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