public void SetAllyInCommand(AllyMember _setToCommand) { bool _validSet = _setToCommand != null && _setToCommand.GetComponent <AllyMember>() != null && PartyMembers.Contains(_setToCommand); if (_validSet) { gamemaster.CallOnAllySwitch(this, _setToCommand, AllyInCommand); if (AllyInCommand != null) { AllyInCommand.allyEventHandler.CallEventSwitchingFromCom(); } AllyInCommand = _setToCommand; AllyInCommand.allyEventHandler.CallEventSetAsCommander(); //Set PartySwitching Event Afterwards for more accurate party data retreival foreach (var _ally in PartyMembers) { if (_ally != null && _ally.IsAlive) { _ally.allyEventHandler.CallEventPartySwitching(); } } } }
public void SetAllyInCommand(AllyMember _setToCommand) { bool _validSet = _setToCommand != null && _setToCommand.GetComponent <AllyMember>() != null && PartyMembers.Contains(_setToCommand); if (_validSet) { gamemaster.CallOnAllySwitch(this, _setToCommand, AllyInCommand); if (AllyInCommand != null) { AllyInCommand.GetComponent <AllyEventHandler>().CallEventSwitchingFromCom(); } AllyInCommand = _setToCommand; AllyInCommand.GetComponent <AllyEventHandler>().CallEventSetAsCommander(); //Set PartySwitching Event Afterwards for more accurate party data retreival foreach (var _ally in PartyMembers) { //TODO: RTSPrototype Fix null exception from foreach loop, this should not happen if (_ally != null) { _ally.allyEventHandler.CallEventPartySwitching(); } } } }
protected void HandleLeftClickPartyMember(AllyMember ally) { if (!bIsCurrentPlayerCommander || bNoPartyCommandsAllowed) { return; } if (PartyMembers.Contains(ally) && ally != AllyInCommand) { SetAllyInCommand(ally); } }
public static string SafeName(this GameObject obj) { var useSafeNames = MainSettingsModel.Instance.UseSafeNames; if (obj.IsMe) { return("Me"); } string name; var character = obj as BattleCharacter; if (character != null) { name = !PartyMembers.Contains(character) ? "Enemy -> " : "Ally -> "; if (name.Contains("Ally")) { if (!useSafeNames) { name += character.Name; } else { name += character.CurrentJob.ToString(); } return(name); } if (obj.IsBoss()) { name += "Boss: "; } return(name += character.Name); } name = obj.Name; return(name); }
public bool AllyIsAPartyMember(AllyMember _ally) { return(PartyMembers.Contains(_ally)); }