diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-24 12:42:13 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-24 14:31:30 +0200 |
commit | 394fb595f6d03fa9d266ed28726975e0b59bc798 (patch) | |
tree | 3a84b6c9ced49b07af9212a3447770ae53897ed5 /crawl-ref/source/fight.cc | |
parent | ea81f9787b7cba7a18ec7c098fcd0fe37fe7daef (diff) | |
download | crawl-ref-394fb595f6d03fa9d266ed28726975e0b59bc798.tar.gz crawl-ref-394fb595f6d03fa9d266ed28726975e0b59bc798.zip |
Extract newgame character restrictions from newgame.cc.
The functions in the new ng-restr.cc are "pure": They don't
access global state; data is passed in via the new and
incomplete newgame_def.
Eventually, new_game should be split into something like
newgame_def choose_game();
that doesn't access "you", and
void setup_game(newgame_def);
that sets up the player.
Also get rid of player_size in favour of player::body_size. Rename
player_size_type to size_part_type since it's not really
player-specific (used in actor::body_size). Move parts of
player_genus, player::has_claws, body_size out into species.cc.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r-- | crawl-ref/source/fight.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index a1d8bbc914..f544fbd617 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -4014,7 +4014,7 @@ int melee_attack::player_calc_base_weapon_damage() // effective. if (shield && weapon->base_type == OBJ_WEAPONS && weapon_skill(*weapon) == SK_STAVES - && hands_reqd(*weapon, player_size()) == HANDS_HALF) + && hands_reqd(*weapon, you.body_size()) == HANDS_HALF) { damage /= 2; } @@ -5479,7 +5479,7 @@ int weapon_str_weight( object_class_type wpn_class, int wpn_type ) int ret; const int wpn_skill = weapon_skill( wpn_class, wpn_type ); - const int hands = hands_reqd( wpn_class, wpn_type, player_size() ); + const int hands = hands_reqd( wpn_class, wpn_type, you.body_size() ); // These are low values, because we'll be adding some bonus to the // larger weapons later. Remember also that 1-1/2-hand weapons get @@ -5550,7 +5550,7 @@ static inline int player_weapon_str_weight() int ret = weapon_str_weight(weapon->base_type, weapon->sub_type); - if (hands_reqd(*weapon, player_size()) == HANDS_HALF && !you.shield()) + if (hands_reqd(*weapon, you.body_size()) == HANDS_HALF && !you.shield()) ret += 1; return (ret); |