Skip to content

Commit

Permalink
Merge pull request #75716 from RenechCDDA/monster_special_difficulty
Browse files Browse the repository at this point in the history
Exclude PARROT special attack from monster difficulty calculations
  • Loading branch information
Maleclypse authored Aug 17, 2024
2 parents 207c865 + be528c0 commit 150650e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,16 @@ void MonsterGenerator::finalize_mtypes()
armor_diff += dt.second;
}
}
std::unordered_set<std::string> blacklisted_specials{"PARROT", "PARROT_AT_DANGER"};
int special_attacks_diff = 0;
for( const auto &special : mon.special_attacks ) {
if( !blacklisted_specials.count( special.first ) ) {
special_attacks_diff++;
}
}
mon.difficulty = ( mon.melee_skill + 1 ) * mon.melee_dice * ( melee_dmg_total + mon.melee_sides ) *
0.04 + ( mon.sk_dodge + 1 ) * armor_diff * 0.04 +
( mon.difficulty_base + mon.special_attacks.size() + 8 * mon.emit_fields.size() );
( mon.difficulty_base + special_attacks_diff + 8 * mon.emit_fields.size() );
mon.difficulty *= ( mon.hp + mon.speed - mon.attack_cost + ( mon.morale + mon.agro ) * 0.1 ) * 0.01
+ ( mon.vision_day + 2 * mon.vision_night ) * 0.01;

Expand Down

0 comments on commit 150650e

Please sign in to comment.