Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
mdbevf.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#pragma once
13
14#define NOT_DISABLED 0
15#define DISABLED_EVF 1
16#define DISABLED_UNIT 2
17#define DISABLED_BOTH 3
18
19#define VEHTYPE_GROUND 1
20#define VEHTYPE_FLYING 2
21#define VEHTYPE_NAVAL 3
22#define VEHTYPE_SUPPORT 4
23
24#include "PurchaseSettingsDefClass.h"
25struct UnitInfo {
26 UnitInfo(PurchaseSettingsDefClass::TYPE type,unsigned int pos,unsigned int preset,bool alternate) : Type(type), Pos(pos), Preset(preset), Alternate(alternate), Support(false)
27 {
28 DMode = NOT_DISABLED;
29 }
30 PurchaseSettingsDefClass::TYPE Type;
31 unsigned int Pos;
32 unsigned int Preset;
33 unsigned int VehType;
34 unsigned int DMode;
35 bool Alternate;
36 bool Support;
37};
38
39struct CreationPos {
40 unsigned int Preset;
41 GameObject *Pos;
42};
43
44class ExpVehFacClass {
45 SimpleDynVecClass<UnitInfo*> Units;
46 SimpleDynVecClass<CreationPos*> Naval_Creation_Pos_Per_Vehicle;
47 int Last_Flying_Landing_Pos;
48 int Last_Naval_Creation_Pos;
49 unsigned int Team;
50 int PHookID;
51 int OHookID;
52 ObjectCreateHookStruct *OHookStruct;
53 bool Is_In_Vector(SimpleDynVecClass<unsigned int> &Vec, unsigned int Preset);
54 Vector3 Get_Flying_Landing_Position();
55 GameObject *Get_Naval_Creation_Position(unsigned int Preset);
56 GameObject *Script;
57 bool Using_Naval;
58
59public:
60 unsigned int Ground_Limit;
61 unsigned int Flying_Limit;
62 unsigned int Naval_Limit;
63 unsigned int Support_Limit;
64 unsigned int Ground_Amount;
65 unsigned int Flying_Amount;
66 unsigned int Naval_Amount;
67 unsigned int Support_Amount;
68 SimpleDynVecClass<GameObject*> *Naval_Creation_Positions;
69 SimpleDynVecClass<GameObject*> *Flying_Landing_Positions;
70 float Ground_Build_Time[2];
71 float Flying_Build_Time[2];
72 float Naval_Build_Time[2];
73 bool Is_Ground_Building;
74 bool Is_Flying_Building;
75 bool Is_Naval_Building;
76 bool Loaded;
77 unsigned int LastFlyVehID;
78 unsigned int LastFlyVehOwner;
79
80 ExpVehFacClass(unsigned int team);
81 ~ExpVehFacClass();
82 void Set_Ground_Currently_Building(bool building);
83 void Set_Flying_Currently_Building(bool building);
84 void Set_Naval_Currently_Building(bool building);
85 void Set_Ground_Limit_Reached(bool Reached);
86 void Set_Flying_Limit_Reached(bool Reached);
87 void Set_Naval_Limit_Reached(bool Reached);
88 void Set_Support_Limit_Reached(bool Reached);
89 UnitInfo *Get_Unit_Info(unsigned int Preset);
90 void Load(const char *NavalVehicles, const char *NavalCreationPresets,GameObject *script,const char *SupportVehicles = 0);
91 void Clear();
92 static PurchaseStatus Purchase_Hook(BaseControllerClass *base, GameObject *purchaser, unsigned int cost, unsigned int preset,const char *data);
93 static void Object_Hook(void *,GameObject *obj);
94};
95
96extern ExpVehFacClass *ExpVehFac[2];
97
98class MDB_ExpVehFac_Helipad : public ScriptImpClass {
99 void Created(GameObject *obj);
100 void Killed(GameObject *obj,GameObject *killer);
101 void Custom(GameObject *obj, int type, int param, GameObject *sender);
102 void Destroyed(GameObject *obj);
103};
104
105class MDB_ExpVehFac_Naval : public ScriptImpClass {
106 void Created(GameObject *obj);
107 void Killed(GameObject *obj,GameObject *killer);
108 void Custom(GameObject *obj, int type, int param, GameObject *sender);
109 void Destroyed(GameObject *obj);
110};
111
112class MDB_ExpVehFac_Vehicle_Factory : public ScriptImpClass {
113 void Created(GameObject *obj);
114 void Killed(GameObject *obj,GameObject *killer);
115 void Custom(GameObject *obj, int type, int param, GameObject *sender);
116 void Timer_Expired(GameObject *obj, int number);
117 void Destroyed(GameObject *obj);
118};
119
120class MDB_ExpVehFac_Cinematic : public ScriptImpClass {
121 int ID;
122 void Created(GameObject *obj);
123 void Timer_Expired(GameObject *obj, int number);
124 public: void Register_Auto_Save_Variables();
125};
126
127class MDB_ExpVehFac_Cinematic_Vehicle : public ScriptImpClass {
128 void Damaged(GameObject *obj,GameObject *damager,float amount);
129};
130
131class MDB_ExpVehFac_Limit : public ScriptImpClass {
132 int Team;
133 void Created(GameObject *obj);
134 void Destroyed(GameObject *obj);
135 public: void Register_Auto_Save_Variables();
136};