18 |
18 |
19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uLocale; |
21 unit uLocale; |
22 interface |
22 interface |
23 type TAmmoStrId = (sidNothing, sidGrenade, sidClusterBomb, sidBazooka, sidBee, sidShotgun, |
23 uses uTypes; |
24 sidPickHammer, sidSkip, sidRope, sidMine, sidDEagle, |
|
25 sidDynamite, sidBaseballBat, sidFirePunch, sidSeconds, |
|
26 sidParachute, sidAirAttack, sidMineStrike, sidBlowTorch, |
|
27 sidGirder, sidTeleport, sidSwitch, sidMortar, sidWhip, |
|
28 sidKamikaze, sidCake, sidSeduction, sidWatermelon, |
|
29 sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane, |
|
30 sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, |
|
31 sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack, |
|
32 sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb, sidSineGun, sidFlamethrower, |
|
33 sidSMine, sidHammer, sidResurrector, sidDrillStrike); |
|
34 |
|
35 TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused, |
|
36 sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync, |
|
37 sidNoEndTurn, sidNotYetAvailable, sidRoundSD, sidRoundsSD, sidReady); |
|
38 |
|
39 TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw, |
|
40 eidNewHealthPack, eidNewAmmoPack, eidNewUtilityPack, eidTurnSkipped, eidHurtSelf, |
|
41 eidHomerun, eidGone); |
|
42 |
|
43 TGoalStrId = (gidCaption, gidSubCaption, gidForts, gidLowGravity, gidInvulnerable, |
|
44 gidVampiric, gidKarma, gidKing, gidPlaceHog, gidArtillery, |
|
45 gidSolidLand, gidSharedAmmo, gidMineTimer, gidNoMineTimer, gidRandomMineTimer, |
|
46 gidDamageModifier, gidResetHealth, gidAISurvival, gidInfAttack, gidResetWeps, gidPerHogAmmo); |
|
47 |
24 |
48 const MAX_EVENT_STRINGS = 100; |
25 const MAX_EVENT_STRINGS = 100; |
49 var trammo: array[TAmmoStrId] of ansistring; // name of the weapon |
|
50 trammoc: array[TAmmoStrId] of ansistring; // caption of the weapon |
|
51 trammod: array[TAmmoStrId] of ansistring; // description of the weapon |
|
52 trmsg: array[TMsgStrId] of ansistring; // message of the event |
|
53 trgoal: array[TGoalStrId] of ansistring; // message of the goal |
|
54 |
26 |
55 procedure LoadLocale(FileName: shortstring); |
27 procedure LoadLocale(FileName: shortstring); |
56 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
28 function Format(fmt: shortstring; var arg: shortstring): shortstring; |
57 function Format(fmt: ansistring; var arg: ansistring): ansistring; |
29 function Format(fmt: ansistring; var arg: ansistring): ansistring; |
58 function GetEventString(e: TEventId): ansistring; |
30 function GetEventString(e: TEventId): ansistring; |
59 |
31 |
60 implementation |
32 implementation |
61 uses uMisc, uRandom; |
33 uses uRandom, uUtils, uVariables, uDebug; |
62 |
34 |
63 var trevt: array[TEventId] of array [0..Pred(MAX_EVENT_STRINGS)] of ansistring; |
35 var trevt: array[TEventId] of array [0..Pred(MAX_EVENT_STRINGS)] of ansistring; |
64 trevt_n: array[TEventId] of integer; |
36 trevt_n: array[TEventId] of integer; |
65 |
37 |
66 procedure LoadLocale(FileName: shortstring); |
38 procedure LoadLocale(FileName: shortstring); |