hedgewars/PascalExports.pas
changeset 3926 668b71f31e51
parent 3924 2a9ace189288
child 3928 2560731c860d
equal deleted inserted replaced
3924:2a9ace189288 3926:668b71f31e51
    12 
    12 
    13 unit PascalExports;
    13 unit PascalExports;
    14 
    14 
    15 interface
    15 interface
    16 uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, 
    16 uses uKeys, GLunit, uWorld, uMisc, uConsole, uTeams, uConsts, uChat, 
    17      uGears, uSound, hwengine, uAmmos; // don't change the order!
    17      uGears, uSound, hwengine, uAmmos, uLocale; // don't change the order!
    18 
    18 
    19 {$INCLUDE "config.inc"}
    19 {$INCLUDE "config.inc"}
    20 
    20 
    21 implementation
    21 implementation
    22 {$IFDEF HWLIBRARY}
    22 {$IFDEF HWLIBRARY}
   258             7: PlaySound(sndPiano7);
   258             7: PlaySound(sndPiano7);
   259             else PlaySound(sndPiano8);
   259             else PlaySound(sndPiano8);
   260         end;
   260         end;
   261 end;
   261 end;
   262 
   262 
       
   263 function HW_getWeaponNameByIndex(whichone: LongInt): PChar; cdecl; export;
       
   264 begin
       
   265     exit (str2pchar(trammo[Ammoz[TAmmoType(whichone+1)].NameId]));
       
   266 end;
       
   267 
       
   268 function HW_getNumberOfWeapons:LongInt; cdecl; export;
       
   269 begin
       
   270     exit(ord(high(TAmmoType)));
       
   271 end;
   263 
   272 
   264 procedure HW_setWeapon(whichone: LongInt); cdecl; export;
   273 procedure HW_setWeapon(whichone: LongInt); cdecl; export;
   265 begin
   274 begin
   266     SetWeapon(TAmmoType(whichone));
   275     if (not CurrentTeam^.ExtDriven) and (CurrentTeam^.Hedgehogs[0].BotLevel = 0) then
       
   276         SetWeapon(TAmmoType(whichone+1));
       
   277 end;
       
   278 
       
   279 function HW_getDelays: pByte; cdecl; export;
       
   280 var skipTurns : PByte;
       
   281     a : TAmmoType;
       
   282 begin
       
   283     GetMem(skipTurns,ord(High(TAmmoType)));
       
   284     for a:= Low(TAmmoType) to High(TAmmoType) do
       
   285         skipTurns[ord(a)-1]:= byte(Ammoz[a].SkipTurns);
       
   286     exit(skipTurns);
       
   287     // leak?
       
   288 end;
       
   289 
       
   290 function HW_getTurnsForCurrentTeam:LongInt; cdecl; export;
       
   291 begin
       
   292     exit(CurrentTeam^.Clan^.TurnNumber);
       
   293 end;
       
   294 
       
   295 function HW_getMaxNumberOfHogs: LongInt; cdecl; export;
       
   296 begin
       
   297     exit(cMaxHHIndex+1);
       
   298 end;
       
   299 
       
   300 function HW_getMaxNumberOfTeams: LongInt; cdecl; export;
       
   301 begin
       
   302     exit(cMaxTeams);
   267 end;
   303 end;
   268 {$ENDIF}
   304 {$ENDIF}
   269 
   305 
   270 end.
   306 end.
   271 
   307