Cleanup combining code, flatten modules

This commit is contained in:
2024-10-01 10:01:21 +01:00
parent f69d150e00
commit 87cbaf911f
17 changed files with 143 additions and 173 deletions
+1
View File
@@ -84,6 +84,7 @@ showAttachItem t itm = case t of
showEquipItem :: EquipItemType -> String
showEquipItem eit = case eit of
INVISIBILITYEQUIPMENT esite -> "INVISIBILITY " ++ show esite
_ -> show eit
showAutoRechargeProgress :: LeftConsumption -> String
+13 -12
View File
@@ -27,7 +27,7 @@ itemTreeSPic (LDT (itm, _) l r) =
itemRotTreeSPic :: Item -> (ItemLink, LabelDoubleTree ItemLink ComposedItem) -> SPic
itemRotTreeSPic par (il, t) = fromMaybe mempty $ do
(p, q) <- _iatOrient il par (_iatType il) itm
return $ (translateSP p $ overPosSP (Q.rotate q) $ itemTreeSPic t)
return . translateSP p . overPosSP (Q.rotate q) $ itemTreeSPic t
where
itm = t ^. ldtValue . _1
@@ -178,22 +178,22 @@ heldItemSPic ht it = case ht of
FORCEFIELDGUN -> defSPic
TORCH -> noPic torchShape
BANGSTICK i -> noPic $ baseStickShapeX it i -- <> addBullets it
PISTOL -> noPic $ baseStickShape
MACHINEPISTOL -> noPic $ baseStickShape
AUTOPISTOL -> noPic $ baseStickShape
SMG -> noPic $ baseSMGShape
PISTOL -> noPic baseStickShape
MACHINEPISTOL -> noPic baseStickShape
AUTOPISTOL -> noPic baseStickShape
SMG -> noPic baseSMGShape
BANGCONE -> noPic $ bangConeShape 5
BLUNDERBUSS -> noPic $ bangConeShape 20
GRAPECANNON _ -> noPic $ bangConeShape 20
MINIGUNX i -> miniGunXPictItem i it
VOLLEYGUN i -> noPic $ volleyGunShape i -- <> addBullets it
RIFLE -> noPic baseRifleShape -- <> addBullets it
AUTORIFLE -> noPic $ baseRifleShape
BURSTRIFLE -> noPic $ baseRifleShape
AUTORIFLE -> noPic baseRifleShape
BURSTRIFLE -> noPic baseRifleShape
BANGROD -> noPic baseRodShape -- <> addBullets it
ELEPHANTGUN -> noPic baseAMRShape -- <> addBullets it
AMR -> noPic $ baseAMRShape
AUTOAMR -> noPic $ baseAMRShape
AMR -> noPic baseAMRShape
AUTOAMR -> noPic baseAMRShape
SNIPERRIFLE -> noPic baseAMRShape -- <> addBullets it
-- MACHINEGUN -> noPic $ baseAMRShape <> addTinClip it
FLAMESPITTER -> flamerPic it
@@ -360,11 +360,12 @@ teslaGunPic =
lasGunPic :: Item -> SPic
lasGunPic _ =
( colorSH blue $
upperBoxST 4 (rectNESW 3 30 1 0)
colorSH
blue
( upperBoxST 4 (rectNESW 3 30 1 0)
<> upperBoxSU 4 (rectNESW (-1) 30 (-3) 0)
<> upperBoxSU 1 (rectNESW 3 30 (-3) 0)
)
)
:!: (setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0)
where
--amFrac = fractionLoadedAmmo it
+2 -2
View File
@@ -73,7 +73,7 @@ ammoComposedItem' itm = fromMaybe (error "in ammoComposedItem, wrong item") $ do
,noa (AmmoTargetingSF atype) AmmoTargetingLink
,noa (AmmoPayloadSF atype) AmmoPayloadLink
,noa (AmmoEffectSF atype) AmmoEffectLink
,noa (RemoteScreenSF) RemoteScreenLink
,noa RemoteScreenSF RemoteScreenLink
]
[]
)
@@ -125,7 +125,7 @@ invLDT'' =
. fmap (singleLDT . basePartiallyComposedItem')
invLDT' :: IM.IntMap Item -> [LabelDoubleTree ComposeLinkType ComposedItem]
invLDT' = map (first _iatType . second (\(x,y,_) -> (x,y))) . invLDT''
invLDT' = map (bimap _iatType (\(x,y,_) -> (x,y))) . invLDT''
-- this assumes the creature inventory is well formed, specifically the
-- location ids
+8 -14
View File
@@ -7,16 +7,10 @@ module Dodge.Item.Held.BatteryGuns
import Dodge.SoundLogic.ExternallyGeneratedSounds
import Dodge.Default.Item
--import Dodge.Base
--import Dodge.Data.Beam
import Color
import Control.Lens
--import qualified Data.Map.Strict as M
import Dodge.Data.Item
--import Dodge.Reloading.Action
import Dodge.Tesla.ItemParams
import Geometry.Data
--import qualified IntMapHelp as IM
sparkGun :: Item
sparkGun =
@@ -54,14 +48,14 @@ lasGun =
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
& itUse . heldAim . aimMuzzles . ix 0 . mzFlareType .~ LasGunFlare
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleLaser
& itParams
.~ Refracting
{ _phaseV = 1
, _lasColor = yellow
, _lasColor2 = yellow
, _lasCycle = 0
, _lasDamage = 11
}
-- & itParams
-- .~ Refracting
-- { _phaseV = 1
-- , _lasColor = yellow
-- , _lasColor2 = yellow
-- , _lasCycle = 0
-- , _lasDamage = 11
-- }
& itDimension . dimRad .~ 10
& itDimension . dimCenter .~ V3 15 0 0
& itUse . heldAim . aimWeight .~ 6
+1 -1
View File
@@ -19,7 +19,7 @@ orientByLink itm lt = case (_itType itm,lt) of
_ -> (0,Q.axisAngle (V3 1 0 0) 0)
orientAttachment :: Item -> ComposeLinkType -> Item -> Maybe (Point3, Q.Quaternion Float)
orientAttachment par lnk ch = Just (t1 + (Q.rotate q1 t2), q1 * q2)
orientAttachment par lnk ch = Just (t1 + Q.rotate q1 t2, q1 * q2)
where
(t1,q1) = orientByLink par lnk
(t2,q2) = orientChild ch