Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
ArmedGameObj.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_ARMEDGAMEOBJ_H
13#define TT_INCLUDE_ARMEDGAMEOBJ_H
14#include "PhysicalGameObj.h"
15#include "ArmedGameObjDef.h"
16#include "MuzzleRecoilClass.h"
17class WeaponBagClass;
18class WeaponClass;
19class ArmedGameObj : public PhysicalGameObj {
20public:
21 ArmedGameObj( void );
22 virtual ~ArmedGameObj( void );
23 void Init( const ArmedGameObjDef & definition );
24 void Copy_Settings( const ArmedGameObjDef & definition );
25 void Re_Init( const ArmedGameObjDef & definition );
26 SCRIPTS_API const ArmedGameObjDef & Get_Definition( void ) const ;
27 virtual bool Save( ChunkSaveClass & csave );
28 virtual bool Load( ChunkLoadClass & cload );
29 virtual void On_Post_Load( void );
30 virtual void Export_Creation( BitStreamClass & packet );
31 virtual void Import_Frequent( BitStreamClass & packet );
32 virtual void Export_Frequent( BitStreamClass & packet );
33 virtual void Import_State_Cs( BitStreamClass & packet );
34 virtual void Export_State_Cs( BitStreamClass & packet );
35 virtual void Post_Think();
36 SCRIPTS_API WeaponClass * Get_Weapon( void );
37 WeaponBagClass * Get_Weapon_Bag( void ) { return WeaponBag; }
38 bool Muzzle_Exists( int index = 0 );
39 virtual const Matrix3D &Get_Muzzle( int index = 0 );
40 void Start_Recoil( int muzzle_index,float recoil_scale,float recoil_time );
41 float Get_Weapon_Error( void ) { return Get_Definition().WeaponError; }
42 float Get_Weapon_Turn_Min(void) { return Get_Definition().WeaponTurnMin; }
43 float Get_Weapon_Turn_Max(void) { return Get_Definition().WeaponTurnMax; }
44 float Get_Weapon_Tilt_Min(void) { return Get_Definition().WeaponTiltMin; }
45 float Get_Weapon_Tilt_Max(void) { return Get_Definition().WeaponTiltMax; }
46 Vector3 Get_Targeting_Pos( void ) { return TargetingPos; }
47 virtual bool Set_Targeting( const Vector3 & pos, bool do_tilt = true );
48 virtual ArmedGameObj *As_ArmedGameObj( void ) { return this; }
49 bool Is_Recoiling(int index) {return MuzzleRecoilController[index].Is_Recoiling();}
50protected:
51 WeaponBagClass * WeaponBag;
52private:
53 Vector3 TargetingPos;
54 int MuzzleA0Bone;
55 int MuzzleA1Bone;
56 int MuzzleB0Bone;
57 int MuzzleB1Bone;
58 enum { MAX_MUZZLES = 4 };
59 MuzzleRecoilClass MuzzleRecoilController[MAX_MUZZLES];
60public:
61 void Init_Muzzle_Bones( void );
62};
63
64#endif