vocab_t verb = command->verb;
vocab_t obj = command->obj;
- long spk = actions[verb].message;
if (obj == NO_OBJECT ||
obj == INTRANSITIVE) {
int changes = 0;
}
if (changes >= 2)
return GO_UNKNOWN;
-
}
+
if (obj == BIRD) {
if (game.closed) {
rspeak(UNHAPPY_BIRD);
- return GO_CLEAROBJ;
+ } else {
+ DESTROY(BIRD);
+ rspeak(BIRD_DEAD);
}
- DESTROY(BIRD);
- spk = BIRD_DEAD;
- } else if (obj == VEND) {
+ return GO_CLEAROBJ;
+ }
+ if (obj == VEND) {
state_change(VEND,
game.prop[VEND] == VEND_BLOCKS ? VEND_UNBLOCKS : VEND_BLOCKS);
return GO_CLEAROBJ;
}
- if (obj == NO_OBJECT)
- spk = NO_TARGET;
- if (obj == CLAM ||
- obj == OYSTER)
- spk = SHELL_IMPERVIOUS;
- if (obj == SNAKE)
- spk = SNAKE_WARNING;
- if (obj == DWARF)
- spk = BARE_HANDS_QUERY;
- if (obj == DWARF && game.closed)
- return GO_DWARFWAKE;
- if (obj == DRAGON)
- spk = ALREADY_DEAD;
- if (obj == TROLL)
- spk = ROCKY_TROLL;
- if (obj == OGRE)
- spk = OGRE_DODGE;
- if (obj == OGRE && atdwrf(game.loc) > 0) {
- rspeak(spk);
- rspeak(KNIFE_THROWN);
- DESTROY(OGRE);
- int dwarves = 0;
- for (int i = 1; i < PIRATE; i++) {
- if (game.dloc[i] == game.loc) {
- ++dwarves;
- game.dloc[i] = LOC_LONGWEST;
- game.dseen[i] = false;
- }
- }
- spk = (dwarves > 1) ?
- OGRE_PANIC1 :
- OGRE_PANIC2;
- } else if (obj == BEAR) {
+ if (obj == BEAR) {
switch (game.prop[BEAR]) {
case UNTAMED_BEAR:
- spk = BEAR_HANDS;
+ rspeak(BEAR_HANDS);
break;
case SITTING_BEAR:
- spk = BEAR_CONFUSED;
+ rspeak(BEAR_CONFUSED);
break;
case CONTENTED_BEAR:
- spk = BEAR_CONFUSED;
+ rspeak(BEAR_CONFUSED);
break;
case BEAR_DEAD:
- spk = ALREADY_DEAD;
+ rspeak(ALREADY_DEAD);
break;
}
- } else if (obj == DRAGON && game.prop[DRAGON] == DRAGON_BARS) {
+ return GO_CLEAROBJ;
+ }
+ if (obj == DRAGON && game.prop[DRAGON] == DRAGON_BARS) {
/* Fun stuff for dragon. If he insists on attacking it, win!
* Set game.prop to dead, move dragon to central loc (still
* fixed), move rug there (not fixed), and move him there,
return GO_MOVE;
}
- rspeak(spk);
+ if (obj == OGRE) {
+ rspeak(OGRE_DODGE);
+ if (atdwrf(game.loc) == 0)
+ return GO_CLEAROBJ;
+
+ rspeak(KNIFE_THROWN);
+ DESTROY(OGRE);
+ int dwarves = 0;
+ for (int i = 1; i < PIRATE; i++) {
+ if (game.dloc[i] == game.loc) {
+ ++dwarves;
+ game.dloc[i] = LOC_LONGWEST;
+ game.dseen[i] = false;
+ }
+ }
+ rspeak((dwarves > 1) ?
+ OGRE_PANIC1 :
+ OGRE_PANIC2);
+ return GO_CLEAROBJ;
+ }
+
+ switch (obj) {
+ case NO_OBJECT:
+ rspeak(NO_TARGET);
+ break;
+ case CLAM:
+ case OYSTER:
+ rspeak(SHELL_IMPERVIOUS);
+ break;
+ case SNAKE:
+ rspeak(SNAKE_WARNING);
+ break;
+ case DWARF:
+ if (game.closed) {
+ return GO_DWARFWAKE;
+ }
+ rspeak(BARE_HANDS_QUERY);
+ break;
+ case DRAGON:
+ rspeak(ALREADY_DEAD);
+ break;
+ case TROLL:
+ rspeak(ROCKY_TROLL);
+ break;
+ default:
+ rspeak(actions[verb].message);
+ }
return GO_CLEAROBJ;
}
}
if (!AT(DOOR)) {
if (obj == WATER) {
- /* cycle through the three plant states */
- state_change(PLANT, MOD(game.prop[PLANT] + 1, 3));
- game.prop[PLANT2] = game.prop[PLANT];
- return GO_MOVE;
+ /* cycle through the three plant states */
+ state_change(PLANT, MOD(game.prop[PLANT] + 1, 3));
+ game.prop[PLANT2] = game.prop[PLANT];
+ return GO_MOVE;
} else {
rspeak(SHAKING_LEAVES);
return GO_CLEAROBJ;
- }
+ }
} else {
state_change(DOOR, (obj == OIL) ?
DOOR_UNRUSTED :
rspeak(NOTHING_HAPPENS);
return GO_CLEAROBJ;
} else {
- state_change(RESER,
- game.prop[RESER] == WATERS_PARTED ? WATERS_UNPARTED : WATERS_PARTED);
+ state_change(RESER,
+ game.prop[RESER] == WATERS_PARTED ? WATERS_UNPARTED : WATERS_PARTED);
if (AT(RESER))
return GO_CLEAROBJ;
else {
FREE_FLY);
state_change(FISSURE,
- game.prop[FISSURE] == BRIDGED ? UNBRIDGED : BRIDGED);
+ game.prop[FISSURE] == BRIDGED ? UNBRIDGED : BRIDGED);
return GO_CLEAROBJ;
}
}
return GO_WORD2;
if (command->verb == SAY)
command->obj = command->wd2;
- if (command->obj == 0 ||
+ if (command->obj == NO_OBJECT ||
command->obj == INTRANSITIVE) {
/* Analyse an intransitive verb (ie, no object given yet). */
switch (command->verb) {
The dragon is sprawled out on a persian rug!!
+> kill dragon
+
+With what? Your bare hands?
+
+> y
+
+Congratulations! You have just vanquished a dragon with your bare
+hands! (Unbelievable, isn't it?)
+
+You are in a secret canyon which exits to the north and east.
+
+There is a persian rug spread out on the floor!
+
+The blood-specked body of a huge green dead dragon lies to one side.
+
+> kill dragon
+
+For crying out loud, the poor thing is already dead!
+
-You scored 77 out of a possible 430, using 48 turns.
+You scored 77 out of a possible 430, using 50 turns.
Your score qualifies you as a novice class adventurer.