Difference between revisions of "Forum:The YANI about throwing to an arbitrary direction"
Jump to navigation
Jump to search
m (Can miss both monsters) |
(Better scheme of the change of hitting) |
||
Line 14: | Line 14: | ||
*** For a projectile, it may hit one of the monsters with a distributed chance. | *** For a projectile, it may hit one of the monsters with a distributed chance. | ||
*** For a ray, it has independent chances of hitting the monsters. | *** For a ray, it has independent chances of hitting the monsters. | ||
− | ** The "chances" mentioned above are determined by the | + | ** The "chances" mentioned above are determined by the length of the overlap between the trajectory and the monster's tile. |
* Depending of the type of the ray/projectile, if it hits a wall, it will stop at the lastly traveled tile, or it will reflect/ricochet back. | * Depending of the type of the ray/projectile, if it hits a wall, it will stop at the lastly traveled tile, or it will reflect/ricochet back. | ||
Revision as of 07:45, 25 November 2022
The Yet Another New Idea page mentions a SMOP saying "rays and projectiles can be fired at an arbitrary target square, not just vertically, horizontally and diagonally." As such, I had a few thoughts about how it would be implemented.
Basically, treat the level as a Euclidean grid of squares, and treat the ray/projectile to be traveling from the center of the origin tile to the center of the target tile.
- Each time the ray/projectile crosses the edge (excluding vertices) between two tiles (excluding the origin and the target):
- If one of the tiles is occupied by a monster:
- For a projectile, it has a chance of hitting that monster rather than the target.
- For a ray, it has a chance of hitting the monster.
- If both of the tiles are occupied by monsters:
- For a projectile, it may hit one of the monsters with a distributed chance.
- For a ray, it has independent chances of hitting the monsters.
- The "chances" mentioned above are determined by the length of the overlap between the trajectory and the monster's tile.
- If one of the tiles is occupied by a monster:
- Depending of the type of the ray/projectile, if it hits a wall, it will stop at the lastly traveled tile, or it will reflect/ricochet back.
Of course, it would not so look nice on the TTY interface. Could be cool on graphical interfaces tho.