Rename protypes/basic to default

This commit is contained in:
jgk
2021-03-26 13:33:55 +01:00
parent c4ce354382
commit 420cf7fc4b
11 changed files with 125 additions and 122 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ module Dodge.Item.Consumable
where
import Dodge.Data
import Dodge.Base
import Dodge.Prototypes
import Dodge.Default
import Dodge.SoundLogic
import Dodge.Item.Draw
@@ -14,7 +14,7 @@ import Control.Lens
import qualified Data.IntMap.Strict as IM
medkit :: Int -> Item
medkit i = basicConsumable
medkit i = defaultConsumable
{ _itIdentity = Medkit25
, _itName = "MEDKIT" ++ show i
, _itMaxStack = 9
+27 -27
View File
@@ -12,7 +12,7 @@ import Dodge.RandomHelp
import Dodge.WorldEvent
import Dodge.Debug
import Dodge.WallCreatureCollisions
import Dodge.Prototypes
import Dodge.Default
import Dodge.Item.Draw
@@ -73,7 +73,7 @@ pistol = Weapon
, _itMaxStack = 1
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itEquipPict = drawWeapon $ color green $ polygon $ rectNESW 3 3 (-3) (-3)
, _itScrollUp = const id
, _itScrollDown = const id
@@ -116,7 +116,7 @@ autoGun = defaultGun
, _itMaxStack = 1
, _itAimingSpeed = 0.4
, _itAimingRange = 1
, _itZoom = basicItZoom {_itAimZoomFac = 1.5}
, _itZoom = defaultItZoom {_itAimZoomFac = 1.5}
, _itEquipPict = drawWeapon $ color red $ polygon $ rectNESW 4 4 (-4) (-4)
, _itEffect = NoItEffect
, _itAttachment = Just $ ItMode 0
@@ -206,7 +206,7 @@ teslaGun = defaultAutoGun
, _itAmount = 1
, _itMaxStack = 1
, _itAimingSpeed = 0.4
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itAimingRange = 0
, _itEquipPict = drawWeapon $ color blue $ pictures [polygon $ rectNESW 7 3 1 (-3)
,polygon $ rectNESW (-1) 3 (-7) (-3)
@@ -345,7 +345,7 @@ bezierGun = defaultAutoGun
, _itScrollDown = removeItAttachment 0
, _itHammer = HammerUp
, _itEffect = bezierRecock
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itAimingRange = 0
}
@@ -451,7 +451,7 @@ ltAutoGun = defaultAutoGun
, _itMaxStack = 1
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itEquipPict = drawWeapon $ color green $ pictures [polygon $ rectNSWE 4 (-4) (-4) 0
,circleSolid 4
]
@@ -542,7 +542,7 @@ multGun = defaultGun
, _itMaxStack = 1
, _itAimingSpeed = 0.4
, _itAimingRange = 1
, _itZoom = basicItZoom {_itAimZoomFac = 1.5}
, _itZoom = defaultItZoom {_itAimZoomFac = 1.5}
, _itEquipPict = drawWeapon $ multGunPic
}
where multGunPic = color red $ pictures
@@ -576,7 +576,7 @@ longGun = defaultGun
, _itMaxStack = 1
, _itAimingSpeed = 0.2
, _itAimingRange = 1
, _itZoom = basicItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5}
, _itZoom = defaultItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5}
, _itEquipPict = drawWeapon $ pictures [color orange $ polygon $ rectNESW 3 6 (-3) (-6) ]
, _itScrollUp = startZoomInLongGun
, _itScrollDown = startZoomOutLongGun
@@ -610,7 +610,7 @@ poisonSprayer = defaultAutoGun
, _itMaxStack = 1
, _itAimingSpeed = 0.2
, _itAimingRange = 0
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itEquipPict = drawWeapon $ color yellow $ polygon $ rectNESW 4 4 (-4) (-4)
}
@@ -633,7 +633,7 @@ flamer = defaultAutoGun
-- , _itAimingSpeed = 1
-- , _itAimingSpeed = 0.2
, _itAimingRange = 0
, _itZoom = basicItZoom {_itAimZoomMax = 5, _itAimZoomMin = 1.5}
, _itZoom = defaultItZoom {_itAimZoomMax = 5, _itAimZoomMin = 1.5}
, _itEquipPict = drawWeapon $ color yellow $ polygon $ rectNESW 4 4 (-4) (-4)
, _itAttachment = Nothing
}
@@ -1007,7 +1007,7 @@ retireRemoteBomb itid 0 ptid w
= set (pointToItem (_itemPositions w IM.! itid) . itAttachment . _Just . scopePos)
(0,0)
$ set (pointToItem (_itemPositions w IM.! itid) . itZoom)
basicItZoom
defaultItZoom
$ set (pointToItem (_itemPositions w IM.! itid) . twFire)
throwRemoteBomb
(w & projectiles %~ IM.delete ptid)
@@ -1047,7 +1047,7 @@ moveRemoteBomb itid time pID w
-> w' & creatures . ix cid . crInv . ix invid . itAttachment
. _Just . scopePos .~ (newPos -.- _crPos (_creatures w' IM.! cid))
& creatures . ix cid . crInv . ix invid . itZoom
.~ (basicItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5})
.~ (defaultItZoom {_itAimZoomMax = 0.5, _itAimZoomMin = 0.5})
_ -> w'
pt = _projectiles w IM.! pID
oldPos = _ptPos pt
@@ -1230,7 +1230,7 @@ grenade = Throwable
, _twFire = throwGrenade fuseTime
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom {_itAimZoomMax = (f fuseTime), _itAimZoomMin = (f fuseTime)}
, _itZoom = defaultItZoom {_itAimZoomMax = (f fuseTime), _itAimZoomMin = (f fuseTime)}
, _itEquipPict = drawWeapon $ grenadePic fuseTime
, _itID = Nothing
, _itAttachment = Just $ ItFuse fuseTime
@@ -1250,7 +1250,7 @@ increaseFuse fuse i w = w & creatures . ix 0 . crInv . ix itRef . itScrollUp .~
& creatures . ix 0 . crInv . ix itRef . itName .~ "GRENADE " ++ show newTime
& creatures . ix 0 . crInv . ix itRef . itAttachment .~ Just (ItFuse newTime)
& creatures . ix 0 . crInv . ix itRef . itZoom
.~ (basicItZoom {_itAimZoomMax = zm, _itAimZoomMin = zm})
.~ (defaultItZoom {_itAimZoomMax = zm, _itAimZoomMin = zm})
where itRef = fromMaybe (-2) $ w ^? creatures . ix 0 . crInvSel
newTime = min (fuse + 5) 90
zm = 50 / fromIntegral newTime
@@ -1262,7 +1262,7 @@ decreaseFuse fuse i w = w & creatures . ix 0 . crInv . ix itRef . itScrollUp .~
& creatures . ix 0 . crInv . ix itRef . itName .~ "GRENADE " ++ show newTime
& creatures . ix 0 . crInv . ix itRef . itAttachment .~ Just (ItFuse newTime)
& creatures . ix 0 . crInv . ix itRef . itZoom
.~ (basicItZoom {_itAimZoomMax = zm, _itAimZoomMin = zm})
.~ (defaultItZoom {_itAimZoomMax = zm, _itAimZoomMin = zm})
where itRef = fromMaybe (-2) $ w ^? creatures . ix 0 . crInvSel
newTime = max (fuse - 5) 20
zm = 50 / fromIntegral newTime
@@ -1648,7 +1648,7 @@ pipe = Craftable
, _itInvDisplay = _itName
, _itInvColor = green
}
magShield = basicEquipment
magShield = defaultEquipment
{ _itIdentity = MagShield
, _itName = "MAGSHIELD"
, _itMaxStack = 1
@@ -1657,7 +1657,7 @@ magShield = basicEquipment
, _itEquipPict = \cr _ -> blank
, _itID = Nothing
}
flameShield = basicEquipment
flameShield = defaultEquipment
{ _itIdentity = FlameShield
, _itName = "FLAMESHIELD"
, _itMaxStack = 1
@@ -1668,7 +1668,7 @@ flameShield = basicEquipment
)
, _itID = Nothing
}
frontArmour = basicEquipment
frontArmour = defaultEquipment
{ _itIdentity = FrontArmour
, _itName = "FARMOUR"
, _itMaxStack = 1
@@ -1685,7 +1685,7 @@ frontArmour = basicEquipment
, _itEffect = NoItEffect
, _itID = Nothing
}
jetPack = basicEquipment
jetPack = defaultEquipment
{ _itIdentity = JetPack
, _itName = "JETPACK"
, _itMaxStack = 1
@@ -1700,7 +1700,7 @@ jetPack = basicEquipment
}
latchkey :: Int -> Item
latchkey n = basicEquipment
latchkey n = defaultEquipment
{ _itIdentity = Generic
, _itName = "KEY "++show n
, _itMaxStack = 1
@@ -1712,7 +1712,7 @@ latchkey n = basicEquipment
, _itID = Nothing
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom
, _itZoom = defaultItZoom
, _itInvColor = yellow
, _itInvDisplay = _itName
}
@@ -1859,7 +1859,7 @@ radar = defaultGun
, _itAmount = 1
, _itMaxStack = 1
, _itAimingRange = 1
, _itZoom = basicItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itZoom = defaultItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itEquipPict = drawWeapon $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
@@ -1880,7 +1880,7 @@ sonar = defaultGun
, _itAmount = 1
, _itMaxStack = 1
, _itAimingRange = 1
, _itZoom = basicItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itZoom = defaultItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itEquipPict = drawWeapon $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
@@ -1968,7 +1968,7 @@ mvRadar x p w pt = (putBlips w, Just $ pt {_ptDraw = const pic
| otherwise = fromIntegral x / 10
colHelper y = color (withAlpha (y * globalAlpha) red)
autoSonar = basicEquipment
autoSonar = defaultEquipment
{ _itIdentity = Generic
, _itName = "AUTOSONAR"
, _itMaxStack = 1
@@ -1979,9 +1979,9 @@ autoSonar = basicEquipment
, _itID = Nothing
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itZoom = defaultItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
}
autoRadar = basicEquipment
autoRadar = defaultEquipment
{ _itIdentity = Generic
, _itName = "AUTORADAR"
, _itMaxStack = 1
@@ -1992,7 +1992,7 @@ autoRadar = basicEquipment
, _itID = Nothing
, _itAimingSpeed = 1
, _itAimingRange = 0
, _itZoom = basicItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
, _itZoom = defaultItZoom {_itAimZoomMax = 1, _itZoomMax = 1}
}
autoRadarEffect :: ItEffect