Fix volleyGun
This commit is contained in:
@@ -6,18 +6,18 @@ module Dodge.Item.BackgroundEffect (
|
||||
removeShieldWall,
|
||||
) where
|
||||
|
||||
import Dodge.Creature.Radius
|
||||
import Color
|
||||
import Dodge.Default.Wall
|
||||
import Dodge.Wall.Delete
|
||||
import Dodge.Item.HeldOffset
|
||||
import Dodge.Creature.Test
|
||||
import Geometry.Vector
|
||||
import Dodge.Wall.Move
|
||||
import Dodge.Wall.Create
|
||||
import Dodge.Item.Location
|
||||
import Dodge.Data.World
|
||||
import Control.Lens
|
||||
import Dodge.Creature.Radius
|
||||
import Dodge.Creature.Test
|
||||
import Dodge.Data.World
|
||||
import Dodge.Default.Wall
|
||||
import Dodge.Item.HeldOffset
|
||||
import Dodge.Item.Location
|
||||
import Dodge.Wall.Create
|
||||
import Dodge.Wall.Delete
|
||||
import Dodge.Wall.Move
|
||||
import Geometry.Vector
|
||||
|
||||
cancelExamineInventory :: World -> World
|
||||
cancelExamineInventory = hud . hudElement . subInventory %~ f
|
||||
@@ -39,7 +39,7 @@ rootNotrootEff f g it
|
||||
createShieldWall :: Item -> Creature -> World -> World
|
||||
createShieldWall it cr w = case it ^? itParams . flatShieldWlMIX . _Just of
|
||||
Nothing ->
|
||||
let (wlid, w') = createWall ((shieldWall' crid){_wlLine = wlline, _wlID = wlid}) w
|
||||
let (wlid, w') = createWall ((shieldWall crid){_wlLine = wlline, _wlID = wlid}) w
|
||||
in w' & pointerToItem it . itParams .~ FlatShieldParams (Just wlid)
|
||||
Just wid -> moveWallID wid wlline w
|
||||
where
|
||||
@@ -67,14 +67,15 @@ itEffectOnPickup _ _ = id
|
||||
itEffectOnDrop :: Item -> Creature -> World -> World
|
||||
itEffectOnDrop itm cr w = case itm ^. itType of
|
||||
HELD MINIGUNX{} -> w & pointerToItemID (_itID itm) . itParams . wTime .~ 0
|
||||
HELD MACHINEPISTOL{} -> w & pointerToItemID (_itID itm) . itParams
|
||||
.~ WarmTime 0 False Nothing
|
||||
HELD MACHINEPISTOL{} ->
|
||||
w & pointerToItemID (_itID itm) . itParams
|
||||
.~ WarmTime 0 False Nothing
|
||||
ITEMSCAN -> cancelExamineInventory w
|
||||
HELD FLATSHIELD -> removeShieldWall itm cr w
|
||||
_ -> w
|
||||
|
||||
shieldWall' :: Int -> Wall
|
||||
shieldWall' crid =
|
||||
shieldWall :: Int -> Wall
|
||||
shieldWall crid =
|
||||
defaultWall
|
||||
{ _wlColor = yellow
|
||||
, _wlOpacity = SeeAbove
|
||||
|
||||
@@ -119,7 +119,7 @@ itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
|
||||
_ -> ([], [])
|
||||
|
||||
getAutoSpringLinks :: Item -> [(ItemStructuralFunction, CLinkType)]
|
||||
getAutoSpringLinks itm = case baseTriggerType itm of
|
||||
getAutoSpringLinks itm = case itemTriggerType itm of
|
||||
HammerTrigger -> [(MakeAutoSF, MakeAutoLink)]
|
||||
_ -> []
|
||||
|
||||
|
||||
@@ -13,34 +13,19 @@ import Dodge.Default
|
||||
import LensHelp
|
||||
|
||||
volleyGun :: Int -> Item
|
||||
volleyGun i =
|
||||
defaultHeldItem
|
||||
-- & itUse . heldMuzzles .~ getZipList
|
||||
-- (ZipList [Muzzle (V2 15 x) 0 0.01 | x <- spreadAroundCenter i 6]
|
||||
-- <*> ZipList [0..i-1]
|
||||
-- <*> pure MiniGunFlare
|
||||
-- <*> pure MuzzleShootBullet
|
||||
-- <*> pure (UseExactly 1)
|
||||
-- <*> ZipList [0..i-1]
|
||||
-- )
|
||||
& itType .~ HELD (VOLLEYGUN i)
|
||||
-- & itAmmoSlots .~ IM.fromList (zip [0..i-1] $ repeat BulletAmmo)
|
||||
-- & itUse . heldUseEffect .~ RandomiseMuzzleFrames i
|
||||
volleyGun i = defaultHeldItem & itType .~ HELD (VOLLEYGUN i)
|
||||
& itParams .~ VolleyUnfiredBarrels [0..i-1]
|
||||
|
||||
rifle :: Item
|
||||
rifle = defaultHeldItem & itType .~ HELD RIFLE
|
||||
-- & itUse . heldMuzzles . ix 0 . mzPos .~ V2 25 0
|
||||
|
||||
alteRifle :: Item
|
||||
alteRifle = rifle
|
||||
& itType .~ HELD ALTERIFLE
|
||||
-- & itAmmoSlots .~ IM.fromList (zip [0..1] $ repeat BulletAmmo)
|
||||
& itParams .~ AlteRifleSwitch 0
|
||||
|
||||
autoRifle :: Item
|
||||
autoRifle =
|
||||
rifle
|
||||
& itType .~ HELD AUTORIFLE
|
||||
autoRifle = rifle & itType .~ HELD AUTORIFLE
|
||||
|
||||
burstRifle :: Item
|
||||
burstRifle = rifle & itType .~ HELD BURSTRIFLE
|
||||
@@ -48,14 +33,5 @@ burstRifle = rifle & itType .~ HELD BURSTRIFLE
|
||||
miniGunX :: Int -> Item
|
||||
miniGunX i =
|
||||
autoRifle
|
||||
-- & itUse . heldDelay .~ WarmUpNoDelay{
|
||||
-- --_warmTime = 0,
|
||||
-- _warmMax = 100, _warmSound = crankSlowS}
|
||||
-- & itAmmoSlots .~ singleAmmo BeltBulletAmmo
|
||||
-- & itUse . heldMuzzles
|
||||
-- .~ replicate i
|
||||
-- (Muzzle (V2 30 0) 0 0.05 0 MiniGunFlare MuzzleShootBullet (UseExactly 1) 0)
|
||||
& itType .~ HELD (MINIGUNX i)
|
||||
-- & itEffect . ieInv .~ ItemReduceWarmTime
|
||||
-- & itEffect . ieOnDrop .~ ItemSetWarmTime 0
|
||||
& itParams .~ WarmTime 0 False Nothing
|
||||
|
||||
Reference in New Issue
Block a user