Nuclide
Software Development Kit for id Tech
NSTraceAttack.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
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
17void TraceAttack_FireBullets(int iShots, vector vecPos, int iDamage, vector vecSpread, int iWeapon);
18
19void TraceAttack_FireBulletsWithDecal(int iShots, vector vecPos, int iDamage, vector vecSpread, int iWeapon, string strDecalGroup);
20
21#ifdef BULLETPENETRATION
23#endif
24
26class
28{
29private:
30 /* multi-part damage */
31 NSSurfacePropEntity m_eMultiTarget;
32 int m_iMultiValue;
33 int m_iMultiBody;
34
35 int m_iShots;
36 float m_flDamage;
37 vector m_vecSpread;
38 int m_iWeapon;
39 entity m_eOwner;
40 float m_flRange;
41 vector m_vecOrigin;
42 //int m_iDecalGroup;
43 string m_strDecalGroup;
44
45 /* bullet penetration */
46#ifdef BULLETPENETRATION
47 float m_flMaxThickness;
48 float m_flRangeModifier;
49 int m_iTotalPenetrations;
50#endif
51
52 virtual void _ApplyDamage(void);
53 virtual void _FireSingle(vector,vector,float,float);
54
55public:
56 void NSTraceAttack(void);
57
58 /* overrides */
59 virtual void Save(float);
60 virtual void Restore(string,string);
61 virtual void RestoreComplete(void);
62
64 virtual void Fire(void);
65
67 virtual void SetShots(int);
69 virtual void SetOrigin(vector);
71 virtual void SetDamage(int);
73 virtual void SetSpread(vector);
75 virtual void SetWeapon(int);
77 virtual void SetRange(float);
79 virtual void SetOwner(entity);
80
82 virtual void SetDecalGroup(string);
83
84 #ifdef BULLETPENETRATION
87 virtual void SetPenetrationMaxThickness(float);
90 virtual void SetPenetrationPower(int);
91 #endif
92
93};
94
void TraceAttack_SetPenetrationPower(int power)
Definition: NSTraceAttack.qc:436
void TraceAttack_FireBullets(int iShots, vector vecPos, int iDamage, vector vecSpread, int iWeapon)
Definition: NSTraceAttack.qc:394
NSTraceAttack g_traceAttack
Definition: NSTraceAttack.h:95
void TraceAttack_FireBulletsWithDecal(int iShots, vector vecPos, int iDamage, vector vecSpread, int iWeapon, string strDecalGroup)
Definition: NSTraceAttack.qc:410
This class is responsible for handling core entity functionality.
Definition: NSIO.h:27
This entity represents an NSRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:49
This class handles traceline/hitscan attacks.
Definition: NSTraceAttack.h:28
vector(vector) normalize
entity() spawn