/
extraPowerTime()
Other great resources: Official JS API docs, Scripting Forum
extraPowerTime()
Aubergine
Owned by Aubergine
Increase the player's power reserve as if they'd played the game for an additional number of seconds...
Syntax
extraPowerTime(time, player);
Parameters
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 |
Return value
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 |
Notes
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.
Examples
Give 'me' 20 seconds-worth of extra power
extraPowerTime( 20 );
Give me extra power as if I'd waited until the mission timer ran out...
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.
Availability 3.2+
Requires:
- Warzone 3.2 and above
Contents
Jump to:
See also
Related articles:
- getMissionTime() – if a player completes a mission early, you can find out how much time they have left and give them power equivalent to that amount of time
- setPowerModifier() – optionally increase or decrease the rate of power income before applying the extra power bonus
, multiple selections available,