Added "get_inven_ap_cost" script function

Added grey outline to controlled critters at the beginning of the turn.
This commit is contained in:
NovaRain
2019-11-02 10:24:05 +08:00
parent 2e655945c0
commit d0c4bc3b78
13 changed files with 37 additions and 24 deletions
Binary file not shown.
+5 -5
View File
@@ -36,9 +36,9 @@ procedure combatturn_handler begin
variable
status := get_sfall_arg,
critter := get_sfall_arg,
pid, perkID, level, i;
pid, perkID, level;
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + ", arg3: " + get_sfall_arg);
//display_msg("Combat Turn: " + status + ", by " + obj_name(critter) + "/" + critter + ", arg3: " + get_sfall_arg);
if npcControl then begin
if lightInt then lightInt := round((lightInt / 65536.0) * 100); // calc percent of intensity
obj_set_light_level(npcControl, lightInt, lightDist); // restore light for prev. controlled NPC
@@ -55,9 +55,7 @@ procedure combatturn_handler begin
foreach (perkID in perksList) begin
level := has_trait(TRAIT_PERK, real_dude_obj, perkID);
if (level) then begin
for (i := 0; i < level; i++) begin
critter_add_trait(critter, TRAIT_PERK, perkID, 1);
end
critter_add_trait(critter, TRAIT_PERK, perkID, level);
end
end
intface_redraw;
@@ -70,6 +68,8 @@ procedure combatturn_handler begin
npcControl := 0; // dude control
end
if inControl then begin
// check preference setting _combat_highlight
if (read_byte(0x56D38C)) then set_outline(critter, OUTLINE_GREY);
// center the screen on the controlled critter/dude and remove roof tiles
move_to(dude_obj, dude_tile, dude_elevation);
if (displayName and critter != real_dude_obj) then begin
+1
View File
@@ -270,6 +270,7 @@
#define get_flags(obj) sfall_func1("get_flags", obj)
#define get_ini_section(file, sect) sfall_func2("get_ini_section", file, sect)
#define get_ini_sections(file) sfall_func1("get_ini_sections", file)
#define get_inven_ap_cost sfall_func0("get_inven_ap_cost")
#define get_map_enter_position sfall_func0("get_map_enter_position")
#define get_metarule_table sfall_func0("get_metarule_table")
#define get_object_ai_data(obj, aiParam) sfall_func2("get_object_ai_data", obj, aiParam)
@@ -630,6 +630,9 @@ optional argument:
> void sfall_func1("add_trait", int traitId)
- adds the specified trait to the player
> int sfall_func0("get_inven_ap_cost")
- returns the current AP cost to access the inventory in combat
------------------------
------ MORE INFO -------
------------------------