Improve weapon handle offsets

This commit is contained in:
2023-05-28 13:59:58 +01:00
parent 4b35a683af
commit 7fc36ab028
8 changed files with 23 additions and 22 deletions
+1
View File
@@ -70,6 +70,7 @@ rifle =
& itUse . heldAim . aimWeight .~ 6
& itUse . heldAim . aimRange .~ 1
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
& itUse . heldAim . aimMuzzles .~ [Muzzle (V2 25 0) 0 0.01]
& itType . iyModules . at ModHeldAttach ?~ EMPTYMODULE
repeater :: Item
-1
View File
@@ -33,7 +33,6 @@ bangStick i =
& itDimension . dimCenter .~ V3 5 0 0
& itUse . heldDelay . rateMax .~ 8
& itUse . heldMods .~ BangStickMod
& itUse . heldAim . aimHandlePos .~ 5
& 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]
+3 -3
View File
@@ -14,13 +14,13 @@ turretItemOffset it tu mc =
transToHandle :: Item -> Point3 -> Point3
transToHandle itm = fromMaybe id $ do
x <- itm ^? itUse . heldAim . aimHandlePos
return (-.-.- V3 x 0 0)
V2 x y <- itm ^? itUse . heldAim . aimHandlePos
return (-.-.- V3 x y 0)
heldItemOffset :: Item -> Creature -> Point3 -> Point3
heldItemOffset itm cr
| isSelected && _posture (_crStance cr) == Aiming =
(+.+.+ V3 (aimingWeaponZeroPos cr itm) 0 shoulderHeight)
(+.+.+ aimingWeaponZeroPos cr itm `v2z` shoulderHeight)
| isSelected && isTwoHandFlat =
(+.+.+ V3 (_crRad cr) 0 handD)
. rotate3 (twoFlatHRot cr)
+5 -4
View File
@@ -59,6 +59,7 @@ module Dodge.Item.Weapon.TriggerType (
blCheck,
) where
import Dodge.Creature.HandPos
import Data.Foldable
import Data.Maybe
import Dodge.Base
@@ -456,9 +457,9 @@ withMuzFlareI :: ChainEffect
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
. 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
. muzFlareAt (V4 10 10 1 3) (cpos `v2z` 20) cdir
. muzFlareAt (V4 10 10 1 3) (cpos `v2z` 20) cdir
. muzFlareAt (V4 10 10 1 3) (cpos `v2z` 20) cdir
. f it cr
where
cdir = _crDir cr
@@ -634,7 +635,7 @@ duplicateNumBarrels n eff itm cr w = foldr f w (take n $ itm ^?! itUse . heldAim
f brl w' =
eff
itm
( cr & crPos +~ rotateV (_crDir cr) (_mzPos brl)
( cr & crPos +~ rotateV (_crDir cr) (_mzPos brl + aimingWeaponZeroPos cr itm)
& crDir +~ (_mzRot brl + a)
)
(w' & randGen .~ g)