version 1.88 | | version 1.89 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.88 2006/04/06 21:18:36 tchize Exp $"; | | * "$Id: time.c,v 1.89 2006/05/05 09:26:36 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
/** Will generate a monster according to content | | /** Will generate a monster according to content |
* of generator. | | * of generator. |
*/ | | */ |
void generate_monster_inv(object *gen) { | | static void generate_monster_inv(object *gen) { |
int i; | | int i; |
object *op,*head=NULL; | | object *op,*head=NULL; |
| | |
| | |
gen->map->difficulty,0); | | gen->map->difficulty,0); |
} | | } |
| | |
void generate_monster_arch(object *gen) { | | static void generate_monster_arch(object *gen) { |
int i; | | int i; |
object *op,*head=NULL,*prev=NULL; | | object *op,*head=NULL,*prev=NULL; |
archetype *at=gen->other_arch; | | archetype *at=gen->other_arch; |
| | |
} | | } |
} | | } |
| | |
void generate_monster(object *gen) { | | static void generate_monster(object *gen) { |
| | |
if(GENERATE_SPEED(gen)&&rndm(0, GENERATE_SPEED(gen)-1)) | | if(GENERATE_SPEED(gen)&&rndm(0, GENERATE_SPEED(gen)-1)) |
return; | | return; |
| | |
| | |
} | | } |
| | |
void remove_force(object *op) { | | static void remove_force(object *op) { |
if (--op->duration > 0) return; | | if (--op->duration > 0) return; |
| | |
switch (op->subtype) { | | switch (op->subtype) { |
| | |
free_object(op); | | free_object(op); |
} | | } |
| | |
void remove_blindness(object *op) { | | static void remove_blindness(object *op) { |
if(--op->stats.food > 0) | | if(--op->stats.food > 0) |
return; | | return; |
CLEAR_FLAG(op, FLAG_APPLIED); | | CLEAR_FLAG(op, FLAG_APPLIED); |
| | |
free_object(op); | | free_object(op); |
} | | } |
| | |
void poison_more(object *op) { | | static void poison_more(object *op) { |
if(op->env==NULL||!QUERY_FLAG(op->env,FLAG_ALIVE)||op->env->stats.hp<0) { | | if(op->env==NULL||!QUERY_FLAG(op->env,FLAG_ALIVE)||op->env->stats.hp<0) { |
remove_ob(op); | | remove_ob(op); |
free_object(op); | | free_object(op); |
| | |
} | | } |
| | |
| | |
void move_gate(object *op) { /* 1 = going down, 0 = goind up */ | | static void move_gate(object *op) { /* 1 = going down, 0 = goind up */ |
object *tmp; | | object *tmp; |
| | |
if(op->stats.wc < 0 || (int)op->stats.wc >= NUM_ANIMATIONS(op)) { | | if(op->stats.wc < 0 || (int)op->stats.wc >= NUM_ANIMATIONS(op)) { |
| | |
* maxhp : initial value for hp | | * maxhp : initial value for hp |
* sp : 1 = open, 0 = close | | * sp : 1 = open, 0 = close |
*/ | | */ |
void move_timed_gate(object *op) | | static void move_timed_gate(object *op) |
{ | | { |
int v = op->value; | | int v = op->value; |
| | |
| | |
* sp: 1 if detection sets buttons | | * sp: 1 if detection sets buttons |
* -1 if detection unsets buttons | | * -1 if detection unsets buttons |
*/ | | */ |
void move_detector(object *op) | | static void move_detector(object *op) |
{ | | { |
object *tmp; | | object *tmp; |
int last = op->value; | | int last = op->value; |
| | |
} | | } |
| | |
| | |
void animate_trigger (object *op) | | static void animate_trigger(object *op) |
{ | | { |
if((unsigned char)++op->stats.wc >= NUM_ANIMATIONS(op)) { | | if((unsigned char)++op->stats.wc >= NUM_ANIMATIONS(op)) { |
op->stats.wc = 0; | | op->stats.wc = 0; |
| | |
} | | } |
} | | } |
| | |
void move_hole(object *op) { /* 1 = opening, 0 = closing */ | | static void move_hole(object *op) { /* 1 = opening, 0 = closing */ |
object *next,*tmp; | | object *next,*tmp; |
| | |
if(op->value) { /* We're opening */ | | if(op->value) { /* We're opening */ |