I find it hard to get what i want to do, need to work on damage class ??

This commit is contained in:
Emilia(SleepeeSoftware) 2026-02-23 22:57:43 +01:00
parent 25d4960b38
commit e5e0f18bfd
11 changed files with 116 additions and 52 deletions

View File

@ -0,0 +1,25 @@
using Emiliasmod.Common.Players;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Emiliasmod.Common.Players
{
[Autoload(false)]
public class PlayerCore : ModPlayer
{
public override void ResetEffects() {
//Player.WingMovement();
}
public override void PreUpdate()
{
base.PreUpdate();
}
public override void PostUpdate()
{
base.PostUpdate();
}
}
}

View File

@ -10,26 +10,10 @@ namespace Emiliasmod.Content.Items.Accessories
[Autoload(false)] [Autoload(false)]
public class Spacesuit : ModItem public class Spacesuit : ModItem
{ {
private int emiliasID; public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
private string name;
private string displayName;
private string texturePath;
protected override bool CloneNewInstances => true;
public override string Texture => texturePath;
public override LocalizedText Tooltip => LocalizedText.Empty;
//public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs();
public override string Name => name;
public Spacesuit(string _name, int _emiliasID, string _displayName, string _texturePath) {
this.name = _name;
this.emiliasID = _emiliasID;
this.displayName = _displayName;
this.texturePath = _texturePath;
}
public override void SetStaticDefaults() { public override void SetStaticDefaults() {
Item.ResearchUnlockCount = 400; //Item.ResearchUnlockCount = 400;
Item.defense = 8; Item.defense = 8;
} }
public override void SetDefaults() { public override void SetDefaults() {

View File

@ -1,41 +1,31 @@
using Terraria; using Terraria;
using Terraria.DataStructures; using Terraria.DataStructures;
using Terraria.GameContent.Creative;
using Terraria.ID; using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
namespace Emiliasmod.Content.Items.Accessories namespace Emiliasmod.Content.Items.Accessories
{ {
[Autoload(false)] [Autoload(false)]
[AutoloadEquip(EquipType.Wings)]
public class Spacesurf : ModItem { public class Spacesurf : ModItem {
public override string Texture => $"Emiliasmod/Assets/Texture/{Name}"; public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
//public abstract int FlyTime { get; }
//public abstract float FlySpeed { get; }
//public abstract float Acceleration { get; }
//public abstract bool CanHover { get; }
public int FlyTime = 180;
public float FlySpeed = 9.0f;
public float Acceleration = 4.5f;
public bool CanHover = true;
public override void SetStaticDefaults() { //public override void SetStaticDefaults() {
ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(FlyTime, FlySpeed, Acceleration, CanHover); // ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 8.5f, 4.5f, true, -1, 4.5f);
} //}
public override void SetDefaults() { public override void SetDefaults() {
Item.width = 22; Item.width = 22;
Item.height = 20; Item.height = 20;
Item.value = Item.sellPrice(platinum: 1, gold: 35); Item.value = Item.sellPrice(1, 35, 0, 0);
Item.rare = ItemRarityID.Red; Item.rare = ItemRarityID.Red;
Item.accessory = true; Item.accessory = true;
Item.master = true; Item.master = true;
Item.wingSlot = Item.type;
} }
public override void UpdateAccessory(Player player, bool hideVisual) { public override void UpdateAccessory(Player player, bool hideVisual) {
player.empressBrooch = true; player.empressBrooch = true;
player.moonLordLegs = true;
player.moveSpeed += 0.15f; player.moveSpeed += 0.15f;
player.wingsLogic = 45; player.wingsLogic = 45; // simplest answer
} }
public override void AddRecipes() { public override void AddRecipes() {
@ -46,12 +36,5 @@ namespace Emiliasmod.Content.Items.Accessories
recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1); recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1);
recipe.Register(); recipe.Register();
} }
public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentSpeed, ref float ascentRunSpeed) {
ascentWhenFalling = 0.85f;
ascentWhenRising = 0.15f;
maxCanAscendMultiplier = 1f;
maxAscentSpeed = 3f;
ascentRunSpeed = 2.5f;
}
} }
} }

View File

@ -8,6 +8,8 @@ namespace Emiliasmod.Content.Items.Ammo
[Autoload(false)] [Autoload(false)]
public class VacuumTube : ModItem { public class VacuumTube : ModItem {
public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public override void SetDefaults() { public override void SetDefaults() {
Item.width = 24; Item.width = 24;
Item.height = 24; Item.height = 24;
@ -33,7 +35,11 @@ namespace Emiliasmod.Content.Items.Ammo
recipe.Register(); recipe.Register();
} }
} }
[Autoload(false)]
public class QuantumVacuumTube : ModItem {//for debug purpose while overheat isn't created public class QuantumVacuumTube : ModItem {//for debug purpose while overheat isn't created
public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public override void SetDefaults() { public override void SetDefaults() {
Item.width = 24; Item.width = 24;
Item.height = 24; Item.height = 24;

View File

@ -0,0 +1,35 @@
using Emiliasmod.Content.Mounts;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Emiliasmod.Content.Items.Mounts
{
[Autoload(false)]
public class SpaceShuttleItem : ModItem
{
public override void SetDefaults() {
Item.width = 20;
Item.height = 30;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Swing; // how the player's arm moves when using the item
Item.value = Item.sellPrice(1, 25, 24, 0);
Item.rare = ItemRarityID.Red;
Item.UseSound = SoundID.Item79; // What sound should play when using the item
Item.noMelee = true; // this item doesn't do any melee damage
Item.mountType = MountID.WitchBroom;
//ModContent.MountType<>();
}
// Please see Content/ExampleRecipes.cs for a detailed explanation of recipe creation.
public override void AddRecipes() {
Recipe recipe = CreateRecipe();
recipe.AddCondition(Condition.DownedMoonLord);
recipe.AddIngredient(ItemID.EmpressFlightBooster, 1);
recipe.AddIngredient(ItemID.MoonLordLegs, 1);
recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1);
recipe.Register();
}
}
}

View File

@ -9,6 +9,8 @@ namespace Emiliasmod.Content.Items.Weapon
public class EmiliasWand : ModItem public class EmiliasWand : ModItem
{ {
public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public override void SetStaticDefaults() { public override void SetStaticDefaults() {
ItemID.Sets.IsDrill[Type] = true; ItemID.Sets.IsDrill[Type] = true;
} }

View File

@ -3,12 +3,14 @@ using Emiliasmod.Content.Items.Ammo;
using Terraria; using Terraria;
using Terraria.ID; using Terraria.ID;
using Terraria.ModLoader; using Terraria.ModLoader;
using Microsoft.Xna.Framework;
namespace Emiliasmod.Content.Items.Weapon namespace Emiliasmod.Content.Items.Weapon
{ {
[Autoload(false)] [Autoload(false)]
public class SpaceBlaster : ModItem public class SpaceBlaster : ModItem {
{ public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public override void SetDefaults() public override void SetDefaults()
{ {
Item.DamageType = DamageClass.Ranged; Item.DamageType = DamageClass.Ranged;

View File

@ -0,0 +1,16 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using System;
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
namespace Emiliasmod.Content.Mounts {
[Autoload(false)]
public class SpaceShuttle : ModMount {
}
}

View File

@ -7,8 +7,10 @@ using Terraria.ModLoader;
namespace Emiliasmod.Content.Projectiles namespace Emiliasmod.Content.Projectiles
{ {
[Autoload(false)] [Autoload(false)]
public class EmiliasWandProjectile : ModProjectile public class EmiliasWandProjectile : ModProjectile {
{
public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public override void SetStaticDefaults() { public override void SetStaticDefaults() {
// Prevents jitter when stepping up and down blocks and half blocks // Prevents jitter when stepping up and down blocks and half blocks
ProjectileID.Sets.HeldProjDoesNotUsePlayerGfxOffY[Type] = true; ProjectileID.Sets.HeldProjDoesNotUsePlayerGfxOffY[Type] = true;

View File

@ -11,8 +11,10 @@ using Terraria.ObjectData;
namespace Emiliasmod.Content.Projectiles namespace Emiliasmod.Content.Projectiles
{ {
[Autoload(false)] [Autoload(false)]
public class SpaceBlasterProjectile : ModProjectile public class SpaceBlasterProjectile : ModProjectile {
{
public override string Texture => $"Emiliasmod/Assets/Textures/{Name}";
public int JumpsLeft = 10; public int JumpsLeft = 10;
private readonly List<int> hitTargets = []; private readonly List<int> hitTargets = [];

View File

@ -58,16 +58,23 @@ namespace Emiliasmod
public const string AssetPath = $"{nameof(Emiliasmod)}/Assets/"; public const string AssetPath = $"{nameof(Emiliasmod)}/Assets/";
//public override bool IsLoadingEnabled(Mod tModLoader) => true; //public override bool IsLoadingEnabled(Mod tModLoader) => true;
//need to load all of the mods here //need to load all of the mods here
//Terraria.ModLoader.VanillaDamageClass;
public override void Load() { public override void Load() {
InternalLoader.Load(this); //InternalLoader.Load(this);
//Spacesuit spacesuit = new Spacesuit(Spacesui); ////Spacesuit spacesuit = new Spacesuit(Spacesui);
// Manual registration happens here //// Manual registration happens here
AddContent<VacuumTube>(); AddContent<VacuumTube>();
AddContent<QuantumVacuumTube>(); AddContent<QuantumVacuumTube>();
AddContent<SpaceBlaster>();
AddContent<SpaceBlasterProjectile>();
AddContent<Spacesuit>();
AddContent<Spacesurf>();
AddContent<EmiliasWand>();
AddContent<EmiliasWandProjectile>();
} }
public override void Unload() { public override void Unload() {
InternalLoader.Unload(this); //InternalLoader.Unload(this);
// Clear caches, static references, or arrays // Clear caches, static references, or arrays
} }
} }