Cleanup
This commit is contained in:
@@ -61,7 +61,7 @@ shootBezier targetp cr w = w & particles %~ (theBullet :)
|
||||
startp
|
||||
(controlp +.+ randPos)
|
||||
(targetp +.+ randPos')
|
||||
(destroyOnImpact bulHitCr bulHitWall bulHitFF')
|
||||
(destroyOnImpact bulHitCr bulHitWall)
|
||||
5
|
||||
controlp = mouseWorldPos w
|
||||
cid = _crID cr
|
||||
|
||||
@@ -8,21 +8,21 @@ import Geometry.Data
|
||||
basicBullet :: Ammo
|
||||
basicBullet = BulletAmmo
|
||||
{ _amString = "BULLET"
|
||||
, _amBulEff = destroyOnImpact bulHitCr bulHitWall bulHitFF'
|
||||
, _amBulEff = destroyOnImpact bulHitCr bulHitWall
|
||||
, _amBulWth = 2
|
||||
, _amBulVel = V2 50 0
|
||||
}
|
||||
ltBullet :: Ammo
|
||||
ltBullet = BulletAmmo
|
||||
{ _amString = "LTBULLET"
|
||||
, _amBulEff = destroyOnImpact bulHitCr bulHitWall bulHitFF'
|
||||
, _amBulEff = destroyOnImpact bulHitCr bulHitWall
|
||||
, _amBulWth = 2
|
||||
, _amBulVel = V2 40 0
|
||||
}
|
||||
hvBullet :: Ammo
|
||||
hvBullet = BulletAmmo
|
||||
{ _amString = "HVBULLET"
|
||||
, _amBulEff = penWalls hvBulHitCr hvBulHitWall' bulHitFF'
|
||||
, _amBulEff = penWalls hvBulHitCr hvBulHitWall'
|
||||
, _amBulWth = 6
|
||||
, _amBulVel = V2 80 0
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ moveLaser phaseV pos dir w pt
|
||||
xp = pos +.+ 800 *.* unitVectorAtAngle dir
|
||||
(a,g) = randomR (-0.7,0.7) $ _randGen w
|
||||
reflectDir wall = a + argV (reflectIn (uncurry (-.-) (_wlLine wall)) (xp -.- pos))
|
||||
f :: [Wall] -> Point2 -> Point2 -> (Maybe (Point2,Either3 Creature Wall ForceField),[Point2])
|
||||
f :: [Wall] -> Point2 -> Point2 -> (Maybe (Point2,Either Creature Wall),[Point2])
|
||||
f seenWs x y = case find (h' seenWs) $ thingsHitExceptCrLongLine Nothing x y w of
|
||||
Just (p,E3x2 wl)
|
||||
Just (p,Right wl)
|
||||
| _wlIsSeeThrough wl -> f' p $ f (wl:seenWs) p (h x y wl p)
|
||||
| otherwise -> (Just (p,E3x2 wl), [p])
|
||||
| otherwise -> (Just (p,Right wl), [p])
|
||||
Just (p,obj) -> (Just (p,obj), [p])
|
||||
Nothing -> (Nothing, [y])
|
||||
f' p (x,ps') = (x,p:ps')
|
||||
@@ -92,25 +92,20 @@ moveLaser phaseV pos dir w pt
|
||||
reflectInternal = 1 < abs (phaseV * sin angleInc')
|
||||
reflectExternal = 1 < abs (sin angleInc / phaseV)
|
||||
|
||||
h' ws (_,E3x2 wl) = not $ any (\w' -> _wlID w' == _wlID wl) ws
|
||||
h' ws (_,Right wl) = not $ any (\w' -> _wlID w' == _wlID wl) ws
|
||||
h' _ _ = True
|
||||
(thHit, ps) = f [] pos xp
|
||||
hitEffect
|
||||
= case thHit of
|
||||
Just (p,E3x1 cr)
|
||||
Just (p,Left cr)
|
||||
-> over (creatures . ix (_crID cr) . crState . crDamage) ((:) $ Lasering 19 pos p xp)
|
||||
Just (p,E3x2 wl) -> createSparkCol 8 (V4 20 (-5) 0 1) (p +.+ safeNormalizeV (pos -.- p))
|
||||
Just (p,Right wl) -> createSparkCol 8 (V4 20 (-5) 0 1) (p +.+ safeNormalizeV (pos -.- p))
|
||||
(reflectDir wl)
|
||||
_ -> id
|
||||
pic = setLayer 1 $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 yellow) $ lineOfThickness 20 (pos:ps)
|
||||
, setDepth 19.5 . color (brightX 10 1 yellow) $ lineOfThickness 3 (pos:ps)
|
||||
]
|
||||
-- $ pictures
|
||||
--[ fadeLine pos (head ps) 0.2 40 yellow
|
||||
--, setLayer 1 $ color (withAlpha 0.9 white) $ vThickLine (pos:ps)
|
||||
--, setLayer 1 $ color (withAlpha 0.5 yellow) $ vvThickLine (pos:ps)
|
||||
--]
|
||||
|
||||
fadeLine :: Point2 -> Point2 -> Float -> Float -> Color -> Picture
|
||||
fadeLine sp ep alph width col = setLayer 1 $ polygonCol
|
||||
|
||||
Reference in New Issue
Block a user