Allow for bullet drag

This commit is contained in:
2021-12-02 18:29:46 +00:00
parent 85ededc158
commit 8b8d75b016
35 changed files with 362 additions and 228 deletions
+8 -6
View File
@@ -3,21 +3,24 @@ import Dodge.Data
import Dodge.Picture.Layer
import Dodge.Default
import Dodge.SoundLogic
import Dodge.Inventory
import Shape
--import ShapePicture
import Dodge.Item.Draw
import Picture
import Data.Maybe
import Control.Lens
import qualified Data.IntMap.Strict as IM
medkit :: Int -> Item
medkit i = defaultConsumable
{ _itIdentity = Medkit25
, _itName = "MEDKIT" ++ show i
, _itMaxStack = 9
, _itAmount = 1
, _cnEffect = heal i
{ _itName = "MEDKIT" ++ show i
, _itUse = LeftUse
{_lUse = \cr invid w -> fromMaybe w (heal 25 (_crID cr) $ rmInvItem (_crID cr) invid w)
,_useDelay = NoDelay
,_useHammer = HasHammer HammerUp
}
, _itFloorPict = \_ -> (,) emptySH $ setLayer 0 . onLayer FlItLayer . color blue $ circleSolid 3
, _itEquipPict = pictureItem $ (,) emptySH $ color blue $ circleSolid 3
, _itID = Nothing
@@ -31,4 +34,3 @@ heal hp n w | _crHP (_creatures w IM.! n) >= 10000 = Nothing
& creatures . ix n . crHP %~ min 10000 . (+ hp)
where
cr = _creatures w IM.! n