X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=actions.c;h=cbf73f27417b1535dac27c6558ba7a73fea17bdb;hp=58d808bf4d6348b60f12d89f3568e6d3c8476c07;hb=f862f9f1d508e00bccc208e66b1d31a5e530ab3e;hpb=b3057f038bc990e216c1763f7de1f485892296d2 diff --git a/actions.c b/actions.c index 58d808b..cbf73f2 100644 --- a/actions.c +++ b/actions.c @@ -21,9 +21,8 @@ static int attack(FILE *input, long verb, token_t obj) * enemies, or no enemies but 2 others. */ { int spk = ACTSPK[verb]; - int d = ATDWRF(game.loc); - if (obj == 0) { - if (d > 0) + if (obj == 0 || obj == INTRANSITIVE) { + if (ATDWRF(game.loc) > 0) obj = DWARF; if (HERE(SNAKE))obj = obj * NOBJECTS + SNAKE; if (AT(DRAGON) && game.prop[DRAGON] == 0)obj = obj * NOBJECTS + DRAGON; @@ -65,7 +64,7 @@ static int attack(FILE *input, long verb, token_t obj) if (obj == DRAGON)spk = ALREADY_DEAD; if (obj == TROLL)spk = ROCKY_TROLL; if (obj == OGRE)spk = OGRE_DODGE; - if (obj == OGRE && d > 0) { + if (obj == OGRE && ATDWRF(game.loc) > 0) { RSPEAK(spk); RSPEAK(KNIFE_THROWN); DESTROY(OGRE); @@ -558,7 +557,7 @@ int fill(token_t verb, token_t obj) spk = URN_NOPOUR; if (LIQUID() != 0) spk = BOTTLE_FULL; - if (spk == 107) { + if (spk == BOTTLED_WATER) { game.prop[BOTTLE] = MOD(COND[game.loc], 4) / 2 * 2; k = LIQUID(); if (TOTING(BOTTLE)) @@ -711,7 +710,7 @@ static int lock(token_t verb, token_t obj) if (AT(GRATE))obj = GRATE; if (obj != 0 && HERE(CHAIN)) return GO_UNKNOWN; if (HERE(CHAIN))obj = CHAIN; - if (obj == 0) { + if (obj == 0 || obj == INTRANSITIVE) { RSPEAK(spk); return GO_CLEAROBJ; } @@ -732,7 +731,7 @@ static int lock(token_t verb, token_t obj) return chain(verb); if (game.closng) { spk = EXIT_CLOSED; - if (!game.panic)game.clock2 = 15; + if (!game.panic)game.clock2 = PANICTIME; game.panic = true; } else { spk = game.prop[GRATE] ? GRATE_LOCKED : ALREADY_LOCKED; @@ -925,19 +924,13 @@ static int throw (FILE *cmdin, long verb, token_t obj) return (discard(verb, obj, false)); int i = ATDWRF(game.loc); if (i <= 0) { - if (AT(DRAGON) && game.prop[DRAGON] == 0) { - spk = DRAGON_SCALES; - return throw_support(spk); - } - if (AT(TROLL)) { - spk = TROLL_RETURNS; - return throw_support(spk); - } - if (AT(OGRE)) { - spk = OGRE_DODGE; - return throw_support(spk); - } - if (HERE(BEAR) && game.prop[BEAR] == 0) { + if (AT(DRAGON) && game.prop[DRAGON] == 0) + return throw_support(DRAGON_SCALES); + if (AT(TROLL)) + return throw_support(TROLL_RETURNS); + else if (AT(OGRE)) + return throw_support(OGRE_DODGE); + else if (HERE(BEAR) && game.prop[BEAR] == 0) { /* This'll teach him to throw the axe at the bear! */ DROP(AXE, game.loc); game.fixed[AXE] = -1; @@ -988,7 +981,7 @@ static int wave(token_t verb, token_t obj) return GO_CLEAROBJ; } if (HERE(BIRD))spk = FREE_FLY + MOD(game.prop[BIRD], 2); - if (spk == 206 && game.loc == game.place[STEPS] && game.prop[JADE] < 0) { + if (spk == FREE_FLY && game.loc == game.place[STEPS] && game.prop[JADE] < 0) { DROP(JADE, game.loc); game.prop[JADE] = 0; --game.tally;