hedgewars/PascalExports.pas
changeset 3836 833c0f32e326
parent 3789 c3eb56754e92
child 3873 28c3b8143573
equal deleted inserted replaced
3835:cbee69165c6a 3836:833c0f32e326
   216     else
   216     else
   217         exit(false);
   217         exit(false);
   218 end;
   218 end;
   219 
   219 
   220 function HW_isWeaponTimerable: boolean; cdecl; export;
   220 function HW_isWeaponTimerable: boolean; cdecl; export;
   221 var CurSlot, CurAmmo: LongWord;
   221 begin
   222 begin
       
   223     CurSlot:= CurrentHedgehog^.CurSlot;
       
   224     CurAmmo:= CurrentHedgehog^.CurAmmo;
       
   225     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   222     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   226         exit( (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Timerable) <> 0)
   223         exit( (CurrentHedgehog^.CurWeapon^.Propz and ammoprop_Timerable) <> 0)
   227     else
   224     else
   228         exit(false);
   225         exit(false);
   229 end;
   226 end;
   230 
   227 
   231 function HW_isWeaponSwitch: boolean cdecl; export;
   228 function HW_isWeaponSwitch: boolean cdecl; export;
   235     else
   232     else
   236         exit(false)
   233         exit(false)
   237 end;
   234 end;
   238 
   235 
   239 function HW_isWeaponRope: boolean cdecl; export;
   236 function HW_isWeaponRope: boolean cdecl; export;
   240 var CurSlot, CurAmmo: LongWord;
   237 begin
   241 begin
       
   242     CurSlot:= CurrentHedgehog^.CurSlot;
       
   243     CurAmmo:= CurrentHedgehog^.CurAmmo;
       
   244     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   238     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   245         exit (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amRope)
   239         exit (CurrentHedgehog^.CurWeapon^.AmmoType = amRope)
   246     else
   240     else
   247         exit(false);
   241         exit(false);
   248 end;
   242 end;
   249 
   243 
   250 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   244 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   251 begin
   245 begin
   252     ParseCommand('/timer ' + inttostr(time), true);
   246     ParseCommand('/timer ' + inttostr(time), true);
   253 end;
   247 end;
   254 
   248 
   255 procedure HW_setPianoSound(snd: LongInt); cdecl; export;
   249 procedure HW_setPianoSound(snd: LongInt); cdecl; export;
   256 var CurSlot, CurAmmo: LongWord;
   250 begin
   257 begin
       
   258     CurSlot:= CurrentHedgehog^.CurSlot;
       
   259     CurAmmo:= CurrentHedgehog^.CurAmmo;
       
   260     // this most likely won't work in network game
   251     // this most likely won't work in network game
   261     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0)
   252     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0)
   262        and (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amPiano) then
   253        and (CurrentHedgehog^.CurWeapon^.AmmoType = amPiano) then
   263         case snd of
   254         case snd of
   264             0: PlaySound(sndPiano0);
   255             0: PlaySound(sndPiano0);
   265             1: PlaySound(sndPiano1);
   256             1: PlaySound(sndPiano1);
   266             2: PlaySound(sndPiano2);
   257             2: PlaySound(sndPiano2);
   267             3: PlaySound(sndPiano3);
   258             3: PlaySound(sndPiano3);