… | |
… | |
58 | } |
58 | } |
59 | |
59 | |
60 | int |
60 | int |
61 | recharge (object *op, object *caster, object *spell_ob) |
61 | recharge (object *op, object *caster, object *spell_ob) |
62 | { |
62 | { |
63 | object *wand, *tmp; |
|
|
64 | int ncharges; |
63 | int ncharges; |
65 | |
64 | |
66 | wand = find_marked_object (op); |
65 | object *wand = op->mark (); |
|
|
66 | |
67 | if (!wand || wand->type != WAND) |
67 | if (!wand || wand->type != WAND) |
68 | { |
68 | { |
69 | op->failmsg ("You need to mark the wand you want to recharge."); |
69 | op->failmsg ("You need to mark the wand you want to recharge."); |
70 | return 0; |
70 | return 0; |
71 | } |
71 | } |
… | |
… | |
73 | if (!(random_roll (0, 3, op, PREFER_HIGH))) |
73 | if (!(random_roll (0, 3, op, PREFER_HIGH))) |
74 | { |
74 | { |
75 | op->failmsgf ("The %s vibrates violently, then explodes!", query_name (wand)); |
75 | op->failmsgf ("The %s vibrates violently, then explodes!", query_name (wand)); |
76 | op->play_sound (sound_find ("ob_explode")); |
76 | op->play_sound (sound_find ("ob_explode")); |
77 | wand->destroy (); |
77 | wand->destroy (); |
78 | tmp = get_archetype (shstr_fireball); |
78 | object *tmp = get_archetype (shstr_fireball); |
79 | tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10; |
79 | tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10; |
80 | |
80 | |
81 | if (!tmp->stats.dam) |
81 | if (!tmp->stats.dam) |
82 | tmp->stats.dam = 1; |
82 | tmp->stats.dam = 1; |
83 | |
83 | |
… | |
… | |
1469 | |
1469 | |
1470 | int num_ident = max (1, spell->stats.dam + SP_level_dam_adjust (caster, spell)); |
1470 | int num_ident = max (1, spell->stats.dam + SP_level_dam_adjust (caster, spell)); |
1471 | |
1471 | |
1472 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1472 | for (tmp = op->inv; tmp; tmp = tmp->below) |
1473 | { |
1473 | { |
1474 | if (!tmp->flag [FLAG_IDENTIFIED] && !tmp->invisible && need_identify (tmp)) |
1474 | if (!tmp->flag [FLAG_IDENTIFIED] && !tmp->invisible && tmp->need_identify ()) |
1475 | { |
1475 | { |
1476 | identify (tmp); |
1476 | identify (tmp); |
1477 | |
1477 | |
1478 | if (op->type == PLAYER) |
1478 | if (op->type == PLAYER) |
1479 | { |
1479 | { |
… | |
… | |
1493 | * was not fully used. |
1493 | * was not fully used. |
1494 | */ |
1494 | */ |
1495 | if (num_ident) |
1495 | if (num_ident) |
1496 | { |
1496 | { |
1497 | for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp; tmp = tmp->above) |
1497 | for (tmp = GET_MAP_OB (op->map, op->x, op->y); tmp; tmp = tmp->above) |
1498 | if (!tmp->flag [FLAG_IDENTIFIED] && !tmp->invisible && need_identify (tmp)) |
1498 | if (!tmp->flag [FLAG_IDENTIFIED] && !tmp->invisible && tmp->need_identify ()) |
1499 | { |
1499 | { |
1500 | identify (tmp); |
1500 | identify (tmp); |
1501 | |
1501 | |
1502 | if (object *pl = tmp->visible_to ()) |
1502 | if (object *pl = tmp->visible_to ()) |
1503 | { |
1503 | { |
… | |
… | |
1978 | * player checks. MSW 2003-01-06 |
1978 | * player checks. MSW 2003-01-06 |
1979 | */ |
1979 | */ |
1980 | int |
1980 | int |
1981 | animate_weapon (object *op, object *caster, object *spell, int dir) |
1981 | animate_weapon (object *op, object *caster, object *spell, int dir) |
1982 | { |
1982 | { |
1983 | object *weapon, *tmp; |
|
|
1984 | char buf[MAX_BUF]; |
1983 | char buf[MAX_BUF]; |
1985 | int a, i; |
1984 | int a, i; |
1986 | sint16 x, y; |
1985 | sint16 x, y; |
1987 | maptile *m; |
1986 | maptile *m; |
1988 | |
1987 | |
… | |
… | |
2018 | op->failmsg ("There is something in the way."); |
2017 | op->failmsg ("There is something in the way."); |
2019 | return 0; |
2018 | return 0; |
2020 | } |
2019 | } |
2021 | |
2020 | |
2022 | /* Use the weapon marked by the player. */ |
2021 | /* Use the weapon marked by the player. */ |
2023 | weapon = find_marked_object (op); |
2022 | object *weapon = op->mark (); |
2024 | |
2023 | |
2025 | if (!weapon) |
2024 | if (!weapon) |
2026 | { |
2025 | { |
2027 | op->failmsg ("You must mark a weapon to use with this spell!"); |
2026 | op->failmsg ("You must mark a weapon to use with this spell!"); |
2028 | return 0; |
2027 | return 0; |
… | |
… | |
2047 | } |
2046 | } |
2048 | |
2047 | |
2049 | weapon = weapon->split (); |
2048 | weapon = weapon->split (); |
2050 | |
2049 | |
2051 | /* create the golem object */ |
2050 | /* create the golem object */ |
2052 | tmp = spell->other_arch->instance (); |
2051 | object *tmp = spell->other_arch->instance (); |
2053 | |
2052 | |
2054 | /* if animated by a player, give the player control of the golem */ |
2053 | /* if animated by a player, give the player control of the golem */ |
2055 | tmp->clr_flag (FLAG_MONSTER); |
2054 | tmp->clr_flag (FLAG_MONSTER); |
2056 | tmp->stats.exp = 0; |
2055 | tmp->stats.exp = 0; |
2057 | add_friendly_object (tmp); |
2056 | add_friendly_object (tmp); |