hedgewars/uGearsUtils.pas
changeset 7092 c9ca770fd7fc
parent 7066 12cc2bd84b0b
child 7168 8defaabce92e
equal deleted inserted replaced
7091:7989850b4418 7092:c9ca770fd7fc
   441 end;
   441 end;
   442 
   442 
   443 
   443 
   444 procedure ResurrectHedgehog(gear: PGear);
   444 procedure ResurrectHedgehog(gear: PGear);
   445 var tempTeam : PTeam;
   445 var tempTeam : PTeam;
       
   446     sparkles: PVisualGear;
       
   447     gX, gY: LongInt;
   446 begin
   448 begin
   447     AttackBar:= 0;
   449     AttackBar:= 0;
   448     gear^.dX := _0;
   450     gear^.dX := _0;
   449     gear^.dY := _0;
   451     gear^.dY := _0;
   450     gear^.Damage := 0;
   452     gear^.Damage := 0;
   457             FreeTexture(Team^.AIKillsTex);
   459             FreeTexture(Team^.AIKillsTex);
   458             Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   460             Team^.AIKillsTex := RenderStringTex(inttostr(Team^.stats.AIKills), Team^.Clan^.Color, fnt16);
   459             end;
   461             end;
   460     tempTeam := gear^.Hedgehog^.Team;
   462     tempTeam := gear^.Hedgehog^.Team;
   461     DeleteCI(gear);
   463     DeleteCI(gear);
       
   464     gX := hwRound(gear^.X);
       
   465     gY := hwRound(gear^.Y);
       
   466     // might need more sparkles for a column
       
   467     sparkles:= AddVisualGear(gX, gY, vgtDust, 1);
       
   468     if sparkles <> nil then
       
   469         begin
       
   470         sparkles^.Tint:= tempTeam^.Clan^.Color shl 8 or $FF;
       
   471         //sparkles^.Angle:= random(360);
       
   472         end;
   462     FindPlace(gear, false, 0, LAND_WIDTH, true); 
   473     FindPlace(gear, false, 0, LAND_WIDTH, true); 
   463     if gear <> nil then
   474     if gear <> nil then
   464         begin
   475         begin
       
   476         AddVisualGear(hwRound(gear^.X), hwRound(gear^.Y), vgtExplosion);
   465         RenderHealth(gear^.Hedgehog^);
   477         RenderHealth(gear^.Hedgehog^);
   466         ScriptCall('onGearResurrect', gear^.uid);
   478         ScriptCall('onGearResurrect', gear^.uid);
   467         gear^.State := gstWait;
   479         gear^.State := gstWait;
   468     end;
   480     end;
   469     RecountTeamHealth(tempTeam);
   481     RecountTeamHealth(tempTeam);