CSC112 Spring 2016 Examples
#include <iostream>1#include "firePaca.h"23using namespace std;45//constructor6//firePaca::firePaca(unsigned int pow) : alpaca(pow){}78std::string9cwillis::firePaca::name()10{11return nickName;12}1314void15cwillis::firePaca::act(Alpaca* opponent) {1617if (getHp() == 100) smolder();18else fireball(opponent);1920}2122//moves23void24cwillis::firePaca::fireball(Alpaca* opponent) {25cout << name() << " flings a ball of flame." << endl;26attack(opponent,18);27}2829void30cwillis::firePaca::smolder() {31cout << name() << " burns within." << endl;32increaseAttack(18);33}3435void36cwillis::firePaca::flare(Alpaca* opponent) {37cout << name() << " produces a blinding flash." << endl;38stun(opponent, 16);39}4041void42cwillis::firePaca::flamekick(Alpaca* opponent) {43cout << name() << " kicks with all four flaming hooves." << endl;44attack(opponent, 22);45}464748