diff --git a/src/Dodge/Combine.hs b/src/Dodge/Combine.hs index 538aea655..e430e8241 100644 --- a/src/Dodge/Combine.hs +++ b/src/Dodge/Combine.hs @@ -8,6 +8,7 @@ import Dodge.Item.SlotsTaken import Dodge.Data.Universe import Dodge.Data.Combine import Dodge.Item.Display +import Dodge.Item.InventoryColor import Color --import Dodge.Data.SelectionList import qualified Data.IntSet as IS @@ -57,7 +58,7 @@ combineList' = map f . combineListInfo { _siPictures = basicItemDisplay itm , _siHeight = itSlotsTaken itm , _siIsSelectable = True - , _siColor = _itInvColor itm + , _siColor = itemInvColor itm , _siOffX = 0 , _siOffY = 0 , _siPayload = CombinableItem is itm strs diff --git a/src/Dodge/Data/Item.hs b/src/Dodge/Data/Item.hs index 047c2b00d..9e1de5a72 100644 --- a/src/Dodge/Data/Item.hs +++ b/src/Dodge/Data/Item.hs @@ -16,7 +16,6 @@ module Dodge.Data.Item ( module Dodge.Data.Item.Location, ) where -import Color import Control.Lens import Data.Aeson import Data.Aeson.TH @@ -39,7 +38,6 @@ data Item = Item , _itIsHeld :: Bool , _itEffect :: ItEffect , _itInvSize :: Float - , _itInvColor :: Color , _itDimension :: ItemDimension , _itCurseStatus :: CurseStatus , _itTweaks :: ItemTweaks diff --git a/src/Dodge/Default.hs b/src/Dodge/Default.hs index 27bb951b2..18ebbd3cf 100644 --- a/src/Dodge/Default.hs +++ b/src/Dodge/Default.hs @@ -25,10 +25,7 @@ import Geometry import Picture defaultEquipment :: Item -defaultEquipment = - defaultItem - & itInvColor .~ yellow - & itUse .~ defaultEquipUse +defaultEquipment = defaultItem & itUse .~ defaultEquipUse defaultFlIt :: FloorItem defaultFlIt = FlIt{_flItRot = 0, _flIt = defaultConsumable, _flItPos = V2 0 0, _flItID = 0} diff --git a/src/Dodge/Default/Item.hs b/src/Dodge/Default/Item.hs index f2f4442ed..e2667bfb1 100644 --- a/src/Dodge/Default/Item.hs +++ b/src/Dodge/Default/Item.hs @@ -4,7 +4,6 @@ module Dodge.Default.Item ( module Dodge.Default.Item.Effect, ) where -import Color import Control.Lens import qualified Data.Map.Strict as M import Dodge.Data.Item @@ -27,7 +26,7 @@ defaultItem = , _itEffect = defaultItEffect , _itID = 0 , _itIsHeld = False - , _itInvColor = yellow +-- , _itInvColor = yellow , _itInvSize = 1 , _itLocation = InVoid , _itDimension = defaultItemDimension @@ -40,22 +39,13 @@ defaultItem = } defaultLeftItem :: Item -defaultLeftItem = - defaultItem - & itUse .~ defaultLeftUse - & itInvColor .~ cyan +defaultLeftItem = defaultItem & itUse .~ defaultLeftUse defaultHeldItem :: Item -defaultHeldItem = - defaultItem - & itInvColor .~ white - & itUse .~ defaultHeldUse +defaultHeldItem = defaultItem & itUse .~ defaultHeldUse defaultCraftItem :: Item -defaultCraftItem = - defaultItem - & itUse .~ CraftUse 1 - & itInvColor .~ green +defaultCraftItem = defaultItem & itUse .~ CraftUse 1 defaultItemType :: ItemType defaultItemType = ItemType NoItemType mempty @@ -73,7 +63,6 @@ defaultWeapon :: Item defaultWeapon = defaultHeldItem & itUse .~ defaultHeldUse - & itInvColor .~ white & itType . iyModules .~ M.fromList [ (ModTarget, EMPTYMODULE) @@ -81,8 +70,5 @@ defaultWeapon = ] defaultConsumable :: Item -defaultConsumable = - defaultItem - & itUse .~ ConsumeUse CDoNothing 1 - & itInvColor .~ blue +defaultConsumable = defaultItem & itUse .~ ConsumeUse CDoNothing 1 diff --git a/src/Dodge/Inventory/SelectionList.hs b/src/Dodge/Inventory/SelectionList.hs index 0c41a2767..6dc52abf1 100644 --- a/src/Dodge/Inventory/SelectionList.hs +++ b/src/Dodge/Inventory/SelectionList.hs @@ -9,6 +9,7 @@ import Dodge.Data.SelectionList import Dodge.Data.World import Dodge.Item.SlotsTaken import Dodge.Item.Display +import Dodge.Item.InventoryColor import LensHelp import Picture.Base @@ -26,7 +27,7 @@ invSelectionItem cr i it = where anyhotkey = maybe [] ((' ':) .hotkeyToString) (cr ^? crInvHotkeys . ix i) anyequippos = maybe [] (rightPad 8 ' ' . (' ':) . eqPosText) (cr ^? crInvEquipped . ix i) - col = _itInvColor it + col = itemInvColor it (yoff,pics) = case _itCurseStatus it of UndroppableIdentified -> itemDisplayOffset cr it _ -> itemDisplayOffset cr it @@ -64,5 +65,5 @@ closeObjectToSelectionItem e = -- closeObjectToTextPictures :: Either FloorItem Button -> ([String], Color) closeObjectToTextPictures e = case e of - Left flit -> let it = _flIt flit in (basicItemDisplay it, _itInvColor it) + Left flit -> let it = _flIt flit in (basicItemDisplay it, itemInvColor it) Right bt -> ([_btText bt], yellow) diff --git a/src/Dodge/Item/Craftable.hs b/src/Dodge/Item/Craftable.hs index 92b1f1bab..747cf5cfa 100644 --- a/src/Dodge/Item/Craftable.hs +++ b/src/Dodge/Item/Craftable.hs @@ -1,7 +1,6 @@ module Dodge.Item.Craftable where import Dodge.Default.Item -import Color import Control.Lens import Dodge.Data.Item @@ -17,10 +16,7 @@ makeTypeCraft :: CraftType -> Item makeTypeCraft = makeTypeCraftNum 1 energyBallCraft :: EnergyBallType -> Item -energyBallCraft ebt = - makeTypeCraft (ENERGYBALLCRAFT ebt) - & itInvSize .~ 1 - & itInvColor .~ chartreuse +energyBallCraft ebt = makeTypeCraft (ENERGYBALLCRAFT ebt) & itInvSize .~ 1 incendiaryModule :: Item incendiaryModule = energyBallCraft IncBall @@ -29,34 +25,21 @@ bulletBodyCraft :: BulletEffect -> Item bulletBodyCraft ebt = makeTypeCraft (BULBODYCRAFT ebt) & itInvSize .~ 1 - & itInvColor .~ chartreuse bounceModule :: Item bounceModule = bulletBodyCraft BounceBullet teleportModule :: Item -teleportModule = - makeTypeCraft TELEPORTMODULE - & itInvSize .~ 1 - & itInvColor .~ chartreuse +teleportModule = makeTypeCraft TELEPORTMODULE & itInvSize .~ 1 timeModule :: Item -timeModule = - makeTypeCraft TIMEMODULE - & itInvSize .~ 1 - & itInvColor .~ chartreuse +timeModule = makeTypeCraft TIMEMODULE & itInvSize .~ 1 sizeModule :: Item -sizeModule = - makeTypeCraft SIZEMODULE - & itInvSize .~ 1 - & itInvColor .~ chartreuse +sizeModule = makeTypeCraft SIZEMODULE & itInvSize .~ 1 gravityModule :: Item -gravityModule = - makeTypeCraft GRAVITYMODULE - & itInvSize .~ 1 - & itInvColor .~ chartreuse +gravityModule = makeTypeCraft GRAVITYMODULE & itInvSize .~ 1 pipe :: Item pipe = makeTypeCraft PIPE diff --git a/src/Dodge/Item/Equipment.hs b/src/Dodge/Item/Equipment.hs index 3cc4b46c8..27014370c 100644 --- a/src/Dodge/Item/Equipment.hs +++ b/src/Dodge/Item/Equipment.hs @@ -127,14 +127,10 @@ powerLegs = & itType . iyBase .~ EQUIP POWERLEGS speedLegs :: Item -speedLegs = - powerLegs - & itType . iyBase .~ EQUIP SPEEDLEGS +speedLegs = powerLegs & itType . iyBase .~ EQUIP SPEEDLEGS jumpLegs :: Item -jumpLegs = - powerLegs - & itType . iyBase .~ EQUIP JUMPLEGS +jumpLegs = powerLegs & itType . iyBase .~ EQUIP JUMPLEGS wristInvisibility :: Item wristInvisibility = diff --git a/src/Dodge/Item/Held/Cane.hs b/src/Dodge/Item/Held/Cane.hs index 27d1c4543..cdd875d98 100644 --- a/src/Dodge/Item/Held/Cane.hs +++ b/src/Dodge/Item/Held/Cane.hs @@ -55,7 +55,8 @@ rifle = & itUse . heldAim . aimStance .~ TwoHandUnder & itType . iyBase .~ HELD RIFLE & itUse . heldConsumption . laSource . _InternalSource . iaMax .~ 1 - & itUse . heldConsumption . laSource . _InternalSource . iaCycle .~ [loadEject 5, loadInsert 5, loadPrime 5] + & itUse . heldConsumption . laSource . _InternalSource . iaCycle + .~ [loadEject 5, loadInsert 5, loadPrime 5] & itUse . heldAim . aimWeight .~ 6 & itUse . heldAim . aimRange .~ 1 & itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1.5} diff --git a/src/Dodge/Item/Held/Utility.hs b/src/Dodge/Item/Held/Utility.hs index 09e07514d..1aaaa0875 100644 --- a/src/Dodge/Item/Held/Utility.hs +++ b/src/Dodge/Item/Held/Utility.hs @@ -2,7 +2,6 @@ module Dodge.Item.Held.Utility where import Linear import Dodge.Default.Item -import Color import Control.Lens import Dodge.Data.Item --import Geometry.Data @@ -19,15 +18,10 @@ flatShield = & itType . iyBase .~ HELD FLATSHIELD keyCard :: Int -> Item -keyCard n = - defaultHeldItem - & itInvColor .~ aquamarine - & itType . iyBase .~ HELD (KEYCARD n) +keyCard n = defaultHeldItem & itType . iyBase .~ HELD (KEYCARD n) latchkey :: Int -> Item -latchkey _ = - defaultHeldItem - & itInvColor .~ yellow +latchkey _ = defaultHeldItem binoculars :: Item binoculars = diff --git a/src/Dodge/Item/Weapon/Utility.hs b/src/Dodge/Item/Weapon/Utility.hs index fc2e93c9b..5b8f1a87f 100644 --- a/src/Dodge/Item/Weapon/Utility.hs +++ b/src/Dodge/Item/Weapon/Utility.hs @@ -10,7 +10,6 @@ module Dodge.Item.Weapon.Utility import Control.Lens import Dodge.Data.Item import Dodge.Default -import Picture stopWatch :: Item stopWatch = @@ -20,7 +19,6 @@ stopWatch = & leftUse .~ LTimePause & equipEffect . eeSite .~ GoesOnWrist ) - & itInvColor .~ cyan & itEffect . ieInv .~ ChargeIfEquipped & itEffect . ieOnDrop .~ SetCharge 0 & itType . iyBase .~ LEFT STOPWATCH @@ -53,8 +51,7 @@ shrinkGun = blinkGun :: Item blinkGun = defaultLeftItem - { _itInvColor = cyan - , _itUse = + { _itUse = defaultLeftUse & leftUse .~ LBlink --hammerCheckL (shootL $ const blinkAction) & equipEffect . eeSite .~ GoesOnWrist