From 0343d7d75e948c25552b4e34401ab1788236d556 Mon Sep 17 00:00:00 2001 From: "Mr.Stalin" Date: Sun, 25 Oct 2020 21:14:33 +0300 Subject: [PATCH] Cleanup command_lite.h/define_lite.h and Release v4.2.8.1 --- artifacts/scripting/headers/command_lite.h | 185 ++-------- artifacts/scripting/headers/define_lite.h | 333 +++++++----------- artifacts/scripting/sfall function notes.txt | 4 +- .../Modules/Scripting/Handlers/Interface.cpp | 2 +- sfall/Modules/Scripting/OpcodeContext.cpp | 2 +- sfall/Modules/Scripting/OpcodeContext.h | 17 +- 6 files changed, 172 insertions(+), 371 deletions(-) diff --git a/artifacts/scripting/headers/command_lite.h b/artifacts/scripting/headers/command_lite.h index 2c2bed8b2..539ec1833 100644 --- a/artifacts/scripting/headers/command_lite.h +++ b/artifacts/scripting/headers/command_lite.h @@ -1,12 +1,7 @@ -/* - Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved. -*/ +#ifndef COMMAND_H +#define COMMAND_H -#ifndef COMMAND_LITE_H -#define COMMAND_LITE_H - - -#define critter_is_armed(x) (((obj_item_subtype(critter_inven_obj(x,INVEN_TYPE_RIGHT_HAND))) == item_type_weapon) or \ +#define critter_is_armed(x) (((obj_item_subtype(critter_inven_obj(x,INVEN_TYPE_RIGHT_HAND))) == item_type_weapon) orElse \ ((obj_item_subtype(critter_inven_obj(x,INVEN_TYPE_LEFT_HAND))) == item_type_weapon)) #define critter_weight_calc(x) (100 + ((get_critter_stat(x,STAT_gender) == GENDER_MALE) * 50) + (get_critter_stat(x,STAT_st) * 5) - ((get_critter_stat(x,STAT_ag) + get_critter_stat(x,STAT_en))/3)) @@ -23,14 +18,12 @@ #define dude_iq (get_critter_stat(dude_obj,STAT_iq)) #define dude_agility (get_critter_stat(dude_obj,STAT_ag)) #define dude_luck (get_critter_stat(dude_obj,STAT_lu)) -#ifndef dude_level #define dude_level (get_pc_stat(PCSTAT_level)) -#endif #define dude_age (get_critter_stat(dude_obj,STAT_age)) #define dude_weight critter_weight(dude_obj) #define dude_cur_weight who_carry_amount(dude_obj) -#define dude_moron_not_vegetable (((get_critter_stat(dude_obj,STAT_iq)) > 1) and ((get_critter_stat(dude_obj,STAT_iq)) < 3) ) +#define dude_moron_not_vegetable (((get_critter_stat(dude_obj,STAT_iq)) > 1) andAlso ((get_critter_stat(dude_obj,STAT_iq)) < 3) ) #define dude_is_male (dude_gender == GENDER_MALE) #define dude_is_female (dude_gender == GENDER_FEMALE) @@ -42,43 +35,42 @@ (obj_is_carrying_obj_pid(dude_obj, PID_ADVANCED_POWER_ARMOR_MK2)) + \ (obj_is_carrying_obj_pid(dude_obj, PID_HARDENED_POWER_ARMOR))) > 0) -#define dude_wielding_knife ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_KNIFE) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_THROWING_KNIFE) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_RIPPER) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_COMBAT_KNIFE) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_KNIFE) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_THROWING_KNIFE) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_RIPPER) or \ +#define dude_wielding_knife ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_KNIFE) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_THROWING_KNIFE) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_RIPPER) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_COMBAT_KNIFE) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_KNIFE) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_THROWING_KNIFE) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_RIPPER) orElse \ (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_COMBAT_KNIFE)) -#define dude_wearing_power_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_POWERED_ARMOR) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_ADVANCED_POWER_ARMOR) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_ADVANCED_POWER_ARMOR_MK2) or \ +#define dude_wearing_power_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_POWERED_ARMOR) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_ADVANCED_POWER_ARMOR) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_ADVANCED_POWER_ARMOR_MK2) orElse \ (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_HARDENED_POWER_ARMOR)) -#define dude_wearing_leather_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_ARMOR) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_JACKET) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_ARMOR_MK_II) or \ +#define dude_wearing_leather_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_ARMOR) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_JACKET) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_LEATHER_ARMOR_MK_II) orElse \ (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_CURED_LEATHER_ARMOR)) -#define dude_wearing_combat_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_COMBAT_ARMOR) or \ - (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_BROTHERHOOD_COMBAT_ARMOR) or \ +#define dude_wearing_combat_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_COMBAT_ARMOR) orElse \ + (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_BROTHERHOOD_COMBAT_ARMOR) orElse \ (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_COMBAT_ARMOR_MK_II)) -#define dude_wearing_metal_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_METAL_ARMOR) or \ +#define dude_wearing_metal_armor ((obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_METAL_ARMOR) orElse \ (obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_WORN)) == PID_METAL_ARMOR_MK_II)) -#define dude_wearing_vault_suit COND019(1) -#define dude_has_gambling_skills ((dude_iq > 3) and (has_skill(dude_obj, SKILL_GAMBLING) >= 25)) +#define dude_has_gambling_skills ((dude_iq > 3) andAlso (has_skill(dude_obj, SKILL_GAMBLING) >= 25)) #define dude_is_sneaking (using_skill(dude_obj,SKILL_SNEAK)) #define dude_is_walking (art_anim(obj_art_fid(dude_obj)) == ANIM_walk) #define dude_is_running (art_anim(obj_art_fid(dude_obj)) == ANIM_running) #define dude_is_poisoned (get_poison(dude_obj)) #define dude_is_irradiated (get_critter_stat(dude_obj, STAT_current_rad)) -#define dude_is_crippled ((critter_state(dude_obj) bwand DAM_CRIP_LEG_LEFT) or \ - (critter_state(dude_obj) bwand DAM_CRIP_LEG_RIGHT) or \ - (critter_state(dude_obj) bwand DAM_CRIP_ARM_LEFT) or \ +#define dude_is_crippled ((critter_state(dude_obj) bwand DAM_CRIP_LEG_LEFT) orElse \ + (critter_state(dude_obj) bwand DAM_CRIP_LEG_RIGHT) orElse \ + (critter_state(dude_obj) bwand DAM_CRIP_ARM_LEFT) orElse \ (critter_state(dude_obj) bwand DAM_CRIP_ARM_RIGHT)) #define dude_cur_rot (has_trait(TRAIT_OBJECT,dude_obj,OBJECT_CUR_ROT)) @@ -102,8 +94,6 @@ #define dude_has_car (global_var(GVAR_PLAYER_GOT_CAR)) #define dude_is_pornstar dude_has_porn_star_rep #define dude_is_high drug_influence(dude_obj) -#define dude_found_geck global_var(GVAR_VAULT13_FOUND_GECK) - #define dude_stat_win(X,Y) ((do_check(dude_obj,X,Y)) > (do_check(self_obj,X,0))) #define dude_stat_lose(X,Y) ((do_check(dude_obj,X,Y)) < (do_check(self_obj,X,0))) @@ -115,7 +105,6 @@ #define dude_is_addict (has_trait(TRAIT_TRAIT, dude_obj, TRAIT_drug_addict)) - #define self_name (obj_name(self_obj)) #define self_gender (get_critter_stat(self_obj,STAT_gender)) #define self_strength (get_critter_stat(self_obj,STAT_st)) @@ -131,7 +120,7 @@ #define self_is_armed critter_is_armed(self_obj) #define self_wearing_armor critter_wearing_armor(self_obj) -#define self_carrying_laser_pistol ((obj_pid(critter_inven_obj(self_obj,INVEN_TYPE_LEFT_HAND)) == PID_LASER_PISTOL) or \ +#define self_carrying_laser_pistol ((obj_pid(critter_inven_obj(self_obj,INVEN_TYPE_LEFT_HAND)) == PID_LASER_PISTOL) orElse \ (obj_pid(critter_inven_obj(self_obj,INVEN_TYPE_RIGHT_HAND)) == PID_LASER_PISTOL)) #define self_is_sneaking (using_skill(self_obj,SKILL_SNEAK)) @@ -172,23 +161,24 @@ // some timer event macros -#define check_set_obj_visiblility(the_obj, x) if (obj_is_visible_flag(the_obj) == x) then set_obj_visibility(the_obj, x) +#define check_set_obj_visiblility(the_obj, x) if (obj_is_visible_flag(the_obj) == x) then set_obj_visibility(the_obj, x) #define flush_add_timer_event(obj, time, param) rm_fixed_timer_event(obj, param); \ add_timer_event(obj, time, param) + #define flush_add_timer_event_sec(obj, sec, param) flush_add_timer_event(obj, game_ticks(sec), param) /****************************************************************** General commands getting information about time ******************************************************************/ -#define morning ((game_time_hour >= 600) and (game_time_hour < 700)) +#define morning ((game_time_hour >= 600) andAlso (game_time_hour < 700)) #ifndef day -#define day ((game_time_hour >= 700) and (game_time_hour < 1800)) +#define day ((game_time_hour >= 700) andAlso (game_time_hour < 1800)) #endif -#define evening ((game_time_hour >= 1800) and (game_time_hour < 1900)) +#define evening ((game_time_hour >= 1800) andAlso (game_time_hour < 1900)) #ifndef night -#define night ((game_time_hour >= 1900) or (game_time_hour < 600)) +#define night ((game_time_hour >= 1900) orElse (game_time_hour < 600)) #endif #define GAME_TIME_SUBSECOND_RESOLUTION (10) @@ -203,7 +193,6 @@ #define GAME_TIME_IN_MINUTES (game_time / (GAME_TIME_SUBSECOND_RESOLUTION * SECONDS_PER_MINUTE)) #define GAME_TIME_IN_SECONDS (game_time / GAME_TIME_SUBSECOND_RESOLUTION) - #define ticks_til_hour(x) ((ONE_GAME_DAY * (game_time_hour > (x))) + ((((x)/100) - (game_time_hour/100)) * ONE_GAME_HOUR) + ((((x)%100) - (game_time_hour%100)) * ONE_GAME_MINUTE)) #define game_time_advance_hour(x) game_time_advance(ticks_til_hour(x)) @@ -222,9 +211,7 @@ /*************************************************************** **************** Dialogue Information *********************** ***************************************************************/ -#ifndef floater - #define floater(x) float_msg(self_obj, message_str(NAME,x), FLOAT_COLOR_NORMAL) -#endif +#define floater(x) float_msg(self_obj, message_str(NAME,x), FLOAT_COLOR_NORMAL) #define floater_rand(x,y) floater(random(x,y)) #define dude_floater(x) float_msg(dude_obj, message_str(NAME,x), FLOAT_COLOR_NORMAL) @@ -232,7 +219,6 @@ #define dude_floater_bad(x) float_msg(dude_obj, message_str(NAME,x), FLOAT_COLOR_BAD) #define dude_floater_sick(x) float_msg(dude_obj, message_str(NAME,x), FLOAT_COLOR_SICK) - #define FLOAT_COLOR_NORMAL FLOAT_MSG_YELLOW #define FLOAT_COLOR_SICK FLOAT_MSG_GREEN #define FLOAT_COLOR_BAD FLOAT_MSG_RED @@ -338,9 +324,7 @@ ******************************************************************/ #define critter_is_male (get_critter_stat(self_obj,STAT_gender) == GENDER_MALE) #define critter_is_female (get_critter_stat(self_obj,STAT_gender) == GENDER_FEMALE) -/*#define critter_is_armed (((obj_item_subtype(critter_inven_obj(self_obj,INVEN_TYPE_RIGHT_HAND))) == item_type_weapon) \ - or ((obj_item_subtype(critter_inven_obj(self_obj,INVEN_TYPE_LEFT_HAND))) == item_type_weapon)) -*/ + /****************************************************************** General commands setting and getting the map exit ******************************************************************/ @@ -388,59 +372,12 @@ #define status_is_warned(status_var) (status_is(status_var, PERSON_WARNED)) #define status_is_sex(status_var) (status_is(status_var, PERSON_SEX)) -#define status_is_alive(status_var) (not (status_is_killed(status_var) or status_is_assassinated(status_var) or status_is_dead(status_var))) +#define status_is_alive(status_var) (not (status_is_killed(status_var) orElse status_is_assassinated(status_var) orElse status_is_dead(status_var))) /****************************************************************** General commands getting information about cities ******************************************************************/ -#define abbey_visible_on_map (town_known(AREA_ABBEY) != MARK_STATE_UNKNOWN) -#define arroyo_visible_on_map (town_known(AREA_ARROYO) != MARK_STATE_UNKNOWN) -#define broken_hills_visible_on_map (town_known(AREA_BROKEN_HILLS) != MARK_STATE_UNKNOWN) -#define colusa_visible_on_map (town_known(AREA_NAVARRO) != MARK_STATE_UNKNOWN) -#define den_visible_on_map (town_known(AREA_DEN) != MARK_STATE_UNKNOWN) -#define enclave_visible_on_map (town_known(AREA_THE_ENCLAVE) != MARK_STATE_UNKNOWN) -#define EPA_visible_on_map (town_known(AREA_EPA) != MARK_STATE_UNKNOWN) -#define gecko_visible_on_map (town_known(AREA_GECKO) != MARK_STATE_UNKNOWN) -#define klamath_visible_on_map (town_known(AREA_KLAMATH) != MARK_STATE_UNKNOWN) -#define military_base_visible_on_map (town_known(AREA_MILITARY_BASE) != MARK_STATE_UNKNOWN) -#define modoc_visible_on_map (town_known(AREA_MODOC) != MARK_STATE_UNKNOWN) -#define new_CA_republic_visible_on_map (town_known(AREA_NCR) != MARK_STATE_UNKNOWN) -#define primitive_tribe_visible_on_map (town_known(AREA_PRIMITIVE_TRIBE) != MARK_STATE_UNKNOWN) -#define redding_visible_on_map (town_known(AREA_REDDING) != MARK_STATE_UNKNOWN) -#define new_reno_visible_on_map (town_known(AREA_NEW_RENO) != MARK_STATE_UNKNOWN) -#define san_francisco_visible_on_map (town_known(AREA_SAN_FRANCISCO) != MARK_STATE_UNKNOWN) -#define sierra_army_base_visible_on_map (town_known(AREA_SIERRA_ARMY_BASE) != MARK_STATE_UNKNOWN) -#define vault_13_visible_on_map (town_known(AREA_VAULT_13) != MARK_STATE_UNKNOWN) -#define vault_15_visible_on_map (town_known(AREA_VAULT_15) != MARK_STATE_UNKNOWN) -#define vault_city_visible_on_map (town_known(AREA_VAULT_CITY) != MARK_STATE_UNKNOWN) -#define vault_fake_13A_visible_on_map (town_known(AREA_FAKE_VAULT_13A) != MARK_STATE_UNKNOWN) -#define vault_fake_13B_visible_on_map (town_known(AREA_FAKE_VAULT_13B) != MARK_STATE_UNKNOWN) - -#define abbey_visit (town_known(AREA_ABBEY) == MARK_STATE_VISITED) -#define arroyo_visit (town_known(AREA_ARROYO) == MARK_STATE_VISITED) -#define broken_hills_visit (town_known(AREA_BROKEN_HILLS) == MARK_STATE_VISITED) -#define colusa_visit (town_known(AREA_NAVARRO) == MARK_STATE_VISITED) -#define den_visit (town_known(AREA_DEN) == MARK_STATE_VISITED) -#define enclave_visit (town_known(AREA_THE_ENCLAVE) == MARK_STATE_VISITED) -#define EPA_visit (town_known(AREA_EPA) == MARK_STATE_VISITED) -#define gecko_visit (town_known(AREA_GECKO) == MARK_STATE_VISITED) -#define klamath_visit (town_known(AREA_KLAMATH) == MARK_STATE_VISITED) -#define military_base_visit (town_known(AREA_MILITARY_BASE) == MARK_STATE_VISITED) -#define modoc_visit (town_known(AREA_MODOC) == MARK_STATE_VISITED) -#define new_CA_republic_visit (town_known(AREA_NCR) == MARK_STATE_VISITED) -#define primitive_tribe_visit (town_known(AREA_PRIMITIVE_TRIBE) == MARK_STATE_VISITED) -#define redding_visit (town_known(AREA_REDDING) == MARK_STATE_VISITED) -#define new_reno_visit (town_known(AREA_NEW_RENO) == MARK_STATE_VISITED) -#define san_francisco_visit (town_known(AREA_SAN_FRANCISCO) == MARK_STATE_VISITED) -#define sierra_army_base_visit (town_known(AREA_SIERRA_ARMY_BASE) == MARK_STATE_VISITED) -#define vault_13_visit (town_known(AREA_VAULT_13) == MARK_STATE_VISITED) -#define vault_15_visit (town_known(AREA_VAULT_15) == MARK_STATE_VISITED) -#define vault_city_visit (town_known(AREA_VAULT_CITY) == MARK_STATE_VISITED) -#define arroyo_destroyed_visit (town_known(AREA_ARROYO_DESTROYED) == MARK_STATE_VISITED) -#define vault_fake_13A_visit (town_known(AREA_FAKE_VAULT_13A) == MARK_STATE_VISITED) -#define vault_fake_13B_visit (town_known(AREA_FAKE_VAULT_13B) == MARK_STATE_VISITED) - #define mark_on_map(x) if (town_known(x) == MARK_STATE_UNKNOWN) then begin \ debug_msg(" mark_on_map("+x+")"); \ mark_area_known(MARK_TYPE_TOWN, x, MARK_STATE_KNOWN); \ @@ -451,63 +388,11 @@ mark_area_known(MARK_TYPE_TOWN, x, MARK_STATE_UNKNOWN); \ end -#define mark_abbey_on_map mark_on_map(AREA_ABBEY) -#define mark_arroyo_on_map mark_on_map(AREA_ARROYO) -#define mark_broken_hills_on_map mark_on_map(AREA_BROKEN_HILLS) -#define mark_colusa_on_map mark_on_map(AREA_NAVARRO) -#define mark_navarro_on_map mark_on_map(AREA_NAVARRO) -#define mark_den_on_map mark_on_map(AREA_DEN) -#define mark_enclave_on_map mark_on_map(AREA_THE_ENCLAVE) -#define mark_EPA_on_map mark_on_map(AREA_EPA) -#define mark_gecko_on_map mark_on_map(AREA_GECKO) -#define mark_klamath_on_map mark_on_map(AREA_KLAMATH) -#define mark_military_base_on_map mark_on_map(AREA_MILITARY_BASE) -#define mark_modoc_on_map mark_on_map(AREA_MODOC) -#define mark_new_CA_republic_on_map mark_on_map(AREA_NCR) -#define mark_primitive_tribe_on_map mark_on_map(AREA_PRIMITIVE_TRIBE) -#define mark_redding_on_map mark_on_map(AREA_REDDING) -#define mark_new_reno_on_map mark_on_map(AREA_NEW_RENO) -#define mark_san_francisco_on_map mark_on_map(AREA_SAN_FRANCISCO) -#define mark_sierra_army_base_on_map mark_on_map(AREA_SIERRA_ARMY_BASE) -#define mark_vault_13_on_map mark_on_map(AREA_VAULT_13) -#define mark_vault_15_on_map mark_on_map(AREA_VAULT_15) -#define mark_vault_city_on_map mark_on_map(AREA_VAULT_CITY) -#define mark_vault_fake_13A_on_map mark_on_map(AREA_FAKE_VAULT_13A) -#define mark_vault_fake_13B_on_map mark_on_map(AREA_FAKE_VAULT_13B) - -#define unmark_vault_fake_13A_on_map unmark_on_map(AREA_FAKE_VAULT_13A) - - - /******************************************************************************************************************* ********** These represent the players acomplishments through the game ********************************************* ********** Note: these reflect the Fallout2 variable designers put in the scripts assuming we were ***************** ********** going to have a magic variable to keep track of the player stats throught the game ********************** *******************************************************************************************************************/ -#define f2_state_v13_looking (0) -#define f2_state_v13_known (1) // set -Chris H -#define f2_state_v13_found (2) // set -Chris H -#define f2_state_v13_entered (3) // set -Chris H -#define f2_state_tribe_kidnapped (4) // ### state not set -#define f2_state_fix_tanker (5) // didn't need to exist -#define f2_state_tanker_fix_known (6) // set -Chris H -#define f2_state_tanker_fixed (7) // set -Chris H -#define f2_state_enclave_destroyed (8) // ### state not set - -#define set_f2(x) if (global_var(GVAR_FALLOUT_2) < x) then set_global_var(GVAR_FALLOUT_2, x) -#define force_f2(x) set_global_var(GVAR_FALLOUT_2, x) -#define get_f2(x) (global_var(GVAR_FALLOUT_2) == x) -#define f2_flag_any (global_var(GVAR_FALLOUT_2)) - -#define Fallout2_vault13_looking get_f2(f2_state_v13_looking) -#define Fallout2_vault13_location_known get_f2(f2_state_v13_known) -#define Fallout2_vault13_found get_f2(f2_state_v13_found) -#define Fallout2_vault13_entered get_f2(f2_state_v13_entered) -#define Fallout2_tribe_kidnapped get_f2(f2_state_tribe_kidnapped) -#define Fallout2_fix_tanker get_f2(f2_state_fix_tanker) -#define Fallout2_tanker_known get_f2(f2_state_tanker_fix_known) -#define Fallout2_tanker_fixed get_f2(f2_state_tanker_fixed) -#define Fallout2_enclave_destroyed get_f2(f2_state_enclave_destroyed) // Info relating to carry weight, how much something costs, and weights #define pid_weight(x) proto_data(x,it_weight) @@ -567,4 +452,4 @@ #define set_is_click set_lvar_bit_off(LVAR_Flags, is_float_bit) -#endif // COMMAND_LITE_H +#endif // COMMAND_H diff --git a/artifacts/scripting/headers/define_lite.h b/artifacts/scripting/headers/define_lite.h index feb301996..304a71df6 100644 --- a/artifacts/scripting/headers/define_lite.h +++ b/artifacts/scripting/headers/define_lite.h @@ -7,7 +7,7 @@ // This file holds all of the things that should be preprocessed. -// script.h: Script Procedure Types // +// Script Procedure Types // #define no_proc (0) #define start_proc (1) #define spatial_proc (2) @@ -41,7 +41,7 @@ #define METARULE_IS_LOADGAME 22 #define is_loading_game metarule(METARULE_IS_LOADGAME, 0) -// script.h: Script Combat Procedure SubTypes // +// Script Combat Procedure SubTypes // #define COMBAT_SUBTYPE_WEAPON_USED (1) #define COMBAT_SUBTYPE_HIT_SUCCEEDED (2) #define COMBAT_SUBTYPE_SEQUENCING (3) @@ -102,19 +102,16 @@ // dialogue defines // #define start_dialogue(X,Y) start_gdialog(-1,X,Y,-1,-1) + // head_anim enums -//#define very_good_reaction (0) #define good_fidget (1) -//#define good_to_neutral (2) -//#define neutral_to_good (3) #define neutral_fidget (4) -//#define neutral_to_bad (5) -//#define bad_to_neutral (6) #define bad_fidget (7) -//#define very_bad_reaction (8) -//#define good_phonemes (9) -//#define neutral_phonemes (10) -//#define bad_phonemes (11) + +// Mood defines // +#define GOOD_REACTION (49) +#define NEUTRAL_REACTION (50) +#define BAD_REACTION (51) // Head defines // #define HEAD_MARCUS (1) //marcus -- Party Member (found in Broken Hills) @@ -129,9 +126,7 @@ #define HEAD_HAKUNIN (10) // Hakunin -- Found in Arroyo #define HEAD_BOSS (11) #define HEAD_DYING_HAKUNIN (12) -/* -#define HEAD_OVERSEER (1) //ovrsr -- vault -*/ + // Head defines // #define BACKGROUND1 (2) // rstymetl #define BACKGROUND_HUB (3) //hub.frm @@ -145,7 +140,8 @@ #define BACKGROUND_MASTER (11) //master.frm #define BACKGROUND_FOLLOWER (12) //follow.frm #define BACKGROUND_RAIDERS (13) //raider.frm - // Start of Fallout 2: Backgrounds + +// Start of Fallout 2: Backgrounds #define BACKGROUND_CAVE (14) //cave0001.frm #define BACKGROUND_ENCLAVE (15) //enclave.frm #define BACKGROUND_WASTELAND (16) //wastelnd.frm @@ -153,14 +149,6 @@ #define BACKGROUND_PRESIDENT (18) // pres.frm #define BACKGROUND_TENT (19) // tent.frm #define BACKGROUND_ADOBE (20) // Adobe.frm -// Mood defines // -#define GOOD_REACTION (49) -#define NEUTRAL_REACTION (50) -#define BAD_REACTION (51) -//#define BAD_REACTION (49) -//#define NEUTRAL_REACTION (50) -//#define GOOD_REACTION (51) - // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // @@ -174,11 +162,11 @@ // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // - // Trait defines // -#define TRAIT_PERK (0) +#define TRAIT_PERK (0) #define TRAIT_OBJECT (1) #define TRAIT_TRAIT (2) + // Perk Trait Types #define PERK_bonus_awareness (0) #define PERK_bonus_hth_attacks (1) @@ -207,7 +195,7 @@ #define PERK_sniper (24) #define PERK_silent_death (25) #define PERK_action_boy (26) -///#define PERK_mental_block (27) -- Disabled FO2 +#define PERK_mental_block (27) //-- Disabled FO2 #define PERK_lifegiver (28) #define PERK_dodger (29) #define PERK_snakeater (30) @@ -216,15 +204,15 @@ #define PERK_master_thief (33) #define PERK_speaker (34) #define PERK_heave_ho (35) -///#define PERK_friendly_foe (36) -- Disabled FO2 +#define PERK_friendly_foe (36) //-- Disabled FO2 #define PERK_pickpocket (37) #define PERK_ghost (38) #define PERK_cult_of_personality (39) -///#define PERK_scrounger (40) -- Disabled FO2 +#define PERK_scrounger (40) //-- Disabled FO2 #define PERK_explorer (41) -///#define PERK_flower_child (42) -- Disabled FO2 +#define PERK_flower_child (42) //-- Disabled FO2 #define PERK_pathfinder (43) -///#define PERK_animal_friend (44) -- Disabled FO2 +#define PERK_animal_friend (44) //-- Disabled FO2 #define PERK_scout (45) #define PERK_mysterious_stranger (46) #define PERK_ranger (47) @@ -233,27 +221,27 @@ #define PERK_swift_learner (50) #define PERK_tag (51) #define PERK_mutate (52) -//#define PERK_add_nuka // Do NOT USE! Engine ONLY! -//#define PERK_add_buffout // Do NOT USE! Engine ONLY! -//#define PERK_add_mentats // Do NOT USE! Engine ONLY! -//#define PERK_add_psycho // Do NOT USE! Engine ONLY! -//#define PERK_add_radaway // Do NOT USE! Engine ONLY! -//#define PERK_weapon_long_range // Do NOT USE! Engine ONLY! -//#define PERK_weapon_accurate // Do NOT USE! Engine ONLY! -//#define PERK_weapon_penetrate // Do NOT USE! Engine ONLY! -//#define PERK_weapon_knockback // Do NOT USE! Engine ONLY! -//#define PERK_armor_powered // Do NOT USE! Engine ONLY! -//#define PERK_armor_combat // Do NOT USE! Engine ONLY! -// Note: Fallout 2: New Perks // Do NOT USE! Engine ONLY! -//#define PERK_weapon_scope_range // Do NOT USE! Engine ONLY! -//#define PERK_weapon_fast_reload // Do NOT USE! Engine ONLY! -//#define PERK_weapon_night_sight // Do NOT USE! Engine ONLY! -//#define PERK_weapon_flameboy // Do NOT USE! Engine ONLY! -//#define PERK_armor_advanced_1 // Do NOT USE! Engine ONLY! -//#define PERK_armor_advanced_2 // Do NOT USE! Engine ONLY! -//#define PERK_add_jet // Do NOT USE! Engine ONLY! -//#define PERK_add_tragic // Do NOT USE! Engine ONLY! -//#define PERK_armor_charisma // Do NOT USE! Engine ONLY! +#define PERK_add_nuka (53) // Do NOT USE! Engine ONLY! +#define PERK_add_buffout (54) // Do NOT USE! Engine ONLY! +#define PERK_add_mentats (55) // Do NOT USE! Engine ONLY! +#define PERK_add_psycho (56) // Do NOT USE! Engine ONLY! +#define PERK_add_radaway (57) // Do NOT USE! Engine ONLY! +#define PERK_weapon_long_range (58) // Do NOT USE! Engine ONLY! +#define PERK_weapon_accurate (59) // Do NOT USE! Engine ONLY! +#define PERK_weapon_penetrate (60) // Do NOT USE! Engine ONLY! +#define PERK_weapon_knockback (61) // Do NOT USE! Engine ONLY! +#define PERK_armor_powered (62) // Do NOT USE! Engine ONLY! +#define PERK_armor_combat (63) // Do NOT USE! Engine ONLY! +// Note: Fallout 2: New Perks +#define PERK_weapon_scope_range (64) // Do NOT USE! Engine ONLY! +#define PERK_weapon_fast_reload (65) // Do NOT USE! Engine ONLY! +#define PERK_weapon_night_sight (66) // Do NOT USE! Engine ONLY! +#define PERK_weapon_flameboy (67) // Do NOT USE! Engine ONLY! +#define PERK_armor_advanced_1 (68) // Do NOT USE! Engine ONLY! +#define PERK_armor_advanced_2 (69) // Do NOT USE! Engine ONLY! +#define PERK_add_jet (70) // Do NOT USE! Engine ONLY! +#define PERK_add_tragic (71) // Do NOT USE! Engine ONLY! +#define PERK_armor_charisma (72) // Do NOT USE! Engine ONLY! #define PERK_gecko_skinning_perk (73) #define PERK_dermal_armor_perk (74) #define PERK_dermal_enhancement_perk (75) @@ -307,7 +295,9 @@ #define OBJECT_CUR_ROT (10) #define OBJECT_VISIBILITY (666) #define OBJECT_CUR_WEIGHT (669) + #define obj_is_visible_flag(WHO) has_trait(TRAIT_OBJECT,WHO,OBJECT_VISIBILITY) + // Trait Types #define TRAIT_fast_metabolism (0) #define TRAIT_bruiser (1) @@ -329,8 +319,7 @@ // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // -// proto.h: stats // -// SPECIAL System stats +// SPECIAL System stats: strength, perception, endurance, charisma, intelligence, agility, luck #define STAT_st (0) #define STAT_pe (1) #define STAT_en (2) @@ -339,24 +328,22 @@ #define STAT_ag (5) #define STAT_lu (6) #define STAT_max_hp (7) -/// strength, perception, endurance, charisma, intelligence, agility, -/// luck, // luck MUST be the last basic stat +// luck MUST be the last basic stat // derived stats -#define STAT_max_hit_points (7) -#define STAT_max_move_points (8) -#define STAT_ac (9) -///#define STAT_unarmed_dmg (10) -#define STAT_unused (10) -#define STAT_melee_dmg (11) -#define STAT_carry_amt (12) -#define STAT_sequence (13) -#define STAT_heal_rate (14) -#define STAT_crit_chance (15) -#define STAT_better_crit (16) -#define STAT_dmg_thresh (17) -#define STAT_dmg_thresh_laser (18) -#define STAT_dmg_thresh_fire (19) -#define STAT_dmg_thresh_plasma (20) +#define STAT_max_hit_points (7) +#define STAT_max_move_points (8) +#define STAT_ac (9) +#define STAT_unused (10) // used in sfall for critter inventory size (see CritterInvSizeLimitMode) +#define STAT_melee_dmg (11) +#define STAT_carry_amt (12) +#define STAT_sequence (13) +#define STAT_heal_rate (14) +#define STAT_crit_chance (15) +#define STAT_better_crit (16) +#define STAT_dmg_thresh (17) +#define STAT_dmg_thresh_laser (18) +#define STAT_dmg_thresh_fire (19) +#define STAT_dmg_thresh_plasma (20) #define STAT_dmg_thresh_electrical (21) #define STAT_dmg_thresh_emp (22) #define STAT_dmg_thresh_explosion (23) @@ -379,7 +366,7 @@ #define STAT_current_rad (37) #define STAT_real_max_stat (38) // extra stat-like values that are treated specially -#define STAT_max_stat STAT_current_hp +#define STAT_max_stat STAT_current_hp #define PCSTAT_unspent_skill_points (0) #define PCSTAT_level (1) @@ -391,7 +378,7 @@ // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // -// skill.h: Skill Equates // +// Skill Equates // // the following are skills for the SPECIAL system #define SKILL_SMALL_GUNS (0) #define SKILL_BIG_GUNS (1) @@ -418,7 +405,7 @@ // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // -// reaction.h: Reaction Levels // +// Reaction Levels // #define rl_disastrous (0) #define rl_very_bad (1) #define rl_bad (2) @@ -428,15 +415,11 @@ #define rl_very_good (6) #define rl_excellent (7) - -// proto.h // //#define LOAD_MAP_INDEX (32) -// proto.h // #define GENDER_MALE (0) #define GENDER_FEMALE (1) - // critter_state States // #define CRITTER_IS_NORMAL (0) #define CRITTER_IS_DEAD (1) @@ -445,7 +428,6 @@ #define is_critter_dead(who) (critter_state(who) bwand CRITTER_IS_DEAD) #define is_critter_prone(who) (critter_state(who) bwand CRITTER_IS_PRONE) - // inventory Equates // #define INVEN_TYPE_WORN (0) #define INVEN_TYPE_RIGHT_HAND (1) @@ -454,7 +436,6 @@ #define INVEN_TYPE_INV_COUNT (-2) #define inven_count(WHO) critter_inven_obj(WHO, INVEN_TYPE_INV_COUNT) - // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // @@ -469,7 +450,6 @@ #define item_type_misc_item (5) #define item_type_key_item (6) - /* Item data_members */ #define it_pid (0) #define it_name (1) @@ -508,7 +488,6 @@ #define CR_BODY_QUADRUPED 1 #define CR_BODY_ROBOTIC 2 - /* Scenery data_members */ #define sc_pid (0) #define sc_name (1) @@ -536,7 +515,6 @@ #define wa_material (9) /* Tile data_members */ - // NONE /* Misc data_members */ #define mi_pid (0) @@ -548,75 +526,37 @@ #define mi_flags (6) #define mi_flags_ext (7) - // ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- // /* Combat Flags */ - -// WIP! These are old and incorrect now, look below! 6/18/97 JLR - -/* -#define DAM_KNOCKED_OUT (1) // 0x00000001 // valid flags for damage_results -#define DAM_STUNNED (2) // 0x00000002 -#define DAM_KNOCKED_DOWN (4) // 0x00000004 -#define DAM_DODGED (8) // 0x00000008 -#define DAM_CRIP_LEG_LEFT (16) // 0x00000010 -#define DAM_CRIP_LEG_RIGHT (32) // 0x00000020 -#define DAM_CRIP_FOOT_LEFT (64) // 0x00000040 -#define DAM_CRIP_FOOT_RIGHT (128) // 0x00000080 -#define DAM_CRIP_ARM_LEFT (256) // 0x00000100 -#define DAM_CRIP_ARM_RIGHT (512) // 0x00000200 -#define DAM_CRIP_HAND_LEFT (1024) // 0x00000400 -#define DAM_CRIP_HAND_RIGHT (2048) // 0x00000800 -#define DAM_BLIND_EYE_LEFT (4096) // 0x00001000 -#define DAM_BLIND_EYE_RIGHT (8192) // 0x00002000 -#define DAM_DECAPITATED (16384) // 0x00004000 -#define DAM_SURPRISED (32768) // 0x00008000 -#define DAM_DEATH_1 (65536) // 0x00010000 -#define DAM_DEATH_2 (131072) // 0x00020000 -#define DAM_DEATH_3 (262144) // 0x00040000 -#define DAM_HIT (524288) // 0x00080000 // true if hit or critical hit -#define DAM_UNBALANCED (1048576) // 0x00100000 -#define DAM_DEAF (2097152) // 0x00200000 -#define DAM_DROP_WEAPON (4194304) // 0x00400000 -#define DAM_BREAK_WEAPON (8388608) // 0x00800000 -#define DAM_UNREADY_WEAPON_LEFT (16777216) // 0x01000000 -#define DAM_UNREADY_WEAPON_RIGHT (33554432) // 0x02000000 -#define DAM_EXPLODE_WEAPON (67108864) // 0x04000000 -#define DAM_DUD_SHOT (134217728) // 0x08000000 -#define DAM_IGNORE_DR (268435456) // 0x10000000 -#define DAM_CRITICAL (536870912) // 0x20000000 // could be a critical hit or critical miss -#define DAM_ON_FIRE (1073741824) // 0x40000000 -*/ - -#define DAM_KNOCKED_OUT 1 -#define DAM_KNOCKED_DOWN 2 -#define DAM_CRIP_LEG_LEFT 4 -#define DAM_CRIP_LEG_RIGHT 8 -#define DAM_CRIP_ARM_LEFT 16 -#define DAM_CRIP_ARM_RIGHT 32 -#define DAM_BLIND 64 -#define DAM_DEAD 128 -#define DAM_HIT 256 -#define DAM_CRITICAL 512 // could be a critical hit or critical miss -#define DAM_ON_FIRE 1024 -#define DAM_BYPASS 2048 -#define DAM_EXPLODE 4096 -#define DAM_DESTROY 8192 -#define DAM_DROP 16384 -#define DAM_LOSE_TURN 32768 -#define DAM_HIT_SELF 65536 -#define DAM_LOSE_AMMO 131072 -#define DAM_DUD 262144 -#define DAM_HURT_SELF 524288 -#define DAM_RANDOM_HIT 1048576 -#define DAM_CRIP_RANDOM 2097152 -#define DAM_BACKWASH 4194304 - +// valid flags for damage_results +#define DAM_KNOCKED_OUT 0x1 +#define DAM_KNOCKED_DOWN 0x2 +#define DAM_CRIP_LEG_LEFT 0x4 +#define DAM_CRIP_LEG_RIGHT 0x8 +#define DAM_CRIP_ARM_LEFT 0x10 +#define DAM_CRIP_ARM_RIGHT 0x20 +#define DAM_BLIND 0x40 +#define DAM_DEAD 0x80 +#define DAM_HIT 0x100 // hit or critical hit +#define DAM_CRITICAL 0x200 // could be a critical hit or critical miss +#define DAM_ON_FIRE 0x400 +#define DAM_BYPASS 0x800 +#define DAM_EXPLODE 0x1000 +#define DAM_DESTROY 0x2000 +#define DAM_DROP 0x4000 +#define DAM_LOSE_TURN 0x8000 +#define DAM_HIT_SELF 0x10000 +#define DAM_LOSE_AMMO 0x20000 +#define DAM_DUD 0x40000 +#define DAM_HURT_SELF 0x80000 +#define DAM_RANDOM_HIT 0x100000 +#define DAM_CRIP_RANDOM 0x200000 +#define DAM_BACKWASH 0x400000 // Fallout 2: -#define DAM_PERFORM_REVERSE 8388608 -#define critter_uninjure(WHO, FLAGS) critter_injure(WHO, (FLAGS BWOR DAM_PERFORM_REVERSE)) +#define DAM_PERFORM_REVERSE 0x800000 +#define critter_uninjure(WHO, FLAGS) critter_injure(WHO, (FLAGS bwor DAM_PERFORM_REVERSE)) #define DMG_normal_dam 0 #define DMG_laser 1 @@ -744,11 +684,9 @@ #define wm_get_subtile_state(XPOS,YPOS) metarule3(METARULE3_WM_SUBTILE_STATE,XPOS,YPOS,0) // Begin tile_get_next_critter(tile, elevation, lastCritter) -//CMH //Note these defines are really messey. #define METARULE3_TILE_GET_NEXT_CRITTER (106) #define tile_get_next_critter(tile, elevation, lastCritter) metarule3(METARULE3_TILE_GET_NEXT_CRITTER, tile, elevation, lastCritter) -//CMH // End #define METARULE3_ART_SET_BASE_FID_NUM (107) @@ -780,6 +718,8 @@ #define INVEN_CMD_INDEX_PTR (13) #define inven_ptr(WHO,WHERE) inven_cmds(WHO,INVEN_CMD_INDEX_PTR,WHERE) + +/* Extra */ /* GSound Values */ // gsound_character_types #define snd_human (0) @@ -820,76 +760,51 @@ #define hit_left_weapon_reload (6) #define hit_right_weapon_reload (7) -/* Extra */ - -#define fadeout(X) gfade_out(X) -#define fadein(X) gfade_in(X) - +#define fade_out gfade_out(1) +#define fade_in gfade_in(1) /* Time Information (in Ticks) */ - #define ONE_GAME_SECOND (10) -#define ONE_GAME_MINUTE (60*ONE_GAME_SECOND) -#define ONE_GAME_HOUR (60*ONE_GAME_MINUTE) -#define ONE_GAME_DAY (24*ONE_GAME_HOUR) -#define ONE_GAME_WEEK (7*ONE_GAME_DAY) -#define ONE_GAME_MONTH (30*ONE_GAME_DAY) +#define ONE_GAME_MINUTE (60 * ONE_GAME_SECOND) +#define ONE_GAME_HOUR (60 * ONE_GAME_MINUTE) +#define ONE_GAME_DAY (24 * ONE_GAME_HOUR) +#define ONE_GAME_WEEK (7 * ONE_GAME_DAY) +#define ONE_GAME_MONTH (30 * ONE_GAME_DAY) /* bits */ #define bit_1 (1) #define bit_2 (2) #define bit_3 (4) #define bit_4 (8) -#define bit_5 (16) -#define bit_6 (32) -#define bit_7 (64) -#define bit_8 (128) -#define bit_9 (256) -#define bit_10 (512) -#define bit_11 (1024) -#define bit_12 (2048) -#define bit_13 (4096) -#define bit_14 (8192) -#define bit_15 (16384) -#define bit_16 (32768) -#define bit_17 (65536) -#define bit_18 (131072) -#define bit_19 (262144) -#define bit_20 (524288) -#define bit_21 (1048576) -#define bit_22 (2097152) -#define bit_23 (4194304) -#define bit_24 (8388608) -#define bit_25 (16777216) -#define bit_26 (33554432) -#define bit_27 (67108864) -#define bit_28 (134217728) -#define bit_29 (268435456) -#define bit_30 (536870912) -#define bit_31 (1073741824) -#define bit_32 (-2147483648) -#define bit_ALL (-1) - -/* macros for pickup_p_proc responses. */ -#define REACTION_TG 1 -#define REACTION_G 2 -#define REACTION_TC 3 -#define REACTION_C 4 - -#define R_CALL_THROUGH 1 -#define R_NOCALL_THROUGH -1 - -#ifndef PICKUP_THRESH -#define PICKUP_THRESH 1 -#endif - -#ifndef CALL_PICKUP -#define CALL_PICKUP R_NOCALL_THROUGH -#endif - -#ifndef NPC_REACTION_VAR -#define NPC_REACTION_VAR (-1) -#endif +#define bit_5 (0x10) +#define bit_6 (0x20) +#define bit_7 (0x40) +#define bit_8 (0x80) +#define bit_9 (0x100) +#define bit_10 (0x200) +#define bit_11 (0x400) +#define bit_12 (0x800) +#define bit_13 (0x1000) +#define bit_14 (0x2000) +#define bit_15 (0x4000) +#define bit_16 (0x8000) +#define bit_17 (0x10000) +#define bit_18 (0x20000) +#define bit_19 (0x40000) +#define bit_20 (0x80000) +#define bit_21 (0x100000) +#define bit_22 (0x200000) +#define bit_23 (0x400000) +#define bit_24 (0x800000) +#define bit_25 (0x1000000) +#define bit_26 (0x2000000) +#define bit_27 (0x4000000) +#define bit_28 (0x8000000) +#define bit_29 (0x10000000) +#define bit_30 (0x20000000) +#define bit_31 (0x40000000) +#define bit_32 (0x80000000) +#define bit_ALL (0xFFFFFFFF) diff --git a/artifacts/scripting/sfall function notes.txt b/artifacts/scripting/sfall function notes.txt index 9166ce6f4..db2306062 100644 --- a/artifacts/scripting/sfall function notes.txt +++ b/artifacts/scripting/sfall function notes.txt @@ -778,8 +778,8 @@ optional arguments: > int sfall_func0("win_fill_color") > int sfall_func5("win_fill_color", int x, int y, int width, int height, int color) -- fills the rectangle area of the script window with the specified color, or clears the transparent window (function without arguments) -- color: the color index of the game palette (from 0 to 255) +- fills the rectangle area of the currently selected script window with the specified color, or clears the transparent window (use function without arguments or color index 0) +- color: the color index in the game palette (from 0 to 255) ------------------------ ------ MORE INFO ------- diff --git a/sfall/Modules/Scripting/Handlers/Interface.cpp b/sfall/Modules/Scripting/Handlers/Interface.cpp index dbbc10a66..6718b2d94 100644 --- a/sfall/Modules/Scripting/Handlers/Interface.cpp +++ b/sfall/Modules/Scripting/Handlers/Interface.cpp @@ -792,7 +792,7 @@ void mf_win_fill_color(OpcodeContext& ctx) { return; } if (ctx.numArgs() > 0) { - fo::WinFillRect(fo::var::sWindows[iWin].wID, ctx.arg(0).rawValue(), ctx.arg(1).rawValue(), ctx.arg(2).rawValue(), ctx.arg(3).rawValue(), ctx.arg(4).rawValue()); + fo::WinFillRect(fo::var::sWindows[iWin].wID, ctx.arg(0).rawValue(), ctx.arg(1).rawValue(), ctx.arg(2).rawValue(), ctx.arg(3).rawValue(), (BYTE)ctx.arg(4).rawValue()); } else { fo::ClearWindow(fo::var::sWindows[iWin].wID, false); // full clear } diff --git a/sfall/Modules/Scripting/OpcodeContext.cpp b/sfall/Modules/Scripting/OpcodeContext.cpp index e73780418..25f2455ba 100644 --- a/sfall/Modules/Scripting/OpcodeContext.cpp +++ b/sfall/Modules/Scripting/OpcodeContext.cpp @@ -70,7 +70,6 @@ int OpcodeContext::argShift() const { void OpcodeContext::setArgShift (int shift) { assert(shift >= 0); - _argShift = shift; } @@ -175,6 +174,7 @@ void OpcodeContext::handleOpcode(ScriptingFunctionHandler func, const OpcodeArgu if (_hasReturn) _pushReturnValue(); } +// unused method void __stdcall OpcodeContext::handleOpcodeStatic(fo::Program* program, DWORD opcodeOffset, ScriptingFunctionHandler func, char argNum, bool hasReturn) { // for each opcode create new context on stack (no allocations at this point) OpcodeContext currentContext(program, opcodeOffset / 4, argNum, hasReturn); diff --git a/sfall/Modules/Scripting/OpcodeContext.h b/sfall/Modules/Scripting/OpcodeContext.h index cfc418242..4f0561c42 100644 --- a/sfall/Modules/Scripting/OpcodeContext.h +++ b/sfall/Modules/Scripting/OpcodeContext.h @@ -163,10 +163,8 @@ class OpcodeContext { static DWORD getScriptTypeBySfallType(DataType dataType); private: - // pops arguments from data stack - void _popArguments(); - // pushes return value to data stack - void _pushReturnValue(); + std::array _args; + ScriptValue _ret; fo::Program* _program; DWORD _opcode; @@ -174,12 +172,15 @@ class OpcodeContext { const SfallMetarule* _metarule; - int _numArgs; + int _numArgs; bool _hasReturn; - int _argShift; - std::array _args; - ScriptValue _ret; + int _argShift; long _errorVal; // error value for incorrect arguments + + // pops arguments from data stack + void _popArguments(); + // pushes return value to data stack + void _pushReturnValue(); }; }