… | |
… | |
471 | |
471 | |
472 | op->destroy (); |
472 | op->destroy (); |
473 | } |
473 | } |
474 | |
474 | |
475 | /* Word of recall causes the player to return 'home'. |
475 | /* Word of recall causes the player to return 'home'. |
476 | * we put a force into the player object, so that there is a |
476 | * we put a force into the player object, so that there is a |
477 | * time delay effect. |
477 | * time delay effect. |
478 | */ |
478 | */ |
479 | int |
479 | int |
480 | cast_word_of_recall (object *op, object *caster, object *spell_ob) |
480 | cast_word_of_recall (object *op, object *caster, object *spell_ob) |
481 | { |
481 | { |
… | |
… | |
705 | /* If this is a spellcasting wall, need to insert the spell object */ |
705 | /* If this is a spellcasting wall, need to insert the spell object */ |
706 | if (tmp->other_arch && tmp->other_arch->type == SPELL) |
706 | if (tmp->other_arch && tmp->other_arch->type == SPELL) |
707 | insert_ob_in_ob (tmp->other_arch->instance (), tmp); |
707 | insert_ob_in_ob (tmp->other_arch->instance (), tmp); |
708 | |
708 | |
709 | /* This code causes the wall to extend some distance in |
709 | /* This code causes the wall to extend some distance in |
710 | * each direction, or until an obstruction is encountered. |
710 | * each direction, or until an obstruction is encountered. |
711 | * posblocked and negblocked help determine how far the |
711 | * posblocked and negblocked help determine how far the |
712 | * created wall can extend, it won't go extend through |
712 | * created wall can extend, it won't go extend through |
713 | * blocked spaces. |
713 | * blocked spaces. |
714 | */ |
714 | */ |
715 | maxrange = spell_ob->range + SP_level_range_adjust (caster, spell_ob); |
715 | maxrange = spell_ob->range + SP_level_range_adjust (caster, spell_ob); |
… | |
… | |
1867 | |
1867 | |
1868 | /* don't attack our own spells */ |
1868 | /* don't attack our own spells */ |
1869 | if (tmp->owner && tmp->owner == op->owner) |
1869 | if (tmp->owner && tmp->owner == op->owner) |
1870 | continue; |
1870 | continue; |
1871 | |
1871 | |
1872 | /* Basically, if the object is magical and not counterspell, |
1872 | /* Basically, if the object is magical and not counterspell, |
1873 | * we will more or less remove the object. Don't counterspell |
1873 | * we will more or less remove the object. Don't counterspell |
1874 | * monsters either. |
1874 | * monsters either. |
1875 | */ |
1875 | */ |
1876 | |
1876 | |
1877 | if (head->attacktype & AT_MAGIC |
1877 | if (head->attacktype & AT_MAGIC |
1878 | && !(head->attacktype & AT_COUNTERSPELL) |
1878 | && !(head->attacktype & AT_COUNTERSPELL) |
1879 | && !head->flag [FLAG_MONSTER] |
1879 | && !head->flag [FLAG_MONSTER] |
… | |
… | |
1953 | |
1953 | |
1954 | op->failmsg ("You are not standing over an altar!"); |
1954 | op->failmsg ("You are not standing over an altar!"); |
1955 | return 0; |
1955 | return 0; |
1956 | } |
1956 | } |
1957 | |
1957 | |
1958 | /* animate_weapon - |
1958 | /* animate_weapon - |
1959 | * Generalization of staff_to_snake. Makes a golem out of the caster's weapon. |
1959 | * Generalization of staff_to_snake. Makes a golem out of the caster's weapon. |
1960 | * The golem is based on the archetype specified, modified by the caster's level |
1960 | * The golem is based on the archetype specified, modified by the caster's level |
1961 | * and the attributes of the weapon. The weapon is inserted in the golem's |
1961 | * and the attributes of the weapon. The weapon is inserted in the golem's |
1962 | * inventory so that it falls to the ground when the golem dies. |
1962 | * inventory so that it falls to the ground when the golem dies. |
1963 | * This code was very odd - code early on would only let players use the spell, |
1963 | * This code was very odd - code early on would only let players use the spell, |
1964 | * yet the code wass full of player checks. I've presumed that the code |
1964 | * yet the code wass full of player checks. I've presumed that the code |
1965 | * that only let players use it was correct, and removed all the other |
1965 | * that only let players use it was correct, and removed all the other |
1966 | * player checks. MSW 2003-01-06 |
1966 | * player checks. MSW 2003-01-06 |
… | |
… | |
2204 | |
2204 | |
2205 | /* move aura function. An aura is a part of someone's inventory, |
2205 | /* move aura function. An aura is a part of someone's inventory, |
2206 | * which he carries with him, but which acts on the map immediately |
2206 | * which he carries with him, but which acts on the map immediately |
2207 | * around him. |
2207 | * around him. |
2208 | * Aura parameters: |
2208 | * Aura parameters: |
2209 | * duration: duration counter. |
2209 | * duration: duration counter. |
2210 | * attacktype: aura's attacktype |
2210 | * attacktype: aura's attacktype |
2211 | * other_arch: archetype to drop where we attack |
2211 | * other_arch: archetype to drop where we attack |
2212 | */ |
2212 | */ |
2213 | void |
2213 | void |
2214 | move_aura (object *aura) |
2214 | move_aura (object *aura) |
2215 | { |
2215 | { |
2216 | /* auras belong in inventories */ |
2216 | /* auras belong in inventories */ |
2217 | object *env = aura->env; |
2217 | object *env = aura->env; |
2218 | object *owner = aura->owner; |
2218 | object *owner = aura->owner; |
2219 | |
2219 | |
2220 | /* no matter what we've gotta remove the aura... |
2220 | /* no matter what we've gotta remove the aura... |
2221 | * we'll put it back if its time isn't up. |
2221 | * we'll put it back if its time isn't up. |
2222 | */ |
2222 | */ |
2223 | aura->remove (); |
2223 | aura->remove (); |
2224 | |
2224 | |
2225 | /* exit if we're out of gas */ |
2225 | /* exit if we're out of gas */ |
2226 | if (aura->duration-- < 0) |
2226 | if (aura->duration-- < 0) |
… | |
… | |
2235 | aura->destroy (); |
2235 | aura->destroy (); |
2236 | return; |
2236 | return; |
2237 | } |
2237 | } |
2238 | |
2238 | |
2239 | /* we need to jump out of the inventory for a bit |
2239 | /* we need to jump out of the inventory for a bit |
2240 | * in order to hit the map conveniently. |
2240 | * in order to hit the map conveniently. |
2241 | */ |
2241 | */ |
2242 | aura->insert_at (env, aura); |
2242 | aura->insert_at (env, aura); |
2243 | |
2243 | |
2244 | for (int i = 1; i < 9; i++) |
2244 | for (int i = 1; i < 9; i++) |
2245 | { |
2245 | { |