private void normalAttack(Hero hero, Monster mon) //Hero attacks!
        {
            int heroDamage;

            if (hero.getIsPhysical())
            {
                heroDamage = hero.BasicAttack() - mon.getModDefense();
            }
            else
            {
                heroDamage = hero.BasicAttack() - mon.getModResistance();
            }
            if (heroDamage < 0)
            {
                heroDamage = 0;
            }

            _Paragraph.Inlines.Add(new Bold(new Run(hero.getName() + " used basic attack for: " + heroDamage + " damage"))//EVENTUALLY, I want to say which monster got attacked, in the swarm window.
            {
                Foreground = hero.getTextColor()
            });
            _Paragraph.Inlines.Add(new LineBreak());

            mon.setCurHealth(mon.getCurHealth() - heroDamage);
            updateVisuals();

            checkForDefeatedUnit();
        }
Exemple #2
0
        private void normalAttack(Hero hero) //Hero attacks!
        {
            var cw = new ChoiceWindow(_TheSwarm);

            cw.ShowDialog();
            int     attackTarget = cw.getChoiceFromSelect();
            Monster mon          = _TheSwarm[attackTarget];

            int heroDamage;

            if (hero.getIsPhysical())
            {
                heroDamage = hero.BasicAttack() - mon.getModDefense();
            }
            else
            {
                heroDamage = hero.BasicAttack() - mon.getModResistance();
            }
            if (heroDamage < 0)
            {
                heroDamage = 0;
            }

            _Paragraph.Inlines.Add(new Bold(new Run(hero.getName() + " used basic attack for: " + heroDamage + " damage"))
            {
                Foreground = hero.getTextColor()
            });
            _Paragraph.Inlines.Add(new LineBreak());

            mon.setCurHealth(mon.getCurHealth() - heroDamage);
            updateVisuals();

            checkForDefeatedUnit();
        }
 private void defend(Hero hero)
 {
     _Paragraph.Inlines.Add(new Bold(new Run(hero.getName() + " used defend and is taking reduced damage this turn."))
     {
         Foreground = hero.getTextColor()
     });
     _Paragraph.Inlines.Add(new LineBreak());
     hero.setIsDefending(true);
 }
Exemple #4
0
        private void specialMove(Hero hero, int whichHero)
        {
            string toReturn = hero.PerformSpecialAttack(_theParty, whichHero, _TheSwarm);

            _Paragraph.Inlines.Add(new Bold(new Run(toReturn))
            {
                Foreground = hero.getTextColor()
            });
            _Paragraph.Inlines.Add(new LineBreak());
            checkForDepletedMana();
            updateVisuals();
            checkForDefeatedUnit();
        }
        private void specialMove(Hero hero, int whichHero)
        {
            Monster[] justOneMonster = new Monster[1];
            justOneMonster[0] = _monster;
            string toReturn = hero.PerformSpecialAttack(_theParty, whichHero, justOneMonster);

            _Paragraph.Inlines.Add(new Bold(new Run(toReturn))
            {
                Foreground = hero.getTextColor()
            });
            _Paragraph.Inlines.Add(new LineBreak());

            updateVisuals();
            checkForDefeatedUnit();
            checkForDepletedMana();
        }