hedgewars/uScript.pas
changeset 11061 2f1efb11ddf3
parent 11060 506b6184f4af
child 11062 46f293e8cbfb
equal deleted inserted replaced
11060:506b6184f4af 11061:2f1efb11ddf3
  2294         if not lua_isnoneornil(L, 8) then
  2294         if not lua_isnoneornil(L, 8) then
  2295 	        flipVert := lua_toboolean(L, 8)
  2295 	        flipVert := lua_toboolean(L, 8)
  2296         else flipVert := false;
  2296         else flipVert := false;
  2297         lf:= 0;
  2297         lf:= 0;
  2298 
  2298 
  2299         // accept any amount of landflags, loop is never executed if n>6
  2299         // accept any amount of landflags, loop is never executed if n<9
  2300         for i:= 9 to n do
  2300         for i:= 9 to n do
  2301             lf:= lf or lua_tointeger(L, i);
  2301             lf:= lf or lua_tointeger(L, i);
  2302 
  2302 
  2303         n:= LuaToSpriteOrd(L, 3, call, params);
  2303         n:= LuaToSpriteOrd(L, 3, call, params);
  2304         if n >= 0 then
  2304         if n >= 0 then
  2691 ScriptSetInteger('GameFlags', GameFlags);
  2691 ScriptSetInteger('GameFlags', GameFlags);
  2692 ScriptSetString('Seed', cSeed);
  2692 ScriptSetString('Seed', cSeed);
  2693 ScriptSetInteger('TemplateFilter', cTemplateFilter);
  2693 ScriptSetInteger('TemplateFilter', cTemplateFilter);
  2694 ScriptSetInteger('TemplateNumber', LuaTemplateNumber);
  2694 ScriptSetInteger('TemplateNumber', LuaTemplateNumber);
  2695 ScriptSetInteger('MapGen', ord(cMapGen));
  2695 ScriptSetInteger('MapGen', ord(cMapGen));
       
  2696 ScriptSetInteger('MapFeatureSize', cFeatureSize);
  2696 ScriptSetInteger('ScreenHeight', cScreenHeight);
  2697 ScriptSetInteger('ScreenHeight', cScreenHeight);
  2697 ScriptSetInteger('ScreenWidth', cScreenWidth);
  2698 ScriptSetInteger('ScreenWidth', cScreenWidth);
  2698 ScriptSetInteger('TurnTime', cHedgehogTurnTime);
  2699 ScriptSetInteger('TurnTime', cHedgehogTurnTime);
  2699 ScriptSetInteger('CaseFreq', cCaseFactor);
  2700 ScriptSetInteger('CaseFreq', cCaseFactor);
  2700 ScriptSetInteger('HealthCaseProb', cHealthCaseProb);
  2701 ScriptSetInteger('HealthCaseProb', cHealthCaseProb);
  2720 // pop game variables
  2721 // pop game variables
  2721 ParseCommand('seed ' + ScriptGetString('Seed'), true, true);
  2722 ParseCommand('seed ' + ScriptGetString('Seed'), true, true);
  2722 cTemplateFilter  := ScriptGetInteger('TemplateFilter');
  2723 cTemplateFilter  := ScriptGetInteger('TemplateFilter');
  2723 LuaTemplateNumber:= ScriptGetInteger('TemplateNumber');
  2724 LuaTemplateNumber:= ScriptGetInteger('TemplateNumber');
  2724 cMapGen          := TMapGen(ScriptGetInteger('MapGen'));
  2725 cMapGen          := TMapGen(ScriptGetInteger('MapGen'));
       
  2726 cFeatureSize     := ScriptGetInteger('MapFeatureSize');
  2725 GameFlags        := ScriptGetInteger('GameFlags');
  2727 GameFlags        := ScriptGetInteger('GameFlags');
  2726 cHedgehogTurnTime:= ScriptGetInteger('TurnTime');
  2728 cHedgehogTurnTime:= ScriptGetInteger('TurnTime');
  2727 cCaseFactor      := ScriptGetInteger('CaseFreq');
  2729 cCaseFactor      := ScriptGetInteger('CaseFreq');
  2728 cHealthCaseProb  := ScriptGetInteger('HealthCaseProb');
  2730 cHealthCaseProb  := ScriptGetInteger('HealthCaseProb');
  2729 cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount');
  2731 cHealthCaseAmount:= ScriptGetInteger('HealthCaseAmount');