Tweak twisting when aiming

This commit is contained in:
2021-12-05 16:54:08 +00:00
parent d9c5cfc26d
commit 22e3256da3
30 changed files with 350 additions and 252 deletions
+2 -3
View File
@@ -82,15 +82,14 @@ itemsMultisets = map mconcat . mapM itemMultisets
-- "individual" items can produce multiple multisets if they are in fact -- "individual" items can produce multiple multisets if they are in fact
-- a stack of more than one item -- a stack of more than one item
itemMultisets :: (Int,Item) -> [([Int],M.Map CombineType Int)] itemMultisets :: (Int,Item) -> [([Int],M.Map CombineType Int)]
itemMultisets (i,it) = case it ^? itConsumption . itAmount' of itemMultisets (i,it) = case it ^? itConsumption . itAmount of
Nothing -> [ ([i], M.singleton thetype 1 ) ] Nothing -> [ ([i], M.singleton thetype 1 ) ]
Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n] Just n -> map (\k -> (replicate k i, M.singleton thetype k)) [1..n]
where where
thetype = _itType it thetype = _itType it
itemTypeAmounts :: Item -> [[CombineType]] itemTypeAmounts :: Item -> [[CombineType]]
itemTypeAmounts it = case it ^? itConsumption . itAmount' of itemTypeAmounts it = case it ^? itConsumption . itAmount of
Nothing -> [[thetype]] Nothing -> [[thetype]]
Just i -> map (`replicate` thetype) [1 .. i] Just i -> map (`replicate` thetype) [1 .. i]
where where
+2 -2
View File
@@ -13,7 +13,7 @@ module Dodge.Creature
where where
--import Dodge.Creature.Stance.Data --import Dodge.Creature.Stance.Data
import Dodge.Creature.State.Data import Dodge.Creature.State.Data
import Dodge.Item.Weapon.Grenade --import Dodge.Item.Weapon.Grenade
import Dodge.Item.Weapon.Booster import Dodge.Item.Weapon.Booster
import Dodge.Item.Weapon.Utility import Dodge.Item.Weapon.Utility
import Dodge.Item.Weapon.Drone import Dodge.Item.Weapon.Drone
@@ -197,7 +197,7 @@ stackedInventory = IM.fromList $ zip [0..]
,boosterGun ,boosterGun
,remoteLauncher ,remoteLauncher
,flatShield ,flatShield
,grenade -- ,grenade
,spawnGun (lamp 5) ,spawnGun (lamp 5)
,lasGun ,lasGun
,flamer ,flamer
+6
View File
@@ -0,0 +1,6 @@
module Dodge.Creature.HandPos where
import Dodge.Data
import Geometry
crHandPos :: Creature -> Point3
crHandPos cr = V3 0 0 20
-1
View File
@@ -85,7 +85,6 @@ creatureDisplayText cfig w cr
a = argV v - 0.5 * pi a = argV v - 0.5 * pi
(V2 x y) = campos +.+ v +.+ _crRad cr *.* normalizeV v (V2 x y) = campos +.+ v +.+ _crRad cr *.* normalizeV v
crDisplayAlert :: Creature -> String crDisplayAlert :: Creature -> String
crDisplayAlert cr crDisplayAlert cr
| isSuspicious = "?" | isSuspicious = "?"
+16 -2
View File
@@ -32,9 +32,22 @@ wasdWithAiming
-> Creature -> Creature
-> Creature -> Creature
wasdWithAiming w speed i cr wasdWithAiming w speed i cr
| isAiming = set crDir mouseDir $ theMovement cr | isAiming
| otherwise = theMovement $ theTurn cr = addAnyTwist $ set crDir mouseDir $ theMovement cr
| (isReloading && SDL.ButtonRight `S.member` _mouseButtons w)
= addAnyTwist $ set crDir (mouseDir + anytwist) $ theMovement cr
| otherwise = theMovement $ theTurn $ removeTwist cr
where where
twistamount = 1.6
removeTwist cr' = case _crTwist cr' of
t -> cr' & crDir +~ t & crTwist .~ 0
anytwist = case cr ^? crInv . ix (_crInvSel (_creatures w IM.! i)) . itUse . useAim . aimStance of
Just TwoHandTwist -> twistamount * pi
_ -> 0
addAnyTwist cr'
= case cr' ^? crInv . ix (_crInvSel (_creatures w IM.! i)) . itUse . useAim . aimStance of
Just TwoHandTwist -> cr' & crTwist .~ twistamount * pi
_ -> cr'
theMovement theMovement
| movDir == V2 0 0 = id | movDir == V2 0 0 = id
| otherwise = crMvAbsolute (speed *.* movAbs) . set crMvDir dir | otherwise = crMvAbsolute (speed *.* movAbs) . set crMvDir dir
@@ -43,6 +56,7 @@ wasdWithAiming w speed i cr
dir = _cameraRot w + argV movDir dir = _cameraRot w + argV movDir
movAbs = rotateV (_cameraRot w) $ normalizeV movDir movAbs = rotateV (_cameraRot w) $ normalizeV movDir
isAiming = _posture (_crStance cr) == Aiming isAiming = _posture (_crStance cr) == Aiming
isReloading = _posture (_crStance cr) == Reloading
mouseDir = case w ^? creatures . ix i . crInv . ix (_crInvSel (_creatures w IM.! i)) mouseDir = case w ^? creatures . ix i . crInv . ix (_crInvSel (_creatures w IM.! i))
. itAttachment of . itAttachment of
Just ItScope{_scopePos = p} -> normalizeAngle $ argV Just ItScope{_scopePos = p} -> normalizeAngle $ argV
+49 -43
View File
@@ -219,6 +219,7 @@ data Creature = Creature
, _crDir :: Float , _crDir :: Float
, _crOldDir :: Float , _crOldDir :: Float
, _crMvDir :: Float , _crMvDir :: Float
, _crTwist :: Float
, _crID :: Int , _crID :: Int
, _crPict :: Creature -> Configuration -> World -> SPic , _crPict :: Creature -> Configuration -> World -> SPic
, _crUpdate :: Creature -> World -> (Endo World, Maybe Creature) , _crUpdate :: Creature -> World -> (Endo World, Maybe Creature)
@@ -329,7 +330,7 @@ data ItemConsumption
, _wpCharge :: Int , _wpCharge :: Int
} }
| ItemItselfConsumable | ItemItselfConsumable
{ _itAmount' :: Int { _itAmount :: Int
} }
| NoConsumption | NoConsumption
data Item data Item
@@ -337,7 +338,6 @@ data Item
{ _itName :: String { _itName :: String
, _itConsumption :: ItemConsumption , _itConsumption :: ItemConsumption
, _itUse :: ItemUse , _itUse :: ItemUse
, _itFloorPict :: Item -> SPic
, _itEquipPict :: Creature -> Int -> SPic , _itEquipPict :: Creature -> Int -> SPic
, _itScroll :: Float -> Creature -> Item -> Item , _itScroll :: Float -> Creature -> Item -> Item
, _itType :: CombineType , _itType :: CombineType
@@ -353,52 +353,57 @@ data Item
, _itParams :: ItemParams , _itParams :: ItemParams
, _itTweaks :: ItemTweaks , _itTweaks :: ItemTweaks
} }
| Equipment -- | Equipment
{ _itName :: String -- { _itName :: String
, _itFloorPict :: Item -> SPic -- , _itFloorPict :: Item -> SPic
, _itEquipPict :: Creature -> Int -> SPic -- , _itEquipPict :: Creature -> Int -> SPic
-- , _itIdentity :: ItemIdentity ---- , _itIdentity :: ItemIdentity
, _itEffect :: ItEffect -- , _itEffect :: ItEffect
, _itID :: Maybe Int -- , _itID :: Maybe Int
, _itType :: CombineType -- , _itType :: CombineType
, _itZoom :: ItZoom
, _itInvSize :: Float
, _itInvDisplay :: Item -> [String]
, _itInvColor :: Color
, _itCurseStatus :: CurseStatus
, _itDimension :: ItemDimension
}
| Throwable
{ _itName :: String
, _itMaxStack :: Int
-- , _itAmount :: Int
, _itFloorPict :: Item -> SPic
, _twMaxRange :: Float
, _twAccuracy :: Float
, _itUse :: ItemUse
-- , _itZoom :: ItZoom -- , _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> SPic -- , _itInvSize :: Float
--, _itIdentity :: ItemIdentity -- , _itInvDisplay :: Item -> [String]
, _itID :: Maybe Int -- , _itInvColor :: Color
, _itAttachment :: ItAttachment -- , _itCurseStatus :: CurseStatus
, _itType :: CombineType -- , _itDimension :: ItemDimension
, _itInvSize :: Float -- }
, _itInvDisplay :: Item -> [String] -- | Throwable
, _itInvColor :: Color -- { _itName :: String
, _itEffect :: ItEffect -- , _itMaxStack :: Int
, _itScroll :: Float -> Creature -> Item -> Item ---- , _itAmount :: Int
, _itCurseStatus :: CurseStatus -- , _itFloorPict :: Item -> SPic
, _itDimension :: ItemDimension -- , _twMaxRange :: Float
} -- , _twAccuracy :: Float
-- , _itUse :: ItemUse
---- , _itZoom :: ItZoom
-- , _itEquipPict :: Creature -> Int -> SPic
-- --, _itIdentity :: ItemIdentity
-- , _itID :: Maybe Int
-- , _itAttachment :: ItAttachment
-- , _itType :: CombineType
-- , _itInvSize :: Float
-- , _itInvDisplay :: Item -> [String]
-- , _itInvColor :: Color
-- , _itEffect :: ItEffect
-- , _itScroll :: Float -> Creature -> Item -> Item
-- , _itCurseStatus :: CurseStatus
-- , _itDimension :: ItemDimension
-- }
-- | NoItem -- | NoItem
data ItemDimension = ItemDimension data ItemDimension = ItemDimension
{ _itDim :: Point3 -- length width height { _dimRad :: Float
, _itRad :: Float , _dimCenter :: Point3
, _itHandle :: Point3 , _dimPortage :: ItemPortage
, _itCenter :: Point3 , _dimSPic :: Item -> SPic
, _muzzleLength :: Float
} }
data ItemPortage
= HeldItem
{ _handlePos :: Float
, _muzPos :: Float
}
| WornItem
data ReloadType data ReloadType
= ActiveClear = ActiveClear
@@ -913,3 +918,4 @@ makeLenses ''ItemParams
makeLenses ''ItemTweaks makeLenses ''ItemTweaks
makeLenses ''Maybe' makeLenses ''Maybe'
makeLenses ''InventoryMode makeLenses ''InventoryMode
makeLenses ''ItemPortage
+13 -8
View File
@@ -28,6 +28,7 @@ defaultCreature = Creature
, _crDir = 0 , _crDir = 0
, _crOldDir = 0 , _crOldDir = 0
, _crMvDir = 0 , _crMvDir = 0
, _crTwist = 0
, _crID = 1 , _crID = 1
, _crPict = \_ _ _ -> (,) mempty blank , _crPict = \_ _ _ -> (,) mempty blank
, _crUpdate = \cr _ -> (Endo id , Just cr) , _crUpdate = \cr _ -> (Endo id , Just cr)
@@ -131,20 +132,25 @@ defaultState = CrSt
, _crDropsOnDeath = DropAll , _crDropsOnDeath = DropAll
} }
defaultEquipment :: Item defaultEquipment :: Item
defaultEquipment = Equipment defaultEquipment = Item
{ _itCurseStatus = Uncursed { _itCurseStatus = Uncursed
, _itType = NOTDEFINED , _itType = NOTDEFINED
, _itName = "genericEquipment" , _itName = "genericEquipment"
-- ,_itIdentity = Generic -- ,_itIdentity = Generic
, _itFloorPict = \_ -> noShape $ setLayer 0 $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itID = Nothing , _itID = Nothing
, _itZoom = defaultItZoom
, _itInvColor = yellow , _itInvColor = yellow
, _itInvDisplay = \it -> [_itName it] , _itInvDisplay = \it -> [_itName it]
, _itInvSize = 1 , _itInvSize = 1
, _itDimension = defaultItemDimension , _itDimension = defItDimCol yellow
, _itConsumption = NoConsumption
, _itUse = NoUse
, _itScroll = \ _ _ -> id
, _itAttachment = NoItAttachment
, _itParams = NoParams
, _itTweaks = NoTweaks
, _itTargeting = Nothing
} }
defaultItZoom :: ItZoom defaultItZoom :: ItZoom
defaultItZoom = ItZoom 20 0.2 1 defaultItZoom = ItZoom 20 0.2 1
@@ -155,19 +161,18 @@ defaultConsumable = Item
, _itInvSize = 1 , _itInvSize = 1
, _itCurseStatus = Uncursed , _itCurseStatus = Uncursed
, _itName = "genericConsumable" , _itName = "genericConsumable"
, _itConsumption = ItemItselfConsumable {_itAmount' = 1} , _itConsumption = ItemItselfConsumable {_itAmount = 1}
, _itFloorPict = \_ -> noShape $ onLayer FlItLayer $ color blue $ circleSolid 3
, _itEquipPict = \_ _ -> mempty , _itEquipPict = \_ _ -> mempty
, _itID = Nothing , _itID = Nothing
, _itInvColor = blue , _itInvColor = blue
, _itInvDisplay = \it -> [_itName it ++ " x" ++ show (_itAmount' $ _itConsumption it)] , _itInvDisplay = \it -> [_itName it ++ " x" ++ show (_itAmount $ _itConsumption it)]
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itScroll = \_ _ -> id , _itScroll = \_ _ -> id
, _itAttachment = NoItAttachment , _itAttachment = NoItAttachment
, _itType = NoCombineType , _itType = NoCombineType
, _itTargeting = Nothing , _itTargeting = Nothing
, _itParams = NoParams , _itParams = NoParams
, _itDimension = defaultItemDimension , _itDimension = defItDimCol blue
, _itTweaks = NoTweaks , _itTweaks = NoTweaks
} }
defaultApplyDamage :: [DamageType] -> Creature -> (World -> World, Creature) defaultApplyDamage :: [DamageType] -> Creature -> (World -> World, Creature)
+21 -19
View File
@@ -86,14 +86,9 @@ defaultGun = Item
{ _itName = "default" { _itName = "default"
, _itType = NoCombineType , _itType = NoCombineType
, _itCurseStatus = Uncursed , _itCurseStatus = Uncursed
-- , _itIdentity = Pistol
, _itConsumption = defaultAmmo , _itConsumption = defaultAmmo
, _itUse = defaultrUse , _itUse = defaultrUse
, _itFloorPict = const $ noPic $ colorSH green (prismPoly , _itDimension = defItDimCol white
(map (addZ 3) $ rectNESW 3 3 (-3) (-3))
(map (addZ 0) $ rectNESW 5 3 (-5) (-7))
)
-- , _itZoom = ItZoom 20 0.2 1
, _itEquipPict = pictureWeaponOnAim , _itEquipPict = pictureWeaponOnAim
, _itScroll = \_ _ -> id , _itScroll = \_ _ -> id
, _itAttachment = NoItAttachment , _itAttachment = NoItAttachment
@@ -104,7 +99,6 @@ defaultGun = Item
, _itInvSize = 1 , _itInvSize = 1
, _itTargeting = Nothing , _itTargeting = Nothing
, _itParams = NoParams , _itParams = NoParams
, _itDimension = defaultItemDimension
, _itTweaks = NoTweaks , _itTweaks = NoTweaks
} }
defaultCraftable :: Item defaultCraftable :: Item
@@ -115,10 +109,6 @@ defaultCraftable = Item
-- , _itIdentity = Generic -- , _itIdentity = Generic
, _itConsumption = NoConsumption , _itConsumption = NoConsumption
, _itUse = NoUse , _itUse = NoUse
, _itFloorPict = const $ noPic $ colorSH green (prismPoly
(map (addZ 3) $ rectNESW 3 3 (-3) (-3))
(map (addZ 0) $ rectNESW 5 3 (-5) (-7))
)
-- , _itZoom = ItZoom 20 0.2 1 -- , _itZoom = ItZoom 20 0.2 1
, _itEquipPict = pictureWeaponOnAim , _itEquipPict = pictureWeaponOnAim
, _itScroll = \_ _ -> id , _itScroll = \_ _ -> id
@@ -130,16 +120,28 @@ defaultCraftable = Item
, _itInvSize = 1 , _itInvSize = 1
, _itTargeting = Nothing , _itTargeting = Nothing
, _itParams = NoParams , _itParams = NoParams
, _itDimension = defaultItemDimension , _itDimension = defItDimCol green
, _itTweaks = NoTweaks , _itTweaks = NoTweaks
} }
defaultItemDimension :: ItemDimension defItDim :: ItemDimension
defaultItemDimension = ItemDimension defItDim = ItemDimension
{ _itDim = V3 4 4 4 { _dimRad = 2
, _itRad = 10 , _dimCenter = V3 0 0 0
, _itHandle = V3 2 2 2 , _dimPortage = HeldItem
, _itCenter = V3 2 2 2 { _handlePos = 0
, _muzzleLength = 5 -- how much the item projects out from the cr radius when aiming , _muzPos = 0
}
, _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ square 4
}
defItDimCol :: Color -> ItemDimension
defItDimCol col = ItemDimension
{ _dimRad = 2
, _dimCenter = V3 0 0 0
, _dimPortage = HeldItem
{ _handlePos = 0
, _muzPos = 0
}
, _dimSPic = const $ noPic $ colorSH col $ upperPrismPoly 3 $ square 4
} }
defaultAutoGun :: Item defaultAutoGun :: Item
+2 -2
View File
@@ -21,14 +21,14 @@ copyItemToFloorID pos it w = (,) flid $ w'
& floorItems %~ IM.insert flid theflit & floorItems %~ IM.insert flid theflit
& updateLocation & updateLocation
where where
(p',w') = findWallFreeDropPoint (_itRad $ _itDimension it) pos w (p',w') = findWallFreeDropPoint (_dimRad $ _itDimension it) pos w
rot = fst . randomR (-pi,pi) $ _randGen w rot = fst . randomR (-pi,pi) $ _randGen w
updateLocation = case it ^? itID of updateLocation = case it ^? itID of
Just (Just i') -> itemPositions . ix i' .~ OnFloor flid Just (Just i') -> itemPositions . ix i' .~ OnFloor flid
_ -> id _ -> id
flid = IM.newKey $ _floorItems w flid = IM.newKey $ _floorItems w
theflit = FlIt theflit = FlIt
{_flIt = it & itConsumption . itAmount' %~ const 1 {_flIt = it & itConsumption . itAmount %~ const 1
,_flItPos = p' ,_flItPos = p'
,_flItRot = rot ,_flItRot = rot
,_flItID = flid ,_flItID = flid
+2 -2
View File
@@ -46,8 +46,8 @@ import Control.Lens
rmInvItem :: Int -- ^ Creature id rmInvItem :: Int -- ^ Creature id
-> Int -- ^ Inventory position -> Int -- ^ Inventory position
-> World -> World -> World -> World
rmInvItem cid invid w = case w ^? creatures . ix cid . crInv . ix invid . itConsumption . itAmount' of rmInvItem cid invid w = case w ^? creatures . ix cid . crInv . ix invid . itConsumption . itAmount of
Just x | x > 1 -> w & creatures . ix cid . crInv . ix invid . itConsumption . itAmount' %~ subtract 1 Just x | x > 1 -> w & creatures . ix cid . crInv . ix invid . itConsumption . itAmount %~ subtract 1
_ -> w & creatures . ix cid . crInv %~ f _ -> w & creatures . ix cid . crInv %~ f
& creatures . ix cid . crInvSel %~ g & creatures . ix cid . crInvSel %~ g
& creatures . ix cid . crLeftInvSel . _Just %~ g & creatures . ix cid . crLeftInvSel . _Just %~ g
+1 -1
View File
@@ -11,7 +11,7 @@ putItemInInvID cid flid w = fromMaybe w
$ tryPutItemInInv cid (_floorItems w IM.! flid) w $ tryPutItemInInv cid (_floorItems w IM.! flid) w
putItemInInvSlot :: Int -> Item -> IM.IntMap Item -> IM.IntMap Item putItemInInvSlot :: Int -> Item -> IM.IntMap Item -> IM.IntMap Item
putItemInInvSlot = IM.insertWith (const $ itConsumption . itAmount' +~ 1) putItemInInvSlot = IM.insertWith (const $ itConsumption . itAmount +~ 1)
{- | Pick up a specific item. -} {- | Pick up a specific item. -}
tryPutItemInInv :: Int -> FloorItem -> World -> Maybe World tryPutItemInInv :: Int -> FloorItem -> World -> Maybe World
+1 -1
View File
@@ -4,6 +4,6 @@ import Dodge.Data
import Control.Lens import Control.Lens
itSlotsTaken :: Item -> Int itSlotsTaken :: Item -> Int
itSlotsTaken it = case it ^? itConsumption . itAmount' of itSlotsTaken it = case it ^? itConsumption . itAmount of
Nothing -> ceiling (_itInvSize it) Nothing -> ceiling (_itInvSize it)
Just i -> ceiling (_itInvSize it * fromIntegral i) Just i -> ceiling (_itInvSize it * fromIntegral i)
-4
View File
@@ -12,8 +12,6 @@ keyToken :: Int -> Item
keyToken n = defaultEquipment keyToken n = defaultEquipment
{ _itType = NOTDEFINED { _itType = NOTDEFINED
, _itName = "KEYTOKEN "++show n , _itName = "KEYTOKEN "++show n
, _itMaxStack = 5
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 keyPic
, _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic , _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itID = Nothing , _itID = Nothing
@@ -32,8 +30,6 @@ latchkey :: Int -> Item
latchkey n = defaultEquipment latchkey n = defaultEquipment
{ _itType = NOTDEFINED { _itType = NOTDEFINED
, _itName = "KEY "++show n , _itName = "KEY "++show n
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ setDepth 0.5 latchkeyPic
, _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic , _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itID = Nothing , _itID = Nothing
-1
View File
@@ -21,7 +21,6 @@ medkit i = defaultConsumable
,_useDelay = NoDelay ,_useDelay = NoDelay
,_useHammer = HasHammer HammerUp ,_useHammer = HasHammer HammerUp
} }
, _itFloorPict = \_ -> (,) emptySH $ setLayer 0 . onLayer FlItLayer . color blue $ circleSolid 3
, _itEquipPict = pictureItem $ (,) emptySH $ color blue $ circleSolid 3 , _itEquipPict = pictureItem $ (,) emptySH $ color blue $ circleSolid 3
, _itID = Nothing , _itID = Nothing
} }
+15 -7
View File
@@ -7,14 +7,17 @@ import ShapePicture
import qualified Data.IntMap.Strict as IM import qualified Data.IntMap.Strict as IM
import Control.Lens import Control.Lens
import Data.Maybe
pictureWeaponOnAim pictureWeaponOnAim
:: Creature :: Creature
-> Int -- ^ Position of item in inventory -> Int -- ^ Position of item in inventory
-> SPic -> SPic
pictureWeaponOnAim cr i = pictureWeaponOnAimItem pic cr i pictureWeaponOnAim cr i = pictureWeaponOnAimItem (itSPic it) cr i
where where
it = _crInv cr IM.! i it = _crInv cr IM.! i
pic = _itFloorPict it it
itSPic :: Item -> SPic
itSPic it = _dimSPic (_itDimension it) it
pictureWeaponOnAim' pictureWeaponOnAim'
:: (Item -> SPic) :: (Item -> SPic)
@@ -40,7 +43,7 @@ pictureWeaponOnAimItem
-> Creature -> Creature
-> Int -- ^ Position of item in inventory -> Int -- ^ Position of item in inventory
-> SPic -> SPic
pictureWeaponOnAimItem p cr posInInv pictureWeaponOnAimItem p' cr posInInv
| isSelected && _posture (_crStance cr) == Aiming && isTwisting | isSelected && _posture (_crStance cr) == Aiming && isTwisting
= shoulderD twistWep = shoulderD twistWep
| isSelected && _posture (_crStance cr) == Aiming && isOneHand | isSelected && _posture (_crStance cr) == Aiming && isOneHand
@@ -59,15 +62,20 @@ pictureWeaponOnAimItem p cr posInInv
handD = translateSPz 15 handD = translateSPz 15
isSelected = _crInvSel cr == posInInv isSelected = _crInvSel cr == posInInv
drawnWep = translateSPf (1.2 * _crRad cr) 0 p drawnWep = translateSPf (1.2 * _crRad cr) 0 p
twistWep = translateSPf (0.5 * _crRad cr) 0 p twistWep = translateSPf (-5) 0 p
oneHandWep = translateSPf (1.5 * _crRad cr) 0 p oneHandWep = translateSPf 14 0 p
holsteredWep = translateSPf (_crRad cr) 0 (rotateSP (strideRot cr + 1.2) p) holsteredWep = translateSPf (_crRad cr) 0
(rotateSP (strideRot cr + 1.2) (translateSPf (-5) 0 twistWep))
holsteredTwoFlat = translateSPf (_crRad cr) 0 (rotateSP (twoFlatHRot cr) p) holsteredTwoFlat = translateSPf (_crRad cr) 0 (rotateSP (twoFlatHRot cr) p)
holsteredOneHandWep = translateSPf (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7) p holsteredOneHandWep = translateSPf (_crRad cr * 0.7 + handPos) (_crRad cr * negate 0.7)
(translateSPf (-2) 0 p)
handPos = case cr^? crStance . carriage of handPos = case cr^? crStance . carriage of
Just (Walking x LeftForward) -> f x * 50 Just (Walking x LeftForward) -> f x * 50
_ -> 0 _ -> 0
theIt = _crInv cr IM.! posInInv theIt = _crInv cr IM.! posInInv
p = fromMaybe p' $ do
x <- theIt ^? itDimension . dimPortage . handlePos
return $translateSPf (-x) 0 p'
isTwisting = theIt ^? itUseAimStance == Just TwoHandTwist isTwisting = theIt ^? itUseAimStance == Just TwoHandTwist
isOneHand = theIt ^? itUseAimStance == Just OneHand isOneHand = theIt ^? itUseAimStance == Just OneHand
isTwoHandFlat = theIt ^? itUseAimStance == Just TwoHandFlat isTwoHandFlat = theIt ^? itUseAimStance == Just TwoHandFlat
+4 -7
View File
@@ -20,7 +20,6 @@ magShield :: Item
magShield = defaultEquipment magShield = defaultEquipment
{ _itType = MAGSHIELD { _itType = MAGSHIELD
, _itName = "MAGSHIELD" , _itName = "MAGSHIELD"
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itID = Nothing , _itID = Nothing
} }
@@ -28,7 +27,6 @@ flameShield :: Item
flameShield = defaultEquipment flameShield = defaultEquipment
{ _itType = FLAMESHIELD { _itType = FLAMESHIELD
, _itName = "FLAMESHIELD" , _itName = "FLAMESHIELD"
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \cr _ -> (,) emptySH $ onLayer CrLayer $ pictures [color cyan $ circle (_crRad cr+2)] , _itEquipPict = \cr _ -> (,) emptySH $ onLayer CrLayer $ pictures [color cyan $ circle (_crRad cr+2)]
, _itID = Nothing , _itID = Nothing
} }
@@ -37,10 +35,10 @@ frontArmour :: Item
frontArmour = defaultEquipment frontArmour = defaultEquipment
{ _itType = FRONTARMOUR { _itType = FRONTARMOUR
, _itName = "FARMOUR" , _itName = "FARMOUR"
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures -- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ translate 0 (-5) $ pictures
[color (greyN 0.1) $ thickArc 0 (pi/2) 10 5 -- [color (greyN 0.1) $ thickArc 0 (pi/2) 10 5
,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5 -- ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5
] -- ]
, _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer $ pictures , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer $ pictures
[color (greyN 0.1) $ thickArc 0 (pi/2) 10 5 [color (greyN 0.1) $ thickArc 0 (pi/2) 10 5
,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5 ,color (greyN 0.1) $ thickArc (3*pi/2) (2*pi) 10 5
@@ -133,7 +131,6 @@ jetPack :: Item
jetPack = defaultEquipment jetPack = defaultEquipment
{ _itType = JETPACK { _itType = JETPACK
, _itName = "JETPACK" , _itName = "JETPACK"
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer , _itEquipPict = \_ _ -> (,) emptySH $ onLayer CrLayer
$ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ] $ pictures [color yellow $ polygon $ rectNSEW 5 (-5) (-3) (-11) ]
, _itEffect = NoItEffect , _itEffect = NoItEffect
+29 -23
View File
@@ -37,7 +37,6 @@ teslaGun :: Item
teslaGun = defaultGun teslaGun = defaultGun
{ _itName = "TESLA" { _itName = "TESLA"
, _itType = TESLAGUN , _itType = TESLAGUN
-- , _itIdentity = TeslaGun
, _itConsumption = defaultAmmo , _itConsumption = defaultAmmo
{ _ammoMax = 200 { _ammoMax = 200
, _ammoLoaded = 200 , _ammoLoaded = 200
@@ -51,16 +50,23 @@ teslaGun = defaultGun
] ]
& useAim . aimSpeed .~ 0.4 & useAim . aimSpeed .~ 0.4
& useAim . aimStance .~ TwoHandFlat & useAim . aimStance .~ TwoHandFlat
, _itFloorPict = teslaGunPic , _itDimension = ItemDimension
{ _dimRad = 9
, _dimCenter = V3 4 0 0
, _dimPortage = HeldItem
{_handlePos = 4
,_muzPos = 4
}
, _dimSPic = teslaGunPic
}
} }
teslaGunPic :: Item -> SPic teslaGunPic :: Item -> SPic
teslaGunPic _ = noPic $ colorSH blue $ teslaGunPic _ = noPic $ colorSH blue $
upperPrismPoly 5 (rectNESW xb y xa (-y)) upperPrismPoly 5 (rectNESW xb 8 xa 0)
++ upperPrismPoly 5 (rectNESW (-xa) y (-xb) (-y)) ++ upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0)
where where
xa = 1 xa = 1
xb = 9 xb = 9
y = 4
lasGun :: Item lasGun :: Item
lasGun = defaultAutoGun lasGun = defaultAutoGun
{ _itName = "LASGUN ////" { _itName = "LASGUN ////"
@@ -79,13 +85,29 @@ lasGun = defaultAutoGun
& useAim . aimSpeed .~ 0.4 & useAim . aimSpeed .~ 0.4
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = lasGunPic
, _itParams = Refracting {_phaseV = 1} , _itParams = Refracting {_phaseV = 1}
, _itTweaks = Tweakable , _itTweaks = Tweakable
{ _tweakParams = IM.fromList [(0,lasGunTweak)] { _tweakParams = IM.fromList [(0,lasGunTweak)]
, _tweakSel = 0 , _tweakSel = 0
} }
, _itDimension = ItemDimension
{ _dimRad = 10
, _dimCenter = V3 15 0 0
, _dimPortage = HeldItem 5 30
, _dimSPic = lasGunPic
} }
}
lasGunPic :: Item -> SPic
lasGunPic it =
( colorSH blue $
upperPrismPoly 4 (rectNESW 3 30 1 0)
<> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0)
<> upperPrismPoly 1 (rectNESW 3 30 (-3) 0)
, setLayer 1 . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0
)
where
amFrac = fractionLoadedAmmo it
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
lasGunTweak :: TweakParam lasGunTweak :: TweakParam
lasGunTweak = TweakParam lasGunTweak = TweakParam
{ _doTweak = thetweak { _doTweak = thetweak
@@ -104,21 +126,9 @@ lasGunTweak = TweakParam
showPhaseV 2 = "Z" showPhaseV 2 = "Z"
showPhaseV i = "THIS SHOULD NOT BE POSSIBLE" ++ show i showPhaseV i = "THIS SHOULD NOT BE POSSIBLE" ++ show i
lasGunPic :: Item -> SPic
lasGunPic it =
( colorSH blue $
upperPrismPoly 4 (rectNESW 3 15 1 (-15))
<> upperPrismPoly 4 (rectNESW (-1) 15 (-3) (-15))
-- <> (upperPrismPoly 4 $ rectNESW (5) l (-5) (l-2))
<> upperPrismPoly 1 (rectNESW 3 15 (-3) (-15))
, setLayer 1 . color col . setDepth 1.1 . polygon $ rectNESW 1 15 (-1) (-15)
)
where
amFrac = fractionLoadedAmmo it
col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red
tractorGun :: Item tractorGun :: Item
tractorGun = defaultAutoGun tractorGun = lasGun
{ _itName = "TRACTORGUN" { _itName = "TRACTORGUN"
, _itType = TRACTORGUN , _itType = TRACTORGUN
, _itConsumption = defaultAmmo , _itConsumption = defaultAmmo
@@ -132,11 +142,7 @@ tractorGun = defaultAutoGun
& useAim . aimSpeed .~ 0.4 & useAim . aimSpeed .~ 0.4
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = tractorGunSPic
} }
-- TODO own picture for tractor gun
tractorGunSPic :: Item -> SPic
tractorGunSPic = lasGunPic
aTeslaArc :: Creature -> World -> World aTeslaArc :: Creature -> World -> World
aTeslaArc cr w = set randGen g w aTeslaArc cr w = set randGen g w
+1 -1
View File
@@ -37,7 +37,7 @@ bezierGun = defaultGun
& useAim . aimRange .~ 0 & useAim . aimRange .~ 0
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
-- & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} -- & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = bezierGunSPic -- , _itFloorPict = bezierGunSPic
, _itAttachment = NoItAttachment , _itAttachment = NoItAttachment
, _itScroll = \_ _ -> removeItTarget , _itScroll = \_ _ -> removeItTarget
, _itEffect = rbSetTarget , _itEffect = rbSetTarget
-1
View File
@@ -119,7 +119,6 @@ boosterGun = defaultGun
, _reloadTime = 20 , _reloadTime = 20
} }
, _itUse = luseInstantNoH $ boostSelfL 10 , _itUse = luseInstantNoH $ boostSelfL 10
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-2,-2),(-2,2),(2,2),(2,0),(0,0),(0,-2)]
, _itEffect = resetAttachmentID , _itEffect = resetAttachmentID
} }
resetAttachmentID :: ItEffect resetAttachmentID :: ItEffect
+90 -28
View File
@@ -89,7 +89,7 @@ autoGun = defaultAutoGun
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = autoGunPic -- , _itFloorPict = autoGunPic
-- , _itZoom = defaultItZoom -- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponOnAim , _itEquipPict = pictureWeaponOnAim
, _itAttachment = ItCharMode $ Seq.fromList "MS" , _itAttachment = ItCharMode $ Seq.fromList "MS"
@@ -139,9 +139,8 @@ bangStick i = defaultGun
, spreadLoaded , spreadLoaded
, withRecoilI 25 , withRecoilI 25
] ]
, _itFloorPict = pistolPic
-- , _itZoom = defaultItZoom -- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponAim pistolPic -- , _itEquipPict = pictureWeaponAim pistolPic
, _itID = Nothing , _itID = Nothing
, _itInvColor = white , _itInvColor = white
, _itTargeting = Nothing , _itTargeting = Nothing
@@ -157,6 +156,15 @@ bangStick i = defaultGun
} }
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
, _itInvSize = fromIntegral i / 3 , _itInvSize = fromIntegral i / 3
, _itDimension = ItemDimension
{ _dimRad = 5
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 10
}
, _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ rectXH 10 2
}
} }
bangCane :: Item bangCane :: Item
bangCane = defaultGun bangCane = defaultGun
@@ -184,8 +192,16 @@ bangCane = defaultGun
, withMuzFlareI , withMuzFlareI
, withRecoilI 50 , withRecoilI 50
] ]
, _itFloorPict = autoGunPic
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 20
}
, _dimSPic = const $ noPic $ colorSH red $ upperPrismPoly 3 $ rectXH 15 2
}
} & itUse . useAim . aimSpeed .~ 0.4 } & itUse . useAim . aimSpeed .~ 0.4
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand & itUse . useAim . aimStance .~ OneHand
@@ -198,16 +214,27 @@ bangCaneX i = bangCane
[ ammoHammerCheck [ ammoHammerCheck
, useTimeCheck , useTimeCheck
, withSoundItemChoiceStart bangStickSoundChoice , withSoundItemChoiceStart bangStickSoundChoice
, useAmmoAmount 1 , useAllAmmo
, torqueAfterI 0.2 , torqueAfterI 0.5
, duplicateLoadedBarrels , duplicateLoadedBarrels
, applyInaccuracy , applyInaccuracy
, withMuzFlareI , withMuzFlareI
, withRecoilI 50 , withRecoilI 50
] ]
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 15
}
, _dimSPic = const $ noPic $ colorSH red $ foldMap
(\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2)
$ map (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5)) [0..i-1]
}
} & itUse . useAim . aimSpeed .~ 0.4 } & itUse . useAim . aimSpeed .~ 0.4
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandFlat
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& itConsumption . ammoMax .~ i & itConsumption . ammoMax .~ i
& itParams . gunBarrels .~ MultiBarrel & itParams . gunBarrels .~ MultiBarrel
@@ -218,6 +245,16 @@ bangCaneX i = bangCane
rifle :: Item rifle :: Item
rifle = bangCane rifle = bangCane
{ _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 25
}
, _dimSPic = const $ noPic $ colorSH red $ upperPrismPoly 3 $ rectXH 25 2
}
}
& itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimStance .~ TwoHandTwist
& itName .~ "RIFLE" & itName .~ "RIFLE"
& itType .~ RIFLE & itType .~ RIFLE
@@ -269,12 +306,20 @@ bangRod = bangCane
, withMuzFlareI , withMuzFlareI
, withRecoilI 50 , withRecoilI 50
] ]
, _itFloorPict = longGunSPic , _itDimension = ItemDimension
{ _dimRad = 12
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 30
}
, _dimSPic = const $ noPic $ colorSH orange $ upperPrismPoly 3 $ rectXH 30 2
}
} }
& itConsumption . reloadType .~ ActiveClear & itConsumption . reloadType .~ ActiveClear
& itUse . useAim . aimSpeed .~ 0.2 & itUse . useAim . aimSpeed .~ 0.2
& itUse . useAim . aimRange .~ 1 & itUse . useAim . aimRange .~ 1
& itUse . useAim . aimStance .~ OneHand & itUse . useAim . aimStance .~ TwoHandTwist
& itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & itUse . useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
elephantGun :: Item elephantGun :: Item
elephantGun = bangRod elephantGun = bangRod
@@ -358,7 +403,16 @@ bangCone = defaultGun
, _bore = 5 , _bore = 5
, _gunBarrels = SingleBarrel 0.5 , _gunBarrels = SingleBarrel 0.5
} }
, _itFloorPict = spreadGunPic , _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 15
}
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2)
<> upperPrismPoly 6 (rectNSEW 4 (-4) 15 5)
}
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
} }
coneRandItemParams :: State StdGen ItemParams coneRandItemParams :: State StdGen ItemParams
@@ -392,6 +446,16 @@ blunderbuss = bangCone
] ]
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimSpeed .~ 0.4 & useAim . aimSpeed .~ 0.4
, _itDimension = ItemDimension
{ _dimRad = 8
, _dimCenter = V3 5 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 30
}
, _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2)
<> upperPrismPoly 6 (rectNSEW 4 (-4) 30 20)
}
} }
grapeShotCannon :: Item grapeShotCannon :: Item
@@ -480,9 +544,8 @@ pistol = defaultGun
} }
, _itUse = useAmmoParamsRate 6 upHammer , _itUse = useAmmoParamsRate 6 upHammer
(ammoHammerCheck : pistolAfterHamMods) (ammoHammerCheck : pistolAfterHamMods)
, _itFloorPict = pistolPic
-- , _itZoom = defaultItZoom -- , _itZoom = defaultItZoom
, _itEquipPict = pictureWeaponAim pistolPic -- , _itEquipPict = pictureWeaponAim pistolPic
, _itID = Nothing , _itID = Nothing
, _itInvColor = white , _itInvColor = white
, _itTargeting = Nothing , _itTargeting = Nothing
@@ -494,14 +557,14 @@ pistol = defaultGun
} }
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
} }
pistolPic :: Item -> SPic --pistolPic :: Item -> SPic
pistolPic it = noPic $ colorSH green (prismPoly --pistolPic it = noPic $ colorSH green (prismPoly
(map (addZ 3) $ rectNESW 3 3 (-3) (-3)) -- (map (addZ 3) $ rectNESW 3 3 (-3) (-3))
(map (addZ 0) $ rectNESW 5 3 (-5) (-7)) -- (map (addZ 0) $ rectNESW 5 3 (-5) (-7))
) -- )
<> translateSH (V3 (-4) 5.5 4) (rotateSH pi $ bulletClip am) -- <> translateSH (V3 (-4) 5.5 4) (rotateSH pi $ bulletClip am)
where -- where
am = _ammoLoaded $ _itConsumption it -- am = _ammoLoaded $ _itConsumption it
bulletClip :: Int -> Shape bulletClip :: Int -> Shape
bulletClip x = rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW 3 0 (3 - 0.25 * am) (-5) bulletClip x = rotateSHx (negate $ pi/4) . upperPrismPoly 2 $ rectNESW 3 0 (3 - 0.25 * am) (-5)
@@ -530,7 +593,7 @@ hvAutoGun = defaultAutoGun
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
& useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0} & useDelay .~ VariableRate {_rateMax = 25, _rateMaxMax = 24, _rateMinMax = 7, _rateTime = 0}
, _itFloorPict = hvAutoGunPic -- , _itFloorPict = hvAutoGunPic
, _itInvSize = 3 , _itInvSize = 3
, _itInvDisplay = \it -> head (basicItemDisplay it) : , _itInvDisplay = \it -> head (basicItemDisplay it) :
["* FIRERATE: *" ["* FIRERATE: *"
@@ -585,7 +648,7 @@ ltAutoGun = defaultAutoGun
, withSidePushI 50 , withSidePushI 50
, modClock 2 withMuzFlareI , modClock 2 withMuzFlareI
] ]
, _itFloorPict = ltAutoGunPic -- , _itFloorPict = ltAutoGunPic
, _itParams = BulletShooter , _itParams = BulletShooter
{ _muzVel = 1 { _muzVel = 1
, _rifling = 0.8 , _rifling = 0.8
@@ -594,7 +657,6 @@ ltAutoGun = defaultAutoGun
} }
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
} }
& itDimension . muzzleLength .~ 10
ltAutoGunPic :: Item -> SPic ltAutoGunPic :: Item -> SPic
ltAutoGunPic it = ltAutoGunPic it =
( colorSH green $ prismPoly ( colorSH green $ prismPoly
@@ -652,7 +714,7 @@ miniGun = defaultAutoGun
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = miniGunPictItem -- , _itFloorPict = miniGunPictItem
, _itParams = BulletShooter , _itParams = BulletShooter
{ _muzVel = 1 { _muzVel = 1
, _rifling = 0.9 , _rifling = 0.9
@@ -673,7 +735,7 @@ miniGun = defaultAutoGun
-- [" " ++ replicate 8 ch -- [" " ++ replicate 8 ch
-- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch -- ," " ++ replicate 2 ch ++ fromMaybe " " (maybeWarmupStatus it) ++ replicate 2 ch
-- ," " ++ replicate 8 ch] -- ," " ++ replicate 8 ch]
} & itDimension . muzzleLength .~ 15 }
where where
--ch = '*' --ch = '*'
recoilAmount = 5 recoilAmount = 5
@@ -744,7 +806,7 @@ spreadGun = defaultGun
,_brlInaccuracy = 0 ,_brlInaccuracy = 0
} }
} }
, _itFloorPict = spreadGunPic -- , _itFloorPict = spreadGunPic
, _itTweaks = defaultBulletSelTweak , _itTweaks = defaultBulletSelTweak
} }
spreadGunPic :: Item -> SPic spreadGunPic :: Item -> SPic
@@ -780,7 +842,7 @@ multGun = defaultGun
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1.5}
, _itFloorPict = multGunSPic -- , _itFloorPict = multGunSPic
, _itParams = BulletShooter , _itParams = BulletShooter
{ _muzVel = 1 { _muzVel = 1
, _rifling = 0.9 , _rifling = 0.9
@@ -833,7 +895,7 @@ longGun = defaultGun
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5} & useAim . aimZoom .~ defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}
, _itFloorPict = longGunSPic -- , _itFloorPict = longGunSPic
-- , _itZoom = defaultItZoom -- , _itZoom = defaultItZoom
, _itScroll = zoomLongGun , _itScroll = zoomLongGun
, _itAttachment = ItScope (V2 0 0) 0 1 False , _itAttachment = ItScope (V2 0 0) 0 1 False
-1
View File
@@ -37,7 +37,6 @@ lasDrones = defaultGun
& useAim . aimSpeed .~ 0.2 & useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5 & useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = lasDronesPic
, _itEffect = NoItEffect , _itEffect = NoItEffect
} }
+49 -48
View File
@@ -3,16 +3,16 @@ module Dodge.Item.Weapon.Grenade
import Dodge.Data import Dodge.Data
import Dodge.Picture.Layer import Dodge.Picture.Layer
import Dodge.WorldEvent.Explosion import Dodge.WorldEvent.Explosion
import Dodge.Item.Weapon.TriggerType --import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.Remote import Dodge.Item.Weapon.Remote
import Dodge.Default import Dodge.Default
import Dodge.Default.Weapon --import Dodge.Default.Weapon
import Dodge.Base import Dodge.Base
import Dodge.Zone import Dodge.Zone
import Dodge.SoundLogic import Dodge.SoundLogic
import Dodge.Item.Draw import Dodge.Item.Draw
import Dodge.Item.Weapon.InventoryDisplay --import Dodge.Item.Weapon.InventoryDisplay
import Dodge.Item.Attachment --import Dodge.Item.Attachment
import Picture import Picture
import Geometry import Geometry
import ShapePicture import ShapePicture
@@ -22,33 +22,34 @@ import qualified IntMapHelp as IM
import Data.Maybe import Data.Maybe
import Control.Lens import Control.Lens
grenade :: Item --grenade :: Item
grenade = Throwable --grenade = Item
{ _itName = "GRENADE " ++ show fuseTime -- { _itName = "GRENADE " ++ show fuseTime
, _itType = GRENADE -- , _itType = GRENADE
, _itInvSize = 1 -- , _itInvSize = 1
, _itDimension = defaultItemDimension -- , _itDimension = defaultItemDimension
, _itCurseStatus = Uncursed -- , _itCurseStatus = Uncursed
, _itMaxStack = 8 -- , _itConsumption = ItemItselfConsumable 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)] ---- , _itMaxStack = 8
, _twMaxRange = 150 -- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _twAccuracy = 30 -- , _twMaxRange = 150
, _itUse = ruseRate 25 (\_ -> throwGrenade makeExplosionAt) upHammer -- , _twAccuracy = 30
[ useTimeCheck -- , _itUse = ruseRate 25 (\_ -> throwGrenade makeExplosionAt) upHammer
] -- [ useTimeCheck
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = f fuseTime, _itZoomMin = f fuseTime} -- ]
-- , _itZoom = defaultItZoom -- & useAim . aimZoom .~ defaultItZoom {_itZoomMax = f fuseTime, _itZoomMin = f fuseTime}
, _itEquipPict = pictureWeaponOnAim' $ \_ -> grenadePic fuseTime ---- , _itZoom = defaultItZoom
, _itID = Nothing -- , _itEquipPict = pictureWeaponOnAim' $ \_ -> grenadePic fuseTime
, _itAttachment = ItFuse fuseTime -- , _itID = Nothing
, _itInvColor = white -- , _itAttachment = ItFuse fuseTime
, _itInvDisplay = basicItemDisplay -- , _itInvColor = white
, _itEffect = NoItEffect -- , _itInvDisplay = basicItemDisplay
, _itScroll = changeFuse -- , _itEffect = NoItEffect
} -- , _itScroll = changeFuse
where -- }
fuseTime = 50 -- where
f x = 50 / fromIntegral x -- fuseTime = 50
-- f x = 50 / fromIntegral x
moveGrenade :: Prop -> World -> World moveGrenade :: Prop -> World -> World
moveGrenade pj w moveGrenade pj w
@@ -207,22 +208,22 @@ setRemoteBombScope itid pj w' = case _itemPositions w' IM.! itid of
.~ (defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5}) .~ (defaultItZoom {_itZoomMax = 0.5, _itZoomMin = 0.5})
_ -> w' _ -> w'
defaultThrowable :: Item --defaultThrowable :: Item
defaultThrowable = grenade --defaultThrowable = grenade
remoteBomb :: Item --remoteBomb :: Item
remoteBomb = defaultThrowable --remoteBomb = defaultThrowable
{ _itName = "REMOTEBOMB" -- { _itName = "REMOTEBOMB"
, _itType = REMOTEBOMB -- , _itType = REMOTEBOMB
, _itMaxStack = 1 -- , _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 -- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2
[(-3,-3),(-3,3),(3,3),(3,-3)] -- [(-3,-3),(-3,3),(3,3),(3,-3)]
, _twMaxRange = 150 -- , _twMaxRange = 150
, _twAccuracy = 30 -- , _twAccuracy = 30
, _itUse = ruseRate 25 (const throwRemoteBomb) upHammer -- , _itUse = ruseRate 25 (const throwRemoteBomb) upHammer
[ hammerCheckI ] -- [ hammerCheckI ]
, _itAttachment = ItScope (V2 0 0) 0 1 True -- , _itAttachment = ItScope (V2 0 0) 0 1 True
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH remoteBombUnarmedPic -- , _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH remoteBombUnarmedPic
} -- }
throwRemoteBomb :: Creature -> World -> World throwRemoteBomb :: Creature -> World -> World
@@ -293,7 +294,7 @@ retireRemoteBomb :: Int -> Int -> Int -> World -> World
retireRemoteBomb itid 0 pjid w = w retireRemoteBomb itid 0 pjid w = w
& pointToItem (_itemPositions w IM.! itid) %~ & pointToItem (_itemPositions w IM.! itid) %~
( (itAttachment . scopePos .~ V2 0 0) ( (itAttachment . scopePos .~ V2 0 0)
. (itZoom .~ defaultItZoom) -- . (itZoom .~ defaultItZoom)
. (itUse . rUse .~ const throwRemoteBomb) . (itUse . rUse .~ const throwRemoteBomb)
) )
& props %~ IM.delete pjid & props %~ IM.delete pjid
+1 -1
View File
@@ -25,7 +25,7 @@ basicItemDisplay it = Prelude.take (itSlotsTaken it) $
Nothing' -> show (_ammoLoaded am) Nothing' -> show (_ammoLoaded am)
Just' x -> show x ++ "R" ++ show (_ammoLoaded am) Just' x -> show x ++ "R" ++ show (_ammoLoaded am)
Just am@ChargeableAmmo{} -> show $ _wpCharge am Just am@ChargeableAmmo{} -> show $ _wpCharge am
Just x@ItemItselfConsumable{} -> "x" ++ show (_itAmount' x) Just x@ItemItselfConsumable{} -> "x" ++ show (_itAmount x)
Just NoConsumption -> "NOCONSUMPTION" Just NoConsumption -> "NOCONSUMPTION"
Nothing -> "" Nothing -> ""
theparam = fromMaybe [] theparam = fromMaybe []
+17 -10
View File
@@ -57,7 +57,6 @@ launcher = defaultGun
& useAim . aimSpeed .~ 0.2 & useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5 & useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = launcherPic
, _itEffect = NoItEffect , _itEffect = NoItEffect
, _itParams = ShellLauncher , _itParams = ShellLauncher
{ _shellSpinDrag = 1 { _shellSpinDrag = 1
@@ -70,7 +69,23 @@ launcher = defaultGun
} }
, _itInvSize = 3 , _itInvSize = 3
, _itInvDisplay = basicItemDisplay , _itInvDisplay = basicItemDisplay
, _itDimension = ItemDimension
{ _dimRad = 9
, _dimCenter = V3 10 0 0
, _dimPortage = HeldItem
{_handlePos = 5
,_muzPos = 20
} }
, _dimSPic = launcherPic
}
}
launcherPic :: Item -> SPic
launcherPic _ =
( colorSH cyan $ prismPoly
(map (+.+.+ V3 20 0 5) $ polyCircx 4 5)
(map (+.+.+ V3 0 0 5) $ polyCircx 4 5)
, mempty
)
defaultShellAmmo :: AmmoType defaultShellAmmo :: AmmoType
defaultShellAmmo = ProjectileAmmo defaultShellAmmo = ProjectileAmmo
@@ -79,13 +94,6 @@ defaultShellAmmo = ProjectileAmmo
, _amPjDraw = const mempty , _amPjDraw = const mempty
} }
launcherPic :: Item -> SPic
launcherPic _ =
( colorSH cyan $ prismPoly
(map (+.+.+ V3 10 0 4.5) $ polyCircx 4 5)
(map (+.+.+ V3 (-10) 0 4.5) $ polyCircx 4 5)
, mempty
)
basicAmPjMoves :: IM.IntMap TweakParam basicAmPjMoves :: IM.IntMap TweakParam
basicAmPjMoves = IM.fromList . zip [0..] $ basicAmPjMoves = IM.fromList . zip [0..] $
@@ -254,7 +262,7 @@ trySpinByCID cid i pj w = w & props . ix pjid . pjSpin .~ newSpin
remoteLauncher :: Item remoteLauncher :: Item
remoteLauncher = defaultGun remoteLauncher = launcher
{ _itName = "ROCKO-REM" { _itName = "ROCKO-REM"
, _itType = LAUNCHER , _itType = LAUNCHER
, _itConsumption = defaultAmmo , _itConsumption = defaultAmmo
@@ -274,7 +282,6 @@ remoteLauncher = defaultGun
& useAim . aimSpeed .~ 0.2 & useAim . aimSpeed .~ 0.2
& useAim . aimRange .~ 0.5 & useAim . aimRange .~ 0.5
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = launcherPic
, _itAttachment = ItScope (V2 0 0) 0 1 True , _itAttachment = ItScope (V2 0 0) 0 1 True
-- , _itParams = ShellLauncher -- , _itParams = ShellLauncher
-- { _tweakSel = 0 -- { _tweakSel = 0
-9
View File
@@ -31,7 +31,6 @@ radar = defaultGun
] ]
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
-- , _itZoom = defaultItZoom { _itZoomMax = 1} -- , _itZoom = defaultItZoom { _itZoomMax = 1}
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) , _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
} }
@@ -51,8 +50,6 @@ sonar = defaultGun
] ]
& useAim . aimRange .~ 1 & useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1} & useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
, _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5) , _itEquipPict = pictureWeaponOnAim' $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
} }
{- | {- |
@@ -61,12 +58,9 @@ autoSonar :: Item
autoSonar = defaultEquipment autoSonar = defaultEquipment
{ _itType = RADAR { _itType = RADAR
, _itName = "AUTOSONAR" , _itName = "AUTOSONAR"
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = autoSonarEffect , _itEffect = autoSonarEffect
, _itID = Nothing , _itID = Nothing
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
} }
{- | {- |
Automatically sends out pulses that display walls. -} Automatically sends out pulses that display walls. -}
@@ -74,10 +68,7 @@ autoRadar :: Item
autoRadar = defaultEquipment autoRadar = defaultEquipment
{ _itType = RADAR { _itType = RADAR
, _itName = "AUTORADAR" , _itName = "AUTORADAR"
, _itMaxStack = 1
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ color yellow $ polygon $ map toV2 [(-3,-3),(-3,3),(3,3),(3,-3)]
, _itEquipPict = \_ _ -> (,) emptySH blank , _itEquipPict = \_ _ -> (,) emptySH blank
, _itEffect = autoRadarEffect , _itEffect = autoRadarEffect
, _itID = Nothing , _itID = Nothing
-- , _itZoom = defaultItZoom {_itZoomMax = 1}
} }
+15 -15
View File
@@ -52,8 +52,21 @@ poisonSprayer = defaultAutoGun
{ _nozzleSpread = 0.2 { _nozzleSpread = 0.2
, _nozzleNum = 3 , _nozzleNum = 3
} }
, _itFloorPict = flamerPic -- , _itFloorPict = flamerPic
} }
flamerPic :: Item -> SPic
flamerPic it =
( colorSH yellow $
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
++ upperPrismPoly 5 (rectNESW 2 9 (-2) (-9))
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
)
where
tx = - 5
ty = - 6
tz = 3
r = 5
am = fractionLoadedAmmo2 it
flamer :: Item flamer :: Item
flamer = defaultAutoGun flamer = defaultAutoGun
{ _itName = "FLAMER" { _itName = "FLAMER"
@@ -73,7 +86,7 @@ flamer = defaultAutoGun
& useAim . aimSpeed .~ 0.5 & useAim . aimSpeed .~ 0.5
& useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5} & useAim . aimZoom .~ defaultItZoom {_itZoomMax = 5, _itZoomMin = 1.5}
& useAim . aimStance .~ TwoHandTwist & useAim . aimStance .~ TwoHandTwist
, _itFloorPict = flamerPic -- , _itFloorPict = flamerPic
-- , _itZoom = defaultItZoom -- , _itZoom = defaultItZoom
, _itAttachment = NoItAttachment , _itAttachment = NoItAttachment
, _itParams = AngleWalk , _itParams = AngleWalk
@@ -82,19 +95,6 @@ flamer = defaultAutoGun
,_currentWalkAngle = 0 ,_currentWalkAngle = 0
} }
} }
flamerPic :: Item -> SPic
flamerPic it =
( colorSH yellow $
translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r)
++ upperPrismPoly 5 (rectNESW 2 9 (-2) (-9))
, color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am)
)
where
tx = - 5
ty = - 6
tz = 3
r = 5
am = fractionLoadedAmmo2 it
aGasCloud :: Creature -> World -> World aGasCloud :: Creature -> World -> World
aGasCloud cr w = insertCloud $ set randGen g w aGasCloud cr w = insertCloud $ set randGen g w
where where
+6 -6
View File
@@ -53,6 +53,7 @@ import Dodge.Reloading
import Dodge.WorldEvent import Dodge.WorldEvent
import Dodge.RandomHelp import Dodge.RandomHelp
import Dodge.Inventory.Lock import Dodge.Inventory.Lock
import Dodge.Creature.HandPos
--import Dodge.Default --import Dodge.Default
import Sound.Data import Sound.Data
import Geometry import Geometry
@@ -353,14 +354,13 @@ modClock n chainEff eff it cr w
withMuzFlareI :: ChainEffect withMuzFlareI :: ChainEffect
withMuzFlareI f it cr w = makeTlsTimeRadColPos 3 100 (V3 1 1 0.5) flashPos withMuzFlareI f it cr w = makeTlsTimeRadColPos 3 100 (V3 1 1 0.5) flashPos
. muzFlareAt (V4 5 5 0 2) flarePos dir . muzFlareAt (V4 5 5 0 2) flarePos cdir
$ f it cr w $ f it cr w
where where
--pos = _crPos cr +.+ _crRad cr *.* unitVectorAtAngle (_crDir cr) flarePos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir muzzleOffset
flarePos = addZ 20 $ _crPos cr +.+ (_crRad cr + itLength) *.* unitVectorAtAngle dir flashPos = addZ 0 (_crPos cr) +.+.+ rotate3z cdir (muzzleOffset +.+.+ V3 5 0 5)
flashPos = addZ 35 $ _crPos cr +.+ (2.5 * _crRad cr) *.* unitVectorAtAngle dir muzzleOffset = V3 (_muzPos (_dimPortage (_itDimension it))) 0 0
dir = _crDir cr cdir = _crDir cr
itLength = _muzzleLength $ _itDimension it
{- | Applies the effect to a randomly rotated creature, {- | Applies the effect to a randomly rotated creature,
- rotation amount given by inaccuracy in itParams -} - rotation amount given by inaccuracy in itParams -}
applyInaccuracy :: ChainEffect applyInaccuracy :: ChainEffect
+3 -3
View File
@@ -63,7 +63,7 @@ shrinkGun = defaultGun
} }
, _itUse = defaultlUse {_lUse = hammerCheckL useShrinkGun} , _itUse = defaultlUse {_lUse = hammerCheckL useShrinkGun}
& useHammer .~ upHammer & useHammer .~ upHammer
, _itFloorPict = shrinkGunPic -- , _itFloorPict = shrinkGunPic
, _itAttachment = ItBool True , _itAttachment = ItBool True
} }
@@ -94,7 +94,7 @@ blinkGun = defaultGun
, _itUse = defaultlUse , _itUse = defaultlUse
{_lUse = hammerCheckL $ shootL aSelfL {_lUse = hammerCheckL $ shootL aSelfL
} & useHammer .~ upHammer } & useHammer .~ upHammer
, _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2 -- , _itFloorPict = const . noPic . colorSH chartreuse $ upperPrismPoly 2 $ square 2
} }
@@ -125,7 +125,7 @@ forceFieldGun = defaultGun
, _reloadState = Nothing' , _reloadState = Nothing'
} }
, _itUse = undefined , _itUse = undefined
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-4,-4),(-4,4),(4,4),(4,0),(0,0),(0,-4)] -- , _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2 [(-4,-4),(-4,4),(4,4),(4,0),(0,0),(0,-4)]
} }
-- grapGun = defaultGun -- grapGun = defaultGun
-- { _itName = "grapGun" -- { _itName = "grapGun"
+2 -1
View File
@@ -9,6 +9,7 @@ import Dodge.WorldEvent.Explosion
import Dodge.Item.Weapon.BatteryGuns import Dodge.Item.Weapon.BatteryGuns
import Dodge.SoundLogic.LoadSound import Dodge.SoundLogic.LoadSound
import Dodge.SoundLogic import Dodge.SoundLogic
import Dodge.Item.Draw
import Geometry import Geometry
import ShapePicture import ShapePicture
import Shape import Shape
@@ -85,7 +86,7 @@ drawTurret :: Machine -> SPic
drawTurret mc = (rotateSH (-_mcDir mc) . colorSH blue $ upperPrismPoly 20 (square wdth) drawTurret mc = (rotateSH (-_mcDir mc) . colorSH blue $ upperPrismPoly 20 (square wdth)
, mempty -- setLayer 5 $ scale 0.5 0.5 $ text $ show $ _mcDir mc ) , mempty -- setLayer 5 $ scale 0.5 0.5 $ text $ show $ _mcDir mc )
) )
<> translateSPz 20 (_itFloorPict it it) <> translateSPz 20 (itSPic it)
where where
it = _tuWeapon $ _mcType mc it = _tuWeapon $ _mcType mc
+2 -1
View File
@@ -12,6 +12,7 @@ import Dodge.SoundLogic.LoadSound
import Dodge.Graph import Dodge.Graph
import Dodge.GameRoom import Dodge.GameRoom
import Dodge.Update.Camera import Dodge.Update.Camera
import Dodge.Item.Draw
--import Dodge.Zone --import Dodge.Zone
import Geometry import Geometry
import ShapePicture import ShapePicture
@@ -62,7 +63,7 @@ ppDraw c = uncurryV translate (_ppPos c) $ rotate (_ppRot c) (_ppPict c)
floorItemSPic :: FloorItem -> SPic floorItemSPic :: FloorItem -> SPic
floorItemSPic flit = uncurryV translateSPf (_flItPos flit) floorItemSPic flit = uncurryV translateSPf (_flItPos flit)
$ rotateSP (_flItRot flit) (_itFloorPict (_flIt flit) (_flIt flit)) $ rotateSP (_flItRot flit) (itSPic (_flIt flit))
btSPic :: Button -> SPic btSPic :: Button -> SPic
btSPic bt = uncurryV translateSPf (_btPos bt) btSPic bt = uncurryV translateSPf (_btPos bt)