hedgewars/uAmmos.pas
changeset 7754 e81dc9bef8b8
parent 7426 55b49cc1f33a
child 8026 4a4f21070479
child 8992 5b0be812dcdb
equal deleted inserted replaced
7753:dda33caa609d 7754:e81dc9bef8b8
    18 
    18 
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 
    20 
    21 unit uAmmos;
    21 unit uAmmos;
    22 interface
    22 interface
    23 uses uConsts, uTypes;
    23 uses uConsts, uTypes, uStore;
    24 
    24 
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 
    27 
    28 procedure AddAmmoStore;
    28 procedure AddAmmoStore;
   275             dec(Count);
   275             dec(Count);
   276             if Count = 0 then
   276             if Count = 0 then
   277                 begin
   277                 begin
   278                 PackAmmo(Ammo, Ammoz[AmmoType].Slot);
   278                 PackAmmo(Ammo, Ammoz[AmmoType].Slot);
   279                 //SwitchNotHeldAmmo(Hedgehog);
   279                 //SwitchNotHeldAmmo(Hedgehog);
       
   280                 if CurAmmoType = amKnife then LoadHedgehogHat(Hedgehog, Hedgehog.Hat);
   280                 CurAmmoType:= amNothing
   281                 CurAmmoType:= amNothing
   281                 end
   282                 end
   282             end
   283             end
   283     end;
   284     end;
   284 end;
   285 end;
   345             inc(slot)
   346             inc(slot)
   346             end
   347             end
   347         end;
   348         end;
   348     TryDo(slot <= cMaxSlotIndex, 'Ammo slot index overflow', true);
   349     TryDo(slot <= cMaxSlotIndex, 'Ammo slot index overflow', true);
   349     CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
   350     CurAmmoType:= Ammo^[slot, ammoidx].AmmoType;
       
   351     if CurAmmoType = amKnife then LoadHedgehogHat(Hedgehog, 'Reserved/chef')
   350     end
   352     end
   351 end;
   353 end;
   352 
   354 
   353 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
   355 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
   354 var s: shortstring;
   356 var s: shortstring;