diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-02 16:30:26 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-02 16:30:26 +0000 |
commit | 3a448771f4f2b3a9b0f85869983a1482b7444e6d (patch) | |
tree | 0897d3ed8a98481eb9aba02b1ab3ce4d6c802e95 | |
parent | a8f9c9ba637b6fbf54528548d94a0b5aa02520ce (diff) | |
download | crawl-ref-3a448771f4f2b3a9b0f85869983a1482b7444e6d.tar.gz crawl-ref-3a448771f4f2b3a9b0f85869983a1482b7444e6d.zip |
Merge trunk into 0.2 branch for 0.2.1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.2@1192 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/CREDITS | 1 | ||||
-rw-r--r-- | crawl-ref/docs/changes.stone_soup | 15 | ||||
-rw-r--r-- | crawl-ref/source/AppHdr.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/describe.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/dungeon.cc | 25 | ||||
-rw-r--r-- | crawl-ref/source/enum.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/insult.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/insult.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/macro.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/message.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/mon-data.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/mon-util.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/monspeak.cc | 172 | ||||
-rw-r--r-- | crawl-ref/source/monspeak.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.cc | 23 | ||||
-rw-r--r-- | crawl-ref/source/monstuff.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/religion.cc | 7 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/spells2.h | 3 | ||||
-rw-r--r-- | crawl-ref/source/spells4.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/tags.cc | 5 | ||||
-rw-r--r-- | crawl-ref/source/util/levcomp.lpp | 2 |
25 files changed, 264 insertions, 100 deletions
diff --git a/crawl-ref/CREDITS b/crawl-ref/CREDITS index b7238a9081..4be4310bf0 100644 --- a/crawl-ref/CREDITS +++ b/crawl-ref/CREDITS @@ -34,6 +34,7 @@ Mitsuhiro Itakura Jarmo Kielosto Ryan Kusnery Jukka Kuusisto +Jordan Lewis Icy Lich Arien Malec Shawn M Moore diff --git a/crawl-ref/docs/changes.stone_soup b/crawl-ref/docs/changes.stone_soup index 9afae1ca12..ce4a7aa739 100644 --- a/crawl-ref/docs/changes.stone_soup +++ b/crawl-ref/docs/changes.stone_soup @@ -1,3 +1,18 @@ +Stone Soup 0.2.1 (20070402) +--------------------------- +* Fixed electric golems getting too much damage against shock-resistant + characters. +* Fixed vampiric draining targeting. +* Fixed monster dialogue grammar. +* Fixed EV penalty for nagas and centaurs. +* Fixed tutorial reporting corpse availability for corpses not in view. +* Fixed a possible buffer overflow when reading saves. +* Fixed sporadic crash when a poisoned monster with other enchantments dies + from poison. +* Fixed description for staff of wizardry. +* Reinstated old behaviour of -macro option for Crawl compiled with + -DDGAMELAUNCH (DGL_MACRO_ABSOLUTE_PATH). + Stone Soup 0.2 (20070401) ------------------------- * Save and bones files formats changed, incompatible with 0.1.x. diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index e7d4529dbb..511013e01d 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -225,6 +225,10 @@ // Record where players are currently. #define DGL_WHEREIS + + // Uses Options.macro_dir as the full path to the macro file. Mutually + // exclusive with DGL_NAMED_MACRO_FILE. + #define DGL_MACRO_ABSOLUTE_PATH #endif // ========================================================================= diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 890e3201cb..0140545dd3 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -207,11 +207,11 @@ static void randart_descpr( std::string &description, const item_def &item ) } if (proprt[ RAP_FIRE ] < -2) - description += "$It makes you highly vulnerable to fire. "; + description += "$It makes you extremely vulnerable to fire. "; else if (proprt[ RAP_FIRE ] == -2) - description += "$It makes you greatly susceptible to fire. "; + description += "$It makes you very vulnerable to fire. "; else if (proprt[ RAP_FIRE ] == -1) - description += "$It makes you susceptible to fire. "; + description += "$It makes you vulnerable to fire. "; else if (proprt[ RAP_FIRE ] == 1) description += "$It protects you from fire. "; else if (proprt[ RAP_FIRE ] == 2) @@ -220,11 +220,11 @@ static void randart_descpr( std::string &description, const item_def &item ) description += "$It renders you almost immune to fire. "; if (proprt[ RAP_COLD ] < -2) - description += "$It makes you highly susceptible to cold. "; + description += "$It makes you extremely vulnerable to cold. "; else if (proprt[ RAP_COLD ] == -2) - description += "$It makes you greatly susceptible to cold. "; + description += "$It makes you very vulnerable to cold. "; else if (proprt[ RAP_COLD ] == -1) - description += "$It makes you susceptible to cold. "; + description += "$It makes you vulnerable to cold. "; else if (proprt[ RAP_COLD ] == 1) description += "$It protects you from cold. "; else if (proprt[ RAP_COLD ] == 2) @@ -2861,8 +2861,8 @@ static std::string describe_staff( const item_def &item ) { case STAFF_WIZARDRY: description += - "increases the magical proficiency of its wielder by " - "a considerable degree, increasing the power of their spells. "; + "significantly increases the ability of its wielder to use " + "magical spells. "; break; case STAFF_POWER: diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 524ab8c86d..caaea6892d 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -6542,9 +6542,26 @@ static void many_pools(unsigned char pool_type) while (pools < no_pools); } // end many_pools() +static int exciting_colour() +{ + switch(random2(4)) + { + case 0: return YELLOW; + case 1: return LIGHTGREEN; + case 2: return LIGHTRED; + case 3: return LIGHTMAGENTA; + default: return MAGENTA; + } +} + + static int newwave_weapon_colour(const item_def &item) { int item_colour = BLACK; + // unrandom artefacts get predefined colours + if ( is_random_artefact(item) ) + return exciting_colour(); + if (is_range_weapon( item )) { switch (range_skill(item)) @@ -6553,7 +6570,7 @@ static int newwave_weapon_colour(const item_def &item) item_colour = BLUE; break; case SK_CROSSBOWS: - item_colour = RED; + item_colour = LIGHTBLUE; break; case SK_DARTS: item_colour = WHITE; @@ -6584,7 +6601,7 @@ static int newwave_weapon_colour(const item_def &item) item_colour = LIGHTGREY; break; case SK_POLEARMS: - item_colour = LIGHTGREEN; + item_colour = RED; break; case SK_STAVES: item_colour = GREEN; @@ -6655,10 +6672,10 @@ static int newwave_missile_colour(const item_def &item) item_colour = WHITE; break; case MI_BOLT: - item_colour = RED; + item_colour = LIGHTBLUE; break; case MI_DART: - item_colour = LIGHTRED; + item_colour = CYAN; break; default: // huh? diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 624732ff40..4223245ab6 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -3004,8 +3004,8 @@ enum size_type SIZE_LITTLE, // spriggan SIZE_SMALL, // halfling/kobold/gnome SIZE_MEDIUM, // human/elf/dwarf - SIZE_LARGE, // troll/ogre - SIZE_BIG, // centaur/naga/large quadrupeds + SIZE_LARGE, // troll/ogre/centaur/naga + SIZE_BIG, // large quadrupeds SIZE_GIANT, // giant SIZE_HUGE, // dragon NUM_SIZE_LEVELS, diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index a756d29d6a..05cd73127c 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2760,8 +2760,10 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) case AF_ELEC: special_damage = - resist_adjust_damage(defender->res_elec(), - atk->hit_dice + random2( 2 * atk->hit_dice )); + resist_adjust_damage( + defender->res_elec(), + atk->hit_dice + random2( atk->hit_dice / 2 )); + if (defender->levitates()) special_damage = special_damage * 2 / 3; @@ -2770,6 +2772,10 @@ void melee_attack::mons_apply_attack_flavour(const mon_attack_def &attk) attacker->name(DESC_CAP_THE).c_str(), attacker->conj_verb("shock").c_str(), defender->name(DESC_NOCAP_THE).c_str()); + +#ifdef DEBUG_DIAGNOSTICS + mprf(MSGCH_DIAGNOSTICS, "Shock damage: %d", special_damage); +#endif break; case AF_VAMPIRIC: diff --git a/crawl-ref/source/insult.cc b/crawl-ref/source/insult.cc index 4a6359110f..7b94c35a9d 100644 --- a/crawl-ref/source/insult.cc +++ b/crawl-ref/source/insult.cc @@ -38,7 +38,7 @@ void init_cap(char * str) str[0] = toupper( str[0] ); } -void imp_taunt( struct monsters *mons ) +void imp_taunt( const monsters *mons ) { char buff[80]; const char *mon_name = ptr_monam( mons, DESC_CAP_THE ); @@ -65,7 +65,7 @@ void imp_taunt( struct monsters *mons ) } } -void demon_taunt( struct monsters *mons ) +void demon_taunt( const monsters *mons ) { static const char * sound_list[] = { diff --git a/crawl-ref/source/insult.h b/crawl-ref/source/insult.h index 143d0ecae3..d29b66acb4 100644 --- a/crawl-ref/source/insult.h +++ b/crawl-ref/source/insult.h @@ -3,8 +3,8 @@ #include "externs.h" -void imp_taunt( struct monsters *mons ); -void demon_taunt( struct monsters *mons ); +void imp_taunt( const monsters *mons ); +void demon_taunt( const monsters *mons ); const char * generic_insult(void); const char * racial_insult(void); diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index 6a4783519f..2420971a40 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -175,11 +175,19 @@ static std::string get_macro_file() if (!dir.empty()) { +#ifndef DGL_MACRO_ABSOLUTE_PATH if (dir[dir.length() - 1] != FILE_SEPARATOR) dir += FILE_SEPARATOR; +#endif } - + +#if defined(DGL_MACRO_ABSOLUTE_PATH) + return (dir.empty()? "macro.txt" : dir); +#elif defined(DGL_NAMED_MACRO_FILE) + return (dir + strip_filename_unsafe_chars(you.your_name) + "-macro.txt"); +#else return (dir + "macro.txt"); +#endif } static void buf2keyseq(const char *buff, keyseq &k) diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index d1b1a45ff8..8872f7b226 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -572,6 +572,13 @@ void more(void) Message_Line >= get_message_window_height() - 1 ); } // end more() +static bool is_channel_dumpworthy(int channel) +{ + return (channel != MSGCH_EQUIPMENT + && channel != MSGCH_DIAGNOSTICS + && channel != MSGCH_TUTORIAL); +} + std::string get_last_messages(int mcount) { if (mcount <= 0) return std::string(); @@ -586,9 +593,11 @@ std::string get_last_messages(int mcount) int count = 0; for (int i = initial; i != Next_Message; ) { - if (Store_Message[i].text.length()) + const message_item &msg = Store_Message[i]; + + if (msg.text.length() && is_channel_dumpworthy(msg.channel)) { - text += Store_Message[i].text; + text += msg.text; text += EOL; count++; } diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index 31214f6f44..ab8fdbfc3e 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -3833,7 +3833,7 @@ M_SPELLCASTER | M_SEE_INVIS, MR_RES_ELEC | MR_RES_POISON | MR_RES_FIRE | MR_RES_COLD, 0, 10, MONS_CLAY_GOLEM, MONS_ELECTRIC_GOLEM, MH_NONLIVING, -8, - { {AT_HIT, AF_ELEC, 12}, {AT_HIT, AF_ELEC, 12}, {AT_HIT, AF_ELEC, 12}, {AT_HIT, AF_PLAIN, 12} }, + { {AT_HIT, AF_ELEC, 15}, {AT_HIT, AF_ELEC, 15}, {AT_HIT, AF_PLAIN, 15}, {AT_HIT, AF_PLAIN, 15} }, { 15, 7, 4, 0 }, 5, 20, 20, 7, MST_ELECTRIC_GOLEM, CE_NOCORPSE, Z_NOZOMBIE, S_SILENT, I_PLANT, MONUSE_OPEN_DOORS, SIZE_LARGE @@ -4393,7 +4393,7 @@ { MONS_MURRAY, 'z', LIGHTRED, "Murray", - M_SPELLCASTER | M_SEE_INVIS | M_EVIL | M_UNIQUE, + M_SPELLCASTER | M_SEE_INVIS | M_EVIL | M_SPEAKS | M_UNIQUE, MR_RES_ELEC | MR_RES_POISON | MR_RES_HELLFIRE | MR_RES_COLD, 0, 50, MONS_LICH, MONS_CURSE_SKULL, MH_UNDEAD, MAG_IMMUNE, { {AT_BITE, AF_PLAIN, 20}, {AT_BITE, AF_PLAIN, 20}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 56d3ccbaae..bb5e894e17 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3573,6 +3573,10 @@ void monsters::apply_enchantments(int spd) { mon_enchant_list::iterator cur = i++; apply_enchantment(*cur, spd); + + // If the monster died, the iterator will be invalid! + if (!alive()) + break; } } diff --git a/crawl-ref/source/monspeak.cc b/crawl-ref/source/monspeak.cc index 6ba349d4b0..e473939cea 100644 --- a/crawl-ref/source/monspeak.cc +++ b/crawl-ref/source/monspeak.cc @@ -38,11 +38,117 @@ #include "stuff.h" #include "view.h" +struct mon_dialogue +{ + monster_type speaker; + const char **silenced; + const char **confused; + const char **confused_friend; + const char **fleeing; + const char **fleeing_friend; + const char **friendly; + const char **hostile; // Most common. +}; + +static const char *murray_silenced[] = +{ + "%s rolls in a circle.", + "%s rolls around.", + "%s spins like a top.", + "%s grins evilly.", + "%s seems to say something.", + "%s says something you can't hear. It was probably not a compliment.", + NULL +}; + +static const char *murray_hostile[] = +{ + "%s rolls in a circle.", + "%s rolls around.", + "%s spins like a top.", + "%s grins evilly.", + "%s laughs evilly.", + "%s cackles, \"I will rule the world!\"", + "%s shouts, \"Give me your head, so I can impale it on a pike!\"", + "%s's teeth chatter loudly.", + "%s yells, \"I'm a mighty demonic power!\"", + "%s asks, \"How could you choose the Orb over me, your best friend?\"", + "%s shouts, \"Let the forces of evil and voodoo overcome you!\"", + "%s screams, \"If I had legs, you would be dead twenty times over!\"", + "%s yells, \"My visage is famous all over the dungeon!\"", + "%s says, \"You're the second biggest fool I've ever met!\"", + NULL +}; + +static mon_dialogue vox_populi[] = +{ + { MONS_MURRAY, murray_silenced, NULL, NULL, NULL, NULL, NULL, + murray_hostile }, +}; + +static const mon_dialogue *find_dialogue(const monsters *monster) +{ + for (unsigned i = 0; i < sizeof(vox_populi) / sizeof(*vox_populi); ++i) + if (vox_populi[i].speaker == monster->type) + return (&vox_populi[i]); + return (NULL); +} + +static bool say_dialogue(const monsters *monster, + const char **dialogue) +{ + if (!dialogue) + return (false); + + int nitems = 0; + for (const char **run = dialogue; *run; ++run, ++nitems) + ; + + const char *chosen = nitems? dialogue[random2(nitems)] : NULL; + + if (chosen && *chosen) + { + mprf(MSGCH_TALK, chosen, monster->name(DESC_CAP_THE).c_str()); + return (true); + } + + return (false); +} + +static bool say_specific_dialogue(const monsters *monster, + const mon_dialogue *dialogue) +{ + if (silenced(monster->x, monster->y)) + return (say_dialogue(monster, dialogue->silenced)); + + if (monster->has_ench(ENCH_CHARM)) + return (false); + + const bool friendly = (monster->attitude == ATT_FRIENDLY); + + if (mons_is_confused(monster)) + return (say_dialogue( + monster, + friendly? dialogue->confused_friend + : dialogue->confused)); + + if (monster->behaviour == BEH_FLEE) + return (say_dialogue( + monster, + friendly? dialogue->fleeing_friend + : dialogue->fleeing)); + + if (monster->attitude == ATT_FRIENDLY) + return (say_dialogue(monster, dialogue->friendly)); + + return (say_dialogue(monster, dialogue->hostile)); +} + // returns true if something is said -bool mons_speaks(struct monsters *monster) +bool mons_speaks(const monsters *monster) { int temp_rand; // probability determination - + // This function is a little bit of a problem for the message channels // since some of the messages it generates are "fake" warning to // scare the player. In order to accomidate this intent, we're @@ -57,6 +163,10 @@ bool mons_speaks(struct monsters *monster) return false; // invisible monster tries to remain unnoticed + const mon_dialogue *dialogue = find_dialogue(monster); + if (dialogue) + return (say_specific_dialogue(monster, dialogue)); + //mv: if it's also invisible, program never gets here if (silenced(monster->x, monster->y)) { @@ -82,7 +192,7 @@ bool mons_speaks(struct monsters *monster) (temp_rand == 4) ? " looks around." : (temp_rand == 5) ? " appears indecisive." : (temp_rand == 6) ? " ponders the situation." - : " seems to says something."); + : " seems to say something."); } // disregard charmed critters.. they're not too expressive else if (monster->attitude == ATT_FRIENDLY) @@ -182,7 +292,7 @@ bool mons_speaks(struct monsters *monster) case 17: strcat(info, " says, \""); strcat(info, you.your_name); - strcat(info, ", I'm little bit confused.\""); + strcat(info, ", I'm a little confused.\""); break; } } @@ -191,7 +301,7 @@ bool mons_speaks(struct monsters *monster) switch (random2(23)) // speaks for unfriendly confused monsters { case 0: - strcat(info, " yells, \"Get them off of me!\""); + strcat(info, " yells, \"Get them off me!\""); break; case 1: strcat(info, " screams, \"I will kill you anyway!\""); @@ -229,7 +339,7 @@ bool mons_speaks(struct monsters *monster) strcat(info, " mumbles something."); break; case 14: - strcat(info, " says, \"I'm little bit confused.\""); + strcat(info, " says, \"I'm a little confused.\""); break; case 15: strcat(info, " asks, \"Where am I?\""); @@ -250,7 +360,7 @@ bool mons_speaks(struct monsters *monster) strcat(info, " says, \"Why is everything spinning?\""); break; case 21: - strcat(info, " screams, \"NO! I can't bear up that noise!\""); + strcat(info, " screams, \"NO! I can't bear that much noise!\""); break; case 22: strcat(info, " is trying to cover his eyes."); @@ -565,7 +675,7 @@ bool mons_speaks(struct monsters *monster) strcat(info, " says, \"It's nothing personal...\""); break; case 14: - strcat(info, " says, \"A dead adventurer is good adventurer.\""); + strcat(info, " says, \"A dead adventurer is a good adventurer.\""); break; case 15: strcat(info, " says, \"Coming here was your last mistake.\""); @@ -590,7 +700,7 @@ bool mons_speaks(struct monsters *monster) break; case 3: strcat(info, - " says, \"It's nothing personal but I have kill you.\""); + " says, \"It's nothing personal, but I have to kill you.\""); break; case 5: strcat(info, " says, \"You will never get the Orb, sorry.\""); @@ -745,12 +855,12 @@ bool mons_speaks(struct monsters *monster) mpr(info, MSGCH_MONSTER_SPELL); strcpy(info, m_name); - strcat(info, "'s fingertips starts to glow."); + strcat(info, "'s fingertips start to glow."); msg_type = MSGCH_MONSTER_ENCHANT; break; case 16: - strcat(info, "'s eyes starts to glow."); + strcat(info, "'s eyes start to glow."); msg_type = MSGCH_MONSTER_SPELL; break; @@ -795,7 +905,7 @@ bool mons_speaks(struct monsters *monster) break; case 7: strcat(info, - " shouts, \"You're disturbing me. I'll have kill you.\""); + " shouts, \"You're disturbing me. I'll have to kill you.\""); break; case 8: strcat(info, " screams, \"You are a ghastly nuisance!\""); @@ -838,12 +948,12 @@ bool mons_speaks(struct monsters *monster) simple_monster_message( monster, " casts a spell.", MSGCH_MONSTER_SPELL ); - strcat(info, "'s eyes starts to glow with a red light. "); + strcat(info, "'s eyes start to glow with a red light. "); msg_type = MSGCH_MONSTER_ENCHANT; break; case 10: - strcat(info, " says, \"Look in to my eyes.\""); + strcat(info, " says, \"Look into my eyes.\""); break; case 11: strcat(info, " says, \"I'm your fate.\""); @@ -980,7 +1090,7 @@ bool mons_speaks(struct monsters *monster) break; case 11: strcat(info, - " says, \"I know thousand and one way to kill you.\""); + " says, \"I know a thousand and one ways to kill you.\""); break; case 12: strcat(info, @@ -1140,10 +1250,10 @@ bool mons_speaks(struct monsters *monster) " cries, \"You want to steal my orb collection?!\""); break; case 13: - strcat(info, " sings some strange song."); + strcat(info, " sings a strange song."); break; case 14: - strcat(info, " bursts in tears."); + strcat(info, " bursts into tears."); break; case 15: strcat(info, " sucks her thumb."); @@ -1361,7 +1471,7 @@ bool mons_speaks(struct monsters *monster) break; case 6: strcat(info, - " says, \"Only few hits and it's over.\"."); + " says, \"Only a few hits and it's over.\"."); break; case 7: strcat(info, " says, \"You know, I'm in a hurry.\""); @@ -1412,7 +1522,7 @@ bool mons_speaks(struct monsters *monster) strcat(info, " screams, \"Blood and destruction!\""); break; case 9: - strcat(info, " says, \"You know, it's honour to die by my hand.\""); + strcat(info, " says, \"You know, it's an honour to die by my hand.\""); break; case 10: strcat(info, " shouts, \"Your time has come!\""); @@ -1445,7 +1555,7 @@ bool mons_speaks(struct monsters *monster) break; case 4: strcat(info, - " says, \"You don't look worth for that money.\""); + " says, \"You don't look worth it for that money.\""); break; case 5: strcat(info, @@ -1508,7 +1618,7 @@ bool mons_speaks(struct monsters *monster) break; case 5: strcat(info, - " says, \"I need new robe. I'll buy it from your money.\""); + " says, \"I need a new robe. I'll buy it with your money.\""); break; case 6: strcat(info, @@ -1596,7 +1706,7 @@ bool mons_speaks(struct monsters *monster) simple_monster_message( monster, " casts a spell", MSGCH_MONSTER_SPELL ); - strcat(info, "'s hands started to glow with soft light."); + strcat(info, "'s hands start to glow with a soft light."); msg_type = MSGCH_MONSTER_ENCHANT; break; @@ -1618,7 +1728,7 @@ bool mons_speaks(struct monsters *monster) break; case 11: strcat(info, - " screams, \"Don't move! I want to cut your ear!\""); + " screams, \"Don't move! I want to cut off your ear!\""); break; case 12: strcat(info, @@ -1645,10 +1755,10 @@ bool mons_speaks(struct monsters *monster) strcat(info, " screams, \"Die, monster!\""); break; case 2: - strcat(info, " screams, \"Give me Holy Grail!\""); + strcat(info, " screams, \"Give me the Holy Grail!\""); break; case 3: - strcat(info, " screams, \"Red! No, blue!\""); + strcat(info, " screams, \"Red! No, blue!\""); break; case 4: strcat(info, " looks confused."); @@ -1657,7 +1767,7 @@ bool mons_speaks(struct monsters *monster) strcat(info, " looks excited."); break; case 6: - strcat(info, " shouts, \"I'm great and powerful hero!\""); + strcat(info, " shouts, \"I'm a great and powerful hero!\""); break; case 7: strcat(info, @@ -1790,14 +1900,14 @@ bool mons_speaks(struct monsters *monster) break; case 5: - strcat(info, "'s eyes starts to glow with a red light."); + strcat(info, "'s eyes start to glow with a red light."); break; case 6: strcat(info, - "'s eyes starts to glow with a green light."); + "'s eyes start to glow with a green light."); break; case 7: - strcat(info, "'s eyes starts to glow with a blue light."); + strcat(info, "'s eyes start to glow with a blue light."); break; case 8: strcat(info, " screams, \"All trespassers must die!\""); @@ -2232,13 +2342,13 @@ bool mons_speaks(struct monsters *monster) case 15: strcat(info, " casts a spell."); mpr(info, MSGCH_MONSTER_SPELL); - mpr("Suddenly you are surrounded with pale green light.", MSGCH_WARN); + mpr("Suddenly you are surrounded with a pale green light.", MSGCH_WARN); return (true); case 16: strcat(info, " casts a spell."); mpr(info, MSGCH_MONSTER_SPELL); - mpr("You have terrible head-ache.", MSGCH_WARN); + mpr("You have a terrible headache.", MSGCH_WARN); return (true); case 17: diff --git a/crawl-ref/source/monspeak.h b/crawl-ref/source/monspeak.h index 7a6559b04e..328ebd0a67 100644 --- a/crawl-ref/source/monspeak.h +++ b/crawl-ref/source/monspeak.h @@ -3,6 +3,6 @@ #include "externs.h" -bool mons_speaks(struct monsters *monster); +bool mons_speaks(const monsters *monster); #endif diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 4dffb17f14..d4e3e67354 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -326,8 +326,8 @@ static void place_monster_corpse(const monsters *monster) // Don't care if 'o' is changed, and it shouldn't be (corpses don't stack) move_item_to_grid( &o, monster->x, monster->y ); - if (you.hunger_state < HS_SATIATED) - learned_something_new(TUT_MAKE_CHUNKS); + if (you.hunger_state < HS_SATIATED && see_grid(monster->x, monster->y)) + learned_something_new(TUT_MAKE_CHUNKS); } // end place_monster_corpse() static void tutorial_inspect_kill() @@ -1111,12 +1111,12 @@ bool monster_polymorph( struct monsters *monster, int targetc, int power ) monster_drop_ething(monster); - // New monster type might be interesting - mark_interesting_monst(monster); + // New monster type might be interesting + mark_interesting_monst(monster); - // If new monster is visible to player, then we've seen it - if (player_monster_visible(monster) && mons_near(monster)) - seen_monster(monster); + // If new monster is visible to player, then we've seen it + if (player_monster_visible(monster) && mons_near(monster)) + seen_monster(monster); return (player_messaged); } // end monster_polymorph() @@ -1834,7 +1834,7 @@ std::string str_simple_monster_message(monsters *mons, const char *event) // distant or invisible to the player ... look elsewhere for a function // permitting output of "It" messages for the invisible {dlb} // Intentionally avoids info and str_pass now. -- bwr -bool simple_monster_message(struct monsters *monster, const char *event, +bool simple_monster_message(const monsters *monster, const char *event, int channel, int param) { char buff[INFO_SIZE]; @@ -3367,7 +3367,8 @@ static void handle_monster_move(int i, monsters *monster) mons_in_cloud( monster ); } - handle_enchantment( monster ); + if (handle_enchantment( monster )) + return; } // memory is decremented here for a reason -- we only want it @@ -3395,7 +3396,7 @@ static void handle_monster_move(int i, monsters *monster) while (monster->speed_increment >= 80) { // The continues & breaks are WRT this. - if (monster->type != -1 && monster->hit_points < 1) + if (!monster->alive()) break; monster->speed_increment -= 10; @@ -3425,7 +3426,7 @@ static void handle_monster_move(int i, monsters *monster) } if (handle_enchantment(monster)) - continue; + break; monster_regenerate(monster); diff --git a/crawl-ref/source/monstuff.h b/crawl-ref/source/monstuff.h index 9b70d4020a..e5ea8f2c45 100644 --- a/crawl-ref/source/monstuff.h +++ b/crawl-ref/source/monstuff.h @@ -87,7 +87,7 @@ bool random_near_space( int ox, int oy, int &tx, int &ty, * called from: beam - effects - fight - monstuff - mstuff2 - spells1 - * spells2 - spells4 * *********************************************************************** */ -bool simple_monster_message(struct monsters *monster, const char *event, +bool simple_monster_message(const monsters *monster, const char *event, int channel = MSGCH_PLAIN, int param = 0); std::string str_simple_monster_message(monsters *mons, const char *event); diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index dd6f5fff6d..22f3339a03 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -4736,11 +4736,11 @@ size_type player::body_size(int psize, bool base) const if (psize == PSIZE_TORSO || psize == PSIZE_PROFILE) ret = SIZE_MEDIUM; else - ret = SIZE_BIG; + ret = SIZE_LARGE; break; case SP_CENTAUR: - ret = (psize == PSIZE_TORSO) ? SIZE_MEDIUM : SIZE_BIG; + ret = (psize == PSIZE_TORSO) ? SIZE_MEDIUM : SIZE_LARGE; break; case SP_SPRIGGAN: @@ -5080,7 +5080,7 @@ int player::res_cold() const int player::res_elec() const { - return (player_res_electricity()); + return (player_res_electricity() * 2); } int player::res_poison() const diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index f0f2d59fd8..14909991a0 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -2595,6 +2595,13 @@ void god_pitch(unsigned char which_god) return; } + if (which_god == GOD_LUGONU && you.penance[GOD_LUGONU]) + { + simple_god_message(" is most displeased with you!", which_god); + lugonu_retribution(which_god); + return; + } + describe_god( which_god, false ); snprintf( info, INFO_SIZE, "Do you wish to %sjoin this religion?", diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index e0cb7d2120..6e38997f69 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -990,31 +990,14 @@ void drain_life(int pow) } } // end drain_life() -int vampiric_drain(int pow) +int vampiric_drain(int pow, const dist &vmove) { int inflicted = 0; int mgr = 0; struct monsters *monster = 0; // NULL - struct dist vmove; - - dirc: - mpr("Which direction?", MSGCH_PROMPT); - direction( vmove, DIR_DIR, TARG_ENEMY ); - - if (!vmove.isValid) - { - canned_msg(MSG_SPELL_FIZZLES); - return -1; - } mgr = mgrd[you.x_pos + vmove.dx][you.y_pos + vmove.dy]; - if (vmove.dx == 0 && vmove.dy == 0) - { - mpr("You can't do that."); - goto dirc; - } - if (mgr == NON_MONSTER) { mpr("There isn't anything there!"); diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h index 409aff5a25..d982c3e997 100644 --- a/crawl-ref/source/spells2.h +++ b/crawl-ref/source/spells2.h @@ -56,11 +56,12 @@ int corpse_rot(int power); int summon_elemental(int pow, int restricted_type, unsigned char unfriendly); +class dist; // last updated 24may2000 {dlb} /* *********************************************************************** * called from: spell * *********************************************************************** */ -int vampiric_drain(int pow); +int vampiric_drain(int pow, const dist &); // last updated 24may2000 {dlb} diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index fb8a0bace2..a57bdb0245 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1873,11 +1873,7 @@ bool backlight_monsters(int x, int y, int pow, int garbage) else if (lvl == 4) simple_monster_message( &menv[mon], " glows brighter for a moment." ); else - { - // remove old level - menv[mon].del_ench(ENCH_BACKLIGHT, true); simple_monster_message( &menv[mon], " glows brighter." ); - } // this enchantment wipes out invisibility (neat) menv[mon].del_ench(ENCH_INVIS); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 86d269dac8..eb39ad7953 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -880,6 +880,9 @@ int your_spells( int spc2, int powc, bool allow_fail ) testbits( flags, SPFLAG_GRID ) ? DIR_TARGET : testbits( flags, SPFLAG_DIR ) ? DIR_DIR : DIR_NONE); + if (dir == DIR_DIR) + mpr("Which direction? ", MSGCH_PROMPT); + if (spell_direction( spd, beam, dir, targ, get_spell_target_prompt(spc2) ) == -1) return (SPRET_ABORT); @@ -1315,7 +1318,7 @@ int your_spells( int spc2, int powc, bool allow_fail ) break; case SPELL_VAMPIRIC_DRAINING: - vampiric_drain(powc); + vampiric_drain(powc, spd); break; case SPELL_SUMMON_WRAITHS: diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index fbddb4c692..2aa534d48a 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -314,7 +314,6 @@ void marshallString(struct tagHeader &th, const char *data, int maxSize) // put in the actual string -- we'll null terminate on // unmarshall. memcpy(&tagBuffer[th.offset], data, len); - th.offset += len; } @@ -324,6 +323,7 @@ void unmarshallString(struct tagHeader &th, char *data, int maxSize) // get length short len = unmarshallShort(th); int copylen = len; + if (len >= maxSize && maxSize > 0) copylen = maxSize - 1; @@ -1137,8 +1137,7 @@ static void tag_read_you(struct tagHeader &th, char minorVersion) you.num_turns = unmarshallLong(th); you.magic_contamination = unmarshallShort(th); - unmarshallString( th, buff, 80 ); - you.last_altar_inscription = buff; + you.last_altar_inscription = unmarshallString(th, 80); } static void tag_read_you_items(struct tagHeader &th, char minorVersion) diff --git a/crawl-ref/source/util/levcomp.lpp b/crawl-ref/source/util/levcomp.lpp index 02ad9c2100..64d790017c 100644 --- a/crawl-ref/source/util/levcomp.lpp +++ b/crawl-ref/source/util/levcomp.lpp @@ -27,7 +27,7 @@ static void flush_free_queue(unsigned int max_allowed) static void add_to_queue(const char *s) { free_queue.push(s); - flush_free_queue(20); + flush_free_queue(100); } static void clean() |