version 1.86 | | version 1.87 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.86 2002/12/18 16:52:12 garbled Exp $"; | | * "$Id: spell_effect.c,v 1.87 2002/12/21 08:02:34 mwedel Exp $"; |
*/ | | */ |
| | |
| | |
| | |
| | |
int summon_pet(object *op, int dir, SpellTypeFrom item) { | | int summon_pet(object *op, int dir, SpellTypeFrom item) { |
int level, number, i; | | int level, number, i; |
char *monster; | | |
treasurelist *trlist = NULL; | | treasurelist *trlist = NULL; |
treasure *tr, *prevtr = NULL; | | treasure *tr, *prevtr = NULL; |
| | |
| | |
{ | | { |
int value=query_cost(obj, NULL, F_TRUE); | | int value=query_cost(obj, NULL, F_TRUE); |
| | |
/* Give half price when we alchemy money (This should hopefully | | /* Give third price when we alchemy money (This should hopefully |
* make it so that it isn't worth it to alchemy money, sell | | * make it so that it isn't worth it to alchemy money, sell |
* the nuggets, alchemy the gold from that, etc. | | * the nuggets, alchemy the gold from that, etc. |
* Otherwise, give 9 silver on the gold for other objects, | | * Otherwise, give 9 silver on the gold for other objects, |
* so that it would still be more affordable to haul | | * so that it would still be more affordable to haul |
* the stuff back to town. | | * the stuff back to town. |
*/ | | */ |
| | |
if (QUERY_FLAG(obj, FLAG_UNPAID)) | | if (QUERY_FLAG(obj, FLAG_UNPAID)) |
value=0; | | value=0; |
else if (obj->type==MONEY || obj->type==GEM) | | else if (obj->type==MONEY || obj->type==GEM) |
value /=3; | | value /=3; |
else if (QUERY_FLAG(obj, FLAG_UNPAID)) | | |
value=0; | | |
else | | else |
value *= 0.9; | | value *= 0.9; |
| | |
if ((obj->value>0) && rndm(0, 29)) { | | if ((obj->value>0) && rndm(0, 29)) { |
static int value_store; | | static int value_store; |
int count; | | int count; |
| | |
value_store += value; | | value_store += value; |
count = value_store / large->value; | | count = value_store / large->value; |
*large_nuggets += count; | | *large_nuggets += count; |
| | |
int x, int y) | | int x, int y) |
{ | | { |
object *tmp; | | object *tmp; |
| | int flag=0; |
| | |
| | /* Put any nuggets below the player, but we can only pass this |
| | * flag if we are on the same space as the player |
| | */ |
| | if (x == op->x && y == op->y) flag = INS_BELOW_ORIGINATOR; |
| | |
if (small_nuggets) { | | if (small_nuggets) { |
tmp = get_object(); | | tmp = get_object(); |
| | |
tmp-> nrof = small_nuggets; | | tmp-> nrof = small_nuggets; |
tmp->x = x; | | tmp->x = x; |
tmp->y = y; | | tmp->y = y; |
insert_ob_in_map(tmp, op->map, op,0); | | insert_ob_in_map(tmp, op->map, op, flag); |
} | | } |
if (large_nuggets) { | | if (large_nuggets) { |
tmp = get_object(); | | tmp = get_object(); |
| | |
tmp-> nrof = large_nuggets; | | tmp-> nrof = large_nuggets; |
tmp->x = x; | | tmp->x = x; |
tmp->y = y; | | tmp->y = y; |
insert_ob_in_map(tmp, op->map, op,0); | | insert_ob_in_map(tmp, op->map, op, flag); |
} | | } |
} | | } |
| | |
| | |
| | |
if(op->type!=PLAYER) | | if(op->type!=PLAYER) |
return 0; | | return 0; |
| | |
/* Put a maximum weight of items that can be alchemied. Limits the power | | /* Put a maximum weight of items that can be alchemied. Limits the power |
* some, and also prevents people from alcheming every table/chair/clock | | * some, and also prevents people from alcheming every table/chair/clock |
* in sight | | * in sight |
*/ | | */ |
/* weight_max = 100000 + 50000*op->level; */ | | |
weight_max = 100000 + 50000*SK_level(op); | | weight_max = 100000 + 50000*SK_level(op); |
small=get_archetype("smallnugget"), | | small=get_archetype("smallnugget"), |
large=get_archetype("largenugget"); | | large=get_archetype("largenugget"); |
| | |
if (tmp->weight>0 && !QUERY_FLAG(tmp, FLAG_NO_PICK) && | | if (tmp->weight>0 && !QUERY_FLAG(tmp, FLAG_NO_PICK) && |
!QUERY_FLAG(tmp, FLAG_ALIVE) && | | !QUERY_FLAG(tmp, FLAG_ALIVE) && |
!QUERY_FLAG(tmp, FLAG_IS_CAULDRON)) { | | !QUERY_FLAG(tmp, FLAG_IS_CAULDRON)) { |
| | |
if (tmp->inv) { | | if (tmp->inv) { |
object *next1, *tmp1; | | object *next1, *tmp1; |
for (tmp1 = tmp->inv; tmp1!=NULL; tmp1=next1) { | | for (tmp1 = tmp->inv; tmp1!=NULL; tmp1=next1) { |
| | |
} | | } |
free_object(large); | | free_object(large); |
free_object(small); | | free_object(small); |
| | /* reset this so that if player standing on a big pile of stuff, |
| | * it is redrawn properly. |
| | */ |
| | op->contr->socket.look_position = 0; |
return 1; | | return 1; |
} | | } |
| | |
| | |
case SP_SHOW_INVIS: | | case SP_SHOW_INVIS: |
/* Might there be other objects that we can make visibile? */ | | /* Might there be other objects that we can make visibile? */ |
if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) || | | if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) || |
tmp->type==PLAYER && !QUERY_FLAG(tmp, FLAG_WIZ) || | | (tmp->type==PLAYER && !QUERY_FLAG(tmp, FLAG_WIZ)) || |
tmp->type==CF_HANDLE || | | tmp->type==CF_HANDLE || |
tmp->type==TRAPDOOR || tmp->type==EXIT || tmp->type==HOLE || | | tmp->type==TRAPDOOR || tmp->type==EXIT || tmp->type==HOLE || |
tmp->type==BUTTON || tmp->type==TELEPORTER || | | tmp->type==BUTTON || tmp->type==TELEPORTER || |