5NewObjectiveSystem NewObjectiveSystemControl = NewObjectiveSystem(1);
11 struct TempPlayerDataNode
14 int killsWithoutGettingHurt;
17 time_t friendlyFireTime;
18 time_t talkToPrezTime;
19 int friendlyFireCount;
23 struct TempPlayerDataNode *next;
27 bool portablePumpjackBeingPlaced;
28 int portablePumpjackId;
29 bool displayedKillMessage;
30 TempPlayerDataNode(
const char *playerName)
33 displayedKillMessage =
false;
34 killsWithoutGettingHurt = 0;
36 talkToPrezTime = NULL;
37 friendlyFireTime = clock();
38 friendlyFireCount = 0;
44 portablePumpjackId = 0;
46 sprintf(this->playerName,
"%s",playerName);
48 sprintf(this->playerName,
"");
55 struct TempPlayerDataNode *players[128];
57 struct TempPlayerDataNode *inactivePlayerData;
58 struct TempPlayerDataNode *dummyNode;
59 TempPlayerDataNode *FindPlayerNode(
const char *playerName)
61 TempPlayerDataNode *Current = inactivePlayerData;
62 if (!inactivePlayerData)
63 return (inactivePlayerData =
new TempPlayerDataNode(playerName));
66 if (!_stricmp(Current->playerName,playerName))
69 return (Current->next =
new TempPlayerDataNode(playerName));
70 Current = Current->next;
77 dummyNode =
new TempPlayerDataNode(
"");
78 for (
int x = 0;x < 128;x++)
80 players[0] = dummyNode;
81 inactivePlayerData = NULL;
83 void getPlayerNode(GameObject *player)
87 int playerId = JmgUtility::JMG_Get_Player_ID(player);
90 if (!players[playerId] || _stricmp(players[playerId]->playerName,Get_Player_Name(player)))
91 players[playerId] = FindPlayerNode(Get_Player_Name(player));
95 TempPlayerDataNode *temp = inactivePlayerData,*die;
103 inactivePlayerData = NULL;
104 for (
int x = 1;x < 128;x++)
108TempPlayerData PlayerData;
113 PCTDataObject(
int id,
const char *animation)
116 sprintf(this->animation,
"%s",animation);
120 this->PCTDataObject::PCTDataObject(0,
"");
123PCTDataObject pctObjectArray[20] = {PCTDataObject()};
124class PowerupLimiterSystem
130 struct PowerupNode *next;
131 PowerupNode(GameObject *obj)
133 id = Commands->Get_ID(obj);
138 PowerupNode *powerupNodeList;
141 PowerupLimiterSystem()
144 powerupNodeList = NULL;
146 PowerupLimiterSystem &operator += (GameObject *obj)
148 PowerupNode *current = powerupNodeList;
149 if (!powerupNodeList)
150 powerupNodeList =
new PowerupNode(obj);
155 current->next =
new PowerupNode(obj);
158 current = current->next;
161 if (powerupCount > 30)
162 Commands->Destroy_Object(powerupNodeList->obj);
165 PowerupLimiterSystem &operator -= (GameObject *obj)
167 PowerupNode *current = powerupNodeList,*prev = NULL;
170 if (current->obj == obj)
174 powerupNodeList = powerupNodeList->next;
179 prev->next = current->next;
186 current = current->next;
191class BearHunterVoiceSystem
194 static int voiceId[128];
195 static void PlayVoice(GameObject *obj,
const char *soundFile,
const char *text)
197 JmgUtility::DisplayChatMessage(obj,127,127,255,text);
198 int playerId = JmgUtility::JMG_Get_Player_ID(obj);
199 Stop_Sound_Player(obj,voiceId[playerId],
true);
200 voiceId[playerId] = Create_2D_Wave_Sound_Dialog_Player(obj,soundFile);
202 static void PlayVoice(
const char *soundFile,
const char *text)
204 JmgUtility::MessageAllPlayers(127,127,255,text);
205 for (
int x = 1;x < 128;x++)
207 GameObject *player = Get_GameObj(x);
210 Stop_Sound_Player(player,voiceId[x],
true);
211 voiceId[x] = Create_2D_Wave_Sound_Dialog_Player(player,soundFile);
215Rp2SimplePositionSystem::SimplePositionNode *Rp2SimplePositionSystem::GetSpotNotVisibileFromSpot(Vector3 pos)
218 SimplePositionNode *current = SimplePositionNodeList;
219 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
220 int originalRandom = random;
223 Vector3 targetpos = current->position;
225 CastResultStruct res;
226 LineSegClass ray(pos,targetpos);
227 PhysRayCollisionTestClass coltest(ray, &res, SOLDIER_GHOST_COLLISION_GROUP);
228 PhysicsSceneClass::Get_Instance()->Cast_Ray(coltest,
false);
229 if (JmgUtility::SimpleDistance(pos,current->position) > 5625 && coltest.CollidedRenderObj)
236 current = current->next;
237 if (!current && originalRandom != random)
238 current = SimplePositionNodeList;
242Rp2SimplePositionSystem::SimplePositionNode *Rp2SimplePositionSystem::GetNonVisibleSpotFromPlayers(
int value)
244 SimplePositionNode *current = SimplePositionNodeList;
245 int random = Commands->Get_Random_Int(0,ObjectCount*2)+1;
246 int originalRandom = random;
249 if (current->value == value)
251 bool visibile =
false;
252 for (
int x = 1;x < 128;x++)
254 GameObject *player = Get_GameObj(x);
257 Vector3 pos = Commands->Get_Position(player);
258 Vector3 targetpos = current->position;
261 CastResultStruct res;
262 LineSegClass ray(pos,targetpos);
263 PhysRayCollisionTestClass coltest(ray, &res, SOLDIER_GHOST_COLLISION_GROUP);
264 PhysicsSceneClass::Get_Instance()->Cast_Ray(coltest,
false);
265 if (!coltest.CollidedRenderObj)
276 current = current->next;
277 if (!current && originalRandom != random)
278 current = SimplePositionNodeList;
280 return GetFurthestSpotFromPlayers(value);
282PowerupLimiterSystem PowerupLimiterSystemControl = PowerupLimiterSystem();
283Rp2SimplePositionSystem randomSelectableSpawnPoints[7] = {Rp2SimplePositionSystem()};
284Rp2SimplePositionSystem aiDefensePoints[6] = {Rp2SimplePositionSystem()};
285Rp2SimplePositionSystem randomWeaponContainerSpawnPositions[6] = {Rp2SimplePositionSystem()};
286Rp2SimplePositionSystem ComancheDefensePoints[6] = {Rp2SimplePositionSystem()};
287Rp2SimplePositionSystem aiPtLocations = Rp2SimplePositionSystem();
288Rp2SimplePositionSystem bossSpawnProtectionPoints = Rp2SimplePositionSystem();
289class Rp2SimpleObjectList
292 struct SimpleObjectNode
297 struct SimpleObjectNode *next;
298 SimpleObjectNode(GameObject *_obj)
302 ID = Commands->Get_ID(_obj);
307 SimpleObjectNode *SimpleObjectNodeList;
310 Rp2SimpleObjectList()
313 SimpleObjectNodeList = NULL;
315 Rp2SimpleObjectList &operator += (GameObject *obj)
317 SimpleObjectNode *Current = SimpleObjectNodeList;
318 if (!SimpleObjectNodeList)
319 SimpleObjectNodeList =
new SimpleObjectNode(obj);
324 Current->ID = Commands->Get_ID(obj);
328 if (Current->obj == obj)
332 Current->next =
new SimpleObjectNode(obj);
335 Current = Current->next;
340 Rp2SimpleObjectList &operator -= (GameObject *obj)
342 SimpleObjectNode *Current = SimpleObjectNodeList;
345 if (Current->obj == obj)
352 Current = Current->next;
356 bool IsInList(GameObject *obj)
358 SimpleObjectNode *Current = SimpleObjectNodeList;
361 if (Current->obj == obj)
363 Current = Current->next;
367 SimpleObjectNode *find(GameObject *obj)
369 SimpleObjectNode *Current = SimpleObjectNodeList;
372 if (Current->obj == obj)
374 Current = Current->next;
376 return SimpleObjectNodeList;
381 SimpleObjectNode *temp,*die;
382 temp = SimpleObjectNodeList;
389 SimpleObjectNodeList = NULL;
393 SimpleObjectNode *temp = SimpleObjectNodeList,*die;
399 Commands->Apply_Damage(die->obj,9999.9f,
"BlamoKiller",0);
405 SimpleObjectNode *Current = SimpleObjectNodeList;
408 if (Commands->Find_Object(Current->ID))
410 Current = Current->next;
414 void DestroyLeastSignificant()
416 float LongestDistance = 0;
417 GameObject *TempObject = NULL;
418 SimpleObjectNode *Current = SimpleObjectNodeList;
421 GameObject *Object = Commands->Find_Object(Current->ID);
424 GameObject *Star = Commands->Get_A_Star(Commands->Get_Position(Object));
427 float Temp = JmgUtility::SimpleDistance(Commands->Get_Position(Object),Commands->Get_Position(Star));
428 if (Temp > LongestDistance)
431 LongestDistance = Temp;
435 Current = Current->next;
438 Commands->Destroy_Object(TempObject);
440 void DestroyOutsideOfRange(
float range,Vector3 pos)
442 SimpleObjectNode *Current = SimpleObjectNodeList;
445 GameObject *Object = Commands->Find_Object(Current->ID);
446 if (Object && JmgUtility::SimpleFlatDistance(Commands->Get_Position(Object),pos) > range)
447 Commands->Destroy_Object(Object);
448 Current = Current->next;
451 GameObject *GetRandom()
455 Console_Input(
"msg SimpleObjectNodeList GetRandom ERROR: List is empty!");
458 int random = Commands->Get_Random_Int(0,objectCount*2);
459 SimpleObjectNode *Current = SimpleObjectNodeList;
462 GameObject *Object = Commands->Find_Object(Current->ID);
470 Current = Current->next;
472 Current = SimpleObjectNodeList;
476 int GetAndRemoveListHeadObject()
478 while (SimpleObjectNodeList)
480 SimpleObjectNode *Current = SimpleObjectNodeList;
481 int id = Current->ID;
482 SimpleObjectNodeList = SimpleObjectNodeList->next;
484 if (Commands->Find_Object(
id))
489 int countInRangeTargetingId(Vector3 pos,
float range,
int targetId)
491 int inRangeCount = 0;
493 SimpleObjectNode *current = SimpleObjectNodeList;
496 if (current->ID && current->enemyId == targetId && current->obj && JmgUtility::SimpleFlatDistance(Commands->Get_Position(current->obj),pos) <= range && Commands->Get_Health(current->obj))
498 current = current->next;
502 GameObject *GetNearest(Vector3 pos)
504 float LongestDistance = 0;
505 GameObject *TempObject = NULL;
506 SimpleObjectNode *Current = SimpleObjectNodeList;
509 GameObject *Object = Commands->Find_Object(Current->ID);
512 float Temp = JmgUtility::SimpleDistance(Commands->Get_Position(Current->obj),pos);
513 if (!TempObject || Temp < LongestDistance)
515 TempObject = Current->obj;
516 LongestDistance = Temp;
519 Current = Current->next;
525 Vector3 GetNearestPosition(Vector3 pos)
527 float LongestDistance = 0;
528 GameObject *TempObject = NULL;
529 SimpleObjectNode *Current = SimpleObjectNodeList;
532 GameObject *Object = Commands->Find_Object(Current->ID);
535 float Temp = JmgUtility::SimpleDistance(Commands->Get_Position(Current->obj),pos);
536 if (!TempObject || Temp < LongestDistance)
538 TempObject = Current->obj;
539 LongestDistance = Temp;
542 Current = Current->next;
545 return Commands->Get_Position(TempObject);
546 return Vector3(0.0f,0.0f,0.0f);
549Rp2SimpleObjectList bearObjectListControl = Rp2SimpleObjectList();
550Rp2SimpleObjectList mutantObjectListControl = Rp2SimpleObjectList();
551class JMG_Bear_Hunter_Player_Soldier :
public ScriptImpClass {
554 Vector3 LastPosition;
557 void Created(GameObject *obj);
558 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
559 void Timer_Expired(GameObject *obj,
int number);
560 void Damaged(GameObject *obj,GameObject *damager,
float damage);
561 void Killed(GameObject *obj,GameObject *killer);
562 void Destroyed(GameObject *obj);
563 void CreateExplosion(GameObject *obj,
const char *explosion,Vector3 pos,
float *distance,
int *explosives);
564 bool LifeSystem(GameObject *obj);
565 void GrantUnlockedWeapons(GameObject *obj);
566 void GrantSpecialUnlocks(GameObject *obj);
568 struct ArmoredCarWeapon
570 char weaponName[256];
573 double calculatedGrant;
577 sprintf(this->weaponName,
"");
578 this->lastFireTime = 0;
580 this->calculatedGrant = 0.0;
581 this->addedGrant = 0.0;
585 this->addedGrant = 0.0;
586 this->lastFireTime = 75;
589 JMG_Bear_Hunter_Player_Soldier()
593 armoredCarWeapon = ArmoredCarWeapon();
595 static double speed[128];
596 static char primaryWeapon[128][256];
597 static bool hasGrenadeVest[128];
599 ArmoredCarWeapon armoredCarWeapon;
601double JMG_Bear_Hunter_Player_Soldier::speed[128] = {0.0};
602char JMG_Bear_Hunter_Player_Soldier::primaryWeapon[128][256] = {
""};
603bool JMG_Bear_Hunter_Player_Soldier::hasGrenadeVest[128] = {
false};
604struct PlayerEmulatedSound
606 enum logicalSoundType{stNone = 0,stOldWeapon = 1,stFootsteps = 2,stVehicle = 3,stGunshot = 4,stBulletHit = 5,stNoticeMe = 6};
608 logicalSoundType SoundType;
609 PlayerEmulatedSound()
614 void SetPlayerEmulatedSound(
float range,logicalSoundType soundType)
617 SoundType = soundType;
620PlayerEmulatedSound PlayerEmulatedSoundList[128] = {PlayerEmulatedSound()};
622#define EmulatedSoundCustom 450040
623class JMG_Rp2_Dedicated_Server_Sound_Emulator :
public ScriptImpClass {
626 int SoundOverrideTime;
628 float weaponSoundRange;
631 void Created(GameObject *obj);
632 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
633 void Timer_Expired(GameObject *obj,
int number);
634 void Killed(GameObject *obj,GameObject *killer);
635 void Destroyed(GameObject *obj);
638class BearHunterGameControl
641 struct BearHunterBearPositionNode
646 struct BearHunterBearPositionNode *xNodes;
647 struct BearHunterBearPositionNode *yNodes;
648 struct BearHunterBearPositionNode *next;
649 BearHunterBearPositionNode(
int id,Vector3 pos)
662 BearHunterBearPositionNode *BearHunterBearPositionNodeList;
663 Vector2 MiddleValues;
664 BearHunterBearPositionNode *BearHunterBearPositionNodeGrouping;
665 void AddListNode(
int id,
const Vector3 &pos)
667 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList;
668 if (!BearHunterBearPositionNodeList)
669 BearHunterBearPositionNodeList =
new BearHunterBearPositionNode(
id,pos);
674 Current->next =
new BearHunterBearPositionNode(
id,pos);
677 Current = Current->next;
680 void AddNodesToLookupTable(BearHunterBearPositionNode *currentNode)
682 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeGrouping,*Prev = NULL;
683 if (!BearHunterBearPositionNodeGrouping)
684 BearHunterBearPositionNodeGrouping = currentNode;
687 if (currentNode->pos.X < Current->pos.X && (!Prev || currentNode->pos.X > Prev->pos.X))
690 BearHunterBearPositionNodeGrouping = currentNode;
692 Prev->xNodes = currentNode;
693 currentNode->xNodes = Current;
696 if (currentNode->pos.X > Current->pos.X && (!Current->xNodes || currentNode->pos.X < Current->xNodes->pos.X))
698 currentNode->xNodes = Current->xNodes;
699 Current->xNodes = currentNode;
702 if (Current->pos.X == currentNode->pos.X)
704 BearHunterBearPositionNode *YNode = Current->yNodes,*yPrev = NULL;
705 if (!Current->yNodes)
707 Current->yNodes = currentNode;
712 if (currentNode->pos.Y < YNode->pos.Y && (!yPrev || currentNode->pos.Y > yPrev->pos.Y))
715 Current->yNodes = currentNode;
717 yPrev->yNodes = currentNode;
718 currentNode->yNodes = YNode;
721 if (currentNode->pos.Y > YNode->pos.Y && (!YNode->yNodes || currentNode->pos.Y < YNode->yNodes->pos.Y))
723 currentNode->yNodes = YNode->yNodes;
724 YNode->yNodes = currentNode;
728 YNode = YNode->yNodes;
733 Current = Current->xNodes;
736 void BuildLookupTable()
738 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList;
741 AddNodesToLookupTable(Current);
742 Current = Current->next;
745 void PrintNodeTable()
748 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList;
752 Current = Current->next;
755 sprintf(debugTxt,
"msg Total Nodes In List:%d",count);
756 Console_Input(debugTxt);
757 BearHunterBearPositionNode *table = BearHunterBearPositionNodeGrouping;
760 BearHunterBearPositionNode *y = table->yNodes;
761 sprintf(debugTxt,
"\nX");
764 sprintf(debugTxt,
"X");
767 table = table->xNodes;
771 BearHunterGameControl()
773 builtNetwork =
false;
775 BearHunterBearPositionNodeList = NULL;
776 BearHunterBearPositionNodeGrouping = NULL;
778 void AddNodeObject(GameObject *obj)
780 AddListNode(Commands->Get_ID(obj),Commands->Get_Position(obj));
782 Commands->Destroy_Object(obj);
784 void Load(
const char *fileName)
786 int File = Commands->Text_File_Open(fileName);
790 sprintf(errorMsg,
"msg BearHunterGameControl ERROR: File %s not found!",fileName);
791 Console_Input(errorMsg);
794 char TextString[1024];
795 while (Commands->Text_File_Get_String(File,TextString,1024))
799 sscanf(TextString,
"%d %f %f %f",&
id,&x,&y,&z);
800 AddListNode(
id,Vector3(x,y,z));
804 Commands->Text_File_Close(File);
806 Vector3 LookupNearestPosition(Vector2 pos)
808 if (BearHunterBearPositionNodeGrouping)
810 BearHunterBearPositionNode *table = BearHunterBearPositionNodeGrouping;
813 if (pos.X < table->pos.X || (pos.X >= table->pos.X && (!table->xNodes || pos.X < table->xNodes->pos.X)))
815 BearHunterBearPositionNode *y = table->yNodes;
818 if (pos.Y < y->pos.Y || (pos.Y >= y->pos.Y && (!y->yNodes || pos.Y < y->yNodes->pos.Y)))
823 table = table->xNodes;
826 sprintf(debugmsg,
"msg BearHunterGameControl::LookupNearestPosition ERROR: Could not find pos for location <%.2f,%.2f>",pos.X,pos.Y);
827 Console_Input(debugmsg);
829 Vector3 StarPos = Vector3(pos.X,pos.Y,0.0f);
831 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList,*BestNode = NULL;
834 float dist = JmgUtility::SimpleFlatDistance(StarPos,Current->pos);
835 if (!BestNode || dist < bestDist)
840 Current = Current->next;
843 return BestNode->pos;
844 return Vector3(0.0f,0.0f,0.0f);
846 bool getRandomPosition(Vector3 *pos,
float minRange,
float range)
848 if (BearHunterBearPositionNodeGrouping)
850 int Random = Commands->Get_Random_Int(0,(NodeCount ? NodeCount : 1)+1);
851 int original = Random;
852 BearHunterBearPositionNode *table = BearHunterBearPositionNodeGrouping;
855 BearHunterBearPositionNode *y = table->yNodes;
858 float tempDist = JmgUtility::SimpleDistance(y->pos,*pos);
859 if (tempDist <= range && tempDist >= minRange)
870 table = table->xNodes;
871 if (!table && Random != original)
874 table = BearHunterBearPositionNodeGrouping;
882 builtNetwork =
false;
884 BearHunterBearPositionNodeGrouping = NULL;
885 BearHunterBearPositionNode *temp,*die;
886 temp = BearHunterBearPositionNodeList;
893 BearHunterBearPositionNodeList = NULL;
896 BearHunterBearPositionNode *FindNodeByID(
int id)
898 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList;
901 if (Current->id ==
id)
903 Current = Current->next;
907 void SaveCleanedTestGrid()
909 BearHunterBearPositionNode *Current = BearHunterBearPositionNodeList;
912 if (Current->badCount)
915 sprintf(badNodes,
"msg %d was marked as bad",Current->id);
916 Console_Input(badNodes);
918 Current = Current->next;
922BearHunterGameControl BearHunterGameControlSystem = BearHunterGameControl();
931 this->position = Vector3();
932 this->activeTime = 0;
934 EASTowerNode(GameObject *obj)
936 this->
id = Commands->Get_ID(obj);
937 this->position = Commands->Get_Position(obj);
938 this->activeTime = 0;
940 bool operator == (
const int value)
946 bool operator != (
const int value)
953class JMG_Bear_Hunter_Game_Control :
public ScriptImpClass {
956 EASTowerNode easTowers[2];
957 bool alarmSwitchActive;
962 unsigned long meteoriteTime;
964 static GameObject *myObject;
972 bool engineerSpawnedOnce[5];
973 int engineerScanTime;
974 int lastUpdateEngineersDead;
975 int wildMountainLionIds[8];
976 int wildMountainLionRespawn[8];
977 int wildMountainLionsPet;
980 int playerReturnedTurkeys[128];
981 int playerReturnedTurkeysDelay[128];
983 bool hasReturnedTurkeys;
984 void Created(GameObject *obj);
985 void Timer_Expired(GameObject *obj,
int number);
986 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
987 void Destroyed(GameObject *obj);
988 bool CheckIfPlayerInRange(Vector3 pos,
float distance);
989 void EndGameDataCleanup(GameObject *obj,
bool saveData);
991 void CreateNormalAnimals(
int normalBears);
992 void CreateBears(
int normalBears);
993 void SpawnAngryTinyDeer();
995 void TriggerCowObjective();
996 static GameObject *MutantSpawn();
998 JMG_Bear_Hunter_Game_Control();
999 static void ObjectiveCompleteReward(
float credits);
1000 static enum GameState{LeaveBase = 0,HuntBears = 1,MutationStart = 2,FallBack = 3,DefendPrez = 4,SecureBase = 5,BossArrive = 6} gameState;
1001 static int mutantTargetId;
1002 static bool gameOver;
1003 static int gameTime;
1004 static int spawnGroup;
1005 static char currentSong[256];
1006 static int objective;
1007 static int bearTransition;
1008 static bool hasGotTurrets;
1009 static int aiIgnorePlayers[128];
1010 static int remainingLives[128];
1011 static bool playerAlive[128];
1012 static int bossRabitDead;
1013 static unsigned int earthWarheadId;
1014 static unsigned int deathWarheadId;
1015 static int turretsDestroyed;
1016 static Vector3 engineerSpawnLocations[5];
1017 static int entineersReturned;
1018 static bool weaponsFound[6];
1019 static bool weaponsReturned[6];
1020 static bool weaponsUnlocked[7];
1021 static float soundAttentionWhoreNotify;
1022 static bool diedInWater[128];
1023 static bool hasActivatedTower;
1025 static bool playersDead;
1026 static int medicineDropInTime;
1027 static float attackSubstationChance;
1028 static int mutantBears;
1029 static float mutantRespawnTime;
1030 static float CreatePositionZ;
1031 static float GamePercent;
1032 static Vector3 centerOfBase;
1033 static bool truckTimeExtended;
1034 static int spawnKarma;
1035 static bool hasBeenInjured;
1036 static int karmaDeerIds[6];
1037 static int friendlyTinyDeerIds[5];
1038 static int friendlyTinyDeerRespawnTime[5];
1039 static int wanderingAiIgnorePlayers[128];
1040 static void IncreaseBonusObjectiveCount(
int objectiveId);
1041 static int bonusObjectiveCount;
1042 static int pumpJackIds[7];
1043 static int damagedPumpJackIds[3];
1044 static Vector3 pumpJackPos[7];
1045 static Vector3 damagedPumpJackPos[3];
1047GameObject *JMG_Bear_Hunter_Game_Control::myObject = NULL;
1048int JMG_Bear_Hunter_Game_Control::mutantTargetId = 600172;
1049JMG_Bear_Hunter_Game_Control::GameState JMG_Bear_Hunter_Game_Control::gameState = LeaveBase;
1050bool JMG_Bear_Hunter_Game_Control::gameOver =
false;
1051int JMG_Bear_Hunter_Game_Control::gameTime = 0;
1052int JMG_Bear_Hunter_Game_Control::spawnGroup = 0;
1053char JMG_Bear_Hunter_Game_Control::currentSong[256] = {
"SpecForce_Sneak_01.mp3"};
1054int JMG_Bear_Hunter_Game_Control::objective = 0;
1055int JMG_Bear_Hunter_Game_Control::bearTransition = 0;
1056bool JMG_Bear_Hunter_Game_Control::hasGotTurrets =
false;
1057int JMG_Bear_Hunter_Game_Control::aiIgnorePlayers[128] = {0};
1058int JMG_Bear_Hunter_Game_Control::remainingLives[128] = {0};
1059bool JMG_Bear_Hunter_Game_Control::playerAlive[128] = {
true};
1060int JMG_Bear_Hunter_Game_Control::bossRabitDead = 0;
1061unsigned int JMG_Bear_Hunter_Game_Control::earthWarheadId = 22;
1062unsigned int JMG_Bear_Hunter_Game_Control::deathWarheadId = 22;
1063int JMG_Bear_Hunter_Game_Control::turretsDestroyed = 0;
1064Vector3 JMG_Bear_Hunter_Game_Control::engineerSpawnLocations[5] = {Vector3(-263.045f,150.827f,0.839f),Vector3(-266.169f,150.874f,0.839f),Vector3(-198.472f,-262.617f,0.251f),Vector3(-198.408f,-259.017f,0.259f),Vector3(-203.714f,-260.658f,0.216f)};
1065int JMG_Bear_Hunter_Game_Control::entineersReturned = 0;
1066bool JMG_Bear_Hunter_Game_Control::weaponsFound[6] = {
false};
1067bool JMG_Bear_Hunter_Game_Control::weaponsReturned[6] = {
false};
1068bool JMG_Bear_Hunter_Game_Control::weaponsUnlocked[7] = {
false};
1069float JMG_Bear_Hunter_Game_Control::soundAttentionWhoreNotify = 0.0025f;
1070bool JMG_Bear_Hunter_Game_Control::diedInWater[128] = {
false};
1071bool JMG_Bear_Hunter_Game_Control::hasActivatedTower =
false;
1072int JMG_Bear_Hunter_Game_Control::winWait = 0;
1073bool JMG_Bear_Hunter_Game_Control::playersDead =
false;
1074int JMG_Bear_Hunter_Game_Control::medicineDropInTime = 0;
1075float JMG_Bear_Hunter_Game_Control::attackSubstationChance = 1.0f;
1076int JMG_Bear_Hunter_Game_Control::mutantBears = 0;
1077float JMG_Bear_Hunter_Game_Control::mutantRespawnTime = 0.0f;
1078float JMG_Bear_Hunter_Game_Control::CreatePositionZ = 0.0f;
1079float JMG_Bear_Hunter_Game_Control::GamePercent = 0.0f;
1080Vector3 JMG_Bear_Hunter_Game_Control::centerOfBase = Vector3(45.146f,-689.362f,-0.166f);
1081bool JMG_Bear_Hunter_Game_Control::truckTimeExtended =
false;
1082int JMG_Bear_Hunter_Game_Control::spawnKarma = 0;
1083bool JMG_Bear_Hunter_Game_Control::hasBeenInjured =
false;
1084int JMG_Bear_Hunter_Game_Control::karmaDeerIds[6] = {0};
1085int JMG_Bear_Hunter_Game_Control::friendlyTinyDeerIds[5] = {0};
1086int JMG_Bear_Hunter_Game_Control::friendlyTinyDeerRespawnTime[5] = {0};
1087int JMG_Bear_Hunter_Game_Control::wanderingAiIgnorePlayers[128] = {0};
1088int JMG_Bear_Hunter_Game_Control::bonusObjectiveCount = 0;
1089int JMG_Bear_Hunter_Game_Control::pumpJackIds[7] = {601041,601038,601044,601040,601045,601039,601043};
1090int JMG_Bear_Hunter_Game_Control::damagedPumpJackIds[3] = {601061,601062,601063};
1091Vector3 JMG_Bear_Hunter_Game_Control::pumpJackPos[7];
1092Vector3 JMG_Bear_Hunter_Game_Control::damagedPumpJackPos[3];
1094struct BearHunterScoreSystem
1097 #define BHHighScoreListCount 124
1100 char PlayerName[256];
1101 unsigned long PlayTime;
1102 unsigned long PreGameTime;
1103 unsigned long IdleTime;
1104 unsigned long RoundsPlayed;
1105 unsigned long RoundsCompleted;
1106 unsigned long RoundsQuit;
1107 unsigned long RoundsWon;
1108 unsigned long RoundsLost;
1109 unsigned long MostKillsInARound;
1110 unsigned long MostDeathsInARound;
1111 unsigned long MostBonusObjectivesCompletedInARound;
1112 unsigned long Deaths;
1113 unsigned long Kills;
1114 unsigned long VehicleKills;
1115 unsigned long KilledSelf;
1116 unsigned long KilledPlayers;
1117 unsigned long KilledPresident;
1118 unsigned long KilledTurrets;
1119 unsigned long KilledBears;
1120 unsigned long KilledBlackBears;
1121 unsigned long KilledMutantBears;
1122 unsigned long KilledMutantDeer;
1123 unsigned long KilledMutantCats;
1124 unsigned long KilledMutantCatsB;
1125 unsigned long KilledMutantCatsR;
1126 unsigned long KilledMutantRabbits;
1127 unsigned long ObjectiveActivatedAlarm;
1128 unsigned long ObjectiveTurretTruck;
1129 unsigned long ObjectiveTurretTruckAlarm;
1130 unsigned long ObjectiveOilRigsActivated;
1131 unsigned long ObjectiveOilRigsRepaired;
1132 unsigned long ObjectiveEngineersSaved;
1133 unsigned long ObjectiveWeaponsFound;
1134 unsigned long ObjectiveWeaponsReturned;
1135 unsigned long ObjectivePlasmaRifleReturned;
1136 unsigned long BonusObjectivesCompleted;
1137 unsigned long PickedupHealthPowerups;
1138 unsigned long PickedupArmorPowerups;
1139 unsigned long PickedupCashPowerups;
1140 unsigned long PickedupAmmoPowerups;
1141 unsigned long PickedupHealthTotal;
1142 unsigned long PickedupArmorTotal;
1143 unsigned long PickedupCashTotal;
1144 unsigned long PickedupAmmoTotal;
1145 unsigned long PickedupTotalPowerups;
1146 unsigned long PickedupTotalPowerupsInARound;
1147 unsigned long KilledHumanAi;
1148 unsigned long VehiclesDestroyed;
1149 unsigned long VehiclesLost;
1150 unsigned long JazzsLost;
1151 unsigned long CleasansLost;
1152 unsigned long TrucksLost;
1153 unsigned long TanksLost;
1154 unsigned long TurretTruckLost;
1155 unsigned long C4VestPowerups;
1156 unsigned long ActivatedCommTower;
1157 unsigned long PlayedGamesWithDefenseTurrets;
1158 unsigned long PlayedGamesWithGuardianHelicopter;
1159 unsigned long TimesDrown;
1160 unsigned long TimesFallen;
1161 unsigned long KillsWithSentryTurret;
1162 unsigned long KilledSentryTurrets;
1163 unsigned long SentryTurretsPlaced;
1164 unsigned long SentryTurretsLost;
1165 unsigned long PickedUpMedicalNeedle;
1166 unsigned long ReturnedMedicalNeedle;
1167 unsigned long RepairedSubstation;
1168 unsigned long SubstationOnLineAtEnd;
1169 unsigned long SubstationNotDamaged;
1170 unsigned long GiantDeerKilled;
1171 unsigned long WolfKilled;
1172 unsigned long MutantDogKilled;
1173 unsigned long BlueDeerKilled;
1174 unsigned long SurvivedAlarm;
1175 unsigned long CheatedRounds;
1176 unsigned long NeverInjured;
1177 unsigned long MooseKilled;
1178 unsigned long EatenByRabbit;
1179 unsigned long PickedUpDeerStatue;
1180 unsigned long DroppedDeerStatue;
1181 unsigned long ReturnedDeerStatue;
1182 unsigned long TinyDeerKilled;
1183 unsigned long MutantSquirrelsKilled;
1184 unsigned long WildDeerKilled;
1185 unsigned long WildSquirrelsKilled;
1186 unsigned long ArmoredCarsLost;
1187 unsigned long WarriorsLost;
1188 unsigned long TimeOnFoot;
1189 unsigned long TimeInAJazzs;
1190 unsigned long TimeInACleasans;
1191 unsigned long TimeInASecurityTruck;
1192 unsigned long TimeInArmoredCars;
1193 unsigned long TimeInAUDVs;
1194 unsigned long TimeInGatlingTanks;
1195 unsigned long TimeInIFVs;
1196 unsigned long FriendlyTinyDeerKilled;
1197 unsigned long SupportReceivedInfantryHp;
1198 unsigned long SupportReceivedVehicleHp;
1199 unsigned long SupportReceivedAmmo;
1200 unsigned long SupportGrantedHpInfantry;
1201 unsigned long SupportGrantedHpVehicle;
1202 unsigned long SupportGrantedAmmo;
1203 unsigned long SupportReceivedHpInfantrySelf;
1204 unsigned long SupportReceivedHpVehicleSelf;
1205 unsigned long SupportReceivedAmmoSelf;
1206 unsigned long PettedCougars;
1207 unsigned long KilledCougars;
1208 unsigned long KilledMutantCougars;
1209 unsigned long FailedPettingCougars;
1210 unsigned long KilledFriendlyCougars;
1211 unsigned long DiedTryingToEscapeBase;
1212 JmgUtility::GenericDateTime LastPlayTime;
1213 unsigned long RescuedCows;
1214 unsigned long KilledCows;
1215 unsigned long LostCows;
1216 unsigned long CompletedCowObjective;
1217 unsigned long KilledMice;
1218 unsigned long CompledMiceObjective;
1219 unsigned long KilledPortablePumpJacks;
1220 unsigned long PortablePumpJacksPlaced;
1221 unsigned long PortablePumpJacksLost;
1222 unsigned long PumpJackMoney;
1223 unsigned long MobilePumpJackMoney;
1225 unsigned long KilledTurkey;
1226 unsigned long ReturnedTurkey;
1229 unsigned long totalObjectivesCompleted;
1230 unsigned long totalPowerupsPickedup;
1235 unsigned int idleDelay;
1236 unsigned long tmpPlayTime;
1237 float tmpSupportReceivedInfantryHp;
1238 float tmpSupportReceivedVehicleHp;
1239 float tmpSupportGrantedHpInfantry;
1240 float tmpSupportGrantedHpVehicle;
1241 float tmpSupportReceivedHpInfantrySelf;
1242 float tmpSupportReceivedHpVehicleSelf;
1243 int tmpPettedCougars;
1244 double weightedRank;
1246 BHScoreNode(
const char *PlayerName)
1248 sprintf(this->PlayerName,
"%s",PlayerName);
1253 RoundsCompleted = 0;
1257 MostKillsInARound = 0;
1258 MostDeathsInARound = 0;
1259 MostBonusObjectivesCompletedInARound = 0;
1265 KilledPresident = 0;
1268 KilledBlackBears = 0;
1269 KilledMutantBears = 0;
1270 KilledMutantDeer = 0;
1271 KilledMutantCats = 0;
1272 KilledMutantCatsB = 0;
1273 KilledMutantCatsR = 0;
1274 KilledMutantRabbits = 0;
1275 ObjectiveActivatedAlarm = 0;
1276 ObjectiveTurretTruck = 0;
1277 ObjectiveTurretTruckAlarm = 0;
1278 ObjectiveOilRigsActivated = 0;
1279 ObjectiveOilRigsRepaired = 0;
1280 ObjectiveEngineersSaved = 0;
1281 ObjectiveWeaponsFound = 0;
1282 ObjectiveWeaponsReturned = 0;
1283 ObjectivePlasmaRifleReturned = 0;
1284 BonusObjectivesCompleted = 0;
1285 PickedupHealthPowerups = 0;
1286 PickedupArmorPowerups = 0;
1287 PickedupCashPowerups = 0;
1288 PickedupAmmoPowerups = 0;
1289 PickedupHealthTotal = 0;
1290 PickedupArmorTotal = 0;
1291 PickedupCashTotal = 0;
1292 PickedupAmmoTotal = 0;
1293 PickedupTotalPowerups = 0;
1294 PickedupTotalPowerupsInARound = 0;
1296 VehiclesDestroyed = 0;
1302 TurretTruckLost = 0;
1304 ActivatedCommTower = 0;
1305 PlayedGamesWithDefenseTurrets = 0;
1306 PlayedGamesWithGuardianHelicopter = 0;
1309 KillsWithSentryTurret = 0;
1310 KilledSentryTurrets = 0;
1311 SentryTurretsPlaced = 0;
1312 SentryTurretsLost = 0;
1313 PickedUpMedicalNeedle = 0;
1314 ReturnedMedicalNeedle = 0;
1315 RepairedSubstation = 0;
1316 SubstationOnLineAtEnd = 0;
1317 SubstationNotDamaged = 0;
1318 GiantDeerKilled = 0;
1320 MutantDogKilled = 0;
1327 PickedUpDeerStatue = 0;
1328 DroppedDeerStatue = 0;
1329 ReturnedDeerStatue = 0;
1331 MutantSquirrelsKilled = 0;
1333 WildSquirrelsKilled = 0;
1334 ArmoredCarsLost = 0;
1338 TimeInACleasans = 0;
1339 TimeInASecurityTruck = 0;
1340 TimeInArmoredCars = 0;
1342 TimeInGatlingTanks = 0;
1344 FriendlyTinyDeerKilled = 0;
1345 SupportReceivedInfantryHp = 0;
1346 SupportReceivedVehicleHp = 0;
1347 SupportReceivedAmmo = 0;
1348 SupportGrantedHpInfantry = 0;
1349 SupportGrantedHpVehicle = 0;
1350 SupportGrantedAmmo = 0;
1351 SupportReceivedHpInfantrySelf = 0;
1352 SupportReceivedHpVehicleSelf = 0;
1353 SupportReceivedAmmoSelf = 0;
1356 KilledMutantCougars = 0;
1357 FailedPettingCougars = 0;
1358 KilledFriendlyCougars = 0;
1359 DiedTryingToEscapeBase = 0;
1360 JmgUtility::GenericDateTime LastPlayTime = JmgUtility::GenericDateTime();
1364 CompletedCowObjective = 0;
1366 CompledMiceObjective = 0;
1367 KilledPortablePumpJacks = 0;
1368 PortablePumpJacksPlaced = 0;
1369 PortablePumpJacksLost = 0;
1371 MobilePumpJackMoney = 0;
1376 startedRound = JMG_Bear_Hunter_Game_Control::gameState >= JMG_Bear_Hunter_Game_Control::HuntBears ? true :
false;
1377 totalObjectivesCompleted = 0;
1378 totalPowerupsPickedup = 0;
1380 lastPos = Vector3(0.0f,0.0f,0.0f);
1385 tmpSupportReceivedInfantryHp = 0.0f;
1386 tmpSupportReceivedVehicleHp = 0.0f;
1387 tmpSupportGrantedHpInfantry = 0.0f;
1388 tmpSupportGrantedHpVehicle = 0.0f;
1389 tmpSupportReceivedHpInfantrySelf = 0.0f;
1390 tmpSupportReceivedHpVehicleSelf = 0.0f;
1391 tmpPettedCougars = 0;
1398 int selectRandomMatchingScore;
1399 BHScoreNode *BHScoreNodeList;
1400 BHScoreNode *BHScoreNodeEmptyNode;
1401 BHScoreNode *BHPlayerHighScoreNodes[128];
1402 BHScoreNode *FindOrAddPlayerBHHighScoreNode(
const char *PlayerName)
1404 if (!BHScoreNodeList)
1406 BHScoreNodeList =
new BHScoreNode(PlayerName);
1407 return BHScoreNodeList;
1409 BHScoreNode *Current = BHScoreNodeList;
1412 if (!_stricmp(Current->PlayerName,PlayerName))
1416 Current->next =
new BHScoreNode(PlayerName);
1417 return Current->next;
1419 Current = Current->next;
1423 int lastDispalyedHighScore;
1424 BHScoreNode *mergeList(BHScoreNode *split1,BHScoreNode *split2)
1430 BHScoreNode *newhead = NULL;
1431 if(split1->weightedRank >= split2->weightedRank)
1434 newhead->next = mergeList(split1->next,split2);
1439 newhead->next = mergeList(split1,split2->next);
1443 void splitList(BHScoreNode *head,BHScoreNode **split1,BHScoreNode **split2)
1445 BHScoreNode *slow = head;
1446 BHScoreNode *fast = head->next;
1457 *split2 = slow->next;
1460 void mergeSort(BHScoreNode **refToHead)
1462 BHScoreNode *head = *refToHead;
1463 BHScoreNode *split1,*split2;
1464 if(head == NULL || head->next == NULL)
1466 splitList(head,&split1,&split2);
1469 *refToHead = mergeList(split1,split2);
1472 void CalculateRank()
1474 BHScoreNode *current = BHScoreNodeList;
1475 unsigned long maxRoundsWon = 0,maxKills = 0,maxBonusObjectivesCompleted = 0,maxPlayTime = 0;
1478 if (current->RoundsWon > maxRoundsWon)
1479 maxRoundsWon = current->RoundsWon;
1480 if (current->Kills > maxKills)
1481 maxKills = current->Kills;
1482 if (current->BonusObjectivesCompleted > maxBonusObjectivesCompleted)
1483 maxBonusObjectivesCompleted = current->BonusObjectivesCompleted;
1484 if (current->PlayTime > maxPlayTime)
1485 maxPlayTime = current->PlayTime;
1486 current = current->next;
1488 current = BHScoreNodeList;
1491 current->weightedRank = current->RoundsWon/(double)maxRoundsWon*1.0+
1492 current->Kills/(
double)maxKills*0.5+
1493 current->BonusObjectivesCompleted/(double)maxBonusObjectivesCompleted*0.5+
1494 current->PlayTime/(
double)maxPlayTime*0.1;
1495 current = current->next;
1497 mergeSort(&BHScoreNodeList);
1500 BearHunterScoreSystem()
1503 lastDispalyedHighScore = -1;
1504 BHScoreNodeList = NULL;
1505 BHScoreNodeEmptyNode =
new BHScoreNode(
"\0");
1506 if (Exe != EXE_LEVELEDIT)
1508 sprintf(savePath,
"%s\\Save\\", Get_File_Path());
1510 for (
int x = 0;x < 128;x++)
1511 BHPlayerHighScoreNodes[x] = BHScoreNodeEmptyNode;
1513 BHScoreNode *Get_Current_Player_Score_Node(
int PlayerID)
1516 return BHScoreNodeEmptyNode;
1517 const char *PlayerName = Get_Player_Name_By_ID(PlayerID);
1519 return BHScoreNodeEmptyNode;
1520 if (!BHPlayerHighScoreNodes[PlayerID])
1521 BHPlayerHighScoreNodes[PlayerID] = FindOrAddPlayerBHHighScoreNode(PlayerName);
1522 else if (_stricmp(BHPlayerHighScoreNodes[PlayerID]->PlayerName,PlayerName))
1523 BHPlayerHighScoreNodes[PlayerID] = FindOrAddPlayerBHHighScoreNode(PlayerName);
1524 return BHPlayerHighScoreNodes[PlayerID];
1529 lastDispalyedHighScore = -1;
1530 for (
int x = 0;x < 128;x++)
1532 if (BHPlayerHighScoreNodes[x])
1533 BHPlayerHighScoreNodes[x] = BHScoreNodeEmptyNode;
1535 if (BHScoreNodeList)
1537 BHScoreNode *temp,*die;
1538 temp = BHScoreNodeList;
1539 while (temp != NULL)
1545 BHScoreNodeList = NULL;
1552 Console_Input(
"msg ERROR: Could not save high scores, no successful load detected!");
1557 char tempPath[512],textTmpPath[512],realPath[512],textPath[512];
1559 sprintf(tempPath,
"%sBearHunterPlayerRecords.tmp",savePath);
1560 sprintf(realPath,
"%sBearHunterPlayerRecords.dat",savePath);
1561 sprintf(textTmpPath,
"%sBearHunterPlayerRecordsTmp.txt",savePath);
1562 sprintf(textPath,
"%sBearHunterPlayerRecords.txt",savePath);
1563 SaveScores = fopen(tempPath,
"w");
1564 SaveScores2 = fopen(textTmpPath,
"w");
1566 int currentRank = 0;
1567 BHScoreNode *Current = BHScoreNodeList;
1570 if (Current->tmpPlayTime >= 60)
1572 if (JMG_Bear_Hunter_Game_Control::spawnKarma > 3)
1573 Current->CheatedRounds++;
1574 if (!JMG_Bear_Hunter_Game_Control::hasBeenInjured)
1575 Current->NeverInjured++;
1577 Current->SupportReceivedInfantryHp += (
unsigned long)Current->tmpSupportReceivedInfantryHp;
1578 Current->SupportReceivedVehicleHp += (
unsigned long)Current->tmpSupportReceivedVehicleHp;
1579 Current->SupportGrantedHpInfantry += (
unsigned long)Current->tmpSupportGrantedHpInfantry;
1580 Current->SupportGrantedHpVehicle += (
unsigned long)Current->tmpSupportGrantedHpVehicle;
1581 Current->SupportReceivedHpInfantrySelf += (
unsigned long)Current->tmpSupportReceivedHpInfantrySelf;
1582 Current->SupportReceivedHpVehicleSelf += (
unsigned long)Current->tmpSupportReceivedHpVehicleSelf;
1583 Current->Rank = ++currentRank;
1584 char EncryptString[2048];
1585 sprintf(EncryptString,
"%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu 0",
1586 Current->PlayTime,Current->PreGameTime,Current->IdleTime,Current->RoundsPlayed,Current->RoundsCompleted,Current->RoundsQuit,Current->RoundsWon,Current->RoundsLost,Current->MostKillsInARound,Current->MostDeathsInARound,Current->MostBonusObjectivesCompletedInARound,Current->Deaths,Current->Kills,Current->VehicleKills,Current->KilledSelf,Current->KilledPlayers,Current->KilledPresident,Current->KilledTurrets,Current->KilledBears,Current->KilledBlackBears,Current->KilledMutantBears,Current->KilledMutantDeer,Current->KilledMutantCats,Current->KilledMutantCatsB,
1587 Current->KilledMutantCatsR,Current->KilledMutantRabbits,Current->ObjectiveActivatedAlarm,Current->ObjectiveTurretTruck,Current->ObjectiveTurretTruckAlarm,Current->ObjectiveOilRigsActivated,Current->ObjectiveOilRigsRepaired,Current->ObjectiveEngineersSaved,Current->ObjectiveWeaponsFound,Current->ObjectiveWeaponsReturned,Current->ObjectivePlasmaRifleReturned,Current->BonusObjectivesCompleted,Current->PickedupHealthPowerups,Current->PickedupArmorPowerups,Current->PickedupCashPowerups,Current->PickedupAmmoPowerups,Current->PickedupHealthTotal,Current->PickedupArmorTotal,
1588 Current->PickedupCashTotal,Current->PickedupAmmoTotal,Current->PickedupTotalPowerups,Current->PickedupTotalPowerupsInARound,Current->KilledHumanAi,Current->VehiclesDestroyed,Current->VehiclesLost,Current->JazzsLost,Current->CleasansLost,Current->TrucksLost,Current->TanksLost,Current->TurretTruckLost,Current->C4VestPowerups,Current->ActivatedCommTower,Current->PlayedGamesWithDefenseTurrets,Current->PlayedGamesWithGuardianHelicopter,Current->TimesDrown,Current->TimesFallen,Current->KillsWithSentryTurret,Current->KilledSentryTurrets,Current->SentryTurretsPlaced,
1589 Current->SentryTurretsLost,Current->PickedUpMedicalNeedle,Current->ReturnedMedicalNeedle,Current->RepairedSubstation,Current->SubstationOnLineAtEnd,Current->SubstationNotDamaged,Current->GiantDeerKilled,Current->SurvivedAlarm,Current->WolfKilled,Current->MutantDogKilled,Current->BlueDeerKilled,Current->CheatedRounds,Current->NeverInjured,Current->MooseKilled,Current->MooseKilled,Current->EatenByRabbit,Current->EatenByRabbit,Current->PickedUpDeerStatue,Current->DroppedDeerStatue,Current->ReturnedDeerStatue,Current->TinyDeerKilled,Current->MutantSquirrelsKilled,
1590 Current->WildDeerKilled,Current->WildSquirrelsKilled,Current->ArmoredCarsLost,Current->WarriorsLost,Current->TimeOnFoot,Current->TimeInAJazzs,Current->TimeInACleasans,Current->TimeInASecurityTruck,Current->TimeInArmoredCars,Current->TimeInAUDVs,Current->TimeInGatlingTanks,Current->TimeInIFVs,Current->FriendlyTinyDeerKilled,Current->LastPlayTime.day,Current->LastPlayTime.month,Current->LastPlayTime.year,Current->LastPlayTime.second,Current->LastPlayTime.minute,Current->LastPlayTime.hour,Current->LastPlayTime.lTime,Current->SupportReceivedInfantryHp,
1591 Current->SupportReceivedVehicleHp,Current->SupportReceivedAmmo,Current->SupportGrantedHpInfantry,Current->SupportGrantedHpVehicle,Current->SupportGrantedAmmo,Current->SupportReceivedHpInfantrySelf,Current->SupportReceivedHpVehicleSelf,Current->SupportReceivedAmmoSelf,Current->PettedCougars,Current->KilledCougars,Current->KilledMutantCougars,Current->FailedPettingCougars,Current->KilledFriendlyCougars,Current->DiedTryingToEscapeBase,Current->RescuedCows,Current->KilledCows,Current->LostCows,Current->CompletedCowObjective,Current->KilledMice,
1592 Current->CompledMiceObjective,Current->KilledPortablePumpJacks,Current->PortablePumpJacksPlaced,Current->PortablePumpJacksLost,Current->PumpJackMoney,Current->MobilePumpJackMoney,Current->Rank,Current->KilledTurkey,Current->ReturnedTurkey);
1593 fprintf(SaveScores2,
"%s\n%s\n",Current->PlayerName,EncryptString);
1594 fprintf(SaveScores,
"%s\n%s",JmgUtility::Rp2Encrypt(Current->PlayerName,25,5),JmgUtility::Rp2Encrypt2(EncryptString,Current->PlayerName[0],Current->PlayerName[1]));
1595 fprintf(SaveScores,
"\n%s",JmgUtility::Rp2Encrypt(EncryptString,Current->PlayerName[1],Current->PlayerName[0]));
1597 fprintf(SaveScores,
"\n");
1598 Current = Current->next;
1601 fclose(SaveScores2);
1603 rename(tempPath,realPath);
1605 rename(textTmpPath,textPath);
1610 char PlayerName[256];
1613 sprintf(realPath,
"%sBearHunterPlayerRecords.dat",savePath);
1614 LoadScores = fopen(realPath,
"r");
1617 while (!feof(LoadScores))
1619 fgets(PlayerName,256,LoadScores);
1620 int Length = strlen(PlayerName);
1623 Console_Input(
"msg MutantAssaultHighScoreSystem::LoadData ERROR: Length is less than 1");
1626 PlayerName[Length-1] =
'\0';
1627 BHScoreNode *Current = FindOrAddPlayerBHHighScoreNode(JmgUtility::Rp2Decrypt(PlayerName,25,5));
1628 char DecryptString[2048],DecryptString2[2048],decryptedString[2048],decryptedString2[2048];
1629 fgets(DecryptString,2048,LoadScores);
1630 fgets(DecryptString2,2048,LoadScores);
1631 sprintf(decryptedString,
"%s",JmgUtility::Rp2Decrypt(DecryptString,Current->PlayerName[0],Current->PlayerName[1]));
1632 sprintf(decryptedString2,
"%s",JmgUtility::Rp2Decrypt(DecryptString2,Current->PlayerName[1],Current->PlayerName[0]));
1634 unsigned int stringLength = strlen(decryptedString);
1635 if (stringLength == strlen(decryptedString2))
1636 for (
unsigned int x = 0;x < stringLength;x++)
1637 if (decryptedString[x] != decryptedString2[x])
1640 char noMatchMsg[220];
1641 sprintf(noMatchMsg,
"msg Error: Cou%s%syp%say%st%sr %s",
"ld ",
"Not Decr",
"t Pl",
"er Da",
"a Fo",Current->PlayerName);
1642 Console_Input(noMatchMsg);
1646 sscanf(decryptedString,
"%lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu",
1647 &Current->PlayTime,&Current->PreGameTime,&Current->IdleTime,&Current->RoundsPlayed,&Current->RoundsCompleted,&Current->RoundsQuit,&Current->RoundsWon,&Current->RoundsLost,&Current->MostKillsInARound,&Current->MostDeathsInARound,&Current->MostBonusObjectivesCompletedInARound,&Current->Deaths,&Current->Kills,&Current->VehicleKills,&Current->KilledSelf,&Current->KilledPlayers,&Current->KilledPresident,&Current->KilledTurrets,&Current->KilledBears,&Current->KilledBlackBears,&Current->KilledMutantBears,&Current->KilledMutantDeer,&Current->KilledMutantCats,&Current->KilledMutantCatsB,
1648 &Current->KilledMutantCatsR,&Current->KilledMutantRabbits,&Current->ObjectiveActivatedAlarm,&Current->ObjectiveTurretTruck,&Current->ObjectiveTurretTruckAlarm,&Current->ObjectiveOilRigsActivated,&Current->ObjectiveOilRigsRepaired,&Current->ObjectiveEngineersSaved,&Current->ObjectiveWeaponsFound,&Current->ObjectiveWeaponsReturned,&Current->ObjectivePlasmaRifleReturned,&Current->BonusObjectivesCompleted,&Current->PickedupHealthPowerups,&Current->PickedupArmorPowerups,&Current->PickedupCashPowerups,&Current->PickedupAmmoPowerups,&Current->PickedupHealthTotal,&Current->PickedupArmorTotal,
1649 &Current->PickedupCashTotal,&Current->PickedupAmmoTotal,&Current->PickedupTotalPowerups,&Current->PickedupTotalPowerupsInARound,&Current->KilledHumanAi,&Current->VehiclesDestroyed,&Current->VehiclesLost,&Current->JazzsLost,&Current->CleasansLost,&Current->TrucksLost,&Current->TanksLost,&Current->TurretTruckLost,&Current->C4VestPowerups,&Current->ActivatedCommTower,&Current->PlayedGamesWithDefenseTurrets,&Current->PlayedGamesWithGuardianHelicopter,&Current->TimesDrown,&Current->TimesFallen,&Current->KillsWithSentryTurret,&Current->KilledSentryTurrets,&Current->SentryTurretsPlaced,
1650 &Current->SentryTurretsLost,&Current->PickedUpMedicalNeedle,&Current->ReturnedMedicalNeedle,&Current->RepairedSubstation,&Current->SubstationOnLineAtEnd,&Current->SubstationNotDamaged,&Current->GiantDeerKilled,&Current->SurvivedAlarm,&Current->WolfKilled,&Current->MutantDogKilled,&Current->BlueDeerKilled,&Current->CheatedRounds,&Current->NeverInjured,&Current->MooseKilled,&Current->MooseKilled,&Current->EatenByRabbit,&Current->EatenByRabbit,&Current->PickedUpDeerStatue,&Current->DroppedDeerStatue,&Current->ReturnedDeerStatue,&Current->TinyDeerKilled,&Current->MutantSquirrelsKilled,
1651 &Current->WildDeerKilled,&Current->WildSquirrelsKilled,&Current->ArmoredCarsLost,&Current->WarriorsLost,&Current->TimeOnFoot,&Current->TimeInAJazzs,&Current->TimeInACleasans,&Current->TimeInASecurityTruck,&Current->TimeInArmoredCars,&Current->TimeInAUDVs,&Current->TimeInGatlingTanks,&Current->TimeInIFVs,&Current->FriendlyTinyDeerKilled,&Current->LastPlayTime.day,&Current->LastPlayTime.month,&Current->LastPlayTime.year,&Current->LastPlayTime.second,&Current->LastPlayTime.minute,&Current->LastPlayTime.hour,&Current->LastPlayTime.lTime,&Current->SupportReceivedInfantryHp,
1652 &Current->SupportReceivedVehicleHp,&Current->SupportReceivedAmmo,&Current->SupportGrantedHpInfantry,&Current->SupportGrantedHpVehicle,&Current->SupportGrantedAmmo,&Current->SupportReceivedHpInfantrySelf,&Current->SupportReceivedHpVehicleSelf,&Current->SupportReceivedAmmoSelf,&Current->PettedCougars,&Current->KilledCougars,&Current->KilledMutantCougars,&Current->FailedPettingCougars,&Current->KilledFriendlyCougars,&Current->DiedTryingToEscapeBase,&Current->RescuedCows,&Current->KilledCows,&Current->LostCows,&Current->CompletedCowObjective,&Current->KilledMice,&Current->CompledMiceObjective,
1653 &Current->KilledPortablePumpJacks,&Current->PortablePumpJacksPlaced,&Current->PortablePumpJacksLost,&Current->PumpJackMoney,&Current->MobilePumpJackMoney,&Current->Rank,&Current->KilledTurkey,&Current->ReturnedTurkey);
1658 inline BHScoreNode *EveluateHighestScore(
unsigned long highValue,
unsigned long currentValue,BHScoreNode *High,BHScoreNode *Current)
1660 if (highValue == currentValue)
1662 selectRandomMatchingScore++;
1663 if (Commands->Get_Random(0.0f,(
float)selectRandomMatchingScore) < 0.5)
1666 else if (highValue < currentValue)
1667 selectRandomMatchingScore = 0;
1668 return (highValue >= currentValue ? High : Current);
1670 BHScoreNode *CompareHighScoreNodes(BHScoreNode *High,BHScoreNode *Current,
int CompVal)
1676 case 0:
return EveluateHighestScore(High->PlayTime,Current->PlayTime,High,Current);
1677 case 1:
return EveluateHighestScore(High->PreGameTime,Current->PreGameTime,High,Current);
1678 case 2:
return EveluateHighestScore(High->IdleTime,Current->IdleTime,High,Current);
1679 case 3:
return EveluateHighestScore(High->RoundsPlayed,Current->RoundsPlayed,High,Current);
1680 case 4:
return EveluateHighestScore(High->RoundsCompleted,Current->RoundsCompleted,High,Current);
1681 case 5:
return EveluateHighestScore(High->RoundsQuit,Current->RoundsQuit,High,Current);
1682 case 6:
return EveluateHighestScore(High->RoundsWon,Current->RoundsWon,High,Current);
1683 case 7:
return EveluateHighestScore(High->RoundsLost,Current->RoundsLost,High,Current);
1684 case 8:
return EveluateHighestScore(High->MostKillsInARound,Current->MostKillsInARound,High,Current);
1685 case 9:
return EveluateHighestScore(High->MostDeathsInARound,Current->MostDeathsInARound,High,Current);
1686 case 10:
return EveluateHighestScore(High->MostBonusObjectivesCompletedInARound,Current->MostBonusObjectivesCompletedInARound,High,Current);
1687 case 11:
return EveluateHighestScore(High->Deaths,Current->Deaths,High,Current);
1688 case 12:
return EveluateHighestScore(High->Kills,Current->Kills,High,Current);
1689 case 13:
return EveluateHighestScore(High->VehicleKills,Current->VehicleKills,High,Current);
1690 case 14:
return EveluateHighestScore(High->KilledSelf,Current->KilledSelf,High,Current);
1691 case 15:
return EveluateHighestScore(High->KilledPlayers,Current->KilledPlayers,High,Current);
1692 case 16:
return EveluateHighestScore(High->KilledPresident,Current->KilledPresident,High,Current);
1693 case 17:
return EveluateHighestScore(High->KilledTurrets,Current->KilledTurrets,High,Current);
1694 case 18:
return EveluateHighestScore(High->KilledBears,Current->KilledBears,High,Current);
1695 case 19:
return EveluateHighestScore(High->KilledBlackBears,Current->KilledBlackBears,High,Current);
1696 case 20:
return EveluateHighestScore(High->KilledMutantBears,Current->KilledMutantBears,High,Current);
1697 case 21:
return EveluateHighestScore(High->KilledMutantDeer,Current->KilledMutantDeer,High,Current);
1698 case 22:
return EveluateHighestScore(High->KilledMutantCats,Current->KilledMutantCats,High,Current);
1699 case 23:
return EveluateHighestScore(High->KilledMutantCatsB,Current->KilledMutantCatsB,High,Current);
1700 case 24:
return EveluateHighestScore(High->KilledMutantCatsR,Current->KilledMutantCatsR,High,Current);
1701 case 25:
return EveluateHighestScore(High->KilledMutantRabbits,Current->KilledMutantRabbits,High,Current);
1702 case 26:
return EveluateHighestScore(High->ObjectiveActivatedAlarm,Current->ObjectiveActivatedAlarm,High,Current);
1703 case 27:
return EveluateHighestScore(High->ObjectiveTurretTruck,Current->ObjectiveTurretTruck,High,Current);
1704 case 28:
return EveluateHighestScore(High->ObjectiveTurretTruckAlarm,Current->ObjectiveTurretTruckAlarm,High,Current);
1705 case 29:
return EveluateHighestScore(High->ObjectiveOilRigsActivated,Current->ObjectiveOilRigsActivated,High,Current);
1706 case 30:
return EveluateHighestScore(High->ObjectiveOilRigsRepaired,Current->ObjectiveOilRigsRepaired,High,Current);
1707 case 31:
return EveluateHighestScore(High->ObjectiveEngineersSaved,Current->ObjectiveEngineersSaved,High,Current);
1708 case 32:
return EveluateHighestScore(High->ObjectiveWeaponsFound,Current->ObjectiveWeaponsFound,High,Current);
1709 case 33:
return EveluateHighestScore(High->ObjectiveWeaponsReturned,Current->ObjectiveWeaponsReturned,High,Current);
1710 case 34:
return EveluateHighestScore(High->ObjectivePlasmaRifleReturned,Current->ObjectivePlasmaRifleReturned,High,Current);
1711 case 35:
return EveluateHighestScore(High->BonusObjectivesCompleted,Current->BonusObjectivesCompleted,High,Current);
1712 case 36:
return EveluateHighestScore(High->PickedupHealthPowerups,Current->PickedupHealthPowerups,High,Current);
1713 case 37:
return EveluateHighestScore(High->PickedupArmorPowerups,Current->PickedupArmorPowerups,High,Current);
1714 case 38:
return EveluateHighestScore(High->PickedupCashPowerups,Current->PickedupCashPowerups,High,Current);
1715 case 39:
return EveluateHighestScore(High->PickedupAmmoPowerups,Current->PickedupAmmoPowerups,High,Current);
1716 case 40:
return EveluateHighestScore(High->PickedupHealthTotal,Current->PickedupHealthTotal,High,Current);
1717 case 41:
return EveluateHighestScore(High->PickedupArmorTotal,Current->PickedupArmorTotal,High,Current);
1718 case 42:
return EveluateHighestScore(High->PickedupCashTotal,Current->PickedupCashTotal,High,Current);
1719 case 43:
return EveluateHighestScore(High->PickedupAmmoTotal,Current->PickedupAmmoTotal,High,Current);
1720 case 44:
return EveluateHighestScore(High->PickedupTotalPowerups,Current->PickedupTotalPowerups,High,Current);
1721 case 45:
return EveluateHighestScore(High->PickedupTotalPowerupsInARound,Current->PickedupTotalPowerupsInARound,High,Current);
1722 case 46:
return EveluateHighestScore(High->KilledHumanAi,Current->KilledHumanAi,High,Current);
1723 case 47:
return EveluateHighestScore(High->VehiclesDestroyed,Current->VehiclesDestroyed,High,Current);
1724 case 48:
return EveluateHighestScore(High->VehiclesLost,Current->VehiclesLost,High,Current);
1725 case 49:
return EveluateHighestScore(High->JazzsLost,Current->JazzsLost,High,Current);
1726 case 50:
return EveluateHighestScore(High->CleasansLost,Current->CleasansLost,High,Current);
1727 case 51:
return EveluateHighestScore(High->TrucksLost,Current->TrucksLost,High,Current);
1728 case 52:
return EveluateHighestScore(High->TanksLost,Current->TanksLost,High,Current);
1729 case 53:
return EveluateHighestScore(High->TurretTruckLost,Current->TurretTruckLost,High,Current);
1730 case 54:
return EveluateHighestScore(High->C4VestPowerups,Current->C4VestPowerups,High,Current);
1731 case 55:
return EveluateHighestScore(High->ActivatedCommTower,Current->ActivatedCommTower,High,Current);
1732 case 56:
return EveluateHighestScore(High->PlayedGamesWithDefenseTurrets,Current->PlayedGamesWithDefenseTurrets,High,Current);
1733 case 57:
return EveluateHighestScore(High->PlayedGamesWithGuardianHelicopter,Current->PlayedGamesWithGuardianHelicopter,High,Current);
1734 case 58:
return EveluateHighestScore(High->TimesDrown,Current->TimesDrown,High,Current);
1735 case 59:
return EveluateHighestScore(High->TimesFallen,Current->TimesFallen,High,Current);
1736 case 60:
return EveluateHighestScore(High->KillsWithSentryTurret,Current->KillsWithSentryTurret,High,Current);
1737 case 61:
return EveluateHighestScore(High->KilledSentryTurrets,Current->KilledSentryTurrets,High,Current);
1738 case 62:
return EveluateHighestScore(High->SentryTurretsPlaced,Current->SentryTurretsPlaced,High,Current);
1739 case 63:
return EveluateHighestScore(High->SentryTurretsLost,Current->SentryTurretsLost,High,Current);
1740 case 64:
return EveluateHighestScore(High->PickedUpMedicalNeedle,Current->PickedUpMedicalNeedle,High,Current);
1741 case 65:
return EveluateHighestScore(High->ReturnedMedicalNeedle,Current->ReturnedMedicalNeedle,High,Current);
1742 case 66:
return EveluateHighestScore(High->RepairedSubstation,Current->RepairedSubstation,High,Current);
1743 case 67:
return EveluateHighestScore(High->SubstationOnLineAtEnd,Current->SubstationOnLineAtEnd,High,Current);
1744 case 68:
return EveluateHighestScore(High->SubstationNotDamaged,Current->SubstationNotDamaged,High,Current);
1745 case 69:
return EveluateHighestScore(High->GiantDeerKilled,Current->GiantDeerKilled,High,Current);
1746 case 70:
return EveluateHighestScore(High->SurvivedAlarm,Current->SurvivedAlarm,High,Current);
1747 case 71:
return EveluateHighestScore(High->WolfKilled,Current->WolfKilled,High,Current);
1748 case 72:
return EveluateHighestScore(High->MutantDogKilled,Current->MutantDogKilled,High,Current);
1749 case 73:
return EveluateHighestScore(High->BlueDeerKilled,Current->BlueDeerKilled,High,Current);
1750 case 74:
return EveluateHighestScore(High->CheatedRounds,Current->CheatedRounds,High,Current);
1751 case 75:
return EveluateHighestScore(High->NeverInjured,Current->NeverInjured,High,Current);
1752 case 76:
return EveluateHighestScore(High->MooseKilled,Current->MooseKilled,High,Current);
1753 case 77:
return EveluateHighestScore(High->EatenByRabbit,Current->EatenByRabbit,High,Current);
1754 case 78:
return EveluateHighestScore(High->PickedUpDeerStatue,Current->PickedUpDeerStatue,High,Current);
1755 case 79:
return EveluateHighestScore(High->DroppedDeerStatue,Current->DroppedDeerStatue,High,Current);
1756 case 80:
return EveluateHighestScore(High->ReturnedDeerStatue,Current->ReturnedDeerStatue,High,Current);
1757 case 81:
return EveluateHighestScore(High->TinyDeerKilled,Current->TinyDeerKilled,High,Current);
1758 case 82:
return EveluateHighestScore(High->MutantSquirrelsKilled,Current->MutantSquirrelsKilled,High,Current);
1759 case 83:
return EveluateHighestScore(High->WildDeerKilled,Current->WildDeerKilled,High,Current);
1760 case 84:
return EveluateHighestScore(High->WildSquirrelsKilled,Current->WildSquirrelsKilled,High,Current);
1761 case 85:
return EveluateHighestScore(High->ArmoredCarsLost,Current->ArmoredCarsLost,High,Current);
1762 case 86:
return EveluateHighestScore(High->WarriorsLost,Current->WarriorsLost,High,Current);
1763 case 87:
return EveluateHighestScore(High->TimeOnFoot,Current->TimeOnFoot,High,Current);
1764 case 88:
return EveluateHighestScore(High->TimeInAJazzs,Current->TimeInAJazzs,High,Current);
1765 case 89:
return EveluateHighestScore(High->TimeInACleasans,Current->TimeInACleasans,High,Current);
1766 case 90:
return EveluateHighestScore(High->TimeInASecurityTruck,Current->TimeInASecurityTruck,High,Current);
1767 case 91:
return EveluateHighestScore(High->TimeInArmoredCars,Current->TimeInArmoredCars,High,Current);
1768 case 92:
return EveluateHighestScore(High->TimeInAUDVs,Current->TimeInAUDVs,High,Current);
1769 case 93:
return EveluateHighestScore(High->TimeInGatlingTanks,Current->TimeInGatlingTanks,High,Current);
1770 case 94:
return EveluateHighestScore(High->TimeInIFVs,Current->TimeInIFVs,High,Current);
1771 case 95:
return EveluateHighestScore(High->FriendlyTinyDeerKilled,Current->FriendlyTinyDeerKilled,High,Current);
1772 case 96:
return EveluateHighestScore(High->SupportReceivedInfantryHp,Current->SupportReceivedInfantryHp,High,Current);
1773 case 97:
return EveluateHighestScore(High->SupportReceivedVehicleHp,Current->SupportReceivedVehicleHp,High,Current);
1774 case 98:
return EveluateHighestScore(High->SupportReceivedAmmo,Current->SupportReceivedAmmo,High,Current);
1775 case 99:
return EveluateHighestScore(High->SupportGrantedHpInfantry,Current->SupportGrantedHpInfantry,High,Current);
1776 case 100:
return EveluateHighestScore(High->SupportGrantedHpVehicle,Current->SupportGrantedHpVehicle,High,Current);
1777 case 101:
return EveluateHighestScore(High->SupportGrantedAmmo,Current->SupportGrantedAmmo,High,Current);
1778 case 102:
return EveluateHighestScore(High->SupportReceivedHpInfantrySelf,Current->SupportReceivedHpInfantrySelf,High,Current);
1779 case 103:
return EveluateHighestScore(High->SupportReceivedHpVehicleSelf,Current->SupportReceivedHpVehicleSelf,High,Current);
1780 case 104:
return EveluateHighestScore(High->SupportReceivedAmmoSelf,Current->SupportReceivedAmmoSelf,High,Current);
1781 case 105:
return EveluateHighestScore(High->PettedCougars,Current->PettedCougars,High,Current);
1782 case 106:
return EveluateHighestScore(High->KilledCougars,Current->KilledCougars,High,Current);
1783 case 107:
return EveluateHighestScore(High->KilledMutantCougars,Current->KilledMutantCougars,High,Current);
1784 case 108:
return EveluateHighestScore(High->FailedPettingCougars,Current->FailedPettingCougars,High,Current);
1785 case 109:
return EveluateHighestScore(High->KilledFriendlyCougars,Current->KilledFriendlyCougars,High,Current);
1786 case 110:
return EveluateHighestScore(High->DiedTryingToEscapeBase,Current->DiedTryingToEscapeBase,High,Current);
1787 case 111:
return EveluateHighestScore(High->RescuedCows,Current->RescuedCows,High,Current);
1788 case 112:
return EveluateHighestScore(High->KilledCows,Current->KilledCows,High,Current);
1789 case 113:
return EveluateHighestScore(High->LostCows,Current->LostCows,High,Current);
1790 case 114:
return EveluateHighestScore(High->CompletedCowObjective,Current->CompletedCowObjective,High,Current);
1791 case 115:
return EveluateHighestScore(High->KilledMice,Current->KilledMice,High,Current);
1792 case 116:
return EveluateHighestScore(High->CompledMiceObjective,Current->CompledMiceObjective,High,Current);
1793 case 117:
return EveluateHighestScore(High->KilledPortablePumpJacks,Current->KilledPortablePumpJacks,High,Current);
1794 case 118:
return EveluateHighestScore(High->PortablePumpJacksPlaced,Current->PortablePumpJacksPlaced,High,Current);
1795 case 119:
return EveluateHighestScore(High->PortablePumpJacksLost,Current->PortablePumpJacksLost,High,Current);
1796 case 120:
return EveluateHighestScore(High->PumpJackMoney,Current->PumpJackMoney,High,Current);
1797 case 121:
return EveluateHighestScore(High->MobilePumpJackMoney,Current->MobilePumpJackMoney,High,Current);
1798 case 122:
return EveluateHighestScore(High->KilledTurkey,Current->KilledTurkey,High,Current);
1799 case 123:
return EveluateHighestScore(High->ReturnedTurkey,Current->ReturnedTurkey,High,Current);
1800 default:
return High;
1803 bool ReturnHighScoreNodeValue(BHScoreNode *Node,
int CompVal)
1809 case 0:
return Node->PlayTime ? true :
false;
1810 case 1:
return Node->PreGameTime ? true :
false;
1811 case 2:
return Node->IdleTime ? true :
false;
1812 case 3:
return Node->RoundsPlayed ? true :
false;
1813 case 4:
return Node->RoundsCompleted ? true :
false;
1814 case 5:
return Node->RoundsQuit ? true :
false;
1815 case 6:
return Node->RoundsWon ? true :
false;
1816 case 7:
return Node->RoundsLost ? true :
false;
1817 case 8:
return Node->MostKillsInARound ? true :
false;
1818 case 9:
return Node->MostDeathsInARound ? true :
false;
1819 case 10:
return Node->MostBonusObjectivesCompletedInARound ? true :
false;
1820 case 11:
return Node->Deaths ? true :
false;
1821 case 12:
return Node->Kills ? true :
false;
1822 case 13:
return Node->VehicleKills ? true :
false;
1823 case 14:
return Node->KilledSelf ? true :
false;
1824 case 15:
return Node->KilledPlayers ? true :
false;
1825 case 16:
return Node->KilledPresident ? true :
false;
1826 case 17:
return Node->KilledTurrets ? true :
false;
1827 case 18:
return Node->KilledBears ? true :
false;
1828 case 19:
return Node->KilledBlackBears ? true :
false;
1829 case 20:
return Node->KilledMutantBears ? true :
false;
1830 case 21:
return Node->KilledMutantDeer ? true :
false;
1831 case 22:
return Node->KilledMutantCats ? true :
false;
1832 case 23:
return Node->KilledMutantCatsB ? true :
false;
1833 case 24:
return Node->KilledMutantCatsR ? true :
false;
1834 case 25:
return Node->KilledMutantRabbits ? true :
false;
1835 case 26:
return Node->ObjectiveActivatedAlarm ? true :
false;
1836 case 27:
return Node->ObjectiveTurretTruck ? true :
false;
1837 case 28:
return Node->ObjectiveTurretTruckAlarm ? true :
false;
1838 case 29:
return Node->ObjectiveOilRigsActivated ? true :
false;
1839 case 30:
return Node->ObjectiveOilRigsRepaired ? true :
false;
1840 case 31:
return Node->ObjectiveEngineersSaved ? true :
false;
1841 case 32:
return Node->ObjectiveWeaponsFound ? true :
false;
1842 case 33:
return Node->ObjectiveWeaponsReturned ? true :
false;
1843 case 34:
return Node->ObjectivePlasmaRifleReturned ? true :
false;
1844 case 35:
return Node->BonusObjectivesCompleted ? true :
false;
1845 case 36:
return Node->PickedupHealthPowerups ? true :
false;
1846 case 37:
return Node->PickedupArmorPowerups ? true :
false;
1847 case 38:
return Node->PickedupCashPowerups ? true :
false;
1848 case 39:
return Node->PickedupAmmoPowerups ? true :
false;
1849 case 40:
return Node->PickedupHealthTotal ? true :
false;
1850 case 41:
return Node->PickedupArmorTotal ? true :
false;
1851 case 42:
return Node->PickedupCashTotal ? true :
false;
1852 case 43:
return Node->PickedupAmmoTotal ? true :
false;
1853 case 44:
return Node->PickedupTotalPowerups ? true :
false;
1854 case 45:
return Node->PickedupTotalPowerupsInARound ? true :
false;
1855 case 46:
return Node->KilledHumanAi ? true :
false;
1856 case 47:
return Node->VehiclesDestroyed ? true :
false;
1857 case 48:
return Node->VehiclesLost ? true :
false;
1858 case 49:
return Node->JazzsLost ? true :
false;
1859 case 50:
return Node->CleasansLost ? true :
false;
1860 case 51:
return Node->TrucksLost ? true :
false;
1861 case 52:
return Node->TanksLost ? true :
false;
1862 case 53:
return Node->TurretTruckLost ? true :
false;
1863 case 54:
return Node->C4VestPowerups ? true :
false;
1864 case 55:
return Node->ActivatedCommTower ? true :
false;
1865 case 56:
return Node->PlayedGamesWithDefenseTurrets ? true :
false;
1866 case 57:
return Node->PlayedGamesWithGuardianHelicopter ? true :
false;
1867 case 58:
return Node->TimesDrown ? true :
false;
1868 case 59:
return Node->TimesFallen ? true :
false;
1869 case 60:
return Node->KillsWithSentryTurret ? true :
false;
1870 case 61:
return Node->KilledSentryTurrets ? true :
false;
1871 case 62:
return Node->SentryTurretsPlaced ? true :
false;
1872 case 63:
return Node->SentryTurretsLost ? true :
false;
1873 case 64:
return Node->PickedUpMedicalNeedle ? true :
false;
1874 case 65:
return Node->ReturnedMedicalNeedle ? true :
false;
1875 case 66:
return Node->RepairedSubstation ? true :
false;
1876 case 67:
return Node->SubstationOnLineAtEnd ? true :
false;
1877 case 68:
return Node->RepairedSubstation ? true :
false;
1878 case 69:
return Node->GiantDeerKilled ? true :
false;
1879 case 70:
return Node->SurvivedAlarm ? true :
false;
1880 case 71:
return Node->WolfKilled ? true :
false;
1881 case 72:
return Node->MutantDogKilled ? true :
false;
1882 case 73:
return Node->BlueDeerKilled ? true :
false;
1883 case 74:
return Node->CheatedRounds ? true :
false;
1884 case 75:
return Node->NeverInjured ? true :
false;
1885 case 76:
return Node->MooseKilled ? true :
false;
1886 case 77:
return Node->EatenByRabbit ? true :
false;
1887 case 78:
return Node->PickedUpDeerStatue ? true :
false;
1888 case 79:
return Node->DroppedDeerStatue ? true :
false;
1889 case 80:
return Node->ReturnedDeerStatue ? true :
false;
1890 case 81:
return Node->TinyDeerKilled ? true :
false;
1891 case 82:
return Node->MutantSquirrelsKilled ? true :
false;
1892 case 83:
return Node->WildDeerKilled ? true :
false;
1893 case 84:
return Node->WildSquirrelsKilled ? true :
false;
1894 case 85:
return Node->ArmoredCarsLost ? true :
false;
1895 case 86:
return Node->WarriorsLost ? true :
false;
1896 case 87:
return Node->TimeOnFoot ? true :
false;
1897 case 88:
return Node->TimeInAJazzs ? true :
false;
1898 case 89:
return Node->TimeInACleasans ? true :
false;
1899 case 90:
return Node->TimeInASecurityTruck ? true :
false;
1900 case 91:
return Node->TimeInArmoredCars ? true :
false;
1901 case 92:
return Node->TimeInAUDVs ? true :
false;
1902 case 93:
return Node->TimeInGatlingTanks ? true :
false;
1903 case 94:
return Node->TimeInIFVs ? true :
false;
1904 case 95:
return Node->FriendlyTinyDeerKilled ? true :
false;
1905 case 96:
return Node->SupportReceivedInfantryHp ? true :
false;
1906 case 97:
return Node->SupportReceivedVehicleHp ? true :
false;
1907 case 98:
return Node->SupportReceivedAmmo ? true :
false;
1908 case 99:
return Node->SupportGrantedHpInfantry ? true :
false;
1909 case 100:
return Node->SupportGrantedHpVehicle ? true :
false;
1910 case 101:
return Node->SupportGrantedAmmo ? true :
false;
1911 case 102:
return Node->SupportReceivedHpInfantrySelf ? true :
false;
1912 case 103:
return Node->SupportReceivedHpVehicleSelf ? true :
false;
1913 case 104:
return Node->SupportReceivedAmmoSelf ? true :
false;
1914 case 105:
return Node->PettedCougars ? true :
false;
1915 case 106:
return Node->KilledCougars ? true :
false;
1916 case 107:
return Node->KilledMutantCougars ? true :
false;
1917 case 108:
return Node->FailedPettingCougars ? true :
false;
1918 case 109:
return Node->KilledFriendlyCougars ? true :
false;
1919 case 110:
return Node->DiedTryingToEscapeBase ? true :
false;
1920 case 111:
return Node->RescuedCows ? true :
false;
1921 case 112:
return Node->KilledCows ? true :
false;
1922 case 113:
return Node->LostCows ? true :
false;
1923 case 114:
return Node->CompletedCowObjective ? true :
false;
1924 case 115:
return Node->KilledMice ? true :
false;
1925 case 116:
return Node->CompledMiceObjective ? true :
false;
1926 case 117:
return Node->KilledPortablePumpJacks ? true :
false;
1927 case 118:
return Node->PortablePumpJacksPlaced ? true :
false;
1928 case 119:
return Node->PortablePumpJacksLost ? true :
false;
1929 case 120:
return Node->PumpJackMoney ? true :
false;
1930 case 121:
return Node->MobilePumpJackMoney ? true :
false;
1931 case 122:
return Node->KilledTurkey ? true :
false;
1932 case 123:
return Node->ReturnedTurkey ? true :
false;
1933 default: Console_Input(
"msg SCORE SYSTEM ERROR: Out of bounds!");
return false;
1936 char *ReturnScore(BHScoreNode *High,
int CompVal)
1938 static char RetChar[200];
1943 case 0: sprintf(RetChar,
"Server Record: %s has played bear hunter for %s mintues.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PlayTime/60.0f));
return RetChar;
1944 case 1: sprintf(RetChar,
"Server Record: %s has dicked around for %s minutes before finally leaving the base to go hunting.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PreGameTime/60.0f));
return RetChar;
1945 case 2: sprintf(RetChar,
"Server Record: %s has been idle for %s minutes.",High->PlayerName,JmgUtility::formatDigitGrouping(High->IdleTime/60.0f));
return RetChar;
1946 case 3: sprintf(RetChar,
"Server Record: %s has joined %s rounds of bear hunter.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RoundsPlayed));
return RetChar;
1947 case 4: sprintf(RetChar,
"Server Record: %s has completed %s rounds of bear hunter.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RoundsCompleted));
return RetChar;
1948 case 5: sprintf(RetChar,
"Server Record: %s has quit %s rounds of bear hunter.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RoundsQuit));
return RetChar;
1949 case 6: sprintf(RetChar,
"Server Record: %s has won %s rounds of bear hunter.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RoundsWon));
return RetChar;
1950 case 7: sprintf(RetChar,
"Server Record: %s has lost %s rounds of bear hunter.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RoundsLost));
return RetChar;
1951 case 8: sprintf(RetChar,
"Server Record: %s has the most kills in a round: %s.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MostKillsInARound));
return RetChar;
1952 case 9: sprintf(RetChar,
"Server Record: %s has the most deaths in a round: %s.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MostDeathsInARound));
return RetChar;
1953 case 10: sprintf(RetChar,
"Server Record: %s has completed the most objectives in a round: %s.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MostBonusObjectivesCompletedInARound));
return RetChar;
1954 case 11: sprintf(RetChar,
"Server Record: %s has %s deaths.",High->PlayerName,JmgUtility::formatDigitGrouping(High->Deaths));
return RetChar;
1955 case 12: sprintf(RetChar,
"Server Record: %s has %s kills.",High->PlayerName,JmgUtility::formatDigitGrouping(High->Kills));
return RetChar;
1956 case 13: sprintf(RetChar,
"Server Record: %s has %s vehicle kills.",High->PlayerName,JmgUtility::formatDigitGrouping(High->VehicleKills));
return RetChar;
1957 case 14: sprintf(RetChar,
"Server Record: %s has comitted suicide %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledSelf));
return RetChar;
1958 case 15: sprintf(RetChar,
"Server Record: %s has killed %s other players.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledPlayers));
return RetChar;
1959 case 16: sprintf(RetChar,
"Server Record: %s has killed the President of Corporate America %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledPresident));
return RetChar;
1960 case 17: sprintf(RetChar,
"Server Record: %s has killed %s shredder turrets.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledTurrets));
return RetChar;
1961 case 18: sprintf(RetChar,
"Server Record: %s has killed %s brown bears.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledBears));
return RetChar;
1962 case 19: sprintf(RetChar,
"Server Record: %s has killed %s black bears.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledBlackBears));
return RetChar;
1963 case 20: sprintf(RetChar,
"Server Record: %s has killed %s mutant bears.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantBears));
return RetChar;
1964 case 21: sprintf(RetChar,
"Server Record: %s has killed %s mutant deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantDeer));
return RetChar;
1965 case 22: sprintf(RetChar,
"Server Record: %s has killed %s mutant cats.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantCats));
return RetChar;
1966 case 23: sprintf(RetChar,
"Server Record: %s has killed %s mutant ion cats.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantCatsB));
return RetChar;
1967 case 24: sprintf(RetChar,
"Server Record: %s has killed %s mutant nuclear cats.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantCatsR));
return RetChar;
1968 case 25: sprintf(RetChar,
"Server Record: %s has killed the boss rabbit %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantRabbits));
return RetChar;
1969 case 26: sprintf(RetChar,
"Server Record: %s has activated the alarm %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveActivatedAlarm));
return RetChar;
1970 case 27: sprintf(RetChar,
"Server Record: %s has returned the security truck %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveTurretTruck));
return RetChar;
1971 case 28: sprintf(RetChar,
"Server Record: %s has deactivated the security alarm %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveTurretTruckAlarm));
return RetChar;
1972 case 29: sprintf(RetChar,
"Server Record: %s has activated %s pump jacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveOilRigsActivated));
return RetChar;
1973 case 30: sprintf(RetChar,
"Server Record: %s has repaired %s pump jacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveOilRigsRepaired));
return RetChar;
1974 case 31: sprintf(RetChar,
"Server Record: %s has saved %s engineers.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveEngineersSaved));
return RetChar;
1975 case 32: sprintf(RetChar,
"Server Record: %s has found %s weapon containers.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveWeaponsFound));
return RetChar;
1976 case 33: sprintf(RetChar,
"Server Record: %s has returned %s weapon containers.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectiveWeaponsReturned));
return RetChar;
1977 case 34: sprintf(RetChar,
"Server Record: %s has retrived the plasma rifle weapon container %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ObjectivePlasmaRifleReturned));
return RetChar;
1978 case 35: sprintf(RetChar,
"Server Record: %s has completed %s bonus objectives.",High->PlayerName,JmgUtility::formatDigitGrouping(High->BonusObjectivesCompleted));
return RetChar;
1979 case 36: sprintf(RetChar,
"Server Record: %s has acquired %s health powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupHealthPowerups));
return RetChar;
1980 case 37: sprintf(RetChar,
"Server Record: %s has acquired %s armor powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupArmorPowerups));
return RetChar;
1981 case 38: sprintf(RetChar,
"Server Record: %s has acquired %s cash powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupCashPowerups));
return RetChar;
1982 case 39: sprintf(RetChar,
"Server Record: %s has acquired %s ammo powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupAmmoPowerups));
return RetChar;
1983 case 40: sprintf(RetChar,
"Server Record: %s has acquired %s health from health powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupHealthTotal));
return RetChar;
1984 case 41: sprintf(RetChar,
"Server Record: %s has acquired %s armor from armor powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupArmorTotal));
return RetChar;
1985 case 42: sprintf(RetChar,
"Server Record: %s has acquired $%s.00 dollars from cash powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupCashTotal));
return RetChar;
1986 case 43: sprintf(RetChar,
"Server Record: %s has acquired %s clips of ammo from ammo powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupAmmoTotal));
return RetChar;
1987 case 44: sprintf(RetChar,
"Server Record: %s has acquired %s powerups.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupTotalPowerups));
return RetChar;
1988 case 45: sprintf(RetChar,
"Server Record: %s has acquired %s powerups in a round.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedupTotalPowerupsInARound));
return RetChar;
1989 case 46: sprintf(RetChar,
"Server Record: %s has killed %s friendly AI.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledHumanAi));
return RetChar;
1990 case 47: sprintf(RetChar,
"Server Record: %s has destroyed %s vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->VehiclesDestroyed));
return RetChar;
1991 case 48: sprintf(RetChar,
"Server Record: %s has lost %s vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->VehiclesLost));
return RetChar;
1992 case 49: sprintf(RetChar,
"Server Record: %s has lost %s Punda Jazzs.",High->PlayerName,JmgUtility::formatDigitGrouping(High->JazzsLost));
return RetChar;
1993 case 50: sprintf(RetChar,
"Server Record: %s has lost %s Cleasan Primera.",High->PlayerName,JmgUtility::formatDigitGrouping(High->CleasansLost));
return RetChar;
1994 case 51: sprintf(RetChar,
"Server Record: %s has lost %s Urban Defense Vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TrucksLost));
return RetChar;
1995 case 52: sprintf(RetChar,
"Server Record: %s has lost %s Gattling Tanks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TanksLost));
return RetChar;
1996 case 53: sprintf(RetChar,
"Server Record: %s has lost %s Cargo Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TurretTruckLost));
return RetChar;
1997 case 54: sprintf(RetChar,
"Server Record: %s has acquired %s C4 Vests.",High->PlayerName,JmgUtility::formatDigitGrouping(High->C4VestPowerups));
return RetChar;
1998 case 55: sprintf(RetChar,
"Server Record: %s activated the transmitter %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ActivatedCommTower));
return RetChar;
1999 case 56: sprintf(RetChar,
"Server Record: %s played in %s games where the security truck has been returned to base.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PlayedGamesWithDefenseTurrets));
return RetChar;
2000 case 57: sprintf(RetChar,
"Server Record: %s has played %s games with assistance from Comanche 4573.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PlayedGamesWithGuardianHelicopter));
return RetChar;
2001 case 58: sprintf(RetChar,
"Server Record: %s has gone too far from the shore %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimesDrown));
return RetChar;
2002 case 59: sprintf(RetChar,
"Server Record: %s has fell to their death %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimesFallen));
return RetChar;
2003 case 60: sprintf(RetChar,
"Server Record: %s has got %s kills with a sentry turret.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KillsWithSentryTurret));
return RetChar;
2004 case 61: sprintf(RetChar,
"Server Record: %s has destroyed %s sentry turrets.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledSentryTurrets));
return RetChar;
2005 case 62: sprintf(RetChar,
"Server Record: %s has placed %s sentry turrets.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SentryTurretsPlaced));
return RetChar;
2006 case 63: sprintf(RetChar,
"Server Record: %s has lost %s sentry turrets.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SentryTurretsLost));
return RetChar;
2007 case 64: sprintf(RetChar,
"Server Record: %s has picked up the medical needle %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedUpMedicalNeedle));
return RetChar;
2008 case 65: sprintf(RetChar,
"Server Record: %s has returned the medical needle %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ReturnedMedicalNeedle));
return RetChar;
2009 case 66: sprintf(RetChar,
"Server Record: %s has repaired the Power Substation %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RepairedSubstation));
return RetChar;
2010 case 67: sprintf(RetChar,
"Server Record: %s has finished %s rounds with the substation online.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SubstationOnLineAtEnd));
return RetChar;
2011 case 68: sprintf(RetChar,
"Server Record: %s has played %s rounds in which the substation was never damaged.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SubstationNotDamaged));
return RetChar;
2012 case 69: sprintf(RetChar,
"Server Record: %s has killed %s Genitically Enhanced Deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->GiantDeerKilled));
return RetChar;
2013 case 70: sprintf(RetChar,
"Server Record: %s has successfully held the cabin %s times for the duration of the EAS.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SurvivedAlarm));
return RetChar;
2014 case 71: sprintf(RetChar,
"Server Record: %s has killed %s Wolfs.",High->PlayerName,JmgUtility::formatDigitGrouping(High->WolfKilled));
return RetChar;
2015 case 72: sprintf(RetChar,
"Server Record: %s has killed %s Mutant Dogs.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MutantDogKilled));
return RetChar;
2016 case 73: sprintf(RetChar,
"Server Record: %s has killed %s Karma Deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->BlueDeerKilled));
return RetChar;
2017 case 74: sprintf(RetChar,
"Server Record: %s has been in %s games that were won unbelievably well.",High->PlayerName,JmgUtility::formatDigitGrouping(High->CheatedRounds));
return RetChar;
2018 case 75: sprintf(RetChar,
"Server Record: %s has been in %s games without the president getting hurt by mutants.",High->PlayerName,JmgUtility::formatDigitGrouping(High->NeverInjured));
return RetChar;
2019 case 76: sprintf(RetChar,
"Server Record: %s has killed %s Moose.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MooseKilled));
return RetChar;
2020 case 77: sprintf(RetChar,
"Server Record: %s has been eaten by the rabbit %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->EatenByRabbit));
return RetChar;
2021 case 78: sprintf(RetChar,
"Server Record: %s has picked up the golden deer statue %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PickedUpDeerStatue));
return RetChar;
2022 case 79: sprintf(RetChar,
"Server Record: %s has dropped up the golden deer statue %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->DroppedDeerStatue));
return RetChar;
2023 case 80: sprintf(RetChar,
"Server Record: %s has returned up the golden deer statue %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ReturnedDeerStatue));
return RetChar;
2024 case 81: sprintf(RetChar,
"Server Record: %s has killed %s tiny deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TinyDeerKilled));
return RetChar;
2025 case 82: sprintf(RetChar,
"Server Record: %s has killed %s mutant squirrels.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MutantSquirrelsKilled));
return RetChar;
2026 case 83: sprintf(RetChar,
"Server Record: %s has killed %s wild deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->WildDeerKilled));
return RetChar;
2027 case 84: sprintf(RetChar,
"Server Record: %s has killed %s wild squirrels.",High->PlayerName,JmgUtility::formatDigitGrouping(High->WildSquirrelsKilled));
return RetChar;
2028 case 85: sprintf(RetChar,
"Server Record: %s has lost %s Armored Cars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ArmoredCarsLost));
return RetChar;
2029 case 86: sprintf(RetChar,
"Server Record: %s has lost %s Warrior Infantry Fighting Vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->WarriorsLost));
return RetChar;
2030 case 87: sprintf(RetChar,
"Server Record: %s has spent %s minutes on foot.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeOnFoot/60.0f));
return RetChar;
2031 case 88: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Punda Jazzes.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInAJazzs/60.0f));
return RetChar;
2032 case 89: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Cleasan Primeras.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInACleasans/60.0f));
return RetChar;
2033 case 90: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Turret Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInASecurityTruck/60.0f));
return RetChar;
2034 case 91: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Armored Cars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInArmoredCars/60.0f));
return RetChar;
2035 case 92: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Urban Defense Vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInAUDVs/60.0f));
return RetChar;
2036 case 93: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Gatling Tanks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInGatlingTanks/60.0f));
return RetChar;
2037 case 94: sprintf(RetChar,
"Server Record: %s has spent %s minutes in Warrior Infantry Fighting Vehicles.",High->PlayerName,JmgUtility::formatDigitGrouping(High->TimeInIFVs/60.0f));
return RetChar;
2038 case 95: sprintf(RetChar,
"Server Record: %s has killed %s friendly tiny deer.",High->PlayerName,JmgUtility::formatDigitGrouping(High->FriendlyTinyDeerKilled));
return RetChar;
2039 case 96: sprintf(RetChar,
"Server Record: %s has received %s points of HP to infantry from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedInfantryHp));
return RetChar;
2040 case 97: sprintf(RetChar,
"Server Record: %s has received %s points of HP to vehicles from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedVehicleHp));
return RetChar;
2041 case 98: sprintf(RetChar,
"Server Record: %s has received %s points of ammo from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedAmmo));
return RetChar;
2042 case 99: sprintf(RetChar,
"Server Record: %s has given %s points of HP to infantry from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportGrantedHpInfantry));
return RetChar;
2043 case 100: sprintf(RetChar,
"Server Record: %s has given %s points of HP to vehicles from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportGrantedHpVehicle));
return RetChar;
2044 case 101: sprintf(RetChar,
"Server Record: %s has given %s points of ammo from Armored Supply Trucks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportGrantedAmmo));
return RetChar;
2045 case 102: sprintf(RetChar,
"Server Record: %s has given %s points of HP to infantry from Armored Supply Trucks to theirself.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedHpInfantrySelf));
return RetChar;
2046 case 103: sprintf(RetChar,
"Server Record: %s has given %s points of HP to vehicles from Armored Supply Trucks to theirself.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedHpVehicleSelf));
return RetChar;
2047 case 104: sprintf(RetChar,
"Server Record: %s has given %s points of ammo from Armored Supply Trucks to theirself.",High->PlayerName,JmgUtility::formatDigitGrouping(High->SupportReceivedAmmoSelf));
return RetChar;
2048 case 105: sprintf(RetChar,
"Server Record: %s has petted %s cougars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PettedCougars));
return RetChar;
2049 case 106: sprintf(RetChar,
"Server Record: %s has killed %s wild cougars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledCougars));
return RetChar;
2050 case 107: sprintf(RetChar,
"Server Record: %s has killed %s mutant cougars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMutantCougars));
return RetChar;
2051 case 108: sprintf(RetChar,
"Server Record: %s has killed %s cougars instead of petting them.",High->PlayerName,JmgUtility::formatDigitGrouping(High->FailedPettingCougars));
return RetChar;
2052 case 109: sprintf(RetChar,
"Server Record: %s has killed %s friendly cougars.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledFriendlyCougars));
return RetChar;
2053 case 110: sprintf(RetChar,
"Server Record: %s has died trying to escape the base %s times when the boss was lurking about.",High->PlayerName,JmgUtility::formatDigitGrouping(High->DiedTryingToEscapeBase));
return RetChar;
2054 case 111: sprintf(RetChar,
"Server Record: %s has rescued %s cows.",High->PlayerName,JmgUtility::formatDigitGrouping(High->RescuedCows));
return RetChar;
2055 case 112: sprintf(RetChar,
"Server Record: %s has killed %s cows.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledCows));
return RetChar;
2056 case 113: sprintf(RetChar,
"Server Record: %s has lost %s cows.",High->PlayerName,JmgUtility::formatDigitGrouping(High->LostCows));
return RetChar;
2057 case 114: sprintf(RetChar,
"Server Record: %s has completed the cow objective %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->CompletedCowObjective));
return RetChar;
2058 case 115: sprintf(RetChar,
"Server Record: %s has killed %s mice.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledMice));
return RetChar;
2059 case 116: sprintf(RetChar,
"Server Record: %s has completed the pest objective %s times.",High->PlayerName,JmgUtility::formatDigitGrouping(High->CompledMiceObjective));
return RetChar;
2060 case 117: sprintf(RetChar,
"Server Record: %s has destroyed %s Portable Pumpjacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledPortablePumpJacks));
return RetChar;
2061 case 118: sprintf(RetChar,
"Server Record: %s has placed %s Portable Pumpjacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PortablePumpJacksPlaced));
return RetChar;
2062 case 119: sprintf(RetChar,
"Server Record: %s has lost %s Portable Pumpjacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PortablePumpJacksLost));
return RetChar;
2063 case 120: sprintf(RetChar,
"Server Record: %s has made $%s.00 from Pumpjacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->PumpJackMoney));
return RetChar;
2064 case 121: sprintf(RetChar,
"Server Record: %s has made $%s.00 from Portable Pumpjacks.",High->PlayerName,JmgUtility::formatDigitGrouping(High->MobilePumpJackMoney));
return RetChar;
2065 case 122: sprintf(RetChar,
"Server Record: %s has killed %s turkeys.",High->PlayerName,JmgUtility::formatDigitGrouping(High->KilledTurkey));
return RetChar;
2066 case 123: sprintf(RetChar,
"Server Record: %s has made $%s.00 from bringing turkeys back to base.",High->PlayerName,JmgUtility::formatDigitGrouping(High->ReturnedTurkey));
return RetChar;
2067 default: sprintf(RetChar,
"Server Record ERROR: Record index out of bounds!");
return RetChar;
2070 void StateHighScore()
2072 int LastHighScoreList = 1;
2073 int Random = Commands->Get_Random_Int(0,BHHighScoreListCount);
2074 while (Random == lastDispalyedHighScore)
2075 Random = Commands->Get_Random_Int(0,BHHighScoreListCount);
2076BHStartOfHighScoreSelectProcess:
2077 selectRandomMatchingScore = 0;
2078 BHScoreNode *Current = BHScoreNodeList,*Best = NULL;
2081 Best = CompareHighScoreNodes(Best,Current,Random);
2082 Current = Current->next;
2084 if (!ReturnHighScoreNodeValue(Best,Random))
2086 if (LastHighScoreList < BHHighScoreListCount)
2088 LastHighScoreList++;
2089 if (Random+1 < BHHighScoreListCount)
2092 if (Random == lastDispalyedHighScore)
2094 if (Random >= BHHighScoreListCount)
2098 Random = lastDispalyedHighScore ? 0 : 1;
2099 goto BHStartOfHighScoreSelectProcess;
2101 if (LastHighScoreList == BHHighScoreListCount)
2102 LastHighScoreList = 1;
2104 lastDispalyedHighScore = Random;
2105 char DisplayMessage[128];
2106 sprintf(DisplayMessage,
"%s",ReturnScore(Best,Random));
2107 for (
int x = 1;x < 128;x++)
2109 GameObject *Player = Get_GameObj(x);
2111 JmgUtility::DisplayChatMessage(Player,6,145,148,DisplayMessage);
2114 void EndGameUpdatePlayerStats(
bool won)
2116 for (SLNode<cPlayer>* PlayerIter = Get_Player_List()->Head(); (PlayerIter != NULL); PlayerIter = PlayerIter->Next())
2118 cPlayer *p = PlayerIter->Data();
2119 BHScoreNode *node = FindOrAddPlayerBHHighScoreNode(WideCharToChar(p->Get_Name()));
2120 if (node->startedRound)
2121 if (!p->Is_Active())
2124 node->RoundsCompleted++;
2129 node->RoundsPlayed++;
2130 if (JMG_Bear_Hunter_Game_Control::hasGotTurrets)
2131 node->PlayedGamesWithDefenseTurrets++;
2132 if (JMG_Bear_Hunter_Game_Control::hasActivatedTower)
2133 node->PlayedGamesWithGuardianHelicopter++;
2134 if ((
unsigned long)p->Get_Kills() > node->MostKillsInARound)
2135 node->MostKillsInARound = (
unsigned long)p->Get_Kills();
2136 if ((
unsigned long)p->Get_Deaths() > node->MostDeathsInARound)
2137 node->MostDeathsInARound = (
unsigned long)p->Get_Deaths();
2138 if (node->MostBonusObjectivesCompletedInARound < node->totalObjectivesCompleted)
2139 node->MostBonusObjectivesCompletedInARound = node->totalObjectivesCompleted;
2140 if (node->PickedupTotalPowerupsInARound < node->totalPowerupsPickedup)
2141 node->PickedupTotalPowerupsInARound = node->totalPowerupsPickedup;
2144 void IncreasePlayerTimeScores()
2146 JmgUtility::GenericDateTime currentTime = JmgUtility::GenericDateTime();
2147 for (
int y = 1;y < 128;y++)
2149 GameObject *Player = Get_GameObj(y);
2152 BearHunterScoreSystem::BHScoreNode *pobj = BHPlayerHighScoreNodes[y];
2155 Vector3 Pos = Commands->Get_Position(Player);
2156 float Facing = Commands->Get_Facing(Player);
2157 bool IsMoving =
true,IsTurning =
true;
2158 if (!JmgUtility::SimpleDistance(Pos,pobj->lastPos))
2160 pobj->lastPos = Pos;
2161 if (abs(Facing - pobj->lastFacing) < 1.0f)
2163 pobj->lastFacing = Facing;
2164 pobj->LastPlayTime = currentTime;
2165 if (pobj->isMoving == IsMoving && pobj->isTurning == IsTurning)
2166 if (pobj->idleDelay > 60)
2174 GameObject *pVehicle = Get_Vehicle(Player);
2177 switch (Commands->Get_Preset_ID(pVehicle))
2179 case 1000001144:
case 1000001158:
case 1000001162:
case 1000001160:
2180 pobj->TimeInAJazzs++;
break;
2181 case 1000001321:
case 1000001323:
case 1000001327:
case 1000001325:
2182 pobj->TimeInACleasans++;
break;
2184 pobj->TimeInAUDVs++;
break;
2186 pobj->TimeInGatlingTanks++;
break;
2188 pobj->TimeInASecurityTruck++;
break;
2190 pobj->TimeInArmoredCars++;
break;
2192 pobj->TimeInIFVs++;
break;
2199 pobj->idleDelay = 0;
2200 pobj->isMoving = IsMoving;
2201 pobj->isTurning = IsTurning;
2202 if (pobj->startedRound)
2205 pobj->tmpPlayTime++;
2208 pobj->PreGameTime++;
2213 BHScoreNode *Current = BHScoreNodeList;
2216 Current->startedRound =
true;
2217 Current = Current->next;
2221BearHunterScoreSystem bearHunterScoreSystem;
2223class JMG_Rp2_Hostile_Mutant_AI :
public ScriptImpClass {
2224 Rp2SimpleObjectList::SimpleObjectNode *myNode;
2231 int currentTargetID;
2232 int secondaryEnemyId;
2233 int lastSeenSecondary;
2235 Vector3 homelocation;
2238 int returnHomeDelay;
2239 int vehicleChaseTime;
2240 int vehicleChaseTimeReset;
2241 int maxVehicleChaseTime;
2242 void Created(GameObject *obj);
2243 void Timer_Expired(GameObject *obj,
int number);
2244 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2245 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2246 void Enemy_Seen(GameObject *obj,GameObject *seen);
2247 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2248 void SoundDHeard(GameObject *obj,
const CombatSound &sound);
2250 JMG_Rp2_Hostile_Mutant_AI()
2254 static Vector3 AllowedSoundPos;
2255 static bool CanInvestigateSound;
2257Vector3 JMG_Rp2_Hostile_Mutant_AI::AllowedSoundPos = Vector3(0.0f,0.0f,0.0f);
2258bool JMG_Rp2_Hostile_Mutant_AI::CanInvestigateSound =
true;
2260class JMG_Bear_Hunt_Mutant_Attacker :
public ScriptImpClass {
2261 Rp2SimpleObjectList::SimpleObjectNode *myNode;
2263 int secondaryEnemyId;
2264 int lastSeenSecondary;
2266 float targetDistance;
2274 void Created(GameObject *obj);
2275 void Enemy_Seen(GameObject *obj,GameObject *seen);
2276 void Timer_Expired(GameObject *obj,
int number);
2277 void AttackTarget(GameObject *obj,GameObject *target,
float distance);
2278 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2279 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2281 JMG_Bear_Hunt_Mutant_Attacker()
2287class JMG_Bear_Hunter_Animal_Control :
public ScriptImpClass {
2288 void Killed(GameObject *obj,GameObject *killer);
2289 void Create_Powerup(GameObject *powerup,GameObject *obj,
float random,
const char *powerup1,
const char *powerup2,
const char *powerup3);
2299 float updateRateMultiplier;
2305 int CameraFacingCount;
2306 int IncreaseOrDecreaseCount;
2308 int stealthModeOverride;
2309 float cameraAngles[5];
2310 float CameraFacingUpdateTime;
2311 float idleZAimAngleModifier;
2312 float minDistanceSquared;
2313 bool canOnlySeeTargetScript;
2314 void Created(GameObject *obj);
2315 void Enemy_Seen(GameObject *obj,GameObject *seen);
2316 void Timer_Expired(GameObject *obj,
int number);
2317 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2318 void Destroyed(GameObject *obj);
2321class JMG_Bear_Hunt_Mutant_Cat_Explosion :
public ScriptImpClass {
2322 void Killed(GameObject *obj,GameObject *killer);
2325class JMG_Bear_Hunter_President_Controller :
public ScriptImpClass {
2327 bool injuredAnimation;
2329 int lastDisplayHealth;
2331 void Created(GameObject *obj);
2332 void Poked(GameObject *obj, GameObject *poker);
2333 void Timer_Expired(GameObject *obj,
int number);
2334 void Animation_Complete(GameObject* obj,
const char *anim);
2335 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2336 void Killed(GameObject *obj,GameObject *killer);
2337 inline void damagedEvent(GameObject *obj,
bool announce,
bool palyinjured);
2338 void Greeting(GameObject *obj);
2339 void InPain(GameObject *obj);
2340 void Critical(GameObject *obj);
2341 void Congrats(GameObject *obj);
2342 void Rabbit(GameObject *obj);
2344 static double lastHPRecorded;
2346double JMG_Bear_Hunter_President_Controller::lastHPRecorded = 500.0;
2348class JMG_Bear_Hunter_Turret_Death_Alert :
public ScriptImpClass {
2349 void Killed(GameObject *obj,GameObject *killer);
2352class JMG_Powerup_Grant_Cash :
public ScriptImpClass {
2353 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2356class JMG_Bear_Hunter_Powerup_Tracker :
public ScriptImpClass {
2357 void Created(GameObject *obj);
2358 void Destroyed(GameObject *obj);
2361class JMG_Bear_Hunter_Grenade_Vest_Powerup :
public ScriptImpClass {
2362 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2365class JMG_Powerup_Grant_Weapon_Clips :
public ScriptImpClass {
2366 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2369class JMG_Bear_Hunter_SpawnPoint :
public ScriptImpClass {
2370 void Created(GameObject *obj);
2373class JMG_Bear_Hunter_Player_Spawn :
public ScriptImpClass {
2374 void Created(GameObject *obj);
2375 void Timer_Expired(GameObject *obj,
int number);
2376 Rp2SimplePositionSystem::SimplePositionNode *JMG_Bear_Hunter_Player_Spawn::GetSpotNotVisibileFromSpots(
int points,Vector3 pos[],
float ranges[]);
2377 Rp2SimplePositionSystem::SimplePositionNode *JMG_Bear_Hunter_Player_Spawn::GetFurthestSpotFromSpots(
int points,Vector3 pos[],
float weight[]);
2378 bool TestRay(Vector3 pos,Vector3 targetPos);
2381class JMG_Bear_Hunter_Player_Vehicle :
public ScriptImpClass {
2382 void Created(GameObject *obj);
2383 void Timer_Expired(GameObject *obj,
int number);
2384 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2385 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2386 void Killed(GameObject *obj,GameObject *killer);
2391class JMG_Bear_Hunter_Bear_Tracker :
public ScriptImpClass {
2392 void Destroyed(GameObject *obj);
2395class JMG_Bear_Hunter_Mutant_Tracker :
public ScriptImpClass {
2396 void Destroyed(GameObject *obj);
2399class JMG_AI_Ignore_Object :
public ScriptImpClass {
2400 void Created(GameObject *obj);
2403class JMG_Bear_Hunter_Security_Turret_Truck :
public ScriptImpClass {
2406 void Created(GameObject *obj);
2407 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2408 void Destroyed(GameObject *obj);
2412int JMG_Bear_Hunter_Security_Turret_Truck::id = 0;
2413class JMG_Bear_Hunter_Security_Turret_Truck_Zone :
public ScriptImpClass {
2414 void Entered(GameObject *obj,GameObject *enterer);
2416class JMG_Bear_Hunt_Final_Boss :
public ScriptImpClass {
2423 float targetDistance;
2429 bool attackingPlayer;
2431 void Created(GameObject *obj);
2432 void Enemy_Seen(GameObject *obj,GameObject *seen);
2433 void Timer_Expired(GameObject *obj,
int number);
2434 void AttackTarget(GameObject *obj,GameObject *target,
float distance);
2435 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2436 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2437 void Killed(GameObject *obj,GameObject *killer);
2438 void Respawn(GameObject *obj);
2439 void ChooseTarget(GameObject *obj,Vector3 pos,GameObject *target);
2440 bool inRange(GameObject *obj);
2441 void SnackTime(GameObject *obj,GameObject *target);
2442 void MineHunt(GameObject *obj,Vector3 myPos,GameObject *enemy);
2444 static Vector3 bossPos;
2445 static int bossChoose;
2447Vector3 JMG_Bear_Hunt_Final_Boss::bossPos = Vector3();
2448int JMG_Bear_Hunt_Final_Boss::bossChoose = 7;
2450class JMG_Bear_Hunter_Spectator :
public ScriptImpClass {
2452 void Created(GameObject *obj);
2453 void Destroyed(GameObject *obj);
2456class JMG_Bear_Hunter_Dummy_Script :
public ScriptImpClass {
2457 void Created(GameObject *obj);
2460class JMG_Set_Player_Type_On_Create :
public ScriptImpClass {
2461 void Created(GameObject *obj);
2464class AIPurchaseSystem
2466 struct AICharacterNode
2470 int requiredPurchaseState;
2472 struct AICharacterNode *next;
2473 AICharacterNode(
const char *name,
int cost,
int requiredPurchaseState,
double rating)
2476 sprintf(this->name,
"%s",name);
2477 this->requiredPurchaseState = requiredPurchaseState;
2478 this->rating = rating;
2482 AICharacterNode *AICharacterNodeList;
2484 void add(
const char *name,
int cost,
int requiredPurchaseState,
double rating)
2486 AICharacterNode *current = AICharacterNodeList;
2488 AICharacterNodeList =
new AICharacterNode(name,cost,requiredPurchaseState,rating);
2493 current->next =
new AICharacterNode(name,cost,requiredPurchaseState,rating);
2496 current = current->next;
2503 AICharacterNodeList = NULL;
2505 add(
"CnC_Nod_Shotgunner",0,-1,0.1);
2506 add(
"CnC_GDI_Grenadier",0,-1,0.0);
2507 add(
"CnC_Nod_Flamethrower",0,-1,0.1);
2508 add(
"CnC_GDI_Sydney",150,1,0.2);
2509 add(
"CnC_Nod_Petrova",150,1,0.15);
2510 add(
"CnC_GDI_Officer",175,-1,0.25);
2511 add(
"CnC_Nod_Officer",175,-1,0.25);
2512 add(
"CnC_Nod_Rocket_Officer",225,-1,0.33);
2513 add(
"CnC_GDI_Rocket_Soldier_Officer",225,-1,0.33);
2514 add(
"CnC_GDI_Gunner",400,-1,0.4);
2515 add(
"CnC_Nod_Stealth_Blackhand",400,-1,0.45);
2516 add(
"CnC_Nod_Chaingunner",450,-1,0.5);
2517 add(
"CnC_GDI_Patch",450,1,0.45);
2518 add(
"CnC_Nod_Raveshaw",1000,-1,0.8);
2519 add(
"CnC_Nod_Raveshaw_Alt",1000,-1,0.7);
2520 add(
"CnC_GDI_Sydney_Ion",1000,-1,0.65);
2521 add(
"CnC_GDI_Sydney_Ion_ALT",1000,-1,0.6);
2522 add(
"CnC_GDI_Ignatio_Mobius",1000,-1,0.65);
2523 add(
"CnC_GDI_Ignatio_Mobius_ALT",1000,-1,0.6);
2524 add(
"CnC_Nod_Mendoza",1000,-1,0.8);
2525 add(
"CnC_Nod_Mendoza_ALT",1000,-1,0.7);
2526 add(
"CnC_GDI_Patch",500,-1,0.5);
2527 add(
"CnC_Nod_Blackhand_Sniper",500,-1,0.5);
2528 add(
"CnC_Nod_Sakura",1000,-1,0.65);
2529 add(
"CnC_Nod_Sakura_ALT",1000,-1,0.6);
2530 add(
"CnC_GDI_Havoc",1000,-1,0.65);
2531 add(
"CnC_GDI_Havoc_ALT",1000,-1,0.6);
2536 AICharacterNode *temp = AICharacterNodeList,*die;
2543 AICharacterNodeList = NULL;
2545 void PurchaseSoldier(GameObject *obj,
float *cash)
2547 AICharacterNode *current = AICharacterNodeList,*best = NULL;
2551 if (current->requiredPurchaseState == -1 || current->requiredPurchaseState == JMG_Bear_Hunter_Game_Control::gameState)
2552 if (*cash >= current->cost && (!best || (current->rating > best->rating || (current->rating == best->rating && Commands->Get_Random(0.0f,1.0f) < 0.5f))))
2554 current = current->next;
2558 int random = Commands->Get_Random_Int(0,presetCount*2);
2561 if ((current->requiredPurchaseState == -1 || current->requiredPurchaseState == JMG_Bear_Hunter_Game_Control::gameState) && *cash >= current->cost)
2570 current = current->next;
2575 *cash = *cash-best->cost;
2576 Change_Character(obj,best->name);
2579AIPurchaseSystem AIPurchaseSystemControl;
2581class JMG_Bear_Hunter_Player_Assist_AI :
public ScriptImpClass {
2582 Rp2SimplePositionSystem::SimplePositionNode *currentDefensePoint;
2583 enum AIStates{NoAction = 0,AccessPT = 4,PTReload = 5,GoHome = 3,WaitForGroup = 1,FollowPlayer = 3,MoveToCabin = 2,HoldCabin = 2,DefendGate = 2,DefendPres = 2};
2584 AIStates aiState,lastAiState;
2585 JMG_Bear_Hunter_Game_Control::GameState lastGameState;
2589 float enemyDistance;
2592 Vector3 targetDestination;
2593 float requiredDestinationRange;
2594 float requiredDestinationRangeSquared;
2596 char primaryWeapon[256];
2599 void Created(GameObject *obj);
2600 void Enemy_Seen(GameObject *obj,GameObject *seen);
2601 void Timer_Expired(GameObject *obj,
int number);
2602 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2603 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2604 void Killed(GameObject *obj,GameObject *killer);
2605 void Destroyed(GameObject *obj);
2606 void GotoLocation(GameObject *obj,GameObject *player);
2607 void SetAIState(GameObject *obj,AIStates newState,Vector3 pos,
float distance,
float speed,Rp2SimplePositionSystem::SimplePositionNode *newNode = NULL);
2608 void Respawn(GameObject *obj);
2609 void PurchaseCharacter(GameObject *obj);
2610 void ChooseAction(GameObject *obj);
2612 #define maxTotalBearHunterPlayerAssistAI 5
2613 static int aiIds[maxTotalBearHunterPlayerAssistAI];
2615 static float cash[maxTotalBearHunterPlayerAssistAI];
2616 static unsigned int aiDeaths[maxTotalBearHunterPlayerAssistAI];
2618int JMG_Bear_Hunter_Player_Assist_AI::aiIds[maxTotalBearHunterPlayerAssistAI] = {0};
2619int JMG_Bear_Hunter_Player_Assist_AI::maxWait = 15;
2620float JMG_Bear_Hunter_Player_Assist_AI::cash[maxTotalBearHunterPlayerAssistAI] = {0};
2621unsigned int JMG_Bear_Hunter_Player_Assist_AI::aiDeaths[maxTotalBearHunterPlayerAssistAI] = {0};
2623void JMG_Bear_Hunter_Game_Control::ObjectiveCompleteReward(
float credits)
2625 for (
int x = 0;x < maxTotalBearHunterPlayerAssistAI;x++)
2626 JMG_Bear_Hunter_Player_Assist_AI::cash[x] += credits;
2627 for (
int x = 1;x < 128;x++)
2629 GameObject *player = Get_GameObj(x);
2632 Commands->Give_Money(player,credits,0);
2636class JMG_Bear_Hunter_AI_PT_Location :
public ScriptImpClass {
2637 void Created(GameObject *obj);
2638 void Timer_Expired(GameObject *obj,
int number);
2641class JMG_Bear_Hunter_AI_Defense_Point :
public ScriptImpClass {
2642 void Created(GameObject *obj);
2645class JMG_Bear_Hunter_Warning_Light_Zone :
public ScriptImpClass {
2648 int LightEffectIDs[2];
2649 int warnTimeCountdown;
2650 void Created(GameObject *obj);
2651 void Timer_Expired(GameObject *obj,
int number);
2652 void Entered(GameObject *obj,GameObject *enterer);
2655class JMG_Bear_Hunter_Vehicle_Purchase_System :
public ScriptImpClass {
2656 void Created(GameObject *obj);
2657 void Timer_Expired(GameObject *obj,
int number);
2658 void AirDropFunction(GameObject *obj,Vector3 pos,
float facing,
int deathZoneId,
int waypath1,
int waypath2,
int waypath3);
2661class JMG_Airdrop_Attached_Object_On_Create :
public ScriptImpClass {
2663 char armorType[256];
2669 void Created(GameObject *obj);
2670 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2671 GameObject *CreateAObject(GameObject *obj,GameObject *Object,
const char *Preset,
const char *Model,
const char *Animation,
const Vector3 &Pos,
float Facing,GameObject *GAttachTo,
const char *Bone,
float DeathFrame,
float LastFrame);
2674class JMG_Animate_While_Firing :
public ScriptImpClass {
2675 unsigned int spinDown;
2679 void Created(GameObject *obj);
2680 void Timer_Expired(GameObject *obj,
int number);
2683class JMG_Bear_Hunter_Alarm_Switch :
public ScriptImpClass {
2684 bool waitingToDeactivate;
2686 void Created(GameObject *obj);
2687 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2688 void Poked(GameObject *obj, GameObject *poker);
2689 void ActivateSwitch(GameObject *obj,
int position);
2690 void UpdateTower(
int position);
2693class JMG_Pickup_Display_Message :
public ScriptImpClass {
2694 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2696class JMG_AI_Follow_Player_When_Near :
public ScriptImpClass {
2699 float targetDistance;
2703 float followDistance;
2704 float followMaxDistance;
2705 float lastMoveSpeed;
2706 Vector3 createLocation;
2707 void Created(GameObject *obj);
2708 void Enemy_Seen(GameObject *obj,GameObject *seen);
2709 void Timer_Expired(GameObject *obj,
int number);
2710 void Destroyed(GameObject *obj);
2711 inline float GetSpeed(GameObject *player,
float distance);
2714class JMG_Bear_Hunter_Engineer_Follow_Player_When_Near :
public ScriptImpClass {
2717 float targetDistance;
2720 float followDistance;
2721 float followMaxDistance;
2722 float lastMoveSpeed;
2723 Vector3 createLocation;
2724 void Created(GameObject *obj);
2725 void Enemy_Seen(GameObject *obj,GameObject *seen);
2726 void Timer_Expired(GameObject *obj,
int number);
2727 void Killed(GameObject *obj,GameObject *killer);
2728 inline float GetSpeed(GameObject *player,
float distance);
2730 static int followPlayerId[5];
2732int JMG_Bear_Hunter_Engineer_Follow_Player_When_Near::followPlayerId[5] = {0};
2734class JMG_Bear_Hunter_Engineer_AI :
public ScriptImpClass {
2735 Vector3 repairSoldierVehicleTurret;
2736 float repairGunRange;
2741 float targetDistance;
2746 Vector3 moveLocation;
2747 int lastRepairTargetId;
2748 GameObject *lastTarget;
2749 GameObject *lastSecondaryTarget;
2750 bool lastRepairTarget;
2751 bool lastUseRepairGun;
2752 void Created(GameObject *obj);
2753 void Enemy_Seen(GameObject *obj,GameObject *seen);
2754 void Timer_Expired(GameObject *obj,
int number);
2755 void AttackTarget(GameObject *obj,GameObject *target,GameObject *secondaryTarget,
bool repairTarget,
bool useRepairGun);
2756 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2757 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2758 void Killed(GameObject *obj,GameObject *killer);
2759 bool inRange(GameObject *obj);
2760 inline bool Valid_Repair_Target(GameObject *obj,GameObject *target,
int playerType);
2762 static int scanAgainForEngineerDeaths;
2763 static int engineersDead;
2764 static int engineerIds[5];
2765 static bool engineerMode[5];
2767int JMG_Bear_Hunter_Engineer_AI::engineerIds[5] = {0};
2768int JMG_Bear_Hunter_Engineer_AI::engineersDead = 0;
2769int JMG_Bear_Hunter_Engineer_AI::scanAgainForEngineerDeaths = 0;
2770bool JMG_Bear_Hunter_Engineer_AI::engineerMode[5] = {
false};
2772class JMG_Bear_Hunter_Oil_Rig :
public ScriptImpClass {
2781 this->active =
false;
2783 PumpjackNode(
int pumpId)
2785 this->pumpId = pumpId;
2786 this->active =
false;
2792 void Created(GameObject *obj);
2793 void Timer_Expired(GameObject *obj,
int number);
2794 void Poked(GameObject *obj, GameObject *poker);
2795 void Killed(GameObject *obj,GameObject *killer);
2797 static int oilRigCount;
2798 static PumpjackNode pumpJacks[7];
2801int JMG_Bear_Hunter_Oil_Rig::oilRigCount = 0;
2802JMG_Bear_Hunter_Oil_Rig::PumpjackNode JMG_Bear_Hunter_Oil_Rig::pumpJacks[7] = {JMG_Bear_Hunter_Oil_Rig::PumpjackNode(0)};
2804class JMG_Bear_Hunter_Damaged_Oil_Rig :
public ScriptImpClass {
2806 void Created(GameObject *obj);
2807 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2808 void Killed(GameObject *obj,GameObject *killer);
2810 static int rigCount;
2812int JMG_Bear_Hunter_Damaged_Oil_Rig::rigCount = 0;
2814class JMG_Complete_Objective_On_Poke :
public ScriptImpClass {
2815 void Poked(GameObject *obj, GameObject *poker);
2817class JMG_Bear_Hunter_Weapons_Container_Spawn_Point :
public ScriptImpClass {
2818 void Created(GameObject *obj);
2821class JMG_Bear_Hunter_Weapons_Container :
public ScriptImpClass {
2822 Vector3 createLocation;
2823 void Created(GameObject *obj);
2824 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2827class JMG_Bear_Hunter_Weapons_Container_Attached :
public ScriptImpClass {
2829 void Created(GameObject *obj);
2830 void Timer_Expired(GameObject *obj,
int number);
2831 void Destroyed(GameObject *obj);
2833 JMG_Bear_Hunter_Weapons_Container_Attached()
2839class JMG_Bear_Hunter_Giant_Deer_Boss :
public ScriptImpClass {
2846 int currentTargetID;
2848 Vector3 homelocation;
2850 void Created(GameObject *obj);
2851 void Timer_Expired(GameObject *obj,
int number);
2852 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2853 void Enemy_Seen(GameObject *obj,GameObject *seen);
2854 void Damaged(GameObject *obj,GameObject *damager,
float damage);
2855 void Killed(GameObject *obj,GameObject *killer);
2856 void ReturnHome(GameObject *obj);
2859class JMG_Bear_Hunter_Kill_Score_Tracker :
public ScriptImpClass {
2860 void Killed(GameObject *obj,GameObject *killer);
2863class JMG_Bear_Hunter_Powerup_Score_Control :
public ScriptImpClass {
2864 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2867class JMG_Bear_Hunter_Increase_Score_On_Poke :
public ScriptImpClass {
2868 void Poked(GameObject *obj, GameObject *poker);
2871class JMG_Bear_Hunter_Radio_Tower_Control :
public ScriptImpClass {
2872 void Created(GameObject *obj);
2873 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2875 static int radioTowerId;
2876 static bool destroyed;
2878int JMG_Bear_Hunter_Radio_Tower_Control::radioTowerId = 0;
2879bool JMG_Bear_Hunter_Radio_Tower_Control::destroyed =
false;
2881class JMG_Bear_Hunter_Radio_Tower_Switch :
public ScriptImpClass {
2883 void Created(GameObject *obj);
2884 void Poked(GameObject *obj, GameObject *poker);
2886 static int supportId;
2888int JMG_Bear_Hunter_Radio_Tower_Switch::supportId = 0;
2890class JMG_Bear_Hunter_Radio_Tower_Support :
public ScriptImpClass {
2891 void Killed(GameObject *obj,GameObject *killer);
2894class JMG_Bear_Hunter_Death_Water_Zone :
public ScriptImpClass {
2895 void Entered(GameObject *obj,GameObject *enterer);
2898class JMG_Bear_Hunter_Guardian_Aircraft :
public ScriptImpClass {
2899 enum{SECONDARY_RELOADING,SECONDARY_READY,SECONDARY_SWITCHING,SECONDARY_ACTIVE} secondaryState;
2900 Rp2SimplePositionSystem::SimplePositionNode *DPNode;
2901 char primaryWeapon[256];
2902 bool hasSecondaryWeapon;
2904 int enemyTimeOutTime;
2910 float altReloadTime;
2911 float enemyDistance;
2912 bool secondaryReady;
2913 bool reloadingSecondary;
2915 void Created(GameObject *obj);
2916 void Timer_Expired(GameObject *obj,
int number);
2917 void Enemy_Seen(GameObject *obj,GameObject *seen);
2918 void Animation_Complete(GameObject* obj,
const char *anim);
2919 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2920 void Select_New_Location(GameObject *obj);
2921 void Attack_Move_Update(GameObject *obj);
2922 void Switch_Weapon(GameObject *obj,
bool primary);
2924 JMG_Bear_Hunter_Guardian_Aircraft()
2930class JMG_Bear_Hunter_Comanche :
public ScriptImpClass {
2931 void Created(GameObject *obj);
2932 void Killed(GameObject *obj,GameObject *killer);
2933 void Destroyed(GameObject *obj);
2937int JMG_Bear_Hunter_Comanche::id = 0;
2939class JMG_Bear_Hunter_Comanche_Defense_Point :
public ScriptImpClass {
2940 void Created(GameObject *obj);
2943class JMG_Bear_Hunter_Defense_Gun_Beacon :
public ScriptImpClass {
2944 void Created(GameObject *obj);
2947class JMG_Bear_Hunter_Defense_Gun_Powerup :
public ScriptImpClass {
2949 void Created(GameObject *obj);
2950 void Timer_Expired(GameObject *obj,
int number);
2951 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2952 void Destroyed(GameObject *obj);
2955class JMG_Bear_Hunter_Camera_Behavior :
public ScriptImpClass {
2956 BearHunterScoreSystem::BHScoreNode *playerScoreNode;
2960 int CameraFacingCount;
2961 int IncreaseOrDecreaseCount;
2963 Vector3 CameraFacingLocation[5];
2964 float CameraFacingUpdateTime;
2965 void Created(GameObject *obj);
2966 void Enemy_Seen(GameObject *obj,GameObject *seen);
2967 void Timer_Expired(GameObject *obj,
int number);
2968 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2969 void Poked(GameObject *obj,GameObject *poker);
2970 void Killed(GameObject *obj,GameObject *killer);
2972 JMG_Bear_Hunter_Camera_Behavior()
2974 playerScoreNode = NULL;
2978class JMG_Bear_Hunter_Sentry_Turret_Placement_Tester :
public ScriptImpClass {
2979 void Created(GameObject *obj);
2980 void Timer_Expired(GameObject *obj,
int number);
2981 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
2984class JMG_Powerup_Prez_Medical_Needle :
public ScriptImpClass {
2985 void Created(GameObject *obj);
2986 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
2989class JMG_Prez_Medical_Needle_Player_Control :
public ScriptImpClass {
2990 Vector3 pickupLocation;
2991 void Created(GameObject *obj);
2992 void Killed(GameObject *obj,GameObject *killer);
2993 void Destroyed(GameObject *obj);
2996class JMG_Prez_Cinematic_C130 :
public ScriptImpClass {
2997 void Created(GameObject *obj);
3000class JMG_Bear_Hunter_Power_Transformer :
public ScriptImpClass {
3001 int lastHealthPercent;
3002 bool objectiveActive;
3003 time_t announceTime;
3004 void Created(GameObject *obj);
3005 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3006 void ToggleTurrets(
bool enabled);
3007 void UpdateHealthDisplays(
float shieldStrength);
3008 void UpdateMCTs(
int team);
3011 static int mctIds[2];
3013bool JMG_Bear_Hunter_Power_Transformer::online =
true;
3014int JMG_Bear_Hunter_Power_Transformer::mctIds[2] = {0};
3016class JMG_Bear_Hunter_Power_Transformer_MCT :
public ScriptImpClass {
3017 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3020class AiPlayerRespawnController
3023 struct AiPlayerRespawnNode
3028 AiPlayerRespawnNode *next;
3030 AiPlayerRespawnNode *newRespawnNode(AiPlayerRespawnNode *Node,
int id)
3034 Node->spawnTime = 0.0f;
3035 Node->spawning =
false;
3039 void AddAPlayer(
int id)
3041 if (!AiPlayerRespawnNodeList)
3043 AiPlayerRespawnNodeList = newRespawnNode(
new AiPlayerRespawnNode(),
id);
3046 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3049 if (Current->id ==
id)
3051 Current = Current->next;
3053 Current = AiPlayerRespawnNodeList;
3060 Current->spawnTime = 0.0f;
3061 Current->spawning =
false;
3066 Current->next = newRespawnNode(
new AiPlayerRespawnNode(),
id);
3069 Current = Current->next;
3073 void RemoveAPlayer(
int id)
3075 if (!AiPlayerRespawnNodeList || !
id)
3077 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3080 if (Current->id ==
id)
3082 Current->spawning =
false;
3087 Current = Current->next;
3090 AiPlayerRespawnNode *FindAPlayer(
int id)
3092 if (!AiPlayerRespawnNodeList)
3094 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3097 if (Current->id ==
id)
3099 Current = Current->next;
3103 void UpdatePlayerSpawnList()
3105 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3108 if (Current->spawning)
3110 Current->spawnTime -= 0.1f;
3111 if (Current->spawnTime <= 0.0f)
3112 RemoveAPlayer(Current->id);
3114 Current = Current->next;
3118 AiPlayerRespawnNode *AiPlayerRespawnNodeList;
3120 AiPlayerRespawnController()
3122 AiPlayerRespawnNodeList = NULL;
3127 if (!AiPlayerRespawnNodeList)
3130 AiPlayerRespawnNode *temp,*die;
3131 temp = AiPlayerRespawnNodeList;
3132 while (temp != NULL)
3138 AiPlayerRespawnNodeList = NULL;
3140 void PlayerCreate(
int id)
3144 void PlayerDeath(
int id,
int EnemyTeamPlayerCount,
float RespawnTime)
3146 if (!AiPlayerRespawnNodeList)
3148 if (EnemyTeamPlayerCount >= playerCount)
3150 AiPlayerRespawnNode *Node = FindAPlayer(
id);
3153 Node->spawnTime = RespawnTime;
3154 Node->spawning =
true;
3162 if (!AiPlayerRespawnNodeList)
3164 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3167 GameObject *Bot = Commands->Find_Object(Current->id);
3169 Commands->Destroy_Object(Bot);
3170 Current = Current->next;
3173 void UpdateTeamAndSpawnCount(
int enemyCount,GameObject *(SpawnObject)())
3175 UpdatePlayerSpawnList();
3176 for (
int x = playerCount;x < enemyCount;x++)
3177 AddAPlayer(Commands->Get_ID(SpawnObject()));
3179 int TotalSpawnedPlayers()
3182 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3185 GameObject *Bot = Commands->Find_Object(Current->id);
3188 Current = Current->next;
3192 void SendCustomToAllMembers(
int message,
int param,
float delay,GameObject *sender = NULL)
3194 AiPlayerRespawnNode *Current = AiPlayerRespawnNodeList;
3197 GameObject *Bot = Commands->Find_Object(Current->id);
3199 Commands->Send_Custom_Event(sender ? sender : Bot,Bot,message,param,delay);
3200 Current = Current->next;
3204AiPlayerRespawnController AiMutantRespawnSystem = AiPlayerRespawnController();
3206class JMG_Bear_Hunter_Mutant_Respawn_Tracker :
public ScriptImpClass {
3207 void Killed(GameObject *obj,GameObject *killer);
3208 void Destroyed(GameObject *obj);
3210class JMG_Wandering_AI :
public ScriptImpClass {
3214 Vector3 homelocation;
3218 int currentTargetID;
3219 int secondaryEnemyId;
3220 int lastSeenSecondary;
3224 int vehicleChaseTime;
3225 int vehicleChaseTimeReset;
3226 int maxVehicleChaseTime;
3228 void Created(GameObject *obj);
3229 void Timer_Expired(GameObject *obj,
int number);
3230 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3231 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
3232 void Enemy_Seen(GameObject *obj,GameObject *seen);
3233 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3234 void SoundDHeard(GameObject *obj,
const CombatSound &sound);
3235 Vector3 GetRandomPosition();
3237 static Vector3 AllowedSoundPos;
3238 static bool CanInvestigateSound;
3240Vector3 JMG_Wandering_AI::AllowedSoundPos = Vector3(0.0f,0.0f,0.0f);
3241bool JMG_Wandering_AI::CanInvestigateSound =
true;
3243class JMG_Wandering_AI_Controller :
public ScriptImpClass {
3244 void Destroyed(GameObject *obj);
3245 void Detach(GameObject *obj);
3247 static Rp2SimplePositionSystem wanderPoints;
3249 JMG_Wandering_AI_Controller()
3251 wanderPoints = Rp2SimplePositionSystem();
3252 JMG_Wandering_AI_Controller::setup =
true;
3255Rp2SimplePositionSystem JMG_Wandering_AI_Controller::wanderPoints;
3256bool JMG_Wandering_AI_Controller::setup =
false;
3258class JMG_Wandering_AI_Wander_Point :
public ScriptImpClass {
3259 void Created(GameObject *obj);
3261class JMG_Wandering_AI_Wander_Point_Dont_Remove :
public ScriptImpClass {
3262 void Created(GameObject *obj);
3264class JMG_Wandering_AI_Wander_Point_Mobile :
public ScriptImpClass {
3265 Rp2SimplePositionSystem::SimplePositionNode *node;
3267 void Created(GameObject *obj);
3268 void Timer_Expired(GameObject *obj,
int number);
3270class JMG_Utility_Custom_Spawn_System_Controller :
public ScriptImpClass {
3271 void Destroyed(GameObject *obj);
3273 static Rp2SimplePositionSystem spawnPoints;
3275 JMG_Utility_Custom_Spawn_System_Controller()
3277 JMG_Utility_Custom_Spawn_System_Controller::setup =
true;
3278 spawnPoints = Rp2SimplePositionSystem();
3281Rp2SimplePositionSystem JMG_Utility_Custom_Spawn_System_Controller::spawnPoints;
3282bool JMG_Utility_Custom_Spawn_System_Controller::setup =
false;
3290 void Created(GameObject *obj);
3303 int avaliableToSpawn;
3305 void Created(GameObject *obj);
3306 void Timer_Expired(GameObject *obj,
int number);
3307 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3308 GameObject *Create_Preset(Vector3 location);
3311class JMG_Utility_Custom_Spawn_System_Attached :
public ScriptImpClass {
3312 void Destroyed(GameObject *obj);
3315class JMG_Bear_Hunter_Player_Count_Scaled_Object_Health :
public ScriptImpClass {
3316 float originalMaxHealth;
3317 float originalPoints;
3320 void Created(GameObject *obj);
3321 void Timer_Expired(GameObject *obj,
int number);
3322 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3324class BearHunterWolfHivemindSystem
3328 struct BearHunterWolfHivemindNode
3331 char presetName[256];
3332 Vector3 territoryCenterSpot;
3333 float territoryRange;
3335 int secondaryTargetId;
3336 Vector3 targetWanderPosition;
3338 int currentPackSize;
3340 int lastSeenSecondary;
3342 Vector3 soundHeardPos;
3345 int randomWanderTime;
3346 int currentWanderTime;
3348 float respawnTimeRandom;
3349 float listenerScale;
3350 bool hearsGlobalSounds;
3351 Rp2SimplePositionSystem wanderPositionNodes;
3352 struct BearHunterWolfHivemindNode *next;
3353 BearHunterWolfHivemindNode(
int id,
const char *presetName,
int maxPackSize,Vector3 territoryCenterSpot,
float territoryRange,
int wanderTime,
int randomWanderTime,
float respawnTime,
float respawnTimeRandom,
float listenerScale,
bool hearsGlobalSounds)
3356 sprintf(this->presetName,
"%s",presetName);
3357 this->territoryCenterSpot = territoryCenterSpot;
3358 this->territoryRange = territoryRange;
3359 this->maxPackSize = maxPackSize;
3360 this->targetWanderPosition = territoryCenterSpot;
3361 this->wanderTime = wanderTime;
3362 this->randomWanderTime = randomWanderTime;
3363 currentWanderTime = wanderTime + (randomWanderTime ? Commands->Get_Random_Int(-randomWanderTime,randomWanderTime) : 0);
3364 this->secondaryTargetId = 0;
3365 this->lastSeenSecondary = 0;
3366 this->heardSound =
false;
3367 this->soundHeardPos = Vector3();
3369 this->huntEnemy =
false;
3370 this->currentPackSize = 0;
3371 this->livingCount = 0;
3372 this->respawnTime = respawnTime;
3373 this->respawnTimeRandom = respawnTimeRandom;
3374 this->listenerScale = listenerScale;
3375 this->hearsGlobalSounds = hearsGlobalSounds;
3376 this->wanderPositionNodes = Rp2SimplePositionSystem();
3381 BearHunterWolfHivemindNode *BearHunterWolfHivemindNodeList;
3383 BearHunterWolfHivemindSystem()
3385 BearHunterWolfHivemindNodeList = NULL;
3387 bool addNode(
int id,
const char *presetName,
int maxPackSize,Vector3 territoryCenterSpot,
float territoryRange,
int wanderTime,
int randomWanderTime,
float respawnTime,
float respawnTimeRandom,
float listenerScale,
bool hearsGlobalSounds)
3389 BearHunterWolfHivemindNode *current = BearHunterWolfHivemindNodeList;
3390 if (!BearHunterWolfHivemindNodeList)
3392 BearHunterWolfHivemindNodeList =
new BearHunterWolfHivemindNode(
id,presetName,maxPackSize,territoryCenterSpot,territoryRange,wanderTime,randomWanderTime,respawnTime,respawnTimeRandom,listenerScale,hearsGlobalSounds);
3397 if (current->id ==
id)
3401 current->next =
new BearHunterWolfHivemindNode(
id,presetName,maxPackSize,territoryCenterSpot,territoryRange,wanderTime,randomWanderTime,respawnTime,respawnTimeRandom,listenerScale,hearsGlobalSounds);
3404 current = current->next;
3408 BearHunterWolfHivemindNode *find(
int id)
3410 BearHunterWolfHivemindNode *Current = BearHunterWolfHivemindNodeList;
3413 if (Current->id ==
id)
3415 Current = Current->next;
3417 return BearHunterWolfHivemindNodeList;
3421 BearHunterWolfHivemindNode *current = BearHunterWolfHivemindNodeList;
3424 if (!current->livingCount)
3426 current->secondaryTargetId = 0;
3427 current->heardSound =
false;
3429 if (current->lastSeenSecondary)
3431 current->lastSeenSecondary--;
3432 if (!current->lastSeenSecondary)
3433 current->secondaryTargetId = 0;
3435 if (current->currentWanderTime)
3437 current->currentWanderTime--;
3438 if (!current->currentWanderTime)
3440 Vector3 pos = Vector3();
3441 Rp2SimplePositionSystem::SimplePositionNode *spn = current->wanderPositionNodes.GetRandom();
3442 current->targetWanderPosition = (spn ? spn->position : current->territoryCenterSpot);
3443 current->currentWanderTime = current->wanderTime + (current->randomWanderTime ? Commands->Get_Random_Int(-current->randomWanderTime,current->randomWanderTime) : 0);
3446 if (current->currentPackSize < current->maxPackSize)
3448 Vector3 createLocation = current->targetWanderPosition;
3449 if (Get_Random_Pathfind_Spot(createLocation,25.0f,&createLocation))
3451 GameObject *packMember = Commands->Create_Object(current->presetName,createLocation);
3453 sprintf(params,
"%d,%d",current->id,controllerId);
3454 Commands->Attach_Script(packMember,
"JMG_Bear_Hunter_Wolf",params);
3455 Commands->Attach_Script(packMember,
"JMG_Bear_Hunter_Give_AI_Cash_For_Kills",
"");
3456 MoveablePhysClass *mphys = packMember->As_PhysicalGameObj() ? packMember->As_PhysicalGameObj()->Peek_Physical_Object()->As_MoveablePhysClass() : NULL;
3457 if (mphys && !mphys->Can_Teleport(Matrix3D(createLocation)))
3459 mphys->Find_Teleport_Location(createLocation,2.5f,&createLocation);
3460 Commands->Set_Position(packMember,createLocation);
3464 current = current->next;
3470 BearHunterWolfHivemindNode *temp,*die;
3471 temp = BearHunterWolfHivemindNodeList;
3476 die->wanderPositionNodes.Empty_List();
3479 BearHunterWolfHivemindNodeList = NULL;
3482BearHunterWolfHivemindSystem bearHunterWolfHivemindControl = BearHunterWolfHivemindSystem();
3483class JMG_Bear_Hunter_Wolf_Pack_Definition :
public ScriptImpClass {
3484 void Created(GameObject *obj);
3486class JMG_Bear_Hunter_Wolf_Pack_Controller :
public ScriptImpClass {
3487 void Created(GameObject *obj);
3488 void Timer_Expired(GameObject *obj,
int number);
3489 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3490 void Destroyed(GameObject *obj);
3492class JMG_Bear_Hunter_Wolf :
public ScriptImpClass {
3493 BearHunterWolfHivemindSystem::BearHunterWolfHivemindNode *controller;
3501 int returnHomeDelay;
3502 int vehicleChaseTime;
3503 int vehicleChaseTimeReset;
3504 int maxVehicleChaseTime;
3506 int currentTargetId;
3508 Vector3 targetPosition;
3509 void Created(GameObject *obj);
3510 void Timer_Expired(GameObject *obj,
int number);
3511 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3512 void Action_Complete(GameObject *obj,
int action_id,ActionCompleteReason reason);
3513 void Enemy_Seen(GameObject *obj,GameObject *seen);
3514 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3515 void SoundDHeard(GameObject *obj,
const CombatSound &sound);
3516 void Destroyed(GameObject *obj);
3518 JMG_Bear_Hunter_Wolf()
3523class JMG_Bear_Hunter_Wolf_Wander_Point :
public ScriptImpClass {
3524 void Created(GameObject *obj);
3525 void Timer_Expired(GameObject *obj,
int number);
3528class JMG_Bear_Hunter_Armored_Car :
public ScriptImpClass {
3529 void Created(GameObject *obj);
3530 void Timer_Expired(GameObject *obj,
int number);
3531 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3532 void Destroyed(GameObject *obj);
3534 JMG_Bear_Hunter_Armored_Car()
3540 BearHunterScoreSystem::BHScoreNode *ownerNode;
3543class JMG_Bear_Hunter_Armored_Car_Controller :
public ScriptImpClass {
3544 void Created(GameObject *obj);
3545 void Timer_Expired(GameObject *obj,
int number);
3546 void ArmoredCarSupport(GameObject *obj,BearHunterScoreSystem::BHScoreNode *ownerNode);
3547 void RegenHp(GameObject *obj,BearHunterScoreSystem::BHScoreNode *ownerNode);
3548 void GrantScore(
const char *playerName,
float score);
3549 void DecideScoreVehicleOrInfantry(GameObject *obj,GameObject *owner,BearHunterScoreSystem::BHScoreNode *ownerNode,
float grantHp);
3550 void GrantVehicleRepairScore(GameObject *obj,GameObject *owner,BearHunterScoreSystem::BHScoreNode *ownerNode,
float grantHp);
3551 void GrantInfantryRepairScore(GameObject *obj,GameObject *owner,BearHunterScoreSystem::BHScoreNode *ownerNode,
float grantHp);
3554class JMG_Bear_Hunt_Final_Boss_Support :
public ScriptImpClass {
3558 void Created(GameObject *obj);
3559 void Timer_Expired(GameObject *obj,
int number);
3560 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3563class JMG_Bear_Hunter_Golden_Deer_Statue :
public ScriptImpClass {
3564 void Created(GameObject *obj);
3565 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3567 static int playerWithTheStatue;
3568 static int tinyDeerIds[25];
3569 static int statueId;
3572class JMG_Bear_Hunter_Golden_Deer_Statue_Standin :
public ScriptImpClass {
3573 void Created(GameObject *obj);
3574 void Timer_Expired(GameObject *obj,
int number);
3577class JMG_Bear_Hunter_Golden_Deer_Statue_Attached :
public ScriptImpClass {
3578 void Created(GameObject *obj);
3579 void Timer_Expired(GameObject *obj,
int number);
3580 void Destroyed(GameObject *obj);
3583class JMG_Bear_Hunter_AI_Avoid_Enemies :
public ScriptImpClass {
3587 Vector3 movePosition;
3588 void Created(GameObject *obj);
3589 void Enemy_Seen(GameObject *obj,GameObject *seen);
3590 void Timer_Expired(GameObject *obj,
int number);
3591 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3592 void Killed(GameObject *obj,GameObject *killer);
3593 void Destroyed(GameObject *obj);
3594 void GotoLocation(GameObject *obj,
const Vector3 &pos,GameObject *Enemy,
float speed);
3595 void setRetreatLocation(GameObject *obj,GameObject *enemy);
3596 void getRandomLocation(GameObject *obj);
3599 static int wildAnimalCount;
3600 static int mouseAnimalCount;
3603class JMG_Security_Camera_Behavior_Ignore :
public ScriptImpClass {
3604 void Created(GameObject *obj);
3607class JMG_Bear_Hunter_Friendly_Cougar :
public ScriptImpClass {
3609 float noPathfindRange;
3611 int lastSeenSecondary;
3612 int currentTargetID;
3613 int secondaryTargetId;
3616 Vector3 homelocation;
3618 int minVisibilityTime;
3619 int maxVisibilityTime;
3620 float maxHuntDistance;
3624 void Created(GameObject *obj);
3625 void Timer_Expired(GameObject *obj,
int number);
3626 void Enemy_Seen(GameObject *obj,GameObject *seen);
3627 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3628 bool chooseTarget(GameObject *obj,GameObject *damager,
int *compareId,
int *seenTimer);
3629 void FollowPlayer(GameObject *obj,
bool moveSlow);
3632class JMG_Bear_Hunter_SpawnPoint_Final_Boss_Line_Of_Sight :
public ScriptImpClass {
3633 void Created(GameObject *obj);
3636class JMG_Bear_Hunter_SpawnPoint_Final_Boss :
public ScriptImpClass {
3637 void Created(GameObject *obj);
3640class JMG_Bear_Hunter_PumpJack_Beacon :
public ScriptImpClass {
3641 void Created(GameObject *obj);
3644class JMG_Bear_Hunter_PumpJack_Powerup :
public ScriptImpClass {
3646 void Created(GameObject *obj);
3647 void Timer_Expired(GameObject *obj,
int number);
3648 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
3649 void Destroyed(GameObject *obj);
3652class JMG_Bear_Hunter_Portable_Pumpjack :
public ScriptImpClass {
3653 BearHunterScoreSystem::BHScoreNode *playerScoreNode;
3656 void Created(GameObject *obj);
3657 void Timer_Expired(GameObject *obj,
int number);
3658 void Killed(GameObject *obj,GameObject *killer);
3661class JMG_Bear_Hunter_PumpJack_Detect_Oil :
public ScriptImpClass {
3663 void Created(GameObject *obj);
3664 void Timer_Expired(GameObject *obj,
int number);
3665 static float FindClosestPumpjack(GameObject *obj);
3667 static float CalculateEffectiveness(GameObject *obj);
3670class JMG_Bear_Hunter_Milk_Drink :
public ScriptImpClass {
3671 void Created(GameObject *obj);
3674class JMG_Bear_Hunter_AI_Guardian_Generic :
public ScriptImpClass {
3677 float arriveDistance;
3678 float arriveDistanceSq;
3681 int EnemyTimeOutTime;
3684 int stealthModeOverride;
3685 void Created(GameObject *obj);
3686 void Timer_Expired(GameObject *obj,
int number);
3687 void Enemy_Seen(GameObject *obj,GameObject *seen);
3688 void Damaged(GameObject *obj,GameObject *damager,
float damage);
3689 void Goto_Location(GameObject *obj);
3690 bool Get_A_Defense_Point(Vector3 *position);
3693class JMG_Bear_Hunter_Give_AI_Cash_For_Kills :
public ScriptImpClass {
3694 void Killed(GameObject *obj,GameObject *killer);
3706 Rp2SimplePositionSystem::SimplePositionNode *node;
3708 char presetName[128];
3709 char weaponName[128];
3710 void Created(GameObject *obj);
3711 void Timer_Expired(GameObject *obj,
int number);
3712 GameObject *FindTargetObject(GameObject *obj);
3715class JMG_Bear_Hunter_Turkey :
public ScriptImpClass {
3716 void Killed(GameObject *obj,GameObject *killer);
3725 void Created(GameObject *obj);
Definition jmgBearHunter.h:3724
Remake of RMV_Camera_Behavior with more settings and more user control.
Definition jmgBearHunter.h:2297
This defines a spawn point for JMG_Utility_Custom_Spawn_System, each group id defines what group the ...
Definition jmgBearHunter.h:3289
A more complicated spawn system, this allows for defining presets you wish to use with precent chance...
Definition jmgBearHunter.h:3298
Makes a wander point follow an object on the map \GroupId - ID of the group the point belongs to \Pre...
Definition jmgBearHunter.h:3705