Increase the player's power reserve as if they'd played the game for an additional number of seconds... |
extraPowerTime(time, player); |
Parameter | Type | Mandatory | Notes | Game Version |
---|---|---|---|---|
time | Number | The extra time, in seconds, the player is granted. | 3.2 | |
player | Number | The ID of the player who will get the power boost. Default: me | 3.2 |
Value | Type | Notes | Game Version |
---|---|---|---|
undefined | Undefined | If the timer is set, nothing is returned. | 3.1 Beta 1 |
<error> | Error | Invalid parameters. | 3.1 Beta 1 |
This function is most commonly used in campaign and challenge games to reward players for finishing a level or mission with time to spare.
You can optionally boost the power using setPowerModifier() prior to giving the player extra power, to increase the incentive for finishing a mission quickly.
extraPowerTime( 20 ); |
var bonusTime = getMissionTime(); if (bonusTime > 0) { setPowerModifier(125); // 25% bonus for completing mission quickly extraPowerTime(bonusTime); setPowerModifier(100); } |
This function should only be used in single player games, otherwise it will cause a desynch. |
AvailabilityRequires:
|
ContentsJump to: |
See alsoRelated articles:
|