Added new HOOK_SETLIGHTING (from Mr.Stalin) (#215)

This commit is contained in:
NovaRain
2018-12-30 08:01:13 +08:00
parent 267d8694c9
commit b89663174f
8 changed files with 92 additions and 2 deletions
+1
View File
@@ -59,6 +59,7 @@
#define HOOK_USESKILLON (35)
#define HOOK_ONEXPLOSION (36)
#define HOOK_SUBCOMBATDAMAGE (37)
#define HOOK_SETLIGHTING (38)
//Valid arguments to list_begin
#define LIST_CRITTERS (0)
+13
View File
@@ -603,3 +603,16 @@ int arg11 - The calculated amount of damage (usually 0, required when using
mixed arg12 - Computed attack results (see C_ATTACK_* for offsets and use get/set_object_data functions to get/set the data)
int ret1 - The returned amount of damage
-------------------------------------------
HOOK_SETLIGHTING (hs_setlighting.int)
Runs before setting the light level for an object or a map. You can override the result.
Obj arg1 - the object being set, or -1 when setting the light level for a map
int arg2 - the light intensity
int arg3 - the light radius, or -1 when setting the light level for a map
int ret1 - overrides the light intensity. Intensity range is from 0 to 65536
int ret2 - overrides the light radius. Radius range is from 0 to 8 (works only for the object)
+2 -2
View File
@@ -141,7 +141,7 @@ array - array ID to be used with array-related functions (actually an integer)
- In this case use force_encounter_with_flags with the ENCOUNTER_FLAG_NO_CAR flag set.
> int get_light_level()
- ambient light level in range 0..65535
- ambient light level in range 0..65536
- The value returned by get_light_level may not exactly match that set by set_light_level, as set_light_level applies modifiers from the night vision perk.
> void set_map_time_multi(float multi)
@@ -325,7 +325,7 @@ Some utility/math functions are available:
- this calls an internal engine function which is used to determine the perception range of critters (which you can override using HOOK_WITHINPERCEPTION)
> int tile_light(int elevation, int tileNum)
- returns light intensity at the given tile in range from 0 to 65535
- returns light intensity at the given tile in range from 0 to 65536
> object obj_blocking_line(object objFrom, int tileTo, int blockingType)
- returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h)