This commit is contained in:
Andrew Marheine committed 2020-09-21 19:57:12 -05:00
commit 18d6ea28bd
7 files changed
+77 -39

No files matched your search

+2 -1
View File
@@ -6,7 +6,8 @@ namespace CalamityMod.Buffs.StatDebuffs
public class KamiDebuff : ModBuff
{
public const float MultiplicativeDamageReduction = 0.8f;
public const float MaxNPCSpeed = 16f; // Hard-cap for npc speed when afflicted with this debuff. Does not affect certain NPCs and does not affect any bosses (Basically only works on boss minions).
// Hard-cap for npc speed when afflicted with this debuff. Does not affect certain NPCs and does not affect any bosses (Basically only works on boss minions).
public const float MaxNPCSpeed = 16f;
public override void SetDefaults()
{
DisplayName.SetDefault("Kami Flu");
+30 -19
View File
@@ -144,6 +144,8 @@ namespace CalamityMod
public static List<int> legOverrideList;
public static List<int> kamiDebuffColorImmuneList;
public static void LoadLists()
{
donatorList = new List<string>()
@@ -278,8 +280,8 @@ namespace CalamityMod
trueMeleeProjectileList = new List<int>()
{
// Vanilla shit
ProjectileID.Spear,
// Vanilla shit
ProjectileID.Spear,
ProjectileID.Trident,
ProjectileID.TheRottedFork,
ProjectileID.Swordfish,
@@ -300,7 +302,7 @@ namespace CalamityMod
ProjectileID.MonkStaffT3,
ProjectileID.NorthPoleWeapon,
// Tools
// Tools
ProjectileID.CobaltDrill,
ProjectileID.MythrilDrill,
ProjectileID.AdamantiteDrill,
@@ -328,8 +330,8 @@ namespace CalamityMod
ProjectileID.SawtoothShark,
ProjectileID.ButchersChainsaw,
// Calamity shit
ModContent.ProjectileType<DevilsSunriseProj>(),
// Calamity shit
ModContent.ProjectileType<DevilsSunriseProj>(),
ModContent.ProjectileType<MarniteObliteratorProj>(),
ModContent.ProjectileType<MurasamaSlash>(),
ModContent.ProjectileType<AmidiasTridentProj>(),
@@ -394,7 +396,7 @@ namespace CalamityMod
projectileDestroyExceptionList = new List<int>()
{
//holdout projectiles
//holdout projectiles
ProjectileID.Phantasm,
ProjectileID.VortexBeater,
ProjectileID.DD2PhoenixBow,
@@ -423,7 +425,7 @@ namespace CalamityMod
ModContent.ProjectileType<MurasamaSlash>(),
ModContent.ProjectileType<PhaseslayerProjectile>(),
//Some hostile boss projectiles
//Some hostile boss projectiles
ModContent.ProjectileType<BrimstoneMonster>(),
ModContent.ProjectileType<InfernadoRevenge>(),
ModContent.ProjectileType<OverlyDramaticDukeSummoner>(),
@@ -875,7 +877,7 @@ namespace CalamityMod
ModContent.ItemType<IceBarrage>(),
ModContent.ItemType<FrostBlossomStaff>(),
ModContent.ItemType<EndoHydraStaff>(),
//Cryonic Bar set stuff, could potentially be removed
//Cryonic Bar set stuff, could potentially be removed
ModContent.ItemType<Trinity>(),
ModContent.ItemType<Shimmerspark>(),
ModContent.ItemType<StarnightLance>(),
@@ -1921,7 +1923,7 @@ namespace CalamityMod
NPCID.BaldZombie,
NPCID.PincushionZombie,
NPCID.ArmedZombiePincussion, // what is this spelling
NPCID.SlimedZombie,
NPCID.SlimedZombie,
NPCID.ArmedZombieSlimed,
NPCID.SwampZombie,
NPCID.ArmedZombieSwamp,
@@ -1948,8 +1950,8 @@ namespace CalamityMod
NPCID.SmallBaldZombie,
NPCID.BigZombie,
NPCID.SmallZombie
// halloween zombies not included because they don't drop shackles or zombie arms
};
// halloween zombies not included because they don't drop shackles or zombie arms
};
demonEyeList = new List<int>()
{
@@ -1957,7 +1959,7 @@ namespace CalamityMod
NPCID.CataractEye,
NPCID.SleepyEye,
NPCID.DialatedEye, // it is spelled "dilated"
NPCID.GreenEye,
NPCID.GreenEye,
NPCID.PurpleEye,
NPCID.DemonEyeOwl,
NPCID.DemonEyeSpaceship,
@@ -1988,13 +1990,13 @@ namespace CalamityMod
NPCID.BigSkeleton,
NPCID.SmallSkeleton,
//Note: These skeletons don't count for Skeleton Banner for some god forsaken reason
NPCID.SkeletonTopHat,
//Note: These skeletons don't count for Skeleton Banner for some god forsaken reason
NPCID.SkeletonTopHat,
NPCID.SkeletonAstonaut,
NPCID.SkeletonAlien,
//Other skeleton types
NPCID.ArmoredSkeleton,
//Other skeleton types
NPCID.ArmoredSkeleton,
NPCID.HeavySkeleton,
NPCID.SkeletonArcher,
NPCID.GreekSkeleton
@@ -2061,8 +2063,8 @@ namespace CalamityMod
NPCID.SantaNK1,
NPCID.Everscream,
NPCID.DD2Betsy,
NPCID.Mothron
};
NPCID.Mothron
};
bossMinionList = new List<int>()
{
@@ -2293,6 +2295,14 @@ namespace CalamityMod
CalamityMod.Instance.GetEquipSlot("SirenLeg", EquipType.Legs),
CalamityMod.Instance.GetEquipSlot("PopoLeg", EquipType.Legs)
};
// Duke Fishron phase 3 becomes way too easy if you can make him stop being invisible with Yanmei's Knife.
// This is a list so that other NPCs can be added as necessary.
// IT DOES NOT make them immune to the debuff, just stops them from being recolored.
kamiDebuffColorImmuneList = new List<int>()
{
NPCID.DukeFishron,
};
}
public static void UnloadLists()
@@ -2365,10 +2375,11 @@ namespace CalamityMod
hornetList = null;
mossHornetList = null;
bossMinionList = null;
minibossList = null;
minibossList = null;
legOverrideList = null;
kamiDebuffColorImmuneList = null;
}
}
}
+1 -1
View File
@@ -4374,7 +4374,7 @@ namespace CalamityMod.NPCs
return new Color(200, 50, 50, npc.alpha);
}
if (npc.Calamity().kamiFlu > 0)
if (npc.Calamity().kamiFlu > 0 && !CalamityLists.kamiDebuffColorImmuneList.Contains(npc.type))
{
return new Color(51, 197, 108, npc.alpha);
}
@@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.DraedonsArsenal;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -71,6 +72,12 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
projectile.localNPCHitCooldown = 7;
}
// Vanilla Terraria doesn't sync projectile rotation, but it does sync velocity.
// Rather than hacking velocity to reflect rotation, I'd rather just send the rotation directly.
// - Ozzatron (09/21/2020)
public override void SendExtraAI(BinaryWriter writer) => writer.Write(projectile.rotation);
public override void ReceiveExtraAI(BinaryReader reader) => projectile.rotation = reader.ReadSingle();
public override void AI()
{
Player player = Main.player[projectile.owner];
@@ -130,7 +137,14 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
float aimResponsiveness = 0.035f + 0.3f * (float)Math.Pow(distRatio, 1D/3);
// Update the sword's angle with the responsiveness determined by mouse position.
projectile.rotation = projectile.rotation.AngleLerp(player.AngleTo(Main.MouseWorld), aimResponsiveness);
// Also flag for netcode sync if applicable (this is the only way the sword can rotate in multiplayer).
float newRotation = projectile.rotation.AngleLerp(player.AngleTo(Main.MouseWorld), aimResponsiveness);
if (projectile.rotation != newRotation)
{
projectile.netUpdate = true;
projectile.netSpam = 0; // You cannot stop Phaseslayer from sending packets.
}
projectile.rotation = newRotation;
}
// If the player is not wielding the sword, determine whether it should fade out or instantly vanish.
@@ -143,10 +157,11 @@ namespace CalamityMod.Projectiles.DraedonsArsenal
else
projectile.Kill();
}
projectile.Center = player.MountedCenter + projectile.rotation.ToRotationVector2() * ProjCenterOffset;
}
// This line ensures the sword stays glued to the player, even for other players in multiplayer.
projectile.Center = player.MountedCenter + projectile.rotation.ToRotationVector2() * ProjCenterOffset;
// These lines ensure the player and their arm are rotated the correct direction to hold the sword.
projectile.direction = (Math.Cos(projectile.rotation) > 0).ToDirectionInt();
player.ChangeDir(projectile.direction);
+8 -13
View File
@@ -17,13 +17,14 @@ namespace CalamityMod.Projectiles.Magic
}
public float IdealScale
{
get => projectile.localAI[0];
set => projectile.localAI[0] = value;
get => projectile.ai[1];
set => projectile.ai[1] = value;
}
public const int TentacleSpawnRate = 20;
public const int PulseInterval = 18;
public const float PulseHitboxExpandRatio = 2.5f;
public const float RadialOffsetVarianceFactor = 0.1f;
public const float StartingScale = 0.0004f;
public override void SetStaticDefaults()
{
@@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic
projectile.friendly = true;
projectile.alpha = 255;
projectile.penetrate = -1;
projectile.scale = 0.0004f;
projectile.scale = StartingScale;
projectile.timeLeft = 540;
projectile.tileCollide = false;
projectile.magic = true;
@@ -46,21 +47,15 @@ namespace CalamityMod.Projectiles.Magic
projectile.localNPCHitCooldown = 4;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(IdealScale);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
IdealScale = reader.ReadSingle();
}
// Vanilla Terraria does not sync projectile scale by default.
public override void SendExtraAI(BinaryWriter writer) => writer.Write(projectile.scale);
public override void ReceiveExtraAI(BinaryReader reader) => projectile.scale = reader.ReadSingle();
public override void AI()
{
projectile.rotation += MathHelper.ToRadians(8f); // Spin 2 win.
projectile.alpha = (int)MathHelper.Lerp(255, 0, Utils.InverseLerp(0f, 20f, Time, true)); // Fade in completely after 20 frames.
projectile.scale = MathHelper.Lerp(0.0004f, IdealScale, Utils.InverseLerp(0f, 30f, Time, true)); // Expand completely after 30 frames.
projectile.scale = MathHelper.Lerp(StartingScale, IdealScale, Utils.InverseLerp(0f, 30f, Time, true)); // Expand completely after 30 frames.
// Determine the ideal scale in the first frame.
if (IdealScale == 0f)
+1
View File
@@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Magic
projectile.ignoreWater = true;
}
// TODO -- Make property wrappers for these variables instead of needing to explain them.
// ai[0] is a frame counter. ai[1] is the next frame mana will be consumed.
// localAI[0] is the number of frames between mana consumptions.
public override void AI()
+17 -2
View File
@@ -14,7 +14,20 @@ namespace CalamityMod.Projectiles.Typeless
public class YanmeisKnifeSlash : ModProjectile
{
// This is a rather weird thing, but it's what the patron asked for.
public static readonly Func<NPC, bool> CanRecieveCoolEffectsFrom = (npc) => (npc.boss && npc.type != ModContent.NPCType<CeaselessVoid>() && npc.type != ModContent.NPCType<DevourerofGodsBody>() && npc.type != ModContent.NPCType<DevourerofGodsBodyS>()) || CalamityLists.bossMinionList.Contains(npc.type) || CalamityLists.minibossList.Contains(npc.type) || AcidRainEvent.AllMinibosses.Contains(npc.type);
public static readonly Func<NPC, bool> CanRecieveCoolEffectsFrom = (npc) =>
{
bool validBoss = npc.boss && npc.type != ModContent.NPCType<CeaselessVoid>()
&& npc.type != ModContent.NPCType<DevourerofGodsBody>()
&& npc.type != ModContent.NPCType<DevourerofGodsBodyS>();
if (validBoss)
return true;
bool bossMinion = CalamityLists.bossMinionList.Contains(npc.type);
if (bossMinion)
return true;
bool miniboss = CalamityLists.minibossList.Contains(npc.type) || AcidRainEvent.AllMinibosses.Contains(npc.type);
return miniboss;
};
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Yanmei's Knife");
@@ -31,7 +44,9 @@ namespace CalamityMod.Projectiles.Typeless
projectile.ownerHitCheck = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 20;
projectile.Calamity().trueMelee = true;
// Not considered true melee to prevent Titan Scale from triggering.
// projectile.Calamity().trueMelee = true;
}
public override void AI()