mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-01-20 00:24:49 +00:00
Formatting/Info
This commit is contained in:
parent
487dd94044
commit
98e7ff7170
|
|
@ -2,6 +2,8 @@
|
||||||
// - To Further Randomize Map Rotation
|
// - To Further Randomize Map Rotation
|
||||||
// - Keep Track of maps so they arnt chosin again
|
// - Keep Track of maps so they arnt chosin again
|
||||||
//
|
//
|
||||||
|
// - Set $Host::ClassicRandomMissions to 2 to activate
|
||||||
|
// - $Host::ClassicRandomMissions = 2;
|
||||||
|
|
||||||
package DarkTigerMapRotation
|
package DarkTigerMapRotation
|
||||||
{
|
{
|
||||||
|
|
@ -22,6 +24,7 @@ function getNextMission( %misName, %misType )
|
||||||
echo("Error: Could not find matching game type in function " @ "getNextMission( " @ %misName @", " @%misType @ " ).\n");
|
echo("Error: Could not find matching game type in function " @ "getNextMission( " @ %misName @", " @%misType @ " ).\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
%EvoTempMissionListLength = 0;
|
%EvoTempMissionListLength = 0;
|
||||||
%EvoCurrentMissionIndex = -1;
|
%EvoCurrentMissionIndex = -1;
|
||||||
|
|
||||||
|
|
@ -111,14 +114,17 @@ function buildMissionList()
|
||||||
{
|
{
|
||||||
%search = "missions/*.mis";
|
%search = "missions/*.mis";
|
||||||
%fobject = new FileObject();
|
%fobject = new FileObject();
|
||||||
|
|
||||||
for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search))
|
for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search))
|
||||||
{
|
{
|
||||||
// get the name
|
// get the name
|
||||||
%name = fileBase(%file);
|
%name = fileBase(%file);
|
||||||
%idx = $HostMissionCount;
|
%idx = $HostMissionCount;
|
||||||
|
|
||||||
$HostMissionCount++;
|
$HostMissionCount++;
|
||||||
$HostMissionFile[%idx] = %name;
|
$HostMissionFile[%idx] = %name;
|
||||||
$HostMissionName[%idx] = %name;
|
$HostMissionName[%idx] = %name;
|
||||||
|
|
||||||
if(!%fobject.openForRead(%file))
|
if(!%fobject.openForRead(%file))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
@ -218,6 +224,7 @@ function getRSGN(%min,%max,%id)
|
||||||
}
|
}
|
||||||
|
|
||||||
%rng = getRandom(%min,%max - $rngCount[%id] ); // find random number - the total number we have done
|
%rng = getRandom(%min,%max - $rngCount[%id] ); // find random number - the total number we have done
|
||||||
|
|
||||||
for(%i = %min; %i <= %max; %i++) // loop cycle though all possable numbers
|
for(%i = %min; %i <= %max; %i++) // loop cycle though all possable numbers
|
||||||
{
|
{
|
||||||
if($RngList[%id,%i]) // skip over ones that we have all ready used
|
if($RngList[%id,%i]) // skip over ones that we have all ready used
|
||||||
|
|
@ -225,17 +232,22 @@ function getRSGN(%min,%max,%id)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
%c++; // skip counter
|
%c++; // skip counter
|
||||||
|
|
||||||
if(%rng == %c) // onces the skip counter matches the rng number we have landed on a valid number that we havent used yet
|
if(%rng == %c) // onces the skip counter matches the rng number we have landed on a valid number that we havent used yet
|
||||||
{
|
{
|
||||||
break; // kill the loop
|
break; // kill the loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$rngList[%id,%i] = 1;// this marks said number as used
|
$rngList[%id,%i] = 1;// this marks said number as used
|
||||||
$rngCount[%id]++;// up are total used numbers
|
$rngCount[%id]++;// up are total used numbers
|
||||||
$rngLast[%id] = %i; // for when the list resets it wont pick the same number twice
|
$rngLast[%id] = %i; // for when the list resets it wont pick the same number twice
|
||||||
if(%i > %max || %i < %min){ // fail safe
|
|
||||||
|
if(%i > %max || %i < %min)
|
||||||
|
{ // fail safe
|
||||||
return %max;
|
return %max;
|
||||||
}
|
}
|
||||||
|
|
||||||
return %i; // return the one we stoped on
|
return %i; // return the one we stoped on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -250,6 +262,7 @@ function addRotationMap(%file, %type, %ffa, %cycle)
|
||||||
{
|
{
|
||||||
%cycle = %ffa;
|
%cycle = %ffa;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isFile("missions/" @ %file @ ".mis"))
|
if(isFile("missions/" @ %file @ ".mis"))
|
||||||
{
|
{
|
||||||
if(%type $= "TR2" && !$Host::ClassicLoadTR2Gametype) // load TR2 gametype?
|
if(%type $= "TR2" && !$Host::ClassicLoadTR2Gametype) // load TR2 gametype?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue