Forum:The YANI about throwing to an arbitrary direction

From NetHackWiki
Revision as of 07:41, 25 November 2022 by NDos (talk | contribs) ("Grazing" doesn't seem to be a good idea)
Jump to navigation Jump to search


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 will 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 Euclidean distance between the trajectory and the center of 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.

Of course, it would not so look nice on the TTY interface. Could be cool on graphical interfaces tho.

--NDos (talk) 07:39, 25 November 2022 (UTC)