Work on CBabygoth

This commit is contained in:
Jack Andersen 2019-06-29 21:29:49 -10:00
parent d1e97dd821
commit 003146f614
12 changed files with 723 additions and 360 deletions

View File

@ -14,89 +14,89 @@ struct Babygoth : IScriptObject {
Value<atVec3f> scale;
PatternedInfo patternedInfo;
ActorParameters actorParameters;
Value<float> unknown1;
Value<float> unknown2;
UniqueID32 wpsc1;
DamageInfo damageInfo1;
DamageInfo damageInfo2;
UniqueID32 wpsc2;
UniqueID32 particle1;
DamageInfo damageInfo3;
DamageVulnerability damageVulnerabilty1;
DamageVulnerability damageVulnerabilty2;
UniqueID32 cmdlShelless;
UniqueID32 cskrShelless;
Value<float> unknown3;
Value<atUint32> unknown4;
UniqueID32 particle2;
UniqueID32 particle3;
UniqueID32 particle4;
UniqueID32 particle5;
Value<atUint32> unknown5;
Value<atUint32> unknown6;
Value<atUint32> unknown7;
Value<float> unknown8;
Value<float> unknown9;
Value<float> unknown10;
UniqueID32 texture;
Value<atUint32> unknown11;
UniqueID32 particle6;
Value<float> fireballAttackTime;
Value<float> fireballAttackTimeVariance;
UniqueID32 fireballWeapon;
DamageInfo fireballDamage;
DamageInfo attackContactDamage;
UniqueID32 fireBreathWeapon;
UniqueID32 fireBreathRes;
DamageInfo fireBreathDamage;
DamageVulnerability mouthVulnerabilities;
DamageVulnerability shellVulnerabilities;
UniqueID32 noShellModel;
UniqueID32 noShellSkin;
Value<float> shellHitPoints;
Value<atUint32> shellCrackSfx;
UniqueID32 intermediateCrackParticle;
UniqueID32 crackOneParticle;
UniqueID32 crackTwoParticle;
UniqueID32 destroyShellParticle;
Value<atUint32> crackOneSfx;
Value<atUint32> crackTwoSfx;
Value<atUint32> destroyShellSfx;
Value<float> timeUntilAttack;
Value<float> attackCooldownTime;
Value<float> interestTime;
UniqueID32 flamePlayerSteamTxtr;
Value<atUint32> flamePlayerHitSfx;
UniqueID32 flamePlayerIceTxtr;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const {
UniqueID32 cinf = patternedInfo.animationParameters.getCINF(pakRouter);
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, patternedInfo.animationParameters);
if (cmdlShelless && cskrShelless) {
charAssoc.m_cmdlRigs[cmdlShelless] = std::make_pair(cskrShelless, cinf);
charAssoc.m_cskrCinfToCharacter[cskrShelless] =
if (noShellModel && noShellSkin) {
charAssoc.m_cmdlRigs[noShellModel] = std::make_pair(noShellSkin, cinf);
charAssoc.m_cskrCinfToCharacter[noShellSkin] =
std::make_pair(patternedInfo.animationParameters.animationCharacterSet, "ATTACH.SHELLESS.CSKR");
charAssoc.addAttachmentRig(patternedInfo.animationParameters.animationCharacterSet, {}, cmdlShelless, "SHELLESS");
charAssoc.addAttachmentRig(patternedInfo.animationParameters.animationCharacterSet, {}, noShellModel, "SHELLESS");
}
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
if (wpsc1) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc1);
if (fireballWeapon) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireballWeapon);
ent->name = name + "_wpsc1";
}
if (wpsc2) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(wpsc2);
if (fireBreathWeapon) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireBreathWeapon);
ent->name = name + "_wpsc2";
}
if (particle1) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1);
if (fireBreathRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(fireBreathRes);
ent->name = name + "_part1";
}
if (cmdlShelless) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(cmdlShelless);
if (noShellModel) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(noShellModel);
ent->name = name + "_emodel";
}
if (cskrShelless) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(cskrShelless);
if (noShellSkin) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(noShellSkin);
ent->name = name + "_eskin";
}
if (particle2) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2);
if (intermediateCrackParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(intermediateCrackParticle);
ent->name = name + "_part2";
}
if (particle3) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3);
if (crackOneParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(crackOneParticle);
ent->name = name + "_part3";
}
if (particle4) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4);
if (crackTwoParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(crackTwoParticle);
ent->name = name + "_part4";
}
if (particle5) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5);
if (destroyShellParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(destroyShellParticle);
ent->name = name + "_part5";
}
if (texture) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(texture);
if (flamePlayerSteamTxtr) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(flamePlayerSteamTxtr);
ent->name = name + "_tex";
}
if (particle6) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6);
if (flamePlayerIceTxtr) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(flamePlayerIceTxtr);
ent->name = name + "_part6";
}
patternedInfo.nameIDs(pakRouter, name + "_patterned");
@ -104,17 +104,17 @@ struct Babygoth : IScriptObject {
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const {
g_curSpec->flattenDependencies(wpsc1, pathsOut);
g_curSpec->flattenDependencies(wpsc2, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut);
g_curSpec->flattenDependencies(cmdlShelless, pathsOut);
g_curSpec->flattenDependencies(cskrShelless, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut);
g_curSpec->flattenDependencies(particle3, pathsOut);
g_curSpec->flattenDependencies(particle4, pathsOut);
g_curSpec->flattenDependencies(particle5, pathsOut);
g_curSpec->flattenDependencies(texture, pathsOut);
g_curSpec->flattenDependencies(particle6, pathsOut);
g_curSpec->flattenDependencies(fireballWeapon, pathsOut);
g_curSpec->flattenDependencies(fireBreathWeapon, pathsOut);
g_curSpec->flattenDependencies(fireBreathRes, pathsOut);
g_curSpec->flattenDependencies(noShellModel, pathsOut);
g_curSpec->flattenDependencies(noShellSkin, pathsOut);
g_curSpec->flattenDependencies(intermediateCrackParticle, pathsOut);
g_curSpec->flattenDependencies(crackOneParticle, pathsOut);
g_curSpec->flattenDependencies(crackTwoParticle, pathsOut);
g_curSpec->flattenDependencies(destroyShellParticle, pathsOut);
g_curSpec->flattenDependencies(flamePlayerSteamTxtr, pathsOut);
g_curSpec->flattenDependencies(flamePlayerIceTxtr, pathsOut);
patternedInfo.depIDs(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut);
}

View File

@ -5,7 +5,7 @@ add_library(NESEmulator CNESEmulator.hpp CNESEmulator.cpp CNESShader.hpp CNESSha
fixNES/mapper.c fixNES/mapperList.c fixNES/fm2play.c fixNES/vrc_irq.c ${MAPPER_SRCS})
target_include_directories(NESEmulator PRIVATE ${CMAKE_SOURCE_DIR}/DataSpec ${CMAKE_SOURCE_DIR}/Runtime
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_definitions(NESEmulator PRIVATE COL_32BIT=1)
target_compile_definitions(NESEmulator PRIVATE COL_32BIT=1 COL_TEX_BSWAP=1)
target_link_libraries(NESEmulator boo hecl-full RuntimeCommon ${HECL_APPLICATION_REPS_TARGETS_LIST})
if (NOT MSVC)
target_compile_options(NESEmulator PRIVATE -Wno-implicit-fallthrough -Wno-format -Wno-pointer-compare

View File

@ -264,13 +264,23 @@ void CNESEmulator::InitializeEmulator() {
// Nearest-neighbor FTW!
m_texture = ctx.newDynamicTexture(VISIBLE_DOTS, linesToDraw, boo::TextureFormat::RGBA8,
boo::TextureClampMode::ClampToEdgeNearest);
Vert verts[4] = {
{{-1.f, -1.f, 0.f}, {0.f, 1.f}},
{{-1.f, 1.f, 0.f}, {0.f, 0.f}},
{{1.f, -1.f, 0.f}, {1.f, 1.f}},
{{1.f, 1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
if (ctx.platform() == boo::IGraphicsDataFactory::Platform::OpenGL) {
Vert verts[4] = {
{{-1.f, -1.f, 0.f}, {0.f, 1.f}},
{{-1.f, 1.f, 0.f}, {0.f, 0.f}},
{{1.f, -1.f, 0.f}, {1.f, 1.f}},
{{1.f, 1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
} else {
Vert verts[4] = {
{{-1.f, 1.f, 0.f}, {0.f, 1.f}},
{{-1.f, -1.f, 0.f}, {0.f, 0.f}},
{{1.f, 1.f, 0.f}, {1.f, 1.f}},
{{1.f, -1.f, 0.f}, {1.f, 0.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, sizeof(Vert), 4);
}
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
m_shadBind = CNESShader::BuildShaderDataBinding(ctx, m_vbo, m_uniBuf, m_texture);
return true;

View File

@ -57,7 +57,7 @@ enum class EMaterialTypes {
NonSolidDamageable = 50,
RadarObject = 51,
PlatformSlave = 52,
Unknown53 = 53,
AIJoint = 53,
Unknown54 = 54,
SolidCharacter = 55,
ExcludeFromLineOfSightTest = 56,

File diff suppressed because it is too large Load Diff

View File

@ -12,43 +12,42 @@ class CWeaponDescription;
namespace urde::MP1 {
struct CBabygothData {
float x0_;
float x4_;
CAssetId x8_;
CDamageInfo xc_;
CDamageInfo x28_;
CAssetId x44_;
float x0_fireballAttackTime;
float x4_fireballAttackTimeVariance;
CAssetId x8_fireballWeapon;
CDamageInfo xc_fireballDamage;
CDamageInfo x28_attackContactDamage;
CAssetId x44_fireBreathWeapon;
CAssetId x48_fireBreathRes;
CDamageInfo x4c_fireBreathDamage;
CDamageVulnerability x68_;
CDamageVulnerability x68_mouthVulnerabilities;
CDamageVulnerability xd0_shellVulnerabilities;
CAssetId x138_;
CAssetId x13c_;
CAssetId x138_noShellModel;
CAssetId x13c_noShellSkin;
float x140_shellHitPoints;
s16 x144_shellCrackSfx;
CAssetId x148_;
CAssetId x14c_;
CAssetId x150_;
CAssetId x154_;
s16 x158_;
s16 x15a_;
s16 x15c_;
float x160_;
float x164_;
float x168_;
CAssetId x16c_;
s16 x170_;
CAssetId x174_;
CAssetId x148_intermediateCrackParticle;
CAssetId x14c_crackOneParticle;
CAssetId x150_crackTwoParticle;
CAssetId x154_destroyShellParticle;
s16 x158_crackOneSfx;
s16 x15a_crackTwoSfx;
s16 x15c_destroyShellSfx;
float x160_timeUntilAttack;
float x164_attackCooldownTime;
float x168_interestTime;
CAssetId x16c_flamePlayerSteamTxtr;
s16 x170_flamePlayerHitSfx;
CAssetId x174_flamePlayerIceTxtr;
public:
CBabygothData(CInputStream&);
CAssetId GetShellModelResId() const;
void GetFireballDamage() const;
CAssetId GetFireballResID() const;
void GetFireballAttackVariance() const;
void GetFireballAttackTime() const;
const CDamageInfo& GetFireballDamage() const { return xc_fireballDamage; }
CAssetId GetFireballResID() const { return x8_fireballWeapon; }
float GetFireballAttackVariance() const { return x4_fireballAttackTimeVariance; }
float GetFireballAttackTime() const { return x0_fireballAttackTime; }
CAssetId GetFireBreathResId() const { return x48_fireBreathRes; }
CDamageInfo GetFireBreathDamage() const { return x4c_fireBreathDamage; }
const CDamageInfo& GetFireBreathDamage() const { return x4c_fireBreathDamage; }
const CDamageVulnerability& GetShellDamageVulnerability() const { return xd0_shellVulnerabilities; }
float GetShellHitPoints() const { return x140_shellHitPoints; }
s16 GetShellCrackSfx() { return x144_shellCrackSfx; }
@ -56,62 +55,63 @@ public:
class CBabygoth final : public CPatterned {
public:
enum class EPathFindMode { Zero, One };
enum class EPathFindMode { Normal, Approach };
enum class EShellState { Default, CrackOne, CrackTwo, Destroyed };
private:
static constexpr s32 skSphereJointCount = 5;
static const SSphereJointInfo skSphereJointList[skSphereJointCount];
static const std::string_view skpMouthDamageJoint;
s32 x568_ = -1;
u32 x56c_ = 0;
s32 x568_stateProg = -1;
EShellState x56c_shellState = EShellState::Default;
CBabygothData x570_babyData;
TUniqueId x6e8_teamMgr = kInvalidUniqueId;
CPathFindSearch x6ec_;
CPathFindSearch x7d0_;
CPathFindSearch x6ec_pathSearch;
CPathFindSearch x7d0_approachPathSearch;
EPathFindMode x8b4_pathFindMode;
zeus::CVector3f x8b8_;
zeus::CVector3f x8c4_;
float x8d0_;
zeus::CVector3f x8b8_backupDestPos;
zeus::CVector3f x8c4_initialFaceDir;
float x8d0_initialSpeed;
float x8d4_stepBackwardDist = 0.f;
float x8d8_ = 0.f;
float x8dc_ = 0.f;
float x8e0_ = 0.f;
float x8e4_ = 0.f;
float x8e8_ = 0.f;
float x8ec_ = 0.f;
float x8d8_attackTimeLeft = 0.f;
float x8dc_attackTimer = 0.f;
float x8e0_attackCooldownTimeLeft = 0.f;
float x8e4_fireballAttackTimeLeft = 0.f;
float x8e8_interestTimer = 0.f;
float x8ec_bodyHP = 0.f;
CBoneTracking x8f0_boneTracking;
std::unique_ptr<CCollisionActorManager> x928_colActMgr;
CCollidableAABox x930_aabox;
CProjectileInfo x958_;
CProjectileInfo x958_iceProjectile;
TUniqueId x980_flameThrower = kInvalidUniqueId;
TToken<CWeaponDescription> x984_flameThrowerDesc;
CDamageVulnerability x98c_;
CDamageVulnerability x98c_dVuln;
CSegId x9f4_mouthLocator;
TUniqueId x9f6_ = kInvalidUniqueId;
TUniqueId x9f6_mouthCollisionActor = kInvalidUniqueId;
rstl::reserved_vector<TUniqueId, 1> x9f8_shellIds;
float xa00_shellHitPoints;
u32 xa04_ = 0;
u32 xa04_drawMaterialIdx = 0;
TLockedToken<CSkinnedModel> xa08_noShellModel;
TToken<CGenDescription> xa14_;
TToken<CGenDescription> xa20_;
TToken<CGenDescription> xa2c_;
TLockedToken<CGenDescription> xa38_; // Used to be an optional, not necessary in URDE
TToken<CGenDescription> xa14_crackOneParticle;
TToken<CGenDescription> xa20_crackTwoParticle;
TToken<CGenDescription> xa2c_destroyShellParticle;
TLockedToken<CGenDescription> xa38_intermediateCrackParticle; // Used to be an optional, not necessary in URDE
union {
struct {
bool xa48_24_isAlert : 1;
bool xa48_25_ : 1;
bool xa48_26_ : 1;
bool xa48_26_inProjectileAttack : 1;
bool xa48_27_ : 1;
bool xa48_28_ : 1;
bool xa48_29_ : 1;
bool xa48_30_ : 1;
bool xa48_31_ : 1;
bool xa49_24_ : 1;
bool xa49_25_ : 1;
bool xa49_26_ : 1;
bool xa49_27_ : 1;
bool xa49_28_ : 1;
bool xa49_29_ : 1;
bool xa48_28_pendingAttackContactDamage : 1;
bool xa48_29_hasBeenEnraged : 1;
bool xa48_30_heardPlayerFire : 1;
bool xa48_31_approachNeedsPathSearch : 1;
bool xa49_24_gettingUp : 1;
bool xa49_25_shouldStepBackwards : 1;
bool xa49_26_readyForTeam : 1;
bool xa49_27_locomotionValid : 1;
bool xa49_28_onApproachPath : 1;
bool xa49_29_objectSpaceCollision : 1;
};
u32 _dummy = 0;
};
@ -130,7 +130,7 @@ private:
void ApplySeparationBehavior(CStateManager&);
bool IsMouthCollisionActor(TUniqueId uid) { return x9f6_ == uid; }
bool IsMouthCollisionActor(TUniqueId uid) { return x9f6_mouthCollisionActor == uid; }
bool IsShell(TUniqueId uid) {
for (TUniqueId shellId : x9f8_shellIds) {
@ -146,9 +146,9 @@ private:
void AddToTeam(CStateManager& mgr);
void sub8021e2c4(float);
void UpdateTimers(float);
void sub8021e708(CStateManager&);
void UpdateHealthInfo(CStateManager& mgr);
void UpdateParticleEffects(float, CStateManager&);
@ -162,17 +162,23 @@ private:
void UpdateAttackPosition(CStateManager&, zeus::CVector3f&);
void sub8021e3f4(CStateManager&);
void UpdateShellHealth(CStateManager&);
bool IsDestinationObstructed(CStateManager&);
void sub8021d9d0(CStateManager&);
void DestroyShell(CStateManager& mgr);
void CrackShell(CStateManager&, const TLockedToken<CGenDescription>&, const zeus::CTransform&, u16, bool);
void UpdateHealthInfo(CStateManager&);
void UpdateHealth(CStateManager&);
float CalculateShellCrackHP(u32);
float CalculateShellCrackHP(EShellState state);
void UpdateAttackTimeLeft(CStateManager& mgr);
void ExtendCollisionActorTouchBounds(CStateManager& mgr, const zeus::CVector3f& extents);
void UpdateAttack(CStateManager& mgr, float dt);
public:
DEFINE_PATTERNED(Babygoth)
@ -184,7 +190,7 @@ public:
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
CPatterned::PreRender(mgr, frustum);
xb4_drawFlags.x1_matSetIdx = u8(xa04_);
xb4_drawFlags.x1_matSetIdx = u8(xa04_drawMaterialIdx);
}
void Think(float, CStateManager&);
@ -201,7 +207,7 @@ public:
const CWeaponMode& wMode, EProjectileAttrib attrib) const {
if (wMode.GetType() == EWeaponType::Ice)
return EWeaponCollisionResponseTypes::None;
if (x56c_ != 3)
if (x56c_shellState != EShellState::Destroyed)
return EWeaponCollisionResponseTypes::Unknown66;
return CPatterned::GetCollisionResponseType(v1, v2, wMode, attrib);
}
@ -215,11 +221,21 @@ public:
return &CDamageVulnerability::ReflectVulnerabilty();
}
zeus::CVector3f GetAimPosition(const CStateManager& mgr, float dt) const;
zeus::CVector3f GetOrigin(const CStateManager& mgr, const CTeamAiRole& role,
const zeus::CVector3f& aimPos) const;
void TakeDamage(const zeus::CVector3f&, float) {
if (x400_25_alive)
x428_damageCooldownTimer = 0.33f;
}
bool IsListening() const { return true; }
void KnockBack(const zeus::CVector3f&, CStateManager&, const CDamageInfo& info, EKnockBackType type, bool inDeferred,
float magnitude);
void Shock(CStateManager&, float, float);
void TurnAround(CStateManager&, EStateMsg, float);
@ -252,7 +268,9 @@ public:
void ProjectileAttack(CStateManager&, EStateMsg, float);
bool AnimOver(CStateManager&, float) { return x568_ == 4; }
bool Leash(CStateManager&, float);
bool AnimOver(CStateManager&, float) { return x568_stateProg == 4; }
bool SpotPlayer(CStateManager& mgr, float arg) {
if (xa48_24_isAlert)
@ -260,17 +278,44 @@ public:
return CPatterned::SpotPlayer(mgr, arg);
}
bool InPosition(CStateManager&, float) { return (x8b8_ - GetTranslation()).magSquared() < 9.f; }
bool InPosition(CStateManager&, float) { return (x8b8_backupDestPos - GetTranslation()).magSquared() < 9.f; }
bool InMaxRange(CStateManager&, float);
bool InDetectionRange(CStateManager&, float);
bool ShotAt(CStateManager&, float) { return x400_24_hitByPlayerProjectile; }
bool OffLine(CStateManager& mgr, float arg) {
SetPathFindMode(EPathFindMode::Zero);
SetPathFindMode(EPathFindMode::Normal);
return PathShagged(mgr, arg);
}
bool ShouldTurn(CStateManager& mgr, float arg);
bool ShouldAttack(CStateManager& mgr, float arg);
bool ShouldSpecialAttack(CStateManager& mgr, float arg);
bool ShouldFire(CStateManager& mgr, float arg);
bool TooClose(CStateManager& mgr, float arg);
bool LineOfSight(CStateManager& mgr, float arg);
bool AggressionCheck(CStateManager& mgr, float arg) {
return x400_25_alive && !xa48_29_hasBeenEnraged && x56c_shellState == EShellState::Destroyed;
}
bool LostInterest(CStateManager& mgr, float arg);
bool Listen(const zeus::CVector3f&, EListenNoiseType);
CPathFindSearch* GetSearchPath() {
return x8b4_pathFindMode == EPathFindMode::Normal ? &x6ec_pathSearch : &x7d0_approachPathSearch;
}
CProjectileInfo* GetProjectileInfo() { return &x958_iceProjectile; }
};
} // namespace urde::MP1

View File

@ -495,9 +495,9 @@ void CFlaahgra::SetupCollisionManagers(CStateManager& mgr) {
AddMaterial(EMaterialTypes::ProjectilePassthrough, EMaterialTypes::Target, EMaterialTypes::Orbit, mgr);
RemoveMaterial(EMaterialTypes::Solid, mgr);
ModelData()->SetScale(oldScale);
x7a4_sphereCollision->AddMaterial(mgr, {EMaterialTypes::Unknown53, EMaterialTypes::CameraPassthrough});
x79c_leftArmCollision->AddMaterial(mgr, {EMaterialTypes::Unknown53, EMaterialTypes::CameraPassthrough});
x7a0_rightArmCollision->AddMaterial(mgr, {EMaterialTypes::Unknown53, EMaterialTypes::CameraPassthrough});
x7a4_sphereCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
x79c_leftArmCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
x7a0_rightArmCollision->AddMaterial(mgr, {EMaterialTypes::AIJoint, EMaterialTypes::CameraPassthrough});
}
void CFlaahgra::sub801ae980(CStateManager& mgr) {

View File

@ -17,7 +17,8 @@ const zeus::CVector3f CFlameThrower::kLightOffset(0, 3.f, 2.f);
CFlameThrower::CFlameThrower(const TToken<CWeaponDescription>& wDesc, std::string_view name, EWeaponType wType,
const CFlameInfo& flameInfo, const zeus::CTransform& xf, EMaterialTypes matType,
const CDamageInfo& dInfo, TUniqueId uid, TAreaId aId, TUniqueId owner,
EProjectileAttrib attribs, CAssetId assetId1, s16 sId, CAssetId assetId2)
EProjectileAttrib attribs, CAssetId playerSteamTxtr, s16 playerHitSfx,
CAssetId playerIceTxtr)
: CGameProjectile(false, wDesc, name, wType, xf, matType, dInfo, uid, aId, owner, kInvalidUniqueId, attribs, false,
zeus::CVector3f(1.f), {}, -1, false)
, x2e8_flameXf(xf)
@ -25,9 +26,9 @@ CFlameThrower::CFlameThrower(const TToken<CWeaponDescription>& wDesc, std::strin
, x33c_flameDesc(g_SimplePool->GetObj({FOURCC('PART'), flameInfo.GetFlameFxId()}))
, x348_flameGen(new CElementGen(x33c_flameDesc))
, x34c_flameWarp(176.f - float(flameInfo.GetLength()), xf.origin, bool(flameInfo.GetAttributes() & 0x4))
, x3f4_playerSteamTxtr(assetId1)
, x3f8_playerHitSfx(sId)
, x3fc_playerIceTxtr(assetId2)
, x3f4_playerSteamTxtr(playerSteamTxtr)
, x3f8_playerHitSfx(playerHitSfx)
, x3fc_playerIceTxtr(playerIceTxtr)
, x400_24_active(false)
, x400_25_particlesActive(false)
, x400_26_(!(flameInfo.GetAttributes() & 1))

View File

@ -49,7 +49,7 @@ public:
CFlameThrower(const TToken<CWeaponDescription>& wDesc, std::string_view name, EWeaponType wType,
const CFlameInfo& flameInfo, const zeus::CTransform& xf, EMaterialTypes matType,
const CDamageInfo& dInfo, TUniqueId uid, TAreaId aId, TUniqueId owner, EProjectileAttrib attribs,
CAssetId w2, s16 sId, CAssetId w3);
CAssetId playerSteamTxtr, s16 playerHitSfx, CAssetId playerIceTxtr);
void Accept(IVisitor& visitor);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);

View File

@ -135,6 +135,7 @@ void CGunWeapon::UpdateGunFx(bool shotSmoke, float dt, const CStateManager& mgr,
if (x218_26_loaded && x204_frozenEffect != EFrozenFxType::None) {
if (x204_frozenEffect == EFrozenFxType::Thawed) {
if (x1b8_frozenGenerator->IsSystemDeletable()) {
x204_frozenEffect = EFrozenFxType::None;
x1b8_frozenGenerator.reset();
} else {
x1b8_frozenGenerator->SetTranslation(xf.origin);

View File

@ -362,9 +362,8 @@ public:
const CKnockBackController& GetKnockBackController() const { return x460_knockBackController; }
void SetupPlayerCollision(bool);
void LaunchProjectile(const zeus::CTransform& gunXf, CStateManager& mgr, int maxAllowed, EProjectileAttrib attrib,
bool playerHoming,
const std::optional<TLockedToken<CGenDescription>>& visorParticle, u16 visorSfx,
bool sendCollideMsg, const zeus::CVector3f& scale);
bool playerHoming, const std::optional<TLockedToken<CGenDescription>>& visorParticle,
u16 visorSfx, bool sendCollideMsg, const zeus::CVector3f& scale);
void DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, EUserEventType type, float dt);
void SetDestPos(const zeus::CVector3f& pos) { x2e0_destPos = pos; }

View File

@ -78,8 +78,10 @@ void CStateMachineState::Update(CStateManager& mgr, CAi& ai, float delta) {
if (andPassed && state) {
x4_state->CallFunc(mgr, ai, EStateMsg::Deactivate, 0.f);
x4_state = state;
#ifndef NDEBUG
printf("%04X %08X %s - %s %d\n", ai.GetUniqueId().Value(), ai.GetEditorId().id, ai.GetName().data(),
state->xc_name, int(state - x0_machine->GetStateVector().data()));
#endif
x8_time = 0.f;
x18_24_codeTrigger = false;
xc_random = mgr.GetActiveRandom()->Float();