make hacking not abortable by NPCs

This commit is contained in:
nek0 2018-09-01 18:27:18 +02:00
parent 6c54aabc94
commit 8d2aba5f7b

View file

@ -187,21 +187,24 @@ instance ObjectAction ObjType ObjState where
} }
return e return e
objectTransition ObjComputer "hack" pa ent = do objectTransition ObjComputer "hack" pa ent =
[e] <- efor (anEnt ent) $ do if pa
let nstat = AnimState then do
(AnimId "computer" "off" N) [e] <- efor (anEnt ent) $ do
0 let nstat = AnimState
0 (AnimId "computer" "off" N)
ost <- query objStateTime 0
return unchanged 0
{ anim = Set nstat ost <- query objStateTime
, objState = Set "off" return unchanged
, objPlayerActivated = Unset { anim = Set nstat
, objStateTime = Unset , objState = Set "off"
, objSolved = if pa then Set (ost < 0) else Keep , objPlayerActivated = Unset
} , objStateTime = Unset
return e , objSolved = if pa then Set (ost < 0) else Keep
}
return e
else return unchanged
objectTransition _ _ _ _ = return unchanged objectTransition _ _ _ _ = return unchanged