Cleanup
This commit is contained in:
@@ -105,7 +105,7 @@ combineModules = mergeA
|
||||
= ("WARNING:REMOVES":ss im1,im2)
|
||||
h _ _ im | im /= EMPTYMODULE = ([],im)
|
||||
h _ im _ = ([],im)
|
||||
ss imt = [moduleName imt]
|
||||
ss imt = [fromJust $ moduleName imt]
|
||||
|
||||
toggleCombineInv :: World -> World
|
||||
toggleCombineInv w = case _hudElement (_hud w) of
|
||||
|
||||
+18
-26
@@ -9,7 +9,6 @@ import Dodge.Item.Weapon.Launcher
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import LensHelp
|
||||
import Geometry
|
||||
--import Dodge.Item.Weapon.BatteryGuns
|
||||
import Dodge.Beam
|
||||
import Dodge.Base.Coordinate
|
||||
|
||||
@@ -18,33 +17,27 @@ import Data.Maybe
|
||||
moduleModification :: ItemModuleType -> Item -> Item
|
||||
moduleModification imt = case imt of
|
||||
EMPTYMODULE -> id
|
||||
DRUMMAG -> (itConsumption . laMax .~ 45)
|
||||
BELTMAG -> (itConsumption . laMax .~ 150)
|
||||
MAGNETMAG -> (itUse . useDelay . rateMax .~ 4)
|
||||
INCENDBUL -> (f $ expireAndDamage $ spawnAtBulDams incBall)
|
||||
BOUNCEBUL -> (f $ expireAndDamage bounceBulDams)
|
||||
STATICBUL -> (f $ expireAndDamage $ spawnAtBulDams aStaticBall)
|
||||
CONCUSBUL -> (f $ expireAndDamage $ spawnAtBulDams concBall)
|
||||
TARGCR -> (itTargeting .~ targetRBCreature)
|
||||
TARGLAS -> (itTargeting .~ targetLaser)
|
||||
TARGPOS -> (itTargeting .~ targetRBPress)
|
||||
MAGNETTRAJ ->
|
||||
( (itConsumption . laType . amBulTraj .~ MagnetTrajectory)
|
||||
DRUMMAG -> itConsumption . laMax .~ 45
|
||||
BELTMAG -> itConsumption . laMax .~ 150
|
||||
MAGNETMAG -> itUse . useDelay . rateMax .~ 4
|
||||
INCENDBUL -> f $ expireAndDamage $ spawnAtBulDams incBall
|
||||
BOUNCEBUL -> f $ expireAndDamage bounceBulDams
|
||||
STATICBUL -> f $ expireAndDamage $ spawnAtBulDams aStaticBall
|
||||
CONCUSBUL -> f $ expireAndDamage $ spawnAtBulDams concBall
|
||||
TARGCR -> itTargeting .~ targetRBCreature
|
||||
TARGLAS -> itTargeting .~ targetLaser
|
||||
TARGPOS -> itTargeting .~ targetRBPress
|
||||
MAGNETTRAJ -> (itConsumption . laType . amBulTraj .~ MagnetTrajectory)
|
||||
. (itConsumption . laType . amBulVel .~ V2 10 0)
|
||||
)
|
||||
FLECHETRAJ ->
|
||||
(itConsumption . laType . amBulTraj .~ FlechetteTrajectory)
|
||||
BEZIERTRAJ ->
|
||||
(itConsumption . laType . amBulTraj .~ BezierTrajectory)
|
||||
INCENDLAS -> (itParams . lasBeam .~ BeamCombine flameBeamCombine)
|
||||
SPLITLAS -> (itParams . lasBeam .~ BeamCombine splitBeamCombine)
|
||||
STATICLAS ->
|
||||
( (itParams . lasBeam .~ BeamCombine teslaBeamCombine)
|
||||
FLECHETRAJ -> itConsumption . laType . amBulTraj .~ FlechetteTrajectory
|
||||
BEZIERTRAJ -> itConsumption . laType . amBulTraj .~ BezierTrajectory
|
||||
INCENDLAS -> itParams . lasBeam .~ BeamCombine flameBeamCombine
|
||||
SPLITLAS -> itParams . lasBeam .~ BeamCombine splitBeamCombine
|
||||
STATICLAS -> (itParams . lasBeam .~ BeamCombine teslaBeamCombine)
|
||||
. (itParams . subParams ?~ teslaParams)
|
||||
)
|
||||
WEPTELE -> makeDirectedTele
|
||||
LAUNCHHOME -> (itConsumption . laType . amPjCreation .~ fireTrackingShell)
|
||||
EXTRABATTERY -> (itConsumption . laMax +~ 1000)
|
||||
LAUNCHHOME -> itConsumption . laType . amPjCreation .~ fireTrackingShell
|
||||
EXTRABATTERY -> itConsumption . laMax +~ 1000
|
||||
where
|
||||
f ameff = itConsumption . laType . amBulEff .~ ameff
|
||||
makeDirectedTele it = it
|
||||
@@ -59,4 +52,3 @@ moduleModification imt = case imt of
|
||||
where
|
||||
p = fromMaybe (_crPos cr) $ it ^? itTargeting . tgPos . _Just
|
||||
a = argV (mouseWorldPos w -.- p)
|
||||
--amod cts str func = (cts,ItemModule [str] 1 func)
|
||||
|
||||
@@ -44,7 +44,8 @@ defaultItem = Item
|
||||
basicItemDisplay :: Item -> [String]
|
||||
basicItemDisplay it = Prelude.take (itSlotsTaken it) $
|
||||
(midPadL 15 ' ' thename (' ' : thenumber) ++ theparam)
|
||||
: moduleStrings it ++ repeat "*"
|
||||
: catMaybes [maybeWarmupStatus it]
|
||||
++ moduleStrings it ++ repeat "*"
|
||||
where
|
||||
thename = show . _iyBase $ _itType it
|
||||
thenumber = case it ^? itConsumption of
|
||||
@@ -79,9 +80,9 @@ maybeWarmupStatus :: Item -> Maybe String
|
||||
maybeWarmupStatus it = case it ^? itUse . useDelay . warmMax of
|
||||
Nothing -> Nothing
|
||||
Just m -> case m - (_warmTime . _useDelay $ _itUse it) of
|
||||
x | x <= 1 -> Just "WARM"
|
||||
x | x <= 1 -> Just "*WARM"
|
||||
| otherwise -> let n = show x
|
||||
in Just $ Prelude.take (4 - Prelude.length n) "WARM" ++ n
|
||||
in Just $ Prelude.take (5 - Prelude.length n) "*WARM" ++ n
|
||||
|
||||
defaultItemType :: ItemType
|
||||
defaultItemType = ItemType NOTDEFINED mempty
|
||||
|
||||
@@ -22,18 +22,18 @@ import Dodge.Beam
|
||||
import Dodge.Item.Weapon.LaserPath
|
||||
import Dodge.Item.Location
|
||||
import Dodge.Creature.HandPos
|
||||
import Dodge.Particle.TeslaArc
|
||||
import Dodge.Particle.Flame
|
||||
--import Dodge.Particle.TeslaArc
|
||||
--import Dodge.Particle.Flame
|
||||
import Dodge.SoundLogic.LoadSound
|
||||
import Dodge.WorldEvent.Flash
|
||||
import Dodge.WorldEvent.Damage
|
||||
--import Dodge.WorldEvent.Damage
|
||||
--import Dodge.Default
|
||||
--import Dodge.Item.Weapon.InventoryDisplay
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.Item.Weapon.AmmoParams
|
||||
import Dodge.Default.Weapon
|
||||
--import Dodge.Item.Attachment
|
||||
import Dodge.WorldEvent.HelperParticle
|
||||
--import Dodge.WorldEvent.HelperParticle
|
||||
import Dodge.Base
|
||||
import Dodge.Zone
|
||||
import Geometry
|
||||
@@ -41,16 +41,16 @@ import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
import LensHelp
|
||||
import Dodge.RandomHelp
|
||||
import MonadHelp
|
||||
--import Dodge.RandomHelp
|
||||
--import MonadHelp
|
||||
|
||||
import Data.Maybe
|
||||
import Data.List (sortOn)
|
||||
import System.Random
|
||||
--import Data.Maybe
|
||||
--import Data.List (sortOn)
|
||||
--import System.Random
|
||||
--import Data.Tuple
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
import Control.Monad.State
|
||||
--import Control.Monad.State
|
||||
|
||||
defaultBatteryGun :: Item
|
||||
defaultBatteryGun = defaultGun
|
||||
|
||||
@@ -31,7 +31,6 @@ import Shape
|
||||
import Sound.Data
|
||||
import LensHelp
|
||||
|
||||
import Data.Maybe
|
||||
--import qualified Data.Map.Strict as M
|
||||
--import qualified Data.Sequence as Seq
|
||||
--import Control.Lens
|
||||
@@ -281,11 +280,6 @@ miniGunX i = defaultAutoGun
|
||||
}
|
||||
, _itEquipPict = pictureWeaponAim (miniGunXPictItem i)
|
||||
, _itInvSize = 4
|
||||
, _itInvDisplay = \it -> head (basicItemDisplay it) :
|
||||
["*" ++ replicate 13 ' ' ++ "*"
|
||||
,"* " ++ fromMaybe " " (maybeWarmupStatus it) ++ " *"
|
||||
,"*" ++ replicate 13 ' ' ++ "*" ]
|
||||
++ moduleStrings it
|
||||
, _itDimension = ItemDimension
|
||||
{ _dimRad = 20
|
||||
, _dimCenter = V3 5 0 0
|
||||
|
||||
+22
-24
@@ -20,33 +20,31 @@ moduleSize imt = case imt of
|
||||
EMPTYMODULE -> 0
|
||||
_ -> 1
|
||||
|
||||
--moduleStrings :: Item -> [String]
|
||||
--moduleStrings = moduleFold (++) (^? modName) []
|
||||
moduleStrings :: Item -> [String]
|
||||
moduleStrings = map moduleName . M.elems . _iyModules . _itType
|
||||
moduleStrings = M.elems . M.mapMaybe moduleName . _iyModules . _itType
|
||||
|
||||
moduleName :: ItemModuleType -> String
|
||||
moduleName :: ItemModuleType -> Maybe String
|
||||
moduleName imt = case imt of
|
||||
EMPTYMODULE -> ""
|
||||
DRUMMAG -> "+DRUM MAG"
|
||||
BELTMAG -> "+BELT FEED"
|
||||
MAGNETMAG -> "+MAGNET FEED"
|
||||
INCENDBUL -> "+INCENDIARY"
|
||||
BOUNCEBUL -> "+BOUNCE"
|
||||
STATICBUL -> "+STATIC"
|
||||
CONCUSBUL -> "+CONCUSS"
|
||||
TARGCR -> "+CREATURETARGETING"
|
||||
TARGLAS -> "+LASERTARGETING"
|
||||
TARGPOS -> "+POSTIONALTARGETING"
|
||||
MAGNETTRAJ -> "+MAGNETTRAJECTORY"
|
||||
FLECHETRAJ -> "+FLECHETTETRAJECTORY"
|
||||
BEZIERTRAJ -> "+BEZIERTRAJECTORY"
|
||||
INCENDLAS -> "+INCENDIARY"
|
||||
SPLITLAS -> "+SPLIT"
|
||||
STATICLAS -> "+STATIC"
|
||||
WEPTELE -> "+DIRECTEDTELE"
|
||||
LAUNCHHOME -> "+TARGET HOMING"
|
||||
EXTRABATTERY -> "+BATTERY"
|
||||
EMPTYMODULE -> Nothing
|
||||
DRUMMAG -> Just "+DRUM MAG"
|
||||
BELTMAG -> Just "+BELT FEED"
|
||||
MAGNETMAG -> Just "+MAGNET FEED"
|
||||
INCENDBUL -> Just "+INCENDIARY"
|
||||
BOUNCEBUL -> Just "+BOUNCE"
|
||||
STATICBUL -> Just "+STATIC"
|
||||
CONCUSBUL -> Just "+CONCUSS"
|
||||
TARGCR -> Just "+CREATURETARGETING"
|
||||
TARGLAS -> Just "+LASERTARGETING"
|
||||
TARGPOS -> Just "+POSTIONALTARGETING"
|
||||
MAGNETTRAJ -> Just "+MAGNETTRAJECTORY"
|
||||
FLECHETRAJ -> Just "+FLECHETTETRAJECTORY"
|
||||
BEZIERTRAJ -> Just "+BEZIERTRAJECTORY"
|
||||
INCENDLAS -> Just "+INCENDIARY"
|
||||
SPLITLAS -> Just "+SPLIT"
|
||||
STATICLAS -> Just "+STATIC"
|
||||
WEPTELE -> Just "+DIRECTEDTELE"
|
||||
LAUNCHHOME -> Just "+TARGET HOMING"
|
||||
EXTRABATTERY -> Just "+BATTERY"
|
||||
|
||||
--moduleFold :: (m -> m -> m) -> (ItemModule -> Maybe m) -> m -> Item -> m
|
||||
--moduleFold g f e = foldr (g . fromMaybe e . f) e
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
module Dodge.PtFlicker where
|
||||
import Dodge.Data
|
||||
import Dodge.LightSource
|
||||
import LensHelp
|
||||
import Geometry
|
||||
|
||||
ptFlicker :: Particle -> World -> World
|
||||
ptFlicker pt
|
||||
| _ptTimer pt `mod` 7 == 0 = tempLightSources
|
||||
.:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ptColor pt)) (addZ 10 $ _ptPos pt)
|
||||
| otherwise = id
|
||||
@@ -15,7 +15,6 @@ module Dodge.WorldEvent.Flash
|
||||
, flareCircleAt
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.PtFlicker
|
||||
import Dodge.LightSource
|
||||
import Dodge.WorldEvent.HelperParticle
|
||||
--import Dodge.Default
|
||||
@@ -53,3 +52,8 @@ explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 intensityFunc
|
||||
| x < 10 = 1 / (10 - fromIntegral x)
|
||||
| otherwise = 1
|
||||
|
||||
ptFlicker :: Particle -> World -> World
|
||||
ptFlicker pt
|
||||
| _ptTimer pt `mod` 7 == 0 = tempLightSources
|
||||
.:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ptColor pt)) (addZ 10 $ _ptPos pt)
|
||||
| otherwise = id
|
||||
|
||||
Reference in New Issue
Block a user