Nuclide
Software Development Kit for id Technology (BETA)
NSAttack.h
1/*
2 * Copyright (c) 2016-2024 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
22{
23public:
24 void ncAttack(void);
25
26#ifdef SERVER
27 virtual void Spawned(void);
28 virtual void SpawnKey(string, string);
29 virtual void Save(float);
30 virtual void Restore(string, string);
31
32 /* launch the attack into the world */
33 virtual void Launch(vector, vector, float, float, float);
34
35 nonvirtual void SetWeaponOwner(ncWeapon);
36 nonvirtual ncWeapon GetWeaponOwner(void);
37#endif
38
39#ifdef SERVER
40private:
41 float m_flFuse;
42 ncWeapon m_weaponOwner;
43 int m_iShots;
44 vector m_vecSpread;
45#endif
46};
47
48#ifdef SERVER
49ncAttack ncAttack_SpawnDef(string entityDef, ncActor theOwner);
50ncAttack ncAttack_SpawnDefAtPosition(string entityDef, ncActor theOwner, vector vecOrigin, vector vecAngles);
51ncAttack ncAttack_SpawnDefAttachment(string entityDef, ncActor theOwner, int attachmentID);
52#endif
This entity class represents an object with choreographed/free-form movement.
Definition: NSNavAI.h:72
This entity class represents an attack.
Definition: NSAttack.h:22
virtual void Restore(string, string)
Similar to ncIO::SpawnKey() but for save-game fields.
Definition: NSAttack.qc:63
virtual void Launch(vector, vector, float, float, float)
Definition: NSAttack.qc:103
nonvirtual void SetWeaponOwner(ncWeapon)
Definition: NSAttack.qc:91
nonvirtual ncWeapon GetWeaponOwner(void)
Definition: NSAttack.qc:97
void ncAttack(void)
Definition: NSAttack.qc:18
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSAttack.qc:30
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSAttack.qc:85
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSAttack.qc:52
This entity represents an ncRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:52
This entity class represents weapon based items.
Definition: NSWeapon.h:170
entityDefAPI_t entityDef
Definition: api.h:366