--- a/hedgewars/uTypes.pas Wed May 16 18:22:28 2018 +0200
+++ b/hedgewars/uTypes.pas Wed Jul 31 23:14:27 2019 +0200
@@ -39,13 +39,13 @@
TGameState = (gsLandGen, gsStart, gsGame, gsConfirm, gsExit, gsSuspend);
// Game types that help determining what the engine is actually supposed to do
- TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtSyntax, gmtRecord);
+ TGameType = (gmtLocal, gmtDemo, gmtNet, gmtSave, gmtLandPreview, gmtBadSyntax, gmtRecord, gmtSyntaxHelp);
// Different files are stored in different folders, this enumeration is used to tell which folder to use
TPathType = (ptNone, ptData, ptGraphics, ptThemes, ptCurrTheme, ptConfig, ptTeams, ptMaps,
ptMapCurrent, ptDemos, ptSounds, ptGraves, ptFonts, ptForts, ptLocale,
ptAmmoMenu, ptHedgehog, ptVoices, ptHats, ptFlags, ptMissionMaps,
- ptSuddenDeath, ptButtons, ptShaders);
+ ptSuddenDeath, ptButtons, ptShaders, ptDefaultVoice, ptMisc);
// Available sprites for displaying stuff
TSprite = (sprWater, sprCloud, sprBomb, sprBigDigit, sprBigDigitGray, sprBigDigitGreen,
@@ -61,7 +61,7 @@
{$IFDEF USE_TOUCH_INTERFACE}
sprFireButton, sprArrowUp, sprArrowDown, sprArrowLeft, sprArrowRight,
sprJumpWidget, sprAMWidget, sprPauseButton, sprTimerButton, sprTargetButton,
- sprSwitchButton,
+ sprSwitchButton, sprBounceButton,
{$ENDIF}
sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
sprHandDEagle, sprHandAirAttack, sprHandBaseball, sprPHammer,
@@ -90,8 +90,11 @@
sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis,
sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar, sprIceTexture, sprIceGun,
sprFrozenHog, sprAmRubber, sprBoing, sprCustom1, sprCustom2, sprCustom3, sprCustom4,
- sprCustom5, sprCustom6, sprCustom7, sprCustom8, sprAirMine, sprHandAirMine,
- sprFlakeL, sprSDFlakeL, sprCloudL, sprSDCloudL, sprDuck, sprHandDuck, sprMinigun
+ sprCustom5, sprCustom6, sprCustom7, sprCustom8, sprFrozenAirMine, sprAirMine, sprHandAirMine,
+ sprFlakeL, sprSDFlakeL, sprCloudL, sprSDCloudL, sprCreeper, sprHandCreeper, sprMinigun,
+ sprSliderInverted, sprFingerBack, sprFingerBackInv, sprTargetPBack, sprTargetPBackInv,
+ sprHealthHud, sprHealthPoisonHud, sprVampHud, sprKarmaHud, sprMedicHud, sprMedicPoisonHud,
+ sprHaloHud, sprInvulnHUD, sprAmPiano, sprHandLandGun, sprFirePunch, sprThroughWrap
);
// Gears that interact with other Gears and/or Land
@@ -108,8 +111,8 @@
gtSniperRifleShot, gtJetpack, gtMolotov, gtBirdy, // 45
gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
- gtNapalmBomb, gtSnowball, gtFlake, {gtStructure,} gtLandGun, gtTardis, // 61
- gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife, gtDuck, gtMinigun, gtMinigunBullet); // 68
+ gtNapalmBomb, gtSnowball, gtFlake, gtLandGun, gtTardis, // 61
+ gtIceGun, gtAddAmmo, gtGenericFaller, gtKnife, gtCreeper, gtMinigun, gtMinigunBullet); // 68
// Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
@@ -121,7 +124,7 @@
vgtSmoothWindBar, vgtStraightShot, vgtNoPlaceWarn);
// Damage can be caused by different sources
- TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
+ TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison, dsHammer);
// Available sounds
TSound = (sndNone,
@@ -150,8 +153,12 @@
sndIceBeam, sndHogFreeze, sndAirMineImpact, sndKnifeImpact, sndExtraTime, sndLaserSight,
sndInvulnerable, sndJetpackLaunch, sndJetpackBoost, sndPortalShot, sndPortalSwitch,
sndPortalOpen, sndBlowTorch, sndCountdown1, sndCountdown2, sndCountdown3, sndCountdown4,
- sndDuckDrop, sndDuckWater, sndDuckDie, sndCustom1, sndCustom2, sndCustom3, sndCustom4,
- sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun);
+ sndCreeperDrop, sndCreeperWater, sndCreeperDie, sndCustom1, sndCustom2, sndCustom3, sndCustom4,
+ sndCustom5, sndCustom6, sndCustom7, sndCustom8, sndMinigun, sndFlamethrower, sndIceBeamIdle,
+ sndLandGun, sndCaseImpact, sndExtraDamage, sndFirePunchHit, sndGrenade, sndThisOneIsMine,
+ sndWhatThe, sndSoLong, sndOhDear, sndGonnaGetYou, sndDrat, sndBugger, sndAmazing,
+ sndBrilliant, sndExcellent, sndFire, sndWatchThis, sndRunAway, sndRevenge, sndCutItOut,
+ sndLeaveMeAlone, sndOuch, sndHmm, sndKiss, sndFlyAway, sndPlaneWater);
// Available ammo types to be used by hedgehogs
TAmmoType = (amNothing, amGrenade, amClusterBomb, amBazooka, amBee, amShotgun, amPickHammer, // 6
@@ -162,8 +169,10 @@
amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
- amResurrector, amDrillStrike, amSnowball, amTardis, {amStructure,} amLandGun, // 53
- amIceGun, amKnife, amRubber, amAirMine, amDuck, amMinigun); // 59
+ amResurrector, amDrillStrike, amSnowball, amTardis, amLandGun, // 53
+ amIceGun, amKnife, amRubber, amAirMine, amCreeper, amMinigun); // 59
+ // NOTE: If we ever reach 126 ammo types, make sure to skip ammo type number 126 because it's
+ // reserved as synonym for amNothing. See also chSetWeapon.
// Different kind of crates that e.g. hedgehogs can pick up
TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
@@ -176,7 +185,7 @@
TStatInfoType = (siGameResult, siMaxStepDamage, siMaxStepKills, siKilledHHs,
siClanHealth, siTeamStats, siPlayerKills, siMaxTeamDamage,
siMaxTeamKills, siMaxTurnSkips, siCustomAchievement, siGraphTitle,
- siPointType);
+ siPointType, siTeamRank, siEverAfter);
// Various 'emote' animations a hedgehog can do
TWave = (waveRollup, waveSad, waveWave, waveHurrah, waveLemonade, waveShrug, waveJuggle);
@@ -250,6 +259,7 @@
doStep: TGearStepProcedure; // Code the gear is running
AmmoType : TAmmoType; // Ammo type associated with this kind of gear
RenderTimer: Boolean; // Will visually display Timer if true
+ RenderHealth: Boolean; // Will visually display Health if true
Target : TPoint; // Gear target. Will render in uGearsRender unless a special case is added
AIHints: LongWord; // hints for ai.
LastDamage: PHedgehog; // Used to track damage source for stats
@@ -268,6 +278,7 @@
Radius: LongInt; // Radius. If not using uCollisions, is usually used to indicate area of effect
CollisionMask: Word; // Masking off Land impact FF7F for example ignores current hog and crates
AdvBounce: Longword; // Triggers 45 bounces. Is a counter to avoid edge cases
+ Sticky: Boolean; // True if gear is *normally* able to stick to landscape on impact
Elasticity: hwFloat;
Friction : hwFloat;
Density : hwFloat; // Density is kind of a mix of size and density. Impacts distance thrown, wind.
@@ -326,17 +337,20 @@
end;
TStatistics = record
- DamageRecv,
- DamageGiven: Longword;
- StepDamageRecv,
- StepDamageGiven,
- StepKills: Longword;
- StepPoisoned,
- StepDied,
- Sacrificed: boolean;
- MaxStepDamageRecv,
- MaxStepDamageGiven,
- MaxStepKills: Longword;
+ DamageRecv, // total damage received
+ DamageGiven: Longword; // total damage dealt
+ StepDamageRecvInRow, // number of enemy turns in row this hog received any damage
+ StepDamageRecv, // damage received in this turn
+ StepDamageGiven, // damage dealt in this turn
+ StepKills: Longword; // kills in this turn
+ StepPoisoned, // whether hog got poisoned this turn
+ StepDied, // whether hog died this turn
+ Sacrificed, // whether hog was sacrificed in suicide attack (kamikaze, piano)
+ GotRevenge: boolean; // whether hog got revenge in this turn
+ StepRevenge: boolean; // whether hog's revenge mode was activated in this turn
+ MaxStepDamageRecv, // most damage received in one turn
+ MaxStepDamageGiven, // most damage dealt in one turn
+ MaxStepKills: Longword; // most kills in one turn
FinishedTurns: Longword;
end;
@@ -349,6 +363,16 @@
TeamDamage : Longword;
end;
+ PClanDeathLogEntry = ^TClanDeathLogEntry;
+
+ TClanDeathLogEntry = record
+ Turn : Longword; // turn in which the clans were killed
+ KilledClans : array[0..Pred(cMaxTeams)] of PClan; // array of clans that have died
+ KilledClansCount: Longword; // number of clans that died
+ NextEntry : PClanDeathLogEntry; // linked list
+ end;
+
+
TBinds = record
indices: array[0..cKbdMaxIndex] of byte;
// zeroth element is reserved, indices[i] == 0 means no binding
@@ -367,6 +391,7 @@
TVoice = record
snd: TSound;
voicepack: PVoicePack;
+ isFallback: boolean;
end;
THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo;
@@ -395,9 +420,12 @@
InitialHealth: LongInt; // used for gfResetHealth
King: boolean; // Flag for a bunch of hedgehog attributes
Unplaced: boolean; // Flag for hog placing mode
+ UnplacedKing: boolean; // Flag for king placing phase in King Mode
Timer: Longword;
HealthBarHealth: LongInt;
Effects: array[THogEffect] of LongInt;
+ RevengeHog: PHedgehog; // For which hog this hog wants revenge most. For sndRevenge taunt
+ FlownOffMap: boolean; // When hedgehog has flown far away off the map left or right
end;
TTeam = record
@@ -425,6 +453,9 @@
voicepack: PVoicepack;
PlayerHash: shortstring; // md5 hash of player name. For temporary enabling of hats as thank you. Hashed for privacy of players
stats: TTeamStats;
+ Passive: boolean; // if true, team will not participate in game. It is treated as if all its hedgehogs are frozen.
+ // updating this value requires updating Passive in TClan as well!
+ hasKing: boolean; // true if team has a living king
hasGone: boolean;
skippedTurns: Longword;
isGoneFlagPendingToBeSet, isGoneFlagPendingToBeUnset: boolean;
@@ -442,7 +473,11 @@
ClanHealth: LongInt;
ClanIndex: LongInt;
TurnNumber: LongWord;
+ DeathLogged: boolean; // true if clan is dead and its latest death has been logged in the clan death log
+ StatsHandled : boolean; // true if clan's rank has been handled for stats screen
Flawless: boolean;
+ Passive: boolean; // informational. Must be set to true if all of the teams are passive
+ LocalOrAlly: boolean; // true if at least 1 team in the clan is a local team. A local team is a non-extdriven team controlled by a human
end;
cdeclPtr = procedure; cdecl;
@@ -468,8 +503,8 @@
sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb,
sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector,
sidDrillStrike, sidSnowball, sidNothing, sidTardis,
- {sidStructure,} sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine,
- sidDuck, sidMinigun);
+ sidLandGun, sidIceGun, sidKnife, sidRubber, sidAirMine,
+ sidCreeper, sidMinigun);
TMsgStrId = (sidLoading, sidDraw, sidWinner, sidVolume, sidPaused,
sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
@@ -479,7 +514,19 @@
sidNotAvailableInSD, sidHealthGain, sidEmptyCrate, sidUnknownKey,
sidWinner2, sidWinner3, sidWinner4, sidWinner5, sidWinner6,
sidWinner7, sidWinnerAll, sidTeamGone, sidTeamBack, sidAutoSkip,
- sidFPS);
+ sidFPS, sidLuaParsingOff, sidLuaParsingOn, sidLuaParsingDenied,
+ sidAmmoCount, sidChat, sidChatTeam, sidChatHog, sidUnknownGearValue);
+
+ TCmdHelpStrId = (
+ sidCmdHeaderBasic, sidCmdTogglechat, sidCmdTeam, sidCmdMe,
+ sidCmdPause, sidCmdPauseNet, sidCmdFullscreen, sidCmdQuit,
+ sidCmdHelp, sidCmdHelpTaunts, sidCmdHistory, sidLua,
+
+ sidCmdHeaderTaunts, sidCmdSpeech, sidCmdThink, sidCmdYell,
+ sidCmdSpeechNumberHint, sidCmdHsa, sidCmdHta, sidCmdHya,
+ sidCmdHurrah, sidCmdIlovelotsoflemonade, sidCmdJuggle,
+ sidCmdRollup, sidCmdShrug, sidCmdWave, sidCmdUnknown,
+ sidCmdHelpRoom, sidCmdHelpRoomFail);
// Events that are important for the course of the game or at least interesting for other reasons
TEventId = (eidDied, eidDrowned, eidRoundStart, eidRoundWin, eidRoundDraw,