summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/acr.cc16
-rw-r--r--crawl-ref/source/chardump.cc5
-rw-r--r--crawl-ref/source/fight.cc189
-rw-r--r--crawl-ref/source/food.cc32
-rw-r--r--crawl-ref/source/it_use2.cc4
-rw-r--r--crawl-ref/source/newgame.cc2
-rw-r--r--crawl-ref/source/output.cc5
-rw-r--r--crawl-ref/source/player.cc7
8 files changed, 142 insertions, 118 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 95cd492391..93bfc5ef4e 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -1242,7 +1242,7 @@ void process_command( command_type cmd )
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
- break;
+ break;
}
if (Options.tutorial_left)
Options.tut_throw_counter++;
@@ -1253,7 +1253,7 @@ void process_command( command_type cmd )
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
- break;
+ break;
}
if (Options.tutorial_left)
Options.tut_throw_counter++;
@@ -1277,7 +1277,7 @@ void process_command( command_type cmd )
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
- break;
+ break;
}
remove_ring();
break;
@@ -1286,7 +1286,7 @@ void process_command( command_type cmd )
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
- break;
+ break;
}
puton_ring(-1, false);
break;
@@ -1375,7 +1375,7 @@ void process_command( command_type cmd )
if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
canned_msg(MSG_PRESENT_FORM);
- break;
+ break;
}
/* randart wpns */
if (scan_randarts(RAP_PREVENT_SPELLCASTING))
@@ -1766,9 +1766,9 @@ static void decrement_durations()
}
// Vampire bat transformations are permanent (until ended.)
- if ( you.species != SP_VAMPIRE ||
- you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT ||
- you.duration[DUR_TRANSFORMATION] < 100 )
+ if ((you.species != SP_VAMPIRE ||
+ you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT)
+ && you.duration[DUR_TRANSFORMATION] < 100 )
{
if ( decrement_a_duration(DUR_TRANSFORMATION,
NULL, 10, random2(3),
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 44d61bfad4..86104c5cc1 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -218,7 +218,10 @@ static void sdump_transform(dump_params &par)
text += "You are in spider-form.";
break;
case TRAN_BAT:
- text += "You are in bat-form.";
+ text += "You are in ";
+ if (you.species == SP_VAMPIRE)
+ text += "vampire ";
+ text += "bat-form.";
break;
case TRAN_BLADE_HANDS:
text += "Your hands are blades.";
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 83c306ef22..64bcaa10e9 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -863,6 +863,47 @@ bool melee_attack::player_apply_aux_unarmed()
if (mons_holiness(def) == MH_HOLY)
did_god_conduct(DID_KILL_ANGEL, 1);
+
+ // normal vampiric biting attack
+ if (damage_brand == SPWPN_VAMPIRICISM && mons_holiness(def) == MH_NATURAL)
+ {
+ const int chunk_type = mons_corpse_effect( def->type );
+
+ // don't drink poisonous or mutagenic blood
+ if (chunk_type == CE_CLEAN || chunk_type == CE_CONTAMINATED)
+ {
+ mprf( "You draw %s's blood!",
+ def->name(DESC_NOCAP_THE, true).c_str() );
+
+ if (you.hp < you.hp_max)
+ {
+ int heal = 1 + random2(damage_done);
+ if (heal > you.experience_level)
+ heal = you.experience_level;
+
+ if (chunk_type == CE_CLEAN)
+ heal += 1 + random2(damage_done);
+
+ inc_hp(heal, false);
+ mpr("You feel better.");
+ }
+
+ if (you.hunger_state < HS_ENGORGED) // always the case
+ {
+ int food_value = 0;
+ if (chunk_type == CE_CLEAN)
+ food_value = 45 + random2avg(59, 2);
+ else if (chunk_type == CE_CONTAMINATED)
+ food_value = 22 + random2avg(29, 2);
+
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ food_value -= 5 + random2(16);
+
+ lessen_hunger(food_value, true);
+ }
+ did_god_conduct(DID_DRINK_BLOOD, 5 + random2(4));
+ }
+ }
}
else // no damage was done
{
@@ -1040,7 +1081,7 @@ int melee_attack::player_apply_misc_modifiers(int damage)
if (you.duration[DUR_MIGHT] > 1)
damage += 1 + random2(10);
- if (you.hunger_state == HS_STARVING)
+ if (you.hunger_state == HS_STARVING && you.species != SP_VAMPIRE)
damage -= random2(5);
return (damage);
@@ -1214,7 +1255,9 @@ int melee_attack::player_weapon_type_modify(int damage)
// All weak hits look the same, except for when the player
// has a non-weapon in hand. -- bwr
- if (damage < HIT_WEAK)
+ // Exception: vampire bats only bite to allow for drawing blood
+ if (damage < HIT_WEAK && (you.species != SP_VAMPIRE
+ || you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT))
{
if (weap_type != WPN_UNKNOWN)
attack_verb = "hit";
@@ -1387,69 +1430,6 @@ bool melee_attack::player_monattk_hit_effects(bool mondied)
{
did_god_conduct(DID_UNHOLY, 1);
}
-
- if (you.species == SP_VAMPIRE && damage_brand == SPWPN_VAMPIRICISM)
- {
- if (defender->holiness() == MH_NATURAL
- && damage_done > 0 && !one_chance_in(5))
- {
- const int chunk_type = mons_corpse_effect( def->type );
-
- // don't drink poisonous or mutagenic blood
- if (chunk_type == CE_CLEAN || chunk_type == CE_CONTAMINATED)
- {
- mprf( "You draw %s's blood!",
- def->name(DESC_NOCAP_THE, true).c_str() );
-
- if (you.hp < you.hp_max)
- {
- int heal = 1 + random2(damage_done);
- if (heal > you.experience_level)
- heal = you.experience_level;
-
- if (chunk_type == CE_CLEAN)
- heal += 1 + random2(damage_done);
-
- inc_hp(heal, false);
- mpr("You feel better.");
- }
-
- if (you.hunger_state < HS_ENGORGED) // always the case
- {
- int food_value = 0;
- if (chunk_type == CE_CLEAN)
- food_value = 45 + random2avg(59, 2);
- else if (chunk_type == CE_CONTAMINATED)
- food_value = 22 + random2avg(29, 2);
-
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
- food_value -= 5 + random2(16);
-
- lessen_hunger(food_value, true);
- }
- did_god_conduct(DID_DRINK_BLOOD, 5 + random2(4));
- }
- }
- }
- else if (mondied && damage_brand == SPWPN_VAMPIRICISM)
- {
- if (mons_holiness(def) == MH_NATURAL
- && damage_done > 0 && you.hp < you.hp_max
- && !one_chance_in(5))
- {
- mpr("You feel better.");
-
- // more than if not killed
- int heal = 1 + random2(damage_done);
-
- inc_hp(heal, false);
-
- if (you.hunger_state != HS_ENGORGED)
- lessen_hunger(30 + random2avg(59, 2), true);
-
- did_god_conduct(DID_NECROMANCY, 2);
- }
- }
if (mondied)
return (true);
@@ -1759,28 +1739,65 @@ bool melee_attack::apply_damage_brand()
{
break;
}
-
- // We only get here if we've done base damage, so no
- // worries on that score.
- if (attacker->atype() == ACT_PLAYER)
- mpr("You feel better.");
- else if (attacker_visible)
+ // vampire bat form
+ if (you.species == SP_VAMPIRE && attacker->atype() == ACT_PLAYER
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
{
- if (defender->atype() == ACT_PLAYER)
- mprf("%s draws strength from your injuries!",
- attacker->name(DESC_CAP_THE).c_str());
- else
- mprf("%s is healed.",
- attacker->name(DESC_CAP_THE).c_str());
+ const int chunk_type = mons_corpse_effect( def->type );
+
+ // don't drink poisonous or mutagenic blood
+ if (chunk_type == CE_CLEAN || chunk_type == CE_CONTAMINATED)
+ {
+ mprf( "You draw %s's blood!",
+ def->name(DESC_NOCAP_THE, true).c_str() );
+
+ if (you.hp < you.hp_max)
+ {
+ int heal = 1 + random2(damage_done);
+ if (heal > you.experience_level)
+ heal = you.experience_level;
+
+ if (chunk_type == CE_CLEAN)
+ heal += 1 + random2(damage_done);
+
+ inc_hp(heal, false);
+ mpr("You feel better.");
+ }
+
+ if (you.hunger_state < HS_ENGORGED) // always the case
+ {
+ int food_value = 0;
+ if (chunk_type == CE_CLEAN)
+ food_value = 30 + random2avg(59, 2);
+ else if (chunk_type == CE_CONTAMINATED)
+ food_value = 15 + random2avg(29, 2);
+
+ lessen_hunger(food_value, true);
+ }
+ did_god_conduct(DID_DRINK_BLOOD, 5 + random2(4));
+ }
}
+ else { // handle weapon effects
+ // We only get here if we've done base damage, so no
+ // worries on that score.
+
+ if (attacker->atype() == ACT_PLAYER)
+ mpr("You feel better.");
+ else if (attacker_visible)
+ {
+ if (defender->atype() == ACT_PLAYER)
+ mprf("%s draws strength from your injuries!",
+ attacker->name(DESC_CAP_THE).c_str());
+ else
+ mprf("%s is healed.",
+ attacker->name(DESC_CAP_THE).c_str());
+ }
- {
int hp_boost = 0;
-
+
// thus is probably more valuable on larger weapons?
- if (weapon
- && is_fixed_artefact( *weapon )
+ if (weapon && is_fixed_artefact( *weapon )
&& weapon->special == SPWPN_VAMPIRES_TOOTH)
{
hp_boost = damage_done;
@@ -1791,12 +1808,12 @@ bool melee_attack::apply_damage_brand()
}
attacker->heal(hp_boost);
- }
- if (attacker->hunger_level() != HS_ENGORGED)
- attacker->make_hungry(-random2avg(59, 2));
-
- attacker->god_conduct( DID_NECROMANCY, 2 );
+ if (attacker->hunger_level() != HS_ENGORGED)
+ attacker->make_hungry(-random2avg(59, 2));
+
+ attacker->god_conduct( DID_NECROMANCY, 2 );
+ }
break;
case SPWPN_DISRUPTION:
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 069f97a3fd..a48e9b9f24 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -1516,25 +1516,25 @@ bool vampire_consume_corpse(int mons_type, int mass,
switch (mons_type)
{
- case MONS_HUMAN:
- food_value = mass + random2avg(you.experience_level * 10, 2);
- mpr( "This warm blood tastes really delicious!" );
- inc_hp(1 + random2(1 + you.experience_level), false);
- break;
-
- case MONS_ELF:
- food_value = mass + random2avg(you.experience_level * 10, 2);
- mpr( "This warm blood tastes magically delicious!" );
- inc_mp(1 + random2(3), false);
- break;
-
- default:
+ case MONS_HUMAN:
+ food_value = mass + random2avg(you.experience_level * 10, 2);
+ mpr( "This warm blood tastes really delicious!" );
+ inc_hp(1 + random2(1 + you.experience_level), false);
+ break;
+
+ case MONS_ELF:
+ food_value = mass + random2avg(you.experience_level * 10, 2);
+ mpr( "This warm blood tastes magically delicious!" );
+ inc_mp(1 + random2(3), false);
+ break;
+
+ default:
switch (chunk_type)
{
case CE_CLEAN:
- food_value = mass;
- mpr( "This warm blood tastes delicious!" );
- break;
+ food_value = mass;
+ mpr( "This warm blood tastes delicious!" );
+ break;
case CE_CONTAMINATED:
food_value = mass / (random2(3) + 1);
mpr( "Somehow that blood was not very filling!" );
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index b21d4024ad..bc07471f58 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -62,9 +62,9 @@ bool potion_effect( potion_type pot_eff, int pow )
if (you.species == SP_VAMPIRE)
{
if (!one_chance_in(3))
- you.rotting = 0;
+ you.rotting = 0;
if (!one_chance_in(3))
- you.duration[DUR_CONF] = 0;
+ you.duration[DUR_CONF] = 0;
}
else
{
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 30c2911c04..5c01458f0c 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -3483,7 +3483,7 @@ bool give_items_skills()
you.skills[(player_light_armour()? SK_DODGING : SK_ARMOUR)] = 2;
if (you.species != SP_VAMPIRE)
- you.skills[SK_SHIELDS] = 2;
+ you.skills[SK_SHIELDS] = 2;
you.skills[SK_RANGED_COMBAT] = 2;
you.skills[((coinflip() || you.species == SP_VAMPIRE)?
SK_STABBING : SK_SHIELDS)]++;
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index cec30a9acd..7d474dedd5 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -1471,7 +1471,10 @@ std::string status_mut_abilities()
text += "\nYou are in spider-form.";
break;
case TRAN_BAT:
- text += "\nYou are in bat-form.";
+ text += "\nYou are in ";
+ if (you.species == SP_VAMPIRE)
+ text += "vampire ";
+ text += "bat-form.";
break;
case TRAN_BLADE_HANDS:
text += "\nYou have blades for hands.";
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 5120e2f876..fe6c3a2e76 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2530,7 +2530,7 @@ void level_change(bool skip_ability_increase)
case SP_VAMPIRE:
if (you.experience_level == 3)
{
- mpr( "You can now transform into a bat.",
+ mpr( "You can now transform into a vampire bat.",
MSGCH_INTRINSIC_GAIN );
}
else if (you.experience_level == 13 || you.experience_level == 26)
@@ -3076,7 +3076,8 @@ void display_char_status()
mpr( "You are in spider-form." );
break;
case TRAN_BAT:
- mpr( "You are in bat-form." );
+ mprf( "You are in %sbat-form.",
+ you.species == SP_VAMPIRE ? "vampire " : "" );
break;
case TRAN_BLADE_HANDS:
mpr( "You have blades for hands." );
@@ -5044,7 +5045,7 @@ int player::damage_brand(int)
break;
case TRAN_BAT:
- if (you.species == SP_VAMPIRE && one_chance_in(3))
+ if (you.species == SP_VAMPIRE && one_chance_in(5))
{
ret = SPWPN_VAMPIRICISM;
} // else fall through