Merge branch '1.4.4' into Debuff-Tooltip-Completion
No files matched your search
@@ -167,9 +167,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Aegis Blade's explosions because the true melee resist ain't enough.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AegisBlast>()))));
|
||||
|
||||
// 40% resist to Icicle Arrows.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<IcicleArrowProj>()))));
|
||||
|
||||
// 35% resist to Flying Dragon.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.Ravager, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
|
||||
|
||||
@@ -213,9 +210,6 @@ namespace CalamityMod.Balancing
|
||||
// 35% resist to Aerial Bane.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2BetsyArrow))));
|
||||
|
||||
// 35% resist to Icicle Arrows.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<IcicleArrowProj>()))));
|
||||
|
||||
// 30% resist to Aurora Blazer.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.AstrumDeus, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
|
||||
|
||||
@@ -254,9 +248,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Galactus Blade.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<GalacticaComet>())));
|
||||
|
||||
// 40% resist to Pristine Fury's alt fire.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<PristineSecondary>())));
|
||||
|
||||
// 40% resist to Stellar Torus Staff.
|
||||
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<StellarTorusBeam>())));
|
||||
#endregion
|
||||
@@ -274,9 +265,6 @@ namespace CalamityMod.Balancing
|
||||
// 50% resist to Legion of Celestia.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<CelestialAxeMinion>()))));
|
||||
|
||||
// 50% resist to Pristine Fury's alt fire.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PristineSecondary>()))));
|
||||
|
||||
// 50% resist to Tactician's Trump Card's explosions.
|
||||
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityNPCTypeSets.StormWeaver, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TacticiansElectricBoom>()))));
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BaconOilBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 3
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
Main.persistentBuff[Type] = true;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().baconOil = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class BloodyMaryBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 646 B After Width: | Height: | Size: 871 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CaribbeanRumBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 866 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class CinnamonRollBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 832 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EverclearBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 2
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 819 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class EvergreenGinBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 668 B After Width: | Height: | Size: 907 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class FireballBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 818 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class GrapeBeerBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 885 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class ManhattanBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 626 B After Width: | Height: | Size: 815 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MargaritaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 842 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoonshineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 813 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class MoscowMuleBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 743 B After Width: | Height: | Size: 898 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class OldFashionedBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 788 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class PurpleHazeBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 807 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class RedWineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 816 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class RumBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 720 B After Width: | Height: | Size: 789 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class ScrewdriverBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 656 B After Width: | Height: | Size: 828 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class StarBeamRyeBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 836 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class TequilaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 670 B After Width: | Height: | Size: 822 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class TequilaSunriseBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 700 B After Width: | Height: | Size: 964 B |
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -6,6 +7,10 @@ namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class VodkaBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 820 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class WhiskeyBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 790 B |
@@ -1,10 +1,15 @@
|
||||
using Terraria;
|
||||
using CalamityMod.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Alcohol
|
||||
{
|
||||
public class WhiteWineBuff : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
AlcoholLevel = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 698 B After Width: | Height: | Size: 848 B |
@@ -1,7 +1,9 @@
|
||||
using CalamityMod.Balancing;
|
||||
using System;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
@@ -10,11 +12,14 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
EnemyLostRegen = 150, //Damage per shellfish
|
||||
EnemyLostRegen = 170, //Damage per shellfish
|
||||
NPCLifeRegenMethod = ShellfishStacking
|
||||
};
|
||||
public static void ShellfishStacking(NPC npc, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
if (npc.SuperArmor)
|
||||
return;
|
||||
|
||||
int projectileCount = 0;
|
||||
int owner = 255;
|
||||
foreach (Projectile p in Main.ActiveProjectiles)
|
||||
@@ -38,7 +43,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
if (CalamityUtils.ShouldTriggerSummonPenalty(Main.player[owner], heldItem))
|
||||
totalDamage = (int)(totalDamage * BalancingConstants.SummonerCrossClassNerf);
|
||||
|
||||
int totalDisplayedDamage = totalDamage / 5;
|
||||
int totalDisplayedDamage = (int)Math.Max(totalDamage * debuffData.MultiplierDamageTickSize, debuffData.MinimumDamageTickSize);
|
||||
npc.Calamity().ApplyDPSDebuff(projectileCount * totalDamage, projectileCount * totalDisplayedDamage, ref npc.lifeRegen, ref damage);
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
@@ -47,6 +52,7 @@ namespace CalamityMod.Buffs.DamageOverTime
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
BuffID.Sets.IsATagBuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class WindChilled : ModBuff
|
||||
{
|
||||
public static DebuffData debuffData = new DebuffData()
|
||||
{
|
||||
EnemyLostRegen = 12,
|
||||
NPCLifeRegenMethod = WindChilledNPCLifeRegen,
|
||||
ColdDebuffScaling = 1
|
||||
};
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
BuffDatasets.DebuffDataset[Type] = debuffData;
|
||||
}
|
||||
public static void WindChilledNPCLifeRegen(NPC npc, int buffType, ref int buffIndex, ref int damage)
|
||||
{
|
||||
var cnpc = npc.Calamity();
|
||||
|
||||
int baseDoTValue = (int)(cnpc.windChilledMult * npc.Calamity().ActiveColdDebuffMultiplier.ApplyTo(debuffData.EnemyLostRegen));
|
||||
cnpc.ApplyDPSDebuff(baseDoTValue, Math.Max((int)(baseDoTValue * debuffData.MultiplierDamageTickSize), debuffData.MinimumDamageTickSize) / 2, ref npc.lifeRegen, ref damage);
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().windChilled = true;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
npc.Calamity().windChilled = true;
|
||||
}
|
||||
|
||||
internal static void DrawEffects(PlayerDrawSet drawInfo, bool hasDebuffResistance = false)
|
||||
{
|
||||
Player player = drawInfo.drawPlayer;
|
||||
|
||||
float widthMult = 1;
|
||||
float hightMult = 1;
|
||||
Color color = Elumphant.color1;
|
||||
Color color2 = Elumphant.color2;
|
||||
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
bool start = !Main.rand.NextBool(4);
|
||||
Vector2 particleVel = Vector2.UnitY * Main.rand.NextFloat(-1.25f, 1.25f) * Math.Max(hightMult, widthMult) * (Main.rand.NextBool(5) ? 1.5f : 1) + player.velocity * 0.85f;
|
||||
Vector2 particlePos = player.Center + Main.rand.NextVector2Circular(3 * widthMult + 8, 3 * widthMult + 8) * Math.Max(hightMult, widthMult);
|
||||
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
|
||||
new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: -particleVel.ToRotation(), shrinkSpeed: 0.1f, sineRate: Main.rand.NextFloat(0.25f, 0.55f), sineIntensity: (int)(Main.rand.Next(12, 19 + 1) * Math.Max(hightMult, widthMult)));
|
||||
GeneralParticleHandler.SpawnParticle(mist, true, Enums.GeneralDrawLayer.AfterPlayers);
|
||||
}
|
||||
if (Main.rand.NextBool(11))
|
||||
{
|
||||
Vector2 dustVel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.2f, 1.1f) * Math.Max(hightMult, widthMult) * 2 * (Main.rand.NextBool(5) ? 2f : 1);
|
||||
Dust dust2 = Dust.NewDustPerfect(player.Center + dustVel * Main.rand.NextFloat(3, 4), ModContent.DustType<SquashDustPixelated>(),
|
||||
Vector2.Zero, 0, default, Main.rand.NextFloat(0.2f, 0.45f) * Math.Max(hightMult, widthMult));
|
||||
dust2.noGravity = false;
|
||||
dust2.color = Main.rand.NextBool() ? color : color2;
|
||||
dust2.customData = new Vector2(0.7f, 1.4f);
|
||||
dust2.fadeIn = 0.1f * Math.Max(hightMult, widthMult);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
float maxSizeMult = 10f;
|
||||
float widthMult = MathF.Pow(Utils.Remap(npc.width, 10, 500, 1f, maxSizeMult, false), 0.8f);
|
||||
float hightMult = MathF.Pow(Utils.Remap(npc.height, 10, 500, 1f, maxSizeMult, false), 0.8f);
|
||||
Color color = Elumphant.color1;
|
||||
Color color2 = Elumphant.color2;
|
||||
float sine = (float)Math.Sin((Main.GlobalTimeWrappedHourly * 9.0f) / MathHelper.Pi);
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
bool start = !Main.rand.NextBool(4);
|
||||
Vector2 particleVel = Vector2.UnitY * Main.rand.NextFloat(-1.25f, 1.25f) * Math.Max(hightMult, widthMult) * (Main.rand.NextBool(5) ? 1.5f : 1) + npc.velocity * 0.85f;
|
||||
Vector2 particlePos = npc.Center + Main.rand.NextVector2Circular(3 * widthMult + 8, 3 * widthMult + 8) * Math.Max(hightMult, widthMult);
|
||||
Particle mist = new CustomPulsingSpark(particlePos, particleVel, "CalamityMod/Particles/ThinSparkle", "CalamityMod/Particles/BloomCircle", false, 65, Main.rand.NextFloat(0.95f, 1.35f) * MathF.Pow(widthMult, 0.45f), start ? color : color2, start ? color2 : color,
|
||||
new Vector2(0.6f, 1.2f), true, true, Main.rand.Next(4, 7 + 1), colorFadeSpeed: 0.85f, noShrink: true, extraRotation: -particleVel.ToRotation(), shrinkSpeed: 0.1f, sineRate: Main.rand.NextFloat(0.25f, 0.55f), sineIntensity: (int)(Main.rand.Next(12, 19 + 1) * Math.Max(hightMult, widthMult)));
|
||||
GeneralParticleHandler.SpawnParticle(mist, true, Main.rand.NextBool() ? Enums.GeneralDrawLayer.AfterNPCs : Enums.GeneralDrawLayer.BeforeNPCs);
|
||||
}
|
||||
if (Main.rand.NextBool(11))
|
||||
{
|
||||
Vector2 dustVel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.2f, 1.1f) * Math.Max(hightMult, widthMult) * 2 * (Main.rand.NextBool(5) ? 2f : 1);
|
||||
Dust dust2 = Dust.NewDustPerfect(npc.Center + dustVel * Main.rand.NextFloat(3, 4), ModContent.DustType<SquashDustPixelated>(),
|
||||
Vector2.Zero, 0, default, Main.rand.NextFloat(0.2f, 0.45f) * Math.Max(hightMult, widthMult));
|
||||
dust2.noGravity = false;
|
||||
dust2.color = Main.rand.NextBool() ? color : color2;
|
||||
dust2.customData = new Vector2(0.7f, 1.4f);
|
||||
dust2.fadeIn = 0.1f * Math.Max(hightMult, widthMult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.DataStructures;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Potions
|
||||
{
|
||||
public class SwinesWrathBuff : ModBuff
|
||||
{
|
||||
public static readonly SoundStyle TimerSound = new("CalamityMod/Sounds/Custom/TickingTimer");
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = false;
|
||||
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
TheConcoctionPlayer concoctionPlayer = player.GetModPlayer<TheConcoctionPlayer>();
|
||||
|
||||
if (concoctionPlayer.swinesWrathCounter < 2 && concoctionPlayer.swinesWrathCounter != -1)
|
||||
{
|
||||
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SwinesWrath" + Main.rand.Next(1, 7 + 1)).ToNetworkText(player.name)), 1000, -1);
|
||||
concoctionPlayer.swinesWrathCounter = -1;
|
||||
}
|
||||
|
||||
else if (concoctionPlayer.swinesWrathCounter % 60 == 59)
|
||||
SoundEngine.PlaySound(TimerSound with { Volume = ((600f - concoctionPlayer.swinesWrathCounter) / 600f) }, player.Center); // Gets louder as time progresses
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 522 B |
@@ -0,0 +1,22 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.StatDebuffs
|
||||
{
|
||||
public class Malnourished : ModBuff
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.Calamity().malnourished = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 798 B |
@@ -43,6 +43,7 @@ using CalamityMod.Items.PermanentBoosters;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.Tools.ClimateChange;
|
||||
using CalamityMod.Items.TreasureBags.MiscGrabBags;
|
||||
@@ -60,7 +61,6 @@ using CalamityMod.Particles;
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
@@ -69,6 +69,7 @@ using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using CalamityMod.Systems.Mechanic;
|
||||
using CalamityMod.Utilities;
|
||||
using CalamityMod.Waters;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -84,7 +85,6 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.Net;
|
||||
using Terraria.WorldBuilding;
|
||||
using static Terraria.Main;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
@@ -140,6 +140,13 @@ namespace CalamityMod.CalPlayer
|
||||
/// </summary>
|
||||
public bool heldGaelsLastFrame = false;
|
||||
/// <summary>
|
||||
/// Tracks whether or not the player is currently holding Elephant Killer.<br/>
|
||||
/// Used to reset stealth when swapping to this item.
|
||||
/// </summary>
|
||||
public bool heldElephantKillerLastFrame = false;
|
||||
public float elephantKillerJoke = 0;
|
||||
public bool drawingElephantKillerJoke = false;
|
||||
/// <summary>
|
||||
/// Tracks whether or not the player currently has Draedon's Heart equipped.<br/>
|
||||
/// Used to reset Adrenaline when (un)equipped to prevent exploits.
|
||||
/// </summary>
|
||||
@@ -379,9 +386,12 @@ namespace CalamityMod.CalPlayer
|
||||
public int hideOfDeusMeleeBoostTimer = 0;
|
||||
/// <summary>
|
||||
/// The player's alcohol level. Increased by 1 for each alcohol the player has drank, 2 for Everclear.<br/>
|
||||
/// If this value is greater than 3, the player is inflicted with Alcohol Poisoning.
|
||||
/// If this value is greater than the max (normally 3), the player is inflicted with Alcohol Poisoning.
|
||||
/// </summary>
|
||||
public int alcoholPoisonLevel = 0;
|
||||
public static int alcoholPoisonMaxBase = 3;
|
||||
/// <summary> The maximum alcohol level the player can reach before getting Alcohol Poisoning. </summary>
|
||||
public int alcoholPoisonMax = alcoholPoisonMaxBase;
|
||||
public int dashTimeMod;
|
||||
/// <summary>
|
||||
/// Timer variable which tracks how long the player has spent outside of Providence's border radius, in frames.<br/>
|
||||
@@ -804,6 +814,7 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Accessory
|
||||
public int friendlyMinions = 0;
|
||||
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
|
||||
public bool yharimsGift = false;
|
||||
public bool luxorsGift = false;
|
||||
@@ -862,6 +873,11 @@ namespace CalamityMod.CalPlayer
|
||||
public bool ascendantInsignia = false;
|
||||
public int ascendantInsigniaBuffTime = 0;
|
||||
public int ascendantInsigniaCooldown = 0;
|
||||
public bool fishStocks = false;
|
||||
public float fishStockVisual = 0;
|
||||
public float fishStockPower = 0;
|
||||
public float fishStockSlidingPower = 0;
|
||||
public (float, float, float, float, float) fishStockOldPower = (0, 0, 0, 0, 0);
|
||||
/// <summary> Used to toggle dust spawned while swinging, through accessory visibility. </summary>
|
||||
public bool magmaStoneVisuals = true;
|
||||
public bool eGauntlet = false;
|
||||
@@ -1033,6 +1049,10 @@ namespace CalamityMod.CalPlayer
|
||||
/// At 0f, the player has regular crit damage. At 1f, the player has +100% crit damage.
|
||||
/// </summary>
|
||||
public float critDamage = 0;
|
||||
/// <summary>
|
||||
/// Multiplies the amount of coins the player gets from enemies.
|
||||
/// </summary>
|
||||
public float coinDropMult = 1f;
|
||||
public bool darkSunRing = false;
|
||||
public bool crawCarapace = false;
|
||||
public bool baroclaw = false;
|
||||
@@ -1129,6 +1149,11 @@ namespace CalamityMod.CalPlayer
|
||||
public bool scionsCurioGotHit = false;
|
||||
public bool scionsCurioVisuals = false;
|
||||
public float scionsCurioDebuffDamage = 0;
|
||||
public bool frozenCube = false;
|
||||
public bool frozenCubeVisuals = false;
|
||||
public float frozenCubeDebuffBoost = 0;
|
||||
public float frozenCubeElumphantBoost = 0;
|
||||
public int frozenCubeUsedDefense = 0;
|
||||
public bool miniOldDuke = false;
|
||||
public bool miniOldDukeVanity = false;
|
||||
public bool starbusterCore = false;
|
||||
@@ -1395,6 +1420,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool riptide = false;
|
||||
public bool hadopelagicPressure = false;
|
||||
public bool fishAlert = false;
|
||||
public bool malnourished = false;
|
||||
public bool clamity = false;
|
||||
public bool NOU = false;
|
||||
public bool absorberAffliction = false;
|
||||
@@ -1407,6 +1433,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool vaporfied = false;
|
||||
public bool banishingFire = false;
|
||||
public bool wither = false;
|
||||
public bool windChilled = false;
|
||||
public bool ManaBurn = false;
|
||||
|
||||
/// <summary> Counter variable used to prevent the player from being inflicted with another immobilizing debuff for a short time after being inflicted with one. </summary>
|
||||
@@ -1486,6 +1513,8 @@ namespace CalamityMod.CalPlayer
|
||||
public bool whiteWine = false;
|
||||
public float whiteWineTimer = 0;
|
||||
public bool evergreenGin = false;
|
||||
public bool baconOil = false;
|
||||
public int baconOilSoundCooldown = 0;
|
||||
public bool tranquilityCandle = false;
|
||||
public bool chaosCandle = false;
|
||||
public bool blueCandle = false;
|
||||
@@ -2162,6 +2191,7 @@ namespace CalamityMod.CalPlayer
|
||||
externalAuricRejectionImmunity = false;
|
||||
|
||||
alcoholPoisonLevel = 0;
|
||||
alcoholPoisonMax = alcoholPoisonMaxBase;
|
||||
noLifeRegen = false;
|
||||
|
||||
//Stratus Starburst amount management
|
||||
@@ -2251,6 +2281,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (!pSoulArtifact)
|
||||
pSoulShieldDurability = 0;
|
||||
}
|
||||
friendlyMinions = 0;
|
||||
pSoulShieldVisible = false;
|
||||
roverDrive = false;
|
||||
roverDriveShieldVisible = false;
|
||||
@@ -2421,6 +2452,7 @@ namespace CalamityMod.CalPlayer
|
||||
teslaVisuals = true;
|
||||
cryogenSoul = false;
|
||||
ascendantInsignia = false;
|
||||
fishStocks = false;
|
||||
magmaStoneVisuals = true;
|
||||
eGauntlet = false;
|
||||
eGauntletVisuals = true;
|
||||
@@ -2510,6 +2542,7 @@ namespace CalamityMod.CalPlayer
|
||||
camper = false;
|
||||
corrosiveSpine = false;
|
||||
scionsCurio = false;
|
||||
frozenCube = false; frozenCubeDebuffBoost = 0; frozenCubeElumphantBoost = 0; frozenCubeUsedDefense = 0;
|
||||
rottenDogTooth = false;
|
||||
angelicAlliance = false;
|
||||
ChaosStone = false;
|
||||
@@ -2695,6 +2728,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
enraged = false;
|
||||
@@ -2708,6 +2742,7 @@ namespace CalamityMod.CalPlayer
|
||||
vaporfied = false;
|
||||
banishingFire = false;
|
||||
wither = false;
|
||||
windChilled = false;
|
||||
ManaBurn = false;
|
||||
|
||||
TypelessDebuffMultiplier = new();
|
||||
@@ -2782,6 +2817,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
@@ -3071,6 +3107,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.HeldItem.IsAir || Player.HeldItem.fishingPole == 0)
|
||||
consecutiveCaughtFish = 0;
|
||||
heldGaelsLastFrame = false;
|
||||
heldElephantKillerLastFrame = false;
|
||||
partialLifeRegenCounter = 0f;
|
||||
gaelSwipes = 0;
|
||||
whitewaterHeal = 0;
|
||||
@@ -3096,6 +3133,7 @@ namespace CalamityMod.CalPlayer
|
||||
holyInfernoFadeIntensity = 0f;
|
||||
spiritOriginCritBoost = 0;
|
||||
critDamage = 0f;
|
||||
coinDropMult = 1f;
|
||||
rage = 0f;
|
||||
adrenaline = 0f;
|
||||
raiderCritLifespan = 0;
|
||||
@@ -3179,6 +3217,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
snowmanNoseless = false;
|
||||
@@ -3191,6 +3230,7 @@ namespace CalamityMod.CalPlayer
|
||||
vaporfied = false;
|
||||
banishingFire = false;
|
||||
wither = false;
|
||||
windChilled = false;
|
||||
ImmobilityDebuffImmunityTimer = 0;
|
||||
TypelessDebuffMultiplier = new();
|
||||
HeatDebuffMultiplier = new();
|
||||
@@ -3293,6 +3333,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
blueCandle = false;
|
||||
@@ -4274,12 +4315,217 @@ namespace CalamityMod.CalPlayer
|
||||
vector = player.CheckForGoodTeleportationSpot(ref canSpawn, halfWorldXTiles + smallerCheckRadius, smallerCheckRadius, teleportStartY, teleportRangeY, settings);
|
||||
|
||||
if (canSpawn)
|
||||
{
|
||||
return (Vector2?)vector;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Lihzhard Temple to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetTempleTeleportPosition(Player player)
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchEnd = dungeonOnRightSide ? 20 : Main.maxTilesX - 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
{
|
||||
for (int i = Main.spawnTileX; i >= xSearchEnd; i -= 2)
|
||||
{
|
||||
for (int j = (int)Main.worldSurface; j < Main.maxTilesY - 210; j++)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
foundX = i;
|
||||
foundY = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundX != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = Main.spawnTileX; i <= xSearchEnd; i += 2)
|
||||
{
|
||||
for (int j = (int)Main.worldSurface; j < Main.maxTilesY - 210; j++)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(i, j);
|
||||
if (tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
foundX = i;
|
||||
foundY = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundX != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundX == -1)
|
||||
return null;
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 300;
|
||||
int rangeY = 300;
|
||||
int randomFluff = 500;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = 0; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = foundX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = foundY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasTile && tile.WallType == WallID.LihzahrdBrickUnsafe)
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finalTeleportPoint.ToWorldCoordinates() - new Vector2(player.width, player.height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Void (Abyss Layer 4) to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetAbyssVoidTeleportPosition(Player player)
|
||||
{
|
||||
bool canSpawn = false;
|
||||
int halfWorldWidth = Main.maxTilesX / 2;
|
||||
|
||||
int abyssStartX = Abyss.AtLeftSideOfWorld ? halfWorldWidth - (halfWorldWidth - 135) + 35 : halfWorldWidth + (halfWorldWidth - 135) - 35;
|
||||
int abyssXRange = 50;
|
||||
|
||||
int teleportStartY = Main.remixWorld ? SulphurousSea.YStart - (int)(Main.UnderworldLayer * 0.6f) : Main.maxTilesY - 300;
|
||||
int teleportRangeY = 80;
|
||||
|
||||
Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings
|
||||
{
|
||||
mostlySolidFloor = false,
|
||||
avoidAnyLiquid = false,
|
||||
avoidLava = true,
|
||||
avoidHurtTiles = true,
|
||||
avoidWalls = false,
|
||||
attemptsBeforeGivingUp = 1000,
|
||||
maximumFallDistanceFromOrignalPoint = 10
|
||||
};
|
||||
|
||||
Vector2 teleportPosition = player.CheckForGoodTeleportationSpot(ref canSpawn, abyssStartX, abyssXRange, teleportStartY, teleportRangeY, settings);
|
||||
return canSpawn ? teleportPosition : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a random position in the Forsaken Archives to teleport the player to. <br></br>
|
||||
/// Used primarily for <see cref="Items.Potions.TheElixir"/>.
|
||||
/// </summary>
|
||||
public static Vector2? GetDungeonArchivesTeleportPosition(Player player)
|
||||
{
|
||||
// Define an area around the center to search for a valid spot to tp
|
||||
int teleportStartX = WorldgenManagementSystem.DungeonArchivePos.X;
|
||||
int teleportStartY = WorldgenManagementSystem.DungeonArchivePos.Y;
|
||||
|
||||
// Manually search for the Archives from the bottom of the world if the Archive position isn't saved.
|
||||
if (WorldgenManagementSystem.DungeonArchivePos == Point.Zero)
|
||||
{
|
||||
int foundX = -1;
|
||||
int foundY = -1;
|
||||
bool dungeonOnRightSide = Main.dungeonX > Main.spawnTileX;
|
||||
int xSearchStart = dungeonOnRightSide ? Main.maxTilesX - 20 : 20;
|
||||
|
||||
if (dungeonOnRightSide)
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x >= Main.maxTilesX / 2; x -= 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int y = Main.UnderworldLayer; y > (int)Main.rockLayer; y--)
|
||||
{
|
||||
for (int x = xSearchStart; x <= Main.maxTilesX / 2; x += 2)
|
||||
{
|
||||
Tile tile = Framing.GetTileSafely(x, y);
|
||||
if (Main.wallDungeon[tile.WallType] && Main.tileDungeon[tile.TileType])
|
||||
{
|
||||
foundX = x;
|
||||
foundY = y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY != -1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundY == -1)
|
||||
return null;
|
||||
|
||||
teleportStartX = foundX;
|
||||
teleportStartY = foundY;
|
||||
}
|
||||
|
||||
int attempts = 25;
|
||||
int rangeX = 100;
|
||||
int rangeY = 200;
|
||||
int randomFluff = 60;
|
||||
Point finalTeleportPoint = Point.Zero;
|
||||
for (int i = 0; i < attempts; i++)
|
||||
{
|
||||
for (int x = -rangeX; x <= rangeX; x++)
|
||||
{
|
||||
for (int y = 0; y <= rangeY; y++)
|
||||
{
|
||||
int teleportPosX = teleportStartX + x + Main.rand.Next(-randomFluff, randomFluff);
|
||||
int teleportPosY = teleportStartY + y + Main.rand.Next(-randomFluff, randomFluff);
|
||||
Tile tile = Framing.GetTileSafely(teleportPosX, teleportPosY);
|
||||
Tile tileAbove = Framing.GetTileSafely(teleportPosX, teleportPosY - 1);
|
||||
Tile tileBelow = Framing.GetTileSafely(teleportPosX, teleportPosY + 1);
|
||||
|
||||
if (!tileAbove.HasTile && tileBelow.HasUnactuatedTile && Main.wallDungeon[tile.WallType])
|
||||
{
|
||||
finalTeleportPoint = new(tile.X(), tile.Y());
|
||||
if (!Collision.SolidCollision(finalTeleportPoint.ToWorldCoordinates(), player.width, player.height))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return finalTeleportPoint.ToWorldCoordinates() - new Vector2(player.width, player.height);
|
||||
}
|
||||
|
||||
public static void ModTeleport(Player player, Vector2 pos, bool playSound = true, int style = TeleportationStyleID.RecallPotion)
|
||||
{
|
||||
bool postImmune = player.immune;
|
||||
@@ -4596,12 +4842,12 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
//Multiply vertical speed
|
||||
if (redWine)
|
||||
if (redWine || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine))
|
||||
{
|
||||
if (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f)
|
||||
{
|
||||
redWineStoredY = Player.velocity.Y;
|
||||
Player.velocity.Y *= 1 + RedWine.VerticalSpeedBoost;
|
||||
Player.velocity.Y *= 1 + (redWine ? RedWine.VerticalSpeedBoost : 0) + (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine) ? RedWine.VerticalSpeedBoost : 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4850,6 +5096,32 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
|
||||
{
|
||||
alcoholPoisonMax += TheSandwich.alcoholCapBoost;
|
||||
// Gives inverted buffs from well fed
|
||||
Player.statDefense -= 2;
|
||||
Player.GetCritChance<GenericDamageClass>() -= 2;
|
||||
Player.minionKB -= 0.5f;
|
||||
Player.moveSpeed -= 0.05f;
|
||||
// damage nerf/boost happens in PostUpdate
|
||||
Player.pickSpeed += 0.05f;
|
||||
|
||||
|
||||
for (int l = 0; l < Player.MaxBuffs; ++l)
|
||||
{
|
||||
int buffID = Player.buffType[l];
|
||||
if ((BuffDatasets.DebuffDataset[buffID] != null && BuffDatasets.DebuffDataset[buffID].AlcoholLevel > 0) || buffID == BuffID.Tipsy)
|
||||
{
|
||||
Player.buffTime[l]++;
|
||||
}
|
||||
}
|
||||
|
||||
if (Player.wellFed)
|
||||
Player.ClearBuff(ModContent.BuffType<Malnourished>());
|
||||
}
|
||||
|
||||
if (moonshine)
|
||||
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
|
||||
ForceVariousEffects();
|
||||
@@ -4882,7 +5154,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region PostUpdateEquips
|
||||
public override void PostUpdateEquips()
|
||||
{
|
||||
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
var item = Player.HeldItem;
|
||||
if (!(item.IsAir || item.damage <= 0))
|
||||
{
|
||||
@@ -4891,11 +5163,13 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingMelee++;
|
||||
if (TimeHoldingMelee > Whiskey.TimeToDischarge)
|
||||
TimeHoldingMelee = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
}
|
||||
} else
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Melee) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingMelee / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeHoldingMelee -= 2;
|
||||
if (TimeHoldingMelee < 0)
|
||||
@@ -4905,11 +5179,12 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
TimeHoldingRanged++;
|
||||
if (TimeHoldingRanged > Whiskey.TimeToDischarge)
|
||||
TimeHoldingRanged = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
}
|
||||
TimeHoldingRanged = (int)Whiskey.TimeToDischarge;
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Ranged) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingRanged / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4922,10 +5197,11 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingMagic++;
|
||||
if (TimeHoldingMagic > Whiskey.TimeToDischarge)
|
||||
TimeHoldingMagic = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Magic) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingMagic / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4938,10 +5214,11 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingSummon++;
|
||||
if (TimeHoldingSummon > Whiskey.TimeToDischarge)
|
||||
TimeHoldingSummon = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(DamageClass.Summon) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingSummon / Whiskey.TimeToDischarge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4954,10 +5231,12 @@ namespace CalamityMod.CalPlayer
|
||||
TimeHoldingRogue++;
|
||||
if (TimeHoldingRogue > Whiskey.TimeToDischarge)
|
||||
TimeHoldingRogue = (int)Whiskey.TimeToDischarge;
|
||||
if (whiskey)
|
||||
{
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.MaxDamageBoost, Whiskey.MinDamageBoost, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Whiskey) && whiskey)
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.CombinedDamageCeiling, Whiskey.CombinedDamageFloor, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
else if (whiskey || dripPlayer.HasAlcohol(AlcoholType.Whiskey))
|
||||
Player.GetDamage(RogueDamageClass.Instance) += MathHelper.Lerp(Whiskey.StandardDamageCeiling, Whiskey.StandardDamageFloor, TimeHoldingRogue / Whiskey.TimeToDischarge);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4978,6 +5257,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (TimeHoldingRogue-- < 0)
|
||||
TimeHoldingRogue = 0;
|
||||
}
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Moonshine))
|
||||
{
|
||||
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
|
||||
}
|
||||
|
||||
|
||||
// PostUpdateMiscEffects runs after the cap has been applied. Do NOT put mining speed stuff there.
|
||||
@@ -5080,6 +5363,9 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (Player.Calamity().XykVisualsBlue || Player.Calamity().XykVisualsOrange)
|
||||
Player.wings = 0;
|
||||
|
||||
if (ZoneAbyss && Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
//Main aura
|
||||
@@ -5114,7 +5400,7 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
//reset the stored Y value for red wine's increased vertical speed
|
||||
if (redWine && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f))
|
||||
if ((redWine || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine)) && (redWineStoredY > 0.2f || redWineStoredY < -0.2f) && (Player.velocity.Y > 0.2f || Player.velocity.Y < -0.2f))
|
||||
{
|
||||
Player.velocity.Y = redWineStoredY;
|
||||
}
|
||||
@@ -5133,6 +5419,17 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Frozen Cube defense cut
|
||||
if (Player.Calamity().frozenCube)
|
||||
{
|
||||
int usedDefense = (Player.statDefense / FrozenCube.usedDefenseDivide);
|
||||
Player.Calamity().frozenCubeUsedDefense = usedDefense;
|
||||
Player.statDefense -= usedDefense;
|
||||
}
|
||||
|
||||
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
|
||||
Player.GetDamage<GenericDamageClass>() += -0.05f + TheSandwich.statBoost * alcoholPoisonLevel;
|
||||
|
||||
// Relic of Convergence defense cut
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicOfConvergenceCrystal>()] > 0 && Player.HeldItem.type == ModContent.ItemType<RelicOfConvergence>())
|
||||
Player.statDefense *= RelicOfConvergence.DefenseMultiplier;
|
||||
@@ -5264,6 +5561,92 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
if ((Player.Calamity().baconOil || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.BaconOil)) && !Player.mount.Active)
|
||||
{
|
||||
Player.noFallDmg = true;
|
||||
|
||||
float stackScale = (Player.Calamity().baconOil && Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.BaconOil)) ? 1.33f : 1;
|
||||
|
||||
float velX = Math.Abs(Player.velocity.X);
|
||||
float velY = Math.Abs(Player.velocity.Y);
|
||||
|
||||
float speedMult = Player.GetBestClassDamage().ApplyTo(1);
|
||||
float maxMoveSpeed = 10.5f * speedMult * stackScale;
|
||||
float minMoveSpeed = 3 * stackScale; // Minimum move speed to be at if the player can bounce
|
||||
float hitboxSizeMult = 0.45f;
|
||||
|
||||
bool onPlatform = false;
|
||||
if (Player.velocity.Y > 0 && !Player.controlDown)
|
||||
{
|
||||
for (int i = 4; i < 8; i++)
|
||||
{
|
||||
Point bottom = (Player.Bottom + Vector2.UnitY * i).ToTileCoordinates();
|
||||
if (TileID.Sets.Platforms[CalamityUtils.ParanoidTileRetrieval(bottom.X, bottom.Y).TileType])
|
||||
{
|
||||
onPlatform = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool hitDown = velY > minMoveSpeed && (Collision.SolidCollision(Player.Bottom + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1) || onPlatform);
|
||||
bool hitUp = velY > minMoveSpeed && Collision.SolidCollision(Player.Top + Vector2.UnitY * Player.velocity.Y, (int)(Player.width * hitboxSizeMult), 1);
|
||||
bool hitSide = velX > minMoveSpeed && Collision.SolidCollision(Vector2.Lerp(Player.TopLeft, Player.Left, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult)) || Collision.SolidCollision(Vector2.Lerp(Player.TopRight, Player.Right, 0.15f) + Vector2.UnitX * Player.velocity.X, 1, (int)(Player.height * hitboxSizeMult));
|
||||
float acceleration = 0.05f * stackScale;
|
||||
float decceleration = -0.025f / speedMult;
|
||||
float riseSpeed = 0.8f * stackScale; // The speed the player rises when in water or rain
|
||||
float slipPower = 0.85f; //How strong the slippery effect is
|
||||
|
||||
float bounceReduction = 0.9f;
|
||||
bool makeSound = false;
|
||||
if (hitSide)
|
||||
{
|
||||
Player.velocity.X = -Player.velocity.X * bounceReduction;
|
||||
Player.oldVelocity.X = -Player.oldVelocity.X * bounceReduction;
|
||||
makeSound = true;
|
||||
}
|
||||
if ((hitDown || hitUp))
|
||||
{
|
||||
if (Player.controlUp)
|
||||
bounceReduction = 1.3f;
|
||||
Player.velocity.Y = -Player.velocity.Y * bounceReduction;
|
||||
Player.oldVelocity.Y = -Player.oldVelocity.Y * bounceReduction;
|
||||
if (hitDown)
|
||||
{
|
||||
Player.RefreshMovementAbilities(true);
|
||||
}
|
||||
makeSound = true;
|
||||
}
|
||||
int soundCDMax = 150;
|
||||
if (makeSound && baconOilSoundCooldown < soundCDMax)
|
||||
{
|
||||
if (baconOilSoundCooldown < soundCDMax)
|
||||
baconOilSoundCooldown += 30;
|
||||
float pitch = (0.55f * stackScale) * Utils.GetLerpValue(0, soundCDMax, baconOilSoundCooldown, true);
|
||||
SoundStyle boyoyoing = new("CalamityMod/Sounds/Item/BaconOilBounce");
|
||||
SoundEngine.PlaySound(boyoyoing with { Volume = 0.45f, Pitch = hitSide ? pitch - 0.3f : pitch, MaxInstances = 5 }, Player.Center);
|
||||
}
|
||||
|
||||
bool playerMoving = Player.controlLeft || Player.controlRight;
|
||||
bool playerMovingInDirection = (Player.controlLeft && Player.oldVelocity.X < 0) || (Player.controlRight && Player.oldVelocity.X > 0);
|
||||
if (((Player.oldVelocity.X > 0 && Player.velocity.X > 0) || (Player.oldVelocity.X < 0 && Player.velocity.X < 0)))
|
||||
Player.velocity.X = MathHelper.Clamp(Player.velocity.X + maxMoveSpeed * MathF.Sign(Player.oldVelocity.X) *
|
||||
((playerMovingInDirection || !playerMoving) ? Player.dashDelay == -1 ? decceleration : // If dashing, deccelerate to prevent infinite dash
|
||||
// If not moving or holding in move direction, accelerate to max speed, otherwise deccelerate
|
||||
acceleration : decceleration), -maxMoveSpeed, maxMoveSpeed);
|
||||
|
||||
bool raining = Player.Center.Y < Main.worldSurface * 16.0 && Main.raining;
|
||||
if ((Player.wet || raining) && Player.velocity.Y > -maxMoveSpeed)
|
||||
{
|
||||
Player.velocity.Y -= riseSpeed; // Cover yourself in oil (go up in liquid)
|
||||
}
|
||||
|
||||
|
||||
Vector2 lerpedVel = Vector2.Lerp(Player.velocity, Player.oldVelocity, slipPower);
|
||||
Player.velocity = new Vector2(lerpedVel.X, Player.velocity.Y);
|
||||
}
|
||||
if (baconOilSoundCooldown > 0)
|
||||
baconOilSoundCooldown = (int)MathHelper.Lerp(baconOilSoundCooldown, 0, 0.027f);
|
||||
|
||||
Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it
|
||||
}
|
||||
#endregion
|
||||
@@ -5295,7 +5678,8 @@ namespace CalamityMod.CalPlayer
|
||||
// Apply weapon modifier stealth strike damage bonus
|
||||
// 01OCT2023: Ozzatron: This is a multiplicative bonus because it is a prefix.
|
||||
// It should be equivalent to x1.15 (or whatever multiplier) on the base damage of the weapon for stealth only.
|
||||
if (rogueItem.StealthStrikePrefixBonus != 0f && StealthStrikeAvailable())
|
||||
bool dontProvideStealthDamage = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (rogueItem.StealthStrikePrefixBonus != 0f && StealthStrikeAvailable() && !dontProvideStealthDamage)
|
||||
damage *= rogueItem.StealthStrikePrefixBonus; // This number centers on 1f, so 1.15f = 1.15x damage.
|
||||
}
|
||||
}
|
||||
@@ -5307,6 +5691,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (moscowMule)
|
||||
knockback += MoscowMule.KnockbackBoost;
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.MoscowMule))
|
||||
knockback += MoscowMule.KnockbackBoost;
|
||||
|
||||
if (titanHeartMantle && rogue)
|
||||
knockback += TitanHeartMantle.RogueKnockbackBoost;
|
||||
@@ -5485,7 +5871,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (bladeArmEnchant)
|
||||
return false;
|
||||
if (purpleHaze)
|
||||
if (purpleHaze || Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.PurpleHaze))
|
||||
{
|
||||
if (item.CountsAsClass<RogueDamageClass>() && StealthStrikeAvailable())
|
||||
{
|
||||
@@ -6018,6 +6404,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (it.type == ItemType<DoomsdayDevice>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Elephant Killer consumes stealth in a special wa- hey maybe this is a sign this class needs some work huh
|
||||
if (it.type == ItemType<ElephantKiller>())
|
||||
playerUsingWeapon = false;
|
||||
|
||||
// Animation check depends on whether the item is "clockwork", like Clockwork Assault Rifle.
|
||||
// "Clockwork" weapons can chain-fire multiple stealth strikes (really only 2 max) until you run out of stealth.
|
||||
bool animationCheck = it.useAnimation == it.useTime
|
||||
@@ -6084,7 +6474,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.ownedProjectileCounts[ProjectileType<FinalDawnThrow2>()];
|
||||
|
||||
// If you are actively using an item, you cannot gain stealth.
|
||||
if (Player.itemAnimation > 0 || finalDawnProjCount > 0)
|
||||
if (Player.itemAnimation > 0 || finalDawnProjCount > 0 || (Player.ownedProjectileCounts[ProjectileType<ElephantKillerThrown>()] > 0 || Player.HeldItem.type == ModContent.ItemType<ElephantKiller>()))
|
||||
return 0f;
|
||||
|
||||
if (shadow)
|
||||
|
||||
@@ -584,6 +584,9 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (calamityPlayer.vHex && drawInfo.shadow == 0f)
|
||||
VulnerabilityHex.DrawEffects(drawInfo);
|
||||
|
||||
if (calamityPlayer.windChilled && drawInfo.shadow == 0f)
|
||||
WindChilled.DrawEffects(drawInfo);
|
||||
#endregion
|
||||
|
||||
if (calamityPlayer.fortunesFavor && drawInfo.shadow == 0f)
|
||||
|
||||
@@ -438,6 +438,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.ZoneSkyHeight && fishingRod.type == ModContent.ItemType<HeronRod>())
|
||||
fishingLevel = fishingLevel * HeronRod.FishingPowerBiomeMult;
|
||||
|
||||
// Rage bait gives free sonar effect
|
||||
if (bait.type == ModContent.ItemType<RageBait>())
|
||||
Player.sonarPotion = true;
|
||||
|
||||
// Prevent the player from fishing if they have the Bloodworm
|
||||
if (bait.type == ModContent.ItemType<BloodwormItem>())
|
||||
{
|
||||
|
||||
@@ -284,6 +284,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
|
||||
{
|
||||
if (fishStocks && fishStockPower < 0)
|
||||
{
|
||||
string year = DateTime.Now.ToString("yy");
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FishStocks" + Main.rand.Next(1, 6 + 1)).ToNetworkText(Player.name, year));
|
||||
}
|
||||
if (alcoholPoisoning)
|
||||
{
|
||||
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholBig" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
|
||||
@@ -480,6 +485,9 @@ namespace CalamityMod.CalPlayer
|
||||
#region Modify Hit NPC
|
||||
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (Player.Calamity().coinDropMult != 1)
|
||||
target.Calamity().coinDropMult = Player.Calamity().coinDropMult;
|
||||
|
||||
if (target.HasBuff<SmashedEvil>())
|
||||
{
|
||||
//This is essentially 10 AP, but independent of armor amount
|
||||
@@ -1354,11 +1362,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0)
|
||||
{
|
||||
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
|
||||
int cooldownTime = RelicOfResilience.baseCooldown;
|
||||
rOfResilienceCooldown = cooldownTime;
|
||||
Player.AddCooldown(Cooldowns.RelicOfResilienceCooldown.ID, cooldownTime);
|
||||
SoundStyle youGotHit = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRockShieldActivate");
|
||||
SoundEngine.PlaySound(youGotHit with { Volume = 0.7f, Pitch = -0.1f }, Player.Center);
|
||||
SoundEngine.PlaySound(youGotHit with { Volume = 0.7f, Pitch = -0.5f }, Player.Center);
|
||||
}
|
||||
|
||||
if (alchFlask)
|
||||
@@ -1529,6 +1537,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.AddCooldown(GlobalDodge.ID, cooldownDuration);
|
||||
else
|
||||
Player.AddCooldown(GlobalDodge.ID, cooldownDuration, true, IconToUse);
|
||||
Player.SetImmuneTimeForAllTypes(Player.longInvince ? 120 : 80);
|
||||
}
|
||||
|
||||
//Dodge activation order is as follows:
|
||||
@@ -1636,8 +1645,8 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
#region Player Incoming Damage Multiplier (Increases)
|
||||
double damageMult = 1D;
|
||||
if (crushingEgo) // Dimensional Soul Artifact increases incoming damage by 15%.
|
||||
damageMult += 0.15;
|
||||
if (crushingEgo)
|
||||
damageMult += 0.2;
|
||||
if (enraged) // Demonshade Enrage
|
||||
damageMult += DemonshadeHelm.MultDamageTakenBoost;
|
||||
|
||||
@@ -2888,8 +2897,9 @@ namespace CalamityMod.CalPlayer
|
||||
defenseDamageRecoveryFrames = 0;
|
||||
|
||||
// Directly add the base defense damage recovery time to whatever recovery time the player already has.
|
||||
int baseTime = DefenseDamageBaseRecoveryTime * (moonshine ? 3 : 1);
|
||||
int baseTime = DefenseDamageBaseRecoveryTime * (moonshine ? 3 : 1) * (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Moonshine) ? 3 : 1);
|
||||
totalDefenseDamageRecoveryFrames = defenseDamageRecoveryFrames + baseTime;
|
||||
|
||||
if (totalDefenseDamageRecoveryFrames > DefenseDamageMaxRecoveryTime)
|
||||
totalDefenseDamageRecoveryFrames = DefenseDamageMaxRecoveryTime;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.CalPlayer.Dashes;
|
||||
using CalamityMod.DataStructures;
|
||||
@@ -12,9 +13,7 @@ using CalamityMod.Items.Armor.Silva;
|
||||
using CalamityMod.Items.Armor.Tarragon;
|
||||
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Potions.Food;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
@@ -102,6 +101,7 @@ namespace CalamityMod.CalPlayer
|
||||
ApplyDoTDebuff(whisperingDeath, 0, laudanum);
|
||||
|
||||
ApplyDoTDebuff(irradiated, 4);
|
||||
ApplyDoTDebuff(windChilled, 4);
|
||||
int sulphurDoT = 6 - (sulphurSet ? 2 : 0) - (sulphurskin ? 2 : 0) - (corrosiveSpine ? 2 : 0);
|
||||
ApplyDoTDebuff(sulphurPoison, sulphurDoT);
|
||||
ApplyDoTDebuff(riptide, 6);
|
||||
@@ -191,17 +191,34 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Alcohol
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int buff = Player.buffType[l];
|
||||
if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level))
|
||||
alcoholPoisonLevel += level;
|
||||
if (buff <= 0) continue;
|
||||
|
||||
var data = BuffDatasets.DebuffDataset[buff];
|
||||
if (data?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += data.AlcoholLevel;
|
||||
}
|
||||
if (Player.Calamity().ivDrip) // +1 stack of poisoning while IV Drip is equipped
|
||||
alcoholPoisonLevel++;
|
||||
|
||||
if (dripPlayer.ivDripEquipped && dripPlayer.currentAlcohol != AlcoholType.None)
|
||||
{
|
||||
int ivBuffID = BuffDatasets.GetBuffIDFromAlcoholType(dripPlayer.currentAlcohol);
|
||||
|
||||
if (ivBuffID != -1)
|
||||
{
|
||||
var ivData = BuffDatasets.DebuffDataset[ivBuffID];
|
||||
if (ivData?.AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += ivData.AlcoholLevel;
|
||||
}
|
||||
}
|
||||
|
||||
if (everclear)
|
||||
totalNegativeLifeRegen += Everclear.RegenLoss;
|
||||
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Everclear))
|
||||
totalNegativeLifeRegen += Everclear.RegenLoss;
|
||||
// Blanket effect for all alcohols
|
||||
if (alcoholPoisonLevel > 0)
|
||||
{
|
||||
@@ -213,7 +230,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.fishingSkill += 5;
|
||||
|
||||
}
|
||||
if (alcoholPoisonLevel > 3)
|
||||
if (alcoholPoisonLevel > alcoholPoisonMax)
|
||||
{
|
||||
// Independently of Calamity's nerfs to Nebula life regen, it is disabled entirely by alcohol poisoning.
|
||||
Player.nebulaLevelLife = 0;
|
||||
@@ -268,8 +285,11 @@ namespace CalamityMod.CalPlayer
|
||||
// At the last second, Reaver defense helm reduces DoT debuffs by 20%
|
||||
if (reaverDefense)
|
||||
totalNegativeLifeRegen -= (int)(totalNegativeLifeRegen * ReaverHeadTank.SetBonusDebuffDamageReduction);
|
||||
|
||||
if (tequilaSunrise)
|
||||
totalNegativeLifeRegen = (int)(totalNegativeLifeRegen * TequilaSunrise.DoTMultiplier);
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.TequilaSunrise))
|
||||
totalNegativeLifeRegen = (int)(totalNegativeLifeRegen * TequilaSunrise.DoTMultiplier);
|
||||
|
||||
Player.lifeRegen -= (int)totalNegativeLifeRegen;
|
||||
|
||||
@@ -341,8 +361,18 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (tequilaSunrise)
|
||||
Player.lifeRegenTime += 1800;
|
||||
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.TequilaSunrise))
|
||||
{
|
||||
if (hadLifeRegenHinderingDebuff && !hasLifeRegenHinderingDebuff)
|
||||
{
|
||||
Player.lifeRegenTime += 1800;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
// During Silva revive or God Slayer dash, all negative life regen is canceled
|
||||
@@ -558,12 +588,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (community)
|
||||
{
|
||||
int regenBoost = 1 + (int)(TheCommunity.CalculatePower() * TheCommunity.RegenMultiplier);
|
||||
bool lesserEffect = false;
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int hasBuff = Player.buffType[l];
|
||||
lesserEffect = CalamityBuffSets.AlcoholStrength.TryGetValue(hasBuff, out var a);
|
||||
}
|
||||
bool lesserEffect = Player.buffType.Any(i => BuffDatasets.DebuffDataset[i] is not null && BuffDatasets.DebuffDataset[i].AlcoholLevel > 0);
|
||||
if (Player.lifeRegen < 0)
|
||||
Player.lifeRegen += lesserEffect ? 1 : regenBoost;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Buffs.StatBuffs;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Buffs.Summon;
|
||||
@@ -17,6 +16,7 @@ using CalamityMod.Events;
|
||||
using CalamityMod.ExtraTextures;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Accessories.Vanity;
|
||||
using CalamityMod.Items.Ammo;
|
||||
using CalamityMod.Items.Armor.Aerospec;
|
||||
using CalamityMod.Items.Armor.Auric;
|
||||
@@ -45,6 +45,7 @@ using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.AcidRain;
|
||||
@@ -239,6 +240,21 @@ namespace CalamityMod.CalPlayer
|
||||
rage = 0f;
|
||||
}
|
||||
|
||||
bool holdingElephantKiller = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (holdingElephantKiller && !heldElephantKillerLastFrame)
|
||||
{
|
||||
Player.Calamity().rogueStealth = 0;
|
||||
heldElephantKillerLastFrame = true;
|
||||
}
|
||||
else if (!holdingElephantKiller)
|
||||
heldElephantKillerLastFrame = false;
|
||||
|
||||
if (!drawingElephantKillerJoke)
|
||||
elephantKillerJoke = 0;
|
||||
else
|
||||
elephantKillerJoke++;
|
||||
drawingElephantKillerJoke = false;
|
||||
|
||||
if (furyFuel < FuryFuelMax && furyRefuelTimer >= 0)
|
||||
{
|
||||
furyFuel += (int)furyRefuelTimer;
|
||||
@@ -257,19 +273,21 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
// Apply stealth damage to rogue.
|
||||
Player.GetDamage<RogueDamageClass>() += stealthDamage;
|
||||
bool dontProvideStealthDamage = Player.HeldItem.type == ModContent.ItemType<ElephantKiller>();
|
||||
if (!dontProvideStealthDamage)
|
||||
Player.GetDamage<RogueDamageClass>() += stealthDamage;
|
||||
|
||||
if ((XykVisualsBlue || XykVisualsOrange))
|
||||
{
|
||||
bool Orange = XykVisualsOrange;
|
||||
Color effectColor = Orange ? Color.Gold : Color.DodgerBlue;
|
||||
Color effectColor = Orange ? XyksBlessingOrange.baseMainColor : XyksBlessingBlue.baseMainColor;
|
||||
|
||||
float rate = Main.GlobalTimeWrappedHourly * 12;
|
||||
List<Color> eColors = new List<Color>()
|
||||
{
|
||||
Orange ? new Color(248, 117, 52) : Color.DodgerBlue,
|
||||
Orange ? Color.Gold : Color.Cyan,
|
||||
Orange ? Color.Orange : Color.RoyalBlue
|
||||
Orange ? XyksBlessingOrange.baseMainColor : XyksBlessingBlue.baseMainColor,
|
||||
Orange ? XyksBlessingOrange.baseAccentColor : XyksBlessingBlue.baseAccentColor,
|
||||
Orange ? XyksBlessingOrange.baseEffectColor : XyksBlessingBlue.baseEffectColor
|
||||
};
|
||||
int colorIndex = (int)(rate / 2 % eColors.Count);
|
||||
Color currentColor = eColors[colorIndex];
|
||||
@@ -278,7 +296,10 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
bool rageOrAdren = (Player.Calamity().rageModeActive || Player.Calamity().adrenalineModeActive);
|
||||
bool rageAndAdren = (Player.Calamity().rageModeActive && Player.Calamity().adrenalineModeActive);
|
||||
Color attemptColor = (rageAndAdren ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) : Player.Calamity().adrenalineModeActive ? Color.MediumSpringGreen : Player.Calamity().rageModeActive ? Color.Crimson : effectColor);
|
||||
Color dashColor = Orange ? XyksBlessingOrange.animEffectColor : XyksBlessingBlue.animEffectColor;
|
||||
Color attemptColor = (rageAndAdren ? new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) :
|
||||
Player.Calamity().adrenalineModeActive ? Color.MediumSpringGreen : Player.Calamity().rageModeActive ? Color.Crimson :
|
||||
Player.dashDelay == -1 ? dashColor : effectColor);
|
||||
XykFXColor = Color.Lerp(XykFXColor, attemptColor, rageOrAdren ? 0.05f : 0.25f);
|
||||
|
||||
|
||||
@@ -430,7 +451,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (dashStart)
|
||||
{
|
||||
Player.velocity.X *= 2.2f; // +120% dash speed
|
||||
Player.velocity.X *= 1 + LeviathanAmbergris.DashSpeedIncrease;
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(LeviathanAmbergris.ambergrisDashDamage);
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), damage, 0f, Player.whoAmI);
|
||||
}
|
||||
@@ -562,9 +583,16 @@ namespace CalamityMod.CalPlayer
|
||||
if (cinnamonRoll && !(Main.getGoodWorld && Main.npc.Any(x=> x.active && x.type == ModContent.NPCType<DevourerofGodsHead>())))
|
||||
{
|
||||
if (dashStart)
|
||||
Player.velocity.X *= 3;
|
||||
Player.velocity.X *= 2f;
|
||||
else if (Player.dashDelay == -1)
|
||||
Player.velocity.X *= 0.8f;
|
||||
Player.velocity.X *= 0.825f;
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.CinnamonRoll) && !(Main.getGoodWorld && Main.npc.Any(x => x.active && x.type == ModContent.NPCType<DevourerofGodsHead>())))
|
||||
{
|
||||
if (dashStart)
|
||||
Player.velocity.X *= 2f;
|
||||
else if (Player.dashDelay == -1)
|
||||
Player.velocity.X *= 0.825f;
|
||||
}
|
||||
|
||||
if (Player.dashDelay == -1)
|
||||
@@ -1277,6 +1305,18 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Margarita))
|
||||
{
|
||||
if (Main.myPlayer == Player.whoAmI)
|
||||
{
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int buffID = Player.buffType[l];
|
||||
if (Player.buffTime[l] > 2 && CalamityBuffSets.IsDebuff[buffID])
|
||||
Player.buffTime[l]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the Providence Burn effect drawer if applicable.
|
||||
float providenceBurnIntensity = 0f;
|
||||
@@ -1651,52 +1691,100 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
float minVis = 0.001f;
|
||||
if (fishStockVisual > minVis) // Fish stock effects are active as long as the UI exists, even if the player removes the item
|
||||
{
|
||||
fishStockSlidingPower = MathHelper.Lerp(fishStockSlidingPower, fishStockPower, 0.05f);
|
||||
if (Player.miscCounter % 60 == 0)
|
||||
{
|
||||
bool isExtreme = fishStockPower > 1.5f || fishStockPower < -1.5f;
|
||||
float smallJump = Main.rand.NextBool(4) ? 0.55f : 0;
|
||||
float bigJump = Main.rand.NextBool(isExtreme ? 7 : 10) ? 1.8f : 0;
|
||||
int riseOrFall = Main.rand.NextBool() ? -1 : 1;
|
||||
float newFishStockPower = Math.Clamp(fishStockPower + (Main.rand.NextFloat(0.1f, 0.2f) + Math.Max(smallJump, bigJump)) * riseOrFall, -2, 2);
|
||||
fishStockOldPower = // Cycle each power point up as the new point is gotten
|
||||
(fishStockPower,
|
||||
fishStockOldPower.Item1,
|
||||
fishStockOldPower.Item2,
|
||||
fishStockOldPower.Item3,
|
||||
fishStockOldPower.Item4);
|
||||
}
|
||||
// Stats
|
||||
Player.GetDamage<GenericDamageClass>() += 0.15f * fishStockPower;
|
||||
Player.GetCritChance<GenericDamageClass>() += 10 * fishStockPower;
|
||||
Player.Calamity().critDamage += 0.15f * fishStockPower;
|
||||
Player.statDefense += (int)(10 * fishStockPower);
|
||||
Player.endurance += 0.1f * fishStockPower;
|
||||
Player.lifeRegen += (int)(6 * fishStockPower);
|
||||
Player.pickSpeed -= 0.25f * fishStockPower;
|
||||
Player.fishingSkill += (int)(50 * fishStockPower);
|
||||
Player.luck += 0.55f * fishStockPower;
|
||||
float CoinMult = MathF.Abs(fishStockPower) * 1.5f;
|
||||
float givenMult = (fishStockPower < 0 ? (1 / CoinMult) : CoinMult);
|
||||
Player.Calamity().coinDropMult = givenMult;
|
||||
}
|
||||
// Only put away fish stocks if the stocks are even or higher, or if they've already been started to be put away
|
||||
float goalVis = (!fishStocks && (fishStockPower >= 0 || fishStockVisual < 0.9f)) ? 0 : 1;
|
||||
fishStockVisual = MathF.Round(MathHelper.Lerp(fishStockVisual, goalVis, 0.05f), 4); // Fade in and out the U
|
||||
|
||||
// The fire boots debuff boosts
|
||||
// bootLevel exists SO THAT THEY DO NOT STACK. Please help me maintain my sanity so we're not "fixing" this issue seventy times
|
||||
if (bootLevel > 0)
|
||||
HeatDebuffMultiplier += 0.25f * bootLevel;
|
||||
|
||||
if (rOfResilienceEffect > 0)
|
||||
rOfResilienceEffect--;
|
||||
if (Player.HeldItem.type == ModContent.ItemType<RelicOfResilience>()) // All players close to a player holding RoR get the benefits
|
||||
bool holdingRoR = Player.HeldItem.type == ModContent.ItemType<RelicOfResilience>();
|
||||
bool shieldIsSetup = (rOfResilienceEffect >= RelicOfResilience.baseTimeMax);
|
||||
bool chargedButNotHolding = (rOfResilienceEffect > RelicOfResilience.baseTimeMax && !holdingRoR);
|
||||
bool reduceEffect = (!shieldIsSetup || chargedButNotHolding);
|
||||
if (rOfResilienceEffect > 0 && reduceEffect)
|
||||
{ rOfResilienceEffect -= (chargedButNotHolding ? 4 : 1); if (shieldIsSetup && rOfResilienceEffect < RelicOfResilience.baseTimeMax) rOfResilienceEffect = RelicOfResilience.baseTimeMax; if (rOfResilienceEffect < 0) rOfResilienceEffect = 0; }
|
||||
if (holdingRoR) // All players close to a player holding RoR get the benefits
|
||||
{
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicGuard>()] < 1 && !Player.dead)
|
||||
if (Player.ownedProjectileCounts[ModContent.ProjectileType<RelicGuard>()] < 1 && !Player.dead && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
Projectile relic = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<RelicGuard>(), 0, 0f, Player.whoAmI);
|
||||
}
|
||||
for (int index = 0; index < Main.player.Length; index++)
|
||||
{
|
||||
Player fella = Main.player[index];
|
||||
if (Utils.Distance(fella.Center, Player.Center) < 650 && fella.team == Player.team)
|
||||
float maxDistancePlayersCanBe = 1000;
|
||||
bool validEffectBoost = Utils.Distance(fella.Center, Player.Center) < maxDistancePlayersCanBe && fella.team == Player.team && fella.Calamity().rOfResilienceEffect < RelicOfResilience.maxPowerTime
|
||||
&& fella.Calamity().rOfResilienceCooldown == 0 && (fella.Calamity().rOfResilienceEffect > RelicOfResilience.baseTimeMax ? holdingRoR : true);
|
||||
if (validEffectBoost)
|
||||
{
|
||||
fella.Calamity().rOfResilienceEffect = (fella != Player ? 480 : 2);
|
||||
fella.Calamity().rOfResilienceEffect += (reduceEffect ? 2 : 1) + (Player.Calamity().profanedSoulRelicBuff ? 1 : 0); // gets subtracted by 1 every frame, so this goes up by more to keep up
|
||||
}
|
||||
}
|
||||
}
|
||||
// Adds a floor for defense and dr, will not ignore defense damage
|
||||
if (Player.Calamity().rOfResilienceCooldown >= RelicOfResilience.baseCooldown / 2|| Player.Calamity().rOfResilienceCooldown == 0)
|
||||
{
|
||||
float fadeInStats = Utils.GetLerpValue(0, RelicOfResilience.baseTimeMax, rOfResilienceEffect, true);
|
||||
float fadeStats = (Player.Calamity().rOfResilienceCooldown == 0 ? fadeInStats : MathF.Pow(Utils.GetLerpValue(RelicOfResilience.baseCooldown / 2, RelicOfResilience.baseCooldown, Player.Calamity().rOfResilienceCooldown, true), 3));
|
||||
float overchargeBoost = 1 + (Utils.GetLerpValue(RelicOfResilience.baseTimeMax, RelicOfResilience.maxPowerTime, rOfResilienceEffect, true) * (Player.Calamity().profanedSoulRelicBuff ? RelicOfResilience.additionalMaxPowerDefensesMult * 5 : RelicOfResilience.additionalMaxPowerDefensesMult)); // The amount of bulk this gives with artifact is way overkill but it is REALLY funny
|
||||
int def = (int)(RelicOfResilience.baseDefenseFloor * overchargeBoost);
|
||||
float dr = RelicOfResilience.baseDrFloor * overchargeBoost;
|
||||
int maxDefFloor = (int)(def * fadeStats);
|
||||
float MaxDRFloor = dr * fadeStats;
|
||||
if (Player.statDefense < maxDefFloor)
|
||||
Player.statDefense += maxDefFloor - Player.statDefense;
|
||||
if (Player.endurance < MaxDRFloor)
|
||||
Player.endurance += MaxDRFloor - Player.endurance;
|
||||
}
|
||||
if (rOfResilienceEffect > 0)
|
||||
{
|
||||
if (Player.Calamity().mouseRight && !Player.mouseInterface && rOfResilienceCooldown == 0)
|
||||
if (Player.Calamity().mouseRight && !Player.mouseInterface && rOfResilienceCooldown == 0 && holdingRoR)
|
||||
{
|
||||
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
|
||||
int cooldownTime = RelicOfResilience.baseCooldown;
|
||||
rOfResilienceCooldown = cooldownTime;
|
||||
Player.AddCooldown(Cooldowns.RelicOfResilienceCooldown.ID, cooldownTime);
|
||||
SoundStyle y = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianRockShieldActivate");
|
||||
SoundEngine.PlaySound(y with { Volume = 0.7f, Pitch = -0.1f }, Player.Center);
|
||||
}
|
||||
|
||||
// Adds a floor for defense and dr at 150 and 10% respectivley, will not ignore defense damage
|
||||
if (Player.Calamity().rOfResilienceCooldown > 300 || Player.Calamity().rOfResilienceCooldown == 0)
|
||||
{
|
||||
float fadeStats = (Player.Calamity().rOfResilienceCooldown == 0 ? 1 : Utils.GetLerpValue(300, 600, Player.Calamity().rOfResilienceCooldown, true));
|
||||
int maxDefFloor = (int)(150 * fadeStats);
|
||||
float MaxDRFloor = 0.10f * fadeStats;
|
||||
if (Player.statDefense < maxDefFloor)
|
||||
Player.statDefense += maxDefFloor - Player.statDefense;
|
||||
if (Player.endurance < MaxDRFloor)
|
||||
Player.endurance += MaxDRFloor - Player.endurance;
|
||||
}
|
||||
|
||||
int shardBaseCap = (Player.Calamity().profanedSoulRelicBuff ? (int)(RelicOfResilience.baseMaxShardCount * 1.5f) : RelicOfResilience.baseMaxShardCount);
|
||||
float postMaxedShards = MathHelper.Lerp(shardBaseCap, shardBaseCap * RelicOfResilience.maxPowerShardMult, MathF.Pow(Utils.GetLerpValue(RelicOfResilience.baseTimeMax, RelicOfResilience.maxPowerTime, rOfResilienceEffect, true), 2));
|
||||
int maxShards = (int)(postMaxedShards * Utils.GetLerpValue(0, RelicOfResilience.baseTimeMax, rOfResilienceEffect, true));
|
||||
int numOfShards = 0;
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
{
|
||||
@@ -1706,7 +1794,26 @@ namespace CalamityMod.CalPlayer
|
||||
numOfShards++;
|
||||
}
|
||||
}
|
||||
if (Player.miscCounter % (Player.Calamity().profanedSoulRelicBuff ? 4 : 8) == 0 && numOfShards < (Player.Calamity().profanedSoulRelicBuff ? 75 : 30) && Player.Calamity().rOfResilienceCooldown == 0)
|
||||
float lowestNum = 0;
|
||||
int whoAmI = 0;
|
||||
if (numOfShards > maxShards) // Kill the most recent shard if there's too many
|
||||
{
|
||||
for (int x = 0; x < Main.maxProjectiles; x++)
|
||||
{
|
||||
Projectile projectile = Main.projectile[x];
|
||||
if (projectile.active && projectile.type == ModContent.ProjectileType<ArtifactOfResilienceShards>() && projectile.ai[1] == 0 && projectile.owner == Player.whoAmI && projectile.ai[2] > lowestNum)
|
||||
{
|
||||
whoAmI = projectile.whoAmI;
|
||||
lowestNum = projectile.ai[2];
|
||||
}
|
||||
}
|
||||
if (whoAmI != 0)
|
||||
{
|
||||
Projectile shard = Main.projectile[whoAmI];
|
||||
shard.ai[1] = -1;
|
||||
}
|
||||
}
|
||||
if (numOfShards < maxShards && Player.Calamity().rOfResilienceCooldown == 0 && (rOfResilienceEffect >= RelicOfResilience.baseTimeMax || holdingRoR))
|
||||
{
|
||||
if (numOfShards == 0)
|
||||
{
|
||||
@@ -1714,12 +1821,23 @@ namespace CalamityMod.CalPlayer
|
||||
SoundStyle sound = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash");
|
||||
SoundEngine.PlaySound(sound with { Volume = 0.5f, Pitch = -0.3f }, Player.Center);
|
||||
}
|
||||
int shardDamage = (int)Player.GetBestClassDamage().ApplyTo(420);
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(1, 0), ModContent.ProjectileType<ArtifactOfResilienceShards>(), shardDamage, 0f, Player.whoAmI, 0, 0, numOfShards + 1);
|
||||
int shardDamage = (int)Player.GetBestClassDamage().ApplyTo(Player.Calamity().profanedSoulRelicBuff ? RelicOfResilience.shardBaseDamage * 5 : RelicOfResilience.shardBaseDamage);
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(1, 0), ModContent.ProjectileType<ArtifactOfResilienceShards>(), shardDamage, 0f, Player.whoAmI, 0, 0, numOfShards + 1);
|
||||
}
|
||||
}
|
||||
if (rOfResilienceCooldown > 0)
|
||||
rOfResilienceCooldown--;
|
||||
{ rOfResilienceCooldown -= (holdingRoR ? 2 : 1); if (rOfResilienceCooldown < 0) rOfResilienceCooldown = 0; }
|
||||
|
||||
if (Player.Calamity().friendlyMinions > 0)
|
||||
{
|
||||
int numOfPigs = Player.ownedProjectileCounts[ModContent.ProjectileType<Pigion>()];
|
||||
if (numOfPigs < Player.Calamity().friendlyMinions)
|
||||
{
|
||||
int pigDamage = 7;
|
||||
Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(0, -16).RotatedByRandom(MathHelper.Pi), ModContent.ProjectileType<Pigion>(), pigDamage, 0f, Player.whoAmI, 0, numOfPigs + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (transformer && Player.Calamity().transformerCooldown == 0 && transformerDelay == 0) // The code for this acursed thing took much... MUCH, too long to make
|
||||
{
|
||||
@@ -3347,7 +3465,7 @@ namespace CalamityMod.CalPlayer
|
||||
#region Other Buff Effects
|
||||
private void OtherBuffEffects()
|
||||
{
|
||||
|
||||
var dripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
if (gravityNormalizer)
|
||||
{
|
||||
Player.buffImmune[BuffID.VortexDebuff] = true;
|
||||
@@ -3535,30 +3653,50 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
//this is so janky looking but it's the only way I could get it to work properly
|
||||
if (!(StealthStrikeAvailable() && Player.HeldItem.DamageType == RogueDamageClass.Instance))
|
||||
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost;
|
||||
Player.GetDamage(DamageClass.Generic) += PurpleHaze.DamageBoost + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.DamageBoost : 0);
|
||||
else
|
||||
stealthDamage -= PurpleHaze.StealthDamageLoss;
|
||||
stealthDamage -= PurpleHaze.StealthDamageLoss + ((dripPlayer.HasAlcohol(AlcoholType.PurpleHaze) && purpleHaze) ? PurpleHaze.StealthDamageLoss : 0);
|
||||
}
|
||||
|
||||
if (everclear)
|
||||
Player.GetDamage<GenericDamageClass>() += Everclear.DamageBoost;
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Everclear))
|
||||
Player.GetDamage<GenericDamageClass>() += Everclear.DamageBoost;
|
||||
|
||||
if (caribbeanRum)
|
||||
{
|
||||
Player.gravity *= CaribbeanRum.GravityMultiplier;
|
||||
Player.moveSpeed += CaribbeanRum.MoveSpeedBoost;
|
||||
}
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.CaribbeanRum))
|
||||
{
|
||||
Player.gravity *= CaribbeanRum.GravityMultiplier;
|
||||
Player.moveSpeed += CaribbeanRum.MoveSpeedBoost;
|
||||
}
|
||||
|
||||
if (starBeamRye)
|
||||
{
|
||||
Player.manaRegenCount += StarBeamRye.ManaRegenBoost;
|
||||
Player.GetDamage<MagicDamageClass>() *= StarBeamRye.MagicDmgMult;
|
||||
}
|
||||
|
||||
if (whiteWine)
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.StarBeamRye))
|
||||
{
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
Player.manaRegenCount += StarBeamRye.ManaRegenBoost;
|
||||
Player.GetDamage<MagicDamageClass>() *= StarBeamRye.MagicDmgMult;
|
||||
}
|
||||
|
||||
if (dripPlayer.HasAlcohol(AlcoholType.Ale) || dripPlayer.HasAlcohol(AlcoholType.Sake))
|
||||
{
|
||||
Player.GetAttackSpeed<MeleeDamageClass>() -= 0.1f;
|
||||
// See CalamityGlobalItem and PlayerUtils for Ale's melee size increase
|
||||
}
|
||||
|
||||
if (whiteWine || dripPlayer.HasAlcohol(AlcoholType.WhiteWine))
|
||||
{
|
||||
if (whiteWine)
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.WhiteWine))
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - WhiteWine.FlightTimeLoss));
|
||||
|
||||
float bonus = 0f;
|
||||
float MaxDistance = 640f;
|
||||
@@ -3570,7 +3708,12 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
else
|
||||
bonus = 0;
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
|
||||
if (whiteWine)
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.WhiteWine))
|
||||
whiteWineTimer += bonus * WhiteWine.FlightTimeRecoveryAmount;
|
||||
|
||||
while (whiteWineTimer > 1)
|
||||
{
|
||||
if (Player.wingTime < Player.wingTimeMax)
|
||||
@@ -3580,9 +3723,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
|
||||
if (redWine)
|
||||
{
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - RedWine.FlightTimeLoss));
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.RedWine))
|
||||
Player.wingTimeMax = (int)(Player.wingTimeMax * (1f - RedWine.FlightTimeLoss));
|
||||
|
||||
if (giantPearl)
|
||||
{
|
||||
@@ -3961,9 +4104,6 @@ namespace CalamityMod.CalPlayer
|
||||
Player.npcTypeNoAggro[ModContent.NPCType<GammaSlime>()] = true;
|
||||
}
|
||||
|
||||
if (fadedIdolatry && Player.FindBuffIndex(ModContent.BuffType<FieryDraconidBuff>()) != -1)
|
||||
Player.maxMinions += Player.ownedProjectileCounts[ModContent.ProjectileType<FieryDraconid>()];
|
||||
|
||||
if (pSoulArtifact)
|
||||
{
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
@@ -4397,7 +4537,7 @@ namespace CalamityMod.CalPlayer
|
||||
// Add any multiplicative damage bonuses here
|
||||
float multiplicativeDamage = 1;
|
||||
if (crushingEgo)
|
||||
multiplicativeDamage += 0.2f;
|
||||
multiplicativeDamage += 0.3f;
|
||||
if (WarbanneroftheRighteous)
|
||||
multiplicativeDamage += warbannerDamageMult;
|
||||
if (multiplicativeDamage != 1)
|
||||
@@ -4727,6 +4867,12 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.statDefense > 0)
|
||||
Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent);
|
||||
}
|
||||
if (Player.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.Everclear))
|
||||
{
|
||||
if (Player.statDefense > 0)
|
||||
Player.statDefense -= (int)(Player.statDefense * Everclear.DefenseLossPercent);
|
||||
}
|
||||
|
||||
if (DesertProwlerHat.ShroudedInSmoke(Player, out _))
|
||||
Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult);
|
||||
}
|
||||
|
||||
@@ -86,11 +86,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
target.Calamity().IncreasedColdEffects_EskimoSet = eskimoSet;
|
||||
target.Calamity().IncreasedColdEffects_CryoStone = CryoStone;
|
||||
target.Calamity().IncreasedColdEffects_FrozenCube = frozenCube;
|
||||
|
||||
target.Calamity().IncreasedElectricityEffects_Unused = false;
|
||||
|
||||
target.Calamity().IncreasedHeatEffects_Fireball = fireball;
|
||||
target.Calamity().IncreasedHeatEffects_CinnamonRoll = cinnamonRoll;
|
||||
target.Calamity().IncreasedHeatEffects_FireBoots = bootLevel;
|
||||
|
||||
target.Calamity().IncreasedSicknessEffects_ToxicHeart = toxicHeart;
|
||||
@@ -240,7 +240,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (proj.type != ProjectileType<MythrilFlare>())
|
||||
MythrilArmorSetChange.OnHitEffects(target, damageDone, Player);
|
||||
|
||||
if (moscowMule)
|
||||
var ivDripPlayer = Player.GetModPlayer<IVDripPlayer>();
|
||||
|
||||
// "Heavy" Knockback effect
|
||||
if (moscowMule || ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule))
|
||||
{
|
||||
var center = Player.Center;
|
||||
if (proj.IsMinionOrSentryRelated)
|
||||
@@ -255,10 +258,16 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
proj.damage = (int)(proj.damage * (moscowMule ? 0.8f : 1f) * (bloodyMary ? 0.75f : 1f));
|
||||
}
|
||||
|
||||
}
|
||||
if (ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule) || ivDripPlayer.HasAlcohol(AlcoholType.BloodyMary))
|
||||
{
|
||||
if (!(PierceResistNPC.exemptProjectiles.Contains(proj.type) || (PierceResistNPC.singleHitboxExemptProjectiles.ContainsKey(proj.type) && PierceResistNPC.singleHitboxExemptProjectiles[proj.type])))
|
||||
{
|
||||
proj.damage = (int)(proj.damage * (ivDripPlayer.HasAlcohol(AlcoholType.MoscowMule) ? 0.8f : 1f) * (ivDripPlayer.HasAlcohol(AlcoholType.BloodyMary) ? 0.75f : 1f));
|
||||
}
|
||||
}
|
||||
|
||||
if (witheringWeaponEnchant)
|
||||
if (witheringWeaponEnchant)
|
||||
witheringDamageDone += (int)(damageDone * (hit.Crit ? 2D : 1D));
|
||||
cgn.TypelessDebuffMultiplier = TypelessDebuffMultiplier;
|
||||
cgn.HeatDebuffMultiplier = HeatDebuffMultiplier;
|
||||
@@ -1002,7 +1011,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType<EmpyreanEmber>()] < 3 && Player.ownedProjectileCounts[ProjectileType<EmpyreanBlast>()] < 3)
|
||||
{
|
||||
switch (Main.rand.Next(5))
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0:
|
||||
// Exodus Rogue Stars: 80%
|
||||
@@ -1030,13 +1039,6 @@ namespace CalamityMod.CalPlayer
|
||||
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<EmpyreanBlast>(), blastDamage, 0f, proj.owner, 0f, 0f);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Exodus Rogue Bubble: 60%
|
||||
int bubbleDamage = (int)(proj.damage * 0.6f);
|
||||
CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType<EmpyreanGlob>(), 800f, 15f);
|
||||
xerocDmg += (int)(bubbleDamage * 0.5);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Items.Tools;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Cooldowns
|
||||
{
|
||||
@@ -12,5 +14,11 @@ namespace CalamityMod.Cooldowns
|
||||
public override Color OutlineColor => new Color(255, 191, 73);
|
||||
public override Color CooldownStartColor => new Color(122, 66, 59);
|
||||
public override Color CooldownEndColor => new Color(165, 103, 87);
|
||||
|
||||
public override void Tick()
|
||||
{
|
||||
if (instance.player.HeldItem.type == ModContent.ItemType<RelicOfResilience>())
|
||||
instance.timeLeft--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -10,6 +12,7 @@ namespace CalamityMod.DataStructures
|
||||
[ReinitializeDuringResizeArrays]
|
||||
public static class BuffDatasets
|
||||
{
|
||||
private static DebuffData Alch(int level) => new DebuffData() { AlcoholLevel = level };
|
||||
public static DebuffData[] DebuffDataset = BuffID.Sets.Factory.CreateNamedSet("DebuffData")
|
||||
.Description("Stores DebuffData for a particular debuff")
|
||||
.RegisterCustomSet<DebuffData>(null,
|
||||
@@ -24,8 +27,69 @@ namespace CalamityMod.DataStructures
|
||||
BuffID.Poisoned, DebuffData.Poisoned,
|
||||
BuffID.Venom, DebuffData.AcidVenom,
|
||||
BuffID.Electrified, DebuffData.Electrified,
|
||||
BuffID.Oiled, DebuffData.Oiled
|
||||
BuffID.Oiled, DebuffData.Oiled,
|
||||
|
||||
BuffID.Tipsy, Alch(1),
|
||||
ModContent.BuffType<BloodyMaryBuff>(), Alch(1),
|
||||
ModContent.BuffType<CaribbeanRumBuff>(), Alch(1),
|
||||
ModContent.BuffType<CinnamonRollBuff>(), Alch(1),
|
||||
ModContent.BuffType<EvergreenGinBuff>(), Alch(1),
|
||||
ModContent.BuffType<FireballBuff>(), Alch(1),
|
||||
ModContent.BuffType<GrapeBeerBuff>(), Alch(1),
|
||||
ModContent.BuffType<ManhattanBuff>(), Alch(1),
|
||||
ModContent.BuffType<MargaritaBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoonshineBuff>(), Alch(1),
|
||||
ModContent.BuffType<MoscowMuleBuff>(), Alch(1),
|
||||
ModContent.BuffType<OldFashionedBuff>(), Alch(1),
|
||||
ModContent.BuffType<PurpleHazeBuff>(), Alch(1),
|
||||
ModContent.BuffType<RedWineBuff>(), Alch(1),
|
||||
ModContent.BuffType<RumBuff>(), Alch(1),
|
||||
ModContent.BuffType<ScrewdriverBuff>(), Alch(1),
|
||||
ModContent.BuffType<StarBeamRyeBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaBuff>(), Alch(1),
|
||||
ModContent.BuffType<TequilaSunriseBuff>(), Alch(1),
|
||||
ModContent.BuffType<VodkaBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiskeyBuff>(), Alch(1),
|
||||
ModContent.BuffType<WhiteWineBuff>(), Alch(1),
|
||||
|
||||
ModContent.BuffType<EverclearBuff>(), Alch(2),
|
||||
ModContent.BuffType<BaconOilBuff>(), Alch(3)
|
||||
);
|
||||
public static int GetBuffIDFromAlcoholType(AlcoholType type)
|
||||
{
|
||||
return type switch
|
||||
{
|
||||
AlcoholType.BaconOil => ModContent.BuffType<BaconOilBuff>(),
|
||||
AlcoholType.BloodyMary => ModContent.BuffType<BloodyMaryBuff>(),
|
||||
AlcoholType.CaribbeanRum => ModContent.BuffType<CaribbeanRumBuff>(),
|
||||
AlcoholType.CinnamonRoll => ModContent.BuffType<CinnamonRollBuff>(),
|
||||
AlcoholType.Everclear => ModContent.BuffType<EverclearBuff>(),
|
||||
AlcoholType.EvergreenGin => ModContent.BuffType<EvergreenGinBuff>(),
|
||||
AlcoholType.Fireball => ModContent.BuffType<FireballBuff>(),
|
||||
AlcoholType.GrapeBeer => ModContent.BuffType<GrapeBeerBuff>(),
|
||||
AlcoholType.Manhattan => ModContent.BuffType<ManhattanBuff>(),
|
||||
AlcoholType.Margarita => ModContent.BuffType<MargaritaBuff>(),
|
||||
AlcoholType.Moonshine => ModContent.BuffType<MoonshineBuff>(),
|
||||
AlcoholType.MoscowMule => ModContent.BuffType<MoscowMuleBuff>(),
|
||||
AlcoholType.OldFashioned => ModContent.BuffType<OldFashionedBuff>(),
|
||||
AlcoholType.PurpleHaze => ModContent.BuffType<PurpleHazeBuff>(),
|
||||
AlcoholType.RedWine => ModContent.BuffType<RedWineBuff>(),
|
||||
AlcoholType.Rum => ModContent.BuffType<RumBuff>(),
|
||||
AlcoholType.Screwdriver => ModContent.BuffType<ScrewdriverBuff>(),
|
||||
AlcoholType.StarBeamRye => ModContent.BuffType<StarBeamRyeBuff>(),
|
||||
AlcoholType.Tequila => ModContent.BuffType<TequilaBuff>(),
|
||||
AlcoholType.TequilaSunrise => ModContent.BuffType<TequilaSunriseBuff>(),
|
||||
AlcoholType.Vodka => ModContent.BuffType<VodkaBuff>(),
|
||||
AlcoholType.Whiskey => ModContent.BuffType<WhiskeyBuff>(),
|
||||
AlcoholType.WhiteWine => ModContent.BuffType<WhiteWineBuff>(),
|
||||
|
||||
// Vanilla treats both Ale and Sake as the "Tipsy" buff
|
||||
AlcoholType.Ale => BuffID.Tipsy,
|
||||
AlcoholType.Sake => BuffID.Tipsy,
|
||||
|
||||
_ => -1
|
||||
};
|
||||
}
|
||||
}
|
||||
public class DebuffData
|
||||
{
|
||||
@@ -113,11 +177,10 @@ namespace CalamityMod.DataStructures
|
||||
public bool GearCanModifyDebuff = true;
|
||||
|
||||
/// <summary>
|
||||
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
|
||||
/// How much alcohol this counts as.
|
||||
/// Default is 0, most alcohol is 1, and Everclear is 2
|
||||
/// </summary>
|
||||
public float AlcoholLevel = 0f;
|
||||
public int AlcoholLevel = 0;
|
||||
|
||||
/// <summary>
|
||||
/// UNIMPLEMENTED. WILL BE DONE IN A FUTURE PR
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using CalamityMod.Utilities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Dusts
|
||||
{
|
||||
public class LemonNadeExplodeDust : ModDust
|
||||
{
|
||||
public override string Texture => "CalamityMod/Particles/LemonNadeExplode";
|
||||
Color RandomColor
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (Main.rand.Next(4))
|
||||
{
|
||||
case 0: return new Color(54, 54, 54);
|
||||
case 1: return new Color(76, 36, 36);
|
||||
case 2: return new Color(132, 72, 56);
|
||||
case 3: return new Color(50, 45, 37);
|
||||
}
|
||||
return Color.White;
|
||||
}
|
||||
}
|
||||
public override void OnSpawn(Dust dust)
|
||||
{
|
||||
if (dust.color == Color.Transparent)
|
||||
dust.color = RandomColor;
|
||||
dust.dataAsFloat = 0.75f;
|
||||
dust.rotation = Main.rand.NextFloat(0, MathHelper.TwoPi);
|
||||
}
|
||||
public override bool MidUpdate(Dust dust)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Update(Dust dust)
|
||||
{
|
||||
dust.dataAsFloat *= 0.96f;
|
||||
dust.position += dust.velocity;
|
||||
dust.velocity *= 0.925f;
|
||||
dust.rotation += MathF.Sin(dust.dustIndex * 0.1f) * 0.2f * dust.dataAsFloat;
|
||||
if (dust.dataAsFloat <= 0.01f)
|
||||
dust.active = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
static Asset<Texture2D> tex;
|
||||
public override bool PreDraw(Dust dust)
|
||||
{
|
||||
tex ??= ModContent.Request<Texture2D>("CalamityMod/Particles/LemonNadeExplode");
|
||||
Main.EntitySpriteDraw(
|
||||
tex.Value,
|
||||
dust.position - Main.screenPosition,
|
||||
null,
|
||||
dust.color * dust.dataAsFloat,
|
||||
dust.rotation,
|
||||
tex.Size() * 0.5f,
|
||||
dust.scale * 0.1f * (0.75f + 0.25f * dust.dataAsFloat),
|
||||
SpriteEffects.None,
|
||||
0
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 410 B |
|
After Width: | Height: | Size: 155 B |
|
After Width: | Height: | Size: 203 B |
|
After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 152 B |
@@ -322,7 +322,7 @@ namespace CalamityMod.Graphics.Primitives
|
||||
}
|
||||
|
||||
// Legacy behaviour: sample based on requested point count using Catmull-Rom style interpolation.
|
||||
PositionsIndex = 1;
|
||||
PositionsIndex = 0;
|
||||
float controlCountMinusOne = controlCount - 1f;
|
||||
PrimitiveSmoothingType legacyType = settings.SmoothingType;
|
||||
|
||||
@@ -344,8 +344,6 @@ namespace CalamityMod.Graphics.Primitives
|
||||
MainPositions[PositionsIndex] = EvaluateCurve(legacyType, p0, p1, p2, p3, localSplineInterpolant, settings);
|
||||
PositionsIndex++;
|
||||
}
|
||||
|
||||
MainPositions[0] = controlPoints[0];
|
||||
MainPositions[PositionsIndex] = controlPoints[controlCount - 1];
|
||||
PositionsIndex++;
|
||||
controlPoints.Clear();
|
||||
|
||||
@@ -309,7 +309,7 @@ namespace CalamityMod.Graphics.Primitives
|
||||
SmoothingTension = smoothingTension;
|
||||
FrameTransportMode = frameTransportMode;
|
||||
Topology = topology;
|
||||
CapStyle = PrimitiveCapStyle.Flat;
|
||||
CapStyle = capStyle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -401,6 +401,32 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Flail Balance Changes
|
||||
// Make flails be unaffected by player velocity
|
||||
private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self)
|
||||
{
|
||||
orig(self);
|
||||
if (self.ai[0] == 1f && self.ai[1] == 0f)
|
||||
self.velocity -= Main.player[self.owner].velocity;
|
||||
}
|
||||
|
||||
// Increase Flower Pow's return speed
|
||||
private static void IncreaseFlowerPowRetSpeed(ILContext il)
|
||||
{
|
||||
var cursor = new ILCursor(il);
|
||||
// Move to where Flower Pow receives its specific flail stat changes. This moves it after num2 = 23f
|
||||
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcR4(23f), i => i.MatchStloc(6)))
|
||||
{
|
||||
LogFailure("Flower Pow Buff", "Could not move to Flower Pow's specific flail stat changes.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Emit an instruction setting num5 (the return speed) to 21. Vanilla is 16
|
||||
cursor.Emit(OpCodes.Ldc_R4, 21f);
|
||||
cursor.Emit(OpCodes.Stloc, 9);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Terrarian Projectile Limitation for Extra Updates
|
||||
private static void LimitTerrarianProjectiles(ILContext il)
|
||||
{
|
||||
@@ -748,5 +774,81 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tweak Pygmy Staff Aggro Distance Logic
|
||||
// Code written by Habble
|
||||
private static void PygmyAggroOnClosestPointInHitbox(ILContext context)
|
||||
{
|
||||
// Adjust Pygmy Staff's attack distance logic to be measured from the closest point to the enemy instead of the enemy's center.
|
||||
ILCursor cursor = new(context);
|
||||
|
||||
// Go to the latest newly set variable near the point we wanna be, as that is an easy unique instruction to jump to. 131 is the number assigned to that local variable.
|
||||
if (!cursor.TryGotoNext(i => i.MatchStloc(131)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate unique Stloc(131) instruction nearest to aggro distance check.");
|
||||
return;
|
||||
}
|
||||
// Move before the minion range variable emission so as to receive the value being targetted at it.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(126)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate the minion range variable.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0); // Emits the Projectile entity itself
|
||||
cursor.Emit(OpCodes.Ldloc, 129); // Emits the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6); // Emits the bool containing type check for Pygmies
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
NPC npc = Main.npc[npcIndex];
|
||||
Player player = Main.player[projectile.owner];
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(player.Center).Distance(player.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
|
||||
// That was part 1, time for part 2.
|
||||
// Go directly before the instruction that's meant to receive the distance value of this tagged NPC.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(185)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(185) instruction.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0);
|
||||
cursor.Emit(OpCodes.Ldloc, 181); // Emits the tagged NPC
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, NPC npc, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
|
||||
// Go directly before the instruction that's meant to receive the distance value of this NPC currently being iterated over.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(189)))
|
||||
{
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate first unique Stloc(189) instruction.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0);
|
||||
cursor.Emit(OpCodes.Ldloc, 186); // Emits the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
NPC npc = Main.npc[npcIndex];
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,10 @@ namespace CalamityMod.ILEditing
|
||||
On_Main.DamageVar_float_int_float += AdjustDamageVariance;
|
||||
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
|
||||
IL_Projectile.Damage += VanillaBossResistChanges;
|
||||
IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox;
|
||||
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
|
||||
On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity;
|
||||
IL_Projectile.AI_015_Flails += IncreaseFlowerPowRetSpeed;
|
||||
IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs;
|
||||
On_Player.ConsumeSolarFlare += SolarWingsDashChange;
|
||||
On_Projectile.IsDamageDodgable += GFBNurseMeteorUndodgeable;
|
||||
@@ -150,7 +153,6 @@ namespace CalamityMod.ILEditing
|
||||
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
|
||||
On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
|
||||
On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements;
|
||||
On_Projectile.AI_015_Flails += FlailsNoLongerAffectedByPlayerVelocity;
|
||||
IL_Projectile.AI_061_FishingBobber += WhitelistVictideBobber;
|
||||
On_Player.ItemCheck_CheckFishingBobbers += PreventVictideBobberFromJamming;
|
||||
|
||||
|
||||
@@ -563,6 +563,8 @@ namespace CalamityMod.ILEditing
|
||||
{
|
||||
if (self.Calamity().oldFashioned)
|
||||
damage = (int)(damage * OldFashioned.DamageBoostMultiplier);
|
||||
if (self.GetModPlayer<IVDripPlayer>().HasAlcohol(AlcoholType.OldFashioned))
|
||||
damage = (int)(damage * OldFashioned.DamageBoostMultiplier);
|
||||
orig(self, npc, damage, knockback, direction, crit, damageType, damageVariation);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -318,15 +318,6 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Remove Flail Throw Velocity Being Affected By Player Velocity
|
||||
private static void FlailsNoLongerAffectedByPlayerVelocity(On_Projectile.orig_AI_015_Flails orig, Projectile self)
|
||||
{
|
||||
orig(self);
|
||||
if (self.ai[0] == 1f && self.ai[1] == 0f)
|
||||
self.velocity -= Main.player[self.owner].velocity;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Allow Victide Bobber to Exist
|
||||
private static void WhitelistVictideBobber(ILContext il)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CreateRecipe().
|
||||
AddIngredient<SilencingSheath>().
|
||||
AddIngredient<RuinMedallion>().
|
||||
AddIngredient<MeldConstruct>(5).
|
||||
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.dOfTheDeep = true;
|
||||
modPlayer.dOfTheDeepVisual = !hideVisual;
|
||||
modPlayer.WaterDebuffMultiplier += 0.75f;
|
||||
modPlayer.WaterDebuffMultiplier += 0.6f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class FishStocks : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 30;
|
||||
Item.height = 38;
|
||||
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
Item.accessory = true;
|
||||
}
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().fishStocks = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 622 B |
@@ -0,0 +1,60 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class FrozenCube : ModItem, ILocalizedModType
|
||||
{
|
||||
public static int mistBaseDamage = 1;
|
||||
public static int slamBaseDamage = 20;
|
||||
public static int baseAttackSpeed = 90;
|
||||
public static int baseAttackCooldown = 180;
|
||||
|
||||
public static int usedDefenseDivide = 3;
|
||||
public static int debuff = ModContent.BuffType<WindChilled>();
|
||||
|
||||
public static readonly SoundStyle noise = new("CalamityMod/Sounds/Item/ElumphantSound") { Volume = 0.6f };
|
||||
public static readonly SoundStyle cry = new("CalamityMod/Sounds/Item/ElumphantCry") { Volume = 0.6f };
|
||||
public static readonly SoundStyle hit = new("CalamityMod/Sounds/Item/ElumphantBop") { Volume = 0.6f };
|
||||
public static readonly SoundStyle jokeBonk = new("CalamityMod/Sounds/Item/Bonk") { Volume = 0.6f };
|
||||
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 34;
|
||||
Item.height = 34;
|
||||
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
|
||||
Item.rare = ItemRarityID.Orange;
|
||||
Item.accessory = true;
|
||||
}
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.frozenCube = true;
|
||||
modPlayer.frozenCubeVisuals = !hideVisual;
|
||||
|
||||
int projectile = ProjectileType<Elumphant>();
|
||||
if (player.ownedProjectileCounts[projectile] < 1 && !player.dead)
|
||||
{
|
||||
int damage = (int)player.GetTotalDamage<GenericDamageClass>().ApplyTo(slamBaseDamage);
|
||||
Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, projectile, damage, 0f, player.whoAmI);
|
||||
}
|
||||
}
|
||||
public override void ModifyTooltips(List<TooltipLine> list)
|
||||
{
|
||||
if (Main.LocalPlayer != null)
|
||||
list.FindAndReplace("[DAMAGELINE]", Main.LocalPlayer.Calamity().frozenCube ?
|
||||
this.GetLocalization("EquippedDebuff").Format((Main.LocalPlayer.Calamity().frozenCubeDebuffBoost.ToPercent("N0")).ToString()) + "\n" +
|
||||
this.GetLocalization("EquippedElumphant").Format((Main.LocalPlayer.Calamity().frozenCubeElumphantBoost.ToPercent("N1")).ToString())
|
||||
: this.GetLocalizedValue("Unequipped"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 794 B |
@@ -1,21 +1,68 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Rarities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.UI;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public enum AlcoholType
|
||||
{
|
||||
None,
|
||||
BaconOil,
|
||||
BloodyMary,
|
||||
CaribbeanRum,
|
||||
CinnamonRoll,
|
||||
Everclear,
|
||||
EvergreenGin,
|
||||
Fireball,
|
||||
GrapeBeer,
|
||||
Manhattan,
|
||||
Margarita,
|
||||
Moonshine,
|
||||
MoscowMule,
|
||||
OldFashioned,
|
||||
PurpleHaze,
|
||||
RedWine,
|
||||
Rum,
|
||||
Screwdriver,
|
||||
StarBeamRye,
|
||||
Tequila,
|
||||
TequilaSunrise,
|
||||
Vodka,
|
||||
Whiskey,
|
||||
WhiteWine,
|
||||
Ale,
|
||||
Sake,
|
||||
}
|
||||
|
||||
public interface IAlcoholItem
|
||||
{
|
||||
Action<Player, float> IVDripAlcoholEffect { get; }
|
||||
AlcoholType AlcoholVariant { get; }
|
||||
LocalizedText DripEffectText { get; }
|
||||
}
|
||||
|
||||
public class IVDripOnTheRocks : ModItem, ILocalizedModType
|
||||
{
|
||||
public int containedAlcoholID = -1;
|
||||
public AlcoholType currentAlcoholType = AlcoholType.None;
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static readonly float DamageBoostMultiplier = 1.25f; // Same as Old Fashioned but can be changed at any time
|
||||
public static readonly float DamageReductionMultiplier = 0.75f; // Same as Old Fashioned but can be changed at any time
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((DamageBoostMultiplier).ToString("N2"), (DamageReductionMultiplier).ToString("N2")); public override void SetDefaults()
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Main.RegisterItemAnimation(Item.type, new Terraria.DataStructures.DrawAnimationVertical(1, 26));
|
||||
ItemID.Sets.AnimatesAsSoul[Item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 58;
|
||||
Item.height = 60;
|
||||
@@ -24,19 +71,216 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
public override void Load()
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.ivDrip = true;
|
||||
On_ItemSlot.OverrideLeftClick += IvDripAlcoholEquip;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
public override void Unload()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<OldFashioned>().
|
||||
AddIngredient<LivingShard>(6).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
On_ItemSlot.OverrideLeftClick -= IvDripAlcoholEquip;
|
||||
}
|
||||
|
||||
private bool IvDripAlcoholEquip(On_ItemSlot.orig_OverrideLeftClick orig, Item[] inv, int context, int slot)
|
||||
{
|
||||
if (context == ItemSlot.Context.InventoryItem || context == ItemSlot.Context.ChestItem)
|
||||
{
|
||||
Item mouseItem = Main.mouseItem;
|
||||
Item targetItem = inv[slot];
|
||||
|
||||
// Vanilla alcohols have to be applied manually
|
||||
bool isMouseAle = mouseItem.type == ItemID.Ale;
|
||||
bool isTargetAle = targetItem.type == ItemID.Ale;
|
||||
bool isMouseSake = mouseItem.type == ItemID.Sake;
|
||||
bool isTargetSake = targetItem.type == ItemID.Sake;
|
||||
|
||||
// Alcohol into this acc
|
||||
if (targetItem.ModItem is IVDripOnTheRocks drip && (mouseItem.ModItem is IAlcoholItem || isMouseAle || isMouseSake))
|
||||
{
|
||||
if (drip.containedAlcoholID == -1)
|
||||
{
|
||||
drip.containedAlcoholID = mouseItem.type;
|
||||
drip.currentAlcoholType = isMouseAle ? AlcoholType.Ale : (isMouseSake ? AlcoholType.Sake : (mouseItem.ModItem as IAlcoholItem).AlcoholVariant);
|
||||
|
||||
mouseItem.stack--;
|
||||
if (mouseItem.stack <= 0)
|
||||
mouseItem.TurnToAir();
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (mouseItem.ModItem is IVDripOnTheRocks dripHeld && (targetItem.ModItem is IAlcoholItem || isTargetAle || isTargetSake))
|
||||
{
|
||||
if (dripHeld.containedAlcoholID == -1)
|
||||
{
|
||||
dripHeld.containedAlcoholID = targetItem.type;
|
||||
dripHeld.currentAlcoholType = isTargetAle ? AlcoholType.Ale : (isTargetSake ? AlcoholType.Sake : (targetItem.ModItem as IAlcoholItem).AlcoholVariant);
|
||||
|
||||
targetItem.stack--;
|
||||
if (targetItem.stack <= 0)
|
||||
targetItem.TurnToAir();
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return orig(inv, context, slot);
|
||||
}
|
||||
|
||||
#region Shift-Right Click to Empty IV Drip
|
||||
|
||||
// Allow shift-right clicking only if the IV drip actually contains alcohol
|
||||
public override bool CanRightClick() => containedAlcoholID != -1 && Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);
|
||||
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
// Give the alcohol back to the player
|
||||
player.QuickSpawnItem(player.GetSource_ItemUse(Item), containedAlcoholID);
|
||||
|
||||
containedAlcoholID = -1;
|
||||
currentAlcoholType = AlcoholType.None;
|
||||
|
||||
Item.stack++;
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Grab);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public override void PreReforge()
|
||||
{
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
// Refund the alcohol to the player.
|
||||
Main.LocalPlayer.QuickSpawnItem(Main.LocalPlayer.GetSource_ItemUse(Item), containedAlcoholID);
|
||||
|
||||
containedAlcoholID = -1;
|
||||
currentAlcoholType = AlcoholType.None;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
IVDripPlayer dripPlayer = player.GetModPlayer<IVDripPlayer>();
|
||||
dripPlayer.ivDripEquipped = true;
|
||||
|
||||
if (containedAlcoholID != -1)
|
||||
{
|
||||
dripPlayer.currentAlcohol = currentAlcoholType;
|
||||
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
if (alcoholItem.ModItem is IAlcoholItem alcohol)
|
||||
dripPlayer.ApplyIVDripAlcoholEffect(alcohol.IVDripAlcoholEffect);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
if (tooltips == null) return;
|
||||
|
||||
var effectLine = tooltips.FirstOrDefault(x => x.Text.Contains("[EFFECT]"));
|
||||
var nameLine = tooltips.FirstOrDefault(x => x.Text.Contains("[NAME]"));
|
||||
|
||||
if (containedAlcoholID == -1)
|
||||
{
|
||||
if (effectLine != null)
|
||||
{
|
||||
effectLine.Text = this.GetLocalizedValue("Empty");
|
||||
}
|
||||
nameLine?.Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (effectLine != null)
|
||||
{
|
||||
if (containedAlcoholID == ItemID.Ale || containedAlcoholID == ItemID.Sake)
|
||||
effectLine.Text = this.GetLocalizedValue("SakeAndAleText");
|
||||
|
||||
else
|
||||
{
|
||||
Item alcoholItem = new Item(containedAlcoholID);
|
||||
if (alcoholItem.ModItem is IAlcoholItem alcohol)
|
||||
effectLine.Text = alcohol.DripEffectText.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (nameLine != null)
|
||||
{
|
||||
string alcoholName = Lang.GetItemNameValue(containedAlcoholID);
|
||||
nameLine.Text = this.GetLocalizedValue("CurrentAlcoholText") + $" [c/FF81E4:{alcoholName}]";
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the correct alcohol variant frame
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Item[Item.type].Value;
|
||||
|
||||
int frameHeight = texture.Height / 26;
|
||||
int frameIndex = (int)currentAlcoholType;
|
||||
|
||||
Rectangle targetFrame = new Rectangle(0, frameIndex * frameHeight, texture.Width, frameHeight);
|
||||
|
||||
spriteBatch.Draw(texture, position, targetFrame, drawColor, 0f, origin, scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
Texture2D texture = TextureAssets.Item[Item.type].Value;
|
||||
|
||||
int frameHeight = texture.Height / 26;
|
||||
int frameIndex = (int)currentAlcoholType;
|
||||
|
||||
Rectangle targetFrame = new Rectangle(0, frameIndex * frameHeight, texture.Width, frameHeight);
|
||||
|
||||
Vector2 drawPosition = Item.position - Main.screenPosition + new Vector2(Item.width / 2, Item.height - frameHeight / 2);
|
||||
Vector2 origin = targetFrame.Size() / 2f;
|
||||
|
||||
spriteBatch.Draw(texture, drawPosition, targetFrame, lightColor, rotation, origin, scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public class IVDripPlayer : ModPlayer
|
||||
{
|
||||
public Dictionary<Action<Player, float>, float> IVDripAlcoholEffects = new();
|
||||
public bool ivDripEquipped;
|
||||
public AlcoholType currentAlcohol = AlcoholType.None;
|
||||
|
||||
// would otherwise be spamming these checks manually any time another class wants to check for if IV drip has a certain alcohol filled
|
||||
public bool HasAlcohol(AlcoholType type)
|
||||
{
|
||||
return ivDripEquipped && currentAlcohol == type;
|
||||
}
|
||||
|
||||
public override void ResetEffects()
|
||||
{
|
||||
IVDripAlcoholEffects.Clear();
|
||||
ivDripEquipped = false;
|
||||
currentAlcohol = AlcoholType.None;
|
||||
}
|
||||
|
||||
public void ApplyIVDripAlcoholEffect(Action<Player, float> effect)
|
||||
{
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
if (IVDripAlcoholEffects.ContainsKey(effect))
|
||||
IVDripAlcoholEffects[effect] += 1f;
|
||||
else
|
||||
IVDripAlcoholEffects[effect] = 1f;
|
||||
}
|
||||
|
||||
public override void PostUpdateEquips()
|
||||
{
|
||||
foreach (var effect in IVDripAlcoholEffects)
|
||||
{
|
||||
effect.Key.Invoke(Player, effect.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 17 KiB |
@@ -8,7 +8,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public class LeviathanAmbergris : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int ambergrisDashDamage = 650;
|
||||
public static int ambergrisDashDamage => 350;
|
||||
public static float DashSpeedIncrease => 1f;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 20;
|
||||
|
||||
|
Before Width: | Height: | Size: 540 B |
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories
|
||||
public class SlagsplitterPauldron : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int PauldronSlamDamage = 330;
|
||||
public static int PauldronSlamDamage => 250;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 42;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories
|
||||
AddIngredient<Baroclaw>().
|
||||
AddIngredient<GiantTortoiseShell>().
|
||||
AddIngredient<MolluskHusk>(5).
|
||||
AddIngredient<MeldConstruct>(6).
|
||||
AddIngredient<MeldBlob>(14). //Consistent with Vanilla lunar wing costs
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.BaseItems;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.NetModules;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.Net;
|
||||
|
||||
namespace CalamityMod.Items.Accessories.Vanity
|
||||
@@ -11,7 +22,14 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
public class XyksBlessingBlue : TransformationAccessory, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
int itemFrame = 0;
|
||||
int itemFrameTimer = 1;
|
||||
int pulseTimer = 0;
|
||||
public static Vector2 extraPosition = Vector2.Zero;
|
||||
public static Color baseEffectColor = new Color(150, 255, 210); // Teal-ish Glow
|
||||
public static Color animEffectColor = new Color(255, 85, 252); // Purple Flash
|
||||
public static Color baseMainColor = new Color(25, 118, 218); // Mid Blue
|
||||
public static Color baseAccentColor = new Color(0, 255, 250); // Light blue
|
||||
public override (EquipType, string, string)[] EquipSlots =>
|
||||
[
|
||||
(EquipType.Head, "Xyk", null),
|
||||
@@ -19,11 +37,104 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
(EquipType.Legs, "Xyk", null),
|
||||
(EquipType.Wings, null, null), //results in setting this equip slot to -1
|
||||
];
|
||||
public static Asset<Texture2D> Texture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Vanity/XyksBlessingBlueAnim");
|
||||
public static Asset<Texture2D> AltTexture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Vanity/XyksBlessingBlueAnim2");
|
||||
public static Asset<Texture2D> ShapeTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRing");
|
||||
public static Asset<Texture2D> BloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
|
||||
|
||||
bool NoArmorEnabled = false;
|
||||
bool DoTransformAnimation = false;
|
||||
float effectsMult = 1;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.FindAndReplace("[TOGGLE]", NoArmorEnabled ? this.GetLocalizedValue("ArmorDisabled") : this.GetLocalizedValue("ArmorEnabled"));
|
||||
}
|
||||
public override bool ConsumeItem(Player player) => !Main.keyState.PressingShift();
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag.Add("noArmor", NoArmorEnabled);
|
||||
tag.Add("doAnim", DoTransformAnimation);
|
||||
}
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
NoArmorEnabled = tag.GetBool("noArmor");
|
||||
DoTransformAnimation = tag.GetBool("doAnim");
|
||||
}
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(NoArmorEnabled);
|
||||
writer.Write(DoTransformAnimation);
|
||||
}
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
NoArmorEnabled = reader.ReadBoolean();
|
||||
DoTransformAnimation = reader.ReadBoolean();
|
||||
}
|
||||
public Rectangle GetFrame()
|
||||
{
|
||||
Texture2D texture = DoTransformAnimation ? AltTexture.Value : Texture.Value;
|
||||
int vertialFramesNum = DoTransformAnimation ? 13 : 20;
|
||||
Rectangle frame = texture.Frame(verticalFrames: vertialFramesNum, frameY: itemFrame);
|
||||
return frame;
|
||||
}
|
||||
public void DrawItem(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, float scale, float rotation, bool inWorld)
|
||||
{
|
||||
itemFrameTimer++;
|
||||
if (itemFrameTimer % 5 == 0)
|
||||
itemFrame++;
|
||||
|
||||
effectsMult = MathHelper.Lerp(effectsMult, 1, 0.1f);
|
||||
Color effectColor = Color.Lerp(baseAccentColor, animEffectColor, Math.Max(effectsMult - 1, 0));
|
||||
|
||||
Texture2D texture = DoTransformAnimation ? AltTexture.Value : Texture.Value;
|
||||
float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 5);
|
||||
extraPosition = new Vector2(0, 5 * (inWorld ? 1 : 0.2f) * sine);
|
||||
Vector2 animPlaceAdjust = Vector2.UnitY * (DoTransformAnimation ? 2.8f : 0);
|
||||
|
||||
float pulseProgress = MathF.Pow(Utils.GetLerpValue(90, 0, pulseTimer % 90), 3.5f);
|
||||
|
||||
if (itemFrame >= (DoTransformAnimation ? 13 : 20))
|
||||
{
|
||||
itemFrame = (DoTransformAnimation ? 8 : 0);
|
||||
if (DoTransformAnimation) { DoTransformAnimation = false; Item.NetStateChanged(); }
|
||||
}
|
||||
//Pulse
|
||||
Texture2D pulse = ShapeTexture.Value;
|
||||
spriteBatch.Draw(pulse, position + extraPosition, null, Color.Lerp(effectColor, baseEffectColor, pulseProgress) with { A = 0 } * pulseProgress, rotation, pulse.Size() / 2, scale * (1 - pulseProgress) * effectsMult, SpriteEffects.None, 0f);
|
||||
|
||||
Texture2D bloom = BloomTexture.Value;
|
||||
Vector2 squash = new Vector2(1 + Math.Max(effectsMult - 1, 0) * 3.5f, 0.85f - Math.Max(effectsMult - 1, 0) * 0.75f);
|
||||
float bloomScale = 0.75f;
|
||||
// Bloom effects
|
||||
spriteBatch.Draw(bloom, position + extraPosition, null, effectColor with { A = 0 }, rotation, bloom.Size() / 2, new Vector2(1, 0.85f) * (scale + 0.05f * sine) * bloomScale, SpriteEffects.None, 0f);
|
||||
spriteBatch.Draw(bloom, position + extraPosition, null, effectColor with { A = 0 }, rotation, bloom.Size() / 2, squash * (scale + 0.05f * sine) * 0.9f * bloomScale, SpriteEffects.None, 0f);
|
||||
// Sprite
|
||||
spriteBatch.Draw(texture, position + extraPosition + animPlaceAdjust, frame, (inWorld ? Lighting.GetColor((Item.Center + extraPosition + animPlaceAdjust).ToTileCoordinates()) : Color.White), 0f, frame.Size() / 2, scale, SpriteEffects.None, 0f);
|
||||
pulseTimer++;
|
||||
}
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
frame = GetFrame();
|
||||
DrawItem(spriteBatch, position, frame, scale * 1.5f, 0, false);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
Rectangle itemFrame = GetFrame();
|
||||
Vector2 drawPosition = Item.Bottom - Main.screenPosition - new Vector2(0, (itemFrame.Size() / 2).Y);
|
||||
DrawItem(spriteBatch, drawPosition, itemFrame, scale * 0.5f, rotation, true);
|
||||
return false;
|
||||
}
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 3);
|
||||
Color clr = Color.Lerp(baseEffectColor, baseMainColor, Utils.GetLerpValue(-1, 1, sine));
|
||||
Lighting.AddLight(Item.Center + extraPosition, clr.ToVector3() * 0.55f);
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 34;
|
||||
Item.width = 30;
|
||||
Item.height = 25;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
Item.rare = ModContent.RarityType<Turquoise>();
|
||||
@@ -33,23 +144,43 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
public override bool CanRightClick() => true;
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
player.PutItemInInventoryFromItemUsage(ModContent.ItemType<XyksBlessingOrange>(), 1);
|
||||
if (Main.keyState.PressingShift())
|
||||
{
|
||||
SoundStyle sound = new("CalamityMod/Sounds/Item/StarfleetFire");
|
||||
for (int i = 0; i < 2; i++)
|
||||
SoundEngine.PlaySound(sound with { Volume = 0.65f, Pitch = Main.rand.NextFloat(0.4f, 0.5f) + 0.9f * i, MaxInstances = 6 }, player.Center);
|
||||
|
||||
effectsMult = 2;
|
||||
pulseTimer = 20;
|
||||
itemFrameTimer = 1;
|
||||
itemFrame = 0;
|
||||
NoArmorEnabled = !NoArmorEnabled;
|
||||
DoTransformAnimation = true;
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
else
|
||||
player.PutItemInInventoryFromItemUsage(ModContent.ItemType<XyksBlessingOrange>());
|
||||
}
|
||||
public override Func<Player, bool> ShouldTransform => ((player) => !NoArmorEnabled);
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsBlue = true;
|
||||
EquipEffects(player);
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (!hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsBlue = true;
|
||||
EquipEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
public void EquipEffects(Player player)
|
||||
{
|
||||
player.DisableWingFlapSound();
|
||||
if (NoArmorEnabled)
|
||||
IsForced = false;
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsBlue = true;
|
||||
}
|
||||
// Also research the other variant
|
||||
public override void OnResearched(bool fullyResearched)
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -1,9 +1,17 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.BaseItems;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent.NetModules;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.Net;
|
||||
|
||||
namespace CalamityMod.Items.Accessories.Vanity
|
||||
@@ -11,7 +19,14 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
public class XyksBlessingOrange : TransformationAccessory, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
|
||||
int itemFrame = 0;
|
||||
int itemFrameTimer = 1;
|
||||
int pulseTimer = 0;
|
||||
public static Vector2 extraPosition = Vector2.Zero;
|
||||
public static Color baseEffectColor = new Color(255, 153, 153); // Red-ish Glow
|
||||
public static Color animEffectColor = new Color(255, 105, 85); // Crimson Flash
|
||||
public static Color baseMainColor = new Color(239, 117, 34); // Mid Orange
|
||||
public static Color baseAccentColor = new Color(251, 242, 54); // Light Orange/Yellow
|
||||
public override (EquipType, string, string)[] EquipSlots =>
|
||||
[
|
||||
(EquipType.Head, "Xyk2", null),
|
||||
@@ -19,11 +34,104 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
(EquipType.Legs, "Xyk2", null),
|
||||
(EquipType.Wings, null, null), //results in setting this equip slot to -1
|
||||
];
|
||||
public static Asset<Texture2D> Texture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Vanity/XyksBlessingOrangeAnim");
|
||||
public static Asset<Texture2D> AltTexture = ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Vanity/XyksBlessingOrangeAnim2");
|
||||
public static Asset<Texture2D> ShapeTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSquareParticleThick");
|
||||
public static Asset<Texture2D> BloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
|
||||
|
||||
bool NoArmorEnabled = false;
|
||||
bool DoTransformAnimation = false;
|
||||
float effectsMult = 1;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.FindAndReplace("[TOGGLE]", NoArmorEnabled ? this.GetLocalizedValue("ArmorDisabled") : this.GetLocalizedValue("ArmorEnabled"));
|
||||
}
|
||||
public override bool ConsumeItem(Player player) => !Main.keyState.PressingShift();
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag.Add("noArmor", NoArmorEnabled);
|
||||
tag.Add("doAnim", DoTransformAnimation);
|
||||
}
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
NoArmorEnabled = tag.GetBool("noArmor");
|
||||
DoTransformAnimation = tag.GetBool("doAnim");
|
||||
}
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(NoArmorEnabled);
|
||||
writer.Write(DoTransformAnimation);
|
||||
}
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
NoArmorEnabled = reader.ReadBoolean();
|
||||
DoTransformAnimation = reader.ReadBoolean();
|
||||
}
|
||||
public Rectangle GetFrame()
|
||||
{
|
||||
Texture2D texture = DoTransformAnimation ? AltTexture.Value : Texture.Value;
|
||||
int vertialFramesNum = DoTransformAnimation ? 13 : 20;
|
||||
Rectangle frame = texture.Frame(verticalFrames: vertialFramesNum, frameY: itemFrame);
|
||||
return frame;
|
||||
}
|
||||
public void DrawItem(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, float scale, float rotation, bool inWorld)
|
||||
{
|
||||
itemFrameTimer++;
|
||||
if (itemFrameTimer % 5 == 0)
|
||||
itemFrame++;
|
||||
|
||||
effectsMult = MathHelper.Lerp(effectsMult, 1, 0.1f);
|
||||
Color effectColor = Color.Lerp(baseAccentColor, animEffectColor, Math.Max(effectsMult - 1, 0));
|
||||
|
||||
Texture2D texture = DoTransformAnimation ? AltTexture.Value : Texture.Value;
|
||||
float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 5);
|
||||
extraPosition = new Vector2(0, 5 * (inWorld ? 1 : 0.2f) * sine);
|
||||
Vector2 animPlaceAdjust = Vector2.UnitY * (DoTransformAnimation ? 2.8f : 0);
|
||||
|
||||
float pulseProgress = MathF.Pow(Utils.GetLerpValue(90, 0, pulseTimer % 90), 3.5f);
|
||||
|
||||
if (itemFrame >= (DoTransformAnimation ? 13 : 20))
|
||||
{
|
||||
itemFrame = (DoTransformAnimation ? 8 : 0);
|
||||
if (DoTransformAnimation) { DoTransformAnimation = false; Item.NetStateChanged(); }
|
||||
}
|
||||
//Pulse
|
||||
Texture2D pulse = ShapeTexture.Value;
|
||||
spriteBatch.Draw(pulse, position + extraPosition, null, Color.Lerp(effectColor, baseEffectColor, pulseProgress) with { A = 0 } * pulseProgress, rotation + MathHelper.PiOver4, pulse.Size() / 2, scale * (1 - pulseProgress) * effectsMult * 0.65f, SpriteEffects.None, 0f);
|
||||
|
||||
Texture2D bloom = BloomTexture.Value;
|
||||
Vector2 squash = new Vector2(1 + Math.Max(effectsMult - 1, 0) * 3.5f, 0.85f - Math.Max(effectsMult - 1, 0) * 0.75f);
|
||||
float bloomScale = 0.75f;
|
||||
// Bloom effects
|
||||
spriteBatch.Draw(bloom, position + extraPosition, null, effectColor with { A = 0 }, rotation, bloom.Size() / 2, new Vector2(1, 0.85f) * (scale + 0.05f * sine) * bloomScale, SpriteEffects.None, 0f);
|
||||
spriteBatch.Draw(bloom, position + extraPosition, null, effectColor with { A = 0 }, rotation, bloom.Size() / 2, squash * (scale + 0.05f * sine) * 0.9f * bloomScale, SpriteEffects.None, 0f);
|
||||
// Sprite
|
||||
spriteBatch.Draw(texture, position + extraPosition + animPlaceAdjust, frame, (inWorld ? Lighting.GetColor((Item.Center + extraPosition + animPlaceAdjust).ToTileCoordinates()) : Color.White), 0f, frame.Size() / 2, scale, SpriteEffects.None, 0f);
|
||||
pulseTimer++;
|
||||
}
|
||||
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
||||
{
|
||||
frame = GetFrame();
|
||||
DrawItem(spriteBatch, position, frame, scale * 1.5f, 0, false);
|
||||
return false;
|
||||
}
|
||||
public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
|
||||
{
|
||||
Rectangle itemFrame = GetFrame();
|
||||
Vector2 drawPosition = Item.Bottom - Main.screenPosition - new Vector2(0, (itemFrame.Size() / 2).Y);
|
||||
DrawItem(spriteBatch, drawPosition, itemFrame, scale * 0.5f, rotation, true);
|
||||
return false;
|
||||
}
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
float sine = MathF.Sin(Main.GlobalTimeWrappedHourly * 3);
|
||||
Color clr = Color.Lerp(baseEffectColor, baseMainColor, Utils.GetLerpValue(-1, 1, sine));
|
||||
Lighting.AddLight(Item.Center + extraPosition, clr.ToVector3() * 0.55f);
|
||||
}
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 34;
|
||||
Item.width = 30;
|
||||
Item.height = 25;
|
||||
Item.accessory = true;
|
||||
Item.vanity = true;
|
||||
Item.rare = ModContent.RarityType<DarkOrange>();
|
||||
@@ -33,23 +141,44 @@ namespace CalamityMod.Items.Accessories.Vanity
|
||||
public override bool CanRightClick() => true;
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
player.PutItemInInventoryFromItemUsage(ModContent.ItemType<XyksBlessingBlue>(), 1);
|
||||
if (Main.keyState.PressingShift())
|
||||
{
|
||||
SoundStyle sound = new("CalamityMod/Sounds/Item/StarfleetFire");
|
||||
for (int i = 0; i < 2; i++)
|
||||
SoundEngine.PlaySound(sound with { Volume = 0.65f, Pitch = Main.rand.NextFloat(0.4f, 0.5f) + 0.9f * i, MaxInstances = 6 }, player.Center);
|
||||
|
||||
effectsMult = 2;
|
||||
pulseTimer = 20;
|
||||
itemFrameTimer = 1;
|
||||
itemFrame = 0;
|
||||
NoArmorEnabled = !NoArmorEnabled;
|
||||
DoTransformAnimation = true;
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
else
|
||||
player.PutItemInInventoryFromItemUsage(ModContent.ItemType<XyksBlessingBlue>());
|
||||
|
||||
}
|
||||
public override Func<Player, bool> ShouldTransform => ((player) => !NoArmorEnabled);
|
||||
public override void UpdateVanity(Player player)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsOrange = true;
|
||||
EquipEffects(player);
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
if (!hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsOrange = true;
|
||||
EquipEffects(player);
|
||||
}
|
||||
}
|
||||
|
||||
public void EquipEffects(Player player)
|
||||
{
|
||||
player.DisableWingFlapSound();
|
||||
if (NoArmorEnabled)
|
||||
IsForced = false;
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.XykVisualsOrange = true;
|
||||
}
|
||||
// Also research the other variant
|
||||
public override void OnResearched(bool fullyResearched)
|
||||
{
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -77,7 +77,7 @@ namespace CalamityMod.Items.Accessories.Wings
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.SoulofFlight, 20).
|
||||
AddIngredient<MeldConstruct>(14).
|
||||
AddIngredient<MeldBlob>(14).
|
||||
AddIngredient(ItemID.LunarBar, 10).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
|
Before Width: | Height: | Size: 485 B After Width: | Height: | Size: 643 B |
@@ -53,7 +53,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(20).
|
||||
AddIngredient<MeldBlob>(20).
|
||||
AddIngredient(ItemID.LunarBar, 16).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(15).
|
||||
AddIngredient<MeldBlob>(15).
|
||||
AddIngredient(ItemID.LunarBar, 12).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace CalamityMod.Items.Armor.Empyrean
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(10).
|
||||
AddIngredient<MeldBlob>(10).
|
||||
AddIngredient(ItemID.LunarBar, 8).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
SortBeforeFirstRecipesOf(ModContent.ItemType<EmpyreanCloak>()).
|
||||
|
||||