Files
loop/src/Dodge/Tweak.hs
T

26 lines
861 B
Haskell

module Dodge.Tweak where
import Control.Lens
import Dodge.Data.Item
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