2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2019-09-22 14:52:05 -07:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Weapon/CWeaponMode.hpp"
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
namespace metaforce {
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
enum class EVulnerability { Weak, Normal, Deflect, Immune, PassThrough, DirectWeak, DirectNormal, DirectImmune };
|
2019-07-16 08:54:07 -07:00
|
|
|
enum class EDeflectType { None, One, Two, Three, Four };
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CDamageVulnerability {
|
2021-05-08 20:14:38 -07:00
|
|
|
std::array<EVulnerability, 15> x0_normal;
|
|
|
|
std::array<EVulnerability, 4> x3c_charged;
|
|
|
|
std::array<EVulnerability, 4> x4c_combo;
|
2019-07-16 08:54:07 -07:00
|
|
|
EDeflectType x5c_deflected;
|
2020-04-25 22:02:02 -07:00
|
|
|
EDeflectType x60_chargedDeflected{};
|
|
|
|
EDeflectType x64_comboDeflected{};
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
void ConstructNew(CInputStream& in, int propCount);
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
static const CDamageVulnerability sNormalVulnerability;
|
|
|
|
static const CDamageVulnerability sImmuneVulnerability;
|
|
|
|
static const CDamageVulnerability sReflectVulnerability;
|
|
|
|
static const CDamageVulnerability sPassThroughVulnerability;
|
2017-02-28 19:42:06 -08:00
|
|
|
|
2016-04-18 17:17:49 -07:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CDamageVulnerability(CInputStream& in);
|
2020-04-25 22:02:02 -07:00
|
|
|
|
|
|
|
constexpr CDamageVulnerability(EVulnerability power, EVulnerability ice, EVulnerability wave, EVulnerability plasma,
|
|
|
|
EVulnerability bomb, EVulnerability powerBomb, EVulnerability missile,
|
|
|
|
EVulnerability boostBall, EVulnerability phazon, EVulnerability enemyWp1,
|
|
|
|
EVulnerability enemyWp2, EVulnerability enemyWp3, EVulnerability enemyWp4,
|
|
|
|
EVulnerability v1, EVulnerability v2, EDeflectType deflectType)
|
2021-05-29 05:18:06 -07:00
|
|
|
: x0_normal({power, ice, wave, plasma, bomb, powerBomb, missile, boostBall, phazon, enemyWp1, enemyWp2, enemyWp3,
|
|
|
|
enemyWp4, v1, v2})
|
2021-05-08 20:14:38 -07:00
|
|
|
, x3c_charged({x0_normal[0], x0_normal[1], x0_normal[2], x0_normal[3]})
|
|
|
|
, x4c_combo({x0_normal[0], x0_normal[1], x0_normal[2], x0_normal[3]})
|
2020-04-25 22:02:02 -07:00
|
|
|
, x5c_deflected(deflectType) {}
|
|
|
|
|
|
|
|
constexpr CDamageVulnerability(EVulnerability power, EVulnerability ice, EVulnerability wave, EVulnerability plasma,
|
|
|
|
EVulnerability bomb, EVulnerability powerBomb, EVulnerability missile,
|
|
|
|
EVulnerability boostBall, EVulnerability phazon, EVulnerability enemyWp1,
|
|
|
|
EVulnerability enemyWp2, EVulnerability enemyWp3, EVulnerability enemyWp4,
|
|
|
|
EVulnerability v1, EVulnerability v2, EVulnerability chargedPower,
|
|
|
|
EVulnerability chargedIce, EVulnerability chargedWave, EVulnerability chargedPlasma,
|
|
|
|
EVulnerability superMissile, EVulnerability iceSpreader, EVulnerability waveBuster,
|
|
|
|
EVulnerability flameThrower, EDeflectType deflected)
|
2021-05-29 05:18:06 -07:00
|
|
|
: x0_normal({power, ice, wave, plasma, bomb, powerBomb, missile, boostBall, phazon, enemyWp1, enemyWp2, enemyWp3,
|
|
|
|
enemyWp4, v1, v2})
|
2021-05-08 20:14:38 -07:00
|
|
|
, x3c_charged({chargedPower, chargedIce, chargedWave, chargedPlasma})
|
|
|
|
, x4c_combo({superMissile, iceSpreader, waveBuster, flameThrower})
|
2020-04-25 22:02:02 -07:00
|
|
|
, x5c_deflected(deflected) {}
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2019-07-16 08:54:07 -07:00
|
|
|
EDeflectType GetDeflectionType(const CWeaponMode& mode) const;
|
2016-04-18 17:17:49 -07:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
bool WeaponHurts(const CWeaponMode&, bool ignoreDirect) const;
|
|
|
|
bool WeaponHits(const CWeaponMode& mode, bool checkDirect) const;
|
|
|
|
EVulnerability GetVulnerability(const CWeaponMode& mode, bool ignoreDirect) const;
|
2017-02-28 19:42:06 -08:00
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
static const CDamageVulnerability& NormalVulnerabilty() { return sNormalVulnerability; }
|
|
|
|
static const CDamageVulnerability& ImmuneVulnerabilty() { return sImmuneVulnerability; }
|
|
|
|
static const CDamageVulnerability& ReflectVulnerabilty() { return sReflectVulnerability; }
|
2018-12-30 21:01:42 -08:00
|
|
|
static const CDamageVulnerability& PassThroughVulnerabilty() { return sPassThroughVulnerability; }
|
2021-05-29 05:18:33 -07:00
|
|
|
|
|
|
|
// Used in ImGuiEntitySupport
|
|
|
|
void ImGuiEditWindow(const char* title, bool& open);
|
2016-04-18 17:17:49 -07:00
|
|
|
};
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|