diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/fight.cc | 6 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/misc.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/player.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/player.h | 2 |
6 files changed, 19 insertions, 13 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 28de9957b6..e890104bed 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -3033,7 +3033,7 @@ static int affect_player( struct bolt &beam ) if (beam.is_beam) { // beams can be dodged - if (player_light_armour() + if (player_light_armour(true) && !beam.aimed_at_feet && coinflip()) { exercise(SK_DODGING, 1); @@ -3086,7 +3086,7 @@ static int affect_player( struct bolt &beam ) exercise( SK_SHIELDS, exer ); } - if (player_light_armour() && !beam.aimed_at_feet + if (player_light_armour(true) && !beam.aimed_at_feet && coinflip()) exercise(SK_DODGING, 1); @@ -3281,7 +3281,7 @@ static int affect_player( struct bolt &beam ) if (you.equip[EQ_BODY_ARMOUR] != -1) { - if (!player_light_armour() && one_chance_in(4) + if (!player_light_armour(false) && one_chance_in(4) && random2(1000) <= item_mass( you.inv[you.equip[EQ_BODY_ARMOUR]] )) { exercise( SK_ARMOUR, 1 ); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index d66e701a29..801cd3e3d9 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2189,7 +2189,7 @@ void monster_attack(int monster_attacking) if (bearing_shield && one_chance_in(4)) exercise(SK_SHIELDS, 1); } - else if (player_light_armour() && one_chance_in(3)) + else if (player_light_armour(true) && one_chance_in(3)) { exercise(SK_DODGING, 1); } @@ -2322,7 +2322,9 @@ void monster_attack(int monster_attacking) { const int body_arm_mass = item_mass( you.inv[you.equip[EQ_BODY_ARMOUR]] ); - if (!player_light_armour() && coinflip() + // Being generous here...this can train both Armour + // and Dodging. + if (!player_light_armour(false) && coinflip() && random2(1000) <= body_arm_mass) { // raised from 1 {bwross} diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index ff433e3399..0840427637 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2838,12 +2838,10 @@ void handle_time( long time_delta ) } // exercise armour *xor* stealth skill: {dlb} - if (!player_light_armour()) + if (!player_light_armour(true)) { if (random2(1000) <= item_mass( you.inv[you.equip[EQ_BODY_ARMOUR]] )) - { return; - } if (one_chance_in(6)) // lowered random roll from 7 to 6 -- bwross exercise(SK_ARMOUR, 1); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index d011d14d72..f41f650cb9 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1202,7 +1202,7 @@ static void dart_trap( bool trap_known, int trapped, struct bolt &pbolt, mpr(info); } - if (player_light_armour() && coinflip()) + if (player_light_armour(true) && coinflip()) exercise( SK_DODGING, 1 ); out_of_trap: diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index d1bc61c891..90aaa62a3d 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -1722,12 +1722,18 @@ bool is_light_armour( const item_def &item ) } } -bool player_light_armour(void) +bool player_light_armour(bool with_skill) { - if (you.equip[EQ_BODY_ARMOUR] == -1) + const int arm = you.equip[EQ_BODY_ARMOUR]; + + if (arm == -1) + return true; + + if (with_skill && + property(you.inv[arm], PARM_EVASION) + you.skills[SK_ARMOUR]/3 >= 0) return true; - return (is_light_armour( you.inv[you.equip[EQ_BODY_ARMOUR]] )); + return (is_light_armour(you.inv[arm])); } // end player_light_armour() // diff --git a/crawl-ref/source/player.h b/crawl-ref/source/player.h index d9a964c0f9..a9db520587 100644 --- a/crawl-ref/source/player.h +++ b/crawl-ref/source/player.h @@ -39,7 +39,7 @@ bool is_light_armour( const item_def &item ); /* *********************************************************************** * called from: beam - fight - misc - newgame * *********************************************************************** */ -bool player_light_armour(void); +bool player_light_armour(bool with_skill = false); /* *********************************************************************** |