Shtoyan 2 years ago
parent
commit
0a54be725e
  1. 2
      config/AcediaGameModes.ini
  2. 2
      config/AcediaLauncher.ini
  3. 3
      config/AcediaMaps.ini
  4. 9
      sources/GameModes/GameMode.uc
  5. 55
      sources/MapList.uc
  6. 2
      sources/Packages.uc
  7. 1
      sources/VotingHandlerAdapter.uc

2
config/AcediaGameModes.ini

@ -1,7 +1,9 @@
[hard GameMode]
title={$green Hard difficulty}
difficulty=hard
mapList=defaultHard
[hell GameMode]
title={$crimson Hell On Earth}
difficulty=hoe
mapList=defaultHOE

2
config/AcediaLauncher.ini

@ -1,2 +1,2 @@
[AcediaLauncher.Packages]
useGameModes=false
useGameModes=true

3
config/AcediaMaps.ini

@ -0,0 +1,3 @@
[defaultHard MapList]
[defaultHOE MapList]

9
sources/GameModes/GameMode.uc

@ -38,6 +38,8 @@ var protected config string acronym;
// Map prefix - only maps that start with specified prefix will be voteable for
// this game mode (plain string)
var protected config string mapPrefix;
// TODO
var protected config string mapList;
// Aliases are an unnecessary overkill for difficulty names, so just define
// them in special `string` arrays.
@ -58,6 +60,7 @@ protected function DefaultIt()
gameTypeClass = "KFMod.KFGameType";
acronym = "";
mapPrefix = "KF";
mapList = "defaultHard";
includeFeature.length = 0;
excludeFeature.length = 0;
includeMutator.length = 0;
@ -77,6 +80,8 @@ protected function HashTable ToData()
result.SetString(P("gameTypeClass"), gameTypeClass);
result.SetString(P("acronym"), acronym);
result.SetString(P("mapPrefix"), mapPrefix);
result.SetString(P("mapList"), mapList);
nextArray = _.collections.EmptyArrayList();
for (i = 0; i < option.length; i += 1)
{
@ -105,6 +110,8 @@ protected function FromData(HashTable source)
gameTypeClass = source.GetString(P("gameTypeClass"));
acronym = source.GetString(P("acronym"));
mapPrefix = source.GetString(P("mapPrefix"));
mapList = source.GetString(P("mapList"));
nextArray = source.GetArrayList(P("option"));
if (nextArray == none) {
return;
@ -271,6 +278,8 @@ defaultproperties
hardSynonyms(0) = "harder" // "hard" is prefix of this, so it will count
hardSynonyms(1) = "difficult"
suicidalSynonyms(0) = "suicidal"
// DONE!
suicidalSynonyms(1) = "sui"
hoeSynonyms(0) = "hellonearth"
hoeSynonyms(1) = "hellon earth"
hoeSynonyms(2) = "hell onearth"

55
sources/MapList.uc

@ -0,0 +1,55 @@
class MapList extends AcediaConfig
perObjectConfig
config(AcediaMaps);
var public config array<string> map;
protected function HashTable ToData() {
local int i;
local ArrayList mapArray;
local HashTable result;
result = _.collections.EmptyHashTable();
mapArray = _.collections.EmptyArrayList();
for (i = 0; i < map.length; i += 1) {
mapArray.AddString(map[i]);
}
result.SetItem(P("maps"), mapArray);
_.memory.Free(mapArray);
return result;
}
protected function FromData(HashTable source) {
local int i;
local ArrayList mapArray;
if (source == none) {
return;
}
mapArray = source.GetArrayList(P("maps"));
if (mapArray == none) {
return;
}
map.length = 0;
for (i = 0; i < mapArray.GetLength(); i += 1) {
map[map.length] = mapArray.GetString(i);
}
_.memory.Free(mapArray);
}
protected function DefaultIt() {
map[0] = "KF-BioticsLab";
map[1] = "KF-Farm";
map[2] = "KF-Manor";
map[3] = "KF-Offices";
map[4] = "KF-WestLondon";
}
defaultproperties {
configName = "AcediaMaps"
}

2
sources/Packages.uc

@ -25,7 +25,7 @@ class Packages extends Object
var public config bool clientside;
// Array of predefined services that must be started along with Acedia mutator.
var public config array<string> package;
// Set to `true` to activate Acedia's game modes systemj.kl;
// Set to `true` to activate Acedia's game modes system
var public config bool useGameModes;
struct FeatureConfigPair

1
sources/VotingHandlerAdapter.uc

@ -102,6 +102,7 @@ protected function Finalizer()
* Backup of replaced configs is made internally, so that they can be restored
* on map change.
*/
// TODO ADD ME!
public final function InjectIntoVotingHandler()
{
local int i;

Loading…
Cancel
Save