Skip to content

Commit

Permalink
Update combat-trainer.lic
Browse files Browse the repository at this point in the history
Refactored original attempt to work correctly. Okay to merge now.
  • Loading branch information
hat071af authored Aug 20, 2024
1 parent f837ba6 commit 132d054
Showing 1 changed file with 39 additions and 32 deletions.
71 changes: 39 additions & 32 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 132d054

Please sign in to comment.