Commit on returning to work
This commit is contained in:
@@ -122,18 +122,6 @@ itemCombinations =
|
||||
moduleCombinations :: [(ModuleSlot, [Item], [([ItemBaseType], ItemModuleType)])]
|
||||
moduleCombinations =
|
||||
[
|
||||
( ModRifleMag
|
||||
,
|
||||
[ repeater
|
||||
, autoRifle
|
||||
, burstRifle
|
||||
]
|
||||
,
|
||||
[ amod [cr STEELDRUM, cr HARDWARE] DRUMMAG
|
||||
, amod [cr MOTOR, cr HARDWARE] BELTMAG
|
||||
]
|
||||
)
|
||||
,
|
||||
( ModHeldAttach
|
||||
,
|
||||
[ rifle
|
||||
|
||||
@@ -10,8 +10,7 @@ import LensHelp
|
||||
moduleModification :: ItemModuleType -> Item -> Item
|
||||
moduleModification imt = case imt of
|
||||
EMPTYMODULE -> id
|
||||
DRUMMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 45
|
||||
BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
|
||||
-- BELTMAG -> itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 150
|
||||
MAGNETMAG -> itUse . heldDelay . rateMax .~ 4
|
||||
BULPAY BulFlak -> (itUse . heldConsumption . laAmmoType . amBullet . buSpawn .~ BulFlak)
|
||||
. (itUse . heldConsumption . laAmmoType . amBullet . buTimer .~ 3)
|
||||
|
||||
@@ -42,6 +42,7 @@ itemEffect cr it w = case it ^. itUse of
|
||||
-- ConsumeUse will cause problems if the item is not selected
|
||||
(ConsumeUse eff _) -> useC eff it cr $ rmInvItem (_crID cr) itRef w
|
||||
CraftUse{} -> w
|
||||
AttachUse{} -> w
|
||||
where
|
||||
itRef = cr ^?! crManipulation . manObject . inInventory . ispItem -- unsafe!! TODO change
|
||||
hammerTest f = case _crHammerPosition cr of
|
||||
|
||||
@@ -29,6 +29,7 @@ import Dodge.Data.Item.Params
|
||||
import Dodge.Data.Item.Tweak
|
||||
import Dodge.Data.Item.Use
|
||||
import Dodge.Data.Item.Location
|
||||
import Data.Set (Set)
|
||||
|
||||
data Item = Item
|
||||
{ _itUse :: ItemUse
|
||||
@@ -44,11 +45,20 @@ data Item = Item
|
||||
, _itTweaks :: ItemTweaks
|
||||
, _itScope :: Scope
|
||||
, _itParams :: ItemParams
|
||||
, _itAttachments :: Set ItemAttachment
|
||||
}
|
||||
--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data ItemAttachment = ScopeAttachment
|
||||
| BulletClipAttachment
|
||||
| BulletBeltAttachment
|
||||
| StandAttachment
|
||||
| PowerSourceAttachment
|
||||
deriving (Eq,Ord)
|
||||
|
||||
_itUseAimStance :: Item -> AimStance
|
||||
_itUseAimStance = _aimStance . _heldAim . _itUse
|
||||
|
||||
makeLenses ''Item
|
||||
deriveJSON defaultOptions ''ItemAttachment
|
||||
deriveJSON defaultOptions ''Item
|
||||
|
||||
@@ -91,10 +91,15 @@ data ItemBaseType
|
||||
| AMMO {_ibtAmmo :: AmmoItemType}
|
||||
| Consumable {_ibtConsumable :: ConsumableItemType}
|
||||
| CRAFT CraftType
|
||||
| ATTACH AttachType
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
--deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data AttachType
|
||||
= ZOOMSCOPE
|
||||
deriving (Eq, Ord, Show, Read)
|
||||
|
||||
data ConsumableItemType
|
||||
= MEDKIT Int
|
||||
| EXPLOSIVES
|
||||
@@ -188,12 +193,11 @@ data HeldItemType
|
||||
data AmmoItemType
|
||||
= TINMAGAZINE
|
||||
| DRUMMAGAZINE
|
||||
| BULLETBELT
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data ItemModuleType
|
||||
= EMPTYMODULE
|
||||
| DRUMMAG
|
||||
| BELTMAG
|
||||
| MAGNETMAG
|
||||
| BULPAY BulletSpawn
|
||||
| BULBODY BulletEffect
|
||||
@@ -235,6 +239,7 @@ makeLenses ''ItemModuleType
|
||||
deriveJSON defaultOptions ''Stack
|
||||
deriveJSON defaultOptions ''CraftType
|
||||
deriveJSON defaultOptions ''ConsumableItemType
|
||||
deriveJSON defaultOptions ''AttachType
|
||||
deriveJSON defaultOptions ''Detector
|
||||
deriveJSON defaultOptions ''EquipItemType
|
||||
deriveJSON defaultOptions ''LeftItemType
|
||||
|
||||
@@ -25,8 +25,6 @@ data Scope
|
||||
-- , _scopeZoomChange :: Int
|
||||
, _scopeZoom :: Float
|
||||
, _scopeDefaultZoom :: Float
|
||||
, -- | if the camera offset is also the center of vision
|
||||
_scopeIsCamera :: Bool
|
||||
}
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -54,8 +54,13 @@ data ItemUse
|
||||
}
|
||||
| CraftUse
|
||||
{_useAmount :: ItAmount}
|
||||
| AttachUse
|
||||
{_attachParams :: AttachParams}
|
||||
--deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data AttachParams
|
||||
= ZoomScopeParams
|
||||
|
||||
data ItemUse'
|
||||
= ItemHeld HeldUse'
|
||||
| ItemEquip EquipUse'
|
||||
@@ -106,6 +111,7 @@ makeLenses ''ItZoom
|
||||
makeLenses ''Muzzle
|
||||
deriveJSON defaultOptions ''Muzzle
|
||||
deriveJSON defaultOptions ''AimStance
|
||||
deriveJSON defaultOptions ''AttachParams
|
||||
deriveJSON defaultOptions ''ItZoom
|
||||
deriveJSON defaultOptions ''AimParams
|
||||
deriveJSON defaultOptions ''ItemUse
|
||||
|
||||
@@ -31,6 +31,11 @@ data AmmoSource
|
||||
| AboveSource
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data ExternalSourceType = BulletClip
|
||||
| BulletBelt
|
||||
| ElectricPower
|
||||
deriving (Eq, Show, Read) --Generic, Flat)
|
||||
|
||||
data InternalAmmo = InternalAmmo
|
||||
{ _iaMax :: Int
|
||||
, _iaLoaded :: Int
|
||||
|
||||
@@ -35,6 +35,7 @@ defaultItem =
|
||||
, _itParams = NoParams
|
||||
, _itTweaks = NoTweaks
|
||||
, _itScope = NoScope
|
||||
, _itAttachments = mempty
|
||||
-- , _itValue = ItemValue 0 MundaneItem
|
||||
}
|
||||
|
||||
|
||||
+8
-2
@@ -24,11 +24,17 @@ itemFromBase ibt = case ibt of
|
||||
AMMO at -> itemFromAmmoType at
|
||||
Consumable et -> itemFromConsumableType et
|
||||
CRAFT cr -> makeTypeCraft cr
|
||||
ATTACH at -> itemFromAttachType at
|
||||
|
||||
itemFromAttachType :: AttachType -> Item
|
||||
itemFromAttachType at = case at of
|
||||
ZOOMSCOPE -> zoomScope
|
||||
|
||||
itemFromAmmoType :: AmmoItemType -> Item
|
||||
itemFromAmmoType at = case at of
|
||||
TINMAGAZINE -> tinMagazine
|
||||
DRUMMAGAZINE -> drumMagazine
|
||||
TINMAGAZINE -> tinMag
|
||||
DRUMMAGAZINE -> drumMag
|
||||
BULLETBELT -> beltMag
|
||||
|
||||
itemFromConsumableType :: ConsumableItemType -> Item
|
||||
itemFromConsumableType ct = case ct of
|
||||
|
||||
@@ -88,6 +88,7 @@ itemBaseName it = case _iyBase $ _itType it of
|
||||
EQUIP eit -> showEquipItem eit
|
||||
AMMO ait -> show ait
|
||||
Consumable cit -> show cit
|
||||
ATTACH ait -> show ait
|
||||
|
||||
showEquipItem :: EquipItemType -> String
|
||||
showEquipItem eit = case eit of
|
||||
|
||||
@@ -25,6 +25,7 @@ itemSPic it =
|
||||
EQUIP et -> equipItemSPic et it
|
||||
AMMO {} -> defSPic
|
||||
Consumable{} -> defSPic
|
||||
ATTACH {} -> defSPic
|
||||
|
||||
equipItemSPic :: EquipItemType -> Item -> SPic
|
||||
equipItemSPic et _ = case et of
|
||||
|
||||
@@ -96,14 +96,10 @@ miniGunUse i =
|
||||
& heldAim . aimRange .~ 1
|
||||
& heldAim . aimStance .~ TwoHandUnder
|
||||
& heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5}
|
||||
-- & heldAim . aimHandlePos .~ 5
|
||||
& heldConsumption
|
||||
.~ (defaultBulletLoadable & laSource .~ AboveSource)
|
||||
--(defaultBulletLoadable
|
||||
-- & laSource . iaMax .~ 1500
|
||||
-- & laSource . iaLoaded .~ 1500
|
||||
--)
|
||||
& heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 40, loadInsert 40, loadPrime 40]
|
||||
& heldConsumption . laSource . _InternalSource . iaCycle
|
||||
.~ [loadEject 40, loadInsert 40, loadPrime 40]
|
||||
|
||||
miniGunX :: Int -> Item
|
||||
miniGunX i =
|
||||
@@ -111,7 +107,6 @@ miniGunX i =
|
||||
& itUse .~ miniGunUse i
|
||||
& itUse . heldAim . aimTurnSpeed .~ 0.5
|
||||
& itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 30 0) 0 0.05)
|
||||
-- & itUse . heldAim . aimMuzzles .~ replicate i (Muzzle (V2 50 0) 0 0.05)
|
||||
& itParams . recoil .~ 10
|
||||
& itParams . torqueAfter .~ 0.01
|
||||
& itParams . randomOffset .~ 10
|
||||
|
||||
@@ -69,7 +69,11 @@ sniperRifle =
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzInaccuracy .~ 0
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
|
||||
& itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
|
||||
& itScope .~ ZoomScope (V2 0 0) 1 0.5 False
|
||||
& itScope .~ ZoomScope
|
||||
{ _scopePos = (V2 0 0)
|
||||
, _scopeZoom = 1
|
||||
, _scopeDefaultZoom = 0.5
|
||||
}
|
||||
& itType . iyModules . at ModTarget ?~ TARGET TargetLaser
|
||||
-- & itUse . useTargeting ?~ TargetLaser
|
||||
|
||||
|
||||
@@ -32,7 +32,11 @@ latchkey _ =
|
||||
binoculars :: Item
|
||||
binoculars =
|
||||
defaultHeldItem
|
||||
& itScope .~ ZoomScope (V2 0 0) 1 0.5 False
|
||||
& itScope .~ ZoomScope
|
||||
{ _scopePos = (V2 0 0)
|
||||
, _scopeZoom = 1
|
||||
, _scopeDefaultZoom = 0.5
|
||||
}
|
||||
& itType . iyBase .~ HELD BINOCULARS
|
||||
-- & itUse . heldAim . aimHandlePos .~ 5
|
||||
-- & itUse . heldAim . aimMuzPos .~ 10
|
||||
|
||||
+1
-2
@@ -22,8 +22,7 @@ moduleStrings = M.elems . M.mapMaybe moduleName . _iyModules . _itType
|
||||
moduleName :: ItemModuleType -> Maybe String
|
||||
moduleName imt = case imt of
|
||||
EMPTYMODULE -> Nothing
|
||||
DRUMMAG -> Just "+DRUM MAG"
|
||||
BELTMAG -> Just "+BELT FEED"
|
||||
-- BELTMAG -> Just "+BELT FEED"
|
||||
MAGNETMAG -> Just "+MAGNET FEED"
|
||||
BULPAY thepayload -> Just $ "+" ++ displayBulletPayload thepayload
|
||||
BULBODY thebody -> Just $ "+" ++ displayBulletBody thebody
|
||||
|
||||
@@ -141,7 +141,8 @@ updateScopeZoom' i w
|
||||
| otherwise = w & wppointer %~ resetscope
|
||||
where
|
||||
wppointer = cWorld . lWorld . creatures . ix 0 . crInv . ix i . itScope
|
||||
resetscope (ZoomScope _ _ defz bl) = ZoomScope (V2 0 0) defz defz bl
|
||||
--resetscope (ZoomScope _ _ defz bl) = ZoomScope (V2 0 0) defz defz bl
|
||||
resetscope (ZoomScope _ _ defz) = ZoomScope (V2 0 0) defz defz
|
||||
resetscope otherAtt = otherAtt
|
||||
mp = rotateV (w ^. wCam . camRot) $ _mousePos (_input w)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user