hedgewars/uScript.pas
changeset 9567 42bc1b58a242
parent 9531 7fcdedc45589
child 9648 3a3defce1b28
equal deleted inserted replaced
9565:7f786eb439aa 9567:42bc1b58a242
    93     ScriptAmmoLoadout : shortstring;
    93     ScriptAmmoLoadout : shortstring;
    94     ScriptAmmoProbability : shortstring;
    94     ScriptAmmoProbability : shortstring;
    95     ScriptAmmoDelay : shortstring;
    95     ScriptAmmoDelay : shortstring;
    96     ScriptAmmoReinforcement : shortstring;
    96     ScriptAmmoReinforcement : shortstring;
    97     ScriptLoaded : boolean;
    97     ScriptLoaded : boolean;
       
    98     mapDims : boolean;
    98 
    99 
    99 procedure ScriptPrepareAmmoStore; forward;
   100 procedure ScriptPrepareAmmoStore; forward;
   100 procedure ScriptApplyAmmoStore; forward;
   101 procedure ScriptApplyAmmoStore; forward;
   101 procedure ScriptSetAmmo(ammo : TAmmoType; count, propability, delay, reinforcement: Byte); forward;
   102 procedure ScriptSetAmmo(ammo : TAmmoType; count, propability, delay, reinforcement: Byte); forward;
   102 
   103 
  2063         end;
  2064         end;
  2064     ScriptApplyAmmoStore
  2065     ScriptApplyAmmoStore
  2065     end;
  2066     end;
  2066 
  2067 
  2067 ScriptSetInteger('ClansCount', ClansCount);
  2068 ScriptSetInteger('ClansCount', ClansCount);
  2068 ScriptSetInteger('TeamsCount', TeamsCount)
  2069 ScriptSetInteger('TeamsCount', TeamsCount);
       
  2070 mapDims:= false
  2069 end;
  2071 end;
  2070 
  2072 
  2071 
  2073 
  2072 // Update values of screen dimensions and allow script to react to resolution change
  2074 // Update values of screen dimensions and allow script to react to resolution change
  2073 procedure ScriptOnScreenResize();
  2075 procedure ScriptOnScreenResize();
  2120 begin
  2122 begin
  2121 ScriptSetInteger('TurnTimeLeft', TurnTimeLeft);
  2123 ScriptSetInteger('TurnTimeLeft', TurnTimeLeft);
  2122 ScriptSetInteger('GameTime', GameTicks);
  2124 ScriptSetInteger('GameTime', GameTicks);
  2123 ScriptSetInteger('TotalRounds', TotalRounds);
  2125 ScriptSetInteger('TotalRounds', TotalRounds);
  2124 ScriptSetInteger('WaterLine', cWaterLine);
  2126 ScriptSetInteger('WaterLine', cWaterLine);
  2125 if GameTicks = 0 then
  2127 if not mapDims then
  2126     begin
  2128     begin
       
  2129     mapDims:= true;
  2127     ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
  2130     ScriptSetInteger('LAND_WIDTH', LAND_WIDTH);
  2128     ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
  2131     ScriptSetInteger('LAND_HEIGHT', LAND_HEIGHT);
  2129     ScriptSetInteger('LeftX', leftX);
  2132     ScriptSetInteger('LeftX', leftX);
  2130     ScriptSetInteger('RightX', rightX);
  2133     ScriptSetInteger('RightX', rightX);
  2131     ScriptSetInteger('TopY', topY)
  2134     ScriptSetInteger('TopY', topY)
  2619 begin
  2622 begin
  2620 end;
  2623 end;
  2621 
  2624 
  2622 procedure initModule;
  2625 procedure initModule;
  2623 begin
  2626 begin
       
  2627 mapDims:= false;
  2624 end;
  2628 end;
  2625 
  2629 
  2626 procedure freeModule;
  2630 procedure freeModule;
  2627 begin
  2631 begin
  2628 end;
  2632 end;