Fix console item creation, fix tank object clockwise orientation

This commit is contained in:
2024-06-11 14:19:31 +01:00
parent c862c862df
commit 935f09f08e
7 changed files with 11 additions and 33 deletions
-1
View File
@@ -1,6 +1,5 @@
module Dodge.Base.You where
import TreeHelp
import Dodge.Data.World
import Dodge.HeldScroll
import qualified IntMapHelp as IM
+1 -1
View File
@@ -25,7 +25,7 @@ data Block = Block
, _blWallIDs :: IS.IntSet
, _blHP :: Int
, _blShadows :: [Int] -- a list of blocks/walls? that are not shown when this block exists
, _blFootprint :: [Point2]
, _blFootprint :: [Point2] -- TODO check whether this should be clockwise/anticlockwise
, _blPos :: Point2
, _blDir :: Float
, _blHeight :: Float
+1 -1
View File
@@ -62,7 +62,7 @@ parseItem (x : xs) =
<|> (readMaybe ("HELD {_ibtHeld=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("EQUIP {_ibtEquip=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("LEFT {_ibtLEFT=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("HELD (" ++ x ++ " {_xNum=" ++ show (parseNum xs) ++ "}") <&> (,1))
<|> (readMaybe ("HELD {_ibtHeld=(" ++ x ++ " {_xNum=" ++ show (parseNum xs) ++ "})}") <&> (,1))
<|> (readMaybe ("ATTACH (" ++ x ++ ")") <&> (,parseNum xs))
<|> (readMaybe ("CONSUMABLE {_ibtConsumable=" ++ x ++ "}") <&> (,parseNum xs))
<|> (readMaybe ("AMMO {_ibtAmmo=" ++ x ++ "}") <&> (,parseNum xs))
+1 -17
View File
@@ -17,27 +17,11 @@ tankSquareDec ::
Color ->
Color ->
Placement
tankSquareDec dec = tankShape (reverse $ square 20) (dec 20 20 31)
tankSquareDec dec = tankShape (reverse . orderPolygon $ square 20) (dec 20 20 31)
tankShape :: [Point2] -> (Color -> Color -> Shape) -> Color -> Color -> Placement
tankShape baseshape facade col col' = sps0 $ decoratedBlock (BlShConst $ facade col col') Metal col 31 baseshape
-- = sps0 $ PutBlock bl wl $ reverse baseshape
-- where
-- bl = defaultBlock
-- & blDraw .~ const (noPic $ colorSH col (upperPrismPoly 31 $ reverse baseshape) <> facade col col')
-- & blDeath .~ const id
-- wl = defaultWall
-- & wlColor .~ col
-- & wlRotateTo .~ False
-- & wlOpacity .~ SeeAbove
-- & wlMaterial .~ Metal
-- = ps0jPushPS
-- (PutShape $ colorSH col (upperPrismPoly 31 baseshape) <> facade col col')
-- $ sps0 $ PutWall baseshape defaultWall
-- {_wlUnshadowed = False, _wlColor = col, _wlRotateTo = False, _wlOpacity = SeeAbove}
roundTank :: Color -> Color -> Placement
roundTank = tankShape (polyCirc 4 20) $
\_ c' -> colorSH c' $ foldMap toprail (take 8 [0, pi / 4 ..])