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(); }
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(); }