public virtual void ModifyWeaponDamage(Player player, ref int damage) { Tynyran modPlayer = player.Tyn(); int originalDmg = damage; damage = (int)(damage * modPlayer.tynyran); float globalDmg = player.meleeDamage - 1; if (player.magicDamage - 1 < globalDmg) { globalDmg = player.magicDamage - 1; } if (player.rangedDamage - 1 < globalDmg) { globalDmg = player.rangedDamage - 1; } if (player.minionDamage - 1 < globalDmg) { globalDmg = player.minionDamage - 1; } if (player.thrownDamage - 1 < globalDmg) { globalDmg = player.thrownDamage - 1; } if (globalDmg > 1) { damage += (int)(originalDmg * globalDmg); } }
public override void Update(GameTime gameTime) { base.Update(gameTime); if (oldScale != Main.inventoryScale) { oldScale = Main.inventoryScale; Recalculate(); } if (!Main.dedServ) { Tynyran p = Main.LocalPlayer.Tyn(); visible = Main.LocalPlayer.HeldItem.type == ItemType <HuntingHorn>(); note1.SetFrame(new Rectangle(0, 24 * p.noteList[0], 32, 24)); note2.SetFrame(new Rectangle(0, 24 * p.noteList[1], 32, 24)); note3.SetFrame(new Rectangle(0, 24 * p.noteList[2], 32, 24)); note4.SetFrame(new Rectangle(0, 24 * p.noteList[3], 32, 24)); } }
public override void Update(GameTime gameTime) { base.Update(gameTime); if (oldScale != Main.inventoryScale) { oldScale = Main.inventoryScale; Recalculate(); } Tynyran tyn = Main.LocalPlayer.Tyn(); visible = tyn.aether; if (visible) { float quotient = (float)Main.LocalPlayer.Tyn().aetherCharges / (float)Main.LocalPlayer.Tyn().maxAetherCharges; quotient = Utils.Clamp(quotient, 0f, 1f); aetherOrbRect.Width = aetherOrbRect.Y = (int)(52 * quotient); AetherBar.SetFrame(aetherOrbRect); } }
public override void Update(GameTime gameTime) { base.Update(gameTime); area.visible = visible; if (oldScale != Main.inventoryScale) { oldScale = Main.inventoryScale; Recalculate(); } Tynyran tyn = Main.LocalPlayer.Tyn(); visible = tyn.hemomancy; if (visible) { float quotient = (float)Main.LocalPlayer.Tyn().bloodLevel / (float)Main.LocalPlayer.Tyn().maxBloodLevel; quotient = Utils.Clamp(quotient, 0f, 1f); bloodBarRect.Width = (int)(124 * quotient); bloodBar.SetFrame(bloodBarRect); if (!set) { bloodUseRect.Width = 0; bloodUse.SetFrame(bloodBarRect); set = true; } if (!arraySet) { bloodArray[2] = bloodArray[1]; bloodArray[1] = bloodArray[0]; bloodArray[0] = tyn.bloodLevel; arraySet = true; } if (tyn.bloodLevel < bloodArray[0]) { bloodArray[2] = bloodArray[1]; bloodArray[1] = bloodArray[0]; bloodArray[0] = tyn.bloodLevel; cooldown = 30; } else if (tyn.bloodLevel == bloodArray[0]) { if (cooldown > 0) { cooldown--; } } if (cooldown == 0 && bloodUseRect.Width != bloodBarRect.Width) { if ((bloodUseRect.Width - bloodBarRect.Width) * 0.05f < 1) { bloodUseRect.Width--; } else { bloodUseRect.Width -= (int)((bloodUseRect.Width - bloodBarRect.Width) * 0.05f); } bloodUse.SetFrame(bloodUseRect); } if (bloodBarRect.Width > bloodUseRect.Width) { bloodUseRect.Width = bloodBarRect.Width; bloodUse.SetFrame(bloodUseRect); } // if (prov.bloodAmp) bLFrame.SetImage(GetTexture("ProvidenceMod/UI/BloodUIFrameAmp")); // else bLFrame.SetImage(GetTexture("ProvidenceMod/UI/BloodUIFrame")); } }