Restructure some code.
This commit is contained in:
parent
10e53a419e
commit
0b91efc9eb
1 changed files with 29 additions and 25 deletions
54
actions.c
54
actions.c
|
@ -891,7 +891,7 @@ static int throw_support(long spk)
|
||||||
return GO_MOVE;
|
return GO_MOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int throw (FILE *cmdin, long verb, token_t obj)
|
static int throw(FILE *cmdin, long verb, token_t obj)
|
||||||
/* Throw. Same as discard unless axe. Then same as attack except
|
/* Throw. Same as discard unless axe. Then same as attack except
|
||||||
* ignore bird, and if dwarf is present then one might be killed.
|
* ignore bird, and if dwarf is present then one might be killed.
|
||||||
* (Only way to do so!) Axe also special for dragon, bear, and
|
* (Only way to do so!) Axe also special for dragon, bear, and
|
||||||
|
@ -922,32 +922,36 @@ static int throw (FILE *cmdin, long verb, token_t obj)
|
||||||
}
|
}
|
||||||
if (obj != AXE)
|
if (obj != AXE)
|
||||||
return (discard(verb, obj, false));
|
return (discard(verb, obj, false));
|
||||||
int i = ATDWRF(game.loc);
|
else {
|
||||||
if (i <= 0) {
|
int i = ATDWRF(game.loc);
|
||||||
if (AT(DRAGON) && game.prop[DRAGON] == 0)
|
if (i <= 0) {
|
||||||
return throw_support(DRAGON_SCALES);
|
if (AT(DRAGON) && game.prop[DRAGON] == 0)
|
||||||
if (AT(TROLL))
|
return throw_support(DRAGON_SCALES);
|
||||||
return throw_support(TROLL_RETURNS);
|
if (AT(TROLL))
|
||||||
else if (AT(OGRE))
|
return throw_support(TROLL_RETURNS);
|
||||||
return throw_support(OGRE_DODGE);
|
else if (AT(OGRE))
|
||||||
else if (HERE(BEAR) && game.prop[BEAR] == 0) {
|
return throw_support(OGRE_DODGE);
|
||||||
/* This'll teach him to throw the axe at the bear! */
|
else if (HERE(BEAR) && game.prop[BEAR] == 0) {
|
||||||
DROP(AXE, game.loc);
|
/* This'll teach him to throw the axe at the bear! */
|
||||||
game.fixed[AXE] = -1;
|
DROP(AXE, game.loc);
|
||||||
game.prop[AXE] = 1;
|
game.fixed[AXE] = -1;
|
||||||
JUGGLE(BEAR);
|
game.prop[AXE] = 1;
|
||||||
RSPEAK(AXE_LOST);
|
JUGGLE(BEAR);
|
||||||
return GO_CLEAROBJ;
|
RSPEAK(AXE_LOST);
|
||||||
}
|
return GO_CLEAROBJ;
|
||||||
return (attack(cmdin, verb, 0));
|
}
|
||||||
}
|
return (attack(cmdin, verb, 0));
|
||||||
|
}
|
||||||
|
|
||||||
if (randrange(NDWARVES + 1) < game.dflag) {
|
if (randrange(NDWARVES + 1) < game.dflag) {
|
||||||
return throw_support(DWARF_DODGES);
|
return throw_support(DWARF_DODGES);
|
||||||
|
} else {
|
||||||
|
game.dseen[i] = false;
|
||||||
|
game.dloc[i] = 0;
|
||||||
|
return throw_support((++game.dkill == 1)
|
||||||
|
? DWARF_SMOKE : KILLED_DWARF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
game.dseen[i] = false;
|
|
||||||
game.dloc[i] = 0;
|
|
||||||
return throw_support((++game.dkill == 1) ? DWARF_SMOKE : KILLED_DWARF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wake(token_t verb, token_t obj)
|
static int wake(token_t verb, token_t obj)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue