moved almost all hardcoded constants to "define.dat"
[k8-i-v-a-n.git] / src / game / items / scroll_scrollofrepair.cpp
blob00588d50566ba22229f15773da1a90191fd0a453
1 #ifdef HEADER_PHASE
2 ITEM(scrollofrepair, scroll)
4 public:
5 virtual void FinishReading(character*);
6 };
9 #else
13 void scrollofrepair::FinishReading (character *Reader) {
14 for (;;) {
15 itemvector Item;
16 if (!Reader->SelectFromPossessions(Item, CONST_S("Which item do you wish to repair?"), NO_MULTI_SELECT|SELECT_PAIR, &item::IsRepairable))
18 ADD_MESSAGE("You notice you haven't got anything to repair.");
19 return;
21 if (!Item.empty()) {
22 if (Item[0]->HandleInPairs() && Item.size() == 1) {
23 ADD_MESSAGE("Only one %s will be repaired.", Item[0]->CHAR_NAME(UNARTICLED));
24 if (!game::TruthQuestion(CONST_S("Still continue?"))) continue;
26 if (Item.size() == 1)
27 ADD_MESSAGE("As you read the scroll, %s glows green and %s.", Item[0]->CHAR_NAME(DEFINITE), Item[0]->IsBroken() ? "fixes itself" : "its rust vanishes");
28 else
29 ADD_MESSAGE("As you read the scroll, %s glow green and %s.", Item[0]->CHAR_NAME(PLURAL), Item[0]->IsBroken() ? "fix themselves" : "their rust vanishes");
30 for (uInt c = 0; c < Item.size(); ++c) {
31 Item[c]->RemoveRust();
32 Item[c]->Fix();
34 break;
35 } else {
36 if (game::TruthQuestion(CONST_S("Really cancel read?"))) return;
39 RemoveFromSlot();
40 SendToHell();
41 Reader->EditExperience(INTELLIGENCE, 300, 1 << 12);
43 #endif