Files
loop/src/Dodge/Item/Weapon/Radar.hs
T
2022-05-22 23:55:10 +01:00

80 lines
2.3 KiB
Haskell

module Dodge.Item.Weapon.Radar where
import Dodge.Data
--import Dodge.Picture.Layer
import Dodge.Default
import Dodge.Item.Draw
import Dodge.Item.Equipment
import Dodge.Item.Weapon.TriggerType
import Dodge.Item.Weapon.ExtraEffect
import Dodge.Item.Weapon.UseEffect
--import Dodge.Item.Weapon.Remote
import Dodge.Default.Weapon
--import Dodge.Item.Weapon.Grenade
import Geometry
import Picture
import Shape
import ShapePicture
import Control.Lens
{- |
Sends out pulses that display walls. -}
radar :: Item
radar = defaultGun
{ _itName = "RADAR"
, _itType = RADAR
, _itConsumption = defaultAmmo
{ _ammoBaseMax = 100
, _ammoLoaded = 100
, _reloadTime = 200
}
, _itUse = ruseRate 120 (const aRadarPulse) upHammer
[ ammoUseCheck
]
& useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
-- , _itZoom = defaultItZoom { _itZoomMax = 1}
, _itEquipPict = pictureWeaponAim $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
{- |
Sends out pulses that display creatures. -}
sonar :: Item
sonar = defaultGun
{ _itName = "SONAR"
, _itType = RADAR
, _itConsumption = defaultAmmo
{ _ammoBaseMax = 100
, _ammoLoaded = 100
, _reloadTime = 200
}
, _itUse = ruseRate 120 (const aSonarPulse) upHammer
[ ammoUseCheck
]
& useAim . aimRange .~ 1
& useAim . aimZoom .~ defaultItZoom {_itZoomFac = 1}
, _itEquipPict = pictureWeaponAim $ \_ -> (,) emptySH $ color blue $ polygon $ rectNESW 5 5 (-5) (-5)
}
{- |
Automatically sends out pulses that display creatures. -}
autoSonar :: Item
autoSonar = defaultEquipment
{ _itType = RADAR
, _itName = "AUTOSONAR"
, _itEquipPict = shapeForWrist (colorSH red $ upperPrismPoly 3 $ rectWH 2 2)
, _itEffect = autoSonarEffect
, _itID = Nothing
} & itUse . eqSite .~ GoesOnWrist
{- |
Automatically sends out pulses that display walls. -}
autoRadar :: Item
autoRadar = defaultEquipment
{ _itType = RADAR
, _itName = "AUTORADAR"
, _itEquipPict = shapeForWrist (colorSH yellow $ upperPrismPoly 3 $ rectWH 2 2)
, _itEffect = autoRadarEffect
, _itID = Nothing
} & itUse . eqSite .~ GoesOnWrist
shapeForWrist :: Shape -> Creature -> Item -> SPic
shapeForWrist = pictureOnEquip . noPic . translateSH (V3 0 4 (-4))