Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compile errors #11

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ static const bionic_id bio_eye_optic( "bio_eye_optic" );
static const bionic_id bio_soporific( "bio_soporific" );
static const bionic_id bio_uncanny_dodge( "bio_uncanny_dodge" );
static const bionic_id bio_watch( "bio_watch" );
static const bionic_id bio_armor_arms( "bio_armor_arms" );
static const bionic_id bio_armor_legs( "bio_armor_legs" );
static const bionic_id bio_armor_head( "bio_armor_head" );
static const bionic_id bio_armor_torso( "bio_armor_torso" );


static const efftype_id effect_adrenaline( "adrenaline" );
static const efftype_id effect_alarm_clock( "alarm_clock" );
Expand Down Expand Up @@ -1497,10 +1502,10 @@ bool Character::can_run() const

bool Character::is_bp_armored( const bodypart_id &bp ) const
{
return ( bp == bp_torso && has_bionic( bio_armor_torso ) ) || \
( bp == bp_head && has_bionic( bio_armor_head ) ) || \
( ( bp == bp_arm_l || bp == bp_arm_r ) && has_bionic( bio_armor_arms ) ) || \
( ( bp == bp_leg_l || bp == bp_leg_r ) && has_bionic( bio_armor_legs ) );
return ( bp->token == bp_torso && has_bionic( bio_armor_torso ) ) || \
( bp->token == bp_head && has_bionic( bio_armor_head ) ) || \
( ( bp->token == bp_arm_l || bp->token == bp_arm_r ) && has_bionic( bio_armor_arms ) ) || \
( ( bp->token == bp_leg_l || bp->token == bp_leg_r ) && has_bionic( bio_armor_legs ) );
}

void Character::try_remove_downed()
Expand Down Expand Up @@ -8337,7 +8342,7 @@ int Character::get_armor_fire_base( bodypart_id bp ) const
}
}

ret += mutation_armor( bp, damage_type::heat );
ret += mutation_armor( bp, damage_type::HEAT );
return ret;
}

Expand All @@ -8357,7 +8362,7 @@ int Character::get_armor_acid_base( bodypart_id bp ) const
}
}

ret += mutation_armor( bp, damage_type::acid );
ret += mutation_armor( bp, damage_type::ACID );
return ret;
}

Expand Down
4 changes: 3 additions & 1 deletion src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,8 +990,10 @@ class Character : public Creature, public visitable<Character>
bool is_limb_broken( const bodypart_id &limb ) const;
/** source of truth of whether a Character can run */
bool can_run() const;
/** Hurts all body parts for dam, no armor reduction */

bool is_bp_armored( const bodypart_id &bp ) const;

/** Hurts all body parts for dam, no armor reduction */
void hurtall( int dam, Creature *source, bool disturb = true );
/** Harms all body parts for dam, with armor reduction. If vary > 0 damage to parts are random within vary % (1-100) */
int hitall( int dam, int vary, Creature *source );
Expand Down
6 changes: 1 addition & 5 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ static const mtype_id mon_zombie_jackson( "mon_zombie_jackson" );
static const mtype_id mon_zombie_skeltal_minion( "mon_zombie_skeltal_minion" );

static const bionic_id bio_uncanny_dodge( "bio_uncanny_dodge" );
static const bionic_id bio_armor_arms( "bio_armor_arms" );
static const bionic_id bio_armor_legs( "bio_armor_legs" );
static const bionic_id bio_armor_head( "bio_armor_head" );
static const bionic_id bio_armor_torso( "bio_armor_torso" );

// shared utility functions
static bool within_visual_range( monster *z, int max_range )
Expand Down Expand Up @@ -4159,7 +4155,7 @@ bool mattack::stretch_bite( monster *z )
z->name(),
body_part_name_accusative( hit ) );

if( one_in( 16 - dam ) && ( ( target->is_avatar() || target->is_npc() ) && target->as_character()->is_bp_armored( hit ) ? !one_in( 4 ) : true ) {
if( one_in( 16 - dam ) && ( ( target->is_avatar() || target->is_npc() ) && target->as_character()->is_bp_armored( hit ) ? !one_in( 4 ) : true ) ) {
if( target->has_effect( effect_bite, hit.id() ) ) {
target->add_effect( effect_bite, 40_minutes, hit, true );
} else if( target->has_effect( effect_infected, hit.id() ) ) {
Expand Down