fixed yoyo speeds AGAIN. They can be tested now.
This commit is contained in:
1 parent
e0dbac6a14
commit
e27363b635
13 files changed
+63
-44
No files matched your search
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Oracle");
|
||||
Tooltip.SetDefault("Emits an aura of red lightning which charges up when hitting enemies\nFires auric orbs when supercharged\nAn exceptionally agile yoyo\n'Gaze into the past, the present, the future... and the circumstances of your inevitable demise'");
|
||||
Tooltip.SetDefault("Emits an aura of red lightning which charges up when hitting enemies\nFires auric orbs when supercharged\nAn incredibly agile yoyo\n'Gaze into the past, the present, the future... and the circumstances of your inevitable demise'");
|
||||
ItemID.Sets.Yoyo[item.type] = true;
|
||||
ItemID.Sets.GamepadExtraRange[item.type] = 15;
|
||||
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Obliterator");
|
||||
Tooltip.SetDefault("Ruins nearby enemies with death lasers\nAn exceptionally agile yoyo\n");
|
||||
Tooltip.SetDefault("Ruins nearby enemies with death lasers\nAn incredibly agile yoyo\n");
|
||||
ItemID.Sets.Yoyo[item.type] = true;
|
||||
ItemID.Sets.GamepadExtraRange[item.type] = 15;
|
||||
ItemID.Sets.GamepadSmartQuickReach[item.type] = true;
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.noUseGraphic = true;
|
||||
item.noMelee = true;
|
||||
|
||||
item.shoot = ModContent.ProjectileType<TheObliteratorYoyo>();
|
||||
item.shoot = ModContent.ProjectileType<ObliteratorYoyo>();
|
||||
item.shootSpeed = 16f;
|
||||
|
||||
item.rare = 10;
|
||||
|
||||
@@ -12,9 +12,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Air Spinner");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 6f;
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 8f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 300f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 10.5f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
DisplayName.SetDefault("Aorta");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 11f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 220f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 14f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 8.5f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
DisplayName.SetDefault("Azathoth");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 700f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 18f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
@@ -28,10 +28,10 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 1;
|
||||
projectile.localNPCHitCooldown = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
DisplayName.SetDefault("Chaotrix");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = 14f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 290f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 13f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
DisplayName.SetDefault("Lacerator");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 560f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 18f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 5;
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
|
||||
+22
-11
@@ -8,14 +8,20 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
{
|
||||
public class TheObliteratorYoyo : ModProjectile
|
||||
public class ObliteratorYoyo : ModProjectile
|
||||
{
|
||||
private const int FramesPerShot = 5;
|
||||
|
||||
// Ensures that the main AI only runs once per frame, despite the projectile's multiple updates
|
||||
private int extraUpdateCounter = 0;
|
||||
private const int UpdatesPerFrame = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Obliterator");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 580f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 640f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 13f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
@@ -30,10 +36,10 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = UpdatesPerFrame;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 5;
|
||||
projectile.localNPCHitCooldown = 3 * UpdatesPerFrame;
|
||||
}
|
||||
|
||||
// localAI[1] is the shot counter. Every 5 frames, The Obliterator tries to fire a laser at a nearby target.
|
||||
@@ -41,14 +47,19 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
// localAI[1] counts up to 19 (4 x 5 - 1), then resets back to 0 for a 20-frame cycle.
|
||||
public override void AI()
|
||||
{
|
||||
// Only do stuff once per frame, despite the yoyo's extra updates.
|
||||
extraUpdateCounter = (extraUpdateCounter + 1) % UpdatesPerFrame;
|
||||
if (extraUpdateCounter != UpdatesPerFrame - 1)
|
||||
return;
|
||||
|
||||
Lighting.AddLight(projectile.Center, 0.8f, 0.3f, 1f);
|
||||
|
||||
projectile.localAI[1]++;
|
||||
if (projectile.localAI[1] >= 20f)
|
||||
if (projectile.localAI[1] >= 4 * FramesPerShot)
|
||||
projectile.localAI[1] = 0f;
|
||||
|
||||
// Attempt to fire a laser every 5 frames
|
||||
if(projectile.localAI[1] % 5f == 0f)
|
||||
if(projectile.localAI[1] % FramesPerShot == 0f)
|
||||
{
|
||||
List<int> targets = new List<int>();
|
||||
float laserRange = 300f;
|
||||
@@ -73,11 +84,11 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
// Pick which of the four corners the laser is spawning in
|
||||
Vector2 laserSpawnPosition = projectile.Center;
|
||||
Vector2 offset;
|
||||
if (projectile.localAI[1] < 5f)
|
||||
if (projectile.localAI[1] < FramesPerShot)
|
||||
offset = new Vector2(7, 7);
|
||||
else if (projectile.localAI[1] < 10f)
|
||||
else if (projectile.localAI[1] < 2 * FramesPerShot)
|
||||
offset = new Vector2(-7, 7);
|
||||
else if (projectile.localAI[1] < 15f)
|
||||
else if (projectile.localAI[1] < 3 * FramesPerShot)
|
||||
offset = new Vector2(-7, -7);
|
||||
else
|
||||
offset = new Vector2(7, -7);
|
||||
@@ -107,7 +118,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Vector2 origin = new Vector2(10f, 10f);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/TheObliteratorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 2f, SpriteEffects.None, 0f);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/Yoyos/ObliteratorYoyoGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 2f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
File renamed without changes.
|
Before Width: | Height: | Size: 128 B After Width: | Height: | Size: 128 B |
@@ -14,23 +14,28 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
// The aura turns on and begins damaging enemies at 20 charge.
|
||||
// The yoyo "supercharges" at 50 charge.
|
||||
// Its size caps out at 100 charge.
|
||||
private static float MaxCharge = 200f;
|
||||
private static float MinAuraRadius = 20f;
|
||||
private static float SuperchargeThreshold = 50f;
|
||||
private static float MaxAuraRadius = 100f;
|
||||
private static float MinDischargeRate = 0.05f;
|
||||
private static float MaxDischargeRate = 0.53f;
|
||||
private static float ChargePerHit = 2.2f;
|
||||
private const float MaxCharge = 200f;
|
||||
private const float MinAuraRadius = 20f;
|
||||
private const float SuperchargeThreshold = 50f;
|
||||
private const float MaxAuraRadius = 100f;
|
||||
private const float MinDischargeRate = 0.05f;
|
||||
private const float MaxDischargeRate = 0.53f;
|
||||
private const float ChargePerHit = 4f;
|
||||
|
||||
private static int AuraBaseDamage = 160;
|
||||
private static int HitsPerOrbVolley = 10;
|
||||
private const int AuraBaseDamage = 300;
|
||||
private const float AuraChargeDamageMultiplier = 2f;
|
||||
private const int HitsPerOrbVolley = 3;
|
||||
|
||||
// Ensures that the main AI only runs once per frame, despite the projectile's multiple updates
|
||||
private int extraUpdateCounter = 0;
|
||||
private const int UpdatesPerFrame = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Oracle");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 800f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 24f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 16f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
@@ -45,14 +50,19 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = UpdatesPerFrame;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 4;
|
||||
projectile.localNPCHitCooldown = 3 * UpdatesPerFrame;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
// Only do stuff once per frame, despite the yoyo's extra updates.
|
||||
extraUpdateCounter = (extraUpdateCounter + 1) % UpdatesPerFrame;
|
||||
if (extraUpdateCounter != UpdatesPerFrame - 1)
|
||||
return;
|
||||
|
||||
// Produces golden dust constantly while in flight. This helps light the yoyo.
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
@@ -92,13 +102,11 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
}
|
||||
|
||||
// The aura's direct damage scales with its charge: 100 base damage + 1 per charge point
|
||||
int auraDamage = (int)(AuraBaseDamage + projectile.localAI[1]);
|
||||
int auraDamage = (int)(AuraBaseDamage + AuraChargeDamageMultiplier * projectile.localAI[1]);
|
||||
DealAuraDamage(auraRadius, auraDamage);
|
||||
}
|
||||
else
|
||||
projectile.soundDelay = 2;
|
||||
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
DisplayName.SetDefault("Solar Flare");
|
||||
ProjectileID.Sets.YoyosLifeTimeMultiplier[projectile.type] = -1f;
|
||||
ProjectileID.Sets.YoyosMaximumRange[projectile.type] = 560f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 20f;
|
||||
ProjectileID.Sets.YoyosTopSpeed[projectile.type] = 18f;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.MaxUpdates = 2;
|
||||
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 5;
|
||||
|
||||
Reference in new issue
Block a user