From be528c06f268dc84e3ba124fbcc02db6d11c60da Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:28:26 -0400 Subject: [PATCH] Exclude PARROT special attack from danger calculations --- src/monstergenerator.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/monstergenerator.cpp b/src/monstergenerator.cpp index 720a95e941d5b..1afd7129c8f7d 100644 --- a/src/monstergenerator.cpp +++ b/src/monstergenerator.cpp @@ -377,9 +377,16 @@ void MonsterGenerator::finalize_mtypes() armor_diff += dt.second; } } + std::unordered_set 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;