Remove creature move type record

This commit is contained in:
2025-06-06 15:32:19 +01:00
parent e9b69be7de
commit 7292bc9012
16 changed files with 193 additions and 183 deletions
+5 -4
View File
@@ -46,13 +46,13 @@ applyTerminalCommandArguments command args u = case command of
return $ u & uvWorld %~ flip (foldl' (&)) (replicate n (snd . createItemYou (itemFromBase ibt)))
"DEX" -> fromMaybe u $ do
x <- readMaybe =<< args ^? _head
return $ u & ypoint . crStatistics . dexterity .~ x
return $ u & ypoint . crType . avDexterity .~ x
"STR" -> fromMaybe u $ do
x <- readMaybe =<< args ^? _head
return $ u & ypoint . crStatistics . strength .~ x
return $ u & ypoint . crType . avStrength .~ x
"INT" -> fromMaybe u $ do
x <- readMaybe =<< args ^? _head
return $ u & ypoint . crStatistics . intelligence .~ x
return $ u & ypoint . crType . avIntelligence .~ x
_ -> u
where
ypoint = uvWorld . cWorld . lWorld . creatures . ix 0
@@ -85,7 +85,8 @@ applySetTerminalString var = case key' of
"hp" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crHP .~ round (fromJust val')
-- "invcap" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crInvCapacity .~ round (fromJust val')
-- "mass" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMass .~ fromJust val'
"mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMvType . mvSpeed .~ fromJust val'
-- "mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crMvType . mvSpeed .~ fromJust val'
"mvspeed" -> uvWorld . cWorld . lWorld . creatures . ix 0 . crType . avMoveSpeed .~ fromJust val'
_ -> showTerminalError ("set " ++ var) ("Invalid set command: " ++ key) -- never reached?
where
(key, val) = getSplitString var