diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 65ff8d22a..72ed756c2 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -339,6 +339,7 @@ struct user_defs { int32 runkey_mode,statusbarscale,mouseaiming,weaponswitch,drawweapon; // JBF 20031125 int32 brightskins,democams,color,pcolor[MAXPLAYERS],msgdisptime,statusbarmode; + int32 m_noexits,noexits; int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run; int32 coords,tickrate,levelstats,m_coop,coop,screen_size,lockout,crosshair; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1b060293e..6183be0a0 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -72,6 +72,8 @@ int display_bonus_screen = 1, userconfiles = 0; static int netparamcount = 0; static char **netparam = NULL; +int votes[MAXPLAYERS], gotvote[MAXPLAYERS], voting = -1; + void setstatusbarscale(long sc) { ud.statusbarscale = min(100,max(10,sc)); @@ -422,6 +424,58 @@ if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } break; + case 18: // map vote + + if (myconnectindex == connecthead) + { + //Master re-transmits message to all others + for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) + if (i != other) + sendpacket(i,packbuf,packbufleng); + } + + switch(packbuf[1]) + { + case 0: + if(voting == myconnectindex) + { + gotvote[packbuf[2]] = 1; + votes[packbuf[2]] = packbuf[3]; + Bsprintf(tempbuf,"GOT VOTE FROM %s",ud.user_name[packbuf[2]]); + adduserquote(tempbuf); + } + break; + + case 1: // call map vote + voting = packbuf[2]; + Bsprintf(tempbuf,"%s HAS CALLED A VOTE FOR MAP %s",ud.user_name[packbuf[2]],level_names[packbuf[3]*11 + packbuf[4]]); + adduserquote(tempbuf); + Bsprintf(tempbuf,"PRESS F1 TO VOTE YES, F2 TO VOTE NO"); + adduserquote(tempbuf); + Bmemset(votes,0,sizeof(votes)); + Bmemset(gotvote,0,sizeof(gotvote)); + gotvote[voting] = votes[voting] = 1; + break; + + case 2: // cancel map vote + if(packbuf[2] == voting) + { + voting = -1; + i = 0; + for(j=0;j=0;i=connectpoint2[i]) if (i != other) sendpacket(i,packbuf,packbufleng); + if(voting != -1) + adduserquote("VOTE SUCCEEDED"); + ud.m_level_number = ud.level_number = packbuf[1]; ud.m_volume_number = ud.volume_number = packbuf[2]; ud.m_player_skill = ud.player_skill = packbuf[3]; @@ -586,6 +643,7 @@ if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } ud.m_coop = packbuf[8]; ud.m_marker = ud.marker = packbuf[9]; ud.m_ffire = ud.ffire = packbuf[10]; + ud.m_noexits = ud.noexits = packbuf[11]; for(i=connecthead;i>=0;i=connectpoint2[i]) { @@ -644,36 +702,6 @@ if( !(ps[myconnectindex].gm&MODE_GAME) ) { OSD_DispatchQueued(); } FX_PlayWAV3D(rtsptr,0,0,0,255,-packbuf[1]); rtsplaying = 7; break; - case 8: - //Slaves in M/S mode only send to master - //Master re-transmits message to all others - if ((!networkmode) && (myconnectindex == connecthead)) - for(i=connectpoint2[connecthead];i>=0;i=connectpoint2[i]) - if (i != other) sendpacket(i,packbuf,packbufleng); - - ud.m_level_number = ud.level_number = packbuf[1]; - ud.m_volume_number = ud.volume_number = packbuf[2]; - ud.m_player_skill = ud.player_skill = packbuf[3]; - ud.m_monsters_off = ud.monsters_off = packbuf[4]; - ud.m_respawn_monsters = ud.respawn_monsters = packbuf[5]; - ud.m_respawn_items = ud.respawn_items = packbuf[6]; - ud.m_respawn_inventory = ud.respawn_inventory = packbuf[7]; - ud.m_coop = ud.coop = packbuf[8]; - ud.m_marker = ud.marker = packbuf[9]; - ud.m_ffire = ud.ffire = packbuf[10]; - - copybufbyte(packbuf+10,boardfilename,packbufleng-11); - boardfilename[packbufleng-11] = 0; - - for(i=connecthead;i>=0;i=connectpoint2[i]) - { - resetweapons(i); - resetinventory(i); - } - - newgame(ud.volume_number,ud.level_number,ud.player_skill); - if (enterlevel(MODE_GAME)) backtomenu(); - break; case 16: movefifoend[other] = movefifoplc = movefifosendplc = fakemovefifoplc = 0; @@ -2062,18 +2090,18 @@ void operatefta(void) if (ps[screenpeek].ftq == 115 || ps[screenpeek].ftq == 116) { - k = quotebot; - for(i=0;i TEXTWRAPLEN) - { - l -= TEXTWRAPLEN; - k -= scale(8,200,ScreenHeight); - } - } + k = quotebot-8; + /* for(i=0;i TEXTWRAPLEN) + { + l -= TEXTWRAPLEN; + k -= 8; + } + } */ k -= 4; } @@ -6809,9 +6837,10 @@ FOUNDCHEAT: tempbuf[8] = ud.m_coop; tempbuf[9] = ud.m_marker; tempbuf[10] = ud.m_ffire; + tempbuf[11] = ud.m_noexits; for(i=connecthead;i>=0;i=connectpoint2[i]) - sendpacket(i,tempbuf,11); + sendpacket(i,tempbuf,12); } else ps[myconnectindex].gm |= MODE_RESTART; @@ -7157,6 +7186,42 @@ void nonsharedkeys(void) inputloc = 0; } + if(gotvote[myconnectindex] == 0 && voting != -1) + { + gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2); + if(KB_KeyPressed(sc_F1)) + { + KB_ClearKeyDown(sc_F1); + tempbuf[0] = 18; + tempbuf[1] = 0; + tempbuf[2] = myconnectindex; + tempbuf[3] = 1; + + for(i=connecthead;i >= 0;i=connectpoint2[i]) + { + if (i != myconnectindex) sendpacket(i,tempbuf,4); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + adduserquote("VOTE CAST"); + gotvote[myconnectindex] = 1; + } + else if(KB_KeyPressed(sc_F2)) + { + KB_ClearKeyDown(sc_F2); + tempbuf[0] = 18; + tempbuf[1] = 0; + tempbuf[2] = myconnectindex; + tempbuf[3] = 0; + + for(i=connecthead;i >= 0;i=connectpoint2[i]) + { + if (i != myconnectindex) sendpacket(i,tempbuf,4); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + adduserquote("VOTE CAST"); + gotvote[myconnectindex] = 1; + } + } if( KB_KeyPressed(sc_F1) || ( ud.show_help && ( KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) ) ) ) { KB_ClearKeyDown(sc_F1); @@ -9071,11 +9136,13 @@ char opendemoread(char which_demo) // 0 = mine if (kread(recfilep,(int32 *)&ps[i].weaponswitch,sizeof(int32)) != sizeof(int32)) goto corrupt; if (kread(recfilep,(int32 *)&ud.pcolor[i],sizeof(int32)) != sizeof(int32)) goto corrupt; ps[i].palookup = ud.pcolor[i]; + if (kread(recfilep,(int32 *)&ud.m_noexits,sizeof(int32)) != sizeof(int32)) goto corrupt; } else { if (kread(recfilep,(int32 *)&ps[i].aim_mode,sizeof(char)) != sizeof(char)) goto corrupt; OSD_Printf("aim_mode: %d\n",ps[i].aim_mode); ps[i].auto_aim = 1; ps[i].weaponswitch = 3; + ud.m_noexits = 0; } } @@ -9125,6 +9192,7 @@ void opendemowrite(void) fwrite((int32 *)&ps[i].auto_aim,sizeof(int32),1,frecfilep); // JBF 20031126 fwrite(&ps[i].weaponswitch,sizeof(int32),1,frecfilep); fwrite(&ud.pcolor[i],sizeof(int32),1,frecfilep); + fwrite((int32 *)&ud.m_noexits,sizeof(int32),1,frecfilep); } totalreccnt = 0; @@ -9992,7 +10060,7 @@ char domovethings(void) adduserquote(buf); Bstrcpy(fta_quotes[116],buf); - ps[myconnectindex].ftq = 116, ps[myconnectindex].fta = 60; + ps[myconnectindex].ftq = 116, ps[myconnectindex].fta = 180; if(j < 0 && networkmode == 0 ) gameexit( "The server/master player just quit the game; disconnected."); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 6c5dbb757..0a2cc1429 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -803,6 +803,8 @@ LABELS userdefslabels[]= { { "color", USERDEFS_COLOR, 0, 0 }, { "msgdisptime", USERDEFS_MSGDISPTIME, 0, 0 }, { "statusbarmode", USERDEFS_STATUSBARMODE, 0, 0 }, + { "m_noexits", USERDEFS_M_NOEXITS, 0, 0 }, + { "noexits", USERDEFS_NOEXITS, 0, 0 }, { "", -1, 0, 0 } // END OF LIST }; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index df55314a6..d124a52f7 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -285,7 +285,9 @@ enum userdefslabels { USERDEFS_DEMOCAMS, USERDEFS_COLOR, USERDEFS_MSGDISPTIME, - USERDEFS_STATUSBARMODE + USERDEFS_STATUSBARMODE, + USERDEFS_M_NOEXITS, + USERDEFS_NOEXITS }; enum sectorlabels { diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 232eec26a..c1eb6b896 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -624,6 +624,20 @@ void DoUserDef(char bSet, long lLabelID, long lVar2, short sActor, short sPlayer SetGameVarID((int)lVar2, ud.statusbarmode, sActor, sPlayer); break; + case USERDEFS_M_NOEXITS: + if(bSet) + ud.m_noexits = lValue; + else + SetGameVarID((int)lVar2, ud.m_noexits, sActor, sPlayer); + break; + + case USERDEFS_NOEXITS: + if(bSet) + ud.noexits = lValue; + else + SetGameVarID((int)lVar2, ud.noexits, sActor, sPlayer); + break; + default: break; } @@ -4209,9 +4223,10 @@ SKIPJIBS: tempbuf[8] = ud.m_coop; tempbuf[9] = ud.m_marker; tempbuf[10] = ud.m_ffire; + tempbuf[11] = ud.m_noexits; for(i=connecthead;i>=0;i=connectpoint2[i]) - sendpacket(i,tempbuf,11); + sendpacket(i,tempbuf,12); } else { ps[myconnectindex].gm |= MODE_EOL; display_bonus_screen = 0; } // MODE_RESTART; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index db7b9d8d8..4ebd1f5a7 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -33,7 +33,7 @@ int last_menu; short sh,onbar,buttonstat,deletespot; short last_zero,last_fifty,last_onehundred,last_twoohtwo,last_threehundred = 0; -static char fileselect = 1, menunamecnt, menuname[256][64]; +static char menunamecnt; static CACHE1D_FIND_REC *finddirs=NULL, *findfiles=NULL, *finddirshigh=NULL, *findfileshigh=NULL; static int numdirs=0, numfiles=0; @@ -45,6 +45,8 @@ static int vidsets[16] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }, cu static char *mousebuttonnames[] = { "Left", "Right", "Middle", "Thumb", "Wheel Down", "Wheel Up" }; +extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting; + void cmenu(short cm) { current_menu = cm; @@ -3963,80 +3965,107 @@ VOLUME_ALL_40x: if (menunamecnt == 0) cmenu(600); } + case 603: - c = (320>>1) - 120; - displayfragbar(); - rotatesprite(320>>1<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); - menutext(320>>1,24,0,0,"USER MAPS"); - for(x=0;x 256 ) ) - { - KB_ClearKeyDown( sc_RightArrow ); - KB_ClearKeyDown( sc_kpad_6 ); - probey += 15; - if(probey >= menunamecnt) - probey -= 15; - else sound(KICK_HIT); - } + x = probe(186,124,0,0); - onbar = 0; - x = probe(0,0,0,menunamecnt); + if (x == -1) { + if(voting != -1) + { + Bmemset(votes,0,sizeof(votes)); + Bmemset(gotvote,0,sizeof(gotvote)); - if(x == -1) cmenu(600); - else if(x >= 0) - { - tempbuf[0] = 8; - tempbuf[1] = ud.m_level_number = 6; - tempbuf[2] = ud.m_volume_number = 0; - tempbuf[3] = ud.m_player_skill+1; + tempbuf[0] = 18; + tempbuf[1] = 2; + tempbuf[2] = myconnectindex; - if(ud.player_skill == 3) - ud.m_respawn_monsters = 1; - else ud.m_respawn_monsters = 0; - - if(ud.m_coop == 0) ud.m_respawn_items = 1; - else ud.m_respawn_items = 0; - - ud.m_respawn_inventory = 1; - - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - - x = strlen(menuname[probey]); - - copybufbyte(menuname[probey],tempbuf+10,x); - copybufbyte(menuname[probey],boardfilename,x+1); - - for(c=connecthead;c>=0;c=connectpoint2[c]) - { - if (c != myconnectindex) sendpacket(c,tempbuf,x+10); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + for(c=connecthead;c>=0;c=connectpoint2[c]) + { + if(c != myconnectindex) sendpacket(c,tempbuf,3); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + voting = -1; + } + cmenu(0); } - newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1); - if (enterlevel(MODE_GAME)) backtomenu(); - } - break; + for(i=0;i (numplayers>>1))) + { + if(plrvotes > (numplayers>>1) || !ps[myconnectindex].i) + { + tempbuf[0] = 5; + tempbuf[1] = ud.m_level_number; + tempbuf[2] = ud.m_volume_number; + tempbuf[3] = ud.m_player_skill+1; + if( ud.m_player_skill == 3 ) ud.m_respawn_monsters = 1; + else ud.m_respawn_monsters = 0; + + if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN)) ud.m_respawn_items = 1; + else ud.m_respawn_items = 0; + + ud.m_respawn_inventory = 1; + + tempbuf[4] = ud.m_monsters_off; + tempbuf[5] = ud.m_respawn_monsters; + tempbuf[6] = ud.m_respawn_items; + tempbuf[7] = ud.m_respawn_inventory; + tempbuf[8] = ud.m_coop; + tempbuf[9] = ud.m_marker; + tempbuf[10] = ud.m_ffire; + tempbuf[11] = ud.m_noexits; + + for(c=connecthead;c>=0;c=connectpoint2[c]) + { + resetweapons(c); + resetinventory(c); + + } + for(c=connecthead;c>=0;c=connectpoint2[c]) + { + if(c != myconnectindex) sendpacket(c,tempbuf,12); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + + if(voting != -1) + adduserquote("VOTE SUCCEEDED"); + + newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1); + if (enterlevel(MODE_GAME)) backtomenu(); + + return; + } + else if(j == numplayers) { + Bmemset(votes,0,sizeof(votes)); + Bmemset(gotvote,0,sizeof(gotvote)); + + tempbuf[0] = 18; + tempbuf[1] = 2; + tempbuf[2] = myconnectindex; + tempbuf[3] = 1; + + for(c=connecthead;c>=0;c=connectpoint2[c]) + { + if(c != myconnectindex) sendpacket(c,tempbuf,4); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + voting = -1; + adduserquote("VOTE FAILED"); + cmenu(0); + } + } else { + gametext(160,60,"WAITING FOR VOTES",0,2); + } + break; + } case 600: c = (320>>1) - 120; if((ps[myconnectindex].gm&MODE_GAME) != MODE_GAME) @@ -4053,8 +4082,9 @@ VOLUME_ALL_40x: if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_MARKEROPTION)) modval(0,1,(int *)&ud.m_marker,1,probey==4); - if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_COOP)) + if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY)) modval(0,1,(int *)&ud.m_ffire,1,probey==5); + else modval(0,1,(int *)&ud.m_noexits,1,probey==5); switch(x) { @@ -4110,98 +4140,43 @@ VOLUME_ALL_40x: break; case 5: - if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_COOP)) + if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY)) ud.m_ffire = !ud.m_ffire; + else ud.m_noexits = !ud.m_noexits; break; case 6: if (VOLUMEALL) { - /* if(boardfilename[0] == 0) break; - - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number = 7; - tempbuf[2] = ud.m_volume_number = 0; - tempbuf[3] = ud.m_player_skill+1; - - ud.level_number = ud.m_level_number; - ud.volume_number = ud.m_volume_number; - - if( ud.m_player_skill == 3 ) ud.m_respawn_monsters = 1; - else ud.m_respawn_monsters = 0; - - if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN)) ud.m_respawn_items = 1; - else ud.m_respawn_items = 0; - - ud.m_respawn_inventory = 1; - - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - - for(c=connecthead;c>=0;c=connectpoint2[c]) - { - resetweapons(c); - resetinventory(c); - } - for(c=connecthead;c>=0;c=connectpoint2[c]) - { - if (c != myconnectindex) sendpacket(c,tempbuf,11); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } - - newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1); - if (enterlevel(MODE_GAME)) backtomenu(); - - return; */ currentlist = 1; last_probey = probey; cmenu(101); } break; case 7: - - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number; - tempbuf[2] = ud.m_volume_number; - tempbuf[3] = ud.m_player_skill+1; - - if( ud.m_player_skill == 3 ) ud.m_respawn_monsters = 1; - else ud.m_respawn_monsters = 0; - - if((gametype_flags[ud.m_coop] & GAMETYPE_FLAG_ITEMRESPAWN)) ud.m_respawn_items = 1; - else ud.m_respawn_items = 0; - - ud.m_respawn_inventory = 1; - - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - - for(c=connecthead;c>=0;c=connectpoint2[c]) + if(voting == -1) { - resetweapons(c); - resetinventory(c); + if(ps[myconnectindex].i) + { + Bmemset(votes,0,sizeof(votes)); + Bmemset(gotvote,0,sizeof(gotvote)); + votes[myconnectindex] = gotvote[myconnectindex] = 1; + voting = myconnectindex; + tempbuf[0] = 18; + tempbuf[1] = 1; + tempbuf[2] = myconnectindex; + tempbuf[3] = ud.m_volume_number; + tempbuf[4] = ud.m_level_number; + + for(c=connecthead;c>=0;c=connectpoint2[c]) + { + if(c != myconnectindex) sendpacket(c,tempbuf,5); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } + } + cmenu(603); } - for(c=connecthead;c>=0;c=connectpoint2[c]) - { - if(c != myconnectindex) sendpacket(c,tempbuf,11); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } - - newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1); - if (enterlevel(MODE_GAME)) backtomenu(); - - return; - + break; } c += 40; @@ -4223,8 +4198,9 @@ VOLUME_ALL_40x: if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_MARKEROPTION) gametext(c+70,57+16+16+16+16-7-9,ud.m_marker?"ON":"OFF",MENUHIGHLIGHT(4),2+8+16); - if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_COOP) + if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) gametext(c+70,57+16+16+16+16+16-7-9,ud.m_ffire?"ON":"OFF",MENUHIGHLIGHT(5),2+8+16); + else gametext(c+70,57+16+16+16+16+16-7-9,ud.m_noexits?"OFF":"ON",MENUHIGHLIGHT(5),2+8+16); c -= 44; @@ -4248,9 +4224,9 @@ VOLUME_ALL_40x: else menutext(c,57+16+16+16+16-9,MENUHIGHLIGHT(4),1,"MARKERS"); - if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_COOP) - menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),PHX(-6),"FR. FIRE"); - else menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),1,"FR. FIRE"); + if(gametype_flags[ud.m_coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) + menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),0,"FR. FIRE"); + else menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),0,"MAP EXITS"); if (VOLUMEALL) { menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),0,"USER MAP"); @@ -4260,7 +4236,7 @@ VOLUME_ALL_40x: menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),1,"USER MAP"); } - menutext(c,57+16+16+16+16+16+16+16-9,MENUHIGHLIGHT(7),PHX(-8),"START GAME"); + menutext(c,57+16+16+16+16+16+16+16-9,MENUHIGHLIGHT(7),voting!=-1,"START GAME"); break; } diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index dadb3b057..6b0b57e4d 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -731,7 +731,7 @@ short shoot(short i,short atwith) if(hitspr >= 0) { checkhitsprite(hitspr,k); - if( sprite[hitspr].picnum == APLAYER && (!(gametype_flags[ud.coop] & GAMETYPE_FLAG_COOP) || ud.ffire == 1) ) + if( sprite[hitspr].picnum == APLAYER && (!(gametype_flags[ud.coop] & GAMETYPE_FLAG_PLAYERSFRIENDLY) || ud.ffire == 1) ) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -1237,7 +1237,7 @@ DOSKIPBULLETHOLE: if(hitspr >= 0) { checkhitsprite(hitspr,k); - if( sprite[hitspr].picnum == APLAYER && (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_COOP ) || ud.ffire == 1) ) + if( sprite[hitspr].picnum == APLAYER && (!(gametype_flags[ud.coop]&GAMETYPE_FLAG_PLAYERSFRIENDLY ) || ud.ffire == 1) ) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -3460,10 +3460,55 @@ void processinput(short snum) Bsprintf(fta_quotes[116],"KILLED %s",&ud.user_name[snum][0]); FTA(116,&ps[p->frag_ps]); } - Bsprintf(tempbuf,"%s WAS KILLED BY %s",&ud.user_name[snum][0],&ud.user_name[p->frag_ps][0]); + char *s[] = { + "%s WAS KICKED TO THE CURB BY %s", + "%s WAS PICKED OFF BY %s", + "%s TOOK %s'S SHOT TO THE FACE", + "%s DANCED THE CHAINGUN CHA-CHA WITH %s", + "%s TRIED TO MAKE A BONG OUT OF %s'S ROCKET", + "%s TOOK A FEW TOO MANY HITS OFF OF %s'S PIPE", + "%s FELT THE EFFECTS OF %s'S CORPORATE DOWNSIZING", + "%s WAS TOO COOL FOR %s", + "%s HAD HIS HORIZONS EXPANDED BY %s", + }; + switch(dynamictostatic[hittype[p->i].picnum]) { + case KNEE__STATIC: + if(hittype[p->i].temp_data[1] == 1) + i = 7; + else i = 0; + break; + case SHOTSPARK1__STATIC: + switch(ps[p->frag_ps].curr_weapon) + { + default: + case PISTOL_WEAPON: + i = 1; + break; + case SHOTGUN_WEAPON: + i = 2; + break; + case CHAINGUN_WEAPON: + i = 3; + break; + } + break; + case RPG__STATIC: i = 4; break; + case RADIUSEXPLOSION__STATIC: i = 5; break; + case SHRINKSPARK__STATIC: i = 6; break; + case GROWSPARK__STATIC: i = 8; break; + default: i = 0; break; + } + initprintf("%d\n",dynamictostatic[hittype[p->i].picnum]); + Bsprintf(tempbuf,s[i],&ud.user_name[snum][0],&ud.user_name[p->frag_ps][0]); + adduserquote(tempbuf); + } + else + { + char *s[] = { "%s KILLED HIMSELF. WHAT A TOOL!","%s TRIED TO LEAVE" }; + p->fraggedself++; + Bsprintf(tempbuf,(hittype[p->i].picnum==NUKEBUTTON)?s[1]:s[0],&ud.user_name[snum][0]); adduserquote(tempbuf); } - else p->fraggedself++; if(myconnectindex == connecthead) { diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 582b975a8..edea12953 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1461,6 +1461,8 @@ void resetmys(void) extern void adduserquote(char *daquote); +extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting; + int enterlevel(char g) { short i; @@ -1475,6 +1477,11 @@ int enterlevel(char g) ud.coop = ud.m_coop; ud.marker = ud.m_marker; ud.ffire = ud.m_ffire; + ud.noexits = ud.m_noexits; + + voting = -1; + Bmemset(votes,0,sizeof(votes)); + Bmemset(gotvote,0,sizeof(gotvote)); if( (g&MODE_DEMO) == 0 && ud.recstat == 2) ud.recstat = 0; diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 2d9d4716c..48595f71d 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -325,6 +325,10 @@ int loadplayer(signed char spot) if (kdfread(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil) != MAXTILES) goto corrupt; + if (kdfread(&ud.noexits,sizeof(ud.noexits),1,fil) != 1) goto corrupt; + ud.m_noexits = ud.noexits; + + if(ReadGameVars(fil)) goto corrupt; kclose(fil); @@ -696,6 +700,8 @@ int saveplayer(signed char spot) dfwrite(&dynamictostatic[0],sizeof(dynamictostatic[0]),MAXTILES,fil); + dfwrite(&ud.noexits,sizeof(ud.noexits),1,fil); + SaveGameVars(fil); fclose(fil); diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 8c68169b0..66abe5e97 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -3372,12 +3372,20 @@ void checksectors(short snum) if(j >= 0 && wall[j].overpicnum == 0) if(hittype[neartagsprite].temp_data[0] == 0) { - hittype[neartagsprite].temp_data[0] = 1; - sprite[neartagsprite].owner = p->i; - p->buttonpalette = sprite[neartagsprite].pal; - if(p->buttonpalette) - ud.secretlevel = sprite[neartagsprite].lotag; - else ud.secretlevel = 0; + if(ud.noexits) + { + hittype[p->i].picnum = NUKEBUTTON; + hittype[p->i].extra = 250; + } + else + { + hittype[neartagsprite].temp_data[0] = 1; + sprite[neartagsprite].owner = p->i; + p->buttonpalette = sprite[neartagsprite].pal; + if(p->buttonpalette) + ud.secretlevel = sprite[neartagsprite].lotag; + else ud.secretlevel = 0; + } } return; case WATERFOUNTAIN__STATIC: diff --git a/polymer/eduke32/source/wrapper.c b/polymer/eduke32/source/wrapper.c index a63cdb72d..77faddf4b 100755 --- a/polymer/eduke32/source/wrapper.c +++ b/polymer/eduke32/source/wrapper.c @@ -55,6 +55,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, in ZeroMemory(&pi,sizeof(pi)); si.cb = sizeof(si); + printf("Launching EDuke32...\n\nPlease leave this window open for the entire duration of your game."); + if (!CreateProcess(NULL,szCmdLine,NULL,NULL,0,0,NULL,NULL,&si,&pi)) { MessageBox(0,"Failed to start eduke32.exe.", "Failure starting game", MB_OK|MB_ICONSTOP); return 1;