Skip to content

Commit

Permalink
Merge pull request #6854 from MahtraDR/equimanager_paralysis
Browse files Browse the repository at this point in the history
[scripts][equipmanager] Account for paralysis blocking weapon swaps
  • Loading branch information
MahtraDR committed Jun 26, 2024
2 parents b5c9b42 + f57e96b commit c3a0238
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions equipmanager.lic
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class EquipmentManager
DRCI.get_item_if_not_held?(temp_right_item)
DRCI.get_item_if_not_held?(temp_left_item)
# In case they end up in different hands, swap.
DRC.bput('swap', 'You move') if (DRC.left_hand != temp_left_item || DRC.right_hand != temp_right_item)
DRC.bput('swap', /You move/, /^Will alone cannot conquer the paralysis/) if (DRC.left_hand != temp_left_item || DRC.right_hand != temp_right_item)
else
# If removing item transforms it (e.g. exoskeletal armor => orb) then continue with the transformed item.
if item.transforms_to && DRCI.in_hands?(item.transforms_to)
Expand Down Expand Up @@ -199,8 +199,14 @@ class EquipmentManager

if get_item?(weapon)
swap_to_skill?(weapon.name, skill) if skill && weapon.swappable
DRC.bput('swap', 'You move') if DRCI.in_right_hand?(weapon)
return true
if DRCI.in_right_hand?(weapon)
case DRC.bput('swap', /^You move/, /^Will alone cannot conquer the paralysis/)
when /^You move/
return true
else
return false
end
end
end

return false
Expand Down Expand Up @@ -230,8 +236,15 @@ class EquipmentManager

if get_item?(weapon)
swap_to_skill?(weapon.name, skill) if skill && weapon.swappable
DRC.bput('swap', 'You move') if offhand && DRC.right_hand
return true

if offhand && DRC.right_hand
case DRC.bput('swap', /^You move/, /^Will alone cannot conquer the paralysis/)
when /^You move/
return true
else
return false
end
end
end

return false
Expand Down

0 comments on commit c3a0238

Please sign in to comment.