Cleanup
This commit is contained in:
@@ -13,6 +13,7 @@ import Dodge.Data
|
|||||||
import Dodge.Item.Amount
|
import Dodge.Item.Amount
|
||||||
import Dodge.Inventory.ItemSpace
|
import Dodge.Inventory.ItemSpace
|
||||||
import Dodge.Combine.Module
|
import Dodge.Combine.Module
|
||||||
|
import Dodge.Module
|
||||||
--import Dodge.Combine.Data
|
--import Dodge.Combine.Data
|
||||||
import Multiset
|
import Multiset
|
||||||
import SimpleTrie
|
import SimpleTrie
|
||||||
@@ -80,7 +81,7 @@ addModules (ps,it) = (is , (applyModules newm it, ss))
|
|||||||
applyModules :: M.Map ModuleSlot ItemModuleType -> Item -> Item
|
applyModules :: M.Map ModuleSlot ItemModuleType -> Item -> Item
|
||||||
applyModules ms it = foldr f (it & itType . iyModules .~ ms) ms
|
applyModules ms it = foldr f (it & itType . iyModules .~ ms) ms
|
||||||
where
|
where
|
||||||
f m = fromMaybe id (fromModuleType m ^? modModification)
|
f m = moduleModification m
|
||||||
-- (is , ) <$> [ (it & itModules .~ themodules,s) | (themodules,s) <- combinedmodules]
|
-- (is , ) <$> [ (it & itModules .~ themodules,s) | (themodules,s) <- combinedmodules]
|
||||||
-- where
|
-- where
|
||||||
-- (ms,is) = unzip ps
|
-- (ms,is) = unzip ps
|
||||||
@@ -104,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 = _modName $ fromModuleType imt
|
ss imt = [moduleName imt]
|
||||||
|
|
||||||
toggleCombineInv :: World -> World
|
toggleCombineInv :: World -> World
|
||||||
toggleCombineInv w = case _hudElement (_hud w) of
|
toggleCombineInv w = case _hudElement (_hud w) of
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
{-# LANGUAGE TupleSections #-}
|
{-# LANGUAGE TupleSections #-}
|
||||||
module Dodge.Combine.Combinations where
|
module Dodge.Combine.Combinations where
|
||||||
import Geometry
|
--import Geometry
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.WorldEvent.SpawnParticle
|
--import Dodge.WorldEvent.SpawnParticle
|
||||||
import Dodge.Particle.HitEffect.ExpireAndDamage
|
--import Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
import Dodge.Particle.Damage
|
--import Dodge.Particle.Damage
|
||||||
import Dodge.Item.Equipment
|
import Dodge.Item.Equipment
|
||||||
import Dodge.Item.Craftable
|
import Dodge.Item.Craftable
|
||||||
import Dodge.Item.Weapon
|
import Dodge.Item.Weapon
|
||||||
import Dodge.Combine.Module
|
--import Dodge.Combine.Module
|
||||||
import Dodge.Base
|
--import Dodge.Base
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
import Data.Maybe
|
--import Data.Maybe
|
||||||
|
|
||||||
itemCombinations :: [([(Int,ItemBaseType)],Item)]
|
itemCombinations :: [([(Int,ItemBaseType)],Item)]
|
||||||
itemCombinations =
|
itemCombinations =
|
||||||
|
|||||||
+22
-24
@@ -4,7 +4,6 @@ import Dodge.Tesla
|
|||||||
import Dodge.Particle.HitEffect.ExpireAndDamage
|
import Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
import Dodge.WorldEvent.SpawnParticle
|
import Dodge.WorldEvent.SpawnParticle
|
||||||
import Dodge.Particle.Damage
|
import Dodge.Particle.Damage
|
||||||
import Dodge.IncBall
|
|
||||||
import Dodge.Item.Weapon.ExtraEffect
|
import Dodge.Item.Weapon.ExtraEffect
|
||||||
import Dodge.Item.Weapon.Launcher
|
import Dodge.Item.Weapon.Launcher
|
||||||
import Dodge.Item.Weapon.TriggerType
|
import Dodge.Item.Weapon.TriggerType
|
||||||
@@ -16,38 +15,37 @@ import Dodge.Base.Coordinate
|
|||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
fromModuleType :: ItemModuleType -> ItemModule
|
moduleModification :: ItemModuleType -> Item -> Item
|
||||||
fromModuleType imt = case imt of
|
moduleModification imt = case imt of
|
||||||
EMPTYMODULE -> ItemModule ["EMPTYMODULE"] 1 id
|
EMPTYMODULE -> id
|
||||||
DRUMMAG -> mod "+DRUM MAG" (itConsumption . laMax .~ 45)
|
DRUMMAG -> (itConsumption . laMax .~ 45)
|
||||||
BELTMAG -> mod "+BELT FEED" (itConsumption . laMax .~ 150)
|
BELTMAG -> (itConsumption . laMax .~ 150)
|
||||||
MAGNETMAG -> mod "+MAGNET FEED" (itUse . useDelay . rateMax .~ 4)
|
MAGNETMAG -> (itUse . useDelay . rateMax .~ 4)
|
||||||
INCENDBUL -> mod "+INCENDIARY" (f $ expireAndDamage $ spawnAtBulDams incBall)
|
INCENDBUL -> (f $ expireAndDamage $ spawnAtBulDams incBall)
|
||||||
BOUNCEBUL -> mod "+BOUNCE" (f $ expireAndDamage bounceBulDams)
|
BOUNCEBUL -> (f $ expireAndDamage bounceBulDams)
|
||||||
STATICBUL -> mod "+STATIC" (f $ expireAndDamage $ spawnAtBulDams aStaticBall)
|
STATICBUL -> (f $ expireAndDamage $ spawnAtBulDams aStaticBall)
|
||||||
CONCUSBUL -> mod "+CONCUSS" (f $ expireAndDamage $ spawnAtBulDams concBall)
|
CONCUSBUL -> (f $ expireAndDamage $ spawnAtBulDams concBall)
|
||||||
TARGCR -> mod "+CREATURETARGETING" (itTargeting .~ targetRBCreature)
|
TARGCR -> (itTargeting .~ targetRBCreature)
|
||||||
TARGLAS -> mod "+LASERTARGETING" (itTargeting .~ targetLaser)
|
TARGLAS -> (itTargeting .~ targetLaser)
|
||||||
TARGPOS -> mod "+POSTIONALTARGETING" (itTargeting .~ targetRBPress)
|
TARGPOS -> (itTargeting .~ targetRBPress)
|
||||||
MAGNETTRAJ -> mod "+MAGNETTRAJECTORY"
|
MAGNETTRAJ ->
|
||||||
( (itConsumption . laType . amBulTraj .~ MagnetTrajectory)
|
( (itConsumption . laType . amBulTraj .~ MagnetTrajectory)
|
||||||
. (itConsumption . laType . amBulVel .~ V2 10 0)
|
. (itConsumption . laType . amBulVel .~ V2 10 0)
|
||||||
)
|
)
|
||||||
FLECHETRAJ -> mod "+FLECHETTETRAJECTORY"
|
FLECHETRAJ ->
|
||||||
(itConsumption . laType . amBulTraj .~ FlechetteTrajectory)
|
(itConsumption . laType . amBulTraj .~ FlechetteTrajectory)
|
||||||
BEZIERTRAJ -> mod "+BEZIERTRAJECTORY"
|
BEZIERTRAJ ->
|
||||||
(itConsumption . laType . amBulTraj .~ BezierTrajectory)
|
(itConsumption . laType . amBulTraj .~ BezierTrajectory)
|
||||||
INCENDLAS -> mod "+INCENDIARY" (itParams . lasBeam .~ BeamCombine flameBeamCombine)
|
INCENDLAS -> (itParams . lasBeam .~ BeamCombine flameBeamCombine)
|
||||||
SPLITLAS -> mod "+SPLIT" (itParams . lasBeam .~ BeamCombine splitBeamCombine)
|
SPLITLAS -> (itParams . lasBeam .~ BeamCombine splitBeamCombine)
|
||||||
STATICLAS -> mod "+STATIC"
|
STATICLAS ->
|
||||||
( (itParams . lasBeam .~ BeamCombine teslaBeamCombine)
|
( (itParams . lasBeam .~ BeamCombine teslaBeamCombine)
|
||||||
. (itParams . subParams ?~ teslaParams)
|
. (itParams . subParams ?~ teslaParams)
|
||||||
)
|
)
|
||||||
WEPTELE -> mod "+DIRECTEDTELE" makeDirectedTele
|
WEPTELE -> makeDirectedTele
|
||||||
LAUNCHHOME -> mod "+TARGET HOMING" (itConsumption . laType . amPjCreation .~ fireTrackingShell)
|
LAUNCHHOME -> (itConsumption . laType . amPjCreation .~ fireTrackingShell)
|
||||||
EXTRABATTERY -> mod "+BATTERY" (itConsumption . laMax +~ 1000)
|
EXTRABATTERY -> (itConsumption . laMax +~ 1000)
|
||||||
where
|
where
|
||||||
mod str func = ItemModule [str] 1 func
|
|
||||||
f ameff = itConsumption . laType . amBulEff .~ ameff
|
f ameff = itConsumption . laType . amBulEff .~ ameff
|
||||||
makeDirectedTele it = it
|
makeDirectedTele it = it
|
||||||
& itTargeting .~ targetRBPress
|
& itTargeting .~ targetRBPress
|
||||||
|
|||||||
@@ -522,14 +522,6 @@ data Targeting
|
|||||||
, _tgActive :: Bool
|
, _tgActive :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
data ItemModule
|
|
||||||
= DefaultModule
|
|
||||||
| ItemModule
|
|
||||||
{ _modName :: [String]
|
|
||||||
, _modSize :: Int
|
|
||||||
, _modModification :: Item -> Item
|
|
||||||
}
|
|
||||||
|
|
||||||
data ItemDimension = ItemDimension
|
data ItemDimension = ItemDimension
|
||||||
{ _dimRad :: Float
|
{ _dimRad :: Float
|
||||||
, _dimCenter :: Point3
|
, _dimCenter :: Point3
|
||||||
@@ -1596,7 +1588,6 @@ makeLenses ''ItemPortage
|
|||||||
makeLenses ''Magnet
|
makeLenses ''Magnet
|
||||||
makeLenses ''Gust
|
makeLenses ''Gust
|
||||||
makeLenses ''GunBarrels
|
makeLenses ''GunBarrels
|
||||||
makeLenses ''ItemModule
|
|
||||||
makeLenses ''Targeting
|
makeLenses ''Targeting
|
||||||
makeLenses ''Nozzle
|
makeLenses ''Nozzle
|
||||||
makeLenses ''HUD
|
makeLenses ''HUD
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import Padding
|
|||||||
import Dodge.Inventory.ItemSpace
|
import Dodge.Inventory.ItemSpace
|
||||||
import Dodge.Module
|
import Dodge.Module
|
||||||
import Picture
|
import Picture
|
||||||
import ShapePicture
|
|
||||||
import Shape
|
import Shape
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
module Dodge.IncBall where
|
|
||||||
import Dodge.Data
|
|
||||||
import Dodge.Particle.HitEffect.ExpireAndDamage
|
|
||||||
import Dodge.Particle.Damage
|
|
||||||
import Dodge.PtFlicker
|
|
||||||
import Geometry
|
|
||||||
import Picture
|
|
||||||
|
|
||||||
import System.Random
|
|
||||||
import Control.Monad.State
|
|
||||||
+1
-4
@@ -3,10 +3,7 @@ module Dodge.Item
|
|||||||
, module Dodge.Item.Consumable
|
, module Dodge.Item.Consumable
|
||||||
, module Dodge.Item.PassKey
|
, module Dodge.Item.PassKey
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
--import Dodge.Data
|
||||||
import Dodge.Item.Weapon
|
import Dodge.Item.Weapon
|
||||||
import Dodge.Item.Consumable
|
import Dodge.Item.Consumable
|
||||||
import Dodge.Item.PassKey
|
import Dodge.Item.PassKey
|
||||||
|
|
||||||
fromType :: ItemType -> Item
|
|
||||||
fromType ct = undefined
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ keyPic = color green $
|
|||||||
]
|
]
|
||||||
|
|
||||||
latchkey :: Int -> Item
|
latchkey :: Int -> Item
|
||||||
latchkey n = defaultEquipment
|
latchkey _ = defaultEquipment
|
||||||
{ _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
|
{ _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
|
||||||
, _itEffect = NoItEffect
|
, _itEffect = NoItEffect
|
||||||
, _itID = Nothing
|
, _itID = Nothing
|
||||||
|
|||||||
@@ -278,9 +278,6 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
|
|||||||
_ -> 0
|
_ -> 0
|
||||||
spinFactor = 5 * (6 - fromIntegral i)
|
spinFactor = 5 * (6 - fromIntegral i)
|
||||||
|
|
||||||
remoteLauncherName :: String
|
|
||||||
remoteLauncherName = "ROCKO-REMOTE"
|
|
||||||
|
|
||||||
remoteLauncher :: Item
|
remoteLauncher :: Item
|
||||||
remoteLauncher = launcher
|
remoteLauncher = launcher
|
||||||
& itType . iyBase .~ REMOTELAUNCHER
|
& itType . iyBase .~ REMOTELAUNCHER
|
||||||
|
|||||||
+20
-1
@@ -1,6 +1,7 @@
|
|||||||
module Dodge.Module
|
module Dodge.Module
|
||||||
( moduleSizes
|
( moduleSizes
|
||||||
, moduleStrings
|
, moduleStrings
|
||||||
|
, moduleName
|
||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
--import Dodge.Combine.Module
|
--import Dodge.Combine.Module
|
||||||
@@ -27,7 +28,25 @@ moduleStrings = map moduleName . M.elems . _iyModules . _itType
|
|||||||
moduleName :: ItemModuleType -> String
|
moduleName :: ItemModuleType -> String
|
||||||
moduleName imt = case imt of
|
moduleName imt = case imt of
|
||||||
EMPTYMODULE -> ""
|
EMPTYMODULE -> ""
|
||||||
_ -> '+':show imt
|
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"
|
||||||
|
|
||||||
--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
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import Dodge.Base
|
|||||||
import Dodge.Zone
|
import Dodge.Zone
|
||||||
import Dodge.Particle.HitEffect.ExpireAndDamage
|
import Dodge.Particle.HitEffect.ExpireAndDamage
|
||||||
import Dodge.Particle.Damage
|
import Dodge.Particle.Damage
|
||||||
import Dodge.IncBall
|
|
||||||
--import Dodge.WorldEvent.HitEffect
|
--import Dodge.WorldEvent.HitEffect
|
||||||
import Dodge.WorldEvent.ThingsHit
|
import Dodge.WorldEvent.ThingsHit
|
||||||
import Dodge.WorldEvent.Cloud
|
import Dodge.WorldEvent.Cloud
|
||||||
|
|||||||
Reference in New Issue
Block a user