Add unsafe blink gun
This commit is contained in:
@@ -73,6 +73,7 @@ data CombineType
|
|||||||
| BOOSTER
|
| BOOSTER
|
||||||
| REWINDER
|
| REWINDER
|
||||||
| BLINKER
|
| BLINKER
|
||||||
|
| BLINKERUNSAFE
|
||||||
| FORCEFIELDGUN
|
| FORCEFIELDGUN
|
||||||
| SHRINKER
|
| SHRINKER
|
||||||
-- Equipment
|
-- Equipment
|
||||||
|
|||||||
+35
-29
@@ -163,35 +163,41 @@ startInvList :: [Item]
|
|||||||
startInvList = [ ]
|
startInvList = [ ]
|
||||||
startInventory :: IM.IntMap Item
|
startInventory :: IM.IntMap Item
|
||||||
startInventory = IM.fromList $ zip [0..] startInvList
|
startInventory = IM.fromList $ zip [0..] startInvList
|
||||||
inventoryA :: IM.IntMap Item
|
|
||||||
inventoryA = IM.fromList $ zip [0..]
|
inventoryX :: Char -> [Item]
|
||||||
[ clickDetector ITEMDETECTOR
|
inventoryX c = case c of
|
||||||
, makeTypeCraftNum 1 TRANSFORMER
|
'A' ->
|
||||||
, makeTypeCraftNum 2 CAN
|
[ clickDetector ITEMDETECTOR
|
||||||
, makeTypeCraftNum 2 PIPE
|
, makeTypeCraftNum 1 TRANSFORMER
|
||||||
]
|
, makeTypeCraftNum 2 CAN
|
||||||
inventoryB :: IM.IntMap Item
|
, makeTypeCraftNum 2 PIPE
|
||||||
inventoryB = IM.fromList $ zip [0..]
|
]
|
||||||
[ forceFieldGun
|
'B' ->
|
||||||
, wristArmour
|
[ forceFieldGun
|
||||||
, wristArmour
|
, wristArmour
|
||||||
, autoRifle
|
, wristArmour
|
||||||
, smg
|
, autoRifle
|
||||||
, machinePistol
|
, smg
|
||||||
, makeTypeCraftNum 4 MICROCHIP
|
, machinePistol
|
||||||
, makeTypeCraftNum 2 TIN
|
, makeTypeCraftNum 4 MICROCHIP
|
||||||
, makeTypeCraftNum 2 HARDWARE
|
, makeTypeCraftNum 2 TIN
|
||||||
, makeTypeCraftNum 2 CAN
|
, makeTypeCraftNum 2 HARDWARE
|
||||||
, makeTypeCraftNum 2 PIPE
|
, makeTypeCraftNum 2 CAN
|
||||||
, makeTypeCraftNum 1 CREATURESENSOR
|
, makeTypeCraftNum 2 PIPE
|
||||||
]
|
, makeTypeCraftNum 1 CREATURESENSOR
|
||||||
inventoryC :: IM.IntMap Item
|
]
|
||||||
inventoryC = IM.fromList $ zip [0..]
|
'C' ->
|
||||||
[ autoDetector CREATUREDETECTOR
|
[ autoDetector CREATUREDETECTOR
|
||||||
, autoDetector WALLDETECTOR
|
, autoDetector WALLDETECTOR
|
||||||
, autoDetector ITEMDETECTOR
|
, autoDetector ITEMDETECTOR
|
||||||
, wristInvisibility
|
, wristInvisibility
|
||||||
]
|
]
|
||||||
|
'D' ->
|
||||||
|
[ blinkGun
|
||||||
|
, unsafeBlinkGun
|
||||||
|
, autoDetector WALLDETECTOR
|
||||||
|
]
|
||||||
|
_ -> []
|
||||||
|
|
||||||
testInventory :: IM.IntMap Item
|
testInventory :: IM.IntMap Item
|
||||||
testInventory = IM.fromList $ zip [0..]
|
testInventory = IM.fromList $ zip [0..]
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ module Dodge.Creature.Action
|
|||||||
, dropExcept
|
, dropExcept
|
||||||
-- , startReloadingWeapon
|
-- , startReloadingWeapon
|
||||||
, blinkAction
|
, blinkAction
|
||||||
|
, unsafeBlinkAction
|
||||||
, sizeSelf
|
, sizeSelf
|
||||||
-- , crAutoReload
|
-- , crAutoReload
|
||||||
, copyInvItemToFloor
|
, copyInvItemToFloor
|
||||||
@@ -35,8 +36,8 @@ import Dodge.FloorItem
|
|||||||
import Geometry
|
import Geometry
|
||||||
import Picture
|
import Picture
|
||||||
import qualified IntMapHelp as IM
|
import qualified IntMapHelp as IM
|
||||||
|
import LensHelp
|
||||||
|
|
||||||
import Control.Lens
|
|
||||||
--import Control.Monad
|
--import Control.Monad
|
||||||
--import Control.Applicative
|
--import Control.Applicative
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
@@ -177,6 +178,33 @@ blinkAction cr w
|
|||||||
r = 1.5 * _crRad cr
|
r = 1.5 * _crRad cr
|
||||||
p3 = maybe p1 (mvPointTowardAtSpeed r cpos . fst) p2
|
p3 = maybe p1 (mvPointTowardAtSpeed r cpos . fst) p2
|
||||||
|
|
||||||
|
{- | Teleport a creature to the mouse position.
|
||||||
|
Can go through walls, if ending up in wall does big damage. -}
|
||||||
|
unsafeBlinkAction
|
||||||
|
:: Creature
|
||||||
|
-> World
|
||||||
|
-> World
|
||||||
|
unsafeBlinkAction cr w
|
||||||
|
| success = soundMultiFrom [TeleSound 0,TeleSound 1] mwp teleS Nothing
|
||||||
|
. over distortions (distortionBulge ++)
|
||||||
|
. set (creatures . ix cid . crPos) mwp
|
||||||
|
. blinkShockwave cid mwp
|
||||||
|
$ inverseShockwaveAt cpos 40 2 2 w
|
||||||
|
| otherwise = blinkAction cr w & creatures . ix cid . crState . crDamage .:~
|
||||||
|
Damage ENTERREMENT 10000 mwp mwp mwp NoDamageEffect
|
||||||
|
where
|
||||||
|
success = fromMaybe True $ do
|
||||||
|
(_,wl) <- collidePointWallsWall mwp cpos $ wallsAlongLine mwp cpos w
|
||||||
|
return (isLHS mwp `uncurry` _wlLine wl)
|
||||||
|
distR = 120
|
||||||
|
distortionBulge =
|
||||||
|
[RadialDistortion mwp (mwp +.+ V2 distR 0) (mwp +.+ V2 0 distR) 0.1
|
||||||
|
,RadialDistortion cpos (cpos +.+ V2 distR 0) (cpos +.+ V2 0 distR) 1.9
|
||||||
|
]
|
||||||
|
cid = _crID cr
|
||||||
|
mwp = mouseWorldPos w
|
||||||
|
cpos = _crPos cr
|
||||||
|
|
||||||
blinkShockwave
|
blinkShockwave
|
||||||
:: Int -- ^ Blinking creature ID.
|
:: Int -- ^ Blinking creature ID.
|
||||||
-> Point2
|
-> Point2
|
||||||
|
|||||||
@@ -410,10 +410,6 @@ data TerminalLine
|
|||||||
{_tlPause :: Int
|
{_tlPause :: Int
|
||||||
,_tlString :: World -> (String, Color)
|
,_tlString :: World -> (String, Color)
|
||||||
}
|
}
|
||||||
-- | TerminalLineChoice
|
|
||||||
-- {_tlPause :: Int
|
|
||||||
-- ,_tlOptions :: [(String,World -> World)]
|
|
||||||
-- }
|
|
||||||
| TerminalLineInput
|
| TerminalLineInput
|
||||||
{_tlPause :: Int
|
{_tlPause :: Int
|
||||||
,_tlScrollCommands :: [TerminalCommand]
|
,_tlScrollCommands :: [TerminalCommand]
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ data DamageType
|
|||||||
| TORQUEDAM
|
| TORQUEDAM
|
||||||
| PUSHDAM
|
| PUSHDAM
|
||||||
| POISONDAM
|
| POISONDAM
|
||||||
|
| ENTERREMENT
|
||||||
deriving (Eq,Ord,Show,Read)
|
deriving (Eq,Ord,Show,Read)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import Data.List --(isPrefixOf, isInfixOf, intercalate)
|
|||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
|
import qualified IntMapHelp as IM
|
||||||
--import qualified Debug.Trace
|
--import qualified Debug.Trace
|
||||||
--import Graphics.Rendering.OpenGL.GL.Shaders (validateProgram)
|
--import Graphics.Rendering.OpenGL.GL.Shaders (validateProgram)
|
||||||
--import Dodge.Data (Universe(Universe))
|
--import Dodge.Data (Universe(Universe))
|
||||||
@@ -22,18 +23,15 @@ applyTerminalString :: String -> Universe -> Universe
|
|||||||
applyTerminalString "NOCLIP" = config . debug_noclip %~ not
|
applyTerminalString "NOCLIP" = config . debug_noclip %~ not
|
||||||
applyTerminalString "LOADME" = (uvWorld . creatures . ix 0 . crInv .~ stackedInventory)
|
applyTerminalString "LOADME" = (uvWorld . creatures . ix 0 . crInv .~ stackedInventory)
|
||||||
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
||||||
applyTerminalString "LA" = (uvWorld . creatures . ix 0 . crInv .~ inventoryA)
|
applyTerminalString "LM" = applyTerminalString "LOADME"
|
||||||
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
applyTerminalString "LT" = applyTerminalString "LOADTEST"
|
||||||
applyTerminalString "LB" = (uvWorld . creatures . ix 0 . crInv .~ inventoryB)
|
applyTerminalString ['L',x] =
|
||||||
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
(uvWorld . creatures . ix 0 . crInv .~ IM.fromList (zip [0..] $ inventoryX x))
|
||||||
applyTerminalString "LC" = (uvWorld . creatures . ix 0 . crInv .~ inventoryC)
|
|
||||||
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
||||||
applyTerminalString "GODON" = uvWorld . creatures . ix 0 . crApplyDamage .~ applyNoDamage
|
applyTerminalString "GODON" = uvWorld . creatures . ix 0 . crApplyDamage .~ applyNoDamage
|
||||||
applyTerminalString "GODOFF" = uvWorld . creatures . ix 0 . crApplyDamage .~ defaultApplyDamage
|
applyTerminalString "GODOFF" = uvWorld . creatures . ix 0 . crApplyDamage .~ defaultApplyDamage
|
||||||
applyTerminalString "LOADTEST" = (uvWorld . creatures . ix 0 . crInv .~ testInventory)
|
applyTerminalString "LOADTEST" = (uvWorld . creatures . ix 0 . crInv .~ testInventory)
|
||||||
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
. (uvWorld . creatures . ix 0 . crInvCapacity .~ 50)
|
||||||
applyTerminalString "LM" = applyTerminalString "LOADME"
|
|
||||||
applyTerminalString "LT" = applyTerminalString "LOADTEST"
|
|
||||||
applyTerminalString ('s': 'e': 't': '_': 'h': 'p': ' ': hp)
|
applyTerminalString ('s': 'e': 't': '_': 'h': 'p': ' ': hp)
|
||||||
| isNothing (readMaybe hp :: Maybe Int) = id
|
| isNothing (readMaybe hp :: Maybe Int) = id
|
||||||
| otherwise = uvWorld . creatures . ix 0 . crHP .~ read hp
|
| otherwise = uvWorld . creatures . ix 0 . crHP .~ read hp
|
||||||
|
|||||||
@@ -104,18 +104,17 @@ blinkGun = defaultGun
|
|||||||
, _reloadTime = 20
|
, _reloadTime = 20
|
||||||
}
|
}
|
||||||
, _itUse = defaultlUse
|
, _itUse = defaultlUse
|
||||||
& lUse .~ hammerCheckL (shootL aSelfL)
|
& lUse .~ hammerCheckL (shootL $ const blinkAction)
|
||||||
& useHammer .~ upHammer
|
& useHammer .~ upHammer
|
||||||
& eqSite .~ GoesOnWrist
|
& eqSite .~ GoesOnWrist
|
||||||
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
|
-- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafeBlinkGun :: Item
|
||||||
aSelf :: Creature -> World -> World
|
unsafeBlinkGun = blinkGun
|
||||||
aSelf = blinkAction
|
& itName .~ "BLINKER-UNSAFE"
|
||||||
|
& itType .~ BLINKERUNSAFE
|
||||||
aSelfL :: Item -> Creature -> World -> World
|
& itUse . lUse .~ hammerCheckL (shootL $ const unsafeBlinkAction)
|
||||||
aSelfL _ = blinkAction
|
|
||||||
|
|
||||||
effectGun :: String -> (Creature -> World -> World) -> Item
|
effectGun :: String -> (Creature -> World -> World) -> Item
|
||||||
effectGun name eff = defaultGun
|
effectGun name eff = defaultGun
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import Dodge.Room.Link
|
|||||||
--import Dodge.Room.RoadBlock
|
--import Dodge.Room.RoadBlock
|
||||||
import Dodge.Placement.Instance
|
import Dodge.Placement.Instance
|
||||||
--import Dodge.Default.Room
|
--import Dodge.Default.Room
|
||||||
--import Dodge.Item.Weapon.BulletGuns
|
|
||||||
--import Dodge.Item.Weapon.Utility
|
--import Dodge.Item.Weapon.Utility
|
||||||
--import Dodge.LevelGen.Data
|
--import Dodge.LevelGen.Data
|
||||||
--import Geometry.Data
|
--import Geometry.Data
|
||||||
@@ -57,11 +56,6 @@ addWarningTerminal outplid = (rmName .++~ "warningTerm-")
|
|||||||
termMessages trid _ = defaultTermParams & addInputLine
|
termMessages trid _ = defaultTermParams & addInputLine
|
||||||
[unlockCommand trid,quitCommand]
|
[unlockCommand trid,quitCommand]
|
||||||
[helpCommand,infoCommand theinfo,commandsCommand]
|
[helpCommand,infoCommand theinfo,commandsCommand]
|
||||||
--termMessages trid = ops trid (genTermMessage $ const ["OPEN DOOR?"])
|
|
||||||
--ops trid f gw w = f gw w & termFutureLines ++.~ [ TerminalLineInput 0
|
|
||||||
-- [unlockCommand trid,quitCommand,damageCodeCommand]
|
|
||||||
-- [helpCommand,infoCommand theinfo,commandsCommand]
|
|
||||||
-- ]
|
|
||||||
unlockCommand trid = singleCommand "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
|
unlockCommand trid = singleCommand "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
|
||||||
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
||||||
theinfo = "DOOR CONTROLABLE WITH THE \"OPEN\" COMMAND. THIS TERMINAL CANNOT CLOSE THE DOOR."
|
theinfo = "DOOR CONTROLABLE WITH THE \"OPEN\" COMMAND. THIS TERMINAL CANNOT CLOSE THE DOOR."
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ damageBlockWith dm = case _dmType dm of
|
|||||||
TORQUEDAM -> id
|
TORQUEDAM -> id
|
||||||
PUSHDAM -> id
|
PUSHDAM -> id
|
||||||
POISONDAM -> id
|
POISONDAM -> id
|
||||||
|
ENTERREMENT -> id
|
||||||
where
|
where
|
||||||
dam = _dmAmount dm
|
dam = _dmAmount dm
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ defaultWallDamage dm wl = wallDamageEffect dm wl . case _dmType dm of
|
|||||||
TORQUEDAM -> id
|
TORQUEDAM -> id
|
||||||
PUSHDAM -> id
|
PUSHDAM -> id
|
||||||
POISONDAM -> id
|
POISONDAM -> id
|
||||||
|
ENTERREMENT -> id
|
||||||
where
|
where
|
||||||
sp = _dmFrom dm
|
sp = _dmFrom dm
|
||||||
p = _dmAt dm
|
p = _dmAt dm
|
||||||
|
|||||||
Reference in New Issue
Block a user