ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/spell_effect.C
(Generate patch)

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.143 by root, Mon Nov 12 03:48:34 2012 UTC vs.
Revision 1.146 by root, Sun Jan 29 02:47:06 2017 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 6 * Copyright (©) 1992 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 8 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 9 * the terms of the Affero GNU General Public License as published by the
404 404
405 if (spell_ob->flag [FLAG_MAKE_INVIS]) 405 if (spell_ob->flag [FLAG_MAKE_INVIS])
406 op->contr->tmp_invis = 0; 406 op->contr->tmp_invis = 0;
407 else 407 else
408 op->contr->tmp_invis = 1; 408 op->contr->tmp_invis = 1;
409
410 op->contr->hidden = 0;
411 } 409 }
412 410
413 if (makes_invisible_to (op, op)) 411 if (makes_invisible_to (op, op))
414 new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!"); 412 new_draw_info (NDI_UNIQUE, 0, op, "You can't see your hands!");
415 else 413 else
473 471
474 op->destroy (); 472 op->destroy ();
475} 473}
476 474
477/* Word of recall causes the player to return 'home'. 475/* Word of recall causes the player to return 'home'.
478 * 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
479 * time delay effect. 477 * time delay effect.
480 */ 478 */
481int 479int
482cast_word_of_recall (object *op, object *caster, object *spell_ob) 480cast_word_of_recall (object *op, object *caster, object *spell_ob)
483{ 481{
707 /* 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 */
708 if (tmp->other_arch && tmp->other_arch->type == SPELL) 706 if (tmp->other_arch && tmp->other_arch->type == SPELL)
709 insert_ob_in_ob (tmp->other_arch->instance (), tmp); 707 insert_ob_in_ob (tmp->other_arch->instance (), tmp);
710 708
711 /* This code causes the wall to extend some distance in 709 /* This code causes the wall to extend some distance in
712 * each direction, or until an obstruction is encountered. 710 * each direction, or until an obstruction is encountered.
713 * posblocked and negblocked help determine how far the 711 * posblocked and negblocked help determine how far the
714 * created wall can extend, it won't go extend through 712 * created wall can extend, it won't go extend through
715 * blocked spaces. 713 * blocked spaces.
716 */ 714 */
717 maxrange = spell_ob->range + SP_level_range_adjust (caster, spell_ob); 715 maxrange = spell_ob->range + SP_level_range_adjust (caster, spell_ob);
1869 1867
1870 /* don't attack our own spells */ 1868 /* don't attack our own spells */
1871 if (tmp->owner && tmp->owner == op->owner) 1869 if (tmp->owner && tmp->owner == op->owner)
1872 continue; 1870 continue;
1873 1871
1874 /* Basically, if the object is magical and not counterspell, 1872 /* Basically, if the object is magical and not counterspell,
1875 * we will more or less remove the object. Don't counterspell 1873 * we will more or less remove the object. Don't counterspell
1876 * monsters either. 1874 * monsters either.
1877 */ 1875 */
1878 1876
1879 if (head->attacktype & AT_MAGIC 1877 if (head->attacktype & AT_MAGIC
1880 && !(head->attacktype & AT_COUNTERSPELL) 1878 && !(head->attacktype & AT_COUNTERSPELL)
1881 && !head->flag [FLAG_MONSTER] 1879 && !head->flag [FLAG_MONSTER]
1955 1953
1956 op->failmsg ("You are not standing over an altar!"); 1954 op->failmsg ("You are not standing over an altar!");
1957 return 0; 1955 return 0;
1958} 1956}
1959 1957
1960/* animate_weapon - 1958/* animate_weapon -
1961 * 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.
1962 * 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
1963 * 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
1964 * 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.
1965 * 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,
1966 * 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
1967 * 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
1968 * player checks. MSW 2003-01-06 1966 * player checks. MSW 2003-01-06
2206 2204
2207/* 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,
2208 * 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
2209 * around him. 2207 * around him.
2210 * Aura parameters: 2208 * Aura parameters:
2211 * duration: duration counter. 2209 * duration: duration counter.
2212 * attacktype: aura's attacktype 2210 * attacktype: aura's attacktype
2213 * other_arch: archetype to drop where we attack 2211 * other_arch: archetype to drop where we attack
2214 */ 2212 */
2215void 2213void
2216move_aura (object *aura) 2214move_aura (object *aura)
2217{ 2215{
2218 /* auras belong in inventories */ 2216 /* auras belong in inventories */
2219 object *env = aura->env; 2217 object *env = aura->env;
2220 object *owner = aura->owner; 2218 object *owner = aura->owner;
2221 2219
2222 /* no matter what we've gotta remove the aura... 2220 /* no matter what we've gotta remove the aura...
2223 * we'll put it back if its time isn't up. 2221 * we'll put it back if its time isn't up.
2224 */ 2222 */
2225 aura->remove (); 2223 aura->remove ();
2226 2224
2227 /* exit if we're out of gas */ 2225 /* exit if we're out of gas */
2228 if (aura->duration-- < 0) 2226 if (aura->duration-- < 0)
2237 aura->destroy (); 2235 aura->destroy ();
2238 return; 2236 return;
2239 } 2237 }
2240 2238
2241 /* we need to jump out of the inventory for a bit 2239 /* we need to jump out of the inventory for a bit
2242 * in order to hit the map conveniently. 2240 * in order to hit the map conveniently.
2243 */ 2241 */
2244 aura->insert_at (env, aura); 2242 aura->insert_at (env, aura);
2245 2243
2246 for (int i = 1; i < 9; i++) 2244 for (int i = 1; i < 9; i++)
2247 { 2245 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines