From a7c16941b77fcdcc841c3edbcd0514c16ac4c2e5 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 18 Apr 2008 10:50:12 +0000 Subject: Fix tiles compile (in a hacky way, since I don't know what the mp/hp bar change was really about). Modify mutations screen for Vampires to allow a toggle to a second page that lists all those resistances and stuff depending on their blood level. The screen (designed by David) is really neat, but the underlying could stand to be improved, and it might be too large, as well. Also restrict Sublimation of Blood to Vampires that are at least Full, and it also makes them a bit more thirsty (since they presumably lose blood when using it). Dispel Undead only does half damage to Vampires at Alive, and 66% damage at Full or Very Full. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4325 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 14 ++++- crawl-ref/source/command.cc | 2 + crawl-ref/source/food.cc | 3 ++ crawl-ref/source/mutation.cc | 119 ++++++++++++++++++++++++++++++++++++++++++- crawl-ref/source/output.cc | 4 +- crawl-ref/source/player.cc | 4 +- crawl-ref/source/skills2.cc | 2 +- crawl-ref/source/spells3.cc | 13 ++++- 8 files changed, 152 insertions(+), 9 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 6e73df519e..f8bf3d3df4 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -205,8 +205,8 @@ static void _ench_animation( int flavour, const monsters *mon, bool force ) (flavour == BEAM_DISPEL_UNDEAD) ? EC_HOLY : (flavour == BEAM_POLYMORPH) ? EC_MUTAGENIC : (flavour == BEAM_TELEPORT - || flavour == BEAM_BANISH - || flavour == BEAM_BLINK) ? EC_WARP + || flavour == BEAM_BANISH + || flavour == BEAM_BLINK) ? EC_WARP : EC_ENCHANT; zap_animation( element_colour( elem ), mon, force ); } @@ -3453,6 +3453,16 @@ static int _affect_player( bolt &beam ) if (beam.aux_source.empty()) beam.aux_source = "by dispel undead"; + if (you.species == SP_VAMPIRE) + { + if (you.hunger_state == HS_ENGORGED) + beam.damage.size /= 2; + else if (you.hunger_state > HS_SATIATED) + { + beam.damage.size *= 2; + beam.damage.size /= 3; + } + } _beam_ouch( roll_dice( beam.damage ), beam ); beam.obvious_effect = true; break; diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 0c3e90c297..ea7739cf4e 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1309,8 +1309,10 @@ std::string help_highlighter::get_species_key() const std::string result = species_name(you.species, you.experience_level); if (player_genus(GENPC_DRACONIAN)) + { strip_tag(result, species_name(you.species, you.experience_level, true)); + } result += " "; return (result); diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 4e0efe99ab..a8ed16a0a1 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -78,6 +78,9 @@ void make_hungry( int hunger_amount, bool suppress_msg ) if (you.is_undead == US_UNDEAD) return; + if (hunger_amount == 0) + return; + #if DEBUG_DIAGNOSTICS set_redraw_status( REDRAW_HUNGER ); #endif diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index ded5f3f8d7..d54883ac1f 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1388,17 +1388,132 @@ formatted_string describe_mutations() if (!have_any) result += "You are rather mundane." EOL; + if (you.species == SP_VAMPIRE) + { + result += EOL EOL; + result += EOL EOL; + result += "Press '!' to toggle between mutations and properties depending on your" EOL + "hunger status." EOL; + } + return formatted_string::parse_string(result); } +static void _display_vampire_attributes() +{ + clrscr(); + cgotoxy(1,1); + + std::string result; + + std::string column[9][7] = + { + {" ", "Alive ", "Full ", + "Satiated ", "Thirsty ", "Near... ", + "Bloodless"}, + //Alive Full Satiated Thirsty Near... Bloodless + {"Metabolism ", "very fast ", "fast ", "fast ", "normal ", "slow ", "none"}, + + {"Regeneration ", "very fast ", "fast ", "normal ", "normal ", "slow ", "none"}, + + {"Poison resistance ", " ", " ", " + ", " + ", " + ", " + "}, + + {"Cold resistance ", " ", " ", " ", " + ", " + ", " ++ "}, + + {"Negative resistance ", " ", " ", " ", " + ", " ++ ", " +++ "}, + + {"Torment resistance ", " ", " ", " ", " ", " ", " + "}, + + {"Mutation effects ", "full ", "capped ", "capped ", "none ", "none ", "none "}, + + {"Stealth boost ", "none ", "none ", "none ", "minor ", "major ", "large"} + }; + + int current = 0; + switch (you.hunger_state) + { + case HS_ENGORGED: + current = 1; + break; + case HS_VERY_FULL: + case HS_FULL: + current = 2; + break; + case HS_SATIATED: + current = 3; + break; + case HS_HUNGRY: + case HS_VERY_HUNGRY: + current = 4; + break; + case HS_NEAR_STARVING: + current = 5; + break; + case HS_STARVING: + current = 6; + } + + for (int y = 0; y < 9; y++) // lines (properties) + { + for (int x = 0; x < 7; x++) // columns (hunger states) + { + if (y > 0 && x == current) + result += ""; + result += column[y][x]; + if (y > 0 && x == current) + result += ""; + } + result += EOL; + } +/* + result = " Alive Full Satiated " + "Thirsty Near... Bloodless" EOL + "Metabolism very fast fast fast normal slow none " EOL + "Regeneration very fast fast normal normal slow none " EOL + "Poison resistance + + + + " EOL + "Cold resistance + + ++ " EOL + "Negative resistance + ++ +++ " EOL + "Torment resistance + " EOL + "Mutation effects full capped capped none none none " EOL + "Stealth boost none none none minor major large" EOL; +*/ + + result += EOL EOL; + result += EOL EOL; + result += EOL EOL; + result += "Press '!' to toggle between mutations and properties depending on your " EOL + "hunger status." EOL; + + const formatted_string vp_props = formatted_string::parse_string(result); + vp_props.display(); + + if (you.species == SP_VAMPIRE) + { + const int keyin = getch(); + if (keyin == '!') + display_mutations(); + } +} + void display_mutations() { clrscr(); cgotoxy(1,1); const formatted_string mutation_fs = describe_mutations(); - Menu mutation_menu(mutation_fs); - mutation_menu.show(); + + if (you.species == SP_VAMPIRE) + { + mutation_fs.display(); + const int keyin = getch(); + if (keyin == '!') + _display_vampire_attributes(); + } + else + { + Menu mutation_menu(mutation_fs); + mutation_menu.show(); + } } static int calc_mutation_amusement_value(mutation_type which_mutation) diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc index 0eebbcb79a..4979ad8d98 100644 --- a/crawl-ref/source/output.cc +++ b/crawl-ref/source/output.cc @@ -112,7 +112,7 @@ class colour_bar if (cx < disp) textcolor(BLACK + m_default * 16); - else if (old_val > val && old_disp > disp && cx < old_disp) + else if (/*old_val > val &&*/ old_disp > disp && cx < old_disp) textcolor(BLACK + m_change_neg * 16); putch(' '); #else @@ -566,7 +566,7 @@ struct status_light // conf. touch, bargain, sage // confused, beheld, fire, poison, disease, rot, held, glow, // swift, fast, slow, breath -// +// // Note the usage of bad_ench_colour() correspond to levels that // can be found in player.cc, ie those that the player can tell by // using the '@' command. Things like confusion and sticky flame diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index c06ff1a2d9..35aae6c6e9 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3514,10 +3514,12 @@ int check_stealth(void) if (you.hunger_state <= HS_STARVING) stealth += (you.skills[SK_STEALTH] * 21); else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT - || you.hunger_state <= HS_HUNGRY) + || you.hunger_state <= HS_NEAR_STARVING) { stealth += (you.skills[SK_STEALTH] * 20); } + else if (you.hunger_state <= HS_HUNGRY) + stealth += (you.skills[SK_STEALTH] * 19); else stealth += (you.skills[SK_STEALTH] * 18); break; diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc index 550164c3ee..8174e8359d 100644 --- a/crawl-ref/source/skills2.cc +++ b/crawl-ref/source/skills2.cc @@ -1836,7 +1836,7 @@ static void _display_skill_table(bool show_aptitudes) "skills by performing the corresponding actions. The number next to the" EOL "skill is your current level, the higher the better. The blue percent " EOL "value shows your progress towards the next skill level. You can toggle" EOL - "which skills to train by pressing their slot letters. A greyish skill " EOL + "which skills to train by pressing their slot letters. A greyish skill " EOL "will increase at a decidedly slower rate and ease training of others. ", false).display(); } diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 0adb191068..90a6bc6ca3 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -366,6 +366,11 @@ void sublimation(int power) mpr( "A conflicting enchantment prevents the spell from " "coming into effect." ); } + else if (you.species == SP_VAMPIRE && you.hunger_state < HS_FULL) + { + mpr("You don't have enough blood to draw power from your " + "own body."); + } else if (!enough_hp( 2, true )) { mpr("Your attempt to draw power from your own body fails."); @@ -374,11 +379,16 @@ void sublimation(int power) { mpr("You draw magical energy from your own body!"); - while (you.magic_points < you.max_magic_points && you.hp > 1) + int food = 0; // for Vampires + while (you.magic_points < you.max_magic_points && you.hp > 1 + && (you.species != SP_VAMPIRE || you.hunger - food >= 7000)) { inc_mp(1, false); dec_hp(1, false); + if (you.species == SP_VAMPIRE) + food += 15; + for (loopy = 0; loopy < (you.hp > 1 ? 3 : 0); loopy++) { if (random2(power) < 6) @@ -388,6 +398,7 @@ void sublimation(int power) if (random2(power) < 6) break; } + make_hungry(food, false); } } -- cgit v1.2.3-54-g00ecf