From ec42e38dae552f851a54076ced6111afb0178882 Mon Sep 17 00:00:00 2001 From: "Emilia(SleepeeSoftware)" Date: Sat, 21 Feb 2026 16:38:15 +0100 Subject: [PATCH] need to fix the dash speed bug with spacesuit and spacesurf --- Assets/Textures/EmiliasWand.png | Bin 0 -> 773 bytes Assets/Textures/EmiliasWandFull.png | Bin 0 -> 413 bytes Assets/Textures/EmiliasWandHorizontal.png | Bin 0 -> 350 bytes Assets/Textures/EmiliasWandNoCable.png | Bin 0 -> 763 bytes Assets/Textures/EmiliasWandProjectile.png | Bin 0 -> 207 bytes Content/Items/Accessories/Spacesuit.cs | 27 ++--- Content/Items/Accessories/Spacesurf.cs | 24 ++--- Content/Items/EmiliasWand.cs | 29 ++++-- Content/Items/EmiliasWand.png | Bin 720 -> 773 bytes Content/Projectiles/EmiliasWandProjectile.cs | 92 ++++++++++++++++++ Content/Projectiles/EmiliasWandProjectile.png | Bin 0 -> 356 bytes Localization/en-US_Mods.Emiliasmod.hjson | 4 +- 12 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 Assets/Textures/EmiliasWand.png create mode 100644 Assets/Textures/EmiliasWandFull.png create mode 100644 Assets/Textures/EmiliasWandHorizontal.png create mode 100644 Assets/Textures/EmiliasWandNoCable.png create mode 100644 Assets/Textures/EmiliasWandProjectile.png create mode 100644 Content/Projectiles/EmiliasWandProjectile.cs create mode 100644 Content/Projectiles/EmiliasWandProjectile.png diff --git a/Assets/Textures/EmiliasWand.png b/Assets/Textures/EmiliasWand.png new file mode 100644 index 0000000000000000000000000000000000000000..a14ec18d43aa04badcc905e3c0a28fdd882a1423 GIT binary patch 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^ literal 0 HcmV?d00001 diff --git a/Assets/Textures/EmiliasWandFull.png b/Assets/Textures/EmiliasWandFull.png new file mode 100644 index 0000000000000000000000000000000000000000..f6acfe91a06369cfe8d32a7efb88e410dd3a9242 GIT binary patch literal 413 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%z!#!ObLn`LH zy}r?p$x!C_$9XS}C3u<>3ys>2us-(P$GTa60cT-Jfr-i|rZan*n}yxPgq-KZa4=8& zAY`%in)muG*B|%2_-=f+HT(Df|La3U2oAa(P`khN(7=NP)ozJD~;HPSip@?zzOUs*n@FWy-pFzJSQMs&{Jj+qzFhaT5& z`0CVg`0@N%X9_=GH7b0^FyB1Vb@RearZd0mPky;xV9Dx}wK;mP*VtdVzWHA1hlxvCKi=AX`TO+0?zOfax37vM76#ltRqfPw->%r+N8isYI%C4N))_X_&Ef-Z);;~3 zYySOV`|^v|I8XDe?3nO=@7q-Cde)eS8rvqk;yb!^^=4bo+aCiyS}Nag`gGGWmD7@I z_SRR;0XdAN@~zHH8+tqc=_lNFEN!23eCusSnBV{H$={w(9=OQt^d*pxr>mdKI;Vst E0K=NSTmS$7 literal 0 HcmV?d00001 diff --git a/Assets/Textures/EmiliasWandHorizontal.png b/Assets/Textures/EmiliasWandHorizontal.png new file mode 100644 index 0000000000000000000000000000000000000000..1a63656d5d7e96cd6db9ee745b03c88dfa7e2d36 GIT binary patch literal 350 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D%zB|KdmLn`LH zy}mz-$x!CN$B0h?Q~hG+EaA`-%YXGmTcn1g_0q+Ki)F5e7krbQqgyH{GiO&vvqo)a z*(*hpXYW3R?|h$rs_>5f&%cwDI|YEILx5=DXTdN3zP&r{9y9fAVgA(SEwTHZj#^!J=7Tw@tRVRK^y1vhID3(zIf$y2G^iF4< zw&`8H58v!g^FG+*k!n-=FTeR*dE>@Hg=jgHTiXZQBMD%YvqkM l+#kMR4cNKtG~D?PsehQ}^|{{I)cqVR=IQF^vd$@?2>``hn*;y= literal 0 HcmV?d00001 diff --git a/Assets/Textures/EmiliasWandNoCable.png b/Assets/Textures/EmiliasWandNoCable.png new file mode 100644 index 0000000000000000000000000000000000000000..e9bc94f3cf3bb696dba1da33c6cfbd89b19bf568 GIT binary patch literal 763 zcmVPx%wMj%lR9J=Wm%(cjK@`TnmEcv~4Kd=i1~F!--mEF4i1oBoda9TH0fJ!LgY-~D zdMG_4JrsI32<@Sil%A|$g$O-HHf)6Gwa^APg6O3P<0Z51Ze}L4$?h5(u5 zf9X9+gbhWV%Z_JIH-Vbf5RPxzHd2~Kcuq#<;7+*+0603_$I0m#cbupXVeY|)kLCdY z@7|XEU8Jx+AIJ}0fHs;;!#rf{Bt9dyId_u|4b0N{K38=m~!b;HrO zqN@5}rHx8A9VrJ zs7$7l9YAmY<>Vz)-@g&Up%W}MtKkWToNh=v#|5O?eqCa=%fi7Iss1e^tDsRF7%rz9 z3Igmozk)<@7u;;s#%%TPw;yh9ere!BAbXl&!foF8jb~pHOt_qGDAuQD-_B9VI4FeM zo75t4PFAE-U!5mkX%YY=Uulw-ZIhbSAT_H&4+un6b*QQy8i2?_rgI-3XOOQnnaF0Ah;+ctR$R^4HNE1`xg*m^im~w?){7X#**T`iD3wq t)UN~!PG(8tl9OhJ5e_s+hGoC8^ap_SY{i9k_61zl`e~!L-{`pQlU4*&cc8QZhR*M`W`48+QqZiyi0P_DG%FHc`Z3 zo10sb^1LcDrQ(EbufLvg4J=uyGP99UckLzn0){U^TC-By6SaVjV(@hJb6Mw<&;$Ud Cg-*x- literal 0 HcmV?d00001 diff --git a/Content/Items/Accessories/Spacesuit.cs b/Content/Items/Accessories/Spacesuit.cs index 9d2372d..29978d6 100644 --- a/Content/Items/Accessories/Spacesuit.cs +++ b/Content/Items/Accessories/Spacesuit.cs @@ -1,3 +1,4 @@ +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,8 +34,8 @@ namespace Emiliasmod.Content.Items.Accessories } public override void UpdateAccessory(Player player, bool hideVisual) { - player.rocketBoots = 4; - player.vanityRocketBoots = 4; + player.rocketBoots = 2; + player.vanityRocketBoots = 2; player.waterWalk2 = true; player.waterWalk = true; @@ -43,13 +44,16 @@ namespace Emiliasmod.Content.Items.Accessories player.fireWalk = true; player.noFallDmg = true; player.lavaRose = true; - player.lavaMax += 20 * 60; + //player.lavaMax += 20 * 60; player.statDefense += DefenseBonus; player.arcticDivingGear = true; - //player.wereWolf = true; player.accMerman = true; + if (Main.dayTime == false) + { + player.wereWolf = true; + } player.buffImmune[BuffID.BrokenArmor] = true; player.buffImmune[BuffID.Bleeding] = true; @@ -68,16 +72,14 @@ namespace Emiliasmod.Content.Items.Accessories player.lifeRegen += 4; player.PotionDelayModifier -= 0.25f; - player.GetDamage(DamageClass.Generic) += 10f; - player.GetAttackSpeed(DamageClass.Generic) += 10f; + player.GetDamage(DamageClass.Generic) += 0.10f; + player.GetAttackSpeed(DamageClass.Generic) += 0.10f; player.GetCritChance(DamageClass.Generic) += 4f; player.GetKnockback(DamageClass.Summon) += 0.5f; player.blockRange += 1; player.pickSpeed -= 0.15f; - //player.accRunSpeed = 6.75f; - //player.runAcceleration = 1.25f; - player.moveSpeed += 0.25f; + player.moveSpeed += 0.08f; if (!hideVisual) { player.CancelAllBootRunVisualEffects(); @@ -101,12 +103,11 @@ namespace Emiliasmod.Content.Items.Accessories public override void PostUpdateRunSpeeds() { //// We only want our additional changes to apply if ExampleStatBonusAccessory is equipped and not on a mount. - //if (Player.mount.Active || !SpacesuitStatBonusAccessory) { - // return; - //} + if (Player.mount.Active || !SpacesuitStatBonusAccessory) { + return; + } // The following modifications are similar to Shadow Armor set bonus - //Player.canFloatInWater = true; Player.runAcceleration *= 1.75f; Player.maxRunSpeed *= 1.15f; Player.accRunSpeed *= 6.75f; diff --git a/Content/Items/Accessories/Spacesurf.cs b/Content/Items/Accessories/Spacesurf.cs index 52dac81..7c6cebe 100644 --- a/Content/Items/Accessories/Spacesurf.cs +++ b/Content/Items/Accessories/Spacesurf.cs @@ -13,31 +13,21 @@ namespace Emiliasmod.Content.Items.Accessories } public override void SetDefaults() { - Item.width = 22; - Item.height = 20; + Item.CloneDefaults(ItemID.LongRainbowTrailWings); + //Item.width = 22; + //Item.height = 20; Item.value = Item.sellPrice(platinum: 1, gold: 35); Item.rare = ItemRarityID.Red; Item.accessory = true; } - - public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, - ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 1.2f; // Falling glide speed - ascentWhenRising = 0.4f; // Rising speed - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - + public override void UpdateAccessory(Player player, bool hideVisual) { - player.wingTimeMax = 100000000; + player.wingTimeMax = 100000; player.moveSpeed += 0.1f; - player.jumpSpeedBoost += 1.8f; - player.maxFallSpeed += 0.10f; - player.maxRunSpeed *= 1.75f; - player.wingAccRunSpeed += 0.75f; + //player.jumpSpeedBoost += 1.8f; } + public override void AddRecipes() { Recipe recipe = CreateRecipe(); recipe.AddCondition(Condition.DownedMoonLord); diff --git a/Content/Items/EmiliasWand.cs b/Content/Items/EmiliasWand.cs index efcce08..621978c 100644 --- a/Content/Items/EmiliasWand.cs +++ b/Content/Items/EmiliasWand.cs @@ -1,3 +1,4 @@ +using Emiliasmod.Content.Projectiles; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,23 +11,35 @@ namespace Emiliasmod.Content.Items // https://github.com/tModLoader/tModLoader/tree/stable/ExampleMod public class EmiliasWand : ModItem { + + public override void SetStaticDefaults() { + // As mentioned in the documentation, IsDrill and IsChainsaw automatically reduce useTime and useAnimation to 60% of what is set in SetDefaults and decrease tileBoost by 1, but only for vanilla items. + // We set it here despite it doing nothing because it is likely to be used by other mods to provide special effects to drill or chainsaw items globally. + ItemID.Sets.IsDrill[Type] = true; + } + // The Display Name and Tooltip of this item can be edited in the 'Localization/en-US_Mods.Emiliasmod.hjson' file. public override void SetDefaults() { Item.damage = 300; - Item.DamageType = DamageClass.Melee; Item.pick = 300; - Item.width = 40; - Item.height = 200; - Item.useTime = 10; - Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Shoot; + Item.DamageType = DamageClass.MeleeNoSpeed; + Item.tileBoost = 5; + Item.width = 14; + Item.height = 64; + Item.useTime = 2; + Item.useAnimation = 15; + Item.crit = 36; Item.knockBack = 6; + Item.useStyle = ItemUseStyleID.Shoot; Item.value = Item.buyPrice(platinum: 1); Item.rare = ItemRarityID.Red; //Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.useTurn = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 16f; // 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; } public override void AddRecipes() diff --git a/Content/Items/EmiliasWand.png b/Content/Items/EmiliasWand.png index b54922e201fda026ad0836235008ead16aebac92..a14ec18d43aa04badcc905e3c0a28fdd882a1423 100644 GIT binary patch delta 736 zcmV<60w4X*1%(EXF@L{FL_t(oh3%KYYZE~f#=n)~Rox9S;ejvoj>-@6 zTpWPt0mqEw$BOxfUnQ)(7m0qqN;|{=~$k%BXy94qyI~bD*%A+oo{&b z^9>6}{}oj=25WV+o>A4Ueb;zyB8#1JQQ9R|SC^gVwSToD04Pj{@!h+xLhZMZ3=T}V zS;(N00@AEZWl~*0_xp>f3#h(-C51ybS!#`@D;addlsXp(km~izl5jjI9Joy7kBm%% zWO3hcx?w8lapri1&0-JST-C;0_3tweH@~nP%8W2yGeWqnYrpa2%a{;OH%z7RsnwTr zRQ)edVenJ|ToLwC4w6%jWnFXK_!|5BK-lU?}sc6 SdxtOp0000TNIQswgNj{Tbg&c(4mt^PaOl`>iA6ng58}4Kz_XlfMxl_plcbF332dn6o5jmpqRUH z_nv(&YEKX`7a8m~0G1b50a!|>l>7es2AyWBOo*k7ZDzaX1pgZpLryrElRl?cYrWmP3-Eh$?R(pleNMKLM)AHu`H)-7E7=nQJ$4_|t5{5mIpO2`l2pGdo05MF>WC@b zXf)mjRDaA(OrBT1*Nrxd{|xGrLXcnnlF7vBBS7_@w=Xte0K7@BxblMDH)wq>0bsV9 z20&rMu4XYbIx?V)SF{sbiO3zj+# R4wwJ{002ovPDHLkV1ka{Mm_)l diff --git a/Content/Projectiles/EmiliasWandProjectile.cs b/Content/Projectiles/EmiliasWandProjectile.cs new file mode 100644 index 0000000..eb68dfe --- /dev/null +++ b/Content/Projectiles/EmiliasWandProjectile.cs @@ -0,0 +1,92 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace Emiliasmod.Content.Projectiles +{ + public class EmiliasWandProjectile : ModProjectile + { + public override void SetStaticDefaults() { + // Prevents jitter when stepping up and down blocks and half blocks + ProjectileID.Sets.HeldProjDoesNotUsePlayerGfxOffY[Type] = true; + } + + public override void SetDefaults() { + Projectile.width = 14; + Projectile.height = 64; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Melee; + Projectile.ownerHitCheck = true; + Projectile.aiStyle = -1; // Replace with 20 if you do not want custom code + Projectile.hide = true; // Hides the projectile, so it will draw in the player's hand when we set the player's heldProj to this one. + } + + // This code is adapted and simplified from aiStyle 20 to use a different dust and more noises. If you want to use aiStyle 20, you do not need to do any of this. + // It should be noted that this projectile has no effect on mining and is mostly visual. + public override void AI() { + Player player = Main.player[Projectile.owner]; + + Projectile.timeLeft = 60; + + // 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; + } + + Vector2 playerCenter = player.RotatedRelativePoint(player.MountedCenter); + if (Main.myPlayer == Projectile.owner) { + // This code must only be ran on the client of the projectile owner + if (player.channel) { + float holdoutDistance = player.HeldItem.shootSpeed * Projectile.scale; + // Calculate a normalized vector from player to mouse and multiply by holdoutDistance to determine resulting holdoutOffset + Vector2 holdoutOffset = holdoutDistance * Vector2.Normalize(Main.MouseWorld - playerCenter); + if (holdoutOffset.X != Projectile.velocity.X || holdoutOffset.Y != Projectile.velocity.Y) { + // This will sync the projectile, most importantly, the velocity. + Projectile.netUpdate = true; + } + + // Projectile.velocity acts as a holdoutOffset for held projectiles. + Projectile.velocity = holdoutOffset; + } + else { + Projectile.Kill(); + } + } + + if (Projectile.velocity.X > 0f) { + player.ChangeDir(1); + } + else if (Projectile.velocity.X < 0f) { + player.ChangeDir(-1); + } + + Projectile.spriteDirection = Projectile.direction; + player.ChangeDir(Projectile.direction); // Change the player's direction based on the projectile's own + player.heldProj = Projectile.whoAmI; // We tell the player that the drill is the held projectile, so it will draw in their hand + player.SetDummyItemTime(2); // Make sure the player's item time does not change while the projectile is out + Projectile.Center = playerCenter; // Centers the projectile on the player. Projectile.velocity will be added to this in later Terraria code causing the projectile to be held away from the player at a set distance. + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + player.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation(); + + // Gives the drill a slight jiggle + Projectile.velocity.X *= 1f + Main.rand.Next(-3, 4) * 0.01f; + Projectile.velocity.Y *= 1f + Main.rand.Next(-3, 4) * 0.01f; + + // Spawning dust + if (Main.rand.NextBool(10)) { + Dust dust = Dust.NewDustDirect(Projectile.position + Projectile.velocity * Main.rand.Next(6, 10) * 0.15f, Projectile.width, Projectile.height, DustID.Honey, 0f, 0f, 80, Color.White, 1f); + dust.position.X -= 4f; + dust.noGravity = true; + dust.velocity.X *= 0.5f; + dust.velocity.Y = -Main.rand.Next(3, 8) * 0.1f; + } + } + } +} diff --git a/Content/Projectiles/EmiliasWandProjectile.png b/Content/Projectiles/EmiliasWandProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..9a5c3aee9d02f421ece5c093bcb97a7d606217e6 GIT binary patch literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^d_e5L!3HF?q}avPjv*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