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
+24
View File
@@ -1 +1,25 @@
module Dodge.Tweak where
import Dodge.Data.Item
import Control.Lens
doTweak :: TweakType -> Int -> Item -> Item
doTweak tt = case tt of
TweakPhaseV -> tweakPhaseV
TweakTractionPower -> tweakTractionPower
TweakSpinDrag -> \i -> itParams . shellSpinDrag .~ i
TweakSpinAmount -> \i -> itParams . shellSpinAmount .~ i
TweakThrustDelay -> \i -> itParams . shellThrustDelay .~ i
tweakTractionPower :: Int -> Item -> Item
tweakTractionPower 0 = itParams . attractionPower .~ 1
tweakTractionPower 1 = itParams . attractionPower .~ -1
tweakTractionPower 2 = itParams . attractionPower .~ -10
tweakTractionPower 3 = itParams . attractionPower .~ 0
tweakTractionPower _ = id
tweakPhaseV :: Int -> Item -> Item
tweakPhaseV 0 = itParams . phaseV .~ 0.2
tweakPhaseV 1 = itParams . phaseV .~ 1
tweakPhaseV 2 = itParams . phaseV .~ 5
tweakPhaseV _ = id