Start to generalise text input to "terminal signal" input
This commit is contained in:
@@ -149,7 +149,7 @@ circleLaser it cr w
|
||||
| otherwise = w
|
||||
where
|
||||
cpos = _crPos cr
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . cwCamPos)
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . cwCam)
|
||||
pos = _crPos cr +.+ rotateV dir (V2 0 (max 70 $ dist cpos mwp))
|
||||
dir = fromIntegral (_lasCycle (_itParams it)) * pi / 1000
|
||||
phasev = _phaseV . _itParams $ _crInv cr IM.! itRef
|
||||
@@ -169,7 +169,7 @@ shootDualLaser it cr w =
|
||||
gap = _dbGap . _itParams $ it
|
||||
posl = pos +.+ (- gap) *.* vNormal (unitVectorAtAngle dir)
|
||||
posr = pos +.+ gap *.* vNormal (unitVectorAtAngle dir)
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . cwCamPos)
|
||||
mwp = mouseWorldPos (w ^. input) (w ^. cWorld . cwCam)
|
||||
mwp'
|
||||
| dist mwp (_crPos cr) < aimlength + 5 = _crPos cr +.+ (aimlength + 5) *.* unitVectorAtAngle dir
|
||||
| otherwise = mwp
|
||||
|
||||
@@ -589,7 +589,7 @@ torqueBefore torque feff item cr w
|
||||
w
|
||||
& randGen .~ g
|
||||
& cWorld . lWorld . creatures . ix cid . crDir +~ rot
|
||||
& cWorld . cwCamPos . camRot +~ rot
|
||||
& cWorld . cwCam . camRot +~ rot
|
||||
| otherwise = feff item cr $ set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -610,7 +610,7 @@ torqueBeforeAtLeast minTorque exTorque feff item cr w
|
||||
w
|
||||
& randGen .~ g
|
||||
& cWorld . lWorld . creatures . ix cid . crDir +~ rot'
|
||||
& cWorld . cwCamPos . camRot +~ rot'
|
||||
& cWorld . cwCam . camRot +~ rot'
|
||||
| otherwise = feff item cr $ set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot') w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -623,7 +623,7 @@ torqueBeforeAtLeast minTorque exTorque feff item cr w
|
||||
withTorqueAfter :: ChainEffect
|
||||
withTorqueAfter feff item cr w
|
||||
-- | cid == 0 = rotateScope $ set randGen g $ over cameraRot (+rot) $ feff item cr w
|
||||
| cid == 0 = set randGen g $ over (cWorld . cwCamPos . camRot) (+ rot) $ feff item cr w
|
||||
| cid == 0 = set randGen g $ over (cWorld . cwCam . camRot) (+ rot) $ feff item cr w
|
||||
| otherwise = set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) $ feff item cr w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -661,7 +661,7 @@ sideEffectOnFrame i sf f it cr w =
|
||||
|
||||
torqueSideEffect :: Float -> Item -> Creature -> World -> World
|
||||
torqueSideEffect torque _ cr w
|
||||
| cid == 0 = set randGen g $ over (cWorld . cwCamPos . camRot) (+ rot) w
|
||||
| cid == 0 = set randGen g $ over (cWorld . cwCam . camRot) (+ rot) w
|
||||
| otherwise = set randGen g $ over (cWorld . lWorld . creatures . ix cid . crDir) (+ rot) w
|
||||
where
|
||||
cid = _crID cr
|
||||
@@ -708,12 +708,12 @@ duplicateOffsetsFocus xs eff item cr w = foldr f w poss
|
||||
& crPos %~ (+.+ pos)
|
||||
& crDir .~ thedir pos
|
||||
thedir pos
|
||||
| dist (mouseWorldPos (w ^. input) (w ^. cWorld . cwCamPos)) (_crPos cr) < aimingMuzzlePos cr item =
|
||||
| dist (mouseWorldPos (w ^. input) (w ^. cWorld . cwCam)) (_crPos cr) < aimingMuzzlePos cr item =
|
||||
argV
|
||||
( _crPos cr +.+ aimingMuzzlePos cr item *.* unitVectorAtAngle (_crDir cr)
|
||||
-.- (_crPos cr +.+ pos)
|
||||
)
|
||||
| otherwise = argV (mouseWorldPos (w ^. input) (w ^. cWorld . cwCamPos) -.- (_crPos cr +.+ pos))
|
||||
| otherwise = argV (mouseWorldPos (w ^. input) (w ^. cWorld . cwCam) -.- (_crPos cr +.+ pos))
|
||||
|
||||
duplicateItem :: (Item -> [Item]) -> ChainEffect
|
||||
duplicateItem fit eff itm cr w = foldr f w (fit itm)
|
||||
|
||||
Reference in New Issue
Block a user