Merged default
authorvitiv <nikita.utiu@gmail.com>
Tue, 08 Jan 2013 21:29:37 +0200
changeset 8367 2506ed09f4be
parent 8364 fbc9bcc6c39d (current diff)
parent 8366 67c7ba2b82a3 (diff)
child 8380 0b375a3ceaa0
Merged default
--- a/QTfrontend/res/xml/tips.xml	Tue Jan 08 21:27:35 2013 +0200
+++ b/QTfrontend/res/xml/tips.xml	Tue Jan 08 21:29:37 2013 +0200
@@ -6,7 +6,7 @@
     <tip>Simply pick the same color as a friend to play together as a team. Each of you will still control his or her own hedgehogs but they'll win or lose together.</tip>
     <tip>Some weapons might do only low damage but they can be a lot more devastating in the right situation. Try to use the Desert Eagle to knock multiple hedgehogs into the water.</tip>
     <tip>If you're unsure what to do and don't want to waste ammo, skip one round. But don't let too much time pass as there will be Sudden Death!</tip>
-    <tip>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground you'll reuse your rope without wasting ammo!</tip>
+    <tip>Want to save ropes? Release the rope in mid air and then shoot again. As long as you don't touch the ground or miss a shot you'll reuse your rope without wasting ammo!</tip>
     <tip>If you'd like to keep others from using your preferred nickname on the official server, register an account at http://www.hedgewars.org/.</tip>
     <tip>You're bored of default gameplay? Try one of the missions - they'll offer different gameplay depending on the one you picked.</tip>
     <tip>By default the game will always record the last game played as a demo. Select 'Local Game' and pick the 'Demos' button on the lower right corner to play or manage them.</tip>
--- a/hedgewars/uScript.pas	Tue Jan 08 21:27:35 2013 +0200
+++ b/hedgewars/uScript.pas	Tue Jan 08 21:29:37 2013 +0200
@@ -37,6 +37,7 @@
 procedure ScriptLoad(name : shortstring);
 procedure ScriptOnGameInit;
 procedure ScriptOnScreenResize;
+procedure ScriptSetInteger(name : shortstring; value : LongInt);
 
 procedure ScriptCall(fname : shortstring);
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
@@ -224,6 +225,30 @@
     lc_hidemission:= 0;
 end;
 
+function lc_enablegameflags(L : Plua_State) : LongInt; Cdecl;
+var i : integer;
+begin
+    for i:= 1 to lua_gettop(L) do
+        if (GameFlags and lua_tointeger(L, i)) = 0 then
+            GameFlags += lua_tointeger(L, i);
+    ScriptSetInteger('GameFlags', GameFlags);
+end;
+
+function lc_disablegameflags(L : Plua_State) : LongInt; Cdecl;
+var i : integer;
+begin
+    for i:= 1 to lua_gettop(L) do
+        if (GameFlags and lua_tointeger(L, i)) <> 0 then
+            GameFlags -= lua_tointeger(L, i);
+    ScriptSetInteger('GameFlags', GameFlags);
+end;
+
+function lc_cleargameflags(L : Plua_State) : LongInt; Cdecl;
+begin
+    GameFlags:= 0;
+    ScriptSetInteger('GameFlags', GameFlags);
+end;
+
 function lc_addcaption(L : Plua_State) : LongInt; Cdecl;
 begin
     if lua_gettop(L) = 1 then
@@ -2335,6 +2360,9 @@
 lua_register(luaState, _P'GetInputMask', @lc_getinputmask);
 lua_register(luaState, _P'SetInputMask', @lc_setinputmask);
 lua_register(luaState, _P'AddGear', @lc_addgear);
+lua_register(luaState, _P'EnableGameFlags', @lc_enablegameflags);
+lua_register(luaState, _P'DisableGameFlags', @lc_disablegameflags);
+lua_register(luaState, _P'ClearGameFlags', @lc_cleargameflags);
 lua_register(luaState, _P'DeleteGear', @lc_deletegear);
 lua_register(luaState, _P'AddVisualGear', @lc_addvisualgear);
 lua_register(luaState, _P'DeleteVisualGear', @lc_deletevisualgear);
--- a/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Tue Jan 08 21:27:35 2013 +0200
+++ b/share/hedgewars/Data/Missions/Training/Basic_Training_-_Bazooka.lua	Tue Jan 08 21:29:37 2013 +0200
@@ -64,7 +64,15 @@
 	-- The base number for the random number generator
 	Seed = 1
 	-- Game settings and rules
-	GameFlags = gfMultiWeapon + gfOneClanMode + gfSolidLand
+    EnableGameFlags(gfMultiWeapon, gfOneClanMode, gfSolidLand)
+    -- Uncommenting this wouldn't do anything
+    --EnableGameFlags(gfMultiWeapon, gfOneClanMode, gfSolidLand)
+    -- Neither this
+    --DisableGameFlags(gfArtillery)
+    -- Uncommenting this would make the terrain damageable
+    --DisableGameFlags(gfSolidLand)
+    -- Uncommenting this would remove all flags set previously
+    --ClearGameFlags()
 	-- The time the player has to move each round (in ms)
 	TurnTime = 60000
 	-- The frequency of crate drops