Skip to content

Commit

Permalink
Merge branch 'rpherbig:master' into dependency_tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Aug 19, 2024
2 parents 0220cf6 + 90683e2 commit 2fe9c22
Show file tree
Hide file tree
Showing 21 changed files with 448 additions and 85 deletions.
6 changes: 3 additions & 3 deletions alchemy.lic
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Alchemy
exit if args.craft && (args.forage || args.prepare)

settings = get_settings
@hometown = settings.hometown
hometown = settings.force_crafting_town || settings.hometown
@alchemy_herb_quantity = settings.alchemy_herb_quantity
@alchemy_herb_storage = settings.alchemy_herb_storage
@herb_container = settings.herb_container
Expand All @@ -36,10 +36,10 @@ class Alchemy

ingredient = get_data('ingredients').ingredients.find { |each_ingredient| each_ingredient['name'] =~ /#{args.target}/i } unless args.craft
# Set town for foraging
@forage_location = ingredient[@forage_override_room] || @forage_override_room || ingredient[@hometown]
@forage_location = ingredient[@forage_override_room] || @forage_override_room || ingredient[hometown]
echo("@forage_location = #{@forage_location}") if @debug
# Set press and grinder location
@press_location = @forage_override_town || @hometown
@press_location = @forage_override_town || hometown
echo("@press_location = #{@press_location}") if @debug
# Forage call section
forage_ingredient(ingredient) if args.forage
Expand Down
4 changes: 2 additions & 2 deletions arrows.lic
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Arrows
@bag = @settings.crafting_container
@bag_items = @settings.crafting_items_in_container
@belt = @settings.engineering_belt
@hometown = @settings.hometown
@hometown = @settings.force_crafting_town || @settings.hometown
@engineering_room = @settings.engineering_room
@hometown_data = get_data('crafting')['shaping'][@hometown]

Expand Down Expand Up @@ -48,7 +48,7 @@ class Arrows
@lumber = args.lumber
@tools = args.tools

DRCM.ensure_copper_on_hand(2000, @settings)
DRCM.ensure_copper_on_hand(2000, @settings, @hometown)
get_tools if @tools
order_lumber
check_flights
Expand Down
1 change: 1 addition & 0 deletions bescort.lic
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,7 @@ class Bescort
def ride_gondola(mode)
case DRC.bput('go gondola', 'There is no wooden gondola here', 'Gondola, Cab')
when /no wooden gondola here/i
DRC.bput('look gondola', 'The wooden gondola')
hide?
waitfor 'The gondola stops on the platform and the door silently swings open'
ride_gondola(mode)
Expand Down
4 changes: 2 additions & 2 deletions bolts.lic
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Bolts
@bag = @settings.crafting_container
@bag_items = @settings.crafting_items_in_container
@belt = @settings.engineering_belt
@hometown = @settings.hometown
@hometown = @settings.force_crafting_town || @settings.hometown
@engineering_room = @settings.engineering_room
@hometown_data = get_data('crafting')['shaping'][@hometown]

Expand Down Expand Up @@ -50,7 +50,7 @@ class Bolts
@lumber = args.lumber
@tools = args.tools

DRCM.ensure_copper_on_hand(2000, @settings)
DRCM.ensure_copper_on_hand(2000, @settings, @hometown)
DRC.wait_for_script_to_complete('clerk-tools', ['engineering', 'get']) unless DRCI.exists?('shaper') if @tools
order_lumber
check_flights
Expand Down
7 changes: 4 additions & 3 deletions clean-leather.lic
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CleanLeather
@bag = @settings.crafting_container
@bag_items = @settings.crafting_items_in_container
@belt = @settings.outfitting_belt
@hometown = @settings.force_crafting_town || @settings.hometown
engineering_room = @settings.engineering_room
outfitting_room = @settings.outfitting_room

Expand All @@ -38,12 +39,12 @@ class CleanLeather
# Set the proper stock rooms, preservative, and order number depending on whether we're
# cleaning hides or bones.
if args.hide =~ /^bones?$/i
@stock_room = get_data('crafting')['shaping'][@settings.hometown]['tool-room']
@stock_room = get_data('crafting')['shaping'][@hometown]['tool-room']
@room = engineering_room
@preservative = 'bleaching solution'
@order_number = '7'
else
@stock_room = get_data('crafting')['tailoring'][@settings.hometown]['tool-room']
@stock_room = get_data('crafting')['tailoring'][@hometown]['tool-room']
@room = outfitting_room
@preservative = 'tanning lotion'
@order_number = '8'
Expand Down Expand Up @@ -100,7 +101,7 @@ class CleanLeather

# If we lack doses to complete the job, purchase what is required before starting our project
bottles_to_purchase = ((required_doses - on_hand.to_f) / 30).ceil
DRCM.ensure_copper_on_hand(625 * bottles_to_purchase, @settings)
DRCM.ensure_copper_on_hand(625 * bottles_to_purchase, @settings, @hometown)
bottles_to_purchase.times do
DRCT.order_item(@stock_room, @order_number)
DRCI.put_away_item?(@preservative, @bag)
Expand Down
2 changes: 1 addition & 1 deletion clerk-tools.lic
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Clerk
action = args.action

settings = get_settings
hometown = settings.hometown
hometown = settings.force_crafting_town || settings.hometown
@bag = settings.crafting_container

crafting_data = get_data('crafting')
Expand Down
84 changes: 79 additions & 5 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ class LootProcess
@make_zombie = settings.zombie['make']
echo(" @make_zombie: #{@make_zombie}") if $debug_mode_ct

@make_bonebug = settings.bonebug['make']
echo(" @make_bonebug: #{@make_bonebug}") 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 @@ -719,6 +722,11 @@ class LootProcess
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'
Expand Down Expand Up @@ -760,7 +768,9 @@ class LootProcess
case result
when @rituals['arise']
echo 'Detected arise messaging' if $debug_mode_ct
game_state.prepare_cfb = true if @make_zombie
game_state.prepare_nr = true if @make_zombie && !game_state.cfb_active?
game_state.prepare_cfb = true if @make_zombie && !game_state.cfb_active?
game_state.prepare_cfw = true if @make_bonebug && !game_state.cfw_active?
@last_ritual = ritual
when @rituals['preserve'], @rituals['dissect']
echo 'Detected preserve or dissect messaging' if $debug_mode_ct
Expand Down Expand Up @@ -826,8 +836,9 @@ class LootProcess
return
end

result = DRC.bput("put material in my #{@necro_container}", 'You put')
result = DRC.bput("put material in my #{@necro_container}", 'You put', 'material doesn\'t seem to fit')
@current_harvest_count += 1 if result =~ /^You put/
DRC.bput('drop material', 'you discard it') if result =~ /^material doesn't seem to fit/
end

def dispose_body(game_state)
Expand Down Expand Up @@ -1224,9 +1235,15 @@ class SpellProcess
@necromancer_healing = settings.necromancer_healing
echo(" @necromancer_healing: #{@necromancer_healing}") if $debug_mode_ct

@corpse_healing = settings.waggle_sets['corpse_healing']
echo(" @corpse_healing: #{@corpse_healing}") if $debug_mode_ct

@necromancer_zombie = settings.waggle_sets['zombie']
echo(" @necromancer_zombie: #{@necromancer_zombie}") if $debug_mode_ct

@necromancer_bonebug = settings.waggle_sets['bonebug']
echo(" @necromancer_bonebug: #{@necromancer_bonebug}") if $debug_mode_ct

@empath_spells = settings.empath_healing
echo(" @empath_spells: #{@empath_spells}") if $debug_mode_ct

Expand Down Expand Up @@ -1412,6 +1429,8 @@ class SpellProcess
check_slivers(game_state)
check_regalia(game_state)
check_consume(game_state)
heal_corpse(game_state)
check_cfw(game_state)
check_cfb(game_state)
check_bless(game_state)
check_ignite(game_state)
Expand Down Expand Up @@ -1669,7 +1688,9 @@ class SpellProcess

game_state.casting_weapon_buff = false
game_state.casting_consume = false
game_state.casting_nr = false
game_state.casting_cfb = false
game_state.casting_cfw = false
game_state.casting_cyclic = false
if game_state.casting_sorcery
game_state.casting_sorcery = false
Expand All @@ -1691,7 +1712,13 @@ class SpellProcess

return unless @command

pause 0.5 until DRRoom.npcs.include?('warrior')
# escape valve in case spell immediately fails (due to anti magic?)
temp_count = 0
until DRRoom.npcs.include?('warrior') || temp_count > 20
pause 0.5
temp_count += 1
end

fput("command #{@command}")
@command = nil
end
Expand Down Expand Up @@ -1917,6 +1944,30 @@ class SpellProcess
prepare_spell(data, game_state, true)
end

def check_cfw(game_state)
return unless DRStats.necromancer?
return unless @necromancer_bonebug['Call from Within']
return if game_state.casting
return unless game_state.prepare_cfw

game_state.casting_cfw = true
game_state.prepare_cfw = false
data = @necromancer_bonebug['Call from Within']
prepare_spell(data, game_state, true)
end

def heal_corpse(game_state)
return unless DRStats.necromancer?
return unless @corpse_healing['Necrotic Reconstruction']
return if game_state.casting
return unless game_state.prepare_nr

game_state.casting_nr = true
game_state.prepare_nr = false
data = @corpse_healing['Necrotic Reconstruction']
prepare_spell(data, game_state, true)
end

def check_consume(game_state)
return unless DRStats.necromancer?
return unless @necromancer_healing
Expand All @@ -1929,6 +1980,7 @@ class SpellProcess
end

return unless game_state.prepare_consume
return if @necromancer_healing.key?('Devour') && DRSpells.active_spells['Devour']

echo "@necromancer_healing.key?('Consume Flesh'): #{@necromancer_healing.key?('Consume Flesh')}" if $debug_mode_ct
echo "@necromancer_healing.key?('Devour'): #{@necromancer_healing.key?('Devour')}" if $debug_mode_ct
Expand Down Expand Up @@ -2124,6 +2176,8 @@ class PetProcess

@zombie = settings.zombie
echo(" @zombie: #{@zombie}") if $debug_mode_ct
@bonebug = settings.bonebug
echo(" @bonebug: #{@bonebug}") if $debug_mode_ct

@is_present = false
@current_stance = nil
Expand All @@ -2134,6 +2188,7 @@ class PetProcess
check_zombie(game_state)
if game_state.dismiss_pet?
dismiss_zombie(game_state)
dismiss_bonebug(game_state)
game_state.next_clean_up_step
return true
end
Expand All @@ -2155,6 +2210,13 @@ class PetProcess
command_zombie('leave', game_state)
end

def dismiss_bonebug(game_state)
return unless @is_present
return unless game_state.cfw_active?

DRCA.release_cyclics
end

def update_behavior(game_state)
return unless game_state.cfb_active?
return unless @zombie['behavior']
Expand Down Expand Up @@ -4079,12 +4141,12 @@ class GameState
$tactics_actions = ['bob', 'weave', 'circle']

attr_accessor :action_count, :aim_queue, :analyze_combo_array, :blessed_room, :cast_timer,
:casting, :casting_cfb, :casting_consume, :casting_cyclic, :casting_moonblade,
:casting, :casting_cfb, :casting_cfw, :casting_nr, :casting_consume, :casting_cyclic, :casting_moonblade,
:casting_regalia, :casting_sorcery, :casting_weapon_buff, :charges, :charges_total,
:clean_up_step, :constructs, :cooldown_timers, :current_weapon_skill,
:currently_whirlwinding, :dance_queue, :dancing, :danger, :hide_on_cast,
:last_regalia_type, :last_weapon_skill, :loaded, :mob_died, :need_bundle,
:no_loot, :no_skins, :no_stab_current_mob, :no_stab_mobs, :parrying, :prepare_cfb,
:no_loot, :no_skins, :no_stab_current_mob, :no_stab_mobs, :parrying, :prepare_cfb, :prepare_cfw, :prepare_nr,
:prepare_consume, :regalia_cancel, :reset_stance, :retreating, :starlight_values,
:swap_regalia_type, :target_weapon_skill, :use_charged_maneuvers,
:whirlwind_trainables, :wounds
Expand Down Expand Up @@ -4122,8 +4184,12 @@ class GameState
@casting_weapon_buff = false
@casting_consume = false
@prepare_consume = false
@prepare_nr = false
@casting_nr = false
@prepare_cfb = false
@casting_cfb = false
@prepare_cfw = false
@casting_cfw = false
@use_charged_maneuvers = false
@wounds = {}
@blessed_room = false
Expand Down Expand Up @@ -4924,8 +4990,12 @@ class GameState

def necro_casting?
return false unless DRStats.necromancer?
return true if @prepare_nr
return true if @casting_nr
return true if @prepare_cfb
return true if @casting_cfb
return true if @prepare_cfw
return true if @casting_cfw
return true if @prepare_consume
return true if @casting_consume

Expand Down Expand Up @@ -5149,6 +5219,10 @@ class GameState
DRSpells.active_spells.include?('Call from Beyond')
end

def cfw_active?
DRSpells.active_spells.include?('Call from Within')
end

def construct_mode?
@construct_mode
end
Expand Down
3 changes: 2 additions & 1 deletion common-arcana.lic
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ module DRCA
/^The Rite of Contrition matrix loses cohesion, leaving your aura naked/, # Rite of Contrition (ROC)
/^The Rite of Forbearance matrix loses cohesion, leaving you to wallow in temptation/, # Rite of Forbearance (ROF)
/^The Rite of Grace matrix loses cohesion, leaving your body exposed/, # Rite of Grace (ROG)
/^The greenish hues about you vanish as the Universal Solvent matrix loses its cohesion/ # Universal Solvent (USOL)
/^The greenish hues about you vanish as the Universal Solvent matrix loses its cohesion/, # Universal Solvent (USOL)
/^You sense your Call from Within spell weaken and disperse/ # Call from Within (CFW)
]

def infuse_om(harness, amount)
Expand Down
Loading

0 comments on commit 2fe9c22

Please sign in to comment.