|
| 1 | +/* |
| 2 | +** Command & Conquer Generals(tm) |
| 3 | +** Copyright 2025 Electronic Arts Inc. |
| 4 | +** |
| 5 | +** This program is free software: you can redistribute it and/or modify |
| 6 | +** it under the terms of the GNU General Public License as published by |
| 7 | +** the Free Software Foundation, either version 3 of the License, or |
| 8 | +** (at your option) any later version. |
| 9 | +** |
| 10 | +** This program is distributed in the hope that it will be useful, |
| 11 | +** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +** GNU General Public License for more details. |
| 14 | +** |
| 15 | +** You should have received a copy of the GNU General Public License |
| 16 | +** along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +*/ |
| 18 | + |
| 19 | +//////////////////////////////////////////////////////////////////////////////// |
| 20 | +// // |
| 21 | +// (c) 2001-2003 Electronic Arts Inc. // |
| 22 | +// // |
| 23 | +//////////////////////////////////////////////////////////////////////////////// |
| 24 | + |
| 25 | +// FILE: VeterancyCrateCollide.h ///////////////////////////////////////////////////////////////////////// |
| 26 | +// Author: Kris Morness, April 2002 |
| 27 | +// Desc: A crate (actually a terrorist - mobile crate) that converts a car into a carbomb, activating |
| 28 | +// it's weapon and then activating it's AI. |
| 29 | +/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 30 | + |
| 31 | +#pragma once |
| 32 | + |
| 33 | +// INCLUDES /////////////////////////////////////////////////////////////////////////////////////// |
| 34 | +#include "Common/Module.h" |
| 35 | +#include "GameLogic/Module/CrateCollide.h" |
| 36 | + |
| 37 | +// FORWARD REFERENCES ///////////////////////////////////////////////////////////////////////////// |
| 38 | +class Thing; |
| 39 | +class FXList; |
| 40 | + |
| 41 | +//------------------------------------------------------------------------------------------------- |
| 42 | +class ConvertToCarBombCrateCollideModuleData : public CrateCollideModuleData |
| 43 | +{ |
| 44 | +public: |
| 45 | + UnsignedInt m_rangeOfEffect; |
| 46 | + const FXList *m_fxList; |
| 47 | + |
| 48 | + ConvertToCarBombCrateCollideModuleData() |
| 49 | + { |
| 50 | + m_rangeOfEffect = 0; |
| 51 | + m_fxList = NULL; |
| 52 | + } |
| 53 | + |
| 54 | + static void buildFieldParse(MultiIniFieldParse& p) |
| 55 | + { |
| 56 | + CrateCollideModuleData::buildFieldParse(p); |
| 57 | + |
| 58 | + static const FieldParse dataFieldParse[] = |
| 59 | + { |
| 60 | + { "FXList", INI::parseFXList, NULL, offsetof( ConvertToCarBombCrateCollideModuleData, m_fxList ) }, |
| 61 | + { 0, 0, 0, 0 } |
| 62 | + }; |
| 63 | + p.add(dataFieldParse); |
| 64 | + } |
| 65 | +}; |
| 66 | + |
| 67 | +//------------------------------------------------------------------------------------------------- |
| 68 | +class ConvertToCarBombCrateCollide : public CrateCollide |
| 69 | +{ |
| 70 | + |
| 71 | + MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( ConvertToCarBombCrateCollide, "ConvertToCarBombCrateCollide" ) |
| 72 | + MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( ConvertToCarBombCrateCollide, ConvertToCarBombCrateCollideModuleData ); |
| 73 | + |
| 74 | +public: |
| 75 | + |
| 76 | + ConvertToCarBombCrateCollide( Thing *thing, const ModuleData* moduleData ); |
| 77 | + // virtual destructor prototype provided by memory pool declaration |
| 78 | + |
| 79 | +protected: |
| 80 | + |
| 81 | + /// This allows specific vetoes to certain types of crates and their data |
| 82 | + virtual Bool isValidToExecute( const Object *other ) const; |
| 83 | + |
| 84 | + /// This is the game logic execution function that all real CrateCollides will implement |
| 85 | + virtual Bool executeCrateBehavior( Object *other ); |
| 86 | + virtual Bool isRailroad() const { return FALSE;}; |
| 87 | + virtual Bool isCarBombCrateCollide() const { return TRUE; } |
| 88 | +}; |
0 commit comments