diff options
-rw-r--r-- | crawl-ref/source/effects.cc | 28 | ||||
-rw-r--r-- | crawl-ref/source/externs.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/mon-data.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 6 |
5 files changed, 46 insertions, 15 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 1f304faa06..7c2a4cb9f4 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -1506,14 +1506,26 @@ void yell(void) int mons_targd = MHITNOT; struct dist targ; - if (silenced(you.x_pos, you.y_pos)) + if (silenced(you.x_pos, you.y_pos) || you.cannot_speak()) { mpr("You are unable to make a sound!"); return; } + const std::string shout_verb = you.shout_verb(); + std::string cap_shout = shout_verb; + cap_shout[0] = toupper(cap_shout[0]); + + int noise_level = 12; + + // Tweak volume for different kinds of vocalisation. + if (shout_verb == "roar") + noise_level = 18; + else if (shout_verb == "hiss") + noise_level = 8; + mpr("What do you say?", MSGCH_PROMPT); - mpr(" ! - Yell"); + mprf(" ! - %s", cap_shout.c_str()); mpr(" a - Order allies to attack a monster"); if (!(you.prev_targ == MHITNOT || you.prev_targ == MHITYOU)) @@ -1527,21 +1539,17 @@ void yell(void) } } - strcpy(info, " Anything else - Stay silent"); - - if (one_chance_in(20)) - strcat(info, " (and be thought a fool)"); - - mpr(info); + mprf(" Anything else - Stay silent%s", + one_chance_in(20)? " (and be thought a fool)" : ""); unsigned char keyn = get_ch(); switch (keyn) { case '!': - mpr("You yell for attention!", MSGCH_SOUND); + mprf(MSGCH_SOUND, "You %s for attention!", shout_verb.c_str()); you.turn_is_over = true; - noisy( 12, you.x_pos, you.y_pos ); + noisy( noise_level, you.x_pos, you.y_pos ); return; case 'a': diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index 048782eca5..a80061df10 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -700,10 +700,12 @@ public: bool in_water() const; bool can_swim() const; bool is_levitating() const; + bool cannot_speak() const; bool has_spell(int spell) const; size_type transform_size(int psize = PSIZE_TORSO) const; + std::string shout_verb() const; item_def *slot_item(equipment_type eq); diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index f36d118044..714d38abf0 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -890,7 +890,7 @@ 800, 10, MONS_WOLF_SPIDER, MONS_WOLF_SPIDER, MH_NATURAL, -3, { {AT_BITE, AF_POISON_MEDIUM, 20}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 8, 3, 5, 0 }, - 3, 10, 15, 7, MST_NO_SPELLS, CE_POISONOUS, Z_BIG, S_SILENT, I_INSECT, + 3, 10, 15, 7, MST_NO_SPELLS, CE_POISONOUS, Z_BIG, S_HISS, I_INSECT, MONUSE_NOTHING, SIZE_TINY } , diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 2b38d25339..cb44baa336 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4610,6 +4610,29 @@ size_type player::body_size(int psize, bool base) const return (ret); } +bool player::cannot_speak() const +{ + if (silenced(x_pos, y_pos)) + return (true); + + // No transform that prevents the player from speaking yet. + return (false); +} + +std::string player::shout_verb() const +{ + const int transform = attribute[ATTR_TRANSFORMATION]; + switch (transform) + { + case TRAN_DRAGON: + return "roar"; + case TRAN_SPIDER: + return "hiss"; + default: + return "yell"; + } +} + int player::damage_type(int) { const int wpn = equip[ EQ_WEAPON ]; diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 91eebad12c..0314200c80 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1055,10 +1055,8 @@ static int ignite_poison_monsters(int x, int y, int pow, int garbage) damage = mons_adjust_flavoured( mon, beam, damage ); #if DEBUG_DIAGNOSTICS - snprintf( info, INFO_SIZE, "Dice: %dd%d; Damage: %d", - dam_dice.num, dam_dice.size, damage ); - - mpr( info, MSGCH_DIAGNOSTICS ); + mprf(MSGCH_DIAGNOSTICS, "Dice: %dd%d; Damage: %d", + dam_dice.num, dam_dice.size, damage ); #endif if (!player_hurt_monster( mon_index, damage )) |