# HG changeset patch # User nemo # Date 1255628541 0 # Node ID ecf0c7e7995be234bfe141e6d14b7c7687e7ea7c # Parent 7067544bb15d09328ea94384b7e8ddc25280237c Initial molotov cocktail. Still needs graphics, tweaking of fire behaviour. Also changed probabilities for default weapon sets diff -r 7067544bb15d -r ecf0c7e7995b QTfrontend/hwconsts.cpp.in --- a/QTfrontend/hwconsts.cpp.in Thu Oct 15 17:18:36 2009 +0000 +++ b/QTfrontend/hwconsts.cpp.in Thu Oct 15 17:42:21 2009 +0000 @@ -31,8 +31,8 @@ QStringList * mapList; QString * cDefaultAmmoStore = new QString( - "939192942219912103223511100120100000021" - "040400044140044464564444477477611121111" + "9391929422199121032235111001201000000211" + "0404000441400444645644444774776111211111" ); int cAmmoNumber = cDefaultAmmoStore->size() / 2; @@ -40,20 +40,20 @@ QList< QPair >() << qMakePair(QString("Default"), *cDefaultAmmoStore) << qMakePair(QString("Crazy"), QString( - "999999999999999999299999999999999929999" - "111111111111111111111111111111111111111")) + "9999999999999999992999999999999999299999" + "1111111111111111111111111111111111111111")) << qMakePair(QString("Pro mode"), QString( - "000000000000000000000000000000000000000" - "000000000000000000000000000000000000000")) + "9090009000000000000009000000000000000000" + "0000000000000000000000000000000000000000")) << qMakePair(QString("Shoppa"), QString( - "000000990000000000000000000000000000000" - "111111111111111111111111111111111111111")) //FIXME: dunno what should be here + "0000009900000000000000000000000000000000" + "4444410044244402210114121222122000000002")) << qMakePair(QString("Basketball"),QString( - "000000900000090000000000000000000000000" - "111111111111111111111111111111111111111")) //FIXME: dunno what should be here + "0000009000000900000000000000000000000000" + "0000000000000000000000000000000000000000")) << qMakePair(QString("Minefield"), QString( - "000000990009000000030000000000000000000" - "111111111111111111111111111111111111111")) //FIXME: dunno what should be here + "0000009900090000000300000000000000000000" + "0000000000000000000000000000000000000000")) ; QColor * color1 = new QColor(221, 0, 0); diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/GSHandlers.inc Thu Oct 15 17:42:21 2009 +0000 @@ -214,6 +214,29 @@ (hwAbs(Gear^.dY) > _0_1) then PlaySound(sndGrenadeImpact, false, nil) end; +//////////////////////////////////////////////////////////////////////////////// +procedure doStepMolotov(Gear: PGear); +var i: LongInt; + dX, dY: hwFloat; + Fire: PGear; +begin + AllInactive:= false; + + doStepFallingGear(Gear); + CalcRotationDirAngle(Gear); + + if (Gear^.State and gstCollision) <> 0 then begin + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound); + for i:= 0 to 40 do begin + dX:= AngleCos(i * 16) * _0_5 * (GetRandom + _1); + dY:= AngleSin(i * 16) * _0_5 * (GetRandom + _1); + Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); + Fire^.State:= Fire^.State or gsttmpFlag; + end; + DeleteGear(Gear); + exit + end; +end; procedure doStepWatermelon(Gear: PGear); begin diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/HHHandlers.inc Thu Oct 15 17:42:21 2009 +0000 @@ -138,6 +138,7 @@ if ((Gear^.State and gstHHHJump) <> 0) then xx:= - xx; case Ammo^[CurSlot, CurAmmo].AmmoType of amGrenade: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Bomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer); + amMolotov: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtMolotov, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); amClusterBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtClusterBomb, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer); amBazooka: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtAmmo_Grenade, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); amUFO: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtUFO, 0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0); diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/uAIAmmoTests.pas Thu Oct 15 17:42:21 2009 +0000 @@ -84,7 +84,8 @@ (proc: nil; flags: 0), // amLaserSight (proc: nil; flags: 0), // amVampiric (proc: nil; flags: 0), // amSniperRifle - (proc: nil; flags: 0) // amJetpack + (proc: nil; flags: 0), // amJetpack + (proc: nil; flags: 0) // amMolotov ); const BadTurn = Low(LongInt) div 4; diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/uAmmos.pas Thu Oct 15 17:42:21 2009 +0000 @@ -99,7 +99,8 @@ cnt:= 0; Ammoz[a].Probability:= 0 end; - ammos[a]:= cnt + ammos[a]:= cnt; + if shoppa then Ammoz[a].NumberInCase:= 1; // FIXME - TEMPORARY remove when crate number in case editor is added end else ammos[a]:= AMMO_INFINITE end; diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/uConsts.pas Thu Oct 15 17:42:21 2009 +0000 @@ -64,7 +64,7 @@ sprSpeechCorner, sprSpeechEdge, sprSpeechTail, sprThoughtCorner, sprThoughtEdge, sprThoughtTail, sprShoutCorner, sprShoutEdge, sprShoutTail, - sprSniperRifle, sprBubbles, sprJetpack, sprHealth); + sprSniperRifle, sprBubbles, sprJetpack, sprHealth, sprHandMolotov, sprMolotov); TGearType = (gtAmmo_Bomb, gtHedgehog, gtAmmo_Grenade, gtHealthTag, // 3 gtGrave, gtUFO, gtShotgunShot, gtPickHammer, gtRope, // 8 @@ -75,7 +75,7 @@ gtTeleport, gtSwitcher, gtTarget, gtMortar, // 31 gtWhip, gtKamikaze, gtCake, gtSeduction, gtWatermelon, gtMelonPiece, // 37 gtHellishBomb, gtEvilTrace, gtWaterUp, gtDrill, gtBallGun, gtBall,gtRCPlane, - gtSniperRifleShot, gtJetpack); + gtSniperRifleShot, gtJetpack, gtMolotov); TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire, vgtSmallDamageTag, vgtTeamHealthSorter, vgtSpeechBubble, vgtBubble, @@ -103,7 +103,7 @@ amGirder, amTeleport, amSwitch, amMortar, amKamikaze, amCake, amSeduction, amWatermelon, amHellishBomb, amNapalm, amDrill, amBallgun, amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, - amLaserSight, amVampiric, amSniperRifle, amJetpack); + amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov); THWFont = (fnt16, fntBig, fntSmall); @@ -614,7 +614,12 @@ (FileName: 'amJetpack'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; Width: 64; Height: 64; imageWidth: 0; imageHeight: 0; saveSurf: false), // sprJetpack (FileName: 'Health'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; - Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false) // sprHealth + Width: 16; Height: 16; imageWidth: 0; imageHeight: 0; saveSurf: false), // sprHealth + + (FileName: 'amMolotov'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false), //sprHandMolotov + (FileName: 'Molotov'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil; + Width: 8; Height: 8; imageWidth: 0; imageHeight: 0; saveSurf: false) // sprMolotov ); Wavez: array [TWave] of record @@ -1508,6 +1513,26 @@ isDamaging: false; SkipTurns: 0; PosCount: 1; + PosSprite: sprWater), + + (NameId: sidMolotov; + NameTex: nil; + Probability: 0; + NumberInCase: 1; + Ammo: (Propz: ammoprop_Power or + ammoprop_AltUse; + Count: AMMO_INFINITE; + NumPerTurn: 0; + Timer: 3000; + Pos: 0; + AmmoType: amMolotov); + Slot: 1; + TimeAfterTurn: 3000; + minAngle: 0; + maxAngle: 0; + isDamaging: true; + SkipTurns: 0; + PosCount: 1; PosSprite: sprWater) ); diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/uGears.pas --- a/hedgewars/uGears.pas Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/uGears.pas Thu Oct 15 17:42:21 2009 +0000 @@ -167,7 +167,8 @@ @doStepBomb, @doStepRCPlane, @doStepSniperRifleShot, - @doStepJetpack + @doStepJetpack, + @doStepMolotov ); procedure InsertGearToList(Gear: PGear); @@ -258,7 +259,7 @@ Result^.Angle:= cMaxAngle div 2; Result^.Z:= cHHZ; end; -gtAmmo_Grenade: begin // bazooka +gtAmmo_Grenade, gtMolotov: begin // bazooka Result^.Radius:= 4; end; gtHealthTag: begin @@ -1061,6 +1062,7 @@ case amt of amBazooka, amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle); + amMolotov: DrawRotated(sprHandMolotov, hx, hy, hwSign(Gear^.dX), aangle); amBallgun: DrawRotated(sprHandBallgun, hx, hy, hwSign(Gear^.dX), aangle); amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle); amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle); @@ -1416,6 +1418,7 @@ begin case Gear^.Kind of gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); + gtMolotov: DrawRotated(sprMolotov, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle); gtRCPlane: begin if (Gear^.Tag = -1) then diff -r 7067544bb15d -r ecf0c7e7995b hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Thu Oct 15 17:18:36 2009 +0000 +++ b/hedgewars/uLocale.pas Thu Oct 15 17:42:21 2009 +0000 @@ -26,7 +26,7 @@ sidKamikaze, sidCake, sidSeduction, sidWatermelon, sidHellishBomb, sidDrill, sidBallgun, sidNapalm, sidRCPlane, sidLowGravity, sidExtraDamage, sidInvulnerable, sidExtraTime, - sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack); + sidLaserSight, sidVampiric, sidSniperRifle, sidJetpack, sidMolotov); TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused, sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync); diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/cs.txt --- a/share/hedgewars/Data/Locale/cs.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/cs.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Do boje! 01:01=Kolo nerozhodně diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/de.txt --- a/share/hedgewars/Data/Locale/de.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/de.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirismus 00:38=Scharfschützengewehr 00:39=Fliegende Untertasse +00:40=Molotov 01:00=Auf in die Schlacht! 01:01=Unentschieden diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/en.txt --- a/share/hedgewars/Data/Locale/en.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/en.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Let's fight! 01:01=Round draw @@ -346,4 +347,4 @@ ; Hog shot an home run (using the bat and another hog) 02:10=Home Run! 02:10=A bird, a plane, ... -02:10=That one is out! \ No newline at end of file +02:10=That one is out! diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/es.txt --- a/share/hedgewars/Data/Locale/es.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/es.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Luchad! 01:01=Empate diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/fi.txt --- a/share/hedgewars/Data/Locale/fi.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/fi.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampyrismi 00:38=Tarkkuuskivääri 00:39=Flying Saucer +00:40=Molotov 01:00=Taistelu alkakoon! 01:01=Tasapeli diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/fr.txt --- a/share/hedgewars/Data/Locale/fr.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/fr.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirisme 00:38=Fusil de sniper 00:39=Flying Saucer +00:40=Molotov 01:00=C'est parti ! 01:01=Round ex-aequo diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/it.txt --- a/share/hedgewars/Data/Locale/it.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/it.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirismo 00:38=Fucile di precisione 00:39=Disco Volante +00:40=Molotov 01:00=Combattiamo! 01:01=Round in parità diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/ja.txt --- a/share/hedgewars/Data/Locale/ja.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/ja.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=ヨシ、ファイト! 01:01=ドロー! diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/pl.txt --- a/share/hedgewars/Data/Locale/pl.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/pl.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Wampiryzm 00:38=Karabin Snajperski 00:39=Latający Talerz +00:40=Molotov 01:00=Walczmy! 01:01=Remis diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/pt-br.txt --- a/share/hedgewars/Data/Locale/pt-br.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/pt-br.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Disco Voador +00:40=Molotov 01:00=Hora de lutar! 01:01=Partida empatou diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/pt-pt.txt --- a/share/hedgewars/Data/Locale/pt-pt.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/pt-pt.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirismo 00:38=Sniper 00:39=Pires Voador +00:40=Molotov 01:00=Vamos lutar! 01:01=Ronda empatada diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/ru.txt --- a/share/hedgewars/Data/Locale/ru.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/ru.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Вампиризм 00:38=Снайперская винтовка 00:39=Летающая тарелка +00:40=Molotov 01:00=Вперёд к победе! 01:01=Ничья diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/sk.txt --- a/share/hedgewars/Data/Locale/sk.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/sk.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Režim vampíra 00:38=Ostreľovačka 00:39=Flying Saucer +00:40=Molotov 01:00=Do boja! 01:01=Remíza diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/sv.txt --- a/share/hedgewars/Data/Locale/sv.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/sv.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Nu kör vi! 01:01=Oavgjort diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/tr.txt --- a/share/hedgewars/Data/Locale/tr.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/tr.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Savaş başlasın! 01:01=Beraberlik diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/uk.txt --- a/share/hedgewars/Data/Locale/uk.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/uk.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=Vampirism 00:38=Sniper Rifle 00:39=Flying Saucer +00:40=Molotov 01:00=Уперед до перемоги! 01:01=Нічия diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/zh_CN.txt --- a/share/hedgewars/Data/Locale/zh_CN.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/zh_CN.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=吸血鬼 00:38=狙擊槍 00:39=飞盘 +00:40=Molotov 01:00=战斗啦! 01:01=平手 diff -r 7067544bb15d -r ecf0c7e7995b share/hedgewars/Data/Locale/zh_TW.txt --- a/share/hedgewars/Data/Locale/zh_TW.txt Thu Oct 15 17:18:36 2009 +0000 +++ b/share/hedgewars/Data/Locale/zh_TW.txt Thu Oct 15 17:42:21 2009 +0000 @@ -40,6 +40,7 @@ 00:37=吸血鬼 00:38=狙擊槍 00:39=Flying Saucer +00:40=Molotov 01:00=戰鬥開始! 01:01=平手