Develop laser upgrade path slightly

This commit is contained in:
2022-04-04 17:00:35 +01:00
parent 3698a738f3
commit 31d5bcd0bb
10 changed files with 108 additions and 22 deletions
+18
View File
@@ -67,6 +67,7 @@ itemCombinations =
, po [FLAMETHROWER,PUMP] flameTorrent
, p [o PRISM,o TRANSFORMER,o PIPE] lasGun
, p [o LASGUN,o TRANSFORMER,o PRISM] (lasGunWide 2)
, p [o TRANSFORMER,p 2 CAN] sparkGun
, p [o SPARKGUN,p 2 PIPE] teslaGun
@@ -79,6 +80,8 @@ itemCombinations =
, p [p 2 PLATE] flatShield
]
++ map (\i -> po [LASGUNWIDE i,TRANSFORMER,PRISM] $ lasGunWide (i+1)) [1..9]
++ map (\i -> po [LASGUNWIDE i,HARDWARE] $ lasGunFocus (i)) [1..10]
++ map (\i -> po [PIPE,BANGSTICK i] $ bangStick (i+1)) [1..8]
++ map (\i -> po [REVOLVERX i,CAN] $ revolverX (i+1)) [1..5]
++ map (\i -> p [o (BANGCANEX i),p 2 PIPE] $ bangCaneX (i+1)) [1..5]
@@ -147,6 +150,11 @@ moduleCombinations =
(itConsumption . aoType . amPjCreation .~ fireTrackingShell)
]
)
, ( ModBattery
, batteryGuns
, [amod [BATTERY] "+BATTERY" (itConsumption . ammoBaseMax +~ 1000)
]
)
]
where
makeDirectedTele it = it
@@ -167,6 +175,16 @@ moduleCombinations =
homingLaunchers :: [Item]
homingLaunchers = launcher : [launcherX i | i <- [2..10]]
batteryGuns :: [Item]
batteryGuns =
[ teslaGun
, sparkGun
, lasGun
] ++
[ lasGunWide i | i <- [1..10]
] ++
[ lasGunFocus i | i <- [1..10]]
bulletWeapons :: [Item]
bulletWeapons = [bangStick i | i <- [1..9] ]
++ [bangCaneX i | i <- [1..6] ]
+2
View File
@@ -50,6 +50,8 @@ data CombineType
| SPARKGUN
| TESLAGUN
| LASGUN
| LASGUNWIDE Int
| LASGUNFOCUS Int
| SONICGUN
| TRACTORGUN
| LAUNCHER
+10 -8
View File
@@ -179,20 +179,22 @@ testInventory = IM.fromList $ zip [0..]
, medkit 50 & itConsumption . itAmount .~ 3
-- , teleportModule
, makeTypeCraftNum 1 LIGHTER
, makeTypeCraftNum 15 TUBE
-- , makeTypeCraftNum 15 TUBE
, makeTypeCraftNum 9 TRANSFORMER
-- , makeTypeCraftNum 5 CREATURESENSOR
, makeTypeCraftNum 3 PRISM
, makeTypeCraftNum 9 PRISM
-- , makeTypeCraftNum 3 DRUM
, makeTypeCraftNum 3 PUMP
-- , makeTypeCraftNum 3 PUMP
, makeTypeCraftNum 3 BATTERY
-- , makeTypeCraftNum 1 MAGNET
, makeTypeCraftNum 1 TRANSMITTER
-- , makeTypeCraftNum 1 TRANSMITTER
, makeTypeCraftNum 10 HARDWARE
, makeTypeCraftNum 3 SPRING
, makeTypeCraftNum 10 CAN
, makeTypeCraftNum 3 TIN
-- , makeTypeCraftNum 10 CAN
-- , makeTypeCraftNum 3 TIN
, makeTypeCraftNum 3 PLANK
, makeTypeCraftNum 1 MOTOR
, makeTypeCraftNum 5 MICROCHIP
-- , makeTypeCraftNum 1 MOTOR
-- , makeTypeCraftNum 5 MICROCHIP
-- , makeTypeCraftNum 5 AIUNIT
]
stackedInventory :: IM.IntMap Item
+1 -1
View File
@@ -44,7 +44,7 @@ chaseCrit = defaultCreature
, targetYouWhenCognizant
, const (crMeleeCooldown %~ max 0 . subtract 1)
]
, _crHP = 150
, _crHP = 1500
, _crPict = basicCrPict green
, _crInv = IM.fromList [(0,medkit 200)]
, _crMeleeCooldown = 0
+1
View File
@@ -54,6 +54,7 @@ data AttentionDir
data AwarenessLevel
= Suspicious Float
| Cognizant Float
deriving (Eq,Ord)
makeLenses ''AttentionDir
makeLenses ''PerceptionState
+15 -10
View File
@@ -79,16 +79,20 @@ creatureDisplayText cfig w cr
. setDepth 50
. translate x y
. color white
. rotate a
. rotate (0.5 * pi)
-- . rotate (argV v - 0.5 * pi)
. scale theScale theScale
. text
$ clockCycle 50 (V.fromList [crDisplayAwake, crDisplayAlert]) w cr
. centerText
$ clockCycle 25 (V.fromList
[ crDisplayAwake
, crDisplayAlert
]
) w cr
where
campos = _cameraViewFrom w
theScale = 0.15 / _cameraZoom w
cpos = _crPos cr
v = cpos -.- campos
a = argV v - 0.5 * pi
(V2 x y) = campos +.+ v +.+ _crRad cr *.* normalizeV v
crDisplayAlert :: Creature -> String
@@ -106,12 +110,13 @@ crDisplayAlert cr
g _ = False
crDisplayAwake :: Creature -> String
crDisplayAwake cr = case _crAwakeLevel (_crPerception cr) of
Comatose -> "-"
Asleep -> "Z"
Lethargic -> "L"
Vigilant -> "V"
Overstrung -> "O"
crDisplayAwake = show . _crAwakeLevel . _crPerception
--crDisplayAwake cr = case _crAwakeLevel (_crPerception cr) of
-- Comatose -> "-"
-- Asleep -> "Z"
-- Lethargic -> "L"
-- Vigilant -> "V"
-- Overstrung -> "O"
--damageMod :: Creature -> Picture -> Picture
--damageMod cr pic = piercingMod $ bluntScale pic
+1
View File
@@ -439,6 +439,7 @@ data ModuleSlot
| ModTarget
| ModBulletTrajectory
| ModLauncherHoming
| ModBattery
deriving (Eq,Ord)
data ItemModule
+40 -2
View File
@@ -1,5 +1,7 @@
module Dodge.Item.Weapon.BatteryGuns
( lasGun
, lasGunWide
, lasGunFocus
, sparkGun
, teslaGun
, tractorGun
@@ -34,14 +36,24 @@ import Data.List (sortOn)
import System.Random
--import Data.Tuple
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
import Control.Monad.State
defaultBatteryGun :: Item
defaultBatteryGun = defaultGun
& itModules .~ M.fromList [(ModBattery, DefaultModule)]
defaultAutoBatteryGun :: Item
defaultAutoBatteryGun = defaultAutoGun
& itModules .~ M.fromList [(ModBattery, DefaultModule)]
sparkGun :: Item
sparkGun = teslaGun
& itName .~ "SPARKGUN"
& itType .~ SPARKGUN
& itParams . arcSize .~ 10
teslaGun :: Item
teslaGun = defaultGun
teslaGun = defaultBatteryGun
{ _itName = "TESLA"
, _itType = TESLAGUN
, _itConsumption = defaultAmmo
@@ -81,8 +93,34 @@ teslaGunPic _ = noPic $ colorSH blue $
where
xa = 1
xb = 9
lasGunWide :: Int -> Item
lasGunWide n = lasGun
& itName .~ "PARALELLAS"++show n
& itType .~ LASGUNWIDE n
& itUse . useMods .~
[ ammoCheckI
, withTempLight 1 100 (V3 1 1 0)
, withSoundForI tone440sawtoothquietS 2
, duplicateOffsets xs
, useAmmoAmount 1
]
where
xs = [ 3 * (fromIntegral x - fromIntegral (n-1) /2) | x <- [0..n-1] ]
lasGunFocus :: Int -> Item
lasGunFocus n = lasGun
& itName .~ "FOCALAS"++show n
& itType .~ LASGUNFOCUS n
& itUse . useMods .~
[ ammoCheckI
, withTempLight 1 100 (V3 1 1 0)
, withSoundForI tone440sawtoothquietS 2
, duplicateOffsetsFocus xs
, useAmmoAmount 1
]
where
xs = [ 3 * (fromIntegral x - fromIntegral (n-1) /2) | x <- [0..n-1] ]
lasGun :: Item
lasGun = defaultAutoGun
lasGun = defaultAutoBatteryGun
{ _itName = "LASGUN"
, _itType = LASGUN
, _itConsumption = defaultAmmo
+19
View File
@@ -42,6 +42,8 @@ module Dodge.Item.Weapon.TriggerType
, sideEffectOnFrame
, duplicateLoadedBarrels
, duplicateLoaded
, duplicateOffsets
, duplicateOffsetsFocus
, hammerCheckI
, hammerCheckL
, shootL
@@ -60,6 +62,7 @@ import Dodge.RandomHelp
import Dodge.Inventory.Lock
--import Dodge.Creature.HandPos
--import Dodge.Default
import Dodge.Base
import Sound.Data
import Geometry
--import Geometry.Vector3D
@@ -530,3 +533,19 @@ duplicateLoadedBarrels eff item cr w = foldr f w poss
f pos = eff item (cr & crPos %~ (+.+ pos))
numBar = _brlNum . _gunBarrels $ _itParams item
numBul = _ammoLoaded $ _itConsumption item
duplicateOffsetsFocus :: [Float] -> ChainEffect
duplicateOffsetsFocus xs eff item cr w = foldr f w poss
where
poss :: [V2 Float]
poss = map (rotateV (_crDir cr) . V2 0 ) xs
f pos = eff item $ cr
& crPos %~ (+.+ pos)
& crDir .~ argV (mouseWorldPos w -.- (_crPos cr +.+ pos))
duplicateOffsets :: [Float] -> ChainEffect
duplicateOffsets xs eff item cr w = foldr f w poss
where
poss :: [V2 Float]
poss = map (rotateV (_crDir cr) . V2 0 ) xs
f pos = eff item (cr & crPos %~ (+.+ pos))
+1 -1
View File
@@ -222,7 +222,7 @@ circle rad = thickArc 0 (2*pi) rad 1
centerText :: String -> Picture
{-# INLINE centerText #-}
centerText s = translate (25 * (negate . fromIntegral $ length s)) 0 $ text s
centerText s = translate (50 * (negate . fromIntegral $ length s - 1)) 0 $ text s
text :: String -> Picture
{-# INLINE text #-}