Pararena2/Sources/PlayUtils.c

1 line
28 KiB
C
Raw Normal View History

/*============================================================*/ /*============================================================*/ /*== ==*/ /*== Play Utility Routines ==*/ /*== ==*/ /*============================================================*/ /*============================================================*/ /*======================================================== Includes */ #include "AppleTalkDDP.h" #include "Globals.h" #include "UnivUtilities.h" #include "PlayUtils.h" #include "Render.h" #include "Ball.h" #include "Menu.h" #include "SoundUtils.h" #include "CommonPerson.h" #include "NetOpponent.h" #include "TeamSetUp.h" #include "MainWindow.h" #include "IdleRoutines.h" #include "Replay.h" #include "DissBits.h" /*======================================================== Functions */ /*======================================================== DoEndGame */ void DoEndGame (void) { pausing = FALSE; primaryMode = kIdleMode; SetMBarToIdle(); } /*======================================================== UpdateWorldRecords */ void UpdateWorldRecords (void) { if (playerScore > mostPoints) { mostPoints = playerScore; GetDateTime((unsigned long *)&mostPointsDate); PasStringCopy((StringPtr)theNames[whichHumanNumber - 1], (StringPtr)mostPointsName); } if ((opponentScore > mostPoints) && (theOpponent.persona >= kSimpleGeorge) && (theOpponent.persona <= kMissTeak)) { mostPoints = opponentScore; GetDateTime((unsigned long *)&mostPointsDate); GetIndString((StringPtr)mostPointsName, rNamesStringID, theOpponent.persona + 1); } if (playerTotalFouls > mostFouls) { mostFouls = playerTotalFouls; GetDateTime((unsigned long *)&mostFoulsDate); PasStringCopy((StringPtr)theNames[whichHumanNumber - 1], (StringPtr)mostFoulsName); } if ((opponentTotalFouls > mostFouls) && (theOpponent.persona >= kSimpleGeorge) && (theOpponent.persona <= kMissTeak)) { mostFouls = opponentTotalFouls; GetDateTime((unsigned long *)&mostFoulsDate); GetIndString((StringPtr)mostFoulsName, rNamesStringID, theOpponent.persona + 1); } if (playerTotalCrits > mostCrits) { mostCrits = playerTotalCrits; GetDateTime((unsigned long *)&mostCritsDate); PasStringCopy((StringPtr)theNames[whichHumanNumber - 1], (StringPtr)mostCritsName); } if ((opponentTotalCrits > mostCrits) && (theOpponent.persona >= kSimpleGeorge) && (theOpponent.persona <= kMissTeak)) { mostCrits = opponentTotalCrits; GetDateTime((unsigned long *)&mostCritsDate); GetIndString((StringPtr)mostCritsName, rNamesStringID, theOpponent.persona + 1); } } /*======================================================== UpdateStats */ void UpdateStats (void) { short statusFlag, didWon, skunked; if (theStats[whichHumanNumber - 1].played < kMaxShort) theStats[whichHumanNumber - 1].played++; /* increment # of games played */ if ((theStats[whichHumanNumber - 1].goals + playerTotalGoals) < kMaxShort) theStats[whichHumanNumber - 1].goals += playerTotalGoals; else theStats[whichHumanNumber - 1].goals = kMaxShort; if ((theStats[whichHumanNumber - 1].oppGoals + opponentTotalGoals) < kMaxShort) theStats[whichHumanNumber - 1].oppGoals += opponentTotalGoals; else theStats[whichHumanNumber - 1].oppGoals = kMaxShort; if ((theStats[whichHumanNumber - 1].fouls + playerTotalFouls) < kMaxShort) theStats[whichHumanNumber - 1].fouls += playerTotalFouls; else theStats[whichHumanNumber - 1].fouls = kMaxShort; if ((theStats[whichHumanNumber - 1].oppFouls + opponentTotalFouls) < kMaxShort) theStats[whichHumanNumber - 1].oppFouls += opponentTotalFouls; else theStats[whichHumanNumber - 1].oppFouls = kMaxShort; if ((theStats[whichHumanNumber - 1].criticals + playerTotalCrits) < kMaxShort) theStats[whichHumanNumber - 1].criticals += playerTotalCrits; else theStats[whichHumanNumber - 1].criticals = kMaxShort; if ((theStats[whichHumanNumber - 1].oppCriticals + opponentTotalCrits) < kMaxShort) theStats[whichHumanNumber - 1].oppCriticals += opponentTotalCrits; else th