コード例 #1
0
        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;
        }
コード例 #2
0
        public void use(Player player, EffectStrength es)
        {
            int strength = es.calculateStrength(this);

            player.setAttack(player.getAttack() + strength);
            player.setDefence(player.getDefence() + strength);
        }
コード例 #3
0
ファイル: News.cs プロジェクト: pedrosbmartins/bullsandbears
 public News(Industry industry, string headline, EffectDirection direction, EffectStrength strength)
 {
     Industry             = industry;
     Headline             = headline;
     PriceEffectDirection = direction;
     PriceEffectStrength  = strength;
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
 public PriceEffect(Industry industry, EffectDirection direction, EffectStrength strength)
 {
     AffectedIndustry = industry;
     Direction        = direction;
     Strength         = strength;
 }
コード例 #6
0
 public void use(Player player, EffectStrength es)
 {
     Console.WriteLine("All enemies are immune to damage potion at the moment! :o");
 }