Compare commits

...
Author SHA1 Message Date
Goober5000 3dc8ab068f made a copy 2008-05-04 00:53:27 +00:00
taylor 25d6129168 damn, that was pretty stupid of me (Mantis #1684) 2008-05-03 19:38:00 +00:00
taylor b57a68c0eb remove old warning messages, that stuff should be added on an as-needed basis when debugging only 2008-05-03 04:47:51 +00:00
taylor 14d88eef33 make table crc spew use the proper table list 2008-05-03 04:46:42 +00:00
taylor f7422e1aee add missing break statement to get rid of unidentified packet message 2008-05-03 04:45:17 +00:00
taylor 8103398fbf some stats fixage 2008-05-03 04:44:22 +00:00
Backslash a387a68a5a Lock turrets on ships that have already split apart. This way firepoints don't go with the 'wrong ship half'. Nice work, Wanderer.
Good idea, blowfish -- this is a much better solution than locking during deathroll (which was proposed by _argv[-1] ages ago).
2008-04-30 07:36:29 +00:00
Backslash 251e565593 Add "orders hidden", "orders shown", and "wing name hidden" to iff_defs.tbl flags.
Use these flags instead of wcsaga command line for certain HUD displays.
2008-04-29 05:26:34 +00:00
Backslash 549589bdd2 One more little change involving #. Stupid pointers... 2008-04-24 02:16:10 +00:00
karajorma 604faf652f Nope. I don't know why I thought that would work either. 2008-04-22 10:13:43 +00:00
karajorma 77f6c1bc9c Fix ship-subsys-guardian-threshold so it can be used with ships in loadout.
Add the set-persona SEXP
2008-04-20 18:31:47 +00:00
Backslash 2d05da8f31 Whoops, apparently we missed a bit of the turret fix. Working now. 2008-04-17 04:34:54 +00:00
Backslash 759872d98b A few more tweaks for ship name end_string_at_first_hash_symbol support.
Make FPS and status displays hide when hud is toggled with shift-O.
2008-04-16 03:21:37 +00:00
phreak c53f86384b Use the weapon object and not the weapon_info object when determining when a flak shell should detonate. Mantis #1662 2008-04-16 02:51:26 +00:00
taylor e4cb3479a7 remove libreadline dependency since we don't need it and can't use it anyway 2008-04-12 22:18:01 +00:00
karajorma a8fae4465f Fix the Stars slider so you can have none. Fix a problem with the SEXP argument numbering fix. 2008-04-12 20:18:44 +00:00
taylor 40f8d02425 make SEXP argument numbering go by 5's, and change to bitmaps to try and be a bit more readable (Mantis #1517) 2008-04-07 22:07:06 +00:00
taylor a988f5eab2 try and handle FSO version comments better (should fix Mantis #1284 and #1639) 2008-04-07 22:01:30 +00:00
Backslash 0e86ab07b4 Whoops. Don't actually change the name, just the displayed name.
Also, don't forget the alternate type name.
2008-04-07 00:18:19 +00:00
Goober5000 2f23ea485f remove obsolete ship flag 2008-04-06 23:37:21 +00:00
Goober5000 dfa4206d02 merge the selectable Command feature (from 1/2007) into the stable branch
rearrange the Mission Specs dialog while we're at it
2008-04-06 23:26:33 +00:00
Backslash 364e644cf0 Apply end_string_at_first_hash_symbol to ship names now.
This way people can use # to name duplicates of ships for fake nanojumps and other stuff like that, instead of Unicode characters.
2008-04-06 23:00:20 +00:00
phreak df5d78f07b Added support for multiple child weapons per parent weapon. 2008-04-06 21:56:08 +00:00
karajorma cd2afc57f4 Fix Mantis 1649 2008-04-06 18:53:01 +00:00
taylor 42a84a2a88 keep track of primary weapons properly for multiplayer (Mantis #1094) 2008-04-05 13:39:21 +00:00
Backslash c8d5f8678d Guess this had only been committed to the former HEAD.
Make max_speed based on max_vel.xyz.z, so that we don't have a strange maxmimum throttle when the ship is capable of x/y movement.
2008-04-04 15:15:06 +00:00
taylor 6c856eb341 make background import from FSO missions work if there is only one list (Mantis #1640) 2008-04-04 13:46:37 +00:00
taylor 1aef19ab7f be sure to properly update shields, afterburner energy, max speed, cm count and set initial
model_anim state through change_ship_type()   (Mantis #1512, #1594, #1645)
2008-04-04 03:17:01 +00:00
taylor 7f2de46f30 be sure to apply special explosion to all selected ships (Mantis #1634) 2008-04-04 03:10:45 +00:00
taylor c040093c68 disable PBO support for the time being (causes hangs under OS X for some reason) 2008-04-03 22:01:47 +00:00
taylor 1b2c251be6 add back Bobboau's "check hull" turret subsystem flag support 2008-04-03 16:47:03 +00:00
Backslash e26c2a7487 Whoops, that beam chargeup particle fix only worked with certain table settings. This should work for everything. 2008-04-03 15:33:03 +00:00
taylor b6fceca721 fix sorting of create list so that it properly sorts mission names
add CTRL+SHIFT+S hotkey to switch bewteen mission and file name sorting
2008-04-03 03:39:13 +00:00
taylor 39f5113405 remove all special_ship hack and just handle it all properly: keep wing order correct regardless of object order 2008-04-03 03:37:56 +00:00
taylor 2899799bfa add a timeout for getting pilot info (part of Mantis #1652) 2008-04-03 03:35:26 +00:00
taylor f7cf34487a make mission/campaign list dynamic (Mantis #1203) 2008-04-02 23:54:56 +00:00
taylor babcedc220 /strchr/strrchr/, for mission filenames (Mantis #1629) 2008-04-02 23:54:25 +00:00
karajorma 86c74f9211 Add the is-player SEXP 2008-04-02 18:38:12 +00:00
Backslash 6f1932987d Tweak the lead indicator code to not just work with primaries -- now, dumbfire secondaries show the correct position.
Also, make it work when the target is stationary but "$use additive weapon velocity" is set.
Fix a couple typos and warnings.
2008-04-02 14:19:06 +00:00
taylor 32c5fa6d1d remove multi_elements thingy since it caused problems for some ATI users, and it was kinda crazy anyway 2008-04-01 22:06:17 +00:00
taylor 0a06e62093 make sure not to carry swarm/corkscrew missile fire to another bank when the first one is out of ammo (Mantis #464) 2008-04-01 20:04:04 +00:00
taylor e90acd5b5d bah, that flag check was wrong since the initial commit to the unstable tree 2008-04-01 10:00:09 +00:00
taylor c99874389c skip .svn directories when packing (for sanity sake when packing versioned data)
just skip files that have names too long rather than bailing
2008-04-01 06:31:55 +00:00
taylor 6d085d6d22 be sure to skip filenames that are too long in cf_get_file_list() too, since we still need them to be of a certain size later 2008-04-01 06:30:05 +00:00
taylor eb468ff25c add missing check for "use multiple guns" so that it actually does something (Mantis #867) 2008-03-31 19:42:33 +00:00
taylor 7ed32a9525 fix subtitle centering for non-1024x768 resolutions (Mantis #1630) 2008-03-31 13:51:39 +00:00
taylor c7b3ad7aaf fix the "carry no damage" stuff to actually work right and distribute the proper amount of damage (Mantis #1638) 2008-03-31 13:08:45 +00:00
taylor 677a285bcf if no paths then don't try to allocate memory for them (avoids Int3() check in vm_malloc from requesting a size of 0) 2008-03-31 12:59:10 +00:00
taylor 3090cd74b0 fix "generate icon" flag check for hud shield icons and add some compatibility handling for old data (Mantis #1646)
clean up ballistic primary fixage so that it doesn't run more than it needs to and doesn't end up "fixing" it's own mess
2008-03-31 12:57:34 +00:00
taylor d8c2926962 bring OS X stuff up to date 2008-03-31 01:39:17 +00:00
taylor 04df95e8c9 line sizes are figured at EOL breaks, so be sure that we account for those when splitting too (Mantis #1152) 2008-03-31 00:02:54 +00:00
Backslash 2d5b4119a5 Pretty sure it was agreed we could bump MAX_MISSION_MESSAGES until the dynamic code was finished. WCSaga and BtRL can't work on some missions without this. 2008-03-30 20:06:14 +00:00
Backslash 11d8505cdf Add $Max Turret Target Ownage and $Max Turret Player Ownage to ai_profiles.tbl
This is to customize the number of turrets on a ship allowed to fire at the same thing.
2008-03-30 19:49:42 +00:00
taylor 75baeadbed crap, that did need to be a float to work properly (fixes wobbly hud from r4561)
also be sure to handle the overflow case in HUD_get_nose_coordinates()
2008-03-30 08:53:50 +00:00
taylor c2bc245f81 don't mess with mainhall sounds directly in the movie code (should fix Mantis #1539)
be sure to stop the ambient mainhall sound when playing a movie through the cutscene viewer
2008-03-29 20:25:07 +00:00
taylor 88693b7388 fix various compiler warnings 2008-03-29 06:30:20 +00:00
taylor 94d2357dd4 some minor optimization and cleanup 2008-03-29 05:22:28 +00:00
114 changed files with 2594 additions and 1335 deletions

No files matched your search

+6
View File
@@ -310,6 +310,12 @@ void parse_ai_profiles_tbl(char *filename)
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Target Ownage:"))
parse_int_list(profile->max_turret_ownage_target, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION);
+4
View File
@@ -115,6 +115,10 @@ typedef struct ai_profile_t {
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
// Maximum turrets of one ship allowed to shoot the same target
int max_turret_ownage_target[NUM_SKILL_LEVELS];
int max_turret_ownage_player[NUM_SKILL_LEVELS];
} ai_profile_t;
+28 -1
View File
@@ -632,7 +632,11 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
dist *= (1.0f + 0.1f*num_att_turrets);
// return if we're over the cap
int max_turrets = 3 + Game_skill_level * Game_skill_level;
// int max_turrets = 3 + Game_skill_level * Game_skill_level;
int max_turrets = The_mission.ai_profile->max_turret_ownage_target[Game_skill_level];
if (objp->flags & OF_PLAYER_SHIP) {
max_turrets = The_mission.ai_profile->max_turret_ownage_player[Game_skill_level];
}
if (num_att_turrets > max_turrets) {
return;
}
@@ -1636,6 +1640,10 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
int secnum = 0;
for(i = 0; i < (MAX_SHIP_WEAPONS); i++)
{
//WMC - Only fire more than once if we have multiple guns flag set.
if(num_valid > 0 && !(tp->flags & MSS_FLAG_USE_MULTIPLE_GUNS))
break;
if(i < MAX_SHIP_PRIMARY_BANKS)
{
if(i >= swp->num_primary_banks)
@@ -1903,6 +1911,25 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
}
}
if ( ok_to_fire && (tp->flags & MSS_FLAG_TURRET_HULL_CHECK) ) {
int model_num = Ship_info[shipp->ship_info_index].model_num;
mc_info hull_check;
vec3d end;
vm_vec_scale_add(&end, &gpos, &gvec, model_get_radius(model_num));
hull_check.model_num = model_num;
hull_check.orient = &objp->orient;
hull_check.pos = &objp->pos;
hull_check.p0 = &gpos;
hull_check.p1 = &end;
hull_check.flags = MC_CHECK_MODEL | MC_CHECK_RAY;
if ( model_collide(&hull_check) ) {
ok_to_fire = false;
}
}
if ( ok_to_fire )
{
something_was_ok_to_fire = true;
+18 -8
View File
@@ -421,18 +421,27 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_t
if(image_id != -1)
{
text_pos[0] = image_pos[0] + w; //Still set from bm_get_info call
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
if (!center_x)
{
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
}
}
else
{
text_pos[0] = image_pos[0];
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
if (!center_x)
{
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
}
}
text_pos[1] = image_pos[1];
deltay = text_pos[1] / 768.0f; //MikeStar;
text_pos[1] = gr_screen.max_h * deltay; //MikeStar;
if (!center_y)
{
deltay = text_pos[1] / 768.0f; //MikeStar;
text_pos[1] = gr_screen.max_h * deltay; //MikeStar;
}
time_displayed = 0.0f;
time_displayed_end = 2.0f*fade_time + display_time;
@@ -462,11 +471,12 @@ void subtitle::do_frame(float frametime)
gr_set_color_fast(&text_color);
int font_height = gr_get_font_height();
int y = text_pos[1];
int x = fl2i(text_pos[0]);
int y = fl2i(text_pos[1]);
for(unsigned int i = 0; i < text_lines.size(); i++)
{
gr_string(text_pos[0], y, (char*)text_lines[i].c_str(), false);
gr_string(x, y, (char*)text_lines[i].c_str(), false);
y += font_height;
}
+7 -1
View File
@@ -1660,9 +1660,11 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (find_handle != -1) {
do {
if (num_files >= max)
break;
if ( strlen(find.name) >= MAX_FILENAME_LEN )
continue;
if (!(find.attrib & _A_SUBDIR)) {
if ( !Get_file_list_filter || (*Get_file_list_filter)(find.name) ) {
ptr = strrchr(find.name, '.');
@@ -1699,6 +1701,10 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (num_files >= max)
break;
if ( strlen(dir->d_name) >= MAX_FILENAME_LEN ) {
continue;
}
if (fnmatch(filter, dir->d_name, 0) != 0)
continue;
+8 -4
View File
@@ -162,8 +162,8 @@ void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_wr
}
if ( strlen(filename) > 31 ) {
printf( "Filename '%s' too long\n", filename );
exit(1);
printf( "Filename '%s' too long! Skipping...\n", filename );
return;
}
memset( path, 0, sizeof(path) );
@@ -255,7 +255,7 @@ void pack_directory( char * filespec)
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
@@ -267,7 +267,7 @@ void pack_directory( char * filespec)
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
@@ -300,6 +300,10 @@ void pack_directory( char * filespec)
continue;
}
if ( (strcmp(dir->d_name, ".svn") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy( tmp, filespec );
strcat( tmp, "/" );
+1
View File
@@ -560,6 +560,7 @@ void cutscenes_screen_play()
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
main_hall_stop_ambient();
int rval = movie_play(name);
main_hall_start_music();
+1 -6
View File
@@ -117,7 +117,6 @@
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
#include "cutscene/mvelib.h"
#include "cutscene/oggplayer.h"
#include "menuui/mainhallmenu.h"
extern int Game_mode;
@@ -196,9 +195,6 @@ bool movie_play(char *name)
return false;
}
// kill all background sounds
main_hall_pause();
// clear the screen and hide the mouse cursor
Mouse_hidden++;
gr_reset_clip();
@@ -251,9 +247,8 @@ bool movie_play(char *name)
}
}
// show the mouse cursor again, and unpause the mainhall music
// show the mouse cursor again
Mouse_hidden--;
main_hall_unpause();
return true;
}
+10 -7
View File
@@ -374,7 +374,7 @@ void bg_bitmap_dlg::create()
box->AddString(Nebula_colors[i]);
}
m_slider.SetRange(100, MAX_STARS);
m_slider.SetRange(0, MAX_STARS);
m_slider.SetPos(Num_stars);
sprintf(buf, "%d", Num_stars);
GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
@@ -1384,15 +1384,18 @@ void bg_bitmap_dlg::OnImportBackground()
Mp = saved_mp;
// pick one (if count is 0, it's retail with just one background)
if (count > 1)
if (count > 0)
{
int i, which;
int i, which = 0;
BackgroundChooser dlg(count);
if (dlg.DoModal() == IDCANCEL)
return;
if (count > 1)
{
BackgroundChooser dlg(count);
if (dlg.DoModal() == IDCANCEL)
return;
which = dlg.GetChosenBackground();
which = dlg.GetChosenBackground();
}
for (i = 0; i < which + 1; i++)
skip_to_string("$Bitmap List:");
+143 -131
View File
@@ -90,21 +90,26 @@ IDB_CHAINED_DIRECTIVE BITMAP MOVEABLE PURE "res\\chained_directive.bmp"
IDB_GREEN_DOT BITMAP MOVEABLE PURE "res\\green_do.bmp"
IDB_BLACK_DOT BITMAP MOVEABLE PURE "res\\black_do.bmp"
IDB_VARIABLE BITMAP MOVEABLE PURE "res\\variable.bmp"
IDB_DATA_12 BITMAP MOVEABLE PURE "res\\data12.bmp"
IDB_DATA_02 BITMAP MOVEABLE PURE "res\\data02.bmp"
IDB_DATA_03 BITMAP MOVEABLE PURE "res\\data03.bmp"
IDB_DATA_04 BITMAP MOVEABLE PURE "res\\data04.bmp"
IDB_DATA_05 BITMAP MOVEABLE PURE "res\\data05.bmp"
IDB_DATA_06 BITMAP MOVEABLE PURE "res\\data06.bmp"
IDB_DATA_07 BITMAP MOVEABLE PURE "res\\data07.bmp"
IDB_DATA_08 BITMAP MOVEABLE PURE "res\\data08.bmp"
IDB_DATA_09 BITMAP MOVEABLE PURE "res\\data09.bmp"
IDB_DATA_00 BITMAP MOVEABLE PURE "res\\data00.bmp"
IDB_DATA_10 BITMAP MOVEABLE PURE "res\\data10.bmp"
IDB_DATA_11 BITMAP MOVEABLE PURE "res\\data11.bmp"
IDB_DATA_01 BITMAP MOVEABLE PURE "res\\data01.bmp"
IDB_DATA_15 BITMAP MOVEABLE PURE "res\\data15.bmp"
IDB_DATA_14 BITMAP MOVEABLE PURE "res\\data14.bmp"
IDB_DATA_13 BITMAP MOVEABLE PURE "res\\data13.bmp"
IDB_DATA_20 BITMAP MOVEABLE PURE "res\\data20.bmp"
IDB_DATA_25 BITMAP MOVEABLE PURE "res\\data25.bmp"
IDB_DATA_30 BITMAP MOVEABLE PURE "res\\data30.bmp"
IDB_DATA_35 BITMAP MOVEABLE PURE "res\\data35.bmp"
IDB_DATA_40 BITMAP MOVEABLE PURE "res\\data40.bmp"
IDB_DATA_45 BITMAP MOVEABLE PURE "res\\data45.bmp"
IDB_DATA_50 BITMAP MOVEABLE PURE "res\\data50.bmp"
IDB_DATA_55 BITMAP MOVEABLE PURE "res\\data55.bmp"
IDB_DATA_60 BITMAP MOVEABLE PURE "res\\data60.bmp"
IDB_DATA_65 BITMAP MOVEABLE PURE "res\\data65.bmp"
IDB_DATA_70 BITMAP MOVEABLE PURE "res\\data70.bmp"
IDB_DATA_75 BITMAP MOVEABLE PURE "res\\data75.bmp"
IDB_DATA_80 BITMAP MOVEABLE PURE "res\\data80.bmp"
IDB_DATA_85 BITMAP MOVEABLE PURE "res\\data85.bmp"
IDB_DATA_90 BITMAP MOVEABLE PURE "res\\data90.bmp"
IDB_DATA_95 BITMAP MOVEABLE PURE "res\\data95.bmp"
/////////////////////////////////////////////////////////////////////////////
//
@@ -873,13 +878,19 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,355,184,50,14
END
IDD_MISSION_NOTES DIALOGEX 0, 0, 464, 324
IDD_MISSION_NOTES DIALOG DISCARDABLE 0, 0, 479, 327
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mission Specs"
FONT 8, "MS Sans Serif"
BEGIN
RTEXT "Title",IDC_STATIC,7,10,29,8
EDITTEXT IDC_MISSION_TITLE,41,7,109,14,ES_AUTOHSCROLL
RTEXT "Designer",IDC_STATIC,7,25,29,8
EDITTEXT IDC_DESIGNER_NAME,41,23,109,14,ES_AUTOHSCROLL
RTEXT "Created:",IDC_STATIC,23,42,28,8
LTEXT "xx/xx/xx",IDC_CREATED,57,42,91,8
RTEXT "Last Modified:",IDC_STATIC,7,51,45,8
LTEXT "xx/xx/xx",IDC_MODIFIED,57,51,92,8
CONTROL "Single Player",IDC_SINGLE,"Button",BS_AUTORADIOBUTTON |
WS_GROUP,7,63,57,10
CONTROL "Multi Player",IDC_MULTI,"Button",BS_AUTORADIOBUTTON,7,
@@ -892,100 +903,100 @@ BEGIN
BS_AUTORADIOBUTTON,76,72,66,10
CONTROL "Dogfight",IDC_DOGFIGHT,"Button",BS_AUTORADIOBUTTON,76,
81,43,10
EDITTEXT IDC_RESPAWNS,92,94,50,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Max Respawns",IDC_STATIC,8,97,52,8
EDITTEXT IDC_RESPAWNS,86,94,50,14,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Spin1",IDC_RESPAWN_SPIN,"msctls_updown32",
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
UDS_ARROWKEYS,142,94,11,14
PUSHBUTTON "Custom Wing Names",IDC_CUSTOM_WING_NAMES,13,115,136,14
EDITTEXT IDC_SQUAD_NAME,356,124,98,14,ES_AUTOHSCROLL
PUSHBUTTON "Logo",IDC_SQUAD_LOGO_BUTTON,316,139,31,14
EDITTEXT IDC_SQUAD_LOGO,356,139,98,14,ES_AUTOHSCROLL |
ES_READONLY
PUSHBUTTON "640x480",IDC_LOADING_SCREEN_BUTTON640,317,284,40,14
EDITTEXT IDC_LOADING_SCREEN640,357,284,97,14,ES_AUTOHSCROLL
PUSHBUTTON "1024x768",IDC_LOADING_SCREEN_BUTTON1024,317,300,40,16
EDITTEXT IDC_LOADING_SCREEN1024,357,300,97,16,ES_AUTOHSCROLL
CONTROL "All Teams at War",IDC_FULL_WAR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,165,22,72,10
CONTROL "Red Alert Mission",IDC_RED_ALERT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,165,33,78,10
CONTROL "Scramble Mission",IDC_SCRAMBLE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,165,42,72,10
CONTROL "No Briefing",IDC_NO_BRIEFING,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,165,52,72,10
CONTROL "No Debriefing",IDC_NO_DEBRIEFING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,165,62,72,10
CONTROL "Disallow Promotions/Badges",IDC_NO_PROMOTION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,165,73,106,10
CONTROL "Disable Built-in Messages",IDC_DISABLE_BUILTIN_MSGS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,165,82,123,10
CONTROL "Disable Built-in Command Messages",
IDC_DISABLE_BUILTIN_COMMAND_MSGS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,165,92,129,10
CONTROL "No Traitor",IDC_NO_TRAITOR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,165,102,123,10
CONTROL "All Ships Beam-Freed By Default",
IDC_BEAM_FREE_ALL_BY_DEFAULT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,304,38,123,10
CONTROL "Allow Daisy-Chained Docking",IDC_ALLOW_DOCK_TREES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,304,47,123,10
UDS_ARROWKEYS,136,94,11,14
PUSHBUTTON "Custom Wing Names",IDC_CUSTOM_WING_NAMES,10,115,128,14
GROUPBOX "Squadron Reassign",IDC_STATIC,2,136,148,44
LTEXT "Name",IDC_STATIC,14,147,28,8
EDITTEXT IDC_SQUAD_NAME,48,147,98,14,ES_AUTOHSCROLL
PUSHBUTTON "Logo",IDC_SQUAD_LOGO_BUTTON,8,161,31,14
EDITTEXT IDC_SQUAD_LOGO,48,161,98,14,ES_AUTOHSCROLL | ES_READONLY
GROUPBOX "Loading Screen",IDC_STATIC,2,185,148,46
PUSHBUTTON "640x480",IDC_LOADING_SCREEN_BUTTON640,7,197,40,14
EDITTEXT IDC_LOADING_SCREEN640,47,197,97,14,ES_AUTOHSCROLL
PUSHBUTTON "1024x768",IDC_LOADING_SCREEN_BUTTON1024,7,213,40,16
EDITTEXT IDC_LOADING_SCREEN1024,47,213,97,16,ES_AUTOHSCROLL
GROUPBOX "Support Ships",IDC_STATIC,160,6,152,71
CONTROL "Disallow Support Ships",IDC_SUPPORT_ALLOWED,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,309,168,95,10
BS_AUTOCHECKBOX | WS_TABSTOP,164,16,95,10
CONTROL "Support Ships Repair Hull",IDC_SUPPORT_REPAIRS_HULL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,179,123,10
EDITTEXT IDC_MAX_HULL_REPAIR_VAL,389,193,59,14,ES_AUTOHSCROLL
EDITTEXT IDC_MAX_SUBSYS_REPAIR_VAL,389,211,59,14,ES_AUTOHSCROLL
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,27,123,10
LTEXT "Hull Repair Ceiling",IDC_STATIC,164,43,60,8
EDITTEXT IDC_MAX_HULL_REPAIR_VAL,244,41,49,14,ES_AUTOHSCROLL
LTEXT "%",IDC_STATIC,298,46,8,8
LTEXT "Subsytem Repair Ceiling",IDC_STATIC,164,64,75,8
EDITTEXT IDC_MAX_SUBSYS_REPAIR_VAL,244,59,49,14,ES_AUTOHSCROLL
LTEXT "%",IDC_STATIC,298,60,8,8
GROUPBOX "Ship Trails",IDC_STATIC,160,81,154,41
CONTROL "Toggle (off in nebula; on elsewhere)",
IDC_SPECS_TOGGLE_TRAILS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,309,242,141,10
WS_TABSTOP,162,92,141,10
CONTROL "Minimium speed to display",IDC_CONTRAIL_THRESHOLD_CHECK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,253,93,10
EDITTEXT IDC_CONTRAIL_THRESHOLD,411,252,48,14,ES_READONLY
COMBOBOX IDC_AI_PROFILE,59,134,93,140,CBS_DROPDOWNLIST |
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,103,93,10
EDITTEXT IDC_CONTRAIL_THRESHOLD,262,102,48,14,ES_READONLY
GROUPBOX "Built-in Command Messages",IDC_STATIC,158,131,154,46
LTEXT "Sender",IDC_STATIC,165,145,40,8
COMBOBOX IDC_COMMAND_SENDER,209,143,99,140,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_EVENT_MUSIC,211,134,93,140,CBS_DROPDOWNLIST |
LTEXT "Persona",IDC_STATIC,165,161,40,8
COMBOBOX IDC_COMMAND_PERSONA,209,160,99,140,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SUBSTITUTE_EVENT_MUSIC,211,150,93,140,CBS_DROPDOWN |
GROUPBOX "Mission Music",IDC_STATIC,157,188,154,47
LTEXT "Default",IDC_STATIC,161,200,40,8
COMBOBOX IDC_EVENT_MUSIC,207,199,99,140,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_MISSION_DESC,0,182,299,57,ES_MULTILINE |
ES_AUTOVSCROLL | ES_WANTRETURN
EDITTEXT IDC_MISSION_NOTES,1,254,297,57,ES_MULTILINE |
ES_AUTOVSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,347,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,403,7,50,14
LTEXT "Max Respawns",IDC_STATIC,8,97,52,8
RTEXT "Title",IDC_STATIC,7,10,29,8
RTEXT "Designer Notes",IDC_STATIC,1,243,50,8
LTEXT "xx/xx/xx",IDC_MODIFIED,57,51,101,8
RTEXT "Designer",IDC_STATIC,7,25,29,8
RTEXT "Created:",IDC_STATIC,23,42,28,8
LTEXT "xx/xx/xx",IDC_CREATED,57,42,103,8
RTEXT "Last Modified:",IDC_STATIC,7,51,45,8
LTEXT "Mission Description",IDC_STATIC,0,170,62,8
LTEXT "Music",IDC_STATIC,153,137,32,8
GROUPBOX "Squadron Reassign",IDC_STATIC,310,114,150,44
LTEXT "Name",IDC_STATIC,322,125,28,8
GROUPBOX "Loading Screen",IDC_STATIC,309,274,151,46
GROUPBOX "Support Ships",IDC_STATIC,305,158,154,71
LTEXT "Hull Repair Ceiling",IDC_STATIC,309,195,60,8
LTEXT "Subsytem Repair Ceiling",IDC_STATIC,309,216,75,8
LTEXT "%",IDC_STATIC,452,196,8,8
LTEXT "%",IDC_STATIC,452,210,8,8
GROUPBOX "Ship Trails",IDC_STATIC,306,231,154,41
LTEXT "Substitute Music",IDC_STATIC,153,153,52,8
LTEXT "AI Profile",IDC_STATIC,1,137,32,8
CONTROL "Player Starts under AI Control (NO MULTI)",
IDC_PLAYER_START_AI,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,3,153,149,10
LTEXT "If music pack is present",IDC_STATIC,161,213,43,16
COMBOBOX IDC_SUBSTITUTE_EVENT_MUSIC,207,215,99,140,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
GROUPBOX "Flags",IDC_STATIC,321,20,154,198
CONTROL "All Teams at War",IDC_FULL_WAR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,31,72,10
CONTROL "Red Alert Mission",IDC_RED_ALERT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,326,41,78,10
CONTROL "Scramble Mission",IDC_SCRAMBLE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,51,72,10
CONTROL "Disallow Promotions/Badges",IDC_NO_PROMOTION,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,326,61,106,10
CONTROL "Disable Built-in Messages",IDC_DISABLE_BUILTIN_MSGS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,326,71,123,10
CONTROL "Disable Built-in Command Messages",
IDC_DISABLE_BUILTIN_COMMAND_MSGS,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,326,81,129,10
CONTROL "No Traitor",IDC_NO_TRAITOR,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,91,123,10
CONTROL "All Ships Beam-Freed By Default",
IDC_BEAM_FREE_ALL_BY_DEFAULT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,101,123,10
CONTROL "Allow Daisy-Chained Docking",IDC_ALLOW_DOCK_TREES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,326,111,123,10
CONTROL "No Briefing",IDC_NO_BRIEFING,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,121,72,10
CONTROL "No Debriefing",IDC_NO_DEBRIEFING,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,326,131,72,10
CONTROL "Use Autopilot Cinematics",IDC_USE_AUTOPILOT_CINEMATICS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,304,58,123,10
CONTROL "2D Mission",IDC_2D_MISSION,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,304,70,123,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,326,141,123,10
CONTROL "Deactivate Hardcoded Autopilot",
IDC_DEACTIVATE_AUTOPILOT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,304,81,123,10
LTEXT "Retail Flags:",IDC_STATIC,167,7,40,8
LTEXT "FS2 Open Flags",IDC_STATIC,304,25,52,8
WS_TABSTOP,326,151,123,10
CONTROL "Player Starts under AI Control (NO MULTI)",
IDC_PLAYER_START_AI,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,161,146,10
CONTROL "2D Mission",IDC_2D_MISSION,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,326,171,123,10
LTEXT "AI Profile",IDC_STATIC,320,229,32,8
COMBOBOX IDC_AI_PROFILE,378,226,93,140,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
LTEXT "Mission Description",IDC_STATIC,4,238,62,8
EDITTEXT IDC_MISSION_DESC,4,250,471,29,ES_MULTILINE |
ES_AUTOVSCROLL | ES_WANTRETURN
RTEXT "Designer Notes",IDC_STATIC,2,284,50,8
EDITTEXT IDC_MISSION_NOTES,3,294,472,29,ES_MULTILINE |
ES_AUTOVSCROLL | ES_WANTRETURN
DEFPUSHBUTTON "OK",IDOK,368,0,50,14
PUSHBUTTON "Cancel",IDCANCEL,424,0,50,14
END
IDD_PREFERENCES DIALOG DISCARDABLE 0, 0, 333, 81
@@ -1917,11 +1928,11 @@ BEGIN
ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
END
IDD_BRIEFING_EDITOR DIALOGEX 0, 0, 258, 407
IDD_BRIEFING_EDITOR DIALOGEX 0, 0, 258, 417
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Briefing Editor"
MENU IDR_PLAYER_EDIT_MENU
FONT 8, "MS Sans Serif", 0, 0, 0x1
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Prev",IDC_PREV,147,7,23,14,0,WS_EX_STATICEDGE
PUSHBUTTON "Next",IDC_NEXT,173,7,23,14,0,WS_EX_STATICEDGE
@@ -1943,57 +1954,58 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,7,38,69,10
CONTROL "Cut to previous stage",IDC_CUT_PREV,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,47,83,10
EDITTEXT IDC_TEXT,7,75,244,40,ES_MULTILINE | ES_AUTOVSCROLL |
EDITTEXT IDC_TEXT,7,72,244,40,ES_MULTILINE | ES_AUTOVSCROLL |
ES_WANTRETURN
EDITTEXT IDC_VOICE,63,118,83,13,ES_AUTOHSCROLL
PUSHBUTTON "Browse",IDC_BROWSE,150,118,42,14,0,WS_EX_STATICEDGE
PUSHBUTTON "IDB_PLAY",IDC_PLAY,194,118,13,14,BS_BITMAP,
EDITTEXT IDC_VOICE,63,115,83,13,ES_AUTOHSCROLL
PUSHBUTTON "Browse",IDC_BROWSE,150,115,42,14,0,WS_EX_STATICEDGE
PUSHBUTTON "IDB_PLAY",IDC_PLAY,194,115,13,14,BS_BITMAP,
WS_EX_TRANSPARENT | WS_EX_STATICEDGE
COMBOBOX IDC_BRIEFING_MUSIC,63,134,83,135,CBS_DROPDOWNLIST |
COMBOBOX IDC_BRIEFING_MUSIC,70,142,83,135,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SUBSTITUTE_BRIEFING_MUSIC,63,151,83,135,CBS_DROPDOWN |
COMBOBOX IDC_SUBSTITUTE_BRIEFING_MUSIC,70,159,83,135,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
CONTROL "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS |
WS_BORDER | WS_TABSTOP,7,181,244,71,WS_EX_CLIENTEDGE
WS_BORDER | WS_TABSTOP,7,190,244,71,WS_EX_CLIENTEDGE
CONTROL "Draw lines between marked icons",IDC_LINES,"Button",
BS_3STATE | WS_TABSTOP,129,255,122,10
EDITTEXT IDC_ICON_LABEL,51,277,75,14,ES_AUTOHSCROLL
COMBOBOX IDC_ICON_IMAGE,52,293,75,135,CBS_DROPDOWNLIST |
BS_3STATE | WS_TABSTOP,129,264,122,10
EDITTEXT IDC_ICON_LABEL,51,288,75,14,ES_AUTOHSCROLL
COMBOBOX IDC_ICON_IMAGE,52,304,75,135,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_SHIP_TYPE,52,309,75,145,CBS_DROPDOWNLIST |
COMBOBOX IDC_SHIP_TYPE,52,320,75,145,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_TEAM,52,325,75,84,CBS_DROPDOWNLIST | WS_VSCROLL |
COMBOBOX IDC_TEAM,52,336,75,84,CBS_DROPDOWNLIST | WS_VSCROLL |
WS_TABSTOP
EDITTEXT IDC_ID,151,273,30,12,ES_AUTOHSCROLL | ES_NUMBER
EDITTEXT IDC_ID,151,284,30,12,ES_AUTOHSCROLL | ES_NUMBER
CONTROL "Highlight",IDC_HILIGHT,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,135,291,43,10
WS_TABSTOP,135,302,43,10
CONTROL "Change locally",IDC_LOCAL,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,135,308,62,10
WS_TABSTOP,135,319,62,10
CONTROL "Flip Icon",IDC_FLIP_ICON,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,136,324,43,10
PUSHBUTTON "Make Icon",IDC_MAKE_ICON,197,272,50,14,0,
WS_TABSTOP,136,335,43,10
PUSHBUTTON "Make Icon",IDC_MAKE_ICON,197,283,50,14,0,
WS_EX_STATICEDGE
PUSHBUTTON "Delete Icon",IDC_DELETE_ICON,197,289,50,14,0,
PUSHBUTTON "Delete Icon",IDC_DELETE_ICON,197,300,50,14,0,
WS_EX_STATICEDGE
PUSHBUTTON "Propagate",IDC_PROPAGATE_ICONS,197,306,50,14,0,
PUSHBUTTON "Propagate",IDC_PROPAGATE_ICONS,197,317,50,14,0,
WS_EX_STATICEDGE
EDITTEXT IDC_ICON_TEXT,14,352,230,40,ES_MULTILINE |
EDITTEXT IDC_ICON_TEXT,14,363,230,40,ES_MULTILINE |
ES_AUTOVSCROLL | ES_WANTRETURN
LTEXT "Stage 1 of 9",IDC_STAGE_TITLE,7,7,53,8
GROUPBOX "Current Icon Info",IDC_STATIC,7,264,244,136
LTEXT "Label",IDC_STATIC,13,280,18,8
LTEXT "Icon image",IDC_STATIC,13,296,36,8
LTEXT "Text",IDC_STATIC,7,65,15,8
GROUPBOX "Current Icon Info",IDC_STATIC,7,274,244,136
LTEXT "Label",IDC_STATIC,13,291,18,8
LTEXT "Icon image",IDC_STATIC,13,307,36,8
LTEXT "Text",IDC_STATIC,7,62,15,8
LTEXT "Camera Transition Time (ms)",IDC_STATIC,7,25,90,8
LTEXT "Voice Wave File",IDC_STATIC,7,120,53,8
LTEXT "Text",IDC_STATIC,14,341,15,8
LTEXT "Team",IDC_STATIC,13,328,19,8
LTEXT "Ship Type",IDC_STATIC,13,312,33,8
LTEXT "ID",IDC_STATIC,137,275,8,8
LTEXT "Briefing Music",IDC_STATIC,7,137,45,8
LTEXT "Usage Formula",IDC_STATIC,7,171,48,8
LTEXT "Substitute Music",IDC_STATIC,7,154,53,8
LTEXT "Voice Wave File",IDC_STATIC,7,117,53,8
LTEXT "Text",IDC_STATIC,14,352,15,8
LTEXT "Team",IDC_STATIC,13,339,19,8
LTEXT "Ship Type",IDC_STATIC,13,323,33,8
LTEXT "ID",IDC_STATIC,137,286,8,8
LTEXT "Default",IDC_STATIC,14,144,24,8
LTEXT "Usage Formula",IDC_STATIC,7,180,48,8
LTEXT "If music pack is present",IDC_STATIC,14,157,44,17
GROUPBOX "Briefing Music",IDC_STATIC,7,132,150,44
END
IDD_IGNORE_ORDERS DIALOG DISCARDABLE 0, 0, 120, 217
@@ -2556,8 +2568,8 @@ BEGIN
IDD_MISSION_NOTES, DIALOG
BEGIN
RIGHTMARGIN, 460
BOTTOMMARGIN, 320
RIGHTMARGIN, 475
BOTTOMMARGIN, 323
END
IDD_PREFERENCES, DIALOG
@@ -2731,7 +2743,7 @@ BEGIN
RIGHTMARGIN, 251
VERTGUIDE, 136
TOPMARGIN, 7
BOTTOMMARGIN, 400
BOTTOMMARGIN, 410
END
IDD_IGNORE_ORDERS, DIALOG
+4
View File
@@ -1572,6 +1572,10 @@ void clear_mission()
The_mission.contrail_threshold = CONTRAIL_THRESHOLD_DEFAULT;
// Goober5000
The_mission.command_persona = Default_command_persona;
strcpy(The_mission.command_sender, DEFAULT_COMMAND);
// Goober5000: reset ALL mission flags, not just nebula!
The_mission.flags = 0;
The_mission.support_ships.max_support_ships = -1; // negative means infinite
+36 -2
View File
@@ -266,6 +266,7 @@
#include "gamesnd/eventmusic.h"
#include "cfile/cfile.h"
#include "mission/missionparse.h"
#include "mission/missionmessage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -297,6 +298,8 @@ CMissionNotesDlg::CMissionNotesDlg(CWnd* pParent /*=NULL*/) : CDialog(CMissionNo
m_ai_profile = -1;
m_event_music = -1;
m_substitute_event_music = _T("");
m_command_persona = -1;
m_command_sender = _T("");
m_full_war = FALSE;
m_red_alert = FALSE;
m_scramble = FALSE;
@@ -341,6 +344,8 @@ void CMissionNotesDlg::DoDataExchange(CDataExchange* pDX)
DDX_CBIndex(pDX, IDC_AI_PROFILE, m_ai_profile);
DDX_CBIndex(pDX, IDC_EVENT_MUSIC, m_event_music);
DDX_Text(pDX, IDC_SUBSTITUTE_EVENT_MUSIC, m_substitute_event_music);
DDX_CBIndex(pDX, IDC_COMMAND_PERSONA, m_command_persona);
DDX_Text(pDX, IDC_COMMAND_SENDER, m_command_sender);
DDX_Check(pDX, IDC_FULL_WAR, m_full_war);
DDX_Check(pDX, IDC_RED_ALERT, m_red_alert);
DDX_Check(pDX, IDC_SCRAMBLE, m_scramble);
@@ -609,6 +614,12 @@ void CMissionNotesDlg::OnOK()
MODIFY(Current_soundtrack_num, m_event_music - 1);
strcpy(The_mission.substitute_event_music_name, m_substitute_event_music);
MODIFY(The_mission.command_persona, ((CComboBox *) GetDlgItem(IDC_COMMAND_PERSONA))->GetItemData(m_command_persona));
if (m_command_sender.GetAt(0) == '#')
strcpy(The_mission.command_sender, m_command_sender.Mid(1));
else
strcpy(The_mission.command_sender, m_command_sender);
MODIFY(Mission_all_attack, m_full_war);
if (query_modified()){
set_modified();
@@ -633,7 +644,7 @@ void CMissionNotesDlg::OnCancel()
BOOL CMissionNotesDlg::OnInitDialog()
{
int i;
int i, box_index = 0, mission_command_persona_box_index = -1;
CComboBox *box;
CEdit *edit;
@@ -650,6 +661,7 @@ BOOL CMissionNotesDlg::OnInitDialog()
m_mission_desc_orig = m_mission_desc = convert_multiline_string(The_mission.mission_desc);
m_red_alert = (The_mission.flags & MISSION_FLAG_RED_ALERT) ? 1 : 0;
m_scramble = (The_mission.flags & MISSION_FLAG_SCRAMBLE) ? 1 : 0;
m_full_war = Mission_all_attack;
m_daisy_chained_docking = (The_mission.flags & MISSION_FLAG_ALLOW_DOCK_TREES) ? 1 : 0;
m_disallow_support = (The_mission.support_ships.max_support_ships == 0) ? 1 : 0;
m_no_promotion = (The_mission.flags & MISSION_FLAG_NO_PROMOTION) ? 1 : 0;
@@ -688,6 +700,25 @@ BOOL CMissionNotesDlg::OnInitDialog()
box->AddString(Soundtracks[i].name);
}
box = (CComboBox *) GetDlgItem(IDC_COMMAND_PERSONA);
for (i=0; i<Num_personas; i++){
if (Personas[i].flags & PERSONA_FLAG_COMMAND){
box->AddString(Personas[i].name);
box->SetItemData(box_index, i);
if (i == The_mission.command_persona)
mission_command_persona_box_index = box_index;
box_index++;
}
}
box = (CComboBox *) GetDlgItem(IDC_COMMAND_SENDER);
box->AddString(DEFAULT_COMMAND);
for (i=0; i<MAX_SHIPS; i++){
if (Ships[i].objnum >= 0)
if (Ship_info[Ships[i].ship_info_index].flags & SIF_HUGE_SHIP)
box->AddString(Ships[i].ship_name);
}
// squad info
if(strlen(The_mission.squad_name) > 0){
m_squad_name = _T(The_mission.squad_name);
@@ -699,9 +730,12 @@ BOOL CMissionNotesDlg::OnInitDialog()
m_type = The_mission.game_type;
m_ai_profile = (The_mission.ai_profile - Ai_profiles);
m_event_music = Current_soundtrack_num + 1;
m_substitute_event_music = The_mission.substitute_event_music_name;
m_full_war = Mission_all_attack;
m_command_persona = mission_command_persona_box_index;
m_command_sender = The_mission.command_sender;
// set up the game type checkboxes accoring to m_type
if ( m_type & MISSION_TYPE_SINGLE ){
+2
View File
@@ -211,6 +211,8 @@ public:
int m_ai_profile;
int m_event_music;
CString m_substitute_event_music;
int m_command_persona;
CString m_command_sender;
BOOL m_full_war;
BOOL m_red_alert;
BOOL m_scramble;
+662 -339
View File
File diff suppressed because it is too large. Load diff
+9 -2
View File
@@ -141,11 +141,15 @@
#include "ship/ship.h"
#include "object/waypoint.h"
#include <string>
#include <vector>
#define BACKUP_DEPTH 9
class CFred_mission_save {
private:
char *raw_ptr;
std::vector<std::string> fso_ver_comment;
int err;
CFILE *fp;
@@ -183,15 +187,18 @@ public:
int save_reinforcements();
void save_ai_goals(ai_goal *goalp, int ship);
int fout(char *format, ...);
int fout_ext(char *format, ...);
int fout_version(char *format, ...);
int fout_ext(char *pre_str, char *format, ...);
void parse_comments(int = 1);
CFred_mission_save() : err(0), raw_ptr(Mission_text_raw) { }
int save_mission_file(char *pathname);
int autosave_mission_file(char *pathname);
int save_campaign_file(char *pathname);
void fso_comment_push(char *ver);
void fso_comment_pop(bool pop_all = false);
// Goober5000
int fout_and_bypass(char *format, ...);
void bypass_comment(char *comment);
};
Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 B

+23 -16
View File
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by fred.rc
// Microsoft Developer Studio generated include file.
// Used by FRED.rc
//
#define IDC_SAVE_DEFAULT_PREFS 3
#define ID_DELETE_VARIABLE 3
@@ -101,21 +101,26 @@
#define IDD_CUSTOM_WING_NAMES 267
#define IDD_RESTRICT_PATHS 270
#define IDD_BACKGROUND_CHOOSER 272
#define IDB_DATA_02 274
#define IDB_DATA_03 275
#define IDB_DATA_04 276
#define IDB_DATA_05 277
#define IDB_DATA_06 278
#define IDB_DATA_07 279
#define IDB_DATA_08 280
#define IDB_DATA_09 281
#define IDB_DATA_01 285
#define IDB_DATA_10 286
#define IDB_DATA_11 287
#define IDB_DATA_12 288
#define IDB_DATA_15 289
#define IDB_DATA_14 290
#define IDB_DATA_13 291
#define IDB_DATA_15 296
#define IDB_DATA_00 297
#define IDB_DATA_20 300
#define IDB_DATA_25 301
#define IDB_DATA_30 302
#define IDB_DATA_35 303
#define IDB_DATA_40 304
#define IDB_DATA_45 305
#define IDB_DATA_50 306
#define IDB_DATA_55 307
#define IDB_DATA_60 308
#define IDB_DATA_65 309
#define IDB_DATA_70 310
#define IDB_DATA_75 311
#define IDB_DATA_80 312
#define IDB_DATA_85 313
#define IDB_DATA_90 314
#define IDB_DATA_95 315
#define IDC_SHIP_CLASS 1003
#define IDC_SHIP_WING 1004
#define IDC_SOUND_CLIP_NAME 1007
@@ -573,6 +578,8 @@
#define IDC_LIST3 1208
#define IDC_FILELIST 1208
#define IDC_YES_MESSAGE_LIST 1208
#define IDC_COMMAND_SENDER 1209
#define IDC_COMMAND_PERSONA 1210
#define IDC_FILTER_WAYPOINTS 1211
#define IDC_FILTER_STARTS 1212
#define IDC_FILTER_SHIPS 1213
@@ -1362,7 +1369,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 292
#define _APS_NEXT_RESOURCE_VALUE 316
#define _APS_NEXT_COMMAND_VALUE 33091
#define _APS_NEXT_CONTROL_VALUE 1595
#define _APS_NEXT_SYMED_VALUE 105
+77 -16
View File
@@ -820,6 +820,7 @@
#include "weapon/weapon.h"
#include "hud/hudartillery.h"
#include "iff_defs/iff_defs.h"
#include "mission/missionmessage.h"
#define TREE_NODE_INCREMENT 100
@@ -3139,6 +3140,7 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
case OPF_SUBSYSTEM:
case OPF_AWACS_SUBSYSTEM:
case OPF_ROTATING_SUBSYSTEM:
case OPF_SUBSYS_OR_GENERIC:
str = "<name of subsystem>";
break;
@@ -3191,6 +3193,10 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
str = "<any data>";
break;
case OPF_PERSONA:
str = "<persona name>";
break;
default:
str = "<new default required!>";
break;
@@ -3259,6 +3265,7 @@ int sexp_tree::query_default_argument_available(int op, int i)
case OPF_SKYBOX_MODEL_NAME:
case OPF_SHIP_OR_NONE:
case OPF_SUBSYSTEM_OR_NONE:
case OPF_SUBSYS_OR_GENERIC:
case OPF_BACKGROUND_BITMAP:
case OPF_SUN_BITMAP:
case OPF_NEBULA_STORM_TYPE:
@@ -3288,6 +3295,12 @@ int sexp_tree::query_default_argument_available(int op, int i)
return 0;
case OPF_PERSONA:
if (Num_personas)
return 1;
return 0;
case OPF_POINT:
case OPF_WAYPOINT_PATH:
if (Num_waypoint_lists)
@@ -4241,21 +4254,26 @@ void sexp_tree::OnLButtonUp(UINT nFlags, CPoint point)
}
const static UINT Numbered_data_bitmaps[] = {
IDB_DATA_01,
IDB_DATA_02,
IDB_DATA_03,
IDB_DATA_04,
IDB_DATA_00,
IDB_DATA_05,
IDB_DATA_06,
IDB_DATA_07,
IDB_DATA_08,
IDB_DATA_09,
IDB_DATA_10,
IDB_DATA_11,
IDB_DATA_12,
IDB_DATA_13,
IDB_DATA_14,
IDB_DATA_15,
IDB_DATA_20,
IDB_DATA_25,
IDB_DATA_30,
IDB_DATA_35,
IDB_DATA_40,
IDB_DATA_45,
IDB_DATA_50,
IDB_DATA_55,
IDB_DATA_60,
IDB_DATA_65,
IDB_DATA_70,
IDB_DATA_75,
IDB_DATA_80,
IDB_DATA_85,
IDB_DATA_90,
IDB_DATA_95
};
void sexp_tree::setup(CEdit *ptr)
@@ -4816,6 +4834,10 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
list = get_listing_opf_subsystem_or_none(parent_node, arg_index);
break;
case OPF_SUBSYS_OR_GENERIC:
list = get_listing_opf_subsys_or_generic(parent_node, arg_index);
break;
case OPF_JUMP_NODE_NAME:
list = get_listing_opf_jump_nodes();
break;
@@ -4856,6 +4878,10 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
list = get_listing_opf_turret_target_order();
break;
case OPF_PERSONA:
list = get_listing_opf_persona();
break;
default:
Int3(); // unknown OPF code
list = NULL;
@@ -4946,15 +4972,25 @@ int sexp_tree::find_ancestral_argument_number(int parent_op, int child_node)
*/
int sexp_tree::get_data_image(int node)
{
int count = get_sibling_place(node);
int count = get_sibling_place(node) + 1;
if(count < 0)
if (count <= 0) {
return BITMAP_DATA;
}
if(count > NUM_BITMAP_NUMBERED_DATA)
if (count % 5) {
return BITMAP_DATA;
}
return BITMAP_NUMBERED_DATA + count;
int idx = (count % 100) / 5;
int num = sizeof(Numbered_data_bitmaps)/sizeof(UINT);
if (idx > num) {
return BITMAP_DATA;
}
return BITMAP_NUMBERED_DATA + idx;
}
int sexp_tree::get_sibling_place(int node)
@@ -5551,6 +5587,20 @@ sexp_list_item *sexp_tree::get_listing_opf_message()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_persona()
{
int i;
sexp_list_item head;
for (i = 0; i < Num_personas; i++) {
if (Personas[i].flags & PERSONA_FLAG_WINGMAN) {
head.add_data (Personas[i].name);
}
}
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_who_from()
{
object *ptr;
@@ -5889,6 +5939,17 @@ sexp_list_item *sexp_tree::get_listing_opf_subsystem_or_none(int parent_node, in
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_subsys_or_generic(int parent_node, int arg_index)
{
sexp_list_item head;
head.add_data(SEXP_ALL_ENGINES_STRING);
head.add_data(SEXP_ALL_TURRETS_STRING);
head.add_list(get_listing_opf_subsystem(parent_node, arg_index));
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_jump_nodes()
{
sexp_list_item head;
+2 -1
View File
@@ -55,7 +55,6 @@
#define BITMAP_BLUE_DOT BITMAP_ROOT
#define BITMAP_RED_DOT BITMAP_ROOT_DIRECTIVE
#define BITMAP_NUMBERED_DATA 9
#define NUM_BITMAP_NUMBERED_DATA 15
//Therefore NEXT DEFINE should be 9+12 or 21
@@ -247,7 +246,9 @@ public:
sexp_list_item *get_listing_opf_flexible_argument();
sexp_list_item *get_listing_opf_ship_or_none();
sexp_list_item *get_listing_opf_subsystem_or_none(int parent_node, int arg_index);
sexp_list_item *get_listing_opf_subsys_or_generic(int parent_node, int arg_index);
sexp_list_item *get_listing_opf_turret_target_order();
sexp_list_item *get_listing_opf_persona();
// ---------------------------------------------------------
int m_mode;
+28 -9
View File
@@ -132,6 +132,7 @@ BOOL ShipSpecialDamage::OnInitDialog()
m_special_exp_enabled = TRUE;
}
CDialog::OnInitDialog();
// maybe gray out lots of stuff
@@ -163,6 +164,25 @@ void ShipSpecialDamage::OnOK()
{
UpdateData(TRUE);
object *objp;
objp = GET_FIRST(&obj_used_list);
while (objp != END_OF_LIST(&obj_used_list)) {
if ((objp->type == OBJ_START) || (objp->type == OBJ_SHIP)) {
if (objp->flags & OF_MARKED)
update_ship(objp->instance);
}
objp = GET_NEXT(objp);
}
CDialog::OnOK();
}
void ShipSpecialDamage::update_ship(int shipnum)
{
ship *shipp = &Ships[shipnum];
// TODO: Add extra validation here
if (m_special_exp_enabled) {
@@ -173,17 +193,17 @@ void ShipSpecialDamage::OnOK()
return;
}
if (Ships[m_ship_num].special_exp_index == -1) {
if (shipp->special_exp_index == -1) {
// get free sexp_variables
start = sexp_variable_allocate_block(Ships[m_ship_num].ship_name, SEXP_VARIABLE_BLOCK | SEXP_VARIABLE_BLOCK_EXP);
start = sexp_variable_allocate_block(shipp->ship_name, SEXP_VARIABLE_BLOCK | SEXP_VARIABLE_BLOCK_EXP);
if (start == -1) {
MessageBox("Unable to allocate storage, try deleting Sexp variables");
return;
} else {
Ships[m_ship_num].special_exp_index = start;
shipp->special_exp_index = start;
}
} else {
start = Ships[m_ship_num].special_exp_index;
start = shipp->special_exp_index;
}
// set to update
set_modified();
@@ -197,17 +217,16 @@ void ShipSpecialDamage::OnOK()
sprintf(Sexp_variables[start+SHOCK_SPEED].text, "%d", m_shock_speed);
} else {
if (Ships[m_ship_num].special_exp_index != -1) {
if (shipp->special_exp_index != -1) {
// set to update
set_modified();
// free block
sexp_variable_block_free(Ships[m_ship_num].ship_name, Ships[m_ship_num].special_exp_index, SEXP_VARIABLE_BLOCK |SEXP_VARIABLE_BLOCK_EXP);
sexp_variable_block_free(shipp->ship_name, Ships[m_ship_num].special_exp_index, SEXP_VARIABLE_BLOCK |SEXP_VARIABLE_BLOCK_EXP);
// set index to no exp block
Ships[m_ship_num].special_exp_index = -1;
shipp->special_exp_index = -1;
}
}
CDialog::OnOK();
}
+1
View File
@@ -24,6 +24,7 @@ class ShipSpecialDamage : public CDialog
// Construction
public:
ShipSpecialDamage(CWnd* pParent = NULL); // standard constructor
void update_ship(int ship);
// Dialog Data
//{{AFX_DATA(ShipSpecialDamage)
+1 -1
View File
@@ -124,7 +124,7 @@ BOOL starfield_editor::OnInitDialog()
CDialog::OnInitDialog();
theApp.init_window(&Starfield_wnd_data, this);
m_slider.SetRange(100, MAX_STARS);
m_slider.SetRange(0, MAX_STARS);
m_slider.SetPos(Num_stars);
sprintf(buf, "%d", Num_stars);
GetDlgItem(IDC_TOTAL)->SetWindowText(buf);
+15 -15
View File
@@ -1833,6 +1833,7 @@
#include "osapi/osregistry.h"
#include "parse/encrypt.h"
#include "parse/lua.h"
#include "parse/parselo.h"
#include "parse/scripting.h"
#include "parse/sexp.h"
#include "particle/particle.h"
@@ -1899,7 +1900,7 @@ extern int Om_tracker_flag; // needed for FS2OpenPXO config
// This function is defined in code\network\multiutil.cpp so will be linked from multiutil.obj
// it's required fro the -missioncrcs command line option - Kazan
void multi_spew_pxo_checksums(int max_files, char *outfile);
void multi_spew_table_checksums(int max_files, char *outfile);
void fs2netd_spew_table_checksums(char *outfile);
extern bool frame_rate_display;
@@ -4168,7 +4169,7 @@ void game_show_framerate()
#endif
if (Show_framerate) {
if (Show_framerate && HUD_draw) {
gr_set_color_fast(&HUD_color_debug);
if (frametotal != 0.0f)
@@ -4190,7 +4191,7 @@ void game_show_framerate()
// MONITOR_INC(BmpNew, bitmaps_new_this_frame);
#ifdef _WIN32
if (Cmdline_show_stats) {
if (Cmdline_show_stats && HUD_draw) {
char mem_buffer[50];
#ifndef NO_DIRECT3D
@@ -4394,7 +4395,7 @@ void game_show_framerate()
void game_show_eye_pos(vec3d *eye_pos, matrix* eye_orient)
{
if(!Cmdline_show_pos)
if ( !Cmdline_show_pos && HUD_draw )
return;
//Do stuff
@@ -4976,19 +4977,17 @@ void say_view_target()
if (!(Game_mode & GM_DEAD_DIED) && ((Game_mode & (GM_DEAD_BLEW_UP)) || ((Last_view_target != NULL) && (Last_view_target != view_target)))) {
if (view_target != Player_obj){
char *view_target_name = NULL;
char view_target_name[128] = "";
switch(Objects[Player_ai->target_objnum].type) {
case OBJ_SHIP:
view_target_name = Ships[Objects[Player_ai->target_objnum].instance].ship_name;
strcpy(view_target_name, Ships[Objects[Player_ai->target_objnum].instance].ship_name);
break;
case OBJ_WEAPON:
view_target_name = Weapon_info[Weapons[Objects[Player_ai->target_objnum].instance].weapon_info_index].name;
strcpy(view_target_name, Weapon_info[Weapons[Objects[Player_ai->target_objnum].instance].weapon_info_index].name);
Viewer_mode &= ~VM_OTHER_SHIP;
break;
case OBJ_JUMP_NODE: {
char jump_node_name[128];
strcpy(jump_node_name, XSTR( "jump node", 184));
view_target_name = jump_node_name;
strcpy(view_target_name, XSTR( "jump node", 184));
Viewer_mode &= ~VM_OTHER_SHIP;
break;
}
@@ -4998,6 +4997,7 @@ void say_view_target()
break;
}
end_string_at_first_hash_symbol(view_target_name);
if ( view_target_name ) {
HUD_fixed_printf(0.0f, XSTR( "Viewing %s%s\n", 185), (Viewer_mode & VM_OTHER_SHIP) ? XSTR( "from ", 186) : "", view_target_name);
Show_viewing_from_self = 1;
@@ -5575,7 +5575,7 @@ void game_render_frame( vec3d *eye_pos, matrix *eye_orient )
// maybe offset the HUD (jitter stuff) and measure the 2D displacement between the player's view and ship vector
dont_offset = ((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_OBSERVER));
HUD_set_offsets(Viewer_obj, !dont_offset, &eye_no_jitter);
// for multiplayer clients, call code in Shield.cpp to set up the Shield_hit array. Have to
// do this becaues of the disjointed nature of this system (in terms of setup and execution).
// must be done before ships are rendered
@@ -6423,7 +6423,7 @@ void game_frame(int paused)
popupdead_start();
}
}
}
}
DEBUG_GET_TIME( render3_time2 )
DEBUG_GET_TIME( render2_time1 )
@@ -7940,7 +7940,7 @@ void game_leave_state( int old_state, int new_state )
}
break;
case GS_STATE_MULTI_MISSION_SYNC:
case GS_STATE_MULTI_MISSION_SYNC:
common_select_close();
// if we're moving into the options menu we don't need to do anything else
@@ -9104,7 +9104,7 @@ int game_main(char *cmdline)
multi_spew_pxo_checksums(1024, "mission_crcs.txt");
if (Cmdline_spew_table_crcs) {
multi_spew_table_checksums(50, "table_crcs.txt");
fs2netd_spew_table_checksums("table_crcs.txt");
}
game_shutdown();
@@ -9113,7 +9113,7 @@ int game_main(char *cmdline)
if (Cmdline_spew_table_crcs) {
multi_spew_table_checksums(50, "table_crcs.txt");
fs2netd_spew_table_checksums("table_crcs.txt");
game_shutdown();
return 0;
}
+154 -6
View File
@@ -46,6 +46,8 @@
#include "graphics/font.h"
#include "globalincs/alphacolors.h"
#include "network/multi_options.h"
#include "cmdline/cmdline.h"
#include "cfile/cfilesystem.h"
#ifdef WIN32
//#include <windows.h>
@@ -603,6 +605,8 @@ void fs2netd_do_frame()
Logged_in = false;
PXO_SID = -1;
}
break;
}
default: {
@@ -765,6 +769,99 @@ int fs2netd_load_servers()
return 0;
}
static char Chk_mission_name[NAME_LENGTH+1];
static uint Chk_mission_crc = 0;
int fs2netd_check_mission_do()
{
if (timeout == -1) {
timeout = timer_get_fixed_seconds() + (15 * F1_0);
}
// if timeout passes then bail on stats failure
if ( timer_get_fixed_seconds() > timeout ) {
timeout = -1;
return 4;
}
int rescode = FS2NetD_CheckSingleMission(Chk_mission_name, Chk_mission_crc, do_full_packet);
do_full_packet = 0;
if (rescode) {
timeout = -1;
return rescode;
}
return 0;
}
bool fs2netd_check_mission(char *mission_name)
{
int rc = 0;
// don't bother with this if we aren't on FS2NetD
if ( !Om_tracker_flag ) {
return 0;
}
if ( !(Game_mode & GM_MULTIPLAYER) ) {
return 0;
}
if ( !Is_connected ) {
return 0;
}
strcpy(Chk_mission_name, mission_name);
cf_chksum_long(Chk_mission_name, &Chk_mission_crc);
do_full_packet = 1;
In_process = true;
if (Is_standalone) {
do { rc = fs2netd_check_mission_do(); } while (!rc);
} else {
rc = popup_till_condition(fs2netd_check_mission_do, XSTR("&Cancel", 779), XSTR("Sending stats...", -1));
}
In_process = false;
switch (rc) {
// operation canceled, or invalid
case 0:
return false;
// successful, but invalid
case 1:
return false;
// successful and valid
case 2:
return true;
// failed to send request packet
case 3:
if ( !Is_standalone ) {
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Server request failed!", -1));
}
return false;
// it timed out
case 4:
if ( !Is_standalone ) {
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Server request timed out!", -1));
}
return false;
}
return false;
}
void fs2netd_debrief_init()
{
if ( !(Game_mode & GM_MULTIPLAYER) ) {
@@ -780,12 +877,7 @@ void fs2netd_debrief_init()
}
uint CurrentMissionChsum;
bool mValidStatus = false;
cf_chksum_long(Netgame.mission_name, &CurrentMissionChsum);
mValidStatus = FS2NetD_CheckSingleMission(Netgame.mission_name, CurrentMissionChsum);
bool mValidStatus = fs2netd_check_mission(Netgame.mission_name);
if ( ((multi_num_players() > 1) || (Multi_num_players_at_start > 1)) && !game_hacked_data() && mValidStatus ) {
// verify that we are logged in before doing anything else
@@ -1326,12 +1418,15 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
strncpy( new_plr.callsign, callsign, CALLSIGN_LEN );
memset( out_plr, 0, sizeof(player) );
timeout = timer_get_fixed_seconds() + (30 * F1_0);
}
int rc = FS2NetD_GetPlayerData(-2, callsign, &new_plr, false, (int)first_call );
// some sort of failure
if (rc > 0) {
timeout = -1;
return -2;
}
@@ -1339,6 +1434,12 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
memcpy( out_plr, &new_plr, sizeof(player) );
}
// if timeout passes then bail on failure
if ( timer_get_fixed_seconds() > timeout ) {
timeout = -1;
return -2;
}
// we should only be returning -1 (processing) or 0 (got data successfully)
return rc;
}
@@ -1392,3 +1493,50 @@ void fs2netd_update_game_count(char *chan_name)
FS2NetD_GameCountUpdate(chan_name);
}
void fs2netd_spew_table_checksums(char *outfile)
{
char full_name[MAX_PATH_LEN];
int count, idx;
FILE *out = NULL;
char modname[128];
time_t my_time = 0;
if ( Table_valid_status.empty() ) {
return;
}
cf_create_default_path_string(full_name, sizeof(full_name) - 1, CF_TYPE_ROOT, outfile);
// open the outfile
out = fopen(full_name, "wt");
if (out == NULL) {
return;
}
memset( modname, 0, sizeof(modname) );
strcpy( modname, Cmdline_spew_table_crcs );
my_time = time(NULL);
fprintf(out, "-- Table CRCs generated on %s \n", ctime(&my_time));
fprintf(out, "LOCK TABLES `fstables` WRITE;\n");
fprintf(out, "INSERT INTO `fstables` VALUES ");
count = (int)Table_valid_status.size();
// do all the checksums
for (idx = 0; idx < count; idx++) {
if (idx == 0) {
fprintf(out, "('%s',%u,'%s')", Table_valid_status[idx].name, Table_valid_status[idx].crc32, modname);
} else {
fprintf(out, ",('%s',%u,'%s')", Table_valid_status[idx].name, Table_valid_status[idx].crc32, modname);
}
}
fprintf(out, ";\n");
fprintf(out, "UNLOCK TABLES;\n");
fclose(out);
}
+7 -5
View File
@@ -175,7 +175,7 @@
extern std::vector<crc_valid_status> Table_valid_status;
bool FS2NetD_CheckSingleMission(const char *m_name, uint crc32, int timeout)
int FS2NetD_CheckSingleMission(const char *m_name, uint crc32, int timeout)
{
int rc, buffer_size, buffer_offset;
bool my_packet = false;
@@ -197,7 +197,7 @@ bool FS2NetD_CheckSingleMission(const char *m_name, uint crc32, int timeout)
DONE_PACKET();
if ( FS2NetD_SendData(buffer, buffer_size) == -1 )
return false;
return 3;
Recieve_Only:
@@ -207,12 +207,12 @@ Recieve_Only:
if ( (rc = FS2NetD_GetData(buffer, sizeof(buffer))) != -1 ) {
if (rc < BASE_PACKET_SIZE)
return false;
return 0;
VRFY_PACKET2( PCKT_MCHECK_REPLY );
if (!my_packet)
return false;
return 0;
PXO_GET_DATA( status );
Assert( (status == 0) || (status == 1) );
@@ -220,9 +220,11 @@ Recieve_Only:
// anything beyond 'true' is considered a failure of some kind
if (status > 1)
status = 0;
return status+1;
}
return (status == 1);
return 0;
}
int FS2NetD_SendPlayerData(int SID, const char *player_name, const char *user, player *pl, int timeout)
+1 -1
View File
@@ -96,7 +96,7 @@ struct netgame_info;
int FS2NetD_SendPlayerData(int SID, const char* player_name, const char* user, player *pl, int timeout = 15);
int FS2NetD_GetPlayerData(int SID, const char* player_name, player *pl, bool CanCreate = false, int timeout = 15);
bool FS2NetD_CheckSingleMission(const char *m_name, uint crc32, int timeout = 15);
int FS2NetD_CheckSingleMission(const char *m_name, uint crc32, int timeout = 15);
int FS2NetD_CheckValidSID(int SID);
int FS2NetD_GetServerList(int timeout = 15);
void FS2NetD_Ping();
+8
View File
@@ -771,6 +771,14 @@ $Player Shield Recharge Scale: 4, 2, 1.5, 1.25, 1 \n\
;; factor applied to the speed at which the player's weapons recharge \n\
$Player Weapon Recharge Scale: 10, 4, 2.5, 2, 1.5 \n\
\n\
;; maximum number of turrets on one ship allowed to be attacking a \n\
;; target at a given time \n\
$Max Turret Target Ownage: 3, 4, 7, 12, 19 \n\
\n\
;; maximum number of turrets on one ship allowed to be attacking the \n\
;; player at a given time \n\
$Max Turret Player Ownage: 3, 4, 7, 12, 19 \n\
\n\
\n\
;; General AI-related flags. These were previously all lumped together \n\
;; under the New AI mission flag. \n\
+2
View File
@@ -1400,6 +1400,8 @@ void gr_init_res(int res, int mode, int max_w, int max_h)
gr_screen.clip_width = gr_screen.clip_width_unscaled = gr_screen.max_w;
gr_screen.clip_height = gr_screen.clip_height_unscaled = gr_screen.max_h;
gr_screen.clip_aspect = i2fl(gr_screen.clip_width) / i2fl(gr_screen.clip_height);
gr_screen.clip_center_x = (gr_screen.clip_left + gr_screen.clip_right) * 0.5f;
gr_screen.clip_center_y = (gr_screen.clip_top + gr_screen.clip_bottom) * 0.5f;
if (gr_screen.custom_size >= 0) {
gr_unsize_screen_pos( &gr_screen.max_w_unscaled, &gr_screen.max_h_unscaled );
+2
View File
@@ -874,6 +874,8 @@ typedef struct screen {
int clip_left, clip_right, clip_top, clip_bottom;
// same as above except in 1024x768 or 640x480 dimensions
int clip_left_unscaled, clip_right_unscaled, clip_top_unscaled, clip_bottom_unscaled;
// center of clip area
float clip_center_x, clip_center_y;
int current_alphablend_mode; // See GR_ALPHABLEND defines above
int current_bitblt_mode; // See GR_BITBLT_MODE defines above
+8 -2
View File
@@ -1755,6 +1755,9 @@ void gr_opengl_set_clip(int x, int y, int w, int h, bool resize)
gr_screen.clip_aspect = i2fl(w) / i2fl(h);
gr_screen.clip_center_x = (gr_screen.clip_left + gr_screen.clip_right) * 0.5f;
gr_screen.clip_center_y = (gr_screen.clip_top + gr_screen.clip_bottom) * 0.5f;
// just return early if we aren't actually going to need the scissor test
if ( (x == 0) && (y == 0) && (w == max_w) && (h == max_h) ) {
glDisable(GL_SCISSOR_TEST);
@@ -1783,6 +1786,9 @@ void gr_opengl_reset_clip()
gr_screen.clip_aspect = i2fl(gr_screen.clip_width) / i2fl(gr_screen.clip_height);
gr_screen.clip_center_x = (gr_screen.clip_left + gr_screen.clip_right) * 0.5f;
gr_screen.clip_center_y = (gr_screen.clip_top + gr_screen.clip_bottom) * 0.5f;
glDisable(GL_SCISSOR_TEST);
}
@@ -4815,8 +4821,8 @@ void gr_opengl_init(int reinit)
if ( !Cmdline_nohtl && !Cmdline_novbo && Is_Extension_Enabled(OGL_ARB_VERTEX_BUFFER_OBJECT) )
VBO_ENABLED = 1;
if ( Is_Extension_Enabled(OGL_ARB_PIXEL_BUFFER_OBJECT) )
Use_PBOs = 1;
//if ( Is_Extension_Enabled(OGL_ARB_PIXEL_BUFFER_OBJECT) )
// Use_PBOs = 1;
// setup the best fog function found
// start with NV Radial Fog (GeForces only) -- needs t&l, will have to wait
+3 -32
View File
@@ -563,34 +563,10 @@ void gr_opengl_destroy_buffer(int idx)
#define DO_RENDER() { \
if ( (ibuffer != NULL) || (sbuffer != NULL) ) { \
if ( multiple_elements ) { \
start_tmp = 0; \
end_tmp = (GL_max_elements_indices - 1); \
count_tmp = (end_tmp - start_tmp + 1); \
\
if (ibuffer) { \
vglDrawRangeElements(GL_TRIANGLES, start_tmp, end_tmp, count_tmp, GL_UNSIGNED_INT, ibuffer + start_tmp); \
} else { \
vglDrawRangeElements(GL_TRIANGLES, start_tmp, end_tmp, count_tmp, GL_UNSIGNED_SHORT, sbuffer + start_tmp); \
} \
\
while (end_tmp < end) { \
start_tmp += (GL_max_elements_indices - 1); \
end_tmp = MIN( (start_tmp + GL_max_elements_indices - 1), end ); \
count_tmp = (end_tmp - start_tmp + 1); \
\
if (ibuffer) { \
vglDrawRangeElements(GL_TRIANGLES, start_tmp, end_tmp, count_tmp, GL_UNSIGNED_INT, ibuffer + start_tmp); \
} else { \
vglDrawRangeElements(GL_TRIANGLES, start_tmp, end_tmp, count_tmp, GL_UNSIGNED_SHORT, sbuffer + start_tmp); \
} \
} \
if (ibuffer) { \
vglDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_INT, ibuffer + start); \
} else { \
if (ibuffer) { \
vglDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_INT, ibuffer + start); \
} else { \
vglDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, sbuffer + start); \
} \
vglDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, sbuffer + start); \
} \
} else { \
glDrawArrays(GL_TRIANGLES, 0, vbp->n_verts); \
@@ -620,7 +596,6 @@ void gr_opengl_render_buffer(int start, int n_prim, ushort *sbuffer, uint *ibuff
int end = ((n_prim * 3) - 1);
int count = (end - start + 1); //(n_prim * 3);
int start_tmp, end_tmp, count_tmp, multiple_elements = 0;
int textured = (flags & TMAP_FLAG_TEXTURED);
@@ -631,10 +606,6 @@ void gr_opengl_render_buffer(int start, int n_prim, ushort *sbuffer, uint *ibuff
// disable all arbs before we start
opengl_switch_arb(-1, 0);
// see if we need to optimize glDrawRangeElements
if ( count > GL_max_elements_indices )
multiple_elements = 1;
if ( glIsEnabled(GL_CULL_FACE) )
glFrontFace(GL_CW);
+16 -9
View File
@@ -1986,7 +1986,7 @@ void HUD_render_2d(float frametime)
}
if ( show_gauge_flag ) {
hud_show_cmeasure_gague();
hud_show_cmeasure_gauge();
}
}
@@ -3498,7 +3498,7 @@ void HUD_set_offsets(object *viewer_obj, int wiggedy_wack, matrix *eye_orient)
flags = g3_rotate_vertex(&pt,&tmp);
g3_project_vertex(&pt);
g3_project_vertex(&pt);
gr_unsize_screen_posf( &pt.sx, &pt.sy );
HUD_offset_x -= 0.45f * (i2fl(gr_screen.clip_width_unscaled)*0.5f - pt.sx);
@@ -3538,8 +3538,8 @@ void HUD_get_nose_coordinates(int *x, int *y)
vertex v0;
vec3d p0;
int x_nose;
int y_nose;
float x_nose;
float y_nose;
vm_vec_scale_add(&p0, &Player_obj->pos, &Player_obj->orient.vec.fvec, 100.0f);
g3_rotate_vertex(&v0, &p0);
@@ -3547,9 +3547,16 @@ void HUD_get_nose_coordinates(int *x, int *y)
if (v0.codes == 0) {
g3_project_vertex(&v0);
if (! (v0.codes & PF_OVERFLOW)) {
x_nose = fl2i(v0.sx);
y_nose = fl2i(v0.sy);
if ( !(v0.codes & PF_OVERFLOW) ) {
x_nose = v0.sx;
y_nose = v0.sy;
} else {
// Means that the ship forward vector is not going through the frame buffer.
// We're assigning a high negative value so that the the bitmaps will be drawn offscreen so that
// we can give the illusion that the player is looking away from the slewable HUD reticle.
*x = -100000;
*y = -100000;
return;
}
} else {
// Means that the ship forward vector is not going through the frame buffer.
@@ -3560,8 +3567,8 @@ void HUD_get_nose_coordinates(int *x, int *y)
return;
}
*x = x_nose - SCREEN_CENTER_X;
*y = y_nose - SCREEN_CENTER_Y;
*x = fl2i(x_nose - gr_screen.clip_center_x);
*y = fl2i(y_nose - gr_screen.clip_center_y);
return;
}
+1 -3
View File
@@ -338,9 +338,6 @@
#include "graphics/2d.h"
#include "hud/hudparse.h"
#define SCREEN_CENTER_X ((gr_screen.clip_left + gr_screen.clip_right) / 2.0f)
#define SCREEN_CENTER_Y ((gr_screen.clip_top + gr_screen.clip_bottom) / 2.0f)
struct object;
typedef struct hud_anim {
@@ -358,6 +355,7 @@ typedef struct hud_frames {
int num_frames;
} hud_frames;
extern int HUD_draw;
extern int HUD_contrast;
+12 -12
View File
@@ -753,7 +753,7 @@ void draw_bounding_brackets(int x1, int y1, int x2, int y2, int w_correction, in
( y1 > gr_screen.clip_height && y2 > gr_screen.clip_height ) )
return;
// *** everything blow is taken care of with this unsize ***
// *** everything below is taken care of with this unsize ***
gr_unsize_screen_pos(&x1, &y1);
gr_unsize_screen_pos(&x2, &y2);
@@ -837,23 +837,24 @@ void draw_bounding_brackets(int x1, int y1, int x2, int y2, int w_correction, in
object* t_objp = &Objects[target_objnum];
char* tinfo_name = NULL;
char* tinfo_class = NULL;
char temp[NAME_LENGTH];
char buffer[NAME_LENGTH];
char empty='\0';
switch(t_objp->type)
{
case OBJ_SHIP:
if ( Cmdline_wcsaga &&
(Ships[t_objp->instance].wingnum >= 0) &&
(iff_x_attacks_y(Player_ship->team, Ships[t_objp->instance].team)) )
{
// if ( Cmdline_wcsaga &&
// (Ships[t_objp->instance].wingnum >= 0) &&
// (iff_x_attacks_y(Player_ship->team, Ships[t_objp->instance].team)) )
// Backslash - Instead of rely on command line, let's use a flag in Iff_defs.tbl
if ( (Iff_info[Ships[t_objp->instance].team].flags & IFFF_WING_NAME_HIDDEN) && (Ships[t_objp->instance].wingnum != -1) ) {
tinfo_name = &empty;
} else {
strcpy(temp, Ships[t_objp->instance].ship_name);
end_string_at_first_hash_symbol(temp);
tinfo_name = temp;
}
else
{
tinfo_name = Ships[t_objp->instance].ship_name;
}
tinfo_class = Ship_info[Ships[t_objp->instance].ship_info_index].name;
@@ -862,9 +863,8 @@ void draw_bounding_brackets(int x1, int y1, int x2, int y2, int w_correction, in
mission_parse_lookup_alt_index(Ships[t_objp->instance].alt_type_index, buffer);
} else {
strcpy(buffer, Ship_info[Ships[t_objp->instance].ship_info_index].name);
end_string_at_first_hash_symbol(buffer);
}
end_string_at_first_hash_symbol(buffer);
tinfo_class = buffer;
break;
+13 -23
View File
@@ -820,7 +820,6 @@ void hud_do_lock_indicator(float frametime)
object *tobjp = &Objects[Player_ai->target_objnum];
vec3d dir_to_target;
vm_vec_normalized_dir(&dir_to_target, &tobjp->pos, &Player_obj->pos);
float dot_target_orient = vm_vec_dot(&tobjp->orient.vec.fvec, &dir_to_target);
if ( !(wip->wi_flags & WIF_LOCKED_HOMING) ) {
hud_lock_reset();
@@ -1223,20 +1222,20 @@ void hud_calculate_lock_start_pos()
double delta_x;
double target_mag, target_x, target_y;
delta_x = Player->current_target_sx - SCREEN_CENTER_X;
delta_y = Player->current_target_sy - SCREEN_CENTER_Y;
delta_x = Player->current_target_sx - gr_screen.clip_center_x;
delta_y = Player->current_target_sy - gr_screen.clip_center_y;
if (!delta_x && !delta_y) {
Players[Player_num].lock_indicator_start_x = fl2i(SCREEN_CENTER_X + Lock_start_dist);
Players[Player_num].lock_indicator_start_y = fl2i(SCREEN_CENTER_Y);
if ( (delta_x == 0.0) && (delta_y == 0.0) ) {
Players[Player_num].lock_indicator_start_x = fl2i(gr_screen.clip_center_x + Lock_start_dist);
Players[Player_num].lock_indicator_start_y = fl2i(gr_screen.clip_center_y);
return;
}
hypotenuse = _hypot(delta_y, delta_x);
if (hypotenuse >= Lock_start_dist) {
Players[Player_num].lock_indicator_start_x = fl2i(SCREEN_CENTER_X);
Players[Player_num].lock_indicator_start_y = fl2i(SCREEN_CENTER_Y);
Players[Player_num].lock_indicator_start_x = fl2i(gr_screen.clip_center_x);
Players[Player_num].lock_indicator_start_y = fl2i(gr_screen.clip_center_y);
return;
}
@@ -1244,20 +1243,11 @@ void hud_calculate_lock_start_pos()
target_x = target_mag * (delta_x / hypotenuse);
target_y = target_mag * (delta_y / hypotenuse);
Players[Player_num].lock_indicator_start_x = fl2i(SCREEN_CENTER_X - target_x);
Players[Player_num].lock_indicator_start_y = fl2i(SCREEN_CENTER_Y - target_y);
Players[Player_num].lock_indicator_start_x = fl2i(gr_screen.clip_center_x - target_x);
Players[Player_num].lock_indicator_start_y = fl2i(gr_screen.clip_center_y - target_y);
if (Players[Player_num].lock_indicator_start_x > gr_screen.clip_right)
Players[Player_num].lock_indicator_start_x = gr_screen.clip_right;
if (Players[Player_num].lock_indicator_start_y > gr_screen.clip_bottom)
Players[Player_num].lock_indicator_start_y = gr_screen.clip_bottom;
if (Players[Player_num].lock_indicator_start_x < gr_screen.clip_left)
Players[Player_num].lock_indicator_start_x = gr_screen.clip_left;
if (Players[Player_num].lock_indicator_start_y < gr_screen.clip_top)
Players[Player_num].lock_indicator_start_y = gr_screen.clip_top;
CLAMP(Players[Player_num].lock_indicator_start_x, gr_screen.clip_left, gr_screen.clip_right);
CLAMP(Players[Player_num].lock_indicator_start_y, gr_screen.clip_top, gr_screen.clip_bottom);
}
// hud_stop_looped_locking_sounds() will terminate any hud related looping sounds that are playing
@@ -1421,8 +1411,8 @@ void hud_lock_determine_lock_point(vec3d *lock_world_pos_out)
if ( lock_local_pos.xyz.z > 0.0f ) {
// Get the location of our target in the "virtual frame" where the locking computation will be done
float w = 1.0f / lock_local_pos.xyz.z;
float sx = ((SCREEN_CENTER_X*2) + (lock_local_pos.xyz.x*(SCREEN_CENTER_X*2)*w))*0.5f;
float sy = ((SCREEN_CENTER_Y*2) - (lock_local_pos.xyz.y*(SCREEN_CENTER_Y*2)*w))*0.5f;
float sx = ((gr_screen.clip_center_x*2.0f) + (lock_local_pos.xyz.x*(gr_screen.clip_center_x*2.0f)*w))*0.5f;
float sy = ((gr_screen.clip_center_y*2.0f) - (lock_local_pos.xyz.y*(gr_screen.clip_center_y*2.0f)*w))*0.5f;
Player->current_target_sx = (int)sx;
Player->current_target_sy = (int)sy;
+1 -1
View File
@@ -552,7 +552,7 @@ void hud_shield_show(object *objp)
sip = &Ship_info[sp->ship_info_index];
// bool digitus_improbus = (fod_model != -2 && strstr(sp->ship_name, "Sathanas") != NULL);
if ( sip->shield_icon_index == 255 && !(sip->flags & SIF2_GENERATE_HUD_ICON) /*&& !digitus_improbus*/) {
if ( sip->shield_icon_index == 255 && !(sip->flags2 & SIF2_GENERATE_HUD_ICON) /*&& !digitus_improbus*/) {
return;
}
+22 -21
View File
@@ -1094,7 +1094,7 @@ typedef struct homing_beep_info
float precalced_interp; // a precalculated value used in a linear interpretation
} homing_beep_info;
homing_beep_info Homing_beep = { -1, 0, 150, 1000, 30.0f, 1500.0f };
homing_beep_info Homing_beep = { -1, 0, 150, 1000, 30.0f, 1500.0f, 1.729412f };
// Set at the start of a mission, used to decide how to draw the separation for the warning missile indicators
float Min_warning_missile_dist;
@@ -4449,7 +4449,7 @@ int hud_get_best_primary_bank(float *range)
//
// Called by the draw lead indicator code to predict where the enemy is going to be
//
void polish_predicted_target_pos(object *targetp, vec3d *enemy_pos, vec3d *predicted_enemy_pos, float dist_to_enemy, vec3d *last_delta_vec, int num_polish_steps)
void polish_predicted_target_pos(weapon_info *wip, object *targetp, vec3d *enemy_pos, vec3d *predicted_enemy_pos, float dist_to_enemy, vec3d *last_delta_vec, int num_polish_steps)
{
int iteration;
vec3d player_pos = Player_obj->pos;
@@ -4458,8 +4458,8 @@ void polish_predicted_target_pos(object *targetp, vec3d *enemy_pos, vec3d *predi
ship *shipp;
shipp = &Ships[Player_obj->instance];
Assert(shipp->weapons.current_primary_bank < shipp->weapons.num_primary_banks);
weapon_info *wip = &Weapon_info[shipp->weapons.primary_bank_weapons[shipp->weapons.current_primary_bank]];
// Assert(shipp->weapons.current_primary_bank < shipp->weapons.num_primary_banks);
// weapon_info *wip = &Weapon_info[shipp->weapons.primary_bank_weapons[shipp->weapons.current_primary_bank]];
float weapon_speed = wip->max_speed;
@@ -4598,12 +4598,9 @@ void hud_show_lead_indicator(vec3d *target_world_pos)
{
int bank = swp->current_secondary_bank;
tmp = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( tmp->wi_flags & WIF_LOCKED_HOMING )
{
if ( !Player->target_in_lock_cone )
{
srange = -1.0f;
}
if ( !(tmp->wi_flags & WIF_HOMING) && !(tmp->wi_flags & WIF_LOCKED_HOMING && Player->target_in_lock_cone) ) {
//The secondary lead indicator is handled farther below if it is a non-locking type
srange = -1.0f;
}
}
@@ -4661,13 +4658,13 @@ void hud_show_lead_indicator(vec3d *target_world_pos)
Players[Player_num].lead_indicator_active = 1;
// test if the target is moving at all
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f) // Find distance!
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f && !(The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) ) // Find distance!
Players[Player_num].lead_target_pos = *target_world_pos;
else {
vm_vec_normalize(&target_moving_direction);
vm_vec_scale(&target_moving_direction,target_moved_dist);
vm_vec_add(&Players[Player_num].lead_target_pos, target_world_pos, &target_moving_direction );
polish_predicted_target_pos(targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
polish_predicted_target_pos(wip, targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
}
g3_rotate_vertex(&lead_target_vertex,&Players[Player_num].lead_target_pos);
@@ -4730,13 +4727,13 @@ void hud_show_lead_indicator(vec3d *target_world_pos)
Players[Player_num].lead_indicator_active = 1;
// test if the target is moving at all
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f) // Find distance!
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f && !(The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) ) // Find distance!
Players[Player_num].lead_target_pos = *target_world_pos;
else {
vm_vec_normalize(&target_moving_direction);
vm_vec_scale(&target_moving_direction,target_moved_dist);
vm_vec_add(&Players[Player_num].lead_target_pos, target_world_pos, &target_moving_direction );
polish_predicted_target_pos(targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
polish_predicted_target_pos(wip, targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
}
g3_rotate_vertex(&lead_target_vertex,&Players[Player_num].lead_target_pos);
@@ -4778,7 +4775,6 @@ void hud_show_lead_indicator_quick(vec3d *target_world_pos, object *targetp)
polymodel *pm;
ship_weapon *swp;
weapon_info *wip;
weapon_info *tmp=NULL;
float dist_to_target, time_to_target, target_moved_dist, prange;
int bank_to_fire, indicator_frame, frame_offset;
float sx, sy;
@@ -4861,13 +4857,13 @@ void hud_show_lead_indicator_quick(vec3d *target_world_pos, object *targetp)
Players[Player_num].lead_indicator_active = 1;
// test if the target is moving at all
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f) // Find distance!
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f && !(The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) ) // Find distance!
Players[Player_num].lead_target_pos = *target_world_pos;
else {
vm_vec_normalize(&target_moving_direction);
vm_vec_scale(&target_moving_direction,target_moved_dist);
vm_vec_add(&Players[Player_num].lead_target_pos, target_world_pos, &target_moving_direction );
polish_predicted_target_pos(targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
polish_predicted_target_pos(wip, targetp, target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
vm_vec_add2(&Players[Player_num].lead_target_pos, rel_pos );
}
@@ -5079,7 +5075,7 @@ void hud_target_change_check()
//
// draws the offscreen target indicator
//
void hud_draw_offscreen_indicator(vertex* target_point, vec3d *tpos, float distance)
void hud_draw_offscreen_indicator(vertex* target_point, vec3d *tpos, float distance, int draw_solid)
{
char buf[32];
int w = 0, h = 0;
@@ -5327,8 +5323,13 @@ void hud_draw_offscreen_indicator(vertex* target_point, vec3d *tpos, float dista
}
}
hud_tri(x3,y3,x2,y2,x1,y1);
hud_tri(x4,y4,x5,y5,x6,y6);
if (draw_solid) {
hud_tri(x3,y3,x2,y2,x1,y1);
hud_tri(x4,y4,x5,y5,x6,y6);
} else {
hud_tri_empty(x3,y3,x2,y2,x1,y1);
hud_tri_empty(x4,y4,x5,y5,x6,y6);
}
if (on_right || on_bottom){
gr_line(fl2i(x2),fl2i(y2),fl2i(x5),fl2i(y5));
} else if (on_left) {
@@ -5631,7 +5632,7 @@ void hud_maybe_flash_weapon(int index)
}
// render the coutermeasure HUD gauge
void hud_show_cmeasure_gague()
void hud_show_cmeasure_gauge()
{
if ( Cmeasure_gauge.first_frame == -1) {
Int3(); // failed to load coutermeasure gauge background
+6 -5
View File
@@ -329,6 +329,7 @@
struct ship;
struct ship_subsys;
struct object;
struct weapon_info;
#define INCREASING 0
#define DECREASING 1
@@ -344,7 +345,7 @@ struct object;
// structure and defines used for hotkey targeting
//WMC - bumped from 50 to 150; 10/24/2005
#define MAX_HOTKEY_TARGET_ITEMS 150 // maximum number of ships that can be targeted on *all* keys
#define SELECTION_SET 0x5000 // variable used for drawing brackets. The bracketinng code uses
#define SELECTION_SET 0x5000 // variable used for drawing brackets. The bracketing code uses
// TEAM_* values. I picked this value to be totally out of that
// range. Only used for drawing selection sets
#define MESSAGE_SENDER 0x5001 // variable used for drawing brackets around a message sender.
@@ -391,7 +392,7 @@ void hud_target_missile(object *source_obj, int next_flag);
void hud_target_next_list(int hostile=1, int next_flag=1);
int hud_target_closest_repair_ship(int goal_objnum=-1);
void hud_target_auto_target_next();
void hud_show_remote_detonate_missile();
void hud_show_remote_detonate_missile();
void hud_target_uninspected_object(int next_flag);
void hud_target_newest_ship();
@@ -423,9 +424,9 @@ void hud_show_weapons();
void hud_start_flash_weapon(int index);
void hud_show_auto_icons();
void hud_show_weapon_energy_gauge();
void hud_show_cmeasure_gague();
void hud_show_cmeasure_gauge();
void hud_show_brackets(object *targetp, vertex *projected_v);
void hud_draw_offscreen_indicator(vertex* target_point, vec3d *tpos, float distance=0.0f);
void hud_draw_offscreen_indicator(vertex* target_point, vec3d *tpos, float distance=0.0f, int draw_solid=1);
void hud_show_homing_missiles(void);
int hud_sensors_ok(ship *sp, int show_msg = 1);
@@ -454,6 +455,6 @@ void hud_tri_empty(float x1,float y1,float x2,float y2,float x3,float y3);
float hud_find_target_distance( object *targetee, object *targeter );
extern void polish_predicted_target_pos(object *targetp, vec3d *enemy_pos, vec3d *predicted_enemy_pos, float dist_to_enemy, vec3d *last_delta_vec, int num_polish_steps);
extern void polish_predicted_target_pos(weapon_info *wip, object *targetp, vec3d *enemy_pos, vec3d *predicted_enemy_pos, float dist_to_enemy, vec3d *last_delta_vec, int num_polish_steps);
#endif
+16 -12
View File
@@ -952,7 +952,8 @@ void hud_targetbox_show_extra_ship_info(ship *target_shipp, object *target_objp)
if ( not_training && (hud_gauge_active(HUD_TARGET_MONITOR_EXTRA_DATA)) && (Targetbox_show_extra_info) ) {
// Print out current orders if the targeted ship is friendly
// AL 12-26-97: only show orders and time to target for friendly ships
if ( (Player_ship->team == target_shipp->team) && !(ship_get_SIF(target_shipp) & SIF_NOT_FLYABLE) ) {
// Backslash: actually let's consult the IFF table. Maybe we want to show orders for certain teams, or hide orders for friendlies
if ( ((Player_ship->team == target_shipp->team) || ((Iff_info[target_shipp->team].flags & IFFF_ORDERS_SHOWN) && !(Iff_info[target_shipp->team].flags & IFFF_ORDERS_HIDDEN)) ) && !(ship_get_SIF(target_shipp) & SIF_NOT_FLYABLE) ) {
extra_data_shown=1;
if ( ship_return_orders(outstr, target_shipp) ) {
gr_force_fit_string(outstr, 255, 162);
@@ -1050,6 +1051,9 @@ void hud_render_target_jump_node(object *target_objp)
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, target_objp->jnp->get_name_ptr());
dist = vm_vec_dist_quick(&target_objp->pos, &Player_obj->pos);
if ( Hud_unit_multiplier > 0.0f ) { // use a different displayed distance scale
dist = dist * Hud_unit_multiplier;
}
// account for hud shaking
hx = fl2i(HUD_offset_x);
@@ -1218,15 +1222,15 @@ void hud_render_target_ship_info(object *target_objp)
target_shipp = &Ships[target_objp->instance];
target_sip = &Ship_info[target_shipp->ship_info_index];
if (Cmdline_wcsaga &&
(target_shipp->wingnum != -1) &&
(target_shipp->team != Player_ship->team))
{
// if (Cmdline_wcsaga &&
// (target_shipp->wingnum != -1) &&
// (target_shipp->team != Player_ship->team))
// Backslash - Instead of rely on command line, let's use a flag in Iff_defs.tbl
if ( (Iff_info[target_shipp->team].flags & IFFF_WING_NAME_HIDDEN) && (target_shipp->wingnum != -1) ) {
strcpy( outstr, "");
}
else
{
} else {
strcpy( outstr, target_shipp->ship_name );
end_string_at_first_hash_symbol(outstr);
}
if ( hud_gauge_maybe_flash(HUD_TARGET_MONITOR) == 1 ) {
@@ -1250,12 +1254,12 @@ void hud_render_target_ship_info(object *target_objp)
char temp_name[NAME_LENGTH+2] = "";
// if this ship has an alternate type name
if(target_shipp->alt_type_index >= 0){
if (target_shipp->alt_type_index >= 0) {
mission_parse_lookup_alt_index(target_shipp->alt_type_index, temp_name);
} else {
strcpy(temp_name, Ship_info[target_shipp->ship_info_index].name);
end_string_at_first_hash_symbol(temp_name);
strcpy(temp_name, Ship_info[target_shipp->ship_info_index].name);
}
end_string_at_first_hash_symbol(temp_name);
if (Lcl_gr) {
lcl_translate_targetbox_name(temp_name);
@@ -1421,7 +1425,7 @@ void hud_blit_target_integrity(int disabled,int force_obj_num)
}
}
// determine if the subsystem is in line-of sight, without taking into accout whether the player ship is
// determine if the subsystem is in line-of sight, without taking into account whether the player ship is
// facing the subsystem
int hud_targetbox_subsystem_in_view(object *target_objp, int *sx, int *sy)
{
+6
View File
@@ -268,6 +268,12 @@ void iff_init()
iff->flags |= IFFF_SUPPORT_ALLOWED;
else if (!stricmp(NOX("exempt from all teams at war"), flag_strings[i]))
iff->flags |= IFFF_EXEMPT_FROM_ALL_TEAMS_AT_WAR;
else if (!stricmp(NOX("orders hidden"), flag_strings[i]))
iff->flags |= IFFF_ORDERS_HIDDEN;
else if (!stricmp(NOX("orders shown"), flag_strings[i]))
iff->flags |= IFFF_ORDERS_SHOWN;
else if (!stricmp(NOX("wing name hidden"), flag_strings[i]))
iff->flags |= IFFF_WING_NAME_HIDDEN;
else
Warning(LOCATION, "Bogus string in iff flags: %s\n", flag_strings[i]);
}
+4 -1
View File
@@ -55,7 +55,10 @@
// iff flags
#define IFFF_SUPPORT_ALLOWED (1 << 0) // this IFF can call for support
#define IFFF_EXEMPT_FROM_ALL_TEAMS_AT_WAR (1 << 1) // self-explanatory
#define MAX_IFF_FLAGS 2
#define IFFF_ORDERS_HIDDEN (1 << 2) // the HUD will not show a targeted ship's orders
#define IFFF_ORDERS_SHOWN (1 << 3) // the HUD will show a targeted ship's orders (friendly has by default)
#define IFFF_WING_NAME_HIDDEN (1 << 4) // the HUD will not show a targeted ship's name if it is in a wing
#define MAX_IFF_FLAGS 5
// Goober5000
typedef struct iff_info {
+6 -2
View File
@@ -661,9 +661,13 @@ float key_down_timef(uint scancode)
uint time_down, time;
uint delta_time;
if ( !key_inited ) return 0.0f;
if ( !key_inited ) {
return 0.0f;
}
if ((scancode<0)|| (scancode>=NUM_KEYS)) return 0.0f;
if (scancode >= NUM_KEYS) {
return 0.0f;
}
ENTER_CRITICAL_SECTION( key_lock );
+45 -32
View File
@@ -2354,7 +2354,49 @@ int button_function_critical(int n, net_player *p = NULL)
return 0;
}
switch (n) {
switch (n) {
// cycle to next primary weapon
case CYCLE_NEXT_PRIMARY:
if (at_self) {
control_used(CYCLE_NEXT_PRIMARY);
}
hud_gauge_popup_start(HUD_WEAPONS_GAUGE);
if (ship_select_next_primary(Player_obj, CYCLE_PRIMARY_NEXT)) {
ship* shipp = &Ships[objp->instance];
if ( timestamp_elapsed(shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank]) ) {
shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank] = timestamp(250); // 1/4 second delay until can fire
}
// multiplayer server should maintain bank/link status here
if ( (Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) ) {
Assert(npl != NULL);
multi_server_update_player_weapons(npl,shipp);
}
}
break;
// cycle to previous primary weapon
case CYCLE_PREV_PRIMARY:
if (at_self) {
control_used(CYCLE_PREV_PRIMARY);
}
hud_gauge_popup_start(HUD_WEAPONS_GAUGE);
if (ship_select_next_primary(objp, CYCLE_PRIMARY_PREV)) {
ship* shipp = &Ships[objp->instance];
if ( timestamp_elapsed(shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank]) ) {
shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank] = timestamp(250); // 1/4 second delay until can fire
}
// multiplayer server should maintain bank/link status here
if ( (Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) ) {
Assert(npl != NULL);
multi_server_update_player_weapons(npl,shipp);
}
}
break;
// cycle to next secondary weapon
case CYCLE_SECONDARY:
if(at_self)
@@ -2821,41 +2863,12 @@ int button_function(int n)
switch (n) {
// cycle to next primary weapon
case CYCLE_NEXT_PRIMARY:
// bogus?
if((Player_obj == NULL) || (Player_ship == NULL)){
break;
}
hud_gauge_popup_start(HUD_WEAPONS_GAUGE);
if (ship_select_next_primary(Player_obj, CYCLE_PRIMARY_NEXT)) {
ship* shipp = Player_ship;
shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank] = timestamp(250); // 1/4 second delay until can fire
// multiplayer server should maintain bank/link status here
// if((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_AM_MASTER)){
// Assert(npl != NULL);
// multi_server_update_player_weapons(npl,shipp);
// }
}
return button_function_critical(CYCLE_NEXT_PRIMARY);
break;
// cycle to previous primary weapon
case CYCLE_PREV_PRIMARY:
// bogus?
if((Player_obj == NULL) || (Player_ship == NULL)){
break;
}
hud_gauge_popup_start(HUD_WEAPONS_GAUGE);
if (ship_select_next_primary(Player_obj, CYCLE_PRIMARY_PREV)) {
ship* shipp = Player_ship;
shipp->weapons.next_primary_fire_stamp[shipp->weapons.current_primary_bank] = timestamp(250); // 1/4 second delay until can fire
// multiplayer server should maintain bank/link status here
// if((Game_mode & GM_MULTIPLAYER) && (Net_player->flags & NETINFO_FLAG_AM_MASTER)){
// Assert(npl != NULL);
// multi_server_update_player_weapons(npl,shipp);
// }
}
return button_function_critical(CYCLE_PREV_PRIMARY);
break;
// cycle to next secondary weapon
+1 -1
View File
@@ -126,7 +126,7 @@ public:
//Setting
void set_alphacolor(int r, int g, int b, int alpha);
void set_model(char *model_name, bool show_polys=false);
void show(bool show){if(show){m_flags&=~JN_HIDE;}else{m_flags|=JN_HIDE;}}
void show(bool enabled){if(enabled){m_flags&=~JN_HIDE;}else{m_flags|=JN_HIDE;}}
//Rendering
void render(vec3d *pos, vec3d *view_pos = NULL);
+2
View File
@@ -233,6 +233,7 @@
#include "globalincs/alphacolors.h"
#include "weapon/beam.h"
#include "iff_defs/iff_defs.h"
#include "parse/parselo.h"
static int Key_sets[MAX_KEYED_TARGETS] = {
@@ -1464,6 +1465,7 @@ void mission_hotkey_do_frame(float frametime)
// draw ship/wing name
strcpy(buf, Hotkey_lines[line].label);
end_string_at_first_hash_symbol(buf);
if (Hotkey_lines[line].type == HOTKEY_LINE_SUBSHIP) {
// indent
gr_force_fit_string(buf, 255, Hotkey_list_coords[gr_screen.res][0] + Hotkey_list_coords[gr_screen.res][2] - (Hotkey_ship_x[gr_screen.res]+20));
+1 -1
View File
@@ -299,7 +299,7 @@ int mission_load(char *filename_ext)
mprintf(("MISSION LOAD: '%s'\n", filename_ext));
strncpy(filename, filename_ext, 127);
ext = strchr(filename, '.');
ext = strrchr(filename, '.');
if (ext) {
mprintf(( "Hmmm... Extension passed to mission_load...\n" ));
*ext = 0; // remove any extension!
+1
View File
@@ -1060,6 +1060,7 @@ void mission_log_scrollback(int line, int list_x, int list_y, int list_w, int li
else
gr_force_fit_string(buf, 256, list_w - seg->x);
end_string_at_first_hash_symbol(buf);
gr_string(list_x + seg->x, list_y + y, buf);
// possibly "print" some symbols for interesting log entries
+22 -16
View File
@@ -796,7 +796,7 @@ char *Persona_type_names[MAX_PERSONA_TYPES] =
//XSTR:ON
};
int Command_persona;
int Default_command_persona;
///////////////////////////////////////////////////////////////////
// used to distort incoming messages when comms are damaged
@@ -870,10 +870,10 @@ void persona_parse()
Personas[Num_personas].flags |= (1<<i);
// save the Terran Command persona in a global
// save the Command persona in a global
if ( Personas[Num_personas].flags & PERSONA_FLAG_COMMAND ) {
// Assert ( Command_persona == -1 );
Command_persona = Num_personas;
if (Default_command_persona < 0)
Default_command_persona = Num_personas;
}
break;
@@ -1091,7 +1091,7 @@ void messages_init()
static int table_read = 0;
if ( !table_read ) {
Command_persona = -1;
Default_command_persona = -1;
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "messages.tbl", rval));
@@ -1604,7 +1604,7 @@ void message_play_anim( message_q *q )
// attached to it. Deal with munging the name
// support ships use a wingman head.
// terran command uses it's own set of heads.
// terran command uses its own set of heads.
int subhead_selected = FALSE;
if ( (q->message_num < Num_builtin_messages) || !(_strnicmp(HEAD_PREFIX_STRING, ani_name, strlen(HEAD_PREFIX_STRING)-1)) ) {
persona_index = m->persona_index;
@@ -1612,7 +1612,7 @@ void message_play_anim( message_q *q )
// if this ani should be converted to a terran command, set the persona to the command persona
// so the correct head plays.
if ( q->flags & MQF_CONVERT_TO_COMMAND ) {
persona_index = Command_persona;
persona_index = The_mission.command_persona;
strcpy( ani_name, COMMAND_HEAD_PREFIX );
}
@@ -2071,7 +2071,7 @@ void message_queue_message( int message_num, int priority, int timing, char *who
// to this message, then set a bit to tell the wave/anim playing code to play the command version
// of the wave and head
MessageQ[i].flags = 0;
if ( !stricmp(who_from, TERRAN_COMMAND) && (m_persona != -1) && (Personas[m_persona].flags & PERSONA_FLAG_WINGMAN) ) {
if ( !stricmp(who_from, The_mission.command_sender) && (m_persona != -1) && (Personas[m_persona].flags & PERSONA_FLAG_WINGMAN) ) {
MessageQ[i].flags |= MQF_CONVERT_TO_COMMAND;
MessageQ[i].source = HUD_SOURCE_TERRAN_CMD;
}
@@ -2239,7 +2239,7 @@ void message_send_unique_to_player( char *id, void *data, int m_source, int prio
// if the ship is NULL and special_who is not NULL, then this is from special_who
// otherwise, message is from ship.
if ( m_source == MESSAGE_SOURCE_COMMAND ) {
who_from = TERRAN_COMMAND;
who_from = The_mission.command_sender;
source = HUD_SOURCE_TERRAN_CMD;
} else if ( m_source == MESSAGE_SOURCE_SPECIAL ) {
who_from = (char *)data;
@@ -2260,7 +2260,7 @@ void message_send_unique_to_player( char *id, void *data, int m_source, int prio
// if the ship_index is -1, then make the message come from Terran command
if ( ship_index == -1 ) {
who_from = TERRAN_COMMAND;
who_from = The_mission.command_sender;
source = HUD_SOURCE_TERRAN_CMD;
} else {
who_from = Ships[ship_index].ship_name;
@@ -2335,7 +2335,7 @@ void message_send_builtin_to_player( int type, ship *shipp, int priority, int ti
// be sure that this ship can actually send a message!!! (i.e. not-not-flyable -- get it!)
Assert( !(Ship_info[shipp->ship_info_index].flags & SIF_NOT_FLYABLE) ); // get allender or alan
} else {
persona_index = Command_persona; // use the terran command persona
persona_index = The_mission.command_persona; // use the terran command persona
}
// try to find a builtin message with the given type for the given persona
@@ -2359,17 +2359,23 @@ void message_send_builtin_to_player( int type, ship *shipp, int priority, int ti
}
// get who this message is from -- kind of a hack since we assume Terran Command in the
// absense of a ship. This will be fixed later
// absence of a ship. This will be fixed later
if ( shipp ) {
source = HUD_team_get_source( shipp->team );
who_from = shipp->ship_name;
source = HUD_team_get_source( shipp->team );
} else {
source = HUD_SOURCE_TERRAN_CMD;
who_from = TERRAN_COMMAND;
who_from = The_mission.command_sender;
// Goober5000 - if Command is a ship that is present, change the source accordingly
int shipnum = ship_name_lookup(who_from);
if (shipnum >= 0)
source = HUD_team_get_source( Ships[shipnum].team );
else
source = HUD_SOURCE_TERRAN_CMD;
}
// maybe change the who from here for special rearm cases (always seems like that is the case :-) )
if ( !stricmp(who_from, TERRAN_COMMAND) && (type == MESSAGE_REARM_ON_WAY) ){
if ( !stricmp(who_from, The_mission.command_sender) && (type == MESSAGE_REARM_ON_WAY) ){
who_from = SUPPORT_NAME;
}
+3 -2
View File
@@ -268,7 +268,7 @@
struct ship;
#define MAX_MISSION_MESSAGES 500
#define MAX_MISSION_MESSAGES 1000
//Bumped to 500 from 300 06/15/2004 -C
// keep seperate lists of AVI's and wav files. I suspect that many messages will have
@@ -306,7 +306,7 @@ extern message_extra Message_waves[MAX_MESSAGE_WAVES];
#define MESSAGE_SOURCE_SPECIAL 4
// define used for sender of a message when you want it to be Terran Command
#define TERRAN_COMMAND "Command"
#define DEFAULT_COMMAND "Command"
// defines for message id's used in FreeSpace code. Callers to message_send_to_player() should
// probably use these defines.
@@ -408,6 +408,7 @@ typedef struct persona_s {
extern Persona *Personas;
extern int Num_personas;
extern int Default_command_persona;
// function to parse a message from either messages.tbl or the mission file. Both files have the
// exact same format, so this function just gets reused in both instances.
+78 -16
View File
@@ -1701,7 +1701,7 @@ void parse_mission_info(mission *pm, bool basic = false)
//
// NOTE: this can be dangerous so be sure that any get_mission_info() call (defaults to basic info) will
// only reference data parsed before this point!! (like current FRED2 and game code does)
if (basic == true)
if (basic)
return;
@@ -1811,6 +1811,7 @@ void parse_mission_info(mission *pm, bool basic = false)
}
}
// wing stuff by Goober5000 ------------------------------------------
// the wing name arrays are initialized in ship_level_init
if (optional_string("$Starting wing names:"))
@@ -1835,6 +1836,7 @@ void parse_mission_info(mission *pm, bool basic = false)
}
// end of wing stuff -------------------------------------------------
// set up the Num_teams variable accoriding to the game_type variable'
Num_teams = 1; // assume 1
@@ -3811,10 +3813,28 @@ int parse_object(mission *pm, int flag, p_object *p_objp)
if (optional_string("+Group:"))
stuff_int(&p_objp->group);
if (optional_string("+Score:"))
stuff_int(&p_objp->score);
else
bool table_score = false;
if (optional_string("+Use Table Score:")) {
table_score = true;
}
if (optional_string("+Score:")) {
if (!table_score) {
stuff_int(&p_objp->score);
}
// throw away the value the mission file has and use the table value.
else {
int temp_score;
stuff_int(&temp_score);
}
}
else {
table_score = true;
}
if (table_score) {
p_objp->score = Ship_info[p_objp->ship_class].score;
}
// parse the persona index if present
p_objp->persona_index = -1;
@@ -4111,8 +4131,8 @@ void swap_parse_object(p_object *p_obj, int new_ship_class)
Assert (p_obj->ship_max_hull_strength > 0);
Assert (old_ship_info->max_hull_strength > 0);
float hp_multiplier = p_obj->ship_max_hull_strength / i2fl(old_ship_info->max_hull_strength);
p_obj->ship_max_hull_strength = fl2i(new_ship_info->max_hull_strength * hp_multiplier);
float hp_multiplier = p_obj->ship_max_hull_strength / old_ship_info->max_hull_strength;
p_obj->ship_max_hull_strength = new_ship_info->max_hull_strength * hp_multiplier;
// Shields
@@ -4383,6 +4403,8 @@ int parse_wing_create_ships( wing *wingp, int num_to_create, int force, int spec
if (p_objp->wingnum != wingnum)
continue;
Assert( (p_objp->pos_in_wing >= 0) && (p_objp->pos_in_wing < MAX_SHIPS_PER_WING) );
// when ingame joining, we need to create a specific ship out of the list of ships for a
// wing. specific_instance is a 0 based integer which specified which ship in the wing
// to create. So, only create the ship we actually need to.
@@ -4434,16 +4456,10 @@ int parse_wing_create_ships( wing *wingp, int num_to_create, int force, int spec
aip->ai_flags |= AIF_NO_DYNAMIC;
// update housekeeping variables
wingp->ship_index[wingp->current_count] = Objects[objnum].instance;
// since wing order and object order aren't necessarily the same thing
// be sure to reset the special ship to the correct ship_index[] offset
if (p_objp->special_ship) {
wingp->special_ship = wingp->current_count;
}
wingp->ship_index[p_objp->pos_in_wing] = Objects[objnum].instance;
// set up wingman status index
hud_wingman_status_set_index(wingp->ship_index[wingp->current_count]);
hud_wingman_status_set_index(wingp->ship_index[p_objp->pos_in_wing]);
p_objp->wing_status_wing_index = Ships[Objects[objnum].instance].wing_status_wing_index;
p_objp->wing_status_wing_pos = Ships[Objects[objnum].instance].wing_status_wing_pos;
@@ -4497,6 +4513,24 @@ int parse_wing_create_ships( wing *wingp, int num_to_create, int force, int spec
// we should always have enough ships in the list!!!
Assert (num_to_create == 0);
// wing current_count needs to match the end of the ship_index[] list, but there
// is a very off chance it could have holes in it, so make sure to compact the list
for (i = 0; i < (MAX_SHIPS_PER_WING-1); i++) {
if (wingp->ship_index[i] == -1) {
j = i;
while ( j < (MAX_SHIPS_PER_WING-1) ) {
wingp->ship_index[j] = wingp->ship_index[j+1];
// update "special" ship too
if (wingp->special_ship == j+1) {
wingp->special_ship--;
}
j++;
}
}
}
// possibly play some event driven music here. Send a network packet indicating the wing was
// created. Only do this stuff if actually in the mission.
if ( (objnum != -1) && (Game_mode & GM_IN_MISSION) ) { // if true, we have created at least one new ship.
@@ -4861,7 +4895,6 @@ void parse_wing(mission *pm)
p_objp->wingnum = wingnum;
p_objp->pos_in_wing = i;
p_objp->special_ship = (i == wingp->special_ship) ? true : false;
assigned++;
}
@@ -5237,6 +5270,35 @@ void parse_messages(mission *pm, int flags)
{
required_string("#Messages");
// command stuff by Goober5000 ---------------------------------------
strcpy(pm->command_sender, DEFAULT_COMMAND);
if (optional_string("$Command Sender:"))
{
char temp[NAME_LENGTH];
stuff_string(temp, F_NAME, NAME_LENGTH);
if (*temp == '#')
strcpy(pm->command_sender, &temp[1]);
else
strcpy(pm->command_sender, temp);
}
pm->command_persona = Default_command_persona;
if (optional_string("$Command Persona:"))
{
int idx;
char temp[NAME_LENGTH];
stuff_string(temp, F_NAME, NAME_LENGTH);
idx = message_persona_name_lookup(temp);
if (idx >= 0)
pm->command_persona = idx;
else
Warning(LOCATION, "Supplied Command Persona is invalid! Defaulting to %s.", Personas[Default_command_persona].name);
}
// end of command stuff ----------------------------------------------
mprintf(("Starting mission message count : %d\n", Num_message_waves));
// the message_parse function can be found in MissionMessage.h. The format in the
@@ -6062,7 +6124,7 @@ int get_mission_info(char *filename, mission *mission_p, bool basic)
{
char real_fname[MAX_FILENAME_LEN];
strcpy(real_fname, filename);
char *p = strchr(real_fname, '.');
char *p = strrchr(real_fname, '.');
if (p) *p = 0; // remove any extension
strcat(real_fname, FS_MISSION_FILE_EXT); // append mission extension
+4 -1
View File
@@ -692,6 +692,10 @@ typedef struct mission {
int contrail_threshold;
int ambient_light_level;
// Goober5000
int command_persona;
char command_sender[NAME_LENGTH];
// Goober5000
char event_music_name[NAME_LENGTH];
char briefing_music_name[NAME_LENGTH];
@@ -862,7 +866,6 @@ typedef struct p_object {
int wingnum; // set to -1 if not in a wing -- Wing array index otherwise
int pos_in_wing; // Goober5000 - needed for FRED with the new way things work
bool special_ship; // what "$Special Ship:" actually points to in the wing array (for later cleanup)
int flags; // mission savable flags
int flags2; // Goober5000
+1
View File
@@ -765,6 +765,7 @@ typedef struct submodel_instance_info {
#define MSS_FLAG_CARRY_NO_DAMAGE (1 << 9) // WMC
#define MSS_FLAG_USE_MULTIPLE_GUNS (1 << 10) // WMC
#define MSS_FLAG_FIRE_ON_NORMAL (1 << 11) // forces a turret to fire down its normal vecs
#define MSS_FLAG_TURRET_HULL_CHECK (1 << 12) // makes the turret check to see if it's going to shoot through it's own hull before fireing - Bobboau
// definition of stepped rotation struct
typedef struct stepped_rotation {
+5 -5
View File
@@ -156,7 +156,7 @@ triggered_rotation::~triggered_rotation()
{
}
void triggered_rotation::add_queue(queued_animation *the_queue, int direction)
void triggered_rotation::add_queue(queued_animation *the_queue, int dir)
{
int i;
queued_animation new_queue;
@@ -164,7 +164,7 @@ void triggered_rotation::add_queue(queued_animation *the_queue, int direction)
memcpy( &new_queue, the_queue, sizeof(queued_animation) );
if (direction == -1) {
if (dir == -1) {
new_queue.start = new_queue.reverse_start;
vm_vec_negate( &new_queue.angle );
}
@@ -208,9 +208,9 @@ void triggered_rotation::add_queue(queued_animation *the_queue, int direction)
if (new_queue.instance == instance) {
// same animation is playing that we are about to think about playing some point in the future
if ( (this->direction.xyz.x * rot_vel.xyz.x) == new_queue.vel.xyz.x &&
(this->direction.xyz.y * rot_vel.xyz.y) == new_queue.vel.xyz.y &&
(this->direction.xyz.z * rot_vel.xyz.z) == new_queue.vel.xyz.z)
if ( (direction.xyz.x * rot_vel.xyz.x) == new_queue.vel.xyz.x &&
(direction.xyz.y * rot_vel.xyz.y) == new_queue.vel.xyz.y &&
(direction.xyz.z * rot_vel.xyz.z) == new_queue.vel.xyz.z)
{
// they're going in opposite directions, one of them is a reversal!
// so this means thata there is some sort of delay that's getting fubared becase of other queue items getting removed due to reversal
+1 -1
View File
@@ -113,7 +113,7 @@ class triggered_rotation
void start(queued_animation *q);
void set_to_end(queued_animation *q);
void add_queue(queued_animation *new_queue, int direction);
void add_queue(queued_animation *new_queue, int dir);
void process_queue();
vec3d current_ang;
+35 -18
View File
@@ -4718,9 +4718,7 @@ void model_really_render(int model_num, matrix *orient, vec3d * pos, uint flags,
vec3d pnt = gpt->pnt;
vec3d norm = gpt->norm;
if (bank->submodel_parent > 0) { //this is were it rotates for the submodel parent-Bobboau
matrix m;
if (bank->submodel_parent > 0) { //this is where it rotates for the submodel parent-Bobboau
if (pm->submodel[bank->submodel_parent].blown_off)
continue;
@@ -4740,14 +4738,15 @@ void model_really_render(int model_num, matrix *orient, vec3d * pos, uint flags,
matrix inv_orientation;
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[bank->submodel_parent].orientation);
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
matrix submodel_matrix;
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);
vec3d offset = pm->submodel[bank->submodel_parent].offset;
vm_vec_sub(&pnt, &pnt, &offset);
vec3d p = pnt;
vec3d n = norm;
vm_vec_rotate(&pnt, &p, &m);
vm_vec_rotate(&norm, &n, &m);
vm_vec_rotate(&pnt, &p, &submodel_matrix);
vm_vec_rotate(&norm, &n, &submodel_matrix);
vm_vec_add2(&pnt, &offset);
}
@@ -4884,7 +4883,7 @@ void model_really_render(int model_num, matrix *orient, vec3d * pos, uint flags,
vm_vec_zero(&controle_rotval);
cull = gr_set_cull(0);
cull = gr_set_cull(0);
// Draw the thruster subobjects
if (is_outlines_only_htl) {
@@ -6187,20 +6186,38 @@ void model_render_children_buffers(bsp_info *model, polymodel *pm, int mn, int d
return;
}
if (model->gun_rotation) {
if (pm->gun_submodel_rotation > PI2 )
pm->gun_submodel_rotation -= PI2;
else if (pm->gun_submodel_rotation < 0.0f )
pm->gun_submodel_rotation += PI2;
angles ang = pm->submodel[mn].angs;
ang.b += pm->gun_submodel_rotation;
// Get submodel rotation data and use submodel orientation matrix
// to put together a matrix describing the final orientation of
// the submodel relative to its parent
angles ang = pm->submodel[mn].angs;
g3_start_instance_angles(&pm->submodel[mn].offset, &ang);
} else {
g3_start_instance_angles(&pm->submodel[mn].offset, &pm->submodel[mn].angs);
// Add barrel rotation if needed
if (model->gun_rotation) {
if ( pm->gun_submodel_rotation > PI2 ) {
pm->gun_submodel_rotation -= PI2;
} else if ( pm->gun_submodel_rotation < 0.0f ) {
pm->gun_submodel_rotation += PI2;
}
ang.b += pm->gun_submodel_rotation;
}
// Compute final submodel orientation by using the orientation matrix
// and the rotation angles.
// By using this kind of computation, the rotational angles can always
// be computed relative to the submodel itself, instead of relative
// to the parent
matrix rotation_matrix = model->orientation;
vm_rotate_matrix_by_angles(&rotation_matrix, &ang);
matrix inv_orientation;
vm_copy_transpose_matrix(&inv_orientation, &model->orientation);
matrix submodel_matrix;
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);
g3_start_instance_matrix(&pm->submodel[mn].offset, &submodel_matrix, true);
if ( !(Interp_flags & MR_NO_LIGHTING) )
light_rotate_all();
+15 -10
View File
@@ -3038,6 +3038,11 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
case ID_PATH:
pm->n_paths = cfread_int( fp );
if (pm->n_paths <= 0) {
break;
}
pm->paths = (model_path *)vm_malloc(sizeof(model_path)*pm->n_paths);
Assert( pm->paths != NULL );
@@ -3670,6 +3675,8 @@ void model_maybe_fixup_subsys_path(polymodel *pm, int path_num)
float dist;
int index_1, index_2;
Assert( (path_num >= 0) && (path_num < pm->n_paths) );
model_path *mp;
mp = &pm->paths[path_num];
@@ -5405,13 +5412,13 @@ void swap_bsp_data( polymodel * pm, void *model_ptr )
void swap_sldc_data(ubyte *buffer)
{
#if BYTE_ORDER == BIG_ENDIAN
char *type_p = (char *)(Mc_pm->shield_collision_tree+offset);
int *size_p = (int *)(Mc_pm->shield_collision_tree+offset+1);
char *type_p = (char *)(buffer);
int *size_p = (int *)(buffer+1);
*size_p = INTEL_INT(*size_p);
// split and polygons
vec3d *minbox_p = (vec3d*)(Mc_pm->shield_collision_tree+offset+5);
vec3d *maxbox_p = (vec3d*)(Mc_pm->shield_collision_tree+offset+17);
vec3d *minbox_p = (vec3d*)(buffer+5);
vec3d *maxbox_p = (vec3d*)(buffer+17);
minbox_p->xyz.x = INTEL_FLOAT(&minbox_p->xyz.x);
minbox_p->xyz.y = INTEL_FLOAT(&minbox_p->xyz.y);
@@ -5423,20 +5430,18 @@ void swap_sldc_data(ubyte *buffer)
// split
unsigned int *front_offset_p = (unsigned int*)(Mc_pm->shield_collision_tree+offset+29);
unsigned int *back_offset_p = (unsigned int*)(Mc_pm->shield_collision_tree+offset+33);
unsigned int *front_offset_p = (unsigned int*)(buffer+29);
unsigned int *back_offset_p = (unsigned int*)(buffer+33);
// polygons
unsigned int *num_polygons_p = (unsigned int*)(Mc_pm->shield_collision_tree+offset+29);
unsigned int *num_polygons_p = (unsigned int*)(buffer+29);
unsigned int *shld_polys = (unsigned int*)(Mc_pm->shield_collision_tree+offset+33);
unsigned int *shld_polys = (unsigned int*)(buffer+33);
if (*type_p == 0) // SPLIT
{
*front_offset_p = INTEL_INT(*front_offset_p);
*back_offset_p = INTEL_INT(*back_offset_p);
mc_check_sldc(buffer+*front_offset_p);
mc_check_sldc(buffer+*back_offset_p);
}
else
{
-3
View File
@@ -1497,7 +1497,6 @@ void process_ingame_ships_packet( ubyte *data, header *hinfo )
void send_ingame_ships_packet(net_player *player)
{
ml_printf("Sending SHIPS_INGAME_PACKET");
ubyte data[MAX_PACKET_SIZE];
ubyte p_type;
ship_obj *so;
@@ -2182,7 +2181,6 @@ void process_ingame_ship_request_packet(ubyte *data, header *hinfo)
void multi_ingame_send_ship_update(net_player *p)
{
ml_printf("Sending ship update -> ");
ship_obj *moveup;
// get the first object on the list
@@ -2204,7 +2202,6 @@ void multi_ingame_send_ship_update(net_player *p)
// for now, I guess we'll just send hull and shield % values
void send_ingame_ship_update_packet(net_player *p,ship *sp)
{
ml_printf("Sending INGAME_SHIP_UPDATE");
ubyte data[MAX_PACKET_SIZE];
object *objp;
int idx;
+18 -28
View File
@@ -2559,7 +2559,6 @@ struct fs2_game_update
// is used to change the current mission, current state, etc.
void send_netgame_update_packet(net_player *pl)
{
ml_printf("Sending GAME_UPDATE");
int packet_size;
int idx;
ubyte data[MAX_PACKET_SIZE];
@@ -2856,7 +2855,6 @@ void process_game_query(ubyte* data, header* hinfo)
// sends information about netplayers in the game. if called on the server, broadcasts information about _all_ players
void send_netplayer_update_packet( net_player *pl )
{
ml_printf("Sending NETPLAYER_UPDATE");
int packet_size,idx;
ubyte data[MAX_PACKET_SIZE],val;
@@ -4103,7 +4101,7 @@ void send_mission_items( net_player *pl )
// reaching a certain maximum
type = MISSION_LIST_ITEMS;
ADD_DATA( type );
for (i = 0; i < Multi_create_mission_count; i++ ) {
for (i = 0; i < (int)Multi_create_mission_list.size(); i++ ) {
stop = 0;
ADD_DATA( stop );
@@ -4132,7 +4130,7 @@ void send_mission_items( net_player *pl )
type = CAMPAIGN_LIST_ITEMS;
BUILD_HEADER(MISSION_ITEM);
ADD_DATA( type );
for (i = 0; i < Multi_create_campaign_count; i++ ) {
for (i = 0; i < (int)Multi_create_campaign_list.size(); i++ ) {
stop = 0;
ADD_DATA( stop );
@@ -4179,6 +4177,7 @@ void process_mission_item_packet(ubyte *data,header *hinfo)
char filename[MAX_FILENAME_LEN], name[NAME_LENGTH], valid_status;
ubyte stop, type,max_players;
uint respawn;
multi_create_info mcip;
Assert(gameseq_get_state() == GS_STATE_MULTI_HOST_SETUP);
offset = HEADER_LENGTH;
@@ -4198,27 +4197,24 @@ void process_mission_item_packet(ubyte *data,header *hinfo)
// STANDALONE_ONLY
GET_DATA(valid_status);
if ( Multi_create_mission_count < MULTI_CREATE_MAX_LIST_ITEMS ) {
strcpy(Multi_create_mission_list[Multi_create_mission_count].filename, filename );
strcpy(Multi_create_mission_list[Multi_create_mission_count].name, name );
Multi_create_mission_list[Multi_create_mission_count].flags = flags;
Multi_create_mission_list[Multi_create_mission_count].respawn = respawn;
Multi_create_mission_list[Multi_create_mission_count].max_players = max_players;
strcpy(mcip.filename, filename );
strcpy(mcip.name, name );
mcip.flags = flags;
mcip.respawn = respawn;
mcip.max_players = max_players;
// STANDALONE_ONLY
Multi_create_mission_list[Multi_create_mission_count].valid_status = valid_status;
// STANDALONE_ONLY
mcip.valid_status = valid_status;
Multi_create_mission_count++;
}
Multi_create_mission_list.push_back( mcip );
} else if ( type == CAMPAIGN_LIST_ITEMS ) {
if ( Multi_create_campaign_count < MULTI_CREATE_MAX_LIST_ITEMS ) {
strcpy(Multi_create_campaign_list[Multi_create_campaign_count].filename, filename );
strcpy(Multi_create_campaign_list[Multi_create_campaign_count].name, name );
Multi_create_campaign_list[Multi_create_campaign_count].flags = flags;
Multi_create_campaign_list[Multi_create_campaign_count].respawn = 0;
Multi_create_campaign_list[Multi_create_campaign_count].max_players = max_players;
Multi_create_campaign_count++;
}
strcpy(mcip.filename, filename );
strcpy(mcip.name, name );
mcip.flags = flags;
mcip.respawn = 0;
mcip.max_players = max_players;
Multi_create_campaign_list.push_back( mcip );
}
GET_DATA( stop );
@@ -4944,7 +4940,6 @@ void process_player_order_packet(ubyte *data, header *hinfo)
// would have to keep track of up to potentially 14 other ack handles (ouch).
void send_file_sig_packet(ushort sum_sig,int length_sig)
{
ml_printf("Sending FILE_SIG_INFO");
ubyte data[MAX_PACKET_SIZE];
int packet_size = 0;
@@ -5213,7 +5208,6 @@ void process_subsystem_cargo_hidden_packet( ubyte *data, header *hinfo )
void send_netplayer_load_packet(net_player *pl)
{
ml_printf("Sending LOAD_MISSION_NOW");
ubyte data[MAX_PACKET_SIZE];
int packet_size = 0;
@@ -5267,7 +5261,6 @@ void process_netplayer_load_packet(ubyte *data, header *hinfo)
void send_jump_into_mission_packet(net_player *pl)
{
ml_printf("Sending JUMP_INTO_GAME");
ubyte data[MAX_PACKET_SIZE];
int packet_size = 0;
@@ -6109,7 +6102,6 @@ void process_mission_goal_info_packet( ubyte *data, header *hinfo )
void send_player_settings_packet(net_player *p)
{
ml_printf("Sending PLAYER_SETTINGS");
ubyte data[MAX_PACKET_SIZE];
ubyte stop;
int idx;
@@ -6274,7 +6266,6 @@ void process_deny_packet(ubyte *data, header *hinfo)
// TOTAL 459 NOTE : keep this in mind when/if adding new data to this packet
void send_post_sync_data_packet(net_player *p, int std_request)
{
ml_printf("Sending POST_SYNC_DATA");
ubyte data[MAX_PACKET_SIZE], val;
char bval;
ship *shipp;
@@ -6656,7 +6647,6 @@ void process_post_sync_data_packet(ubyte *data, header *hinfo)
void send_wss_slots_data_packet(int team_num,int final,net_player *p,int std_request)
{
ml_printf("Sending WSS_SLOTS_DATA");
ubyte data[MAX_PACKET_SIZE],val;
short val_short;
int idx,i;
+333 -200
View File
@@ -683,6 +683,9 @@
#include "cfile/cfile.h"
#include "fs2netd/fs2netd_client.h"
#include <vector>
#include <algorithm>
// -------------------------------------------------------------------------------------------------------------
//
@@ -3974,21 +3977,14 @@ int Multi_create_list_max_display[GR_NUM_RESOLUTIONS] = {
};
int Multi_create_list_count; // number of items in listbox
int Multi_create_list_count;
int Multi_create_list_mode; // 0 == mission mode, 1 == campaign mode
int Multi_create_list_start; // where to start displaying from
int Multi_create_list_select; // which item is currently highlighted
int Multi_create_files_loaded;
char Multi_create_files_array[MULTI_CREATE_MAX_LIST_ITEMS][MAX_FILENAME_LEN];
int Multi_create_mission_count; // how many we have
int Multi_create_campaign_count;
multi_create_info Multi_create_mission_list[MULTI_CREATE_MAX_LIST_ITEMS];
multi_create_info Multi_create_campaign_list[MULTI_CREATE_MAX_LIST_ITEMS];
// use a pointer for the file list. Will point to either the missions or the campaigns
multi_create_info *Multi_create_file_list;
std::vector<multi_create_info> Multi_create_mission_list;
std::vector<multi_create_info> Multi_create_campaign_list;
// LOCAL function definitions
void multi_create_check_buttons();
@@ -4024,15 +4020,69 @@ int Multi_create_should_show_popup = 0;
int Multi_create_force_heartbeat = 0; // to force a master heardbeat packet be sent (rather than waiting for timeout)
bool Multi_create_sort_mode = false; // default to mission name sorting, "true" is mission filename sorting
// sorting function to sort mission lists.. Basic sorting on mission name
int multi_create_sort_func(const void *a, const void *b)
bool multi_create_sort_func(const multi_create_info &m1, const multi_create_info &m2)
{
multi_create_info *m1, *m2;
if (Multi_create_filter != MISSION_TYPE_MULTI) {
if ( (m1.flags & Multi_create_filter) && !(m2.flags & Multi_create_filter) ) {
return false;
} else if ( (m2.flags & Multi_create_filter) && !(m1.flags & Multi_create_filter) ) {
return true;
}
}
m1 = (multi_create_info *)a;
m2 = (multi_create_info *)b;
int test = 0;
return ( strcmp(m1->name, m2->name) );
if (Multi_create_sort_mode) {
test = stricmp(m1.filename, m2.filename);
} else {
test = stricmp(m1.name, m2.name);
}
if (test < 0) {
return true;
} else if (test > 0) {
return false;
} else {
return true;
}
}
void multi_create_list_sort(int mode)
{
bool sort_missions = false;
bool sort_campaigns = false;
if (Multi_create_list_count < 0) {
return;
}
switch (mode) {
case MULTI_CREATE_SHOW_MISSIONS:
sort_missions = true;
break;
case MULTI_CREATE_SHOW_CAMPAIGNS:
sort_campaigns = true;
break;
default:
sort_missions = true;
sort_campaigns = true;
break;
}
if (sort_missions) {
std::sort( Multi_create_mission_list.begin(), Multi_create_mission_list.end(), multi_create_sort_func);
}
if (sort_campaigns) {
std::sort( Multi_create_campaign_list.begin(), Multi_create_campaign_list.end(), multi_create_sort_func);
}
}
void multi_create_setup_list_data(int mode)
@@ -4045,68 +4095,74 @@ void multi_create_setup_list_data(int mode)
if((Multi_create_list_mode != mode) && (mode != -1)){
Multi_create_list_mode = mode;
switched_modes = 1;
// set up the list pointers
if ( Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS ) {
Multi_create_file_list = Multi_create_mission_list;
} else if ( Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS ) {
Multi_create_file_list = Multi_create_campaign_list;
} else {
Int3();
}
}
// get the mission count based upon the filter selected
if(Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS){
switch(Multi_create_filter){
case MISSION_TYPE_MULTI:
Multi_create_list_count = Multi_create_mission_count;
break;
default :
Multi_create_list_count = 0;
// find all missions which match
for(idx=0;idx<Multi_create_mission_count;idx++){
if(Multi_create_mission_list[idx].flags & Multi_create_filter){
Multi_create_list_count++;
}
}
switch (Multi_create_filter) {
case MISSION_TYPE_MULTI:
Multi_create_list_count = (int)Multi_create_mission_list.size();
// if we switched modes and we have more than 0 items, sort them
if(switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
}
break;
// if we switched modes and we have more than 0 items, sort them
if (switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
}
break;
default :
Multi_create_list_count = 0;
// find all missions which match
for (idx = 0; idx < (int)Multi_create_mission_list.size(); idx++) {
if(Multi_create_mission_list[idx].flags & Multi_create_filter){
Multi_create_list_count++;
}
}
// if we switched modes and we have more than 0 items, sort them
if (switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
}
break;
}
} else if(Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS){
switch(Multi_create_filter){
case MISSION_TYPE_MULTI:
Multi_create_list_count = Multi_create_campaign_count;
break;
default :
Multi_create_list_count = 0;
// find all missions which match
for(idx=0;idx<Multi_create_campaign_count;idx++){
if(Multi_create_campaign_list[idx].flags & Multi_create_filter){
Multi_create_list_count++;
}
}
switch (Multi_create_filter) {
case MISSION_TYPE_MULTI:
Multi_create_list_count = (int)Multi_create_campaign_list.size();
// if we switched modes and we have more than 0 items, sort them
if(switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
// if we switched modes and we have more than 0 items, sort them
if (switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
}
break;
default :
Multi_create_list_count = 0;
// find all missions which match
for (idx = 0; idx < Multi_create_campaign_list.size(); idx++) {
if(Multi_create_campaign_list[idx].flags & Multi_create_filter){
Multi_create_list_count++;
}
}
// if we switched modes and we have more than 0 items, sort them
if(switched_modes && (Multi_create_list_count > 0)){
should_sort = 1;
}
break;
}
break;
}
}
// reset the list start and selected indices
Multi_create_list_start = 0;
Multi_create_list_select = -1;
multi_create_list_select_item(Multi_create_list_start);
// sort the list of missions if necessary
if( should_sort ) {
qsort(Multi_create_file_list, Multi_create_list_count, sizeof(multi_create_info), multi_create_sort_func);
if (should_sort) {
multi_create_list_sort(mode);
}
// reset the slider
@@ -4203,19 +4259,15 @@ void multi_create_game_init()
Multi_create_filter = MISSION_TYPE_MULTI;
// initialize the list mode, and load in a list
memset(Multi_create_mission_list, 0, sizeof(multi_create_info) * MULTI_CREATE_MAX_LIST_ITEMS);
memset(Multi_create_campaign_list, 0, sizeof(multi_create_info) * MULTI_CREATE_MAX_LIST_ITEMS);
Multi_create_mission_list.clear();
Multi_create_campaign_list.clear();
for(idx=0; idx<MULTI_CREATE_MAX_LIST_ITEMS; idx++){
Multi_create_mission_list[idx].valid_status = MVALID_STATUS_UNKNOWN;
Multi_create_campaign_list[idx].valid_status = MVALID_STATUS_UNKNOWN;
}
Multi_create_list_mode = MULTI_CREATE_SHOW_MISSIONS;
Multi_create_list_start = -1;
Multi_create_list_select = -1;
Multi_create_list_count = 0;
Multi_create_slider.create(&Multi_create_window, Mc_slider_coords[gr_screen.res][MC_X_COORD], Mc_slider_coords[gr_screen.res][MC_Y_COORD], Mc_slider_coords[gr_screen.res][MC_W_COORD],Mc_slider_coords[gr_screen.res][MC_H_COORD], MULTI_CREATE_MAX_LIST_ITEMS, Mc_slider_bitmap[gr_screen.res], &multi_create_list_scroll_up, &multi_create_list_scroll_down, NULL);
Multi_create_slider.create(&Multi_create_window, Mc_slider_coords[gr_screen.res][MC_X_COORD], Mc_slider_coords[gr_screen.res][MC_Y_COORD], Mc_slider_coords[gr_screen.res][MC_W_COORD],Mc_slider_coords[gr_screen.res][MC_H_COORD], -1, Mc_slider_bitmap[gr_screen.res], &multi_create_list_scroll_up, &multi_create_list_scroll_down, NULL);
// create the player list select button
Multi_create_player_select_button.create(&Multi_create_window, "", Mc_players_coords[gr_screen.res][MC_X_COORD], Mc_players_coords[gr_screen.res][MC_Y_COORD], Mc_players_coords[gr_screen.res][MC_W_COORD], Mc_players_coords[gr_screen.res][MC_H_COORD], 0, 1);
@@ -4237,10 +4289,7 @@ void multi_create_game_init()
// send any pilots as appropriate
multi_data_send_my_junk();
Multi_create_file_list = Multi_create_mission_list;
Multi_create_campaign_count = 0;
Multi_create_mission_count = 0;
Multi_create_files_loaded = 0;
}
@@ -4338,7 +4387,9 @@ void multi_create_game_do()
}
// update the file list
multi_create_setup_list_data(MULTI_CREATE_SHOW_MISSIONS);
multi_create_setup_list_data(MULTI_CREATE_SHOW_MISSIONS);
// the above function doesn't sort initially, so we need this to take care of it
multi_create_list_sort(MULTI_CREATE_SHOW_MISSIONS);
}
// don't bother setting netgame state if ont the server
@@ -4360,15 +4411,22 @@ void multi_create_game_do()
k = Multi_create_window.process(k,0);
switch(k){
// same as the cancel button
case KEY_ESC:
if(help_overlay_active(MULTI_CREATE_OVERLAY)){
help_overlay_set_state(MULTI_CREATE_OVERLAY,0);
} else {
gamesnd_play_iface(SND_USER_SELECT);
multi_quit_game(PROMPT_HOST);
// same as the cancel button
case KEY_ESC: {
if ( help_overlay_active(MULTI_CREATE_OVERLAY) ) {
help_overlay_set_state(MULTI_CREATE_OVERLAY, 0);
} else {
gamesnd_play_iface(SND_USER_SELECT);
multi_quit_game(PROMPT_HOST);
}
break;
}
break;
case KEY_CTRLED | KEY_SHIFTED | KEY_S:
Multi_create_sort_mode = !Multi_create_sort_mode;
multi_create_list_sort(Multi_create_list_mode);
break;
}
if ( mouse_down(MOUSE_LEFT_BUTTON) ) {
@@ -5021,12 +5079,21 @@ void multi_create_list_load_missions()
{
char *fname, mission_name[NAME_LENGTH+1];
char wild_card[10];
int file_count,idx;
int file_count, idx;
char **file_list = NULL;
Multi_create_mission_list.clear();
memset( wild_card, 0, sizeof(wild_card) );
snprintf(wild_card, sizeof(wild_card) - 1, "*%s", FS_MISSION_FILE_EXT);
file_count = cf_get_file_list_preallocated(MULTI_CREATE_MAX_LIST_ITEMS, Multi_create_files_array, NULL, CF_TYPE_MISSIONS, wild_card);
Multi_create_mission_count = 0;
file_list = (char**) vm_malloc( sizeof(char*) * 1024 );
if (file_list == NULL) {
return;
}
file_count = cf_get_file_list(1024, file_list, CF_TYPE_MISSIONS, wild_card);
// maybe create a standalone dialog
if (Game_mode & GM_STANDALONE_SERVER) {
@@ -5039,7 +5106,7 @@ void multi_create_list_load_missions()
char *filename;
uint m_respawn;
fname = Multi_create_files_array[idx];
fname = file_list[idx];
// tack on any necessary file extension
filename = cf_add_ext( fname, FS_MISSION_FILE_EXT );
@@ -5066,27 +5133,36 @@ void multi_create_list_load_missions()
max_players = mission_parse_get_multi_mission_info( filename );
m_respawn = The_mission.num_respawns;
if ( Multi_create_mission_count < MULTI_CREATE_MAX_LIST_ITEMS ) {
multi_create_info *mcip;
multi_create_info mcip;
mcip = &Multi_create_mission_list[Multi_create_mission_count];
strcpy(mcip->filename, filename );
strcpy(mcip->name, mission_name );
mcip->flags = flags;
mcip->respawn = m_respawn;
mcip->max_players = (ubyte)max_players;
strcpy(mcip.filename, filename );
strcpy(mcip.name, mission_name );
mcip.flags = flags;
mcip.respawn = m_respawn;
mcip.max_players = (ubyte)max_players;
// get any additional information for possibly builtin missions
fs_builtin_mission *fb = game_find_builtin_mission(filename);
if(fb != NULL){
}
Multi_create_mission_count++;
// get any additional information for possibly builtin missions
fs_builtin_mission *fb = game_find_builtin_mission(filename);
if(fb != NULL){
}
Multi_create_mission_list.push_back( mcip );
}
}
Multi_create_slider.set_numberItems(Multi_create_mission_count > Multi_create_list_max_display[gr_screen.res] ? Multi_create_mission_count-Multi_create_list_max_display[gr_screen.res] : 0);
if (file_list) {
for (idx = 0; idx < file_count; idx++) {
if (file_list[idx]) {
vm_free(file_list[idx]);
file_list[idx] = NULL;
}
}
vm_free(file_list);
file_list = NULL;
}
Multi_create_slider.set_numberItems(int(Multi_create_mission_list.size()) > Multi_create_list_max_display[gr_screen.res] ? int(Multi_create_mission_list.size())-Multi_create_list_max_display[gr_screen.res] : 0);
// maybe create a standalone dialog
if (Game_mode & GM_STANDALONE_SERVER) {
@@ -5101,6 +5177,20 @@ void multi_create_list_load_campaigns()
int campaign_type,max_players;
char title[255];
char wild_card[10];
char **file_list = NULL;
Multi_create_campaign_list.clear();
memset( wild_card, 0, sizeof(wild_card) );
snprintf(wild_card, sizeof(wild_card) - 1, "*%s", FS_CAMPAIGN_FILE_EXT);
file_list = (char**) vm_malloc( sizeof(char*) * 1024 );
if (file_list == NULL) {
return;
}
file_count = cf_get_file_list(1024, file_list, CF_TYPE_MISSIONS, wild_card);
// maybe create a standalone dialog
if (Game_mode & GM_STANDALONE_SERVER) {
@@ -5108,16 +5198,11 @@ void multi_create_list_load_campaigns()
std_gen_set_text("Campaign:", 1);
}
Multi_create_campaign_count = 0;
memset( wild_card, 0, sizeof(wild_card) );
snprintf(wild_card, sizeof(wild_card) - 1, "*%s", FS_CAMPAIGN_FILE_EXT);
file_count = cf_get_file_list_preallocated(MULTI_CREATE_MAX_LIST_ITEMS, Multi_create_files_array, NULL, CF_TYPE_MISSIONS, wild_card);
for (idx = 0; idx < file_count; idx++) {
int flags;
char *filename, name[NAME_LENGTH];
fname = Multi_create_files_array[idx];
fname = file_list[idx];
// tack on any necessary file extension
filename = cf_add_ext( fname, FS_CAMPAIGN_FILE_EXT );
@@ -5140,38 +5225,47 @@ void multi_create_list_load_campaigns()
// if the campaign is a multiplayer campaign, then add the data to the campaign list items
flags = mission_campaign_parse_is_multi( filename, name );
if( flags != CAMPAIGN_TYPE_SINGLE && mission_campaign_get_info(filename,title,&campaign_type,&max_players)) {
if ( Multi_create_campaign_count < MULTI_CREATE_MAX_LIST_ITEMS ) {
multi_create_info *mcip;
multi_create_info mcip;
mcip = &Multi_create_campaign_list[Multi_create_campaign_count];
strcpy(mcip->filename, filename );
strcpy(mcip->name, name );
// setup various flags
if ( flags == CAMPAIGN_TYPE_MULTI_COOP ){
mcip->flags = MISSION_TYPE_MULTI_COOP | MISSION_TYPE_MULTI;
} else if ( flags == CAMPAIGN_TYPE_MULTI_TEAMS ) {
mcip->flags = MISSION_TYPE_MULTI_TEAMS | MISSION_TYPE_MULTI;
} else {
Int3(); // bogus campaign multi type -- find allender
}
strcpy(mcip.filename, filename );
strcpy(mcip.name, name );
// setup various flags
if ( flags == CAMPAIGN_TYPE_MULTI_COOP ){
mcip.flags = MISSION_TYPE_MULTI_COOP | MISSION_TYPE_MULTI;
} else if ( flags == CAMPAIGN_TYPE_MULTI_TEAMS ) {
mcip.flags = MISSION_TYPE_MULTI_TEAMS | MISSION_TYPE_MULTI;
} else {
Int3(); // bogus campaign multi type -- find allender
}
// 0 respawns for campaign files (should be contained within the mission files themselves)
mcip->respawn = 0;
// 0 respawns for campaign files (should be contained within the mission files themselves)
mcip.respawn = 0;
// 0 max players for campaign files
mcip->max_players = (unsigned char)max_players;
// 0 max players for campaign files
mcip.max_players = (unsigned char)max_players;
// get any additional information for possibly builtin missions
fs_builtin_mission *fb = game_find_builtin_mission(filename);
if(fb != NULL){
}
// get any additional information for possibly builtin missions
fs_builtin_mission *fb = game_find_builtin_mission(filename);
if(fb != NULL){
}
Multi_create_campaign_count++;
Multi_create_campaign_list.push_back( mcip );
}
}
if (file_list) {
for (idx = 0; idx < file_count; idx++) {
if (file_list[idx]) {
vm_free(file_list[idx]);
file_list[idx] = NULL;
}
}
}
vm_free(file_list);
file_list = NULL;
}
// maybe create a standalone dialog
if (Game_mode & GM_STANDALONE_SERVER) {
std_destroy_gen_dialog();
@@ -5216,21 +5310,31 @@ void multi_create_list_do()
int y_start = Mc_list_coords[gr_screen.res][MC_Y_COORD];
start_index = multi_create_select_to_index(Multi_create_list_start);
stop_index = Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS ? Multi_create_mission_count : Multi_create_campaign_count;
for(idx=start_index; idx<stop_index; idx++){
stop_index = (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) ? Multi_create_mission_list.size() : Multi_create_campaign_list.size();
for (idx = start_index; idx < stop_index; idx++) {
multi_create_info *mcip;
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
mcip = &Multi_create_mission_list[idx];
} else {
mcip = &Multi_create_campaign_list[idx];
}
// see if we should drop out
if(count == Multi_create_list_max_display[gr_screen.res]){
break;
}
// see if we should filter out this mission
if ( !(Multi_create_file_list[idx].flags & Multi_create_filter) ){
if ( !(mcip->flags & Multi_create_filter) ) {
continue;
}
// highlight the selected item
multi_create_select_to_filename(Multi_create_list_select,selected_name);
if(!strcmp(selected_name,Multi_create_file_list[idx].filename)){
multi_create_select_to_filename(Multi_create_list_select, selected_name);
if ( !strcmp(selected_name, mcip->filename) ) {
gr_set_color_fast(&Color_text_selected);
} else {
gr_set_color_fast(&Color_text_normal);
@@ -5240,20 +5344,20 @@ void multi_create_list_do()
multi_create_list_blit_icons(idx, y_start);
// force fit the mission name string
strcpy(selected_name,Multi_create_file_list[idx].name);
gr_force_fit_string(selected_name,255,Mc_column1_w[gr_screen.res]);
gr_string(Mc_mission_name_x[gr_screen.res],y_start,selected_name);
strcpy(selected_name, mcip->name);
gr_force_fit_string(selected_name, 255, Mc_column1_w[gr_screen.res]);
gr_string(Mc_mission_name_x[gr_screen.res], y_start, selected_name);
// draw the max players if in mission mode
sprintf(selected_name,"%d",(int)Multi_create_file_list[idx].max_players);
gr_string(Mc_mission_count_x[gr_screen.res],y_start,selected_name);
sprintf(selected_name, "%d", (int)mcip->max_players);
gr_string(Mc_mission_count_x[gr_screen.res], y_start, selected_name);
// force fit the mission filename string
strcpy(selected_name,Multi_create_file_list[idx].filename);
gr_force_fit_string(selected_name,255,Mc_column3_w[gr_screen.res]);
gr_string(Mc_mission_fname_x[gr_screen.res],y_start,selected_name);
strcpy(selected_name, mcip->filename);
gr_force_fit_string(selected_name, 255, Mc_column3_w[gr_screen.res]);
gr_string(Mc_mission_fname_x[gr_screen.res], y_start, selected_name);
y_start+=10;
y_start += 10;
count++;
}
}
@@ -5265,6 +5369,7 @@ void multi_create_list_select_item(int n)
char title[NAME_LENGTH+1];
netgame_info ng_temp;
netgame_info *ng;
multi_create_info *mcip = NULL;
char *campaign_desc;
@@ -5290,26 +5395,33 @@ void multi_create_list_select_item(int n)
Multi_create_force_heartbeat = 1;
// set the mission name
if(Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS){
multi_create_select_to_filename(n,ng->mission_name);
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
multi_create_select_to_filename(n, ng->mission_name);
} else {
multi_create_select_to_filename(n,ng->campaign_name);
multi_create_select_to_filename(n, ng->campaign_name);
}
// make sure the netgame type is properly set
int old_type = Netgame.type_flags;
abs_index = multi_create_select_to_index(n);
if(abs_index != -1){
if(Multi_create_file_list[abs_index].flags & MISSION_TYPE_MULTI_TEAMS){
if (abs_index != -1) {
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
mcip = &Multi_create_mission_list[abs_index];
} else {
mcip = &Multi_create_campaign_list[abs_index];
}
if (mcip->flags & MISSION_TYPE_MULTI_TEAMS) {
// if we're in squad war mode, leave it as squad war
if(old_type & NG_TYPE_SW){
ng->type_flags = NG_TYPE_SW;
} else {
ng->type_flags = NG_TYPE_TVT;
}
} else if(Multi_create_file_list[abs_index].flags & MISSION_TYPE_MULTI_COOP){
} else if (mcip->flags & MISSION_TYPE_MULTI_COOP) {
ng->type_flags = NG_TYPE_COOP;
} else if(Multi_create_file_list[abs_index].flags & MISSION_TYPE_MULTI_DOGFIGHT){
} else if (mcip->flags & MISSION_TYPE_MULTI_DOGFIGHT) {
ng->type_flags = NG_TYPE_DOGFIGHT;
}
}
@@ -5344,12 +5456,14 @@ void multi_create_list_select_item(int n)
}
// set the respawns as appropriate
if(Netgame.options.respawn <= Multi_create_file_list[abs_index].respawn){
ng->respawn = Netgame.options.respawn;
nprintf(("Network","Using netgame options for respawn count (%d %d)\n",Netgame.options.respawn,Multi_create_file_list[abs_index].respawn));
} else {
ng->respawn = Multi_create_file_list[abs_index].respawn;
nprintf(("Network","Using mission settings for respawn count (%d %d)\n",Netgame.options.respawn,Multi_create_file_list[abs_index].respawn));
if (mcip) {
if(Netgame.options.respawn <= mcip->respawn){
ng->respawn = Netgame.options.respawn;
nprintf(("Network", "Using netgame options for respawn count (%d %d)\n", Netgame.options.respawn, mcip->respawn));
} else {
ng->respawn = mcip->respawn;
nprintf(("Network", "Using mission settings for respawn count (%d %d)\n", Netgame.options.respawn, mcip->respawn));
}
}
break;
case MULTI_CREATE_SHOW_CAMPAIGNS:
@@ -5412,11 +5526,17 @@ void multi_create_list_blit_icons(int list_index, int y_start)
int max_index;
// get a pointer to the list item
max_index = Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS ? Multi_create_mission_count - 1 : Multi_create_campaign_count - 1;
if((list_index < 0) || (list_index > max_index)){
max_index = (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) ? Multi_create_mission_list.size() - 1 : Multi_create_campaign_list.size() - 1;
if ( (list_index < 0) || (list_index > max_index) ) {
return;
}
mcip = &Multi_create_file_list[list_index];
}
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
mcip = &Multi_create_mission_list[list_index];
} else {
mcip = &Multi_create_campaign_list[list_index];
}
// blit the multiplayer type icons
if(mcip->flags & MISSION_TYPE_MULTI_COOP){
@@ -5628,30 +5748,30 @@ short multi_create_get_mouse_id()
void multi_create_select_to_filename(int select_index,char *filename)
{
int idx;
uint idx;
// look through the mission list
if(Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS){
for(idx=0;idx<Multi_create_mission_count;idx++){
if(Multi_create_file_list[idx].flags & Multi_create_filter){
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
for (idx = 0; idx < Multi_create_mission_list.size(); idx++) {
if (Multi_create_mission_list[idx].flags & Multi_create_filter) {
select_index--;
}
// if we found the item
if(select_index < 0){
strcpy(filename,Multi_create_file_list[idx].filename);
if (select_index < 0) {
strcpy(filename, Multi_create_mission_list[idx].filename);
return;
}
}
}
// look through the campaign list
else if(Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS){
for(idx=0;idx<Multi_create_campaign_count;idx++){
else if (Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS) {
for (idx = 0; idx < Multi_create_campaign_list.size(); idx++) {
select_index--;
// if we found the item
if(select_index < 0){
strcpy(filename,Multi_create_file_list[idx].filename);
if (select_index < 0) {
strcpy(filename, Multi_create_campaign_list[idx].filename);
return;
}
}
@@ -5662,29 +5782,29 @@ void multi_create_select_to_filename(int select_index,char *filename)
int multi_create_select_to_index(int select_index)
{
int idx;
uint idx;
int lookup_index = 0;
// look through the mission list
if(Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS){
for(idx=0;idx<Multi_create_mission_count;idx++){
if(Multi_create_file_list[idx].flags & Multi_create_filter){
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
for (idx = 0; idx < Multi_create_mission_list.size(); idx++) {
if (Multi_create_mission_list[idx].flags & Multi_create_filter) {
lookup_index++;
}
// if we found the item
if(select_index < lookup_index){
if (select_index < lookup_index) {
return idx;
}
}
}
// look through the campaign list
else if(Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS){
for(idx=0;idx<Multi_create_campaign_count;idx++){
else if (Multi_create_list_mode == MULTI_CREATE_SHOW_CAMPAIGNS) {
for (idx = 0; idx < Multi_create_campaign_list.size(); idx++) {
select_index--;
// if we found the item
if(select_index < 0){
if (select_index < 0) {
return idx;
}
}
@@ -5847,7 +5967,7 @@ int multi_create_ok_to_commit()
// if we're playing on the tracker
if(MULTI_IS_TRACKER_GAME){
//#ifdef PXO_CHECK_VALID_MISSIONS
if((Multi_create_file_list == Multi_create_mission_list) && (Multi_create_file_list[abs_index].valid_status != MVALID_STATUS_VALID)){
if ( (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) && (Multi_create_mission_list[abs_index].valid_status != MVALID_STATUS_VALID) ) {
if(popup(PF_USE_AFFIRMATIVE_ICON | PF_USE_NEGATIVE_ICON, 2, XSTR("&Back", 995), XSTR("&Continue", 780), XSTR("You have selected a mission which is either invalid or unknown to PXO. Your stats will not be saved if you continue",996)) <= 0){
return 0;
}
@@ -5906,10 +6026,10 @@ int multi_create_verify_cds()
// returns an index into Multi_create_mission_list
int multi_create_lookup_mission(char *fname)
{
int idx;
uint idx;
for(idx=0; idx<Multi_create_mission_count; idx++){
if(!stricmp(fname, Multi_create_mission_list[idx].filename)){
for (idx = 0; idx < Multi_create_mission_list.size(); idx++) {
if ( !stricmp(fname, Multi_create_mission_list[idx].filename) ) {
return idx;
}
}
@@ -5921,10 +6041,10 @@ int multi_create_lookup_mission(char *fname)
// returns an index into Multi_create_campaign_list
int multi_create_lookup_campaign(char *fname)
{
int idx;
uint idx;
for(idx=0; idx<Multi_create_campaign_count; idx++){
if(!stricmp(fname, Multi_create_campaign_list[idx].filename)){
for (idx = 0; idx < Multi_create_campaign_list.size(); idx++) {
if ( !stricmp(fname, Multi_create_campaign_list[idx].filename) ) {
return idx;
}
}
@@ -5947,9 +6067,26 @@ void multi_create_sw_clicked()
{
netgame_info ng_temp;
netgame_info *ng;
multi_create_info *mcip;
int file_index = multi_create_select_to_index(Multi_create_list_select);
if (file_index < 0) {
Int3();
if ( Multi_create_sw_checkbox.checked() ) {
Multi_create_sw_checkbox.set_state(0);
}
return;
}
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
mcip = &Multi_create_mission_list[file_index];
} else {
mcip = &Multi_create_campaign_list[file_index];
}
// either a temporary netgame or the real one
if(MULTIPLAYER_MASTER){
ng = &Netgame;
@@ -5961,13 +6098,10 @@ void multi_create_sw_clicked()
// maybe switch squad war off
if(!Multi_create_sw_checkbox.checked()){
// if the mission selected is a coop mission, go back to coop mode
Assert(file_index != -1);
if(file_index == -1){
ng->type_flags = NG_TYPE_COOP;
}
if(Multi_create_file_list[file_index].flags & MISSION_TYPE_MULTI_TEAMS){
if (mcip->flags & MISSION_TYPE_MULTI_TEAMS) {
ng->type_flags = NG_TYPE_TVT;
} else if(Multi_create_file_list[file_index].flags & MISSION_TYPE_MULTI_DOGFIGHT){
} else if (mcip->flags & MISSION_TYPE_MULTI_DOGFIGHT) {
ng->type_flags = NG_TYPE_DOGFIGHT;
} else {
ng->type_flags = NG_TYPE_COOP;
@@ -5975,13 +6109,8 @@ void multi_create_sw_clicked()
}
// switch squad war on
else {
Assert(file_index != -1);
if((file_index == -1) || !(Multi_create_file_list[file_index].flags & MISSION_TYPE_MULTI_TEAMS)){
Multi_create_sw_checkbox.set_state(0);
} else {
// at this point we know its safe to switch squad war on
ng->type_flags = NG_TYPE_SW;
}
// at this point we know its safe to switch squad war on
ng->type_flags = NG_TYPE_SW;
}
// update
@@ -6415,7 +6544,11 @@ void multi_host_options_init()
// if he has a valid mission selected
if(abs_index >= 0){
Multi_ho_mission_respawn = (int)Multi_create_file_list[abs_index].respawn;
if (Multi_create_list_mode == MULTI_CREATE_SHOW_MISSIONS) {
Multi_ho_mission_respawn = (int)Multi_create_mission_list[abs_index].respawn;
} else {
Multi_ho_mission_respawn = (int)Multi_create_campaign_list[abs_index].respawn;
}
} else {
Multi_ho_mission_respawn = -1;
}
+12 -14
View File
@@ -334,6 +334,10 @@
#include "globalincs/globals.h"
#include "ui/ui.h"
#include "network/multi.h"
#include <vector>
struct net_player;
struct net_addr;
@@ -350,20 +354,19 @@ void multi_common_set_text(char *str,int auto_scroll = 0);
#define MULTI_JOIN_SERVER_TIMEOUT (MULTI_JOIN_REFRESH_TIME + (MULTI_JOIN_REFRESH_TIME /2))
#define MULTI_JOIN_SERVER_TIMEOUT_LOCAL (MULTI_JOIN_REFRESH_TIME_LOCAL + (MULTI_JOIN_REFRESH_TIME_LOCAL / 2))
// maximum number of items which can be on the list
#if defined(DEMO) || defined(OEM_BUILD) // not for FS2_DEMO
#define MULTI_CREATE_MAX_LIST_ITEMS 1
#else
#define MULTI_CREATE_MAX_LIST_ITEMS 200
#endif
typedef struct {
typedef struct multi_create_info {
char filename[MAX_FILENAME_LEN]; // filename of the mission
char name[NAME_LENGTH]; // name of the mission
int flags; // flags to tell what type of multiplayer game (coop, team v. team)
uint respawn; // mission specified respawn count
ubyte max_players; // max players allowed for this file
char valid_status; // see MVALID_* defines above
multi_create_info() {
memset(this, 0, sizeof(multi_create_info));
valid_status = MVALID_STATUS_UNKNOWN;
}
} multi_create_info;
// load all common icons
@@ -399,13 +402,8 @@ void multi_common_unload_palette();
void multi_common_verify_cd();
// variables to hold the mission and campaign lists
extern int Multi_create_mission_count; // how many we have
extern int Multi_create_campaign_count;
extern multi_create_info Multi_create_mission_list[MULTI_CREATE_MAX_LIST_ITEMS];
extern multi_create_info Multi_create_campaign_list[MULTI_CREATE_MAX_LIST_ITEMS];
extern char Multi_create_files_array[MULTI_CREATE_MAX_LIST_ITEMS][MAX_FILENAME_LEN];
extern int Multi_create_files_array_count;
extern std::vector<multi_create_info> Multi_create_mission_list;
extern std::vector<multi_create_info> Multi_create_campaign_list;
void multi_create_list_load_missions();
void multi_create_list_load_campaigns();
+7 -4
View File
@@ -3461,7 +3461,8 @@ void multi_update_valid_missions()
char temp[256];
char *tok;
CFILE *in;
int idx, file_index;
int file_index;
uint idx;
bool was_cancelled = false;
// if we're a standalone, show a dialog saying "validating missions"
@@ -3471,7 +3472,7 @@ void multi_update_valid_missions()
}
// mark all missions on our list as being MVALID_STATUS_UNKNOWN
for (idx = 0; idx < Multi_create_mission_count; idx++) {
for (idx = 0; idx < Multi_create_mission_list.size(); idx++) {
Multi_create_mission_list[idx].valid_status = MVALID_STATUS_UNKNOWN;
}
@@ -3548,7 +3549,8 @@ void multi_update_valid_missions()
return;
}
for(idx=0; idx<Multi_create_mission_count; idx++){
for (idx = 0; idx < Multi_create_mission_list.size(); idx++) {
switch(Multi_create_mission_list[idx].valid_status){
case MVALID_STATUS_VALID:
cfputs(Multi_create_mission_list[idx].filename, in);
@@ -3729,7 +3731,7 @@ Done:
}
}
/*
void multi_spew_table_checksums(int max_files, char *outfile)
{
char **file_names;
@@ -3797,6 +3799,7 @@ Done:
file_names = NULL;
}
}
*/
DCF(pxospew,"spew PXO 32 bit checksums for all visible mission files")
{
+1 -1
View File
@@ -119,4 +119,4 @@ int waypoint_lookup(char *name)
}
return -1;
}
}
+6 -3
View File
@@ -2831,8 +2831,9 @@ char *split_str_once(char *src, int max_pixel_w)
Assert(max_pixel_w > 0);
gr_get_string_size(&w, NULL, src);
if ( w <= max_pixel_w )
if ( (w <= max_pixel_w) && !strstr(src, "\n") ) {
return NULL; // string doesn't require a cut
}
len = strlen(src);
for (i=0; i<len; i++) {
@@ -3126,14 +3127,16 @@ char *get_pointer_to_first_hash_symbol(char *src)
char *p, *p2;
Assert(src);
p = strchr(src, '(');
/* p = strchr(src, '(');
if (p != NULL)
{
p2 = strchr(p, ')');
if (p2 != NULL)
return p;
}
*/
// Backslash - The above used to be for very old versions of FSPort. Now it's not needed, and
// interferes with some situations where we want to strip the hash symbol but keep the ( ).
return strchr(src, '#');
}
+203 -19
View File
@@ -1751,6 +1751,7 @@ sexp_oper Operators[] = {
{ "skill-level-at-least", OP_SKILL_LEVEL_AT_LEAST, 1, 1, },
{ "num-ships-in-battle", OP_NUM_SHIPS_IN_BATTLE, 0, 1}, //phreak
{ "num-ships-in-wing", OP_NUM_SHIPS_IN_WING, 1, INT_MAX}, // Karajorma
{ "is-player", OP_IS_PLAYER, 2, INT_MAX}, // Karajorma
{ "num-players", OP_NUM_PLAYERS, 0, 0, },
{ "num_kills", OP_NUM_KILLS, 1, 1 },
{ "num_assists", OP_NUM_ASSISTS, 1, 1 },
@@ -1796,6 +1797,7 @@ sexp_oper Operators[] = {
{ "unscramble-messages", OP_UNSCRAMBLE_MESSAGES, 0, 0,},
{ "disable-builtin-messages", OP_DISABLE_BUILTIN_MESSAGES, 0, INT_MAX,}, // Karajorma
{ "enable-builtin-messages", OP_ENABLE_BUILTIN_MESSAGES, 0, INT_MAX,}, // Karajorma
{ "set-persona", OP_SET_PERSONA, 2, INT_MAX,}, // Karajorma
{ "add-goal", OP_ADD_GOAL, 2, 2, },
{ "remove-goal", OP_REMOVE_GOAL, 2, 2, }, // Goober5000
@@ -3030,6 +3032,7 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, i
case OPF_ROTATING_SUBSYSTEM:
case OPF_SUBSYSTEM:
case OPF_SUBSYSTEM_OR_NONE:
case OPF_SUBSYS_OR_GENERIC:
{
char *shipname;
int shipnum,ship_class;
@@ -3045,6 +3048,11 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, i
break;
}
// subsys_or_generic has a few extra options it accepts
if (type == OPF_SUBSYS_OR_GENERIC && (!(stricmp(CTEXT(node), SEXP_ALL_ENGINES_STRING)) || !(stricmp(CTEXT(node), SEXP_ALL_TURRETS_STRING)) )) {
break;
}
// we must get the model of the ship that is part of this sexpression and find a subsystem
// with that name. This code assumes by default that the ship is *always* the first name
// in the sexpression. If this is ever not the case, the code here must be changed to
@@ -3694,6 +3702,21 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, i
}
break;
//Karajorma
case OPF_PERSONA:
if (type2 != SEXP_ATOM_STRING){
return SEXP_CHECK_TYPE_MISMATCH;
}
for (i=0; i < Num_personas ; i++) {
if (!strcmp(CTEXT(node), Personas[i].name))
break;
}
if (i == Num_personas)
return SEXP_CHECK_INVALID_PERSONA_NAME;
break;
case OPF_KEYPRESS:
if (type2 != SEXP_ATOM_STRING)
@@ -10527,6 +10550,47 @@ void sexp_toggle_builtin_messages (int node, bool enable_messages)
}
}
void sexp_set_persona (int node)
{
int persona_index = -1, sindex, i;
char *persona_name;
persona_name = CTEXT(node);
for (i = 0 ; i < Num_personas ; i++) {
if (!strcmp(persona_name, Personas[i].name) && (Personas[i].flags & PERSONA_FLAG_WINGMAN)) {
persona_index = i;
break;
}
}
if (persona_index == -1) {
Warning(LOCATION, "Unable to change to persona type: '%s'. Persona is not a wingman!", persona_name);
return;
}
node = CDR(node);
Assert (node >=0);
// now loop through the list of ships
while (node >= 0) {
sindex = ship_name_lookup( CTEXT(node) );
if (sindex < 0) {
return;
}
if (Ships[sindex].objnum < 0) {
return;
}
Ships[sindex].persona_index = persona_index;
node = CDR(node);
}
}
// function to deal with getting status of goals for previous missions (in the current campaign).
// the status parameter is used to tell this function if we are looking for a goal_satisfied, goal_failed,
// or goal incomplete event
@@ -10883,22 +10947,19 @@ void sexp_ships_visible(int n, int visible)
sexp_deal_with_ship_flag(n, 0, 0, SF_HIDDEN_FROM_SENSORS, 0, P_SF_HIDDEN_FROM_SENSORS, 0, !visible);
// we also have to add any escort ships that were made visible
if (visible)
for (; n >= 0; n = CDR(n))
{
for (; n >= 0; n = CDR(n))
{
int shipnum = ship_name_lookup(CTEXT(n));
if (shipnum < 0)
continue;
int shipnum = ship_name_lookup(CTEXT(n));
if (shipnum < 0)
continue;
if (Ships[shipnum].flags & SF_ESCORT)
hud_add_ship_to_escort(Ships[shipnum].objnum, 1);
}
}
else {
if (Player_ai->target_objnum == Ships[n].objnum) {
if (!visible && Player_ai->target_objnum == Ships[shipnum].objnum) {
hud_cease_targeting();
}
else if (visible && (Ships[shipnum].flags & SF_ESCORT)) {
hud_add_ship_to_escort(Ships[shipnum].objnum, 1);
}
}
}
@@ -11067,7 +11128,7 @@ void sexp_ship_guardian_threshold(int num)
void sexp_ship_subsys_guardian_threshold(int num)
{
char *ship_name, *hull_name;
int ship_num, threshold;
int ship_num, threshold, subsys_type = SUBSYSTEM_UNKNOWN;;
ship_subsys *ss;
int n = -1;
@@ -11099,10 +11160,24 @@ void sexp_ship_subsys_guardian_threshold(int num)
if (hull_name != NULL) {
if ( !strcmp(hull_name, SEXP_HULL_STRING) ) {
Ships[ship_num].ship_guardian_threshold = threshold;
} else {
}
else if (!strcmp(hull_name, SEXP_ALL_ENGINES_STRING) || !strcmp(hull_name, SEXP_ALL_TURRETS_STRING)) {
subsys_type = ai_get_subsystem_type(hull_name);
// search through all subsystems
for (ss = GET_FIRST(&Ships[ship_num].subsys_list); ss != GET_LAST(&Ships[ship_num].subsys_list); ss = GET_NEXT(ss)) {
if (subsys_type == ai_get_subsystem_type(ss->sub_name)) {
ss->subsys_guardian_threshold = threshold;
}
}
}
else {
ss = ship_get_subsys(&Ships[ship_num], hull_name);
Assert( ss != NULL );
ss->subsys_guardian_threshold = threshold;
if ( ss == NULL ) {
Warning(LOCATION, "Invalid subsystem passed to ship-subsys-guardian-threshold: %s does not have a %s subsystem", ship_name, hull_name);
}
else {
ss->subsys_guardian_threshold = threshold;
}
}
}
}
@@ -12650,11 +12725,11 @@ void parse_copy_damage(p_object *target_pobjp, ship *source_shipp)
// copy hull...
target_pobjp->special_hitpoint_index = source_shipp->special_hitpoint_index;
target_pobjp->ship_max_hull_strength = source_shipp->ship_max_hull_strength;
target_pobjp->initial_hull = get_hull_pct(source_objp) * 100.0f;
target_pobjp->initial_hull = fl2i(get_hull_pct(source_objp) * 100.0f);
// ...and shields
target_pobjp->ship_max_shield_strength = source_shipp->ship_max_shield_strength;
target_pobjp->initial_shields = get_shield_pct(source_objp) * 100.0f;
target_pobjp->initial_shields = fl2i(get_shield_pct(source_objp) * 100.0f);
// search through all subsystems on source ship and map them onto target ship
@@ -14235,6 +14310,70 @@ int sexp_missile_locked(int node)
return SEXP_FALSE;
}
int sexp_is_player (int node)
{
int sindex, standard_check = 1, np_index;
p_object *p_objp;
standard_check = is_sexp_true(node);
if (!(Game_mode & GM_MULTIPLAYER)){
sindex = ship_name_lookup(CTEXT(CDR(node)));
// There can only be one player ship in singleplayer so if more than one ship is specifed the sexp is false
if (CDDR(node) < 0 ) {
return SEXP_FALSE;
}
if(sindex >= 0){
if(Player_obj == &Objects[Ships[sindex].objnum]){
if (standard_check) {
if (Player_use_ai) {
return SEXP_FALSE;
}
}
return SEXP_TRUE;
}
}
return SEXP_FALSE;
}
// For multiplayer we need to decide what to do about respawning players
else {
node = CDR(node);
while (node >= 0) {
// reset the netplayer index
np_index = -1;
sindex = ship_name_lookup(CTEXT(node));
if(sindex >= 0){
if(Ships[sindex].objnum >= 0) {
// try and find the player
np_index = multi_find_player_by_object(&Objects[Ships[sindex].objnum]);
}
}
if (standard_check && np_index < 0) {
// Respawning ships don't have an objnum so we need to take a different approach
p_objp = mission_parse_get_arrival_ship(CTEXT(node));
if (p_objp != NULL) {
np_index = multi_find_player_by_parse_object(p_objp);
}
}
// if we couldn't find a valid netplayer index then the ship isn't a player
if((np_index < 0) || (np_index >= MAX_PLAYERS)){
return SEXP_FALSE;
}
node = CDR(node);
}
// if we reached this far they all checked out
return SEXP_TRUE;
}
}
int sexp_return_player_data(int node, int type)
{
int sindex, np_index = -1;
@@ -14311,6 +14450,10 @@ int sexp_return_player_data(int node, int type)
// AI ships also have a respawn count so we can return valid data for that at least
else if ( (Game_mode & GM_MULTIPLAYER) && (type == OP_SHIP_DEATHS || type == OP_RESPAWNS_LEFT ) ) {
p_objp = mission_parse_get_arrival_ship(CTEXT(node));
if (p_objp == NULL) {
return 0;
}
if (p_objp->flags & P_OF_PLAYER_START) {
switch (type) {
case OP_SHIP_DEATHS:
@@ -15985,6 +16128,11 @@ int eval_sexp(int cur_node, int referenced_node)
sexp_val = SEXP_TRUE;
break;
case OP_SET_PERSONA:
sexp_set_persona (node);
sexp_val = SEXP_TRUE;
break;
case OP_SEND_MESSAGE_LIST:
sexp_send_message_list(node);
sexp_val = SEXP_TRUE;
@@ -16337,6 +16485,10 @@ int eval_sexp(int cur_node, int referenced_node)
sexp_val = sexp_is_tagged(node);
break;
case OP_IS_PLAYER:
sexp_val = sexp_is_player(node);
break;
case OP_NUM_KILLS:
case OP_NUM_ASSISTS:
case OP_SHIP_SCORE:
@@ -17027,6 +17179,7 @@ int query_operator_return_type(int op)
case OP_MISSILE_LOCKED:
case OP_NAV_IS_VISITED:
case OP_NAV_ISLINKED:
case OP_IS_PLAYER:
return OPR_BOOL;
case OP_PLUS:
@@ -17302,6 +17455,7 @@ int query_operator_return_type(int op)
case OP_LOCK_SECONDARY_WEAPON:
case OP_UNLOCK_SECONDARY_WEAPON:
case OP_RESET_ORDERS:
case OP_SET_PERSONA:
case OP_CHANGE_SUBSYSTEM_NAME:
return OPR_NULL;
@@ -17506,7 +17660,7 @@ int query_operator_argument_type(int op, int argnum)
else if (argnum == 1)
return OPF_SHIP;
else
return OPF_SUBSYSTEM;
return OPF_SUBSYS_OR_GENERIC;
case OP_SHIP_SUBSYS_TARGETABLE:
case OP_SHIP_SUBSYS_UNTARGETABLE:
@@ -17931,6 +18085,12 @@ int query_operator_argument_type(int op, int argnum)
case OP_DISABLE_BUILTIN_MESSAGES:
return OPF_WHO_FROM;
case OP_SET_PERSONA:
if (argnum == 0)
return OPF_PERSONA;
else
return OPF_SHIP;
case OP_SELF_DESTRUCT:
return OPF_SHIP;
@@ -18193,6 +18353,13 @@ int query_operator_argument_type(int op, int argnum)
case OP_IS_TAGGED:
return OPF_SHIP;
case OP_IS_PLAYER:
if (argnum == 0) {
return OPF_BOOL;
} else {
return OPF_SHIP;
}
case OP_NUM_KILLS:
case OP_NUM_ASSISTS:
case OP_SHIP_SCORE:
@@ -19060,6 +19227,9 @@ char *sexp_error_message(int num)
case SEXP_CHECK_INVALID_SOUNDTRACK_NAME:
return "Invalid soundtrack name";
case SEXP_CHECK_INVALID_PERSONA_NAME:
return "Invalid persona name";
}
sprintf(Sexp_error_text, "Sexp error code %d", num);
@@ -19561,6 +19731,7 @@ int get_subcategory(int sexp_id)
case OP_UNSCRAMBLE_MESSAGES:
case OP_ENABLE_BUILTIN_MESSAGES:
case OP_DISABLE_BUILTIN_MESSAGES:
case OP_SET_PERSONA:
return CHANGE_SUBCATEGORY_MESSAGING_AND_MISSION_GOALS;
case OP_ADD_GOAL:
@@ -20462,6 +20633,13 @@ sexp_help_struct Sexp_help[] = {
"Using the Any Wingman option silences for all ships in wings.\r\n"
"\tAll:\tName of ship to allow to talk." },
// Karajorma
{ OP_SET_PERSONA, "Set Persona (Action operator)\r\n"
"\tSets the persona of the supplied ship to the persona supplied\r\n"
"Takes 2 or more arguments...\r\n"
"\t1:\tPersona to use."
"\tRest:\tName of the ship." },
{ OP_SELF_DESTRUCT, "Self destruct (Action operator)\r\n"
"\tCauses the specified ship(s) to self destruct.\r\n\r\n"
"Takes 1 or more arguments...\r\n"
@@ -21342,6 +21520,12 @@ sexp_help_struct Sexp_help[] = {
{ OP_IS_TAGGED, "is-tagged\r\n"
"\tReturns whether a given ship is tagged or not\r\n"},
{ OP_IS_PLAYER, "is-player\r\n"
"\tReturns true if all the ships specified are currently under control of a player.\r\n"
"\t1 \t(SinglePlayer) When true ships under AI control return false even if they are the player ship\r\n"
"\t \t(Multiplayer) When true ships that are respawning return true if the player is still connected\r\n"
"\tRest \tList of ships to test"},
{ OP_NUM_KILLS, "num-kills\r\n"
"\tReturns the # of kills a player has. The ship specified in the first field should be the ship the player is in.\r\n"
"\tSo, for single player, this would be Alpha 1. For multiplayer, it can be any ship with a player in it. If, at any\r\n"
+10 -3
View File
@@ -943,6 +943,9 @@ struct ship_subsys;
#define OPF_NEBULA_POOF 58 // phreak - name of a nebula poof
#define OPF_TURRET_TARGET_ORDER 59 // WMC - name of a turret target type (see aiturret.cpp)
#define OPF_SUBSYSTEM_OR_NONE 60 // Goober5000 - an "optional" subsystem argument
#define OPF_PERSONA 61 // Karajorma - name of a persona
#define OPF_SUBSYS_OR_GENERIC 62 // Karajorma - a subsystem or a generic name (like engine) which covers all subsystems of that type
// Operand return types
#define OPR_NUMBER 1 // returns number
@@ -1139,6 +1142,7 @@ struct ship_subsys;
#define OP_SHIP_SCORE (0x0030 | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_SHIP_DEATHS (0x0031 | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_RESPAWNS_LEFT (0x0032 | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_IS_PLAYER (0x0033 | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
// conditional sexpressions
@@ -1347,8 +1351,8 @@ struct ship_subsys;
#define OP_SET_CAMERA_SHUDDER (0x00b2 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_ALLOW_TREASON (0x00b3 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_SHIP_COPY_DAMAGE (0x00b4 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_CHANGE_SUBSYSTEM_NAME (0x00b5 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_CHANGE_SUBSYSTEM_NAME (0x00b5 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_SET_PERSONA (0x00b6 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Karajorma
/* made obsolete by Goober5000
@@ -1447,7 +1451,9 @@ struct ship_subsys;
// defines for string constants
#define SEXP_HULL_STRING "Hull"
#define SEXP_SIM_HULL_STRING "Simulated Hull"
#define SEXP_SIM_HULL_STRING "Simulated Hull"
#define SEXP_ALL_ENGINES_STRING "<All Engines>"
#define SEXP_ALL_TURRETS_STRING "<All Turrets>"
#define SEXP_ARGUMENT_STRING "<argument>"
#define SEXP_NONE_STRING "<none>"
@@ -1605,6 +1611,7 @@ char *CTEXT(int n);
#define SEXP_CHECK_INVALID_SOUNDTRACK_NAME -136
#define SEXP_CHECK_INVALID_INTEL_NAME -137
#define SEXP_CHECK_INVALID_SKYBOX_NAME -138
#define SEXP_CHECK_INVALID_PERSONA_NAME -139
#define TRAINING_CONTEXT_SPEED (1<<0)
#define TRAINING_CONTEXT_FLY_PATH (1<<1)
+4 -4
View File
@@ -456,13 +456,13 @@ class flash_ball{
public:
// flash_ball():ray(NULL),n_rays(0){}
flash_ball(int number, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*center = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255)
flash_ball(int number, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*pcenter = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255)
:ray(NULL),n_rays(0)
{initialize(number, min_ray_width, max_ray_width , dir , center , outer , inner , max_r , max_g , max_b , min_r , min_g ,min_b);}
{initialize(number, min_ray_width, max_ray_width , dir , pcenter , outer , inner , max_r , max_g , max_b , min_r , min_g ,min_b);}
~flash_ball(){if(ray)vm_free(ray);}
void initialize(int number, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*center = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255);
void initialize(ubyte *bsp_data, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*center = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255);
void initialize(int number, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*pcenter = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255);
void initialize(ubyte *bsp_data, float min_ray_width, float max_ray_width = 0, vec3d* dir = &vmd_zero_vector, vec3d*pcenter = &vmd_zero_vector, float outer = PI2, float inner = 0.0f, ubyte max_r = 255, ubyte max_g = 255, ubyte max_b = 255, ubyte min_r = 255, ubyte min_g = 255, ubyte min_b = 255);
void render(float rad, float intinsity, float life);
};
#endif
+1 -1
View File
@@ -721,7 +721,7 @@ int g3_draw_polygon(vec3d *pos, matrix *ori, float width, float height, int tmap
//Let's begin.
const int NUM_VERTICES = 4;
vec3d p[NUM_VERTICES] = {0};
vec3d p[NUM_VERTICES] = { ZERO_VECTOR };
vertex v[NUM_VERTICES];
//float h = sqrt(2*(radius*radius));
+122 -61
View File
@@ -2499,7 +2499,8 @@ flag_def_list Subsystem_flags[] = {
{ "untargetable", MSS_FLAG_UNTARGETABLE, 0 },
{ "carry no damage", MSS_FLAG_CARRY_NO_DAMAGE, 0 },
{ "use multiple guns", MSS_FLAG_USE_MULTIPLE_GUNS, 0 },
{ "fire down normals", MSS_FLAG_FIRE_ON_NORMAL, 0 }
{ "fire down normals", MSS_FLAG_FIRE_ON_NORMAL, 0 },
{ "check hull", MSS_FLAG_TURRET_HULL_CHECK, 0 }
};
int Num_subsystem_flags = sizeof(Subsystem_flags)/sizeof(flag_def_list);
@@ -3340,7 +3341,7 @@ int parse_ship(char *filename, bool replace)
stuff_vector(&sip->max_vel);
// calculate the max speed from max_velocity
sip->max_speed = vm_vec_mag(&sip->max_vel);
sip->max_speed = sip->max_vel.xyz.z; //vm_vec_mag(&sip->max_vel);
if(optional_string("$Rotation Time:"))
{
@@ -5014,7 +5015,7 @@ void ship_set_default_player_ship()
void parse_shiptbl(char *filename)
{
int i, j, rval;
int rval;
// open localization
lcl_ext_open();
@@ -5066,48 +5067,6 @@ void parse_shiptbl(char *filename)
//Set default player ship
ship_set_default_player_ship();
// Goober5000 - validate ballistic primaries
for(i = 0; i < Num_ship_classes; i++)
{
int pbank_capacity_specified = 0;
ship_info *sip = &Ship_info[i];
// determine whether this ship had primary capacities specified for it
for (j = 0; j < sip->num_primary_banks; j++)
{
if (sip->primary_bank_ammo_capacity[j] > 0)
{
pbank_capacity_specified = 1;
break;
}
}
// be friendly; ensure ballistic flags check out
if (pbank_capacity_specified)
{
if (!(sip->flags & SIF_BALLISTIC_PRIMARIES))
{
Warning(LOCATION, "Pbank capacity specified for non-ballistic-primary-enabled ship %s.\nResetting capacities to 0.\n", sip->name);
for (j = 0; j < MAX_SHIP_PRIMARY_BANKS; j++)
{
sip->primary_bank_ammo_capacity[j] = 0;
}
}
}
else
{
if (sip->flags & SIF_BALLISTIC_PRIMARIES)
{
Warning(LOCATION, "Pbank capacity not specified for ballistic-primary-enabled ship %s.\nDefaulting to capacity of 1 per bank.\n", sip->name);
for (j = 0; j < MAX_SHIP_PRIMARY_BANKS; j++)
{
sip->primary_bank_ammo_capacity[j] = 1;
}
}
}
}
// add tbl/tbm to multiplayer validation list
fs2netd_add_table_validation(filename);
@@ -5141,6 +5100,58 @@ int ship_show_velocity_dot = 0;
DCF_BOOL( show_velocity_dot, ship_show_velocity_dot )
// clean up ship entries, making sure various flags and settings are correct
void ship_parse_post_cleanup()
{
int i, j;
ship_info *sip;
for (i = 0; i < Num_ship_classes; i++) {
sip = &Ship_info[i];
// ballistic primary fixage...
{
bool pbank_capacity_specified = false;
// determine whether this ship had primary capacities specified for it
for (j = 0; j < sip->num_primary_banks; j++) {
if (sip->primary_bank_ammo_capacity[j] > 0) {
pbank_capacity_specified = true;
break;
}
}
// be friendly; ensure ballistic flags check out
if (pbank_capacity_specified) {
if ( !(sip->flags & SIF_BALLISTIC_PRIMARIES) ) {
Warning(LOCATION, "Pbank capacity specified for non-ballistic-primary-enabled ship %s.\nResetting capacities to 0.\n", sip->name);
for (j = 0; j < MAX_SHIP_PRIMARY_BANKS; j++) {
sip->primary_bank_ammo_capacity[j] = 0;
}
}
} else {
if (sip->flags & SIF_BALLISTIC_PRIMARIES) {
Warning(LOCATION, "Pbank capacity not specified for ballistic-primary-enabled ship %s.\nDefaulting to capacity of 1 per bank.\n", sip->name);
for (j = 0; j < MAX_SHIP_PRIMARY_BANKS; j++) {
sip->primary_bank_ammo_capacity[j] = 1;
}
}
}
} // ... ballistic primaries
// ultra stupid compatbility handling for the once broken "generate hud" flag.
// it was previously testing the afterburner flag, so that's what we check for that
if ( (sip->shield_icon_index == 255) && (sip->flags & SIF_AFTERBURNER)
&& !(sip->flags2 & SIF2_GENERATE_HUD_ICON) )
{
Warning(LOCATION, "Compatibility warning:\nNo shield icon specified for '%s' but the \"generate icon\" flag is not specified.\nEnabling flag by default.\n", sip->name);
sip->flags2 |= SIF2_GENERATE_HUD_ICON;
}
}
}
// Called once at the beginning of the game to parse ships.tbl and stuff the Ship_info[]
// structure
void ship_init()
@@ -5193,6 +5204,8 @@ void ship_init()
//Then other ones
parse_modular_table(NOX("*-shp.tbm"), parse_shiptbl);
ship_parse_post_cleanup();
ships_inited = 1;
// cleanup
@@ -7926,10 +7939,22 @@ void ship_dying_frame(object *objp, int ship_num)
}
if ( timestamp_elapsed(shipp->really_final_death_time)) {
// Copied from lock all turrets sexp
// Locks all turrets on ship that is about to split.
ship_subsys *subsys;
subsys = GET_FIRST(&shipp->subsys_list);
while ( subsys != END_OF_LIST(&shipp->subsys_list) )
{
// just mark all turrets as locked
if (subsys->system_info->type == SUBSYSTEM_TURRET) {
subsys->weapons.flags |= SW_FLAG_TURRET_LOCK;
}
subsys = GET_NEXT(subsys);
}
//mprintf(( "Ship really dying!!\n" ));
// do large_ship_split and explosion
if ( shipp->large_ship_blowup_index >= 0 ) {
if ( shipp->large_ship_blowup_index >= 0 ) {
if ( shipfx_large_blowup_do_frame(shipp, flFrametime) ) {
// do all accounting for respawning client and server side here.
if(objp == Player_obj) {
@@ -9340,6 +9365,22 @@ void ship_model_change(int n, int ship_type)
}
}
if (sp->shield_integrity != NULL) {
vm_free(sp->shield_integrity);
sp->shield_integrity = NULL;
}
// Allocate shield and initialize it.
if (pm->shield.ntris) {
sp->shield_integrity = (float *) vm_malloc(sizeof(float) * pm->shield.ntris);
for (i = 0; i < pm->shield.ntris; i++) {
sp->shield_integrity[i] = 1.0f;
}
} else {
sp->shield_integrity = NULL;
}
for (i=0; i<sip->num_detail_levels; i++ ) {
pm->detail_depth[i] = i2fl(sip->detail_distance[i]);
}
@@ -9360,6 +9401,7 @@ void ship_model_change(int n, int ship_type)
void change_ship_type(int n, int ship_type, int by_sexp)
{
ship_info *sip;
ship_info *sip_orig;
ship *sp;
object *objp;
float hull_pct, shield_pct;
@@ -9367,6 +9409,7 @@ void change_ship_type(int n, int ship_type, int by_sexp)
Assert( n >= 0 && n < MAX_SHIPS );
sp = &Ships[n];
sip = &(Ship_info[ship_type]);
sip_orig = &Ship_info[sp->ship_info_index];
objp = &Objects[sp->objnum];
// Goober5000 - maintain the original hull and shield percentages when called by sexp
@@ -9399,11 +9442,8 @@ void change_ship_type(int n, int ship_type, int by_sexp)
// Goober5000 - extra checks
Assert(hull_pct > 0.0f && hull_pct <= 1.0f);
Assert(shield_pct >= 0.0f && shield_pct <= 1.0f);
if (hull_pct <= 0.0f) hull_pct = 0.1f;
if (hull_pct > 1.0f) hull_pct = 1.0f;
if (shield_pct < 0.0f) shield_pct = 0.0f;
if (shield_pct > 1.0f) shield_pct = 1.0f;
CLAMP(hull_pct, 0.1f, 1.0f);
CLAMP(shield_pct, 0.0f, 1.0f);
// point to new ship data
ship_model_change(n, ship_type);
@@ -9412,7 +9452,6 @@ void change_ship_type(int n, int ship_type, int by_sexp)
//WMC - set warp effects
ship_set_warp_effects(objp, sip);
// set the correct hull strength
if (Fred_running) {
sp->ship_max_hull_strength = 100.0f;
@@ -9440,15 +9479,18 @@ void change_ship_type(int n, int ship_type, int by_sexp)
sp->ship_max_shield_strength = sip->max_shield_strength;
}
// make sure that shields are enabled if they need to be
if (sp->ship_max_shield_strength > 0.0f) {
objp->flags &= ~OF_NO_SHIELDS;
}
shield_set_strength(objp, shield_pct * sp->ship_max_shield_strength);
}
// Goober5000: div-0 checks
Assert(sp->ship_max_hull_strength > 0.0f);
Assert(objp->hull_strength > 0.0f);
// subsys stuff done only after hull stuff is set
// if the subsystem list is not currently empty, then we need to clear it out first.
@@ -9457,7 +9499,11 @@ void change_ship_type(int n, int ship_type, int by_sexp)
// fix up the subsystems
subsys_set( sp->objnum );
sp->afterburner_fuel = sip->afterburner_fuel_capacity;
sp->afterburner_fuel = MAX(0, sip->afterburner_fuel_capacity - (sip_orig->afterburner_fuel_capacity - sp->afterburner_fuel));
sp->cmeasure_count = MAX(0, sip->cmeasure_max - (sip_orig->cmeasure_max - sp->cmeasure_count));
sp->current_max_speed = sip->max_speed * (sp->current_max_speed / sip_orig->max_speed);
ship_set_default_weapons(sp, sip);
physics_ship_init(&Objects[sp->objnum]);
@@ -9469,7 +9515,9 @@ void change_ship_type(int n, int ship_type, int by_sexp)
// above removed by Goober5000 in favor of new ship_set_new_ai_class function :)
ship_set_new_ai_class(n, sip->ai_class);
model_anim_set_initial_states(sp);
//======================================================
// Bobboau's thruster stuff again
@@ -10327,7 +10375,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
int pt; //point
if (winfo_p->wi_flags2 & WIF2_CYCLE){
//pnt = pm->gun_banks[bank_to_fire].pnt[shipp->last_fired_point[bank_to_fire]+j%num_slots];
pt = shipp->last_fired_point[bank_to_fire]+j%num_slots;
pt = (shipp->last_fired_point[bank_to_fire]+j)%num_slots;
//mprintf(("fireing from %d\n",shipp->last_fired_point[bank_to_fire]+j%num_slots));
}else{
//pnt = pm->gun_banks[bank_to_fire].pnt[j];
@@ -10361,8 +10409,6 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
vec3d firing_vec, last_delta_vec, player_forward_vec;
float dist_to_target, time_to_target, angle_to_target;
aip->targeted_subsys->system_info->subobj_num;
// If a subsystem is targeted, fire in that direction instead
if (aip->targeted_subsys != NULL)
{
@@ -10383,7 +10429,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
}
vm_vec_scale_add(&predicted_target_pos, &target_position, &target_velocity_vec, time_to_target);
polish_predicted_target_pos(&Objects[aip->target_objnum], &target_position, &predicted_target_pos, dist_to_target, &last_delta_vec, 1);
polish_predicted_target_pos(winfo_p, &Objects[aip->target_objnum], &target_position, &predicted_target_pos, dist_to_target, &last_delta_vec, 1);
vm_vec_sub(&firing_vec, &predicted_target_pos, &obj->pos);
// Deactivate autoaiming if the target leaves the autoaim-FOV cone
@@ -10475,7 +10521,7 @@ int ship_fire_primary(object * obj, int stream_weapons, int force)
if(shipp->weapon_energy < 0.0f){
shipp->weapon_energy = 0.0f;
}
}
banks_fired |= (1<<bank_to_fire); // mark this bank as fired.
@@ -11189,6 +11235,21 @@ done_secondary:
ai_maybe_announce_shockwave_weapon(obj, weapon);
}
// if we are out of ammo in this bank then don't carry over firing swarm/corkscrew
// missiles to a new bank
if (swp->secondary_bank_ammo[bank] <= 0) {
// NOTE: these are set to 1 since they will get reduced by 1 in the
// swarm/corkscrew code once this function returns
if (shipp->num_swarm_missiles_to_fire > 1) {
shipp->num_swarm_missiles_to_fire = 1;
}
if (shipp->num_corkscrew_to_fire > 1) {
shipp->num_corkscrew_to_fire = 1;
}
}
// AL 3-7-98: Move to next valid secondary bank if out of ammo
//
+16 -17
View File
@@ -1263,23 +1263,22 @@ typedef struct ship_subsys_info {
// Bits for ship.flags2
#define SF2_LIGHTS_ON (1<<0) // ship has 'GLOW' lights turned on (Bobboau's lights)
#define SF2_PRIMITIVE_SENSORS (1<<1) // Goober5000 - primitive sensor display
#define SF2_FRIENDLY_STEALTH_INVIS (1<<2) // Goober5000 - when stealth, don't appear on radar even if friendly
#define SF2_STEALTH (1<<3) // Goober5000 - is this particular ship stealth
#define SF2_DONT_COLLIDE_INVIS (1<<4) // Goober5000 - is this particular ship don't-collide-invisible
#define SF2_NO_SUBSPACE_DRIVE (1<<5) // Goober5000 - this ship has no subspace drive
#define SF2_NAVPOINT_CARRY (1<<6) // Kazan - This ship autopilots with the player
#define SF2_AFFECTED_BY_GRAVITY (1<<7) // Goober5000 - ship affected by gravity points
#define SF2_TOGGLE_SUBSYSTEM_SCANNING (1<<8) // Goober5000 - switch whether subsystems are scanned
#define SF2_NO_BUILTIN_MESSAGES (1<<9) // Karajorma - ship should not send built-in messages
#define SF2_PRIMARIES_LOCKED (1<<10) // Karajorma - This ship can't fire primary weapons
#define SF2_SECONDARIES_LOCKED (1<<11) // Karajorma - This ship can't fire secondary weapons
#define SF2_GLOWMAPS_DISABLED (1<<12) // taylor - to disable glow maps
#define SF2_NO_DEATH_SCREAM (1<<13) // Goober5000 - for WCS
#define SF2_ALWAYS_DEATH_SCREAM (1<<14) // Goober5000 - for WCS
#define SF2_NAVPOINT_NEEDSLINK (1<<15) // Kazan - This ship requires "linking" for autopilot (when player ship gets within specified distance SF2_NAVPOINT_NEEDSLINK is replaced by SF2_NAVPOINT_CARRY)
#define SF2_USE_ALT_NAME_AS_CALLSIGN (1<<16) // Karajorma - When sending messages from this ship use the alt name instead of name
#define SF2_PRIMITIVE_SENSORS (1<<0) // Goober5000 - primitive sensor display
#define SF2_FRIENDLY_STEALTH_INVIS (1<<1) // Goober5000 - when stealth, don't appear on radar even if friendly
#define SF2_STEALTH (1<<2) // Goober5000 - is this particular ship stealth
#define SF2_DONT_COLLIDE_INVIS (1<<3) // Goober5000 - is this particular ship don't-collide-invisible
#define SF2_NO_SUBSPACE_DRIVE (1<<4) // Goober5000 - this ship has no subspace drive
#define SF2_NAVPOINT_CARRY (1<<5) // Kazan - This ship autopilots with the player
#define SF2_AFFECTED_BY_GRAVITY (1<<6) // Goober5000 - ship affected by gravity points
#define SF2_TOGGLE_SUBSYSTEM_SCANNING (1<<7) // Goober5000 - switch whether subsystems are scanned
#define SF2_NO_BUILTIN_MESSAGES (1<<8) // Karajorma - ship should not send built-in messages
#define SF2_PRIMARIES_LOCKED (1<<9) // Karajorma - This ship can't fire primary weapons
#define SF2_SECONDARIES_LOCKED (1<<10) // Karajorma - This ship can't fire secondary weapons
#define SF2_GLOWMAPS_DISABLED (1<<11) // taylor - to disable glow maps
#define SF2_NO_DEATH_SCREAM (1<<12) // Goober5000 - for WCS
#define SF2_ALWAYS_DEATH_SCREAM (1<<13) // Goober5000 - for WCS
#define SF2_NAVPOINT_NEEDSLINK (1<<14) // Kazan - This ship requires "linking" for autopilot (when player ship gets within specified distance SF2_NAVPOINT_NEEDSLINK is replaced by SF2_NAVPOINT_CARRY)
#define SF2_USE_ALT_NAME_AS_CALLSIGN (1<<15) // Karajorma - When sending messages from this ship use the alt name instead of name
// If any of these bits in the ship->flags are set, ignore this ship when targetting
extern int TARGET_SHIP_IGNORE_FLAGS;
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff. Show more