--- a/hedgewars/GSHandlers.inc Tue Jun 12 17:20:27 2012 +0400
+++ b/hedgewars/GSHandlers.inc Sun Jun 24 20:31:26 2012 +0400
@@ -2114,18 +2114,32 @@
end
else
begin
- if Gear^.Timer = 0 then
- begin
+ if Gear^.Timer = 500 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
+ // Abuse a couple of gear values to track origin
+ Gear^.Angle:= hwRound(Gear^.X);
+ Gear^.Power:= hwRound(Gear^.Y);
+ Gear^.Tag:= random(2);
+ inc(Gear^.Timer)
+ end;
+ if Gear^.Timer < 1833 then inc(Gear^.Timer);
+ if Gear^.Timer = 1000 then
begin
- sparkles^.Tint:= $FAB22CFF
- end
- end;
- if (GameTicks and $1 = 0) and (Gear^.Timer < 255) then inc(Gear^.Timer)
+ sparkles:= AddVisualGear(Gear^.Angle, Gear^.Power, vgtDust, 1);
+ if sparkles <> nil then
+ begin
+ sparkles^.dX:= 0;
+ sparkles^.dY:= 0;
+ sparkles^.Angle:= 270;
+ if Gear^.Tag = 1 then
+ sparkles^.Tint:= $3744D7FF
+ else sparkles^.Tint:= $FAB22CFF
+ end;
+ end;
+ if Gear^.Timer < 1000 then exit;
end;
if (Gear^.Damage > 0) or exBoom then
@@ -2768,7 +2782,7 @@
CurrentTeam^.CurrHedgehog := Succ(CurrentTeam^.CurrHedgehog) mod (CurrentTeam^.HedgehogsNumber);
until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0);
- CurrentHedgehog := @CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog];
+ SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
AmmoMenuInvalidated:= true;
HHGear := CurrentHedgehog^.Gear;
@@ -3087,7 +3101,7 @@
begin
Gear^.Tag := 0;
Gear^.X := Gear^.X + int2hwFloat(xx);
- if not TestCollisionY(Gear, yyn) then
+ if TestCollisionYwithGear(Gear, yyn) = 0 then
begin
Gear^.Y := Gear^.Y + int2hwFloat(yyn);
NextAngle(Gear, dA)
@@ -3165,8 +3179,7 @@
HHGear := Gear^.Hedgehog^.Gear;
HHGear^.Message := HHGear^.Message and (not gmAttack);
- DeleteCI(HHGear);
- Gear^.IntersectGear:= nil;
+ Gear^.CollisionMask:= $FF7F;
FollowGear := Gear;
@@ -4026,12 +4039,12 @@
gear^.RenderTimer := true;
// abort if there is no other portal connected to this one
- if (Gear^.IntersectGear = nil) then
+ if (Gear^.LinkedGear = nil) then
exit;
- if ((Gear^.IntersectGear^.Tag and 1) = 0) then // or if it's still moving;
+ if ((Gear^.LinkedGear^.Tag and 1) = 0) then // or if it's still moving;
exit;
- conPortal := Gear^.IntersectGear;
+ conPortal := Gear^.LinkedGear;
// check all gears for stuff to port through
iterator := nil;
@@ -4414,8 +4427,8 @@
if not Gear^.dX.isNegative then
Gear^.DirAngle := 180-Gear^.DirAngle;
- if ((Gear^.IntersectGear = nil)
- or (hwRound(Distance(Gear^.X - Gear^.IntersectGear^.X,Gear^.Y-Gear^.IntersectGear^.Y)) >=Gear^.Radius*2)) then
+ if ((Gear^.LinkedGear = nil)
+ or (hwRound(Distance(Gear^.X - Gear^.LinkedGear^.X,Gear^.Y-Gear^.LinkedGear^.Y)) >=Gear^.Radius*2)) then
begin
loadNewPortalBall(Gear, false);
inc(Gear^.Tag);
@@ -4457,7 +4470,7 @@
newPortal^.dX := newPortal^.dX * s;
newPortal^.dY := newPortal^.dY * s;
- newPortal^.IntersectGear := nil;
+ newPortal^.LinkedGear := nil;
if CurrentHedgehog <> nil then
with CurrentHedgehog^ do
@@ -4486,8 +4499,8 @@
else
begin
// link portals with each other
- newPortal^.IntersectGear := iterator;
- iterator^.IntersectGear := newPortal;
+ newPortal^.LinkedGear := iterator;
+ iterator^.LinkedGear := newPortal;
iterator^.Health := newPortal^.Health;
end;
end;
@@ -4940,7 +4953,7 @@
ApplyDamage(tmp, CurrentHedgehog, tmp^.Health div 3, dsUnknown);
//DrawTunnel(tmp^.X, tmp^.Y - _1, _0, _0_5, cHHRadius * 6, cHHRadius * 3);
tmp2:= AddGear(hwRound(tmp^.X), hwRound(tmp^.Y), gtHammerHit, 0, _0, _0, 0);
- tmp2^.IntersectGear:= tmp;
+ tmp2^.LinkedGear:= tmp;
SetAllToActive
end
else
@@ -4959,7 +4972,7 @@
HitGear: PGear;
begin
AllInactive := false;
- HitGear := Gear^.IntersectGear;
+ HitGear := Gear^.LinkedGear;
dec(Gear^.Timer);
if (HitGear = nil) or (Gear^.Timer = 0) or ((Gear^.Message and gmDestroy) <> 0) then
begin