| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- /*
- ** Command & Conquer Generals Zero Hour(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/>.
- */
- ////////////////////////////////////////////////////////////////////////////////
- // //
- // (c) 2001-2003 Electronic Arts Inc. //
- // //
- ////////////////////////////////////////////////////////////////////////////////
- // FILE: TransportContain.h ////////////////////////////////////////////////////////////////////////
- // Author: Steven Johnson, March 2002
- // Desc: Contain module for transport units.
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- #pragma once
- #ifndef __TransportContain_H_
- #define __TransportContain_H_
- // USER INCLUDES //////////////////////////////////////////////////////////////////////////////////
- #include "GameLogic/Module/OpenContain.h"
- //-------------------------------------------------------------------------------------------------
- class TransportContainModuleData : public OpenContainModuleData
- {
- public:
- struct InitialPayload
- {
- AsciiString name;
- Int count;
- };
- Int m_slotCapacity; ///< max units that can be inside us
- Real m_exitPitchRate;
- AsciiString m_exitBone;
- InitialPayload m_initialPayload;
- Real m_healthRegen;
- UnsignedInt m_exitDelay;
- Bool m_scatterNearbyOnExit;
- Bool m_orientLikeContainerOnExit;
- Bool m_keepContainerVelocityOnExit;
- Bool m_goAggressiveOnExit;
- Bool m_armedRidersUpgradeWeaponSet;
- Bool m_resetMoodCheckTimeOnExit;
- Bool m_destroyRidersWhoAreNotFreeToExit;
- Bool m_isDelayExitInAir;
- TransportContainModuleData();
- static void buildFieldParse(MultiIniFieldParse& p);
- static void parseInitialPayload( INI* ini, void *instance, void *store, const void* /*userData*/ );
- };
- //-------------------------------------------------------------------------------------------------
- class TransportContain : public OpenContain
- {
- MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( TransportContain, "TransportContain" )
- MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( TransportContain, TransportContainModuleData )
- public:
- TransportContain( Thing *thing, const ModuleData* moduleData );
- // virtual destructor prototype provided by memory pool declaration
- virtual Bool isValidContainerFor( const Object* obj, Bool checkCapacity) const;
- virtual void onCapture( Player *oldOwner, Player *newOwner ); // have to kick everyone out on capture.
- virtual void onContaining( Object *obj, Bool wasSelected ); ///< object now contains 'obj'
- virtual void onRemoving( Object *obj ); ///< object no longer contains 'obj'
- virtual UpdateSleepTime update(); ///< called once per frame
- virtual Bool isRiderChangeContain() const { return FALSE; }
- virtual Bool isSpecialOverlordStyleContainer() const {return FALSE;}
-
- virtual Int getContainMax( void ) const;
- virtual Int getExtraSlotsInUse( void ) { return m_extraSlotsInUse; }///< Transports have the ability to carry guys how take up more than spot.
- virtual Bool isExitBusy() const; ///< Contain style exiters are getting the ability to space out exits, so ask this before reserveDoor as a kind of no-commitment check.
- virtual ExitDoorType reserveDoorForExit( const ThingTemplate* objType, Object *specificObject );
- virtual void unreserveDoorForExit( ExitDoorType exitDoor );
- virtual Bool isDisplayedOnControlBar() const {return TRUE;}///< Does this container display its contents on the ControlBar?
- protected:
- // exists primarily for TransportContain to override
- virtual void killRidersWhoAreNotFreeToExit();
- virtual Bool isSpecificRiderFreeToExit(Object* obj);
- virtual Bool isPassengerAllowedToFire( ObjectID id = INVALID_ID ) const; ///< Hey, can I shoot out of this container?
- virtual void createPayload();
- void letRidersUpgradeWeaponSet( void );
- Bool m_payloadCreated;
- private:
- Int m_extraSlotsInUse;
- UnsignedInt m_frameExitNotBusy;
- };
- #endif // __TransportContain_H_
|