/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see .
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: SlowDeathBehavior.h /////////////////////////////////////////////////////////////////////////
// Author: Colin Day, December 2001
// Desc: Update that will count down a lifetime and destroy object when it reaches zero
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#ifndef __SlowDeathBehavior_H_
#define __SlowDeathBehavior_H_
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
#include "GameLogic/Module/BehaviorModule.h"
#include "GameLogic/Module/DieModule.h"
#include "GameLogic/Module/UpdateModule.h"
class FXList;
class ObjectCreationList;
class WeaponTemplate;
class DamageInfo;
//-------------------------------------------------------------------------------------------------
typedef std::vector FXListVec;
typedef std::vector OCLVec;
typedef std::vector WeaponTemplateVec;
//-------------------------------------------------------------------------------------------------
enum SlowDeathPhaseType
{
SDPHASE_INITIAL = 0,
SDPHASE_MIDPOINT,
SDPHASE_FINAL,
SD_PHASE_COUNT // keep last
};
#ifdef DEFINE_SLOWDEATHPHASE_NAMES
static const char *TheSlowDeathPhaseNames[] =
{
"INITIAL",
"MIDPOINT",
"FINAL",
NULL
};
#endif
//-------------------------------------------------------------------------------------------------
class SlowDeathBehaviorModuleData : public UpdateModuleData
{
public:
DieMuxData m_dieMuxData;
Real m_sinkRate;
Int m_probabilityModifier;
Real m_modifierBonusPerOverkillPercent;
UnsignedInt m_sinkDelay;
UnsignedInt m_sinkDelayVariance;
Real m_destructionAltitude;
UnsignedInt m_destructionDelay;
UnsignedInt m_destructionDelayVariance;
FXListVec m_fx[SD_PHASE_COUNT];
OCLVec m_ocls[SD_PHASE_COUNT];
WeaponTemplateVec m_weapons[SD_PHASE_COUNT];
Real m_flingForce;
Real m_flingForceVariance;
Real m_flingPitch;
Real m_flingPitchVariance;
enum
{
//flags used by m_maskOfLoadedEffects
HAS_FX = 1,
HAS_OCL = 2,
HAS_WEAPON = 4,
HAS_NON_LOD_EFFECTS = (HAS_OCL | HAS_WEAPON)
};
Byte m_maskOfLoadedEffects; ///m_dieMuxData.isDieApplicable(getObject(), damageInfo); }
protected:
void doPhaseStuff(SlowDeathPhaseType sdphase);
inline Bool isSlowDeathActivated() const { return (m_flags & (1<