2018-07-22 20:30:17 +00:00
|
|
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
|
|
|
module Object where
|
|
|
|
|
|
|
|
import Affection
|
|
|
|
|
|
|
|
import Data.Ecstasy
|
|
|
|
|
|
|
|
import Types
|
|
|
|
|
|
|
|
instance ObjectAction UserData ObjType where
|
|
|
|
objectAction ObjCopier ent = do
|
|
|
|
ud <- getAffection
|
|
|
|
(nws, _) <- liftIO $ yieldSystemT (worldState ud) $ do
|
|
|
|
emap (anEnt ent) $ do
|
|
|
|
with anim
|
|
|
|
liftIO $ logIO Debug "copying!"
|
|
|
|
let nstat = AnimState
|
|
|
|
(AnimId "copier" "copy" N)
|
|
|
|
0
|
|
|
|
0
|
|
|
|
return unchanged
|
|
|
|
{ anim = Set nstat
|
|
|
|
}
|
|
|
|
putAffection ud
|
|
|
|
{ worldState = nws
|
|
|
|
}
|
2018-07-30 13:34:45 +00:00
|
|
|
|
|
|
|
objectAction _ _ = return ()
|