//=============================================================================
// MutObjectiveAlterations
//=============================================================================
// An objective Mutator that changes objective values
//=============================================================================
// Red Orchestra 2 Source
//
// - Tobias "Beskar Mando" Moos
// All Rights Reserved.
//=============================================================================
MutObjectiveAlterations extends ROMutator;
// Used to track ownership state
//enum EObjectiveState
//{
// OBJ_Axis,
// OBJ_Allies,
// OBJ_Neutral
//};
//
// Objective Settings
//var() byte ObjIndex; Unique Objective Index per layout(16, 32, 64 player version) set by the Build Paths function in the Editor
//var() byte ObjRepIndex; Globally Unique Index
//var() localized string ObjName; The name of this objective as it should be displayed to the player
//var string ObjShortName; Short name for this objective(assigned in code as A-Z)
//var() EObjectiveState InitialObjState; The original state of the objective
//var EObjectiveState AppliedInitialObjState; The original state of the objective
// Objective status variables
var EObjectiveState ObjState; Manages the state of the objective
var bool bEnabled; Whether or not this objective is enabled for the current configuration(generally based off the MaxPlayers setting on the server)
//var bool bLocked; Tracks whether or not this objective can be Activated/Deactivated
//var bool bActive; Tracks whether this objective is currently active
//var byte CapTeamIndex; The team that has captured or is currently capturing this objective
var config bool MatchLive;
// Interprets commands and broadcasts their execution
function Mutate(string MutateString, PlayerController Sender)
{
// Get player name for broadcasts
local string MyPlayerName;
MyPlayerName = Sender.PlayerReplicationInfo.PlayerName;
// always call super class implementation!
Super.Mutate(MutateString, Sender);
if ( MutateString ~= "EnableObjective" && IsAdmin(Sender) )
{
if( bLocked== true && MatchLive == false )
//Currently doesn't do anything except broadcast, we'll need to add a new string for the specified objective, this is just a generalization
Level.Game.Broadcast( self, "[Objective]" Enabled by "$MyPlayerName$" );
}
else if( MutateString ~= "DisableObjective" && IsAdmin(Sender) )
{
//Currently doesn't do anything except broadcast, we'll need to add a new string for the specified objective, this is just a generalization
if( bLocked== false && MatchLive == false )
{
Level.Game.Broadcast( self, "[Objective] Disabled by "$MyPlayerName$" );
}
}
else if (MutateString ~= "Add Role" && IsAdmin(Sender) )
//Opens user friendly interface, we'll get to this later (will be a lot of work! Definitely won't be in alpha version!), this will allow us to customize all squads to our preferences, before match live (this can be different, this is just for another mutator that goes hand in hand with this one)
If (MatchLive==false )
{
// add all that fancy and stupidly complex code here
}
//More commands coming soon!