Nuclide
Software Development Kit for id Technology
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 NSAttack(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(NSWeapon);
36 nonvirtual NSWeapon GetWeaponOwner(void);
37#endif
38
39#ifdef SERVER
40private:
41 float m_flFuse;
42 NSWeapon m_weaponOwner;
43 int m_iShots;
44 vector m_vecSpread;
45#endif
46};
47
48#ifdef SERVER
49NSAttack NSAttack_SpawnDef(string entityDef, NSActor theOwner);
50NSAttack NSAttack_SpawnDefAtPosition(string entityDef, NSActor theOwner, vector vecOrigin, vector vecAngles);
51NSAttack NSAttack_SpawnDefAttachment(string entityDef, NSActor theOwner, int attachmentID);
52#endif
This entity class represents an object with choreographed/free-form movement.
Definition: NSNavAI.h:50
This entity class represents an attack.
Definition: NSAttack.h:22
virtual void Restore(string, string)
Similar to NSIO::SpawnKey but for save-game fields.
Definition: NSAttack.qc:63
virtual void Launch(vector, vector, float, float, float)
Definition: NSAttack.qc:103
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSAttack.qc:85
nonvirtual void SetWeaponOwner(NSWeapon)
Definition: NSAttack.qc:91
void NSAttack(void)
Definition: NSAttack.qc:18
nonvirtual NSWeapon GetWeaponOwner(void)
Definition: NSAttack.qc:97
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSAttack.qc:52
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSAttack.qc:30
This entity represents an NSRenderableEntity 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:363