86 lines
2.0 KiB
Haskell
86 lines
2.0 KiB
Haskell
module Dodge.Item.Module where
|
|
|
|
import Dodge.Data.Item.Combine
|
|
import Geometry.Data
|
|
|
|
moduleAttachPosition :: ItemBaseType -> ModuleSlot -> (Point3, Point3)
|
|
moduleAttachPosition ibt ms = case ms of
|
|
ModBulletCollision -> (V3 (x - 2.5) y (0.5 * z) , V3 0 1 0)
|
|
ModBulletPayload -> (V3 (-x) 0 (0.5 * z), V3 (-1) 0 0)
|
|
ModRifleMag -> undefined
|
|
ModAutoMag -> undefined
|
|
ModTarget -> (V3 0 0 z, V3 0 0 1)
|
|
ModBulletTrajectory -> undefined
|
|
ModLauncherHoming -> undefined
|
|
ModBattery -> undefined
|
|
ModTeleport -> undefined
|
|
ModDualBeam -> undefined
|
|
ModHeldAttach -> undefined
|
|
where
|
|
V3 x y z = itBounds ibt
|
|
|
|
itBounds :: ItemBaseType -> Point3
|
|
itBounds ibt = case ibt of
|
|
HELD hit -> heldBounds hit
|
|
_ -> V3 0 0 0
|
|
|
|
heldBounds :: HeldItemType -> Point3
|
|
heldBounds hit = case hit of
|
|
BANGSTICK _ -> V3 0 0 0
|
|
PISTOL -> bss
|
|
MACHINEPISTOL -> bss
|
|
AUTOPISTOL -> bss
|
|
SMG -> smgs
|
|
BANGCONE -> cs
|
|
BLUNDERBUSS -> bbs
|
|
GRAPECANNON _ -> bbs
|
|
MINIGUNX _ -> minis
|
|
VOLLEYGUN _ -> undefined
|
|
MULTIGUN _ -> undefined
|
|
RIFLE -> rs
|
|
REPEATER -> rs
|
|
AUTORIFLE -> rs
|
|
BURSTRIFLE -> rs
|
|
BANGROD -> amrs
|
|
ELEPHANTGUN -> amrs
|
|
AMR -> amrs
|
|
AUTOAMR -> amrs
|
|
SNIPERRIFLE -> amrs
|
|
MACHINEGUN -> amrs
|
|
FLAMESPITTER -> fs
|
|
FLAMETHROWER -> fs
|
|
FLAMETORRENT -> fs
|
|
FLAMEWALL -> fs
|
|
BLOWTORCH -> fs
|
|
SPARKGUN -> ts
|
|
TESLAGUN -> ts
|
|
LASGUN -> ls
|
|
LASCIRCLE -> ls
|
|
DUALBEAM -> ls
|
|
LASWIDE _ -> ls
|
|
TRACTORGUN -> ls
|
|
LAUNCHER -> launchs
|
|
LAUNCHERX _ -> launchs
|
|
REMOTELAUNCHER -> launchs
|
|
POISONSPRAYER -> fs
|
|
DRONELAUNCHER -> fs
|
|
SHATTERGUN -> launchs
|
|
FORCEFIELDGUN -> launchs
|
|
HELDDETECTOR _ -> launchs
|
|
TORCH -> launchs
|
|
FLATSHIELD -> launchs
|
|
KEYCARD _ -> launchs
|
|
where
|
|
bss = V3 10 2 3
|
|
smgs = V3 20 2 3
|
|
cs = V3 5 2 3
|
|
bbs = V3 20 2 3
|
|
minis = V3 10 2 3
|
|
rs = V3 25 2 3
|
|
amrs = V3 30 2 3
|
|
fs = V3 10 2 3
|
|
ts = V3 10 2 3
|
|
ls = V3 30 2 3
|
|
launchs = V3 10 10 10
|
|
|