Nuclide
Software Development Kit for id Technology
NSSquadMonster.h
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
17#define NSSQUADMONSTER_MAXMEMBERS 5
18
22class
24{
25public:
26 void NSSquadMonster(void);
27
28#ifdef SERVER
29 /* overrides */
30 virtual void Spawned(void);
31 virtual void SpawnKey(string, string);
32 virtual void Save(float);
33 virtual void Restore(string, string);
34
36 virtual void HasBecomeSquadLeader(void);
38 virtual void HasJoinedSquad(void);
39
41 nonvirtual bool InSquad(void);
43 nonvirtual bool IsSquadLeader(void);
45 nonvirtual NSSquadMonster GetSquadLeader(void);
46
48 nonvirtual void FindSquadNearMe(float);
49
51 nonvirtual void AddToSquad(NSSquadMonster);
53 nonvirtual void RemoveFromSquad(NSSquadMonster);
55 nonvirtual NSSquadMonster GetNearestSquadMember(void);
57 nonvirtual NSSquadMonster GetFarthestSquadMember(void);
58#endif
59
60#ifdef SERVER
61private:
62 string m_strSquadLeaderBody;
63 bool m_bStartAsLeader;
64 bool m_inSquad;
65 NSSquadMonster m_eSquadLeader;
66
67 /* stored only in the squad leader's memory */
68 NSSquadMonster m_eSquadMembers[NSSQUADMONSTER_MAXMEMBERS];
69#endif
70};
This entity class represents non-player characters.
Definition: NSMonster.h:243
NSSquadMonster based NPCs are able to communicate strategies together.
Definition: NSSquadMonster.h:24