This repository was archived by the owner on Feb 27, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 511
/
Copy pathBULLET.H
153 lines (131 loc) · 5.59 KB
/
BULLET.H
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
/*
** Command & Conquer(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* $Header: F:\projects\c&c\vcs\code\bullet.h_v 2.18 16 Oct 1995 16:47:40 JOE_BOSTIC $ */
/***********************************************************************************************
*** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
***********************************************************************************************
* *
* Project Name : Command & Conquer *
* *
* File Name : BULLET.H *
* *
* Programmer : Joe L. Bostic *
* *
* Start Date : April 23, 1994 *
* *
* Last Update : April 23, 1994 [JLB] *
* *
*---------------------------------------------------------------------------------------------*
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef BULLET_H
#define BULLET_H
#include "object.h"
#include "fly.h"
#include "fuse.h"
class BulletClass : public ObjectClass,
public FlyClass,
public FuseClass
{
public:
/*
** This specifies exactly what kind of bullet this is. All of the static attributes
** for this bullet is located in the BulletTypeClass pointed to by this variable.
*/
BulletTypeClass const * const Class;
operator BulletType(void) const {return Class->Type;};
/*
** Records who sent this "present" so that an appropriate "thank you" can
** be returned.
*/
TechnoClass * Payback;
/*
** This is the facing that the projectile is travelling.
*/
FacingClass PrimaryFacing;
/*---------------------------------------------------------------------
** Constructors, Destructors, and overloaded operators.
*/
static void * BulletClass::operator new(size_t size);
static void BulletClass::operator delete(void *ptr);
BulletClass(void);
BulletClass(BulletType id);
virtual ~BulletClass(void) {if (GameActive) BulletClass::Limbo();};
virtual RTTIType What_Am_I(void) const {return RTTI_BULLET;};
/*---------------------------------------------------------------------
** Member function prototypes.
*/
static void Init(void);
virtual void Assign_Target(TARGET target) {TarCom = target;};
virtual bool Unlimbo(COORDINATE , DirType facing = DIR_N);
virtual LayerType In_Which_Layer(void) const {return LAYER_TOP;};
virtual ObjectTypeClass const & Class_Of(void) const {return *Class;};
virtual void Detach(TARGET target, bool all);
virtual void Draw_It(int x, int y, WindowNumberType window);
virtual bool Mark(MarkType mark=MARK_CHANGE);
virtual void AI(void);
virtual short const * Occupy_List(void) const;
virtual short const * Overlap_List(void) const {return Occupy_List();};
virtual TARGET As_Target(void) const;
/*
** File I/O.
*/
bool Load(FileClass & file);
bool Save(FileClass & file);
virtual void Code_Pointers(void);
virtual void Decode_Pointers(void);
/*
** Dee-buggin' support.
*/
int Validate(void) const;
/*
** If this bullet is forced to be inaccurate because of some outside means. A tank
** firing while moving is a good example.
*/
unsigned IsInaccurate:1;
private:
// Crude animation flag.
unsigned IsToAnimate:1;
/*
** This is the height of the projectile. It starts at a low height, rises to an
** apogee and then drops to explode upon impact. The height is used to render
** the bullet's vertical offset.
*/
int Altitude;
/*
** This is a modifier for the altitude that rises and falls in order to simulate
** the arc of the projectile. This value is added to the height every game tick
** while simultaneously being reduced itself. The net effect, is a rising
** projectile that slows and then eventually drops.
*/
signed char Riser;
/*
** This is the target of the projectile. It is especially significant for those projectiles
** that home in on a target.
*/
TARGET TarCom;
/*
** Is this missle allowed to come in from out of bounds?
*/
unsigned IsLocked:1;
/*
** This contains the value of the Virtual Function Table Pointer
*/
static void * VTable;
};
#endif