Willow As Programmed In C++

back to filk list
by Gudanov

class Willow : public Human {
private:
CSoul *m_soul;
CDemon *m_demon;
CPersonality *m_personality;
bool m_bCollegeAge;
public:
Willow() {
m_soul = new CSoul();
m_demon = NULL;
m_personality = new CPersonality(
CPersonality::Sweet |
CPersonality::Geek |
CPersonality::Catty );
m_bCollegeAge = false;
}
~Willow() {
throw JossIsEvilBastardException();
}
// Added to support Xander class's processing of GetInvolvedWith
// or SleepWith Event types
bool OkToGetInvolvedOrSleepWith(const Human target) {
if (target->HasTormented(this) ||
target->HasTriedToGetKilled(this) ||
target->GenerallyDislikedBy(this) )
return true;
else
return false;
}
void ProcessEvent(const CEvent& event) {
switch(event.type) {
case CEvent::CatchBoyfriendWithSkankyChick:
m_confidence -= 50;
Mope(50);
this->ProcessEvent(new CEvent(CEvent::CastSpell, false));
break;
case CEvent::Baking:
m_guilt -= (m_guilt * 0.3);
m_termoil -= (m_termoil * 0.07);
break;
case CEvent::GotoCollege:
m_confidence += 20;
BeHappy(25);
m_bCollegeAge = true;
break;
case CEvent::CalledGeek:
m_confidence -= 10;
Mope(5);
break;
case CEvent::SelectOutfit:
if (m_soul == NULL) {
SelectLeatherOutfit();
}
if (m_bCollegeAge) {
// This condition has been causing problems, remove?
SelectOutfit();
}
else {
m_pMother->SelectOutfit();
}
break;
}
case CEvent::CalledSidekick:
throw FitException();
break;
case CEvent::CastSpell:
if (((int)(10 * rand())) < 5) {
event.spell.IsSuccess(true);
m_confidence += 5;
}
else {
event.spell.IsSuccess(false);
m_confidence -= 5;
}
break;
default:
if ((int)(100 * rand())) < 2) {
MakeRemark(CALLAUS | STRANGE);
}
m_personality->ProcessEvent(event);
break;
}
};

| back to top |

back to filk list