Пример #1
0
    /// <summary>
    /// in case of a future localization feature...
    /// </summary>
    /// <param name="standing"></param>
    /// <returns></returns>
    public static string StandingToNiceName(FactionStanding standing)
    {
        switch (standing)
        {
        case FactionStanding.ally:
            return("Ally");

        case FactionStanding.enemy:
            return("Enemy");

        default:
            return("Neutral");
        }
    }
Пример #2
0
    public static List <Faction> GetFactionsWithTargetStandingWithFac(Faction fac, FactionStanding targetStanding)
    {
        List <Faction> facList = new List <Faction>(GameController.instance.curData.factions);

        facList.Remove(fac);
        for (int i = facList.Count - 1; i >= 0; i--)
        {
            if (fac.GetStandingWith(facList[i]) != targetStanding)
            {
                facList.RemoveAt(i);
            }
        }

        return(facList);
    }
Пример #3
0
    public void LoggerAnnounceStandingChange(int facID1, int facID2, FactionStanding newStanding)
    {
        string announcement = string.Format("{0} and {1} have become ",
                                            GameController.GetFactionByID(facID1).name, GameController.GetFactionByID(facID2).name);

        switch (newStanding)
        {
        case FactionStanding.ally:
            announcement += "allies!";
            break;

        case FactionStanding.neutral:
            announcement += "neutral towards each other!";
            break;

        case FactionStanding.enemy:
            announcement += "enemies!";
            break;
        }

        LoggerBox.instance.WriteText(announcement);
    }
Пример #4
0
    public List <int> GetFactionsWithStandingToFaction(int facID, FactionStanding targetStanding)
    {
        List <int> returnedList = new List <int>();

        foreach (FactionRelation rel in relations)
        {
            if (rel.relatedFacs[0] == facID)
            {
                if (RelationValueToStanding(rel.relationValue) == targetStanding)
                {
                    returnedList.Add(rel.relatedFacs[1]);
                }
            }
            else if (rel.relatedFacs[1] == facID)
            {
                if (RelationValueToStanding(rel.relationValue) == targetStanding)
                {
                    returnedList.Add(rel.relatedFacs[0]);
                }
            }
        }

        return(returnedList);
    }