public Item(int id, string name, PotionType type, int price, EffectStrength es) { this.id = id; this.name = name; this.price = price; switch (type) { case PotionType.health: effect = new HealthEffect(); break; case PotionType.buff: effect = new BuffEffect(); break; case PotionType.damage: effect = new DamageEffect(); break; default: effect = new HealthEffect(); break; } this.es = es; }
public void use(Player player, EffectStrength es) { int strength = es.calculateStrength(this); player.setAttack(player.getAttack() + strength); player.setDefence(player.getDefence() + strength); }
public News(Industry industry, string headline, EffectDirection direction, EffectStrength strength) { Industry = industry; Headline = headline; PriceEffectDirection = direction; PriceEffectStrength = strength; }
public void use(Player player, EffectStrength es) { //heal player for 5 int strength = es.calculateStrength(this); if (player.getMaxHp() < player.getHp() + strength) { player.setHp(player.getMaxHp()); } else { player.setHp(player.getHp() + strength); } }
public PriceEffect(Industry industry, EffectDirection direction, EffectStrength strength) { AffectedIndustry = industry; Direction = direction; Strength = strength; }
public void use(Player player, EffectStrength es) { Console.WriteLine("All enemies are immune to damage potion at the moment! :o"); }