Cleanup
This commit is contained in:
@@ -5,13 +5,13 @@ module Dodge.Item.Display (
|
|||||||
basicItemDisplay,
|
basicItemDisplay,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Dodge.Item.InvSize
|
|
||||||
import Dodge.Data.ComposedItem
|
|
||||||
import ShortShow
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
import Dodge.Data.ComposedItem
|
||||||
import Dodge.Data.Creature
|
import Dodge.Data.Creature
|
||||||
|
import Dodge.Item.InvSize
|
||||||
import LensHelp
|
import LensHelp
|
||||||
import Padding
|
import Padding
|
||||||
|
import ShortShow
|
||||||
|
|
||||||
itemDisplay :: Creature -> ComposedItem -> [String]
|
itemDisplay :: Creature -> ComposedItem -> [String]
|
||||||
itemDisplay cr ci =
|
itemDisplay cr ci =
|
||||||
@@ -60,7 +60,11 @@ showAttachItem :: AttachType -> Item -> String
|
|||||||
showAttachItem t itm = case t of
|
showAttachItem t itm = case t of
|
||||||
ZOOMSCOPE -> "ZOOMSCOPE"
|
ZOOMSCOPE -> "ZOOMSCOPE"
|
||||||
BULLETSYNTH -> "BSYNTH"
|
BULLETSYNTH -> "BSYNTH"
|
||||||
REMOTESCREEN -> "REMOTE SCREEN " ++ maybe mempty show
|
REMOTESCREEN ->
|
||||||
|
"REMOTE SCREEN "
|
||||||
|
++ maybe
|
||||||
|
mempty
|
||||||
|
show
|
||||||
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
|
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
|
||||||
HOMINGMODULE -> "HOMING MOD"
|
HOMINGMODULE -> "HOMING MOD"
|
||||||
AUGMENTEDHUD -> "AUGMENTED HUD"
|
AUGMENTEDHUD -> "AUGMENTED HUD"
|
||||||
@@ -72,10 +76,10 @@ showEquipItem eit = case eit of
|
|||||||
|
|
||||||
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
||||||
itemNumberDisplay cr ci
|
itemNumberDisplay cr ci
|
||||||
| EQUIP WRIST_ECG <- ci ^. _1 . itType
|
| EQUIP WRIST_ECG <- ci ^. _1 . itType =
|
||||||
= [displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
[displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
||||||
| WeaponTargetingSF <- ci ^. _2
|
| isJust $ ci ^? _1 . itTargeting . itTgPos . _Just =
|
||||||
= [maybe "" (const "!TARG!") (ci ^? _1 . itTargeting . itTgPos . _Just)]
|
["!TARG!"]
|
||||||
| Just x <- ci ^? _1 . itConsumables . magLoadStatus . iaLoaded = [shortShow x]
|
| Just x <- ci ^? _1 . itConsumables . magLoadStatus . iaLoaded = [shortShow x]
|
||||||
| UseAttach (APInt i) <- ci ^. _1 . itUse = [show i]
|
| UseAttach (APInt i) <- ci ^. _1 . itUse = [show i]
|
||||||
| UseScope OpticScope{_opticZoom = x} <- ci ^. _1 . itUse = [shortShow x]
|
| UseScope OpticScope{_opticZoom = x} <- ci ^. _1 . itUse = [shortShow x]
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
--{-# LANGUAGE BangPatterns #-}
|
|
||||||
|
|
||||||
{- |
|
|
||||||
Extra weapon effects, supplementing explicit use effects.
|
|
||||||
-}
|
|
||||||
module Dodge.Item.Weapon.ExtraEffect (
|
|
||||||
-- autoSonarEffect,
|
|
||||||
autoEffect,
|
|
||||||
-- autoRadarEffect,
|
|
||||||
) where
|
|
||||||
|
|
||||||
import Dodge.Data.World
|
|
||||||
--import Dodge.RadarSweep
|
|
||||||
import Dodge.SoundLogic
|
|
||||||
import LensHelp
|
|
||||||
import Sound.Data
|
|
||||||
|
|
||||||
autoEffect :: (Item -> Creature -> World -> World) -> Int -> SoundID -> Item -> Creature -> World -> World
|
|
||||||
autoEffect eff t sid itm cr w
|
|
||||||
| _eparamInt (_eeParams (_uequipEffect $ _itUse itm)) < 1 =
|
|
||||||
eff itm cr w
|
|
||||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (_ilInvID $ _itLocation itm)
|
|
||||||
. itUse
|
|
||||||
. uequipEffect
|
|
||||||
. eeParams
|
|
||||||
. eparamInt
|
|
||||||
.~ t
|
|
||||||
& soundStart OnceSound (_crPos cr) sid Nothing
|
|
||||||
| otherwise =
|
|
||||||
w
|
|
||||||
& cWorld . lWorld . creatures . ix (_crID cr) . crInv . ix (_ilInvID $ _itLocation itm)
|
|
||||||
. itUse
|
|
||||||
. uequipEffect
|
|
||||||
. eeParams
|
|
||||||
. 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 sonar pulses that detect creatures.
|
|
||||||
--autoSonarEffect :: Item -> Creature -> World -> World
|
|
||||||
--autoSonarEffect = autoEffect (const (aRadarPulse ObCreature)) 50 click1S
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user