Readd wall corner collisions
This commit is contained in:
@@ -60,12 +60,9 @@ teslaGun = defaultGun
|
||||
, _itAimingRange = 0
|
||||
}
|
||||
teslaGunPic :: Item -> SPic
|
||||
teslaGunPic _ =
|
||||
( colorSH blue $
|
||||
teslaGunPic _ = noPic $ colorSH blue $
|
||||
upperPrismPoly 5 (rectNESW xb y xa (-y))
|
||||
++ upperPrismPoly 5 (rectNESW (-xa) y (-xb) (-y))
|
||||
, mempty
|
||||
)
|
||||
where
|
||||
xa = 1
|
||||
xb = 9
|
||||
|
||||
@@ -9,7 +9,7 @@ import Geometry
|
||||
import Picture
|
||||
--import qualified IntMapHelp as IM
|
||||
import Shape
|
||||
--import ShapePicture
|
||||
import ShapePicture
|
||||
|
||||
import Control.Lens
|
||||
shrinkGun :: Item
|
||||
@@ -31,15 +31,20 @@ shrinkGun = defaultGun
|
||||
, _itLeftClickUse = Nothing
|
||||
, _wpSpread = 0.05
|
||||
, _wpRange = 20
|
||||
, _itFloorPict = \_ -> (,) emptySH $ onLayer FlItLayer $ polygon $ map toV2[(-2,-2),(-2,2),(2,2),(2,0),(0,0),(0,-2)]
|
||||
, _itFloorPict = shrinkGunPic
|
||||
, _itAimingSpeed = 1
|
||||
, _itAimingRange = 0
|
||||
, _itAttachment = ItBool True
|
||||
}
|
||||
|
||||
shrinkGunPic :: Item -> SPic
|
||||
shrinkGunPic _ = noPic $ colorSH violet $ upperPrismPoly 5 $ square 5
|
||||
|
||||
-- be careful changing this around; potential problems include updating the
|
||||
-- creature but using the old crInvSel value
|
||||
useShrinkGun :: Item -> Creature -> World -> World
|
||||
useShrinkGun it cr w = if _itBool $ _itAttachment it
|
||||
then tryResize 0.5 $ f False UndroppableIdentified . stripNoItems cr . dropUnselected cr
|
||||
then tryResize 0.5 $ stripNoItems cr . f False UndroppableIdentified . dropUnselected cr
|
||||
else tryResize 1 $ f True Uncursed . setMinInvSize defaultInvSize cr
|
||||
where
|
||||
tryResize x g = maybe w g $ maybeSizeSelf x cr w
|
||||
|
||||
Reference in New Issue
Block a user