Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Champion
- {
- public string name;
- public double health;
- public double mana;
- public int ap;
- public int ad;
- public int armor;
- public int mr;
- public Champion(string name, double health, double mana, int ap, int ad, int armor, int mr)
- {
- this.name = name;
- this.health = health;
- this.mana = mana;
- this.ap = ap;
- this.ad = ad;
- this.armor = armor;
- this.mr = mr;
- }
- /*
- * this champion get damaged by ap and reduced by mr
- * return true if this champion still a live. false if dead.
- */
- private bool DamageTakenAP(double ap)
- {
- this.health -= (ap * 100 / (100 + this.mr));
- return this.health > 0;
- }
- private bool DamgeTakenAd(double ad)
- {
- this.health -= (ad * 100 / (100 + this.armor));
- return this.health > 0;
- }
- /*
- * Deal damage to other champion
- */
- public void DamageDealtAP(Champion other)
- {
- other.DamageTakenAP(this.ap);
- }
- public void DamgeDealtAd(Champion other)
- {
- other.DamageTakenAP(this.ad);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement