# HG changeset patch # User nemo # Date 1338735732 14400 # Node ID 8defaabce92e7006c57c82b7ab6de250393a3eb8 # Parent 0b3b306f129ae57d4def95f355ec56469c616d58 warp sound when AI survival hog respawns. attempt at a bit of a crate spawn animation (moar sparkles and a quick fadein) diff -r 0b3b306f129a -r 8defaabce92e hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Sat Jun 02 22:31:41 2012 +0200 +++ b/hedgewars/GSHandlers.inc Sun Jun 03 11:02:12 2012 -0400 @@ -2077,6 +2077,7 @@ exBoom: boolean; dX, dY: HWFloat; hog: PHedgehog; + sparkles: PVisualGear; begin k := Gear^.Kind; exBoom := false; @@ -2108,6 +2109,21 @@ Gear^.Damage := 0; if Gear^.Health <= 0 then exBoom := true; + end + else + begin + if Gear^.Timer = 0 then + begin +(* Can't make sparkles team coloured without working out what the next team is going to be. This should be solved, really, since it also screws up + voices. Reinforcements voices is heard for active team, not team-to-be. Either that or change crate spawn from end of turn to start, although that + has its own complexities. *) + sparkles:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1); + if sparkles <> nil then + begin + sparkles^.Tint:= $FAB22CFF + end + end; + if (GameTicks and $1 = 0) and (Gear^.Timer < 255) then inc(Gear^.Timer) end; if (Gear^.Damage > 0) or exBoom then diff -r 0b3b306f129a -r 8defaabce92e hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Sat Jun 02 22:31:41 2012 +0200 +++ b/hedgewars/uGearsList.pas Sun Jun 03 11:02:12 2012 -0400 @@ -246,7 +246,8 @@ gear^.ImpactSound:= sndGraveImpact; gear^.nImpactSounds:= 1; gear^.Radius:= 16; - gear^.Elasticity:= _0_3 + gear^.Elasticity:= _0_3; + gear^.Timer:= 0 end; gtExplosives: begin gear^.ImpactSound:= sndGrenadeImpact; diff -r 0b3b306f129a -r 8defaabce92e hedgewars/uGearsRender.pas --- a/hedgewars/uGearsRender.pas Sat Jun 02 22:31:41 2012 +0200 +++ b/hedgewars/uGearsRender.pas Sun Jun 03 11:02:12 2012 -0400 @@ -989,7 +989,9 @@ DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle) else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle); - gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then + gtCase: begin + if Gear^.Timer < 255 then Tint($FF, $FF, $FF, Gear^.Timer); + if ((Gear^.Pos and posCaseAmmo) <> 0) then begin i:= (GameTicks shr 6) mod 64; if i > 18 then @@ -1011,6 +1013,8 @@ i:= i mod 12; DrawSprite(sprUtility, x - 24, y - 24, i); end; + if Gear^.Timer < 255 then Tint($FF, $FF, $FF, $FF); + end; gtExplosives: begin if ((Gear^.State and gstDrowning) <> 0) then DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0) diff -r 0b3b306f129a -r 8defaabce92e hedgewars/uGearsUtils.pas --- a/hedgewars/uGearsUtils.pas Sat Jun 02 22:31:41 2012 +0200 +++ b/hedgewars/uGearsUtils.pas Sun Jun 03 11:02:12 2012 -0400 @@ -474,6 +474,7 @@ if gear <> nil then begin AddVisualGear(hwRound(gear^.X), hwRound(gear^.Y), vgtExplosion); + PlaySound(sndWarp); RenderHealth(gear^.Hedgehog^); ScriptCall('onGearResurrect', gear^.uid); gear^.State := gstWait;