version 1.2 | | version 1.3 |
---|
| | |
/* | | /* |
* static char *rcsid_swamp_c = | | * static char *rcsid_swamp_c = |
* "$Id: swamp.c,v 1.2 1999/07/13 06:03:05 cvs Exp $"; | | * "$Id: swamp.c,v 1.3 2000/05/26 09:50:49 jec Exp $"; |
*/ | | */ |
| | |
#include <global.h> | | #include <global.h> |
| | |
#include <sproto.h> | | #include <sproto.h> |
#endif | | #endif |
| | |
void deep_swamp(object *op, int walk_on) | | void walk_on_deep_swamp (object *op, object *victim) |
| | { |
| | if (victim->type == PLAYER && ! QUERY_FLAG (victim, FLAG_FLYING) |
| | && victim->stats.hp >= 0) |
| | { |
| | new_draw_info (NDI_UNIQUE, 0, victim, "You are down to your knees " |
| | "in the swamp."); |
| | op->stats.food = 1; |
| | victim->speed_left -= SLOW_PENALTY(op); |
| | } |
| | } |
| | |
| | void move_deep_swamp (object *op) |
{ | | { |
object *above = op->above; | | object *above = op->above; |
object *nabove; | | object *nabove; |
| | |
!QUERY_FLAG(above, FLAG_FLYING) && | | !QUERY_FLAG(above, FLAG_FLYING) && |
above->stats.hp >= 0) { | | above->stats.hp >= 0) { |
| | |
if (op->stats.food == 0 || walk_on) { | | if (op->stats.food < 1) { |
new_draw_info(NDI_UNIQUE, 0,above, "You are down to your knees in the swamp."); | | LOG (llevDebug, "move_deep_swamp(): player is here, but state is " |
| | "%d\n", op->stats.food); |
op->stats.food = 1; | | op->stats.food = 1; |
above->speed_left -= SLOW_PENALTY(op); | | } |
} else { | | |
switch(op->stats.food) { | | switch(op->stats.food) { |
case 1: | | case 1: |
if (RANDOM()%3 == 0) { | | if (RANDOM()%3 == 0) { |
| | |
} | | } |
break; | | break; |
} | | } |
} | | |
} else if (!QUERY_FLAG(above, FLAG_ALIVE)) { | | } else if (!QUERY_FLAG(above, FLAG_ALIVE)) { |
if (RANDOM()%3 == 0) decrease_ob(above); | | if (RANDOM()%3 == 0) decrease_ob(above); |
} | | } |