2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Weapon/CWeaponMode.hpp"
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EVulnerability { Weak, Normal, Deflect, Immune, PassThrough, DirectWeak, DirectNormal, DirectImmune };
|
2019-07-16 15:54:07 +00:00
|
|
|
enum class EDeflectType { None, One, Two, Three, Four };
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CDamageVulnerability {
|
|
|
|
EVulnerability x0_power;
|
|
|
|
EVulnerability x4_ice;
|
|
|
|
EVulnerability x8_wave;
|
|
|
|
EVulnerability xc_plasma;
|
|
|
|
EVulnerability x10_bomb;
|
|
|
|
EVulnerability x14_powerbomb;
|
|
|
|
EVulnerability x18_missile;
|
|
|
|
EVulnerability x1c_boostBall;
|
|
|
|
EVulnerability x20_phazon;
|
|
|
|
EVulnerability x24_enemyWp1;
|
|
|
|
EVulnerability x28_enemyWp2Poison;
|
|
|
|
EVulnerability x2c_enemyWp3Lava;
|
|
|
|
EVulnerability x30_enemyWp4;
|
|
|
|
EVulnerability x34_unk1;
|
|
|
|
EVulnerability x38_unk2;
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
EVulnerability x3c_chargedPower;
|
|
|
|
EVulnerability x40_chargedIce;
|
|
|
|
EVulnerability x44_chargedWave;
|
|
|
|
EVulnerability x48_chargedPlasma;
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
EVulnerability x4c_superMissile;
|
|
|
|
EVulnerability x50_iceSpreader;
|
|
|
|
EVulnerability x54_wavebuster;
|
|
|
|
EVulnerability x58_flamethrower;
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2019-07-16 15:54:07 +00:00
|
|
|
EDeflectType x5c_deflected;
|
2020-04-26 05:02:02 +00:00
|
|
|
EDeflectType x60_chargedDeflected{};
|
|
|
|
EDeflectType x64_comboDeflected{};
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
void ConstructNew(CInputStream& in, int propCount);
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static const CDamageVulnerability sNormalVulnerability;
|
|
|
|
static const CDamageVulnerability sImmuneVulnerability;
|
|
|
|
static const CDamageVulnerability sReflectVulnerability;
|
|
|
|
static const CDamageVulnerability sPassThroughVulnerability;
|
2017-03-01 03:42:06 +00:00
|
|
|
|
2016-04-19 00:17:49 +00:00
|
|
|
public:
|
2020-03-26 01:25:11 +00:00
|
|
|
explicit CDamageVulnerability(CInputStream& in);
|
2020-04-26 05:02:02 +00: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)
|
|
|
|
: x0_power(power)
|
|
|
|
, x4_ice(ice)
|
|
|
|
, x8_wave(wave)
|
|
|
|
, xc_plasma(plasma)
|
|
|
|
, x10_bomb(bomb)
|
|
|
|
, x14_powerbomb(powerBomb)
|
|
|
|
, x18_missile(missile)
|
|
|
|
, x1c_boostBall(boostBall)
|
|
|
|
, x20_phazon(phazon)
|
|
|
|
, x24_enemyWp1(enemyWp1)
|
|
|
|
, x28_enemyWp2Poison(enemyWp2)
|
|
|
|
, x2c_enemyWp3Lava(enemyWp3)
|
|
|
|
, x30_enemyWp4(enemyWp4)
|
|
|
|
, x34_unk1(v1)
|
|
|
|
, x38_unk2(v2)
|
|
|
|
, x3c_chargedPower(x0_power)
|
|
|
|
, x40_chargedIce(x4_ice)
|
|
|
|
, x44_chargedWave(x8_wave)
|
|
|
|
, x48_chargedPlasma(xc_plasma)
|
|
|
|
, x4c_superMissile(x0_power)
|
|
|
|
, x50_iceSpreader(x4_ice)
|
|
|
|
, x54_wavebuster(x8_wave)
|
|
|
|
, x58_flamethrower(xc_plasma)
|
|
|
|
, 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)
|
|
|
|
: x0_power(power)
|
|
|
|
, x4_ice(ice)
|
|
|
|
, x8_wave(wave)
|
|
|
|
, xc_plasma(plasma)
|
|
|
|
, x10_bomb(bomb)
|
|
|
|
, x14_powerbomb(powerBomb)
|
|
|
|
, x18_missile(missile)
|
|
|
|
, x1c_boostBall(boostBall)
|
|
|
|
, x20_phazon(phazon)
|
|
|
|
, x24_enemyWp1(enemyWp1)
|
|
|
|
, x28_enemyWp2Poison(enemyWp2)
|
|
|
|
, x2c_enemyWp3Lava(enemyWp3)
|
|
|
|
, x30_enemyWp4(enemyWp4)
|
|
|
|
, x34_unk1(v1)
|
|
|
|
, x38_unk2(v2)
|
|
|
|
, x3c_chargedPower(chargedPower)
|
|
|
|
, x40_chargedIce(chargedIce)
|
|
|
|
, x44_chargedWave(chargedWave)
|
|
|
|
, x48_chargedPlasma(chargedPlasma)
|
|
|
|
, x4c_superMissile(superMissile)
|
|
|
|
, x50_iceSpreader(iceSpreader)
|
|
|
|
, x54_wavebuster(waveBuster)
|
|
|
|
, x58_flamethrower(flameThrower)
|
|
|
|
, x5c_deflected(deflected) {}
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2019-07-16 15:54:07 +00:00
|
|
|
EDeflectType GetDeflectionType(const CWeaponMode& mode) const;
|
2016-04-19 00:17:49 +00:00
|
|
|
|
2018-12-08 05:30:43 +00: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-03-01 03:42:06 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static const CDamageVulnerability& NormalVulnerabilty() { return sNormalVulnerability; }
|
|
|
|
static const CDamageVulnerability& ImmuneVulnerabilty() { return sImmuneVulnerability; }
|
|
|
|
static const CDamageVulnerability& ReflectVulnerabilty() { return sReflectVulnerability; }
|
2018-12-31 05:01:42 +00:00
|
|
|
static const CDamageVulnerability& PassThroughVulnerabilty() { return sPassThroughVulnerability; }
|
2016-04-19 00:17:49 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|