XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

DeathMod

【Terraria】DeathMod (now aka Soul Harvest)

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/DeathMod

fix: align reaper effects and refine altar UI

560dde1
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

22 个文件 +200 -36
Modified Items/BloodSickle.cs +3 -2
@@ -20,9 +20,10 @@ public class BloodSickle : NormalSickle
20 20 public override Color SickleColor => new(235, 45, 80);
21 21 public override Color SickleSecondaryColor => new(255, 145, 175);
22 22 public override int SickleDustType => DustID.Blood;
23 public override float TrailWidth => 13f;
23 public override float TrailWidth => 16f;
24 24 public override Vector2 HandleAnchor => new(0.13f, 0.94f);
25 public override float TextureRotationCorrection => 0.82f;
25 public override float TextureRotationCorrection => 0.824f;
26 public override float BladeTipLength => 131.6f;
26 27
27 28 public override void SetDefaults()
28 29 {
Modified Items/DevilSickle.cs +3 -2
@@ -19,9 +19,10 @@ public class DevilSickle : NormalSickle
19 19 public override Color SickleColor => new(255, 125, 25);
20 20 public override Color SickleSecondaryColor => new(255, 235, 85);
21 21 public override int SickleDustType => DustID.Torch;
22 public override float TrailWidth => 16f;
22 public override float TrailWidth => 22f;
23 23 public override Vector2 HandleAnchor => new(0.13f, 0.93f);
24 public override float TextureRotationCorrection => 0.79f;
24 public override float TextureRotationCorrection => 0.695f;
25 public override float BladeTipLength => 119f;
25 26
26 27 public override void SetDefaults()
27 28 {
Modified Items/FrostSickle.cs +3 -2
@@ -20,9 +20,10 @@ public class FrostSickle : NormalSickle
20 20 public override Color SickleColor => new(105, 195, 255);
21 21 public override Color SickleSecondaryColor => new(235, 255, 255);
22 22 public override int SickleDustType => DustID.IceTorch;
23 public override float TrailWidth => 14f;
23 public override float TrailWidth => 22f;
24 24 public override Vector2 HandleAnchor => new(0.18f, 0.93f);
25 public override float TextureRotationCorrection => 0.80f;
25 public override float TextureRotationCorrection => 0.904f;
26 public override float BladeTipLength => 112.2f;
26 27
27 28 public override void SetDefaults()
28 29 {
Modified Items/NormalSickle.cs +4 -3
@@ -27,7 +27,7 @@ public enum SickleSwingStyle : byte
27 27 public enum SickleAlternateAttackStyle : byte
28 28 {
29 29 None,
30 HarvestDash,
30 HarvestUppercut,
31 31 BoneRush,
32 32 BloodCharge,
33 33 InfernalRush,
@@ -91,7 +91,7 @@ public class NormalSickle : ModItem, IDeathAltarUpgradeable
91 91 public virtual int AlternateNextSickleType => ModContent.ItemType<BloodSickle>();
92 92 public virtual bool UsesModernSwing => true;
93 93 public virtual SickleSwingStyle SwingStyle => SickleSwingStyle.Diagonal;
94 public virtual SickleAlternateAttackStyle AlternateAttackStyle => SickleAlternateAttackStyle.HarvestDash;
94 public virtual SickleAlternateAttackStyle AlternateAttackStyle => SickleAlternateAttackStyle.HarvestUppercut;
95 95 public virtual int MaximumChargeFrames => 55 + SickleTier * 8;
96 96 public virtual int SickleReach => 74 + SickleTier * 10;
97 97 public virtual float SickleCollisionWidth => 18f + SickleTier * 3f;
@@ -99,9 +99,10 @@ public class NormalSickle : ModItem, IDeathAltarUpgradeable
99 99 public virtual Color SickleColor => new(80, 205, 225);
100 100 public virtual Color SickleSecondaryColor => new(210, 250, 255);
101 101 public virtual int SickleDustType => DustID.AncientLight;
102 public virtual float TrailWidth => 8f;
102 public virtual float TrailWidth => 9f;
103 103 public virtual Vector2 HandleAnchor => new(0.06f, 0.95f);
104 104 public virtual float TextureRotationCorrection => 0.98f;
105 public virtual float BladeTipLength => 157.4f;
105 106
106 107 public bool SupportsProjectileCount => AttackProjectileType > ProjectileID.None;
107 108 public bool HasAlternateAttack => AlternateAttackStyle != SickleAlternateAttackStyle.None;
Modified Items/SkullSickle.cs +3 -2
@@ -19,9 +19,10 @@ public class SkullSickle : NormalSickle
19 19 public override Color SickleColor => new(80, 235, 255);
20 20 public override Color SickleSecondaryColor => new(235, 245, 220);
21 21 public override int SickleDustType => DustID.DungeonSpirit;
22 public override float TrailWidth => 10f;
22 public override float TrailWidth => 14f;
23 23 public override Vector2 HandleAnchor => new(0.25f, 0.94f);
24 public override float TextureRotationCorrection => 0.97f;
24 public override float TextureRotationCorrection => 1.046f;
25 public override float BladeTipLength => 129.7f;
25 26
26 27 public override void SetDefaults()
27 28 {
Modified Items/SoulSickle.cs +3 -2
@@ -20,9 +20,10 @@ public class SoulSickle : NormalSickle
20 20 public override Color SickleColor => new(120, 100, 255);
21 21 public override Color SickleSecondaryColor => new(75, 245, 255);
22 22 public override int SickleDustType => DustID.AncientLight;
23 public override float TrailWidth => 18f;
23 public override float TrailWidth => 28f;
24 24 public override Vector2 HandleAnchor => new(0.20f, 0.93f);
25 public override float TextureRotationCorrection => 0.84f;
25 public override float TextureRotationCorrection => 0.984f;
26 public override float BladeTipLength => 124.6f;
26 27
27 28 public override void SetDefaults()
28 29 {
Modified Items/VoidSickle.cs +3 -2
@@ -20,9 +20,10 @@ public class VoidSickle : NormalSickle
20 20 public override Color SickleColor => new(190, 55, 255);
21 21 public override Color SickleSecondaryColor => new(255, 85, 235);
22 22 public override int SickleDustType => DustID.Shadowflame;
23 public override float TrailWidth => 20f;
23 public override float TrailWidth => 32f;
24 24 public override Vector2 HandleAnchor => new(0.13f, 0.93f);
25 public override float TextureRotationCorrection => 0.89f;
25 public override float TextureRotationCorrection => 0.846f;
26 public override float BladeTipLength => 137.8f;
26 27
27 28 public override void SetDefaults()
28 29 {
Modified Localization/en-US.hjson +1 -1
@@ -116,7 +116,7 @@ Mods: {
116 116 ChargeHint: Right-click to charge with a separate soul-gathering pose, then release a high-multiplier heavy slash and empowered projectile pattern
117 117
118 118 AlternateHints: {
119 HarvestDash: Right-click: instantly dash toward the cursor with a forward diagonal slash
119 HarvestUppercut: Right-click: rush into a rising uppercut that launches knockable enemies
120 120 BoneRush: Right-click: rush forward with a non-charged bone-wraith thrust
121 121 BloodCharge: Hold right-click to charge, then release a circular Blood Covenant execution
122 122 InfernalRush: Right-click: rush forward with a non-charged infernal spin
Modified Localization/zh-Hans.hjson +1 -1
@@ -116,7 +116,7 @@ Mods: {
116 116 ChargeHint: 右键蓄力:使用独立聚魂动作,松开后施展高倍率重斩与强化弹幕
117 117
118 118 AlternateHints: {
119 HarvestDash: 右键:立即向准星方向突进并施展前冲斜斩
119 HarvestUppercut: 右键:向准星方向上挑突进,将可击退的敌人挑向空中
120 120 BoneRush: 右键:无需蓄力,以亡骨镰向前突刺追魂
121 121 BloodCharge: 右键按住蓄力,松开后施展环身血契处决斩
122 122 InfernalRush: 右键:无需蓄力,突进并施展炼狱旋斩
Modified Projectiles/BloodCrescentProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/BoneWispProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/FrostShardProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/InfernalCrescentProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/LifeStealWispProjectile.cs +27 -3
@@ -1,5 +1,7 @@
1 1 using Microsoft.Xna.Framework;
2 using Microsoft.Xna.Framework.Graphics;
2 3 using Terraria;
4 using Terraria.GameContent;
3 5 using Terraria.ID;
4 6 using Terraria.ModLoader;
5 7
@@ -32,8 +34,6 @@ internal static class LifeStealVisuals
32 34
33 35 public class LifeStealWispProjectile : ModProjectile
34 36 {
35 public override string Texture => "Terraria/Images/Projectile_0";
36
37 37 private int LifeStealLevel => (int)Projectile.ai[0];
38 38
39 39 public override void SetStaticDefaults()
@@ -54,7 +54,7 @@ public class LifeStealWispProjectile : ModProjectile
54 54 Projectile.penetrate = -1;
55 55 Projectile.netImportant = false;
56 56 Projectile.extraUpdates = 1;
57 Projectile.hide = true;
57 Projectile.hide = false;
58 58 }
59 59
60 60 public override void AI()
@@ -112,4 +112,28 @@ public class LifeStealWispProjectile : ModProjectile
112 112 Projectile.Kill();
113 113 }
114 114
115 public override bool PreDraw(ref Color lightColor)
116 {
117 Texture2D texture = TextureAssets.Projectile[Type].Value;
118 Vector2 origin = texture.Size() * 0.5f;
119 float rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
120 float baseScale = 0.34f + LifeStealLevel * 0.045f;
121 int trailLength = 2 + LifeStealLevel;
122
123 for (int index = trailLength; index >= 1; index--)
124 {
125 if (Projectile.oldPos[index] == Vector2.Zero)
126 continue;
127
128 float strength = (trailLength - index + 1f) / (trailLength + 1f);
129 Vector2 position = Projectile.oldPos[index] + Projectile.Size * 0.5f - Main.screenPosition;
130 Color trailColor = Color.Lerp(new Color(220, 20, 45), new Color(255, 100, 190), LifeStealLevel / 5f) with { A = 0 };
131 Main.EntitySpriteDraw(texture, position, null, trailColor * strength * 0.42f,
132 rotation, origin, baseScale * (0.65f + strength * 0.25f), SpriteEffects.None);
133 }
134
135 Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White,
136 rotation, origin, baseScale, SpriteEffects.None);
137 return false;
138 }
115 139 }
Added Projectiles/LifeStealWispProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/SickleSwingProjectile.cs +41 -8
@@ -114,7 +114,7 @@ public class SickleSwingProjectile : ModProjectile
114 114 return false;
115 115
116 116 Vector2 start = gripPosition + weaponAngle.ToRotationVector2() * 8f;
117 Vector2 end = gripPosition + weaponAngle.ToRotationVector2() * sickle.SickleReach;
117 Vector2 end = GetBladeTip(sickle, gripPosition, weaponAngle);
118 118 float collisionPoint = 0f;
119 119 float widthMultiplier = IsAlternateAttack ? 1.35f : 1f;
120 120 return Collision.CheckAABBvLineCollision(
@@ -134,7 +134,7 @@ public class SickleSwingProjectile : ModProjectile
134 134 DrawSlashTrail(sickle);
135 135
136 136 Texture2D texture = TextureAssets.Item[ItemType].Value;
137 float scale = 0.82f + sickle.SickleTier * 0.075f + (IsReleasedCharge ? chargeRatio * 0.12f : 0f);
137 float scale = GetWeaponScale(sickle);
138 138 int afterimageCount = Math.Min(HistoryLength - 1, 2 + sickle.SickleTier * 2 + (IsAlternateAttack ? 2 : 0));
139 139
140 140 for (int index = afterimageCount; index >= 1; index--)
@@ -316,7 +316,7 @@ public class SickleSwingProjectile : ModProjectile
316 316 swingTimer++;
317 317 int duration = sickle.AlternateAttackStyle switch
318 318 {
319 SickleAlternateAttackStyle.HarvestDash => 20,
319 SickleAlternateAttackStyle.HarvestUppercut => 24,
320 320 SickleAlternateAttackStyle.BoneRush => 24,
321 321 SickleAlternateAttackStyle.InfernalRush => 30,
322 322 SickleAlternateAttackStyle.VoidStep => 34,
@@ -339,6 +339,15 @@ public class SickleSwingProjectile : ModProjectile
339 339
340 340 switch (sickle.AlternateAttackStyle)
341 341 {
342 case SickleAlternateAttackStyle.HarvestUppercut:
343 {
344 float lift = (float)Math.Sin(progress * MathHelper.Pi);
345 SetArc(aimRotation, 2.35f, -1.15f, EaseOutSine(progress), player.direction, 0);
346 gripPosition += aimRotation.ToRotationVector2() * lift * 12f;
347 gripPosition.Y -= lift * 9f;
348 ApplyDash(player, 4.8f, 0.16f);
349 break;
350 }
342 351 case SickleAlternateAttackStyle.BoneRush:
343 352 {
344 353 float lunge = (float)Math.Sin(progress * MathHelper.Pi);
@@ -372,6 +381,20 @@ public class SickleSwingProjectile : ModProjectile
372 381 Projectile.Kill();
373 382 }
374 383
384 public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
385 {
386 if (!IsAlternateAttack || Main.netMode == NetmodeID.MultiplayerClient
387 || !TryGetSickle(out Player player, out NormalSickle sickle)
388 || sickle.AlternateAttackStyle != SickleAlternateAttackStyle.HarvestUppercut)
389 return;
390
391 float resistance = MathHelper.Clamp(target.knockBackResist, 0.15f, 1f);
392 float liftSpeed = (6.5f + Projectile.knockBack * 0.35f) * resistance;
393 target.velocity.Y = Math.Min(target.velocity.Y, -liftSpeed);
394 target.velocity.X += player.direction * (1.8f + Projectile.knockBack * 0.12f) * resistance;
395 target.netUpdate = true;
396 }
397
375 398 private void UpdateCrossCut(float progress, float centerAngle, int direction, bool charged)
376 399 {
377 400 float split = charged ? 0.48f : 0.54f;
@@ -425,7 +448,7 @@ public class SickleSwingProjectile : ModProjectile
425 448
426 449 private void SpawnMotionEffects(Player player, NormalSickle sickle)
427 450 {
428 Vector2 bladeTip = gripPosition + weaponAngle.ToRotationVector2() * sickle.SickleReach;
451 Vector2 bladeTip = GetBladeTip(sickle, gripPosition, weaponAngle);
429 452 bool charging = IsAlternateAttack && sickle.SupportsCharge && !IsReleasedCharge;
430 453 float intensity = charging ? 0.3f + chargeRatio : 0.65f + sickle.SickleTier * 0.2f;
431 454 Lighting.AddLight(bladeTip, sickle.SickleColor.ToVector3() * intensity * 0.45f);
@@ -454,8 +477,8 @@ public class SickleSwingProjectile : ModProjectile
454 477 if (sickle.SwingStyle is SickleSwingStyle.Overhead or SickleSwingStyle.CrossCut && index % 3 == 2)
455 478 continue;
456 479
457 Vector2 currentTip = gripHistory[index] + angleHistory[index].ToRotationVector2() * sickle.SickleReach;
458 Vector2 oldTip = gripHistory[index + 1] + angleHistory[index + 1].ToRotationVector2() * sickle.SickleReach;
480 Vector2 currentTip = GetBladeTip(sickle, gripHistory[index], angleHistory[index]);
481 Vector2 oldTip = GetBladeTip(sickle, gripHistory[index + 1], angleHistory[index + 1]);
459 482 Vector2 difference = oldTip - currentTip;
460 483 float length = difference.Length();
461 484 float maximumSegmentLength = 28f + sickle.SickleTier * 4f;
@@ -474,8 +497,8 @@ public class SickleSwingProjectile : ModProjectile
474 497
475 498 if (sickle.SwingStyle == SickleSwingStyle.Circular)
476 499 {
477 Vector2 innerCurrent = gripHistory[index] + angleHistory[index].ToRotationVector2() * (sickle.SickleReach * 0.82f);
478 Vector2 innerOld = gripHistory[index + 1] + angleHistory[index + 1].ToRotationVector2() * (sickle.SickleReach * 0.82f);
500 Vector2 innerCurrent = Vector2.Lerp(gripHistory[index], currentTip, 0.82f);
501 Vector2 innerOld = Vector2.Lerp(gripHistory[index + 1], oldTip, 0.82f);
479 502 DrawTrailSegment(pixel, innerCurrent, innerOld - innerCurrent, sickle.SickleSecondaryColor with { A = 0 }, width * 0.32f, strength * 0.5f);
480 503 }
481 504 else if (sickle.SwingStyle == SickleSwingStyle.SoulOrbit)
@@ -523,6 +546,16 @@ public class SickleSwingProjectile : ModProjectile
523 546 angle + rotationCorrection, origin, scale, effects);
524 547 }
525 548
549 private float GetWeaponScale(NormalSickle sickle)
550 {
551 return 0.82f + sickle.SickleTier * 0.075f + (IsReleasedCharge ? chargeRatio * 0.12f : 0f);
552 }
553
554 private Vector2 GetBladeTip(NormalSickle sickle, Vector2 grip, float angle)
555 {
556 return grip + angle.ToRotationVector2() * sickle.BladeTipLength * GetWeaponScale(sickle);
557 }
558
526 559 private void DrawChargeRing(Player player, NormalSickle sickle)
527 560 {
528 561 Texture2D pixel = TextureAssets.MagicPixel.Value;
Modified Projectiles/SoulSickleProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified Projectiles/VoidRiftProjectile.png +0 -0
二进制文件已变更,无法进行逐行预览。
Modified README.md +2 -2
@@ -4,7 +4,7 @@
4 4
5 5 Soul Harvest(内部模组名:`DeathMod`)是一款面向 Terraria tModLoader 的死神装备成长模组。玩家使用本模组的镰刀收割灵魂,将灵魂凝聚为灵魂精华,再通过死神祭坛培养镰刀、死神长袍与死亡之翼。
6 6
7 当前版本:`2.3.1`
7 当前版本:`2.4`
8 8
9 9 作者:XFEstudio
10 10
@@ -16,7 +16,7 @@ Soul Harvest(内部模组名:`DeathMod`)是一款面向 Terraria tModLoade
16 16 - 只有本模组的镰刀能够登记并收割灵魂。
17 17 - 可在死神祭坛提升攻击、攻速、击退、弹幕数量、穿甲、伤害间隔和吸血;攻击最高 40 级,终局常规镰刀可突破 1000 基础伤害。
18 18 - 每种常规镰刀拥有不同的斜斩、过顶斩、环身弧、逆向挑斩、交叉斩或多圈回旋轨迹,并使用与轨迹匹配的独立刀光拖尾和握柄朝向。
19 - 所有常规镰刀都有独立右键招式:血契、霜魂与灵魂形态可按住蓄力;收魂、亡骨、炼狱与虚空形态使用无需蓄力的突进、旋斩或踏步攻击。
19 - 所有常规镰刀都有独立右键招式:血契、霜魂与灵魂形态可按住蓄力;收魂镰能够上挑敌人,亡骨、炼狱与虚空形态使用无需蓄力的突进、旋斩或踏步攻击。
20 20 - 吸血命中会产生飞回人物的血魂反馈,吸血等级越高,回流数量与视觉层次越丰富。
21 21 - 死亡之翼拥有飞行时间、水平速度、加速度、垂直能力和无限飞行五条改造路线。
22 22 - 死神长袍拥有防御、生命、回复、机动、召唤容量、功能免疫等 25 条改造路线;15 种减益免疫需要逐项解锁。
Modified UI/DeathAltarUISystem.cs +103 -3
Modified build.txt +1 -1
Modified docs/PLAY_GUIDE.md +2 -2