hedgewars/HHHandlers.inc
changeset 1033 622c5de38d72
parent 1012 36b5cc8264e8
child 1034 05f003ad3caa
equal deleted inserted replaced
1032:bf6f5122baf7 1033:622c5de38d72
   274           else exit;
   274           else exit;
   275           StepTicks:= 200;
   275           StepTicks:= 200;
   276           exit
   276           exit
   277           end;
   277           end;
   278 
   278 
       
   279 	if ((Gear^.Message and gm_Animate) <> 0) then
       
   280 		begin
       
   281 		Gear^.Message:= 0;
       
   282 		Gear^.State:= Gear^.State or gstAnimation;
       
   283 		Gear^.Tag:= Gear^.MsgParam;
       
   284 		Gear^.Timer:= 0;
       
   285 		Gear^.Pos:= 0
       
   286 		end;
       
   287 
   279    if ((Gear^.Message and gm_LJump ) <> 0) then
   288    if ((Gear^.Message and gm_LJump ) <> 0) then
   280       begin
   289       begin
   281       Gear^.Message:= Gear^.Message and not gm_LJump;
   290       Gear^.Message:= Gear^.Message and not gm_LJump;
   282       DeleteCI(Gear);
   291       DeleteCI(Gear);
   283       if not TestCollisionYwithGear(Gear, -1) then
   292       if not TestCollisionYwithGear(Gear, -1) then
   469 if not isInMultiShoot then
   478 if not isInMultiShoot then
   470    AllInactive:= false
   479    AllInactive:= false
   471 else
   480 else
   472    Gear^.Message:= 0;
   481    Gear^.Message:= 0;
   473 
   482 
       
   483 if (Gear^.State and gstAnimation) <> 0 then
       
   484 	begin
       
   485 	Gear^.Message:= 0;
       
   486 	inc(Gear^.Timer);
       
   487 	if Gear^.Timer = 125 then
       
   488 		begin
       
   489 		Gear^.Timer:= 0;
       
   490 		inc(Gear^.Pos);
       
   491 		if Gear^.Pos = 12 then
       
   492 			Gear^.State:= Gear^.State and not gstAnimation
       
   493 		end;
       
   494 	exit
       
   495 	end;
       
   496 
       
   497 
   474 if (TurnTimeLeft = 0) or (Gear^.Damage > 0) then
   498 if (TurnTimeLeft = 0) or (Gear^.Damage > 0) then
   475    begin
   499    begin
   476    TurnTimeLeft:= 0;
   500    TurnTimeLeft:= 0;
   477    Gear^.State:= Gear^.State and not gstHHDriven;
   501    Gear^.State:= Gear^.State and not gstHHDriven;
   478    if Gear^.Damage > 0 then
   502    if Gear^.Damage > 0 then
   552       StepTicks:= 350
   576       StepTicks:= 350
   553       end;
   577       end;
   554    exit
   578    exit
   555    end;
   579    end;
   556 
   580 
   557    if not isInMultiShoot then
   581 	if not isInMultiShoot then
   558       begin
   582 		begin
   559       if StepTicks > 0 then dec(StepTicks);
   583 		if StepTicks > 0 then dec(StepTicks);
   560       if (StepTicks = 0) then HedgehogStep(Gear)
   584 		if (StepTicks = 0) then HedgehogStep(Gear)
   561       end
   585 		end
   562 end;
   586 end;
   563 
   587 
   564 ////////////////////////////////////////////////////////////////////////////////
   588 ////////////////////////////////////////////////////////////////////////////////
   565 procedure doStepHedgehogFree(Gear: PGear);
   589 procedure doStepHedgehogFree(Gear: PGear);
   566 var prevState: Longword;
   590 var prevState: Longword;
   587 		AllInactive:= false
   611 		AllInactive:= false
   588 		end;
   612 		end;
   589 	exit
   613 	exit
   590 	end;
   614 	end;
   591 
   615 
   592 if ((Gear^.State and gstAnimation) = 0) and
   616 if ((Gear^.State and gstWait) = 0) and
   593 	(prevState <> Gear^.State) then
   617 	(prevState <> Gear^.State) then
   594 	begin
   618 	begin
   595 	Gear^.State:= gstAnimation;
   619 	Gear^.State:= gstWait;
   596 	Gear^.Timer:= 150
   620 	Gear^.Timer:= 150
   597 	end else
   621 	end else
   598 	begin
   622 	begin
   599 	if Gear^.Timer = 0 then
   623 	if Gear^.Timer = 0 then
   600 		begin
   624 		begin