Tweak muzzle flare
This commit is contained in:
@@ -60,14 +60,12 @@ useAmmoParams :: Item -> Creature -> World -> World
|
|||||||
useAmmoParams it cr w =
|
useAmmoParams it cr w =
|
||||||
w & cWorld . lWorld . instantBullets
|
w & cWorld . lWorld . instantBullets
|
||||||
.:~ ( _amBullet bultype
|
.:~ ( _amBullet bultype
|
||||||
-- & buPos .~ sp
|
|
||||||
& buPos .~ _crPos cr
|
& buPos .~ _crPos cr
|
||||||
& buTrajectory %~ settrajectory
|
& buTrajectory %~ settrajectory
|
||||||
& buVel %~ (rotateV dir . (muzvel *.*))
|
& buVel %~ (rotateV dir . (muzvel *.*))
|
||||||
& buDrag *~ _rifling (_itParams it)
|
& buDrag *~ _rifling (_itParams it)
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
--sp = _crPos cr +.+ (muzlength + 10) *.* unitVectorAtAngle dir
|
|
||||||
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
sp = _crPos cr +.+ (muzlength ^?! _head . _x) *.* unitVectorAtAngle dir
|
||||||
dir = _crDir cr
|
dir = _crDir cr
|
||||||
bultype = _laAmmoType $ _heldConsumption $ _itUse it
|
bultype = _laAmmoType $ _heldConsumption $ _itUse it
|
||||||
|
|||||||
@@ -218,9 +218,9 @@ useMod hm = case hm of
|
|||||||
, blCheck
|
, blCheck
|
||||||
]
|
]
|
||||||
PistolMod ->
|
PistolMod ->
|
||||||
[ withMuzFlareI
|
[ withSidePushI 50
|
||||||
, withSidePushI 50
|
|
||||||
, withRecoil
|
, withRecoil
|
||||||
|
, withMuzFlareI
|
||||||
, withTorqueAfter
|
, withTorqueAfter
|
||||||
, duplicateLoadedBarrels
|
, duplicateLoadedBarrels
|
||||||
, withSoundStart tap3S
|
, withSoundStart tap3S
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ bangStick i =
|
|||||||
& itUse . heldDelay . rateMax .~ 8
|
& itUse . heldDelay . rateMax .~ 8
|
||||||
& itUse . heldMods .~ BangStickMod
|
& itUse . heldMods .~ BangStickMod
|
||||||
& itUse . heldAim . aimHandlePos .~ 5
|
& itUse . heldAim . aimHandlePos .~ 5
|
||||||
& itUse . heldAim . aimMuzzles .~ [Muzzle 10 a 0.01 | a <- spreadAroundCenter i baseStickSpread]
|
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) a 0.01 | a <- spreadAroundCenter i baseStickSpread]
|
||||||
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
|
& itUse . heldConsumption . laSource . _InternalSource . iaMax .~ i
|
||||||
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
|
& itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadPartialInsert 10 1]
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ pistol =
|
|||||||
)
|
)
|
||||||
& itUse . heldDelay . rateMax .~ 6
|
& itUse . heldDelay . rateMax .~ 6
|
||||||
& itUse . heldMods .~ PistolMod
|
& itUse . heldMods .~ PistolMod
|
||||||
& itUse . heldAim . aimMuzzles .~ [Muzzle 0 0 0.05]
|
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 10 0) 0 0.05]
|
||||||
& itParams
|
& itParams
|
||||||
%~ ( (muzVel .~ 0.8)
|
%~ ( (muzVel .~ 0.8)
|
||||||
. (rifling .~ 0.8)
|
. (rifling .~ 0.8)
|
||||||
|
|||||||
@@ -453,17 +453,14 @@ modClock n chainEff eff it cr w
|
|||||||
| otherwise = eff it cr w
|
| otherwise = eff it cr w
|
||||||
|
|
||||||
withMuzFlareI :: ChainEffect
|
withMuzFlareI :: ChainEffect
|
||||||
withMuzFlareI f it cr w =
|
withMuzFlareI f it cr =
|
||||||
makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) (cpos `v2z` 20)
|
makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) (cpos `v2z` 20)
|
||||||
. muzFlareAt (V4 5 5 0 2) (cpos `v2z` 20) cdir
|
-- . muzFlareAt (V4 5 5 0 2) (cpos `v2z` 20) cdir
|
||||||
$ f it cr w
|
. muzFlareAt (V4 5 5 1 3) (cpos `v2z` 20) cdir
|
||||||
-- makeTlsTimeRadColPos 2 100 (V3 1 1 0.5) flashPos
|
. muzFlareAt (V4 5 5 1 3) (cpos `v2z` 20) cdir
|
||||||
-- . muzFlareAt (V4 5 5 0 2) flarePos cdir
|
. muzFlareAt (V4 5 5 1 3) (cpos `v2z` 20) cdir
|
||||||
-- $ f it cr w
|
. f it cr
|
||||||
where
|
where
|
||||||
-- flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 0 0 20)
|
|
||||||
-- flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset cr it +.+.+ V3 5 0 20)
|
|
||||||
-- -- muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
|
|
||||||
cdir = _crDir cr
|
cdir = _crDir cr
|
||||||
cpos = _crPos cr
|
cpos = _crPos cr
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module Dodge.Update.Input.ScreenLayer (
|
|||||||
updateUseInputOnScreen,
|
updateUseInputOnScreen,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Data.Char
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
@@ -30,7 +31,7 @@ doInputScreenInput s u =
|
|||||||
checkEndStatus
|
checkEndStatus
|
||||||
| ispressed ScancodeReturn =
|
| ispressed ScancodeReturn =
|
||||||
(uvScreenLayers %~ tail)
|
(uvScreenLayers %~ tail)
|
||||||
. applyTerminalString (words s)
|
. applyTerminalString (words $ map toUpper s)
|
||||||
. (uvWorld . worldEventFlags . at InventoryChange ?~ ())
|
. (uvWorld . worldEventFlags . at InventoryChange ?~ ())
|
||||||
| ispressed ScancodeEscape = uvScreenLayers %~ tail
|
| ispressed ScancodeEscape = uvScreenLayers %~ tail
|
||||||
| otherwise = id
|
| otherwise = id
|
||||||
|
|||||||
@@ -16,16 +16,17 @@ module Dodge.WorldEvent.Flash (
|
|||||||
|
|
||||||
import Dodge.Data.World
|
import Dodge.Data.World
|
||||||
import Dodge.LightSource
|
import Dodge.LightSource
|
||||||
--import Dodge.Default
|
import Control.Monad
|
||||||
|
|
||||||
import Geometry
|
import Geometry
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import Picture
|
import Picture
|
||||||
import System.Random
|
import System.Random
|
||||||
|
import Control.Monad.Trans.State.Strict
|
||||||
|
|
||||||
muzFlareAt :: Color -> Point3 -> Float -> World -> World
|
muzFlareAt :: Color -> Point3 -> Float -> World -> World
|
||||||
muzFlareAt col tranv dir w =
|
muzFlareAt col tranv dir w =
|
||||||
w & cWorld . lWorld . flares
|
w & randGen .~ g
|
||||||
|
& cWorld . lWorld . flares
|
||||||
.:~ MuzFlare
|
.:~ MuzFlare
|
||||||
{ _flarePoly =
|
{ _flarePoly =
|
||||||
map
|
map
|
||||||
@@ -39,7 +40,8 @@ muzFlareAt col tranv dir w =
|
|||||||
, _flareTime = 2
|
, _flareTime = 2
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
(a : b : c : d : _) = randomRs (2, 20) (_randGen w)
|
thestate = replicateM 4 $ state $ randomR (2,20)
|
||||||
|
((a : b : c : d : _), g) = runState thestate $ _randGen w -- randomRs (2, 20) (_randGen w)
|
||||||
|
|
||||||
flareCircleAt :: Color -> Float -> Point3 -> World -> World
|
flareCircleAt :: Color -> Float -> Point3 -> World -> World
|
||||||
flareCircleAt col alphax tranv =
|
flareCircleAt col alphax tranv =
|
||||||
|
|||||||
Reference in New Issue
Block a user