1
#ifndef WEAPONTYPE_EXT_H
2
#define WEAPONTYPE_EXT_H
5
#include <Helpers/Template.h>
7
#include <BombListClass.h>
8
#include <BulletClass.h>
9
#include <CCINIClass.h>
13
#include <RadSiteClass.h>
15
#include <WarheadTypeClass.h>
16
#include <WaveClass.h>
17
#include <WeaponTypeClass.h>
18
#include <ScenarioClass.h>
19
#include <MouseClass.h>
21
#include "../../Enum/RadTypes.h"
23
#include "../../Misc/Debug.h"
25
#include "../_Container.hpp"
27
#include "../../Utilities/Template.h"
34
typedef WeaponTypeClass TT;
35
class ExtData : public Extension<TT>
42
Customizable<ColorStruct> Beam_Color;
44
double Beam_Amplitude;
45
bool Beam_IsHouseColor;
48
Customizable<ColorStruct> Bolt_Color1;
49
Customizable<ColorStruct> Bolt_Color2;
50
Customizable<ColorStruct> Bolt_Color3;
53
bool Wave_IsHouseColor;
56
Customizable<ColorStruct> Wave_Color;
59
int Wave_InitialIntensity;
60
int Wave_IntensityStep;
61
int Wave_FinalIntensity;
64
bool Ivan_KillsBridges;
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;
76
// MouseCursor Cursor_Attack;
77
// bool Cursor_Custom;
79
ExtData(const DWORD Canary, TT* const OwnerObject) : Extension<TT>(Canary, OwnerObject),
80
Weapon_Loaded (false),
81
Beam_Color (&RulesClass::Instance->RadColor),
83
Beam_Amplitude (40.0),
84
Beam_IsHouseColor (false),
88
Wave_IsHouseColor (false),
90
Wave_IsBigLaser (false),
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),
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;
110
virtual size_t Size() const { return sizeof(*this); };
112
virtual void LoadFromINIFile(TT *pThis, CCINIClass *pINI);
113
virtual void Initialize(TT* pThis);
115
virtual void InvalidatePointer(void *ptr) {
116
AnnounceInvalidPointer(Rad_Type, ptr);
119
bool IsWave(WeaponTypeClass *pThis) {
120
return pThis->IsSonic || pThis->IsMagBeam || this->Wave_IsLaser || this->Wave_IsBigLaser;
130
bool operator < (const WeaponWeight &RHS) const {
131
return (this->InRange < RHS.InRange && this->DPF < RHS.DPF);
135
EXT_P_DECLARE(WeaponTypeClass);
136
EXT_FUNCS(WeaponTypeClass);
137
EXT_INI_FUNCS(WeaponTypeClass);
141
static Container<WeaponTypeExt> ExtMap;
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;
149
#define idxAircraft 1
150
#define idxBuilding 2
151
#define idxInfantry 3
154
static char AbsIDtoIdx(eAbstractType absId)
171
// @return skipNormalHandling?
172
static bool ModifyWaveColor(WORD *src, WORD *dst, int Intensity, WaveClass *Wave);
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;