Tweaks concerning item types
This commit is contained in:
+18
-12
@@ -94,22 +94,28 @@ showAutoRechargeProgress lc = case lc of
|
||||
-- ic = (itm ^?! itUse . heldConsumption . laSource)
|
||||
|
||||
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemNumberDisplay cr ci = case (ci ^. _2, itm ^?! itUse) of
|
||||
(WeaponTargetingSF,_)
|
||||
itemNumberDisplay cr ci = case (ci ^. _2, itm ^?! itUse, itm ^. itType) of
|
||||
(_,_,EQUIP WRIST_ECG) -> [displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
||||
(WeaponTargetingSF,_,_)
|
||||
-> [maybe "" (const "!TARG!") (itm ^? itTargeting . itTgPos . _Just)]
|
||||
(_,UseHeld{}) -> []
|
||||
(_,UseHotkey{_leftConsumption=lc}) -> [showAutoRechargeProgress lc]
|
||||
(_,UseEquip{}) -> showEquipmentNumber cr itm
|
||||
(_,UseCraft) -> []
|
||||
(_,UseConsume {}) -> []
|
||||
(_,UseAttach (APInt i)) -> [show i]
|
||||
(_,UseAttach {}) -> []
|
||||
(_,UseAmmoMag {}) -> [maybe "" shortShow $ itm ^? itUse . amagLoadStatus . iaLoaded]
|
||||
(_,UseScope OpticScope {_opticZoom = x}) -> [shortShow x]
|
||||
(_,UseBulletMod {}) -> mempty
|
||||
(_,UseHeld{},_) -> []
|
||||
(_,UseHotkey{_leftConsumption=lc},_) -> [showAutoRechargeProgress lc]
|
||||
(_,UseEquip{},_) -> showEquipmentNumber cr itm
|
||||
(_,UseCraft,_) -> []
|
||||
(_,UseConsume {},_) -> []
|
||||
(_,UseAttach (APInt i),_) -> [show i]
|
||||
(_,UseAttach {},_) -> []
|
||||
(_,UseAmmoMag {},_) -> [maybe "" shortShow $ itm ^? itUse . amagLoadStatus . iaLoaded]
|
||||
(_,UseScope OpticScope {_opticZoom = x},_) -> [shortShow x]
|
||||
(_,UseBulletMod {},_) -> mempty
|
||||
where
|
||||
itm = ci ^. _1
|
||||
|
||||
displayPulse :: Int -> String
|
||||
displayPulse x = take 5 $ drop y "----^-----"
|
||||
where
|
||||
y = min 5 $ x `div` 3
|
||||
|
||||
showEquipmentNumber :: Creature -> Item -> [String]
|
||||
showEquipmentNumber _ itm = case _eeUse ee of
|
||||
EFuelSource x _ -> [show x]
|
||||
|
||||
@@ -65,7 +65,7 @@ fractionLoadedAmmo rs = fromIntegral (_iaLoaded rs) / fromIntegral (_iaMax rs)
|
||||
|
||||
equipItemSPic :: EquipItemType -> Item -> SPic
|
||||
equipItemSPic et _ = case et of
|
||||
PULSECHECKER -> defSPic
|
||||
WRIST_ECG -> defSPic
|
||||
MAGSHIELD -> defSPic
|
||||
FLAMESHIELD -> defSPic
|
||||
FRONTARMOUR -> defSPic
|
||||
@@ -209,7 +209,7 @@ heldItemSPic ht it = case ht of
|
||||
POISONSPRAYER -> flamerPic it
|
||||
DRONELAUNCHER -> defSPic
|
||||
SHATTERGUN -> shatterGunSPic
|
||||
HELDDETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPolySU 3 $ rectWH 2 2)
|
||||
DETECTOR dt -> noPic (colorSH (detectorColor dt) $ upperPrismPolySU 3 $ rectWH 2 2)
|
||||
KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi / 2.5) keyPic)
|
||||
|
||||
torchShape :: Shape
|
||||
|
||||
@@ -129,4 +129,4 @@ pulseChecker :: Item
|
||||
pulseChecker =
|
||||
defaultEquipment
|
||||
& itUse . uequipEffect . eeSite .~ GoesOnWrist
|
||||
& itType .~ EQUIP PULSECHECKER
|
||||
& itType .~ EQUIP WRIST_ECG
|
||||
|
||||
@@ -53,7 +53,7 @@ itemToBreakLists ::
|
||||
([(ItemStructuralFunction, ComposeLinkType)], [(ItemStructuralFunction, ComposeLinkType)])
|
||||
itemToBreakLists itm itmf = case (itm ^. itType, itmf) of
|
||||
(HELD TORCH, _) -> (getAmmoLinks itm, [])
|
||||
(_, WeaponPlatformSF) ->
|
||||
(_, HeldPlatformSF) ->
|
||||
( getAmmoLinks itm
|
||||
, [(WeaponTargetingSF, WeaponTargetingLink), (WeaponScopeSF, WeaponScopeLink)]
|
||||
)
|
||||
@@ -83,7 +83,7 @@ getAmmoLinks itm =
|
||||
itemToFunction :: Item -> ItemStructuralFunction
|
||||
itemToFunction itm = case itm ^. itType of
|
||||
HELD LASER -> WeaponTargetingSF
|
||||
HELD{} -> WeaponPlatformSF
|
||||
HELD{} -> HeldPlatformSF
|
||||
AMMOMAG{} -> maybe UncomposableIsolateSF AmmoMagSF $ itm ^? itUse . amagType
|
||||
ATTACH REMOTESCREEN -> RemoteScreenSF
|
||||
ATTACH BULLETSYNTH -> AmmoModifierSF BulletAmmo
|
||||
@@ -125,7 +125,7 @@ toLasgunUpdate :: Item -> LinkUpdate
|
||||
toLasgunUpdate itm =
|
||||
LUpdate
|
||||
(ILink FunctionChangeLink orientAttachment)
|
||||
(\(par, _, _) -> (par, WeaponPlatformSF, uncurry useBreakL $ itemToBreakLists itm WeaponPlatformSF))
|
||||
(\(par, _, _) -> (par, HeldPlatformSF, uncurry useBreakL $ itemToBreakLists itm HeldPlatformSF))
|
||||
(\(chi, _, up) -> (chi, FunctionChangeSF, up))
|
||||
|
||||
--itemLinkTestLeft :: Item -> PartiallyComposedItem -> Maybe LinkUpdate
|
||||
|
||||
@@ -64,5 +64,5 @@ itemFromHeldType ht = case ht of
|
||||
-- REMOTELAUNCHER -> remoteLauncher
|
||||
POISONSPRAYER -> poisonSprayer
|
||||
DRONELAUNCHER -> undefined
|
||||
HELDDETECTOR d -> clickDetector d
|
||||
DETECTOR d -> clickDetector d
|
||||
FLATSHIELD -> flatShield
|
||||
|
||||
@@ -38,5 +38,5 @@ clickDetector dt =
|
||||
& itUse . heldDelay . rateMax .~ 20
|
||||
& itUse . heldAim . aimRange .~ 1
|
||||
& itUse . heldAim . aimZoom .~ defaultItZoom{_izFac = 1}
|
||||
& itType .~ HELD (HELDDETECTOR dt)
|
||||
& itType .~ HELD (DETECTOR dt)
|
||||
& itUse . heldAim . aimMuzzles . ix 0 . mzEffect .~ MuzzleDetector
|
||||
|
||||
@@ -86,7 +86,7 @@ heldInfo hit = case hit of
|
||||
DRONELAUNCHER -> "A device for launching drones."
|
||||
SHATTERGUN -> "A seismic device that shatters hard items in its line of fire."
|
||||
-- FORCEFIELDGUN -> "A device that produces a durable forcefield."
|
||||
HELDDETECTOR d -> "A device that detects " ++ detectorInfo d ++ " in an expanding radius."
|
||||
DETECTOR d -> "A device that detects " ++ detectorInfo d ++ " in an expanding radius."
|
||||
TORCH -> "A stick with a light on the end."
|
||||
FLATSHIELD -> "A panel of metal that blocks unwanted objects from the front of the user."
|
||||
KEYCARD i -> "A keycard. It is labelled " ++ show i ++ "."
|
||||
@@ -119,7 +119,7 @@ equipInfo eit = case eit of
|
||||
BULLETBELTBRACER -> "A container holding a long belt of bullets."
|
||||
BATTERYPACK -> "A collection of batteries with a universal adapter."
|
||||
AUTODETECTOR d -> "A device that detects " ++ detectorInfo d ++ " in an expanding radius. Pulses automatically. "
|
||||
PULSECHECKER -> "A device that detects heartbeats."
|
||||
WRIST_ECG -> "A wristworn device that detects the hearts electrical activity."
|
||||
|
||||
--targetingInfo :: TargetingType -> String
|
||||
--targetingInfo tt = case tt of
|
||||
|
||||
@@ -10,8 +10,9 @@ import Dodge.Data.ComposedItem
|
||||
|
||||
itemInvColor :: ComposedItem -> Color
|
||||
itemInvColor ci = case ci ^. _2 of
|
||||
WeaponPlatformSF -> white
|
||||
HeldPlatformSF -> white
|
||||
EquipmentPlatformSF -> yellow
|
||||
GadgetPlatformSF -> blue
|
||||
WeaponScopeSF -> chartreuse
|
||||
WeaponTargetingSF -> green
|
||||
AugmentedHUDSF -> rose
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
Extra weapon effects, supplementing explicit use effects.
|
||||
-}
|
||||
module Dodge.Item.Weapon.ExtraEffect (
|
||||
autoSonarEffect,
|
||||
-- autoSonarEffect,
|
||||
autoEffect,
|
||||
autoRadarEffect,
|
||||
-- autoRadarEffect,
|
||||
) where
|
||||
|
||||
import Dodge.Data.World
|
||||
import Dodge.RadarSweep
|
||||
--import Dodge.RadarSweep
|
||||
import Dodge.SoundLogic
|
||||
import LensHelp
|
||||
import Sound.Data
|
||||
@@ -35,11 +35,11 @@ autoEffect eff t sid itm cr w
|
||||
. eparamInt
|
||||
-~ 1
|
||||
|
||||
-- | Automatically send out radar pulses that detect walls.
|
||||
autoRadarEffect :: Item -> Creature -> World -> World
|
||||
autoRadarEffect = autoEffect (const (aRadarPulse ObWall)) 100 click1S
|
||||
---- | Automatically send out radar pulses that detect walls.
|
||||
--autoRadarEffect :: Item -> Creature -> World -> World
|
||||
--autoRadarEffect = autoEffect (const (aRadarPulse ObWall)) 100 click1S
|
||||
|
||||
-- | Automatically send out sonar pulses that detect creatures.
|
||||
autoSonarEffect :: Item -> Creature -> World -> World
|
||||
autoSonarEffect = autoEffect (const (aRadarPulse ObCreature)) 50 click1S
|
||||
--autoSonarEffect :: Item -> Creature -> World -> World
|
||||
--autoSonarEffect = autoEffect (const (aRadarPulse ObCreature)) 50 click1S
|
||||
|
||||
|
||||
Reference in New Issue
Block a user