返回提交历史
Modified
Common/DeathDomainPrimitiveTextureSystem.cs
+14
-0
Modified
Projectiles/DeathDomainHarvestSlashProjectile.cs
+28
-21
XFEstudio/DeathMod
调整领域斩击裂变形态
e777e77
代码差异
2 个文件
+42
-21
@@ -87,6 +87,20 @@ internal sealed class DeathDomainPrimitiveTextureSystem : ModSystem
87
87
0f);
88
88
}
89
89
90
internal static void DrawBladeCentered(
91
Vector2 center,
92
float rotation,
93
float length,
94
float width,
95
Color color,
96
float completion = 1f)
97
{
98
completion = MathHelper.Clamp(completion, 0f, 1f);
99
float visibleLength = Math.Max(0.5f, length * completion);
100
Vector2 start = center - rotation.ToRotationVector2() * visibleLength * 0.5f;
101
DrawBlade(start, rotation, length, width, color, completion);
102
}
103
90
104
private static float SmoothStep(float start, float end, float value)
91
105
{
92
106
if (end <= start)
@@ -137,12 +137,12 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
137
137
float strength = Smooth01(progress / 0.08f) * disappear;
138
138
float rotation = GetSlashRotation(Projectile.rotation, slash);
139
139
float length = GetSlashLength(Mastery, Projectile.scale, slash);
140
float width = (28f + Mastery * 18f + (IsRequiem ? 12f : 0f)) * Projectile.scale;
140
float width = (21f + Mastery * 13f + (IsRequiem ? 8f : 0f)) * Projectile.scale;
141
141
Vector2 center = Projectile.Center - Main.screenPosition;
142
142
143
143
// Three passes over one continuous high-resolution silhouette produce one
144
// integrated blade. reveal stretches it from the starting tip toward the
145
// destination, with no MagicPixel seams between individual segments.
144
// integrated blade. The warning line now splits at its centre and opens
145
// toward both tips, restoring the original execution rhythm.
146
146
DrawTaperedBladeLayer(center, rotation, length, width * 1.52f, reveal,
147
147
new Color(92, 0, 22, 0) * (strength * 0.54f));
148
148
DrawTaperedBladeLayer(center, rotation, length, width, reveal,
@@ -152,12 +152,19 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
152
152
153
153
Vector2 direction = rotation.ToRotationVector2();
154
154
Vector2 normal = direction.RotatedBy(MathHelper.PiOver2);
155
Vector2 start = center - direction * length * 0.5f;
156
Vector2 cuttingEdge = start + direction * (length * reveal);
155
float halfRevealLength = length * reveal * 0.5f;
156
Vector2 cuttingEdgeA = center - direction * halfRevealLength;
157
Vector2 cuttingEdgeB = center + direction * halfRevealLength;
157
158
float spark = (8f + Mastery * 5f) * Projectile.scale * strength;
158
159
159
160
DeathDomainPrimitiveTextureSystem.DrawBlade(
160
cuttingEdge - normal * spark,
161
cuttingEdgeA - normal * spark,
162
normal.ToRotation(),
163
spark * 2f,
164
1.6f + Mastery,
165
new Color(255, 12, 52, 0) * strength);
166
DeathDomainPrimitiveTextureSystem.DrawBlade(
167
cuttingEdgeB - normal * spark,
161
168
normal.ToRotation(),
162
169
spark * 2f,
163
170
1.6f + Mastery,
@@ -169,20 +176,19 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
169
176
float bloodReveal = Smooth01((progress - 0.08f) / 0.34f);
170
177
float bloodFade = 1f - Smooth01((progress - 0.64f) / 0.28f);
171
178
float bloodStrength = bloodReveal * bloodFade;
172
float bloodLength = length * (1.78f + Mastery * 0.28f + (IsRequiem ? 0.18f : 0f));
173
Vector2 bloodStart = center - direction * bloodLength * 0.5f;
174
DeathDomainPrimitiveTextureSystem.DrawBlade(
175
bloodStart,
179
float bloodLength = length * (3f + Mastery * 0.47f + (IsRequiem ? 0.3f : 0f));
180
DeathDomainPrimitiveTextureSystem.DrawBladeCentered(
181
center,
176
182
rotation,
177
183
bloodLength,
178
(6.2f + Mastery * 2.2f) * Projectile.scale,
184
(10f + Mastery * 3.5f) * Projectile.scale,
179
185
new Color(95, 0, 24, 0) * (bloodStrength * 0.72f),
180
186
bloodReveal);
181
DeathDomainPrimitiveTextureSystem.DrawBlade(
182
bloodStart,
187
DeathDomainPrimitiveTextureSystem.DrawBladeCentered(
188
center,
183
189
rotation,
184
190
bloodLength,
185
(1.25f + Mastery * 0.55f) * Projectile.scale,
191
(2.4f + Mastery * 0.85f) * Projectile.scale,
186
192
new Color(255, 0, 38, 0) * bloodStrength,
187
193
bloodReveal);
188
194
}
@@ -192,8 +198,7 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
192
198
if (maximumWidth <= 0.05f || reveal <= 0f)
193
199
return;
194
200
195
Vector2 start = center - rotation.ToRotationVector2() * length * 0.5f;
196
DeathDomainPrimitiveTextureSystem.DrawBlade(start, rotation, length, maximumWidth, color, reveal);
201
DeathDomainPrimitiveTextureSystem.DrawBladeCentered(center, rotation, length, maximumWidth, color, reveal);
197
202
}
198
203
199
204
private void ApplyHarvestDamage()
@@ -242,12 +247,13 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
242
247
Vector2 direction = rotation.ToRotationVector2();
243
248
Vector2 normal = direction.RotatedBy(MathHelper.PiOver2);
244
249
float length = GetSlashLength(Mastery, Projectile.scale, slash);
245
Vector2 start = Projectile.Center - direction * length * 0.5f;
246
250
int count = 10 + (int)(Mastery * 8f) + (IsRequiem ? 5 : 0);
247
251
for (int i = 0; i < count; i++)
248
252
{
249
Vector2 position = start + direction * Main.rand.NextFloat(0f, length * 0.12f);
250
Vector2 velocity = normal * Main.rand.NextFloat(-4.8f, 4.8f) + direction * Main.rand.NextFloat(1.2f, 3.6f);
253
float side = Main.rand.NextBool() ? -1f : 1f;
254
Vector2 position = Projectile.Center + direction * Main.rand.NextFloat(-length * 0.035f, length * 0.035f);
255
Vector2 velocity = normal * Main.rand.NextFloat(-4.8f, 4.8f)
256
+ direction * side * Main.rand.NextFloat(1.2f, 3.6f);
251
257
int dustType = i % 3 == 0 ? DustID.Shadowflame : DustID.RedTorch;
252
258
Dust dust = Dust.NewDustPerfect(
253
259
position,
@@ -268,7 +274,8 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
268
274
Vector2 direction = rotation.ToRotationVector2();
269
275
Vector2 normal = direction.RotatedBy(MathHelper.PiOver2);
270
276
float length = GetSlashLength(Mastery, Projectile.scale, slash);
271
Vector2 position = Projectile.Center - direction * length * 0.5f + direction * length * reveal;
277
float side = Main.rand.NextBool() ? -1f : 1f;
278
Vector2 position = Projectile.Center + direction * (length * reveal * 0.5f * side);
272
279
Dust dust = Dust.NewDustPerfect(
273
280
position + normal * Main.rand.NextFloat(-4f, 4f) * Projectile.scale,
274
281
Main.rand.NextBool(3) ? DustID.Shadowflame : DustID.RedTorch,
@@ -295,7 +302,7 @@ public class DeathDomainHarvestSlashProjectile : ModProjectile
295
302
internal static float GetSlashLength(float mastery, float scale, int slash)
296
303
{
297
304
float variation = 0.94f + 0.06f * (float)Math.Sin((slash + 1) * 2.7f);
298
return (126f + mastery * 76f) * scale * variation;
305
return (154f + mastery * 90f) * scale * variation;
299
306
}
300
307
301
308
private static float Smooth01(float value)