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