diff --git a/src/Dodge/Combine.hs b/src/Dodge/Combine.hs index 13ad83903..dea3c6c20 100644 --- a/src/Dodge/Combine.hs +++ b/src/Dodge/Combine.hs @@ -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 diff --git a/src/Dodge/Combine/Combinations.hs b/src/Dodge/Combine/Combinations.hs index 52cb3ef8a..ed4a19650 100644 --- a/src/Dodge/Combine/Combinations.hs +++ b/src/Dodge/Combine/Combinations.hs @@ -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 = diff --git a/src/Dodge/Combine/Module.hs b/src/Dodge/Combine/Module.hs index 35fdd73ce..8c578c076 100644 --- a/src/Dodge/Combine/Module.hs +++ b/src/Dodge/Combine/Module.hs @@ -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 diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index fbeaa7c64..0e61bb541 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -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 diff --git a/src/Dodge/Default/Item.hs b/src/Dodge/Default/Item.hs index b3eb21042..56b4b4b70 100644 --- a/src/Dodge/Default/Item.hs +++ b/src/Dodge/Default/Item.hs @@ -10,7 +10,6 @@ import Padding import Dodge.Inventory.ItemSpace import Dodge.Module import Picture -import ShapePicture import Shape import Data.Maybe diff --git a/src/Dodge/IncBall.hs b/src/Dodge/IncBall.hs deleted file mode 100644 index b2ef3d8cd..000000000 --- a/src/Dodge/IncBall.hs +++ /dev/null @@ -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 diff --git a/src/Dodge/Item.hs b/src/Dodge/Item.hs index 1928aaf37..cd088661f 100644 --- a/src/Dodge/Item.hs +++ b/src/Dodge/Item.hs @@ -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 diff --git a/src/Dodge/Item/PassKey.hs b/src/Dodge/Item/PassKey.hs index 79215b0d6..c756140cf 100644 --- a/src/Dodge/Item/PassKey.hs +++ b/src/Dodge/Item/PassKey.hs @@ -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 diff --git a/src/Dodge/Item/Weapon/Launcher.hs b/src/Dodge/Item/Weapon/Launcher.hs index ff1de37d8..bec425d5a 100644 --- a/src/Dodge/Item/Weapon/Launcher.hs +++ b/src/Dodge/Item/Weapon/Launcher.hs @@ -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 diff --git a/src/Dodge/Module.hs b/src/Dodge/Module.hs index 35c245f6f..7b04957e9 100644 --- a/src/Dodge/Module.hs +++ b/src/Dodge/Module.hs @@ -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 diff --git a/src/Dodge/WorldEvent/SpawnParticle.hs b/src/Dodge/WorldEvent/SpawnParticle.hs index c7b035c25..477293ba9 100644 --- a/src/Dodge/WorldEvent/SpawnParticle.hs +++ b/src/Dodge/WorldEvent/SpawnParticle.hs @@ -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