mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Edited the description of hook/functions in the previous commit
Rewrote ASM code for tile_under_cursor script function.
This commit is contained in:
@@ -653,10 +653,11 @@ int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STD
|
||||
|
||||
HOOK_TARGETOBJECT (hs_targetobject.int)
|
||||
|
||||
Runs whenever the targeting cursor hovers over something.
|
||||
Runs when the targeting cursor moves over an object, or when the player tries to attack the target object.
|
||||
You can override the target object or prevent the player from attacking the chosen target.
|
||||
|
||||
int arg1 - event type: 0 - when hovering over the target, 1 - when clicking on the target
|
||||
int arg2 - 1 if the target is a valid object, 0 otherwise
|
||||
int arg1 - event type: 0 - when the cursor moves over the object, 1 - when trying to attack the target object
|
||||
int arg2 - 1 when the target object is valid to attack, 0 otherwise
|
||||
Obj arg3 - the target object
|
||||
|
||||
int ret1 - overrides the target object
|
||||
mixed ret1 - overrides the target object, or pass -1 to prevent the player from attacking the object
|
||||
|
||||
@@ -690,12 +690,12 @@ optional argument:
|
||||
> array sfall_func3("objects_in_radius", int tile, int radius, int elevation)
|
||||
> array sfall_func4("objects_in_radius", int tile, int radius, int elevation, int type)
|
||||
- returns an array of objects of a type (see OBJ_TYPE_* constants in define_extra.h) within the specified radius from the given tile
|
||||
- The radius is limited to 50 hexes
|
||||
- passing -1 to the type argument or not specifying it will return all types of objects
|
||||
- passing -1 to the type argument or not specifying it will return all objects within the radius
|
||||
- the radius is limited to 50 hexes
|
||||
|
||||
> int sfall_func2("tile_by_position", int x, int y)
|
||||
- returns the tile number at the x/y position relative to the top-left corner of the screen
|
||||
- returns -1 if the position is outside of the screen
|
||||
- returns the tile number at the x, y position relative to the top-left corner of the screen
|
||||
- if the position is outside of the range of tiles, it will return -1
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
|
||||
Reference in New Issue
Block a user