Skip to content

Commit

Permalink
Merge pull request #6928 from hat071af/flying-mount
Browse files Browse the repository at this point in the history
[script] [bescort] Added more flying mount functionality
  • Loading branch information
MahtraDR authored Nov 17, 2024
2 parents 4f0035f + ca7ee3e commit 8d890bf
Showing 1 changed file with 47 additions and 7 deletions.
54 changes: 47 additions & 7 deletions bescort.lic
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,13 @@ class Bescort
@settings = get_settings
@equipment_manager = EquipmentManager.new(@settings)
@flying_mount = @settings.flying_mount
if @settings.mountable_item
@flying_mount_item = @settings.mountable_item
else
@flying_mount_item = @settings.flying_mount
end
@flying_mount_activate = @settings.mountable_verb
@flying_mount_dismount = @settings.mountable_dismount

pause

Expand Down Expand Up @@ -324,16 +331,17 @@ class Bescort
mode = mode.downcase
case mode
when 'mount'
DRCI.get_item?(type)
case type
when /broom|dirigible/i
when /broom|dirigible/i # This section is for broom type flying mounts that are just mounted
DRCI.get_item?(type)
case DRC.bput("mount my #{type}", /You mount your/, /You are already mounted/, /What were you referring/)
when /What were you referring/
DRC.message("Can't mount your #{type}, where is it?")
exit
end
DRC.bput("command #{type} to #{speed}", /You command your/)
when /carpet|rug/i
when /carpet|rug/i # This section is for carpet style flying mounts that are lowered/unrolled before mounting
DRCI.get_item?(type)
DRC.bput(DRC.right_hand == type ? "lower ground right" : "lower ground left", /You lower/, /But you aren't holding/)
DRC.bput("unroll #{type}", /You carefully unroll/, /You can't unroll/, /What were you referring/)
case DRC.bput("mount #{type}", /You step onto your .* which comes to life and slowly raises up off of the ground/, /You are already mounted/, /What were you referring/)
Expand All @@ -342,6 +350,15 @@ class Bescort
exit
end
DRC.bput("command #{type} to #{speed}", /You command your/)
when /cloud/i # This section is for mounts with different nouns than their activating item. May need to add more activation matches.
DRCI.remove_item?(@flying_mount_item)
DRCI.get_item_if_not_held?(@flying_mount_item)
case DRC.bput("#{@flying_mount_activate} my #{@flying_mount_item}", /You gently buff/, /Rub what/)
when /What were you referring/
DRC.message("Can't mount your #{type}, where is it?")
exit
end
DRC.bput("command #{type} to #{speed}", /You command your/, /You signal the/)
else
DRC.message("#{type} is not a valid type of flying mount.")
exit
Expand All @@ -350,14 +367,20 @@ class Bescort
case type
when /broom|dirigible/i
DRC.bput('dismount', /Your .* floats down to the ground/, /You climb off/)
DRCI.put_away_item?(type)
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/)
DRCI.put_away_item?(type)
when /cloud/i
DRC.bput("#{@flying_mount_dismount} #{type}", /With a gesture,/)
DRCI.wear_item?(@flying_mount_item)
DRCI.put_away_item?(@flying_mount_item) if checkright
DRCI.put_away_item?(@flying_mount_item) if checkleft
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 @@ -1112,7 +1135,15 @@ class Bescort

if @flying_mount
move_fast = true
use_flying_mount(@flying_mount, 'mount', 'glide')
case @flying_mount
when /broom|dirigible|carpet|rug/i
use_flying_mount(@flying_mount, 'mount', 'glide')
when /cloud/i
use_flying_mount(@flying_mount, 'mount', 'drift')
else
DRC.message("#{@flying_mount} is not a valid type of flying mount.")
exit
end
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
Expand Down Expand Up @@ -1192,9 +1223,9 @@ class Bescort
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')
move 'go river'
if north
move n
move nw
Expand All @@ -1205,6 +1236,7 @@ class Bescort
move 'go bridge'
use_flying_mount(@flying_mount, 'dismount')
else
move 'dive river'
swim(moveset[0]) while XMLData.room_exits.include?(moveset[0])
swim(moveset[1]) while XMLData.room_exits.include?('east')
swim(moveset[2]) while XMLData.room_exits.include?(moveset[0])
Expand Down Expand Up @@ -1499,7 +1531,15 @@ class Bescort
end

if @flying_mount
use_flying_mount(@flying_mount, 'mount', 'skim')
case @flying_mount
when /broom|dirigible|carpet|rug/i
use_flying_mount(@flying_mount, 'mount', 'skim')
when /cloud/i
use_flying_mount(@flying_mount, 'mount', 'hover')
else
DRC.message("#{@flying_mount} is not a valid type of flying mount.")
exit
end
if dir_of_travel == 'south'
move 'go bank'
move 'west'
Expand Down

0 comments on commit 8d890bf

Please sign in to comment.