darkf / darkfo

DarkFO, a post-nuclear RPG remake (of Fallout 2)
Apache License 2.0
136 stars 12 forks source link

Hostile NPCs should trigger combat #15

Closed darkf closed 8 years ago

darkf commented 8 years ago

Part of #14

darkf commented 8 years ago

Actually this is irrelevant to AI; it seems that scripts trigger combat, and typically use obj_can_see_obj, which currently is stubbed to always return false.

This should be properly implemented. It seems that it takes Perception into account, and then tries to draw a straight line for line of sight. It is unclear if the distance is limited (I believe it is limited to 16 hexes, but PER may limit it even further. What is the max distance you can see with 10 (+ bonuses) PER?)

darkf commented 8 years ago

Fixed with aa5afb7e7a677ef8b69527fef02f0630b6cc3d0f.

It still needs more testing, and the Sneak skill needs to be implemented, but it basically works (obj_can_see_obj and ancillary functions were reversed and reimplemented.)