Make torch use battery power
This commit is contained in:
@@ -80,8 +80,8 @@ battery =
|
||||
, _amagType = ElectricalAmmo
|
||||
, _amagLoadStatus =
|
||||
ReloadStatus
|
||||
{ _iaMax = 100
|
||||
, _iaLoaded = 100
|
||||
{ _iaMax = 10^ (9::Int)
|
||||
, _iaLoaded = 10^ (9::Int)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ useBreakL' :: [(ItemStructuralFunction, ComposeLinkType)] -> [(ItemStructuralFun
|
||||
useBreakL' x y = useBreakListsLinkTest (map (uncurry noa) x) (map (uncurry noa) y)
|
||||
where
|
||||
noa a b = (a, ILink b orientAttachment)
|
||||
|
||||
|
||||
useBreakListsLinkTest :: [(ItemStructuralFunction, a)] -> [(ItemStructuralFunction, a)] -> LinkTest a
|
||||
useBreakListsLinkTest llist rlist = LTest ltest rtest
|
||||
|
||||
@@ -26,7 +26,6 @@ latchkey _ = defaultHeldItem
|
||||
torch :: Item
|
||||
torch =
|
||||
defaultHeldItem
|
||||
& itEffect . ieInv .~ EffectWhileAttached CreateHeldLight
|
||||
& itType .~ HELD TORCH
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzPos . _x .~ 10
|
||||
& itUse . heldAmmoTypes .~ singleAmmo ElectricalAmmo
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
module Dodge.Item.Orientation
|
||||
( orientAttachment
|
||||
) where
|
||||
module Dodge.Item.Orientation (
|
||||
orientAttachment,
|
||||
) where
|
||||
|
||||
import Dodge.Data.ComposedItem
|
||||
import Geometry.Data
|
||||
import Dodge.Data.Item
|
||||
import Geometry.Data
|
||||
import qualified Quaternion as Q
|
||||
|
||||
orientChild :: Item -> (Point3, Q.Quaternion Float)
|
||||
orientChild itm = case _itType itm of
|
||||
HELD TORCH -> (V3 0 20 0,Q.qID)
|
||||
_ -> (0,Q.qID)
|
||||
HELD TORCH -> (V3 0 5 0, Q.qID)
|
||||
_ -> (0, Q.qID)
|
||||
|
||||
orientByLink :: Item -> ComposeLinkType -> (Point3, Q.Quaternion Float)
|
||||
orientByLink itm lt = case (_itType itm,lt) of
|
||||
orientByLink itm lt = case (_itType itm, lt) of
|
||||
(HELD FLAMETHROWER, AmmoInLink{}) -> (V3 4 (-6) 0, Q.qID)
|
||||
(HELD _,AmmoInLink{}) -> (V3 7 (-2) 0, Q.qID)
|
||||
(HELD _,WeaponScopeLink) -> (V3 5 0 5, Q.qID)
|
||||
_ -> (0,Q.qID)
|
||||
(HELD _, AmmoInLink{}) -> (V3 7 (-2) 0, Q.qID)
|
||||
(HELD _, WeaponScopeLink) -> (V3 5 0 5, Q.qID)
|
||||
_ -> (0, Q.qID)
|
||||
|
||||
orientAttachment :: Item -> ComposeLinkType -> Item -> (Point3, Q.Quaternion Float)
|
||||
orientAttachment par lnk ch = case (_itType par,lnk,_itType ch) of
|
||||
-- (HELD BURSTRIFLE,_,HELD TORCH) -> (V3 20 0 0, Q.qID)
|
||||
-- (HELD LAUNCHER,_,HELD TORCH) -> (V3 0 20 0, Q.qID)
|
||||
orientAttachment par lnk ch = case (_itType par, lnk, _itType ch) of
|
||||
-- (HELD BURSTRIFLE, _, HELD TORCH) -> (V3 20 0 0, Q.axisAngle (V3 0 0 1) (pi/2))
|
||||
-- (HELD LAUNCHER, _, HELD TORCH) -> (V3 0 20 0, Q.axisAngle (V3 0 0 1) (pi/4))
|
||||
_ -> (t1 + Q.rotate q1 t2, q1 * q2)
|
||||
where
|
||||
(t1,q1) = orientByLink par lnk
|
||||
(t2,q2) = orientChild ch
|
||||
(t1, q1) = orientByLink par lnk
|
||||
(t2, q2) = orientChild ch
|
||||
|
||||
Reference in New Issue
Block a user