2 CHARACTER(slave
, playerkind
)
5 virtual void BeTalkedTo();
6 virtual void GetAICommand();
7 virtual col16
GetHairColor() const { return humanoid::GetHairColor(); }
8 virtual col16
GetEyeColor() const { return humanoid::GetEyeColor(); }
10 virtual void PostConstruct();
18 void slave::BeTalkedTo()
20 if(GetRelation(PLAYER
) == HOSTILE
)
22 ADD_MESSAGE("\"Yikes!\"");
26 room
* Room
= GetHomeRoom();
28 if(Room
&& Room
->MasterIsActive())
30 character
* Master
= Room
->GetMaster();
32 if(PLAYER
->GetMoney() >= 50)
34 ADD_MESSAGE("%s talks: \"Do you want to buy me? 50 gold pieces. I work very hard.\"", CHAR_DESCRIPTION(DEFINITE
));
36 if(game::TruthQuestion(CONST_S("Do you want to buy him?")))
38 PLAYER
->SetMoney(PLAYER
->GetMoney() - 50);
39 Master
->SetMoney(Master
->GetMoney() + 50);
40 ChangeTeam(PLAYER
->GetTeam());
45 ADD_MESSAGE("\"Don't touch me! Master doesn't want people to touch sale items. I'm worth 50 gold pieces, you know!\"");
50 if(GetTeam() == PLAYER
->GetTeam())
52 if((PLAYER
->GetMainWielded() && PLAYER
->GetMainWielded()->IsWhip()) || (PLAYER
->GetSecondaryWielded() && PLAYER
->GetSecondaryWielded()->IsWhip()))
53 ADD_MESSAGE("\"Don't hit me! I work! I obey! I don't think!\"");
55 character::BeTalkedTo();
58 ADD_MESSAGE("\"I'm free! Rejoice!\"");
63 void slave::GetAICommand()
65 SeekLeader(GetLeader());
67 if(CheckForEnemies(true, true, true))
70 if(CheckForUsefulItemsOnGround())
73 if(FollowLeader(GetLeader()))
79 if(!GetHomeRoom() || !GetHomeRoom()->MasterIsActive())
86 else if(MoveTowardsHomePos())
94 void slave::PostConstruct()
96 Talent
= TALENT_STRONG
;
97 Weakness
= TALENT_CLEVER
;