Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
PowerupGameObj.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_POWERUPGAMEOBJ_H
13#define TT_INCLUDE_POWERUPGAMEOBJ_H
14#include "SimpleGameObj.h"
15class AudibleSoundClass;
16class WeaponBagClass;
17class SmartGameObj;
18class PowerUpGameObjDef;
19class PowerUpGameObj : public SimpleGameObj {
20public:
21 PowerUpGameObj( void );
22 virtual ~PowerUpGameObj( void );
23 virtual void Init( void );
24 void Init( const PowerUpGameObjDef & definition );
25 const PowerUpGameObjDef SCRIPTS_API & Get_Definition( void ) const ;
26 virtual bool Save( ChunkSaveClass & csave );
27 virtual bool Load( ChunkLoadClass & cload );
28 virtual void On_Post_Load( void ); // MOVED
29 virtual const PersistFactoryClass & Get_Factory( void ) const;
30 virtual void Think( void );
31 void SCRIPTS_API Grant( SmartGameObj * obj );
32 virtual PowerUpGameObj *As_PowerUpGameObj() { return this; }
33 static PowerUpGameObj * Create_Backpack( ArmedGameObj * provider );
34 virtual bool Is_Always_Dirty( void ) { return false; }
35 virtual void Get_Description( StringClass & description );
36 void Expire( void );
37protected:
38 enum
39 {
40 STATE_BECOMING_IDLE = 0,
41 STATE_IDLING,
42 STATE_GRANTING,
43 STATE_EXPIRING,
44 };
45 void Set_State( int state );
46 void Update_State( void );
47 AudibleSoundClass * IdleSoundObj;
48 int State;
49 float StateEndTimer;
50 WeaponBagClass * WeaponBag;
51 friend class PowerUpGameObjDef;
52};
53
54#endif