Add Read instances

This commit is contained in:
2022-07-22 01:06:35 +01:00
parent d4e5b02874
commit 4c5218c633
44 changed files with 209 additions and 126 deletions
+2
View File
@@ -17,6 +17,7 @@ data ItAttachment
| AttachFloat { _atFloat :: Float }
| AttachBool { _atBool :: Bool }
| NoItAttachment
deriving (Eq,Ord,Show,Read)
data Scope = NoScope
| RemoteScope
@@ -31,6 +32,7 @@ data Scope = NoScope
,_scopeDefaultZoom :: Float
,_scopeIsCamera :: Bool -- ^ if the camera offset is also the center of vision
}
deriving (Eq,Ord,Show,Read)
makeLenses ''ItAttachment
makeLenses ''Scope
+1
View File
@@ -6,3 +6,4 @@ data CurseStatus
= Uncursed
| UndroppableIdentified
| UndroppableUnidentified
deriving (Eq,Ord,Show,Read)
+12 -37
View File
@@ -248,33 +248,21 @@ lasGun = defaultAutoBatteryGun
lasGunTweak :: TweakParam
lasGunTweak = TweakParam
{ _doTweak = thetweak
, _curTweak = 1
, _maxTweak = 3
, _showTweak = showPhaseV
, _nameTweak = "PHASE VELOCITY"
{ _tweakType = TweakPhaseV
, _tweakVal = 1
, _tweakMax = 3
}
where
thetweak 0 = itParams . phaseV .~ 0.2
thetweak 1 = itParams . phaseV .~ 1
thetweak 2 = itParams . phaseV .~ 5
thetweak _ = id
showPhaseV 0 = "V"
showPhaseV 1 = "/"
showPhaseV 2 = "Z"
showPhaseV i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
tractorGun :: Item
tractorGun = lasGun
{ _itConsumption = defaultLoadable
& laMax .~ 10000
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60]
, _itParams = Attracting {_attractionPower = 1}
, _itTweaks = Tweakable
& itConsumption .~
( defaultLoadable
& laMax .~ 10000
& laCycle .~ [loadEject 10, loadInsert 10 , loadPrime 60] )
& itParams .~ Attracting {_attractionPower = 1}
& itTweaks .~ Tweakable
{ _tweakParams = IM.fromList [(0,tractorGunTweak)]
, _tweakSel = 0
}
}
& itUse . rUse .~ HeldTractor --aTractorBeam
& itUse . useDelay .~ NoDelay
& itUse . useMods .~ AmmoCheckMod
@@ -287,23 +275,10 @@ tractorGun = lasGun
tractorGunTweak :: TweakParam
tractorGunTweak = TweakParam
{ _doTweak = thetweak
, _curTweak = 1
, _maxTweak = 4
, _showTweak = showPower
, _nameTweak = "TRACTION POWER"
{ _tweakType = TweakTractionPower
, _tweakVal = 1
, _tweakMax = 4
}
where
thetweak 0 = itParams . attractionPower .~ 1
thetweak 1 = itParams . attractionPower .~ -1
thetweak 2 = itParams . attractionPower .~ -10
thetweak 3 = itParams . attractionPower .~ 0
thetweak _ = id
showPower 0 = "+"
showPower 1 = "-"
showPower 2 = "#"
showPower 3 = "0" -- object should stay in the center of the beam
showPower i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
-- | assumes that the item is held
shootTeslaArc :: Item -> Creature -> World -> World
+9 -16
View File
@@ -68,30 +68,23 @@ basicAmPjMoves = IM.fromList . zip [0..] $
]
spinDrag :: TweakParam
spinDrag = TweakParam
{ _doTweak = \i -> itParams . shellSpinDrag .~ i
, _curTweak = 1
, _showTweak = show
, _maxTweak = 5
, _nameTweak = "SPIN SLOWDOWN"
{ _tweakType = TweakSpinDrag
, _tweakVal = 1
, _tweakMax = 5
}
spinStart :: TweakParam
spinStart = TweakParam
{ _doTweak = \i -> itParams . shellSpinAmount .~ i
, _curTweak = 2
, _showTweak = show
, _maxTweak = 5
, _nameTweak = "SPIN AMOUNT"
{ _tweakType = TweakSpinAmount
, _tweakVal = 2
, _tweakMax = 5
}
thrustParam :: TweakParam
thrustParam = TweakParam
{ _doTweak = \i -> itParams . shellThrustDelay .~ i
, _curTweak = 1
, _showTweak = show
, _maxTweak = 5
, _nameTweak = "THRUST DELAY"
{ _tweakType = TweakThrustDelay
, _tweakVal = 1
, _tweakMax = 5
}
remoteLauncher :: Item
remoteLauncher = launcher
& itType . iyBase .~ HELD REMOTELAUNCHER