From 5deb29bf245d7ff57751f4ea2a2159439a516e42 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 18 May 2009 13:26:18 +0000 Subject: * Fix Bat Form restrictions not applying to choice by clicking (Tiles). * Allow as synonyms for left/right hand in swap_rings(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9791 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index dbb5fc47e7..ef4c97f985 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -427,10 +427,15 @@ bool player_is_swimming() return (you.swimming()); } +bool player_in_bat_form() +{ + return (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT); +} + bool player_can_open_doors() { // Bats can't close/open doors. - return (you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT); + return !player_in_bat_form(); } bool player_under_penance(void) @@ -1096,7 +1101,7 @@ int player_hunger_rate(void) { int hunger = 3; - if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT) + if (player_in_bat_form()) return 1; if (you.species == SP_TROLL) @@ -1918,7 +1923,7 @@ int player_movement_speed(void) // transformations if (you.attribute[ATTR_TRANSFORMATION] == TRAN_SPIDER) mv = 8; - else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT) + else if (player_in_bat_form()) mv = 5; // but allowed minimum is six // armour @@ -3600,7 +3605,7 @@ int check_stealth(void) // Thirsty/bat-form vampires are (much) more stealthy if (you.hunger_state == HS_STARVING) stealth += (you.skills[SK_STEALTH] * 21); - else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT + else if (player_in_bat_form() || you.hunger_state <= HS_NEAR_STARVING) { stealth += (you.skills[SK_STEALTH] * 20); @@ -3882,8 +3887,7 @@ void display_char_status() { std::string text; - if ((you.species != SP_VAMPIRE - || you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT) + if ((you.species != SP_VAMPIRE || !player_in_bat_form()) && dur_expiring(DUR_TRANSFORMATION)) { text = "Expiring: "; -- cgit v1.2.3-54-g00ecf