Refactor, try to limit dependencies
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
module Dodge.Default.AimParams where
|
||||
import Dodge.Data.Item.Use
|
||||
|
||||
defaultAimParams :: AimParams
|
||||
defaultAimParams = AimParams
|
||||
{ _aimWeight = 0
|
||||
, _aimRange = 0
|
||||
, _aimZoom = ItZoom 20 0.2 1
|
||||
, _aimStance = OneHand
|
||||
, _aimHandlePos = 10
|
||||
, _aimMuzPos = 20
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
module Dodge.Default.Block where
|
||||
import Dodge.Data
|
||||
import Dodge.Data.Block
|
||||
import LensHelp
|
||||
|
||||
defaultBlock :: Block
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
module Dodge.Default.Block where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Block.Debris
|
||||
import Dodge.Data.Block
|
||||
import LensHelp
|
||||
|
||||
defaultBlock :: Block
|
||||
defaultBlock = Block
|
||||
{ _blID = 0
|
||||
, _blWallIDs = mempty
|
||||
, _blHP = 1000
|
||||
, _blShadows = []
|
||||
, _blFootprint = []
|
||||
, _blPos = 0
|
||||
, _blDir = 0
|
||||
, _blDraw = const mempty
|
||||
, _blDeath = makeBlockDebris
|
||||
, _blObstructs = []
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
, _blPaths = []
|
||||
>>>>>>> efficientRuntime
|
||||
}
|
||||
defaultBlock =
|
||||
Block
|
||||
{ _blID = 0
|
||||
, _blWallIDs = mempty
|
||||
, _blHP = 1000
|
||||
, _blShadows = []
|
||||
, _blFootprint = []
|
||||
, _blPos = 0
|
||||
, _blDir = 0
|
||||
, _blDraw = const mempty
|
||||
, _blDeath = makeBlockDebris
|
||||
, _blObstructs =
|
||||
[]
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
, _blPaths =
|
||||
[]
|
||||
>>>>>>> efficientRuntime
|
||||
}
|
||||
|
||||
defaultDirtBlock :: Block
|
||||
defaultDirtBlock = defaultBlock & blHP .~ 50
|
||||
|
||||
+109
-92
@@ -1,58 +1,61 @@
|
||||
module Dodge.Default.Creature where
|
||||
import Dodge.Data
|
||||
import Dodge.Data.FloatFunction
|
||||
import Geometry.Data
|
||||
import Picture
|
||||
|
||||
import qualified IntMapHelp as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Data.FloatFunction
|
||||
import Geometry.Data
|
||||
import qualified IntMapHelp as IM
|
||||
import Picture
|
||||
|
||||
defaultCreature :: Creature
|
||||
defaultCreature = Creature
|
||||
{ _crPos = V2 0 0
|
||||
, _crOldPos = V2 0 0
|
||||
, _crVel = V2 0 0
|
||||
, _crDir = 0
|
||||
, _crOldDir = 0
|
||||
, _crMvDir = 0
|
||||
, _crTwist = 0
|
||||
, _crID = 1
|
||||
, _crType = defaultCreatureSkin
|
||||
, _crRad = 10
|
||||
, _crMass = 10
|
||||
, _crHP = 100
|
||||
, _crMaxHP = 150
|
||||
, _crInv = IM.empty
|
||||
, _crInvSel = InvSel 0 NoInvSelAction
|
||||
, _crInvCapacity = 25
|
||||
, _crInvLock = False
|
||||
, _crInvEquipped = mempty
|
||||
, _crLeftInvSel = Nothing
|
||||
, _crState = defaultState
|
||||
, _crCorpse = MakeDefaultCorpse
|
||||
, _crMaterial = Flesh
|
||||
, _crPastDamage = 0
|
||||
, _crEquipment = M.empty
|
||||
, _crStance = Stance
|
||||
{_carriage=Walking 0 WasLeftForward
|
||||
,_posture=AtEase
|
||||
,_strideLength = yourDefaultStrideLength
|
||||
defaultCreature =
|
||||
Creature
|
||||
{ _crPos = V2 0 0
|
||||
, _crOldPos = V2 0 0
|
||||
, _crVel = V2 0 0
|
||||
, _crDir = 0
|
||||
, _crOldDir = 0
|
||||
, _crMvDir = 0
|
||||
, _crTwist = 0
|
||||
, _crID = 1
|
||||
, _crType = defaultCreatureSkin
|
||||
, _crRad = 10
|
||||
, _crMass = 10
|
||||
, _crHP = 100
|
||||
, _crMaxHP = 150
|
||||
, _crInv = IM.empty
|
||||
, _crInvSel = InvSel 0 NoInvSelAction
|
||||
, _crInvCapacity = 25
|
||||
, _crInvLock = False
|
||||
, _crInvEquipped = mempty
|
||||
, _crLeftInvSel = Nothing
|
||||
, _crState = defaultState
|
||||
, _crCorpse = MakeDefaultCorpse
|
||||
, _crMaterial = Flesh
|
||||
, _crPastDamage = 0
|
||||
, _crEquipment = M.empty
|
||||
, _crStance =
|
||||
Stance
|
||||
{ _carriage = Walking 0 WasLeftForward
|
||||
, _posture = AtEase
|
||||
, _strideLength = yourDefaultStrideLength
|
||||
}
|
||||
, _crVocalization = Mute
|
||||
, _crActionPlan = ActionPlan [] [] (StrategyActions WatchAndWait [StartSentinelPost]) [LiveLongAndProsper]
|
||||
, _crPerception = defaultPerceptionState
|
||||
, _crMemory = defaultCreatureMemory
|
||||
, _crMeleeCooldown = 0
|
||||
, _crFaction = NoFaction
|
||||
, _crIntention = defaultIntention
|
||||
, _crGroup = LoneWolf
|
||||
, _crMvType = defaultAimMvType
|
||||
, _crHammerPosition = HammerUp
|
||||
, _crName = "DEFAULTCRNAME"
|
||||
, _crStatistics = CreatureStatistics 10 10 10
|
||||
, _crCamouflage = FullyVisible
|
||||
}
|
||||
, _crVocalization = Mute
|
||||
, _crActionPlan = ActionPlan [] [] (StrategyActions WatchAndWait [StartSentinelPost]) [LiveLongAndProsper]
|
||||
, _crPerception = defaultPerceptionState
|
||||
, _crMemory = defaultCreatureMemory
|
||||
, _crMeleeCooldown = 0
|
||||
, _crFaction = NoFaction
|
||||
, _crIntention = defaultIntention
|
||||
, _crGroup = LoneWolf
|
||||
, _crMvType = defaultAimMvType
|
||||
, _crHammerPosition = HammerUp
|
||||
, _crName = "DEFAULTCRNAME"
|
||||
, _crStatistics = CreatureStatistics 10 10 10
|
||||
, _crCamouflage = FullyVisible
|
||||
}
|
||||
|
||||
defaultCreatureSkin :: CreatureType
|
||||
defaultCreatureSkin = Humanoid (greyN 0.9) (light4 green) (greyN 0.3) InanimateAI
|
||||
|
||||
@@ -60,53 +63,66 @@ defaultInanimate :: Creature
|
||||
defaultInanimate = defaultCreature & crActionPlan .~ Inanimate
|
||||
|
||||
defaultCreatureMemory :: Memory
|
||||
defaultCreatureMemory = Memory
|
||||
{ _soundsToInvestigate = []
|
||||
, _nodesSearched = []
|
||||
}
|
||||
defaultCreatureMemory =
|
||||
Memory
|
||||
{ _soundsToInvestigate = []
|
||||
, _nodesSearched = []
|
||||
}
|
||||
|
||||
defaultInvSize :: Int
|
||||
defaultInvSize = 20
|
||||
|
||||
defaultPerceptionState :: Perception
|
||||
defaultPerceptionState = Perception
|
||||
{ _cpVigilance = Lethargic
|
||||
, _cpAttention = AttentiveTo mempty
|
||||
, _cpAwareness = mempty
|
||||
, _cpVision = defaultVision
|
||||
, _cpAudition = defaultAudition
|
||||
}
|
||||
defaultPerceptionState =
|
||||
Perception
|
||||
{ _cpVigilance = Lethargic
|
||||
, _cpAttention = AttentiveTo mempty
|
||||
, _cpAwareness = mempty
|
||||
, _cpVision = defaultVision
|
||||
, _cpAudition = defaultAudition
|
||||
}
|
||||
|
||||
defaultVision :: Vision
|
||||
defaultVision = Eyes
|
||||
{ _viFOV = FloatFOV 0.5
|
||||
, _viDist = FloatLessCheck 500
|
||||
}
|
||||
defaultVision =
|
||||
Eyes
|
||||
{ _viFOV = FloatFOV 0.5
|
||||
, _viDist = FloatLessCheck 500
|
||||
}
|
||||
|
||||
defaultAudition :: Audition
|
||||
defaultAudition = Ears
|
||||
{ _auDist = FloatID
|
||||
}
|
||||
defaultAudition =
|
||||
Ears
|
||||
{ _auDist = FloatID
|
||||
}
|
||||
|
||||
defaultIntention :: Intention
|
||||
defaultIntention = Intention
|
||||
{ _targetCr = Nothing
|
||||
, _mvToPoint = Nothing
|
||||
, _viewPoint = Nothing
|
||||
}
|
||||
defaultIntention =
|
||||
Intention
|
||||
{ _targetCr = Nothing
|
||||
, _mvToPoint = Nothing
|
||||
, _viewPoint = Nothing
|
||||
}
|
||||
|
||||
defaultChaseMvType :: CrMvType
|
||||
defaultChaseMvType = CrMvType
|
||||
{ _mvSpeed = 2
|
||||
, _mvTurnRad = FloatAbsCheckGreaterLess (pi/4) 0.2 0.05--f
|
||||
, _mvTurnJit = 0.2
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi/8) 0.2 0.01
|
||||
}
|
||||
defaultChaseMvType =
|
||||
CrMvType
|
||||
{ _mvSpeed = 2
|
||||
, _mvTurnRad = FloatAbsCheckGreaterLess (pi / 4) 0.2 0.05 --f
|
||||
, _mvTurnJit = 0.2
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi / 8) 0.2 0.01
|
||||
}
|
||||
|
||||
defaultAimMvType :: CrMvType
|
||||
defaultAimMvType = CrMvType
|
||||
{ _mvSpeed = 3
|
||||
, _mvTurnRad = FloatConst 0.2
|
||||
, _mvTurnJit = 0.05
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi/8) 0.2 0.01
|
||||
}
|
||||
defaultAimMvType =
|
||||
CrMvType
|
||||
{ _mvSpeed = 3
|
||||
, _mvTurnRad = FloatConst 0.2
|
||||
, _mvTurnJit = 0.05
|
||||
, _mvAimSpeed = FloatAbsCheckGreaterLess (pi / 8) 0.2 0.01
|
||||
}
|
||||
|
||||
defaultAimingCrit :: Creature
|
||||
defaultAimingCrit = defaultCreature { _crMvType = defaultAimMvType }
|
||||
defaultAimingCrit = defaultCreature{_crMvType = defaultAimMvType}
|
||||
|
||||
yourDefaultSpeed :: Float
|
||||
yourDefaultSpeed = 3
|
||||
@@ -115,9 +131,10 @@ yourDefaultStrideLength :: Int
|
||||
yourDefaultStrideLength = 40
|
||||
|
||||
defaultState :: CreatureState
|
||||
defaultState = CrSt
|
||||
{ _csDamage = []
|
||||
-- , _crPastDamage = V.fromList $ replicate 20 []
|
||||
, _csSpState = GenCr
|
||||
, _csDropsOnDeath = DropAll
|
||||
}
|
||||
defaultState =
|
||||
CrSt
|
||||
{ _csDamage = []
|
||||
, -- , _crPastDamage = V.fromList $ replicate 20 []
|
||||
_csSpState = GenCr
|
||||
, _csDropsOnDeath = DropAll
|
||||
}
|
||||
|
||||
+36
-32
@@ -1,42 +1,46 @@
|
||||
module Dodge.Default.Door
|
||||
( module Dodge.Default.Door
|
||||
, module Dodge.Default.Wall
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Default.Wall
|
||||
import Color
|
||||
module Dodge.Default.Door (
|
||||
module Dodge.Default.Door,
|
||||
module Dodge.Default.Wall,
|
||||
) where
|
||||
|
||||
import Color
|
||||
import Control.Lens
|
||||
import Dodge.Data.Door
|
||||
import Dodge.Data.Wall
|
||||
import Dodge.Default.Wall
|
||||
|
||||
switchWallCol :: Color -> Wall
|
||||
switchWallCol col = defaultSwitchWall & wlColor .~ col
|
||||
|
||||
defaultAutoWall :: Wall
|
||||
defaultAutoWall = defaultDoorWall'
|
||||
& wlColor .~ dim yellow
|
||||
& wlPathable .~ True
|
||||
defaultAutoWall =
|
||||
defaultDoorWall'
|
||||
& wlColor .~ dim yellow
|
||||
& wlPathable .~ True
|
||||
|
||||
defaultSwitchWall :: Wall
|
||||
defaultSwitchWall = defaultDoorWall'
|
||||
& wlColor .~ red
|
||||
& wlPathable .~ False
|
||||
defaultSwitchWall =
|
||||
defaultDoorWall'
|
||||
& wlColor .~ red
|
||||
& wlPathable .~ False
|
||||
|
||||
defaultDoor :: Door
|
||||
defaultDoor = Door
|
||||
{ _drID = 0
|
||||
, _drWallIDs = mempty
|
||||
, _drStatus = DoorClosed
|
||||
, _drTrigger = WdBlConst False
|
||||
, _drMech = DrWdId
|
||||
, _drPos = (0,0)
|
||||
, _drOpenPos = (0,0)
|
||||
, _drClosePos = (0,0)
|
||||
, _drHP = 10000
|
||||
, _drDeath = DrWdMakeDoorDebris
|
||||
, _drSpeed = 1
|
||||
, _drPushedBy = PushesItself
|
||||
, _drPushes = Nothing
|
||||
, _drMounts = mempty
|
||||
, _drObstructs = mempty
|
||||
, _drObstacleType = DoorObstacle
|
||||
}
|
||||
|
||||
defaultDoor =
|
||||
Door
|
||||
{ _drID = 0
|
||||
, _drWallIDs = mempty
|
||||
, _drStatus = DoorClosed
|
||||
, _drTrigger = WdBlConst False
|
||||
, _drMech = DrWdId
|
||||
, _drPos = (0, 0)
|
||||
, _drOpenPos = (0, 0)
|
||||
, _drClosePos = (0, 0)
|
||||
, _drHP = 10000
|
||||
, _drDeath = DrWdMakeDoorDebris
|
||||
, _drSpeed = 1
|
||||
, _drPushedBy = PushesItself
|
||||
, _drPushes = Nothing
|
||||
, _drMounts = mempty
|
||||
, _drObstructs = mempty
|
||||
, _drObstacleType = DoorObstacle
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Dodge.Default.Foreground where
|
||||
import Dodge.Data
|
||||
module Dodge.Default.ForegroundShape where
|
||||
|
||||
import Dodge.Data.ForegroundShape
|
||||
|
||||
defaultForeground :: ForegroundShape
|
||||
defaultForeground = ForegroundShape 0 0 0 0 mempty
|
||||
+56
-15
@@ -1,19 +1,23 @@
|
||||
module Dodge.Default.Item (
|
||||
defaultItem,
|
||||
defaultItEffect,
|
||||
module Dodge.Default.Item,
|
||||
module Dodge.Default.Item.Use,
|
||||
module Dodge.Default.Item.Effect,
|
||||
) where
|
||||
|
||||
import Color
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Default.Item.Effect
|
||||
import Dodge.Default.Item.Use
|
||||
import Geometry.Data
|
||||
import Picture
|
||||
|
||||
defaultItem :: Item
|
||||
defaultItem =
|
||||
Item
|
||||
{ _itCurseStatus = Uncursed
|
||||
, _itType = defaultItemType
|
||||
, -- , _itEquipPict = \_ _ -> (,) emptySH blank
|
||||
_itEffect = defaultItEffect
|
||||
, _itEffect = defaultItEffect
|
||||
, _itID = Nothing
|
||||
, _itIsHeld = False
|
||||
, _itInvColor = yellow
|
||||
@@ -28,15 +32,52 @@ defaultItem =
|
||||
, _itValue = ItemValue 0 MundaneItem
|
||||
}
|
||||
|
||||
defaultItEffect :: ItEffect
|
||||
defaultItEffect =
|
||||
ItEffect
|
||||
{ _ieInv = NoInvEffect
|
||||
, _ieOnInsert = NoInvEffect
|
||||
, _ieOnDrop = NoInvEffect
|
||||
, _ieOnHeld = NoInvEffect
|
||||
, _ieOnStash = NoInvEffect
|
||||
}
|
||||
defaultLeftItem :: Item
|
||||
defaultLeftItem =
|
||||
defaultItem
|
||||
& itUse .~ defaultLeftUse
|
||||
& itInvColor .~ cyan
|
||||
|
||||
defaultHeldItem :: Item
|
||||
defaultHeldItem =
|
||||
defaultItem
|
||||
& itInvColor .~ white
|
||||
& itUse .~ defaultHeldUse
|
||||
|
||||
defaultCraftItem :: Item
|
||||
defaultCraftItem =
|
||||
defaultItem
|
||||
& itUse .~ CraftUse 1
|
||||
& itInvColor .~ green
|
||||
|
||||
defaultItemType :: ItemType
|
||||
defaultItemType = ItemType (error "defaultItemType not initialized") mempty NoStack
|
||||
defaultItemType = ItemType NoItemType mempty NoStack
|
||||
|
||||
defaultBulletWeapon :: Item
|
||||
defaultBulletWeapon =
|
||||
defaultWeapon
|
||||
& itUse . heldConsumption .~ defaultBulletLoadable
|
||||
& itUse . heldUse .~ HeldUseAmmoParams -- useAmmoParams
|
||||
& itType . iyModules . at ModBullet ?~ EMPTYMODULE
|
||||
& itType . iyModules . at ModBulletSpawn ?~ EMPTYMODULE
|
||||
& itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
||||
|
||||
defaultWeapon :: Item
|
||||
defaultWeapon =
|
||||
defaultHeldItem
|
||||
& itUse .~ defaultHeldUse
|
||||
& itInvColor .~ white
|
||||
& itType . iyModules
|
||||
.~ M.fromList
|
||||
[ (ModTarget, EMPTYMODULE)
|
||||
, (ModTeleport, EMPTYMODULE)
|
||||
]
|
||||
|
||||
defaultConsumable :: Item
|
||||
defaultConsumable =
|
||||
defaultItem
|
||||
& itUse .~ ConsumeUse CDoNothing 1
|
||||
& itInvColor .~ blue
|
||||
|
||||
defaultItZoom :: ItZoom
|
||||
defaultItZoom = ItZoom 20 0.2 1
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
module Dodge.Default.Item.Effect
|
||||
where
|
||||
import Dodge.Data.Item.Effect
|
||||
|
||||
defaultItEffect :: ItEffect
|
||||
defaultItEffect =
|
||||
ItEffect
|
||||
{ _ieInv = NoInvEffect
|
||||
, _ieOnInsert = NoInvEffect
|
||||
, _ieOnDrop = NoInvEffect
|
||||
, _ieOnHeld = NoInvEffect
|
||||
, _ieOnStash = NoInvEffect
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
module Dodge.Default.Item.Use (
|
||||
module Dodge.Default.Item.Use,
|
||||
module Dodge.Default.Item.Use.AimParams,
|
||||
module Dodge.Default.Item.Use.Consumption,
|
||||
module Dodge.Default.Item.Use.Equipment,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Item.Use
|
||||
import Dodge.Default.Item.Use.AimParams
|
||||
import Dodge.Default.Item.Use.Consumption
|
||||
import Dodge.Default.Item.Use.Equipment
|
||||
|
||||
defaultLeftUse :: ItemUse
|
||||
defaultLeftUse =
|
||||
LeftUse
|
||||
{ _leftUse = LDoNothing
|
||||
, _leftDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _leftHammer = HammerUp
|
||||
, _equipEffect = defaultEquip
|
||||
, _leftConsumption = defaultLeftLoadable
|
||||
}
|
||||
|
||||
defaultEquipUse :: ItemUse
|
||||
defaultEquipUse = EquipUse{_equipEffect = defaultEquip}
|
||||
|
||||
defaultHeldUse :: ItemUse
|
||||
defaultHeldUse =
|
||||
HeldUse
|
||||
{ _heldUse = HeldDoNothing
|
||||
, _heldDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _heldMods = HeldModNothing
|
||||
, _heldHammer = HammerUp
|
||||
, _heldAim = defaultAimParams
|
||||
, _heldScroll = HeldScrollDoNothing
|
||||
, _heldConsumption = defaultLoadable
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
module Dodge.Default.Item.Use.AimParams where
|
||||
|
||||
import Dodge.Data.Item.Use
|
||||
|
||||
defaultAimParams :: AimParams
|
||||
defaultAimParams =
|
||||
AimParams
|
||||
{ _aimWeight = 0
|
||||
, _aimRange = 0
|
||||
, _aimZoom = ItZoom 20 0.2 1
|
||||
, _aimStance = OneHand
|
||||
, _aimHandlePos = 10
|
||||
, _aimMuzPos = 20
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
module Dodge.Default.Item.Use.Consumption where
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import Dodge.Reloading.Action
|
||||
import Dodge.Data.Item.Use.Consumption
|
||||
import Control.Lens
|
||||
|
||||
defaultLoadable :: HeldConsumption
|
||||
defaultLoadable =
|
||||
LoadableAmmo
|
||||
{ _laAmmoType = GenericAmmo
|
||||
, _laMax = 15
|
||||
, _laLoaded = 0
|
||||
, _laPrimed = True
|
||||
, _laCycle = [loadEject 10, loadInsert 10, loadPrime 10]
|
||||
, _laProgress = Nothing
|
||||
}
|
||||
|
||||
defaultBulletLoadable :: HeldConsumption
|
||||
defaultBulletLoadable = defaultLoadable & laAmmoType .~ basicBullet
|
||||
|
||||
defaultLeftLoadable :: LeftConsumption
|
||||
defaultLeftLoadable = AutoRecharging 10 10 100 100
|
||||
@@ -0,0 +1,15 @@
|
||||
module Dodge.Default.Item.Use.Equipment where
|
||||
|
||||
import Dodge.Data.Item.HeldUse
|
||||
import Dodge.Data.Item.Use.Equipment
|
||||
|
||||
defaultEquip :: EquipEffect
|
||||
defaultEquip =
|
||||
EquipEffect
|
||||
{ _eeSite = GoesOnSpecial
|
||||
, _eeUse = EDoNothing
|
||||
, _eeOnEquip = EDoNothing
|
||||
, _eeOnRemove = EDoNothing
|
||||
, _eeParams = NoEquipParams
|
||||
, _eeViewDist = Nothing
|
||||
}
|
||||
@@ -1,25 +1,31 @@
|
||||
module Dodge.Default.LightSource where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Data.LightSource
|
||||
import Geometry
|
||||
|
||||
defaultLS :: LightSource
|
||||
defaultLS = LS
|
||||
{ _lsID = 0
|
||||
, _lsParam = LSParam
|
||||
{ _lsPos = V3 0 0 50
|
||||
, _lsRad = 700
|
||||
, _lsCol = 0.6
|
||||
defaultLS =
|
||||
LS
|
||||
{ _lsID = 0
|
||||
, _lsParam =
|
||||
LSParam
|
||||
{ _lsPos = V3 0 0 50
|
||||
, _lsRad = 700
|
||||
, _lsCol = 0.6
|
||||
}
|
||||
, _lsDir = 0
|
||||
, _lsPict = DefaultLightSourceDraw --defLSPic
|
||||
}
|
||||
, _lsDir = 0
|
||||
, _lsPict = DefaultLightSourceDraw --defLSPic
|
||||
}
|
||||
|
||||
defaultTLS :: TempLightSource
|
||||
defaultTLS = TLS
|
||||
{ _tlsParam = LSParam
|
||||
{ _lsPos = 0
|
||||
, _lsRad = 0
|
||||
, _lsCol = 0.5
|
||||
defaultTLS =
|
||||
TLS
|
||||
{ _tlsParam =
|
||||
LSParam
|
||||
{ _lsPos = 0
|
||||
, _lsRad = 0
|
||||
, _lsCol = 0.5
|
||||
}
|
||||
, _tlsUpdate = TimerTLS
|
||||
, _tlsTime = 1
|
||||
}
|
||||
, _tlsUpdate = TimerTLS
|
||||
, _tlsTime = 1
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
module Dodge.Default.Prop where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Data.Prop
|
||||
import Geometry
|
||||
|
||||
defaultProp :: Prop
|
||||
defaultProp = ShapeProp
|
||||
{ _prPos = V2 0 0
|
||||
, _prDraw = PropDrawSPic mempty
|
||||
, _prID = 0
|
||||
, _prUpdate = PropUpdateId
|
||||
, _prToggle = True
|
||||
, _prRot = 0
|
||||
}
|
||||
defaultProp =
|
||||
ShapeProp
|
||||
{ _prPos = V2 0 0
|
||||
, _prDraw = PropDrawSPic mempty
|
||||
, _prID = 0
|
||||
, _prUpdate = PropUpdateId
|
||||
, _prToggle = True
|
||||
, _prRot = 0
|
||||
}
|
||||
|
||||
+33
-31
@@ -1,37 +1,39 @@
|
||||
module Dodge.Default.Room where
|
||||
import Data.Tile
|
||||
import Geometry.Data
|
||||
--import Dodge.LevelGen.Data
|
||||
import Dodge.Data
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
import qualified Data.Set as S
|
||||
import Data.Tile
|
||||
import Dodge.Data.GenWorld
|
||||
import Geometry.Data
|
||||
import qualified IntMapHelp as IM
|
||||
|
||||
defaultRoom :: Room
|
||||
defaultRoom = Room
|
||||
{ _rmPolys = mempty
|
||||
, _rmLinks = mempty
|
||||
, _rmLinkEff = const . const . const . const id
|
||||
, _rmPos = mempty
|
||||
, _rmPath = mempty
|
||||
, _rmPmnts = mempty
|
||||
, _rmInPmnt = mempty
|
||||
, _rmOutPmnt = mempty
|
||||
, _rmBound = mempty
|
||||
, _rmFloor = InheritFloor
|
||||
, _rmName = "defaultRoom"
|
||||
, _rmShift = (V2 0 0 , 0)
|
||||
, _rmViewpoints = mempty
|
||||
, _rmRandPSs = mempty
|
||||
-- , _rmLabel = Nothing
|
||||
-- , _rmTakeFrom = Nothing
|
||||
, _rmStartWires = IM.empty
|
||||
, _rmEndWires = IM.empty
|
||||
, _rmConnectsTo = S.member OutLink
|
||||
, _rmMID = Nothing
|
||||
, _rmMParent = Nothing
|
||||
, _rmChildren = []
|
||||
, _rmType = DefaultRoomType
|
||||
, _rmClusterStatus = defaultClusterStatus
|
||||
}
|
||||
defaultRoom =
|
||||
Room
|
||||
{ _rmPolys = mempty
|
||||
, _rmLinks = mempty
|
||||
, _rmLinkEff = const . const . const . const id
|
||||
, _rmPos = mempty
|
||||
, _rmPath = mempty
|
||||
, _rmPmnts = mempty
|
||||
, _rmInPmnt = mempty
|
||||
, _rmOutPmnt = mempty
|
||||
, _rmBound = mempty
|
||||
, _rmFloor = InheritFloor
|
||||
, _rmName = "defaultRoom"
|
||||
, _rmShift = (V2 0 0, 0)
|
||||
, _rmViewpoints = mempty
|
||||
, _rmRandPSs = mempty
|
||||
, -- , _rmLabel = Nothing
|
||||
-- , _rmTakeFrom = Nothing
|
||||
_rmStartWires = IM.empty
|
||||
, _rmEndWires = IM.empty
|
||||
, _rmConnectsTo = S.member OutLink
|
||||
, _rmMID = Nothing
|
||||
, _rmMParent = Nothing
|
||||
, _rmChildren = []
|
||||
, _rmType = DefaultRoomType
|
||||
, _rmClusterStatus = defaultClusterStatus
|
||||
}
|
||||
|
||||
defaultClusterStatus :: ClusterStatus
|
||||
defaultClusterStatus = ClusterStatus "defRoomClust" S.empty
|
||||
|
||||
+20
-18
@@ -1,21 +1,23 @@
|
||||
module Dodge.Default.Shell
|
||||
where
|
||||
import Dodge.Data
|
||||
module Dodge.Default.Shell where
|
||||
|
||||
import Dodge.Data.Item.Use.Consumption.Ammo
|
||||
import Dodge.Data.Projectile
|
||||
import Geometry.Data
|
||||
|
||||
defaultShell :: Proj
|
||||
defaultShell = Shell
|
||||
{ _prjPos = V2 0 0
|
||||
, _prjZ = 20
|
||||
, _prjStartPos = V2 0 0
|
||||
, _prjVel = V2 0 0
|
||||
, _prjAcc = V2 0 0
|
||||
, _prjDir = 0
|
||||
, _prjSpin = 0
|
||||
, _prjDraw = DrawShell
|
||||
, _prjID = 0
|
||||
, _prjTimer = 0
|
||||
, _prjPayload = ExplosionPayload
|
||||
, _prjUpdates = []
|
||||
, _prjMITID = Nothing
|
||||
}
|
||||
defaultShell =
|
||||
Shell
|
||||
{ _prjPos = V2 0 0
|
||||
, _prjZ = 20
|
||||
, _prjStartPos = V2 0 0
|
||||
, _prjVel = V2 0 0
|
||||
, _prjAcc = V2 0 0
|
||||
, _prjDir = 0
|
||||
, _prjSpin = 0
|
||||
, _prjDraw = DrawShell
|
||||
, _prjID = 0
|
||||
, _prjTimer = 0
|
||||
, _prjPayload = ExplosionPayload
|
||||
, _prjUpdates = []
|
||||
, _prjMITID = Nothing
|
||||
}
|
||||
|
||||
@@ -1,32 +1,35 @@
|
||||
module Dodge.Default.Terminal
|
||||
where
|
||||
import Dodge.Data.WorldEffect
|
||||
import Dodge.Data.Terminal
|
||||
module Dodge.Default.Terminal where
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.Text as T
|
||||
defaultTerminal :: Terminal
|
||||
defaultTerminal = Terminal
|
||||
{ _tmID = 0
|
||||
, _tmBootProgram = TerminalBootMempty
|
||||
, _tmButtonID = 0
|
||||
, _tmMachineID = 0
|
||||
, _tmName = "TESTTERMINAL"
|
||||
, _tmDisplayedLines = []
|
||||
, _tmFutureLines = []
|
||||
, _tmMaxLines = 14
|
||||
, _tmTitle = "TERMINAL IN LOCATION"
|
||||
, _tmInput = defaultTerminalInput
|
||||
, _tmScrollCommands = []
|
||||
, _tmWriteCommands = []
|
||||
, _tmDeathEffect = TmWdId
|
||||
, _tmStatus = TerminalOff
|
||||
, _tmCommandHistory = []
|
||||
, _tmToggles = M.empty
|
||||
}
|
||||
defaultTerminalInput :: TerminalInput
|
||||
defaultTerminalInput = TerminalInput
|
||||
{ _tiText = T.pack ""
|
||||
, _tiFocus = True
|
||||
, _tiSel = (0,0)
|
||||
}
|
||||
import Dodge.Data.Terminal
|
||||
import Dodge.Data.WorldEffect
|
||||
|
||||
defaultTerminal :: Terminal
|
||||
defaultTerminal =
|
||||
Terminal
|
||||
{ _tmID = 0
|
||||
, _tmBootProgram = TerminalBootMempty
|
||||
, _tmButtonID = 0
|
||||
, _tmMachineID = 0
|
||||
, _tmName = "TESTTERMINAL"
|
||||
, _tmDisplayedLines = []
|
||||
, _tmFutureLines = []
|
||||
, _tmMaxLines = 14
|
||||
, _tmTitle = "TERMINAL IN LOCATION"
|
||||
, _tmInput = defaultTerminalInput
|
||||
, _tmScrollCommands = []
|
||||
, _tmWriteCommands = []
|
||||
, _tmDeathEffect = TmWdId
|
||||
, _tmStatus = TerminalOff
|
||||
, _tmCommandHistory = []
|
||||
, _tmToggles = M.empty
|
||||
}
|
||||
|
||||
defaultTerminalInput :: TerminalInput
|
||||
defaultTerminalInput =
|
||||
TerminalInput
|
||||
{ _tiText = T.pack ""
|
||||
, _tiFocus = True
|
||||
, _tiSel = (0, 0)
|
||||
}
|
||||
|
||||
+74
-62
@@ -1,74 +1,86 @@
|
||||
module Dodge.Default.Wall
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.Block.Debris -- this dependency is (directly) for dirtColor
|
||||
import Picture
|
||||
import Geometry.Data
|
||||
module Dodge.Default.Wall where
|
||||
|
||||
import Control.Lens
|
||||
import Dodge.Block.Debris
|
||||
import Dodge.Data.Wall
|
||||
import Geometry.Data
|
||||
import Picture
|
||||
|
||||
{- Indestructible wall. -}
|
||||
defaultWall :: Wall
|
||||
defaultWall = Wall
|
||||
{ _wlLine = (V2 0 0,V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = greyN 0.6
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = Opaque
|
||||
, _wlPathable = False
|
||||
, _wlPenetrable = False
|
||||
, _wlFireThrough = False
|
||||
, _wlTouchThrough = False
|
||||
, _wlReflect = False
|
||||
, _wlUnshadowed = True
|
||||
, _wlRotateTo = True
|
||||
, _wlStructure = StandaloneWall
|
||||
, _wlWalkable = False
|
||||
, _wlHeight = 100
|
||||
, _wlMaterial = Stone
|
||||
, _wlBouncy = True
|
||||
}
|
||||
defaultWall =
|
||||
Wall
|
||||
{ _wlLine = (V2 0 0, V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = greyN 0.6
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = Opaque
|
||||
, _wlPathable = False
|
||||
, _wlPenetrable = False
|
||||
, _wlFireThrough = False
|
||||
, _wlTouchThrough = False
|
||||
, _wlReflect = False
|
||||
, _wlUnshadowed = True
|
||||
, _wlRotateTo = True
|
||||
, _wlStructure = StandaloneWall
|
||||
, _wlWalkable = False
|
||||
, _wlHeight = 100
|
||||
, _wlMaterial = Stone
|
||||
, _wlBouncy = True
|
||||
}
|
||||
|
||||
defaultDoorWall' :: Wall
|
||||
defaultDoorWall' = defaultWall
|
||||
{ _wlPathable = True
|
||||
, _wlMaterial = Metal
|
||||
}
|
||||
defaultDoorWall' =
|
||||
defaultWall
|
||||
{ _wlPathable = True
|
||||
, _wlMaterial = Metal
|
||||
}
|
||||
|
||||
{- Indestructible see-through wall. -}
|
||||
defaultCrystalWall :: Wall
|
||||
defaultCrystalWall = defaultWall
|
||||
{ _wlColor = withAlpha 0.5 aquamarine
|
||||
, _wlOpacity = SeeThrough
|
||||
, _wlMaterial = Crystal
|
||||
}
|
||||
defaultCrystalWall =
|
||||
defaultWall
|
||||
{ _wlColor = withAlpha 0.5 aquamarine
|
||||
, _wlOpacity = SeeThrough
|
||||
, _wlMaterial = Crystal
|
||||
}
|
||||
|
||||
defaultMachineWall :: Wall
|
||||
defaultMachineWall = defaultWall
|
||||
{ _wlOpacity = SeeAbove
|
||||
, _wlRotateTo = False
|
||||
, _wlStructure = MachinePart 0
|
||||
, _wlMaterial = Metal
|
||||
, _wlPenetrable = True
|
||||
}
|
||||
defaultMachineWall =
|
||||
defaultWall
|
||||
{ _wlOpacity = SeeAbove
|
||||
, _wlRotateTo = False
|
||||
, _wlStructure = MachinePart 0
|
||||
, _wlMaterial = Metal
|
||||
, _wlPenetrable = True
|
||||
}
|
||||
|
||||
defaultSensorWall :: Wall
|
||||
defaultSensorWall = defaultMachineWall & wlBouncy .~ False
|
||||
|
||||
defaultDirtWall :: Wall
|
||||
defaultDirtWall = defaultWall
|
||||
{ _wlLine = (V2 0 0,V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = dirtColor
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = Opaque
|
||||
, _wlRotateTo = False
|
||||
, _wlFireThrough = True
|
||||
, _wlPenetrable = True
|
||||
, _wlMaterial = Dirt
|
||||
}
|
||||
defaultDirtWall =
|
||||
defaultWall
|
||||
{ _wlLine = (V2 0 0, V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = dirtColor
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = Opaque
|
||||
, _wlRotateTo = False
|
||||
, _wlFireThrough = True
|
||||
, _wlPenetrable = True
|
||||
, _wlMaterial = Dirt
|
||||
}
|
||||
|
||||
defaultWindow :: Wall
|
||||
defaultWindow = defaultWall
|
||||
{ _wlLine = (V2 0 0,V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = withAlpha 0.5 cyan
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = SeeThrough
|
||||
, _wlFireThrough = True
|
||||
, _wlMaterial = Glass
|
||||
, _wlPenetrable = True
|
||||
}
|
||||
defaultWindow =
|
||||
defaultWall
|
||||
{ _wlLine = (V2 0 0, V2 50 0)
|
||||
, _wlID = 0
|
||||
, _wlColor = withAlpha 0.5 cyan
|
||||
, _wlSeen = False
|
||||
, _wlOpacity = SeeThrough
|
||||
, _wlFireThrough = True
|
||||
, _wlMaterial = Glass
|
||||
, _wlPenetrable = True
|
||||
}
|
||||
|
||||
+75
-115
@@ -1,122 +1,82 @@
|
||||
module Dodge.Default.Weapon where
|
||||
|
||||
import Control.Lens
|
||||
import qualified Data.Map.Strict as M
|
||||
import Dodge.Data.Hammer
|
||||
import Dodge.Data.Item
|
||||
import Dodge.Default.AimParams
|
||||
import Dodge.Default.Item
|
||||
import Dodge.Item.Weapon.Bullet
|
||||
import Dodge.Reloading.Action
|
||||
import Picture
|
||||
--import Control.Lens
|
||||
--import qualified Data.Map.Strict as M
|
||||
--import Dodge.Data.Hammer
|
||||
--import Dodge.Data.Item
|
||||
--import Dodge.Default.Item
|
||||
--import Dodge.Item.Weapon.Bullet
|
||||
--import Dodge.Reloading.Action
|
||||
--import Picture
|
||||
|
||||
defaultLeftLoadable :: LeftConsumption
|
||||
defaultLeftLoadable = AutoRecharging 10 10 100 100
|
||||
--
|
||||
--defaultLoadable :: HeldConsumption
|
||||
--defaultLoadable =
|
||||
-- LoadableAmmo
|
||||
-- { _laAmmoType = GenericAmmo
|
||||
-- , _laMax = 15
|
||||
-- , _laLoaded = 0
|
||||
-- , _laPrimed = True
|
||||
-- , _laCycle = [loadEject 10, loadInsert 10, loadPrime 10]
|
||||
-- , _laProgress = Nothing
|
||||
-- }
|
||||
--
|
||||
----defaultBulletLoadable :: HeldConsumption
|
||||
----defaultBulletLoadable = defaultLoadable & laAmmoType .~ basicBullet
|
||||
--
|
||||
--defaultChargeable :: LeftConsumption
|
||||
--defaultChargeable = ChargeableAmmo 100 100
|
||||
|
||||
defaultLoadable :: HeldConsumption
|
||||
defaultLoadable =
|
||||
LoadableAmmo
|
||||
{ _laAmmoType = GenericAmmo
|
||||
, _laMax = 15
|
||||
, _laLoaded = 0
|
||||
, _laPrimed = True
|
||||
, _laCycle = [loadEject 10, loadInsert 10, loadPrime 10]
|
||||
, _laProgress = Nothing
|
||||
}
|
||||
--defaultrUse :: ItemUse
|
||||
--defaultrUse =
|
||||
-- RightUse
|
||||
-- { _rUse = HeldDoNothing
|
||||
-- , _useDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
-- , _useMods = HeldModNothing
|
||||
-- , _useHammer = HammerUp
|
||||
-- , _useAim = defaultAimParams
|
||||
-- , _heldScroll = HeldScrollDoNothing
|
||||
-- , _heldConsumption = defaultLoadable
|
||||
-- }
|
||||
|
||||
defaultBulletLoadable :: HeldConsumption
|
||||
defaultBulletLoadable = defaultLoadable & laAmmoType .~ basicBullet
|
||||
--
|
||||
--
|
||||
--luseInstantNoH :: Luse -> ItemUse
|
||||
--luseInstantNoH f =
|
||||
-- defaultlUse
|
||||
-- & lUse .~ f
|
||||
-- & useDelay .~ NoDelay
|
||||
|
||||
defaultChargeable :: LeftConsumption
|
||||
defaultChargeable = ChargeableAmmo 100 100
|
||||
---- TODO change this
|
||||
--defaultLeftItem :: Item
|
||||
--defaultLeftItem =
|
||||
-- defaultWeapon
|
||||
-- & itUse .~ defaultlUse
|
||||
|
||||
defaultrUse :: ItemUse
|
||||
defaultrUse =
|
||||
RightUse
|
||||
{ _rUse = HeldDoNothing
|
||||
, _useDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _useMods = HeldModNothing
|
||||
, _useHammer = HammerUp
|
||||
, _useAim = defaultAimParams
|
||||
, _heldScroll = HeldScrollDoNothing
|
||||
, _heldConsumption = defaultLoadable
|
||||
}
|
||||
|
||||
defaultlUse :: ItemUse
|
||||
defaultlUse =
|
||||
LeftUse
|
||||
{ _lUse = LDoNothing
|
||||
, _useDelay = FixedRate{_rateMax = 8, _rateTime = 0}
|
||||
, _useHammer = HammerUp
|
||||
, _eqEq = defaultEquip
|
||||
, _leftConsumption = defaultLeftLoadable
|
||||
}
|
||||
|
||||
defaultEquip :: Equipment
|
||||
defaultEquip =
|
||||
Equipment
|
||||
{ _eqSite = GoesOnSpecial
|
||||
, _eqUse = EDoNothing
|
||||
, _eqOnEquip = EDoNothing
|
||||
, _eqOnRemove = EDoNothing
|
||||
, _eqParams = NoEquipParams
|
||||
, _eqViewDist = Nothing
|
||||
}
|
||||
|
||||
luseInstantNoH :: Luse -> ItemUse
|
||||
luseInstantNoH f =
|
||||
defaultlUse
|
||||
& lUse .~ f
|
||||
& useDelay .~ NoDelay
|
||||
|
||||
-- TODO change this
|
||||
defaultLeftItem :: Item
|
||||
defaultLeftItem =
|
||||
defaultWeapon
|
||||
& itUse .~ defaultlUse
|
||||
|
||||
defaultWeapon :: Item
|
||||
defaultWeapon =
|
||||
defaultItem
|
||||
& itUse .~ defaultrUse
|
||||
& itInvColor .~ white
|
||||
& itType . iyModules
|
||||
.~ M.fromList
|
||||
[ (ModTarget, EMPTYMODULE)
|
||||
, (ModTeleport, EMPTYMODULE)
|
||||
]
|
||||
|
||||
defaultBulletWeapon :: Item
|
||||
defaultBulletWeapon =
|
||||
defaultWeapon
|
||||
& itUse . heldConsumption .~ defaultBulletLoadable
|
||||
& itUse . rUse .~ HeldUseAmmoParams -- useAmmoParams
|
||||
& itType . iyModules . at ModBullet ?~ EMPTYMODULE
|
||||
& itType . iyModules . at ModBulletSpawn ?~ EMPTYMODULE
|
||||
& itType . iyModules . at ModBulletTrajectory ?~ EMPTYMODULE
|
||||
|
||||
defaultItemValue :: ItemValue
|
||||
defaultItemValue = ItemValue 10 MundaneItem
|
||||
|
||||
defaultCraftable :: Item
|
||||
defaultCraftable =
|
||||
defaultItem
|
||||
{ _itInvColor = green
|
||||
}
|
||||
|
||||
defBulletShooter :: ItemParams
|
||||
defBulletShooter =
|
||||
BulletShooter
|
||||
{ _muzVel = 1
|
||||
, _rifling = 0.8
|
||||
, _bore = 2
|
||||
, _gunBarrels = SingleBarrel 0
|
||||
, _recoil = 0
|
||||
, _torqueAfter = 0
|
||||
, _randomOffset = 0
|
||||
}
|
||||
|
||||
defaultAutoGun :: Item
|
||||
defaultAutoGun =
|
||||
defaultBulletWeapon
|
||||
& itUse . useAim . aimStance .~ TwoHandTwist
|
||||
--
|
||||
--
|
||||
--defaultItemValue :: ItemValue
|
||||
--defaultItemValue = ItemValue 10 MundaneItem
|
||||
--
|
||||
--defaultCraftable :: Item
|
||||
--defaultCraftable =
|
||||
-- defaultItem
|
||||
-- { _itInvColor = green
|
||||
-- }
|
||||
--
|
||||
--defBulletShooter :: ItemParams
|
||||
--defBulletShooter =
|
||||
-- BulletShooter
|
||||
-- { _muzVel = 1
|
||||
-- , _rifling = 0.8
|
||||
-- , _bore = 2
|
||||
-- , _gunBarrels = SingleBarrel 0
|
||||
-- , _recoil = 0
|
||||
-- , _torqueAfter = 0
|
||||
-- , _randomOffset = 0
|
||||
-- }
|
||||
--
|
||||
----defaultAutoGun :: Item
|
||||
----defaultAutoGun =
|
||||
---- defaultBulletWeapon
|
||||
---- & itUse . useAim . aimStance .~ TwoHandTwist
|
||||
|
||||
+126
-119
@@ -1,133 +1,140 @@
|
||||
module Dodge.Default.World where
|
||||
import Dodge.Data.Hammer
|
||||
import Dodge.Data
|
||||
import Geometry.Data
|
||||
import Geometry.Polygon
|
||||
|
||||
import System.Random
|
||||
import qualified IntMapHelp as IM
|
||||
import MaybeHelp
|
||||
import Data.Graph.Inductive.Graph hiding ((&))
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.Set as S
|
||||
import Data.Graph.Inductive.Graph hiding ((&))
|
||||
import Dodge.Data.World
|
||||
import Geometry.Data
|
||||
import Geometry.Polygon
|
||||
import qualified IntMapHelp as IM
|
||||
import System.Random
|
||||
|
||||
--import Data.Graph.Inductive.NodeMap
|
||||
defaultWorld :: World
|
||||
defaultWorld = World
|
||||
{ _cWorld = defaultCWorld
|
||||
, _toPlaySounds = M.empty
|
||||
, _playingSounds = M.empty
|
||||
, _randGen = mkStdGen 2
|
||||
, _keys = S.empty
|
||||
, _mouseButtons = mempty
|
||||
, _mousePos = V2 0 0
|
||||
, _hammers = defaultWorldHammers
|
||||
, _testFloat = 0
|
||||
, _lLine = (0,0)
|
||||
, _rLine = (0,0)
|
||||
, _lSelect = 0
|
||||
, _rSelect = 0
|
||||
, _backspaceTimer = 0
|
||||
, _timeFlow = NormalTimeFlow
|
||||
, _rbOptions = NoRightButtonOptions
|
||||
}
|
||||
defaultWorld =
|
||||
World
|
||||
{ _cWorld = defaultCWorld
|
||||
, _toPlaySounds = M.empty
|
||||
, _playingSounds = M.empty
|
||||
, _randGen = mkStdGen 2
|
||||
, _keys = S.empty
|
||||
, _mouseButtons = mempty
|
||||
, _mousePos = V2 0 0
|
||||
, _hammers = defaultWorldHammers
|
||||
, _testFloat = 0
|
||||
, _lLine = (0, 0)
|
||||
, _rLine = (0, 0)
|
||||
, _lSelect = 0
|
||||
, _rSelect = 0
|
||||
, _backspaceTimer = 0
|
||||
, _timeFlow = NormalTimeFlow
|
||||
, _rbOptions = NoRightButtonOptions
|
||||
}
|
||||
|
||||
defaultCWorld :: CWorld
|
||||
defaultCWorld = CWorld
|
||||
{ _cameraCenter = V2 0 0
|
||||
, _cameraRot = 0
|
||||
, _cameraZoom = 1
|
||||
, _magnets = IM.empty
|
||||
, _itemZoom = 1
|
||||
, _defaultZoom = 1
|
||||
, _cameraViewFrom = V2 0 0
|
||||
, _viewDistance = 1000
|
||||
, _modifications = IM.empty
|
||||
, _creatures = IM.empty
|
||||
, _crZoning = mempty --Zoning IM.empty crZoneSize zoneOfCreature
|
||||
, _creatureGroups = IM.empty
|
||||
, _clouds = mempty
|
||||
, _clZoning = mempty
|
||||
, _gusts = IM.empty
|
||||
, _gsZoning = mempty --Zoning IM.empty clZoneSize (zonePos _guPos)
|
||||
, _itemLocations = IM.empty
|
||||
, _props = IM.empty
|
||||
, _projectiles = IM.empty
|
||||
, _instantBullets = []
|
||||
, _bullets = []
|
||||
-- , _instantParticles = []
|
||||
-- , _particles = []
|
||||
, _flames = []
|
||||
, _radarSweeps = []
|
||||
, _sparks = []
|
||||
, _posEvents = []
|
||||
, _energyBalls = []
|
||||
, _radarBlips = []
|
||||
, _flares = []
|
||||
, _newBeams = WorldBeams [] [] [] []
|
||||
, _beams = WorldBeams [] [] [] []
|
||||
, _teslaArcs = []
|
||||
, _shockwaves = []
|
||||
, _lasers = []
|
||||
, _lasersToDraw = []
|
||||
, _tractorBeams = mempty
|
||||
, _linearShockwaves = mempty
|
||||
, _walls = IM.empty
|
||||
, _wallDamages = IM.empty
|
||||
, _blocks = IM.empty
|
||||
, _machines = IM.empty
|
||||
, _terminals = IM.empty
|
||||
, _doors = IM.empty
|
||||
, _coordinates = IM.empty
|
||||
, _triggers = IM.empty
|
||||
, _wlZoning = IM.empty --Zoning IM.empty wlZoneSize zoneOfWall
|
||||
, _floorItems = IM.empty
|
||||
, _floorTiles = []
|
||||
, _yourID = 0
|
||||
, _worldEvents = []
|
||||
, _delayedEvents = []
|
||||
, _pressPlates = IM.empty
|
||||
, _buttons = IM.empty
|
||||
, _corpses = IM.empty
|
||||
, _decorations = IM.empty
|
||||
--, _savedWorlds = M.empty
|
||||
-- , _menuLayers = []
|
||||
, _clickMousePos = V2 0 0
|
||||
, _pathGraph = Data.Graph.Inductive.Graph.empty
|
||||
-- , _pathGraphP = mempty
|
||||
, _pnZoning = mempty
|
||||
, _peZoning = mempty
|
||||
, _hud = HUD
|
||||
{ _hudElement = DisplayInventory NoSubInventory
|
||||
, _carteCenter = V2 0 0
|
||||
, _carteZoom = 0.5
|
||||
, _carteRot = 0
|
||||
defaultCWorld =
|
||||
CWorld
|
||||
{ _cameraCenter = V2 0 0
|
||||
, _cameraRot = 0
|
||||
, _cameraZoom = 1
|
||||
, _magnets = IM.empty
|
||||
, _itemZoom = 1
|
||||
, _defaultZoom = 1
|
||||
, _cameraViewFrom = V2 0 0
|
||||
, _viewDistance = 1000
|
||||
, _modifications = IM.empty
|
||||
, _creatures = IM.empty
|
||||
, _crZoning = mempty --Zoning IM.empty crZoneSize zoneOfCreature
|
||||
, _creatureGroups = IM.empty
|
||||
, _clouds = mempty
|
||||
, _clZoning = mempty
|
||||
, _gusts = IM.empty
|
||||
, _gsZoning = mempty --Zoning IM.empty clZoneSize (zonePos _guPos)
|
||||
, _itemLocations = IM.empty
|
||||
, _props = IM.empty
|
||||
, _projectiles = IM.empty
|
||||
, _instantBullets = []
|
||||
, _bullets = []
|
||||
, -- , _instantParticles = []
|
||||
-- , _particles = []
|
||||
_flames = []
|
||||
, _radarSweeps = []
|
||||
, _sparks = []
|
||||
, _posEvents = []
|
||||
, _energyBalls = []
|
||||
, _radarBlips = []
|
||||
, _flares = []
|
||||
, _newBeams = WorldBeams [] [] [] []
|
||||
, _beams = WorldBeams [] [] [] []
|
||||
, _teslaArcs = []
|
||||
, _shockwaves = []
|
||||
, _lasers = []
|
||||
, _lasersToDraw = []
|
||||
, _tractorBeams = mempty
|
||||
, _linearShockwaves = mempty
|
||||
, _walls = IM.empty
|
||||
, _wallDamages = IM.empty
|
||||
, _blocks = IM.empty
|
||||
, _machines = IM.empty
|
||||
, _terminals = IM.empty
|
||||
, _doors = IM.empty
|
||||
, _coordinates = IM.empty
|
||||
, _triggers = IM.empty
|
||||
, _wlZoning = IM.empty --Zoning IM.empty wlZoneSize zoneOfWall
|
||||
, _floorItems = IM.empty
|
||||
, _floorTiles = []
|
||||
, _yourID = 0
|
||||
, _worldEvents = []
|
||||
, _delayedEvents = []
|
||||
, _pressPlates = IM.empty
|
||||
, _buttons = IM.empty
|
||||
, _corpses = IM.empty
|
||||
, _decorations = IM.empty
|
||||
, --, _savedWorlds = M.empty
|
||||
-- , _menuLayers = []
|
||||
_clickMousePos = V2 0 0
|
||||
, _pathGraph = Data.Graph.Inductive.Graph.empty
|
||||
, -- , _pathGraphP = mempty
|
||||
_pnZoning = mempty
|
||||
, _peZoning = mempty
|
||||
, _hud =
|
||||
HUD
|
||||
{ _hudElement = DisplayInventory NoSubInventory
|
||||
, _carteCenter = V2 0 0
|
||||
, _carteZoom = 0.5
|
||||
, _carteRot = 0
|
||||
}
|
||||
, _lightSources = IM.empty
|
||||
, _tempLightSources = []
|
||||
, _closeObjects = []
|
||||
, _seenLocations =
|
||||
IM.fromList
|
||||
[ (0, (WdYouPos, "CURRENT POSITION"))
|
||||
, (1, (WdP2Const (V2 0 0), "START POSITION"))
|
||||
]
|
||||
, _selLocation = 0
|
||||
, _foregroundShapes = mempty
|
||||
, _distortions = []
|
||||
, _gameRooms = []
|
||||
, _roomClipping = []
|
||||
, _worldClock = 0
|
||||
, _worldBounds = defaultBounds
|
||||
, _maybeWorld = Nothing'
|
||||
, _rewindWorlds = []
|
||||
, _genParams = GenParams M.empty
|
||||
, -- , _genPlacements = IM.empty
|
||||
-- , _genRooms = IM.empty
|
||||
_deathDelay = Nothing
|
||||
, _boundBox = square 100
|
||||
, _boundDist = (100, -100, 100, -100)
|
||||
}
|
||||
, _lightSources = IM.empty
|
||||
, _tempLightSources = []
|
||||
, _closeObjects = []
|
||||
, _seenLocations = IM.fromList
|
||||
[(0, (WdYouPos, "CURRENT POSITION"))
|
||||
,(1, (WdP2Const (V2 0 0) , "START POSITION"))
|
||||
]
|
||||
, _selLocation = 0
|
||||
, _foregroundShapes = mempty
|
||||
, _distortions = []
|
||||
, _gameRooms = []
|
||||
, _roomClipping = []
|
||||
, _worldClock = 0
|
||||
, _worldBounds = defaultBounds
|
||||
, _maybeWorld = Nothing'
|
||||
, _rewindWorlds = []
|
||||
, _genParams = GenParams M.empty
|
||||
-- , _genPlacements = IM.empty
|
||||
-- , _genRooms = IM.empty
|
||||
, _deathDelay = Nothing
|
||||
, _boundBox = square 100
|
||||
, _boundDist = (100,-100,100,-100)
|
||||
}
|
||||
|
||||
defaultWorldHammers :: M.Map WorldHammer HammerPosition
|
||||
defaultWorldHammers = M.fromSet (const HammerUp) $ S.fromList [minBound.. maxBound]
|
||||
defaultWorldHammers = M.fromSet (const HammerUp) $ S.fromList [minBound .. maxBound]
|
||||
|
||||
--youLight :: TempLightSource
|
||||
--youLight = TLS
|
||||
--youLight = TLS
|
||||
-- { _tlsParam = LSParam
|
||||
-- {_lsPos = V3 0 0 0
|
||||
-- ,_lsRad = 300
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module Dodge.Default.World where
|
||||
import Dodge.Data
|
||||
import Dodge.Data.World
|
||||
import Dodge.Zone.Size
|
||||
import Dodge.Zone.Object
|
||||
import Dodge.Base
|
||||
|
||||
Reference in New Issue
Block a user