L L4D2node

Music::UpdateMeters

0x008f09b0 · 8563 bytes · __thiscall

_ZN5Music12UpdateMetersEv

Decompiled

undefined (1 param)

/* Music::UpdateMeters() */

void __thiscall Music::UpdateMeters(Music *this)

{
  float *pfVar1;
  float *pfVar2;
  float *pfVar3;
  uint *puVar4;
  float fVar5;
  Music MVar6;
  Music MVar7;
  Music MVar8;
  CBaseEntity *pCVar9;
  undefined1 auVar10 [12];
  CDirector *this_00;
  char cVar11;
  char cVar12;
  Music MVar13;
  bool bVar14;
  int iVar15;
  int *piVar16;
  CNavArea *pCVar17;
  CNavArea *pCVar18;
  int iVar19;
  undefined4 *puVar20;
  CWeaponCSBase *this_01;
  char *pcVar21;
  undefined4 uVar22;
  undefined *puVar23;
  int iVar24;
  int in_GS_OFFSET;
  longdouble lVar25;
  longdouble lVar26;
  uint uVar27;
  float fVar28;
  float fVar29;
  undefined1 auVar30 [12];
  float fVar31;
  float fVar32;
  float fVar33;
  float local_f0;
  int local_e4;
  CUtlMemory<CTerrorPlayer*,int> *local_e0;
  float local_dc;
  CBaseEntity *local_d4;
  float local_d0;
  int local_c8 [5];
  int local_b4 [5];
  char local_a0 [128];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  lVar25 = (longdouble)
           ScalarDeltaMeter::UpdateMeterDelta
                     ((float)(this + 0x34),(float)*(int *)(*(int *)(this + 0x378) + 0x100),
                      *(float *)(MusicDynamicDamageIncrement._28_4_ + 0x2c),
                      SUB41(*(undefined4 *)(MusicDynamicDamageDecayTime._28_4_ + 0x2c),0),false,true
                     );
  if ((this[5] == (Music)0x0) ||
     (this_01 = (CWeaponCSBase *)CCSPlayer::GetActiveCSWeapon(*(CCSPlayer **)(this + 0x378)),
     this_01 == (CWeaponCSBase *)0x0)) {
    fVar33 = 0.0;
  }
  else {
    iVar24 = CWeaponCSBase::GetCSWpnData(this_01);
    fVar33 = *(float *)(iVar24 + 0xbec);
  }
  local_dc = 0.0;
  this[5] = (Music)0x0;
  ScalarDeltaMeter::UpdateMeter
            ((float)(this + 0xc),fVar33,*(float *)(MusicDynamicGunFireIncrement._28_4_ + 0x2c),
             SUB41(*(undefined4 *)(MusicDynamicGunFireDecayTime._28_4_ + 0x2c),0),false);
  ScalarDeltaMeter::UpdateMeter
            ((float)(this + 0x20),fVar33,*(float *)(MusicDynamicGunFireSlowIncrement._28_4_ + 0x2c),
             SUB41(*(undefined4 *)(MusicDynamicGunFireSlowDecayTime._28_4_ + 0x2c),0),false);
  ScalarDeltaMeter::UpdateMeter
            ((float)(this + 0x48),*(float *)(this + 8),
             *(float *)(MusicDynamicDoDamageIncrement._28_4_ + 0x2c),
             SUB41(*(undefined4 *)(MusicDynamicDoDamageDecayTime._28_4_ + 0x2c),0),false);
  *(undefined4 *)(this + 8) = 0;
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0x98),
             (float)*(int *)(this + 0x1dc) / *(float *)(ZombieMobMusicSize._28_4_ + 0x2c),
             *(float *)(MusicDynamicCISightDecayTime._28_4_ + 0x2c),false,false);
  cVar11 = IsTimeOfDayBetween(2,4);
  MVar6 = this[0x185];
  this[0x185] = (Music)0x0;
  MVar7 = this[0x186];
  this[0x186] = (Music)0x0;
  MVar8 = this[0x187];
  this[0x187] = (Music)0x0;
  if (*(float *)(this + 0x188) != 0.0) {
    (**(code **)(*(int *)this + 0xc))(this,this + 0x188);
    *(undefined4 *)(this + 0x188) = 0;
  }
  if (*(int *)(this + 0x238) < 1) {
    local_d4 = (CBaseEntity *)0x0;
    local_e4 = 0;
    local_f0 = 2.6843546e+08;
  }
  else {
    iVar24 = 0;
    local_d4 = (CBaseEntity *)0x0;
    local_e4 = 0;
    local_f0 = 2.6843546e+08;
LAB_008f0c47:
    do {
      pCVar9 = *(CBaseEntity **)(*(int *)(this + 0x22c) + iVar24 * 4);
      if ((pCVar9 != (CBaseEntity *)0x0) &&
         (iVar15 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar15 == 7)) {
        if (local_d4 == (CBaseEntity *)0x0) {
          if (*(int *)(pCVar9 + 0x30) == 0) {
            local_e4 = 0;
            local_d4 = pCVar9;
          }
          else {
            local_e4 = *(int *)(pCVar9 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
            local_d4 = pCVar9;
          }
        }
        piVar16 = (int *)(**(code **)(*(int *)pCVar9 + 0x594))(pCVar9);
        if (piVar16 != (int *)0x0) {
          this[0x185] = (Music)0x1;
          cVar12 = (**(code **)(*piVar16 + 0x114))(piVar16,2);
          if (cVar12 != '\0') {
            puVar20 = (undefined4 *)(**(code **)(*(int *)pCVar9 + 0xc))(pCVar9);
            local_b4[0] = *puVar20;
            CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::FindAndRemove
                      ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)
                       (this + 0x19c),(CHandle *)local_b4);
            this[0x186] = (Music)0x1;
            if (((byte)pCVar9[0x153] & 8) != 0) {
              this[0x187] = (Music)0x1;
            }
          }
          if (cVar11 == '\0') {
            pCVar17 = (CNavArea *)(**(code **)(*(int *)pCVar9 + 0x52c))(pCVar9);
            pCVar18 = (CNavArea *)
                      (**(code **)(**(int **)(this + 0x378) + 0x52c))(*(int **)(this + 0x378));
            if ((pCVar18 != (CNavArea *)0x0) && (pCVar17 != (CNavArea *)0x0)) {
              fVar33 = *(float *)(MusicDynamicWitchNearMax._28_4_ + 0x2c);
              if ((*(float *)(pCVar18 + 0x2c) - *(float *)(pCVar17 + 0x2c)) *
                  (*(float *)(pCVar18 + 0x2c) - *(float *)(pCVar17 + 0x2c)) +
                  (*(float *)(pCVar18 + 0x30) - *(float *)(pCVar17 + 0x30)) *
                  (*(float *)(pCVar18 + 0x30) - *(float *)(pCVar17 + 0x30)) +
                  (*(float *)(pCVar18 + 0x34) - *(float *)(pCVar17 + 0x34)) *
                  (*(float *)(pCVar18 + 0x34) - *(float *)(pCVar17 + 0x34)) < fVar33 * fVar33) {
                if (pCVar17 == pCVar18) {
LAB_008f2aab:
                  fVar33 = 0.0;
                }
                else {
                  bVar14 = NavAreaBuildPath<ShortestPathCost>
                                     (pCVar18,pCVar17,(Vector *)0x0,(Vector *)0x0,
                                      (ShortestPathCost *)local_b4,(CNavArea **)0x0,fVar33,-1,false)
                  ;
                  if (!bVar14) goto LAB_008f0d31;
                  iVar15 = *(int *)(pCVar17 + 0x78);
                  if (iVar15 == 0) goto LAB_008f2aab;
                  fVar33 = 0.0;
                  fVar31 = *(float *)(pCVar17 + 0x30);
                  fVar28 = *(float *)(pCVar17 + 0x2c);
                  fVar29 = *(float *)(pCVar17 + 0x34);
                  do {
                    pfVar1 = (float *)(iVar15 + 0x30);
                    pfVar2 = (float *)(iVar15 + 0x34);
                    fVar31 = fVar31 - *pfVar1;
                    pfVar3 = (float *)(iVar15 + 0x2c);
                    fVar29 = fVar29 - *pfVar2;
                    iVar15 = *(int *)(iVar15 + 0x78);
                    fVar28 = fVar28 - *pfVar3;
                    fVar33 = fVar33 + SQRT(fVar29 * fVar29 + fVar31 * fVar31 + fVar28 * fVar28);
                    fVar31 = *pfVar1;
                    fVar28 = *pfVar3;
                    fVar29 = *pfVar2;
                  } while (iVar15 != 0);
                  if (fVar33 < 0.0) goto LAB_008f0d31;
                  fVar33 = fVar33 * fVar33;
                }
              }
              else {
LAB_008f0d31:
                fVar33 = 2.6843546e+08;
              }
              if (fVar33 < local_f0) {
                local_f0 = fVar33;
                if (*(int *)(pCVar9 + 0x30) != 0) {
                  iVar24 = iVar24 + 1;
                  local_e4 = *(int *)(pCVar9 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
                  local_d4 = pCVar9;
                  if (*(int *)(this + 0x238) <= iVar24) break;
                  goto LAB_008f0c47;
                }
                local_e4 = 0;
                local_d4 = pCVar9;
              }
            }
          }
        }
      }
      iVar24 = iVar24 + 1;
    } while (iVar24 < *(int *)(this + 0x238));
  }
  local_e0 = (CUtlMemory<CTerrorPlayer*,int> *)local_b4;
  if (this[0x185] == (Music)0x0) {
    if ((cVar11 == '\x01') || (MVar6 == (Music)0x0)) goto LAB_008f10cd;
    StopPlaying(this,"Event.WitchRage",1.0,false);
    StopPlaying(this,"Event.WitchRageBride",1.0,false);
    if (MVar8 == (Music)0x0) goto LAB_008f0e30;
LAB_008f10da:
    MVar13 = this[0x187];
LAB_008f10e1:
    if (MVar13 == (Music)0x0) {
      StopPlaying(this,"Event.WitchBurning",2.0,false);
    }
  }
  else {
    fVar33 = *(float *)(MusicDynamicWitchNearMax._28_4_ + 0x2c);
    fVar29 = *(float *)(MusicDynamicWitchNearMin._28_4_ + 0x2c);
    if (fVar33 == fVar29) {
      fVar33 = (float)(~-(uint)(fVar33 <= SQRT(local_f0)) & 0x3f7d70a4);
LAB_008f0dd5:
      if (fVar33 == *(float *)(this + 0x188)) goto LAB_008f0de2;
LAB_008f1abc:
      (**(code **)(*(int *)this + 0xc))(this,this + 0x188);
      MVar13 = this[0x187];
      *(float *)(this + 0x188) = fVar33;
      if (MVar13 == (Music)0x0) goto LAB_008f1af5;
LAB_008f0df1:
      if (MVar8 != (Music)0x0) goto LAB_008f10e1;
      Play(this,"Event.WitchBurning",0,-1.0,false,false);
    }
    else {
      fVar33 = (SQRT(local_f0) - fVar29) / (fVar33 - fVar29);
      if (1.0 <= fVar33) {
        fVar33 = 1.0;
      }
      if (fVar33 <= 0.0) {
        fVar33 = local_dc;
      }
      fVar33 = fVar33 * 0.99;
      if (fVar33 < -0.01) {
        fVar33 = 1.0;
        goto LAB_008f0dd5;
      }
      if (fVar33 <= 0.99) {
        fVar33 = 1.0 - (fVar33 + 0.01);
        goto LAB_008f0dd5;
      }
      fVar33 = 0.0;
      if (*(float *)(this + 0x188) != 0.0) goto LAB_008f1abc;
LAB_008f0de2:
      MVar13 = this[0x187];
      if (MVar13 != (Music)0x0) goto LAB_008f0df1;
LAB_008f1af5:
      if (this[0x186] != (Music)0x0) {
        if (MVar7 == (Music)0x0) {
          Play(this,"Event.WitchAttack",0,-1.0,false,false);
          goto LAB_008f10cd;
        }
        if (MVar8 == (Music)0x0) goto LAB_008f0e30;
        Play(this,"Event.WitchAttack",0,-1.0,false,false);
        MVar13 = this[0x187];
        goto LAB_008f10e1;
      }
      if (((MVar6 != (Music)0x1) && (cVar11 != '\x01')) && (local_d4 != (CBaseEntity *)0x0)) {
        iVar24 = CBaseEntity::GetGender(local_d4);
        if (iVar24 == 0x13) {
          Play(this,"Event.WitchRageBride",local_e4,-1.0,false,true);
        }
        else {
          Play(this,"Event.WitchRage",local_e4,-1.0,false,true);
        }
      }
LAB_008f10cd:
      if (MVar8 != (Music)0x0) goto LAB_008f10da;
    }
  }
LAB_008f0e30:
  if ((MVar7 != (Music)0x0) && ((this[0x186] == (Music)0x0 || (this[0x187] != (Music)0x0)))) {
    StopPlaying(this,"Event.WitchAttack",2.0,false);
  }
  if (((cVar11 != '\0') && (this[0x187] == (Music)0x0)) && (this[0x186] == (Music)0x0)) {
    local_d4 = *(CBaseEntity **)(this + 0x1a8);
    if ((int)local_d4 < 1) {
      if (this[0x198] != (Music)0x0) {
        StopPlaying(this,"witchChoir",-1.0,true);
        this[0x198] = (Music)0x0;
      }
    }
    else {
      fVar33 = 1.0;
      iVar24 = 0;
      do {
        iVar15 = *(int *)(this + 0x19c);
        puVar4 = (uint *)(iVar15 + iVar24 * 4);
        uVar27 = *puVar4;
        if ((((uVar27 == 0xffffffff) ||
             (puVar23 = g_pEntityList + (uVar27 & 0xfff) * 0x10, puVar23 == (undefined *)0xfffffffc)
             ) || (*(uint *)(puVar23 + 8) != uVar27 >> 0xc)) ||
           ((*(int *)(puVar23 + 4) == 0 ||
            (iVar19 = __dynamic_cast(*(int *)(puVar23 + 4),&CBaseEntity::typeinfo,
                                     &Infected::typeinfo,0), iVar19 == 0)))) {
          if ((int)local_d4 < 1) {
            local_d4 = *(CBaseEntity **)(this + 0x1a8);
          }
          else {
            if (iVar24 != (int)local_d4 + -1) {
              *puVar4 = *(uint *)(iVar15 + ((int)local_d4 + -1) * 4);
            }
            local_d4 = (CBaseEntity *)(*(int *)(this + 0x1a8) + -1);
            *(CBaseEntity **)(this + 0x1a8) = local_d4;
          }
          iVar24 = iVar24 + -1;
        }
        else {
          if (*(float *)(iVar19 + 0x1d8c) <= fVar33) {
            fVar33 = *(float *)(iVar19 + 0x1d8c);
          }
          local_d4 = *(CBaseEntity **)(this + 0x1a8);
        }
        iVar24 = iVar24 + 1;
      } while (iVar24 < (int)local_d4);
      lVar26 = (longdouble)CountdownTimer::Now();
      if (*(float *)(this + 0x194) <= (float)lVar26) {
        if (fVar33 < 0.25) {
          Play(this,"Event.WanderingAngryWitch4",0,-1.0,false,false);
        }
        else if (fVar33 < 0.5) {
          Play(this,"Event.WanderingAngryWitch3",0,-1.0,false,false);
        }
        else if (0.75 <= fVar33) {
          Play(this,"Event.WanderingAngryWitch",0,-1.0,false,false);
        }
        else {
          Play(this,"Event.WanderingAngryWitch2",0,-1.0,false,false);
        }
        lVar26 = (longdouble)CountdownTimer::Now();
        if ((float)lVar26 + 2.5 != *(float *)(this + 0x194)) {
          (**(code **)(*(int *)(this + 0x18c) + 4))(this + 0x18c,this + 0x194);
          *(float *)(this + 0x194) = (float)lVar26 + 2.5;
        }
        if (*(float *)(this + 400) != 2.5) {
          (**(code **)(*(int *)(this + 0x18c) + 4))(this + 0x18c,this + 400);
          *(undefined4 *)(this + 400) = 0x40200000;
        }
        this[0x198] = (Music)0x1;
      }
    }
  }
  uVar22 = MusicDynamicAttackCIVeryCloseDecay._28_4_;
  local_c8[0] = 0;
  local_c8[1] = 0;
  local_c8[2] = 0;
  local_c8[3] = 0;
  local_c8[4] = 0;
  *(float *)(this + 0xfc) =
       (*(float *)(this + 0x2dc) - *(float *)(this + 0xfc)) *
       *(float *)(MusicDynamicAttackCICloseDecay._28_4_ + 0x2c) + *(float *)(this + 0xfc);
  local_b4[0] = 0;
  local_b4[1] = 0;
  local_b4[2] = 0;
  local_b4[3] = 0;
  local_b4[4] = 0;
  *(float *)(this + 0x100) =
       (*(float *)(this + 0x2e4) - *(float *)(this + 0x100)) * *(float *)(uVar22 + 0x2c) +
       *(float *)(this + 0x100);
                    /* try { // try from 008f0f62 to 008f106f has its CatchHandler @ 008f2b7d */
  iVar24 = CDirectorTacticalServices::GetSpecialZombiesInRange
                     (*(CDirectorTacticalServices **)(TheDirector + 0x628),
                      *(float *)(MusicDynamicSIInRangeMax._28_4_ + 0x2c),(CUtlVector *)local_c8,
                      (CUtlVector *)local_e0,*(CBaseEntity **)(this + 0x378));
  if (0 < iVar24) {
    local_d4 = (CBaseEntity *)0x0;
    do {
      uVar22 = *(undefined4 *)(local_c8[0] + (int)local_d4 * 4);
      pCVar9 = *(CBaseEntity **)(local_b4[0] + (int)local_d4 * 4);
      if (*(int *)(pCVar9 + 0x30) == 0) {
        iVar15 = 0;
      }
      else {
        iVar15 = *(int *)(pCVar9 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
                    /* try { // try from 008f1115 to 008f1972 has its CatchHandler @ 008f2b7d */
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 1)) {
        (**(code **)(*(int *)this + 0x98))(this,iVar15,uVar22);
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 2)) {
        (**(code **)(*(int *)this + 0x88))(this,iVar15,uVar22);
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 3)) {
        (**(code **)(*(int *)this + 0xac))(this,iVar15,uVar22);
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 6)) {
        (**(code **)(*(int *)this + 0xe8))(this,iVar15,uVar22);
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 4)) {
        (**(code **)(*(int *)this + 0xd0))(this,iVar15,uVar22);
      }
      iVar19 = CBaseEntity::GetTeamNumber(pCVar9);
      if ((iVar19 == 3) && (iVar19 = (**(code **)(*(int *)pCVar9 + 0x544))(pCVar9), iVar19 == 5)) {
        (**(code **)(*(int *)this + 0xc0))(this,iVar15,uVar22);
      }
      local_d4 = (CBaseEntity *)((int)local_d4 + 1);
    } while (local_d4 != (CBaseEntity *)iVar24);
  }
  fVar33 = *(float *)(this + 0x34);
  fVar29 = *(float *)(this + 0x100);
  if (*(float *)(this + 0x160) != 1.0) {
    (**(code **)(*(int *)this + 0xc))(this,this + 0x160);
    *(undefined4 *)(this + 0x160) = 0x3f800000;
  }
  if ((float)lVar25 != 0.0) {
    fVar28 = *(float *)(MusicDynamicCIDuckMax._28_4_ + 0x2c);
    fVar31 = fVar29 * 5.0;
    if (fVar33 <= fVar29 * 5.0) {
      fVar31 = fVar33;
    }
    fVar33 = *(float *)(MusicDynamicCIDuckMin._28_4_ + 0x2c);
    fVar29 = *(float *)(MusicDynamicCIDuckDamageMax._28_4_ + 0x2c);
    fVar5 = *(float *)(MusicDynamicCIDuckDamageMin._28_4_ + 0x2c);
    if (fVar31 <= fVar29) {
      if (fVar31 <= fVar5) {
        fVar31 = fVar5;
      }
      if (fVar29 != fVar5) goto LAB_008f1305;
      fVar28 = (float)(~-(uint)(fVar31 < fVar29) & (uint)fVar28 |
                      (uint)fVar33 & -(uint)(fVar31 < fVar29));
    }
    else {
      fVar31 = fVar29;
      if (fVar29 != fVar5) {
LAB_008f1305:
        fVar28 = fVar33 + ((fVar31 - fVar5) * (fVar28 - fVar33)) / (fVar29 - fVar5);
      }
    }
    if (1.0 - fVar28 != *(float *)(this + 0x160)) {
      (**(code **)(*(int *)this + 0xc))(this,this + 0x160);
      *(float *)(this + 0x160) = 1.0 - fVar28;
    }
  }
  fVar33 = *(float *)(MusicDynamicMobMax._28_4_ + 0x2c);
  fVar29 = *(float *)(this + 0x100) * 4.0;
  if (*(float *)(this + 0x34) <= *(float *)(this + 0x100) * 4.0) {
    fVar29 = *(float *)(this + 0x34);
  }
  fVar28 = *(float *)(MusicDynamicMobMin._28_4_ + 0x2c);
  fVar31 = *(float *)(MusicDynamicMobDamageMax._28_4_ + 0x2c);
  fVar5 = *(float *)(MusicDynamicMobDamageMin._28_4_ + 0x2c);
  if (fVar29 <= fVar31) {
    fVar32 = fVar29;
    if (fVar29 <= fVar5) {
      fVar32 = fVar5;
    }
    if (fVar31 != fVar5) goto LAB_008f13a2;
    fVar33 = (float)(~-(uint)(fVar32 < fVar31) & (uint)fVar33 |
                    (uint)fVar28 & -(uint)(fVar32 < fVar31));
  }
  else {
    fVar32 = fVar31;
    if (fVar31 != fVar5) {
LAB_008f13a2:
      fVar33 = fVar28 + ((fVar32 - fVar5) * (fVar33 - fVar28)) / (fVar31 - fVar5);
    }
  }
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0x84),(float)((uint)fVar33 & -(uint)(fVar5 <= fVar29)),
             *(float *)(MusicDynamicMobDecayTime._28_4_ + 0x2c),false,false);
  local_d0 = *(float *)(this + 0x84);
  if (local_d0 < 0.1) {
    local_d0 = 0.0;
  }
  if (local_d0 != *(float *)(this + 0x164)) {
    (**(code **)(*(int *)this + 0xc))(this,this + 0x164);
    *(float *)(this + 0x164) = local_d0;
  }
  cVar11 = (**(code **)(**(int **)(this + 0x378) + 0x7e8))(*(int **)(this + 0x378));
  fVar33 = *(float *)(this + 0x164);
  if (cVar11 == '\0') {
    if (*(float *)(this + 0x178) != fVar33) {
      if (fVar33 == 0.0) goto LAB_008f16ea;
      if (*(float *)(this + 0x178) == 0.0) {
        cVar11 = (**(code **)(**(int **)(this + 0x378) + 0x7e8))(*(int **)(this + 0x378));
        if (cVar11 == '\0') {
          this[0x104] = (Music)0x1;
          Play(this,"Event.Mobbed",0,-1.0,false,false);
        }
        goto LAB_008f170a;
      }
    }
  }
  else {
    if (fVar33 != 0.0) {
      (**(code **)(*(int *)this + 0xc))(this,this + 0x164);
      *(undefined4 *)(this + 0x164) = 0;
      fVar33 = 0.0;
    }
    if (fVar33 != *(float *)(this + 0x178)) {
LAB_008f16ea:
      StopPlaying(this,"Event.Mobbed",-1.0,false);
LAB_008f170a:
      fVar33 = *(float *)(this + 0x164);
    }
  }
  this_00 = TheDirector;
  *(float *)(this + 0x178) = fVar33;
  cVar11 = CDirector::IsFinale(this_00);
  fVar33 = 1.0;
  if ((((cVar11 == '\0') && (this[0x182] == (Music)0x0)) && (this[0x181] == (Music)0x0)) &&
     (((this[0x180] == (Music)0x0 && (this[0x183] == (Music)0x0)) &&
      ((this[0x184] == (Music)0x0 &&
       ((*(int *)(TheDirector + 0x1c0) < 1 && (fVar33 = 0.0, this[0x186] != (Music)0x0)))))))) {
    fVar33 = 1.0;
  }
  fVar29 = *(float *)(this + 0x280) * 5.0;
  if (*(float *)(this + 0x280) * 5.0 <= *(float *)(this + 0xc)) {
    fVar29 = *(float *)(this + 0xc);
  }
  if (fVar33 <= fVar29) {
    fVar33 = fVar29;
  }
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0xc0),fVar33,
             *(float *)(MusicDynamicActionDecay._28_4_ + 0x2c),false,false);
  fVar29 = 1.0;
  if (((iVar24 < 1) && (this[0x2f4] == (Music)0x0)) && (fVar29 = 0.0, this[0x185] != (Music)0x0)) {
    fVar29 = 1.0;
  }
  fVar28 = *(float *)(this + 0x280) + *(float *)(this + 0x280);
  if (fVar28 <= *(float *)(this + 0x2b4)) {
    fVar28 = *(float *)(this + 0x2b4);
  }
  if (fVar28 <= fVar29) {
    fVar28 = fVar29;
  }
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0xac),fVar28,
             *(float *)(MusicDynamicThreatDecay._28_4_ + 0x2c),false,true);
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0xd4),1.0 - fVar33,
             *(float *)(MusicDynamicCalmDecay._28_4_ + 0x2c),false,true);
  ScalarDeltaMeter::UpdateMeterMax
            ((ScalarDeltaMeter *)(this + 0xe8),(*(float *)(this + 0xd4) + -0.3) * 1.4285715,
             *(float *)(MusicDynamicAmbientDecay._28_4_ + 0x2c),false,false);
  fVar5 = *(float *)(this + 0xe8);
  fVar33 = *(float *)(MusicDynamicAmbientOutMax._28_4_ + 0x2c);
  fVar29 = *(float *)(MusicDynamicAmbientOutMin._28_4_ + 0x2c);
  fVar28 = *(float *)(MusicDynamicAmbientInMax._28_4_ + 0x2c);
  fVar31 = *(float *)(MusicDynamicAmbientInMin._28_4_ + 0x2c);
  if (fVar28 == fVar31) {
    if (fVar5 < fVar28) goto joined_r0x008f174d;
    if (1.0 < fVar33) goto LAB_008f1753;
joined_r0x008f27d3:
    if (fVar33 < 0.0) {
      fVar33 = 0.0;
    }
  }
  else {
    fVar28 = (fVar5 - fVar31) / (fVar28 - fVar31);
    if (1.0 <= fVar28) {
      fVar28 = 1.0;
    }
    if (fVar28 <= 0.0) {
      fVar28 = local_dc;
    }
    fVar29 = fVar28 * (fVar33 - fVar29) + fVar29;
joined_r0x008f174d:
    fVar33 = fVar29;
    if (fVar33 <= 1.0) goto joined_r0x008f27d3;
LAB_008f1753:
    fVar33 = 1.0;
  }
  fVar29 = *(float *)(this + 0x188);
  fVar28 = fVar33;
  if ((0.0 <= fVar29) && (fVar28 = local_dc, fVar29 <= 1.0)) {
    fVar28 = (1.0 - fVar29) * fVar33;
  }
  if (fVar28 != *(float *)(this + 0x1b4)) {
    (**(code **)(*(int *)this + 0xc))(this,this + 0x1b4);
    *(float *)(this + 0x1b4) = fVar28;
    fVar5 = *(float *)(this + 0xe8);
  }
  if (0.2 < fVar5) {
    lVar25 = (longdouble)CountdownTimer::Now();
    if (((float)lVar25 < *(float *)(this + 0x218)) || (*(int *)(this + 700) < 1)) {
      iVar24 = *(int *)(this + 0x1c8);
    }
    else {
      iVar24 = *(int *)(this + 0x1c8);
      if (iVar24 == 0) {
        fVar33 = *(float *)(MusicDynamicMobChoirIntervalBeats._28_4_ + 0x2c);
        iVar24 = RandomInt(1,*(undefined4 *)(MusicDynamicMobChoirIntervalRandMultMax._28_4_ + 0x30))
        ;
        fVar33 = (float)iVar24 * fVar33 * (60.0 / *(float *)(MusicDynamicMobChoirBPM._28_4_ + 0x2c))
        ;
        lVar25 = (longdouble)CountdownTimer::Now();
        if ((float)lVar25 + fVar33 != *(float *)(this + 0x218)) {
          (**(code **)(*(int *)(this + 0x210) + 4))(this + 0x210,this + 0x218);
          *(float *)(this + 0x218) = (float)lVar25 + fVar33;
        }
        if (fVar33 != *(float *)(this + 0x214)) {
                    /* try { // try from 008f29af to 008f2a95 has its CatchHandler @ 008f2b7d */
          (**(code **)(*(int *)(this + 0x210) + 4))(this + 0x210,this + 0x214);
          *(float *)(this + 0x214) = fVar33;
        }
        iVar24 = RandomInt(0,*(int *)(this + 700) + -1);
        iVar24 = *(int *)(*(int *)(*(int *)(this + 0x2c0) + iVar24 * 4) + 0x30);
        iVar15 = 0;
        if (iVar24 != 0) {
          iVar15 = iVar24 - *(int *)(gpGlobals + 0x58) >> 4;
        }
        *(int *)(this + 0x1c8) = iVar15;
        lVar25 = (longdouble)CountdownTimer::Now();
        if ((float)lVar25 + 0.1 != *(float *)(this + 0x1d4)) {
          (**(code **)(*(int *)(this + 0x1cc) + 4))(this + 0x1cc,this + 0x1d4);
          *(float *)(this + 0x1d4) = (float)lVar25 + 0.1;
        }
        if (*(float *)(this + 0x1d0) != 0.1) {
          (**(code **)(*(int *)(this + 0x1cc) + 4))(this + 0x1cc,this + 0x1d0);
          *(undefined4 *)(this + 0x1d0) = 0x3dcccccd;
        }
        goto LAB_008f17ac;
      }
    }
    if ((0 < iVar24) &&
       (lVar25 = (longdouble)CountdownTimer::Now(), *(float *)(this + 0x1d4) <= (float)lVar25)) {
      cVar11 = (**(code **)(*(int *)this + 0x14))(this);
      if (cVar11 == '\0') {
        Play(this,"Event.ZombieChoir",*(int *)(this + 0x1c8),-1.0,false,true);
      }
      else {
                    /* try { // try from 008f280d to 008f2928 has its CatchHandler @ 008f2b7d */
        Play(this,"Event.ZombieChoir_L4D1",*(int *)(this + 0x1c8),-1.0,false,true);
      }
      *(undefined4 *)(this + 0x1c8) = 0;
    }
  }
LAB_008f17ac:
  fVar33 = *(float *)(MusicDynamicSoloSuccessDamageMin._28_4_ + 0x2c);
  if (fVar33 == 1.0) {
    fVar33 = (float)(-(uint)(1.0 <= 1.0 - *(float *)(this + 0x34)) & 0x3f800000);
  }
  else {
    fVar33 = ((1.0 - *(float *)(this + 0x34)) - fVar33) / (1.0 - fVar33);
    if (1.0 <= fVar33) {
      fVar33 = 1.0;
    }
    if (fVar33 <= 0.0) {
      fVar33 = local_dc;
    }
  }
  fVar29 = *(float *)(this + 0x48);
  if (fVar33 <= *(float *)(this + 0x48)) {
    fVar29 = fVar33;
  }
  ScalarDeltaMeter::UpdateMeterDelta
            ((float)(this + 0x70),fVar29,*(float *)(MusicDynamicSoloSuccessIncrement._28_4_ + 0x2c),
             SUB41(*(undefined4 *)(MusicDynamicSoloSuccessDecayTime._28_4_ + 0x2c),0),false,false);
  fVar33 = *(float *)(this + 0x48) + *(float *)(this + 0x48);
  auVar30 = ZEXT812(0x3f800000);
  if (fVar33 <= 1.0) {
    auVar30._4_8_ = 0;
    auVar30._0_4_ = fVar33;
  }
  if (auVar30._0_4_ <= 0.0) {
    auVar10._8_4_ = 0;
    auVar10._0_8_ = auVar30._4_8_;
    auVar30 = auVar10 << 0x20;
  }
  if (auVar30._0_4_ != *(float *)(this + 0x16c)) {
    (**(code **)(*(int *)this + 0xc))(this,this + 0x16c);
    *(float *)(this + 0x16c) = auVar30._0_4_;
  }
  if (*(int *)(MusicDynamicOn._28_4_ + 0x30) < 1) goto LAB_008f19f1;
  iVar24 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(this + 0x378));
  if (iVar24 == 2) {
    if (*(int *)(this + 0x1dc) < 1) {
LAB_008f21ab:
      fVar33 = *(float *)(this + 0x108);
    }
    else {
                    /* try { // try from 008f2000 to 008f2392 has its CatchHandler @ 008f2b7d */
      cVar11 = CTerrorGameRules::IsScavengeMode();
      fVar33 = *(float *)(this + 0x108);
      if ((cVar11 == '\0') && (fVar33 == 0.0)) {
        cVar11 = (**(code **)(**(int **)(this + 0x378) + 0x7e8))(*(int **)(this + 0x378));
        if ((cVar11 == '\0') && ((*(int *)(TheDirector + 0x1c0) < 1 && (this[0x186] == (Music)0x0)))
           ) {
          this[0x104] = (Music)0x0;
          *(undefined4 *)(this + 0x108) = 0x3f800000;
          *(undefined4 *)(this + 0x48) = 0;
          *(undefined4 *)(this + 0x4c) = 0;
          if (*(float *)(this + 0x58) != -1.0) {
            (**(code **)(*(int *)(this + 0x50) + 4))(this + 0x50,this + 0x58);
            *(undefined4 *)(this + 0x58) = 0xbf800000;
          }
          cVar11 = (**(code **)(*(int *)this + 0x14))(this);
          if (cVar11 == '\0') {
            uVar22 = RandomInt(1,0xb);
            V_snprintf(local_a0,0x80,"Event.Zombat_Intro_%i",uVar22);
            Play(this,local_a0,0,-1.0,false,false);
          }
          else {
            Play(this,"Event.ZombatIntro_L4D1",0,-1.0,false,false);
          }
          iVar24 = GetWorldEntity();
          pcVar21 = "";
          if (*(char **)(iVar24 + 0x480) != (char *)0x0) {
            pcVar21 = *(char **)(iVar24 + 0x480);
          }
          iVar24 = _V_stricmp(pcVar21,"ThePassing");
          if (iVar24 == 0) {
            Play(this,"Event.Zombat_ThePassing",0,-1.0,false,false);
          }
          cVar11 = (**(code **)(*(int *)this + 0x14))(this);
          if (cVar11 == '\0') {
            (**(code **)(*(int *)this + 0x1c))(this,"Event.Zombat2_Intro",local_a0);
            Play(this,local_a0,0,-1.0,false,false);
            (**(code **)(*(int *)this + 0x1c))(this,"Event.Zombat3_Intro",local_a0);
            Play(this,local_a0,0,-1.0,false,false);
          }
          else {
            Play(this,"Event.Zombat2_L4D1",0,-1.0,false,false);
            Play(this,"Event.Zombat3_L4D1",0,-1.0,false,false);
          }
        }
        goto LAB_008f21ab;
      }
    }
    if (0.0 < fVar33) {
      fVar33 = *(float *)(this + 0x20);
      if (*(float *)(this + 0x20) <= *(float *)(this + 0x98)) {
        fVar33 = *(float *)(this + 0x98);
      }
      if (((((fVar33 < 0.01) || (this[0x104] != (Music)0x0)) ||
           (cVar11 = (**(code **)(**(int **)(this + 0x378) + 0x7e8))(*(int **)(this + 0x378)),
           cVar11 != '\0')) || ((0 < *(int *)(TheDirector + 0x1c0) || (this[0x186] != (Music)0x0))))
         || ((iVar24 = *(int *)(this + 0x284),
             iVar15 = CDirector::GetScriptValue
                                (TheDirector,"MusicDynamicMobStopSize",
                                 *(int *)(DirectorPrivate_DirectorMusicDynamicMobStopSize._28_4_ +
                                         0x30)), iVar24 <= iVar15 &&
             (iVar24 = *(int *)(this + 0x2f0),
             iVar15 = CDirector::GetScriptValue
                                (TheDirector,"MusicDynamicMobScanStopSize",
                                 *(int *)(DirectorPrivate_DirectorMusicDynamicMobScanStopSize._28_4_
                                         + 0x30)), iVar24 <= iVar15)))) {
        *(undefined4 *)(this + 0x1dc) = 0;
        this[0x104] = (Music)0x1;
        *(undefined4 *)(this + 0x108) = 0;
        iVar24 = GetWorldEntity();
        pcVar21 = "";
        if (*(char **)(iVar24 + 0x480) != (char *)0x0) {
          pcVar21 = *(char **)(iVar24 + 0x480);
        }
        iVar24 = _V_stricmp(pcVar21,"ThePassing");
        if (iVar24 == 0) {
          StopPlaying(this,"zombat_tp",2.0,true);
        }
        StopPlaying(this,"zombat",2.0,true);
        StopPlaying(this,"zombat2",2.0,true);
        StopPlaying(this,"zombat2c",2.0,true);
        StopPlaying(this,"zombat3",2.0,true);
      }
    }
  }
  else if (0.0 < *(float *)(this + 0x108)) {
    *(undefined4 *)(this + 0x1dc) = 0;
    this[0x104] = (Music)0x1;
    *(undefined4 *)(this + 0x108) = 0;
    StopPlaying(this,"zombat",2.0,true);
    StopPlaying(this,"zombat2",2.0,true);
    StopPlaying(this,"zombat2c",2.0,true);
    StopPlaying(this,"zombat3",2.0,true);
    iVar24 = GetWorldEntity();
    pcVar21 = "";
    if (*(char **)(iVar24 + 0x480) != (char *)0x0) {
      pcVar21 = *(char **)(iVar24 + 0x480);
    }
    iVar24 = _V_stricmp(pcVar21,"ThePassing");
    if (iVar24 == 0) {
                    /* try { // try from 008f2554 to 008f2558 has its CatchHandler @ 008f2b7d */
      StopPlaying(this,"zombat_tp",2.0,true);
    }
  }
  fVar33 = *(float *)(MusicDynamicMobActionMin._28_4_ + 0x2c);
  fVar29 = *(float *)(MusicDynamicMobActionCloseMax._28_4_ + 0x2c);
  fVar28 = *(float *)(MusicDynamicMobActionCloseMin._28_4_ + 0x2c);
  if (fVar29 == fVar28) {
    uVar27 = -(uint)(*(float *)(this + 0x2dc) < fVar29);
    fVar33 = (float)(~uVar27 & (uint)*(float *)(MusicDynamicMobActionMax._28_4_ + 0x2c) |
                    (uint)fVar33 & uVar27);
  }
  else {
    fVar33 = fVar33 + ((*(float *)(this + 0x2dc) - fVar28) *
                      (*(float *)(MusicDynamicMobActionMax._28_4_ + 0x2c) - fVar33)) /
                      (fVar29 - fVar28);
  }
  if (fVar33 <= 0.0) {
    fVar33 = local_dc;
  }
  fVar29 = 1.0;
  if (fVar33 <= 1.0) {
    fVar29 = fVar33;
  }
  if (fVar29 != *(float *)(this + 0x170)) {
                    /* try { // try from 008f1d3d to 008f1f4a has its CatchHandler @ 008f2b7d */
    (**(code **)(*(int *)this + 0xc))(this,this + 0x170);
    *(float *)(this + 0x170) = fVar29;
  }
LAB_008f19f1:
  local_b4[3] = 0;
  CUtlMemory<CTerrorPlayer*,int>::Purge(local_e0);
  local_b4[4] = local_b4[0];
  CUtlMemory<CTerrorPlayer*,int>::Purge(local_e0);
  local_c8[3] = 0;
  CUtlMemory<float,int>::Purge((CUtlMemory<float,int> *)local_c8);
  local_c8[4] = local_c8[0];
  CUtlMemory<float,int>::Purge((CUtlMemory<float,int> *)local_c8);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)