Modularise item data, change tesla arc from projectile to particle
This commit is contained in:
+13
-38
@@ -25,6 +25,7 @@ import Dodge.Data.DamageType
|
||||
import Dodge.Config.Data
|
||||
import Dodge.Config.KeyConfig
|
||||
import Dodge.Item.Attachment.Data
|
||||
import Dodge.Item.Data
|
||||
import Dodge.World.Trigger.Data
|
||||
import Preload.Data
|
||||
import Picture.Data
|
||||
@@ -230,6 +231,7 @@ data Item
|
||||
, _itInvColor :: Color
|
||||
, _itTargeting :: Maybe (World -> Maybe Point2, Int -> Item -> Creature -> World -> Picture)
|
||||
, _itWorldTrigger :: Maybe (Int -> World -> Bool)
|
||||
, _itAimStance :: AimStance
|
||||
}
|
||||
| Consumable
|
||||
{ _itName :: String
|
||||
@@ -244,6 +246,7 @@ data Item
|
||||
, _itInvColor :: Color
|
||||
, _itEffect :: ItEffect
|
||||
, _itHammer :: HammerPosition
|
||||
, _itAimStance :: AimStance
|
||||
}
|
||||
| Craftable
|
||||
{ _itName :: String
|
||||
@@ -255,6 +258,7 @@ data Item
|
||||
, _itID :: Maybe Int
|
||||
, _itInvDisplay :: Item -> String
|
||||
, _itInvColor :: Color
|
||||
, _itAimStance :: AimStance
|
||||
}
|
||||
| Equipment
|
||||
{ _itName :: String
|
||||
@@ -271,6 +275,7 @@ data Item
|
||||
, _itInvDisplay :: Item -> String
|
||||
, _itInvColor :: Color
|
||||
, _itHammer :: HammerPosition
|
||||
, _itAimStance :: AimStance
|
||||
}
|
||||
| Throwable
|
||||
{ _itName :: String
|
||||
@@ -295,6 +300,7 @@ data Item
|
||||
, _itHammer :: HammerPosition
|
||||
, _itScrollUp :: Int -> World -> World
|
||||
, _itScrollDown :: Int -> World -> World
|
||||
, _itAimStance :: AimStance
|
||||
}
|
||||
| NoItem
|
||||
data ItEffect = NoItEffect
|
||||
@@ -317,44 +323,6 @@ data ItZoom = ItZoom
|
||||
,_itZoomFac :: Float
|
||||
}
|
||||
data IntID a = IntID Int a
|
||||
data HammerPosition
|
||||
= HammerDown
|
||||
| HammerReleased
|
||||
| HammerUp
|
||||
| NoHammer
|
||||
deriving
|
||||
(Eq, Ord, Show)
|
||||
data ItemIdentity
|
||||
= Pistol
|
||||
| SpreadGun
|
||||
| MultGun
|
||||
| HvAutoGun
|
||||
| AutoGun
|
||||
| LtAutoGun
|
||||
| MiniGun
|
||||
| Medkit25
|
||||
| MagShield
|
||||
| FrontArmour
|
||||
| JetPack
|
||||
| FlameShield
|
||||
| Generic
|
||||
| SparkGun
|
||||
| ShatterGun
|
||||
| LongGun
|
||||
| Flamethrower
|
||||
| Blinker
|
||||
| Grenade
|
||||
| RemoteBomb
|
||||
| TeslaGun
|
||||
| LasGun
|
||||
| ForceFieldGun
|
||||
| GrapGun
|
||||
| TractorGun
|
||||
| Launcher
|
||||
| RemoteLauncher
|
||||
| LightningGun
|
||||
| PoisonSprayer
|
||||
deriving (Eq,Show,Ord,Enum)
|
||||
{- Objects without ids.
|
||||
Update themselves, perhaps with side effects. -}
|
||||
data Particle
|
||||
@@ -362,6 +330,13 @@ data Particle
|
||||
{ _ptDraw :: Particle -> Picture
|
||||
, _ptUpdate' :: World -> Particle -> (World, Maybe Particle)
|
||||
}
|
||||
| LinearParticle
|
||||
{ _ptDraw :: Particle -> Picture
|
||||
, _ptUpdate' :: World -> Particle -> (World, Maybe Particle)
|
||||
, _ptPoints :: [Point2]
|
||||
, _ptTimer :: Int
|
||||
, _ptColor :: Color
|
||||
}
|
||||
| Bul'
|
||||
{ _ptDraw :: Particle -> Picture
|
||||
, _ptUpdate' :: World -> Particle -> (World, Maybe Particle)
|
||||
|
||||
Reference in New Issue
Block a user