Shtoyan 2 years ago
parent
commit
0a54be725e
  1. 2
      config/AcediaGameModes.ini
  2. 2
      config/AcediaLauncher.ini
  3. 3
      config/AcediaMaps.ini
  4. 15
      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] [hard GameMode]
title={$green Hard difficulty} title={$green Hard difficulty}
difficulty=hard difficulty=hard
mapList=defaultHard
[hell GameMode] [hell GameMode]
title={$crimson Hell On Earth} title={$crimson Hell On Earth}
difficulty=hoe difficulty=hoe
mapList=defaultHOE

2
config/AcediaLauncher.ini

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

3
config/AcediaMaps.ini

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

15
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 // Map prefix - only maps that start with specified prefix will be voteable for
// this game mode (plain string) // this game mode (plain string)
var protected config string mapPrefix; var protected config string mapPrefix;
// TODO
var protected config string mapList;
// Aliases are an unnecessary overkill for difficulty names, so just define // Aliases are an unnecessary overkill for difficulty names, so just define
// them in special `string` arrays. // them in special `string` arrays.
@ -58,6 +60,7 @@ protected function DefaultIt()
gameTypeClass = "KFMod.KFGameType"; gameTypeClass = "KFMod.KFGameType";
acronym = ""; acronym = "";
mapPrefix = "KF"; mapPrefix = "KF";
mapList = "defaultHard";
includeFeature.length = 0; includeFeature.length = 0;
excludeFeature.length = 0; excludeFeature.length = 0;
includeMutator.length = 0; includeMutator.length = 0;
@ -77,6 +80,8 @@ protected function HashTable ToData()
result.SetString(P("gameTypeClass"), gameTypeClass); result.SetString(P("gameTypeClass"), gameTypeClass);
result.SetString(P("acronym"), acronym); result.SetString(P("acronym"), acronym);
result.SetString(P("mapPrefix"), mapPrefix); result.SetString(P("mapPrefix"), mapPrefix);
result.SetString(P("mapList"), mapList);
nextArray = _.collections.EmptyArrayList(); nextArray = _.collections.EmptyArrayList();
for (i = 0; i < option.length; i += 1) for (i = 0; i < option.length; i += 1)
{ {
@ -103,9 +108,11 @@ protected function FromData(HashTable source)
return; return;
} }
gameTypeClass = source.GetString(P("gameTypeClass")); gameTypeClass = source.GetString(P("gameTypeClass"));
acronym = source.GetString(P("acronym")); acronym = source.GetString(P("acronym"));
mapPrefix = source.GetString(P("mapPrefix")); mapPrefix = source.GetString(P("mapPrefix"));
nextArray = source.GetArrayList(P("option")); mapList = source.GetString(P("mapList"));
nextArray = source.GetArrayList(P("option"));
if (nextArray == none) { if (nextArray == none) {
return; return;
} }
@ -271,6 +278,8 @@ defaultproperties
hardSynonyms(0) = "harder" // "hard" is prefix of this, so it will count hardSynonyms(0) = "harder" // "hard" is prefix of this, so it will count
hardSynonyms(1) = "difficult" hardSynonyms(1) = "difficult"
suicidalSynonyms(0) = "suicidal" suicidalSynonyms(0) = "suicidal"
// DONE!
suicidalSynonyms(1) = "sui"
hoeSynonyms(0) = "hellonearth" hoeSynonyms(0) = "hellonearth"
hoeSynonyms(1) = "hellon earth" hoeSynonyms(1) = "hellon earth"
hoeSynonyms(2) = "hell onearth" 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; var public config bool clientside;
// Array of predefined services that must be started along with Acedia mutator. // Array of predefined services that must be started along with Acedia mutator.
var public config array<string> package; 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; var public config bool useGameModes;
struct FeatureConfigPair 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 * Backup of replaced configs is made internally, so that they can be restored
* on map change. * on map change.
*/ */
// TODO ADD ME!
public final function InjectIntoVotingHandler() public final function InjectIntoVotingHandler()
{ {
local int i; local int i;

Loading…
Cancel
Save