hedgewars/PascalExports.pas
changeset 3739 97cf933e5bd2
parent 3737 2ba6ac8a114b
child 3778 2e61bb50cc57
equal deleted inserted replaced
3738:f10626e18b8a 3739:97cf933e5bd2
   200     exit( isPaused );
   200     exit( isPaused );
   201 end;
   201 end;
   202 
   202 
   203 function HW_isWeaponRequiringClick: boolean; cdecl; export;
   203 function HW_isWeaponRequiringClick: boolean; cdecl; export;
   204 begin
   204 begin
   205     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
   205     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   206         exit( (CurrentHedgehog^.Gear^.State and gstHHChooseTarget) <> 0 )
   206         exit( (CurrentHedgehog^.Gear^.State and gstHHChooseTarget) <> 0 )
   207     else
   207     else
   208         exit(false);
   208         exit(false);
   209 end;
   209 end;
   210 
   210 
   211 function HW_isWeaponTimerable: boolean; cdecl; export;
   211 function HW_isWeaponTimerable: boolean; cdecl; export;
   212 var CurSlot, CurAmmo: LongWord;
   212 var CurSlot, CurAmmo: LongWord;
   213 begin
   213 begin
   214     CurSlot:= CurrentHedgehog^.CurSlot;
   214     CurSlot:= CurrentHedgehog^.CurSlot;
   215     CurAmmo:= CurrentHedgehog^.CurAmmo;
   215     CurAmmo:= CurrentHedgehog^.CurAmmo;
   216     exit( (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Timerable) <> 0)
   216     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
       
   217         exit( (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].Propz and ammoprop_Timerable) <> 0)
       
   218     else
       
   219         exit(false);
   217 end;
   220 end;
   218 
   221 
   219 function HW_isWeaponSwitch: boolean cdecl; export;
   222 function HW_isWeaponSwitch: boolean cdecl; export;
   220 begin
   223 begin
   221     if CurAmmoGear <> nil then
   224     if (CurAmmoGear <> nil) and (CurrentHedgehog^.BotLevel = 0) then
   222         exit(CurAmmoGear^.AmmoType = amSwitch)
   225         exit(CurAmmoGear^.AmmoType = amSwitch)
   223     else
   226     else
   224         exit(false)
   227         exit(false)
   225 end;
   228 end;
   226 
   229 
   227 function HW_isWeaponRope: boolean cdecl; export;
   230 function HW_isWeaponRope: boolean cdecl; export;
   228 var CurSlot, CurAmmo: LongWord;
   231 var CurSlot, CurAmmo: LongWord;
   229 begin
   232 begin
   230     CurSlot:= CurrentHedgehog^.CurSlot;
   233     CurSlot:= CurrentHedgehog^.CurSlot;
   231     CurAmmo:= CurrentHedgehog^.CurAmmo;
   234     CurAmmo:= CurrentHedgehog^.CurAmmo;
   232     exit (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amRope)
   235     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0) then
       
   236         exit (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amRope)
       
   237     else
       
   238         exit(false);
   233 end;
   239 end;
   234 
   240 
   235 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   241 procedure HW_setGrenadeTime(time: LongInt); cdecl; export;
   236 begin
   242 begin
   237     ParseCommand('/timer ' + inttostr(time), true);
   243     ParseCommand('/timer ' + inttostr(time), true);
   241 var CurSlot, CurAmmo: LongWord;
   247 var CurSlot, CurAmmo: LongWord;
   242 begin
   248 begin
   243     CurSlot:= CurrentHedgehog^.CurSlot;
   249     CurSlot:= CurrentHedgehog^.CurSlot;
   244     CurAmmo:= CurrentHedgehog^.CurAmmo;
   250     CurAmmo:= CurrentHedgehog^.CurAmmo;
   245     // this most likely won't work in network game
   251     // this most likely won't work in network game
   246     if (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amPiano) then
   252     if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Ammo <> nil) and (CurrentHedgehog^.BotLevel = 0)
       
   253        and (CurrentHedgehog^.Ammo^[CurSlot, CurAmmo].AmmoType = amPiano) then
   247         case snd of
   254         case snd of
   248             0: PlaySound(sndPiano0);
   255             0: PlaySound(sndPiano0);
   249             1: PlaySound(sndPiano1);
   256             1: PlaySound(sndPiano1);
   250             2: PlaySound(sndPiano2);
   257             2: PlaySound(sndPiano2);
   251             3: PlaySound(sndPiano3);
   258             3: PlaySound(sndPiano3);
   254             6: PlaySound(sndPiano6);
   261             6: PlaySound(sndPiano6);
   255             7: PlaySound(sndPiano7);
   262             7: PlaySound(sndPiano7);
   256             else PlaySound(sndPiano8);
   263             else PlaySound(sndPiano8);
   257         end;
   264         end;
   258 end;
   265 end;
   259 
       
   260 //amSwitch
       
   261 {$ENDIF}
   266 {$ENDIF}
   262 
   267 
   263 end.
   268 end.
   264 
   269