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