~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to Ext/WeaponType/Body.h

  • Committer: Renegade
  • Date: 2010-05-29 08:12:17 UTC
  • Revision ID: git-v1:0a1bb6321f04d723afe64d1b843dc87b4da783ec
Creating /trunk/src.

git-svn-id: svn://svn.renegadeprojects.com/ares/trunk@622 859b54a9-7a54-0410-aeb3-f8d2f1fa40fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef WEAPONTYPE_EXT_H
2
 
#define WEAPONTYPE_EXT_H
3
 
 
4
 
#include <xcompile.h>
5
 
#include <Helpers/Template.h>
6
 
#include <BombClass.h>
7
 
#include <BombListClass.h>
8
 
#include <BulletClass.h>
9
 
#include <CCINIClass.h>
10
 
#include <Drawing.h>
11
 
#include <EBolt.h>
12
 
#include <RadBeam.h>
13
 
#include <RadSiteClass.h>
14
 
#include <VocClass.h>
15
 
#include <WarheadTypeClass.h>
16
 
#include <WaveClass.h>
17
 
#include <WeaponTypeClass.h>
18
 
#include <ScenarioClass.h>
19
 
#include <MouseClass.h>
20
 
 
21
 
#include "../../Enum/RadTypes.h"
22
 
 
23
 
#include "../../Misc/Debug.h"
24
 
 
25
 
#include "../_Container.hpp"
26
 
 
27
 
#include "../../Utilities/Template.h"
28
 
 
29
 
struct SHPStruct;
30
 
 
31
 
class WeaponTypeExt
32
 
{
33
 
public:
34
 
        typedef WeaponTypeClass TT;
35
 
        class ExtData : public Extension<TT>
36
 
        {
37
 
        public:
38
 
                // Generic
39
 
                bool Weapon_Loaded;
40
 
 
41
 
                // Coloured Rad Beams
42
 
                Customizable<ColorStruct> Beam_Color;
43
 
                int    Beam_Duration;
44
 
                double Beam_Amplitude;
45
 
                bool   Beam_IsHouseColor;
46
 
 
47
 
                // Coloured EBolts
48
 
                Customizable<ColorStruct> Bolt_Color1;
49
 
                Customizable<ColorStruct> Bolt_Color2;
50
 
                Customizable<ColorStruct> Bolt_Color3;
51
 
 
52
 
                // TS Lasers
53
 
                bool   Wave_IsHouseColor;
54
 
                bool   Wave_IsLaser;
55
 
                bool   Wave_IsBigLaser;
56
 
                Customizable<ColorStruct> Wave_Color;
57
 
                bool   Wave_Reverse[5];
58
 
/*
59
 
                int    Wave_InitialIntensity;
60
 
                int    Wave_IntensityStep;
61
 
                int    Wave_FinalIntensity;
62
 
*/
63
 
                // custom Ivan Bombs
64
 
                bool Ivan_KillsBridges;
65
 
                bool Ivan_Detachable;
66
 
                Customizable<int> Ivan_Damage;
67
 
                Customizable<int> Ivan_Delay;
68
 
                Customizable<int> Ivan_TickingSound;
69
 
                Customizable<int> Ivan_AttachSound;
70
 
                Customizable<WarheadTypeClass *> Ivan_WH;
71
 
                Customizable<SHPStruct *> Ivan_Image;
72
 
                Customizable<int> Ivan_FlickerRate;
73
 
 
74
 
                RadType * Rad_Type;
75
 
 
76
 
//              MouseCursor Cursor_Attack;
77
 
//              bool Cursor_Custom;
78
 
 
79
 
                ExtData(const DWORD Canary, TT* const OwnerObject) : Extension<TT>(Canary, OwnerObject),
80
 
                        Weapon_Loaded (false),
81
 
                        Beam_Color (&RulesClass::Instance->RadColor),
82
 
                        Beam_Duration (15),
83
 
                        Beam_Amplitude (40.0),
84
 
                        Beam_IsHouseColor (false),
85
 
                        Bolt_Color1 (NULL),
86
 
                        Bolt_Color2 (NULL),
87
 
                        Bolt_Color3 (NULL),
88
 
                        Wave_IsHouseColor (false),
89
 
                        Wave_IsLaser (false),
90
 
                        Wave_IsBigLaser (false),
91
 
                        Wave_Color (NULL),
92
 
                        Ivan_KillsBridges (true),
93
 
                        Ivan_Detachable (true),
94
 
                        Ivan_Damage (&RulesClass::Instance->IvanDamage),
95
 
                        Ivan_Delay (&RulesClass::Instance->IvanTimedDelay),
96
 
                        Ivan_TickingSound (&RulesClass::Instance->BombTickingSound),
97
 
                        Ivan_AttachSound (&RulesClass::Instance->BombAttachSound),
98
 
                        Ivan_WH (&RulesClass::Instance->IvanWarhead),
99
 
                        Ivan_Image (&RulesClass::Instance->BOMBCURS_SHP),
100
 
                        Ivan_FlickerRate (&RulesClass::Instance->IvanIconFlickerRate),
101
 
                        Rad_Type (NULL)
102
 
                        {
103
 
//                              this->Beam_Color = ColorStruct(255, 255, 255);
104
 
//                              this->Wave_Color = ColorStruct(255, 255, 255);
105
 
                                for(int i = 0; i < 5; ++i) {
106
 
                                        this->Wave_Reverse[i] = false;
107
 
                                }
108
 
                        };
109
 
 
110
 
                virtual size_t Size() const { return sizeof(*this); };
111
 
 
112
 
                virtual void LoadFromINIFile(TT *pThis, CCINIClass *pINI);
113
 
                virtual void Initialize(TT* pThis);
114
 
 
115
 
                virtual void InvalidatePointer(void *ptr) {
116
 
                        AnnounceInvalidPointer(Rad_Type, ptr);
117
 
                }
118
 
 
119
 
                bool IsWave(WeaponTypeClass *pThis) {
120
 
                        return pThis->IsSonic || pThis->IsMagBeam || this->Wave_IsLaser || this->Wave_IsBigLaser;
121
 
                }
122
 
        };
123
 
 
124
 
/*
125
 
        struct WeaponWeight
126
 
        {
127
 
                short index;
128
 
                bool InRange;
129
 
                float DPF;
130
 
                bool operator < (const WeaponWeight &RHS) const {
131
 
                        return (this->InRange < RHS.InRange && this->DPF < RHS.DPF);
132
 
                }
133
 
        };
134
 
 
135
 
        EXT_P_DECLARE(WeaponTypeClass);
136
 
        EXT_FUNCS(WeaponTypeClass);
137
 
        EXT_INI_FUNCS(WeaponTypeClass);
138
 
 
139
 
*/
140
 
 
141
 
        static Container<WeaponTypeExt> ExtMap;
142
 
 
143
 
        static hash_map<BombClass *, ExtData *> BombExt;
144
 
        static hash_map<WaveClass *, ExtData *> WaveExt;
145
 
        static hash_map<EBolt *, ExtData *> BoltExt;
146
 
        static hash_map<RadSiteClass *, ExtData *> RadSiteExt;
147
 
 
148
 
#define idxVehicle 0
149
 
#define idxAircraft 1
150
 
#define idxBuilding 2
151
 
#define idxInfantry 3
152
 
#define idxOther 4
153
 
 
154
 
        static char AbsIDtoIdx(eAbstractType absId)
155
 
                {
156
 
                        switch(absId)
157
 
                        {
158
 
                                case abs_Unit:
159
 
                                        return idxVehicle;
160
 
                                case abs_Aircraft:
161
 
                                        return idxAircraft;
162
 
                                case abs_Building:
163
 
                                        return idxBuilding;
164
 
                                case abs_Infantry:
165
 
                                        return idxInfantry;
166
 
                                default:
167
 
                                        return idxOther;
168
 
                        }
169
 
                };
170
 
 
171
 
        // @return skipNormalHandling?
172
 
        static bool ModifyWaveColor(WORD *src, WORD *dst, int Intensity, WaveClass *Wave);
173
 
};
174
 
 
175
 
typedef hash_map<BombClass *, WeaponTypeExt::ExtData *> hash_bombExt;
176
 
typedef hash_map<WaveClass *, WeaponTypeExt::ExtData *> hash_waveExt;
177
 
typedef hash_map<EBolt *, WeaponTypeExt::ExtData *> hash_boltExt;
178
 
typedef hash_map<RadSiteClass *, WeaponTypeExt::ExtData *> hash_radsiteExt;
179
 
 
180
 
#endif