LuaAPI: Add Retreat
Sat, 21 Apr 2018 16:26:26 +0100
changeset 1325 14223a7d3c15
parent 1324 bb87061fc23f
child 1326 81f8f7659f50
LuaAPI: Add Retreat
--- a/	Thu Apr 19 13:19:35 2018 +0100
+++ b/	Sat Apr 21 16:26:26 2018 +0100
@@ -1034,10 +1034,19 @@
 Forces the current hedgehog to skip its turn.
 ==== `EndTurn([noTaunts])` (0.9.23) ====
-Ends the current turn.
+Ends the current turn immediately.
 Normally, a “Coward” taunt may be played and an announcer message may be shown (depending on the situation). Set the optional `noTaunts` parameter to `true` to force the engine to never play a taunt or show a message. `noTaunts` is `false` by default.
+=== `Retreat(time [, respectGetAwayTimeFactor)` (0.9.25) ===
+Forces the current turn into the retreating phase, as if the hog made an attack. That is, the current hedgehog is unable to attack or select a weapon, only movement is possible until the retreat time is up.
+The retreat time must be set with `time` in milliseconds. By default, this time is automatically multiplied with get-away time percentage from the game scheme for seamless integration with schemes. If you want to ignore the game scheme for some reason and set the retreat time no matter what, set `respectGetAwayTimeFactor` to `false`.
+If the current hedgehog was busy doing an attack, the attack is aborted, no shot is made. If this function is called in the ready phase of af a turn, the ready phase is not stopped immediately, but the turn will begin in the retreat phase instead.
+Note: If you want the turn to end instantly, it is recommended to use `EndTurn` instead.
 ==== <tt>!EndGame()</tt> ====
 Makes the game end.