mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Add getMaxDamage() method. This will be needed for the forthcoming HealthTextHud GuiControl.
This commit is contained in:
parent
a6f54b7b44
commit
99e8bcb817
2 changed files with 15 additions and 0 deletions
|
|
@ -1632,6 +1632,11 @@ F32 ShapeBase::getDamageValue()
|
||||||
return mDamage / mDataBlock->maxDamage;
|
return mDamage / mDataBlock->maxDamage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
F32 ShapeBase::getMaxDamage()
|
||||||
|
{
|
||||||
|
return mDataBlock->maxDamage;
|
||||||
|
}
|
||||||
|
|
||||||
void ShapeBase::updateDamageLevel()
|
void ShapeBase::updateDamageLevel()
|
||||||
{
|
{
|
||||||
if (mDamageThread) {
|
if (mDamageThread) {
|
||||||
|
|
@ -4534,6 +4539,13 @@ DefineEngineMethod( ShapeBase, getDamagePercent, F32, (),,
|
||||||
{
|
{
|
||||||
return object->getDamageValue();
|
return object->getDamageValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(ShapeBase, getMaxDamage, F32, (),,
|
||||||
|
"Get the object's maxDamage level.\n"
|
||||||
|
"@return datablock.maxDamage\n")
|
||||||
|
{
|
||||||
|
return object->getMaxDamage();
|
||||||
|
}
|
||||||
|
|
||||||
DefineEngineMethod( ShapeBase, setDamageState, bool, ( const char* state ),,
|
DefineEngineMethod( ShapeBase, setDamageState, bool, ( const char* state ),,
|
||||||
"@brief Set the object's damage state.\n\n"
|
"@brief Set the object's damage state.\n\n"
|
||||||
|
|
|
||||||
|
|
@ -1265,6 +1265,9 @@ public:
|
||||||
///
|
///
|
||||||
/// @return Damage factor, between 0.0 - 1.0
|
/// @return Damage factor, between 0.0 - 1.0
|
||||||
F32 getDamageValue();
|
F32 getDamageValue();
|
||||||
|
|
||||||
|
/// Returns the datablock.maxDamage value
|
||||||
|
F32 getMaxDamage();
|
||||||
|
|
||||||
/// Returns the rate at which the object regenerates damage
|
/// Returns the rate at which the object regenerates damage
|
||||||
F32 getRepairRate() { return mRepairRate; }
|
F32 getRepairRate() { return mRepairRate; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue