This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
PlayerStart.cpp
187 lines (148 loc) · 5.28 KB
/
PlayerStart.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
//-----------------------------------------------------------------------------
//
// $Logfile:: /Quake 2 Engine/Sin/code/game/PlayerStart.cpp $
// $Revision:: 14 $
// $Author:: Jimdose $
// $Date:: 12/15/98 6:17p $
//
// Copyright (C) 1997 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// $Log:: /Quake 2 Engine/Sin/code/game/PlayerStart.cpp $
//
// 14 12/15/98 6:17p Jimdose
// made ProgressiveStart respond to EV_Activate
//
// 13 12/09/98 8:05p Jimdose
// added progressive start
//
// 12 8/14/98 8:18p Markd
// reworked camera class
//
// 11 8/08/98 7:29p Aldie
// Added intermissions for deathmatch
//
// 10 3/23/98 1:31p Jimdose
// Revamped event and command system
//
// 9 3/02/98 8:49p Jimdose
// Changed the classid parameter of CLASS_DECLARATION to a quoted string so
// that you could have a NULL classid.
//
// 8 2/19/98 5:08p Jimdose
// Changed offset of SINED entity box
//
// 7 2/04/98 4:32p Jimdose
// Added Sined headers
//
// 6 2/03/98 10:51a Jimdose
// Updated to work with Quake 2 engine
// Moved initialization to constructor and removed Init function
//
// 5 1/23/98 3:04p Jimdose
// Made compatible with Q2 based progs
//
// 3 10/27/97 3:29p Jimdose
// Removed dependency on quakedef.h
//
// 2 9/26/97 6:47p Jimdose
// Added standard Ritual headers
//
// DESCRIPTION:
// Player start location entity declarations
//
#include "g_local.h"
#include "entity.h"
#include "trigger.h"
#include "PlayerStart.h"
/*****************************************************************************/
/*SINED info_player_start (1 0 0) (-16 -16 0) (16 16 64)
The normal starting point for a level.
/*****************************************************************************/
CLASS_DECLARATION( Entity, PlayerStart, "info_player_start" );
ResponseDef PlayerStart::Responses[] =
{
{ NULL, NULL }
};
PlayerStart::PlayerStart()
{
float angle;
angle = G_GetFloatArg( "angle", 0 );
angles = Vector( 0, angle, 0 );
}
/*****************************************************************************/
/*SINED info_player_progressivestart (1 0 0) (-16 -16 0) (16 16 64)
Starting point for a level. When triggered, sets next spawnpoint to itself.
Used for respawn point in Sin Arcade. This must have a targetname for it to work.
"starthere" set to 1 to make this the default spawnpoint. (Note: multiple progressive
starts with starthere set will override each other).
/*****************************************************************************/
CLASS_DECLARATION( PlayerStart, ProgressiveStart, "info_player_progressivestart" );
ResponseDef ProgressiveStart::Responses[] =
{
{ &EV_Activate, ( Response )ProgressiveStart::SetSpawnpoint },
{ NULL, NULL }
};
ProgressiveStart::ProgressiveStart()
{
if ( !targetname.length() )
{
gi.error( "ProgressiveStart without targetname at (%f,%f,%f)\n", origin.x, origin.y, origin.z );
}
if ( G_GetIntArg( "starthere" ) )
{
game.spawnpoint = targetname;
}
}
void ProgressiveStart::SetSpawnpoint
(
Event *ev
)
{
game.spawnpoint = targetname;
}
/*****************************************************************************/
/* saved out by quaked in region mode
/*****************************************************************************/
CLASS_DECLARATION( PlayerStart, TestPlayerStart, "testplayerstart" );
ResponseDef TestPlayerStart::Responses[] =
{
{ NULL, NULL }
};
/*****************************************************************************/
/*SINED info_player_deathmatch (1 0 1) (-16 -16 0) (16 16 64)
potential spawning position for deathmatch games
/*****************************************************************************/
CLASS_DECLARATION( PlayerStart, PlayerDeathmatchStart, "info_player_deathmatch" );
ResponseDef PlayerDeathmatchStart::Responses[] =
{
{ NULL, NULL }
};
/*****************************************************************************/
/*SINED info_player_coop (1 0 1) (-16 -16 0) (16 16 64)
potential spawning position for coop games
/*****************************************************************************/
CLASS_DECLARATION( PlayerStart, PlayerCoopStart, "info_player_coop" );
ResponseDef PlayerCoopStart::Responses[] =
{
{ NULL, NULL }
};
/*****************************************************************************/
/*SINED info_player_intermission (1 0 1) (-16 -16 0) (16 16 64)
viewing point in between deathmatch levels
/*****************************************************************************/
CLASS_DECLARATION( Camera, PlayerIntermission, "info_player_intermission" );
ResponseDef PlayerIntermission::Responses[] =
{
{ NULL, NULL }
};
PlayerIntermission::PlayerIntermission
(
)
{
currentstate.watch.splineangles = false;
newstate.watch.splineangles = false;
}