diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index 7db29f68d..13899cd95 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -535,7 +535,6 @@ data ItemConsumption data Item = Item { _itConsumption :: ItemConsumption , _itUse :: ItemUse --- , _itEquipPict :: Creature -> Item -> SPic , _itType :: ItemType , _itAttachment :: ItAttachment , _itID :: Maybe Int @@ -570,7 +569,7 @@ data ItemDimension = ItemDimension { _dimRad :: Float , _dimCenter :: Point3 -- , _dimPortage :: ItemPortage - , _dimSPic :: Item -> SPic +-- , _dimSPic :: Item -> SPic } data ItemPortage = HeldItem diff --git a/src/Dodge/Default.hs b/src/Dodge/Default.hs index 72c112525..376a05506 100644 --- a/src/Dodge/Default.hs +++ b/src/Dodge/Default.hs @@ -160,7 +160,6 @@ defaultState = CrSt defaultEquipment :: Item defaultEquipment = defaultItem { _itInvColor = yellow - , _itDimension = defItDimCol yellow , _itUse = EquipUse defaultEquip , _itAttachment = NoItAttachment } @@ -170,7 +169,6 @@ defaultConsumable :: Item defaultConsumable = defaultItem { _itConsumption = ItemItselfConsumable {_icAmount = 1} , _itInvColor = blue - , _itDimension = defItDimCol blue } defaultFlIt :: FloorItem diff --git a/src/Dodge/Default/Item.hs b/src/Dodge/Default/Item.hs index 49ea63b9c..b16123c7c 100644 --- a/src/Dodge/Default/Item.hs +++ b/src/Dodge/Default/Item.hs @@ -16,7 +16,7 @@ defaultItem = Item , _itInvColor = yellow , _itInvSize = 1 , _itPos = VoidItm - , _itDimension = ItemDimension 0 0 (const mempty) + , _itDimension = ItemDimension 2 0 , _itConsumption = NoConsumption , _itUse = NoUse , _itAttachment = NoItAttachment diff --git a/src/Dodge/Default/Weapon.hs b/src/Dodge/Default/Weapon.hs index 9cd2c8e79..0e23c84fe 100644 --- a/src/Dodge/Default/Weapon.hs +++ b/src/Dodge/Default/Weapon.hs @@ -8,11 +8,6 @@ import Dodge.Default.Item import Dodge.Default.AimParams --import Dodge.Item.Draw import Picture -import ShapePicture -import Shape ---import Geometry.Vector3D -import Geometry ---import Dodge.TweakBullet import qualified Data.Map.Strict as M import Control.Lens @@ -103,7 +98,6 @@ defaultWeapon :: Item defaultWeapon = defaultItem & itConsumption .~ defaultLoadable & itUse .~ defaultrUse - & itDimension .~ defItDimCol white & itInvColor .~ white & itType . iyModules .~ M.fromList [(ModBullet, EMPTYMODULE) @@ -122,19 +116,6 @@ defaultItemValue = ItemValue 10 MundaneItem defaultCraftable :: Item defaultCraftable = defaultItem { _itInvColor = green - , _itDimension = defItDimCol green - } -defItDim :: ItemDimension -defItDim = ItemDimension - { _dimRad = 2 - , _dimCenter = V3 0 0 0 - , _dimSPic = const $ noPic $ colorSH green $ upperPrismPoly 3 $ square 4 - } -defItDimCol :: Color -> ItemDimension -defItDimCol col = ItemDimension - { _dimRad = 2 - , _dimCenter = V3 0 0 0 - , _dimSPic = const $ noPic $ colorSH col $ upperPrismPoly 3 $ square 4 } defBulletShooter :: ItemParams defBulletShooter = BulletShooter diff --git a/src/Dodge/Item/Draw.hs b/src/Dodge/Item/Draw.hs index 7376c2054..66923b629 100644 --- a/src/Dodge/Item/Draw.hs +++ b/src/Dodge/Item/Draw.hs @@ -2,37 +2,31 @@ module Dodge.Item.Draw ( pictureWeaponOnAim , pictureWeaponAim , twoFlatHRot - , itSPic + , itemSPic , itemEquipPict ) where import Dodge.Data ---import Dodge.Picture.Layer ---import Picture ---import Shape import ShapePicture import Dodge.Creature.HandPos import Dodge.Item.Equipment.Shape +import Dodge.Item.Draw.SPic import qualified Data.IntMap.Strict as IM import Control.Lens import Data.Maybe - itemEquipPict :: Creature -> Item -> SPic itemEquipPict cr it = case it ^?! itUse of RightUse {} -> pictureWeaponOnAim cr it ituse -> case ituse ^? eqEq of - Just _ -> pictureOnEquip (itSPic it) cr it + Just _ -> pictureOnEquip (itemSPic it) cr it Nothing -> mempty pictureWeaponOnAim :: Creature -> Item -> SPic -pictureWeaponOnAim = pictureWeaponAim itSPic - -itSPic :: Item -> SPic -itSPic it = _dimSPic (_itDimension it) it +pictureWeaponOnAim = pictureWeaponAim itemSPic pictureWeaponAim :: (Item -> SPic) diff --git a/src/Dodge/Item/Draw/SPic.hs b/src/Dodge/Item/Draw/SPic.hs index 4e7e486c0..430dadc2d 100644 --- a/src/Dodge/Item/Draw/SPic.hs +++ b/src/Dodge/Item/Draw/SPic.hs @@ -1,98 +1,117 @@ module Dodge.Item.Draw.SPic where +import Dodge.Data +import Dodge.Item.Weapon.AmmoParams +import ShapePicture +import Shape +import LensHelp +import Color +import Picture +import Geometry + +import Data.Maybe itemSPic :: Item -> SPic itemSPic it = modulesSPic it <> case it ^. itType . iyBase of HELD ht -> heldItemSPic ht it - _ -> mempty --- NOTDEFINED -> --- EFFGUN _ -> --- AUTOEFFGUN _ -> --- --- --- BOOSTER --- REWINDER --- BLINKER --- BLINKERUNSAFE --- FORCEFIELDGUN --- SHRINKER --- SPAWNER --- --- CLICKDETECTOR Detector --- AUTODETECTOR Detector --- MAGSHIELD --- FLAMESHIELD --- FRONTARMOUR --- WRISTARMOUR --- INVISIBILITYEQUIPMENT EquipSite --- BRAINHAT --- HEADLAMP --- HEADLAMP1 --- POWERLEGS --- SPEEDLEGS --- JUMPLEGS --- FLATSHIELD --- JETPACK --- --- KEYCARD Int --- --- MEDKIT Int --- CRAFT CraftType + NOTDEFINED -> defSPic + EFFGUN _ -> defSPic + AUTOEFFGUN _ -> defSPic + BOOSTER -> defSPic + REWINDER -> defSPic + BLINKER -> defSPic + BLINKERUNSAFE -> defSPic + SHRINKER -> defSPic + SPAWNER -> defSPic +-- + CLICKDETECTOR dt -> (noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)) + AUTODETECTOR dt -> (noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)) + MAGSHIELD -> defSPic + FLAMESHIELD -> defSPic + FRONTARMOUR -> (emptySH , setDepth 20 $ pictures + [color yellow $ thickArc 0 (pi/2) 10 5 + ,color yellow $ thickArc (3*pi/2) (2*pi) 10 5 + ]) + WRISTARMOUR -> defSPic + INVISIBILITYEQUIPMENT _ -> (noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2)) + BRAINHAT -> noPic (colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4) + HEADLAMP -> noPic headLampShape + HEADLAMP1 -> noPic headLampShape + POWERLEGS -> legsSPic yellow + SPEEDLEGS -> legsSPic green + JUMPLEGS -> legsSPic red + FLATSHIELD -> flatShieldEquipSPic + JETPACK -> ((,) emptySH $ setDepth 20 + $ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ] + ) +-- + KEYCARD _ -> noShape (setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic) +-- + MEDKIT _ -> defSPic + CRAFT _ -> defSPic + +heldItemSPic :: HeldItemType -> Item -> SPic heldItemSPic ht it = case ht of - BANGSTICK i -> noPic & baseStickShapeX i <> stickClip it --- PISTOL -> --- REVOLVER -> --- REVOLVERX i -> --- MACHINEPISTOL -> --- AUTOPISTOL -> --- SMG -> --- BANGCONE -> --- BLUNDERBUSS -> --- GRAPECANNON i -> --- MINIGUNX i -> --- VOLLEYGUN i -> --- RIFLE -> --- REPEATER -> --- AUTORIFLE -> --- BURSTRIFLE -> --- BANGROD -> --- ELEPHANTGUN -> --- AMR -> --- AUTOAMR -> --- SNIPERRIFLE -> --- MACHINEGUN -> --- FLAMESPITTER -> --- FLAMETHROWER -> --- FLAMETORRENT -> --- FLAMEWALL -> --- BLOWTORCH -> --- AUTOGUN -> --- SPARKGUN -> --- TESLAGUN -> --- LASGUN -> --- LASCIRCLE -> --- DUALBEAM -> --- LASWIDE i -> --- SONICGUN -> --- TRACTORGUN -> --- LAUNCHER -> --- LAUNCHERX i -> --- REMOTELAUNCHER -> --- POISONSPRAYER -> --- DRONELAUNCHER -> --- SHATTERGUN -> + FORCEFIELDGUN -> defSPic + BANGSTICK i -> noPic $ baseStickShapeX it i <> stickClip it + PISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it + REVOLVER -> noPic $ baseStickShape <> revolverClip it + REVOLVERX _ -> noPic $ baseStickShape <> revolverClip it + MACHINEPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it + AUTOPISTOL -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it + SMG -> noPic (baseSMGShape <> makeTinClipAt 0 (V3 7 (-2) 0) it) + BANGCONE -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2) + <> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15) + BLUNDERBUSS -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2) + <> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30) + GRAPECANNON _ -> noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2) + <> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30) + MINIGUNX i -> miniGunXPictItem i it + VOLLEYGUN i -> volleyGunSPic i it + RIFLE -> noPic $ baseRifleShape <> makeSingleClipAt (V3 5 0 3) it + REPEATER -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + AUTORIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + BURSTRIFLE -> noPic $ baseRifleShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + BANGROD -> noPic $ baseRodShape <> makeSingleClipAt (V3 5 0 3) it + ELEPHANTGUN -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it + AMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + AUTOAMR -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + SNIPERRIFLE -> noPic $ baseAMRShape <> makeSingleClipAt (V3 5 0 3) it + MACHINEGUN -> noPic $ baseAMRShape <> makeTinClipAt 0 (V3 10 (-2) 0) it + FLAMESPITTER -> flamerPic it + FLAMETHROWER -> flamerPic it + FLAMETORRENT -> flamerPic it + FLAMEWALL -> flamerPic it + BLOWTORCH -> flamerPic it + AUTOGUN -> defSPic + SPARKGUN -> teslaGunPic + TESLAGUN -> teslaGunPic + LASGUN -> lasGunPic it + LASCIRCLE -> lasGunPic it + DUALBEAM -> dualBeamPic it + LASWIDE _ -> lasGunPic it + SONICGUN -> noPic baseSonicShape + TRACTORGUN -> tractorGunPic it + LAUNCHER -> launcherPic it + LAUNCHERX _ -> launcherPic it + REMOTELAUNCHER -> launcherPic it + POISONSPRAYER -> flamerPic it + DRONELAUNCHER -> defSPic + SHATTERGUN -> shatterGunSPic modulesSPic :: Item -> SPic -modulesSPic it = mempty +modulesSPic _ = mempty -baseStickShapeX :: Int -> Shape -baseStickShapeX i = foldMap f [0..i-1] +baseStickShapeX :: Item -> Int -> Shape +baseStickShapeX it i = foldMap f [0..i-1] where f j = rotateSH ang baseStickShape where - ang = fromIntegral j * baseStickSpread - (fromIntegral i - 1) * baseStickSpread * 0.5 -baseStickSpread :: Float -baseStickSpread = 0.2 + ang = fromIntegral j * barrelspread - (fromIntegral i - 1) * barrelspread * 0.5 + barrelspread = it ^?! itParams . gunBarrels . brlSpread . spreadAngle + +baseStickShape :: Shape +baseStickShape = colorSH green $ upperPrismPoly 3 $ rectXH 10 2 stickClip :: Item -> Shape stickClip it = case it ^? itConsumption . laLoaded of @@ -101,5 +120,196 @@ stickClip it = case it ^? itConsumption . laLoaded of where f i = rotateSH ang $ translateSH (V3 5 0 3) $ upperPrismPoly 2 $ square 1.5 where - ang = baseStickSpread * fromIntegral i - - 0.5 * baseStickSpread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1) + ang = barrelspread * fromIntegral i + - 0.5 * barrelspread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1) + barrelspread = it ^?! itParams . gunBarrels . brlSpread . spreadAngle + +defSPic :: SPic +defSPic = noPic $ colorSH green $ upperPrismPoly 3 $ square 4 + +shatterGunSPic :: SPic +shatterGunSPic = noPic $ colorSH blue $ + upperPrismPoly 5 (rectNESW xb 8 xa 0) + <> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0) + where + xa = 1 + xb = 9 + +defCane :: Item -> SPic +defCane it = noPic $ baseCaneShape <> makeSingleClipAt (V3 5 0 3) it + +baseCaneShape :: Shape +baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 1.5 + +baseRifleShape :: Shape +baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2 + +makeSingleClipAt :: Point3 -> Item -> Shape +makeSingleClipAt p it = case it ^? itConsumption . laLoaded of + Just 0 -> mempty + _ -> translateSH p $ upperPrismPoly 1 $ square 1.5 + +makeTinClipAt :: Float -> Point3 -> Item -> Shape +makeTinClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ reverse + $ rectNSWE 0 (-y) (-2) 2 + where + y = fromIntegral y' * 0.3 + y' = fromMaybe 0 $ it ^? itConsumption . laLoaded + +volleyGunSPic :: Int -> Item -> SPic +volleyGunSPic i it = noPic $ + colorSH red (foldMap + ((\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2) + . (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))) [0..i-1] + ) <> caneClipX i it + + +caneClipX :: Int -> Item -> Shape +caneClipX i it = case it ^? itConsumption . laLoaded of + Just la | la > 0 -> foldMap + ( (\y -> translateSH (V3 5 0 3) . upperPrismPoly 1 $ map (+.+ V2 0 y) $ square 1.5) + . (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))) + [0..la-1] + _ -> mempty + +miniGunXPictItem :: Int -> Item -> SPic +miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it) + where + spin = (-10) * _laLoaded (_itConsumption it) + _warmTime (_useDelay $ _itUse it) + +miniGunXPict :: Int -> Int -> Int -> SPic +miniGunXPict i spin _ = + ( colorSH red (rotateSHx a barrels) + <> baseRifleShape +-- <> clip (-1) 0 +-- <> clip (-7) 0 + , mempty + ) + where + aBarrel = translateSH (V3 15 2 2) baseCaneShape + barrels = foldMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i] + a = fromIntegral spin / 100 + --x = fromIntegral am / 10 +-- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4) +-- . upperPrismPoly 2 +-- $ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5)) + +baseSonicShape :: Shape +baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2 + +revolverClip :: Item -> Shape +revolverClip it = case it ^? itConsumption . laLoaded of + Just al | al > 0 -> translateSH (V3 5 0 1) $ foldMap f [1..al] + _ -> mempty + where + f i = rotateSHx (fromIntegral i * pi / 3 + pi/6) . translateSH (V3 0 0 2) $ upperPrismPoly 1 $ square 1 + +baseSMGShape :: Shape +baseSMGShape = colorSH green $ upperPrismPoly 3 $ rectXH 20 2 + +flamerPic :: Item -> SPic +flamerPic it = + ( colorSH yellow $ + translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r) + <> upperPrismPoly 5 (rectNESW 2 18 (-2) 0) + , color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am) + ) + where + tx = 4 + ty = - 6 + tz = 3 + r = 5 + am = fractionLoadedAmmo2 it + +launcherPic :: Item -> SPic +launcherPic _ = + ( colorSH cyan $ prismPoly + (map (+.+.+ V3 20 0 5) $ polyCircx 4 5) + (map (+.+.+ V3 0 0 5) $ polyCircx 4 5) + , mempty + ) + +baseRodShape :: Shape +baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2 +baseAMRShape :: Shape +baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2 + +teslaGunPic :: SPic +teslaGunPic = noPic $ colorSH blue $ + upperPrismPoly 5 (rectNESW xb 8 xa 0) + <> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0) + where + xa = 1 + xb = 9 + +lasGunPic :: Item -> SPic +lasGunPic it = + ( colorSH blue $ + upperPrismPoly 4 (rectNESW 3 30 1 0) + <> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0) + <> upperPrismPoly 1 (rectNESW 3 30 (-3) 0) + , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0 + ) + where + amFrac = fractionLoadedAmmo it + col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red + +dualBeamPic :: Item -> SPic +dualBeamPic it = + ( colorSH blue $ + upperPrismPoly 4 (rectNESW gap 3 (-gap) 1) + <> upperPrismPoly 4 (rectNESW gap (-1) (-gap) (-3)) + <> upperPrismPoly 1 (rectNESW gap 3 (-gap) (-3)) + , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (-gap) (-1) + ) + where + amFrac = fractionLoadedAmmo it + col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red + gap = _dbGap (_itParams it) - 3 + +tractorGunPic :: Item -> SPic +tractorGunPic it = + ( colorSH red $ + upperPrismPoly 4 (rectNESW 3 30 1 0) + <> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0) + <> upperPrismPoly 1 (rectNESW 3 30 (-3) 0) + , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0 + ) + where + amFrac = fractionLoadedAmmo it + col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red + +flatShieldEquipSPic :: SPic +flatShieldEquipSPic = + ( colorSH yellow $ upperPrismPoly 10 (rectWH 2 10) + , mempty + ) + +headLampShape :: Shape +headLampShape = colorSH yellow $ + translateSH (V3 5 2 4) (upperPrismPoly 4 $ rectWH 4 1) + <> translateSH (V3 5 2 0) (upperPrismPoly 4 $ rectWH 4 1) + <> translateSH (V3 5 (-2) 4) (upperPrismPoly 4 $ rectWH 4 1) + <> translateSH (V3 5 (-2) 0) (upperPrismPoly 4 $ rectWH 4 1) + +detectorColor :: Detector -> Color +detectorColor dt = case dt of + ITEMDETECTOR -> blue + CREATUREDETECTOR -> green + WALLDETECTOR -> red + +keyPic :: Picture +keyPic = color green $ + pictures [translate (-4) 0 $ thickCircle 4 2 + ,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)] + ,thickLine 2 $ map toV2 [(4,0),(4,-4)] + ] + +latchkeyPic :: Picture +latchkeyPic = color yellow $ + pictures [translate (-4) 0 $ thickCircle 4 2 + ,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)] + ,thickLine 2 $ map toV2 [(4,0),(4,-4)] + ] +legsSPic :: Color -> SPic +legsSPic col = (noPic $ translateSH (V3 0 4 0) $ colorSH col $ upperPrismPoly 3 $ rectWH 2 2) diff --git a/src/Dodge/Item/Equipment.hs b/src/Dodge/Item/Equipment.hs index 2d9bd2520..c1bb4d874 100644 --- a/src/Dodge/Item/Equipment.hs +++ b/src/Dodge/Item/Equipment.hs @@ -27,8 +27,6 @@ import Dodge.Wall.ForceField import Dodge.Magnet import Picture import Geometry -import ShapePicture -import Shape import qualified IntMapHelp as IM import LensHelp --import ShortShow @@ -67,12 +65,6 @@ frontArmour = defaultEquipment } & itUse . eqEq . eqSite .~ GoesOnChest & itType . iyBase .~ FRONTARMOUR - & itDimension . dimSPic .~ const (emptySH , setDepth 20 $ pictures - [color thecol $ thickArc 0 (pi/2) 10 5 - ,color thecol $ thickArc (3*pi/2) (2*pi) 10 5 - ]) - where - thecol = yellow -- (greyN 0.1) wristArmour :: Item wristArmour = defaultEquipment @@ -83,7 +75,6 @@ wristArmour = defaultEquipment & itUse . eqEq . eqUse .~ setWristShieldPos & itUse . eqEq . eqOnRemove .~ onRemoveWristShield & itType . iyBase .~ WRISTARMOUR - & itDimension . dimSPic .~ const mempty onEquipWristShield :: Item -> Creature -> World -> World onEquipWristShield itm cr w = w @@ -138,12 +129,6 @@ flatShield = defaultEquipment , _itInvSize = 3 } & itType . iyBase .~ FLATSHIELD - & itDimension . dimSPic .~ flatShieldEquipSPic -flatShieldEquipSPic :: Item -> SPic -flatShieldEquipSPic _ = - ( colorSH yellow $ upperPrismPoly 10 (rectWH 2 10) - , mempty - ) shieldWall :: Int -> Wall shieldWall crid = defaultWall @@ -212,9 +197,6 @@ jetPack = defaultEquipment , _itID = Nothing } & itUse . eqEq . eqSite .~ GoesOnBack & itType . iyBase .~ JETPACK - & itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 20 - $ pictures [color yellow $ polygon $ reverse $ rectNSWE 5 (-5) (-11) (-3) ] - ) brainHat :: Item brainHat = defaultEquipment @@ -223,8 +205,6 @@ brainHat = defaultEquipment } & itUse . eqEq . eqSite .~ GoesOnHead & itType . iyBase .~ BRAINHAT - & itDimension . dimSPic .~ - const (noPic $ colorSH yellow $ upperPrismPoly 3 $ rectWH 4 4) headLamp1 :: Item headLamp1 = defaultEquipment @@ -234,10 +214,6 @@ headLamp1 = defaultEquipment & itUse . eqEq . eqUse .~ createHeadLamp & itUse . eqEq . eqSite .~ GoesOnHead & itType . iyBase .~ HEADLAMP1 - & itDimension . dimSPic .~ - const (noPic $ colorSH yellow $ - translateSHf 5 2 (upperPrismPoly 8 $ rectWH 4 1) - <> translateSHf 5 (-2) (upperPrismPoly 8 $ rectWH 4 1)) headLamp :: Item headLamp = defaultEquipment { _itEffect = NoItEffect @@ -246,14 +222,7 @@ headLamp = defaultEquipment & itUse . eqEq . eqUse .~ createHeadLamp & itUse . eqEq . eqSite .~ GoesOnHead & itType . iyBase .~ HEADLAMP - & itDimension . dimSPic .~ const (noPic headLampShape) -headLampShape :: Shape -headLampShape = colorSH yellow $ - translateSH (V3 5 2 4) (upperPrismPoly 4 $ rectWH 4 1) - <> translateSH (V3 5 2 0) (upperPrismPoly 4 $ rectWH 4 1) - <> translateSH (V3 5 (-2) 4) (upperPrismPoly 4 $ rectWH 4 1) - <> translateSH (V3 5 (-2) 0) (upperPrismPoly 4 $ rectWH 4 1) createHeadLamp :: Item -> Creature -> World -> World createHeadLamp _ cr = tempLightSources .:~ tlsTimeRadColPos 1 200 0.7 @@ -266,8 +235,6 @@ powerLegs = defaultEquipment } & itUse . eqEq . eqSite .~ GoesOnLegs & itType . iyBase .~ POWERLEGS - & itDimension . dimSPic .~ const - (noPic $ translateSH (V3 0 4 0) $ colorSH yellow $ upperPrismPoly 3 $ rectWH 2 2) speedLegs :: Item speedLegs = powerLegs & itType . iyBase .~ SPEEDLEGS @@ -283,7 +250,6 @@ wristInvisibility = defaultEquipment & itUse . eqEq . eqOnEquip .~ overCID (crCamouflage .~ Invisible) & itUse . eqEq . eqOnRemove .~ overCID (crCamouflage .~ FullyVisible) & itType . iyBase .~ INVISIBILITYEQUIPMENT GoesOnWrist - & itDimension . dimSPic .~ const (noPic (colorSH chartreuse $ upperPrismPoly 3 $ rectWH 2 2)) overCID :: (Creature -> Creature) -> Item -> Creature -> World -> World overCID f _ cr = creatures . ix (_crID cr) %~ f diff --git a/src/Dodge/Item/PassKey.hs b/src/Dodge/Item/PassKey.hs index b1058eb23..dc3ea4432 100644 --- a/src/Dodge/Item/PassKey.hs +++ b/src/Dodge/Item/PassKey.hs @@ -2,10 +2,7 @@ module Dodge.Item.PassKey where import Dodge.Data import Dodge.Default import Picture -import Geometry.Data import LensHelp -import ShapePicture -import Shape keyCard :: Int -> Item keyCard n = defaultEquipment { _itEffect = NoItEffect @@ -14,15 +11,6 @@ keyCard n = defaultEquipment , _itInvColor = aquamarine } & itType . iyBase .~ KEYCARD n - & itDimension . dimSPic .~ (const . noShape) - (setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic) - -keyPic :: Picture -keyPic = color green $ - pictures [translate (-4) 0 $ thickCircle 4 2 - ,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)] - ,thickLine 2 $ map toV2 [(4,0),(4,-4)] - ] latchkey :: Int -> Item latchkey _ = defaultEquipment @@ -31,11 +19,3 @@ latchkey _ = defaultEquipment -- , _itZoom = defaultItZoom , _itInvColor = yellow } - & itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic - ) -latchkeyPic :: Picture -latchkeyPic = color yellow $ - pictures [translate (-4) 0 $ thickCircle 4 2 - ,thickLine 2 $ map toV2 [(0,0),(8,0),(8,-4)] - ,thickLine 2 $ map toV2 [(4,0),(4,-4)] - ] diff --git a/src/Dodge/Item/Weapon/BatteryGuns.hs b/src/Dodge/Item/Weapon/BatteryGuns.hs index 872efa3bc..3c199c26d 100644 --- a/src/Dodge/Item/Weapon/BatteryGuns.hs +++ b/src/Dodge/Item/Weapon/BatteryGuns.hs @@ -32,15 +32,11 @@ import Dodge.WorldEvent.Flash --import Dodge.Default --import Dodge.Item.Weapon.InventoryDisplay import Dodge.Item.Weapon.TriggerType -import Dodge.Item.Weapon.AmmoParams import Dodge.Default.Weapon ---import Dodge.Item.Attachment ---import Dodge.WorldEvent.HelperParticle import Dodge.Base --import Dodge.Zone import Geometry import Picture -import Shape import ShapePicture import LensHelp --import Dodge.RandomHelp @@ -80,7 +76,6 @@ teslaGun = defaultBatteryGun , _itDimension = ItemDimension { _dimRad = 9 , _dimCenter = V3 4 0 0 - , _dimSPic = teslaGunPic } , _itParams = teslaParams } @@ -97,13 +92,6 @@ teslaGun = defaultBatteryGun & itUse . useAim . aimHandlePos .~ 4 & itUse . useAim . aimMuzPos .~ 4 & itType . iyBase .~ HELD TESLAGUN -teslaGunPic :: Item -> SPic -teslaGunPic _ = noPic $ colorSH blue $ - upperPrismPoly 5 (rectNESW xb 8 xa 0) - <> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0) - where - xa = 1 - xb = 9 --lasPulse :: Item --lasPulse = lasGun -- & itType . iyBase .~ LASPULSE @@ -240,7 +228,6 @@ dualBeam :: Item dualBeam = lasGun & itType . iyBase .~ HELD DUALBEAM & itUse . useAim . aimMuzPos .~ 0 - & itDimension .dimSPic .~ dualBeamPic & itParams .~ DualBeam { _phaseV = 1 , _lasColor = red @@ -304,7 +291,6 @@ lasGun = defaultAutoBatteryGun & itDimension .~ ItemDimension { _dimRad = 10 , _dimCenter = V3 15 0 0 - , _dimSPic = lasGunPic } & itUse . rUse .~ shootLaser & itUse . useDelay .~ NoDelay @@ -323,31 +309,6 @@ lasGun = defaultAutoBatteryGun & itUse . useAim . aimMuzPos .~ 30 & itType . iyBase .~ HELD LASGUN -lasGunPic :: Item -> SPic -lasGunPic it = - ( colorSH blue $ - upperPrismPoly 4 (rectNESW 3 30 1 0) - <> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0) - <> upperPrismPoly 1 (rectNESW 3 30 (-3) 0) - , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0 - ) - where - amFrac = fractionLoadedAmmo it - col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red - -dualBeamPic :: Item -> SPic -dualBeamPic it = - ( colorSH blue $ - upperPrismPoly 4 (rectNESW gap 3 (-gap) 1) - <> upperPrismPoly 4 (rectNESW gap (-1) (-gap) (-3)) - <> upperPrismPoly 1 (rectNESW gap 3 (-gap) (-3)) - , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW gap 1 (-gap) (-1) - ) - where - amFrac = fractionLoadedAmmo it - col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red - gap = _dbGap (_itParams it) - 3 - lasGunTweak :: TweakParam lasGunTweak = TweakParam { _doTweak = thetweak @@ -374,7 +335,6 @@ tractorGun = lasGun , _itDimension = ItemDimension { _dimRad = 10 , _dimCenter = V3 15 0 0 - , _dimSPic = tractorGunPic } , _itParams = Attracting {_attractionPower = 1} , _itTweaks = Tweakable @@ -414,17 +374,6 @@ tractorGunTweak = TweakParam showPower 3 = "0" -- object should stay in the center of the beam showPower i = "THIS SHOULD NOT BE POSSIBLE" ++ show i -tractorGunPic :: Item -> SPic -tractorGunPic it = - ( colorSH red $ - upperPrismPoly 4 (rectNESW 3 30 1 0) - <> upperPrismPoly 4 (rectNESW (-1) 30 (-3) 0) - <> upperPrismPoly 1 (rectNESW 3 30 (-3) 0) - , setLayer BloomNoZWrite . color col . setDepth 1.1 . polygon $ rectNESW 1 30 (-1) 0 - ) - where - amFrac = fractionLoadedAmmo it - col = brightX 2 1.5 $ mixColors amFrac (1-amFrac) green red -- | assumes that the item is held shootTeslaArc :: Item -> Creature -> World -> World shootTeslaArc it cr w = w' diff --git a/src/Dodge/Item/Weapon/BulletGun/Cane.hs b/src/Dodge/Item/Weapon/BulletGun/Cane.hs index 4d4498971..9360a938a 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Cane.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Cane.hs @@ -10,8 +10,6 @@ module Dodge.Item.Weapon.BulletGun.Cane ) where --import Dodge.Particle.Bullet.HitEffect import Dodge.Reloading.Action ---import Dodge.WorldEvent.HitEffect -import Dodge.Item.Weapon.BulletGun.Clip import Dodge.Data --import Dodge.ChainEffect import Dodge.Default.Weapon @@ -25,8 +23,6 @@ import Dodge.Item.Weapon.TriggerType import Dodge.SoundLogic.LoadSound import Picture import Geometry -import ShapePicture -import Shape import Sound.Data import LensHelp @@ -46,8 +42,6 @@ defaultBangCane = defaultBulletWeapon , _itDimension = ItemDimension { _dimRad = 8 , _dimCenter = V3 5 0 0 - , _dimSPic = \it -> noPic $ baseCaneShape - <> makeSingleClipAt (V3 5 0 3) it } } & itUse . useDelay . rateMax .~ 6 @@ -85,11 +79,6 @@ volleyGun i = defaultBulletWeapon & itDimension .~ ItemDimension { _dimRad = 8 , _dimCenter = V3 5 0 0 - , _dimSPic = \it -> noPic $ - colorSH red (foldMap - ((\y -> upperPrismPoly 3 $ map (+.+ V2 0 y) $ rectXH 15 2) - . (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))) [0..i-1] - ) <> caneClipX i it } & itUse . useAim . aimWeight .~ 6 & itUse . useAim . aimRange .~ 1 @@ -120,20 +109,11 @@ caneStickSoundChoice :: Item -> SoundID caneStickSoundChoice it | _laLoaded (_itConsumption it) < 2 = tap3S | otherwise = shotgunS -caneClipX :: Int -> Item -> Shape -caneClipX i it = case it ^? itConsumption . laLoaded of - Just la | la > 0 -> foldMap - ( (\y -> translateSH (V3 5 0 3) . upperPrismPoly 1 $ map (+.+ V2 0 y) $ square 1.5) - . (\k -> fromIntegral k * 5 - ((fromIntegral i - 1) * 2.5))) - [0..la-1] - _ -> mempty rifle :: Item rifle = defaultBangCane { _itDimension = ItemDimension { _dimRad = 8 , _dimCenter = V3 5 0 0 - , _dimSPic = \it -> noPic $ baseRifleShape - <> makeSingleClipAt (V3 5 0 3) it } } & itUse . useAim . aimStance .~ TwoHandTwist @@ -150,15 +130,7 @@ repeater = rifle & itType . iyBase .~ HELD REPEATER & itConsumption . laCycle .~ [loadEject 50, loadInsert 40 ,loadPrime 20] & itConsumption . laMax .~ 15 - & itDimension . dimSPic .~ (\it -> noPic $ baseRifleShape - <> makeTinClipAt 0 (V3 10 (-2) 0) it - ) -baseCaneShape :: Shape -baseCaneShape = colorSH red $ upperPrismPoly 3 $ rectXH 15 1.5 - -baseRifleShape :: Shape -baseRifleShape = colorSH red $ upperPrismPoly 3 $ rectXH 25 2 autoRifle :: Item autoRifle = repeater @@ -279,29 +251,7 @@ miniGunX i = defaultAutoGun , _itDimension = ItemDimension { _dimRad = 20 , _dimCenter = V3 5 0 0 - , _dimSPic = miniGunXPictItem i } } & itType . iyBase .~ HELD (MINIGUNX i) & itUse . useAim . aimMuzPos .~ 40 -miniGunXPictItem :: Int -> Item -> SPic -miniGunXPictItem i it = miniGunXPict i spin (_laLoaded $ _itConsumption it) - where - spin = (-10) * _laLoaded (_itConsumption it) + _warmTime (_useDelay $ _itUse it) - -miniGunXPict :: Int -> Int -> Int -> SPic -miniGunXPict i spin _ = - ( colorSH red (rotateSHx a barrels) - <> baseRifleShape --- <> clip (-1) 0 --- <> clip (-7) 0 - , mempty - ) - where - aBarrel = translateSH (V3 15 2 2) baseCaneShape - barrels = foldMap (\an -> aBarrel & rotateSHx (2*pi * fromIntegral an / fromIntegral i)) [1..i] - a = fromIntegral spin / 100 - --x = fromIntegral am / 10 --- clip y z = translateSH (V3 0 (-1) z) (rotateSHx (negate $ pi/4) --- . upperPrismPoly 2 --- $ rectNESW (negate $ 3 + 0.25 * x) y 3 (y-5)) diff --git a/src/Dodge/Item/Weapon/BulletGun/Clip.hs b/src/Dodge/Item/Weapon/BulletGun/Clip.hs deleted file mode 100644 index f9a911cf4..000000000 --- a/src/Dodge/Item/Weapon/BulletGun/Clip.hs +++ /dev/null @@ -1,18 +0,0 @@ -module Dodge.Item.Weapon.BulletGun.Clip where -import Dodge.Data -import Shape -import Geometry -import Data.Maybe -import Control.Lens - -makeSingleClipAt :: Point3 -> Item -> Shape -makeSingleClipAt p it = case it ^? itConsumption . laLoaded of - Just 0 -> mempty - _ -> translateSH p $ upperPrismPoly 1 $ square 1.5 - -makeTinClipAt :: Float -> Point3 -> Item -> Shape -makeTinClipAt r p it = translateSH p . overPosSH (rotate3z r) $ upperPrismPoly 1 $ reverse - $ rectNSWE 0 (-y) (-2) 2 - where - y = fromIntegral y' * 0.3 - y' = fromMaybe 0 $ it ^? itConsumption . laLoaded diff --git a/src/Dodge/Item/Weapon/BulletGun/Rod.hs b/src/Dodge/Item/Weapon/BulletGun/Rod.hs index e907056db..bfce4c918 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Rod.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Rod.hs @@ -8,7 +8,6 @@ module Dodge.Item.Weapon.BulletGun.Rod ) where import Dodge.Data import Dodge.Reloading.Action -import Dodge.Item.Weapon.BulletGun.Clip import Dodge.Particle.HitEffect import Dodge.Particle.Damage --import Dodge.ChainEffect @@ -22,11 +21,7 @@ import Dodge.Item.Weapon.ZoomScope import Dodge.Item.Weapon.ExtraEffect import Dodge.Item.Weapon.TriggerType import Dodge.SoundLogic.LoadSound -import Picture import Geometry -import ShapePicture -import Shape ---import Sound.Data import LensHelp --import qualified Data.Sequence as Seq @@ -60,8 +55,6 @@ bangRod = defaultBulletWeapon & itDimension .~ ItemDimension { _dimRad = 12 , _dimCenter = V3 5 0 0 - , _dimSPic = \it -> noPic $ baseRodShape - <> makeSingleClipAt (V3 5 0 3) it } & itConsumption . laMax .~ 1 & itConsumption . laCycle .~ [loadEject 5, loadInsert 10 , loadPrime 5] @@ -73,18 +66,11 @@ bangRod = defaultBulletWeapon & itUse . useAim . aimHandlePos .~ 5 & itUse . useAim . aimMuzPos .~ 30 & itConsumption . laAmmoType . amBulEff .~ expireAndDamage heavyBulDams -baseRodShape :: Shape -baseRodShape = colorSH orange $ upperPrismPoly 3 $ rectXH 20 2 -baseAMRShape :: Shape -baseAMRShape = colorSH orange $ upperPrismPoly 3 $ rectXH 30 2 elephantGun :: Item elephantGun = bangRod & itType . iyBase .~ HELD ELEPHANTGUN & itUse . useAim . aimStance .~ TwoHandTwist & itParams . gunBarrels .~ SingleBarrel 0.05 - & itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape - <> makeSingleClipAt (V3 5 0 3) it - ) & itUse . useMods .~ [ ammoHammerCheck , useTimeCheck @@ -102,9 +88,6 @@ amr :: Item amr = elephantGun & itType . iyBase .~ HELD AMR & itConsumption . laMax .~ 15 - & itDimension . dimSPic .~ (\it -> noPic $ baseAMRShape - <> makeTinClipAt 0 (V3 10 (-2) 0) it - ) autoAmr :: Item autoAmr = amr diff --git a/src/Dodge/Item/Weapon/BulletGun/Stick.hs b/src/Dodge/Item/Weapon/BulletGun/Stick.hs index e856f4473..fb4bc6bcf 100644 --- a/src/Dodge/Item/Weapon/BulletGun/Stick.hs +++ b/src/Dodge/Item/Weapon/BulletGun/Stick.hs @@ -7,7 +7,6 @@ module Dodge.Item.Weapon.BulletGun.Stick , revolver , revolverX ) where -import Dodge.Item.Weapon.BulletGun.Clip import Dodge.Reloading.Action import Dodge.Data import Dodge.ChainEffect @@ -21,10 +20,7 @@ import Dodge.Item.Weapon.AmmoParams --import Dodge.Item.Draw import Dodge.Item.Weapon.TriggerType import Dodge.SoundLogic.LoadSound -import Picture import Geometry -import ShapePicture -import Shape import Sound.Data import LensHelp @@ -71,8 +67,6 @@ bangStick i = defaultBulletWeapon , _itDimension = ItemDimension { _dimRad = 5 , _dimCenter = V3 5 0 0 - , _dimSPic = \it -> noPic $ baseStickShapeX i - <> stickClip it } } & itType . iyBase .~ HELD (BANGSTICK i) @@ -80,46 +74,18 @@ bangStick i = defaultBulletWeapon & itUse . useAim . aimMuzPos .~ 10 & itConsumption . laMax .~ i & itConsumption . laCycle .~ [loadPartialInsert 10 1] -baseStickShapeX :: Int -> Shape -baseStickShapeX i = foldMap f [0..i-1] - where - f j = rotateSH ang baseStickShape - where - ang = fromIntegral j * baseStickSpread - (fromIntegral i - 1) * baseStickSpread * 0.5 + baseStickSpread :: Float baseStickSpread = 0.2 -baseSMGShape :: Shape -baseSMGShape = colorSH green $ upperPrismPoly 3 $ rectXH 20 2 - -baseStickShape :: Shape -baseStickShape = colorSH green $ upperPrismPoly 3 $ rectXH 10 2 -stickClip :: Item -> Shape -stickClip it = case it ^? itConsumption . laLoaded of - Just x | x > 0 -> foldMap f [0..x-1] - _ -> mempty - where - f i = rotateSH ang $ translateSH (V3 5 0 3) $ upperPrismPoly 2 $ square 1.5 - where - ang = baseStickSpread * fromIntegral i - - 0.5 * baseStickSpread * fromIntegral (_brlNum (_gunBarrels (_itParams it))-1) - revolver :: Item revolver = pistol & itConsumption .~ (defaultBulletLoadable & laMax .~ 6 & laCycle .~ [loadPartialInsert 10 1] ) - & itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> revolverClip it) & itType . iyBase .~ HELD REVOLVER -revolverClip :: Item -> Shape -revolverClip it = case it ^? itConsumption . laLoaded of - Just al | al > 0 -> translateSH (V3 5 0 1) $ foldMap f [1..al] - _ -> mempty - where - f i = rotateSHx (fromIntegral i * pi / 3 + pi/6) . translateSH (V3 0 0 2) $ upperPrismPoly 1 $ square 1 - pistolAfterHamMods :: [ChainEffect] pistolAfterHamMods = [ useTimeCheck @@ -161,7 +127,6 @@ pistol = bangStick 1 & laCycle .~ [loadEject 5, loadInsert 5 , loadPrime 5] ) & itUse . useDelay . rateMax .~ 6 & itUse . useMods .~ (ammoHammerCheck : pistolAfterHamMods) - & itDimension . dimSPic .~ (\it -> noPic $ baseStickShape <> makeTinClipAt pi (V3 5 2 0) it) & itParams %~ ( ( muzVel .~ 0.8 ) . ( rifling .~ 0.8 ) @@ -190,8 +155,6 @@ smg = autoPistol -- & some parameter affecting stability & itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimHandlePos .~ 2 & itParams . torqueAfter .~ 0.05 - & itDimension . dimSPic .~ \it -> noPic (baseSMGShape - <> makeTinClipAt 0 (V3 7 (-2) 0) it) revolverX :: Int -> Item revolverX i = revolver & itUse . useDelay . rateMax .~ 8 diff --git a/src/Dodge/Item/Weapon/BulletGuns.hs b/src/Dodge/Item/Weapon/BulletGuns.hs index 6b9b05daa..f24de9196 100644 --- a/src/Dodge/Item/Weapon/BulletGuns.hs +++ b/src/Dodge/Item/Weapon/BulletGuns.hs @@ -103,8 +103,6 @@ bangCone = defaultBulletWeapon , _itDimension = ItemDimension { _dimRad = 8 , _dimCenter = V3 5 0 0 - , _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 5 2) - <> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 5 15) } } & itUse . useDelay . rateMax .~ 20 @@ -146,8 +144,6 @@ blunderbuss = bangCone {_itDimension = ItemDimension { _dimRad = 8 , _dimCenter = V3 5 0 0 - , _dimSPic = const $ noPic $ colorSH cyan $ upperPrismPoly 3 (rectXH 20 2) - <> upperPrismPoly 6 (reverse $ rectNSWE 4 (-4) 20 30) } } & itConsumption . laMax .~ 25 diff --git a/src/Dodge/Item/Weapon/Launcher.hs b/src/Dodge/Item/Weapon/Launcher.hs index 3ff4b9e4a..f0395434c 100644 --- a/src/Dodge/Item/Weapon/Launcher.hs +++ b/src/Dodge/Item/Weapon/Launcher.hs @@ -60,7 +60,6 @@ launcher = defaultWeapon , _itDimension = ItemDimension { _dimRad = 9 , _dimCenter = V3 10 0 0 - , _dimSPic = launcherPic } } & itUse . useDelay . rateMax .~ 20 @@ -104,14 +103,6 @@ usePjCreationX i it cr = foldr f where f n = (. _amPjCreation (_laAmmoType (_itConsumption it)) it (cr & crDir +~ (2*pi*fromIntegral n / fromIntegral i))) -launcherPic :: Item -> SPic -launcherPic _ = - ( colorSH cyan $ prismPoly - (map (+.+.+ V3 20 0 5) $ polyCircx 4 5) - (map (+.+.+ V3 0 0 5) $ polyCircx 4 5) - , mempty - ) - basicAmPjMoves :: IM.IntMap TweakParam basicAmPjMoves = IM.fromList . zip [0..] $ [spinDrag diff --git a/src/Dodge/Item/Weapon/Radar.hs b/src/Dodge/Item/Weapon/Radar.hs index 9910caa6c..5868b83e9 100644 --- a/src/Dodge/Item/Weapon/Radar.hs +++ b/src/Dodge/Item/Weapon/Radar.hs @@ -8,11 +8,6 @@ import Dodge.Item.Weapon.UseEffect --import Dodge.Item.Weapon.Remote import Dodge.Default.Weapon import Dodge.SoundLogic ---import Dodge.Item.Weapon.Grenade -import Geometry -import Picture -import Shape -import ShapePicture import Control.Lens @@ -36,16 +31,8 @@ autoDetector dt = defaultEquipment & itUse . eqEq . eqParams .~ EquipCounter 0 & itUse . eqEq . eqViewDist ?~ 350 & itType . iyBase .~ AUTODETECTOR dt - & itDimension . dimSPic .~ const - (noPic (colorSH (detectorColor dt) $ upperPrismPoly 3 $ rectWH 2 2)) -- , _itEffect = autoRadarEffect -detectorColor :: Detector -> Color -detectorColor dt = case dt of - ITEMDETECTOR -> blue - CREATUREDETECTOR -> green - WALLDETECTOR -> red - detectorEffect :: Detector -> Item -> Creature -> World -> World detectorEffect dt = case dt of ITEMDETECTOR -> const anItemFindPulse diff --git a/src/Dodge/Item/Weapon/Shatter.hs b/src/Dodge/Item/Weapon/Shatter.hs index e44c977b0..56b11de20 100644 --- a/src/Dodge/Item/Weapon/Shatter.hs +++ b/src/Dodge/Item/Weapon/Shatter.hs @@ -17,11 +17,7 @@ import Dodge.Default.Weapon --import Dodge.Item.Draw import Dodge.Item.Weapon.TriggerType --import Dodge.SoundLogic.LoadSound -import Picture import Geometry -import ShapePicture -import Shape ---import Sound.Data import LensHelp --import qualified Data.IntMap.Strict as IM @@ -38,15 +34,7 @@ shatterGun = defaultWeapon , useAmmoAmount 1 ] & itUse . useAim . aimStance .~ TwoHandFlat - & itDimension . dimSPic .~ shatterGunSPic -shatterGunSPic :: Item -> SPic -shatterGunSPic _ = noPic $ colorSH blue $ - upperPrismPoly 5 (rectNESW xb 8 xa 0) - <> upperPrismPoly 5 (rectNESW (-xa) 8 (-xb) 0) - where - xa = 1 - xb = 9 shootShatter :: Item -> Creature -> World -> World shootShatter it cr w = maybe w (uncurry $ shatterWall w sp ep) $ sequence $ collidePointWallsFilterStream canshatter sp ep w @@ -65,3 +53,4 @@ shatterWall w sp ep p wl = w & makeDebrisDirected 1 2 (pi/2) (argV $ vNormal $ uncurry (-.-) $ _wlLine wl) (_wlMaterial wl) (_wlColor wl) p & damageWall (Damage SHATTERING 1000 sp p ep NoDamageEffect) wl + diff --git a/src/Dodge/Item/Weapon/SonicGuns.hs b/src/Dodge/Item/Weapon/SonicGuns.hs index f09cf4188..a9623b1dd 100644 --- a/src/Dodge/Item/Weapon/SonicGuns.hs +++ b/src/Dodge/Item/Weapon/SonicGuns.hs @@ -17,9 +17,6 @@ import Dodge.Default.Weapon --import Dodge.Zone import Geometry import Picture -import Shape -import ShapePicture ---import Dodge.Picture import LensHelp --import Data.Maybe @@ -39,7 +36,6 @@ sonicGun = defaultAutoGun , _itDimension = ItemDimension { _dimRad = 10 , _dimCenter = V3 15 0 0 - , _dimSPic = const $ noPic baseSonicShape } } & itUse . useDelay . rateMax .~ 8 @@ -54,8 +50,6 @@ sonicGun = defaultAutoGun & itUse . useAim . aimStance .~ TwoHandTwist & itUse . useAim . aimMuzPos .~ 25 & itType . iyBase .~ HELD SONICGUN -baseSonicShape :: Shape -baseSonicShape = colorSH rose $ upperPrismPoly 3 $ rectXH 25 2 aSonicWave :: Item -> Creature -> World -> World aSonicWave it cr = instantParticles .:~ sonicWave pos dir cpos diff --git a/src/Dodge/Item/Weapon/SprayGuns.hs b/src/Dodge/Item/Weapon/SprayGuns.hs index 5872cd7b9..81c2aab55 100644 --- a/src/Dodge/Item/Weapon/SprayGuns.hs +++ b/src/Dodge/Item/Weapon/SprayGuns.hs @@ -21,16 +21,9 @@ import Dodge.Default --import Dodge.Item.Weapon.BulletGuns --import Dodge.Item.Weapon.InventoryDisplay import Dodge.Item.Weapon.TriggerType ---import Dodge.Item.Weapon.ExtraEffect ---import Dodge.Item.Weapon.UseEffect -import Dodge.Item.Weapon.AmmoParams import Dodge.Default.Weapon --import Dodge.Item.Attachment import Geometry ---import Geometry.Vector3D -import Picture -import Shape -import ShapePicture import LensHelp import Data.Traversable @@ -52,19 +45,6 @@ poisonSprayer = flameThrower -- , spreadNumI ] -flamerPic :: Item -> SPic -flamerPic it = - ( colorSH yellow $ - translateSHf tx ty (upperPrismPoly tz $ polyCirc 3 r) - <> upperPrismPoly 5 (rectNESW 2 18 (-2) 0) - , color black $ translate3 (V3 tx ty (tz+0.01)) $ circleSolid (r * am) - ) - where - tx = 4 - ty = - 6 - tz = 3 - r = 5 - am = fractionLoadedAmmo2 it flameSpitter :: Item flameSpitter = flameThrower & itType . iyBase .~ HELD FLAMESPITTER @@ -139,7 +119,6 @@ flameThrower = defaultAutoGun , _itDimension = ItemDimension { _dimRad = 7 , _dimCenter = V3 9 0 0 - , _dimSPic = flamerPic } -- , _itFloorPict = flamerPic } diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 5f79acb25..9740e62e6 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -270,7 +270,7 @@ ppDraw c = uncurryV translate (_ppPos c) $ rotate (_ppRot c) (_ppPict c) floorItemSPic :: FloorItem -> SPic floorItemSPic flit = uncurryV translateSPf (_flItPos flit) - $ rotateSP (_flItRot flit) (itSPic (_flIt flit)) + $ rotateSP (_flItRot flit) (itemSPic (_flIt flit)) btSPic :: Button -> SPic btSPic bt = uncurryV translateSPf (_btPos bt)