Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Terraria;
- using Terraria.ModLoader;
- namespace SingularityMod.Items
- {
- public class TestydudeysNecklace : ModItem
- {
- public override void SetStaticDefaults()
- {
- Tooltip.SetDefault("10 tiers of stat boosts (all stack)"
- + "\nIf below 100% health, damage increased by 5%"
- + "\nIf below 90% health, crit chance increased by 5%"
- + "\nIf below 80% health, defense increased by 10"
- + "\nIf below 70% health, damage reduction increased by 5%"
- + "\nIf below 60% health, melee speed increased by 15%"
- + "\nIf below 50% health, mana increased by 100"
- + "\nIf below 40% health, damage increased by 10%"
- + "\nIf below 30% health, crit increased by 10%"
- + "\nIf below 20% health, damage reduction increased by 10%"
- + "\nIf below 10% health, regeneration increased by 10");
- }
- public override void SetDefaults()
- {
- item.width = 20;
- item.height = 32;
- item.accessory = true;
- item.rare = 8;
- item.value = 10000000;
- }
- public override void UpdateAccessory(Player player, bool hideVisual)
- {
- bool isBelow100HP = player.statLifeMax2 - player.statLife > player.statLifeMax2;
- if (isBelow100HP)
- {
- player.meleeDamage += 0.05f;
- player.rangedDamage += 0.05f;
- player.magicDamage += 0.05f;
- player.minionDamage += 0.05f;
- player.thrownDamage += 0.05f;
- }
- bool isBelow90HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.9;
- if (isBelow90HP)
- {
- player.meleeCrit += 5;
- player.rangedCrit += 5;
- player.magicCrit += 5;
- player.thrownCrit += 5;
- }
- bool isBelow80HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.8;
- if (isBelow80HP)
- {
- player.statDefense += 10;
- }
- bool isBelow70HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.7;
- if (isBelow70HP)
- {
- player.endurance += 0.15f;
- }
- bool isBelow60HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.6;
- if (isBelow60HP)
- {
- player.meleeSpeed += 15f;
- }
- bool isBelow50HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.5;
- if (isBelow50HP)
- {
- player.statManaMax2 += 100;
- }
- bool isBelow40HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.4;
- if (isBelow40HP)
- {
- player.meleeDamage += 0.1f;
- player.rangedDamage += 0.1f;
- player.magicDamage += 0.1f;
- player.minionDamage += 0.1f;
- player.thrownDamage += 0.1f;
- }
- bool isBelow30HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.3;
- if (isBelow30HP)
- {
- player.meleeCrit += 1;
- player.rangedCrit += 1;
- player.magicCrit += 1;
- player.thrownCrit += 1;
- }
- bool isBelow20HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.2;
- if (isBelow20HP)
- {
- player.endurance += 0.1f;
- }
- bool isBelow10HP = player.statLifeMax2 - player.statLife > player.statLifeMax2 * 0.1;
- if (isBelow10HP)
- {
- player.lifeRegen += 10;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement