Add modules to items, upgrades the can persist through combinations

This commit is contained in:
2022-02-20 14:13:12 +00:00
parent 3f20398ed0
commit 7afc367abc
16 changed files with 108 additions and 32 deletions
+7 -1
View File
@@ -9,9 +9,12 @@ module Dodge.Item.Weapon.AmmoParams
import Dodge.Data
import Dodge.Particle.Bullet.Spawn
import Dodge.Creature.HandPos
import Dodge.WorldEvent.HitEffect
import Dodge.Particle.Bullet.HitEffect
import Geometry
import LensHelp
import Data.Maybe
--import Control.Lens
useAmmoParamsRate :: Int
@@ -39,12 +42,15 @@ useAmmoParams it cr = withVelWthHiteff
(_rifling $ _itParams it)
(_amBulWth b)
muzlength
(_amBulEff b)
bulHitEff
-- (_amBulEff b)
cr
where
muzlength = aimingMuzzlePos cr it
muzvel = _muzVel $ _itParams it
b = _aoType $ _itConsumption it
bulHitEff = fromMaybe (destroyOnImpact bulHitCr bulHitWall)
$ it ^? itModules . modHitEffect . theModule
useAmmoParamsVelMod :: Float -> Item -> Creature -> World -> World
useAmmoParamsVelMod vfact it = withDelayedVelWthHiteff vfact (_amBulVel b) (_rifling $ _itParams it)
+4
View File
@@ -9,6 +9,8 @@ module Dodge.Item.Weapon.BulletGun.Cane
, fastBurstRifle
, miniGunX
) where
import Dodge.Particle.Bullet.HitEffect
import Dodge.WorldEvent.HitEffect
import Dodge.Item.Weapon.BulletGun.Clip
import Dodge.Data
--import Dodge.ChainEffect
@@ -40,6 +42,8 @@ import Data.Maybe
bangCane :: Item
bangCane = defaultGun
{ _itName = "BANGCANE"
, _itModules = ItemModules
{ _modHitEffect = ItemModule (destroyOnImpact bulIncCr bulIncWall) ["+INCENDIARY"] 1}
, _itType = BANGCANE
,_itParams = BulletShooter
{ _muzVel = 0.8
+2 -1
View File
@@ -17,8 +17,9 @@ import Control.Lens
basicItemDisplay :: Item -> [String]
basicItemDisplay it = Prelude.take (itSlotsTaken it) $
(midPadL 15 ' ' thename (' ' : thenumber) ++ theparam)
: repeat "*"
: moduleStrings ++ repeat "*"
where
moduleStrings = fromMaybe [] $ it ^? itModules . modHitEffect . modName
thename = _itName it
thenumber = case it ^? itConsumption of
Just am@LoadableAmmo{} -> case _reloadState am of
+1 -1
View File
@@ -38,7 +38,7 @@ rewindEffect _ cr invid w
ptrWpCharge = creatures . ix (_crID cr) . crInv . ix invid . itConsumption . wpCharge
maxcharge = _wpMaxCharge . _itConsumption $ _crInv cr IM.! invid
w' = w & rewindWorlds .~ []
& rewinding .~ RewindingNow
& timeFlow .~ NormalTimeFlow
useRewindGun :: Item -> Creature -> World -> World
useRewindGun _ _ w = case _rewindWorlds w of