diff --git a/artifacts/scripting/headers/command_lite.h b/artifacts/scripting/headers/command_lite.h index f6de703e..7ed82592 100644 --- a/artifacts/scripting/headers/command_lite.h +++ b/artifacts/scripting/headers/command_lite.h @@ -93,6 +93,7 @@ #define dude_elevation (elevation(dude_obj)) #define tile_behind_obj(who) (tile_num_in_direction(tile_num(who),((has_trait(TRAIT_OBJECT,who,OBJECT_CUR_ROT) + 3) % 6), 1)) +#define tile_behind_obj_rng(who, rng) (tile_num_in_direction(tile_num(who),((has_trait(TRAIT_OBJECT,who,OBJECT_CUR_ROT) + 3) % 6), rng)) #define dude_cur_hits (get_critter_stat(dude_obj,STAT_current_hp)) #define dude_max_hits (get_critter_stat(dude_obj,STAT_max_hp)) diff --git a/artifacts/scripting/headers/lib.arrays.h b/artifacts/scripting/headers/lib.arrays.h index bc0da2ce..2695cc27 100644 --- a/artifacts/scripting/headers/lib.arrays.h +++ b/artifacts/scripting/headers/lib.arrays.h @@ -131,7 +131,7 @@ procedure remove_array_block(variable arr, variable blocksize, variable index); /** * Converts any array to string for debugging purposes */ -procedure debug_array_str(variable arr); +#define debug_array_str(arr) debug_array_str_deep(arr, 1) #define display_array(arr) display_msg(debug_array_str(arr)) @@ -618,8 +618,6 @@ end Different utility functions... */ -#define debug_array_str(arr) debug_array_str_deep(arr, 1) - procedure debug_array_str_deep(variable arr, variable levels) begin #define _newline if (levels > 1) then s += "\n"; #define _indent ii := 0; while (ii < levels - 1) do begin s += " "; ii++; end diff --git a/artifacts/scripting/headers/command_extra.h b/artifacts/scripting/headers/lib.obj.h similarity index 56% rename from artifacts/scripting/headers/command_extra.h rename to artifacts/scripting/headers/lib.obj.h index f1375daf..4ffd6691 100644 --- a/artifacts/scripting/headers/command_extra.h +++ b/artifacts/scripting/headers/lib.obj.h @@ -1,12 +1,11 @@ -#ifndef COMMAND_EXTRA_H -#define COMMAND_EXTRA_H +#ifndef LIB_OBJ_H +#define LIB_OBJ_H #include "define_lite.h" #include "define_extra.h" - -#define ammo_caliber(ammoPid) get_proto_data(ammoPid, PROTO_AM_CALIBER) #define obj_name_safe(obj) (obj_name(obj) if obj else "(null)") #define get_active_weapon(critter) critter_inven_obj(critter, (2 - active_hand) if critter == dude_obj else INVEN_TYPE_RIGHT_HAND) +#define obj_can_hear_and_shoot_obj(critter,target) (obj_can_hear_obj(critter, target) and obj_blocking_line(critter, tile_num(target), BLOCKING_TYPE_SHOOT) == target) #endif