WitchAngry::Update
0x00a3bd60 · 1222 bytes · __cdecl
_ZN10WitchAngry6UpdateEP8Infectedf
Decompiled
undefined (2 params)
/* WitchAngry::Update(Infected*, float) */
Infected * WitchAngry::Update(Infected *param_1,float param_2)
{
float fVar1;
char cVar2;
int *piVar3;
CBaseEntity *pCVar4;
int iVar5;
WitchAttack *pWVar6;
undefined4 *puVar7;
longdouble lVar8;
float fVar9;
Witch *in_stack_0000000c;
float in_stack_00000010;
undefined4 uVar10;
Growl((WitchAngry *)param_2,in_stack_0000000c);
uVar10 = 2;
lVar8 = (longdouble)(**(code **)(*(int *)in_stack_0000000c + 0x4b0))();
if (((float)lVar8 < 5.0) &&
(iVar5 = (**(code **)(*(int *)in_stack_0000000c + 0x56c))(), iVar5 != 0)) {
pCVar4 = (CBaseEntity *)(**(code **)(*(int *)in_stack_0000000c + 0x56c))();
cVar2 = WitchAttack::IsValidEnemy(pCVar4);
if (cVar2 != '\0') {
cVar2 = IsInCommentaryMode();
if (cVar2 == '\0') {
LAB_00a3bf9b:
pCVar4 = (CBaseEntity *)(**(code **)(*(int *)in_stack_0000000c + 0x56c))();
pWVar6 = ::operator_new(0x487c);
/* try { // try from 00a3bfbd to 00a3bfc1 has its CatchHandler @ 00a3c257 */
WitchAttack::WitchAttack(pWVar6,pCVar4);
*(undefined4 *)((int)param_2 + 0x20) = 0;
*(undefined4 *)((int)param_2 + 0x24) = 0;
*(undefined4 *)((int)param_2 + 0x28) = 0;
*(undefined4 *)((int)param_2 + 0x2c) = 0;
*(undefined4 *)param_1 = 2;
*(WitchAttack **)(param_1 + 4) = pWVar6;
*(char **)(param_1 + 8) = "Resumed Angry when recently attacked";
return param_1;
}
piVar3 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x56c))();
cVar2 = (**(code **)(*piVar3 + 0x16c))(piVar3);
if (cVar2 == '\0') goto LAB_00a3bf9b;
piVar3 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x56c))();
cVar2 = (**(code **)(*piVar3 + 0x778))(piVar3);
if (cVar2 != '\0') goto LAB_00a3bf9b;
}
}
piVar3 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x59c))();
pCVar4 = (CBaseEntity *)(**(code **)(*piVar3 + 0xb4))(piVar3,uVar10);
if (pCVar4 == (CBaseEntity *)0x0) {
LAB_00a3bf00:
lVar8 = (longdouble)CountdownTimer::Now();
if (*(float *)((int)param_2 + 0x3c) <= (float)lVar8) {
Witch::ChangeRageLevel
(in_stack_0000000c,
-*(float *)(ZombieWitchRelaxRate._28_4_ + 0x2c) * in_stack_00000010);
if (*(float *)(in_stack_0000000c + 0x1d94) <= 0.0) {
puVar7 = ::operator_new(0x50);
puVar7[8] = 0;
puVar7[9] = 0;
puVar7[10] = 0;
puVar7[3] = 0;
puVar7[4] = 0;
puVar7[5] = 0;
puVar7[6] = 0;
puVar7[7] = 0;
puVar7[2] = 0;
*(undefined1 *)(puVar7 + 0xc) = 0;
*(undefined1 *)((int)puVar7 + 0x31) = 0;
puVar7[0xb] = 0;
*puVar7 = &PTR__WitchIdle_00d265a8;
puVar7[1] = &PTR__WitchIdle_00d2670c;
puVar7[0xd] = &PTR_NetworkStateChanged_00c0b6e0;
puVar7[0xe] = 0;
puVar7[0xf] = 0xbf800000;
puVar7[0x10] = &PTR_NetworkStateChanged_00c0b6e0;
puVar7[0x11] = 0;
puVar7[0x12] = 0xbf800000;
puVar7[0x13] = 0xffffffff;
*(undefined4 *)param_1 = 1;
*(undefined4 **)(param_1 + 4) = puVar7;
*(undefined4 *)(param_1 + 8) = 0;
return param_1;
}
pCVar4 = (CBaseEntity *)0x0;
goto LAB_00a3c02b;
}
fVar9 = 1.0;
pCVar4 = (CBaseEntity *)0x0;
}
else {
cVar2 = Witch::IsHostileToMe(in_stack_0000000c,pCVar4);
if (cVar2 == '\0') {
fVar9 = *(float *)(ZombieWitchThreatNormalRange._28_4_ + 0x2c);
}
else {
fVar9 = *(float *)(ZombieWitchThreatHostileRange._28_4_ + 0x2c);
}
cVar2 = (**(code **)(*(int *)(in_stack_0000000c + 0x1a3c) + 0x11c))
(in_stack_0000000c + 0x1a3c,pCVar4,fVar9 + 50.0);
if (cVar2 != '\0') goto LAB_00a3bf00;
piVar3 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x594))();
uVar10 = 2;
(**(code **)(*piVar3 + 0x13c))(piVar3,pCVar4,2,0x3f800000,0,0);
CountdownTimer::Now();
cVar2 = Witch::IsHostileToMe(in_stack_0000000c,pCVar4);
fVar9 = 1.0;
if (cVar2 != '\0') {
piVar3 = (int *)(**(code **)(*(int *)pCVar4 + 0x144))(pCVar4);
if (piVar3 != (int *)0x0) {
uVar10 = 0x3f7ae148;
cVar2 = (**(code **)(*piVar3 + 0x41c))(piVar3);
if (cVar2 != '\0') {
fVar9 = *(float *)(ZombieWitchHostileAtMeAnger._28_4_ + 0x2c);
goto LAB_00a3be7f;
}
}
fVar9 = *(float *)(ZombieWitchHostileAtMeAnger._28_4_ + 0x2c) * 0.5;
}
LAB_00a3be7f:
lVar8 = (longdouble)
(**(code **)(*(int *)(in_stack_0000000c + 0x1a3c) + 0x124))
(in_stack_0000000c + 0x1a3c,pCVar4,uVar10);
fVar1 = *(float *)(ZombieWitchThreatNormalRange._28_4_ + 0x2c);
if (fVar1 < (float)lVar8) {
fVar9 = fVar9 * (((float)lVar8 - fVar1) /
(fVar1 - *(float *)(ZombieWitchThreatHostileRange._28_4_ + 0x2c)) + 1.0);
}
iVar5 = GetDifficulty();
if (iVar5 == 0) {
fVar9 = fVar9 * 0.5;
}
}
Witch::ChangeRageLevel
(in_stack_0000000c,
in_stack_00000010 * *(float *)(ZombieWitchAngerRate._28_4_ + 0x2c) * fVar9);
LAB_00a3c02b:
lVar8 = (longdouble)CountdownTimer::Now();
if (((*(float *)((int)param_2 + 0x3c) <= (float)lVar8) &&
(1.0 < *(float *)(in_stack_0000000c + 0x1d94) || *(float *)(in_stack_0000000c + 0x1d94) == 1.0
)) && (cVar2 = WitchAttack::IsValidEnemy(pCVar4), cVar2 != '\0')) {
pWVar6 = ::operator_new(0x487c);
/* try { // try from 00a3c076 to 00a3c07a has its CatchHandler @ 00a3c269 */
WitchAttack::WitchAttack(pWVar6,pCVar4);
*(undefined4 *)((int)param_2 + 0x20) = 0;
*(undefined4 *)((int)param_2 + 0x24) = 0;
*(undefined4 *)((int)param_2 + 0x28) = 0;
*(undefined4 *)((int)param_2 + 0x2c) = 0;
*(undefined4 *)param_1 = 2;
*(WitchAttack **)(param_1 + 4) = pWVar6;
*(undefined4 *)(param_1 + 8) = 0;
return param_1;
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
return param_1;
}
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.