6 virtual truth
Apply(character
*);
7 virtual truth
IsAppliable(ccharacter
*) const { return true; }
8 virtual void Load(inputfile
&);
9 virtual void Save(outputfile
&) const;
10 virtual void FinalProcessForBone();
12 virtual col16
GetMaterialColorB(int) const;
21 col16
charmlyre::GetMaterialColorB(int) const { return MakeRGB16(150, 130, 110); }
25 truth
charmlyre::Apply (character
*Charmer
) {
26 if (LastUsed
&& game::GetTick()-LastUsed
< 10000) {
27 if (Charmer
->IsPlayer()) {
28 if (Charmer
->CanHear()) ADD_MESSAGE("You produce a highly alluring sound.");
29 else ADD_MESSAGE("You try to play something with the %s, but it is hard when you can't hear.", CHAR_NAME(DEFINITE
));
30 } else if (Charmer
->CanBeSeenByPlayer()) {
31 if (PLAYER
->CanHear()) ADD_MESSAGE("%s plays %s and produces a highly alluring sound.", Charmer
->CHAR_NAME(DEFINITE
), CHAR_NAME(DEFINITE
));
32 else ADD_MESSAGE("%s plays %s.", Charmer
->CHAR_NAME(DEFINITE
), CHAR_NAME(DEFINITE
));
33 } else if (PLAYER
->CanHear()) ADD_MESSAGE("You hear a lyre playing.");
35 LastUsed
= game::GetTick();
36 if (Charmer
->IsPlayer()) {
37 if (Charmer
->CanHear()) ADD_MESSAGE("You produce a mesmerizing sound.");
38 else ADD_MESSAGE("You try to play something with the %s, but it is hard when you can't hear.", CHAR_NAME(DEFINITE
));
39 } else if (Charmer
->CanBeSeenByPlayer()) {
40 if (PLAYER
->CanHear()) ADD_MESSAGE("%s plays %s and produces a mesmerizing sound.", Charmer
->CHAR_NAME(DEFINITE
), CHAR_NAME(DEFINITE
));
41 else ADD_MESSAGE("%s plays %s.", Charmer
->CHAR_NAME(DEFINITE
), CHAR_NAME(DEFINITE
));
43 for (int d
= 0; d
< Charmer
->GetNeighbourSquares(); ++d
) {
44 square
*Square
= Charmer
->GetNeighbourSquare(d
);
46 character
*Char
= Square
->GetCharacter();
48 if (Char
->CanHear()) {
49 if (Char
->CanTameWithLyre(Charmer
)) {
50 if (Char
->GetTeam() == Charmer
->GetTeam()) ADD_MESSAGE("%s seems to be very happy.", Char
->CHAR_NAME(DEFINITE
));
51 else if (Char
->GetRelation(Charmer
) == HOSTILE
) ADD_MESSAGE("%s stops fighting.", Char
->CHAR_NAME(DEFINITE
));
52 else ADD_MESSAGE("%s seems to be very friendly towards you.", Char
->CHAR_NAME(DEFINITE
));
53 Char
->ChangeTeam(Charmer
->GetTeam());
55 ADD_MESSAGE("%s resists its charming call.", Char
->CHAR_NAME(DEFINITE
));
58 ADD_MESSAGE("%s seems not affected.", Char
->CHAR_NAME(DEFINITE
));
64 Charmer
->EditAP(-1000);
65 game::CallForAttention(GetPos(), 100);
71 void charmlyre::Save(outputfile
& SaveFile
) const
79 void charmlyre::Load(inputfile
& SaveFile
)
87 charmlyre::charmlyre()
94 void charmlyre::FinalProcessForBone()
96 item::FinalProcessForBone();