version 1.165 | | version 1.166 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.165 2006/03/18 15:05:36 ryo_saeba Exp $"; | | * "$Id: apply.c,v 1.166 2006/04/06 21:18:35 tchize Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
yield = get_ob_key_value(tmp,"on_use_yield"); | | yield = get_ob_key_value(tmp,"on_use_yield"); |
if (yield != NULL) | | if (yield != NULL) |
{ | | { |
object* drop = get_archetype(yield); | | object* drop = create_archetype(yield); |
if (tmp->env) | | if (tmp->env) |
{ | | { |
drop = insert_ob_in_ob(drop,tmp->env); | | drop = insert_ob_in_ob(drop,tmp->env); |
| | |
| | |
new_draw_info(NDI_UNIQUE,0,op, "Yech! Your lungs are on fire!"); | | new_draw_info(NDI_UNIQUE,0,op, "Yech! Your lungs are on fire!"); |
/* Explodes a fireball centered at player */ | | /* Explodes a fireball centered at player */ |
fball = get_archetype(EXPLODING_FIREBALL); | | fball = create_archetype(EXPLODING_FIREBALL); |
fball->dam_modifier=random_roll(1, op->level, op, PREFER_LOW)/5+1; | | fball->dam_modifier=random_roll(1, op->level, op, PREFER_LOW)/5+1; |
fball->stats.maxhp=random_roll(1, op->level, op, PREFER_LOW)/10+2; | | fball->stats.maxhp=random_roll(1, op->level, op, PREFER_LOW)/10+2; |
fball->x = op->x; | | fball->x = op->x; |
| | |
force=NULL; | | force=NULL; |
for (i=0; i<NROFATTACKS; i++) { | | for (i=0; i<NROFATTACKS; i++) { |
if (tmp->resist[i]) { | | if (tmp->resist[i]) { |
if (!force) force=get_archetype(FORCE_NAME); | | if (!force) force=create_archetype(FORCE_NAME); |
memcpy(force->resist, tmp->resist, sizeof(tmp->resist)); | | memcpy(force->resist, tmp->resist, sizeof(tmp->resist)); |
force->type=POTION_EFFECT; | | force->type=POTION_EFFECT; |
break; /* Only need to find one protection since we copy entire batch */ | | break; /* Only need to find one protection since we copy entire batch */ |
| | |
| | |
new_draw_info_format(NDI_UNIQUE, 0, originator, "The %s seems to be broken!", query_name(trap)); | | new_draw_info_format(NDI_UNIQUE, 0, originator, "The %s seems to be broken!", query_name(trap)); |
| | |
op = get_archetype("burnout"); | | op = create_archetype("burnout"); |
if (op != NULL) { | | if (op != NULL) { |
op->x = trap->x; | | op->x = trap->x; |
op->y = trap->y; | | op->y = trap->y; |
| | |
* A valid 2 way exit means: | | * A valid 2 way exit means: |
* -You can come back (there is another exit at the other side) | | * -You can come back (there is another exit at the other side) |
* -You are | | * -You are |
* ° the owner of the exit | | * the owner of the exit |
* ° or in the same party as the owner | | * or in the same party as the owner |
* | | * |
* Note: a owner in a 2 way exit is saved as the owner's name | | * Note: a owner in a 2 way exit is saved as the owner's name |
* in the field exit->name cause the field exit->owner doesn't | | * in the field exit->name cause the field exit->owner doesn't |
| | |
int i, did_one=0; | | int i, did_one=0; |
sint8 k; | | sint8 k; |
| | |
force = get_archetype(FORCE_NAME); | | force = create_archetype(FORCE_NAME); |
| | |
for (i=0; i < NUM_STATS; i++) { | | for (i=0; i < NUM_STATS; i++) { |
k = get_attr_value(&food->stats, i); | | k = get_attr_value(&food->stats, i); |
| | |
object *tmp; | | object *tmp; |
| | |
new_draw_info(NDI_UNIQUE, 0,op,"Your spell warps!."); | | new_draw_info(NDI_UNIQUE, 0,op,"Your spell warps!."); |
tmp=get_archetype(SPELL_WONDER); | | tmp=create_archetype(SPELL_WONDER); |
cast_wonder(op, op, 0, tmp); | | cast_wonder(op, op, 0, tmp); |
free_object(tmp); | | free_object(tmp); |
} else if (failure <= -15&&failure > -35) {/* drain mana */ | | } else if (failure <= -15&&failure > -35) {/* drain mana */ |
| | |
blind_player(op,op,power); | | blind_player(op,op,power); |
} else if (failure <= -80) {/* blast the immediate area */ | | } else if (failure <= -80) {/* blast the immediate area */ |
object *tmp; | | object *tmp; |
tmp=get_archetype(LOOSE_MANA); | | tmp=create_archetype(LOOSE_MANA); |
cast_magic_storm(op,tmp, power); | | cast_magic_storm(op,tmp, power); |
new_draw_info(NDI_UNIQUE, 0,op,"You unlease uncontrolled mana!"); | | new_draw_info(NDI_UNIQUE, 0,op,"You unlease uncontrolled mana!"); |
free_object(tmp); | | free_object(tmp); |
| | |
got[len] = '\0'; | | got[len] = '\0'; |
| | |
/* Now create new item, remove used ones when required. */ | | /* Now create new item, remove used ones when required. */ |
new_item = get_archetype( got ); | | new_item = create_archetype( got ); |
if ( !new_item ) | | if ( !new_item ) |
{ | | { |
new_draw_info_format( NDI_UNIQUE, 0, pl, "This %s is strange, better to not use it.", query_base_name( marked, 0 ) ); | | new_draw_info_format( NDI_UNIQUE, 0, pl, "This %s is strange, better to not use it.", query_base_name( marked, 0 ) ); |