fixed some bugs in new 'g'o system
[k8-i-v-a-n.git] / src / game / commands / Throw.cpp
blob07afa4e234cdad20b75e31e30931682eaf0b2239
1 COMMAND(Throw) {
2 if (!Char->CheckThrow()) return false;
3 if (!Char->GetStack()->GetItems()) {
4 ADD_MESSAGE("You have nothing to throw!");
5 return false;
7 item *Item = Char->GetStack()->DrawContents(Char, CONST_S("What do you want to throw?"));
8 if (Item) {
9 int Answer = game::DirectionQuestion(CONST_S("In what direction do you wish to throw? [press a direction key]"), false);
10 if (Answer == DIR_ERROR) return false;
11 Char->ThrowItem(Answer, Item);
12 Char->EditExperience(ARM_STRENGTH, 75, 1 << 8);
13 Char->EditExperience(DEXTERITY, 75, 1 << 8);
14 Char->EditExperience(PERCEPTION, 75, 1 << 8);
15 Char->EditNP(-50);
16 Char->DexterityAction(5);
17 return true;
19 return false;