,
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,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;
|
||||
@@ -379,9 +380,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 +808,7 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Accessory
|
||||
public int friendlyMinions = 0;
|
||||
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
|
||||
public bool yharimsGift = false;
|
||||
public bool luxorsGift = false;
|
||||
@@ -1395,6 +1400,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;
|
||||
@@ -1486,6 +1492,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 +2170,7 @@ namespace CalamityMod.CalPlayer
|
||||
externalAuricRejectionImmunity = false;
|
||||
|
||||
alcoholPoisonLevel = 0;
|
||||
alcoholPoisonMax = alcoholPoisonMaxBase;
|
||||
noLifeRegen = false;
|
||||
|
||||
//Stratus Starburst amount management
|
||||
@@ -2251,6 +2260,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (!pSoulArtifact)
|
||||
pSoulShieldDurability = 0;
|
||||
}
|
||||
friendlyMinions = 0;
|
||||
pSoulShieldVisible = false;
|
||||
roverDrive = false;
|
||||
roverDriveShieldVisible = false;
|
||||
@@ -2695,6 +2705,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
enraged = false;
|
||||
@@ -2782,6 +2793,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
@@ -3179,6 +3191,7 @@ namespace CalamityMod.CalPlayer
|
||||
riptide = false;
|
||||
hadopelagicPressure = false;
|
||||
fishAlert = false;
|
||||
malnourished = false;
|
||||
clamity = false;
|
||||
NOU = false;
|
||||
snowmanNoseless = false;
|
||||
@@ -3293,6 +3306,7 @@ namespace CalamityMod.CalPlayer
|
||||
moscowMule = false;
|
||||
whiteWine = false;
|
||||
evergreenGin = false;
|
||||
baconOil = false;
|
||||
tranquilityCandle = false;
|
||||
chaosCandle = false;
|
||||
blueCandle = false;
|
||||
@@ -4850,14 +4864,34 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Player.whoAmI == Main.myPlayer)
|
||||
|
||||
if (malnourished) // Has to be here because alcoholPoisonLevel isn't updated until now
|
||||
{
|
||||
if (moonshine)
|
||||
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)
|
||||
{
|
||||
Player.statLifeMax2 = (int)(Player.statLifeMax2 * (1 + Moonshine.MaxLifePercentBoost));
|
||||
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();
|
||||
}
|
||||
#endregion
|
||||
@@ -5164,6 +5198,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -5295,6 +5332,90 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (Player.Calamity().baconOil && !Player.mount.Active)
|
||||
{
|
||||
Player.noFallDmg = true;
|
||||
|
||||
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;
|
||||
float minMoveSpeed = 3; // 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;
|
||||
float decceleration = -0.025f / speedMult;
|
||||
float riseSpeed = 0.8f; // 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 * 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
|
||||
|
||||
@@ -1636,8 +1636,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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -194,8 +193,8 @@ namespace CalamityMod.CalPlayer
|
||||
for (int l = 0; l < Player.MaxBuffs; l++)
|
||||
{
|
||||
int buff = Player.buffType[l];
|
||||
if (CalamityBuffSets.AlcoholStrength.TryGetValue(buff, out int level))
|
||||
alcoholPoisonLevel += level;
|
||||
if (BuffDatasets.DebuffDataset[buff] is not null && BuffDatasets.DebuffDataset[buff].AlcoholLevel > 0)
|
||||
alcoholPoisonLevel += BuffDatasets.DebuffDataset[buff].AlcoholLevel;
|
||||
}
|
||||
if (Player.Calamity().ivDrip) // +1 stack of poisoning while IV Drip is equipped
|
||||
alcoholPoisonLevel++;
|
||||
@@ -214,7 +213,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;
|
||||
@@ -573,12 +572,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;
|
||||
}
|
||||
|
||||
@@ -430,7 +430,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);
|
||||
}
|
||||
@@ -1740,6 +1740,16 @@ namespace CalamityMod.CalPlayer
|
||||
if (rOfResilienceCooldown > 0)
|
||||
rOfResilienceCooldown--;
|
||||
|
||||
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
|
||||
{
|
||||
float zoneSize = 150;
|
||||
@@ -4005,9 +4015,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)
|
||||
@@ -4441,7 +4448,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)
|
||||
|
||||
@@ -1039,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;
|
||||
}
|
||||
|
||||
@@ -113,11 +113,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,73 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tweak Pygmy Staff aggro distance logic
|
||||
|
||||
private static void PygmyAggroOnClosestPointInHitbox(ILContext context)
|
||||
{
|
||||
ILCursor cursor = new(context);
|
||||
if (!cursor.TryGotoNext(i => i.MatchStloc(131)))
|
||||
{// 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 variable in ILview
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate unique Stloc(131) instruction nearest to aggro distance check.");
|
||||
return;
|
||||
}
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdloc(126)))
|
||||
{// Before the minion range variable emission so as to receive the value being targetted at it
|
||||
LogFailure("Tweaking Pygmy Staff aggro distance logic", "Could not locate the minion range variable.");
|
||||
return;
|
||||
}
|
||||
cursor.Emit(OpCodes.Ldarg_0); // Emit the Projectile entity as we are in Projectile.cs::AI_026
|
||||
cursor.Emit(OpCodes.Ldloc, 129); // Emit the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6); // Emit the bool containing type check for pygmies
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
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.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(185)))
|
||||
{// Go directly before the instruction that's meant to receive the distance value of this tagged NPC
|
||||
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); // Emit the tagged NPC
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, NPC npc, bool pygmy) =>
|
||||
{// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
if (!pygmy)
|
||||
return distance;
|
||||
|
||||
float finalDistance = npc.Hitbox.ClosestPointInRect(projectile.Center).Distance(projectile.Hitbox.ClosestPointInRect(npc.Center));
|
||||
return finalDistance;
|
||||
});
|
||||
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchStloc(189)))
|
||||
{// Go directly before the instruction that's meant to receive the distance value of this NPC currently being iterated over
|
||||
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); // Emit the NPC index via the incremented loop variable
|
||||
cursor.Emit(OpCodes.Ldloc, 6);
|
||||
cursor.EmitDelegate((float distance, Projectile projectile, int npcIndex, bool pygmy) =>
|
||||
{// Replace the distance with a different value calculated off of closest point in hitboxes
|
||||
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 Tweak Pygmy Staff aggro distance logic
|
||||
}
|
||||
}
|
||||
@@ -106,6 +106,8 @@ namespace CalamityMod.ILEditing
|
||||
IL_NPC.ScaleStats_ApplyExpertTweaks += RemoveExpertHardmodeScaling;
|
||||
IL_Projectile.Damage += VanillaBossResistChanges;
|
||||
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 +152,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;
|
||||
|
||||
@@ -187,6 +188,9 @@ namespace CalamityMod.ILEditing
|
||||
// Fix vanilla behaviour of not calling CheckDead for NPCs that realLife is set
|
||||
IL_NPC.StrikeNPC_HitInfo_bool_bool += EnsureCheckDeadOnSegments;
|
||||
|
||||
// Change Pygmy Staff minion AI to check distance based on closest points in hitboxes
|
||||
IL_Projectile.AI_026 += PygmyAggroOnClosestPointInHitbox;
|
||||
|
||||
//Additional detours that are in their own item files given they are only relevant to these specific items:
|
||||
//Rover drive detours on Player.DrawInfernoRings to draw its shield
|
||||
//Wulfrum armor hooks on Player.KeyDoubleTap and DrawPendingMouseText to activate its set bonus and spoof the mouse text to display the stats of the activated weapon if shift is held
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>()).
|
||||
|
||||
@@ -173,7 +173,10 @@ namespace CalamityMod.Items
|
||||
//Add "Uses X Minion Slots right above "Uses X Mana"
|
||||
if (ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 || ContentSamples.ProjectilesByType[item.shoot].minionSlots > 0)
|
||||
{
|
||||
tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback") + 1, new(Mod, "Minions", CalamityUtils.GetText(ItemID.Sets.StaffMinionSlotsRequired[item.type] > 1 ? "Common.MinionSlotCost" : "Common.MinionSlotCostSingle").Format(ItemID.Sets.StaffMinionSlotsRequired[item.type])));
|
||||
float cost = ItemID.Sets.StaffMinionSlotsRequired[item.type];
|
||||
if (item.type == ModContent.ItemType<YharonsKindleStaff>() && Main.LocalPlayer.Calamity().fadedIdolatry)
|
||||
cost--;
|
||||
tooltips.Insert(tooltips.FindIndex(0, (x) => x.Name == "Knockback") + 1, new(Mod, "Minions", CalamityUtils.GetText(cost > 1 ? "Common.MinionSlotCost" : "Common.MinionSlotCostSingle").Format(cost)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.Anchor, Do(DamageExact(107), UseExact(30)) }, // VANILLA: 70 DMG, 20 UT
|
||||
{ ItemID.AntlionClaw, Do(UseExact(10)) }, // Mandible Blade. VANILLA: 18 UT
|
||||
{ ItemID.AquaScepter, Do(DamageRatio(0.9f)) }, // VANILLA: 27 DMG. Uses ratios due to remix seed
|
||||
{ ItemID.Bananarang, Do(DamageExact(76), UseExact(14)) }, // VANILLA: 45 DMG, 11 UT
|
||||
{ ItemID.Bananarang, Do(DamageExact(60)) }, // VANILLA: 45 DMG
|
||||
{ ItemID.BatScepter, Do(DamageExact(50)) }, // VANILLA: 45 DMG
|
||||
{ ItemID.BeamSword, Do(UseMeleeSpeed, DamageExact(131), UseAnimationExact(40), KnockbackExact(8)) }, // VANILLA: 52 DMG, 20 UT, 6.5 KB
|
||||
{ ItemID.BeeGun, Do(DamageExact(11)) }, // VANILLA: 9 DMG
|
||||
@@ -95,7 +95,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.DarkLance, Do(TrueMelee, DamageExact(40)) }, // VANILLA: 34 DMG
|
||||
{ ItemID.DartRifle, Do(DamageExact(58)) }, // VANILLA: 52 DMG
|
||||
{ ItemID.DayBreak, Do(DamageExact(125), UseExact(22)) }, // VANILLA: 150 DMG, 16 UT
|
||||
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // VANILLA: 39 DMG. Compensation for removing aerial multiplier
|
||||
{ ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane. VANILLA: 39 DMG. Compensation for removing aerial multiplier
|
||||
{ ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon. VANILLA: 180 DMG
|
||||
{ ItemID.DeadlySphereStaff, Do(DamageExact(50)) }, // VANILLA: 40 DMG
|
||||
{ ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(65), ShootSpeedExact(15f)) }, // VANILLA: 57 DMG, 9 VEL
|
||||
@@ -116,6 +116,7 @@ namespace CalamityMod.Items
|
||||
{ ItemID.Flamelash, Do(DamageExact(36)) }, // VANILLA: 32 DMG
|
||||
{ ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, // VANILLA: 35 DMG, 7 VEL
|
||||
{ ItemID.FlowerofFire, Do(DamageRatio(0.78f)) }, // VANILLA: 48 DMG. Uses ratios due to remix seed
|
||||
{ ItemID.FlowerPow, Do(DamageExact(80)) }, // Displays as 160 damage. VANILLA: 65 DMG (displays as 130)
|
||||
{ ItemID.FlyingKnife, Do(DamageExact(53)) }, // VANILLA: 40 DMG
|
||||
{ ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, // VANILLA: 49 DMG
|
||||
{ ItemID.Gatligator, Do(UseExact(6)) }, // VANILLA: 7 UT
|
||||
@@ -156,7 +157,6 @@ namespace CalamityMod.Items
|
||||
{ ItemID.Marrow, Do(DamageExact(60)) }, // VANILLA: 53 DMG
|
||||
{ ItemID.MedusaHead, Do(DamageExact(75)) }, // VANILLA: 40 DMG
|
||||
{ ItemID.Meowmere, Do(UseMeleeSpeed, DamageExact(240)) }, // VANILLA: 200 DMG
|
||||
{ ItemID.MeteorStaff, Do(DamageExact(58), ShootSpeedExact(13f)) }, // VANILLA: 50 DMG, 10 VEL
|
||||
{ ItemID.MiniNukeI, Do(DamageExact(90)) }, // VANILLA: 75 DMG
|
||||
{ ItemID.MiniNukeII, Do(DamageExact(90)) },
|
||||
{ ItemID.Minishark, Do(DamageExact(4)) }, // VANILLA: 6 DMG
|
||||
|
||||
@@ -7,18 +7,26 @@ namespace CalamityMod.Items.Materials
|
||||
public class MeldBlob : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Materials";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 100;
|
||||
Item.ResearchUnlockCount = 25;
|
||||
ItemID.Sets.ItemIconPulse[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 16;
|
||||
Item.height = 14;
|
||||
Item.width = 24;
|
||||
Item.height = 22;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.value = Item.sellPrice(silver: 20);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
Item.rare = ItemRarityID.Cyan;
|
||||
ItemID.Sets.ItemNoGravity[Type] = true;
|
||||
}
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f);
|
||||
Lighting.AddLight(Item.Center, 0.5f * brightness, 0.5f * brightness, 0.5f * brightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 462 B |
@@ -1,33 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Materials
|
||||
{
|
||||
[LegacyName("MeldiateBar")]
|
||||
public class MeldConstruct : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Materials";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 25;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 15;
|
||||
Item.height = 12;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.value = Item.sellPrice(silver: 42);
|
||||
Item.rare = ItemRarityID.Red;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(3).
|
||||
AddIngredient<MeldBlob>(6).
|
||||
AddIngredient<StarblightSoot>(3).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -61,6 +61,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"Cooper",
|
||||
"CosmaticMango",
|
||||
"CrabBar",
|
||||
"Critaquil",
|
||||
"Dandy",
|
||||
"Dia",
|
||||
"Done",
|
||||
@@ -68,9 +69,9 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"Flowaria",
|
||||
"Fluffy",
|
||||
"fryzahh",
|
||||
"Gpscorpion",
|
||||
"jasper",
|
||||
"LordMetarex",
|
||||
"math2",
|
||||
"Moonburn",
|
||||
"Ozzatron",
|
||||
"Piky",
|
||||
@@ -147,6 +148,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Paintings
|
||||
"Lompl Allimath",
|
||||
"Lucille Karma",
|
||||
"MarieArk",
|
||||
"math2",
|
||||
"Mercutio 'Merkalto' Takle",
|
||||
"Mihaii",
|
||||
"Minecat",
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using CalamityMod.Items.Critters;
|
||||
using CalamityMod.Tiles.Furniture;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Furniture
|
||||
{
|
||||
public class ShroombleCage : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToPlaceableTile(ModContent.TileType<ShroombleCageTile>());
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Terrarium).
|
||||
AddIngredient<ShroombleItem>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 565 B |
@@ -0,0 +1,43 @@
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Tiles.Furniture;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables.Furniture
|
||||
{
|
||||
public class TheMonument : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
|
||||
public const float MonumentTaxIncrease = 0.5f;
|
||||
public const float MonumentHappinessReduction = 0.15f;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToPlaceableTile(ModContent.TileType<TheMonumentTile>());
|
||||
Item.width = 40;
|
||||
Item.height = 50;
|
||||
Item.rare = ItemRarityID.Pink;
|
||||
Item.value = Item.buyPrice(gold: 5);
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
On_Player.CollectTaxes += AddMonumentTaxes;
|
||||
}
|
||||
|
||||
private static void AddMonumentTaxes(On_Player.orig_CollectTaxes orig, Player self)
|
||||
{
|
||||
orig(self);
|
||||
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
if (!n.homeless && !NPCID.Sets.IsTownPet[n.type] && NPC.TypeToDefaultHeadIndex(n.type) > 0 && n.GetGlobalNPC<CalamityGlobalTownNPC>().AffectedByTheMonument)
|
||||
self.taxMoney += (int)(CalamityGlobalTownNPC.TotalTaxesPerNPC * MonumentTaxIncrease);
|
||||
}
|
||||
if (self.taxMoney > CalamityGlobalTownNPC.TaxesToCollectLimit)
|
||||
self.taxMoney = CalamityGlobalTownNPC.TaxesToCollectLimit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CalamityMod.Tiles;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Placeables
|
||||
{
|
||||
public class GreedPot : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Placeables";
|
||||
|
||||
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<GreedPotTile>());
|
||||
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 457 B |
@@ -0,0 +1,32 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Alcohol
|
||||
{
|
||||
public class BaconOil : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 20;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3] {
|
||||
new Color(204, 90, 73),
|
||||
new Color(168, 37, 37),
|
||||
new Color(120, 28, 28)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToFood(20, 32, ModContent.BuffType<BaconOilBuff>(), CalamityUtils.MinutesToFrames(6), true);
|
||||
Item.value = Item.sellPrice(silver: 2);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.2 KiB |
@@ -0,0 +1,42 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions.Food
|
||||
{
|
||||
public class TheSandwich : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
public static int alcoholCapBoost = 2;
|
||||
public static float statBoost = 0.05f; // The player starts with negative stat boosts, so it is a bit less than you'd expect
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(statBoost.ToPercent());
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 5;
|
||||
Main.RegisterItemAnimation(Type, new DrawAnimationVertical(int.MaxValue, 3));
|
||||
ItemID.Sets.FoodParticleColors[Type] = new Color[3] {
|
||||
new Color(132, 171, 87),
|
||||
new Color(174, 91, 107),
|
||||
new Color(218, 176, 133)
|
||||
};
|
||||
ItemID.Sets.IsFood[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToFood(70, 48, ModContent.BuffType<Malnourished>(), CalamityUtils.MinutesToFrames(10));
|
||||
Item.value = Item.sellPrice(silver: 20);
|
||||
Item.rare = ItemRarityID.Blue;
|
||||
}
|
||||
public override void UseAnimation(Player player)
|
||||
{
|
||||
player.ClearBuff(BuffID.WellFed);
|
||||
player.ClearBuff(BuffID.WellFed2);
|
||||
player.ClearBuff(BuffID.WellFed3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
@@ -0,0 +1,89 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Potions
|
||||
{
|
||||
public class TheConcoction : ModItem, ILocalizedModType
|
||||
{
|
||||
private static int hoverTimer = 0;
|
||||
private static bool wasHovering = false;
|
||||
public new string LocalizationCategory => "Items.Potions";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 30;
|
||||
ItemID.Sets.DrinkParticleColors[Type] = new Color[3]
|
||||
{
|
||||
new Color(255, 190, 250),
|
||||
new Color(255, 225, 183),
|
||||
new Color(246, 34, 79)
|
||||
};
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.DefaultToHealingPotion(50, 56, 500);
|
||||
Item.value = Item.sellPrice(silver: 60);
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
TheConcoctionPlayer cocPlayer = player.GetModPlayer<TheConcoctionPlayer>();
|
||||
cocPlayer.swinesWrathCounter = 1200; // Creates a 10 second delay before the buff is visible (triggers at 600)
|
||||
}
|
||||
|
||||
|
||||
public override void UpdateInventory(Player player)
|
||||
{
|
||||
wasHovering = Main.HoverItem?.type == Type;
|
||||
}
|
||||
|
||||
// Display different text for the first 10 frames of hovering over the item's tooltip.
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
bool isHovering = Main.HoverItem?.type == Type;
|
||||
|
||||
if (isHovering && !wasHovering)
|
||||
hoverTimer = 0;
|
||||
if (isHovering)
|
||||
hoverTimer++;
|
||||
|
||||
if (hoverTimer <= 10 && hoverTimer > 0)
|
||||
{
|
||||
TooltipLine healLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "HealLife");
|
||||
healLine?.Text = this.GetLocalization("EasterEggText").Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TheConcoctionPlayer : ModPlayer
|
||||
{
|
||||
public int swinesWrathCounter = -1;
|
||||
|
||||
public override void PostUpdate()
|
||||
{
|
||||
if (swinesWrathCounter > 0)
|
||||
{
|
||||
swinesWrathCounter--;
|
||||
|
||||
if (swinesWrathCounter <= 600 && !Player.HasBuff<SwinesWrathBuff>()) // When there is 10 seconds left
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<SwinesWrathBuff>(), 600);
|
||||
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/SwinesWrathProc"), Player.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,67 @@
|
||||
using CalamityMod.NPCs.TownNPCs;
|
||||
using CalamityMod.Packets;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Chat;
|
||||
using Terraria.Enums;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.SummonItems.TownPets
|
||||
{
|
||||
public class TheHousingContract : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.SummonItems";
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.ResearchUnlockCount = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.HoldUp;
|
||||
Item.consumable = true;
|
||||
Item.useAnimation = 45;
|
||||
Item.useTime = 45;
|
||||
Item.UseSound = SoundID.Item92;
|
||||
Item.width = 28;
|
||||
Item.height = 28;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.SetShopValues(ItemRarityColor.Green2, Item.buyPrice(0, 5));
|
||||
}
|
||||
|
||||
public override bool? UseItem(Player player)
|
||||
{
|
||||
int npcType = ModContent.NPCType<TownPiggy>();
|
||||
if (player.ItemAnimationJustStarted && (!CalamityWorld.unlockedTownPig || NPC.AnyNPCs(npcType)))
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
SpawnPiggy();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void SpawnPiggy()
|
||||
{
|
||||
Color color = new(50, 255, 130);
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (!CalamityWorld.unlockedTownPig)
|
||||
{
|
||||
SyncTownPigLicensePacket.Send();
|
||||
}
|
||||
}
|
||||
else if (!CalamityWorld.unlockedTownPig)
|
||||
{
|
||||
CalamityWorld.unlockedTownPig = true;
|
||||
ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Mods.CalamityMod.Misc.PiggyLicense"), color);
|
||||
CalamityNetcode.SyncWorld();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 445 B |
|
After Width: | Height: | Size: 543 B |
|
After Width: | Height: | Size: 489 B |
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Tools
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient<MeldConstruct>(12)
|
||||
.AddIngredient<MeldBlob>(12)
|
||||
.AddIngredient(ItemID.LunarBar, 10)
|
||||
.AddTile(TileID.LunarCraftingStation)
|
||||
.Register();
|
||||
|
||||
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 541 B |
@@ -0,0 +1,153 @@
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Tools
|
||||
{
|
||||
public class TheGift : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
public static readonly SoundStyle BadBuzzer = new SoundStyle("CalamityMod/Sounds/Custom/BadGiftBuzzer") with { Volume = 0.85f };
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = Item.height = 20;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
Item.useTime = Item.useAnimation = 10;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTurn = true;
|
||||
Item.noMelee = true;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
}
|
||||
|
||||
public override void Load()
|
||||
{
|
||||
On_ShopHelper.ProcessMood += TheGiftHappiness;
|
||||
}
|
||||
|
||||
public override void Update(ref float gravity, ref float maxFallSpeed)
|
||||
{
|
||||
// Controls actually applying the effect to an NPC
|
||||
// None of this should work in Remix because Remix disables happiness
|
||||
if (Item.noGrabDelay <= 0 && !Main.remixWorld)
|
||||
{
|
||||
foreach (NPC n in Main.ActiveNPCs)
|
||||
{
|
||||
// Don't run this code for NPCs that aren't affected by happiness
|
||||
// Also don't run this if The Gift has already been used on this NPC; they all will hold grudges against you :)
|
||||
if (!n.isLikeATownNPC || NPCID.Sets.NoTownNPCHappiness[n.type] || NPCID.Sets.IsTownPet[n.type] || n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftStatus.HasValue)
|
||||
continue;
|
||||
|
||||
if (Item.Hitbox.Intersects(n.Hitbox))
|
||||
{
|
||||
bool positive = Main.rand.NextBool();
|
||||
Color c = positive ? Color.Green : Color.Red;
|
||||
SoundEngine.PlaySound(positive ? SoundID.ResearchComplete : BadBuzzer, n.Center);
|
||||
n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftStatus = positive;
|
||||
n.GetGlobalNPC<CalamityGlobalTownNPC>().TheGiftReset = 0.0;
|
||||
|
||||
// Visual effect to demonstrate that something happened
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Vector2 spawnPos = n.Center + Main.rand.NextVector2Circular(30f, 30f);
|
||||
HealingPlus s = new(spawnPos, 0.5f, (spawnPos - n.Center).SafeNormalize(Vector2.Zero) * 0.65f, c, c * 0.2f, 25)
|
||||
{
|
||||
Rotation = positive ? 0f : MathHelper.PiOver4
|
||||
};
|
||||
GeneralParticleHandler.SpawnParticle(s);
|
||||
}
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
Vector2 spawnPos = n.Center + Main.rand.NextVector2Circular(50f, 50f);
|
||||
Vector2 arrVel = -Vector2.UnitY * 0.6f * positive.ToDirectionInt();
|
||||
StatChangeArrow arr = new(spawnPos, arrVel, -MathHelper.PiOver2 * positive.ToDirectionInt(), c, c * 0.1f, 0.7f, 40);
|
||||
GeneralParticleHandler.SpawnParticle(arr);
|
||||
}
|
||||
|
||||
Item.active = false;
|
||||
Item.type = ItemID.None;
|
||||
Item.stack = 0;
|
||||
if (Main.dedServ)
|
||||
NetMessage.SendData(MessageID.SyncItem, -1, -1, null, Item.whoAmI);
|
||||
// Make sure it can't apply to multiple NPCs at once
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also contains logic for The Monument, so I can make sure these apply in the correct order
|
||||
private static void TheGiftHappiness(On_ShopHelper.orig_ProcessMood orig, ShopHelper self, Player player, NPC npc)
|
||||
{
|
||||
orig(self, player, npc);
|
||||
|
||||
// Immediately exit early if it's Remix world, or if it's an NPC that should not be affected by happiness
|
||||
if (Main.remixWorld || NPCID.Sets.NoTownNPCHappiness[npc.type] || NPCID.Sets.IsTownPet[npc.type])
|
||||
return;
|
||||
|
||||
var gtnpc = npc.GetGlobalNPC<CalamityGlobalTownNPC>();
|
||||
// The Monument lowers happiness by a fixed amount. This is not applied to the Tax Collector.
|
||||
if (npc.type != NPCID.TaxCollector && gtnpc.SearchForTheMonument(npc))
|
||||
{
|
||||
float oldHappiness = self._currentPriceAdjustment;
|
||||
self._currentPriceAdjustment += TheMonument.MonumentHappinessReduction;
|
||||
self.LimitAndRoundMultiplier(self._currentPriceAdjustment);
|
||||
string dialogueKey;
|
||||
if (npc.type < NPCID.Count)
|
||||
{
|
||||
dialogueKey = $"Mods.CalamityMod.Vanilla.TownNPCMood.{NPCID.Search.GetName(npc.type)}.Monument";
|
||||
// Zoologist has separate dialogue when transformed
|
||||
if (npc.type == NPCID.BestiaryGirl && npc.ShouldBestiaryGirlBeLycantrope())
|
||||
dialogueKey += "Transformed";
|
||||
}
|
||||
else
|
||||
{
|
||||
var modNPC = NPCLoader.GetNPC(npc.type);
|
||||
dialogueKey = $"Mods.{modNPC.Mod.Name}.NPCs.{modNPC.Name}.TownNPCMood.Monument";
|
||||
}
|
||||
|
||||
// If the NPC is content, it should override that text because they are no longer content
|
||||
if (oldHappiness == 1f)
|
||||
self._currentHappiness = Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue("Vanilla.TownNPCMood.DefaultMonument") + " ";
|
||||
else
|
||||
self._currentHappiness += Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue("Vanilla.TownNPCMood.DefaultMonument") + " ";
|
||||
}
|
||||
|
||||
// The Gift sets happiness to a fixed either extremely high or extremely low value, depending on its random state.
|
||||
bool? gift = gtnpc.TheGiftStatus;
|
||||
if (gift.HasValue)
|
||||
{
|
||||
if (gift.Value)
|
||||
self._currentPriceAdjustment = 0.5f;
|
||||
else
|
||||
self._currentPriceAdjustment = 1.75f;
|
||||
|
||||
string locKey = gift.Value ? "GiftPositive" : "GiftNegative";
|
||||
string dialogueKey;
|
||||
if (npc.type < NPCID.Count)
|
||||
{
|
||||
dialogueKey = $"Mods.CalamityMod.Vanilla.TownNPCMood.{NPCID.Search.GetName(npc.type)}.{locKey}";
|
||||
// Zoologist has separate dialogue when transformed
|
||||
if (npc.type == NPCID.BestiaryGirl && npc.ShouldBestiaryGirlBeLycantrope())
|
||||
dialogueKey += "Transformed";
|
||||
}
|
||||
else
|
||||
{
|
||||
var modNPC = NPCLoader.GetNPC(npc.type);
|
||||
dialogueKey = $"Mods.{modNPC.Mod.Name}.NPCs.{modNPC.Name}.TownNPCMood.{locKey}";
|
||||
}
|
||||
// Yes, it's intentional that this completely overrides all other happiness report dialogue
|
||||
self._currentHappiness = Language.Exists(dialogueKey) ? Language.GetTextValue(dialogueKey) : CalamityUtils.GetTextValue($"Vanilla.TownNPCMood.Default{locKey}") + " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 601 B |
@@ -0,0 +1,395 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Particles;
|
||||
using CalamityMod.Prefixes;
|
||||
using CalamityMod.Projectiles.Environment;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Tools
|
||||
{
|
||||
public static class VoucherReforgeSystem
|
||||
{
|
||||
public static int ForcedPrefix = -1;
|
||||
public static bool RollWon = false;
|
||||
}
|
||||
|
||||
public class VoucherGlobalItem : GlobalItem
|
||||
{
|
||||
public override void PreReforge(Item item)
|
||||
{
|
||||
Player player = Main.LocalPlayer;
|
||||
bool isAccessory = item.accessory;
|
||||
|
||||
VoucherReforgeSystem.ForcedPrefix = -1;
|
||||
|
||||
for (int i = 0; i < player.inventory.Length; i++)
|
||||
{
|
||||
Item invItem = player.inventory[i];
|
||||
|
||||
if (invItem.ModItem is VoucherItem voucher)
|
||||
{
|
||||
if (voucher.IsUsableVoucher(player, item, isAccessory))
|
||||
{
|
||||
VoucherReforgeSystem.ForcedPrefix = voucher.GetPrefixForItem(player, item, isAccessory);
|
||||
|
||||
invItem.stack--;
|
||||
if (invItem.stack <= 0)
|
||||
invItem.TurnToAir();
|
||||
|
||||
if (Main.netMode != NetmodeID.Server)
|
||||
{
|
||||
if (VoucherReforgeSystem.RollWon)
|
||||
{
|
||||
for (int dustCount = 0; dustCount < 8; dustCount++)
|
||||
{
|
||||
// Light dust and sparks
|
||||
Vector2 sparkVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
|
||||
Vector2 dustVel = (sparkVel).SafeNormalize(Vector2.UnitY).RotatedBy(Main.rand.Next(100)) * Main.rand.NextFloat(1f, 15f);
|
||||
Vector2 fxPos = player.Center + sparkVel;
|
||||
Color fxColor = Color.Lerp(Color.MediumAquamarine, Color.MediumSeaGreen, Main.rand.NextFloat(1f));
|
||||
|
||||
Particle fx = new CustomSpark(fxPos, sparkVel, "CalamityMod/Particles/Sparkle", false, (int)(Main.rand.Next(30, 60)), Main.rand.NextFloat(1.3f, 1.8f), fxColor, new Vector2(0.5f, 1.1f), extraRotation: 0, shrinkSpeed: Main.rand.NextFloat(0.1f, 0.3f));
|
||||
GeneralParticleHandler.SpawnParticle(fx);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(fxPos, ModContent.DustType<LightDust>(), dustVel, 0, default, Main.rand.NextFloat(0.8f, 1.6f));
|
||||
dust.noGravity = true;
|
||||
dust.color = fxColor;
|
||||
|
||||
|
||||
// Crit sparkles
|
||||
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(1f, 25f);
|
||||
Color color = Main.rand.NextBool() ? Color.LightBlue : Color.LightSkyBlue;
|
||||
|
||||
Particle sparkle = new CritSpark(player.MountedCenter, velocity, color, bloom: Color.Cyan, scale: 1f, lifeTime: Main.rand.Next(15, 60));
|
||||
GeneralParticleHandler.SpawnParticle(sparkle);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item4, player.position);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int d = 0; d < 10; d++)
|
||||
{
|
||||
for (int smokeCount = 0; smokeCount < 3; smokeCount++)
|
||||
{
|
||||
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, 12f);
|
||||
Color smokeStart = Main.rand.NextBool() ? Color.Gray : Color.LightGray;
|
||||
Color smokeEnd = Color.DimGray;
|
||||
float smokeSize = Main.rand.NextFloat(0.9f, 2f);
|
||||
|
||||
Particle smoke = new SmallSmokeParticle(player.MountedCenter, velocity, smokeStart, smokeEnd, smokeSize, Main.rand.Next(90, 140));
|
||||
GeneralParticleHandler.SpawnParticle(smoke);
|
||||
}
|
||||
|
||||
Particle skull = new DesertProwlerSkullParticle(player.Center, new Vector2(2.5f, 2.5f).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1f), Main.rand.NextBool() ? Color.LightGray : Color.Silver, Color.Gray, Main.rand.NextFloat(0.15f, 0.5f), Main.rand.Next(100, 190));
|
||||
GeneralParticleHandler.SpawnParticle(skull);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item16, player.position);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class VoucherItem : ModItem
|
||||
{
|
||||
#region CyclePrefixes
|
||||
protected virtual int[] prefixChoices => Array.Empty<int>();
|
||||
protected int chosenPrefix = 0;
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
string selected = GetSelectedPrefixName();
|
||||
string all = GetAllPrefixNames();
|
||||
|
||||
foreach (var line in tooltips)
|
||||
{
|
||||
if (line.Mod == "Terraria" && line.Name.StartsWith("Tooltip"))
|
||||
{
|
||||
line.Text = line.Text
|
||||
.Replace("{0}", selected)
|
||||
.Replace("{1}", all);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string GetAllPrefixNames()
|
||||
{
|
||||
var pool = prefixChoices;
|
||||
if (pool.Length == 0)
|
||||
return null;
|
||||
|
||||
List<string> names = new();
|
||||
|
||||
foreach (int p in pool)
|
||||
{
|
||||
if (p >= 0 && p < Lang.prefix.Length && Lang.prefix[p] != null)
|
||||
names.Add(Lang.prefix[p].Value);
|
||||
}
|
||||
|
||||
return string.Join(", ", names);
|
||||
}
|
||||
|
||||
public string GetSelectedPrefixName()
|
||||
{
|
||||
var pool = prefixChoices;
|
||||
if (pool.Length == 0)
|
||||
return null;
|
||||
|
||||
int p = pool[chosenPrefix];
|
||||
|
||||
if (p >= 0 && p < Lang.prefix.Length && Lang.prefix[p] != null)
|
||||
return Lang.prefix[p].Value;
|
||||
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public bool IsUsableVoucher(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return Item.favorited && CanApply(player, itemBeingReforged, isAccessory);
|
||||
}
|
||||
|
||||
public override bool CanRightClick() => Main.keyState.PressingShift();
|
||||
|
||||
public override void RightClick(Player player)
|
||||
{
|
||||
if (prefixChoices.Length == 0)
|
||||
return;
|
||||
|
||||
chosenPrefix++;
|
||||
if (chosenPrefix >= prefixChoices.Length)
|
||||
chosenPrefix = 0;
|
||||
|
||||
Item.NetStateChanged();
|
||||
}
|
||||
|
||||
public override bool ConsumeItem(Player player) => false;
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(chosenPrefix);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
chosenPrefix = reader.ReadInt32();
|
||||
}
|
||||
|
||||
public virtual bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public virtual int GetPrefixForItem(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
if (prefixChoices.Length == 0)
|
||||
return -1;
|
||||
|
||||
if (isAccessory)
|
||||
{
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
VoucherReforgeSystem.RollWon = true;
|
||||
return prefixChoices[chosenPrefix];
|
||||
}
|
||||
else
|
||||
{
|
||||
VoucherReforgeSystem.RollWon = false;
|
||||
return ModContent.PrefixType<Friendly>();
|
||||
}
|
||||
}
|
||||
|
||||
VoucherReforgeSystem.RollWon = true;
|
||||
return prefixChoices[chosenPrefix];
|
||||
}
|
||||
}
|
||||
|
||||
public class CombatVoucher : VoucherItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return !isAccessory;
|
||||
}
|
||||
|
||||
public override int GetPrefixForItem(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
int prefix = -1;
|
||||
var category = itemBeingReforged.GetPrefixCategories();
|
||||
|
||||
if (!category.Any())
|
||||
return -1;
|
||||
|
||||
if ((itemBeingReforged).knockBack == 0f) // Weapons which do not apply knockback universally have demonic as their best reforge
|
||||
prefix = PrefixID.Demonic;
|
||||
|
||||
else if (itemBeingReforged.CountsAsClass<MeleeDamageClass>() && itemBeingReforged.type != ModContent.ItemType<TheBurningSky>())
|
||||
{
|
||||
bool weirdMelee = !category.Contains(PrefixCategory.Melee); // Weapons which deal melee damage but cannot recieve melee prefixes because Item.noUseGraphic is true
|
||||
|
||||
if (weirdMelee || itemBeingReforged.CountsAsClass<MeleeNoSpeedDamageClass>())
|
||||
prefix = PrefixID.Godly;
|
||||
else
|
||||
prefix = PrefixID.Legendary;
|
||||
}
|
||||
else if (itemBeingReforged.CountsAsClass<RangedDamageClass>() || itemBeingReforged.type == ModContent.ItemType<TheBurningSky>())
|
||||
prefix = PrefixID.Unreal;
|
||||
else if (itemBeingReforged.CountsAsClass<MagicDamageClass>())
|
||||
prefix = PrefixID.Mythical;
|
||||
else if (itemBeingReforged.CountsAsClass<RogueDamageClass>())
|
||||
prefix = ModContent.PrefixType<Flawless>();
|
||||
else if (itemBeingReforged.CountsAsClass<SummonDamageClass>())
|
||||
prefix = itemBeingReforged.IsWhip() ? PrefixID.Legendary : PrefixID.Ruthless;
|
||||
|
||||
else // Fallback case
|
||||
prefix = PrefixID.Godly;
|
||||
|
||||
if (Main.rand.NextBool())
|
||||
{
|
||||
VoucherReforgeSystem.RollWon = true;
|
||||
return prefix;
|
||||
}
|
||||
else
|
||||
{
|
||||
VoucherReforgeSystem.RollWon = false;
|
||||
return ModContent.PrefixType<Horrible>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class AggressiveVoucher : VoucherItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
|
||||
protected override int[] prefixChoices => new int[]
|
||||
{
|
||||
PrefixID.Jagged,
|
||||
PrefixID.Angry,
|
||||
PrefixID.Spiked,
|
||||
PrefixID.Menacing,
|
||||
PrefixID.Precise,
|
||||
PrefixID.Lucky
|
||||
};
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return isAccessory;
|
||||
}
|
||||
}
|
||||
|
||||
public class UnbreakableVoucher : VoucherItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
|
||||
protected override int[] prefixChoices => new int[]
|
||||
{
|
||||
PrefixID.Hard,
|
||||
PrefixID.Armored,
|
||||
PrefixID.Guarding,
|
||||
PrefixID.Warding,
|
||||
ModContent.PrefixType<Invigorating>(),
|
||||
ModContent.PrefixType<Dauntless>()
|
||||
};
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return isAccessory;
|
||||
}
|
||||
}
|
||||
|
||||
public class HurriedVoucher : VoucherItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
|
||||
protected override int[] prefixChoices => new int[]
|
||||
{
|
||||
PrefixID.Brisk,
|
||||
PrefixID.Fleeting,
|
||||
PrefixID.Hasty,
|
||||
PrefixID.Quick
|
||||
};
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return isAccessory;
|
||||
}
|
||||
}
|
||||
|
||||
public class OddVoucher : VoucherItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Tools";
|
||||
|
||||
protected override int[] prefixChoices => new int[]
|
||||
{
|
||||
PrefixID.Arcane,
|
||||
PrefixID.Wild,
|
||||
PrefixID.Rash,
|
||||
PrefixID.Intrepid,
|
||||
PrefixID.Violent,
|
||||
ModContent.PrefixType<Silent>()
|
||||
};
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 20;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.maxStack = Item.CommonMaxStack;
|
||||
}
|
||||
|
||||
public override bool CanApply(Player player, Item itemBeingReforged, bool isAccessory)
|
||||
{
|
||||
return isAccessory;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 548 B |
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
{
|
||||
Item.width = 26;
|
||||
Item.height = 26;
|
||||
Item.damage = 68;
|
||||
Item.damage = 60;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useTime = Item.useAnimation = 12;
|
||||
Item.knockBack = 12f;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.SpellTome).
|
||||
AddIngredient<MeldConstruct>(9).
|
||||
AddIngredient<MeldBlob>(18).
|
||||
AddTile(TileID.Bookcases).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
Item.width = 28;
|
||||
Item.height = 30;
|
||||
Item.damage = 69;
|
||||
Item.damage = 56;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.mana = 8;
|
||||
Item.useTime = 20;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 56;
|
||||
Item.height = 60;
|
||||
Item.damage = 77;
|
||||
Item.damage = 65;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = Item.useTime = 30;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(15).
|
||||
AddIngredient<MeldBlob>(18).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 124;
|
||||
Item.height = 124;
|
||||
Item.damage = 3777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :(
|
||||
Item.damage = 5777; // Feel free to change these 7s as balance requires. The other 7s should stay - Update: no more 2777... :(
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = 77;
|
||||
Item.useTime = 77;
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 130;
|
||||
Item.height = 130;
|
||||
Item.damage = 515;
|
||||
Item.damage = 360;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.useAnimation = 35;
|
||||
Item.useTime = 35;
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public bool spawnProj = true;
|
||||
public bool spawnTrueMeleeProj = true;
|
||||
public bool playSound = true;
|
||||
public float scaling = 1;
|
||||
|
||||
public Color clr = Color.MediumOrchid;
|
||||
|
||||
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 78;
|
||||
Item.height = 78;
|
||||
Item.damage = 310;
|
||||
Item.damage = 280;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useAnimation = Item.useTime = 20;
|
||||
@@ -48,10 +49,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override void ModifyItemScale(Player player, ref float scale)
|
||||
{
|
||||
scale = scaling = player.GetMeleeScale();
|
||||
}
|
||||
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
|
||||
{
|
||||
// Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
|
||||
float scale = 8f;
|
||||
float scale = 8f * scaling;
|
||||
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
|
||||
hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
|
||||
}
|
||||
@@ -60,7 +65,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Vector2 mPos = player.Calamity().mouseWorld;
|
||||
Vector2 shootDir = player.Center.DirectionTo(mPos);
|
||||
float _ = float.NaN;
|
||||
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 145, Item.width * 3f, ref _);
|
||||
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30 * scaling, player.Center + shootDir * 145 * scaling, Item.width * 3f * scaling, ref _);
|
||||
return ((canHit && hitCheck) ? null : false);
|
||||
}
|
||||
public override void UseAnimation(Player player)
|
||||
@@ -109,9 +114,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
if (completion >= 0.65f && spawnProj)
|
||||
{
|
||||
if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted
|
||||
Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
|
||||
|
||||
Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f, clr, new Vector2(1f, 1f), true, false, 0, false, false);
|
||||
{
|
||||
Projectile beam = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
|
||||
beam.ai[1] = scaling;
|
||||
}
|
||||
Particle swipe = new CustomSpark(player.Center - shootDir * 5 * scaling, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f * scaling, clr, new Vector2(1f, 1f), true, false, 0, false, false);
|
||||
GeneralParticleHandler.SpawnParticle(swipe);
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item60, player.Center);
|
||||
@@ -123,7 +130,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
}
|
||||
|
||||
float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
|
||||
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
|
||||
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180 * scaling;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
|
||||
player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
|
||||
@@ -137,13 +144,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (spawnTrueMeleeProj)
|
||||
{
|
||||
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.35f);
|
||||
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.2f);
|
||||
Vector2 mouseClamped = player.ClampedMouseWorld();
|
||||
SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Vector2 vel = player.Center.DirectionFrom(target.Center).RotatedByRandom(0.7f) * Main.rand.NextFloat(18, 20);
|
||||
Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType<StarofJudgement>(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1);
|
||||
Projectile star = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType<StarofJudgement>(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1);
|
||||
star.scale = scaling;
|
||||
}
|
||||
spawnTrueMeleeProj = false;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 76;
|
||||
Item.height = 76;
|
||||
Item.damage = 144;
|
||||
Item.damage = 100;
|
||||
Item.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Item.crit = 11;
|
||||
Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow
|
||||
|
||||
@@ -15,10 +15,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.height = 146;
|
||||
Item.damage = 100;
|
||||
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
|
||||
Item.crit = 45;
|
||||
Item.useAnimation = 12;
|
||||
Item.crit = 41;
|
||||
Item.useTime = Item.useAnimation = 12;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.useTime = 12;
|
||||
Item.useTurn = true;
|
||||
Item.knockBack = 6f;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public bool spawnProj = true;
|
||||
public bool spawnTrueMeleeProj = true;
|
||||
public bool playSound = true;
|
||||
public float scaling = 1;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = Item.height = 112;
|
||||
@@ -46,6 +47,10 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.shoot = ModContent.ProjectileType<OrderbringerWaveProj>();
|
||||
Item.shootSpeed = 5.5f;
|
||||
}
|
||||
public override void ModifyItemScale(Player player, ref float scale)
|
||||
{
|
||||
scale = scaling = player.GetMeleeScale();
|
||||
}
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
return false;
|
||||
@@ -53,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
|
||||
{
|
||||
// Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
|
||||
float scale = 8f;
|
||||
float scale = 8f * scaling;
|
||||
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
|
||||
hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
|
||||
}
|
||||
@@ -62,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Vector2 mPos = player.Calamity().mouseWorld;
|
||||
Vector2 shootDir = player.Center.DirectionTo(mPos);
|
||||
float _ = float.NaN;
|
||||
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 245, Item.width * 3f, ref _);
|
||||
bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30 * scaling, player.Center + shootDir * 215 * scaling, Item.width * 3f * scaling, ref _);
|
||||
return ((canHit && hitCheck) ? null : false);
|
||||
}
|
||||
public override void UseAnimation(Player player)
|
||||
@@ -110,17 +115,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (!player.Calamity().bladeArmEnchant) // Manually remove projectiles when Tainted
|
||||
{
|
||||
Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
|
||||
|
||||
Projectile beam = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
|
||||
beam.ai[1] = scaling;
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1);
|
||||
Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f);
|
||||
Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType<StarofOrder>(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1);
|
||||
Projectile star = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType<StarofOrder>(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1);
|
||||
star.scale = scaling;
|
||||
}
|
||||
}
|
||||
|
||||
Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false);
|
||||
Particle swipe = new CustomSpark(player.Center - shootDir * 5 * scaling, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f * scaling, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false);
|
||||
GeneralParticleHandler.SpawnParticle(swipe);
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item60, player.Center);
|
||||
@@ -132,8 +139,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
}
|
||||
|
||||
float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
|
||||
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240;
|
||||
Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
|
||||
bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240 * scaling;
|
||||
Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180 * scaling;
|
||||
|
||||
player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
|
||||
player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
|
||||
@@ -147,7 +154,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
if (spawnTrueMeleeProj)
|
||||
{
|
||||
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.35f);
|
||||
int beamDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage * 0.10f);
|
||||
Vector2 mouseClamped = player.ClampedMouseWorld();
|
||||
SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center);
|
||||
for (int i = 0; i < 2; i++)
|
||||
@@ -159,7 +166,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900);
|
||||
Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10;
|
||||
Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType<OrderbringerBeam>(), beamDamage, 0, player.whoAmI);
|
||||
Projectile skybeam = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType<OrderbringerBeam>(), beamDamage, 0, player.whoAmI);
|
||||
skybeam.scale = scaling;
|
||||
}
|
||||
spawnTrueMeleeProj = false;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
Item.width = 134;
|
||||
Item.height = 54;
|
||||
Item.damage = 3725;
|
||||
Item.damage = 1400;
|
||||
Item.crit = 18;
|
||||
Item.knockBack = 12f;
|
||||
Item.useTime = 5;
|
||||
|
||||
@@ -47,6 +47,10 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
}
|
||||
public override bool RangedPrefix() => true; //class identity is fake
|
||||
public override bool MeleePrefix() => false;
|
||||
public override void ModifyItemScale(Player player, ref float scale)
|
||||
{
|
||||
scale = player.GetMeleeScale();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public static float ScrewBazingaModeDamageMult = 6.5f;
|
||||
public static float ScrewBazingaAimAssistAngle = 0.52f; //This may look high but remember this is the FULL angle, so it actually checks for half that angle deviation
|
||||
public static float ScrewBazingaAimAssistReach = 600f;
|
||||
public float scaler = 1;
|
||||
|
||||
public override ModItem Clone(Item item)
|
||||
{
|
||||
@@ -99,6 +100,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
scaler = player.GetMeleeScale();
|
||||
player.Calamity().mouseWorldListener = true;
|
||||
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
@@ -143,8 +145,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
//Prevent it from being thrown at any less than -1f
|
||||
chuckSpeed.Y = Math.Clamp(chuckSpeed.Y, -1f, 3f);
|
||||
|
||||
int p = Projectile.NewProjectile(source, position, chuckSpeed, ModContent.ProjectileType<WulfrumScrew>(), damage, knockback, player.whoAmI);
|
||||
|
||||
Projectile p = Projectile.NewProjectileDirect(source, position, chuckSpeed, ModContent.ProjectileType<WulfrumScrew>(), damage, knockback, player.whoAmI);
|
||||
p.scale = scaler + 0.2f;
|
||||
ScrewStored = false;
|
||||
return false;
|
||||
}
|
||||
@@ -188,7 +190,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
position = Vector2.Lerp(new Vector2(ScrewPosition.X, ScrewPosition.Y), new Vector2(ScrewStart.X, ScrewStart.Y), ProgressionOfScrew);
|
||||
float rotation = ScrewPosition.Z.AngleLerp(ScrewStart.Z, ProgressionOfScrew);
|
||||
float outlineOpacity = (float)Math.Pow(1 - ScrewTimer / ScrewTime, 2);
|
||||
scale = 1.05f + 0.05f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f);
|
||||
scale = 1.05f * scale + 0.05f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f);
|
||||
|
||||
Main.spriteBatch.Draw(screwOutlineTex, position, null, Color.Lerp(Color.GreenYellow, Color.White, (float)Math.Sin(Main.GlobalTimeWrappedHourly) * 0.5f + 0.5f) * outlineOpacity, rotation, screwOutlineTex.Size() / 2f, scale, 0, 0);
|
||||
Main.spriteBatch.Draw(screwTex, position, null, Color.White, rotation, screwTex.Size() / 2f, scale, 0, 0);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<MeldConstruct>(12).
|
||||
AddIngredient<MeldBlob>(18).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Rarities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
public class OmniGun : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Weapons.Ranged";
|
||||
|
||||
public static int AmmoSavedPercent = 66;
|
||||
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(AmmoSavedPercent);
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 118;
|
||||
Item.height = 32;
|
||||
Item.damage = 57;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.useAnimation = Item.useTime = 6;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.noMelee = true;
|
||||
Item.knockBack = 5f;
|
||||
Item.UseSound = null;
|
||||
Item.noUseGraphic = true;
|
||||
Item.channel = true;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<OmniGunHoldout>();
|
||||
Item.shootSpeed = 16f;
|
||||
Item.useAmmo = AmmoID.Bullet;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityYellowBuyPrice;
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
}
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0 && Main.rand.Next(100) >= AmmoSavedPercent;
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType<OmniGunHoldout>(), damage, knockback, player.whoAmI);
|
||||
|
||||
// 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction
|
||||
// We set the rotation to the direction to the mouse so the first frame doesn't appear bugged out.
|
||||
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||