hedgewars/HHHandlers.inc
changeset 1286 a02a5345b91e
parent 1285 993845ea5c8d
child 1347 1102e19780b9
equal deleted inserted replaced
1285:993845ea5c8d 1286:a02a5345b91e
   164                        amKamikaze: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
   164                        amKamikaze: CurAmmoGear:= AddGear(hwRound(X), hwRound(Y), gtKamikaze, 0, xx * _0_5, yy * _0_5, 0);
   165                          amCake: begin
   165                          amCake: begin
   166                                  CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 3, hwRound(Y), gtCake, 0, xx, _0, 0);
   166                                  CurAmmoGear:= AddGear(hwRound(X) + hwSign(dX) * 3, hwRound(Y), gtCake, 0, xx, _0, 0);
   167                                  PlaySound(sndLaugh, false)
   167                                  PlaySound(sndLaugh, false)
   168                                  end;
   168                                  end;
   169                     amSeduction: FollowGear:= AddGear(hwRound(X + xx * cHHRadius * 2), hwRound(Y + yy * cHHRadius * 2), gtSeduction, 0, xx * _0_4, yy * _0_4, 0);
   169                     amSeduction: CurAmmoGear:= AddGear(hwRound(X + xx * cHHRadius * 2), hwRound(Y + yy * cHHRadius * 2), gtSeduction, 0, xx * _0_4, yy * _0_4, 0);
   170                    amWatermelon: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtWatermelon,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
   170                    amWatermelon: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtWatermelon,  0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, Ammo^[CurSlot, CurAmmo].Timer);
   171                   amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 5000);
   171                   amHellishBomb: FollowGear:= AddGear(hwRound(X), hwRound(Y), gtHellishBomb,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 5000);
   172                   end;
   172                   end;
   173 
   173 
   174         uStats.AmmoUsed(Ammo^[CurSlot, CurAmmo].AmmoType);
   174         uStats.AmmoUsed(Ammo^[CurSlot, CurAmmo].AmmoType);
   190 end;
   190 end;
   191 
   191 
   192 procedure AfterAttack;
   192 procedure AfterAttack;
   193 begin
   193 begin
   194 with CurrentHedgehog^.Gear^,
   194 with CurrentHedgehog^.Gear^,
   195      CurrentHedgehog^ do
   195 		CurrentHedgehog^ do
   196      begin
   196 	begin
   197         Inc(AttacksNum);
   197 		Inc(AttacksNum);
   198         State:= State and not gstAttacking;
   198 		State:= State and not gstAttacking;
   199         if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) or
   199 		if (Ammo^[CurSlot, CurAmmo].NumPerTurn >= AttacksNum) or
   200            ((GameFlags and gfMultiWeapon) <> 0) then isInMultiShoot:= true
   200 		((GameFlags and gfMultiWeapon) <> 0) then isInMultiShoot:= true
   201            else begin
   201 		else begin
   202            TurnTimeLeft:= Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].TimeAfterTurn;
   202 		TurnTimeLeft:= Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].TimeAfterTurn;
   203            State:= State or gstAttacked;
   203 		State:= State or gstAttacked;
   204            OnUsedAmmo(CurrentHedgehog^)
   204 		OnUsedAmmo(CurrentHedgehog^)
   205            end;
   205 		end;
   206      AttackBar:= 0;
   206 	AttackBar:= 0;
   207      end
   207 	end
   208 end;
   208 end;
   209 
   209 
   210 ////////////////////////////////////////////////////////////////////////////////
   210 ////////////////////////////////////////////////////////////////////////////////
   211 procedure doStepHedgehogDead(Gear: PGear);
   211 procedure doStepHedgehogDead(Gear: PGear);
   212 const frametime = 200;
   212 const frametime = 200;