Improve detector equipment, various cleanup
This commit is contained in:
@@ -3,7 +3,8 @@ import Dodge.Data
|
||||
--import Dodge.Picture.Layer
|
||||
import Dodge.Default
|
||||
import Dodge.Item.Draw
|
||||
import Dodge.Item.Equipment
|
||||
--import Dodge.Item.Equipment
|
||||
import Dodge.Item.Equipment.Shape
|
||||
import Dodge.Item.Weapon.TriggerType
|
||||
import Dodge.Item.Weapon.ExtraEffect
|
||||
import Dodge.Item.Weapon.UseEffect
|
||||
@@ -14,22 +15,22 @@ import Dodge.SoundLogic
|
||||
import Geometry
|
||||
import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
--import ShapePicture
|
||||
|
||||
import Control.Lens
|
||||
|
||||
{- |
|
||||
Sends out pulses that display walls. -}
|
||||
radar :: Item
|
||||
radar = defaultGun
|
||||
{ _itName = "RADAR"
|
||||
, _itType = RADAR
|
||||
clickDetector :: Detector -> Item
|
||||
clickDetector dt = defaultGun
|
||||
{ _itName = show dt
|
||||
, _itType = CLICKDETECTOR dt
|
||||
, _itConsumption = defaultAmmo
|
||||
{ _ammoBaseMax = 100
|
||||
, _ammoLoaded = 100
|
||||
, _reloadTime = 200
|
||||
}
|
||||
, _itUse = ruseRate 120 (const aWallPulse) upHammer
|
||||
, _itUse = ruseRate 20 (detectorEffect dt) upHammer
|
||||
[ ammoUseCheck
|
||||
]
|
||||
& useAim . aimRange .~ 1
|
||||
@@ -37,62 +38,27 @@ radar = defaultGun
|
||||
-- , _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)
|
||||
, _itID = Nothing
|
||||
} & itUse . eqSite .~ GoesOnWrist
|
||||
& itUse . eqUse .~ autoSonarEffect
|
||||
& itUse . eqParams .~ EquipCounter 0
|
||||
{- |
|
||||
Automatically sends out pulses that display walls. -}
|
||||
autoRadar :: Item
|
||||
autoRadar = defaultEquipment
|
||||
{ _itType = RADAR
|
||||
, _itName = "WALLFINDER"
|
||||
, _itEquipPict = shapeForWrist (colorSH red $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
|
||||
autoDetector :: Detector -> Item
|
||||
autoDetector dt = defaultEquipment
|
||||
{ _itType = AUTODETECTOR dt
|
||||
, _itName = "AUTO-" ++ show dt
|
||||
, _itEquipPict = shapeForWrist (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
-- , _itEffect = autoRadarEffect
|
||||
, _itID = Nothing
|
||||
}
|
||||
& itUse . eqSite .~ GoesOnWrist
|
||||
& itUse . eqUse .~ autoRadarEffect
|
||||
& itUse . eqUse .~ autoEffect (detectorEffect dt) 100 click1S
|
||||
& itUse . eqParams .~ EquipCounter 0
|
||||
|
||||
{- |
|
||||
Automatically sends out pulses that display walls. -}
|
||||
itemFinder :: Item
|
||||
itemFinder = defaultEquipment
|
||||
{ _itType = ITEMFINDER
|
||||
, _itName = "ITEMFINDER"
|
||||
, _itEquipPict = shapeForWrist (colorSH blue $ upperPrismPoly 3 $ rectWH 2 2)
|
||||
-- , _itEffect = autoRadarEffect
|
||||
, _itID = Nothing
|
||||
}
|
||||
& itUse . eqSite .~ GoesOnWrist
|
||||
& itUse . eqUse .~ autoEffect anItemFindPulse 100 click1S
|
||||
& itUse . eqParams .~ EquipCounter 0
|
||||
detectorColor :: Detector -> Color
|
||||
detectorColor dt = case dt of
|
||||
ITEMDETECTOR -> blue
|
||||
CREATUREDETECTOR -> green
|
||||
WALLDETECTOR -> red
|
||||
|
||||
shapeForWrist :: Shape -> Creature -> Item -> SPic
|
||||
shapeForWrist = pictureOnEquip . noPic . translateSH (V3 0 4 (-4))
|
||||
detectorEffect :: Detector -> Item -> Creature -> World -> World
|
||||
detectorEffect dt = case dt of
|
||||
ITEMDETECTOR -> const anItemFindPulse
|
||||
CREATUREDETECTOR -> const aSonarPulse
|
||||
WALLDETECTOR -> const aWallPulse
|
||||
|
||||
Reference in New Issue
Block a user