Remove hvAuto, replace with machineGun
This commit is contained in:
+10
-1
@@ -203,6 +203,16 @@ inventoryX c = case c of
|
|||||||
, autoDetector WALLDETECTOR
|
, autoDetector WALLDETECTOR
|
||||||
, effectGun "GIBBER" addCrGibs
|
, effectGun "GIBBER" addCrGibs
|
||||||
]
|
]
|
||||||
|
'E' ->
|
||||||
|
[ makeTypeCraftNum 3 PIPE
|
||||||
|
, makeTypeCraftNum 5 HARDWARE
|
||||||
|
, makeTypeCraftNum 1 TIN
|
||||||
|
, makeTypeCraftNum 1 SPRING
|
||||||
|
, makeTypeCraftNum 1 PLANK
|
||||||
|
, makeTypeCraftNum 1 PLATE
|
||||||
|
, makeTypeCraftNum 1 DRUM
|
||||||
|
, makeTypeCraftNum 1 MOTOR
|
||||||
|
]
|
||||||
_ -> []
|
_ -> []
|
||||||
|
|
||||||
testInventory :: IM.IntMap Item
|
testInventory :: IM.IntMap Item
|
||||||
@@ -253,7 +263,6 @@ stackedInventory = IM.fromList $ zip [0..]
|
|||||||
,longGun
|
,longGun
|
||||||
,autoGun
|
,autoGun
|
||||||
,ltAutoGun
|
,ltAutoGun
|
||||||
,hvAutoGun
|
|
||||||
,pistol
|
,pistol
|
||||||
,teslaGun
|
,teslaGun
|
||||||
,blinkGun
|
,blinkGun
|
||||||
|
|||||||
@@ -10,4 +10,3 @@ inTermFocus w = fromMaybe False $ do
|
|||||||
hasfocus <- w ^? terminals . ix tmid . tmInput . tiFocus
|
hasfocus <- w ^? terminals . ix tmid . tmInput . tiFocus
|
||||||
connectionstatus <- w ^? terminals . ix tmid . tmStatus
|
connectionstatus <- w ^? terminals . ix tmid . tmStatus
|
||||||
return $ hasfocus && connectionstatus == TerminalReady
|
return $ hasfocus && connectionstatus == TerminalReady
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ module Dodge.Item.Weapon.BulletGun.Rod
|
|||||||
) where
|
) where
|
||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
import Dodge.Item.Weapon.BulletGun.Clip
|
import Dodge.Item.Weapon.BulletGun.Clip
|
||||||
|
import Dodge.Item.Weapon.InventoryDisplay
|
||||||
import Dodge.Particle.HitEffect
|
import Dodge.Particle.HitEffect
|
||||||
import Dodge.Particle.Damage
|
import Dodge.Particle.Damage
|
||||||
--import Dodge.ChainEffect
|
--import Dodge.ChainEffect
|
||||||
@@ -32,7 +33,7 @@ import Shape
|
|||||||
--import Sound.Data
|
--import Sound.Data
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
--import Data.Maybe
|
import Data.Maybe
|
||||||
--import qualified Data.Sequence as Seq
|
--import qualified Data.Sequence as Seq
|
||||||
--import Control.Lens
|
--import Control.Lens
|
||||||
--import Control.Monad.State
|
--import Control.Monad.State
|
||||||
@@ -76,7 +77,6 @@ bangRod = defaultGun
|
|||||||
{ _laType = basicBullet
|
{ _laType = basicBullet
|
||||||
, _laMax = 1
|
, _laMax = 1
|
||||||
, _laReloadTime = 20
|
, _laReloadTime = 20
|
||||||
, _laReloadType = ActiveClear
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
& itUse . useAim . aimWeight .~ 8
|
& itUse . useAim . aimWeight .~ 8
|
||||||
@@ -139,3 +139,23 @@ machineGun :: Item
|
|||||||
machineGun = bangRod
|
machineGun = bangRod
|
||||||
& itName .~ "MACHINEGUN"
|
& itName .~ "MACHINEGUN"
|
||||||
& itType .~ MACHINEGUN
|
& itType .~ MACHINEGUN
|
||||||
|
& itUse .~ (ruseAmmoParamsRate 25 NoHammer
|
||||||
|
[ ammoCheckI
|
||||||
|
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
||||||
|
, withSoundStart bangEchoS
|
||||||
|
, withThinSmokeI
|
||||||
|
, withMuzFlareI
|
||||||
|
]
|
||||||
|
& useAim . aimWeight .~ 8
|
||||||
|
& useAim . aimRange .~ 1
|
||||||
|
& useAim . aimStance .~ TwoHandTwist
|
||||||
|
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
||||||
|
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
||||||
|
)
|
||||||
|
& itConsumption . laMax .~ 100
|
||||||
|
& itConsumption . laReloadTime .~ 75
|
||||||
|
& itInvSize .~ 3
|
||||||
|
& itParams. torqueAfter .~ 0.2 -- not sure if this is necessary?
|
||||||
|
& itInvDisplay .~ \it -> head (basicItemDisplay it) :
|
||||||
|
["*FIRERATE:" ++ fromMaybe "" (maybeRateStatus it)
|
||||||
|
]
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ module Dodge.Item.Weapon.BulletGuns
|
|||||||
, biggestBlunderbuss
|
, biggestBlunderbuss
|
||||||
, grenadeLauncher
|
, grenadeLauncher
|
||||||
, ltAutoGun
|
, ltAutoGun
|
||||||
, hvAutoGun
|
|
||||||
, autogunSpread
|
, autogunSpread
|
||||||
, autoGun
|
, autoGun
|
||||||
, autoGunPic
|
, autoGunPic
|
||||||
@@ -23,7 +22,6 @@ import Dodge.Item.Weapon.ZoomScope
|
|||||||
import Dodge.Data
|
import Dodge.Data
|
||||||
--import Dodge.ChainEffect
|
--import Dodge.ChainEffect
|
||||||
import Dodge.Default.Weapon
|
import Dodge.Default.Weapon
|
||||||
import Dodge.Item.Weapon.InventoryDisplay
|
|
||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
import Dodge.Item.Attachment
|
import Dodge.Item.Attachment
|
||||||
--import Dodge.Item.Weapon.InventoryDisplay
|
--import Dodge.Item.Weapon.InventoryDisplay
|
||||||
@@ -39,7 +37,6 @@ import Shape
|
|||||||
--import Sound.Data
|
--import Sound.Data
|
||||||
import LensHelp
|
import LensHelp
|
||||||
|
|
||||||
import Data.Maybe
|
|
||||||
import qualified Data.Sequence as Seq
|
import qualified Data.Sequence as Seq
|
||||||
--import Control.Lens
|
--import Control.Lens
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
@@ -212,36 +209,6 @@ biggestBlunderbuss = biggerBlunderbuss
|
|||||||
grenadeLauncher :: Int -> Item
|
grenadeLauncher :: Int -> Item
|
||||||
grenadeLauncher _ = bangCone
|
grenadeLauncher _ = bangCone
|
||||||
|
|
||||||
hvAutoGun :: Item
|
|
||||||
hvAutoGun = defaultAutoGun
|
|
||||||
{ _itName = "AUTO-HV"
|
|
||||||
, _itType = HVAUTOGUN
|
|
||||||
, _itConsumption = defaultAmmo
|
|
||||||
{ _laType = hvBullet
|
|
||||||
, _laMax = 100
|
|
||||||
, _laLoaded = 100
|
|
||||||
, _laReloadTime = 200
|
|
||||||
}
|
|
||||||
, _itUse = ruseAmmoParamsRate 25 NoHammer
|
|
||||||
[ ammoCheckI
|
|
||||||
, rateIncAB (torqueBeforeAtLeast 0.1 0.1) withTorqueAfter
|
|
||||||
, withSoundStart bangEchoS
|
|
||||||
, withThinSmokeI
|
|
||||||
, withMuzFlareI
|
|
||||||
]
|
|
||||||
& useAim . aimWeight .~ 8
|
|
||||||
& useAim . aimRange .~ 1
|
|
||||||
& useAim . aimStance .~ TwoHandTwist
|
|
||||||
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
|
|
||||||
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
|
|
||||||
-- , _itFloorPict = hvAutoGunPic
|
|
||||||
, _itInvSize = 3
|
|
||||||
, _itInvDisplay = \it -> head (basicItemDisplay it) :
|
|
||||||
["* FIRERATE: *"
|
|
||||||
,"* " ++ fromMaybe " " (maybeRateStatus it) ++ " *"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
& itParams. torqueAfter .~ 0.2
|
|
||||||
ltAutoGun :: Item
|
ltAutoGun :: Item
|
||||||
ltAutoGun = defaultAutoGun
|
ltAutoGun = defaultAutoGun
|
||||||
{ _itName = "AUTO-LT"
|
{ _itName = "AUTO-LT"
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ maybeModeStatus it = case it ^? itAttachment of
|
|||||||
maybeRateStatus :: Item -> Maybe String
|
maybeRateStatus :: Item -> Maybe String
|
||||||
maybeRateStatus it = case it ^? itUse . useDelay . rateMaxMax of
|
maybeRateStatus it = case it ^? itUse . useDelay . rateMaxMax of
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
_ -> Just $ ' ' : " " ++ leftPad 4 ' ' (show (_rateMax . _useDelay $ _itUse it))
|
_ -> Just $ leftPad 3 ' ' (show (_rateMax . _useDelay $ _itUse it))
|
||||||
|
|
||||||
maybeWarmupStatus :: Item -> Maybe String
|
maybeWarmupStatus :: Item -> Maybe String
|
||||||
maybeWarmupStatus it = case it ^? itUse . useDelay . warmMax of
|
maybeWarmupStatus it = case it ^? itUse . useDelay . warmMax of
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ module Dodge.Placement.Instance.Terminal
|
|||||||
, putTerminal'
|
, putTerminal'
|
||||||
, putTerminal''
|
, putTerminal''
|
||||||
, simpleTermMessage
|
, simpleTermMessage
|
||||||
, topFlushStrings
|
|
||||||
, terminalColor
|
, terminalColor
|
||||||
, terminalSPic
|
, terminalSPic
|
||||||
) where
|
) where
|
||||||
@@ -128,24 +127,3 @@ accessTerminal mtmid w = case mtmid of
|
|||||||
|
|
||||||
simpleTermMessage :: [String] -> Terminal
|
simpleTermMessage :: [String] -> Terminal
|
||||||
simpleTermMessage strs = defaultTerminal & tmFutureLines .~ map makeTermLine strs
|
simpleTermMessage strs = defaultTerminal & tmFutureLines .~ map makeTermLine strs
|
||||||
--simpleTermMessage ss = const $ TerminalParams
|
|
||||||
-- {_termDisplayedLines = []
|
|
||||||
-- ,_termFutureLines = TerminalLineEffect 0 termsound
|
|
||||||
-- : map totermline (topFlushStrings ss ++ ss)
|
|
||||||
-- ,_termMaxLines = 7
|
|
||||||
-- ,_termTitle = "TERMINAL"
|
|
||||||
-- ,_termSel = Nothing
|
|
||||||
-- ,_termMaxSel = Nothing
|
|
||||||
-- }
|
|
||||||
-- where
|
|
||||||
-- totermline s = TerminalLineDisplay 0 (const (s,white))
|
|
||||||
-- termsound subinv w' = soundStart TerminalSound tpos computerBeepingS Nothing w'
|
|
||||||
-- where
|
|
||||||
-- tpos = fromMaybe 0 $ w' ^? buttons . ix (_termID subinv) . btPos
|
|
||||||
|
|
||||||
topFlushStrings :: [String] -> [String]
|
|
||||||
topFlushStrings = topFlush . maximum . map length
|
|
||||||
|
|
||||||
topFlush :: Int -> [String]
|
|
||||||
topFlush twidth = [replicate i ' ' ++ "*" | i <- [0, max 1 $ twidth `div` 5 .. twidth]]
|
|
||||||
|
|
||||||
|
|||||||
+5
-29
@@ -28,8 +28,7 @@ disconnectTerminal tm w = w
|
|||||||
& terminals . ix (_tmID tm) . tmStatus .~ TerminalOff
|
& terminals . ix (_tmID tm) . tmStatus .~ TerminalOff
|
||||||
& exitTerminalSubInv
|
& exitTerminalSubInv
|
||||||
& terminals . ix (_tmID tm) . tmFutureLines .~
|
& terminals . ix (_tmID tm) . tmFutureLines .~
|
||||||
[ TerminalLineTerminalEffect 0 (tmDisplayedLines .~ [])
|
[ TerminalLineTerminalEffect 0 (tmDisplayedLines .~ []) ]
|
||||||
]
|
|
||||||
|
|
||||||
exitTerminalSubInv :: World -> World
|
exitTerminalSubInv :: World -> World
|
||||||
exitTerminalSubInv w = case w ^? hud . hudElement . subInventory . termID of
|
exitTerminalSubInv w = case w ^? hud . hudElement . subInventory . termID of
|
||||||
@@ -41,16 +40,12 @@ damageCodeCommand = TerminalCommand
|
|||||||
{ _tcString = "DAMAGECODE"
|
{ _tcString = "DAMAGECODE"
|
||||||
, _tcAlias = ["DCODE","DC"]
|
, _tcAlias = ["DCODE","DC"]
|
||||||
, _tcHelp = "DISPLAYS THE SHAPE AND COLOR ASSOCIATED WITH A GIVEN DAMAGE TYPE."
|
, _tcHelp = "DISPLAYS THE SHAPE AND COLOR ASSOCIATED WITH A GIVEN DAMAGE TYPE."
|
||||||
, _tcEffect = \_ w -> OneArgument "A DAMAGE TYPE" $ getDamageCoding w
|
, _tcEffect = \_ -> OneArgument "A DAMAGE TYPE" . getDamageCoding
|
||||||
-- , _tcArgumentType = Just "A DAMAGE TYPE"
|
|
||||||
-- , _tcArguments = \_ -> map (map toUpper . show) . M.keys . _sensorCoding . _genParams
|
|
||||||
-- , _tcEffect = f
|
|
||||||
}
|
}
|
||||||
getDamageCoding :: World -> M.Map String [TerminalLine]
|
getDamageCoding :: World -> M.Map String [TerminalLine]
|
||||||
getDamageCoding = decodedtmap . _sensorCoding . _genParams
|
getDamageCoding = decodedtmap . _sensorCoding . _genParams
|
||||||
|
|
||||||
decodedtmap :: M.Map DamageType (PaletteColor,DecorationShape)
|
decodedtmap :: M.Map DamageType (PaletteColor,DecorationShape) -> M.Map String [TerminalLine]
|
||||||
-> M.Map String [TerminalLine]
|
|
||||||
decodedtmap = M.mapKeys show . M.map ((:[]) . makeTermLine . show)
|
decodedtmap = M.mapKeys show . M.map ((:[]) . makeTermLine . show)
|
||||||
|
|
||||||
sensorCommand :: TerminalCommand
|
sensorCommand :: TerminalCommand
|
||||||
@@ -58,7 +53,7 @@ sensorCommand = TerminalCommand
|
|||||||
{ _tcString = "SENSOR"
|
{ _tcString = "SENSOR"
|
||||||
, _tcAlias = ["SEN"]
|
, _tcAlias = ["SEN"]
|
||||||
, _tcHelp = "ACCESS INFORMATION CONCERNING THE CONNECTED SENSOR."
|
, _tcHelp = "ACCESS INFORMATION CONCERNING THE CONNECTED SENSOR."
|
||||||
, _tcEffect = \tm w -> OneArgument "A SENSOR PARAMETER" (sensorInfoMap tm w)
|
, _tcEffect = \tm -> OneArgument "A SENSOR PARAMETER" . sensorInfoMap tm
|
||||||
}
|
}
|
||||||
sensorInfoMap :: Terminal -> World -> M.Map String [TerminalLine]
|
sensorInfoMap :: Terminal -> World -> M.Map String [TerminalLine]
|
||||||
sensorInfoMap tm w = M.fromList
|
sensorInfoMap tm w = M.fromList
|
||||||
@@ -71,20 +66,6 @@ getSensor :: Show a => (Sensor -> a) -> Terminal -> World -> [TerminalLine]
|
|||||||
getSensor f tm w = maybe [] (makeTermPara . map toUpper . show . f)
|
getSensor f tm w = maybe [] (makeTermPara . map toUpper . show . f)
|
||||||
(w ^? machines . ix (_tmMachineID tm) . mcSensor)
|
(w ^? machines . ix (_tmMachineID tm) . mcSensor)
|
||||||
|
|
||||||
|
|
||||||
effectArgMessage :: (String -> Terminal -> World -> Maybe [String])
|
|
||||||
-> [String] -> Terminal -> World -> Either String [TerminalLine]
|
|
||||||
effectArgMessage f args tm w = maybe (Left "") Right $ do
|
|
||||||
arg <- safeHead args
|
|
||||||
strs <- f arg tm w
|
|
||||||
return $ map makeTermLine strs
|
|
||||||
|
|
||||||
sensf :: String -> Terminal -> World -> Maybe [String]
|
|
||||||
sensf arg tm w = case arg of
|
|
||||||
-- "REQUIREMENT","DISTANCE","CURRENTSTATUS","PASTSTATUS"]
|
|
||||||
"BOOL" -> Just [show $ w ^? machines . ix (_tmMachineID tm) . mcSensor . sensToggle]
|
|
||||||
_ -> Nothing
|
|
||||||
|
|
||||||
toggleCommand :: TerminalCommand
|
toggleCommand :: TerminalCommand
|
||||||
toggleCommand = TerminalCommand
|
toggleCommand = TerminalCommand
|
||||||
{ _tcString = "TOGGLE"
|
{ _tcString = "TOGGLE"
|
||||||
@@ -105,9 +86,6 @@ helpCommand = TerminalCommand
|
|||||||
, _tcEffect = \tm -> OneArgument "AN AVAILABLE COMMAND" . getCommandsHelp tm
|
, _tcEffect = \tm -> OneArgument "AN AVAILABLE COMMAND" . getCommandsHelp tm
|
||||||
}
|
}
|
||||||
getCommandsHelp :: Terminal -> World -> M.Map String [TerminalLine]
|
getCommandsHelp :: Terminal -> World -> M.Map String [TerminalLine]
|
||||||
--getCommandsHelp tm w = fromMaybe mempty $ do
|
|
||||||
-- tcs <- getCommands tm w
|
|
||||||
-- return $ foldr f mempty tcs
|
|
||||||
getCommandsHelp tm w = foldr f mempty $ getCommands tm
|
getCommandsHelp tm w = foldr f mempty $ getCommands tm
|
||||||
where
|
where
|
||||||
f tc = M.insert (_tcString tc)
|
f tc = M.insert (_tcString tc)
|
||||||
@@ -126,8 +104,7 @@ getCommands tm = _tmScrollCommands tm ++ _tmWriteCommands tm
|
|||||||
infoClearInput :: Terminal -> [TerminalLine] -> World -> World
|
infoClearInput :: Terminal -> [TerminalLine] -> World -> World
|
||||||
infoClearInput tm tls = terminals . ix (_tmID tm) %~
|
infoClearInput tm tls = terminals . ix (_tmID tm) %~
|
||||||
( (tmInput .~ TerminalInput T.empty True (0,0))
|
( (tmInput .~ TerminalInput T.empty True (0,0))
|
||||||
. (tmFutureLines ++.~ tls
|
. (tmFutureLines ++.~ tls)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
argumentHelp :: TerminalCommand -> Terminal -> World -> (String,Maybe [String])
|
argumentHelp :: TerminalCommand -> Terminal -> World -> (String,Maybe [String])
|
||||||
@@ -266,4 +243,3 @@ connectionBlurb1 =
|
|||||||
,TerminalLineDisplay 10 (const ("...",white))
|
,TerminalLineDisplay 10 (const ("...",white))
|
||||||
,TerminalLineDisplay 10 (const ("CONNECTED",white))
|
,TerminalLineDisplay 10 (const ("CONNECTED",white))
|
||||||
,TerminalLineTerminalEffect 0 (tmStatus .~ TerminalReady)]
|
,TerminalLineTerminalEffect 0 (tmStatus .~ TerminalReady)]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user