Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
OffenseObjectClass.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_OFFENSEOBJECTCLASS_H
13#define TT_INCLUDE_OFFENSEOBJECTCLASS_H
14class ArmedGameObj;
15class OffenseObjectClass {
16public:
17#define DEFAULT_DAMAGE 1.0f
18 OffenseObjectClass( float damage = DEFAULT_DAMAGE, unsigned int warhead = 0, ArmedGameObj *owner = NULL ) : Damage( damage ), Warhead( warhead ), ForceServerDamage( false ), EnableClientDamage( false ) { Set_Owner( owner ); }
19 OffenseObjectClass( const OffenseObjectClass & base );
20 ~OffenseObjectClass() { Set_Owner( NULL ); };
21 bool Save( ChunkSaveClass & csave );
22 bool Load( ChunkLoadClass & cload );
23 void Set_Damage( float damage ) { Damage = damage; }
24 float Get_Damage( void ) const { return Damage; }
25 void Set_Warhead( unsigned int warhead ) { Warhead = warhead; }
26 unsigned int Get_Warhead( void ) const { return Warhead; }
27 void Set_Owner( ArmedGameObj *owner ) { Owner = (ScriptableGameObj *)owner; }
28 ArmedGameObj *Get_Owner( void ) const { return (ArmedGameObj *)Owner.Get_Ptr(); }
29 bool ForceServerDamage;
30 bool EnableClientDamage;
31private:
32 float Damage;
33 unsigned int Warhead;
34 ReferencerClass Owner;
35};
36
37#endif