From e5e0f18bfd426a9787a2e115b2e617a3116c35aa Mon Sep 17 00:00:00 2001 From: "Emilia(SleepeeSoftware)" Date: Mon, 23 Feb 2026 22:57:43 +0100 Subject: [PATCH] I find it hard to get what i want to do, need to work on damage class ?? --- Common/Players/PlayerCore.cs | 25 +++++++++++++ Content/Items/Accessories/Spacesuit.cs | 20 ++--------- Content/Items/Accessories/Spacesurf.cs | 31 ++++------------ Content/Items/Ammo/VacuumTube.cs | 6 ++++ Content/Items/Mounts/SpaceShuttle.cs | 35 +++++++++++++++++++ Content/Items/Weapon/EmiliasWand.cs | 2 ++ Content/Items/Weapon/SpaceBlaster.cs | 6 ++-- Content/Mounts/SpaceShuttle.cs | 16 +++++++++ Content/Projectiles/EmiliasWandProjectile.cs | 6 ++-- Content/Projectiles/SpaceBlasterProjectile.cs | 6 ++-- Emiliasmod.cs | 15 +++++--- 11 files changed, 116 insertions(+), 52 deletions(-) create mode 100644 Common/Players/PlayerCore.cs create mode 100644 Content/Items/Mounts/SpaceShuttle.cs create mode 100644 Content/Mounts/SpaceShuttle.cs diff --git a/Common/Players/PlayerCore.cs b/Common/Players/PlayerCore.cs new file mode 100644 index 0000000..702aab4 --- /dev/null +++ b/Common/Players/PlayerCore.cs @@ -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(); + } + } +} diff --git a/Content/Items/Accessories/Spacesuit.cs b/Content/Items/Accessories/Spacesuit.cs index 9066715..500418a 100644 --- a/Content/Items/Accessories/Spacesuit.cs +++ b/Content/Items/Accessories/Spacesuit.cs @@ -10,26 +10,10 @@ namespace Emiliasmod.Content.Items.Accessories [Autoload(false)] public class Spacesuit : ModItem { - private int emiliasID; - 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 string Texture => $"Emiliasmod/Assets/Textures/{Name}"; public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 400; + //Item.ResearchUnlockCount = 400; Item.defense = 8; } public override void SetDefaults() { diff --git a/Content/Items/Accessories/Spacesurf.cs b/Content/Items/Accessories/Spacesurf.cs index 467f24f..67ee9a8 100644 --- a/Content/Items/Accessories/Spacesurf.cs +++ b/Content/Items/Accessories/Spacesurf.cs @@ -1,41 +1,31 @@ using Terraria; using Terraria.DataStructures; -using Terraria.GameContent.Creative; using Terraria.ID; using Terraria.ModLoader; namespace Emiliasmod.Content.Items.Accessories { [Autoload(false)] + [AutoloadEquip(EquipType.Wings)] public class Spacesurf : ModItem { - public override string Texture => $"Emiliasmod/Assets/Texture/{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 string Texture => $"Emiliasmod/Assets/Textures/{Name}"; - public override void SetStaticDefaults() { - ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(FlyTime, FlySpeed, Acceleration, CanHover); - } + //public override void SetStaticDefaults() { + // ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 8.5f, 4.5f, true, -1, 4.5f); + //} public override void SetDefaults() { Item.width = 22; Item.height = 20; - Item.value = Item.sellPrice(platinum: 1, gold: 35); + Item.value = Item.sellPrice(1, 35, 0, 0); Item.rare = ItemRarityID.Red; Item.accessory = true; Item.master = true; - Item.wingSlot = Item.type; } public override void UpdateAccessory(Player player, bool hideVisual) { player.empressBrooch = true; - player.moonLordLegs = true; player.moveSpeed += 0.15f; - player.wingsLogic = 45; + player.wingsLogic = 45; // simplest answer } public override void AddRecipes() { @@ -46,12 +36,5 @@ namespace Emiliasmod.Content.Items.Accessories recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1); 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; - } } } diff --git a/Content/Items/Ammo/VacuumTube.cs b/Content/Items/Ammo/VacuumTube.cs index 781b6c3..7c840bd 100644 --- a/Content/Items/Ammo/VacuumTube.cs +++ b/Content/Items/Ammo/VacuumTube.cs @@ -8,6 +8,8 @@ namespace Emiliasmod.Content.Items.Ammo [Autoload(false)] public class VacuumTube : ModItem { + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public override void SetDefaults() { Item.width = 24; Item.height = 24; @@ -33,7 +35,11 @@ namespace Emiliasmod.Content.Items.Ammo recipe.Register(); } } + + [Autoload(false)] public class QuantumVacuumTube : ModItem {//for debug purpose while overheat isn't created + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public override void SetDefaults() { Item.width = 24; Item.height = 24; diff --git a/Content/Items/Mounts/SpaceShuttle.cs b/Content/Items/Mounts/SpaceShuttle.cs new file mode 100644 index 0000000..ac35bef --- /dev/null +++ b/Content/Items/Mounts/SpaceShuttle.cs @@ -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(); + } + } +} diff --git a/Content/Items/Weapon/EmiliasWand.cs b/Content/Items/Weapon/EmiliasWand.cs index 413fbc1..7d1c192 100644 --- a/Content/Items/Weapon/EmiliasWand.cs +++ b/Content/Items/Weapon/EmiliasWand.cs @@ -9,6 +9,8 @@ namespace Emiliasmod.Content.Items.Weapon public class EmiliasWand : ModItem { + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public override void SetStaticDefaults() { ItemID.Sets.IsDrill[Type] = true; } diff --git a/Content/Items/Weapon/SpaceBlaster.cs b/Content/Items/Weapon/SpaceBlaster.cs index a05f97f..65f8e81 100644 --- a/Content/Items/Weapon/SpaceBlaster.cs +++ b/Content/Items/Weapon/SpaceBlaster.cs @@ -3,12 +3,14 @@ using Emiliasmod.Content.Items.Ammo; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Microsoft.Xna.Framework; namespace Emiliasmod.Content.Items.Weapon { [Autoload(false)] - public class SpaceBlaster : ModItem - { + public class SpaceBlaster : ModItem { + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public override void SetDefaults() { Item.DamageType = DamageClass.Ranged; diff --git a/Content/Mounts/SpaceShuttle.cs b/Content/Mounts/SpaceShuttle.cs new file mode 100644 index 0000000..94a378f --- /dev/null +++ b/Content/Mounts/SpaceShuttle.cs @@ -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 { + + } +} diff --git a/Content/Projectiles/EmiliasWandProjectile.cs b/Content/Projectiles/EmiliasWandProjectile.cs index 8fa9216..57f6d61 100644 --- a/Content/Projectiles/EmiliasWandProjectile.cs +++ b/Content/Projectiles/EmiliasWandProjectile.cs @@ -7,8 +7,10 @@ using Terraria.ModLoader; namespace Emiliasmod.Content.Projectiles { [Autoload(false)] - public class EmiliasWandProjectile : ModProjectile - { + public class EmiliasWandProjectile : ModProjectile { + + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public override void SetStaticDefaults() { // Prevents jitter when stepping up and down blocks and half blocks ProjectileID.Sets.HeldProjDoesNotUsePlayerGfxOffY[Type] = true; diff --git a/Content/Projectiles/SpaceBlasterProjectile.cs b/Content/Projectiles/SpaceBlasterProjectile.cs index fc4f762..2eba91a 100644 --- a/Content/Projectiles/SpaceBlasterProjectile.cs +++ b/Content/Projectiles/SpaceBlasterProjectile.cs @@ -11,8 +11,10 @@ using Terraria.ObjectData; namespace Emiliasmod.Content.Projectiles { [Autoload(false)] - public class SpaceBlasterProjectile : ModProjectile - { + public class SpaceBlasterProjectile : ModProjectile { + + public override string Texture => $"Emiliasmod/Assets/Textures/{Name}"; + public int JumpsLeft = 10; private readonly List hitTargets = []; diff --git a/Emiliasmod.cs b/Emiliasmod.cs index 80a33d8..187085d 100644 --- a/Emiliasmod.cs +++ b/Emiliasmod.cs @@ -58,16 +58,23 @@ namespace Emiliasmod public const string AssetPath = $"{nameof(Emiliasmod)}/Assets/"; //public override bool IsLoadingEnabled(Mod tModLoader) => true; //need to load all of the mods here + //Terraria.ModLoader.VanillaDamageClass; public override void Load() { - InternalLoader.Load(this); - //Spacesuit spacesuit = new Spacesuit(Spacesui); - // Manual registration happens here + //InternalLoader.Load(this); + ////Spacesuit spacesuit = new Spacesuit(Spacesui); + //// Manual registration happens here AddContent(); AddContent(); + AddContent(); + AddContent(); + AddContent(); + AddContent(); + AddContent(); + AddContent(); } public override void Unload() { - InternalLoader.Unload(this); + //InternalLoader.Unload(this); // Clear caches, static references, or arrays } }