Cleanup warnings
This commit is contained in:
+23
-9
@@ -28,6 +28,7 @@ import qualified Data.Set as S
|
||||
import Data.Graph.Inductive.Graph hiding ((&))
|
||||
import Data.List
|
||||
{- Indestructible wall. -}
|
||||
defaultWall :: Wall
|
||||
defaultWall = Wall
|
||||
{ _wlLine = ((0,0),(50,0))
|
||||
, _wlID = 0
|
||||
@@ -36,6 +37,7 @@ defaultWall = Wall
|
||||
, _wlIsSeeThrough = False
|
||||
}
|
||||
{- Indestructible see-through wall. -}
|
||||
defaultCrystalWall :: Wall
|
||||
defaultCrystalWall = Wall
|
||||
{ _wlLine = ((0,0),(50,0))
|
||||
, _wlID = 0
|
||||
@@ -45,6 +47,7 @@ defaultCrystalWall = Wall
|
||||
}
|
||||
{- Door that opens on approach.
|
||||
Pathable. -}
|
||||
defaultAutoDoor :: Wall
|
||||
defaultAutoDoor = Door
|
||||
{ _wlLine = ((0,0),(50,0))
|
||||
, _wlID = 0
|
||||
@@ -58,6 +61,7 @@ defaultAutoDoor = Door
|
||||
{-
|
||||
Non-pathable door.
|
||||
-}
|
||||
defaultDoor :: Wall
|
||||
defaultDoor = Door
|
||||
{ _wlLine = ((0,0),(50,0))
|
||||
, _wlID = 0
|
||||
@@ -76,7 +80,7 @@ defaultCreature = Creature
|
||||
, _crDir = 0
|
||||
, _crID = 1
|
||||
, _crPict = const $ onLayer CrLayer $ circleSolid 10
|
||||
, _crUpdate = \ w f cr -> (f , Just cr)
|
||||
, _crUpdate = \ _ f cr -> (f , Just cr)
|
||||
, _crRad = 10
|
||||
, _crMass = 10
|
||||
, _crHP = 100
|
||||
@@ -96,19 +100,21 @@ defaultCreature = Creature
|
||||
, _crTarget = Nothing
|
||||
, _crGroup = LoneWolf
|
||||
}
|
||||
defaultState :: CreatureState
|
||||
defaultState = CrSt
|
||||
{ _crDamage = []
|
||||
, _crPastDamage = []
|
||||
, _crSpState = GenCr
|
||||
, _crDropsOnDeath = DropAmount 1
|
||||
}
|
||||
defaultEquipment :: Item
|
||||
defaultEquipment = Equipment
|
||||
{ _itIdentity = Generic
|
||||
, _itName = "genericEquipment"
|
||||
, _itMaxStack = 1
|
||||
, _itAmount = 1
|
||||
, _itFloorPict = onLayer FlItLayer $ polygon [(-3,-3),(-3,3),(3,3),(3,-3)]
|
||||
, _itEquipPict = \cr _ -> blank
|
||||
, _itEquipPict = \_ _ -> blank
|
||||
, _itEffect = NoItEffect
|
||||
, _itHammer = HammerUp
|
||||
, _itID = Nothing
|
||||
@@ -118,6 +124,7 @@ defaultEquipment = Equipment
|
||||
, _itInvColor = yellow
|
||||
, _itInvDisplay = _itName
|
||||
}
|
||||
defaultItZoom :: ItZoom
|
||||
defaultItZoom = ItZoom 20 0.2 1 20 0.2 1
|
||||
defaultConsumable :: Item
|
||||
defaultConsumable = Consumable
|
||||
@@ -144,16 +151,16 @@ defaultApplyDamage ds cr = (id, doPoisonDam $ foldr (\d c -> snd $ applyIndividu
|
||||
doPoisonDam = over crHP (\hp -> hp - poisonDam)
|
||||
|
||||
applyIndividualDamage :: DamageType -> Creature -> (World -> World, Creature)
|
||||
applyIndividualDamage (Concussive amount from push pushexp pushRad) cr
|
||||
applyIndividualDamage (Concussive amount fromDir push pushexp pushRad) cr
|
||||
= ( id
|
||||
, over crHP (\hp -> hp - amount)
|
||||
$ over crPos (+.+ (pushAmount *.* safeNormalizeV (_crPos cr -.- from)))
|
||||
$ over crPos (+.+ (pushAmount *.* safeNormalizeV (_crPos cr -.- fromDir)))
|
||||
cr
|
||||
)
|
||||
where pushAmount | dist (_crPos cr) from == 0
|
||||
= 0
|
||||
| otherwise = min 5 $
|
||||
(push*5*pushRad / (dist (_crPos cr) from * _crMass cr))**pushexp
|
||||
where
|
||||
pushAmount
|
||||
| dist (_crPos cr) fromDir == 0 = 0
|
||||
| otherwise = min 5 $ (push*5*pushRad / (dist (_crPos cr) fromDir * _crMass cr))**pushexp
|
||||
applyIndividualDamage (TorqueDam amount rot) cr
|
||||
= ( id
|
||||
, over crHP (\hp -> hp - amount) $ over crDir (+ rot) cr)
|
||||
@@ -163,7 +170,9 @@ applyIndividualDamage (PushDam amount pback) cr
|
||||
)
|
||||
applyIndividualDamage dt cr
|
||||
= ( id , over crHP (\hp -> hp - _dmAmount dt) cr )
|
||||
defaultFlIt :: FloorItem
|
||||
defaultFlIt = FlIt {_flItRot=0,_flIt = defaultIt, _flItPos = (0,0), _flItID = 0}
|
||||
defaultIt :: Item
|
||||
defaultIt = Consumable
|
||||
{ _itIdentity = Medkit25
|
||||
, _itName = "defaultIt"
|
||||
@@ -171,13 +180,14 @@ defaultIt = Consumable
|
||||
, _itAmount = 2
|
||||
, _cnEffect = const return
|
||||
, _itFloorPict = onLayer FlItLayer $ polygon [(-3,-3),(-3,3),(3,3),(3,-3)]
|
||||
, _itEquipPict = \cr _ -> blank
|
||||
, _itEquipPict = \_ _ -> blank
|
||||
, _itID = Nothing
|
||||
, _itInvDisplay = _itName
|
||||
, _itInvColor = blue
|
||||
, _itEffect = NoItEffect
|
||||
, _itHammer = HammerUp
|
||||
}
|
||||
defaultButton :: Button
|
||||
defaultButton = Button
|
||||
{ _btPict = onLayer WlLayer $ color red $ polygon $ rectNSEW 5 (-5) 10 (-10)
|
||||
, _btPos = (0,0)
|
||||
@@ -190,6 +200,7 @@ defaultButton = Button
|
||||
, _btText = "Button"
|
||||
, _btState = BtOff
|
||||
}
|
||||
defaultPT :: Projectile
|
||||
defaultPT = Projectile
|
||||
{ _pjPos = (0,0)
|
||||
, _pjStartPos = (0,0)
|
||||
@@ -198,6 +209,7 @@ defaultPT = Projectile
|
||||
, _pjID = 0
|
||||
, _pjUpdate = id
|
||||
}
|
||||
defaultPP :: PressPlate
|
||||
defaultPP = PressPlate
|
||||
{ _ppPict = onLayer PressPlateLayer $ color (dim $ dim $ bright blue) $ circleSolid 5
|
||||
, _ppPos = (0,0)
|
||||
@@ -206,6 +218,7 @@ defaultPP = PressPlate
|
||||
, _ppID = -1
|
||||
, _ppText = "Pressure plate"
|
||||
}
|
||||
defaultWorld :: World
|
||||
defaultWorld = World
|
||||
{ _keys = S.empty
|
||||
, _mouseButtons = S.empty
|
||||
@@ -266,6 +279,7 @@ defaultWorld = World
|
||||
, _sideEffects = []
|
||||
, _doneSideEffects = []
|
||||
}
|
||||
youLight :: TempLightSource
|
||||
youLight =
|
||||
TLS { _tlsPos = (0,0)
|
||||
,_tlsRad = 300
|
||||
|
||||
Reference in New Issue
Block a user