Added "combat_data" script function

Added a new argument to HOOK_COMBATDAMAGE.
Removed the check for valid objects from get/set_object_data functions.
Some code fixes.
This commit is contained in:
NovaRain
2020-10-08 13:49:58 +08:00
parent 2f750a8a4b
commit c71ca95665
10 changed files with 35 additions and 30 deletions
+9 -4
View File
@@ -468,13 +468,13 @@ Some utility/math functions are available:
- NOTE: all keys and their values will be of String type
> int sfall_func0("car_gas_amount")
- returns current amount of fuel in player's car (between 0 and 80000)
- returns the current amount of fuel in player's car (between 0 and 80000)
- to change fuel amount, use vanilla function: metarule(METARULE_GIVE_CAR_GAS, amount) - amount can be positive or negative
> void sfall_func1("set_car_intface_art", int artIndex)
- changes the interface art (index in LST file) for the car image on worldmap screen
- should be called before going to worldmap
- vanilla art index is 0x1B1
- changes the interface art (index in intrface.lst) for the car image on the world map interface
- should be called before going to the world map
- vanilla art index is 433
> int sfall_func0("get_cursor_mode")
- returns the current cursor mode (0 - movement cursor, 1 - command cursor, 2 - targeting cursor)
@@ -769,6 +769,11 @@ optional arguments:
0x2000000 - fills the background of the text with black color, the 'textnofill' compiler constant (works the other way around)
- width (optional): the maximum width of the text. The text will be wrapped to fit within the specified width
> mixed sfall_func0("combat_data")
- returns a pointer to the C_ATTACK_* data for the current combat attack turn (see defined constants in define_extra.h)
- can be used in conjunction with the get_object_data and set_object_data functions
example: sfall_func3("set_object_data", sfall_func0("combat_data"), C_ATTACK_UNUSED, 255);
------------------------
------ MORE INFO -------
------------------------