Skip to content

Commit

Permalink
Merge branch 'rpherbig:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Tirost authored Oct 30, 2024
2 parents 81ed251 + 8eca738 commit f557945
Show file tree
Hide file tree
Showing 12 changed files with 1,139 additions and 642 deletions.
9 changes: 8 additions & 1 deletion bootstrap.lic
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Documentation: https://elanthipedia.play.net/Lich_script_development#bootstrap
=end

$BOOTSTRAP_VERSION = '1.0.1'
$BOOTSTRAP_VERSION = '1.0.2'
DRINFOMON_IN_CORE_LICH ||= false

class_defs = {
'drinfomon' => :DRINFOMON,
Expand Down Expand Up @@ -60,6 +61,12 @@ end

scripts_to_run = args.flex || []
echo scripts_to_run.to_s if UserVars.bootstrap_debug

if scripts_to_run.include?("drinfomon") && DRINFOMON_IN_CORE_LICH
scripts_to_run -= ['drinfomon']
echo("Removing drinfomon from scripts_to_run") if UserVars.bootstrap_debug
end

until scripts_to_run.empty?
script_to_run = scripts_to_run.shift
respond("BS:#{script_to_run}:#{scripts_to_run}") if UserVars.bootstrap_debug
Expand Down
64 changes: 42 additions & 22 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -706,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'
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
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
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 @@ -746,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 @@ -1392,6 +1409,9 @@ class SpellProcess
if game_state.finish_spell_casting?
echo('SpellProcess::clean_up') if $debug_mode_ct
game_state.next_clean_up_step
if DRStats.guild == "Bard" && @settings.segue_spell_on_stop
DRCA.segue?(@settings.segue_spell_on_stop, @settings.segue_prep_on_stop)
end
DRCA.release_cyclics(@settings.cyclic_no_release)
if checkprep != 'None'
DRC.bput('release spell', 'You let your concentration lapse', "You aren't preparing a spell")
Expand Down Expand Up @@ -1429,8 +1449,8 @@ class SpellProcess
check_slivers(game_state)
check_regalia(game_state)
check_consume(game_state)
heal_corpse(game_state)
check_cfw(game_state)
heal_corpse(game_state)
check_cfb(game_state)
check_bless(game_state)
check_ignite(game_state)
Expand Down
Loading

0 comments on commit f557945

Please sign in to comment.