WeaponsTypes.cpp matches

This commit is contained in:
Phillip Stephens
2026-01-08 16:26:33 -08:00
parent faf2edd1ca
commit d83ece42d8
3 changed files with 15 additions and 19 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class CPrimitive {
public:
CPrimitive(CInputStream& in);
void PutTo(COutputStream& out) const;
CAssetId GetAnimResId() const { return x0_animId; }
const CAssetId GetAnimResId() const { return x0_animId; }
private:
CAssetId x0_animId;
+6 -6
View File
@@ -36,8 +36,8 @@ public:
, x18_24_noImmunity(noImmunity) {}
// HACK: This constructor exists to fix CWeapon::Think writing xc_radiusDamage as a double
CDamageInfo(const CWeaponMode& mode, float damage, float radiusDamage, float radius, float knockback,
bool noImmunity = false)
CDamageInfo(const CWeaponMode& mode, float damage, float radiusDamage, float radius,
float knockback, bool noImmunity = false)
: x0_weaponMode(mode)
, x8_damage(damage)
, xc_radiusDamage(radiusDamage)
@@ -66,10 +66,10 @@ public:
float GetRadiusDamage(const CDamageVulnerability& dVuln) const;
bool NoImmunity() const { return x18_24_noImmunity; }
void SetNoImmunity(bool b) { x18_24_noImmunity = b; }
void MultiplyDamage(float m) {
x8_damage *= m;
xc_radiusDamage *= m;
x14_knockback *= m;
void MultiplyDamage(const float m) {
x8_damage = m * x8_damage;
xc_radiusDamage = m * xc_radiusDamage;
x14_knockback = m * x14_knockback;
}
void MultiplyDamageAndRadius(float m) {
x8_damage *= m;
+8 -12
View File
@@ -1,13 +1,14 @@
#include "MetroidPrime/Weapons/WeaponTypes.hpp"
#include "Kyoto/SObjectTag.hpp"
#include "MetroidPrime/Weapons/WeaponCommon.hpp"
#include "MetroidPrime/CAnimData.hpp"
#include "MetroidPrime/CAnimPlaybackParms.hpp"
#include "MetroidPrime/CStateManager.hpp"
#include "MetroidPrime/Player/CPlayerState.hpp"
#include "MetroidPrime/Player/CGameState.hpp"
#include "MetroidPrime/Weapons/CGunWeapon.hpp"
#include "MetroidPrime/Player/CPlayerState.hpp"
#include "MetroidPrime/Tweaks/CTweakPlayerGun.hpp"
#include "MetroidPrime/Weapons/CGunWeapon.hpp"
#include "Kyoto/Animation/CPrimitive.hpp"
#include "Kyoto/Audio/CSfxManager.hpp"
@@ -77,7 +78,7 @@ void primitive_set_to_token_vector(const CAnimData& animData,
tokensOut.reserve(primSet.size() + eventCount);
for (it = primSet.begin(); it != primSet.end(); ++it) {
int aId = it->GetAnimResId();
CAssetId aId = it->GetAnimResId();
int eId = animData.GetEventResourceIdForAnimResourceId(aId);
if (eId != -1) {
@@ -156,7 +157,7 @@ void do_sound_event(rstl::pair< u16, CSfxHandle >& sfxHandle, int& pitch, bool d
}
}
CSfxHandle play_sfx(u16 sfx, bool underwater, bool looped, short pan) {
CSfxHandle play_sfx(const ushort sfx, const bool underwater, const bool looped, const short pan) {
CSfxHandle hnd = CSfxManager::SfxStart(sfx, 0x7f, pan, true, CSfxManager::kMaxPriority, looped);
CSfxManager::SfxSpan(hnd, 0);
if (underwater)
@@ -174,13 +175,9 @@ CDamageInfo CGunWeapon::GetShotDamageInfo(const SShotParam& shotParam, CStateMan
// float knockback = shotParam.x14_knockback;
// bool noImmunity = shotParam.x18_24_noImmunity;
CDamageInfo result(
CWeaponMode(shotParam.x0_weaponType, 0),
shotParam.x8_damage,
shotParam.xc_radiusDamage,
shotParam.x10_radius,
shotParam.x14_knockback,
shotParam.x18_24_noImmunity);
CDamageInfo result(CWeaponMode(shotParam.x0_weaponType, 0), shotParam.x8_damage,
shotParam.xc_radiusDamage, shotParam.x10_radius, shotParam.x14_knockback,
shotParam.x18_24_noImmunity);
if (gpGameState->GetHardMode()) {
result.MultiplyDamage(gpGameState->GetHardModeWeaponMultiplier());
@@ -188,7 +185,6 @@ CDamageInfo CGunWeapon::GetShotDamageInfo(const SShotParam& shotParam, CStateMan
return result;
}
namespace NWeaponTypes {
int get_current_suit(const CStateManager& mgr) {