5#define FORCELOOKATLOCATIONCUSTOM 6531234
7class JMG_DeathMatch_Game_Control :
public ScriptImpClass {
8 void Created(GameObject *obj);
9 void Timer_Expired(GameObject *obj,
int number);
10 void EnableSpawners(
const char *name);
13class JMG_DeathMatch_Spawn_Character :
public ScriptImpClass {
14 void Created(GameObject *obj);
15 void Timer_Expired(GameObject *obj,
int number);
18class JMG_DeathMatch_Player :
public ScriptImpClass {
20 void Created(GameObject *obj);
21 void Enemy_Seen(GameObject *obj,GameObject *seen);
22 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
25class RP2DeathMatchSpawnSystem
28 struct RP2DeathMatchSpawnNode
31 unsigned long lastSeen;
34 struct RP2DeathMatchSpawnNode *next;
35 RP2DeathMatchSpawnNode(GameObject *obj)
37 this->
id = Commands->Get_ID(obj);
39 this->pos = Commands->Get_Position(obj);
40 Vector3 temppos = this->pos;
42 Commands->Set_Position(this->obj,temppos);
43 this->lastSeen = Commands->Get_Random_Int(0,10);
48 struct RP2DeathMatchSpawnNode *RP2DeathMatchSpawnNodeList;
49 float FindNearestPlayer(
const Vector3 &pos,
int ignorePlayer)
51 float nearest = -1.0f;
52 for (
int x = 1;x < 128;x++)
54 if (x == ignorePlayer)
56 GameObject *player = Get_GameObj(x);
59 float tempDist = JmgUtility::SimpleDistance(pos,Commands->Get_Position(player));
60 if (nearest < 0 || tempDist < nearest)
66 RP2DeathMatchSpawnSystem()
68 RP2DeathMatchSpawnNodeList = NULL;
70 RP2DeathMatchSpawnNode *AddNode(GameObject *obj)
72 int id = Commands->Get_ID(obj);
73 RP2DeathMatchSpawnNode *Current = RP2DeathMatchSpawnNodeList;
74 if (!RP2DeathMatchSpawnNodeList)
75 return (RP2DeathMatchSpawnNodeList =
new RP2DeathMatchSpawnNode(obj));
78 if (Current->id ==
id)
82 Current->next =
new RP2DeathMatchSpawnNode(obj);
85 Current = Current->next;
89 RP2DeathMatchSpawnSystem &operator -= (GameObject *obj)
91 int id = Commands->Get_ID(obj);
92 if (!RP2DeathMatchSpawnNodeList)
94 RP2DeathMatchSpawnNode *Current = RP2DeathMatchSpawnNodeList, *Prev = NULL;
97 if (Current->id ==
id)
100 RP2DeathMatchSpawnNodeList = Current->next;
102 Prev->next = Current->next;
103 RP2DeathMatchSpawnNode *temp = Current;
104 Current = Current->next;
109 Current = Current->next;
115 RP2DeathMatchSpawnNode *temp,*die;
116 temp = RP2DeathMatchSpawnNodeList;
123 RP2DeathMatchSpawnNodeList = NULL;
127 RP2DeathMatchSpawnNode *Current = RP2DeathMatchSpawnNodeList;
131 Current = Current->next;
134 void seePoint(
int pointId)
136 RP2DeathMatchSpawnNode *Current = RP2DeathMatchSpawnNodeList;
139 if (Current->id == pointId)
141 Current->lastSeen = 0;
144 Current = Current->next;
147 RP2DeathMatchSpawnNode *findSpawnPoint(
int playerId)
149 float bestDistance = 0;
150 unsigned long bestTime = 0;
151 RP2DeathMatchSpawnNode *Current = RP2DeathMatchSpawnNodeList,*best = NULL;
154 float tempDist = FindNearestPlayer(Current->pos,playerId);
155 if ((tempDist > 25.0f || tempDist == -1) && (!bestTime || (Current->lastSeen > 1 && bestTime < Current->lastSeen) || (bestTime == Current->lastSeen && tempDist > bestDistance)))
157 bestDistance = tempDist;
158 bestTime = Current->lastSeen;
161 Current = Current->next;
168 Current = RP2DeathMatchSpawnNodeList;
171 float tempDist = FindNearestPlayer(Current->pos,playerId);
172 if (!bestDistance || tempDist > bestDistance)
174 bestDistance = tempDist;
177 Current = Current->next;
188 if (!RP2DeathMatchSpawnNodeList)
193RP2DeathMatchSpawnSystem RP2DeathMatchSpawnControl = RP2DeathMatchSpawnSystem();
195class JMG_DeathMatch_Random_Spawn_Point :
public ScriptImpClass {
196 RP2DeathMatchSpawnSystem::RP2DeathMatchSpawnNode *myNode;
197 void Created(GameObject *obj);
198 void Enemy_Seen(GameObject *obj,GameObject *seen);
199 void Destroyed(GameObject *obj);
202class JMG_DeathMatch_Teleport_Zone_Script :
public ScriptImpClass {
203 Vector3 Teleport_Pos;
204 void Created(GameObject *obj);
205 void Timer_Expired(GameObject *obj,
int number);
206 void Entered(GameObject *obj,GameObject *enter);
209class JMG_DeathMatch_Teleport_Zone_Script_Attach :
public ScriptImpClass {
212 void Created(GameObject *obj);
213 void Timer_Expired(GameObject *obj,
int number);
216class JMG_DeathMatch_Damage_When_Outside_Of_Range :
public ScriptImpClass {
218 float damageDistance;
219 float vehicleWarnDistance;
220 float vehicleDamageDistance;
221 float aircraftWarnDistance;
222 float aircraftDamageDistance;
223 float maxSurviveDistance;
226 bool screenEffectOn[128];
227 void Created(GameObject *obj);
228 void Timer_Expired(GameObject *obj,
int number);
232class JMG_DeathMatch_Random_Weapon_Spawner :
public ScriptImpClass {
237 void Created(GameObject *obj);
238 void Custom(GameObject *obj,
int message,
int param,GameObject *sender);
239 int CreatePowerup(GameObject *obj);
242class JMG_DeathMatch_Random_Weapon_Spawner_Attached :
public ScriptImpClass {
243 void Destroyed(GameObject *obj);