private void CountPresentationHP(MyEvil evil) { EvilInGame targetEvil = gameModel.Evil[evil]; int scheduledHP = targetEvil.HealthPoints - (targetEvil.NumberOfEvil - 1) * 100; int resultHP = scheduledHP; if (scheduledHP == 0) { if (targetEvil.NumberOfEvil != 0) { resultHP = 100; } else { resultHP = 0; } } targetEvil.PresentationHP = resultHP; }
public void DecreaseEvilHP(MyEvil evil, int damage) { EvilInGame targetEvil = gameModel.Evil[evil]; int scheduledHP = targetEvil.HealthPoints - damage; int edgeHP = (targetEvil.NumberOfEvil - 1) * 100; if (scheduledHP > 0) { if (scheduledHP < edgeHP) { targetEvil.NumberOfEvil--; } targetEvil.HealthPoints = scheduledHP; CountPresentationHP(evil); } else { targetEvil.NumberOfEvil = 0; targetEvil.HealthPoints = 0; targetEvil.PresentationHP = 0; } }
public void LogMovementOfEvil(EvilInGame evil) { LogInfo(string.Format("Evil moved: POSITION: [ X: {0} Y: {1} ], HP left: {2}, Number of evils: {3}", evil.pointForEvil.X, evil.pointForEvil.Y, evil.HealthPoints, evil.NumberOfEvil)); }
public void LogEvilFight(EvilInGame evil) { LogInfo(string.Format("Evil was attacked: POSITION: [ X: {0} Y: {1} ], HP left: {2}, Number of evils: {3}", evil.pointForEvil.X, evil.pointForEvil.Y, evil.HealthPoints, evil.NumberOfEvil)); }