fixed some bugs in new 'g'o system
[k8-i-v-a-n.git] / src / game / items / item_scroll.cpp
blob129b51d055ec9be46e83d5647edc0255cc77ea7c
1 #ifdef HEADER_PHASE
2 ITEM(scroll, item)
4 public:
5 virtual truth CanBeRead(character*) const;
6 virtual truth IsReadable(ccharacter*) const { return true; }
7 virtual truth IsScroll () const { return true; }
8 virtual truth ReceiveDamage(character*, int, int, int);
9 };
12 #else
16 truth scroll::CanBeRead(character* Reader) const
18 return Reader->CanRead() || game::GetSeeWholeMapCheatMode();
23 truth scroll::ReceiveDamage(character*, int Damage, int Type, int)
25 if(Type & FIRE && Damage
26 && GetMainMaterial()->GetInteractionFlags() & CAN_BURN
27 && (Damage > 125 || !(RAND() % (250 / Damage))))
29 if(CanBeSeenByPlayer())
30 ADD_MESSAGE("%s catches fire!", GetExtendedDescription().CStr());
32 RemoveFromSlot();
33 SendToHell();
34 return true;
37 return false;
39 #endif