Lua API: Add onSkipTurn callback, called when hog skips
authorWuzzy <Wuzzy2@mail.ru>
Mon, 12 Mar 2018 12:37:35 +0100
changeset 13176 9f80c08cdae9
parent 13175 98a0edb4bb5a
child 13177 159004144897
Lua API: Add onSkipTurn callback, called when hog skips
ChangeLog.txt
hedgewars/uGears.pas
--- a/ChangeLog.txt	Mon Mar 12 12:27:13 2018 +0100
+++ b/ChangeLog.txt	Mon Mar 12 12:37:35 2018 +0100
@@ -106,6 +106,7 @@
  + New call: SkipTurn(): Force current hedgehog to skip turn
  + New param: PlaySound accepts 3rd parameter for voices: instaVoice: If true, sound plays instantly instead of being queued
  + New callback: onEndTurn(): Called at the end of a turn (when gears have settled)
+ + New callback: onSkipTurn(): Called when a hog skips turn
  + New hedgehog effect: heArtillery: Per-hedgehog artillery mode (can't walk). Values: 1 = permanently active. 2 = temporarily active (sniper rifle). 0 = not active
  * AddAmmo now automatically unselects weapon if it would remove current ammo from current hedgehog
  * Fix call: SetWeapon(amNothing) now unselects weapon
--- a/hedgewars/uGears.pas	Mon Mar 12 12:27:13 2018 +0100
+++ b/hedgewars/uGears.pas	Mon Mar 12 12:37:35 2018 +0100
@@ -1119,7 +1119,8 @@
 if not isExternalSource then
     SendIPC(_S',');
 uStats.Skipped;
-skipFlag:= true
+skipFlag:= true;
+ScriptCall('onSkipTurn');
 end;
 
 procedure chHogSay(var s: shortstring);