| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- /*
- ** Command & Conquer(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* $Header: F:\projects\c&c\vcs\code\teamtype.h_v 2.18 16 Oct 1995 16:45:40 JOE_BOSTIC $ */
- /***************************************************************************
- ** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S **
- ***************************************************************************
- * *
- * Project Name : Command & Conquer *
- * *
- * File Name : TEAMTYPE.H *
- * *
- * Programmer : Bill Randolph *
- * *
- * Start Date : December 7, 1994 *
- * *
- * Last Update : December 7, 1994 [BR] *
- * *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #ifndef TEAMTYPE_H
- #define TEAMTYPE_H
- /*
- ********************************** Defines **********************************
- */
- //#define TEAMTYPE_MAX 20 // max # of different team types
- /*
- ** TeamMissionType: the various missions that a team can have.
- */
- typedef enum TeamMissionType {
- TMISSION_NONE=-1,
- TMISSION_ATTACKBASE, // Attack nearest enemy base.
- TMISSION_ATTACKUNITS, // Attack all enemy units.
- TMISSION_ATTACKCIVILIANS, // Attack all civilians
- TMISSION_RAMPAGE, // attack & destroy anything that's not mine
- TMISSION_DEFENDBASE, // Protect my base.
- // TMISSION_HARVEST, // stake out a Tiberium claim, defend & harvest it
- TMISSION_MOVE, // moves to waypoint specified.
- TMISSION_MOVECELL, // moves to cell # specified.
- TMISSION_RETREAT, // order given by superior team, for coordinating
- TMISSION_GUARD, // works like an infantry's guard mission
- TMISSION_LOOP, // loop back to start of mission list
- TMISSION_ATTACKTARCOM, // attack tarcom
- TMISSION_UNLOAD, // Unload at current location.
- TMISSION_COUNT,
- TMISSION_FIRST=0
- } TeamMissionType;
- /*
- ** Forward declarations.
- */
- class TechnoTypeClass;
- /*
- ** This structure contains one team mission value & its argument.
- */
- typedef struct TeamMissionTag
- {
- TeamMissionType Mission;
- int Argument;
- } TeamMissionStruct;
- /*
- ** TeamTypeClass declaration
- */
- class TeamTypeClass : public AbstractTypeClass
- {
- public:
- enum TeamTypeClassEnums {
- MAX_TEAM_CLASSCOUNT=5,
- MAX_TEAM_MISSIONS=20
- };
- /*
- ** Constructor/Destructor
- */
- TeamTypeClass(void);
- virtual ~TeamTypeClass(void) {};
- /*
- ** Initialization: clears all team types in preparation for new scenario
- */
- static void Init(void);
- /*
- ** File I/O routines
- */
- static void Read_INI(char *buffer);
- void Fill_In(char *name, char *entry);
- static void Write_INI(char *buffer, bool refresh);
- static void Read_Old_INI(char *buffer);
- static char * INI_Name(void) {return "TeamTypes";};
- bool Load(FileClass & file);
- bool Save(FileClass & file);
- void Code_Pointers(void);
- void Decode_Pointers(void);
- /*
- ** As_Pointer gets a pointer to the trigger object give its name
- */
- static TeamTypeClass *As_Pointer(char *name);
- /*
- ** Processing routines
- */
- void Remove(void);
- TeamClass * Create_One_Of(void) const;
- void Destroy_All_Of(void) const;
- /*
- ** Utility routines
- */
- static char const * Name_From_Mission(TeamMissionType order);
- static TeamMissionType Mission_From_Name(char const *name);
- static TeamTypeClass const * Suggested_New_Team(HouseClass * house, long utypes, long itypes, bool alerted);
- TARGET As_Target(void) const;
- /*
- ** Overloaded operators
- */
- void * operator new(size_t );
- void operator delete(void *ptr);
- /*
- ** Dee-buggin' support.
- */
- int Validate(void) const;
- /*
- ** If this teamtype object is active, then this flag will be true.
- ** TeamType objects that are not active are either not yet created or have
- ** been deleted after fulfilling their action.
- */
- unsigned IsActive:1;
- /*
- ** If RoundAbout, the team avoids high-threat areas
- */
- unsigned IsRoundAbout:1;
- /*
- ** If Learning, the team learns from mistakes
- */
- unsigned IsLearning:1;
- /*
- ** If Suicide, the team won't stop until it achieves its mission or it's
- ** dead
- */
- unsigned IsSuicide:1;
- /*
- ** Is this team type allowed to be created automatically by the computer
- ** when the appropriate trigger indicates?
- */
- unsigned IsAutocreate:1;
- /*
- ** Mercenaries will change sides if they start to lose.
- */
- unsigned IsMercenary:1;
- /*
- ** This flag tells the computer that it should build members to fill
- ** a team of this type regardless of whether there actually is a team
- ** of this type active.
- */
- unsigned IsPrebuilt:1;
- /*
- ** If this team should allow recruitment of new members, then this flag
- ** will be true. A false value results in a team that fights until it
- ** is dead. This is similar to IsSuicide, but they will defend themselves.
- */
- unsigned IsReinforcable:1;
- /*
- ** A transient team type was created exclusively to bring on reinforcements
- ** as a result of some special event. As soon as there are no teams
- ** existing of this type, then this team type should be deleted.
- */
- unsigned IsTransient:1;
- /*
- ** Priority given the team for recruiting purposes; higher priority means
- ** it can steal members from other teams (scale: 0 - 15)
- */
- int RecruitPriority;
- /*
- ** Initial # of this type of team
- */
- unsigned char InitNum;
- /*
- ** Max # of this type of team allowed at one time
- */
- unsigned char MaxAllowed;
- /*
- ** Fear level of this team
- */
- unsigned char Fear;
- /*
- ** House the team belongs to
- */
- HousesType House;
- /*
- ** The mission list for this team
- */
- int MissionCount;
- TeamMissionStruct MissionList[MAX_TEAM_MISSIONS];
- /*
- ** Number of different classes in the team
- */
- unsigned char ClassCount;
- /*
- ** Array of object types comprising the team
- */
- TechnoTypeClass const * Class[MAX_TEAM_CLASSCOUNT];
- /*
- ** Desired # of each type of object comprising the team
- */
- unsigned char DesiredNum[MAX_TEAM_CLASSCOUNT];
- private:
- static char const * TMissions[TMISSION_COUNT];
- /*
- ** This contains the value of the Virtual Function Table Pointer
- */
- static void * VTable;
- };
- #endif
|