fixed some bugs in new 'g'o system
[k8-i-v-a-n.git] / src / game / commands / Zap.cpp
blobc57de6247d150964642ec25a4837f0c5838beca7
1 COMMAND(Zap) {
2 if (!Char->CheckZap()) return false;
3 if (!Char->PossessesItem(&item::IsZappable)) {
4 ADD_MESSAGE("You have nothing to zap with, %s.", game::Insult());
5 return false;
7 item *Item = Char->SelectFromPossessions(CONST_S("What do you want to zap with?"), &item::IsZappable);
8 if (Item) {
9 int Answer = game::DirectionQuestion(CONST_S("In what direction do you wish to zap? [press a direction key or '.']"), false, true);
10 if (Answer == DIR_ERROR) return false;
11 if (Item->Zap(Char, Char->GetPos(), Answer)) {
12 Char->EditAP(-100000/APBonus(Char->GetAttribute(PERCEPTION)));
13 return true;
15 return false;
17 return false;