Remove unused "death match" game mode code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2156 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
ac131d745f
commit
45b4dfb7b7
|
@ -3287,7 +3287,6 @@ void intDisplayWidgets(void)
|
|||
bPlayerHasHQ = getHQExists(selectedPlayer);
|
||||
|
||||
|
||||
// if(bPlayerHasHQ || (bMultiPlayer && (game.type == DMATCH)) )
|
||||
if(bPlayerHasHQ)
|
||||
{
|
||||
drawRadar();
|
||||
|
|
|
@ -3704,25 +3704,6 @@ void drawRadarBlips(void)
|
|||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// deathmatch code
|
||||
// if(bMultiPlayer && (game.type == DMATCH))
|
||||
// {
|
||||
// for (psFeature = apsFeatureLists[0]; psFeature != NULL; psFeature =
|
||||
// psFeature->psNext)
|
||||
// {
|
||||
// if( psFeature->psStats->subType == FEAT_GEN_ARTE) // it's an artifact.
|
||||
// {
|
||||
// worldPosToRadarPos(psFeature->x >> TILE_SHIFT ,
|
||||
// psFeature->y >> TILE_SHIFT, &radarX,&radarY);
|
||||
// if (radarX > 0 && radarX < (SDWORD)VisWidth && // it's visable.
|
||||
// radarY > 0 && radarY < (SDWORD)VisHeight)
|
||||
// {
|
||||
// iV_DrawImage(IntImages,(UWORD)(IMAGE_RAD_ENM3),radarX + RADTLX, radarY + RADTLY);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
/*draws blips on world to represent Proximity Messages - no longer the Green Arrow!*/
|
||||
|
|
241
src/multigifts.c
241
src/multigifts.c
|
@ -53,14 +53,6 @@
|
|||
#include "multimenu.h" // for multimenu
|
||||
#include "multistat.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//#define DMATCH_DROID_LIMIT 25 // max number of droids in a dmatch game (per player).
|
||||
|
||||
#define ENDFREQUENCY 5000 // how often to check end game conditions
|
||||
#define MAXFRAGS 10000 // max score in a frag match.
|
||||
#define MAXTIME (5*60*1000) // max time in a time limit dmatch.
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// prototypes
|
||||
|
||||
|
@ -80,7 +72,6 @@ BOOL recvGift(NETMSG *pMsg)
|
|||
from = pMsg->body[1];
|
||||
to = pMsg->body[2];
|
||||
|
||||
|
||||
switch(t)
|
||||
{
|
||||
case RADAR_GIFT:
|
||||
|
@ -767,13 +758,6 @@ void addMultiPlayerRandomArtifacts(UDWORD quantity,SDWORD type)
|
|||
NETbcast(&m,FALSE); // tell everyone.
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
BOOL addDMatchDroid(UDWORD count)
|
||||
{
|
||||
addMultiPlayerRandomArtifacts(count,FEAT_GEN_ARTE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
BOOL addOilDrum(UDWORD count)
|
||||
{
|
||||
|
@ -827,7 +811,7 @@ void giftArtifact(UDWORD owner,UDWORD x,UDWORD y)
|
|||
|
||||
if(owner == ANYPLAYER)
|
||||
{
|
||||
// foundDMatchDroid(selectedPlayer,x,y);
|
||||
// nothing nowadays
|
||||
}
|
||||
else if(owner >= MAX_PLAYERS) //1.04 bodge to stop savegame crash
|
||||
{
|
||||
|
@ -883,16 +867,6 @@ void processMultiPlayerArtifacts(void)
|
|||
position.y = pF->z;
|
||||
addEffect(&position,EFFECT_EXPLOSION,EXPLOSION_TYPE_DISCOVERY,FALSE,NULL,FALSE);
|
||||
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// x = pF->x;
|
||||
// y = pF->y;
|
||||
// removeFeature(pF); // remove artifact+ send info.
|
||||
// foundDMatchDroid(selectedPlayer, x,y);
|
||||
// addDMatchDroid(1);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
x = pF->x;
|
||||
y = pF->y;
|
||||
pl= pF->player;
|
||||
|
@ -900,7 +874,6 @@ void processMultiPlayerArtifacts(void)
|
|||
giftArtifact(pl,x,y); // reward player.
|
||||
pF->player = 0;
|
||||
audio_QueueTrack( ID_SOUND_ARTIFACT_RECOVERED );
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -921,7 +894,6 @@ void processMultiPlayerArtifacts(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* Ally team members with each other */
|
||||
void createTeamAlliances(void)
|
||||
{
|
||||
|
@ -943,214 +915,3 @@ void createTeamAlliances(void)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
// deathmatch Stuff find/add droids using artifacts.
|
||||
|
||||
// pick a template approximating the normal distribution around powerpoints.
|
||||
DROID_TEMPLATE * pickDistribTempl(UDWORD player)
|
||||
{
|
||||
DROID_TEMPLATE *psTempl;
|
||||
UDWORD i,rn,rt,dist,min=UDWORD_MAX,max=0,av=0,num=0;
|
||||
|
||||
// gather data
|
||||
for(psTempl=apsDroidTemplates[player];psTempl;psTempl=psTempl->psNext)
|
||||
{
|
||||
num++;
|
||||
av += psTempl->powerPoints;
|
||||
if(psTempl->powerPoints < min) min = psTempl->powerPoints;
|
||||
if(psTempl->powerPoints > max) max = psTempl->powerPoints;
|
||||
}
|
||||
|
||||
av = av / num; // get average build pts.
|
||||
if(av-min > max-av) // get furthest from average.
|
||||
{
|
||||
max = min;
|
||||
}
|
||||
|
||||
rn = (rand()% abs(max-av) )+ av; // pick a test level. av - max.
|
||||
rn = abs(rn - av); // rn is now a random distance from av.
|
||||
|
||||
dist = 0; //init distn
|
||||
|
||||
while(dist <= rn)
|
||||
{
|
||||
//pick a template
|
||||
rt = (rand()%num); // template to pick
|
||||
i =0;
|
||||
for(psTempl=apsDroidTemplates[player];i<rt;psTempl=psTempl->psNext)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
// distance of this template
|
||||
dist = abs(psTempl->powerPoints - av);
|
||||
}
|
||||
return psTempl;
|
||||
|
||||
}
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
// player runs into a dmatch artifact
|
||||
BOOL foundDMatchDroid(UDWORD player,UDWORD x,UDWORD y)
|
||||
{
|
||||
DROID_TEMPLATE *psTempl;
|
||||
DROID *psD;
|
||||
UDWORD count=0;
|
||||
|
||||
// check to see if player has too many droids.
|
||||
for(psD = apsDroidLists[player];psD; psD=psD->psNext)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if(count >= DMATCH_DROID_LIMIT)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
psTempl = pickDistribTempl(player); //pick a droid
|
||||
|
||||
// no longer need to turn off power, but just in case.
|
||||
powerCalc(FALSE); //turn off power temporarily.
|
||||
|
||||
psD=buildDroid( psTempl, x, y, player, FALSE);
|
||||
if(psD)
|
||||
{
|
||||
addDroid(psD,apsDroidLists); // add droid. telling everyone
|
||||
}
|
||||
powerCalc(TRUE); // power back on.
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
// check for respawn or win situations.
|
||||
BOOL deathmatchCheck(void)
|
||||
{
|
||||
UDWORD pl,maxScP;
|
||||
SDWORD maxSc;
|
||||
static BOOL gameComplete=FALSE;
|
||||
static UDWORD lastCheck=0;
|
||||
char sTemp[256];
|
||||
|
||||
// respawn check
|
||||
if(apsDroidLists[selectedPlayer] == NULL)
|
||||
{
|
||||
setPower(selectedPlayer,LEV_HI); // reset power.
|
||||
sendPowerCheck(TRUE); // tell everyone.
|
||||
|
||||
strcpy(sTemp, "multiplay/forces/");
|
||||
strcat(sTemp, sForceName);
|
||||
strcat(sTemp,".for");
|
||||
loadForce( sTemp);
|
||||
|
||||
useTheForce(FALSE);
|
||||
|
||||
cameraToHome(selectedPlayer,FALSE); // move camera.
|
||||
}
|
||||
|
||||
|
||||
// go no further if recently called.
|
||||
if(lastCheck > gameTime)lastCheck = 0;
|
||||
if(gameTime-lastCheck < ENDFREQUENCY)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
lastCheck = gameTime;
|
||||
|
||||
// end game conditions.
|
||||
// fraglimit / timelimit.
|
||||
if(NetPlay.bHost && !gameComplete)
|
||||
{
|
||||
switch(game.limit)
|
||||
{
|
||||
case FRAGLIMIT: // check for fraglimit => FRAGLIMIT
|
||||
for(pl=0; pl<MAX_PLAYERS;pl++)
|
||||
{
|
||||
if(isHumanPlayer(pl) && getMultiStats(pl,TRUE).recentScore >= MAXFRAGS)
|
||||
{
|
||||
gameComplete = TRUE;
|
||||
dMatchWinner(pl,TRUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TIMELIMIT: // check for timelimit exceeded.
|
||||
if(gameTime-ingame.startTime > MAXTIME)
|
||||
{
|
||||
// pick a winner.
|
||||
maxScP = 0;
|
||||
maxSc = 0;
|
||||
for(pl=0; pl<MAX_PLAYERS;pl++)
|
||||
{
|
||||
if(isHumanPlayer(pl) && getMultiStats(pl,FALSE).recentScore > maxSc)
|
||||
{
|
||||
maxSc = getMultiStats(pl,FALSE).recentScore;
|
||||
maxScP = pl;
|
||||
}
|
||||
}
|
||||
gameComplete == TRUE;
|
||||
dMatchWinner(pl,TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
// Winner recieved.
|
||||
|
||||
BOOL recvdMatchWinner(NETMSG *pMsg)
|
||||
{
|
||||
return dMatchWinner( (UDWORD)pMsg->body[0] ,FALSE);
|
||||
}
|
||||
|
||||
// ///////////////////////////////////////////////////////////////
|
||||
// Winner.
|
||||
static BOOL dMatchWinner(UDWORD winplayer,BOOL bcast)
|
||||
{
|
||||
NETMSG m;
|
||||
|
||||
if(bcast)
|
||||
{
|
||||
m.type = NET_DMATCHWIN; // send a netmsg.
|
||||
m.size = 1;
|
||||
m.body[0] = (UBYTE)winplayer;
|
||||
NETbcast(m,TRUE);
|
||||
}
|
||||
|
||||
// declare player winner/looser.
|
||||
if(winplayer == selectedPlayer)
|
||||
{
|
||||
displayGameOver(TRUE); // winner.
|
||||
}
|
||||
else
|
||||
{
|
||||
displayGameOver(FALSE); // looooseeer.
|
||||
}
|
||||
|
||||
// throw up the multimenu
|
||||
if(widgGetFromID(psWScreen,MULTIMENU_FORM) == NULL)
|
||||
{
|
||||
intAddMultiMenu();
|
||||
}
|
||||
|
||||
// add some effects??
|
||||
|
||||
// fire up a new level????????
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
|
@ -39,18 +39,9 @@ extern void addMultiPlayerRandomArtifacts (UDWORD quantity,SDWORD type);
|
|||
extern void processMultiPlayerArtifacts (void);
|
||||
|
||||
extern void giftArtifact (UDWORD owner,UDWORD x,UDWORD y);
|
||||
|
||||
// deathmatch stuff
|
||||
extern BOOL addOilDrum (UDWORD count);
|
||||
extern void giftPower (UDWORD from,UDWORD to,BOOL send);
|
||||
extern void giftRadar (UDWORD from, UDWORD to,BOOL send);
|
||||
//extern BOOL addDMatchDroid (UDWORD count);
|
||||
//extern BOOL foundDMatchDroid (UDWORD player,UDWORD x,UDWORD y);
|
||||
//extern BOOL deathmatchCheck (void);
|
||||
|
||||
//extern BOOL dMatchWinner (UDWORD winplayer,BOOL bcast);
|
||||
//extern BOOL recvdMatchWinner (NETMSG *pMsg);
|
||||
|
||||
|
||||
#define RADAR_GIFT 1
|
||||
#define DROID_GIFT 2
|
||||
|
|
122
src/multiint.c
122
src/multiint.c
|
@ -642,16 +642,7 @@ void runGameFind(void )
|
|||
ingame.localOptionsReceived = FALSE; // note we are awaiting options
|
||||
strcpy(game.name, NetPlay.games[gameNumber].name); // store name
|
||||
|
||||
// strcpy(sPlayer,"LastUsed");
|
||||
// loadMultiStats(sPlayer,&nullStats);
|
||||
// if(NETgetGameFlagsUnjoined(gameNumber,1) == DMATCH)
|
||||
// {
|
||||
// joinArena(gameNumber,(char*)sPlayer);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
joinCampaign(gameNumber,(char*)sPlayer);
|
||||
// }
|
||||
joinCampaign(gameNumber,(char*)sPlayer);
|
||||
|
||||
changeTitleMode(MULTIOPTION);
|
||||
}
|
||||
|
@ -772,22 +763,16 @@ static void addGameOptions(BOOL bRedo)
|
|||
|
||||
// game type
|
||||
addBlueForm(MULTIOP_OPTIONS,MULTIOP_GAMETYPE,_("Game"),MCOL0,MROW5,MULTIOP_BLUEFORMW,27);
|
||||
// addMultiBut(psWScreen,MULTIOP_GAMETYPE,MULTIOP_ARENA, MCOL1, 2 , MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
// _("Deathmatch Mode"), IMAGE_ARENA, IMAGE_ARENA_HI,TRUE); //arena
|
||||
addMultiBut(psWScreen,MULTIOP_GAMETYPE,MULTIOP_CAMPAIGN,MCOL1, 2 , MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("Campaign Mode"),IMAGE_CAMPAIGN,IMAGE_CAMPAIGN_HI,TRUE); //camp
|
||||
addMultiBut(psWScreen,MULTIOP_GAMETYPE,MULTIOP_SKIRMISH,MCOL2, 2 , MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("Skirmish"),IMAGE_SKIRMISH,IMAGE_SKIRMISH_HI,TRUE); //skirmish
|
||||
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA, 0);
|
||||
widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN, 0);
|
||||
widgSetButtonState(psWScreen, MULTIOP_SKIRMISH, 0);
|
||||
|
||||
switch(game.type)
|
||||
{
|
||||
// case DMATCH:
|
||||
// widgSetButtonState(psWScreen,MULTIOP_ARENA,WBUT_LOCK);
|
||||
// break;
|
||||
case CAMPAIGN:
|
||||
widgSetButtonState(psWScreen,MULTIOP_CAMPAIGN,WBUT_LOCK);
|
||||
break;
|
||||
|
@ -799,7 +784,6 @@ static void addGameOptions(BOOL bRedo)
|
|||
if(!NetPlay.bComms)
|
||||
{
|
||||
widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN, WBUT_DISABLE);
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA, WBUT_DISABLE);
|
||||
}
|
||||
|
||||
//just display the game options.
|
||||
|
@ -822,14 +806,7 @@ static void addGameOptions(BOOL bRedo)
|
|||
}
|
||||
|
||||
// alliances
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// addBlueForm(MULTIOP_OPTIONS,MULTIOP_ALLIANCES,_("Alliances"),MCOL0,MROW7,MULTIOP_BLUEFORMW,27);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
addBlueForm(MULTIOP_OPTIONS,MULTIOP_ALLIANCES,_("Alliances"),MCOL0,MROW8,MULTIOP_BLUEFORMW,27);
|
||||
// }
|
||||
addBlueForm(MULTIOP_OPTIONS, MULTIOP_ALLIANCES, _("Alliances"), MCOL0, MROW8, MULTIOP_BLUEFORMW, 27);
|
||||
|
||||
addMultiBut(psWScreen,MULTIOP_ALLIANCES,MULTIOP_ALLIANCE_N,MCOL1,2,MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("No Alliances"),IMAGE_NOALLI,IMAGE_NOALLI_HI,TRUE);
|
||||
|
@ -866,36 +843,7 @@ static void addGameOptions(BOOL bRedo)
|
|||
break;
|
||||
}
|
||||
|
||||
/* if(game.type == DMATCH)
|
||||
{
|
||||
|
||||
// limit options
|
||||
addBlueForm(MULTIOP_OPTIONS,MULTIOP_LIMIT,_("Limits") ,MCOL0,MROW8,MULTIOP_BLUEFORMW,27);
|
||||
addMultiBut(psWScreen,MULTIOP_LIMIT,MULTIOP_NOLIMIT,MCOL1,2,MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("No Limits"),IMAGE_NOLIMIT,IMAGE_NOLIMIT_HI,TRUE);
|
||||
addMultiBut(psWScreen,MULTIOP_LIMIT,MULTIOP_FRAGLIMIT,MCOL2,2,MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("Kill Limit"),IMAGE_FRAGLIMIT,IMAGE_FRAGLIMIT_HI,TRUE);
|
||||
addMultiBut(psWScreen,MULTIOP_LIMIT,MULTIOP_TIMELIMIT, MCOL3, 2,MULTIOP_BUTW,MULTIOP_BUTH,
|
||||
_("Time Limit"),IMAGE_TIMELIMIT,IMAGE_TIMELIMIT_HI,TRUE);
|
||||
widgSetButtonState(psWScreen, MULTIOP_NOLIMIT,0); //hilight correct entry
|
||||
widgSetButtonState(psWScreen, MULTIOP_FRAGLIMIT,0);
|
||||
widgSetButtonState(psWScreen, MULTIOP_TIMELIMIT ,0);
|
||||
switch(game.limit)
|
||||
{
|
||||
case NOLIMIT:
|
||||
widgSetButtonState(psWScreen, MULTIOP_NOLIMIT,WBUT_LOCK);
|
||||
break;
|
||||
case FRAGLIMIT:
|
||||
widgSetButtonState(psWScreen, MULTIOP_FRAGLIMIT,WBUT_LOCK);
|
||||
break;
|
||||
case TIMELIMIT:
|
||||
widgSetButtonState(psWScreen, MULTIOP_TIMELIMIT,WBUT_LOCK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (game.type == SKIRMISH || game.base != CAMP_WALLS )
|
||||
// ||(game.type != DMATCH && game.base != CAMP_WALLS))
|
||||
{
|
||||
widgSetButtonState(psWScreen, MULTIOP_FNAME,WEDBS_DISABLE); // disable force buts
|
||||
widgSetButtonState(psWScreen, MULTIOP_FNAME_ICON,WBUT_DISABLE);
|
||||
|
@ -1008,7 +956,7 @@ static void addGameOptions(BOOL bRedo)
|
|||
|
||||
// hosted or hosting.
|
||||
// limits button.
|
||||
if(ingame.bHostSetup )//&& (game.type != DMATCH))
|
||||
if(ingame.bHostSetup )
|
||||
{
|
||||
addMultiBut(psWScreen,MULTIOP_OPTIONS,MULTIOP_STRUCTLIMITS,MULTIOP_STRUCTLIMITSX,MULTIOP_STRUCTLIMITSY,
|
||||
35,28, _("Set Structure Limits"),IMAGE_SLIM,IMAGE_SLIM_HI,FALSE);
|
||||
|
@ -1032,7 +980,6 @@ static void addGameOptions(BOOL bRedo)
|
|||
// widgSetButtonState(psWScreen, MULTIOP_MAP_ICON,WBUT_DISABLE);
|
||||
|
||||
widgSetButtonState(psWScreen, MULTIOP_DEFENCE,WBUT_DISABLE);
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA,WBUT_DISABLE);
|
||||
widgSetButtonState(psWScreen, MULTIOP_SKIRMISH,WBUT_DISABLE);
|
||||
#endif
|
||||
|
||||
|
@ -1593,14 +1540,12 @@ static void disableMultiButs(void)
|
|||
|
||||
// force choice.
|
||||
if (game.type == SKIRMISH || game.base != CAMP_WALLS )
|
||||
// if (game.type == SKIRMISH ||(game.type != DMATCH && game.base != CAMP_WALLS ))
|
||||
{
|
||||
widgSetButtonState(psWScreen,MULTIOP_FNAME_ICON,WBUT_DISABLE);
|
||||
widgSetButtonState(psWScreen,MULTIOP_FNAME,WEDBS_DISABLE);
|
||||
}
|
||||
|
||||
if(game.type != CAMPAIGN) widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN, WBUT_DISABLE);
|
||||
// if(game.type != DMATCH) widgSetButtonState(psWScreen, MULTIOP_ARENA, WBUT_DISABLE);
|
||||
if(game.type != SKIRMISH) widgSetButtonState(psWScreen, MULTIOP_SKIRMISH, WBUT_DISABLE);
|
||||
|
||||
if(! NetPlay.bHost)
|
||||
|
@ -1608,13 +1553,6 @@ static void disableMultiButs(void)
|
|||
if( game.fog) widgSetButtonState(psWScreen,MULTIOP_FOG_OFF ,WBUT_DISABLE); //fog
|
||||
if(!game.fog) widgSetButtonState(psWScreen,MULTIOP_FOG_ON ,WBUT_DISABLE);
|
||||
|
||||
// if( game.type == DMATCH )
|
||||
// {
|
||||
// if(game.limit != NOLIMIT) widgSetButtonState(psWScreen, MULTIOP_NOLIMIT,WBUT_DISABLE); // limit levels
|
||||
// if(game.limit != FRAGLIMIT) widgSetButtonState(psWScreen, MULTIOP_FRAGLIMIT,WBUT_DISABLE);
|
||||
// if(game.limit != TIMELIMIT) widgSetButtonState(psWScreen, MULTIOP_TIMELIMIT,WBUT_DISABLE);
|
||||
// }
|
||||
|
||||
if( game.type == CAMPAIGN)
|
||||
{
|
||||
if(game.bComputerPlayers) widgSetButtonState(psWScreen, MULTIOP_COMPUTER_N,WBUT_DISABLE); // pow levels
|
||||
|
@ -1633,7 +1571,7 @@ static void disableMultiButs(void)
|
|||
}
|
||||
|
||||
|
||||
if( /*game.type == DMATCH||*/ game.type == CAMPAIGN || game.type == SKIRMISH)
|
||||
if (game.type == CAMPAIGN || game.type == SKIRMISH)
|
||||
{
|
||||
if(game.alliance != NO_ALLIANCES) widgSetButtonState(psWScreen,MULTIOP_ALLIANCE_N ,WBUT_DISABLE); //alliance settings.
|
||||
if(game.alliance != ALLIANCES) widgSetButtonState(psWScreen,MULTIOP_ALLIANCE_Y ,WBUT_DISABLE);
|
||||
|
@ -1784,23 +1722,7 @@ static void processMultiopWidgets(UDWORD id)
|
|||
addMultiRequest(MultiCustomMapsPath, ".wrf", MULTIOP_MAP, 1, 2);
|
||||
break;
|
||||
|
||||
// case MULTIOP_ARENA: // turn on arena game
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA, WBUT_LOCK);
|
||||
// widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN, 0);
|
||||
// widgSetButtonState(psWScreen, MULTIOP_SKIRMISH,0);
|
||||
// game.type = DMATCH;
|
||||
//
|
||||
// widgSetString(psWScreen, MULTIOP_MAP, "DeadValley");
|
||||
// strcpy(game.map,widgGetString(psWScreen, MULTIOP_MAP));
|
||||
// game.maxPlayers =8;
|
||||
//
|
||||
// addGameOptions();
|
||||
// widgSetButtonState(psWScreen, MULTIOP_FNAME,WEDBS_FIXED);
|
||||
// widgSetButtonState(psWScreen, MULTIOP_FNAME_ICON,0);
|
||||
// break;
|
||||
|
||||
case MULTIOP_CAMPAIGN: // turn on campaign game
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA, 0);
|
||||
widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN, WBUT_LOCK);
|
||||
widgSetButtonState(psWScreen, MULTIOP_SKIRMISH,0);
|
||||
game.type = CAMPAIGN;
|
||||
|
@ -1812,7 +1734,6 @@ static void processMultiopWidgets(UDWORD id)
|
|||
break;
|
||||
|
||||
case MULTIOP_SKIRMISH:
|
||||
// widgSetButtonState(psWScreen, MULTIOP_ARENA, 0);
|
||||
widgSetButtonState(psWScreen, MULTIOP_CAMPAIGN,0 );
|
||||
widgSetButtonState(psWScreen, MULTIOP_SKIRMISH,WBUT_LOCK);
|
||||
game.type = SKIRMISH;
|
||||
|
@ -2114,18 +2035,10 @@ static void processMultiopWidgets(UDWORD id)
|
|||
removeWildcards((char*)sPlayer);
|
||||
removeWildcards(sForceName);
|
||||
|
||||
// if (game.type == DMATCH)
|
||||
// {
|
||||
// hostArena((char*)game.name,(char*)sPlayer);
|
||||
// bHosted = TRUE;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
hostCampaign((char*)game.name,(char*)sPlayer);
|
||||
bHosted = TRUE;
|
||||
// }
|
||||
hostCampaign((char*)game.name,(char*)sPlayer);
|
||||
bHosted = TRUE;
|
||||
|
||||
// wait for players, when happy, send options.
|
||||
// wait for players, when happy, send options.
|
||||
if(NetPlay.bLobbyLaunched)
|
||||
{
|
||||
for(i=0;i<MAX_PLAYERS;i++) // send options to everyone.
|
||||
|
@ -2546,22 +2459,6 @@ void runMultiOptions(void)
|
|||
sendPing();
|
||||
}
|
||||
|
||||
// check for being able to go!
|
||||
// if(ingame.localJoiningInProgress
|
||||
// && (widgGetFromID(psWScreen,CON_OK) == NULL) // oks not yet there.
|
||||
// && ingame.localOptionsReceived // weve got the options
|
||||
// && (game.type == DMATCH)) // it's a dmatch game
|
||||
// {
|
||||
// for(i=0;i<MAX_PLAYERS;i++)
|
||||
// {
|
||||
// if( isHumanPlayer(i) && !ingame.JoiningInProgress[i]) // only go when someones ready..
|
||||
// {
|
||||
// addOkBut();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// if typing and not in an edit box then jump to chat box.
|
||||
k = getQwertyKey();
|
||||
if( k && psWScreen->psFocus == NULL)
|
||||
|
@ -3459,11 +3356,6 @@ void displayRemoteGame(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD
|
|||
iV_SetTextColour(-1); //colour
|
||||
|
||||
//draw type overlay.
|
||||
// if(NETgetGameFlagsUnjoined(i,1) == DMATCH)
|
||||
// {
|
||||
// iV_DrawImage(FrontImages,IMAGE_ARENA_OVER,x+59,y+3);
|
||||
// }
|
||||
// else
|
||||
if( NETgetGameFlagsUnjoined(i,1) == CAMPAIGN)
|
||||
{
|
||||
iV_DrawImage(FrontImages,IMAGE_CAMPAIGN_OVER,x+59,y+3);
|
||||
|
|
|
@ -340,12 +340,6 @@ void setupNewPlayer(UDWORD dpid, UDWORD player)
|
|||
ingame.PingTimes[player] =0; // reset ping time
|
||||
ingame.JoiningInProgress[player] = TRUE; // note that player is now joining.
|
||||
|
||||
// if (game.type == DMATCH)
|
||||
// {
|
||||
// // set the power level for that player..
|
||||
// setPower(player, game.power);
|
||||
// }
|
||||
|
||||
for(i=0;i<MAX_PLAYERS;i++) // set all alliances to broken.
|
||||
{
|
||||
alliances[selectedPlayer][i] = ALLIANCE_BROKEN;
|
||||
|
|
|
@ -171,17 +171,6 @@ static BOOL enumerateMultiMaps(char *found, UDWORD *players,BOOL first, UBYTE ca
|
|||
}
|
||||
while(lev)
|
||||
{
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// if(lev->type == DMATCH)
|
||||
// {
|
||||
// strcpy(found,lev->pName);
|
||||
// *players = lev->players;
|
||||
// lev = lev->psNext;
|
||||
// return TRUE;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
if(game.type == SKIRMISH)
|
||||
{
|
||||
if(lev->type == MULTI_SKIRMISH2)
|
||||
|
@ -811,7 +800,6 @@ void displayMultiPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD
|
|||
|
||||
//c3-7 alliance
|
||||
//manage buttons by showing or hiding them. gifts only in campaign,
|
||||
// if(game.type != DMATCH)
|
||||
{
|
||||
if(game.alliance != NO_ALLIANCES)
|
||||
{
|
||||
|
@ -847,14 +835,7 @@ void displayMultiPlayer(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset, UDWORD
|
|||
iV_DrawText(str, x+MULTIMENU_C8, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
//c9:kills,
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// sprintf(str,"%d",getMultiStats(player,TRUE).recentKills);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
sprintf(str,"%d",getMultiStats(player,TRUE).recentKills);
|
||||
// }
|
||||
sprintf(str,"%d",getMultiStats(player,TRUE).recentKills);
|
||||
iV_DrawText(str, x+MULTIMENU_C9, y+MULTIMENU_FONT_OSET);
|
||||
|
||||
if(!getDebugMappingStatus())
|
||||
|
@ -1088,8 +1069,6 @@ void addMultiPlayer(UDWORD player,UDWORD pos)
|
|||
|
||||
sButInit.pDisplay = intDisplayImageHilight;
|
||||
|
||||
// if(game.type != DMATCH)
|
||||
// {
|
||||
// add the gift buttons.
|
||||
sButInit.y += 1; // move down a wee bit.
|
||||
|
||||
|
@ -1118,8 +1097,6 @@ void addMultiPlayer(UDWORD player,UDWORD pos)
|
|||
widgAddButton(psWScreen, &sButInit);
|
||||
|
||||
giftsUp[player] = TRUE; // note buttons are up!
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
182
src/multiopt.c
182
src/multiopt.c
|
@ -332,98 +332,6 @@ BOOL joinCampaign(UDWORD gameNumber, char *sPlayer)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// HostArena
|
||||
/*
|
||||
BOOL hostArena(char *sGame, char *sPlayer)
|
||||
{
|
||||
PLAYERSTATS playerStats;
|
||||
UDWORD numpl,i,j,pl;
|
||||
|
||||
game.type = DMATCH;
|
||||
|
||||
freeMessages();
|
||||
if(!NetPlay.bLobbyLaunched)
|
||||
{
|
||||
NEThostGame(sGame,sPlayer,DMATCH,0,0,0,game.maxPlayers); // temporary stuff
|
||||
}
|
||||
else
|
||||
{
|
||||
NETsetGameFlags(1,DMATCH);
|
||||
// 2 is average ping
|
||||
NETsetGameFlags(3,0);
|
||||
NETsetGameFlags(4,0);
|
||||
}
|
||||
|
||||
bMultiPlayer = TRUE;
|
||||
|
||||
for(i=0;i<MAX_PLAYERS;i++)
|
||||
{
|
||||
player2dpid[i] =0;
|
||||
}
|
||||
|
||||
//pick a player
|
||||
#if 0
|
||||
pl =0;
|
||||
#else
|
||||
pl = rand()%game.maxPlayers;
|
||||
#endif
|
||||
|
||||
player2dpid[pl] = NetPlay.dpidPlayer; // add ourselves to the array.
|
||||
selectedPlayer = pl;
|
||||
|
||||
ingame.localJoiningInProgress = TRUE;
|
||||
ingame.JoiningInProgress[selectedPlayer] = TRUE;
|
||||
|
||||
loadMultiStats(sPlayer,&playerStats); // load player stats!
|
||||
setMultiStats(NetPlay.dpidPlayer,playerStats,FALSE);
|
||||
setMultiStats(NetPlay.dpidPlayer,playerStats,TRUE);
|
||||
|
||||
numpl = NETplayerInfo(NULL);
|
||||
|
||||
// may be more than one player already. check and resolve!
|
||||
if(numpl >1)
|
||||
{
|
||||
for(j = 0;j<MAX_PLAYERS;j++)
|
||||
{
|
||||
if(NetPlay.players[j].dpid && (NetPlay.players[j].dpid != NetPlay.dpidPlayer))
|
||||
{
|
||||
for(i = 0;player2dpid[i] != 0;i++);
|
||||
player2dpid[i] = NetPlay.players[j].dpid;
|
||||
ingame.JoiningInProgress[i] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// JoinArena.
|
||||
BOOL joinArena(UDWORD gameNumber, char *playerName)
|
||||
{
|
||||
PLAYERSTATS playerStats;
|
||||
|
||||
if(!ingame.localJoiningInProgress)
|
||||
{
|
||||
game.type = DMATCH;
|
||||
if(!NetPlay.bLobbyLaunched)
|
||||
{
|
||||
NETjoinGame(NetPlay.games[gameNumber].desc.guidInstance,playerName); // join
|
||||
}
|
||||
ingame.localJoiningInProgress = TRUE;
|
||||
|
||||
loadMultiStats(playerName,&playerStats);
|
||||
setMultiStats(NetPlay.dpidPlayer,playerStats,FALSE);
|
||||
setMultiStats(NetPlay.dpidPlayer,playerStats,TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bMultiPlayer = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// Lobby launched. fires the correct routine when the game was lobby launched.
|
||||
BOOL LobbyLaunched(void)
|
||||
|
@ -612,13 +520,6 @@ BOOL multiTemplateSetup(void)
|
|||
|
||||
switch (game.type)
|
||||
{
|
||||
// case DMATCH:
|
||||
// for(player=0;player<MAX_PLAYERS;player++)
|
||||
// {
|
||||
// copyTemplateSet(DEATHMATCHTEMPLATES,player);
|
||||
// }
|
||||
// break;
|
||||
|
||||
case CAMPAIGN:
|
||||
for(player=0;player<game.maxPlayers;player++)
|
||||
{
|
||||
|
@ -835,75 +736,6 @@ static BOOL cleanMap(UDWORD player)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// setup a deathmatch game.
|
||||
/*
|
||||
static BOOL dMatchInit()
|
||||
{
|
||||
UDWORD i;
|
||||
NETMSG msg;
|
||||
UDWORD player;
|
||||
BOOL resourceFound = FALSE;
|
||||
char sTemp[256];
|
||||
|
||||
turnOffMultiMsg(TRUE);
|
||||
|
||||
for(i =0 ; i<MAX_PLAYERS;i++)
|
||||
{
|
||||
setPower(i,LEV_HI); // set deathmatch power to hi.
|
||||
}
|
||||
|
||||
strcpy(sTemp, "multiplay/forces/");
|
||||
strcat(sTemp, sForceName);
|
||||
strcat(sTemp,".for");
|
||||
loadForce( sTemp);
|
||||
|
||||
|
||||
freeMessages(); // CLEAR MESSAGES
|
||||
|
||||
if(NetPlay.bHost) // it's new.
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
for(player=0;player<MAX_PLAYERS;player++) // remove droids.
|
||||
{
|
||||
while(apsDroidLists[player])
|
||||
{
|
||||
killDroid(apsDroidLists[player]);
|
||||
}
|
||||
|
||||
while(apsFeatureLists[player])
|
||||
{
|
||||
removeFeature(apsFeatureLists[player]);
|
||||
}
|
||||
|
||||
while(apsStructLists[player])
|
||||
{
|
||||
removeStruct(apsStructLists[player]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
turnOffMultiMsg(FALSE);
|
||||
|
||||
if(NetPlay.bHost)
|
||||
{
|
||||
// dont do anything.
|
||||
}
|
||||
else
|
||||
{
|
||||
NetAdd(msg,0,NetPlay.dpidPlayer); // start to request info.
|
||||
NetAdd(msg,4,arenaPlayersReceived); // player we require.
|
||||
msg.size = 8;
|
||||
msg.type = NET_REQUESTPLAYER;
|
||||
NETbcast(msg,TRUE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
// ////////////////////////////////////////////////////////////////////////////
|
||||
// setup a campaign game
|
||||
static BOOL campInit(void)
|
||||
|
@ -1031,19 +863,7 @@ BOOL multiGameInit(void)
|
|||
openchannels[player] =TRUE; //open comms to this player.
|
||||
}
|
||||
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// dMatchInit();
|
||||
// if(NetPlay.bHost)
|
||||
// {
|
||||
// addDMatchDroid(1); // each player adds a newdroid point.
|
||||
// playerResponding(); // say hi, only if host, clients wait until all info recvd.
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
campInit();
|
||||
// }
|
||||
campInit();
|
||||
|
||||
InitializeAIExperience();
|
||||
msgStackReset(); //for multiplayer msgs, reset message stack
|
||||
|
|
|
@ -221,13 +221,6 @@ BOOL multiPlayerLoop(void)
|
|||
sendCheck(); // send some checking info if possible
|
||||
processMultiPlayerArtifacts(); // process artifacts
|
||||
|
||||
// if( (game.type == DMATCH) && !ingame.localJoiningInProgress)
|
||||
// {
|
||||
// deathmatchCheck();
|
||||
// }
|
||||
|
||||
// if (game.type != DMATCH)
|
||||
// {
|
||||
joinCount =0;
|
||||
for(i=0;i<MAX_PLAYERS;i++)
|
||||
{
|
||||
|
@ -260,7 +253,6 @@ BOOL multiPlayerLoop(void)
|
|||
setWidgetsStatus(TRUE);
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
recvMessage(); // get queued messages
|
||||
|
||||
|
@ -700,9 +692,6 @@ BOOL recvMessage(void)
|
|||
case NET_SCORESUBMIT: // a score update from another player
|
||||
recvScoreSubmission(&msg);
|
||||
break;
|
||||
// case NET_DMATCHWIN: // someone has won!.
|
||||
// recvdMatchWinner(&msg);
|
||||
// break;
|
||||
case NET_VTOL:
|
||||
recvHappyVtol(&msg);
|
||||
break;
|
||||
|
|
|
@ -243,12 +243,6 @@ void useTheForce(BOOL bAddTempl)//Luke
|
|||
UDWORD x1,y1,x,y;
|
||||
DROID_TEMPLATE *psTempl;
|
||||
|
||||
// if(game.type == DMATCH)
|
||||
// {
|
||||
// chooseForceLoc(&x,&y);
|
||||
// }
|
||||
// if(game.type == CAMPAIGN)
|
||||
// {
|
||||
if(apsDroidLists[selectedPlayer])
|
||||
{
|
||||
//set drop off point to pos of other droids.
|
||||
|
@ -262,7 +256,6 @@ void useTheForce(BOOL bAddTempl)//Luke
|
|||
}
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
x1 = x; // now we have a coord, place droids
|
||||
y1 = y;
|
||||
|
|
|
@ -1894,9 +1894,7 @@ CONST_SYMBOL asConstantTable[] =
|
|||
|
||||
// multiplayer
|
||||
|
||||
// { "DMATCH", VAL_INT, FALSE, DMATCH, NULL, NULL, 0.0f },
|
||||
{ "CAMPAIGN", VAL_INT, FALSE, CAMPAIGN, NULL, NULL, 0.0f },
|
||||
// { "TEAMPLAY", VAL_INT, FALSE, TEAMPLAY, NULL, NULL, 0.0f },
|
||||
{ "SKIRMISH", VAL_INT, FALSE, SKIRMISH, NULL, NULL, 0.0f },
|
||||
|
||||
{ "CAMP_CLEAN", VAL_INT, FALSE, CAMP_CLEAN, NULL, NULL, 0.0f },
|
||||
|
|
Loading…
Reference in New Issue