This commit is contained in:
Andrew Marheine committed 2020-03-20 19:10:20 -05:00
commit 80d042a6e9
9 files changed
+57 -13

No files matched your search

@@ -0,0 +1,25 @@
using CalamityMod.Tiles;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Banners
{
public class FlakBabyBanner : ModItem
{
public override void SetDefaults()
{
item.width = 10;
item.height = 24;
item.maxStack = 99;
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
item.rare = 1;
item.value = Item.buyPrice(0, 0, 10, 0);
item.createTile = ModContent.TileType<MonsterBanner>();
item.placeStyle = 119;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

+9 -2
View File
@@ -75,8 +75,14 @@ namespace CalamityMod.NPCs.AcidRain
}
Player closest = Main.player[Player.FindClosest(npc.Top, 0, 0)];
if (Math.Abs(closest.Center.X - npc.Center.X) > 600f)
{
npc.ai[1] = 90;
}
if (npc.ai[1] > 0f)
{
npc.velocity.X *= 0.935f;
npc.ai[1]--;
}
else
{
@@ -97,8 +103,7 @@ namespace CalamityMod.NPCs.AcidRain
}
public override void FindFrame(int frameHeight)
{
Player closest = Main.player[Player.FindClosest(npc.Top, 0, 0)];
if (Math.Abs(closest.Center.X - npc.Center.X) < 600f)
if (npc.ai[1] <= 0f)
{
if (npc.ai[0]++ % 4 == 3)
{
@@ -119,6 +124,8 @@ namespace CalamityMod.NPCs.AcidRain
{
npc.frame.Y = 0;
}
if (npc.ai[1] <= 8)
npc.frame.Y = frameHeight;
}
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
+10 -4
View File
@@ -56,15 +56,19 @@ namespace CalamityMod.NPCs.AcidRain
public override void AI()
{
Player closest = Main.player[Player.FindClosest(npc.Top, 0, 0)];
if (npc.life / (float)npc.lifeMax > 0.95f)
if (npc.justHit)
npc.localAI[0] = 240;
if (npc.localAI[0] == 0f)
{
npc.chaseable = false;
if (Math.Abs(closest.Center.X - npc.Center.X) < 320f &&
closest.Center.Y - npc.Top.Y < -60f &&
npc.ai[1]++ >= Main.rand.Next(35, 95))
{
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float speed = CalamityWorld.downedPolterghast ? 20f : 11f;
float speed = CalamityWorld.downedPolterghast ? 29f : 17f;
speed *= Main.rand.NextFloat(0.8f, 1.2f);
int damage = CalamityWorld.downedPolterghast ? 42 : 23;
Projectile.NewProjectile(npc.Top + Vector2.UnitY * 6f, npc.DirectionTo(closest.Center).RotatedByRandom(0.25f) * speed,
@@ -75,6 +79,8 @@ namespace CalamityMod.NPCs.AcidRain
}
else
{
npc.localAI[0]--;
npc.chaseable = true;
if (npc.velocity.Y == 0f)
{
npc.TargetClosest(true);
@@ -110,7 +116,7 @@ namespace CalamityMod.NPCs.AcidRain
public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position)
{
// Don't draw the bar if in stealth mode
if (npc.life / (float)npc.lifeMax > 0.95f)
if (npc.localAI[0] == 0f)
return false;
return null;
}
@@ -121,7 +127,7 @@ namespace CalamityMod.NPCs.AcidRain
}
public override void FindFrame(int frameHeight)
{
if (npc.life / (float)npc.lifeMax <= 0.95f)
if (npc.localAI[0] > 0f)
{
if (npc.ai[0]++ % 6 == 5)
{
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Enemy
projectile.hostile = true;
projectile.timeLeft = 480;
projectile.tileCollide = true;
projectile.ignoreWater = false;
projectile.ignoreWater = true;
}
public override void AI()
{
+6 -6
View File
@@ -61,15 +61,15 @@ namespace CalamityMod.Projectiles.Summon
// Adjust damage as needed
if (projectile.localAI[0] == 0f)
{
projectile.Calamity().spawnedPlayerMinionDamageValue = player.allDamage + player.minionDamage - 1f;
projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage();
projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage;
projectile.localAI[0] = 1f;
}
if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue)
if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue)
{
int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
projectile.Calamity().spawnedPlayerMinionDamageValue *
(player.allDamage + player.minionDamage - 1f));
player.MinionDamage());
projectile.damage = trueDamage;
}
@@ -101,8 +101,8 @@ namespace CalamityMod.Projectiles.Summon
if (projectile.Distance(potentialTarget.Center) < DistanceBeforeCharge)
{
projectile.ai[0] += 1f;
int timePerCharge = playerHalfLife ? 33 : 50;
float chargeSpeed = playerHalfLife ? 22f : 17.5f;
int timePerCharge = playerHalfLife ? 25 : 35;
float chargeSpeed = playerHalfLife ? 25f : 20f;
if (projectile.ai[0] >= timePerCharge)
{
projectile.velocity = projectile.DirectionTo(potentialTarget.Center) * chargeSpeed;
@@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Summon
else
{
float intertia = 0.94f;
float homeSpeed = playerHalfLife ? 33f : 25.75f;
float homeSpeed = playerHalfLife ? 38f : 32f;
projectile.velocity = Vector2.Lerp(projectile.velocity,
projectile.DirectionTo(potentialTarget.Center) * homeSpeed,
1f - intertia);
+6
View File
@@ -392,6 +392,9 @@ namespace CalamityMod.Tiles
case 118:
item = "SulfurousSkaterBanner";
break;
case 119:
item = "FlakBabyBanner";
break;
default:
return;
}
@@ -767,6 +770,9 @@ namespace CalamityMod.Tiles
case 118:
type = "SulfurousSkater";
break;
case 119:
type = "FlakBaby";
break;
default:
return;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB