From 3151533be564797d2bbd3eb09b2234a6706bc6a6 Mon Sep 17 00:00:00 2001 From: "Emilia(SleepeeSoftware)" Date: Sun, 22 Feb 2026 15:11:35 +0100 Subject: [PATCH] Updated Space Blaster (Aka Wunderwaffe) --- Content/Items/Accessories/Spacesurf.cs | 18 ++-- Content/Items/Ammo/VacuumTube.cs | 22 +++++ Content/Items/Ammo/VacuumTube.png | Bin 0 -> 285 bytes Content/Items/{ => Weapon}/EmiliasWand.cs | 8 +- Content/Items/{ => Weapon}/EmiliasWand.png | Bin Content/Items/Weapon/SpaceBlaster.cs | 49 +++++++++++ Content/Items/Weapon/SpaceBlaster.png | Bin 0 -> 599 bytes Content/Projectiles/EmiliasWandProjectile.cs | 10 +-- Content/Projectiles/EmiliasWandProjectile.png | Bin 356 -> 492 bytes Content/Projectiles/SpaceBlasterProjectile.cs | 79 ++++++++++++++++++ .../Projectiles/SpaceBlasterProjectile.png | Bin 0 -> 115 bytes Localization/en-US_Mods.Emiliasmod.hjson | 33 +++++++- README.md | 54 ++++++------ 13 files changed, 223 insertions(+), 50 deletions(-) create mode 100644 Content/Items/Ammo/VacuumTube.cs create mode 100644 Content/Items/Ammo/VacuumTube.png rename Content/Items/{ => Weapon}/EmiliasWand.cs (88%) rename Content/Items/{ => Weapon}/EmiliasWand.png (100%) create mode 100644 Content/Items/Weapon/SpaceBlaster.cs create mode 100644 Content/Items/Weapon/SpaceBlaster.png create mode 100644 Content/Projectiles/SpaceBlasterProjectile.cs create mode 100644 Content/Projectiles/SpaceBlasterProjectile.png 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 0000000000000000000000000000000000000000..e110dd35c6fb11575440469534422c71fc211ccc GIT binary patch literal 285 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjjKx9jP7LeL$-D$|u6w#ThIn)) zryO89B_UBHDIp=TOF}{|aq{tn>inzHjW$^bZ)BUmEwOP2%h9g}(;qUw$eLK|SS)|x z4wG1tsFa)Wi3Qzr<4=8PnP9i5rr~Ts%_Eg)2Ih(0lBXtQCLMUtk)o;0Rv2`|bJKy{ z(+}=Q;B>axl^Ep4^N7`3;?dq}$sWy34M7eDGwrO8fB5vLlC3R0ibuaw(4DIrGa;xh(); - 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 0000000000000000000000000000000000000000..7e9beeb7c3061a5f8214fca43fdf9c0f36981116 GIT binary patch literal 599 zcmV-d0;v6oP)Px%5lKWrRCt{2*S%`nP!tF7bBjTc(4mi+ z;4P;taS~&bn4&!Api+Q~U*GA{`0uV+bMYEs9kr1Sl8a#XHiFQNW8(YpuyZNpwd!(QV2EKL3u)@1n^Afx`^ zcTYYgN(-=lFmPb=7}6{pN05*>=WFn^br=zP|i3yZJfW0z_HvjyDoSG*{oNWXOIWDt z7!bDDFzf<`PvoSw?*{yrpC4U*yPCt*`gT9EyEe5>EVZavPjv*eM z$tey@T|$@sOMYnhtv}D`(2W8%Mc)^*Brlr2wJsEMeK_&)b_o!8#ibl*Vyvj`bp6PI z0|ye4R~`dW2QFOMFXK8#Fzxo#=joDhwnyH&l*|sy5t*$1#$CeUV#j&6JyIvPO%!q1 z=H`~9Jg>@3sW@TV>#t{A14~w_%xq-TU3&*Z=+h=>K1Kfjt#J7ydW+ z*jV~XL32W>N-t+tii`Mxt30lGVa5gq1`G_1XLHYgI2!u{7;Frlu6{1-oD!M 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 0000000000000000000000000000000000000000..ea7a1e365e3f9450c88229b721fae1a27b77abec GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1|(O0oL2{=7>k44ofy`glX(f`=z6+1hH%Wx zJ-v|efC3N0hK6IsC;z>Zk7?4|cZ2g0vs2iKCb3P=%n!u5fB&Q}9=u9GFI(=n1yCb{ Mr>mdKI;Vst0OJHCK>z>% literal 0 HcmV?d00001 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 !!" + ``` + } +}