diff --git a/Content/Items/Accessories/Spacesurf.cs b/Content/Items/Accessories/Spacesurf.cs index 2f78955..a37f5d4 100644 --- a/Content/Items/Accessories/Spacesurf.cs +++ b/Content/Items/Accessories/Spacesurf.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Creative; using Terraria.ID; using Terraria.ModLoader; @@ -8,24 +9,24 @@ namespace Emiliasmod.Content.Items.Accessories [AutoloadEquip(EquipType.Wings)] public class Spacesurf : ModItem { - //public override void SetStaticDefaults() { - // ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 14f, 4f, true); - //} + public override void SetStaticDefaults() { + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(180, 9.0f, 4.5f, true, 16.0f, 4.5f); + } public override void SetDefaults() { - Item.CloneDefaults(ItemID.LongRainbowTrailWings); - //Item.width = 22; - //Item.height = 20; + Item.width = 22; + Item.height = 20; Item.value = Item.sellPrice(platinum: 1, gold: 35); Item.rare = ItemRarityID.Red; Item.accessory = true; + Item.master = true; } public override void UpdateAccessory(Player player, bool hideVisual) { player.empressBrooch = true; player.moonLordLegs = true; - //player.moveSpeed += 0.15f; - //player.dashType = 1; + player.moveSpeed += 0.15f; + player.wingsLogic = 45; } public override void AddRecipes() { @@ -34,7 +35,6 @@ namespace Emiliasmod.Content.Items.Accessories recipe.AddIngredient(ItemID.EmpressFlightBooster, 1); recipe.AddIngredient(ItemID.MoonLordLegs, 1); recipe.AddIngredient(ItemID.LongRainbowTrailWings, 1); - //recipe.AddIngredient(ItemID.MasterNinjaGear, 1); recipe.Register(); } } diff --git a/Content/Items/Ammo/VacuumTube.cs b/Content/Items/Ammo/VacuumTube.cs new file mode 100644 index 0000000..bb3cf9d --- /dev/null +++ b/Content/Items/Ammo/VacuumTube.cs @@ -0,0 +1,22 @@ +using Emiliasmod.Content.Projectiles; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Emiliasmod.Content.Items.Ammo +{ + public class VacuumTube : ModItem { + public override void SetDefaults() { + Item.width = 24; + Item.height = 24; + Item.maxStack = 24;//need to introduce overheat if i want to make this 9999 + Item.consumable = true; + Item.knockBack = 0f; + Item.crit = 0; + Item.value = Item.sellPrice(0, 15, 5, 0); + Item.rare = ItemRarityID.Red; + Item.shoot = ModContent.ProjectileType(); // The bolt it fires + Item.ammo = Item.type; // This item IS the ammo type + } + } +} diff --git a/Content/Items/Ammo/VacuumTube.png b/Content/Items/Ammo/VacuumTube.png new file mode 100644 index 0000000..e110dd3 Binary files /dev/null and b/Content/Items/Ammo/VacuumTube.png differ diff --git a/Content/Items/EmiliasWand.cs b/Content/Items/Weapon/EmiliasWand.cs similarity index 88% rename from Content/Items/EmiliasWand.cs rename to Content/Items/Weapon/EmiliasWand.cs index 621978c..48f11e2 100644 --- a/Content/Items/EmiliasWand.cs +++ b/Content/Items/Weapon/EmiliasWand.cs @@ -4,7 +4,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Emiliasmod.Content.Items +namespace Emiliasmod.Content.Items.Weapon { // This is a basic item template. // Please see tModLoader's ExampleMod for every other example: @@ -25,7 +25,7 @@ namespace Emiliasmod.Content.Items Item.pick = 300; Item.DamageType = DamageClass.MeleeNoSpeed; Item.tileBoost = 5; - Item.width = 14; + Item.width = 64; Item.height = 64; Item.useTime = 2; Item.useAnimation = 15; @@ -34,9 +34,9 @@ namespace Emiliasmod.Content.Items Item.useStyle = ItemUseStyleID.Shoot; Item.value = Item.buyPrice(platinum: 1); Item.rare = ItemRarityID.Red; - //Item.UseSound = SoundID.Item1; + //Item.UseSound = SoundID.ZombieMoan; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; // Adjusts how far away from the player to hold the projectile + Item.shootSpeed = 24f; // Adjusts how far away from the player to hold the projectile Item.noMelee = true; // Turns off damage from the item itself, as we have a projectile Item.noUseGraphic = true; // Stops the item from drawing in your hands, for the aforementioned reason Item.channel = true; diff --git a/Content/Items/EmiliasWand.png b/Content/Items/Weapon/EmiliasWand.png similarity index 100% rename from Content/Items/EmiliasWand.png rename to Content/Items/Weapon/EmiliasWand.png diff --git a/Content/Items/Weapon/SpaceBlaster.cs b/Content/Items/Weapon/SpaceBlaster.cs new file mode 100644 index 0000000..df7aedd --- /dev/null +++ b/Content/Items/Weapon/SpaceBlaster.cs @@ -0,0 +1,49 @@ +using Emiliasmod.Content.Projectiles; +using Emiliasmod.Content.Items.Ammo; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; + +namespace Emiliasmod.Content.Items.Weapon +{ + public class SpaceBlaster : ModItem + { + public override void SetDefaults() + { + Item.DamageType = DamageClass.Ranged; + Item.damage = 1500; + Item.width = 64; + Item.height = 64; + Item.crit = -20; + Item.useTime = 20; + Item.useAnimation = 20; + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.knockBack = 0; + Item.value = Item.sellPrice(0, 50, 0, 0); + Item.rare = ItemRarityID.Purple; + Item.UseSound = SoundID.Item92; + Item.autoReuse = false; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 16f; + Item.useAmmo = ModContent.ItemType(); + } + + public override void AddRecipes() + { + Recipe recipe = CreateRecipe(); + recipe.AddIngredient(ItemID.WaterGun, 1); + recipe.AddIngredient(ItemID.BubbleGun, 1); + //recipe.AddIngredient(ItemID, 10); + recipe.AddTile(TileID.WorkBenches); + recipe.Register(); + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + base.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI); + } + } +} diff --git a/Content/Items/Weapon/SpaceBlaster.png b/Content/Items/Weapon/SpaceBlaster.png new file mode 100644 index 0000000..7e9beeb Binary files /dev/null and b/Content/Items/Weapon/SpaceBlaster.png differ diff --git a/Content/Projectiles/EmiliasWandProjectile.cs b/Content/Projectiles/EmiliasWandProjectile.cs index eb68dfe..76e3f25 100644 --- a/Content/Projectiles/EmiliasWandProjectile.cs +++ b/Content/Projectiles/EmiliasWandProjectile.cs @@ -14,7 +14,7 @@ namespace Emiliasmod.Content.Projectiles } public override void SetDefaults() { - Projectile.width = 14; + Projectile.width = 64; Projectile.height = 64; Projectile.friendly = true; Projectile.tileCollide = false; @@ -35,10 +35,10 @@ namespace Emiliasmod.Content.Projectiles // Animation code could go here if the projectile was animated. // Plays a sound every 20 ticks. In aiStyle 20, soundDelay is set to 30 ticks. - if (Projectile.soundDelay <= 0) { - SoundEngine.PlaySound(SoundID.Item22, Projectile.Center); - Projectile.soundDelay = 20; - } + //if (Projectile.soundDelay <= 0) { + //SoundEngine.PlaySound(SoundID.Item22, Projectile.Center); + //Projectile.soundDelay = 20; + //} Vector2 playerCenter = player.RotatedRelativePoint(player.MountedCenter); if (Main.myPlayer == Projectile.owner) { diff --git a/Content/Projectiles/EmiliasWandProjectile.png b/Content/Projectiles/EmiliasWandProjectile.png index 9a5c3ae..4013782 100644 Binary files a/Content/Projectiles/EmiliasWandProjectile.png and b/Content/Projectiles/EmiliasWandProjectile.png differ diff --git a/Content/Projectiles/SpaceBlasterProjectile.cs b/Content/Projectiles/SpaceBlasterProjectile.cs new file mode 100644 index 0000000..bad4229 --- /dev/null +++ b/Content/Projectiles/SpaceBlasterProjectile.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Emiliasmod.Content.Projectiles +{ + public class SpaceBlasterProjectile : ModProjectile + { + public int JumpsLeft = 10; + private readonly List hitTargets = []; + + public override void SetDefaults() { + Projectile.width = 4; + Projectile.height = 4; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Generic; + Projectile.extraUpdates = 100; + Projectile.tileCollide = false; + Projectile.timeLeft = 600; + Projectile.CritChance = 0; + Projectile.penetrate = -1; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { + if (JumpsLeft <= 0) { + Projectile.Kill(); + hitTargets.Clear(); + return; + } + + hitTargets.Add(target.whoAmI); + JumpsLeft--; + + NPC nextTarget = FindNextTarget(target.Center, 400f); // 25 tile radius + if (nextTarget != null) { + // Visual: Draw a line of dust between targets + DrawLightning(target.Center, nextTarget.Center); + + // Snap projectile to next target + Projectile.Center = target.Center; + Projectile.velocity = (nextTarget.Center - target.Center).SafeNormalize(Vector2.Zero) * 16f; + } else { + Projectile.Kill(); + hitTargets.Clear(); + } + } + + private NPC FindNextTarget(Vector2 origin, float range) { + NPC closest = null; + float closestDist = range; + for (int i = 0; i < Main.maxNPCs; i++) { + NPC npc = Main.npc[i]; + if ((npc.CanBeChasedBy() || npc.netID == NPCID.TargetDummy) && !hitTargets.Contains(npc.whoAmI)) { + float dist = Vector2.Distance(origin, npc.Center); + if (dist < closestDist) { + closestDist = dist; + closest = npc; + } + } + } + return closest; + } + + private static void DrawLightning(Vector2 start, Vector2 end) { + int count = (int)(Vector2.Distance(start, end) / 8f); + for (int i = 0; i < count; i++) { + Vector2 pos = Vector2.Lerp(start, end, i / (float)count); + Dust d1 = Dust.NewDustDirect(pos, 0, 0, DustID.Electric, Main.rand.Next(-3, 4), Main.rand.Next(-3, 4), 0, Color.Cyan, 0.8f); + Dust d2 = Dust.NewDustPerfect(pos, DustID.Electric, Vector2.Zero, 100, Color.Cyan, 0.8f); + d1.noGravity = true; + d2.noGravity = true; + } + } + } +} diff --git a/Content/Projectiles/SpaceBlasterProjectile.png b/Content/Projectiles/SpaceBlasterProjectile.png new file mode 100644 index 0000000..ea7a1e3 Binary files /dev/null and b/Content/Projectiles/SpaceBlasterProjectile.png differ diff --git a/Localization/en-US_Mods.Emiliasmod.hjson b/Localization/en-US_Mods.Emiliasmod.hjson index f77f254..e7958c1 100644 --- a/Localization/en-US_Mods.Emiliasmod.hjson +++ b/Localization/en-US_Mods.Emiliasmod.hjson @@ -3,18 +3,43 @@ Items: { EmiliasWand: { DisplayName: Emilias Wand - Tooltip: Is it a Drill ? is it a Sword ? It's an Hitachi Magic Wand !! (never used ?) + Tooltip: + ''' + What is this ? + 'Where did you find this ?!(never used ?)' + ''' } Spacesuit: { DisplayName: Spacesuit - Tooltip: Are you ready for Space ? + Tooltip: + ''' + PowerFull Suit !! + 'Are you ready for Space ?' + ''' } Spacesurf: { DisplayName: Spacesurf - Tooltip: Surfing through the void + Tooltip: + ''' + A nice Device ! + 'Surfing with the aliens !!' + ''' + } + + SpaceBlaster: { + DisplayName: Space Blaster + Tooltip: "" + } + + VacuumTube: { + DisplayName: Vacuum Tube + Tooltip: "" } } -Projectiles.EmiliasWandProjectile.DisplayName: Emilias Wand Projectile +Projectiles: { + EmiliasWandProjectile.DisplayName: Emilias Wand Projectile + SpaceBlasterProjectile.DisplayName: Space Blaster Projectile +} diff --git a/README.md b/README.md index ae522d1..b74b389 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,37 @@ # Emilia's Mod -___ - ### 1. Environment: Space & Subworlds - - Subworld Library: Integrate this to handle the "Space" dimension without hitting the 163,840-tile height limit of the main world. - - Physics Overrides: Create a ModSceneEffect or Subworld hook to set gravity = 0f and windSpeed = 0f. - - Oxygen Logic: A ModPlayer timer that drains health if HasSpaceSuit == false while in the Space subworld. -___ - ### 2. Ship Construction & The Launch Pad - - The Anchor (Launch Pad): A ModTile that acts as the origin point (0,0) for your ship scan. - - Integrity Scan: A method to check a 50×50 (or larger) area for "Hull" tiles (Luminite bricks, etc.) and at least one "Engine" tile. - - Serialization: A CaptureShip() function that saves the TileType, WallType, and TileEntity data of the ship into a TagCompound. - - Launch Animation: * Spawn a large Projectile with the ship’s sprite. - Set ship tiles in the world to type = 0 (Air). - Apply upward velocity to the projectile and trigger the subworld transfer once it hits the "top" of the screen. -___ - ### 3. Pilot Mode (Top-Down Combat) - - The Controller: A ModTile (Pilot Seat) that toggles IsPiloting = true. - - Physics Hack: * In PreUpdateMovement, set Player.gravity = 0. - - Apply Player.velocity *= 0.95f for linear drag. - - Map WASD to 2D vector movement (Top-down style). - - Visual Masking: Use PlayerDrawLayer to hide the player sprite and draw the Ship sprite rotated toward Main.MouseWorld. - - Ship Systems: Implement a "Shield" variable in ModPlayer that recharges over time and absorbs damage before the player takes hits. ### 4. Automation & Logistics - - The Registry: A List or List in a ModSystem to track active machines (extractors, assemblers). - - Heartbeat Loop: Run automation logic in PostUpdateWorld every 10–20 ticks to save CPU. - - Push/Pull Logic: Instead of complex pipes, use a "Transferer" tile that checks for an IItemStorage (Chest or TileEntity) in the 4 cardinal directions and moves 1 item per tick. - - Resource Nodes: Create "Asteroid" tiles in the subworld that can only be harvested by an automated LaserDrill TileEntity. ### 5. Progression Flow (Post-Moon Lord) - - Crafting: Combine Luminite and Moon Lord drops to create the Launch Pad and Ship Engines. - - Assembly: Build the ship on the pad in the Main World. - - Exploration: Launch to the Orbit Subworld to mine "Exotic Matter" from asteroids. - - Automation: Use Exotic Matter to build the Star-Chart (Remote Teleporter) and auto-farms. - - Expansion: Use the ship's Top-Down mode to fight "Star-Beast" bosses in Deep Space. ### 6. Other Point @@ -72,3 +44,29 @@ ___ - Alien Surf (Sigil + Celestial Starboard) - Space Combat (Top Down Ship Control). - Drill Containment Unit need to be integrated as it come very nicely into the mods as a post moonlord mount + +Item: { + EmiliasWand: { + DisplayName: Emilias Wand + Tooltip: What is this ? + ``` + "Where did you find this ?!(never used ?)" + ``` + } + + Spacesuit: { + DisplayName: Spacesuit + Tooltip: PowerFull Suit !! + ``` + "Are you ready for Space ?" + ``` + } + + Spacesurf: { + DisplayName: Spacesurf + Tooltip: A nice Device ! + ``` + "Surfing with the aliens !!" + ``` + } +}