mirror of https://github.com/AxioDL/metaforce.git
Move weapon code to RuntimeWeapon
This commit is contained in:
parent
83f3e3d4f1
commit
be40ebc8db
|
@ -15,6 +15,7 @@ add_subdirectory(Graphics)
|
|||
add_subdirectory(Collision)
|
||||
add_subdirectory(Camera)
|
||||
add_subdirectory(World)
|
||||
add_subdirectory(Weapon)
|
||||
add_subdirectory(AutoMapper)
|
||||
add_subdirectory(GuiSys)
|
||||
add_subdirectory(Input)
|
||||
|
@ -46,6 +47,7 @@ add_library(RuntimeCommon
|
|||
${INPUT_SOURCES}
|
||||
${PARTICLE_SOURCES}
|
||||
${WORLD_SOURCES}
|
||||
${WEAPON_SOURCES}
|
||||
#CMemory.hpp CMemory.cpp
|
||||
ITweak.hpp
|
||||
IMain.hpp
|
||||
|
@ -59,7 +61,6 @@ add_library(RuntimeCommon
|
|||
CIOWin.hpp
|
||||
CIOWinManager.hpp CIOWinManager.cpp
|
||||
CStateManager.hpp CStateManager.cpp
|
||||
CWeaponMgr.hpp CWeaponMgr.cpp
|
||||
CFluidPlaneManager.hpp CFluidPlaneManager.cpp
|
||||
CGameState.hpp CGameState.cpp
|
||||
CScanDisplay.hpp CScanDisplay.cpp
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "Camera/CGameCamera.hpp"
|
||||
#include "Graphics/CBooRenderer.hpp"
|
||||
#include "CSortedLists.hpp"
|
||||
#include "CWeaponMgr.hpp"
|
||||
#include "Weapon/CWeaponMgr.hpp"
|
||||
#include "CFluidPlaneManager.hpp"
|
||||
#include "World/CEnvFxManager.hpp"
|
||||
#include "World/CActorModelParticles.hpp"
|
||||
|
@ -17,7 +17,7 @@
|
|||
#include "CPlayerState.hpp"
|
||||
#include "CGameState.hpp"
|
||||
#include "World/CPlayer.hpp"
|
||||
#include "World/CPlayerGun.hpp"
|
||||
#include "Weapon/CPlayerGun.hpp"
|
||||
#include "World/CMorphBall.hpp"
|
||||
#include "World/CScriptSpawnPoint.hpp"
|
||||
#include "AutoMapper/CMapWorldInfo.hpp"
|
||||
|
@ -492,14 +492,16 @@ void CStateManager::InformListeners(const zeus::CVector3f&, EListenNoiseType)
|
|||
{
|
||||
}
|
||||
|
||||
void CStateManager::ApplyKnockBack(CActor& actor, const CDamageInfo& info,
|
||||
bool CStateManager::ApplyKnockBack(CActor& actor, const CDamageInfo& info,
|
||||
const CDamageVulnerability&, const zeus::CVector3f&, float)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStateManager::ApplyDamageToWorld(TUniqueId, const CActor&, const zeus::CVector3f&,
|
||||
bool CStateManager::ApplyDamageToWorld(TUniqueId, const CActor&, const zeus::CVector3f&,
|
||||
const CDamageInfo& info, const CMaterialFilter&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStateManager::ProcessRadiusDamage(const CActor&, CActor&, const zeus::CVector3f&,
|
||||
|
@ -507,19 +509,46 @@ void CStateManager::ProcessRadiusDamage(const CActor&, CActor&, const zeus::CVec
|
|||
{
|
||||
}
|
||||
|
||||
void CStateManager::ApplyRadiusDamage(const CActor&, const zeus::CVector3f&, CActor&,
|
||||
bool CStateManager::ApplyRadiusDamage(const CActor&, const zeus::CVector3f&, CActor&,
|
||||
const CDamageInfo& info)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStateManager::ApplyLocalDamage(const zeus::CVector3f&, const zeus::CVector3f&, CActor&, float,
|
||||
const CWeaponMode&)
|
||||
bool CStateManager::ApplyLocalDamage(const zeus::CVector3f& vec1, const zeus::CVector3f& vec2, CActor& actor, float dt,
|
||||
const CWeaponMode& weapMode)
|
||||
{
|
||||
CHealthInfo* hInfo = actor.HealthInfo();
|
||||
if (!hInfo || dt < 0.f)
|
||||
return false;
|
||||
|
||||
if (hInfo->GetHP() <= 0.f)
|
||||
return true;
|
||||
|
||||
float f30 = dt;
|
||||
|
||||
CPlayer* player = dynamic_cast<CPlayer*>(&actor);
|
||||
CAi* ai = dynamic_cast<CAi*>(&actor);
|
||||
#if 0
|
||||
CDestroyableRock* dRock = nullptr;
|
||||
if (!ai)
|
||||
dynamic_cast<CDestroyableRock*>(&actor);
|
||||
#endif
|
||||
|
||||
if (player)
|
||||
{
|
||||
if (x870_cameraManager->IsInCinematicCamera())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStateManager::ApplyDamage(TUniqueId, TUniqueId, TUniqueId, const CDamageInfo& info,
|
||||
bool CStateManager::ApplyDamage(TUniqueId, TUniqueId, TUniqueId, const CDamageInfo& info,
|
||||
const CMaterialFilter&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStateManager::UpdateAreaSounds()
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include "Camera/CCameraFilter.hpp"
|
||||
#include "CRandom16.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "CWeaponMgr.hpp"
|
||||
#include "Weapon/CWeaponMgr.hpp"
|
||||
#include "World/CAi.hpp"
|
||||
#include "CToken.hpp"
|
||||
#include "World/ScriptLoader.hpp"
|
||||
|
@ -224,17 +224,17 @@ public:
|
|||
void LoadScriptObject(TAreaId, EScriptObjectType, u32, CInputStream& in);
|
||||
void InitScriptObjects(std::vector<TEditorId>& ids);
|
||||
void InformListeners(const zeus::CVector3f&, EListenNoiseType);
|
||||
void ApplyKnockBack(CActor& actor, const CDamageInfo& info,
|
||||
bool ApplyKnockBack(CActor& actor, const CDamageInfo& info,
|
||||
const CDamageVulnerability&, const zeus::CVector3f&, float);
|
||||
void ApplyDamageToWorld(TUniqueId, const CActor&, const zeus::CVector3f&,
|
||||
bool ApplyDamageToWorld(TUniqueId, const CActor&, const zeus::CVector3f&,
|
||||
const CDamageInfo& info, const CMaterialFilter&);
|
||||
void ProcessRadiusDamage(const CActor&, CActor&, const zeus::CVector3f&,
|
||||
const CDamageInfo& info, const CMaterialFilter&);
|
||||
void ApplyRadiusDamage(const CActor&, const zeus::CVector3f&, CActor&,
|
||||
bool ApplyRadiusDamage(const CActor&, const zeus::CVector3f&, CActor&,
|
||||
const CDamageInfo& info);
|
||||
void ApplyLocalDamage(const zeus::CVector3f&, const zeus::CVector3f&, CActor&, float,
|
||||
bool ApplyLocalDamage(const zeus::CVector3f&, const zeus::CVector3f&, CActor&, float,
|
||||
const CWeaponMode&);
|
||||
void ApplyDamage(TUniqueId, TUniqueId, TUniqueId, const CDamageInfo& info,
|
||||
bool ApplyDamage(TUniqueId, TUniqueId, TUniqueId, const CDamageInfo& info,
|
||||
const CMaterialFilter&);
|
||||
void UpdateAreaSounds();
|
||||
void FrameEnd();
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
set(WEAPON_SOURCES
|
||||
CWeaponMgr.hpp CWeaponMgr.cpp
|
||||
CGunController.hpp CGunController.cpp
|
||||
CGunMotion.hpp CGunMotion.cpp
|
||||
CGrappleArm.hpp CGrappleArm.cpp
|
||||
CWeaponMode.hpp CWeaponMode.cpp
|
||||
CPlayerGun.hpp CPlayerGun.cpp
|
||||
CGunWeapon.hpp CGunWeapon.cpp
|
||||
CAuxWeapon.hpp CAuxWeapon.cpp
|
||||
CPowerBeam.hpp CPowerBeam.cpp
|
||||
CIceBeam.hpp CIceBeam.cpp
|
||||
CWaveBeam.hpp CWaveBeam.cpp
|
||||
CPlasmaBeam.hpp CPlasmaBeam.cpp
|
||||
CPhazonBeam.hpp CPhazonBeam.cpp
|
||||
CGSFreeLook.hpp CGSFreeLook.cpp
|
||||
CGSComboFire.hpp CGSComboFire.cpp
|
||||
CGSFidget.hpp CGSFidget.cpp
|
||||
CFidget.hpp CFidget.cpp)
|
||||
|
||||
runtime_add_list(Weapon WEAPON_SOURCES)
|
|
@ -6,7 +6,7 @@
|
|||
#include "CFidget.hpp"
|
||||
#include "zeus/CTransform.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "CPlayerCameraBob.hpp"
|
||||
#include "World/CPlayerCameraBob.hpp"
|
||||
#include "CGunMotion.hpp"
|
||||
#include "CGrappleArm.hpp"
|
||||
#include "CAuxWeapon.hpp"
|
||||
|
@ -17,7 +17,7 @@
|
|||
#include "CPhazonBeam.hpp"
|
||||
#include "Particle/CElementGen.hpp"
|
||||
#include "Character/CModelData.hpp"
|
||||
#include "CWorldShadow.hpp"
|
||||
#include "World/CWorldShadow.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
|
@ -1,6 +1,8 @@
|
|||
#ifndef __URDE_CWEAPONMGR_HPP__
|
||||
#define __URDE_CWEAPONMGR_HPP__
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
#include "CWeaponMode.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
CWeaponMode::CWeaponMode(EWeaponType type, bool, bool)
|
||||
: x0_weaponType(type)
|
||||
{
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Invalid()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::None, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Phazon()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Phazon, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Plasma()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Plasma, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Wave()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Wave, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::BoostBall()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::BoostBall, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Ice()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Ice, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Power()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Power, false, false);
|
||||
}
|
||||
|
||||
CWeaponMode CWeaponMode::Bomb()
|
||||
{
|
||||
return CWeaponMode(EWeaponType::Bomb, false, false);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef __URDE_CWEAPONMODE_HPP__
|
||||
#define __URDE_CWEAPONMODE_HPP__
|
||||
|
||||
#include "CWeaponMgr.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
class CWeaponMode
|
||||
{
|
||||
EWeaponType x0_weaponType;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool x4_24_ : 1;
|
||||
bool x4_25_ : 1;
|
||||
bool x4_26_instantKill : 1;
|
||||
};
|
||||
u8 dummy = 0;
|
||||
};
|
||||
public:
|
||||
CWeaponMode(EWeaponType, bool, bool);
|
||||
EWeaponType GetType() const;
|
||||
|
||||
|
||||
bool IsCharged() const;
|
||||
bool IsComboed() const;
|
||||
bool IsInstantKill() const;
|
||||
|
||||
static CWeaponMode Invalid();
|
||||
static CWeaponMode Phazon();
|
||||
static CWeaponMode Plasma();
|
||||
static CWeaponMode Wave();
|
||||
static CWeaponMode BoostBall();
|
||||
static CWeaponMode Ice();
|
||||
static CWeaponMode Power();
|
||||
static CWeaponMode Bomb();
|
||||
};
|
||||
}
|
||||
#endif // __URDE_CWEAPONMODE_HPP__
|
|
@ -100,7 +100,7 @@ void CActor::CalculateRenderBounds()
|
|||
x9c_aabox = zeus::CAABox(x34_transform.origin, x34_transform.origin);
|
||||
}
|
||||
|
||||
const CHealthInfo* CActor::GetHealthInfo() const
|
||||
CHealthInfo* CActor::HealthInfo()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -178,18 +178,18 @@ void CActor::FluidFXThink(CActor::EFluidState, CScriptWater &, CStateManager &)
|
|||
|
||||
void CActor::OnScanStateChanged(EScanState state, CStateManager& mgr)
|
||||
{
|
||||
if (state == EScanState::Zero)
|
||||
SendScriptMsgs(EScriptObjectState::UNKS7, mgr, EScriptObjectMessage::None);
|
||||
else if (state == EScanState::One)
|
||||
SendScriptMsgs(EScriptObjectState::UNKS8, mgr, EScriptObjectMessage::None);
|
||||
else if (state == EScanState::Two)
|
||||
if (state == EScanState::Start)
|
||||
SendScriptMsgs(EScriptObjectState::ScanStart, mgr, EScriptObjectMessage::None);
|
||||
else if (state == EScanState::Processing)
|
||||
SendScriptMsgs(EScriptObjectState::ScanProcessing, mgr, EScriptObjectMessage::None);
|
||||
else if (state == EScanState::Done)
|
||||
SendScriptMsgs(EScriptObjectState::ScanDone, mgr, EScriptObjectMessage::None);
|
||||
|
||||
}
|
||||
|
||||
zeus::CAABox CActor::GetSortingBounds(const CStateManager &) const
|
||||
{
|
||||
return {};
|
||||
return x9c_aabox;
|
||||
}
|
||||
|
||||
void CActor::DoUserAnimEvent(CStateManager &, CInt32POINode &, EUserEventType)
|
||||
|
|
|
@ -75,9 +75,9 @@ public:
|
|||
|
||||
enum class EScanState
|
||||
{
|
||||
Zero,
|
||||
One,
|
||||
Two,
|
||||
Start,
|
||||
Processing,
|
||||
Done,
|
||||
};
|
||||
|
||||
CActor(TUniqueId, bool, const std::string&, const CEntityInfo&,
|
||||
|
@ -98,7 +98,7 @@ public:
|
|||
virtual void Render(const CStateManager&) const {}
|
||||
virtual bool CanRenderUnsorted(const CStateManager&) const { return false; }
|
||||
virtual void CalculateRenderBounds();
|
||||
virtual const CHealthInfo* GetHealthInfo() const;
|
||||
virtual CHealthInfo* HealthInfo();
|
||||
virtual const CDamageVulnerability* GetDamageVulnerability() const;
|
||||
virtual const CDamageVulnerability* GetDamageVulnerability(const zeus::CVector3f&, const zeus::CVector3f&, const CDamageInfo&) const;
|
||||
virtual rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
|
||||
|
|
|
@ -40,8 +40,7 @@ public:
|
|||
const CStateMachine* GetStateMachine() const;
|
||||
|
||||
virtual void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) {}
|
||||
virtual CHealthInfo HealthInfo(CStateManager&) { return x258_healthInfo; }
|
||||
virtual CHealthInfo GetHealthInfo(const CStateManager&) { return x258_healthInfo; }
|
||||
virtual CHealthInfo* HealthInfo() { return &x258_healthInfo; }
|
||||
virtual void Death(const zeus::CVector3f&, CStateManager&)=0;
|
||||
virtual void KnockBack(const zeus::CVector3f&, CStateManager&)=0;
|
||||
virtual CDamageVulnerability GetDamageVulnerability() { return x260_damageVulnerability; }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __URDE_CDAMAGEINFO_HPP__
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
#include "CWeaponMgr.hpp"
|
||||
#include "Weapon/CWeaponMgr.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
|
|
|
@ -7,21 +7,6 @@ set(WORLD_SOURCES
|
|||
CPlayerEnergyDrain.hpp CPlayerEnergyDrain.cpp
|
||||
CEnergyDrainSource.hpp CEnergyDrainSource.cpp
|
||||
CPlayerCameraBob.hpp CPlayerCameraBob.cpp
|
||||
CPlayerGun.hpp CPlayerGun.cpp
|
||||
CGunWeapon.hpp CGunWeapon.cpp
|
||||
CAuxWeapon.hpp CAuxWeapon.cpp
|
||||
CPowerBeam.hpp CPowerBeam.cpp
|
||||
CIceBeam.hpp CIceBeam.cpp
|
||||
CWaveBeam.hpp CWaveBeam.cpp
|
||||
CPlasmaBeam.hpp CPlasmaBeam.cpp
|
||||
CPhazonBeam.hpp CPhazonBeam.cpp
|
||||
CGunMotion.hpp CGunMotion.cpp
|
||||
CGrappleArm.hpp CGrappleArm.cpp
|
||||
CGunController.hpp CGunController.cpp
|
||||
CGSFreeLook.hpp CGSFreeLook.cpp
|
||||
CGSComboFire.hpp CGSComboFire.cpp
|
||||
CGSFidget.hpp CGSFidget.cpp
|
||||
CFidget.hpp CFidget.cpp
|
||||
CMorphBall.hpp CMorphBall.cpp
|
||||
CActor.hpp CActor.cpp
|
||||
CAi.hpp CAi.cpp
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "CPlayer.hpp"
|
||||
#include "CActorParameters.hpp"
|
||||
#include "CMorphBall.hpp"
|
||||
#include "CPlayerGun.hpp"
|
||||
#include "Weapon/CPlayerGun.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
#include "CSimplePool.hpp"
|
||||
#include "GameGlobalObjects.hpp"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "CPhysicsActor.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "zeus/CTransform.hpp"
|
||||
#include "CWeaponMgr.hpp"
|
||||
#include "Weapon/CWeaponMgr.hpp"
|
||||
#include "CPlayerEnergyDrain.hpp"
|
||||
|
||||
namespace urde
|
||||
|
|
|
@ -54,6 +54,7 @@ void CScriptWater::CalculateRenderBounds()
|
|||
|
||||
zeus::CAABox CScriptWater::GetSortingBounds(const CStateManager&) const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
EWeaponCollisionResponseTypes CScriptWater::GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&, int)
|
||||
|
|
|
@ -165,8 +165,8 @@ enum class EScriptObjectState
|
|||
UNKS6,
|
||||
UNKS5,
|
||||
Modify,
|
||||
UNKS7,
|
||||
UNKS8,
|
||||
ScanStart,
|
||||
ScanProcessing,
|
||||
ScanDone,
|
||||
UNKS9,
|
||||
DFST,
|
||||
|
|
Loading…
Reference in New Issue