Pararena2/Sources/InitGameStructs.c

1 line
26 KiB
C
Raw Permalink Normal View History

/*============================================================*/ /*============================================================*/ /*== ==*/ /*== Initialize Game Structures ==*/ /*== ==*/ /*============================================================*/ /*============================================================*/ /*======================================================== Includes */ #include "Globals.h" #include "UnivUtilities.h" #include "InitGameStructs.h" #include "Prefs.h" #include <Sound.h> #include "AnimCursor.h" #include "PlayerStats.h" /*======================================================== SetPrefsToDefault */ void SetPrefsToDefault (void) { short i; lifeTime = 0L; encryptedNumber = 0L; GetChooserName((StringPtr)theNames[0]); if (theNames[0][0] == 0) PasStringCopy((StringPtr)"\pPlayer 1", (StringPtr)theNames[0]); PasStringCopy((StringPtr)"\pPlayer 2", (StringPtr)theNames[1]); PasStringCopy((StringPtr)"\pPlayer 3", (StringPtr)theNames[2]); PasStringCopy((StringPtr)"\pPlayer 4", (StringPtr)theNames[3]); PasStringCopy((StringPtr)"\pPlayer 5", (StringPtr)theNames[4]); PasStringCopy((StringPtr)"\pPlayer 6", (StringPtr)theNames[5]); PasStringCopy((StringPtr)"\pPlayer 7", (StringPtr)theNames[6]); PasStringCopy((StringPtr)"\pPlayer 8", (StringPtr)theNames[7]); PasStringCopy((StringPtr)"\pPlayer 9", (StringPtr)theNames[8]); PasStringCopy((StringPtr)"\pPlayer 10", (StringPtr)theNames[9]); ResetWorldRecords(); theOpponent.persona = kSimpleGeorge; whichHumanNumber = 1; whichGame = kStandardGame; GetSoundVol(&soundVolume); isLeague = kLittleLeague; for (i = 0; i < 10; i++) { teaksThreshholds[i] = 50; } theOpponent.teaksThresh = teaksThreshholds[whichHumanNumber - 1]; useQD = FALSE; willUseQD = useQD; replayGoals = TRUE; replayFouls = FALSE; replayOnR = TRUE; autoTeamsDialog = TRUE; showBoardCursor = FALSE; leftGoalIsPlayers = TRUE; soundOn = TRUE; beamSoundOn = TRUE; incidentSoundOn = TRUE; collisionSoundOn = TRUE; crowdSoundOn = TRUE; autoSetDepth = TRUE; enableAnnouncer = TRUE; enableBackground = FALSE; doZooms = TRUE; replayZooms = TRUE; doSkipFrames = FALSE; for (i = 0; i < 10; i++) { theStats[i].tournamentTime = 0L; theStats[i].bestPlatinumTime = 0L; theStats[i].copperTitles = 0; theStats[i].bronzeTitles = 0; theStats[i].silverTitles = 0; theStats[i].goldTitles = 0; theStats[i].platinumTitles = 0; theStats[i].played = 0; theStats[i].won = 0; theStats[i].goals = 0; theStats[i].fouls = 0; theStats[i].criticals = 0; theStats[i].oppGoals = 0; theStats[i].oppFouls = 0; theStats[i].oppCriticals = 0; theStats[i].georgeState = kUnplayedState; theStats[i].maraState = kUnplayedState; theStats[i].ottoState = kUnplayedState; theStats[i].claireState = kUnplayedState; theStats[i].eazeState = kUnplayedState; theStats[i].teakState = kUnplayedState; } } /*======================================================== LoadThePreferences */ void LoadThePreferences (void) { prefsInfo thePreferred; short i; if (LoadPrefs(&thePreferred) == FALSE) { SetPrefsToDefault(); return; } if (thePreferred.prefVersion >= 0x0200) { SetPrefsToDefault(); return; } encryptedNumber = thePreferred.encryption; lifeTime = thePreferred.timeWas; PasStringCopy((StringPtr)thePreferred.mostTitlesName, (StringPtr)mostTitlesName); mostTitlesDate = thePreferred.mostTitlesDate; mostTitles = thePreferred.mostTitles; PasStringCopy((StringPtr)thePreferred.mostPointsName, (StringPtr)mostPointsName); mostPointsDate = thePreferred.mostPointsDate; mostPoints = thePreferred.mostPoints; PasStringCopy((StringPtr)thePreferred.mostFoulsName, (StringPtr)mostFoulsName); mostFoulsDate = thePreferred.mostFoulsDate; mostFouls = thePreferred.mostFouls; PasStringCopy((StringPtr)thePreferred.mostCritsName, (StringPtr)mostCritsName); mostCritsDate = thePreferred.mostCritsDate; mostCrits = thePreferred.mostCrits; for (i = 0; i < 10; i++) { PasStringCopy((StringPtr)thePreferred.namesWere[