Skip to content

Commit

Permalink
Merge branch 'rpherbig:master' into outdoorsmanship_skip_magic
Browse files Browse the repository at this point in the history
  • Loading branch information
MahtraDR authored Jun 8, 2024
2 parents 92a4885 + 98f0dac commit e316b0b
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 395 deletions.
102 changes: 52 additions & 50 deletions bescort.lic
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class Bescort

@settings = get_settings
@equipment_manager = EquipmentManager.new(@settings)
@flying_mount = @settings.flying_mount

pause

Expand Down Expand Up @@ -323,7 +324,7 @@ class Bescort
mode = mode.downcase
case mode
when 'mount'
DRC.bput("get my #{type}", /You get/, /You pick up/, /You are already holding/, /What were you referring/)
DRCI.get_item?(type)
case type
when /broom|dirigible/i
case DRC.bput("mount my #{type}", /You mount your/, /You are already mounted/, /What were you referring/)
Expand All @@ -349,15 +350,14 @@ class Bescort
case type
when /broom|dirigible/i
DRC.bput('dismount', /Your .* floats down to the ground/, /You climb off/)
@equipment_manager.empty_hands
when /carpet|rug/i
DRC.bput('dismount', /Your .* floats down to the ground/, /You climb off/)
DRC.bput("roll #{type}", /You roll up/, /You can't roll/)
DRC.bput("stow my #{type}", /You put/, /You pick up/, /Stow what?/)
else
DRC.message("#{type} is not a valid type of flying mount.")
exit
end
DRCI.put_away_item?(type)
end
end

Expand Down Expand Up @@ -468,18 +468,16 @@ class Bescort
manual_go2(start_room)
move('go stream bank')
# Once in the stream then you're in a safe room, get mount or remove gear.
flying_mount = @settings.flying_mount
@equipment_manager.empty_hands
have_changed_gear = flying_mount ? false : @equipment_manager.wear_equipment_set?('swimming')
if flying_mount
use_flying_mount(flying_mount, 'mount')
have_changed_gear = @flying_mount ? false : @equipment_manager.wear_equipment_set?('swimming')
if @flying_mount
use_flying_mount(@flying_mount, 'mount')
move(moveset.first) # mount travels all three rooms at once
else
moveset.each { |dir| swim(dir) }
end
use_flying_mount(flying_mount, 'dismount') if flying_mount
use_flying_mount(@flying_mount, 'dismount') if @flying_mount
# While in the stream then you're in a safe room, dismount or wear gear.
@equipment_manager.empty_hands
@equipment_manager.wear_equipment_set?('standard') if have_changed_gear
move('go stream bank')
# You're now among cave trolls!
Expand Down Expand Up @@ -1076,13 +1074,12 @@ class Bescort
end

def faldesu(mode)
flying_mount = @settings.flying_mount
unless mode =~ /haven|crossing/i
echo 'You must specify haven or crossing for traversing the faldesu river'
exit
end

if flying_mount
if @flying_mount
swim_faldesu(mode =~ /haven/i)
return
end
Expand All @@ -1108,40 +1105,45 @@ class Bescort
path = mode == 'shard' ? $ICE_PATH_SHARD : $ICE_PATH_HIB

@equipment_manager.empty_hands
settings = get_settings
footwear = settings.footwear
footwear = @settings.footwear
move_fast = false
footwear_removed = false
skates_worn = false

# If the footwear setting has been defined then respect that
# and only try to remove it. If you're not wearing this item
# then obviously nothing on your feet will be removed.
# You might:
# - have incorrect yaml
# - put something else on (or nothing on)
# - already wearing your skates
if footwear
if DRCI.remove_item?(footwear)
footwear_removed = true
DRCI.put_away_item?(footwear)
if @flying_mount
move_fast = true
use_flying_mount(@flying_mount, 'mount', 'glide')
path = mode == 'shard' ? %w[se se sw sw se] : %w[nw ne ne nw sw]
else
# If the footwear setting has been defined then respect that
# and only try to remove it. If you're not wearing this item
# then obviously nothing on your feet will be removed.
# You might:
# - have incorrect yaml
# - put something else on (or nothing on)
# - already wearing your skates
if footwear
if DRCI.remove_item?(footwear)
footwear_removed = true
DRCI.put_away_item?(footwear)
end
end
end

# If you have some skates then try to get and wear them.
# Note, if you're already wearing the skates then we won't
# be able to "get" them, and that's why the attempt to wear
# is not conditional upon you getting them to your hands.
if DRCI.exists?('skates')
DRCI.get_item?('skates')
if DRCI.wear_item?('skates')
skates_worn = true
else
DRCI.put_away_item?('skates')
# If you have some skates then try to get and wear them.
# Note, if you're already wearing the skates then we won't
# be able to "get" them, and that's why the attempt to wear
# is not conditional upon you getting them to your hands.
if DRCI.exists?('skates')
DRCI.get_item?('skates')
if DRCI.wear_item?('skates')
skates_worn = true
else
DRCI.put_away_item?('skates')
end
end
end

move_fast = skates_worn
move_fast = skates_worn
end

# Despite our best efforts, if bescort starts moving you fast
# and the game gives you warnings to slow down, SLOW DOWN!
Expand Down Expand Up @@ -1174,6 +1176,10 @@ class Bescort
DRCI.get_item?(footwear)
DRCI.wear_item?(footwear)
end

if @flying_mount
use_flying_mount(@flying_mount, 'dismount')
end
end

def swim(dir)
Expand All @@ -1183,13 +1189,12 @@ class Bescort
end

def swim_faldesu(north)
flying_mount = @settings.flying_mount
start = north ? 1375 : 473
manual_go2(start)
moveset = north ? %w[north northwest northeast] : %w[south southwest southeast]
move 'dive river'
if flying_mount
use_flying_mount(flying_mount, 'mount')
if @flying_mount
use_flying_mount(@flying_mount, 'mount')
if north
move n
move nw
Expand All @@ -1198,8 +1203,7 @@ class Bescort
move sw
end
move 'go bridge'
use_flying_mount(flying_mount, 'dismount')
@equipment_manager.empty_hands
use_flying_mount(@flying_mount, 'dismount')
else
swim(moveset[0]) while XMLData.room_exits.include?(moveset[0])
swim(moveset[1]) while XMLData.room_exits.include?('east')
Expand Down Expand Up @@ -1477,9 +1481,8 @@ class Bescort
end

def segoltha(mode)
flying_mount = @settings.flying_mount
@equipment_manager.empty_hands
have_changed_gear = flying_mount ? false : @equipment_manager.wear_equipment_set?('swimming')
have_changed_gear = @flying_mount ? false : @equipment_manager.wear_equipment_set?('swimming')
move_count = 0
if mode =~ /^n/i
dir_of_travel = 'north'
Expand All @@ -1495,8 +1498,8 @@ class Bescort
exit
end

if flying_mount
use_flying_mount(flying_mount, 'mount', 'skim')
if @flying_mount
use_flying_mount(@flying_mount, 'mount', 'skim')
if dir_of_travel == 'south'
move 'go bank'
move 'west'
Expand All @@ -1511,7 +1514,7 @@ class Bescort
move 'east'
move 'go slope'
end
use_flying_mount(flying_mount, 'dismount')
use_flying_mount(@flying_mount, 'dismount')
return
end

Expand Down Expand Up @@ -1640,7 +1643,7 @@ class Bescort
DRCA.release_cyclics
unless DRCA.cast_spell({ 'abbrev' => 'rezz',
'mana' => 5,
'cyclic' => true }, get_settings)
'cyclic' => true }, @settings)
echo('Failed to cast Resurrection! Try again or use the puzzle to enter.')
exit
end
Expand Down Expand Up @@ -2014,7 +2017,6 @@ class Bescort
def get_fare?(amount, town, room)
return false unless @settings.bescort_fare_handling

settings = get_settings
echo 'GETTING MONEY, YOU SLOB.'
echo "Heading to #{town} for public transportation fare"
pause 1
Expand All @@ -2025,7 +2027,7 @@ class Bescort
echo 'You might be a necromancer! Get some money manually!'
return false
end
settings.hometown = town
@settings.hometown = town
succeeded = false
DRCM.minimize_coins(amount).each { |each_amount| succeeded = DRCM.get_money_from_bank(each_amount, settings) }
echo "Put some fare money in the #{town} bank!" unless succeeded
Expand Down
2 changes: 1 addition & 1 deletion circlecheck.lic
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ $GuildReqs = {

},
hard_reqs: ['Evasion', 'Parry Ability', 'Expertise', 'Inner Fire', 'Tactics'],
restricted: ['Sorcery', 'Thievery', 'Utility', 'Targeted Magic', 'Offhand Weapon']
restricted: ['Sorcery', 'Thievery', 'Targeted Magic', 'Offhand Weapon']
},

'Necromancer' => {
Expand Down
6 changes: 4 additions & 2 deletions combat-trainer.lic
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,18 @@ class SetupProcess

private

def armor_hysteresis?
def armor_hysteresis?(game_state)
return false unless @armor_hysteresis
return false if @cycle_armors.keys.any? { |skill| DRSkill.getxp(skill) < 25 }

all_swap_pieces = @cycle_armors.keys.map { |armortype| @cycle_armors[armortype] }.flatten
if @cycle_armors.keys.all? { |skill| DRSkill.getxp(skill) > 32 }
if @last_worn_type != @default_armor && @cycle_armors.keys.include?(@default_armor)
game_state.sheath_whirlwind_offhand
@equipment_manager.worn_items(all_swap_pieces).each { |item| @equipment_manager.remove_item(item) }
@equipment_manager.wear_items(@equipment_manager.desc_to_items(@cycle_armors[@default_armor]))
@last_worn_type = @default_armor
game_state.wield_whirlwind_offhand
end
end
true
Expand All @@ -113,7 +115,7 @@ class SetupProcess
end

def check_armor_swap(game_state)
return if armor_hysteresis?
return if armor_hysteresis?(game_state)
return if Time.now - @last_cycle_time < @cycle_armors_time
return if game_state.loaded

Expand Down
2 changes: 2 additions & 0 deletions data/base-spells.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ prep_messages:
- Please don't do that here
- You cannot use the tattoo while maintaining the effort to stay hidden
- As you attempt to prepare the spell, a sense of overwhelming peace washes over you
# You tried to target a spell but there is nothing left to face
- There is nothing else to face

cast_messages:
- Converging in midair, angular ripples assemble a slender hexagonal rod whorled with faintly shifting fractals
Expand Down
Loading

0 comments on commit e316b0b

Please sign in to comment.