Nuclide
Software Development Kit for id Tech
NSItem.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 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
55{
56public:
57 void NSItem(void);
58
59 /* overrides */
60#ifdef SERVER
61 virtual void Spawned(void);
62 virtual void Touch(entity);
63 virtual void Respawn(void);
64 virtual void SpawnKey(string, string);
65 virtual void Save(float);
66 virtual void Restore(string,string);
67
68 nonvirtual void SetItem(int i);
69 nonvirtual int GetItem(void);
70 nonvirtual void SetFloating(int);
71 nonvirtual bool GetFloating(void);
72 nonvirtual void SetSpinning(bool);
73 nonvirtual bool GetSpinning(void);
74 nonvirtual void PickupRespawn(void);
75#endif
76
77
78private:
79 int m_iClip;
80 int m_iWasDropped;
81
82 /* spawn keys */
83 int m_iInvItem;
84 string m_sndAcquire;
85 string m_sndRespawn;
86 int m_bFloating;
87 bool m_bSpins;
88 string m_strInvWeapon;
89};
id Tech 4 keys to support:
Definition: NSItem.h:55
nonvirtual int GetItem(void)
Definition: NSItem.qc:196
nonvirtual void SetSpinning(bool)
Definition: NSItem.qc:213
virtual void Restore(string, string)
Similar to ::SpawnKey but for save-game fields.
Definition: NSItem.qc:124
nonvirtual void SetFloating(int)
Definition: NSItem.qc:201
virtual void Save(float)
Handles saving a copy of this entity to a given filehandle.
Definition: NSItem.qc:110
virtual void Respawn(void)
Server: Called when the entity first spawns or when game-logic requests the entity to return to its o...
Definition: NSItem.qc:42
nonvirtual bool GetFloating(void)
Definition: NSItem.qc:207
virtual void SpawnKey(string, string)
This method handles entity key/value pairs on map load.
Definition: NSItem.qc:76
nonvirtual bool GetSpinning(void)
Definition: NSItem.qc:219
void NSItem(void)
Definition: NSItem.qc:18
virtual void Spawned(void)
Called when the entity is fulled initialized.
Definition: NSItem.qc:33
nonvirtual void PickupRespawn(void)
Definition: NSItem.qc:226
nonvirtual void SetItem(int i)
Definition: NSItem.qc:187
virtual void Touch(entity)
Called whenever we're touching another entity.
Definition: NSItem.qc:158
This entity represents any NSEntity with advanced rendering properties.
Definition: NSRenderableEntity.h:91
entity() spawn
get __int i
Definition: fteextensions.qc:3826