| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766 |
- /*
- ** Command & Conquer Red Alert(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: /CounterStrike/TEVENT.CPP 1 3/03/97 10:25a 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 : TEVENT.CPP *
- * *
- * Programmer : Joe L. Bostic *
- * *
- * Start Date : 11/28/95 *
- * *
- * Last Update : July 29, 1996 [JLB] *
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * Attaches_To -- Determines what event can be attached to. *
- * EventChoiceClass::Draw_It -- Displays the event choice class as a text string. *
- * Event_From_Name -- retrieves EventType for given name *
- * Event_Needs -- Returns with what this event type needs for data. *
- * Name_From_Event -- retrieves name for EventType *
- * TEventClass::Build_INI_Entry -- Builds the ini text for this event. *
- * TEventClass::Read_INI -- Parses the INI text for this event's data. *
- * TEventClass::Reset -- Reset the trigger for a subsequent "spring". *
- * TEventClass::operator () -- Action operator to see if event is satisfied. *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "function.h"
- /*
- ** This is the text name for all of the trigger events. These are used by the scenario editor
- */
- const char * EventText[TEVENT_COUNT] = {
- "-No Event-",
- "Entered by...",
- "Spied by...",
- "Thieved by...",
- "Discovered by player",
- "House Discovered...",
- "Attacked by anybody",
- "Destroyed by anybody",
- "Any Event",
- "Destroyed, Units, All...",
- "Destroyed, Buildings, All...",
- "Destroyed, All...",
- "Credits exceed (x100)...",
- "Elapsed Time (1/10th min)...",
- "Mission Timer Expired",
- "Destroyed, Buildings, #...",
- "Destroyed, Units, #...",
- "No Factories left",
- "Civilians Evacuated",
- "Build Building Type...",
- "Build Unit Type...",
- "Build Infantry Type...",
- "Build Aircraft Type...",
- "Leaves map (team)...",
- "Zone Entry by...",
- "Crosses Horizontal Line...",
- "Crosses Vertical Line...",
- "Global is set...",
- "Global is clear...",
- "Destroyed, Fakes, All...",
- "Low Power...",
- "All bridges destroyed",
- "Building exists..."
- };
- /*
- ** This is an ordinal list of trigger events. This list
- ** is used when generating the trigger dialog box.
- */
- EventChoiceClass EventChoices[TEVENT_COUNT] = {
- {TEVENT_NONE},
- {TEVENT_PLAYER_ENTERED},
- {TEVENT_SPIED},
- {TEVENT_THIEVED},
- {TEVENT_DISCOVERED},
- {TEVENT_HOUSE_DISCOVERED},
- {TEVENT_ATTACKED},
- {TEVENT_DESTROYED},
- {TEVENT_ANY},
- {TEVENT_UNITS_DESTROYED},
- {TEVENT_BUILDINGS_DESTROYED},
- {TEVENT_ALL_DESTROYED},
- {TEVENT_CREDITS},
- {TEVENT_TIME},
- {TEVENT_MISSION_TIMER_EXPIRED},
- {TEVENT_NBUILDINGS_DESTROYED},
- {TEVENT_NUNITS_DESTROYED},
- {TEVENT_NOFACTORIES},
- {TEVENT_EVAC_CIVILIAN},
- {TEVENT_BUILD},
- {TEVENT_BUILD_UNIT},
- {TEVENT_BUILD_INFANTRY},
- {TEVENT_BUILD_AIRCRAFT},
- {TEVENT_LEAVES_MAP},
- {TEVENT_ENTERS_ZONE},
- {TEVENT_CROSS_HORIZONTAL},
- {TEVENT_CROSS_VERTICAL},
- {TEVENT_GLOBAL_SET},
- {TEVENT_GLOBAL_CLEAR},
- {TEVENT_FAKES_DESTROYED},
- {TEVENT_LOW_POWER},
- {TEVENT_ALL_BRIDGES_DESTROYED},
- {TEVENT_BUILDING_EXISTS},
- };
- /***********************************************************************************************
- * EventChoiceClass::Draw_It -- Displays the event choice class as a text string. *
- * *
- * This utility routine is used by the list box display code to print the text line that *
- * describes the event choice action. *
- * *
- * INPUT: see below... *
- * *
- * OUTPUT: none *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 07/29/1996 JLB : Created. *
- *=============================================================================================*/
- void EventChoiceClass::Draw_It(int , int x, int y, int width, int height, bool selected, TextPrintType flags) const
- {
- RemapControlType * scheme = GadgetClass::Get_Color_Scheme();
- static int _tabs[] = {13,40};
- if ((flags & 0x0F) == TPF_6PT_GRAD || (flags & 0x0F) == TPF_EFNT) {
- if (selected) {
- flags = flags | TPF_BRIGHT_COLOR;
- LogicPage->Fill_Rect(x, y, x + width - 1, y + height - 1, scheme->Shadow);
- } else {
- if (!(flags & TPF_USE_GRAD_PAL)) {
- flags = flags | TPF_MEDIUM_COLOR;
- }
- }
- Conquer_Clip_Text_Print(Description(), x, y, scheme, TBLACK, flags, width, _tabs);
- } else {
- Conquer_Clip_Text_Print(Description(), x, y, (selected ? &ColorRemaps[PCOLOR_DIALOG_BLUE] : &ColorRemaps[PCOLOR_GREY]), TBLACK, flags, width, _tabs);
- }
- }
- /***********************************************************************************************
- * TEventClass::Reset -- Reset the trigger for a subsequent "spring". *
- * *
- * This will reset the trigger event so that it may be "sprung" again. Typically, this *
- * occurs for persistent triggers. *
- * *
- * INPUT: none *
- * *
- * OUTPUT: none *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- void TEventClass::Reset(TDEventClass & td) const
- {
- td.IsTripped = false;
- if (Event == TEVENT_TIME) {
- td.Timer = Data.Value * (TICKS_PER_MINUTE/10);
- }
- }
- /***********************************************************************************************
- * TEventClass::operator () -- Action operator to see if event is satisfied. *
- * *
- * This routine is called to see if the event has been satisfied. Typically, when the *
- * necessary trigger events have been satisfied, then the trigger is sprung. For some *
- * events, the act of calling this routine is tacit proof enough that the event has *
- * occurred. For most other events, the success condition must be explicitly checked. *
- * *
- * INPUT: event -- The event that has occurred according to the context from which this *
- * routine was called. In the case of no specific event having occurred, *
- * then TEVENT_ANY will be passed in. *
- * *
- * house -- The house that this event is tied to. *
- * *
- * object-- The object that this event might apply to. For object triggering *
- * events, this will point to the perpetrator object. *
- * *
- * forced-- If this event is forced by some outside action, this flag will be true. *
- * Forcing only occurs as an explicit action from another trigger. *
- * *
- * OUTPUT: Was this event satisfied? A satisfied event will probably spring the trigger *
- * it is attached to. *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- bool TEventClass::operator () (TDEventClass & td, TEventType event, HousesType house, ObjectClass const * object, bool forced)
- {
- /*
- ** If this trigger event has been forced, then no further checks are required.
- ** Force the trigger to be tripped.
- */
- if (forced) {
- td.IsTripped = true;
- }
- if (td.IsTripped) return(true);
- /*
- ** Triggers based on the game's global environment such as time or
- ** global flags are triggered only when the appropriate condition
- ** is true.
- */
- switch (Event) {
- case TEVENT_GLOBAL_SET:
- if (!Scen.GlobalFlags[Data.Value]) return(false);
- return(true);
- case TEVENT_GLOBAL_CLEAR:
- if (Scen.GlobalFlags[Data.Value]) return(false);
- return(true);
- case TEVENT_MISSION_TIMER_EXPIRED:
- // if (MissionSuspend == -1 || MissionTimer != 0) return(false);
- if (!Scen.MissionTimer.Is_Active() || Scen.MissionTimer != 0) return(false);
- return(true);
- case TEVENT_TIME:
- if (td.Timer != 0) return(false);
- return(true);
- }
- /*
- ** Don't trigger this event if the parameters mean nothing. Typical of
- ** this would be for events related to time or other outside influences.
- */
- if (Event == TEVENT_NONE) {
- return(false);
- }
- /*
- ** If this is not the event for this trigger, just return. This is only
- ** necessary to check for those trigger events that are presumed to be
- ** true just by the fact that this routine is called with the appropriate
- ** event identifier.
- */
- if (Event == TEVENT_ATTACKED ||
- Event == TEVENT_DESTROYED ||
- Event == TEVENT_DISCOVERED ||
- Event == TEVENT_SPIED ||
- Event == TEVENT_NONE ||
- Event == TEVENT_CROSS_HORIZONTAL ||
- Event == TEVENT_CROSS_VERTICAL ||
- Event == TEVENT_ENTERS_ZONE ||
- Event == TEVENT_PLAYER_ENTERED) {
- if (event != Event && event != TEVENT_ANY) {
- return(false);
- }
- }
- /*
- ** The cell entry trigger event is only tripped when an object of the
- ** matching ownership has entered the cell in question. All other
- ** conditions will not trigger the event.
- */
- if (Event == TEVENT_PLAYER_ENTERED || Event == TEVENT_CROSS_HORIZONTAL || Event == TEVENT_CROSS_VERTICAL || Event == TEVENT_ENTERS_ZONE) {
- if (!object || object->Owner() != Data.House) return(false);
- td.IsTripped = true;
- return(true);
- }
- /*
- ** Check for all bridges destroyed condition.
- */
- if (Event == TEVENT_ALL_BRIDGES_DESTROYED) {
- if (Scen.BridgeCount) return(false);
- td.IsTripped = true;
- return(true);
- }
- /*
- ** The following trigger events are not considered to have sprung
- ** merely by fact that this routine has been called. These trigger
- ** events must be verified manually by examining the house that
- ** they are assigned to.
- */
- HouseClass * hptr = HouseClass::As_Pointer(house);
- int index;
- if (hptr != NULL) {
- switch (Event) {
- /*
- ** Check to see if a team of the appropriate type has left the map.
- */
- case TEVENT_LEAVES_MAP:
- for (index = 0; index < Teams.Count(); index++) {
- TeamClass * ptr = Teams.Ptr(index);
- if (ptr->Class == Team && ptr->Is_Empty() && ptr->IsLeaveMap) {
- // if (ptr->Class == Team && ptr->House == hptr && ptr->Is_Empty() && ptr->IsLeaveMap) {
- td.IsTripped = true;
- break;
- }
- }
- if (index == Teams.Count()) return(false);
- break;
- /*
- ** Credits must be equal or greater to the value specified.
- */
- case TEVENT_CREDITS:
- if (hptr->Available_Money() < Data.Value) return(false);
- break;
- /*
- ** Ensure that there are no more factories left.
- */
- case TEVENT_NOFACTORIES:
- if (hptr->BScan & (STRUCTF_AIRSTRIP|STRUCTF_TENT|STRUCTF_WEAP|STRUCTF_BARRACKS|STRUCTF_CONST)) return(false);
- break;
- /*
- ** Ensure that there are no fake structures left.
- */
- case TEVENT_FAKES_DESTROYED:
- if (hptr->BScan & (STRUCTF_FAKECONST|STRUCTF_FAKEWEAP)) return(false);
- break;
- /*
- ** A civilian must have been evacuated.
- */
- case TEVENT_EVAC_CIVILIAN:
- if (!hptr->IsCivEvacuated) return(false);
- break;
- /*
- ** Verify that the structure has been built.
- */
- case TEVENT_BUILDING_EXISTS:
- if ((hptr->ActiveBScan & (1 << Data.Structure)) == 0) return(false);
- // if (hptr->Get_Quantity(Data.Structure) == 0) return(false);
- break;
- /*
- ** Verify that the structure has been built.
- */
- case TEVENT_BUILD:
- if (hptr->JustBuiltStructure != Data.Structure) return(false);
- td.IsTripped = true;
- break;
- /*
- ** Verify that the unit has been built.
- */
- case TEVENT_BUILD_UNIT:
- if (hptr->JustBuiltUnit != Data.Unit) return(false);
- td.IsTripped = true;
- break;
- /*
- ** Verify that the infantry has been built.
- */
- case TEVENT_BUILD_INFANTRY:
- if (hptr->JustBuiltInfantry != Data.Infantry) return(false);
- td.IsTripped = true;
- break;
- /*
- ** Verify that the aircraft has been built.
- */
- case TEVENT_BUILD_AIRCRAFT:
- if (hptr->JustBuiltAircraft != Data.Aircraft) return(false);
- td.IsTripped = true;
- break;
- /*
- ** Verify that the specified number of buildings have been destroyed.
- */
- case TEVENT_NBUILDINGS_DESTROYED:
- if (hptr->BuildingsLost < Data.Value) return(false);
- break;
- /*
- ** Verify that the specified number of units have been destroyed.
- */
- case TEVENT_NUNITS_DESTROYED:
- if (hptr->UnitsLost < Data.Value) return(false);
- break;
- default:
- break;
- }
- }
- hptr = HouseClass::As_Pointer(Data.House);
- if (hptr) {
- switch (Event) {
- case TEVENT_LOW_POWER:
- if (hptr->Power_Fraction() >= 1) return(false);
- break;
- // case TEVENT_SPIED:
- // if (!hptr->IsSpied) return(false);
- // break;
- case TEVENT_THIEVED:
- if (!hptr->IsThieved) return(false);
- break;
- /*
- ** Verify that the house has been discovered.
- */
- case TEVENT_HOUSE_DISCOVERED:
- if (!hptr->IsDiscovered) return(false);
- break;
- /*
- ** Verify that all buildings have been destroyed.
- */
- case TEVENT_BUILDINGS_DESTROYED:
- if (hptr->ActiveBScan) return(false);
- break;
- /*
- ** Verify that all units have been destroyed -- with some
- ** exceptions.
- */
- case TEVENT_UNITS_DESTROYED:
- if (hptr->ActiveUScan | hptr->ActiveIScan) return(false);
- break;
- /*
- ** Verify that all buildings and units have been destroyed.
- */
- case TEVENT_ALL_DESTROYED:
- if (hptr->ActiveBScan | hptr->ActiveUScan | hptr->ActiveIScan | hptr->ActiveVScan) return(false);
- break;
- default:
- break;
- }
- }
- return(true);
- }
- /***********************************************************************************************
- * TEventClass::Build_INI_Entry -- Builds the ini text for this event. *
- * *
- * This routine will build the ini text for this trigger event. The ini text is appended *
- * to the string buffer specified. This routine is used to build the complete trigger *
- * ini text for writing out to the INI scenario file. *
- * *
- * INPUT: ptr -- Pointer to the string buffer that will hold the event INI data. *
- * *
- * OUTPUT: none *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- void TEventClass::Build_INI_Entry(char * ptr) const
- {
- sprintf(ptr, "%d,%d,%d", Event, TeamTypes.Logical_ID(Team), Data.Value);
- }
- /***********************************************************************************************
- * TEventClass::Read_INI -- Parses the INI text for this event's data. *
- * *
- * This routine is used to parse the INI data line to fetch the event's data from it. *
- * *
- * INPUT: none *
- * *
- * OUTPUT: none *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- void TEventClass::Read_INI(void)
- {
- char const * token;
- switch (NewINIFormat) {
- default:
- Event = TEventType(atoi(strtok(NULL, ",")));
- Team.Set_Raw(atoi(strtok(NULL, ",")));
- Data.Value = atoi(strtok(NULL, ","));
- break;
- case 1:
- token = strtok(NULL, ",");
- Event = TEVENT_NONE;
- if (token) Event = TEventType(atoi(token));
- token = strtok(NULL, ",");
- Team = NULL;
- Data.Value = -1;
- if (token) {
- if (Event_Needs(Event) == NEED_TEAM) {
- Team = TeamTypes.Raw_Ptr(atoi(token));
- } else {
- Data.Value = atoi(token);
- }
- }
- break;
- case 0:
- Event = TEventType(atoi(strtok(NULL, ",")));
- strtok(NULL, ",");
- strtok(NULL, ",");
- Team = TeamTypeClass::From_Name(strtok(NULL, ","));
- Data.Value = atoi(strtok(NULL, ","));
- strtok(NULL, ",");
- break;
- }
- }
- /***********************************************************************************************
- * Event_Needs -- Returns with what this event type needs for data. *
- * *
- * This routine will examine the specified event type and return a code that indicates *
- * the type of data that must be supplied to this event. Some events require no data and *
- * these will return NEED_NONE. *
- * *
- * INPUT: event -- The event type to examine. *
- * *
- * OUTPUT: Returns with the type of additional data that is needed by this event. *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- NeedType Event_Needs(TEventType event)
- {
- switch (event) {
- case TEVENT_THIEVED:
- case TEVENT_PLAYER_ENTERED:
- case TEVENT_CROSS_HORIZONTAL:
- case TEVENT_CROSS_VERTICAL:
- case TEVENT_ENTERS_ZONE:
- case TEVENT_HOUSE_DISCOVERED:
- case TEVENT_BUILDINGS_DESTROYED:
- case TEVENT_UNITS_DESTROYED:
- case TEVENT_ALL_DESTROYED:
- case TEVENT_LOW_POWER:
- return(NEED_HOUSE);
- case TEVENT_NUNITS_DESTROYED:
- case TEVENT_NBUILDINGS_DESTROYED:
- case TEVENT_CREDITS:
- case TEVENT_TIME:
- case TEVENT_GLOBAL_SET:
- case TEVENT_GLOBAL_CLEAR:
- return(NEED_NUMBER);
- case TEVENT_BUILDING_EXISTS:
- case TEVENT_BUILD:
- return(NEED_STRUCTURE);
- case TEVENT_BUILD_UNIT:
- return(NEED_UNIT);
- case TEVENT_BUILD_INFANTRY:
- return(NEED_INFANTRY);
- case TEVENT_BUILD_AIRCRAFT:
- return(NEED_AIRCRAFT);
- case TEVENT_LEAVES_MAP:
- return(NEED_TEAM);
- default:
- break;
- }
- return(NEED_NONE);
- }
- /***********************************************************************************************
- * Event_From_Name -- retrieves EventType for given name *
- * *
- * INPUT: *
- * name name to get event for *
- * *
- * OUTPUT: *
- * EventType for given name *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 11/29/1994 BR : Created. *
- *=============================================================================================*/
- TEventType Event_From_Name (char const * name)
- {
- if (name) {
- for (TEventType i = TEVENT_NONE; i < TEVENT_COUNT; i++) {
- if (!stricmp(name, EventText[i])) {
- return(i);
- }
- }
- }
- return(TEVENT_NONE);
- }
- /***********************************************************************************************
- * Name_From_Event -- retrieves name for EventType *
- * *
- * INPUT: *
- * event EventType to get name for *
- * *
- * OUTPUT: *
- * name for EventType *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 11/29/1994 BR : Created. *
- *=============================================================================================*/
- char const * Name_From_Event(TEventType event)
- {
- return(EventText[event]);
- }
- /***********************************************************************************************
- * Attaches_To -- Determines what event can be attached to. *
- * *
- * This routine is used to determine what this event type can be attached to in the game. *
- * Some events are specifically tied to cells or game object. This routine will indicate *
- * this requirement. *
- * *
- * INPUT: event -- The event type to examine. *
- * *
- * OUTPUT: Returns with the attachable characteristics for this event type. These *
- * characteristics are represented by a composite bit field. Some events can be *
- * attached to multiple objects. *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 11/28/1995 JLB : Created. *
- *=============================================================================================*/
- AttachType Attaches_To(TEventType event)
- {
- AttachType attach = ATTACH_NONE;
- switch (event) {
- case TEVENT_CROSS_HORIZONTAL:
- case TEVENT_CROSS_VERTICAL:
- case TEVENT_ENTERS_ZONE:
- case TEVENT_PLAYER_ENTERED:
- case TEVENT_ANY:
- case TEVENT_DISCOVERED:
- case TEVENT_NONE:
- attach = attach | ATTACH_CELL;
- break;
- default:
- break;
- }
- switch (event) {
- case TEVENT_SPIED:
- case TEVENT_PLAYER_ENTERED:
- case TEVENT_DISCOVERED:
- case TEVENT_DESTROYED:
- case TEVENT_ATTACKED:
- case TEVENT_ANY:
- case TEVENT_NONE:
- attach = attach | ATTACH_OBJECT;
- break;
- default:
- break;
- }
- switch (event) {
- // case TEVENT_CROSS_HORIZONTAL:
- // case TEVENT_CROSS_VERTICAL:
- case TEVENT_ENTERS_ZONE:
- case TEVENT_ANY:
- attach = attach | ATTACH_MAP;
- break;
- default:
- break;
- }
- switch (event) {
- case TEVENT_LOW_POWER:
- case TEVENT_EVAC_CIVILIAN:
- case TEVENT_BUILDING_EXISTS:
- case TEVENT_BUILD:
- case TEVENT_BUILD_UNIT:
- case TEVENT_BUILD_INFANTRY:
- case TEVENT_BUILD_AIRCRAFT:
- case TEVENT_NOFACTORIES:
- case TEVENT_BUILDINGS_DESTROYED:
- case TEVENT_NBUILDINGS_DESTROYED:
- case TEVENT_UNITS_DESTROYED:
- case TEVENT_NUNITS_DESTROYED:
- case TEVENT_ALL_DESTROYED:
- case TEVENT_HOUSE_DISCOVERED:
- case TEVENT_CREDITS:
- // case TEVENT_ATTACKED:
- case TEVENT_THIEVED:
- case TEVENT_ANY:
- case TEVENT_FAKES_DESTROYED:
- attach = attach | ATTACH_HOUSE;
- break;
- default:
- break;
- }
- switch (event) {
- case TEVENT_TIME:
- case TEVENT_GLOBAL_SET:
- case TEVENT_GLOBAL_CLEAR:
- case TEVENT_MISSION_TIMER_EXPIRED:
- case TEVENT_ANY:
- case TEVENT_ALL_BRIDGES_DESTROYED:
- case TEVENT_LEAVES_MAP:
- attach = attach | ATTACH_GENERAL;
- break;
- default:
- break;
- }
- return(attach);
- }
|