… | |
… | |
438 | /* |
438 | /* |
439 | * Combine similar spell effects into one spell effect. Needed for |
439 | * Combine similar spell effects into one spell effect. Needed for |
440 | * performance reasons with meteor swarm and the like, but also for |
440 | * performance reasons with meteor swarm and the like, but also for |
441 | * playability reasons. |
441 | * playability reasons. |
442 | */ |
442 | */ |
443 | if (tmp->arch == op->arch |
443 | if (tmp->arch == op->arch /* no harm if not comparing by name here */ |
444 | && tmp->type == op->type |
444 | && tmp->type == op->type |
445 | && tmp->subtype == op->subtype |
445 | && tmp->subtype == op->subtype |
446 | && tmp->owner == op->owner |
446 | && tmp->owner == op->owner |
447 | && ((tmp->subtype == SP_EXPLOSION) || (tmp->subtype == SP_CONE && tmp->stats.sp == op->stats.sp))) |
447 | && ((tmp->subtype == SP_EXPLOSION) || (tmp->subtype == SP_CONE && tmp->stats.sp == op->stats.sp))) |
448 | { |
448 | { |
… | |
… | |
692 | create_treasure (head->randomitems, head, GT_INVISIBLE, op->map->difficulty, 0); |
692 | create_treasure (head->randomitems, head, GT_INVISIBLE, op->map->difficulty, 0); |
693 | |
693 | |
694 | insert_ob_in_map (head, op->map, op, 0); |
694 | insert_ob_in_map (head, op->map, op, 0); |
695 | |
695 | |
696 | /* thought it'd be cool to insert a burnout, too. */ |
696 | /* thought it'd be cool to insert a burnout, too. */ |
697 | op->map->insert (get_archetype ("burnout"), op->x + freearr_x[dir], op->y + freearr_y[dir], op); |
697 | op->map->insert (archetype::get (shstr_burnout), op->x + freearr_x[dir], op->y + freearr_y[dir], op); |
698 | } |
698 | } |
699 | } |
699 | } |
700 | |
700 | |
701 | /* peterm: function which summons hostile monsters and |
701 | /* peterm: function which summons hostile monsters and |
702 | * places them in nearby squares. |
702 | * places them in nearby squares. |
… | |
… | |
1004 | { |
1004 | { |
1005 | skill = find_skill_by_name (op, spell_ob->skill); |
1005 | skill = find_skill_by_name (op, spell_ob->skill); |
1006 | |
1006 | |
1007 | if (!skill) |
1007 | if (!skill) |
1008 | { |
1008 | { |
1009 | op->failmsg (format ("You need the skill %s to cast %s!", &spell_ob->skill, &spell_ob->name)); |
1009 | op->failmsg (format ("You need the skill %s to cast %s! " |
|
|
1010 | "H<You either need to learn the skill via a skill scroll " |
|
|
1011 | "or you need to wear a talisman or holy symbol.>", |
|
|
1012 | &spell_ob->skill, &spell_ob->name)); |
1010 | return 0; |
1013 | return 0; |
1011 | } |
1014 | } |
1012 | |
1015 | |
|
|
1016 | int casting_level = min_casting_level (op, spell_ob); |
|
|
1017 | |
1013 | if (min_casting_level (op, spell_ob) > cast_level && !QUERY_FLAG (op, FLAG_WIZ)) |
1018 | if (casting_level > cast_level && !QUERY_FLAG (op, FLAG_WIZ)) |
1014 | { |
1019 | { |
1015 | op->failmsg ("You lack enough skill to cast that spell!"); |
1020 | op->failmsg (format ("You lack enough skill to cast that spell! " |
|
|
1021 | "H<Your cast level is %d, but level %d is required. Maybe you are repelled?>", |
|
|
1022 | cast_level, casting_level)); |
1016 | return 0; |
1023 | return 0; |
1017 | } |
1024 | } |
1018 | } |
1025 | } |
1019 | |
1026 | |
1020 | /* If the caster is the wiz, they don't ever fail, and don't have |
1027 | /* If the caster is the wiz, they don't ever fail, and don't have |