CDirectorVersusMode::InitVersusBossSpawning
0x008c4040 · 1083 bytes · __thiscall
_ZN19CDirectorVersusMode22InitVersusBossSpawningEv
Decompiled
undefined (1 param)
/* WARNING: Type propagation algorithm not settling */
/* CDirectorVersusMode::InitVersusBossSpawning() */
void __thiscall CDirectorVersusMode::InitVersusBossSpawning(CDirectorVersusMode *this)
{
float fVar1;
CDirectorVersusMode CVar2;
bool bVar3;
undefined4 uVar4;
bool bVar5;
int iVar6;
CDirectorVersusMode *pCVar7;
longdouble lVar8;
float fVar9;
float fVar10;
double dVar11;
float fVar12;
float fVar13;
double dVar14;
double dVar15;
double dVar16;
bool local_2d;
float local_2c;
float local_28;
float local_24;
float local_20 [4];
uVar4 = versus_boss_flow_min._28_4_;
local_2d = true;
this[0x38] = (CDirectorVersusMode)0x0;
this[0x39] = (CDirectorVersusMode)0x0;
this[0x3a] = (CDirectorVersusMode)0x0;
this[0x3b] = (CDirectorVersusMode)0x0;
local_2c = *(float *)(uVar4 + 0x2c);
local_28 = *(float *)(versus_boss_flow_max._28_4_ + 0x2c);
local_24 = *(float *)(versus_tank_chance._28_4_ + 0x2c);
local_20[0] = *(float *)(versus_witch_chance._28_4_ + 0x2c);
iVar6 = CDirector::GetMapArcValue(TheDirector);
if (iVar6 == 0) {
local_2c = *(float *)(versus_boss_flow_min_intro._28_4_ + 0x2c);
local_28 = *(float *)(versus_boss_flow_max_intro._28_4_ + 0x2c);
local_24 = *(float *)(versus_tank_chance_intro._28_4_ + 0x2c);
local_20[0] = *(float *)(versus_witch_chance_intro._28_4_ + 0x2c);
local_2d = false;
}
else {
iVar6 = CDirector::GetMapArcValue(TheDirector);
if (iVar6 == 4) {
local_2c = *(float *)(versus_boss_flow_min_finale._28_4_ + 0x2c);
local_28 = *(float *)(versus_boss_flow_max_finale._28_4_ + 0x2c);
local_24 = *(float *)(versus_tank_chance_finale._28_4_ + 0x2c);
local_20[0] = *(float *)(versus_witch_chance_finale._28_4_ + 0x2c);
local_2d = false;
}
}
GetMissionVersusBossSpawning(this,&local_2c,&local_28,&local_24,local_20,&local_2d);
lVar8 = (longdouble)RandomFloat(0,0x3f800000);
bVar3 = (float)lVar8 < local_20[0];
lVar8 = (longdouble)RandomFloat(0,0x3f800000);
bVar5 = (float)lVar8 < local_24;
if (bVar3) {
bVar5 = local_2d != false && bVar5;
lVar8 = (longdouble)RandomFloat(local_2c,local_28);
uVar4 = versus_witch_flow_team_variation._28_4_;
fVar13 = (float)lVar8;
*(float *)(this + 0x30) = fVar13;
fVar9 = *(float *)(uVar4 + 0x2c) * 0.5;
lVar8 = (longdouble)RandomFloat(fVar13 - fVar9,fVar13 + fVar9);
fVar13 = (float)lVar8;
if (local_2c <= fVar13) {
if (local_28 <= fVar13) {
fVar13 = local_28;
}
this[0x3a] = (CDirectorVersusMode)0x1;
this[0x3b] = (CDirectorVersusMode)0x1;
*(float *)(this + 0x34) = fVar13;
}
else {
*(float *)(this + 0x34) = local_2c;
this[0x3a] = (CDirectorVersusMode)0x1;
this[0x3b] = (CDirectorVersusMode)0x1;
}
}
if (bVar5) {
lVar8 = (longdouble)RandomFloat(local_2c,local_28);
uVar4 = versus_tank_flow_team_variation._28_4_;
fVar13 = (float)lVar8;
*(float *)(this + 0x28) = fVar13;
fVar9 = *(float *)(uVar4 + 0x2c) * 0.5;
lVar8 = (longdouble)RandomFloat(fVar13 - fVar9,fVar13 + fVar9);
fVar13 = (float)lVar8;
fVar9 = local_2c;
if ((local_2c <= fVar13) && (fVar9 = fVar13, local_28 <= fVar13)) {
fVar9 = local_28;
}
*(float *)(this + 0x2c) = fVar9;
this[0x38] = (CDirectorVersusMode)0x1;
this[0x39] = (CDirectorVersusMode)0x1;
if (bVar3) {
iVar6 = 0;
pCVar7 = this;
do {
lVar8 = (longdouble)
RandomFloat(*(undefined4 *)(versus_boss_padding_min._28_4_ + 0x2c),
*(undefined4 *)(versus_boss_padding_max._28_4_ + 0x2c));
fVar13 = *(float *)(pCVar7 + 0x28);
fVar9 = *(float *)(pCVar7 + 0x30);
fVar1 = (float)lVar8;
if (fVar13 <= fVar9) {
fVar12 = local_2c;
if ((local_2c <= fVar13) && (fVar12 = local_28 - fVar1, fVar13 <= local_28 - fVar1)) {
fVar12 = fVar13;
}
fVar10 = fVar1 + fVar12;
if ((fVar1 + fVar12 <= fVar9) && (fVar10 = fVar9, local_28 <= fVar9)) {
fVar10 = local_28;
}
}
else {
fVar10 = local_2c;
if ((local_2c <= fVar9) && (fVar10 = local_28 - fVar1, fVar9 <= local_28 - fVar1)) {
fVar10 = fVar9;
}
fVar12 = fVar1 + fVar10;
if ((fVar1 + fVar10 <= fVar13) && (fVar12 = fVar13, local_28 <= fVar13)) {
fVar12 = local_28;
}
}
iVar6 = iVar6 + 1;
*(float *)(pCVar7 + 0x28) = fVar12;
*(float *)(pCVar7 + 0x30) = fVar10;
pCVar7 = pCVar7 + 4;
} while (iVar6 != 2);
}
}
if (*(int *)(versus_boss_debug._28_4_ + 0x30) != 0) {
if (this[0x3b] == (CDirectorVersusMode)0x0) {
CVar2 = this[0x39];
dVar16 = -1.0;
}
else {
CVar2 = this[0x39];
dVar16 = (double)*(float *)(this + 0x34);
}
if (CVar2 == (CDirectorVersusMode)0x0) {
CVar2 = this[0x3a];
dVar15 = -1.0;
}
else {
CVar2 = this[0x3a];
dVar15 = (double)*(float *)(this + 0x2c);
}
if (CVar2 == (CDirectorVersusMode)0x0) {
CVar2 = this[0x38];
dVar14 = -1.0;
}
else {
CVar2 = this[0x38];
dVar14 = (double)*(float *)(this + 0x30);
}
if (CVar2 == (CDirectorVersusMode)0x0) {
dVar11 = -1.0;
}
else {
dVar11 = (double)*(float *)(this + 0x28);
}
Msg("Versus Boss: MinFlow %.2f MaxFlow %.2f - Team 0: Tank %.2f Witch %.2f - Team 1: Tank %.2f Witch %.2f\n"
,(double)local_2c,(double)local_28,dVar11,dVar14,dVar15,dVar16);
return;
}
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.