From 4b1f4e316e67c61e69ca095051e3035808c74a72 Mon Sep 17 00:00:00 2001 From: hat071af Date: Mon, 19 Aug 2024 23:35:37 -0700 Subject: [PATCH 1/6] [script] [combat-trainer] Added necro_corpse_priority: setting Added `necro_corpse_priority:` setting to allow for prioritization of using corpses for either healing or pet creation. Default behavior is to prioritze healing from corpses. Exclude it, leave it blank or set it to `heal`. To have it prioritize pet creation from corpses set it to `pet`. Rituals other than consue/arise have not changed. They are handled separately in the rituals section and continue to be prioritized behind pets and healing as before. --- combat-trainer.lic | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index 8beda904e..784cd6593 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -438,6 +438,9 @@ class LootProcess @make_bonebug = settings.bonebug['make'] echo(" @make_bonebug: #{@make_bonebug}") if $debug_mode_ct + @necro_corpse_priority = settings.necro_corpse_priority + echo(" @necro_corpse_priority: #{@necro_corpse_priority}") if $debug_mode_ct + @wound_level_threshold = settings.necromancer_healing['wound_level_threshold'] || 1 echo(" @wound_level_threshold: #{@wound_level_threshold}") if $debug_mode_ct @@ -1428,10 +1431,17 @@ class SpellProcess end check_slivers(game_state) check_regalia(game_state) - check_consume(game_state) - heal_corpse(game_state) - check_cfw(game_state) - check_cfb(game_state) + if @settings.necro_corpse_priority == 'pet' + check_cfw(game_state) + heal_corpse(game_state) + check_cfb(game_state) + check_consume(game_state) + elsif @settings.necro_corpse_priority['heal'] || !@settings.necro_corpse_priority + check_consume(game_state) + check_cfw(game_state) + heal_corpse(game_state) + check_cfb(game_state) + end check_bless(game_state) check_ignite(game_state) check_rutilors_edge(game_state) From f837ba62829f88f08afdc0e6c574248b6b48ea8c Mon Sep 17 00:00:00 2001 From: hat071af Date: Mon, 19 Aug 2024 23:38:24 -0700 Subject: [PATCH 2/6] Update combat-trainer.lic --- combat-trainer.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index 784cd6593..156c73a75 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -440,7 +440,7 @@ class LootProcess @necro_corpse_priority = settings.necro_corpse_priority echo(" @necro_corpse_priority: #{@necro_corpse_priority}") if $debug_mode_ct - + @wound_level_threshold = settings.necromancer_healing['wound_level_threshold'] || 1 echo(" @wound_level_threshold: #{@wound_level_threshold}") if $debug_mode_ct From 132d0541225d1b22269b4b8814afb658ec431ef6 Mon Sep 17 00:00:00 2001 From: hat071af Date: Tue, 20 Aug 2024 00:46:06 -0700 Subject: [PATCH 3/6] Update combat-trainer.lic Refactored original attempt to work correctly. Okay to merge now. --- combat-trainer.lic | 71 +++++++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index 156c73a75..cb8cb9249 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -709,28 +709,15 @@ class LootProcess echo " should_perform_ritual? #{should_perform_ritual?(game_state)}" if $debug_mode_ct if @last_ritual.nil? - if @necro_heal && !game_state.necro_casting? - game_state.wounds = DRCH.check_health['wounds'] - echo "Severity to Wounds: #{game_state.wounds}" if $debug_mode_ct - echo "wound_level_threshold: #{@wound_level_threshold}" if $debug_mode_ct - unless game_state.wounds.empty? - if @wound_level_threshold <= game_state.wounds.keys.max - do_necro_ritual(mob_noun, 'consume', game_state) - return false - end - end + if @necro_corpse_priority == 'pet' + DRC.message("Prioritizing pet creation over healing") + check_necro_pet(mob_noun, game_state) + check_necro_heal(mob_noun, game_state) + elsif @necro_corpse_priority == 'heal' || !@necro_corpse_priority + DRC.message("Prioritizing healing over pet creation") + check_necro_heal(mob_noun, game_state) + check_necro_pet(mob_noun, game_state) end - if @make_zombie && !game_state.necro_casting? && !game_state.cfb_active? - echo 'Making zombie' if $debug_mode_ct - do_necro_ritual(mob_noun, 'arise', game_state) - return false - end - if @make_bonebug && !game_state.necro_casting? && !game_state.cfw_active? - echo 'Making bone bug' if $debug_mode_ct - do_necro_ritual(mob_noun, 'arise', game_state) - return false - end - ritual = if @redeemed 'dissect' elsif @current_harvest_count < @necro_count @@ -749,6 +736,33 @@ class LootProcess true end + def check_necro_heal(mob_noun, game_state) + if @necro_heal && !game_state.necro_casting? + game_state.wounds = DRCH.check_health['wounds'] + echo "Severity to Wounds: #{game_state.wounds}" if $debug_mode_ct + echo "wound_level_threshold: #{@wound_level_threshold}" if $debug_mode_ct + unless game_state.wounds.empty? + if @wound_level_threshold <= game_state.wounds.keys.max + do_necro_ritual(mob_noun, 'consume', game_state) + return false + end + end + end + end + + def check_necro_pet(mob_noun, game_state) + if @make_zombie && !game_state.necro_casting? && !game_state.cfb_active? + echo 'Making zombie' if $debug_mode_ct + do_necro_ritual(mob_noun, 'arise', game_state) + return false + end + if @make_bonebug && !game_state.necro_casting? && !game_state.cfw_active? + echo 'Making bone bug' if $debug_mode_ct + do_necro_ritual(mob_noun, 'arise', game_state) + return false + end + end + def do_necro_ritual(mob_noun, ritual, game_state) return unless DRStats.necromancer? return unless ritual @@ -1431,17 +1445,10 @@ class SpellProcess end check_slivers(game_state) check_regalia(game_state) - if @settings.necro_corpse_priority == 'pet' - check_cfw(game_state) - heal_corpse(game_state) - check_cfb(game_state) - check_consume(game_state) - elsif @settings.necro_corpse_priority['heal'] || !@settings.necro_corpse_priority - check_consume(game_state) - check_cfw(game_state) - heal_corpse(game_state) - check_cfb(game_state) - end + check_consume(game_state) + check_cfw(game_state) + heal_corpse(game_state) + check_cfb(game_state) check_bless(game_state) check_ignite(game_state) check_rutilors_edge(game_state) From f3b916b3794e7ad1e6b5119daaa7bcefb248f1e5 Mon Sep 17 00:00:00 2001 From: hat071af Date: Tue, 20 Aug 2024 00:47:10 -0700 Subject: [PATCH 4/6] Update combat-trainer.lic --- combat-trainer.lic | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index cb8cb9249..4fd8fc5d7 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -748,8 +748,8 @@ class LootProcess end end end - end - + end + def check_necro_pet(mob_noun, game_state) if @make_zombie && !game_state.necro_casting? && !game_state.cfb_active? echo 'Making zombie' if $debug_mode_ct From fb072756b0c328f5ea34a4c6528a4eca20beb195 Mon Sep 17 00:00:00 2001 From: hat071af Date: Tue, 20 Aug 2024 00:50:33 -0700 Subject: [PATCH 5/6] Update combat-trainer.lic --- combat-trainer.lic | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index 4fd8fc5d7..b6bf4033b 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -710,11 +710,11 @@ class LootProcess echo " should_perform_ritual? #{should_perform_ritual?(game_state)}" if $debug_mode_ct if @last_ritual.nil? if @necro_corpse_priority == 'pet' - DRC.message("Prioritizing pet creation over healing") + echo ("Prioritizing pet creation over healing" if $debug_mode_ct check_necro_pet(mob_noun, game_state) check_necro_heal(mob_noun, game_state) elsif @necro_corpse_priority == 'heal' || !@necro_corpse_priority - DRC.message("Prioritizing healing over pet creation") + echo "Prioritizing healing over pet creation" if $debug_mode_ct check_necro_heal(mob_noun, game_state) check_necro_pet(mob_noun, game_state) end From 8b8b3a691bd452b4edd42389f19db13bf5c34ffe Mon Sep 17 00:00:00 2001 From: hat071af Date: Tue, 20 Aug 2024 00:51:59 -0700 Subject: [PATCH 6/6] Update combat-trainer.lic --- combat-trainer.lic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/combat-trainer.lic b/combat-trainer.lic index b6bf4033b..517b2554f 100644 --- a/combat-trainer.lic +++ b/combat-trainer.lic @@ -710,7 +710,7 @@ class LootProcess echo " should_perform_ritual? #{should_perform_ritual?(game_state)}" if $debug_mode_ct if @last_ritual.nil? if @necro_corpse_priority == 'pet' - echo ("Prioritizing pet creation over healing" if $debug_mode_ct + echo "Prioritizing pet creation over healing" if $debug_mode_ct check_necro_pet(mob_noun, game_state) check_necro_heal(mob_noun, game_state) elsif @necro_corpse_priority == 'heal' || !@necro_corpse_priority