Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Step_QuickHeal()

void Terraria.GameContent.ChromaHotkeyPainter.Step_QuickHeal ( )
inlineprivate

Definition at line 445 of file ChromaHotkeyPainter.cs.

446 {
447 PaintKey healKey = _healKey;
449 {
450 healKey.SetClear();
451 _quickHealAlert = 0;
452 }
453 else if (_player.potionDelay > 0)
454 {
455 float lerpValue = Utils.GetLerpValue(_player.potionDelayTime, 0f, _player.potionDelay, clamped: true);
456 Color solid = Color.Lerp(PainterColors.DangerKeyBlocked, PainterColors.QuickHealCooldown, lerpValue) * lerpValue * lerpValue * lerpValue;
457 healKey.SetSolid(solid);
458 _quickHealAlert = 0;
459 }
461 {
462 healKey.SetClear();
463 _quickHealAlert = 0;
464 }
465 else if ((float)_player.statLife <= (float)_player.statLifeMax2 / 4f)
466 {
467 if (_quickHealAlert != 1)
468 {
469 _quickHealAlert = 1;
470 healKey.SetAlert(Color.Black, PainterColors.QuickHealReadyUrgent, -1f, 2f);
471 }
472 }
473 else if ((float)_player.statLife <= (float)_player.statLifeMax2 / 2f)
474 {
475 if (_quickHealAlert != 2)
476 {
477 _quickHealAlert = 2;
478 healKey.SetAlert(Color.Black, PainterColors.QuickHealReadyUrgent, -1f, 2f);
479 }
480 }
481 else
482 {
483 healKey.SetSolid(PainterColors.QuickHealReady);
484 _quickHealAlert = 0;
485 }
486 }
Item QuickHeal_GetItemToUse()
Definition Player.cs:4689
int potionDelayTime
Definition Player.cs:2443
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Terraria.GameContent.ChromaHotkeyPainter._healKey, Terraria.GameContent.ChromaHotkeyPainter._player, Terraria.GameContent.ChromaHotkeyPainter._quickHealAlert, Microsoft.Xna.Framework.Color.Black, Terraria.GameContent.ChromaHotkeyPainter.PainterColors.DangerKeyBlocked, Terraria.Player.DeadOrGhost, Terraria.Utils.GetLerpValue(), Microsoft.Xna.Framework.Color.Lerp(), Terraria.Player.potionDelay, Terraria.Player.potionDelayTime, Terraria.Player.QuickHeal_GetItemToUse(), Terraria.GameContent.ChromaHotkeyPainter.PainterColors.QuickHealCooldown, Terraria.GameContent.ChromaHotkeyPainter.PainterColors.QuickHealReady, Terraria.GameContent.ChromaHotkeyPainter.PainterColors.QuickHealReadyUrgent, Terraria.Player.statLife, and Terraria.Player.statLifeMax2.

Referenced by Terraria.GameContent.ChromaHotkeyPainter.Update().