Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ItemGroup>
<ClCompile Include="src\Commands\Commands.cpp" />
<ClCompile Include="src\Commands\Dummy.h" />
<ClCompile Include="src\Enum\RadTypes.cpp" />
<ClCompile Include="src\Enum\RadTypeClass.cpp" />
<ClCompile Include="src\Ext\Aircraft\Body.cpp" />
<ClCompile Include="src\Ext\Aircraft\Hooks.cpp" />
<ClCompile Include="src\Ext\Building\Body.cpp" />
Expand Down Expand Up @@ -76,7 +76,7 @@
<ClInclude Include="src\Commands\NextIdleHarvester.h" />
<ClInclude Include="src\Commands\ObjectInfo.h" />
<ClInclude Include="src\Commands\Commands.h" />
<ClInclude Include="src\Enum\RadTypes.h" />
<ClInclude Include="src\Enum\RadTypeClass.h" />
<ClInclude Include="src\Enum\_Enumerator.hpp" />
<ClInclude Include="src\ExtraHeaders\CCToolTip.h" />
<ClInclude Include="src\ExtraHeaders\Matrix3D.h" />
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho

- Fixed the bug when deploying mindcontrolled vehicle into a building permanently trasferred the control to the house which mindcontrolled it.
- Fixed the bug when units are already dead but still in map (for sinking, crashing, dying animation, etc.), they could die again.
- Fixed the bug when cloaked Desolator was unable to fire his deploy weapon.
- SHP debris shadows now respect the `Shadow` tag.
- Allowed usage of TileSet of 255 and above without making NE-SW broken bridges unrepairable.
- `TurretOffset` tag for voxel turreted technos now accepts FLH (forward, lateral, height) values like `TurretOffset=F,L` or `TurretOffset=F,L,H`, which means turret location can be adjusted in all three axes.
Expand Down
9 changes: 6 additions & 3 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ In `rulesmd.ini`:
Pips.Shield=-1,-1,-1 ; int, frames of pips.shp for Green, Yellow, Red
Pips.Shield.Building=-1,-1,-1 ; int, frames of pips.shp for Green, Yellow, Red

[SOMETECHNO] ; TechnoType
[SOMETECHNO] ; TechnoType
Shield.Strength=0 ; integer
Shield.Armor=none ; ArmorType
Shield.AbsorbOverDamage=false ; boolean
Expand Down Expand Up @@ -147,8 +147,10 @@ Strafing.SimulateBurst=false ; bool

In `rulesmd.ini`
```ini
[RadiationTypes]
0=SOMERADTYPE

[SOMEWEAPON] ; WeaponType
RadLevel=0 ; integer, vanilla tag; used to activate the feature
RadType=Radiation ; RadType to use instead
; of default [Radiation]

Expand All @@ -168,9 +170,10 @@ RadSiteWarhead=RadSite ; WarheadType

### Radiation enhancements

- Radiation now has owner by default, so any rad-kills will be scored.
- Radiation now has owner by default, so any rad-kills will be scored. This behaviour can be reverted by a corresponding tag.
- `AffectsAllies`, `AffectsOwner` and `AffectsEnemies` on `RadSiteWarhead` are respected.
- Currently the rad maker doesn't gain experience from kills, this may change in future.
- Radiation is now able to deal damage to Buildings. To enable set `RadApplicationDelay.Building` value more than 0.

In `rulesmd.ini`:
```ini
Expand Down
3 changes: 2 additions & 1 deletion docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Vanilla fixes:
- Fixed fatal errors when `Blowfish.dll` couldn't be registered in the system properly due to missing admin rights (by Belonit)
- Fix to take Burst into account for aircraft weapon shots beyond the first one (by Starkku)
- Fixed the bug when units are already dead but still in map (for sinking, crashing, dying animation, etc.), they could die again (by Uranusian)
- Fixed the bug when cloaked Desolator was unable to fire his deploy weapon (by Otamaa)

Phobos fixes:
- Properly rewritten a fix for mind-controlled vehicles deploying into buildings (by FS-21)
Expand Down Expand Up @@ -74,4 +75,4 @@ Vanilla fixes:
- `DeployToFire` vehicles won't lose target on deploy anymore (unfinished fix by DCoder)
- Fixed QWER hotkey tab switching not hiding the displayed tooltip as it should (by Belonit)
- Sidebar tooltips now can go over sidebar bounds (by Belonit)
- Lifted stupidly small limit for tooltip character amount (by Belonit)
- Lifted stupidly small limit for tooltip character amount (by Belonit)
80 changes: 80 additions & 0 deletions src/Enum/RadTypeClass.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#include "RadTypeClass.h"

#include <Utilities/TemplateDef.h>

#include <WarheadTypeClass.h>

Enumerable<RadTypeClass>::container_t Enumerable<RadTypeClass>::Array;

// pretty nice, eh
const char* Enumerable<RadTypeClass>::GetMainSection()
{
return "RadiationTypes";
}

void RadTypeClass::AddDefaults()
{
FindOrAllocate("Radiation");
}

void RadTypeClass::LoadListSection(CCINIClass * pINI)
{
for (int i = 0; i < pINI->GetKeyCount(GetMainSection()); ++i)
{
if (pINI->ReadString(GetMainSection(), pINI->GetKeyName(GetMainSection(), i), "", Phobos::readBuffer))
{
FindOrAllocate(Phobos::readBuffer);
Debug::Log("RadTypeClass :: LoadListSection check [%s] \n", Phobos::readBuffer);
}
}

for (auto &radType: Array)
radType->LoadFromINI(pINI);
}

void RadTypeClass::LoadFromINI(CCINIClass * pINI)
{
const char* section = this->Name;

INI_EX exINI(pINI);

this->RadWarhead.Read(exINI, section, "RadSiteWarhead", true);
this->RadSiteColor.Read(exINI, section, "RadColor");
this->DurationMultiple.Read(exINI, section, "RadDurationMultiple");
this->ApplicationDelay.Read(exINI, section, "RadApplicationDelay");
this->BuildingApplicationDelay.Read(exINI, section, "RadApplicationDelay.Building");
this->LevelMax.Read(exINI, section, "RadLevelMax");
this->LevelDelay.Read(exINI, section, "RadLevelDelay");
this->LightDelay.Read(exINI, section, "RadLightDelay");
this->LevelFactor.Read(exINI, section, "RadLevelFactor");
this->LightFactor.Read(exINI, section, "RadLightFactor");
this->TintFactor.Read(exINI, section, "RadTintFactor");
}

template <typename T>
void RadTypeClass::Serialize(T & Stm)
{
Stm
.Process(this->DurationMultiple)
.Process(this->ApplicationDelay)
.Process(this->LevelMax)
.Process(this->LevelDelay)
.Process(this->LightDelay)
.Process(this->BuildingApplicationDelay)
.Process(this->LevelFactor)
.Process(this->LightFactor)
.Process(this->TintFactor)
.Process(this->RadSiteColor)
.Process(this->RadWarhead)
;
};

void RadTypeClass::LoadFromStream(PhobosStreamReader & Stm)
{
this->Serialize(Stm);
}

void RadTypeClass::SaveToStream(PhobosStreamWriter & Stm)
{
this->Serialize(Stm);
}
109 changes: 109 additions & 0 deletions src/Enum/RadTypeClass.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#pragma once

#include "_Enumerator.hpp"
#include <Utilities/Template.h>
#include <Utilities/GeneralUtils.h>
#include <Ext/Rules/Body.h>

class WarheadTypeClass;

class RadTypeClass final : public Enumerable<RadTypeClass>
{
private:
Nullable<int> DurationMultiple;
Nullable<int> ApplicationDelay;
Nullable<int> BuildingApplicationDelay;
Nullable<double> LevelFactor;
Nullable<int> LevelMax;
Nullable<int> LevelDelay;
Nullable<int> LightDelay;
Nullable<WarheadTypeClass *> RadWarhead;
Nullable<ColorStruct> RadSiteColor;
Nullable<double> LightFactor;
Nullable<double> TintFactor;

public:

RadTypeClass(const char* const pTitle) : Enumerable<RadTypeClass>(pTitle),
LevelDelay(),
LightDelay(),
RadSiteColor(),
LevelMax(),
LevelFactor(),
LightFactor(),
TintFactor(),
RadWarhead(),
DurationMultiple(),
ApplicationDelay(),
BuildingApplicationDelay()
{ }

virtual ~RadTypeClass() override = default;

static void AddDefaults();

static void LoadListSection(CCINIClass * pINI);

WarheadTypeClass* GetWarhead() const
{
return this->RadWarhead.Get(RulesClass::Instance->RadSiteWarhead);
}

const ColorStruct& GetColor() const
{
return *this->RadSiteColor.GetEx(&RulesClass::Instance->RadColor);
}

int GetDurationMultiple() const
{
return this->DurationMultiple.Get(RulesClass::Instance->RadDurationMultiple);
}

int GetApplicationDelay() const
{
return this->ApplicationDelay.Get(RulesClass::Instance->RadApplicationDelay);
}

int GetBuildingApplicationDelay() const
{
return this->BuildingApplicationDelay.Get(RulesExt::Global()->RadApplicationDelay_Building);
}

int GetLevelMax() const
{
return this->LevelMax.Get(RulesClass::Instance->RadLevelMax);
}

int GetLevelDelay() const
{
return this->LevelDelay.Get(RulesClass::Instance->RadLevelDelay);
}

int GetLightDelay() const
{
return this->LightDelay.Get(RulesClass::Instance->RadLightDelay);
}

double GetLevelFactor() const
{
return this->LevelFactor.Get(RulesClass::Instance->RadLevelFactor);
}

double GetLightFactor() const
{
return this->LightFactor.Get(RulesClass::Instance->RadLightFactor);
}

double GetTintFactor() const
{
return this->TintFactor.Get(RulesClass::Instance->RadTintFactor);
}

virtual void LoadFromINI(CCINIClass *pINI) override;
virtual void LoadFromStream(PhobosStreamReader& Stm);
virtual void SaveToStream(PhobosStreamWriter& Stm);

private:
template <typename T>
void Serialize(T& Stm);
};
62 changes: 0 additions & 62 deletions src/Enum/RadTypes.cpp

This file was deleted.

49 changes: 0 additions & 49 deletions src/Enum/RadTypes.h

This file was deleted.

Loading