Cleanup
This commit is contained in:
@@ -14,7 +14,7 @@ import Control.Lens
|
|||||||
-- previous frame
|
-- previous frame
|
||||||
-- Not sure if it is a good idea
|
-- Not sure if it is a good idea
|
||||||
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
crIsArmouredFrom :: Point2 -> Creature -> Bool
|
||||||
crIsArmouredFrom p cr = hasFrontArmour p cr
|
crIsArmouredFrom = hasFrontArmour
|
||||||
|
|
||||||
hasFrontArmour :: Point2 -> Creature -> Bool
|
hasFrontArmour :: Point2 -> Creature -> Bool
|
||||||
hasFrontArmour p cr = fromMaybe False $ do
|
hasFrontArmour p cr = fromMaybe False $ do
|
||||||
|
|||||||
@@ -377,6 +377,7 @@ data ItemUse
|
|||||||
{ _lUse :: Item -> Creature -> World -> World
|
{ _lUse :: Item -> Creature -> World -> World
|
||||||
, _useDelay :: UseDelay
|
, _useDelay :: UseDelay
|
||||||
, _useHammer :: HammerType
|
, _useHammer :: HammerType
|
||||||
|
, _eqSite :: EquipSite
|
||||||
}
|
}
|
||||||
| ConsumeUse
|
| ConsumeUse
|
||||||
{ _cUse :: Item -> Creature -> World -> World
|
{ _cUse :: Item -> Creature -> World -> World
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ defaultlUse = LeftUse
|
|||||||
{ _lUse = \_ _ -> id
|
{ _lUse = \_ _ -> id
|
||||||
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
, _useDelay = FixedRate {_rateMax = 8, _rateTime = 0}
|
||||||
, _useHammer = NoHammer
|
, _useHammer = NoHammer
|
||||||
|
, _eqSite = GoesOnSpecial
|
||||||
}
|
}
|
||||||
|
|
||||||
luseInstantNoH :: (Item -> Creature -> World -> World) -> ItemUse
|
luseInstantNoH :: (Item -> Creature -> World -> World) -> ItemUse
|
||||||
@@ -72,6 +73,7 @@ luseInstantNoH f = LeftUse
|
|||||||
{ _lUse = f
|
{ _lUse = f
|
||||||
, _useDelay = NoDelay
|
, _useDelay = NoDelay
|
||||||
, _useHammer = NoHammer
|
, _useHammer = NoHammer
|
||||||
|
, _eqSite = GoesOnSpecial
|
||||||
}
|
}
|
||||||
defaultAimParams :: AimParams
|
defaultAimParams :: AimParams
|
||||||
defaultAimParams = AimParams
|
defaultAimParams = AimParams
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ flameThrower = defaultAutoGun
|
|||||||
{ _dimRad = 7
|
{ _dimRad = 7
|
||||||
, _dimCenter = V3 9 0 0
|
, _dimCenter = V3 9 0 0
|
||||||
, _dimPortage = HeldItem
|
, _dimPortage = HeldItem
|
||||||
{ _handlePos = 5
|
{ _handlePos = 0
|
||||||
, _muzPos = 18
|
, _muzPos = 18
|
||||||
}
|
}
|
||||||
, _dimSPic = flamerPic
|
, _dimSPic = flamerPic
|
||||||
|
|||||||
@@ -385,11 +385,19 @@ withMuzFlareI f it cr w = makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) flashPos
|
|||||||
. muzFlareAt (V4 5 5 0 2) flarePos cdir
|
. muzFlareAt (V4 5 5 0 2) flarePos cdir
|
||||||
$ f it cr w
|
$ f it cr w
|
||||||
where
|
where
|
||||||
flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset +.+.+ V3 0 0 20)
|
flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 0 0 20)
|
||||||
flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset +.+.+ V3 5 0 20)
|
flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 5 0 20)
|
||||||
muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
|
-- muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
|
||||||
cdir = _crDir cr
|
cdir = _crDir cr
|
||||||
|
|
||||||
|
muzzleOffset :: Creature -> Item -> Point3
|
||||||
|
muzzleOffset cr it = V3 (holdOffset + 5 + _muzPos dimPort - _handlePos dimPort) 0 0
|
||||||
|
where
|
||||||
|
dimPort = _dimPortage $ _itDimension it
|
||||||
|
holdOffset
|
||||||
|
| crInStance OneHand cr = 10
|
||||||
|
| otherwise = 0
|
||||||
|
|
||||||
withMuzPos :: (Point3 -> World -> World) -> ChainEffect
|
withMuzPos :: (Point3 -> World -> World) -> ChainEffect
|
||||||
withMuzPos = withMuzPosShift (V2 0 0)
|
withMuzPos = withMuzPosShift (V2 0 0)
|
||||||
withMuzPosShift :: Point2 -> (Point3 -> World -> World) -> ChainEffect
|
withMuzPosShift :: Point2 -> (Point3 -> World -> World) -> ChainEffect
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ rewindGun = defaultGun
|
|||||||
, _wpCharge = 0
|
, _wpCharge = 0
|
||||||
}
|
}
|
||||||
, _itEffect = ItRewindEffect rewindEffect []
|
, _itEffect = ItRewindEffect rewindEffect []
|
||||||
, _itUse = defaultlUse {_lUse = \itm cr -> useRewindGun itm cr}
|
, _itUse = defaultlUse {_lUse = useRewindGun}
|
||||||
}
|
}
|
||||||
rewindEffect :: Item -> Creature -> World -> World
|
rewindEffect :: Item -> Creature -> World -> World
|
||||||
rewindEffect itm cr w
|
rewindEffect itm cr w
|
||||||
@@ -109,7 +109,7 @@ aSelf :: Creature -> World -> World
|
|||||||
aSelf = blinkAction
|
aSelf = blinkAction
|
||||||
|
|
||||||
aSelfL :: Item -> Creature -> World -> World
|
aSelfL :: Item -> Creature -> World -> World
|
||||||
aSelfL _ cr = blinkAction cr
|
aSelfL _ = blinkAction
|
||||||
|
|
||||||
effectGun :: String -> (Creature -> World -> World) -> Item
|
effectGun :: String -> (Creature -> World -> World) -> Item
|
||||||
effectGun name eff = defaultGun
|
effectGun name eff = defaultGun
|
||||||
|
|||||||
+2
-2
@@ -49,11 +49,11 @@ rotateSP :: Float -> SPic -> SPic
|
|||||||
rotateSP a = bimap (rotateSH a) (rotate a)
|
rotateSP a = bimap (rotateSH a) (rotate a)
|
||||||
|
|
||||||
mirrorSPxz :: SPic -> SPic
|
mirrorSPxz :: SPic -> SPic
|
||||||
mirrorSPxz = bimap (reverse . overPosSH flipy) (mirrorxz)
|
mirrorSPxz = bimap (reverse . overPosSH flipy) mirrorxz
|
||||||
where
|
where
|
||||||
flipy (V3 x y z) = V3 x (negate y) z
|
flipy (V3 x y z) = V3 x (negate y) z
|
||||||
|
|
||||||
mirrorSPyz :: SPic -> SPic
|
mirrorSPyz :: SPic -> SPic
|
||||||
mirrorSPyz = bimap (reverse . overPosSH flipx) (mirroryz)
|
mirrorSPyz = bimap (reverse . overPosSH flipx) mirroryz
|
||||||
where
|
where
|
||||||
flipx (V3 x y z) = V3 (negate x) y z
|
flipx (V3 x y z) = V3 (negate x) y z
|
||||||
|
|||||||
Reference in New Issue
Block a user