CSC112 Spring 2016 Examples
#include "zenPaca.h"1#include <cstdlib>2#include <iostream>34using namespace std;567//override virtual functions8std::string9zenPaca::name() {10return "ZenPaca";11}1213void14zenPaca::act(Alpaca *opponent) {1516static int stunCount = 0;1718if(getPower() <= 6) {19reflect();20} else {21if (stunCount%4 == 0 and getPower() >= 18) {22inceptionate(opponent);23} else {24zenTap(opponent);25}26stunCount++;27}28}2930void31zenPaca::transcend() {32cout << name() << " transcends the limits of its body!" << endl;33increaseAttack(9);34}3536void37zenPaca::mindread(Alpaca *opponent) {38cout << name() << " better understands his opponent!" << endl;39decreaseDefense(opponent, 5);40}4142void43zenPaca::zenKick(Alpaca *opponent) {44cout << name() << " centers its chakra in its hoof for a devastating kick!!" << endl45<< " ... It's super effective!" << endl;46attack(opponent, 10);47}4849void50zenPaca::zenTap(Alpaca *opponent) {51cout << name() << " disrupts the chakra of its opponent!" << endl52<< " ... It's super effective!" << endl;53attack(opponent, 6);54}5556void57zenPaca::inceptionate(Alpaca *opponent) {58cout << name() << " places its opponent in a psychic coma!" << endl;59stun(opponent, 6);60}6162void63zenPaca::zenergy() {64cout << name() << " repairs its disrupted zenergy!" << endl;65increaseHp(8);66}6768void69zenPaca::reflect() {70cout << name() << " reflects about its life as it treasures its last bit of power" << endl;71}727374