resistances::resistances( monster &monster ) : resist_vals( NUM_DT, 0 ) { set_resist( DT_BASH, monster.type->armor_bash ); set_resist( DT_CUT, monster.type->armor_cut ); set_resist( DT_STAB, 0.8 * monster.type->armor_cut ); // stab dam cares less bout armor set_resist( DT_ACID, monster.type->armor_cut / 2 ); // No acid resist stat yet }
resistances::resistances( monster &monster ) { set_resist( DT_BASH, monster.type->armor_bash ); set_resist( DT_CUT, monster.type->armor_cut ); set_resist( DT_STAB, monster.type->armor_stab ); set_resist( DT_ACID, monster.type->armor_acid ); set_resist( DT_HEAT, monster.type->armor_fire ); }
resistances::resistances(item &armor) : resist_vals(NUM_DT, 0) { if (armor.is_armor()) { set_resist(DT_BASH, armor.bash_resist()); set_resist(DT_CUT, armor.cut_resist()); set_resist(DT_STAB, 0.8 * armor.cut_resist()); // stab dam cares less bout armor } }
resistances::resistances( const item &armor, bool to_self ) { // Armors protect, but all items can resist if( to_self || armor.is_armor() ) { for( int i = 0; i < NUM_DT; i++ ) { damage_type dt = static_cast<damage_type>( i ); set_resist( dt, armor.damage_resist( dt, to_self ) ); } } }