typos
[k8-i-v-a-n.git] / src / game / humans / playerkind_slave.cpp
blob77a9204a35e13a97669a67870a2af7dde1b30ec8
1 #ifdef HEADER_PHASE
2 CHARACTER(slave, playerkind)
4 public:
5 virtual void BeTalkedTo();
6 virtual void GetAICommand();
7 virtual col16 GetHairColor() const { return humanoid::GetHairColor(); }
8 virtual col16 GetEyeColor() const { return humanoid::GetEyeColor(); }
9 protected:
10 virtual void PostConstruct();
14 #else
18 void slave::BeTalkedTo()
20 if(GetRelation(PLAYER) == HOSTILE)
22 ADD_MESSAGE("\"Yikes!\"");
23 return;
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());
41 RemoveHomeData();
44 else
45 ADD_MESSAGE("\"Don't touch me! Master doesn't want people to touch sale items. I'm worth 50 gold pieces, you know!\"");
47 return;
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!\"");
54 else
55 character::BeTalkedTo();
57 else
58 ADD_MESSAGE("\"I'm free! Rejoice!\"");
63 void slave::GetAICommand()
65 SeekLeader(GetLeader());
67 if(CheckForEnemies(true, true, true))
68 return;
70 if(CheckForUsefulItemsOnGround())
71 return;
73 if(FollowLeader(GetLeader()))
74 return;
76 if(CheckForDoors())
77 return;
79 if(!GetHomeRoom() || !GetHomeRoom()->MasterIsActive())
81 RemoveHomeData();
83 if(MoveRandomly())
84 return;
86 else if(MoveTowardsHomePos())
87 return;
89 EditAP(-1000);
94 void slave::PostConstruct()
96 Talent = TALENT_STRONG;
97 Weakness = TALENT_CLEVER;
99 #endif