Files
loop/src/Dodge/Creature.hs
T
2024-10-02 23:53:38 +01:00

322 lines
8.3 KiB
Haskell

module Dodge.Creature (
module Dodge.Creature,
module Dodge.Creature.ChaseCrit,
module Dodge.Creature.Inanimate,
launcherCrit,
pistolCrit,
ltAutoCrit,
spreadGunCrit,
autoCrit,
armourChaseCrit,
module Dodge.Creature.Action,
module Dodge.Creature.Boid,
module Dodge.Creature.ChainUpdates,
module Dodge.Creature.Impulse,
module Dodge.Creature.Perception,
module Dodge.Creature.ReaderUpdate,
module Dodge.Creature.SentinelAI,
module Dodge.Creature.State,
module Dodge.Creature.Strategy,
module Dodge.Creature.Test,
module Dodge.Creature.Volition,
module Dodge.Creature.YourControl,
) where
import Dodge.Item.Ammo
import Dodge.Item.Scope
import Control.Lens
import Dodge.Creature.Action
import Dodge.Creature.ArmourChase
import Dodge.Creature.AutoCrit
import Dodge.Creature.Boid
import Dodge.Creature.ChainUpdates
import Dodge.Creature.ChaseCrit
import Dodge.Creature.Impulse
import Dodge.Creature.Inanimate
import Dodge.Creature.LauncherCrit
import Dodge.Creature.LtAutoCrit
import Dodge.Creature.Perception
import Dodge.Creature.PistolCrit
import Dodge.Creature.ReaderUpdate
import Dodge.Creature.SentinelAI
import Dodge.Creature.SpreadGunCrit
import Dodge.Creature.State
import Dodge.Creature.Strategy
import Dodge.Creature.Test
import Dodge.Creature.Volition
import Dodge.Creature.YourControl
import Dodge.Data.Creature
import Dodge.Default
import Dodge.Item
import Geometry.Data
import qualified IntMapHelp as IM
import Picture
spawnerCrit :: Creature
spawnerCrit =
defaultCreature
& crHP .~ 300
& crInv .~ IM.empty
& crType . skinUpper .~ lightx4 blue
miniGunCrit :: Creature
miniGunCrit =
defaultCreature
& crInv .~ IM.fromList [(0, miniGunX 3)]
& crType . skinUpper .~ lightx4 red
& crType . humanoidAI .~ MiniGunAI
longCrit :: Creature
longCrit =
defaultCreature
& crInv .~ IM.fromList [(0, sniperRifle), (1, medkit 100)]
& crType . humanoidAI .~ LongAI
& crType . skinUpper .~ lightx4 red
multGunCrit :: Creature
multGunCrit =
defaultCreature
& crInv .~ IM.fromList [(0, volleyGun 4), (1, medkit 100)]
& crType . skinUpper .~ lightx4 red
& crType . humanoidAI .~ MultGunAI
addArmour :: Creature -> Creature
addArmour = over crInv insarmour
where
insarmour xs = IM.insert (IM.newKey xs) frontArmour xs
{- | The creature you control.
ID 0.
-}
startCr :: Creature
startCr =
defaultCreature
& crPos .~ V2 20 0
& crOldPos .~ V2 20 0
& crDir .~ pi / 2
& crMvDir .~ pi / 2
& crID .~ 0
& crHP .~ 1000
& crMaxHP .~ 1500
& crInv .~ startInventory
& crCorpse .~ MakeDefaultCorpse
& crFaction .~ PlayerFaction
& crMvType .~ MvWalking yourDefaultSpeed
& crType . skinUpper .~ lightx4 black
& crType . humanoidAI .~ YourAI
-- | Items you start with.
startInvList :: [Item]
startInvList = []
startInventory :: IM.IntMap Item
startInventory = IM.fromList $ zip [0 ..] startInvList
inventoryX :: Char -> [Item]
inventoryX c = case c of
'A' ->
[ clickDetector ITEMDETECTOR
] <> fold
[ makeTypeCraftNum 1 TRANSFORMER
, makeTypeCraftNum 2 CAN
, makeTypeCraftNum 2 PIPE
]
'B' ->
[ wristArmour
, wristArmour
, autoRifle
, tinMag
, smg
, tinMag
, machinePistol
, tinMag
] <> fold
[ makeTypeCraftNum 4 MICROCHIP
, makeTypeCraftNum 2 TIN
, makeTypeCraftNum 2 HARDWARE
, makeTypeCraftNum 2 CAN
, makeTypeCraftNum 2 PIPE
, makeTypeCraftNum 1 CREATURESENSOR
]
'C' ->
[ autoDetector CREATUREDETECTOR
, autoDetector WALLDETECTOR
, autoDetector ITEMDETECTOR
, wristInvisibility
]
'D' ->
[ blinkGun
, unsafeBlinkGun
, autoDetector WALLDETECTOR
]
'E' -> fold
[ makeTypeCraftNum 3 PIPE
, makeTypeCraftNum 5 HARDWARE
, makeTypeCraftNum 1 TIN
, makeTypeCraftNum 1 SPRING
, makeTypeCraftNum 1 PLANK
, makeTypeCraftNum 1 PLATE
, makeTypeCraftNum 1 STEELDRUM
, makeTypeCraftNum 1 MOTOR
]
'F' -> fold
[ makeTypeCraftNum 5 PIPE
, makeTypeCraftNum 5 TUBE
, makeTypeCraftNum 5 HARDWARE
, makeTypeCraftNum 5 TIN
, makeTypeCraftNum 5 CAN
, makeTypeCraftNum 5 SPRING
, makeTypeCraftNum 5 PUMP
, makeTypeCraftNum 5 MAGNET
, makeTypeCraftNum 5 PLANK
, makeTypeCraftNum 5 PLATE
, makeTypeCraftNum 5 STEELDRUM
, makeTypeCraftNum 5 MOTOR
, makeTypeCraftNum 5 TRANSFORMER
, makeTypeCraftNum 5 PRISM
, makeTypeCraftNum 5 LIGHTER
-- , makeTypeCraftNum 5 (ENERGYBALLCRAFT IncBall)
]
'G' ->
[ autoPistol
, tinMag
, pistol
, tinMag
] <> fold
[ makeTypeCraftNum 2 HARDWARE
, makeTypeCraftNum 2 MAGNET
-- , makeTypeCraftNum 5 (ENERGYBALLCRAFT IncBall)
-- , makeTypeCraftNum 5 (ENERGYBALLCRAFT TeslaBall)
-- , makeTypeCraftNum 5 (ENERGYBALLCRAFT ConcBall)
-- , makeTypeCraftNum 5 (BULBODYCRAFT BounceBullet)
-- , makeTypeCraftNum 5 (BULBODYCRAFT PenetrateBullet)
]
'H' -> [shatterGun]
'I' ->
[ makeTypeCraft TELEPORTMODULE
, makeTypeCraft HARDDRIVE
, makeTypeCraft RAM
] <> fold
[ makeTypeCraftNum 2 TIMEMODULE
, makeTypeCraftNum 2 MICROCHIP
]
'J' ->
[ lasGun
, lasGun
--, dualBeam
] <> makeTypeCraftNum 10 TRANSFORMER
'K' ->
[ autoRifle
, tinMag
] <> fold
[ makeTypeCraftNum 7 MICROCHIP
, makeTypeCraftNum 4 HARDWARE
, makeTypeCraftNum 2 MAGNET
, makeTypeCraftNum 1 MOTOR
, makeTypeCraftNum 2 ANTIMATTER
, makeTypeCraftNum 1 LIGHTSENSOR
, makeTypeCraftNum 1 SOUNDSENSOR
, makeTypeCraftNum 1 HEATSENSOR
]
'L' -> [scrollWatch]
'M' -> stackedInventory
'N' -> [zoomScope,targetingScope TARGETLASER, sniperRifle]
'O' -> [ launcherX 2
, shellMag
, shellMag
, launcherX 3
, shellMag
, shellMag
, shellMag
, rifle
, shellMag
]
'P' -> [burstRifle , tinMag, bulletSynthesizer]
'T' -> testInventory
'U' ->
[targetingScope tt | tt <- [minBound .. maxBound]]
<>
[ launcher
, megaShellMag
, homingModule
, remoteScreen
]
'V' ->
[targetingScope tt | tt <- [minBound .. maxBound]]
<>
[ augmentedHUD
, autoRifle
, megaTinMag 10200
] <>
[bulletTargetingModule btt | btt <- [minBound .. maxBound]]
<> [bulletModule (BulletModPayload (BulBall x)) | x <- [minBound .. maxBound]]
<> [bulletModule (BulletModEffect x) | x <- [minBound .. maxBound]]
_ -> []
testInventory :: [Item]
testInventory =
[ autoAmr
, brainHat
, headLamp
, autoDetector WALLDETECTOR
, magShield
, frontArmour
, wristArmour
, flatShield
, sniperRifle
-- , makeTypeCraft (ENERGYBALLCRAFT IncBall)
-- , makeTypeCraft (ENERGYBALLCRAFT TeslaBall)
-- , makeTypeCraft (ENERGYBALLCRAFT ConcBall)
, teleportModule
] <> fold
[ makeTypeCraftNum 1 MOTOR
, makeTypeCraftNum 9 PIPE
, makeTypeCraftNum 10 HARDWARE
, makeTypeCraftNum 3 SPRING
, makeTypeCraftNum 10 CAN
, makeTypeCraftNum 3 PLANK
]
stackedInventory :: [Item]
stackedInventory =
[ torch
, torch
, remoteScreen
, megaShellMag
, targetingScope TARGETLASER
, burstRifle
, megaTinMag 100
, teslaGun
, megaBattery
, flameThrower
, chemFuelPouch
, bulletSynthesizer
, zoomScope
, drumMag
, launcherX 3
, megaShellMag
, megaShellMag
, megaShellMag
, pipe
, scrollWatch
, rewindWatch
, stopWatch
, tractorGun
, autoPistol
, tinMag
, pistol
, tinMag
, teslaGun
, blinkGun
, miniGunX 3
, beltMag
, boosterGun
, flatShield
, spawnGun (lamp 5)
, lasGun
-- , lasWide 20
, poisonSprayer
, bulletBeltPack
, bulletBeltBracer
]