public void HealOneTimeModTest() { Setup.SetupTestInfrastructure(); ActiveGame activeGame = GameContainer.ActiveGame; try { AmountModifier healthMod = new AmountModifier("Healing Field", "Increase next healing by 1", ModifierTargets.Local, AmountModifierType.Health, 1, true); CharacterAccount fromAccount = activeGame.AllTargets[43]; CharacterAccount toAccount = activeGame.AllTargets[87]; GameContainer.AddHealthModifier(healthMod, toAccount); GameContainer.DealDamage(fromAccount, toAccount, 4, DamageType.Melee); GameContainer.HealCharacter(toAccount, toAccount, 1); int expectedHealth = 13; int actualhealth = toAccount.CurrentHealth; Assert.IsTrue(expectedHealth == actualhealth, $"{toAccount.Name} health doesn't match expected health. Expected {expectedHealth}, actually {actualhealth}"); int expectedMod = 0; int actualMod = toAccount.HealthMod; Assert.IsTrue(expectedMod == actualMod, $"{toAccount.Name} health mod doesn't match expected mod. Expected {expectedMod}, actually {actualMod}"); } catch (Exception e) { Assert.Fail("Test failed: " + e); } }
public void HealEnvironmentTarget() { Setup.SetupTestInfrastructure(); ActiveGame activeGame = GameContainer.ActiveGame; GameContainer.DealDamage(activeGame.AllTargets[43], activeGame.AllTargets[87], 5, DamageType.Melee); try { GameContainer.HealCharacter(activeGame.AllTargets[43], activeGame.AllTargets[87], 3); int expectedHealth = 13; int actualHealth = activeGame.AllTargets[87].CurrentHealth; Assert.IsTrue(expectedHealth == actualHealth, $"Enraged T-Rex is not at the expected health. Expected {expectedHealth}, Actual {actualHealth}"); } catch (Exception e) { Assert.Fail("Test failed: " + e); } }
public void HealHeroTarget() { Setup.SetupTestInfrastructure(); ActiveGame activeGame = GameContainer.ActiveGame; GameContainer.DealDamage(activeGame.AllTargets[88], activeGame.AllTargets[88], 1, DamageType.Melee); try { GameContainer.HealCharacter(activeGame.AllTargets[43], activeGame.AllTargets[88], 1); int expectedHealth = 2; int actualHealth = activeGame.AllTargets[88].CurrentHealth; Assert.IsTrue(expectedHealth == actualHealth, $"Raptor Bot is not at the expected health. Expected {expectedHealth}, Actual {actualHealth}"); } catch (Exception e) { Assert.Fail("Test failed: " + e); } }
private void Heal(int amount, CharacterAccount to) { CharacterAccount from = selectedCharacter; GameContainer.HealCharacter(from, to, amount); }