2 ITEM(scrollofdetectmaterial
, scroll
)
5 virtual void FinishReading(character
*);
13 void scrollofdetectmaterial::FinishReading(character
* Reader
)
15 material
* TempMaterial
;
19 festring Temp
= game::DefaultQuestion(CONST_S("What material do you want to detect?"),
20 game::GetDefaultDetectMaterial());
21 TempMaterial
= protosystem::CreateMaterial(Temp
);
26 game::DrawEverythingNoBlit();
29 level
* Level
= GetLevel();
30 int Squares
= Level
->DetectMaterial(TempMaterial
);
34 if(Squares
> Reader
->GetAttribute(INTELLIGENCE
) * (25 + RAND() % 51))
36 ADD_MESSAGE("An enormous burst of geographical information overwhelms your consciousness. Your mind cannot cope with it and your memories blur.");
38 Reader
->BeginTemporaryState(CONFUSED
, 1000 + RAND() % 1000);
39 Reader
->EditExperience(INTELLIGENCE
, -100, 1 << 12);
43 ADD_MESSAGE("You feel a sudden urge to imagine the dark void of a starless night sky.");
44 Reader
->EditExperience(INTELLIGENCE
, 200, 1 << 12);
48 ADD_MESSAGE("You feel attracted to all things made of %s.", TempMaterial
->GetName(false, false).CStr());
49 game::PositionQuestion(CONST_S("Detecting material [direction keys move cursor, space exits]"), Reader
->GetPos(), 0, 0, false);
50 Reader
->EditExperience(INTELLIGENCE
, 300, 1 << 12);
54 Level
->CalculateLuminances();
55 game::SendLOSUpdateRequest();