Nuclide
Software Development Kit for id Technology (BETA)
SquadMonster.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 ncSquadMonster(void);
27
28#ifdef SERVER
29 /* overrides */
30 virtual void Spawned(void);
31 virtual void SpawnKey(string, string);
32 virtual void Input(entity, string, string);
33 virtual void Save(float);
34 virtual void Restore(string, string);
35
37 virtual void HasBecomeSquadLeader(void);
39 virtual void HasJoinedSquad(void);
40
42 nonvirtual bool InSquad(void);
44 nonvirtual bool IsSquadLeader(void);
46 nonvirtual ncSquadMonster GetSquadLeader(void);
47
49 nonvirtual void FindSquadNearMe(float);
50
52 nonvirtual void AddToSquad(ncSquadMonster);
54 nonvirtual void RemoveFromSquad(ncSquadMonster);
56 nonvirtual ncSquadMonster GetNearestSquadMember(void);
58 nonvirtual ncSquadMonster GetFarthestSquadMember(void);
60 nonvirtual void AlertSquadWithMindset(string scheduleType);
61#endif
62
63#ifdef SERVER
64private:
65 string m_strSquadLeaderBody;
66 bool m_bStartAsLeader;
67 bool m_inSquad;
68 ncSquadMonster m_eSquadLeader;
69
70 /* stored only in the squad leader's memory */
71 ncSquadMonster m_eSquadMembers[NSSQUADMONSTER_MAXMEMBERS];
72#endif
73};
This entity class represents non-player characters.
Definition: Monster.h:276
ncSquadMonster based NPCs are able to communicate strategies together.
Definition: SquadMonster.h:24