… | |
… | |
154 | /* If it starts with a letter, presume it is a description */ |
154 | /* If it starts with a letter, presume it is a description */ |
155 | if (isalpha (*stringarg)) |
155 | if (isalpha (*stringarg)) |
156 | { |
156 | { |
157 | artifact *al = find_artifactlist (missile->type)->items; |
157 | artifact *al = find_artifactlist (missile->type)->items; |
158 | |
158 | |
159 | for (; al != NULL; al = al->next) |
159 | for (; al; al = al->next) |
160 | if (!strcasecmp (al->item->name, stringarg)) |
160 | if (!strcasecmp (al->item->name, stringarg)) |
161 | break; |
161 | break; |
162 | |
162 | |
163 | if (!al) |
163 | if (!al) |
164 | { |
164 | { |
… | |
… | |
373 | * normal applies. |
373 | * normal applies. |
374 | */ |
374 | */ |
375 | int |
375 | int |
376 | cast_invisible (object *op, object *caster, object *spell_ob) |
376 | cast_invisible (object *op, object *caster, object *spell_ob) |
377 | { |
377 | { |
378 | object *tmp; |
|
|
379 | |
|
|
380 | if (op->invisible > 1000) |
378 | if (op->invisible > 1000) |
381 | { |
379 | { |
382 | new_draw_info (NDI_UNIQUE, 0, op, "You can not extend the duration of your invisibility any further"); |
380 | new_draw_info (NDI_UNIQUE, 0, op, "You can not extend the duration of your invisibility any further"); |
383 | return 0; |
381 | return 0; |
384 | } |
382 | } |
… | |
… | |
400 | else |
398 | else |
401 | op->contr->tmp_invis = 1; |
399 | op->contr->tmp_invis = 1; |
402 | |
400 | |
403 | op->contr->hidden = 0; |
401 | op->contr->hidden = 0; |
404 | } |
402 | } |
|
|
403 | |
405 | if (makes_invisible_to (op, op)) |
404 | if (makes_invisible_to (op, op)) |
406 | new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!"); |
405 | new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!"); |
407 | else |
406 | else |
408 | new_draw_info (NDI_UNIQUE, 0, op, "You feel more transparent!"); |
407 | new_draw_info (NDI_UNIQUE, 0, op, "You feel more transparent!"); |
409 | |
408 | |
410 | update_object (op, UP_OBJ_FACE); |
409 | update_object (op, UP_OBJ_CHANGE); |
411 | |
410 | |
412 | /* Only search the active objects - only these should actually do |
411 | /* Only search the active objects - only these should actually do |
413 | * harm to the player. |
412 | * harm to the player. |
414 | */ |
413 | */ |
415 | for_all_actives (tmp) |
414 | for_all_actives (tmp) |
… | |
… | |
566 | } |
565 | } |
567 | |
566 | |
568 | int |
567 | int |
569 | perceive_self (object *op) |
568 | perceive_self (object *op) |
570 | { |
569 | { |
|
|
570 | char buf[MAX_BUF]; |
571 | char *cp = describe_item (op, op), buf[MAX_BUF]; |
571 | const char *cp = describe_item (op, op); |
572 | archetype *at = archetype::find (ARCH_DEPLETION); |
572 | archetype *at = archetype::find (ARCH_DEPLETION); |
573 | object *tmp; |
573 | object *tmp; |
574 | int i; |
574 | int i; |
575 | |
575 | |
576 | tmp = find_god (determine_god (op)); |
576 | tmp = find_god (determine_god (op)); |
… | |
… | |
2153 | /* Basically, if the object is magical and not counterspell, |
2153 | /* Basically, if the object is magical and not counterspell, |
2154 | * we will more or less remove the object. Don't counterspell |
2154 | * we will more or less remove the object. Don't counterspell |
2155 | * monsters either. |
2155 | * monsters either. |
2156 | */ |
2156 | */ |
2157 | |
2157 | |
2158 | if (head->attacktype & AT_MAGIC && |
2158 | if (head->attacktype & AT_MAGIC |
2159 | !(head->attacktype & AT_COUNTERSPELL) && !QUERY_FLAG (head, FLAG_MONSTER) && (op->level > head->level)) |
2159 | && !(head->attacktype & AT_COUNTERSPELL) |
|
|
2160 | && !QUERY_FLAG (head, FLAG_MONSTER) |
|
|
2161 | && (op->level > head->level)) |
2160 | head->destroy (); |
2162 | head->destroy (); |
2161 | else |
2163 | else |
2162 | switch (head->type) |
2164 | switch (head->type) |
2163 | { |
2165 | { |
2164 | case SPELL_EFFECT: |
2166 | case SPELL_EFFECT: |
|
|
2167 | // XXX: Don't affect floor spelleffects. See also XXX comment |
|
|
2168 | // about sanctuary in spell_util.C |
|
|
2169 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
|
|
2170 | continue; |
|
|
2171 | |
2165 | if (op->level > head->level) |
2172 | if (op->level > head->level) |
2166 | head->destroy (); |
2173 | head->destroy (); |
2167 | |
2174 | |
2168 | break; |
2175 | break; |
2169 | |
2176 | |