mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061a3925e6 | ||
|
|
c6fa6bac30 | ||
|
|
0988004245 | ||
|
|
e59af7e88a | ||
|
|
7cf1b60b38 | ||
|
|
a8919367ea | ||
|
|
0a44f7118a | ||
|
|
cda56aca7d |
+4
-1
@@ -1,5 +1,5 @@
|
||||
;sfall configuration settings
|
||||
;v3.8.28
|
||||
;v3.8.28.1
|
||||
|
||||
[Main]
|
||||
;Change to 1 if you want to use command line args to tell sfall to use another ini file.
|
||||
@@ -687,6 +687,9 @@ CarPlacedTileFix=1
|
||||
InstantWeaponEquip=0
|
||||
|
||||
;To add additional game msg files, uncomment the next line and set a comma delimited list of filenames without .msg extension
|
||||
;By default, the files will have consecutive numbers assigned beginning with 0
|
||||
;You can use the syntax 'filename:number' to manually assign numbers to specific msg files, with each pair separated by a comma
|
||||
;If a file after the specified pair does not have a number assigned, it will have the next consecutive number from the last pair
|
||||
;You need to use the message_str_game script function to get messages from the files
|
||||
;ExtraGameMsgFileList=
|
||||
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
/*
|
||||
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef COMMAND_H
|
||||
#define COMMAND_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(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))
|
||||
#define critter_wearing_armor(x) (obj_item_subtype(critter_inven_obj(x,INVEN_TYPE_WORN)) == item_type_armor)
|
||||
|
||||
@@ -21,13 +17,13 @@
|
||||
#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_carry who_carry_amount(dude_obj)
|
||||
#define dude_max_carry who_max_carry(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)
|
||||
@@ -39,43 +35,50 @@
|
||||
(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 \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_COMBAT_KNIFE))
|
||||
#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_RIGHT_HAND)) == PID_SWITCHBLADE) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_SHIV) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_LIL_JESUS_WEAPON) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_RIGHT_HAND)) == PID_WAKIZASHI_BLADE) 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) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_SWITCHBLADE) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_SHIV) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_LIL_JESUS_WEAPON) orElse \
|
||||
(obj_pid(critter_inven_obj(dude_obj,INVEN_TYPE_LEFT_HAND)) == PID_WAKIZASHI_BLADE))
|
||||
|
||||
#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))
|
||||
@@ -99,8 +102,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)))
|
||||
@@ -112,7 +113,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))
|
||||
@@ -128,7 +128,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))
|
||||
@@ -173,19 +173,20 @@
|
||||
|
||||
#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)
|
||||
@@ -200,7 +201,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))
|
||||
|
||||
@@ -219,9 +219,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)
|
||||
@@ -229,7 +227,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
|
||||
@@ -335,9 +332,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
|
||||
******************************************************************/
|
||||
@@ -385,59 +380,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); \
|
||||
@@ -448,63 +396,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)
|
||||
|
||||
@@ -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_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,14 +328,12 @@
|
||||
#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_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)
|
||||
@@ -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 <objptr> 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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -265,6 +265,7 @@
|
||||
#define art_cache_clear sfall_func0("art_cache_clear")
|
||||
#define attack_is_aimed sfall_func0("attack_is_aimed")
|
||||
#define car_gas_amount sfall_func0("car_gas_amount")
|
||||
#define clear_window sfall_func0("win_fill_color")
|
||||
#define combat_data sfall_func0("combat_data")
|
||||
#define create_win(winName, x, y, w, h) sfall_func5("create_win", winName, x, y, w, h)
|
||||
#define create_win_flag(winName, x, y, w, h, flag) sfall_func6("create_win", winName, x, y, w, h, flag)
|
||||
@@ -341,5 +342,6 @@
|
||||
#define unjam_lock(obj) sfall_func1("unjam_lock", obj)
|
||||
#define unset_unique_id(obj) sfall_func2("set_unique_id", obj, -1)
|
||||
#define unwield_slot(critter, slot) sfall_func2("unwield_slot", critter, slot)
|
||||
#define win_fill_color(x, y, width, height, color) sfall_func5("win_fill_color", x, y, width, height, color)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -324,6 +324,7 @@ Some utility/math functions are available:
|
||||
- works exactly the same as message_str, except you get messages from files in "text\<language>\game\" directory
|
||||
- use GAME_MSG_* defines or mstr_* macros from sfall.h to use specific msg file
|
||||
- Additional game msg files added by ExtraGameMsgFileList setting will have consecutive fileIds assigned beginning from 0x2000 to 0x2FFF. (e.g. if you set ExtraGameMsgFileList=foo,bar in ddraw.ini, foo.msg will be associated with 0x2000 and bar.msg with 0x2001.)
|
||||
- if a file has a specific number assigned in ExtraGameMsgFileList, its fileId will be (0x2000 + assigned number). (e.g. with ExtraGameMsgFileList=foo,bar:2,foobar in ddraw.ini, bar.msg will be associated with 0x2002 and foobar.msg with 0x2003.)
|
||||
|
||||
> int sneak_success
|
||||
- returns 1 if the player is currently sneaking, and last sneak attempt (roll against skill) was successful; 0 otherwise
|
||||
@@ -647,7 +648,7 @@ optional arguments:
|
||||
- message: the text in the dialog box. Use the '\n' control character to move text to a new line (example: "Hello\nWorld!")
|
||||
optional arguments:
|
||||
- flags: mode flags (see MSGBOX_* constants in define_extra.h). Pass -1 to skip setting the flags (default flags are NORMAL and YESNO)
|
||||
- color1/color2: the color index in Fallout palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
|
||||
- color1/color2: the color index in the game palette. color1 sets the text color for the first line, and color2 for all subsequent lines of text (default color is 145)
|
||||
|
||||
> int sfall_func1("get_stat_min", int stat)
|
||||
> int sfall_func1("get_stat_max", int stat)
|
||||
@@ -677,7 +678,7 @@ optional arguments:
|
||||
- text: the text to be printed. Use the '\n' control character to move text to a new line (example: "Hello\nWorld!")
|
||||
- winType: the type number of the interface window (see WINTYPE_* constants in sfall.h)
|
||||
- x/y: offset relative to the top-left corner of the window
|
||||
- color: the color index in Fallout palette. Pass 0 if the text color was previously set by vanilla SetTextColor function
|
||||
- color: the color index in the game palette. Pass 0 if the text color was previously set by vanilla SetTextColor function
|
||||
it can also take additional flags (via bwor) for displaying text:
|
||||
0x0010000 - adds a shadow to the text, the 'textshadow' compiler constant
|
||||
0x1000000 - prevents immediate redrawing of the interface window, the 'textdirect' compiler constant (works the other way around)
|
||||
@@ -689,6 +690,11 @@ optional arguments:
|
||||
- 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);
|
||||
|
||||
> 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 currently selected script window with the specified color, or clears the window with transparent (index 0) color (call the function without arguments)
|
||||
- color: the color index in the game palette (from 0 to 255)
|
||||
|
||||
------------------------
|
||||
------ MORE INFO -------
|
||||
------------------------
|
||||
|
||||
+38
-3
@@ -210,7 +210,7 @@ DWORD* ptr_stack_offset = reinterpret_cast<DWORD*>(_stack_offset
|
||||
DWORD* ptr_stat_data = reinterpret_cast<DWORD*>(_stat_data);
|
||||
DWORD* ptr_stat_flag = reinterpret_cast<DWORD*>(_stat_flag);
|
||||
SubTitleList** ptr_subtitleList = reinterpret_cast<SubTitleList**>(_subtitleList);
|
||||
DWORD* ptr_sWindows = reinterpret_cast<DWORD*>(_sWindows); // total 16 sWindow struct
|
||||
sWindow* ptr_sWindows = reinterpret_cast<sWindow*>(_sWindows); // array of 16 sWindow
|
||||
DWORD* ptr_Tag_ = reinterpret_cast<DWORD*>(_Tag_);
|
||||
DWORD* ptr_tag_skill = reinterpret_cast<DWORD*>(_tag_skill);
|
||||
DWORD* ptr_target_curr_stack = reinterpret_cast<DWORD*>(_target_curr_stack);
|
||||
@@ -352,6 +352,7 @@ const DWORD critter_name_ = 0x42D0A8;
|
||||
const DWORD critter_pc_set_name_ = 0x42D138;
|
||||
const DWORD critterClearObjDrugs_ = 0x42DA54;
|
||||
const DWORD critterIsOverloaded_ = 0x42E66C;
|
||||
const DWORD datafileConvertData_ = 0x42EE84;
|
||||
const DWORD db_access_ = 0x4390B4;
|
||||
const DWORD db_dir_entry_ = 0x4C5D68;
|
||||
const DWORD db_fclose_ = 0x4C5EB4;
|
||||
@@ -554,6 +555,7 @@ const DWORD ListSkills_ = 0x436154;
|
||||
const DWORD ListTraits_ = 0x43B8A8;
|
||||
const DWORD loadColorTable_ = 0x4C78E4;
|
||||
const DWORD LoadGame_ = 0x47C640;
|
||||
const DWORD loadPCX_ = 0x496494;
|
||||
const DWORD loadProgram_ = 0x4A3B74;
|
||||
const DWORD LoadSlot_ = 0x47DC68;
|
||||
const DWORD load_frame_ = 0x419EC0;
|
||||
@@ -591,6 +593,7 @@ const DWORD move_inventory_ = 0x474708;
|
||||
const DWORD movieRun_ = 0x487AC8;
|
||||
const DWORD movieStop_ = 0x487150;
|
||||
const DWORD movieUpdate_ = 0x487BEC;
|
||||
const DWORD my_free_ = 0x4C5C2C;
|
||||
const DWORD new_obj_id_ = 0x4A386C;
|
||||
const DWORD NixHotLines_ = 0x4999C0;
|
||||
const DWORD nrealloc_ = 0x4F1669;
|
||||
@@ -718,6 +721,7 @@ const DWORD scr_set_ext_param_ = 0x4A3B34;
|
||||
const DWORD scr_set_local_var_ = 0x4A6E58;
|
||||
const DWORD scr_set_objs_ = 0x4A3B0C;
|
||||
const DWORD scr_write_ScriptNode_ = 0x4A5704;
|
||||
const DWORD selectWindowID_ = 0x4B81C4;
|
||||
const DWORD set_focus_func_ = 0x4C9438;
|
||||
const DWORD set_game_time_ = 0x4A347C;
|
||||
const DWORD setup_move_timer_win_ = 0x476AB8;
|
||||
@@ -1188,6 +1192,23 @@ void __cdecl TransBufToBuf(BYTE* src, long width, long height, long src_width, B
|
||||
__asm emms;
|
||||
}
|
||||
|
||||
BYTE* __fastcall LoadPCXData(const char* file, long* width, long* height) {
|
||||
__asm {
|
||||
mov eax, ecx;
|
||||
mov ebx, height;
|
||||
mov ecx, _pal;
|
||||
call loadPCX_;
|
||||
push eax;
|
||||
mov ebx, [width];
|
||||
mov edx, _pal;
|
||||
mov ecx, [height];
|
||||
mov ebx, [ebx];
|
||||
mov ecx, [ecx];
|
||||
call datafileConvertData_;
|
||||
pop eax;
|
||||
}
|
||||
}
|
||||
|
||||
long __fastcall GetGameConfigString(const char* outValue, const char* section, const char* param) {
|
||||
__asm {
|
||||
mov ebx, param;
|
||||
@@ -1552,11 +1573,25 @@ void DrawToSurface(long width, long height, long fromX, long fromY, long fromWid
|
||||
}
|
||||
}
|
||||
|
||||
// Fills the specified non-scripted interface window with index color 0 (black color)
|
||||
// Fills the specified interface window with index color
|
||||
void WinFillRect(long winID, long x, long y, long width, long height, BYTE indexColor) {
|
||||
WINinfo* win = GNWFind(winID);
|
||||
BYTE* surf = win->surface + (win->width * y) + x;
|
||||
long pitch = win->width - width;
|
||||
while (height--) {
|
||||
long w = width;
|
||||
while (w--) *surf++ = indexColor;
|
||||
surf += pitch;
|
||||
};
|
||||
}
|
||||
|
||||
// Fills the specified interface window with index color 0 (black color)
|
||||
void ClearWindow(long winID, bool refresh) {
|
||||
WINinfo* win = GNWFind(winID);
|
||||
BYTE* surf = win->surface;
|
||||
for (long i = 0; i < win->height; i++) {
|
||||
std::memset(win->surface, 0, win->width);
|
||||
std::memset(surf, 0, win->width);
|
||||
surf += win->width;
|
||||
}
|
||||
if (refresh) {
|
||||
GNWWinRefresh(win, &win->rect, 0);
|
||||
|
||||
+13
-2
@@ -106,6 +106,7 @@
|
||||
#define _folder_card_title2 0x5705BC
|
||||
#define _frame_time 0x5709C4
|
||||
#define _free_perk 0x570A29
|
||||
#define _freePtr 0x519594
|
||||
#define _frstc_draw1 0x5707D8
|
||||
#define _game_config 0x58E950
|
||||
#define _game_global_vars 0x5186C0
|
||||
@@ -206,6 +207,7 @@
|
||||
#define _optionsButtonUpKey 0x518F28
|
||||
#define _optnwin 0x663900
|
||||
#define _outlined_object 0x518D94
|
||||
#define _pal 0x56D7E0
|
||||
#define _partyMemberAIOptions 0x519DB8
|
||||
#define _partyMemberCount 0x519DAC
|
||||
#define _partyMemberLevelUpInfoList 0x519DBC
|
||||
@@ -513,7 +515,7 @@ extern DWORD* ptr_stack_offset;
|
||||
extern DWORD* ptr_stat_data;
|
||||
extern DWORD* ptr_stat_flag;
|
||||
extern SubTitleList** ptr_subtitleList;
|
||||
extern DWORD* ptr_sWindows; // total 16 sWindow struct
|
||||
extern sWindow* ptr_sWindows; // array of 16 sWindow
|
||||
extern DWORD* ptr_Tag_;
|
||||
extern DWORD* ptr_tag_skill;
|
||||
extern DWORD* ptr_target_curr_stack;
|
||||
@@ -638,6 +640,7 @@ extern const DWORD critter_name_;
|
||||
extern const DWORD critter_pc_set_name_;
|
||||
extern const DWORD critterClearObjDrugs_;
|
||||
extern const DWORD critterIsOverloaded_;
|
||||
extern const DWORD datafileConvertData_;
|
||||
extern const DWORD db_access_;
|
||||
extern const DWORD db_dir_entry_;
|
||||
extern const DWORD db_fclose_;
|
||||
@@ -843,6 +846,7 @@ extern const DWORD ListSkills_;
|
||||
extern const DWORD ListTraits_;
|
||||
extern const DWORD loadColorTable_;
|
||||
extern const DWORD LoadGame_;
|
||||
extern const DWORD loadPCX_;
|
||||
extern const DWORD loadProgram_; // loads script from scripts/ folder by file name and returns pointer to it: char* <eax> - file name (w/o extension)
|
||||
extern const DWORD LoadSlot_;
|
||||
extern const DWORD load_frame_;
|
||||
@@ -883,6 +887,7 @@ extern const DWORD move_inventory_;
|
||||
extern const DWORD movieRun_;
|
||||
extern const DWORD movieStop_;
|
||||
extern const DWORD movieUpdate_;
|
||||
extern const DWORD my_free_;
|
||||
extern const DWORD new_obj_id_;
|
||||
extern const DWORD NixHotLines_;
|
||||
extern const DWORD nrealloc_;
|
||||
@@ -1013,6 +1018,7 @@ extern const DWORD scr_set_ext_param_;
|
||||
extern const DWORD scr_set_local_var_;
|
||||
extern const DWORD scr_set_objs_;
|
||||
extern const DWORD scr_write_ScriptNode_;
|
||||
extern const DWORD selectWindowID_;
|
||||
extern const DWORD set_focus_func_;
|
||||
extern const DWORD set_game_time_;
|
||||
extern const DWORD setup_move_timer_win_;
|
||||
@@ -1195,6 +1201,8 @@ void __cdecl BufToBuf(BYTE* src, long width, long height, long src_width, BYTE*
|
||||
// trans_buf_to_buf_ function implementation
|
||||
void __cdecl TransBufToBuf(BYTE* src, long width, long height, long src_width, BYTE* dst, long dst_width);
|
||||
|
||||
BYTE* __fastcall LoadPCXData(const char* file, long* width, long* height);
|
||||
|
||||
long __fastcall GetGameConfigString(const char* outValue, const char* section, const char* param);
|
||||
|
||||
// X-Macro for wrapper functions.
|
||||
@@ -1334,7 +1342,10 @@ void DrawToSurface(long width, long height, long fromX, long fromY, long fromWid
|
||||
|
||||
void DrawToSurface(long width, long height, long fromX, long fromY, long fromWidth, BYTE* fromSurf, long toX, long toY, long toWidth, long toHeight, BYTE* toSurf);
|
||||
|
||||
// Fills the specified non-scripted interface window with index color 0 (black color)
|
||||
// Fills the specified interface window with index color
|
||||
void WinFillRect(long winID, long x, long y, long width, long height, BYTE indexColor);
|
||||
|
||||
// Fills the specified interface window with index color 0 (black color)
|
||||
void ClearWindow(long winID, bool refresh = true);
|
||||
|
||||
// Print text to surface
|
||||
|
||||
@@ -187,6 +187,7 @@ WRAP_WATCOM_FUNC3(long, RegisterObjectTakeOut, register_object_take_out_, TGameO
|
||||
WRAP_WATCOM_FUNC3(long, RegisterObjectTurnTowards, register_object_turn_towards_, TGameObj*, object, long, tileNum, long, nothing)
|
||||
WRAP_WATCOM_FUNC2(long, RollRandom, roll_random_, long, minValue, long, maxValue)
|
||||
WRAP_WATCOM_FUNC1(long*, RunProgram, runProgram_, TProgram*, progPtr)
|
||||
WRAP_WATCOM_FUNC1(long, SelectWindowID, selectWindowID_, long, sWinID)
|
||||
WRAP_WATCOM_FUNC1(TScript*, ScrFindFirstAt, scr_find_first_at_, long, elevation)
|
||||
WRAP_WATCOM_FUNC0(TScript*, ScrFindNextAt, scr_find_next_at_)
|
||||
WRAP_WATCOM_FUNC1(TGameObj*, ScrFindObjFromProgram, scr_find_obj_from_program_, TProgram*, program)
|
||||
|
||||
+42
-24
@@ -158,8 +158,7 @@ struct CombatGcsd {
|
||||
struct TScript {
|
||||
long id;
|
||||
long next;
|
||||
// first 3 bits - elevation, rest - tile number
|
||||
long elevationAndTile;
|
||||
long elevationAndTile; // first 3 bits - elevation, rest - tile number
|
||||
long spatialRadius;
|
||||
long flags;
|
||||
long scriptIdx;
|
||||
@@ -175,31 +174,50 @@ struct TScript {
|
||||
TGameObj *targetObject;
|
||||
long actionNum;
|
||||
long scriptOverrides;
|
||||
char gap_48[4];
|
||||
long field_48;
|
||||
long howMuch;
|
||||
char gap_50[4];
|
||||
long field_50;
|
||||
long procedureTable[28];
|
||||
};
|
||||
|
||||
// Script run-time data
|
||||
struct TProgram {
|
||||
const char* fileName;
|
||||
const char* fileName; // path and file name of the script "scripts\*.int"
|
||||
long *codeStackPtr;
|
||||
long gap_8;
|
||||
long gap_9;
|
||||
long field_8;
|
||||
long field_C;
|
||||
long *codePtr;
|
||||
long field_14;
|
||||
long gap_18;
|
||||
long field_18;
|
||||
long *dStackPtr;
|
||||
long *aStackPtr;
|
||||
long *dStackOffs;
|
||||
long *aStackOffs;
|
||||
long gap_2C;
|
||||
long field_2C;
|
||||
long *stringRefPtr;
|
||||
long gap_34;
|
||||
long *procTablePtr;
|
||||
long field_34; // procTablePtr
|
||||
long *procTablePtr; // field_38
|
||||
long regs[12];
|
||||
long field_6C;
|
||||
long field_70;
|
||||
long field_74;
|
||||
long field_78;
|
||||
long field_7C;
|
||||
union {
|
||||
long flags;
|
||||
struct {
|
||||
char flags1;
|
||||
char flags2;
|
||||
char flags3;
|
||||
char flags4;
|
||||
};
|
||||
};
|
||||
long currentScriptWin; // current window for executing script
|
||||
long field_88;
|
||||
};
|
||||
|
||||
static_assert(sizeof(TProgram) == 140, "Incorrect TProgram definition.");
|
||||
|
||||
struct ItemButtonItem {
|
||||
TGameObj* item;
|
||||
union {
|
||||
@@ -478,14 +496,14 @@ struct WINinfo {
|
||||
long width;
|
||||
long height;
|
||||
long clearColour;
|
||||
long rand1;
|
||||
long rand2;
|
||||
long randX;
|
||||
long randY;
|
||||
BYTE *surface; // bytes frame data ref to palette
|
||||
long *buttonsList;
|
||||
long unknown5; // buttonptr?
|
||||
long unknown6;
|
||||
long buttonT1; // buttonptr?
|
||||
long buttonT2;
|
||||
long *menuBar;
|
||||
long *drawFunc;
|
||||
long *drawFunc; // trans_buf_to_buf_
|
||||
};
|
||||
|
||||
struct sWindow {
|
||||
@@ -493,18 +511,18 @@ struct sWindow {
|
||||
long wID;
|
||||
long width;
|
||||
long height;
|
||||
long unknown1;
|
||||
long unknown2;
|
||||
long unknown3;
|
||||
long unknown4;
|
||||
long region1;
|
||||
long region2;
|
||||
long region3;
|
||||
long region4;
|
||||
long *buttons;
|
||||
long numButtons;
|
||||
long unknown5;
|
||||
long unknown6;
|
||||
long setPositionX;
|
||||
long setPositionY;
|
||||
long clearColour;
|
||||
long flags;
|
||||
long unknown7;
|
||||
long unknown8;
|
||||
float randX;
|
||||
float randY;
|
||||
};
|
||||
|
||||
struct LSData {
|
||||
|
||||
+4
-6
@@ -567,14 +567,12 @@ static void __declspec(naked) main_death_scene_hook() {
|
||||
}
|
||||
|
||||
static void __declspec(naked) display_body_hook() {
|
||||
static const DWORD display_body_hook_Ret = 0x47098D;
|
||||
__asm {
|
||||
mov ebx, [esp + 0x60 - 0x28 + 8];
|
||||
cmp ebx, 1; // check mode 0 or 1
|
||||
jbe fix;
|
||||
add esp, 8;
|
||||
mov dword ptr [esp + 0x60 - 0x40], 0; // frm_ptr
|
||||
jmp display_body_hook_Ret;
|
||||
xor ebx, ebx;
|
||||
jmp art_id_;
|
||||
fix:
|
||||
dec edx; // USE.FRM
|
||||
mov ecx, 48; // INVBOX.FRM
|
||||
@@ -618,7 +616,7 @@ void InterfaceInit() {
|
||||
if (hrpIsEnabled == false || hrpVersionValid) SafeWrite8(0x481345, 4); // main_death_scene_
|
||||
if (hrpVersionValid) SafeWrite8(HRPAddress(0x10011738), 10);
|
||||
|
||||
// Cosmetic fix for the background image of the character portrait on the inventory and character screens
|
||||
// Cosmetic fix for the background image of the character portrait on the player's inventory screen
|
||||
HookCall(0x47093C, display_body_hook);
|
||||
BYTE code[11] = {
|
||||
0x8B, 0xD3, // mov edx, ebx
|
||||
@@ -626,7 +624,7 @@ void InterfaceInit() {
|
||||
0x0F, 0xAF, 0xD3, // imul edx, ebx (y * frame width)
|
||||
0x53, 0x90 // push ebx (frame width)
|
||||
};
|
||||
SafeWriteBytes(0x470971, code, 11);
|
||||
SafeWriteBytes(0x470971, code, 11); // calculates the offset in the pixel array for x/y coordinates
|
||||
}
|
||||
|
||||
void InterfaceExit() {
|
||||
|
||||
@@ -346,10 +346,6 @@ static void __declspec(naked) NewGame() {
|
||||
}
|
||||
}
|
||||
|
||||
static void ReadExtraGameMsgFilesIfNeeded() {
|
||||
if (gExtraGameMsgLists.empty()) ReadExtraGameMsgFiles();
|
||||
}
|
||||
|
||||
static void __declspec(naked) MainMenuHook() {
|
||||
__asm {
|
||||
pushad;
|
||||
@@ -357,7 +353,7 @@ static void __declspec(naked) MainMenuHook() {
|
||||
call ResetState;
|
||||
mov al, pipBoyAvailableAtGameStart;
|
||||
mov byte ptr ds:[_gmovie_played_list + 3], al;
|
||||
call ReadExtraGameMsgFilesIfNeeded;
|
||||
call ReadExtraGameMsgFiles;
|
||||
popad;
|
||||
jmp main_menu_loop_;
|
||||
}
|
||||
|
||||
+25
-28
@@ -17,9 +17,10 @@
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
#include "main.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "FalloutEngine.h"
|
||||
|
||||
#include "Message.h"
|
||||
|
||||
#define CASTMSG(adr) reinterpret_cast<MSGList*>(adr)
|
||||
@@ -48,6 +49,7 @@ const MSGList* gameMsgFiles[] = {
|
||||
#undef CASTMSG
|
||||
|
||||
ExtraGameMessageListsMap gExtraGameMsgLists;
|
||||
static std::vector<std::string> msgFileList;
|
||||
|
||||
// Loads the msg file from the 'english' folder if it does not exist in the current language directory
|
||||
static void __declspec(naked) message_load_hook() {
|
||||
@@ -106,40 +108,27 @@ char* GetMsg(MSGList* msgList, int msgRef, int msgNum) {
|
||||
}
|
||||
|
||||
void ReadExtraGameMsgFiles() {
|
||||
int read;
|
||||
std::string names;
|
||||
|
||||
names.resize(256);
|
||||
|
||||
while ((read = GetConfigString("Misc", "ExtraGameMsgFileList", "",
|
||||
(LPSTR)names.data(), names.size())) == names.size() - 1)
|
||||
names.resize(names.size() + 256);
|
||||
|
||||
if (names.empty()) return;
|
||||
|
||||
names.resize(names.find_first_of('\0'));
|
||||
names.append(",");
|
||||
|
||||
int begin = 0;
|
||||
int end;
|
||||
int length;
|
||||
if (!msgFileList.empty()) {
|
||||
int number = 0;
|
||||
|
||||
while ((end = names.find_first_of(',', begin)) != std::string::npos) {
|
||||
length = end - begin;
|
||||
|
||||
if (length > 0) {
|
||||
std::string path = "game\\" + names.substr(begin, length) + ".msg";
|
||||
MSGList* list = new MSGList;
|
||||
for (std::vector<std::string>::const_iterator it = msgFileList.begin(); it != msgFileList.end(); ++it) {
|
||||
std::string path("game\\");
|
||||
size_t n = it->find(':');
|
||||
if (n == std::string::npos) {
|
||||
path += *it;
|
||||
} else {
|
||||
path += it->substr(0, n);
|
||||
number = std::stoi(it->substr(n + 1), nullptr, 0);
|
||||
}
|
||||
path += ".msg";
|
||||
MSGList* list = new MSGList();
|
||||
if (MessageLoad(list, path.c_str()) == 1) {
|
||||
gExtraGameMsgLists.insert(std::make_pair(0x2000 + number, list));
|
||||
} else {
|
||||
delete list;
|
||||
}
|
||||
}
|
||||
if (++number == 4096) break;
|
||||
|
||||
begin = end + 1;
|
||||
}
|
||||
msgFileList.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,3 +145,11 @@ void ClearReadExtraGameMsgFiles() {
|
||||
delete it->second;
|
||||
}
|
||||
}
|
||||
|
||||
void MessageInit() {
|
||||
msgFileList = GetConfigList("Misc", "ExtraGameMsgFileList", "", 512);
|
||||
}
|
||||
|
||||
void MessageExit() {
|
||||
//gExtraGameMsgLists.clear();
|
||||
}
|
||||
|
||||
+6
-2
@@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
#define MSG_FILE_COMBAT (0x56D368)
|
||||
@@ -46,9 +47,12 @@ typedef std::tr1::unordered_map<int, MSGList*> ExtraGameMessageListsMap;
|
||||
extern ExtraGameMessageListsMap gExtraGameMsgLists;
|
||||
extern const MSGList* gameMsgFiles[];
|
||||
|
||||
MSGNode* GetMsgNode(MSGList* msgList, int msgRef);
|
||||
char* GetMsg(MSGList* msgList, int msgRef, int msgNum);
|
||||
void MessageInit();
|
||||
void MessageExit();
|
||||
|
||||
void ReadExtraGameMsgFiles();
|
||||
void FallbackEnglishLoadMsgFiles();
|
||||
void ClearReadExtraGameMsgFiles();
|
||||
|
||||
MSGNode* GetMsgNode(MSGList* msgList, int msgRef);
|
||||
char* GetMsg(MSGList* msgList, int msgRef, int msgNum);
|
||||
|
||||
@@ -206,12 +206,12 @@ class OpcodeHandler {
|
||||
public:
|
||||
OpcodeHandler() {
|
||||
_argShift = 0;
|
||||
_args.reserve(OP_MAX_ARGUMENTS);
|
||||
_args.resize(OP_MAX_ARGUMENTS);
|
||||
}
|
||||
|
||||
// number of arguments, possibly reduced by argShift
|
||||
int numArgs() const {
|
||||
return _args.size() - _argShift;
|
||||
return _numArgs - _argShift;
|
||||
}
|
||||
|
||||
// returns current argument shift, default is 0
|
||||
@@ -223,7 +223,6 @@ public:
|
||||
// for example if shift value is 2, then subsequent calls to arg(i) will return arg(i+2) instead, etc.
|
||||
void setArgShift(int shift) {
|
||||
assert(shift >= 0);
|
||||
|
||||
_argShift = shift;
|
||||
}
|
||||
|
||||
@@ -257,10 +256,12 @@ public:
|
||||
void resetState(TProgram* program, int argNum) {
|
||||
_program = program;
|
||||
|
||||
// reset argument list
|
||||
if (argNum < OP_MAX_ARGUMENTS) std::fill(_args.begin() + argNum, _args.end(), ScriptValue());
|
||||
// reset return value
|
||||
_ret = ScriptValue();
|
||||
// reset argument list
|
||||
_args.resize(argNum);
|
||||
// reset number of arguments
|
||||
_numArgs = argNum;
|
||||
// reset arg shift
|
||||
_argShift = 0;
|
||||
}
|
||||
@@ -356,11 +357,13 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
TProgram* _program;
|
||||
|
||||
int _argShift;
|
||||
std::vector<ScriptValue> _args;
|
||||
ScriptValue _ret;
|
||||
|
||||
TProgram* _program;
|
||||
|
||||
int _numArgs;
|
||||
int _argShift;
|
||||
};
|
||||
|
||||
static OpcodeHandler opHandler;
|
||||
@@ -880,6 +883,7 @@ static const SfallOpcodeMetadata opcodeMetaArray[] = {
|
||||
{mf_tile_by_position, "tile_by_position", {DATATYPE_MASK_INT, DATATYPE_MASK_INT}},
|
||||
{mf_unjam_lock, "unjam_lock", {DATATYPE_MASK_VALID_OBJ}},
|
||||
{mf_unwield_slot, "unwield_slot", {DATATYPE_MASK_VALID_OBJ, DATATYPE_MASK_INT}},
|
||||
{mf_win_fill_color, "win_fill_color", {DATATYPE_MASK_INT, DATATYPE_MASK_INT, DATATYPE_MASK_INT, DATATYPE_MASK_INT, DATATYPE_MASK_INT}},
|
||||
#ifndef NDEBUG
|
||||
{mf_test, "validate_test", {DATATYPE_MASK_INT, DATATYPE_MASK_INT | DATATYPE_MASK_FLOAT, DATATYPE_MASK_STR, DATATYPE_NONE}},
|
||||
#endif
|
||||
|
||||
@@ -340,8 +340,7 @@ static void __declspec(naked) op_is_iface_tag_active() {
|
||||
}
|
||||
|
||||
static void mf_intface_redraw() {
|
||||
DWORD flag = (opHandler.numArgs() > 0) ? opHandler.arg(0).rawValue() : 0;
|
||||
if (flag == 0) {
|
||||
if (opHandler.arg(0).rawValue() == 0) {
|
||||
IntfaceRedraw();
|
||||
} else {
|
||||
RefreshGNW(2); // fake redraw all interfaces (TODO: need a real redraw of interfaces)
|
||||
@@ -445,7 +444,7 @@ static void mf_create_win() {
|
||||
: WinFlags::MoveOnTop;
|
||||
|
||||
if (CreateWindowFunc(opHandler.arg(0).strValue(),
|
||||
opHandler.arg(1).rawValue(), opHandler.arg(2).rawValue(), // y, x
|
||||
opHandler.arg(1).rawValue(), opHandler.arg(2).rawValue(), // x, y
|
||||
opHandler.arg(3).rawValue(), opHandler.arg(4).rawValue(), // w, h
|
||||
(flags & WinFlags::Transparent) ? 0 : 256, flags) == -1)
|
||||
{
|
||||
@@ -457,11 +456,9 @@ static void mf_create_win() {
|
||||
static void mf_show_window() {
|
||||
if (opHandler.numArgs() > 0) {
|
||||
const char* name = opHandler.arg(0).strValue();
|
||||
sWindow sWin;
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
sWin = *(sWindow*)&ptr_sWindows[i * 23]; // sWindow struct = 92 bytes
|
||||
if (_stricmp(name, sWin.name) == 0) {
|
||||
WinShow(sWin.wID);
|
||||
if (_stricmp(name, ptr_sWindows[i].name) == 0) {
|
||||
WinShow(ptr_sWindows[i].wID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -474,11 +471,9 @@ static void mf_show_window() {
|
||||
static void mf_hide_window() {
|
||||
if (opHandler.numArgs() > 0) {
|
||||
const char* name = opHandler.arg(0).strValue();
|
||||
sWindow sWin;
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
sWin = *(sWindow*)&ptr_sWindows[i * 23]; // sWindow struct = 92 bytes
|
||||
if (_stricmp(name, sWin.name) == 0) {
|
||||
WinHide(sWin.wID);
|
||||
if (_stricmp(name, ptr_sWindows[i].name) == 0) {
|
||||
WinHide(ptr_sWindows[i].wID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -503,16 +498,14 @@ static void mf_set_window_flag() {
|
||||
bool mode = opHandler.arg(2).asBool();
|
||||
if (opHandler.arg(0).isString()) {
|
||||
const char* name = opHandler.arg(0).strValue();
|
||||
sWindow sWin;
|
||||
for (size_t i = 0; i < 16; i++) {
|
||||
sWin = *(sWindow*)&ptr_sWindows[i * 23]; // sWindow struct = 92 bytes
|
||||
if (_stricmp(name, sWin.name) == 0) {
|
||||
WINinfo* win = GNWFind(sWin.wID);
|
||||
if (_stricmp(name, ptr_sWindows[i].name) == 0) {
|
||||
WINinfo* win = GNWFind(ptr_sWindows[i].wID);
|
||||
if (mode) {
|
||||
sWin.flags |= bitFlag;
|
||||
ptr_sWindows[i].flags |= bitFlag;
|
||||
win->flags |= bitFlag;
|
||||
} else {
|
||||
sWin.flags &= ~bitFlag;
|
||||
ptr_sWindows[i].flags &= ~bitFlag;
|
||||
win->flags &= ~bitFlag;
|
||||
}
|
||||
return;
|
||||
@@ -531,6 +524,45 @@ static void mf_set_window_flag() {
|
||||
}
|
||||
}
|
||||
|
||||
static void __fastcall FreeArtFile(FrmFile* frmPtr) {
|
||||
if (frmPtr->id == 'PCX') {
|
||||
__asm mov eax, frmPtr;
|
||||
__asm mov eax, [eax]frmPtr.pixelData;
|
||||
__asm call ds:[_freePtr];
|
||||
delete[] frmPtr;
|
||||
} else {
|
||||
__asm mov eax, frmPtr;
|
||||
__asm call my_free_;
|
||||
}
|
||||
}
|
||||
|
||||
static FrmFile* LoadArtFile(const char* file, long frame, long direction, FrmFrameData* &framePtr, bool checkPCX) {
|
||||
FrmFile* frmPtr = nullptr;
|
||||
if (checkPCX) {
|
||||
const char* pos = strrchr(file, '.');
|
||||
if (pos && _stricmp(++pos, "PCX") == 0) {
|
||||
long w, h;
|
||||
BYTE* data = LoadPCXData(file, &w, &h);
|
||||
if (!data) return nullptr;
|
||||
|
||||
frmPtr = reinterpret_cast<FrmFile*>(new BYTE[78]);
|
||||
std::memset(frmPtr, 0, 74);
|
||||
|
||||
frmPtr->id = 'PCX';
|
||||
frmPtr->width = static_cast<short>(w);
|
||||
frmPtr->height = static_cast<short>(h);
|
||||
frmPtr->pixelData = data;
|
||||
framePtr = frmPtr->GetFrameData(0, 0);
|
||||
return frmPtr;
|
||||
}
|
||||
}
|
||||
if (LoadFrame(file, &frmPtr)) {
|
||||
return nullptr;
|
||||
}
|
||||
framePtr = frmPtr->GetFrameData(direction, frame);
|
||||
return frmPtr;
|
||||
}
|
||||
|
||||
static long GetArtFIDFile(long fid, const char* &file) {
|
||||
long direction = 0;
|
||||
long _fid = fid & 0xFFFFFFF;
|
||||
@@ -544,25 +576,17 @@ static long GetArtFIDFile(long fid, const char* &file) {
|
||||
return direction;
|
||||
}
|
||||
|
||||
static FrmFile* LoadArtFile(const char* file, long frame, long direction, FrmFrameData* &framePtr) {
|
||||
FrmFile* frmPtr = nullptr;
|
||||
if (LoadFrame(file, &frmPtr)) {
|
||||
return nullptr;
|
||||
}
|
||||
framePtr = frmPtr->GetFrameData(direction, frame);
|
||||
|
||||
return frmPtr;
|
||||
}
|
||||
|
||||
static void mf_draw_image() {
|
||||
if (*(DWORD*)_currentWindow == -1) {
|
||||
opHandler.printOpcodeError("draw_image() - no created/selected window for the image.");
|
||||
if (!SelectWindowID(opHandler.program()->currentScriptWin) || *(DWORD*)_currentWindow == -1) {
|
||||
opHandler.printOpcodeError("draw_image() - no created or selected window.");
|
||||
opHandler.setReturn(0);
|
||||
return;
|
||||
}
|
||||
long direction = 0;
|
||||
const char* file = nullptr;
|
||||
if (opHandler.arg(0).isInt()) { // art id
|
||||
|
||||
bool isID = opHandler.arg(0).isInt();
|
||||
if (isID) { // art id
|
||||
long fid = opHandler.arg(0).rawValue();
|
||||
if (fid == -1) {
|
||||
opHandler.setReturn(-1);
|
||||
@@ -572,43 +596,35 @@ static void mf_draw_image() {
|
||||
} else {
|
||||
file = opHandler.arg(0).strValue(); // path to frm/pcx file
|
||||
}
|
||||
// initialize other args
|
||||
int frameno = 0, x = 0, y = 0, noTrans = 0;
|
||||
switch (opHandler.numArgs()) {
|
||||
case 5:
|
||||
noTrans = opHandler.arg(4).rawValue();
|
||||
case 4:
|
||||
y = opHandler.arg(3).rawValue();
|
||||
case 3:
|
||||
x = opHandler.arg(2).rawValue();
|
||||
case 2:
|
||||
frameno = opHandler.arg(1).rawValue();
|
||||
}
|
||||
|
||||
FrmFrameData* framePtr;
|
||||
FrmFile* frmPtr = LoadArtFile(file, frameno, direction, framePtr);
|
||||
FrmFile* frmPtr = LoadArtFile(file, opHandler.arg(1).rawValue(), direction, framePtr, !isID);
|
||||
if (frmPtr == nullptr) {
|
||||
opHandler.printOpcodeError("draw_image() - cannot open the file: %s", file);
|
||||
opHandler.setReturn(-1);
|
||||
return;
|
||||
}
|
||||
BYTE* pixelData = (frmPtr->id == 'PCX') ? frmPtr->pixelData : framePtr->data;
|
||||
|
||||
int x = opHandler.arg(2).rawValue(), y = opHandler.arg(3).rawValue();
|
||||
// with x/y frame offsets
|
||||
WindowDisplayBuf(x + frmPtr->xshift[direction], framePtr->width, y + frmPtr->yshift[direction], framePtr->height, framePtr->data, noTrans);
|
||||
WindowDisplayBuf(x + frmPtr->xshift[direction], framePtr->width, y + frmPtr->yshift[direction], framePtr->height, pixelData, opHandler.arg(4).rawValue());
|
||||
|
||||
MemFree(frmPtr);
|
||||
FreeArtFile(frmPtr);
|
||||
opHandler.setReturn(1);
|
||||
}
|
||||
|
||||
static void mf_draw_image_scaled() {
|
||||
if (*(DWORD*)_currentWindow == -1) {
|
||||
opHandler.printOpcodeError("draw_image_scaled() - no created/selected window for the image.");
|
||||
if (!SelectWindowID(opHandler.program()->currentScriptWin) || *(DWORD*)_currentWindow == -1) {
|
||||
opHandler.printOpcodeError("draw_image_scaled() - no created or selected window.");
|
||||
opHandler.setReturn(0);
|
||||
return;
|
||||
}
|
||||
long direction = 0;
|
||||
const char* file = nullptr;
|
||||
if (opHandler.arg(0).isInt()) { // art id
|
||||
|
||||
bool isID = opHandler.arg(0).isInt();
|
||||
if (isID) { // art id
|
||||
long fid = opHandler.arg(0).rawValue();
|
||||
if (fid == -1) {
|
||||
opHandler.setReturn(-1);
|
||||
@@ -618,39 +634,28 @@ static void mf_draw_image_scaled() {
|
||||
} else {
|
||||
file = opHandler.arg(0).strValue(); // path to frm/pcx file
|
||||
}
|
||||
// initialize other args
|
||||
int frameno = 0, x = 0, y = 0, wsize = 0;
|
||||
switch (opHandler.numArgs()) {
|
||||
case 6:
|
||||
case 5:
|
||||
wsize = opHandler.arg(4).rawValue();
|
||||
case 4:
|
||||
y = opHandler.arg(3).rawValue();
|
||||
case 3:
|
||||
x = opHandler.arg(2).rawValue();
|
||||
case 2:
|
||||
frameno = opHandler.arg(1).rawValue();
|
||||
}
|
||||
|
||||
FrmFrameData* framePtr;
|
||||
FrmFile* frmPtr = LoadArtFile(file, frameno, direction, framePtr);
|
||||
FrmFile* frmPtr = LoadArtFile(file, opHandler.arg(1).rawValue(), direction, framePtr, !isID);
|
||||
if (frmPtr == nullptr) {
|
||||
opHandler.printOpcodeError("draw_image_scaled() - cannot open the file: %s", file);
|
||||
opHandler.setReturn(-1);
|
||||
return;
|
||||
}
|
||||
long result = 1;
|
||||
BYTE* pixelData = (frmPtr->id == 'PCX') ? frmPtr->pixelData : framePtr->data;
|
||||
|
||||
if (opHandler.numArgs() < 3) {
|
||||
DisplayInWindow(framePtr->width, framePtr->width, framePtr->height, framePtr->data); // scaled to window size (w/o transparent)
|
||||
DisplayInWindow(framePtr->width, framePtr->width, framePtr->height, pixelData); // scaled to window size (w/o transparent)
|
||||
} else {
|
||||
int x = opHandler.arg(2).rawValue(), y = opHandler.arg(3).rawValue();
|
||||
// draw to scale
|
||||
long s_width, s_height;
|
||||
if (opHandler.numArgs() < 5) {
|
||||
s_width = framePtr->width;
|
||||
s_height = framePtr->height;
|
||||
} else {
|
||||
s_width = wsize;
|
||||
s_width = opHandler.arg(4).rawValue();
|
||||
s_height = (opHandler.numArgs() > 5) ? opHandler.arg(5).rawValue() : -1;
|
||||
}
|
||||
// scale with aspect ratio if w or h is set to -1
|
||||
@@ -666,11 +671,11 @@ static void mf_draw_image_scaled() {
|
||||
|
||||
long w_width = WindowWidth();
|
||||
long xy_pos = (y * w_width) + x;
|
||||
WindowTransCscale(framePtr->width, framePtr->height, s_width, s_height, xy_pos, w_width, framePtr->data); // custom scaling
|
||||
WindowTransCscale(framePtr->width, framePtr->height, s_width, s_height, xy_pos, w_width, pixelData); // custom scaling
|
||||
}
|
||||
|
||||
exit:
|
||||
MemFree(frmPtr);
|
||||
FreeArtFile(frmPtr);
|
||||
opHandler.setReturn(result);
|
||||
}
|
||||
|
||||
@@ -682,12 +687,11 @@ static void mf_interface_art_draw() {
|
||||
bool useShift = false;
|
||||
long direction = -1, w = -1, h = -1;
|
||||
|
||||
if (opHandler.arg(1).isInt()) { // art id
|
||||
bool isID = opHandler.arg(1).isInt();
|
||||
if (isID) { // art id
|
||||
long fid = opHandler.arg(1).rawValue();
|
||||
if (fid == -1) {
|
||||
result = -1;
|
||||
goto exit;
|
||||
}
|
||||
if (fid == -1) goto exit;
|
||||
|
||||
useShift = (((fid & 0xF000000) >> 24) == OBJ_TYPE_CRITTER);
|
||||
direction = GetArtFIDFile(fid, file);
|
||||
} else {
|
||||
@@ -703,13 +707,12 @@ static void mf_interface_art_draw() {
|
||||
if (size > 2) h = sArray->val[2].intVal;
|
||||
}
|
||||
}
|
||||
long frame = (opHandler.numArgs() > 4) ? opHandler.arg(4).rawValue() : 0;
|
||||
long frame = opHandler.arg(4).rawValue();
|
||||
|
||||
FrmFrameData* framePtr;
|
||||
FrmFile* frmPtr = LoadArtFile(file, frame, direction, framePtr);
|
||||
FrmFile* frmPtr = LoadArtFile(file, frame, direction, framePtr, !isID);
|
||||
if (frmPtr == nullptr) {
|
||||
opHandler.printOpcodeError("interface_art_draw() - cannot open the file: %s", file);
|
||||
result = -1;
|
||||
goto exit;
|
||||
}
|
||||
int x = opHandler.arg(2).rawValue();
|
||||
@@ -725,14 +728,15 @@ static void mf_interface_art_draw() {
|
||||
int width = (w >= 0) ? w : framePtr->width;
|
||||
int height = (h >= 0) ? h : framePtr->height;
|
||||
|
||||
TransCscale(framePtr->data, framePtr->width, framePtr->height, framePtr->width,
|
||||
TransCscale(((frmPtr->id == 'PCX') ? frmPtr->pixelData : framePtr->data), framePtr->width, framePtr->height, framePtr->width,
|
||||
interfaceWin->surface + (y * interfaceWin->width) + x, width, height, interfaceWin->width
|
||||
);
|
||||
|
||||
if (!(opHandler.arg(0).rawValue() & 0x1000000)) {
|
||||
GNWWinRefresh(interfaceWin, &interfaceWin->rect, 0);
|
||||
}
|
||||
MemFree(frmPtr);
|
||||
|
||||
FreeArtFile(frmPtr);
|
||||
result = 1;
|
||||
} else {
|
||||
opHandler.printOpcodeError("interface_art_draw() - the game interface window is not created or invalid value for the interface.");
|
||||
@@ -804,11 +808,9 @@ static void mf_unwield_slot() {
|
||||
}
|
||||
|
||||
static void mf_get_window_attribute() {
|
||||
long attr = (opHandler.numArgs() > 1) ? opHandler.arg(1).rawValue() : 0;
|
||||
|
||||
WINinfo* win = Interface_GetWindow(opHandler.arg(0).rawValue());
|
||||
if (win == nullptr) {
|
||||
if (attr != 0) {
|
||||
if (opHandler.arg(1).rawValue() != 0) {
|
||||
opHandler.printOpcodeError("get_window_attribute() - failed to get the interface window.");
|
||||
opHandler.setReturn(-1);
|
||||
}
|
||||
@@ -820,15 +822,15 @@ static void mf_get_window_attribute() {
|
||||
return;
|
||||
}
|
||||
long result = 0;
|
||||
switch (attr) {
|
||||
switch (opHandler.arg(1).rawValue()) {
|
||||
case 0: // check if window exists
|
||||
result = 1;
|
||||
break;
|
||||
case 1: // x
|
||||
result = win->wRect.left;
|
||||
result = win->rect.x;
|
||||
break;
|
||||
case 2: // y
|
||||
result = win->wRect.top;
|
||||
result = win->rect.y;
|
||||
break;
|
||||
}
|
||||
opHandler.setReturn(result);
|
||||
@@ -849,7 +851,7 @@ static void mf_interface_print() { // same as vanilla PrintRect
|
||||
if (y < 0) y = 0;
|
||||
|
||||
long color = opHandler.arg(4).rawValue();
|
||||
long width = (opHandler.numArgs() > 5) ? opHandler.arg(5).rawValue() : 0;
|
||||
long width = opHandler.arg(5).rawValue();
|
||||
|
||||
int maxHeight = win->height - y;
|
||||
int maxWidth = win->width - x;
|
||||
@@ -873,3 +875,22 @@ static void mf_interface_print() { // same as vanilla PrintRect
|
||||
// no redraw (textdirect)
|
||||
if (!(color & 0x1000000)) GNWWinRefresh(win, &win->rect, 0);
|
||||
}
|
||||
|
||||
static void mf_win_fill_color() {
|
||||
long result = SelectWindowID(opHandler.program()->currentScriptWin);
|
||||
long iWin = *(DWORD*)_currentWindow;
|
||||
if (!result || iWin == -1) {
|
||||
opHandler.printOpcodeError("win_fill_color() - no created or selected window.");
|
||||
opHandler.setReturn(-1);
|
||||
return;
|
||||
}
|
||||
if (opHandler.numArgs() > 0) {
|
||||
WinFillRect(ptr_sWindows[iWin].wID,
|
||||
opHandler.arg(0).rawValue(), opHandler.arg(1).rawValue(), // x, y
|
||||
opHandler.arg(2).rawValue(), opHandler.arg(3).rawValue(), // w, h
|
||||
static_cast<BYTE>(opHandler.arg(4).rawValue())
|
||||
);
|
||||
} else {
|
||||
ClearWindow(ptr_sWindows[iWin].wID, false); // full clear
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,6 +184,7 @@ static const SfallMetarule metaruleArray[] = {
|
||||
{"tile_refresh_display", mf_tile_refresh_display, 0, 0},
|
||||
{"unjam_lock", mf_unjam_lock, 1, 1},
|
||||
{"unwield_slot", mf_unwield_slot, 2, 2},
|
||||
{"win_fill_color", mf_win_fill_color, 0, 5},
|
||||
#ifndef NDEBUG
|
||||
{"validate_test", mf_test, 2, 5},
|
||||
#endif
|
||||
|
||||
@@ -639,7 +639,7 @@ static void mf_set_object_data() {
|
||||
static void mf_set_unique_id() {
|
||||
TGameObj* obj = opHandler.arg(0).object();
|
||||
long id;
|
||||
if (opHandler.numArgs() > 1 && opHandler.arg(1).rawValue() == -1) {
|
||||
if (opHandler.arg(1).rawValue() == -1) {
|
||||
id = NewObjId();
|
||||
obj->id = id;
|
||||
} else {
|
||||
|
||||
+13
-6
@@ -164,21 +164,28 @@ static bool LoadFrm(Frm* frm) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static WINinfo* dialogWin = nullptr;
|
||||
static struct DialogWinPos {
|
||||
long x;
|
||||
long y;
|
||||
|
||||
DialogWinPos() : x(-1) {}
|
||||
} dialogWinPos;
|
||||
|
||||
static void __fastcall DrawHeadFrame(Frm* frm, int frameno) {
|
||||
if (frm && !frm->broken) {
|
||||
if (!frm->loaded && !LoadFrm(frm)) goto loadFail;
|
||||
FrmFrameData* frame = FramePtr((FrmHeaderData*)frm, frameno, 0);
|
||||
|
||||
if (dialogWin == nullptr) {
|
||||
dialogWin = GNWFind(*ptr_dialogueBackWindow);
|
||||
if (dialogWinPos.x == -1) {
|
||||
WINinfo* dialogWin = GNWFind(*ptr_dialogueBackWindow);
|
||||
dialogWinPos.x = dialogWin->rect.x;
|
||||
dialogWinPos.y = dialogWin->rect.y;
|
||||
}
|
||||
Gfx_SetHeadTex(frm->textures[frameno],
|
||||
frame->width,
|
||||
frame->height,
|
||||
frame->x + frm->xshift + dialogWin->wRect.left,
|
||||
frame->y + frm->yshift + dialogWin->wRect.top
|
||||
frame->x + frm->xshift + dialogWinPos.x,
|
||||
frame->y + frm->yshift + dialogWinPos.y
|
||||
);
|
||||
showHighlights = frm->showHighlights;
|
||||
return;
|
||||
@@ -207,7 +214,7 @@ void __declspec(naked) gdDestroyHeadWindow_hack() {
|
||||
__asm {
|
||||
call Gfx_SetDefaultTechnique;
|
||||
mov showHighlights, 0;
|
||||
//mov dialogWin, 0; // uncomment if the dialog window position is supposed to change
|
||||
//mov dword ptr ds:[dialogWinPos], -1; // uncomment if the dialog window position is supposed to change
|
||||
pop ebp;
|
||||
pop edi;
|
||||
pop edx;
|
||||
|
||||
+4
-1
@@ -254,6 +254,9 @@ static void DllMain2() {
|
||||
dlogr("Running ExplosionInit().", DL_INIT);
|
||||
ExplosionInit();
|
||||
|
||||
dlogr("Running MessageInit().", DL_INIT);
|
||||
MessageInit();
|
||||
|
||||
dlogr("Running ElevatorsInit().", DL_INIT);
|
||||
ElevatorsInit();
|
||||
|
||||
@@ -304,7 +307,7 @@ static void __stdcall OnExit() {
|
||||
ConsoleExit();
|
||||
ExtraSaveSlotsExit();
|
||||
BooksExit();
|
||||
//gExtraGameMsgLists.clear();
|
||||
MessageExit();
|
||||
AnimationsExit();
|
||||
BarBoxesExit();
|
||||
HeroAppearanceModExit();
|
||||
|
||||
+3
-3
@@ -25,10 +25,10 @@
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_BUILD 28
|
||||
#define VERSION_REV 0
|
||||
#define VERSION_REV 1
|
||||
|
||||
#ifdef WIN2K
|
||||
#define VERSION_STRING "3.8.28 win2k"
|
||||
#define VERSION_STRING "3.8.28.1 win2k"
|
||||
#else
|
||||
#define VERSION_STRING "3.8.28"
|
||||
#define VERSION_STRING "3.8.28.1"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user