public override void Happen(Player entity) { if (amount < 0) { var sc = Run.Scourge; for (var i = 0; i < sc; i++) { Run.RemoveScourge(); } var inventory = entity.GetComponent <InventoryComponent>(); var toRemove = new List <Item>(); foreach (var i in inventory.Items) { if (i.Scourged) { i.Scourged = false; } if (i.Type == ItemType.Scourge) { toRemove.Add(i); } } Cleanse(entity.GetComponent <WeaponComponent>()); Cleanse(entity.GetComponent <ActiveWeaponComponent>()); Cleanse(entity.GetComponent <ActiveItemComponent>()); // fixme: doesnt do anything to ui inventory foreach (var i in toRemove) { inventory.Remove(i, true); } foreach (var s in Scourge.Defined) { Scourge.Disable(s); } } else { for (var i = 0; i < amount; i++) { Run.AddScourge(); } } }
public void RenderWindow() { ImGui.Separator(); ImGui.Text($"Time: {Math.Floor(Time / 3600f)}h {Math.Floor(Time / 60f % 60f)}m {Math.Floor(Time % 60f)}s"); ImGui.Text($"Won: {Won}"); ImGui.Text($"Loop: {Run.Loop}"); ImGui.Text($"Max Depth: {MaxDepth}"); ImGui.Text($"Game Version: {GameVersion}"); Run.CalculateScore(); ImGui.Text($"Score: {Run.Score}"); ImGui.Separator(); if (ImGui.TreeNode("Items")) { foreach (var item in Items) { ImGui.BulletText(item); } ImGui.TreePop(); } if (ImGui.TreeNode("Banned items")) { foreach (var item in Banned) { ImGui.BulletText(item); } ImGui.TreePop(); } ImGui.Separator(); ImGui.Text($"Coins Collected: {CoinsObtained}"); ImGui.Text($"Keys Collected: {KeysObtained}"); ImGui.Text($"Bombs Collected: {BombsObtained}"); ImGui.Text($"Hearts Collected: {HeartsCollected}"); ImGui.Text($"Heart Containers Collected: {MaxHealth}"); ImGui.Separator(); ImGui.Text($"Damage Taken: {DamageTaken}"); ImGui.Text($"Damage Dealt: {DamageDealt}"); ImGui.Text($"Mobs Killed: {MobsKilled}"); ImGui.Text($"Rooms Explored: {RoomsExplored} / {RoomsTotal}"); ImGui.Text($"Secret Rooms Explored: {SecretRoomsFound} / {SecretRoomsTotal}"); ImGui.Separator(); ImGui.Text($"Date Started: {Day} {Year}"); ImGui.Text($"Tiles Walked: {TilesWalked}"); ImGui.Text($"Pits Fallen: {PitsFallen}"); ImGui.Text($"Bosses Defeated: {BossesDefeated}"); ImGui.Text($"Spikes Triggered: {SpikesTriggered}"); ImGui.Text($"Paintings Broke: {GlobalSave.GetInt("paintings_destroyed")}"); ImGui.Separator(); ImGui.Text($"Luck: {Run.Luck}"); ImGui.Text($"Scourge: {Run.Scourge}"); if (ImGui.TreeNode("Scourges")) { foreach (var curse in Scourge.Defined) { var v = Scourge.IsEnabled(curse); if (ImGui.Checkbox(curse, ref v)) { if (v) { Scourge.Enable(curse); } else { Scourge.Disable(curse); } } } ImGui.TreePop(); } }