Engine:
authorsmxx
Thu, 25 Feb 2010 13:02:08 +0000
changeset 2863 9eb53b1f1842
parent 2862 1d15ca7b7f64
child 2864 bb0726eb85ba
Engine: * Added a new window to the game's start that shows special rules affecting the current game (e.g. karma or low gravity)
hedgewars/uLocale.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/missions.png
share/hedgewars/Data/Locale/en.txt
--- a/hedgewars/uLocale.pas	Thu Feb 25 12:49:04 2010 +0000
+++ b/hedgewars/uLocale.pas	Thu Feb 25 13:02:08 2010 +0000
@@ -38,11 +38,14 @@
 			eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf,
 			eidHomerun, eidFrozen);
 
+	TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable, gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, gidSolidLand);
+
 const MAX_EVENT_STRINGS = 100;
 var trammo: array[TAmmoStrId] of string;
     trammoc: array[TAmmoStrId] of string;
     trammod: array[TAmmoStrId] of string;
     trmsg: array[TMsgStrId] of string;
+    trgoal: array[TGoalStrId] of string;
 
 procedure LoadLocale(FileName: string);
 function Format(fmt: shortstring; var arg: shortstring): shortstring;
@@ -103,6 +106,7 @@
                end;
            3: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammoc[TAmmoStrId(b+1)]:= s;
            4: if (b >=0) and (b <= ord(High(TAmmoStrId))) then trammod[TAmmoStrId(b+1)]:= s;
+           5: if (b >=0) and (b <= ord(High(TGoalStrId))) then trgoal[TGoalStrId(b)]:= s;
            end;
        end;
    Close(f)
--- a/hedgewars/uWorld.pas	Thu Feb 25 12:49:04 2010 +0000
+++ b/hedgewars/uWorld.pas	Thu Feb 25 13:02:08 2010 +0000
@@ -75,6 +75,14 @@
 procedure InitWorld;
 var i, t: LongInt;
     cp: PClan;
+    g: ansistring;
+
+    // helper function to create the goal/game mode string
+    function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId): ansistring;
+    begin
+        if (GameFlags and gf) <> 0 then s:= s + trgoal[si] + '|';
+        AddGoal:= s;
+    end;
 begin
 missionTimer:= 0;
 
@@ -97,6 +105,20 @@
    CurrentTeam:= ClansArray[0]^.Teams[0];
    end;
 
+// if special game flags are set, add them to the game mode notice window and then show it
+g:= ''; // no text/things to note yet
+g:= AddGoal(g, gfForts, gidForts); // forts?
+g:= AddGoal(g, gfLowGravity, gidLowGravity); // low gravity?
+g:= AddGoal(g, gfInvulnerable, gidInvulnerable); // invulnerability?
+g:= AddGoal(g, gfVampiric, gidVampiric); // vampirism?
+g:= AddGoal(g, gfKarma, gidKarma); // karma?
+g:= AddGoal(g, gfKing, gidKing); // king?
+g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
+g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
+g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
+// if the string has been set, show it for (default timeframe) seconds
+if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
+
 cWaveWidth:= SpritesData[sprWater].Width;
 //cWaveHeight:= SpritesData[sprWater].Height;
 cWaveHeight:= 32;
Binary file share/hedgewars/Data/Graphics/missions.png has changed
--- a/share/hedgewars/Data/Locale/en.txt	Thu Feb 25 12:49:04 2010 +0000
+++ b/share/hedgewars/Data/Locale/en.txt	Thu Feb 25 13:02:08 2010 +0000
@@ -446,3 +446,16 @@
 04:38=The sniper rifle can be the most devastating weapon|in your whole arsenal, however it's very ineffective|at close quarters. The damage dealt increases with|the distance to its target.|Attack: Shoot (once)
 04:39=Fly to other parts of the map using the flying|saucer. This hard to master utility is able to|take you to almost any position on the battlefield.|Attack: Activate|Up/Left/Right: Apply force into one direction
 04:40=Set some ground on fire using this bottle filled|with (soon to be) burning liquid.|Attack: Hold to shoot with more power
+
+; Game goal strings
+05:00=Game Modes
+05:01=The following rules apply
+05:02=Forts: Defend your fortress; vanquish your enemies!
+05:03=Low Gravity: Watch your step
+05:04=Invulnerability: Hogs are (almost) invulnerable
+05:05=Vampirism: Hogs will be healed for the damage dealt
+05:06=Karma: Hogs will be damaged for the damage dealt
+05:07=Protect the King: Don''t let your king die!
+05:08=Place Hedgehogs: Place your hogs before the game starts
+05:09=Artillery: Hogs can't walk to change position
+05:10=Indestructible Terrain: Most weapons won't destroy terrain
\ No newline at end of file