Ejemplo n.º 1
0
        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();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        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();
                    }
                }
            }
        }
Ejemplo n.º 3
0
 protected void HandleLeftClickPartyMember(AllyMember ally)
 {
     if (!bIsCurrentPlayerCommander || bNoPartyCommandsAllowed)
     {
         return;
     }
     if (PartyMembers.Contains(ally) && ally != AllyInCommand)
     {
         SetAllyInCommand(ally);
     }
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public bool AllyIsAPartyMember(AllyMember _ally)
 {
     return(PartyMembers.Contains(_ally));
 }