Replace previously-wielded items when wielding
When wielding a new item, put any previously-wielded items back in the character's backpack.
This commit is contained in:
parent
ffc8e793d5
commit
0373e06c02
1 changed files with 3 additions and 1 deletions
|
@ -250,7 +250,9 @@ handleCommand Wield = do
|
|||
selectItemFromInventory_ ["wield", "menu"] Cancellable asWieldedItem
|
||||
(say_ ["wield", "nothing"])
|
||||
$ \(MenuResult item) -> do
|
||||
character . inventory . wielded .= inRightHand item
|
||||
prevItems <- character . inventory . wielded <<.= inRightHand item
|
||||
character . inventory . backpack
|
||||
<>= fromList (prevItems ^.. wieldedItems . wieldedItem)
|
||||
say ["wield", "wielded"] item
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue