hedgewars/HHHandlers.inc
changeset 2608 cebfea02f8b5
parent 2603 abed6070a669
child 2619 bc2786a00fb8
equal deleted inserted replaced
2607:dbeaba78e676 2608:cebfea02f8b5
    25 with PHedgehog(Gear^.Hedgehog)^ do
    25 with PHedgehog(Gear^.Hedgehog)^ do
    26 	begin
    26 	begin
    27 	Gear^.Message:= Gear^.Message and not gm_Slot;
    27 	Gear^.Message:= Gear^.Message and not gm_Slot;
    28 
    28 
    29 	if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0)
    29 	if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0)
    30 		or (AttacksNum > 0)
    30 		or (MultiShootAttacks > 0)
    31 		or ((Gear^.State and gstHHDriven) = 0) then exit;
    31 		or ((Gear^.State and gstHHDriven) = 0) then exit;
    32 
    32 
    33 	Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
    33 	Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
    34 
    34 
    35 	if CurSlot = slot then
    35 	if CurSlot = slot then
   240 		CurrentHedgehog^ do
   240 		CurrentHedgehog^ do
   241 	begin
   241 	begin
   242 	State:= State and not gstAttacking;
   242 	State:= State and not gstAttacking;
   243 	if ((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_Utility) = 0 then
   243 	if ((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_Utility) = 0 then
   244 		begin
   244 		begin
   245 		Inc(AttacksNum);
   245 		Inc(MultiShootAttacks);
   246 		
   246 		
   247 		if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) then
   247 		if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= MultiShootAttacks) then
   248 			begin
   248 			begin
   249 			s:= inttostr(Ammo^[CurSlot, CurAmmo].NumPerTurn + 1 - AttacksNum);
   249 			s:= inttostr(Ammo^[CurSlot, CurAmmo].NumPerTurn + 1 - MultiShootAttacks);
   250 			AddCaption(format(trmsg[sidRemaining], s),
   250 			AddCaption(format(trmsg[sidRemaining], s),
   251 				$FFFFFF,
   251 				$FFFFFF,
   252 				capgrpAmmostate);
   252 				capgrpAmmostate);
   253 			end;
   253 			end;
   254 				
   254 		
   255 		if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) or
   255 		if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= MultiShootAttacks) or
   256 		((GameFlags and gfMultiWeapon) <> 0) then
   256 			((GameFlags and gfMultiWeapon) <> 0) then
   257 			begin
   257 			begin
   258 			isInMultiShoot:= true
   258 			isInMultiShoot:= true
   259 			end
   259 			end
   260 		else
   260 		else
   261 			begin
   261 			begin
   263 			State:= State or gstAttacked;
   263 			State:= State or gstAttacked;
   264 			OnUsedAmmo(CurrentHedgehog^);
   264 			OnUsedAmmo(CurrentHedgehog^);
   265 			end;
   265 			end;
   266 		end
   266 		end
   267 	else
   267 	else
   268 	begin
   268 		begin
   269 	OnUsedAmmo(CurrentHedgehog^);
   269 		OnUsedAmmo(CurrentHedgehog^);
   270 	ApplyAmmoChanges(CurrentHedgehog^);
   270 		ApplyAmmoChanges(CurrentHedgehog^);
   271 	end;
   271 		end;
   272 	AttackBar:= 0;
   272 	AttackBar:= 0;
   273 	end
   273 	end
   274 end;
   274 end;
   275 
   275 
   276 ////////////////////////////////////////////////////////////////////////////////
   276 ////////////////////////////////////////////////////////////////////////////////