Remove shrink gun
This commit is contained in:
+1
-10
@@ -1,10 +1 @@
|
||||
/home/justin/Haskell/loop/src/Dodge/DisplayInventory.hs:12:1-30: warning: [-Wunused-imports]
|
||||
The import of ‘Dodge.Data.ComposedItem’ is redundant
|
||||
|
|
||||
12 | import Dodge.Data.ComposedItem
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
/home/justin/Haskell/loop/src/Dodge/Item/InventoryColor.hs:7:1-22: warning: [-Wunused-imports]
|
||||
The import of ‘Dodge.Data.Item’ is redundant
|
||||
|
|
||||
7 | import Dodge.Data.Item
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
All good (597 modules, at 22:09:47)
|
||||
|
||||
@@ -186,16 +186,13 @@ youDropItem w = fromMaybe w $ do
|
||||
curpos <-
|
||||
you w ^? crManipulation . manObject . imSelectedItem
|
||||
<|> fmap fst (IM.lookupMax =<< w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems)
|
||||
guard $ not $ _crInvLock (you w) || cursed
|
||||
guard $ not $ _crInvLock (you w)
|
||||
return $
|
||||
w
|
||||
& dropItem cr curpos
|
||||
& soundStart (CrSound (_crID cr)) (_crPos cr) whiteNoiseFadeOutS Nothing
|
||||
where
|
||||
cr = you w
|
||||
cursed = fromMaybe False $ do
|
||||
it <- yourSelectedItem w
|
||||
return $ it ^. itCurseStatus /= Uncursed
|
||||
|
||||
sizeSelf :: Float -> Creature -> World -> Maybe World
|
||||
sizeSelf x cr w
|
||||
|
||||
@@ -5,6 +5,7 @@ module Dodge.Creature.Impulse.UseItem (
|
||||
useItemHotkey,
|
||||
) where
|
||||
|
||||
import Dodge.Luse
|
||||
import Dodge.SelectUse
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Data.ComposedItem
|
||||
@@ -19,7 +20,6 @@ import Dodge.HeldUse
|
||||
import Dodge.Hotkey
|
||||
import Dodge.Inventory
|
||||
import Dodge.Item.Location
|
||||
import Dodge.Luse
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
useRootItem :: Int -> World -> World
|
||||
|
||||
@@ -7,7 +7,6 @@ module Dodge.Data.Item (
|
||||
module Dodge.Data.Item.Misc,
|
||||
module Dodge.Data.Item.Params,
|
||||
module Dodge.Data.Item.Use,
|
||||
module Dodge.Data.Item.CurseStatus,
|
||||
module Dodge.Data.Item.Scope,
|
||||
module Dodge.Data.Item.Combine,
|
||||
module Dodge.Data.Item.Location,
|
||||
@@ -19,7 +18,6 @@ import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Dodge.Data.Item.Combine
|
||||
import Dodge.Data.Item.CurseStatus
|
||||
import Dodge.Data.Item.Effect
|
||||
import Dodge.Data.Item.Location
|
||||
import Dodge.Data.Item.Misc
|
||||
@@ -40,7 +38,6 @@ data Item = Item
|
||||
, _itAmmoSlots :: IM.IntMap AmmoType
|
||||
, _itInvSize :: Int
|
||||
, _itDimension :: ItemDimension
|
||||
, _itCurseStatus :: CurseStatus
|
||||
, _itParams :: ItemParams
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@ data LeftItemType
|
||||
| SCROLLWATCH
|
||||
| BLINKER
|
||||
| BLINKERUNSAFE
|
||||
| SHRINKER
|
||||
| SPAWNER
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE DeriveAnyClass #-}
|
||||
{-# LANGUAGE StrictData #-}
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Dodge.Data.Item.CurseStatus where
|
||||
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
|
||||
data CurseStatus
|
||||
= Uncursed
|
||||
| UndroppableIdentified
|
||||
| UndroppableUnidentified
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
deriveJSON defaultOptions ''CurseStatus
|
||||
@@ -12,15 +12,6 @@ import Dodge.Data.CamouflageStatus
|
||||
import Dodge.Data.Item.Combine
|
||||
import Control.Lens
|
||||
|
||||
--data Huse
|
||||
-- = HeldDoNothing
|
||||
---- | HeldFireRemoteShell
|
||||
---- | HeldExplodeRemoteShell Int Int
|
||||
-- | HeldDetectorEffect Detector
|
||||
-- | HeldForceField
|
||||
---- | HeldShatter
|
||||
-- deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data Cuse
|
||||
= CDoNothing
|
||||
| CHeal Int
|
||||
@@ -49,7 +40,6 @@ data Luse
|
||||
| LRewind
|
||||
| LTimePause
|
||||
| LTimeScroll
|
||||
| LShrink
|
||||
| LBlink
|
||||
| LUnsafeBlink
|
||||
| LBoost
|
||||
|
||||
@@ -23,8 +23,7 @@ defaultItemDimension = ItemDimension
|
||||
|
||||
defaultHeldItem :: Item
|
||||
defaultHeldItem = Item
|
||||
{ _itCurseStatus = Uncursed
|
||||
, _itType = HELD PISTOL
|
||||
{ _itType = HELD PISTOL
|
||||
, _itEffect = defaultItEffect
|
||||
, _itID = 0 -- should this return an error ? const $ error "itID not correctly initialised" ?
|
||||
, _itTargeting = NoItTargeting
|
||||
|
||||
@@ -9,7 +9,6 @@ module Dodge.DisplayInventory (
|
||||
updateCombinePositioning,
|
||||
) where
|
||||
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.DoubleTree
|
||||
import Control.Lens
|
||||
import Dodge.Inventory.SelectionList
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
module Dodge.Inventory.SelectionList (
|
||||
invSelectionItem,
|
||||
invSelectionItem',
|
||||
@@ -81,6 +82,6 @@ closeObjectToSelectionItem e =
|
||||
|
||||
--
|
||||
closeObjectToTextPictures :: Either FloorItem Button -> ([String], Color)
|
||||
closeObjectToTextPictures e = case e of
|
||||
closeObjectToTextPictures = \case
|
||||
Left flit -> let it = _flIt flit in (basicItemDisplay it, itemInvColor . pciToCI $ basePCI it)
|
||||
Right bt -> ([_btText bt], yellow)
|
||||
|
||||
@@ -81,5 +81,4 @@ itemFromLeftType lt = case lt of
|
||||
SCROLLWATCH -> scrollWatch
|
||||
BLINKER -> blinkGun
|
||||
BLINKERUNSAFE -> unsafeBlinkGun
|
||||
SHRINKER -> shrinkGun
|
||||
SPAWNER -> error "need to datify creatures first"
|
||||
|
||||
@@ -8,7 +8,6 @@ makeTypeCraftNum :: Int -> CraftType -> [Item]
|
||||
makeTypeCraftNum i ct = replicate i $
|
||||
defaultCraftItem
|
||||
& itInvSize .~ 1
|
||||
& itCurseStatus .~ Uncursed
|
||||
& itType .~ CRAFT ct
|
||||
|
||||
makeTypeCraft :: CraftType -> Item
|
||||
|
||||
@@ -202,12 +202,16 @@ invTrees' = IM.unions . map (ldtToIM getindex . fmap (^. _1)) . map (fmap (\(x,
|
||||
-- returns an intmap with trees for all items
|
||||
--invTrees'' :: IM.IntMap Item -> [LocationLDT ItemLink ComposedItem]
|
||||
invTrees'' :: IM.IntMap Item -> IM.IntMap (Int,LocationLDT ItemLink ComposedItem)
|
||||
invTrees'' = IM.unions . map (f . LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
--invTrees'' = map (LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
invTrees'' inv = foldMap (f . LocLDT TopLDT) (IM.elems (invRootTrees inv)) mempty
|
||||
where
|
||||
f t = cldtPropagateFold h h g 0 t mempty
|
||||
f t = cldtPropagateFold h h g 0 t id
|
||||
h x _ _ _ = x + 1
|
||||
g x ldt = IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt)
|
||||
g x ldt = (.) (IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt))
|
||||
--invTrees'' = IM.unions . map (f . LocLDT TopLDT) . IM.elems . invRootTrees
|
||||
-- where
|
||||
-- f t = cldtPropagateFold h h g 0 t mempty
|
||||
-- h x _ _ _ = x + 1
|
||||
-- g x ldt = IM.insert (ldt ^?! locLDT . ldtValue . cItem . itLocation . ilInvID) (x,ldt)
|
||||
|
||||
-- returns an intmap with trees for root items, indexed by inventory position
|
||||
invRootTrees :: IM.IntMap Item -> IM.IntMap (LabelDoubleTree ItemLink ComposedItem)
|
||||
|
||||
@@ -101,7 +101,6 @@ leftInfo lit = case lit of
|
||||
SCROLLWATCH -> "A device that can be used to scroll through recent events."
|
||||
BLINKER -> "A device that allows local teleportation."
|
||||
BLINKERUNSAFE -> "A device that allows local teleportation. Potentially hazardous around walls."
|
||||
SHRINKER -> "A device that shrinks the user."
|
||||
SPAWNER -> "A device that spawns creatures."
|
||||
|
||||
equipInfo :: EquipItemType -> String
|
||||
|
||||
@@ -4,7 +4,6 @@ module Dodge.Item.InventoryColor
|
||||
|
||||
import Dodge.Data.ComposedItem
|
||||
import Color
|
||||
import Dodge.Data.Item
|
||||
import Control.Lens
|
||||
|
||||
itemInvColor :: ComposedItem -> Color
|
||||
|
||||
@@ -4,7 +4,6 @@ module Dodge.Item.Weapon.Utility
|
||||
, scrollWatch
|
||||
, blinkGun
|
||||
, unsafeBlinkGun
|
||||
, shrinkGun
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
@@ -40,14 +39,6 @@ rewindWatch =
|
||||
& itUse . leftUse .~ LRewind --useRewindGun
|
||||
& itType .~ LEFT REWINDWATCH
|
||||
|
||||
-- needs to shift this item to the current inventory slot
|
||||
shrinkGun :: Item
|
||||
shrinkGun =
|
||||
defaultLeftItem
|
||||
& itUse .~ (defaultLeftUse & leftUse .~ LShrink)
|
||||
& itParams .~ ShrinkGunParams FullSize
|
||||
& itType .~ LEFT SHRINKER
|
||||
|
||||
blinkGun :: Item
|
||||
blinkGun =
|
||||
defaultLeftItem
|
||||
|
||||
+2
-20
@@ -1,10 +1,9 @@
|
||||
module Dodge.Luse where
|
||||
module Dodge.Luse
|
||||
where
|
||||
|
||||
import Dodge.Base
|
||||
import Dodge.Creature.Action
|
||||
import Dodge.Data.World
|
||||
--import MaybeHelp
|
||||
import Dodge.Default.Creature
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Geometry
|
||||
import qualified IntMapHelp as IM
|
||||
@@ -16,7 +15,6 @@ useL lu = case lu of
|
||||
LRewind -> useRewindGun
|
||||
LTimePause -> hammerCheckL useStopWatch
|
||||
LTimeScroll -> hammerCheckL useTimeScrollGun
|
||||
LShrink -> hammerCheckL useShrinkGun
|
||||
LBlink -> hammerCheckL (shootL $ const blinkActionMousePos)
|
||||
LUnsafeBlink -> hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||
LBoost -> boostSelfL 10
|
||||
@@ -53,22 +51,6 @@ useRewindGun itm _ w = w
|
||||
-- & cwTime . rewindWorlds .~ ws
|
||||
-- _ -> w
|
||||
|
||||
-- be careful changing this around; potential problems include updating the
|
||||
-- creature but using the old crInvSel value
|
||||
-- 22.05.23 this has been changed from using invids to items
|
||||
useShrinkGun :: Item -> Creature -> World -> World
|
||||
useShrinkGun it cr w = case it ^? itParams . shrinkGunStatus of
|
||||
--Just FullSize -> tryResize 0.5 $ stripNoItems cr . f Shrunk UndroppableIdentified . dropExcept cr invid
|
||||
Just FullSize -> tryResize 0.5 $ f Shrunk UndroppableIdentified . dropExcept cr invid
|
||||
Just Shrunk -> tryResize 1 $ f FullSize Uncursed . setMinInvSize defaultInvSize cr
|
||||
Nothing -> error "useShrinkGun applied to item with incorrect ItParam"
|
||||
where
|
||||
invid = _ilInvID $ _itLocation it
|
||||
tryResize x g = maybe w g $ sizeSelf x cr w
|
||||
f isInUse cstatus =
|
||||
cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix invid
|
||||
%~ ((itParams . shrinkGunStatus .~ isInUse) . (itCurseStatus .~ cstatus))
|
||||
|
||||
boostSelfL ::
|
||||
-- | boost amount
|
||||
Float ->
|
||||
|
||||
+1
-12
@@ -10,8 +10,6 @@ import Dodge.Item.Held.Launcher
|
||||
import Dodge.Cleat
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.Item.Craftable
|
||||
import Dodge.Item.Weapon
|
||||
import Dodge.LevelGen.PlacementHelper
|
||||
import Dodge.Room.Containing
|
||||
import Dodge.Room.Corridor
|
||||
import Dodge.Room.Door
|
||||
@@ -20,17 +18,8 @@ import Dodge.Room.RezBox
|
||||
import Dodge.Room.Room
|
||||
import Dodge.Room.RunPast
|
||||
import Dodge.Tree
|
||||
--import Dodge.LevelGen.PlacementHelper
|
||||
--import Geometry.Data
|
||||
--import Padding
|
||||
--import Shape
|
||||
import LensHelp
|
||||
import RandomHelp
|
||||
|
||||
--import Data.Maybe
|
||||
--import Data.Tree
|
||||
--import qualified IntMapHelp as IM
|
||||
|
||||
powerFakeout' :: RandomGen g => State g (MetaTree Room String)
|
||||
powerFakeout' = tToBTree "powerFakeout'" <$> powerFakeout
|
||||
|
||||
@@ -52,7 +41,7 @@ powerFakeout = do
|
||||
, door
|
||||
]
|
||||
++ randcors
|
||||
++ [ corridor & rmPmnts .:~ plRRpt 0 (PutFlIt shrinkGun)
|
||||
++ [ corridor
|
||||
, keyholeCorridor
|
||||
, corridor
|
||||
, cleatOnward door
|
||||
|
||||
Reference in New Issue
Block a user