From RGWiki
Contents
- 1 TSTK Reference: TGB - easyDamageEnergy
- 1.1 damage.cs
- 1.1.1 t2dSceneObject::initDamage(%this, %max, %disabledAt, %destroyedAt, %autoRepairRate )
- 1.1.2 t2dSceneObject::getMaxDamage(%this)
- 1.1.3 t2dSceneObject::setMaxDamage(%this, %max, %skipTest )
- 1.1.4 t2dSceneObject::getCurrentDamage(%this)
- 1.1.5 t2dSceneObject::getCurrentDamagePercent(%this)
- 1.1.6 t2dSceneObject::setCurrentDamage(%this, %current, %skipTest )
- 1.1.7 t2dSceneObject::getDisabledAtDamage(%this)
- 1.1.8 t2dSceneObject::setDisabledAtDamage(%this, %disabledAt, %skipTest )
- 1.1.9 t2dSceneObject::getDestroyedAtDamage(%this)
- 1.1.10 t2dSceneObject::setDestroyedAtDamage(%this, %destroyedAt, %skipTest )
- 1.1.11 t2dSceneObject::getAutoRepairRate(%this)
- 1.1.12 t2dSceneObject::setAutoRepairRate(%this, %autoRepairRate, %skipTest )
- 1.1.13 t2dSceneObject::applyDamage( %this , %amount )
- 1.1.14 t2dSceneObject::repairDamage( %this , %amount )
- 1.1.15 t2dSceneObject::applyDamageOverTime( %this , %period, %duration, %totalDamage )
- 1.1.16 t2dSceneObject::repairDamageOverTime( %this , %period, %duration, %totalRepair )
- 1.1.17 t2dSceneObject::autoRepairDamage( %this )
- 1.1.18 t2dSceneObject::test_DestroyedDamage( %this )
- 1.1.19 t2dSceneObject::test_DisabledDamage( %this )
- 1.1.20 t2dSceneObject::test_EnabledDamage( %this )
- 1.1.21 t2dSceneObject::autoReportDMG(%this,%period)
- 1.2 energy.cs
- 1.2.1 t2dSceneObject::initEnergy(%this, %max, %disabledAt, %destroyedAt, %autoRechargeRate )
- 1.2.2 t2dSceneObject::getMaxEnergy(%this)
- 1.2.3 t2dSceneObject::setMaxEnergy(%this, %max, %skipTest )
- 1.2.4 t2dSceneObject::getCurrentEnergy(%this)
- 1.2.5 t2dSceneObject::getCurrentEnergyPercent(%this)
- 1.2.6 t2dSceneObject::setCurrentEnergy(%this, %current, %skipTest )
- 1.2.7 t2dSceneObject::getDisabledAtEnergy(%this)
- 1.2.8 t2dSceneObject::setDisabledAtEnergy(%this, %disabledAt, %skipTest )
- 1.2.9 t2dSceneObject::getDestroyedAtEnergy(%this)
- 1.2.10 t2dSceneObject::setDestroyedAtEnergy(%this, %destroyedAt, %skipTest )
- 1.2.11 t2dSceneObject::getAutoRechargeRate(%this)
- 1.2.12 t2dSceneObject::setAutoRechargeRate(%this, %autoRechargeRate, %skipTest )
- 1.2.13 t2dSceneObject::drainEnergy( %this , %amount )
- 1.2.14 t2dSceneObject::rechargeEnergy( %this , %amount )
- 1.2.15 t2dSceneObject::drainEnergyOverTime( %this , %period, %duration, %totalEnergy )
- 1.2.16 t2dSceneObject::rechargeEnergyOverTime( %this , %period, %duration, %totalRecharge )
- 1.2.17 t2dSceneObject::autoRechargeEnergy( %this )
- 1.2.18 t2dSceneObject::test_DestroyedEnergy( %this )
- 1.2.19 t2dSceneObject::test_DisabledEnergy( %this )
- 1.2.20 t2dSceneObject::test_EnabledEnergy( %this )
- 1.2.21 t2dSceneObject::autoReportENG(%this,%period)
- 1.3 helperMethods.cs
|
TSTK Reference: TGB - easyDamageEnergy
damage.cs
The following section documents all of the functions found in the file: TSTK/TGB/easyDamageEnergy/damage.cs.
t2dSceneObject::initDamage(%this, %max, %disabledAt, %destroyedAt, %autoRepairRate )
| Description: Initialize easy damage settings for this object.
|
| %max - Maximum damage this object can take. i.e. Hit Points
|
| %disabledAt - Damage point value at which the object should be considered disable. (-1 means can't be disabled)
|
| %destroyedAt - Damage point value at which the object should be considered destroyed. (-1 means can't be destroyed)
|
| %autoRepairRate - Damage points per/second that should be repaired when the object is damaged.
|
Top
t2dSceneObject::getMaxDamage(%this)
| Description: Returns the maximum damage points this object should assigned.
|
Top
t2dSceneObject::setMaxDamage(%this, %max, %skipTest )
| Description: Sets the maximum damage points this object should assigned.
|
| Unless %skipTest is set to true, , the object is tested for damage to see if it needs to be repaired.
|
Top
t2dSceneObject::getCurrentDamage(%this)
| Description: Returns the current damage points for this object.
|
Top
t2dSceneObject::getCurrentDamagePercent(%this)
| Description: Returns the current damage as a percentage value (between 0 and 100) for this object.
|
Top
t2dSceneObject::setCurrentDamage(%this, %current, %skipTest )
| Description: Sets the curred damage points for this object.
|
| Unless %skipTest is set to true, , the object is tested for damage to see if it needs to be repaired.
|
Top
t2dSceneObject::getDisabledAtDamage(%this)
| Description: Returns the disabled at damage points level for this object.
|
Top
t2dSceneObject::setDisabledAtDamage(%this, %disabledAt, %skipTest )
| Description: Sets the disabled at damage points level for this object.
|
| If %skipTest is not set to true, this object is also tested to see if it should now be disabled.
|
Top
t2dSceneObject::getDestroyedAtDamage(%this)
| Description: Returns the destroyed at damage points level for this object.
|
Top
t2dSceneObject::setDestroyedAtDamage(%this, %destroyedAt, %skipTest )
| Description: Sets the destroyed at damage points level for this object.
|
| If %skipTest is not set to true, this object is also tested to see if it should now be destroyed.
|
Top
t2dSceneObject::getAutoRepairRate(%this)
| Description: Returns the auto-repair rate for this object.
|
Top
t2dSceneObject::setAutoRepairRate(%this, %autoRepairRate, %skipTest )
| Description: Sets the auto-repair rate for this object.
|
| If %skipTest is not set to true, this object is also tested to see if it should now be auto-repaired.
|
Top
t2dSceneObject::applyDamage( %this , %amount )
| Description: Attempt to apply the specified amount of damage to this object.
|
| If the amount is negative, do repair instead.
|
| If damage is successfully applied, broadcast the onDamage() method to all behaviors on this object with the actual damage done.
|
Top
t2dSceneObject::repairDamage( %this , %amount )
| Description: Attempt to apply the specified amount of repair to this object.
|
| If the amount is negative, do damage instead.
|
| If repair is successfully applied, broadcast the onRepair() method to all behaviors on this object with the actual repair done.
|
Top
t2dSceneObject::applyDamageOverTime( %this , %period, %duration, %totalDamage )
| Description: Apply damage to this object over time, where a portion of the total damage is applied every %period.
|
| The damage done per period is calculated as: %totalDamage / ( %duration / %period )
|
Top
t2dSceneObject::repairDamageOverTime( %this , %period, %duration, %totalRepair )
| Description: Apply repair to this object over time, where a portion of the total repair is applied every %period.
|
| The repair done per period is calculated as: %totalRepair / ( %duration / %period )
|
Top
t2dSceneObject::autoRepairDamage( %this )
| Description: Internal only. Called automatically in a number of cases to attempt to auto-repair this object.
|
Top
t2dSceneObject::test_DestroyedDamage( %this )
| Description: Test to see if this object should be destroyed and if so, destroy it.
|
Top
t2dSceneObject::test_DisabledDamage( %this )
| Description: Test to see if this object should be disabled and if so, disable it.
|
Top
t2dSceneObject::test_EnabledDamage( %this )
| Description: Test to see if this object should be disabled and if so, disable it.
|
Top
t2dSceneObject::autoReportDMG(%this,%period)
| Description: Internal only. Prints the current damage and other metrics for this object repeatedly every period.
|
Top
energy.cs
The following section documents all of the functions found in the file: TSTK/TGB/easyDamageEnergy/energy.cs.
t2dSceneObject::initEnergy(%this, %max, %disabledAt, %destroyedAt, %autoRechargeRate )
| Description: Initialize easy energy settings for this object.
|
| %max - Maximum damage this object can take. i.e. Hit Points
|
| %disabledAt - Energy point value at which the object should be considered disable. (-1 means can't be disabled)
|
| %destroyedAt - Energy point value at which the object should be considered destroyed. (-1 means can't be destroyed)
|
| %autoRechargeRate - Energy points per/second that should be repaired when the object is drained.
|
Top
t2dSceneObject::getMaxEnergy(%this)
| Description: Returns the maximum energy points this object should assigned.
|
Top
t2dSceneObject::setMaxEnergy(%this, %max, %skipTest )
| Description: Sets the maximum energy points this object should assigned.
|
| Unless %skipTest is set to true, the object is tested for drain to see if it needs to be recharged.
|
Top
t2dSceneObject::getCurrentEnergy(%this)
| Description: Returns the current energy points for this object.
|
Top
t2dSceneObject::getCurrentEnergyPercent(%this)
| Description: Returns the current energy as a percentage value (between 0 and 100) for this object.
|
Top
t2dSceneObject::setCurrentEnergy(%this, %current, %skipTest )
| Description: Sets the current energy points this object should assigned.
|
| Unless %skipTest is set to true, the object is tested for drain to see if it needs to be recharged.
|
Top
t2dSceneObject::getDisabledAtEnergy(%this)
| Description: Returns the disabled at energy points level for this object.
|
Top
t2dSceneObject::setDisabledAtEnergy(%this, %disabledAt, %skipTest )
| Description: Sets the maximum energy points this object should assigned.
|
| Unless %skipTest is set to true, , the object is tested for drain to see if it needs to be recharged.
|
Top
t2dSceneObject::getDestroyedAtEnergy(%this)
| Description: Returns the destroyed at energy points level for this object.
|
Top
t2dSceneObject::setDestroyedAtEnergy(%this, %destroyedAt, %skipTest )
| Description: Sets the maximum energy points this object should assigned.
|
| Unless %skipTest is set to true, , the object is tested for drain to see if it needs to be recharged.
|
Top
t2dSceneObject::getAutoRechargeRate(%this)
| Description: Returns the auto-repair rate for this object.
|
Top
t2dSceneObject::setAutoRechargeRate(%this, %autoRechargeRate, %skipTest )
| Description: Sets the auto-repair rate for this object.
|
| If %skipTest is not set to true, this object is also tested to see if it should now be auto-repaired.
|
Top
t2dSceneObject::drainEnergy( %this , %amount )
| Description: Attempt to apply the specified amount of energy drain to this object.
|
| If the amount is negative, do recharge instead.
|
| If energy is successfully drained, broadcast the onDrain() method to all behaviors on this object with the actual drain done.
|
Top
t2dSceneObject::rechargeEnergy( %this , %amount )
| Description: Attempt to apply the specified amount of repair to this object.
|
| If the amount is negative, do drain instead.
|
| If repair is successfully applied, broadcast the onRepair() method to all behaviors on this object with the actual repair done.
|
Top
t2dSceneObject::drainEnergyOverTime( %this , %period, %duration, %totalEnergy )
| Description: Apply energy drain to this object over time, where a portion of the total drain is applied every %period.
|
| The drain done per period is calculated as: %totalEnergy / ( %duration / %period )
|
Top
t2dSceneObject::rechargeEnergyOverTime( %this , %period, %duration, %totalRecharge )
| Description: Apply repair to this object over time, where a portion of the total repair is applied every %period.
|
| The repair done per period is calculated as: %totalRepair / ( %duration / %period )
|
Top
t2dSceneObject::autoRechargeEnergy( %this )
| Description: Internal only. Called automatically in a number of cases to attempt to auto-recharge this object.
|
Top
t2dSceneObject::test_DestroyedEnergy( %this )
| Description: Test to see if this object should be destroyed and if so, destroy it.
|
Top
t2dSceneObject::test_DisabledEnergy( %this )
| Description: Test to see if this object should be disabled and if so, disable it.
|
Top
t2dSceneObject::test_EnabledEnergy( %this )
| Description: Test to see if this object should be disabled and if so, disable it.
|
Top
t2dSceneObject::autoReportENG(%this,%period)
| Description: Internal only. Prints the current energy and other metrics for this object repeatedly every period.
|
Top
helperMethods.cs
The following section documents all of the functions found in the file: TSTK/TGB/easyDamageEnergy/helperMethods.cs.
t2dSceneObject::getIsDestroyed( %this )
| Description: Returns true if this object has been marked as destroyed.
|
Top
t2dSceneObject::getIsDisabled( %this )
| Description: Returns true if this object has been marked as disabled.
|
Top
t2dSceneObject::setIsDestroyed( %this, %status )
| Description: Mark this object as destroyed.
|
Top
t2dSceneObject::setIsDisabled( %this, %status )
| Description: Mark this object as disabled.
|
Top
t2dSceneObject::destroyObject( %this )
| Description: Destroy this object if it is not already destroyed and broadcast the method onDestroyed() to call behaviors on this object.
|
Top
t2dSceneObject::disableObject( %this )
| Description: Disable this object if it is not already disabled and broadcast the method onDisabled() to call behaviors on this object.
|
Top
t2dSceneObject::enableObject( %this )
| Description: Enable this object if it is disabled and broadcast the method onEnabled() to call behaviors on this object.
|
Top