Commit before perhaps rethinking item structure

This commit is contained in:
2024-12-29 10:40:21 +00:00
parent ef7aee82e5
commit 2037891cc9
11 changed files with 33 additions and 13 deletions
+3
View File
@@ -94,8 +94,11 @@ shellCollisionCheck pj w
time = _pjTimer pj
oldPos = _pjPos pj
-- note this doesn't take into account moving walls, which may break the
-- bouncing in some way
tryShellBounce :: (Point2, Either Creature Wall) -> Projectile -> World -> World
tryShellBounce (p, Right wl) pj w
| Just GStick <- pj ^? pjType . gnHitEffect = w
| Just x <- pj ^? pjType . gnHitEffect . bounceTolerance =
if abs (dotV (pj ^. pjVel) (vNormal hitline)) < x
then w & cWorld . lWorld . projectiles . ix (_pjID pj) . pjVel %~ reflectIn