From 5894f27848d3bf7ca770c06c207ee1fc627dc983 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 3 Apr 2007 12:54:05 +0000 Subject: Jellies now resist acid spit (adapted jlewis' patch). On Windows and DOS, prompt for a newline after printing an error message and exiting, since users on those systems seem to run executables by double-clicking on them, and cannot see error messages because the console disappears when the game exits. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1198 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 9 +++++++++ crawl-ref/source/enum.h | 22 ++++++++++++---------- crawl-ref/source/mon-data.h | 15 ++++++++------- crawl-ref/source/mon-util.cc | 8 +++++++- crawl-ref/source/mon-util.h | 2 +- crawl-ref/source/stuff.cc | 8 ++++++++ 6 files changed, 45 insertions(+), 19 deletions(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index c9c77dbb2a..21dd4beac5 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1572,6 +1572,15 @@ int mons_adjust_flavoured( struct monsters *monster, struct bolt &pbolt, } break; + case BEAM_ACID: + if (mons_res_acid(monster)) + { + if (doFlavouredEffects) + simple_monster_message(monster, " appears unharmed."); + + hurted = 0; + } + break; case BEAM_POISON: if (mons_res_poison(monster) > 0) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index fad67e73db..a3be6766bd 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1808,6 +1808,7 @@ enum mons_class_flags M_NO_EXP_GAIN = (1<<31) // worth 0 xp }; +// now saved in an unsigned long. enum mon_resist_flags { MR_NO_FLAGS = 0, @@ -1823,22 +1824,23 @@ enum mon_resist_flags MR_RES_HELLFIRE = (1<< 3), MR_RES_COLD = (1<< 4), MR_RES_ASPHYX = (1<< 5), + MR_RES_ACID = (1<< 6), // vulnerabilities - MR_VUL_ELEC = (1<< 6), - MR_VUL_POISON = (1<< 7), - MR_VUL_FIRE = (1<< 8), - MR_VUL_COLD = (1<< 9), + MR_VUL_ELEC = (1<< 7), + MR_VUL_POISON = (1<< 8), + MR_VUL_FIRE = (1<< 9), + MR_VUL_COLD = (1<<10), // melee armour resists/vulnerabilities // XXX: how to do combos (bludgeon/slice, bludgeon/pierce) - MR_RES_PIERCE = (1<<10), - MR_RES_SLICE = (1<<11), - MR_RES_BLUDGEON = (1<<12), + MR_RES_PIERCE = (1<<11), + MR_RES_SLICE = (1<<12), + MR_RES_BLUDGEON = (1<<13), - MR_VUL_PIERCE = (1<<13), - MR_VUL_SLICE = (1<<14), - MR_VUL_BLUDGEON = (1<<15) + MR_VUL_PIERCE = (1<<14), + MR_VUL_SLICE = (1<<15), + MR_VUL_BLUDGEON = (1<<16) }; enum targ_mode_type diff --git a/crawl-ref/source/mon-data.h b/crawl-ref/source/mon-data.h index ab8fdbfc3e..bf3d0b56a9 100644 --- a/crawl-ref/source/mon-data.h +++ b/crawl-ref/source/mon-data.h @@ -556,7 +556,7 @@ { MONS_JELLY, 'J', LIGHTRED, "jelly", M_SEE_INVIS | M_SPLITS | M_AMPHIBIOUS | M_ACID_SPLASH, - MR_RES_POISON | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_ASPHYX | MR_RES_ACID, 0, 13, MONS_JELLY, MONS_JELLY, MH_NATURAL, -3, { {AT_HIT, AF_ACID, 8}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 3, 5, 5, 0 }, @@ -2876,7 +2876,7 @@ { MONS_BROWN_OOZE, 'J', BROWN, "brown ooze", M_NO_SKELETON | M_SEE_INVIS | M_ACID_SPLASH, - MR_RES_POISON | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_ASPHYX | MR_RES_ACID, 0, 11, MONS_JELLY, MONS_BROWN_OOZE, MH_NATURAL, -7, { {AT_HIT, AF_ACID, 25}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 7, 3, 5, 0 }, @@ -2888,7 +2888,8 @@ { MONS_AZURE_JELLY, 'J', LIGHTBLUE, "azure jelly", M_NO_SKELETON | M_SEE_INVIS, - MR_RES_POISON | MR_RES_COLD | MR_VUL_FIRE | MR_RES_ELEC | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_COLD | MR_VUL_FIRE | MR_RES_ELEC | MR_RES_ASPHYX + | MR_RES_ACID, 0, 11, MONS_JELLY, MONS_AZURE_JELLY, MH_NATURAL, -4, { {AT_HIT, AF_COLD, 12}, {AT_HIT, AF_COLD, 12}, {AT_HIT, AF_PLAIN, 12}, {AT_HIT, AF_PLAIN, 12} }, { 15, 3, 5, 0 }, @@ -2900,7 +2901,7 @@ { MONS_DEATH_OOZE, 'J', DARKGREY, "death ooze", M_NO_SKELETON | M_SEE_INVIS | M_EVIL, - MR_RES_POISON | MR_RES_COLD | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_COLD | MR_RES_ASPHYX | MR_RES_ACID, 0, 13, MONS_JELLY, MONS_DEATH_OOZE, MH_UNDEAD, -8, { {AT_HIT, AF_ROT, 32}, {AT_HIT, AF_PLAIN, 32}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 11, 3, 3, 0 }, @@ -2912,7 +2913,7 @@ { MONS_ACID_BLOB, 'J', LIGHTGREEN, "acid blob", M_NO_SKELETON | M_SEE_INVIS | M_SPECIAL_ABILITY | M_ACID_SPLASH, - MR_RES_POISON | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_ASPHYX | MR_RES_ACID, 0, 12, MONS_JELLY, MONS_ACID_BLOB, MH_NATURAL, -7, { {AT_HIT, AF_ACID, 42}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 18, 3, 5, 0 }, @@ -2924,7 +2925,7 @@ { MONS_ROYAL_JELLY, 'J', YELLOW, "royal jelly", M_NO_SKELETON | M_SEE_INVIS | M_ACID_SPLASH, - MR_RES_POISON | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_ASPHYX | MR_RES_ACID, 0, 20, MONS_JELLY, MONS_ROYAL_JELLY, MH_NATURAL, -7, { {AT_HIT, AF_ACID, 50}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 21, 0, 0, 111 }, @@ -3393,7 +3394,7 @@ { MONS_OOZE, 'J', LIGHTGREY, "ooze", M_NO_SKELETON | M_SEE_INVIS, - MR_RES_POISON | MR_RES_ASPHYX, + MR_RES_POISON | MR_RES_ASPHYX | MR_RES_ACID, 0, 5, MONS_JELLY, MONS_OOZE, MH_NATURAL, -6, { {AT_HIT, AF_PLAIN, 5}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0}, {AT_NONE, AF_PLAIN, 0} }, { 3, 3, 5, 0 }, diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 3cc841f45c..95248327be 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -796,11 +796,17 @@ bool mons_res_asphyx( const monsters *mon ) || mons_resist(mon, MR_RES_ASPHYX)); } +int mons_res_acid( const monsters *mon ) +{ + const unsigned long f = get_mons_resists(mon); + return ((f & MR_RES_ACID) != 0); +} + int mons_res_poison( const monsters *mon ) { int mc = mon->type; - int u = 0, f = get_mons_resists(mon); + unsigned long u = 0, f = get_mons_resists(mon); if (f & MR_RES_POISON) u++; diff --git a/crawl-ref/source/mon-util.h b/crawl-ref/source/mon-util.h index f35f9cce2f..1317bf983a 100644 --- a/crawl-ref/source/mon-util.h +++ b/crawl-ref/source/mon-util.h @@ -271,7 +271,7 @@ int mons_res_fire( const monsters *mon ); * called from: beam - monstuff - spells4 * *********************************************************************** */ int mons_res_poison( const monsters *mon ); - +int mons_res_acid( const monsters *mon ); int mons_res_negative_energy( const monsters *mon ); bool mons_res_asphyx( const monsters *mon ); diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 31aa0de613..74c9250bdd 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -376,6 +376,14 @@ void end(int exit_code, bool print_error, const char *format, ...) error += "\n"; fprintf(stderr, "%s", error.c_str()); } + +#if defined(WIN32CONSOLE) || defined(DOS) + if (exit_code) + { + fprintf(stderr, "Hit Enter to continue...\n"); + getchar(); + } +#endif exit(exit_code); } -- cgit v1.2.3-54-g00ecf