CSC112 Spring 2016 Examples
//implimentation file for blobPaca12#include "blobPaca.h"3#include "../alpaca.h"4#include <cstdlib>5#include <iostream>67using namespace std;89//virtual functions to override10std::string11blobPaca::name() {12return nickName;13}1415void16blobPaca::act(Alpaca *opponent) {1718static int moves = 0;1920if(getPower() > 11) {21if(moves < 3 and getHp() < 20) {22reblob();23} else {24//up the attack of the first or second zenPaca like nothin else25int i = (rand()%2);26int j = (*pack).packSize()-(10 +i);27jellify((*pack)[j]);28}29} else {30snooze();31}3233moves++;34}3536//moveset37void38blobPaca::congeal() {39cout << name() << " adds blobenous mass!" << endl;40increaseDefense(10);41}4243void44blobPaca::snooze() {45cout << name() << " takes a frickin nap??" << endl;46}4748void49blobPaca::reblob() {50cout << name() << " reattaches some lost blobberisms." << endl;51increaseHp(11);52}5354void55blobPaca::ooze(Alpaca *opponent) {56cout << name() << " grosses out his opponent!" << endl;57decreaseAttack(opponent, 5);58}5960void61blobPaca::jellify(Alpaca *buddy) {62cout << name() << " surrounds his teammate in a glowing gel!" << endl;63bufAlly(buddy, 10, 0,0);64}656667