summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 06:15:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 06:15:49 +0000
commit55e422bf9dcda3c8515848e84e079da6dc9a9ad9 (patch)
tree2c157c11685b0eabf6687db8662977228e8e9287
parent372b7c5803a47c4f2aaa246867aeb0c4bbd2abaf (diff)
downloadcrawl-ref-55e422bf9dcda3c8515848e84e079da6dc9a9ad9.tar.gz
crawl-ref-55e422bf9dcda3c8515848e84e079da6dc9a9ad9.zip
Add more minor cosmetic fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8161 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/abyss.cc5
-rw-r--r--crawl-ref/source/debug.cc3
-rw-r--r--crawl-ref/source/decks.cc10
-rw-r--r--crawl-ref/source/dungeon.cc4
-rw-r--r--crawl-ref/source/it_use3.cc36
-rw-r--r--crawl-ref/source/mon-util.cc9
-rw-r--r--crawl-ref/source/mon-util.h2
-rw-r--r--crawl-ref/source/monplace.h2
-rw-r--r--crawl-ref/source/mstuff2.cc53
-rw-r--r--crawl-ref/source/religion.cc2
-rw-r--r--crawl-ref/source/spells2.cc18
-rw-r--r--crawl-ref/source/spells3.cc7
-rw-r--r--crawl-ref/source/xom.cc17
13 files changed, 88 insertions, 80 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index e8a33b2f4d..a3bf7932b8 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -669,7 +669,7 @@ static void _initialise_level_corrupt_seeds(int power)
static bool _spawn_corrupted_servant_near(const coord_def &pos)
{
- // Thirty tries for a place
+ // Thirty tries for a place.
for (int i = 0; i < 30; ++i)
{
const coord_def p( pos.x + random2avg(4, 3) + random2(3),
@@ -688,10 +688,11 @@ static bool _spawn_corrupted_servant_near(const coord_def &pos)
const beh_type beh =
one_chance_in(5 + you.skills[SK_INVOCATIONS] / 4) ? BEH_HOSTILE
: BEH_NEUTRAL;
- const int mid = create_monster( mgen_data( mons, beh, 5, p ) );
+ const int mid = create_monster(mgen_data(mons, beh, 5, 0, p));
return (mid != -1);
}
+
return (false);
}
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 06cb29b26e..440aea457e 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -454,8 +454,7 @@ void wizard_create_spec_monster(void)
{
create_monster(
mgen_data::sleeper_at(
- static_cast<monster_type>(mon),
- you.pos()));
+ static_cast<monster_type>(mon), you.pos()));
}
}
#endif
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 110ea24fb2..d2232990d4 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -2498,8 +2498,8 @@ static bool _trowel_card(int power, deck_rarity_type rarity)
if (create_monster(
mgen_data(RANDOM_ELEMENT(golems),
- BEH_FRIENDLY, 5, you.pos(),
- you.pet_target)) != -1)
+ BEH_FRIENDLY, 5,
+ you.pos(), you.pet_target)) != -1)
{
mpr("You construct a golem!");
num_made++;
@@ -2824,9 +2824,9 @@ static void _summon_flying(int power, deck_rarity_type rarity)
create_monster(
mgen_data(result,
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- std::min(power / 50, 6),
+ std::min(power / 50, 6), 0,
you.pos(),
- friendly ? you.pet_target : MHITYOU ));
+ friendly ? you.pet_target : MHITYOU));
}
}
@@ -2844,7 +2844,7 @@ static void _summon_skeleton(int power, deck_rarity_type rarity)
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
std::min(power / 50, 6),
you.pos(),
- friendly ? you.pet_target : MHITYOU ));
+ friendly ? you.pet_target : MHITYOU));
}
static void _summon_ugly(int power, deck_rarity_type rarity)
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 779538c1b8..4c507001df 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4897,7 +4897,7 @@ static void _vault_grid( vault_placement &place,
if (vgrid == 'F' && one_chance_in(100))
{
vgrid = '.';
- create_monster(mgen_data::hostile_at( _random_evil_statue(), where));
+ create_monster(mgen_data::hostile_at(_random_evil_statue(), where));
}
// First, set base tile for grids {dlb}:
@@ -6436,7 +6436,7 @@ static void _labyrinth_place_items(const coord_def &end)
static void _labyrinth_place_exit(const coord_def &end)
{
_labyrinth_place_items(end);
- mons_place( mgen_data::sleeper_at(MONS_MINOTAUR, end, MG_PATROLLING) );
+ mons_place(mgen_data::sleeper_at(MONS_MINOTAUR, end, MG_PATROLLING));
grd(end) = DNGN_ESCAPE_HATCH_UP;
}
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index 605e1eaf39..1c19650a76 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -391,8 +391,8 @@ static bool evoke_horn_of_geryon()
{
mpr("You produce a hideous howling noise!", MSGCH_SOUND);
create_monster(
- mgen_data(MONS_BEAST, BEH_HOSTILE,
- 4, you.pos(), MHITYOU));
+ mgen_data::hostile_at(MONS_BEAST,
+ you.pos(), 4, 0, true));
}
return (rc);
}
@@ -405,16 +405,15 @@ static bool evoke_sceptre_of_asmodeus()
else if (one_chance_in(20))
{
// Summon devils, maybe a Fiend.
- const monster_type mtype = (one_chance_in(4) ? MONS_FIEND :
- summon_any_demon(DEMON_COMMON));
- const bool good_summon =
- create_monster(
- mgen_data(mtype, BEH_HOSTILE,
- 6, you.pos(), MHITYOU)) != -1;
+ const monster_type mon = (one_chance_in(4) ? MONS_FIEND :
+ summon_any_demon(DEMON_COMMON));
+ const bool good_summon = create_monster(
+ mgen_data::hostile_at(mon,
+ you.pos(), 6, 0, true)) != -1;
if (good_summon)
{
- if (mtype == MONS_FIEND)
+ if (mon == MONS_FIEND)
mpr("\"Your arrogance condemns you, mortal!\"");
else
mpr("The Sceptre summons one of its servants.");
@@ -424,15 +423,16 @@ static bool evoke_sceptre_of_asmodeus()
}
else
{
- // Cast a destructive spell
+ // Cast a destructive spell.
const spell_type spl = static_cast<spell_type>(
- random_choose_weighted( 114, SPELL_BOLT_OF_FIRE,
- 57, SPELL_LIGHTNING_BOLT,
- 57, SPELL_BOLT_OF_DRAINING,
- 12, SPELL_HELLFIRE,
- 0 ));
- your_spells( spl, you.skills[SK_EVOCATIONS] * 8, false );
+ random_choose_weighted(114, SPELL_BOLT_OF_FIRE,
+ 57, SPELL_LIGHTNING_BOLT,
+ 57, SPELL_BOLT_OF_DRAINING,
+ 12, SPELL_HELLFIRE,
+ 0));
+ your_spells(spl, you.skills[SK_EVOCATIONS] * 8, false);
}
+
return (rc);
}
@@ -905,8 +905,8 @@ void tome_of_power(int slot)
else if (one_chance_in(36))
{
if (create_monster(
- mgen_data(MONS_ABOMINATION_SMALL, BEH_HOSTILE,
- 6, you.pos(), MHITYOU)) != -1)
+ mgen_data::hostile_at(MONS_ABOMINATION_SMALL,
+ you.pos(), 6, 0, true)) != -1)
{
mpr("A horrible Thing appears!");
mpr("It doesn't look too friendly.");
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 51d845c9b8..d7a2facd71 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -7627,7 +7627,7 @@ void monsters::react_to_damage(int damage, beam_type flavour)
#ifdef DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "Trying to spawn %d jellies.", tospawn);
#endif
- const beh_type sbehaviour = SAME_ATTITUDE(this);
+ const beh_type beha = SAME_ATTITUDE(this);
int spawned = 0;
for (int i = 0; i < tospawn; ++i)
{
@@ -7636,10 +7636,9 @@ void monsters::react_to_damage(int damage, beam_type flavour)
if (!in_bounds(jpos))
continue;
- const int nmons =
- mons_place(
- mgen_data( jelly, sbehaviour, 0, jpos,
- foe, true ) );
+ const int nmons = mons_place(
+ mgen_data(jelly, beha, 0, 0,
+ jpos, foe, true));
if (nmons != -1 && nmons != NON_MONSTER)
{
diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h
index a7c2da68b7..fad483a5be 100644
--- a/crawl-ref/source/mon-util.h
+++ b/crawl-ref/source/mon-util.h
@@ -86,7 +86,7 @@ enum mon_attack_flavour
};
// Non-spell "summoning" types to give to monsters::mark_summoned(), or as
-// the fourth paramater of mgen_data's second constructor.
+// the fourth parameter of mgen_data's second constructor.
//
// Negative values since spells are non-negative.
enum mon_summon_type
diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h
index 36a3ebdf22..6e51f386aa 100644
--- a/crawl-ref/source/monplace.h
+++ b/crawl-ref/source/monplace.h
@@ -129,7 +129,7 @@ struct mgen_data
// For summoned monsters this is their type of summoning, either the
// spell which summoned them or one of the values of the enumeration
- // mon_summon_type in mon-util.h
+ // mon_summon_type in mon-util.h.
int summon_type;
// Where the monster will be created.
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc
index 2afda419c3..aa9cbc0a4a 100644
--- a/crawl-ref/source/mstuff2.cc
+++ b/crawl-ref/source/mstuff2.cc
@@ -107,8 +107,8 @@ static void _do_high_level_summon(monsters *monster, bool monsterNearby,
continue;
create_monster(
- mgen_data(which_mons, SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ mgen_data(which_mons, SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
}
@@ -225,9 +225,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (sumcount = 0; sumcount < sumcount2; ++sumcount)
{
create_monster(
- mgen_data(RANDOM_MONSTER, SAME_ATTITUDE(monster), 5,
- SPELL_SHADOW_CREATURES,
- monster->pos(), monster->foe));
+ mgen_data(RANDOM_MONSTER, SAME_ATTITUDE(monster),
+ 5, spell_cast, monster->pos(), monster->foe));
}
return;
@@ -237,8 +236,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (sumcount = 0; sumcount < sumcount2; sumcount++)
{
create_monster(
- mgen_data(MONS_RAKSHASA_FAKE, SAME_ATTITUDE(monster), 3,
- monster->pos(), monster->foe));
+ mgen_data(MONS_RAKSHASA_FAKE, SAME_ATTITUDE(monster),
+ 3, monster->pos(), monster->foe));
}
return;
@@ -272,8 +271,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
: MONS_UGLY_THING);
create_monster(
- mgen_data(mon, SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ mgen_data(mon, SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
return;
@@ -291,8 +290,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
{
create_monster(
mgen_data(summon_any_demon(DEMON_LESSER),
- SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
return;
@@ -306,8 +305,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (sumcount = 0; sumcount < sumcount2; ++sumcount)
{
create_monster(
- mgen_data(MONS_SCORPION, SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ mgen_data(MONS_SCORPION, SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
return;
@@ -319,21 +318,21 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (sumcount = 0; sumcount < sumcount2; ++sumcount)
{
create_monster(
- mgen_data(MONS_UFETUBUS, SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ mgen_data(MONS_UFETUBUS, SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
return;
case SPELL_SUMMON_BEAST: // Geryon
create_monster(
- mgen_data(MONS_BEAST, SAME_ATTITUDE(monster), 4,
- monster->pos(), monster->foe));
+ mgen_data(MONS_BEAST, SAME_ATTITUDE(monster),
+ 4, monster->pos(), monster->foe));
return;
case SPELL_SUMMON_ICE_BEAST:
create_monster(
- mgen_data(MONS_ICE_BEAST, SAME_ATTITUDE(monster), 5,
- monster->pos(), monster->foe));
+ mgen_data(MONS_ICE_BEAST, SAME_ATTITUDE(monster),
+ 5, monster->pos(), monster->foe));
return;
case SPELL_SUMMON_MUSHROOMS: // Summon swarms of icky crawling fungi.
@@ -366,9 +365,9 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
const int n = 2 + random2(monster->hit_dice / 4);
for (int i = 0; i < n; ++i)
{
- create_monster(mgen_data(MONS_BALL_LIGHTNING,
- SAME_ATTITUDE(monster), 2,
- monster->pos(), monster->foe));
+ create_monster(
+ mgen_data(MONS_BALL_LIGHTNING, SAME_ATTITUDE(monster),
+ 2, monster->pos(), monster->foe));
}
return;
}
@@ -397,8 +396,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
{
create_monster(
mgen_data(summon_any_demon(DEMON_GREATER),
- SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
return;
@@ -431,8 +430,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast,
for (int i = 0, size = monsters.size(); i < size; ++i)
{
create_monster(
- mgen_data(monsters[i], SAME_ATTITUDE(monster), duration,
- monster->pos(), monster->foe));
+ mgen_data(monsters[i], SAME_ATTITUDE(monster),
+ duration, monster->pos(), monster->foe));
}
}
return;
@@ -2746,7 +2745,7 @@ std::string summoned_poof_msg(const monsters* monster, bool plural)
std::string msg = "disappear%s in a puff of smoke";
bool no_chaos = false;
- switch(summon_type)
+ switch (summon_type)
{
case SPELL_SHADOW_CREATURES:
msg = "dissolve%s into shadows";
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index af954c7f37..41015c8eda 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4709,7 +4709,7 @@ static bool _lugonu_retribution()
bool success = false;
int how_many = 1 + (you.experience_level / 7);
- for (int loopy = 0; loopy < how_many; loopy++)
+ for (int loopy = 0; loopy < how_many; ++loopy)
{
if (create_monster(
mgen_data::hostile_at(
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index e5b2125ef1..e642ff08d7 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -1446,9 +1446,11 @@ bool cast_summon_elemental(int pow, god_type god,
&& random2(100) >= unfriendly);
if (create_monster(
- mgen_data(mon, friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- dur, targ, friendly ? you.pet_target : MHITYOU, 0, god))
- == -1)
+ mgen_data(mon,
+ friendly ? BEH_FRIENDLY : BEH_HOSTILE,
+ dur, targ,
+ friendly ? you.pet_target : MHITYOU,
+ 0, god)) == -1)
{
canned_msg(MSG_NOTHING_HAPPENS);
return (false);
@@ -1469,8 +1471,8 @@ bool cast_summon_ice_beast(int pow, god_type god)
const int dur = std::min(2 + (random2(pow) / 4), 6);
if (create_monster(
- mgen_data(mon, BEH_FRIENDLY, dur, you.pos(),
- you.pet_target,
+ mgen_data(mon, BEH_FRIENDLY, dur,
+ you.pos(), you.pet_target,
0, god)) != -1)
{
mpr("A chill wind blows around you.");
@@ -1709,7 +1711,8 @@ bool cast_tukimas_dance(int pow, god_type god,
create_monster(
mgen_data(MONS_DANCING_WEAPON,
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- dur, SPELL_TUKIMAS_DANCE, you.pos(),
+ dur, SPELL_TUKIMAS_DANCE,
+ you.pos(),
friendly ? you.pet_target : MHITYOU,
0, god));
@@ -1785,7 +1788,8 @@ bool cast_conjure_ball_lightning(int pow, god_type god)
int monster =
mons_place(
- mgen_data(MONS_BALL_LIGHTNING, BEH_FRIENDLY, 0,
+ mgen_data(MONS_BALL_LIGHTNING, BEH_FRIENDLY,
+ 0, SPELL_CONJURE_BALL_LIGHTNING,
target, MHITNOT, 0, god));
if (monster != -1)
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 552fa11bd4..104cacd6b6 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -546,7 +546,8 @@ bool cast_shadow_creatures(god_type god)
const int monster =
create_monster(
- mgen_data(RANDOM_MONSTER, BEH_FRIENDLY, 2, SPELL_SHADOW_CREATURES,
+ mgen_data(RANDOM_MONSTER, BEH_FRIENDLY,
+ 2, SPELL_SHADOW_CREATURES,
you.pos(), you.pet_target,
MG_FORCE_BEH, god), false);
@@ -810,8 +811,8 @@ static bool _raise_remains(const coord_def &a, int corps, beh_type beha,
}
const int monster = create_monster(
- mgen_data(mon, beha, 0,
- a, hitting,
+ mgen_data(mon, beha,
+ 0, a, hitting,
0, god,
zombie_type, number));
if (mon_index != NULL)
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 50eec92430..8db3f9cf48 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -821,8 +821,10 @@ static bool _xom_is_good(int sever, int tension)
summons[i] =
create_monster(
- mgen_data(monster, BEH_FRIENDLY, 3, MON_SUMM_AID,
- you.pos(), you.pet_target, MG_FORCE_BEH, GOD_XOM));
+ mgen_data(monster, BEH_FRIENDLY,
+ 3, MON_SUMM_AID,
+ you.pos(), you.pet_target,
+ MG_FORCE_BEH, GOD_XOM));
if (summons[i] != -1)
success = true;
@@ -897,8 +899,10 @@ static bool _xom_is_good(int sever, int tension)
const int summons =
create_monster(
- mgen_data(mon, beha, 6, MON_SUMM_AID,
- you.pos(), hitting, MG_FORCE_BEH, GOD_XOM));
+ mgen_data(mon, beha,
+ 6, MON_SUMM_AID,
+ you.pos(), hitting,
+ MG_FORCE_BEH, GOD_XOM));
if (summons != -1)
{
@@ -1061,8 +1065,9 @@ static bool _xom_is_good(int sever, int tension)
const int summons =
create_monster(
- mgen_data(_xom_random_demon(sever, one_chance_in(8)), beha, 0,
- you.pos(), hitting, MG_FORCE_BEH, GOD_XOM));
+ mgen_data(_xom_random_demon(sever, one_chance_in(8)), beha,
+ 0, 0, you.pos(), hitting,
+ MG_FORCE_BEH, GOD_XOM));
if (summons != -1)
{