CTerrorPlayer::OnPouncedOnSurvivor
0x009bf920 · 3496 bytes · __thiscall
_ZN13CTerrorPlayer19OnPouncedOnSurvivorEPS_
Decompiled
undefined (2 params)
/* CTerrorPlayer::OnPouncedOnSurvivor(CTerrorPlayer*) */
void __thiscall CTerrorPlayer::OnPouncedOnSurvivor(CTerrorPlayer *this,CTerrorPlayer *param_1)
{
uint uVar1;
CBaseEdict *pCVar2;
code *pcVar3;
char cVar4;
undefined *puVar5;
undefined4 *puVar6;
undefined4 uVar7;
int *piVar8;
undefined *puVar9;
int iVar10;
undefined4 *puVar11;
int iVar12;
longdouble lVar13;
float fVar14;
float fVar15;
float fVar16;
float local_170;
float local_164;
float local_160;
float local_15c;
CTerrorPlayer *local_158;
CTerrorPlayer *local_154;
CTerrorPlayer *local_150;
float local_14c;
float local_148;
float local_144;
CTraceFilterSimple local_140 [16];
Vector local_130 [12];
CTerrorPlayer *local_124;
CTerrorPlayer *local_120;
CTerrorPlayer *local_11c;
CTerrorPlayer *local_e4;
uint local_dc [24];
CTerrorPlayer *local_7c;
CTerrorPlayer *local_78;
CTerrorPlayer *local_74;
undefined4 local_70;
float local_6c;
float local_68;
float local_64;
float local_60;
float local_5c;
undefined4 local_58;
undefined4 local_54;
undefined4 local_50;
undefined4 local_4c;
int local_48;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
undefined4 local_38;
undefined2 local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined1 local_24;
undefined1 local_23;
puVar11 = (undefined4 *)&stack0xfffffe54;
if (*(int *)(SurvivorNoPounceOrTongue._28_4_ + 0x30) != 0) {
return;
}
cVar4 = IsInCommentaryMode();
if ((cVar4 != '\0') && (cVar4 = (**(code **)(*(int *)param_1 + 0x778))(), cVar4 == '\0')) {
return;
}
uVar1 = *(uint *)(param_1 + 0x3e48);
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)) {
return;
}
cVar4 = CTerrorGameRules::IsSurvivalMode();
if ((cVar4 != '\0') || (0.0 < *(float *)(ZombiePounceStumbleRadius._28_4_ + 0x2c))) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
UTIL_ScreenShake();
local_7c = this;
local_78 = param_1;
puVar6 = (undefined4 *)(**(code **)(*(int *)this + 0x288))();
local_74 = (CTerrorPlayer *)*puVar6;
local_70 = puVar6[1];
local_6c = (float)puVar6[2];
ForEachSurvivor<PounceStumbleNearbySurvivors>((PounceStumbleNearbySurvivors *)&local_7c);
}
OnPouncedSurvivor();
for (iVar12 = IPredictionSystem::g_pPredictionSystems; iVar12 != 0; iVar12 = *(int *)(iVar12 + 4))
{
*(int *)(iVar12 + 0x10) = *(int *)(iVar12 + 0x10) + 1;
}
/* try { // try from 009bfa6e to 009c003d has its CatchHandler @ 009c076e */
OnPounceEnded(this);
CHandle<CTerrorPlayer>::CHandle((CHandle<CTerrorPlayer> *)local_dc,param_1);
puVar5 = g_pEntityList;
if (((local_dc[0] == 0xffffffff) ||
(puVar9 = g_pEntityList + (local_dc[0] & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != local_dc[0] >> 0xc)) {
iVar12 = 0;
}
else {
iVar12 = *(int *)(puVar9 + 4);
}
uVar1 = *(uint *)(this + 0x3e64);
if (((uVar1 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar1 >> 0xc)) {
iVar10 = 0;
}
else {
iVar10 = *(int *)(puVar9 + 4);
}
if (iVar12 != iVar10) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar12 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar12 + 2) = 0;
puVar5 = g_pEntityList;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(uint *)(this + 0x3e64) = local_dc[0];
}
if ((puVar5 == (undefined *)0xfffffffc) || (*(int *)(puVar5 + 8) != 0)) {
iVar12 = 0;
}
else {
iVar12 = *(int *)(puVar5 + 4);
}
uVar1 = *(uint *)(this + 0x3e68);
if (((uVar1 == 0xffffffff) ||
(puVar5 = puVar5 + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
iVar10 = 0;
}
else {
iVar10 = *(int *)(puVar5 + 4);
}
if (iVar12 != iVar10) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar12 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar12 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x3e68) = 0;
}
if (this[0x3e78] != (CTerrorPlayer)0x0) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar12 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar12 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
this[0x3e78] = (CTerrorPlayer)0x0;
}
this[0x3e79] = (CTerrorPlayer)0x1;
uVar7 = (**(code **)(*(int *)this + 0x1fc))();
*(undefined4 *)(this + 0x3e7c) = uVar7;
(**(code **)(*(int *)param_1 + 0xb8))();
(**(code **)(*(int *)this + 0xb8))();
UTIL_LogPrintf("%s pounced on %s, %d damage interrupts\n");
OnPouncedUpon(param_1,this);
fVar14 = *(float *)(ZombiePounceDamageDelay._28_4_ + 0x2c);
lVar13 = (longdouble)CountdownTimer::Now();
if ((float)lVar13 + fVar14 != *(float *)(this + 0x3e74)) {
(**(code **)(*(int *)(this + 0x3e6c) + 4))();
*(float *)(this + 0x3e74) = (float)lVar13 + fVar14;
}
if (fVar14 != *(float *)(this + 0x3e70)) {
(**(code **)(*(int *)(this + 0x3e6c) + 4))();
*(float *)(this + 0x3e70) = fVar14;
}
(**(code **)(*(int *)this + 0x7fc))();
piVar8 = (int *)CCSPlayer::GetActiveCSWeapon((CCSPlayer *)this);
if (piVar8 != (int *)0x0) {
(**(code **)(*piVar8 + 0x3f0))();
}
CBaseEntity::EmitSound((CBaseEntity *)this,"HunterZombie.Pounce.Hit",0.0,(float *)0x0);
lVar13 = (longdouble)RandomFloat();
fVar14 = (float)lVar13;
lVar13 = (longdouble)CountdownTimer::Now();
if ((float)lVar13 + fVar14 != *(float *)(this + 0x30a0)) {
(**(code **)(*(int *)(this + 0x3098) + 4))();
*(float *)(this + 0x30a0) = (float)lVar13 + fVar14;
}
if (fVar14 != *(float *)(this + 0x309c)) {
(**(code **)(*(int *)(this + 0x3098) + 4))();
*(float *)(this + 0x309c) = fVar14;
}
if (((byte)this[0x14d] & 8) != 0) {
/* try { // try from 009c0083 to 009c0105 has its CatchHandler @ 009c076e */
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
piVar8 = (int *)(**(code **)(*gameeventmanager + 0x1c))();
if (piVar8 != (int *)0x0) {
pcVar3 = *(code **)(*piVar8 + 0x30);
(**(code **)(*engine + 0x40))();
(*pcVar3)();
pcVar3 = *(code **)(*piVar8 + 0x30);
(**(code **)(*engine + 0x40))();
(*pcVar3)();
(**(code **)(*piVar8 + 0x38))();
}
cVar4 = CTerrorGameRules::HasPlayerControlledZombies();
if (cVar4 == '\0') {
LAB_009bff63:
if (piVar8 == (int *)0x0) goto LAB_009bff80;
}
else {
if (((byte)this[0x14d] & 8) != 0) {
/* try { // try from 009c0723 to 009c0727 has its CatchHandler @ 009c076e */
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
fVar14 = SQRT((*(float *)(this + 0x3e84) - *(float *)(this + 0x2e4)) *
(*(float *)(this + 0x3e84) - *(float *)(this + 0x2e4)) +
(*(float *)(this + 16000) - *(float *)(this + 0x2e0)) *
(*(float *)(this + 16000) - *(float *)(this + 0x2e0)) +
(*(float *)(this + 0x3e88) - *(float *)(this + 0x2e8)) *
(*(float *)(this + 0x3e88) - *(float *)(this + 0x2e8)));
if (fVar14 <= 300.0) {
local_170 = 1.0;
}
else {
local_170 = *(float *)(z_hunter_max_pounce_bonus_damage._28_4_ + 0x2c);
if (fVar14 < 1000.0) {
local_170 = (fVar14 + -300.0) * local_170 * 0.0014285714;
}
local_170 = local_170 + 1.0;
(**(code **)(*(int *)this + 0xb8))();
UTIL_LogPrintf("Pounce by %s dealt %0.1f damage from a 2d distance of %.0f\n");
local_74 = this;
local_70 = 0;
local_7c = (CTerrorPlayer *)0xc;
fVar14 = (float)(int)local_170;
local_68 = (float)CONCAT31(local_68._1_3_,1);
local_78 = param_1;
local_6c = fVar14;
ForEachTerrorPlayer<HitAnnouncement>((HitAnnouncement *)&local_7c);
if (*(int *)(this + 0x39d0) < (int)fVar14) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
/* try { // try from 009c054b to 009c054f has its CatchHandler @ 009c076e */
iVar12 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar12 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(float *)(this + 0x39d0) = fVar14;
}
if (local_170 <= 0.0) goto LAB_009bff63;
}
/* try { // try from 009c0157 to 009c04b7 has its CatchHandler @ 009c075b */
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)local_dc,(CBaseEntity *)this,(CBaseEntity *)this,local_170,1,0);
(**(code **)(*(int *)this + 0x478))();
if (((byte)this[0x14d] & 0x10) != 0) {
/* try { // try from 009c0523 to 009c0527 has its CatchHandler @ 009c075b */
CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)this);
}
CalculateMeleeDamageForce
((CTakeDamageInfo *)local_dc,(Vector *)(this + 0x274),(Vector *)&local_7c,1.0);
CBaseEntity::TakeDamage((CBaseEntity *)param_1,(CTakeDamageInfo *)local_dc);
CBasePlayer::EyeVectors((CBasePlayer *)this,(Vector *)&local_164,(Vector *)0x0,(Vector *)0x0);
VectorNormalize((Vector *)&local_164);
local_15c = local_15c - 0.2;
fVar16 = local_164 * 80.0;
fVar15 = local_160 * 80.0;
fVar14 = local_15c * 80.0;
(**(code **)(*(int *)this + 0x234))();
(**(code **)(*(int *)this + 0x234))();
puVar11 = (undefined4 *)&stack0xfffffe48;
local_3c = 0;
local_64 = (local_144 - (float)local_150) + fVar14;
local_6c = (fVar16 - (float)local_158) + local_14c;
local_7c = local_158;
local_78 = local_154;
local_68 = (fVar15 - (float)local_154) + local_148;
local_74 = local_150;
local_44 = 0;
local_48 = 0;
local_4c = 0;
local_54 = 0;
local_58 = 0;
local_5c = 0.0;
local_38._0_2_ =
CONCAT11(local_6c * local_6c + local_64 * local_64 + local_68 * local_68 != 0.0,1);
CTraceFilterSimple::CTraceFilterSimple
(local_140,(IHandleEntity *)this,0,(_func_bool_IHandleEntity_ptr_int *)0x0);
(**(code **)(*enginetrace + 0x14))();
if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
DebugDrawLine(local_130,(Vector *)&local_124,0xff,0,0,true,-1.0);
}
iVar12 = IPredictionSystem::g_pPredictionSystems;
if (local_e4 == param_1) {
for (; iVar12 != 0; iVar12 = *(int *)(iVar12 + 4)) {
*(int *)(iVar12 + 0x10) = *(int *)(iVar12 + 0x10) + 1;
}
/* try { // try from 009c05c4 to 009c06e0 has its CatchHandler @ 009c0746 */
UTIL_BloodDecalTrace((CGameTrace *)local_130,0);
local_24 = 0;
local_34 = 0;
local_7c = local_124;
local_70 = 0;
local_78 = local_120;
local_23 = 0;
local_74 = local_11c;
local_60 = -local_160;
local_5c = -local_15c;
local_6c = 0.0;
local_64 = -local_164;
local_68 = 0.0;
local_58 = 0;
local_54 = 0;
local_50 = 0;
local_4c = 0;
local_44 = 0x3f800000;
local_38 = 0;
local_3c = 0;
local_30 = 0;
local_2c = 0;
local_28 = 0;
if ((local_e4 == (CTerrorPlayer *)0x0) || (*(int *)(local_e4 + 0x30) == 0)) {
local_48 = 0;
}
else {
local_48 = *(int *)(local_e4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
local_40 = 0x41a00000;
DispatchEffect("csblood",(CEffectData *)&local_7c);
for (iVar12 = IPredictionSystem::g_pPredictionSystems; iVar12 != 0;
iVar12 = *(int *)(iVar12 + 4)) {
*(int *)(iVar12 + 0x10) = *(int *)(iVar12 + 0x10) + -1;
}
}
BloodyHands_Increment(this);
(**(code **)(*(int *)this + 0x8f0))();
(**(code **)(*(int *)param_1 + 0x8f0))();
cVar4 = (**(code **)(*(int *)param_1 + 300))();
if (cVar4 == '\0') {
if (*(int *)(this + 0x330c) != 10) {
if (this[0x6c] == (CTerrorPlayer)0x0) {
pCVar2 = *(CBaseEdict **)(this + 0x30);
if (pCVar2 != (CBaseEdict *)0x0) {
*(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
iVar12 = CBaseEdict::GetChangeAccessor(pCVar2);
*(undefined2 *)(iVar12 + 2) = 0;
}
}
else {
this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
}
*(undefined4 *)(this + 0x330c) = 10;
}
OnPounceEnded(this);
}
(**(code **)(*piVar8 + 0x30))();
}
iVar12 = *gameeventmanager;
puVar11[2] = 0;
puVar11[1] = piVar8;
*puVar11 = gameeventmanager;
pcVar3 = *(code **)(iVar12 + 0x20);
puVar11[-1] = 0x9bff80;
(*pcVar3)();
LAB_009bff80:
iVar12 = IPredictionSystem::g_pPredictionSystems;
if (IPredictionSystem::g_pPredictionSystems == 0) {
return;
}
do {
*(int *)(iVar12 + 0x10) = *(int *)(iVar12 + 0x10) + -1;
piVar8 = (int *)(iVar12 + 4);
iVar12 = *piVar8;
} while (*piVar8 != 0);
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.