Implement teleporting bullets
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Combine.Combinations where
|
||||
import Geometry
|
||||
import Dodge.Data
|
||||
import Dodge.WorldEvent.HitEffect
|
||||
import Dodge.Particle.Bullet.HitEffect
|
||||
@@ -9,8 +10,14 @@ import Dodge.Item.Weapon.BulletGuns
|
||||
import Dodge.Item.Weapon.BatteryGuns
|
||||
import Dodge.Item.Weapon.Launcher
|
||||
import Dodge.Item.Weapon.SprayGuns
|
||||
import Dodge.Item.Weapon.Bezier
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
import Dodge.Base
|
||||
import LensHelp
|
||||
|
||||
import Data.Maybe
|
||||
|
||||
import Control.Lens
|
||||
itemCombinations :: [([(Int,CombineType)],Item)]
|
||||
itemCombinations =
|
||||
[ po [PIPE, HARDWARE] (bangStick 1)
|
||||
@@ -34,6 +41,7 @@ itemCombinations =
|
||||
, po [BANGCANE,TIN] rifle
|
||||
, po [RIFLE,PLANK] repeater
|
||||
, po [REPEATER,SPRING,HARDWARE] autoRifle
|
||||
, po [AUTORIFLE,MICROCHIP,MAGNET] bezierGun
|
||||
, po [REPEATER,SPRING,CAN] burstRifle
|
||||
, po [BURSTRIFLE,SPRING,HARDWARE] fastBurstRifle
|
||||
, po [FASTBURSTRIFLE,SPRING,HARDWARE] completeBurstRifle
|
||||
@@ -67,52 +75,77 @@ itemCombinations =
|
||||
++ 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]
|
||||
++ map (\i -> po [MINIGUNX i,BANGCANE] $ miniGunX (i+1)) [3..15]
|
||||
++ [ po [itype,mtype] $ it & itModules . modHitEffect .~ m
|
||||
| (itype,it) <- firearmTypes , (mtype,m) <- bulletModules
|
||||
]
|
||||
++ [ po (itype : ctypes) $ it & itModules . modRifleMag .~ m
|
||||
| (itype,it) <- rifleMagTypes , (ctypes,m) <- rifleMagModules
|
||||
++ [ po (_itType it:mtype) $ it & itModules . ix modtype .~ m
|
||||
| (modtype,is,ms) <- moduleCombinations
|
||||
, it <- is
|
||||
, (mtype,m) <- ms
|
||||
]
|
||||
where
|
||||
p = (,)
|
||||
po xs it = (map o xs,it)
|
||||
o = (1,)
|
||||
|
||||
rifleMagTypes :: [(CombineType,Item)]
|
||||
rifleMagTypes
|
||||
= [(REPEATER,repeater)
|
||||
,(AUTORIFLE,autoRifle)
|
||||
,(BURSTRIFLE,burstRifle)
|
||||
,(FASTBURSTRIFLE,fastBurstRifle)
|
||||
]
|
||||
rifleMagModules :: [([CombineType],ItemModule RifleMag)]
|
||||
rifleMagModules =
|
||||
[([DRUM,HARDWARE], ItemModule DrumMag ["+DRUM MAGAZINE"] 1 id)
|
||||
,([MOTOR,HARDWARE], ItemModule BeltMag ["+BELT MAGAZINE"] 1 id)
|
||||
,([MAGNET,HARDWARE],ItemModule MagnetMag ["+MAGNET MAGAZINE"] 1 id)
|
||||
moduleCombinations :: [( ModuleSlot, [Item], [([CombineType],ItemModule)] )]
|
||||
moduleCombinations =
|
||||
[ ( ModRifleMag
|
||||
, [repeater
|
||||
,autoRifle
|
||||
,burstRifle
|
||||
,fastBurstRifle
|
||||
]
|
||||
, [amod [DRUM,HARDWARE] "+DRUM MAG" (itConsumption . ammoBaseMax .~ 45)
|
||||
,amod [MOTOR,HARDWARE] "+BELT FEED" (itConsumption . ammoBaseMax .~ 150)
|
||||
]
|
||||
)
|
||||
, ( ModAutoMag
|
||||
, [autoRifle
|
||||
,autoPistol
|
||||
,smg
|
||||
]
|
||||
, [amod [MAGNET,HARDWARE] "+MAGNET FEED" (itUse . useDelay . rateMax .~ 4)
|
||||
]
|
||||
)
|
||||
, ( ModBullet
|
||||
, bulletWeapons
|
||||
, [amod [INCENDIARYMODULE] "+INCENDIARY" (f $ destroyOnImpact bulIncCr bulIncWall)
|
||||
,amod [BOUNCEMODULE] "+BOUNCE" (f $ destroyOnImpact bulBounceArmCr' bulBounceWall)
|
||||
]
|
||||
)
|
||||
, ( ModBulletTarget
|
||||
, bulletWeapons
|
||||
, [amod [TELEPORTMODULE,MICROCHIP] "+TELEPORT" (itUse . useMods .:~ withPositionWallCheck (const . const mouseWorldPos))
|
||||
,amod [TELEPORTMODULE] "+DIRECTEDTELE" makeDirectedTele
|
||||
]
|
||||
)
|
||||
]
|
||||
where
|
||||
makeDirectedTele it = it & itEffect .~ rbSetTarget
|
||||
& itUse . useMods .:~ withPosDirWallCheck directedTelPos
|
||||
& itUse . useAim . aimZoom . itZoomFac .~ 1
|
||||
directedTelPos it cr w = (p,a)
|
||||
where
|
||||
p = fromMaybe (_crPos cr) $ do
|
||||
(g,_) <- _itTargeting it
|
||||
g w
|
||||
a = argV (mouseWorldPos w -.- p)
|
||||
f ameff = itConsumption . aoType . amBulEff .~ ameff
|
||||
amod cts str func = (cts,ItemModule [str] 1 func)
|
||||
|
||||
firearmTypes :: [(CombineType,Item)]
|
||||
firearmTypes
|
||||
= [(BANGSTICK i,bangStick i) | i <- [1..9] ]
|
||||
++ [(BANGCANEX i,bangCaneX i) | i <- [1..6] ]
|
||||
++ [(REVOLVERX i,revolverX i) | i <- [1..5] ]
|
||||
++ [(MINIGUNX i,miniGunX i) | i <- [3..16] ]
|
||||
++ [(BANGCANE,bangCane)
|
||||
,(PISTOL,pistol)
|
||||
,(AUTOPISTOL,autoPistol)
|
||||
,(SMG,smg)
|
||||
,(MACHINEPISTOL,machinePistol)
|
||||
,(REVOLVER,revolver)
|
||||
,(RIFLE,rifle)
|
||||
,(REPEATER,repeater)
|
||||
,(AUTORIFLE,autoRifle)
|
||||
,(BURSTRIFLE,burstRifle)
|
||||
,(FASTBURSTRIFLE,fastBurstRifle)
|
||||
,(COMPLETEBURSTRIFLE,completeBurstRifle)
|
||||
]
|
||||
bulletModules :: [(CombineType,ItemModule HitEffect)]
|
||||
bulletModules =
|
||||
[(INCENDIARYMODULE, ItemModule (destroyOnImpact bulIncCr bulIncWall) ["+INCENDIARY"] 1 id)
|
||||
,(BOUNCEMODULE, ItemModule (destroyOnImpact bulBounceArmCr' bulBounceWall) ["+BOUNCE"] 1 id)
|
||||
]
|
||||
bulletWeapons :: [Item]
|
||||
bulletWeapons = [bangStick i | i <- [1..9] ]
|
||||
++ [bangCaneX i | i <- [1..6] ]
|
||||
++ [revolverX i | i <- [1..5] ]
|
||||
++ [miniGunX i | i <- [3..16] ]
|
||||
++ [bangCane
|
||||
,pistol
|
||||
,autoPistol
|
||||
,smg
|
||||
,machinePistol
|
||||
,revolver
|
||||
,rifle
|
||||
,repeater
|
||||
,autoRifle
|
||||
,burstRifle
|
||||
,fastBurstRifle
|
||||
,completeBurstRifle
|
||||
]
|
||||
|
||||
@@ -83,7 +83,7 @@ data CombineType
|
||||
| LIGHTER
|
||||
| MAGNET
|
||||
| PLATE
|
||||
| MCHIP
|
||||
| MICROCHIP
|
||||
| LED
|
||||
| NAILBOX
|
||||
| IRONBAR
|
||||
@@ -98,4 +98,9 @@ data CombineType
|
||||
| INCENDIARYMODULE
|
||||
| BOUNCEMODULE
|
||||
| NoCombineType
|
||||
--
|
||||
| TELEPORTMODULE
|
||||
| TIMEMODULE
|
||||
| SIZEMODULE
|
||||
| GRAVITYMODULE
|
||||
deriving (Eq,Ord,Show)
|
||||
|
||||
Reference in New Issue
Block a user