# HG changeset patch # User Wuzzy <Wuzzy2@mail.ru> # Date 1521771421 -3600 # Node ID 5984e8c6cbeb215bc9db7a79efc71d3f5c0131a9 # Parent 4b9c5cf49c9f78adaad62517c0e93d12c38965a0 Add new game flag gfSwitchHog, enable hog switching at turn start diff -r 4b9c5cf49c9f -r 5984e8c6cbeb ChangeLog.txt --- a/ChangeLog.txt Thu Mar 22 23:27:11 2018 +0100 +++ b/ChangeLog.txt Fri Mar 23 03:17:01 2018 +0100 @@ -3,6 +3,7 @@ ====================== 0.9.24 ====================== Game: + New weapon: Minigun + + New game modifier: Enable switch hedgehog at start of turn + Change weapon icons: Mudball, air mine + Add healing visual effect in Paramedics mode and a few scripts + Show remaining ammo when using Birdy egg or RC Plane bomb diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/hedgewars.qrc --- a/QTfrontend/hedgewars.qrc Thu Mar 22 23:27:11 2018 +0100 +++ b/QTfrontend/hedgewars.qrc Fri Mar 23 03:17:01 2018 +0100 @@ -127,6 +127,7 @@ <file>res/hh_small.png</file> <file>res/btnDisabled.png</file> <file>res/btnBorder@2x.png</file> + <file>res/btnSwitchHog@2x.png</file> <file>res/btnInvulnerable@2x.png</file> <file>res/btnLaserSight@2x.png</file> <file>res/btnLowGravity@2x.png</file> diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/model/gameSchemeModel.cpp --- a/QTfrontend/model/gameSchemeModel.cpp Thu Mar 22 23:27:11 2018 +0100 +++ b/QTfrontend/model/gameSchemeModel.cpp Fri Mar 23 03:17:01 2018 +0100 @@ -28,7 +28,7 @@ QList<QVariant> defaultScheme = QList<QVariant>() << QVariant("Default") // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -96,7 +96,7 @@ spNames = QStringList() << "name" // 0 | Name should be first forever - << "fortsmode" // 1 + << "switchhog" // 1 << "divteams" // 2 << "solidland" // 3 << "border" // 4 @@ -144,7 +144,7 @@ QList<QVariant> proMode; proMode << predefSchemesNames[1] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -192,7 +192,7 @@ QList<QVariant> shoppa; shoppa << predefSchemesNames[2] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(true) // solid land 3 << QVariant(true) // border 4 @@ -240,7 +240,7 @@ QList<QVariant> cleanslate; cleanslate << predefSchemesNames[3] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -288,7 +288,7 @@ QList<QVariant> minefield; minefield << predefSchemesNames[4] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -336,7 +336,7 @@ QList<QVariant> barrelmayhem; barrelmayhem << predefSchemesNames[5] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -384,7 +384,7 @@ QList<QVariant> tunnelhogs; tunnelhogs << predefSchemesNames[6] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(true) // border 4 @@ -432,7 +432,7 @@ QList<QVariant> timeless; timeless << predefSchemesNames[7] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -480,7 +480,7 @@ QList<QVariant> thinkingportals; thinkingportals << predefSchemesNames[8] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -528,7 +528,7 @@ QList<QVariant> kingmode; kingmode << predefSchemesNames[9] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -576,7 +576,7 @@ QList<QVariant> construction; construction << predefSchemesNames[10] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -625,7 +625,7 @@ QList<QVariant> spaceinvasion; spaceinvasion << predefSchemesNames[11] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 @@ -674,7 +674,7 @@ QList<QVariant> hedgeeditor; hedgeeditor << predefSchemesNames[12] // name 0 - << QVariant(false) // fortsmode 1 + << QVariant(false) // switchhog 1 << QVariant(false) // team divide 2 << QVariant(false) // solid land 3 << QVariant(false) // border 4 diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/res/btnSwitchHog.png Binary file QTfrontend/res/btnSwitchHog.png has changed diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/res/btnSwitchHog@2x.png Binary file QTfrontend/res/btnSwitchHog@2x.png has changed diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/ui/page/pagescheme.cpp --- a/QTfrontend/ui/page/pagescheme.cpp Thu Mar 22 23:27:11 2018 +0100 +++ b/QTfrontend/ui/page/pagescheme.cpp Fri Mar 23 03:17:01 2018 +0100 @@ -84,6 +84,10 @@ TBW_bottomborder->setWhatsThis(tr("Add an indestructible border along the bottom")); glGMLayout->addWidget(TBW_bottomborder,0,3,1,1); + TBW_switchhog = new ToggleButtonWidget(gbGameModes, ":/res/btnSwitchHog@2x.png"); + TBW_switchhog->setWhatsThis(tr("Select a hedgehog at the beginning of a turn")); + glGMLayout->addWidget(TBW_switchhog,0,4,1,1); + TBW_solid = new ToggleButtonWidget(gbGameModes, ":/res/btnSolid@2x.png"); TBW_solid->setWhatsThis(tr("Land can not be destroyed!")); glGMLayout->addWidget(TBW_solid,1,0,1,1); @@ -545,6 +549,7 @@ selectScheme->setModel(model); mapper->addMapping(LE_name, 0); + mapper->addMapping(TBW_switchhog, 1); mapper->addMapping(TBW_teamsDivide, 2); mapper->addMapping(TBW_solid, 3); mapper->addMapping(TBW_border, 4); diff -r 4b9c5cf49c9f -r 5984e8c6cbeb QTfrontend/ui/page/pagescheme.h --- a/QTfrontend/ui/page/pagescheme.h Thu Mar 22 23:27:11 2018 +0100 +++ b/QTfrontend/ui/page/pagescheme.h Fri Mar 23 03:17:01 2018 +0100 @@ -75,6 +75,7 @@ ToggleButtonWidget * TBW_morewind; ToggleButtonWidget * TBW_tagteam; ToggleButtonWidget * TBW_bottomborder; + ToggleButtonWidget * TBW_switchhog; QSpinBox * SB_DamageModifier; QSpinBox * SB_TurnTime; diff -r 4b9c5cf49c9f -r 5984e8c6cbeb hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Thu Mar 22 23:27:11 2018 +0100 +++ b/hedgewars/uConsts.pas Fri Mar 23 03:17:01 2018 +0100 @@ -209,7 +209,7 @@ gfVampiric = $00000200; gfKarma = $00000400; gfArtillery = $00000800; - gfForts = $00001000; + gfSwitchHog = $00001000; gfRandomOrder = $00002000; gfKing = $00004000; gfPlaceHog = $00008000; diff -r 4b9c5cf49c9f -r 5984e8c6cbeb hedgewars/uLand.pas --- a/hedgewars/uLand.pas Thu Mar 22 23:27:11 2018 +0100 +++ b/hedgewars/uLand.pas Fri Mar 23 03:17:01 2018 +0100 @@ -717,10 +717,6 @@ LoadThemeConfig; - // is this not needed any more? lets hope setlength sets also 0s - //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then - // FillChar(Land,SizeOf(TCollisionArray),0);*) - if cPathz[ptMapCurrent] <> '' then begin map:= cPathz[ptMapCurrent] + '/map.png'; @@ -741,7 +737,7 @@ mgMaze : begin ResizeLand(4096,2048); GenMaze; end; mgPerlin: begin ResizeLand(4096,2048); GenPerlin; end; mgDrawn : GenDrawnMap; - mgForts : begin GameFlags:= (GameFlags or gfForts or gfDivideTeams); MakeFortsMap(); end; + mgForts : begin GameFlags:= (GameFlags or gfDivideTeams); MakeFortsMap(); end; else OutError('Unknown mapgen', true); end; @@ -835,7 +831,7 @@ if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false; -if (GameFlags and gfForts = 0) and (maskOnly or (cPathz[ptMapCurrent] = '')) then +if (cMapGen <> mgForts) and (maskOnly or (cPathz[ptMapCurrent] = '')) then AddObjects else diff -r 4b9c5cf49c9f -r 5984e8c6cbeb hedgewars/uScript.pas --- a/hedgewars/uScript.pas Thu Mar 22 23:27:11 2018 +0100 +++ b/hedgewars/uScript.pas Fri Mar 23 03:17:01 2018 +0100 @@ -3662,7 +3662,7 @@ ScriptSetString(_S'LOCALE', cLocale); // import game flags -ScriptSetInteger('gfForts', gfForts); +ScriptSetInteger('gfSwitchHog', gfSwitchHog); ScriptSetInteger('gfMultiWeapon', gfMultiWeapon); ScriptSetInteger('gfSolidLand', gfSolidLand); ScriptSetInteger('gfBorder', gfBorder); diff -r 4b9c5cf49c9f -r 5984e8c6cbeb hedgewars/uTeams.pas --- a/hedgewars/uTeams.pas Thu Mar 22 23:27:11 2018 +0100 +++ b/hedgewars/uTeams.pas Fri Mar 23 03:17:01 2018 +0100 @@ -271,6 +271,7 @@ CurWeapon: PAmmo; w: real; vg: PVisualGear; + g: PGear; s: ansistring; begin if PlacingHogs then @@ -332,25 +333,35 @@ if (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then SetBinds(CurrentTeam^.Binds); -bShowFinger:= true; - if PlacingHogs then begin if CurrentHedgehog^.Unplaced then TurnTimeLeft:= 15000 else TurnTimeLeft:= 0 end -else if ((GameFlags and gfTagTeam) <> 0) and (not NextClan) then - begin - if TagTurnTimeLeft <> 0 then - TurnTimeLeft:= TagTurnTimeLeft; - TagTurnTimeLeft:= 0; - end else begin - TurnTimeLeft:= cHedgehogTurnTime; - TagTurnTimeLeft:= 0; - NextClan:= false; + if ((GameFlags and gfTagTeam) <> 0) and (not NextClan) then + begin + if TagTurnTimeLeft <> 0 then + TurnTimeLeft:= TagTurnTimeLeft; + TagTurnTimeLeft:= 0; + end + else + begin + TurnTimeLeft:= cHedgehogTurnTime; + TagTurnTimeLeft:= 0; + NextClan:= false; + end; + + if (GameFlags and gfSwitchHog) <> 0 then + begin + g:= AddGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), gtSwitcher, 0, _0, _0, 0); + CurAmmoGear:= g; + lastGearByUID:= g; + end + else + bShowFinger:= true; end; IsGetAwayTime:= false; diff -r 4b9c5cf49c9f -r 5984e8c6cbeb share/hedgewars/Data/Locale/hedgewars_de.ts --- a/share/hedgewars/Data/Locale/hedgewars_de.ts Thu Mar 22 23:27:11 2018 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_de.ts Fri Mar 23 03:17:01 2018 +0100 @@ -973,11 +973,11 @@ <name>HWUploadVideoDialog</name> <message> <source>Upload video</source> - <translation>Video hochladen</translation> + <translation type="vanished">Video hochladen</translation> </message> <message> <source>Upload</source> - <translation>Hochladen</translation> + <translation type="vanished">Hochladen</translation> </message> </context> <context> @@ -2135,6 +2135,10 @@ <source>Sea (Edges connect to sea)</source> <translation>Ozean (Grenzen sind mit dem Wasser verbunden)</translation> </message> + <message> + <source>Select a hedgehog at the beginning of a turn</source> + <translation>Wähle am Zugbeginn einen Igel aus</translation> + </message> </context> <context> <name>PageSelectWeapon</name> @@ -2252,7 +2256,7 @@ </message> <message> <source>uploading</source> - <translation>hochladen</translation> + <translation type="vanished">hochladen</translation> </message> <message> <source>Date: %1 @@ -2376,11 +2380,11 @@ </message> <message> <source>Save account name and password</source> - <translation>Kontoname und Passwort speichern</translation> + <translation type="vanished">Kontoname und Passwort speichern</translation> </message> <message> <source>Video is private</source> - <translation>Video ist privat</translation> + <translation type="vanished">Video ist privat</translation> </message> <message> <source>Record audio</source> @@ -2793,27 +2797,27 @@ </message> <message> <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source> - <translation>Bitte gib entweder deinen YouTube-Kontonamen oder die entsprechende E-Mail-Adresse des Google-Kontos an.</translation> + <translation type="vanished">Bitte gib entweder deinen YouTube-Kontonamen oder die entsprechende E-Mail-Adresse des Google-Kontos an.</translation> </message> <message> <source>Account name (or email): </source> - <translation>Kontoname (oder E-Mail): </translation> + <translation type="vanished">Kontoname (oder E-Mail): </translation> </message> <message> <source>Password: </source> - <translation>Passwort: </translation> + <translation type="vanished">Passwort: </translation> </message> <message> <source>Video title: </source> - <translation>Videotitel: </translation> + <translation type="vanished">Videotitel: </translation> </message> <message> <source>Video description: </source> - <translation>Videobeschreibung: </translation> + <translation type="vanished">Videobeschreibung: </translation> </message> <message> <source>Tags (comma separated): </source> - <translation>Tags (durch Kommas getrennt): </translation> + <translation type="vanished">Tags (durch Kommas getrennt): </translation> </message> <message> <source>Description</source> @@ -2964,17 +2968,17 @@ <message> <source>Error while authenticating at google.com: </source> - <translation>Fehler während Authentifizierung auf google.com: + <translation type="vanished">Fehler während Authentifizierung auf google.com: </translation> </message> <message> <source>Login or password is incorrect</source> - <translation>Login oder Passwort inkorrekt</translation> + <translation type="vanished">Login oder Passwort inkorrekt</translation> </message> <message> <source>Error while sending metadata to youtube.com: </source> - <translation>Fehler bei Senden von Meta-Daten zu youtube.com: + <translation type="vanished">Fehler bei Senden von Meta-Daten zu youtube.com: </translation> </message> <message> @@ -3045,7 +3049,7 @@ </message> <message> <source>Video upload - Error</source> - <translation>Video hochladen - Fehler</translation> + <translation type="vanished">Video hochladen - Fehler</translation> </message> <message> <source>Netgame - Error</source> @@ -3122,7 +3126,7 @@ </message> <message> <source>Do you really want to cancel uploading %1?</source> - <translation>Willst du das Hochladen von %1 wirklich abbrechen?</translation> + <translation type="vanished">Willst du das Hochladen von %1 wirklich abbrechen?</translation> </message> <message> <source>File error</source> @@ -3326,11 +3330,11 @@ </message> <message> <source>Upload to YouTube</source> - <translation>Auf YouTube hochladen</translation> + <translation type="vanished">Auf YouTube hochladen</translation> </message> <message> <source>Cancel uploading</source> - <translation>Hochladen abbrechen</translation> + <translation type="vanished">Hochladen abbrechen</translation> </message> <message> <source>Restore default coding parameters</source> @@ -3378,7 +3382,7 @@ </message> <message> <source>Upload this video to your YouTube account</source> - <translation>Dieses Video zu deinem YouTube-Benutzerkonto hochladen</translation> + <translation type="vanished">Dieses Video zu deinem YouTube-Benutzerkonto hochladen</translation> </message> </context> <context> diff -r 4b9c5cf49c9f -r 5984e8c6cbeb share/hedgewars/Data/Locale/hedgewars_en.ts --- a/share/hedgewars/Data/Locale/hedgewars_en.ts Thu Mar 22 23:27:11 2018 +0100 +++ b/share/hedgewars/Data/Locale/hedgewars_en.ts Fri Mar 23 03:17:01 2018 +0100 @@ -944,11 +944,11 @@ <name>HWUploadVideoDialog</name> <message> <source>Upload video</source> - <translation>Upload video</translation> + <translation type="vanished">Upload video</translation> </message> <message> <source>Upload</source> - <translation>Upload</translation> + <translation type="vanished">Upload</translation> </message> </context> <context> @@ -2027,6 +2027,10 @@ <source>Name of this scheme</source> <translation>Name of this scheme</translation> </message> + <message> + <source>Select a hedgehog at the beginning of a turn</source> + <translation>Select a hedgehog at the beginning of a turn</translation> + </message> </context> <context> <name>PageSelectWeapon</name> @@ -2140,7 +2144,7 @@ </message> <message> <source>uploading</source> - <translation>uploading</translation> + <translation type="vanished">uploading</translation> </message> <message> <source>Date: %1</source> @@ -2254,11 +2258,11 @@ </message> <message> <source>Save account name and password</source> - <translation>Save account name and password</translation> + <translation type="vanished">Save account name and password</translation> </message> <message> <source>Video is private</source> - <translation>Video is private</translation> + <translation type="vanished">Video is private</translation> </message> <message> <source>Record audio</source> @@ -2627,27 +2631,27 @@ </message> <message> <source>Please provide either the YouTube account name or the email address associated with the Google Account.</source> - <translation>Please provide either the YouTube account name or the email address associated with the Google Account.</translation> + <translation type="vanished">Please provide either the YouTube account name or the email address associated with the Google Account.</translation> </message> <message> <source>Account name (or email): </source> - <translation>Account name (or email): </translation> + <translation type="vanished">Account name (or email): </translation> </message> <message> <source>Password: </source> - <translation>Password: </translation> + <translation type="vanished">Password: </translation> </message> <message> <source>Video title: </source> - <translation>Video title: </translation> + <translation type="vanished">Video title: </translation> </message> <message> <source>Video description: </source> - <translation>Video description: </translation> + <translation type="vanished">Video description: </translation> </message> <message> <source>Tags (comma separated): </source> - <translation>Tags (comma separated): </translation> + <translation type="vanished">Tags (comma separated): </translation> </message> <message> <source>Description</source> @@ -2802,17 +2806,17 @@ <message> <source>Error while authenticating at google.com: </source> - <translation>Error while authenticating at google.com: + <translation type="vanished">Error while authenticating at google.com: </translation> </message> <message> <source>Login or password is incorrect</source> - <translation>Login or password is incorrect</translation> + <translation type="vanished">Login or password is incorrect</translation> </message> <message> <source>Error while sending metadata to youtube.com: </source> - <translation>Error while sending metadata to youtube.com: + <translation type="vanished">Error while sending metadata to youtube.com: </translation> </message> <message> @@ -2857,7 +2861,7 @@ </message> <message> <source>Video upload - Error</source> - <translation>Video upload—Error</translation> + <translation type="vanished">Video upload—Error</translation> </message> <message> <source>Netgame - Error</source> @@ -2934,7 +2938,7 @@ </message> <message> <source>Do you really want to cancel uploading %1?</source> - <translation>Do you really want to cancel uploading %1?</translation> + <translation type="vanished">Do you really want to cancel uploading %1?</translation> </message> <message> <source>File error</source> @@ -3138,11 +3142,11 @@ </message> <message> <source>Upload to YouTube</source> - <translation>Upload to YouTube</translation> + <translation type="vanished">Upload to YouTube</translation> </message> <message> <source>Cancel uploading</source> - <translation>Cancel uploading</translation> + <translation type="vanished">Cancel uploading</translation> </message> <message> <source>Restore default coding parameters</source> @@ -3186,7 +3190,7 @@ </message> <message> <source>Upload this video to your YouTube account</source> - <translation>Upload this video to your YouTube account</translation> + <translation type="vanished">Upload this video to your YouTube account</translation> </message> </context> <context> diff -r 4b9c5cf49c9f -r 5984e8c6cbeb share/hedgewars/Data/Maps/Control/map.lua --- a/share/hedgewars/Data/Maps/Control/map.lua Thu Mar 22 23:27:11 2018 +0100 +++ b/share/hedgewars/Data/Maps/Control/map.lua Fri Mar 23 03:17:01 2018 +0100 @@ -319,7 +319,7 @@ -- Things we don't modify here will use their default values. EnableGameFlags(gfInfAttack, gfSolidLand) - DisableGameFlags(gfKing, gfForts, gfAISurvival) + DisableGameFlags(gfKing, gfAISurvival) WaterRise = 0 HealthDecrease = 0 diff -r 4b9c5cf49c9f -r 5984e8c6cbeb share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Thu Mar 22 23:27:11 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Fri Mar 23 03:17:01 2018 +0100 @@ -1205,7 +1205,7 @@ gfDisableGirders + gfRandomOrder + -- highly recommended! gfDisableLandObjects + gfSolidLand + gfLowGravity + -- a bit unusual but may still be useful - gfBottomBorder + gfForts + gfDivideTeams + + gfBottomBorder + gfDivideTeams + gfDisableWind + gfMoreWind + gfTagTeam + -- very unusual flags, they don’t affect gameplay really, they are mostly for funny graphical effects gfKing + -- King Mode doesn’t work like expected, since hedgehogs never really die here in this mode