summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/ghost.cc64
-rw-r--r--crawl-ref/source/item_use.cc3
-rw-r--r--crawl-ref/source/mon-util.cc13
-rw-r--r--crawl-ref/source/monstuff.cc5
-rw-r--r--crawl-ref/source/mstuff2.cc34
5 files changed, 68 insertions, 51 deletions
diff --git a/crawl-ref/source/ghost.cc b/crawl-ref/source/ghost.cc
index dd5e76c3d3..b39895755d 100644
--- a/crawl-ref/source/ghost.cc
+++ b/crawl-ref/source/ghost.cc
@@ -88,7 +88,7 @@ static spell_type search_order_misc[] = {
/* 0 */
SPELL_AGONY,
SPELL_BANISHMENT,
- SPELL_FREEZING_CLOUD,
+ SPELL_FREEZING_CLOUD,
SPELL_PARALYSE,
SPELL_CONFUSE,
SPELL_MEPHITIC_CLOUD,
@@ -110,22 +110,24 @@ ghost_demon::ghost_demon()
void ghost_demon::reset()
{
name.clear();
- species = SP_UNKNOWN;
- job = JOB_UNKNOWN;
- best_skill = SK_FIGHTING;
+ species = SP_UNKNOWN;
+ job = JOB_UNKNOWN;
+ best_skill = SK_FIGHTING;
best_skill_level = 0;
- xl = 0;
- max_hp = 0;
- ev = 0;
- ac = 0;
- damage = 0;
- speed = 10;
- see_invis = false;
- brand = SPWPN_NORMAL;
- resists = mon_resist_def();
- spellcaster = false;
- cycle_colours = false;
- fly = FL_NONE;
+ xl = 0;
+ max_hp = 0;
+ ev = 0;
+ ac = 0;
+ damage = 0;
+ speed = 10;
+ see_invis = false;
+ brand = SPWPN_NORMAL;
+ resists = mon_resist_def();
+ // HACKY: demons and ghosts always resist poison
+// resists.poison = 1;
+ spellcaster = false;
+ cycle_colours = false;
+ fly = FL_NONE;
}
void ghost_demon::init_random_demon()
@@ -175,13 +177,13 @@ void ghost_demon::init_random_demon()
do {
brand = static_cast<brand_type>( random2(MAX_PAN_LORD_BRANDS) );
/* some brands inappropriate (e.g. holy wrath) */
- } while (brand == SPWPN_HOLY_WRATH
+ } while (brand == SPWPN_HOLY_WRATH
|| (brand == SPWPN_ORC_SLAYING
&& you.mons_species() != MONS_ORC)
|| (brand == SPWPN_DRAGON_SLAYING
&& you.mons_species() != MONS_DRACONIAN)
- || brand == SPWPN_PROTECTION
- || brand == SPWPN_FLAME
+ || brand == SPWPN_PROTECTION
+ || brand == SPWPN_FLAME
|| brand == SPWPN_FROST);
}
@@ -193,7 +195,7 @@ void ghost_demon::init_random_demon()
// does demon fly?
fly = (one_chance_in(3)? FL_NONE :
one_chance_in(5)? FL_LEVITATE : FL_FLY);
-
+
// hit dice:
xl = 10 + roll_dice(2, 10);
@@ -206,7 +208,7 @@ void ghost_demon::init_random_demon()
for the demon, then converts those spells to the monster spell indices.
Some special monster-only spells are at the end. */
if (spellcaster)
- {
+ {
if (coinflip())
spells[0] = RANDOM_ELEMENT(search_order_conj);
@@ -222,7 +224,7 @@ void ghost_demon::init_random_demon()
spells[3] = RANDOM_ELEMENT(search_order_misc);
if ( spells[3] == SPELL_DIG )
spells[3] = SPELL_NO_SPELL;
- }
+ }
if (coinflip())
spells[4] = RANDOM_ELEMENT(search_order_misc);
@@ -277,7 +279,7 @@ void ghost_demon::init_random_demon()
void ghost_demon::init_player_ghost()
{
- name = you.your_name;
+ name = you.your_name;
max_hp = ((you.hp_max >= 400) ? 400 : you.hp_max);
ev = player_evasion();
ac = player_AC();
@@ -285,11 +287,11 @@ void ghost_demon::init_player_ghost()
if (ev > 60)
ev = 60;
- see_invis = player_see_invis();
- resists.fire = player_res_fire();
- resists.cold = player_res_cold();
- resists.elec = player_res_electricity();
- speed = player_ghost_base_movement_speed();
+ see_invis = player_see_invis();
+ resists.fire = player_res_fire();
+ resists.cold = player_res_cold();
+ resists.elec = player_res_electricity();
+ speed = player_ghost_base_movement_speed();
int d = 4;
int e = SPWPN_NORMAL;
@@ -424,7 +426,7 @@ void ghost_demon::add_spells( )
spells[ 4 ] = SPELL_DIG;
/* Looks for blink/tport for emergency slot */
- if (player_has_spell( SPELL_CONTROLLED_BLINK )
+ if (player_has_spell( SPELL_CONTROLLED_BLINK )
|| player_has_spell( SPELL_BLINK ))
{
spells[ 5 ] = SPELL_CONTROLLED_BLINK;
@@ -533,7 +535,7 @@ int ghost_demon::n_extra_ghosts()
{
const int lev = you.your_level + 1;
const int subdepth = subdungeon_depth(you.where_are_you, you.your_level);
-
+
if (you.level_type == LEVEL_PANDEMONIUM
|| you.level_type == LEVEL_ABYSS
|| (you.level_type == LEVEL_DUNGEON
@@ -548,7 +550,7 @@ int ghost_demon::n_extra_ghosts()
if (you.where_are_you == BRANCH_ECUMENICAL_TEMPLE)
return (0);
-
+
// No multiple ghosts until level 9 of the Main Dungeon.
if ((lev < 9 && you.where_are_you == BRANCH_MAIN_DUNGEON)
|| (subdepth < 2 && you.where_are_you == BRANCH_LAIR)
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 2d8956fcd8..ce4071cfca 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -3895,8 +3895,10 @@ bool enchant_armour( int &ac_change, bool quiet, item_def &arm )
static bool _handle_enchant_armour( int item_slot )
{
if (item_slot == -1)
+ {
item_slot = prompt_invent_item( "Enchant which item?", MT_INVLIST,
OSEL_ENCH_ARM, true, true, false );
+ }
if (item_slot == -1)
{
@@ -3982,6 +3984,7 @@ static bool scroll_modify_item(const scroll_type scroll)
if ( !fully_identified(item) )
{
mpr("This is a scroll of identify!");
+ set_ident_type( OBJ_SCROLLS, SCR_IDENTIFY, ID_KNOWN_TYPE );
identify(-1, item_slot);
return (true);
}
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 3f2f71c123..76718e6c67 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -292,13 +292,16 @@ const mon_resist_def &get_mons_class_resists(int mc)
mon_resist_def get_mons_resists(const monsters *mon)
{
+ mon_resist_def resists;
if (mon->type == MONS_PLAYER_GHOST || mon->type == MONS_PANDEMONIUM_DEMON)
- return (mon->ghost->resists);
+ resists = (mon->ghost->resists);
+ else
+ resists = mon_resist_def();
+
+ resists |= get_mons_class_resists(mon->type);
- mon_resist_def resists = get_mons_class_resists(mon->type);
- if ((mons_genus(mon->type) == MONS_DRACONIAN &&
- mon->type != MONS_DRACONIAN) ||
- mon->type == MONS_TIAMAT)
+ if (mons_genus(mon->type) == MONS_DRACONIAN && mon->type != MONS_DRACONIAN
+ || mon->type == MONS_TIAMAT)
{
monster_type draco_species = draco_subspecies(mon);
if (draco_species != mon->type)
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 15c51418c6..afb6efdfdb 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -3849,6 +3849,7 @@ static bool _is_emergency_spell(const monster_spells &msp, int spell)
for (int i = 0; i < 5; ++i)
if (msp[i] == spell)
return (false);
+
return (msp[5] == spell);
}
@@ -3937,9 +3938,11 @@ static bool _mons_announce_cast(monsters *monster, bool nearby,
// ones in monspeak.cc... has the problem
// that it doesn't suggest a vocal component. -- bwr
if (player_monster_visible(monster))
+ {
simple_monster_message( monster,
" gestures wildly.",
MSGCH_MONSTER_SPELL );
+ }
break;
case 1:
simple_monster_message( monster,
@@ -4314,7 +4317,9 @@ static bool _handle_spell( monsters *monster, bolt & beem )
if (!_mons_announce_cast(monster, monsterNearby,
spell_cast, draco_breath))
+ {
return (false);
+ }
// FINALLY! determine primary spell effects {dlb}:
if (spell_cast == SPELL_BLINK)
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index b99185c2bb..fc0162e428 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -815,8 +815,10 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast)
}
if (need_friendly_stub)
+ {
simple_monster_message(monster, " shimmers for a moment.",
MSGCH_MONSTER_ENCHANT);
+ }
return;
}
@@ -900,25 +902,27 @@ void setup_mons_cast(const monsters *monster, struct bolt &pbolt, int spell_cast
// Need to correct this for power of spellcaster
int power = 12 * monster->hit_dice;
- bolt theBeam = mons_spells(spell_cast, power);
+ bolt theBeam = mons_spells(spell_cast, power);
+
+ pbolt.colour = theBeam.colour;
+ pbolt.range = theBeam.range;
+ pbolt.rangeMax = theBeam.rangeMax;
+ pbolt.hit = theBeam.hit;
+ pbolt.damage = theBeam.damage;
- pbolt.colour = theBeam.colour;
- pbolt.range = theBeam.range;
- pbolt.rangeMax = theBeam.rangeMax;
- pbolt.hit = theBeam.hit;
- pbolt.damage = theBeam.damage;
if (theBeam.ench_power != -1)
pbolt.ench_power = theBeam.ench_power;
- pbolt.type = theBeam.type;
- pbolt.flavour = theBeam.flavour;
- pbolt.thrower = theBeam.thrower;
+
+ pbolt.type = theBeam.type;
+ pbolt.flavour = theBeam.flavour;
+ pbolt.thrower = theBeam.thrower;
pbolt.aux_source.clear();
- pbolt.name = theBeam.name;
- pbolt.is_beam = theBeam.is_beam;
- pbolt.source_x = monster->x;
- pbolt.source_y = monster->y;
- pbolt.is_tracer = false;
- pbolt.is_explosion = theBeam.is_explosion;
+ pbolt.name = theBeam.name;
+ pbolt.is_beam = theBeam.is_beam;
+ pbolt.source_x = monster->x;
+ pbolt.source_y = monster->y;
+ pbolt.is_tracer = false;
+ pbolt.is_explosion = theBeam.is_explosion;
if (pbolt.name.length() && pbolt.name[0] != '0')
pbolt.aux_source = pbolt.name;