TSTK Reference: TGB Easy Damage & Energy

From RGWiki

Jump to: navigation, search

Contents

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

Personal tools