From 25d4960b38b5b1c6533cef2b9d799e1a6423f353 Mon Sep 17 00:00:00 2001 From: "Emilia(SleepeeSoftware)" Date: Mon, 23 Feb 2026 13:42:18 +0100 Subject: [PATCH] not working build do not launch, need to finish loading all assets and the mod --- Content/Items/Accessories/Spacesuit.cs | 53 +++++++++------- Content/Items/Accessories/Spacesuit.png | Bin 416 -> 0 bytes Content/Items/Accessories/Spacesurf.cs | 28 +++++++-- Content/Items/Accessories/Spacesurf.png | Bin 370 -> 0 bytes Content/Items/Accessories/Spacesurf_Wings.png | Bin 2058 -> 0 bytes Content/Items/Ammo/QuantumVacuumTube.png | Bin 389 -> 0 bytes Content/Items/Ammo/VacuumTube.cs | 24 ++++++- Content/Items/Ammo/VacuumTube.png | Bin 285 -> 0 bytes Content/Items/Weapon/EmiliasWand.cs | 26 ++++---- Content/Items/Weapon/EmiliasWand.png | Bin 773 -> 0 bytes Content/Items/Weapon/SpaceBlaster.cs | 18 ++---- Content/Items/Weapon/SpaceBlaster.png | Bin 599 -> 0 bytes Content/Projectiles/EmiliasWandProjectile.cs | 34 ++++------ Content/Projectiles/EmiliasWandProjectile.png | Bin 355 -> 0 bytes Content/Projectiles/SpaceBlasterProjectile.cs | 32 +++++++--- .../Projectiles/SpaceBlasterProjectile.png | Bin 115 -> 0 bytes Emiliasmod.cs | 59 +++++++++++++++++- 17 files changed, 185 insertions(+), 89 deletions(-) delete mode 100644 Content/Items/Accessories/Spacesuit.png delete mode 100644 Content/Items/Accessories/Spacesurf.png delete mode 100644 Content/Items/Accessories/Spacesurf_Wings.png delete mode 100644 Content/Items/Ammo/QuantumVacuumTube.png delete mode 100644 Content/Items/Ammo/VacuumTube.png delete mode 100644 Content/Items/Weapon/EmiliasWand.png delete mode 100644 Content/Items/Weapon/SpaceBlaster.png delete mode 100644 Content/Projectiles/EmiliasWandProjectile.png delete mode 100644 Content/Projectiles/SpaceBlasterProjectile.png diff --git a/Content/Items/Accessories/Spacesuit.cs b/Content/Items/Accessories/Spacesuit.cs index 07ba70c..9066715 100644 --- a/Content/Items/Accessories/Spacesuit.cs +++ b/Content/Items/Accessories/Spacesuit.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using Terraria.Localization; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -6,13 +7,31 @@ using Terraria.ModLoader; namespace Emiliasmod.Content.Items.Accessories { + [Autoload(false)] public class Spacesuit : ModItem { + private int emiliasID; + private string name; + private string displayName; + private string texturePath; - public static readonly int DefenseBonus = 8; - + 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() { + Item.ResearchUnlockCount = 400; + Item.defense = 8; + } public override void SetDefaults() { Item.width = 40; Item.height = 40; @@ -34,8 +53,7 @@ namespace Emiliasmod.Content.Items.Accessories } public override void UpdateAccessory(Player player, bool hideVisual) { - player.rocketBoots = 2; - player.vanityRocketBoots = 2; + player.rocketBoots = 4; player.waterWalk2 = true; player.waterWalk = true; @@ -45,14 +63,8 @@ namespace Emiliasmod.Content.Items.Accessories player.noFallDmg = true; player.lavaRose = true; player.lavaImmune = true; - - player.statDefense += DefenseBonus; - - //player.arcticDivingGear = true; - player.accMerman = true; - player.wolfAcc = true; - player.accDivingHelm = true; + player.statDefense += Item.defense; player.buffImmune[BuffID.BrokenArmor] = true; player.buffImmune[BuffID.Bleeding] = true; @@ -82,17 +94,16 @@ namespace Emiliasmod.Content.Items.Accessories player.accRunSpeed *= 3.75f; player.runSlowdown *= 1.75f; + player.arcticDivingGear = true;//may it do something ? + player.accMerman = true; + player.wolfAcc = true; + if (!hideVisual) { - player.CancelAllBootRunVisualEffects(); // This ensures that boot visual effects don't overlap if multiple are equipped - - // Hellfire Treads sprint dust. For more info on sprint dusts see Player.SpawnFastRunParticles() method in Player.cs - player.hellfireTreads = true; - // Other boot run visual effects include: sailDash, coldDash, desertDash, fairyBoots - - if (!player.mount.Active || player.mount.Type != MountID.WallOfFleshGoat) { - // Spawns flames when walking, like Flame Waker Boots. We also check the Goat Skull mount so the effects don't overlap. - player.DoBootsEffect(player.DoBootsEffect_PlaceFlamesOnTile); - } + player.vanityRocketBoots = 4; + player.CancelAllBootRunVisualEffects(); + } else { + player.hideWolf = true; + player.hideMerman = true; } } } diff --git a/Content/Items/Accessories/Spacesuit.png b/Content/Items/Accessories/Spacesuit.png deleted file mode 100644 index 256e1ca8fc1c1523723ef668918953c765f70e70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 416 zcmV;R0bl-!P)lGLg_6c^aCVXB*OB=?;_>1nFqz+L?GEY+GO$L#Wiv@c_=LTwq(+X zluk)r6X)cii4pSr&p#uBZc_Kcj!b@!X2Lp=sJd!PlC7EtOr1@W&n>-~1+6^Du>Y@6 zruTj33`K5_K(f58v&7S_!Pf70BKsf_#4Km(@AFNB&nA2!x4DTVG%WV;_0e zBane4I%p2^!fc4`%RIi2mr6OwJ+cPe$gKCsjRfi*k(F%!bdSX=>1Xnxc#Op_Pp)i9 z{6hpe-7^UH1QWnX{`te=q@%_#o9dX-ZY0u)JgeC=^v#Q;5j6lUiiCFvh30br0000< KMNUMnLSTYfv%W?E diff --git a/Content/Items/Accessories/Spacesurf.cs b/Content/Items/Accessories/Spacesurf.cs index a37f5d4..467f24f 100644 --- a/Content/Items/Accessories/Spacesurf.cs +++ b/Content/Items/Accessories/Spacesurf.cs @@ -6,13 +6,21 @@ using Terraria.ModLoader; 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, 9.0f, 4.5f, true, 16.0f, 4.5f); - } + [Autoload(false)] + 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 void SetStaticDefaults() { + ArmorIDs.Wing.Sets.Stats[Item.wingSlot] = new WingStats(FlyTime, FlySpeed, Acceleration, CanHover); + } public override void SetDefaults() { Item.width = 22; Item.height = 20; @@ -20,6 +28,7 @@ namespace Emiliasmod.Content.Items.Accessories Item.rare = ItemRarityID.Red; Item.accessory = true; Item.master = true; + Item.wingSlot = Item.type; } public override void UpdateAccessory(Player player, bool hideVisual) { @@ -37,5 +46,12 @@ 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/Accessories/Spacesurf.png b/Content/Items/Accessories/Spacesurf.png deleted file mode 100644 index 2641ee132a356090ee113ff1f1577e1e5dae63e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 370 zcmV-&0ge8NP)c~0G zB}(_oe{(u>?@aSM=YQ|f*oPGi8K?VvwOnYI_{Sva|I>txZV9c|O?LWj;z%@&2z5i} zal6?*d`}v&_AVJHU&)|+wceq8GFaes*{;43Q#VpkcSgfulxNFTl>7X?>vscQ9_waX zQQ}0-u-r&pde|R$oK5?d`=J8KR180ln@kO2O73*oc~p3c$3XqHYFJSNB^(X7wHQrjw}W z0p0Vk*FZ=spx#~mOrmoRE(H~v1(d@)rXEtC*lrJ5_8e{^(LTB^o%r{31_>g1w`S!K QVE_OC07*qoM6N<$f`8wmJ^%m! diff --git a/Content/Items/Accessories/Spacesurf_Wings.png b/Content/Items/Accessories/Spacesurf_Wings.png deleted file mode 100644 index 2536fe346f873bcd68737aebb1260f7e1434927d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2058 zcmY*ad0dj&8n&9$EZY}TC#&0a43m-uxMrrNre=zXfJ2~;rjFpggkj2UEZcOIbW}r{E``%Kb-wS;)U-~1{Vz%4q#e{u%>j}BY!y!*$<|N@NwcpMQ|I8^ z>5L%>apbDyCW3VauYS!jNIGQq#fjO)*hSGNLHaOheyM|5UfNnTq#x@MvqUck_Ocw& zRV!rGNkv5%&UzxXghNA2iDu(aqY-hNrP7dO;<)BvD4mw^Ncf^-z>eiOuU)V~#vf1m zoXonLNJ&b2B4PHsal@&B@%cNlQV-8#O9!DAR-SW0Fb*F=TKv7o17!mj8lSD<(VMji zghYM1Grwv6lVt{exnFR)z$UU`@$mfnwoSb@*}S(j0+B6Az=t&#DwrNOdZkoI7N3ufHm2LubrMA0Zm;9 ze;vw@vN1K`z-BDohCv5r6tX21k*NYr!5%j98UB-Dr0GHUXL5X%S>D>eNd5n4cZTnq zTp16+IryfqudJ(7%<&+I8%g_1HmL2})!@*n*{_bU>kg!Tk$2do`-((YeZqr#vU@vn zc<#ad_MK7IWC*PuhyD5; zzbki3R%)j5Kr(<_mASUGu-Ca`*m7XrX*FHdh3}o&kT}(l7O+cb-17t1jSsy>b;v;> zp(#Nhgr14D!mdG1g%`k3S~UCAY1UQNy;Y{mH#)RtZo6i?IOGpE&qgZbI|Cx$fq(8N$I_Ob6SyseK(g*0~1 zCNyPo&_&)x;p)GY!gGsSRfS)ZTwC&U`datkx(n6ux~kqbZ_=FnJ)UY{vm&DJ%HzZ? zT+R3$X5*UV6zSKab;>f}$##kT=7h4(nQ>HE$3(^2VTt?~F;K|udFdYdrIDFN&6hz3 zlc!rjj7hbI@-EK9gDAIbIIJ1K2jor?GUqo}~Y z#8>s(z+TuAcQkk65Y5l-f``kaz>L;^#|Xyu$eG)&nPhW@Jiu*!qoF$8>%Kkz%7}>4 zySJ>(Gp|g~7w3;(-7vfI)O{BwAa$ff&l%egI(Y3;#cSPNMRV#rnS$ z#$Px2!EI!6we8-zO6Ti@tp(-v>pHU$++h;h68IJynVPZs=~zq}W;Ni0c<#H-zE|ff z)luV|6xF_;-Ximhy&v@7Z9WTvqYXCIH$Y?4DOM zeTWc3=hz;TW0VwcPSxn0k(7hJmG}NsbZDeYR%572+GONU$Z=o{7I=zM~<(FjoIuzhD9?f5>q+Vs*rdy@a_qJmTj`-U-KRcy@f z#j#`2ufwIm`LyDU<2_bv9;6{QVIM$x<@5g`RsSGrmA)rBUa}lLQbpAmX`tI zKM1=-legeO_K{b0^n|2sCq6`Q!q1FfIw8xCBd4Tn6MVlQo^EgeSV@kAM!b<{#r~*$ zZrxrBMSZNudB;6WN%XmywGoJNpZ6j(az+l43Kxd>>g;Z@a!gxb2w%oO$7(@{v88SC znXtoiv>aQ*0i!AF`E>Wm%TC)PJO7u_dOQ6p31)nIdFt&~h817008h@z@SpzxP_q^O diff --git a/Content/Items/Ammo/QuantumVacuumTube.png b/Content/Items/Ammo/QuantumVacuumTube.png deleted file mode 100644 index 6fbc63ae4f912dd3b4c40ba34788f4460e01b358..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 389 zcmV;00eb$4P)Px$KS@MER7i=fRl#w@APn5~q>MC?5_nz*nMqm*Pp1bzofhJmbZ}2fa1+;u@`&Z* zKp5Bq_%MuW(F6LF^C|D z;385j)0XY&B}#*2B?=;8=?qBMlnD}nj$}1}wu5=Xjdb{=^YK^r zQ|D_2j-(FDZ~(?q%kBZMt-9EYTGHN&SZr6?NENjreFqt|yDm??c_>H!hzh&M{^3Xp jnZK(); Item.ammo = ModContent.ItemType(); } + public override void AddRecipes() + { + Recipe recipe = CreateRecipe(); + recipe.AddIngredient(ItemID.Glass, 15); + recipe.AddIngredient(ItemID.GoldBar, 4); + recipe.AddIngredient(ItemID.TitaniumBar, 4); + recipe.AddIngredient(ItemID.PlatinumCoin, 4); + recipe.AddIngredient(ItemID.LunarBar, 2); + recipe.AddIngredient(ItemID.Nanites, 2); + recipe.AddTile(TileID.HeavyWorkBench); + recipe.Register(); + } } public class QuantumVacuumTube : ModItem {//for debug purpose while overheat isn't created public override void SetDefaults() { @@ -34,5 +46,15 @@ namespace Emiliasmod.Content.Items.Ammo Item.shoot = ModContent.ProjectileType(); Item.ammo = ModContent.ItemType(); } + + public override void AddRecipes() + { + Recipe recipe = CreateRecipe(); + recipe.AddIngredient(ModContent.ItemType(), 100); + recipe.AddIngredient(ItemID.LunarBar, 500); + recipe.AddIngredient(ItemID.Nanites, 1000); + recipe.AddTile(TileID.LunarMonolith); + recipe.Register(); + } } } diff --git a/Content/Items/Ammo/VacuumTube.png b/Content/Items/Ammo/VacuumTube.png deleted file mode 100644 index e110dd35c6fb11575440469534422c71fc211ccc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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 = 32f; // 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.shootSpeed = 32f; + Item.noMelee = true; + Item.noUseGraphic = true; Item.channel = true; } public override void AddRecipes() { Recipe recipe = CreateRecipe(); - recipe.AddIngredient(ItemID.DirtBlock, 10); - recipe.AddTile(TileID.WorkBenches); + recipe.AddIngredient(ItemID.Drax, 1); + recipe.AddIngredient(ItemID.LaserDrill, 1); + recipe.AddIngredient(ItemID.LunarBar, 50); + recipe.AddTile(TileID.LunarMonolith); recipe.Register(); } } diff --git a/Content/Items/Weapon/EmiliasWand.png b/Content/Items/Weapon/EmiliasWand.png deleted file mode 100644 index a14ec18d43aa04badcc905e3c0a28fdd882a1423..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 773 zcmV+g1N!`lP)Px%zez+vR9J=Wm%(cjK@`TnmEu+14Kd=i1~KkZy;)O85$kEG^i(hX0|ddg2kD`R z^iX<8dMNa65bQxpN>5g>LWCY88xkRUEwsUnAbKgnc*(4@v$K=UX0sc_4?@`4Vdls8 z=DoKA{MSD&C82#uP>v)32>`Th+Zjk}nlDQ%fVyD<0P5Dh2ad`Q@?0E%=mE!!^P$Js zFrlb(xrr?57Eo(6rSsdijkKl_*2!2L+$k3U0EY*AI6gV`ohN!Xlrwn$!2$r_-PBnRhGqz-b<5tw$BOxfUnQ)(7m0qqN;|{=~$k%BXy94qyI~bD*%A+oo{&b^9>6}{}oj=25WV+ zo>A4Ueb;zyB8#1JQQ9R|SC^gVwY4GuC`^a(-Mgh;T#a6Bj+xJ>1bj7)=Mao=#dVJhfx=6Hq8 zVh`M0)y7=)?=ufKzpxz2j4)p_Lb$DKzwzYDm=I1kOr`Ou)t7Tr{W>Ux+nv%Pb1sZX zx4$~Se5FMIkbI>@+O|z4SR<$00000NkvXXu0mjf DM@VN^ diff --git a/Content/Items/Weapon/SpaceBlaster.cs b/Content/Items/Weapon/SpaceBlaster.cs index fbbef4c..a05f97f 100644 --- a/Content/Items/Weapon/SpaceBlaster.cs +++ b/Content/Items/Weapon/SpaceBlaster.cs @@ -3,11 +3,10 @@ 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 -{ +{ + [Autoload(false)] public class SpaceBlaster : ModItem { public override void SetDefaults() @@ -17,8 +16,8 @@ namespace Emiliasmod.Content.Items.Weapon Item.width = 64; Item.height = 64; Item.crit = -20; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useTime = 24; + Item.useAnimation = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0; @@ -36,14 +35,9 @@ namespace Emiliasmod.Content.Items.Weapon Recipe recipe = CreateRecipe(); recipe.AddIngredient(ItemID.WaterGun, 1); recipe.AddIngredient(ItemID.BubbleGun, 1); - //recipe.AddIngredient(ItemID, 10); - recipe.AddTile(TileID.WorkBenches); + recipe.AddIngredient(ItemID.LunarBar, 50); + recipe.AddTile(TileID.LunarMonolith); 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 deleted file mode 100644 index 7e9beeb7c3061a5f8214fca43fdf9c0f36981116..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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(-=Px$9Z5t%R7it_7L5f*E-(}vxj;u72>}*d5=TqQAdC~csB0tjooe0FMV`h9HU@Y#4x*GpGmR+i z9DIc`a$$_o&LIU1A&nTVM{EIv9xwyr)KQJJ(1-#QC8Yl=N=X0z`v1lM`wt*^@$y6e zVd4Yp)FGr1Yk{mIX-rTfBf0>t_A7F;nt_3V0RUvFZO{IP-)R5<002ovPDHLkV1it{ BjGzDj diff --git a/Content/Projectiles/SpaceBlasterProjectile.cs b/Content/Projectiles/SpaceBlasterProjectile.cs index df8ea9e..fc4f762 100644 --- a/Content/Projectiles/SpaceBlasterProjectile.cs +++ b/Content/Projectiles/SpaceBlasterProjectile.cs @@ -5,9 +5,12 @@ using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using Terraria.ModLoader.IO; +using Terraria.ObjectData; namespace Emiliasmod.Content.Projectiles { + [Autoload(false)] public class SpaceBlasterProjectile : ModProjectile { public int JumpsLeft = 10; @@ -19,7 +22,7 @@ namespace Emiliasmod.Content.Projectiles Projectile.friendly = true; Projectile.DamageType = DamageClass.Generic; Projectile.extraUpdates = 100; - Projectile.tileCollide = false; + Projectile.tileCollide = true; Projectile.timeLeft = 600; Projectile.CritChance = 0; Projectile.penetrate = -1; @@ -58,14 +61,20 @@ namespace Emiliasmod.Content.Projectiles private NPC FindNextTarget(Vector2 origin, float range) { NPC closest = null; - float closestDist = range; + float closestDistSq = range * range; // Use squared distance to avoid sqrt in loop + for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy() && !hitTargets.Contains(npc.whoAmI)) { - float dist = Vector2.Distance(origin, npc.Center); - if (dist < closestDist) { - closestDist = dist; - closest = npc; + + if (npc.active && npc.CanBeChasedBy() && !hitTargets.Contains(npc.whoAmI)) { + float distSq = Vector2.DistanceSquared(origin, npc.Center); + + if (distSq < closestDistSq) { + // Check collision last (most expensive check) + if (Collision.CanHitLine(origin, 1, 1, npc.position, npc.width, npc.height)) { + closestDistSq = distSq; + closest = npc; + } } } } @@ -75,12 +84,15 @@ namespace Emiliasmod.Content.Projectiles 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); + if (Main.rand.NextBool(10)) { + Dust d1 = Dust.NewDustDirect(pos, 0, 0, DustID.Electric, Main.rand.Next(-3, 4), Main.rand.Next(-3, 4), 0, Color.Cyan, 0.8f); + d1.noGravity = true; + } Dust d2 = Dust.NewDustPerfect(pos, DustID.Electric, Vector2.Zero, 100, Color.Cyan, 0.8f); - d1.noGravity = true; d2.noGravity = true; - Lighting.AddLight(pos, Color.Cyan.ToVector3()); + Lighting.AddLight(pos, Color.Cyan.ToVector3());//may not be usefull } } } diff --git a/Content/Projectiles/SpaceBlasterProjectile.png b/Content/Projectiles/SpaceBlasterProjectile.png deleted file mode 100644 index ea7a1e365e3f9450c88229b721fae1a27b77abec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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>% diff --git a/Emiliasmod.cs b/Emiliasmod.cs index 20c532f..80a33d8 100644 --- a/Emiliasmod.cs +++ b/Emiliasmod.cs @@ -2,16 +2,73 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using Terraria; using Terraria.ModLoader; +using Emiliasmod.Content.Items.Ammo; +using Emiliasmod.Content.Items.Accessories; +using Emiliasmod.Content.Items.Weapon; +using Emiliasmod.Content.Projectiles; +// Please read https://github.com/tModLoader/tModLoader/wiki/Basic-tModLoader-Modding-Guide#mod-skeleton-contents for more information about the various files in a mod. namespace Emiliasmod { - // Please read https://github.com/tModLoader/tModLoader/wiki/Basic-tModLoader-Modding-Guide#mod-skeleton-contents for more information about the various files in a mod. + public static class InternalLoader { + public static void Load(Mod mod) { + var types = mod.Code.GetTypes(); + + foreach (Type type in types) { + // 1. Must be a class and not abstract + // 2. Must implement ILoadable (this covers ModItem, ModNPC, ModSystem, etc.) + // 3. Optional: Check if it has the [Autoload(false)] attribute to confirm it's your target + // !type.IsAbstract is the key here to skip BaseWing itself + if (!type.IsAbstract && typeof(ILoadable).IsAssignableFrom(type)) { + var instance = (ILoadable)Activator.CreateInstance(type); + mod.AddContent(instance); + } + } + } + public static void Unload(Mod mod) { + // Manual cleanup for statics if necessary + // 1. Clear custom lists/dictionaries + // hitTargets.Clear(); + + // 2. Nullify static references to textures/assets + // MyBaseClass.CustomShader = null; + + // 3. Use Reflection to nullify all statics in a specific namespace (Extreme approach) + // Only do this if you have hundreds of static fields and want to be "lazy" but safe. + var types = mod.Code.GetTypes(); + foreach (var type in types) { + // Look for any static fields that are classes (not value types) + var staticFields = type.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); + foreach (var field in staticFields) { + if (!field.FieldType.IsValueType) { + field.SetValue(null, null); + } + } + } + } + } + public class Emiliasmod : Mod { + public const string AssetPath = $"{nameof(Emiliasmod)}/Assets/"; + //public override bool IsLoadingEnabled(Mod tModLoader) => true; //need to load all of the mods here + public override void Load() { + InternalLoader.Load(this); + //Spacesuit spacesuit = new Spacesuit(Spacesui); + // Manual registration happens here + AddContent(); + AddContent(); + } + + public override void Unload() { + InternalLoader.Unload(this); + // Clear caches, static references, or arrays + } } }