Nuke agent is separete role (#15385)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -53,6 +53,9 @@ public sealed class NukeopsRuleComponent : Component
|
|||||||
[DataField("operativeRoleProto", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
[DataField("operativeRoleProto", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
||||||
public string OperativeRoleProto = "Nukeops";
|
public string OperativeRoleProto = "Nukeops";
|
||||||
|
|
||||||
|
[DataField("medicRoleProto", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
||||||
|
public string MedicRoleProto = "NukeopsMedic";
|
||||||
|
|
||||||
[DataField("commanderStartingGearProto", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
[DataField("commanderStartingGearProto", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
||||||
public string CommanderStartGearPrototype = "SyndicateCommanderGearFull";
|
public string CommanderStartGearPrototype = "SyndicateCommanderGearFull";
|
||||||
|
|
||||||
|
|||||||
@@ -408,8 +408,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
var playersPerOperative = nukeops.PlayersPerOperative;
|
var playersPerOperative = nukeops.PlayersPerOperative;
|
||||||
var maxOperatives = nukeops.MaxOperatives;
|
var maxOperatives = nukeops.MaxOperatives;
|
||||||
|
|
||||||
|
// Dear lord what is happening HERE.
|
||||||
var everyone = new List<IPlayerSession>(ev.PlayerPool);
|
var everyone = new List<IPlayerSession>(ev.PlayerPool);
|
||||||
var prefList = new List<IPlayerSession>();
|
var prefList = new List<IPlayerSession>();
|
||||||
|
var medPrefList = new List<IPlayerSession>();
|
||||||
var cmdrPrefList = new List<IPlayerSession>();
|
var cmdrPrefList = new List<IPlayerSession>();
|
||||||
var operatives = new List<IPlayerSession>();
|
var operatives = new List<IPlayerSession>();
|
||||||
|
|
||||||
@@ -427,7 +429,10 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
{
|
{
|
||||||
prefList.Add(player);
|
prefList.Add(player);
|
||||||
}
|
}
|
||||||
|
if (profile.AntagPreferences.Contains(nukeops.MedicRoleProto))
|
||||||
|
{
|
||||||
|
medPrefList.Add(player);
|
||||||
|
}
|
||||||
if (profile.AntagPreferences.Contains(nukeops.CommanderRolePrototype))
|
if (profile.AntagPreferences.Contains(nukeops.CommanderRolePrototype))
|
||||||
{
|
{
|
||||||
cmdrPrefList.Add(player);
|
cmdrPrefList.Add(player);
|
||||||
@@ -438,31 +443,38 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
|
|
||||||
for (var i = 0; i < numNukies; i++)
|
for (var i = 0; i < numNukies; i++)
|
||||||
{
|
{
|
||||||
|
// TODO: Please fix this if you touch it.
|
||||||
IPlayerSession nukeOp;
|
IPlayerSession nukeOp;
|
||||||
// Only one commander, so we do it at the start
|
// Only one commander, so we do it at the start
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
if (cmdrPrefList.Count == 0)
|
if (cmdrPrefList.Count == 0)
|
||||||
|
{
|
||||||
|
if (medPrefList.Count == 0)
|
||||||
{
|
{
|
||||||
if (prefList.Count == 0)
|
if (prefList.Count == 0)
|
||||||
{
|
{
|
||||||
if (everyone.Count == 0)
|
if (everyone.Count == 0)
|
||||||
{
|
{
|
||||||
Logger.InfoS("preset",
|
Logger.InfoS("preset", "Insufficient ready players to fill up with nukeops, stopping the selection");
|
||||||
"Insufficient ready players to fill up with nukeops, stopping the selection");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nukeOp = _random.PickAndTake(everyone);
|
nukeOp = _random.PickAndTake(everyone);
|
||||||
Logger.InfoS("preset",
|
Logger.InfoS("preset", "Insufficient preferred nukeop commanders, agents or nukies, picking at random.");
|
||||||
"Insufficient preferred nukeop commanders or nukies, picking at random.");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nukeOp = _random.PickAndTake(prefList);
|
nukeOp = _random.PickAndTake(prefList);
|
||||||
everyone.Remove(nukeOp);
|
everyone.Remove(nukeOp);
|
||||||
Logger.InfoS("preset",
|
Logger.InfoS("preset", "Insufficient preferred nukeop commander or agents, picking at random from regular op list.");
|
||||||
"Insufficient preferred nukeop commanders, picking at random from regular op list.");
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nukeOp = _random.PickAndTake(medPrefList);
|
||||||
|
everyone.Remove(nukeOp);
|
||||||
|
prefList.Remove(nukeOp);
|
||||||
|
Logger.InfoS("preset", "Insufficient preferred nukeop commanders, picking an agent");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -470,30 +482,45 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
nukeOp = _random.PickAndTake(cmdrPrefList);
|
nukeOp = _random.PickAndTake(cmdrPrefList);
|
||||||
everyone.Remove(nukeOp);
|
everyone.Remove(nukeOp);
|
||||||
prefList.Remove(nukeOp);
|
prefList.Remove(nukeOp);
|
||||||
|
medPrefList.Remove(nukeOp);
|
||||||
Logger.InfoS("preset", "Selected a preferred nukeop commander.");
|
Logger.InfoS("preset", "Selected a preferred nukeop commander.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else if (i == 1)
|
||||||
|
{
|
||||||
|
if (medPrefList.Count == 0)
|
||||||
{
|
{
|
||||||
if (prefList.Count == 0)
|
if (prefList.Count == 0)
|
||||||
{
|
{
|
||||||
if (everyone.Count == 0)
|
if (everyone.Count == 0)
|
||||||
{
|
{
|
||||||
Logger.InfoS("preset",
|
Logger.InfoS("preset", "Insufficient ready players to fill up with nukeops, stopping the selection");
|
||||||
"Insufficient ready players to fill up with nukeops, stopping the selection");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nukeOp = _random.PickAndTake(everyone);
|
nukeOp = _random.PickAndTake(everyone);
|
||||||
Logger.InfoS("preset", "Insufficient preferred nukeops, picking at random.");
|
Logger.InfoS("preset", "Insufficient preferred nukeop commanders, agents or nukies, picking at random.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nukeOp = _random.PickAndTake(prefList);
|
nukeOp = _random.PickAndTake(prefList);
|
||||||
everyone.Remove(nukeOp);
|
everyone.Remove(nukeOp);
|
||||||
Logger.InfoS("preset", "Selected a preferred nukeop.");
|
Logger.InfoS("preset", "Insufficient preferred nukeop commander or agents, picking at random from regular op list.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nukeOp = _random.PickAndTake(medPrefList);
|
||||||
|
everyone.Remove(nukeOp);
|
||||||
|
Logger.InfoS("preset", "Insufficient preferred nukeop commanders, picking an agent");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nukeOp = _random.PickAndTake(prefList);
|
||||||
|
everyone.Remove(nukeOp);
|
||||||
|
Logger.InfoS("preset", "Selected a preferred nukeop commander.");
|
||||||
|
}
|
||||||
|
|
||||||
operatives.Add(nukeOp);
|
operatives.Add(nukeOp);
|
||||||
}
|
}
|
||||||
@@ -641,7 +668,7 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
name = Loc.GetString("nukeops-role-agent") + " " + _random.PickAndTake(component.OperativeNames[component.NormalNames]);
|
name = Loc.GetString("nukeops-role-agent") + " " + _random.PickAndTake(component.OperativeNames[component.NormalNames]);
|
||||||
role = component.OperativeRoleProto;
|
role = component.MedicRoleProto;
|
||||||
gear = component.MedicStartGearPrototype;
|
gear = component.MedicStartGearPrototype;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -16,5 +16,8 @@ roles-antag-suspicion-suspect-objective = Kill the innocents.
|
|||||||
roles-antag-nuclear-operative-commander-name = Nuclear operative commander
|
roles-antag-nuclear-operative-commander-name = Nuclear operative commander
|
||||||
roles-antag-nuclear-operative-commander-objective = Lead your team to the destruction of the station.
|
roles-antag-nuclear-operative-commander-objective = Lead your team to the destruction of the station.
|
||||||
|
|
||||||
|
roles-antag-nuclear-operative-agent-name = Nuclear operative agent
|
||||||
|
roles-antag-nuclear-operative-agent-objective = Like default operative, the team's treatment will have priority.
|
||||||
|
|
||||||
roles-antag-nuclear-operative-name = Nuclear operative
|
roles-antag-nuclear-operative-name = Nuclear operative
|
||||||
roles-antag-nuclear-operative-objective = Find the nuke disk and blow up the station.
|
roles-antag-nuclear-operative-objective = Find the nuke disk and blow up the station.
|
||||||
|
|||||||
@@ -5,6 +5,13 @@
|
|||||||
setPreference: true
|
setPreference: true
|
||||||
objective: roles-antag-nuclear-operative-objective
|
objective: roles-antag-nuclear-operative-objective
|
||||||
|
|
||||||
|
- type: antag
|
||||||
|
id: NukeopsMedic
|
||||||
|
name: roles-antag-nuclear-operative-agent-name
|
||||||
|
antagonist: true
|
||||||
|
setPreference: true
|
||||||
|
objective: roles-antag-nuclear-operative-agent-objective
|
||||||
|
|
||||||
- type: antag
|
- type: antag
|
||||||
id: NukeopsCommander
|
id: NukeopsCommander
|
||||||
name: roles-antag-nuclear-operative-commander-name
|
name: roles-antag-nuclear-operative-commander-name
|
||||||
|
|||||||
Reference in New Issue
Block a user