Cleanup
This commit is contained in:
+14
-10
@@ -5,13 +5,13 @@ module Dodge.Item.Display (
|
||||
basicItemDisplay,
|
||||
) where
|
||||
|
||||
import Dodge.Item.InvSize
|
||||
import Dodge.Data.ComposedItem
|
||||
import ShortShow
|
||||
import Data.Maybe
|
||||
import Dodge.Data.ComposedItem
|
||||
import Dodge.Data.Creature
|
||||
import Dodge.Item.InvSize
|
||||
import LensHelp
|
||||
import Padding
|
||||
import ShortShow
|
||||
|
||||
itemDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemDisplay cr ci =
|
||||
@@ -60,8 +60,12 @@ showAttachItem :: AttachType -> Item -> String
|
||||
showAttachItem t itm = case t of
|
||||
ZOOMSCOPE -> "ZOOMSCOPE"
|
||||
BULLETSYNTH -> "BSYNTH"
|
||||
REMOTESCREEN -> "REMOTE SCREEN " ++ maybe mempty show
|
||||
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
|
||||
REMOTESCREEN ->
|
||||
"REMOTE SCREEN "
|
||||
++ maybe
|
||||
mempty
|
||||
show
|
||||
(itm ^? itUse . uaParams . apLinkedProjectile . _Just)
|
||||
HOMINGMODULE -> "HOMING MOD"
|
||||
AUGMENTEDHUD -> "AUGMENTED HUD"
|
||||
|
||||
@@ -72,13 +76,13 @@ showEquipItem eit = case eit of
|
||||
|
||||
itemNumberDisplay :: Creature -> ComposedItem -> [String]
|
||||
itemNumberDisplay cr ci
|
||||
| EQUIP WRIST_ECG <- ci ^. _1 . itType
|
||||
= [displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
||||
| WeaponTargetingSF <- ci ^. _2
|
||||
= [maybe "" (const "!TARG!") (ci ^? _1 . itTargeting . itTgPos . _Just)]
|
||||
| EQUIP WRIST_ECG <- ci ^. _1 . itType =
|
||||
[displayPulse $ cr ^?! crType . avatarPulse . pulseProgress]
|
||||
| isJust $ ci ^? _1 . itTargeting . itTgPos . _Just =
|
||||
["!TARG!"]
|
||||
| Just x <- ci ^? _1 . itConsumables . magLoadStatus . iaLoaded = [shortShow x]
|
||||
| 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]
|
||||
| otherwise = mempty
|
||||
|
||||
displayPulse :: Int -> String
|
||||
|
||||
@@ -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