예제 #1
0
 private void SelectDeity(DeityId deityId)
 {
     _pkt.deityId         = deityId;
     _pkt.alignmentChoice = GameSystems.Deity.GetAlignmentChoice(deityId, _pkt.alignment.GetValueOrDefault());
     UiSystems.PCCreation.ResetSystemsAfter(ChargenStages.CG_Stage_Deity);
     UpdateDescriptionBox();
     UpdateButtonStates();
 }
예제 #2
0
    public static bool GetDeityFromEnglishName(string name, out DeityId deityId)
    {
        foreach (var deity in Deities)
        {
            if (deity.EnglishName.Equals(name, StringComparison.InvariantCultureIgnoreCase))
            {
                deityId = deity.Id;
                return(true);
            }
        }

        deityId = default;
        return(false);
    }
예제 #3
0
    private static int fuzz(DeityId deity)
    {
        var dice = Dice.D2;

        dice = dice.WithModifier(-1);
        // make the non-chooseable deities a little more interesting
        if (deity == DeityId.ZUGGTMOY || deity == DeityId.IUZ)
        {
            dice = dice.WithCount(2);
        }
        else if (deity == DeityId.LOLTH)
        {
            dice = dice.WithSides(3);
        }

        return(dice.Roll());
    }
예제 #4
0
    private void ShowDeityHelp(DeityId deityId)
    {
        var topic = GameSystems.Deity.GetHelpTopic(deityId);

        UiSystems.PCCreation.ShowHelpTopic(topic);
    }
예제 #5
0
 public string GetName(DeityId deity)
 {
     return(_deityNames[deity]);
 }
예제 #6
0
    public bool CanSelect(GameObject playerObj, DeityId deityId)
    {
        var deity = DeitiesById[deityId];

        if (!deity.IsSelectable)
        {
            return(false);
        }

        var race = playerObj.GetRace();

        if (D20RaceSystem.UseBaseRaceForDeity(race))
        {
            race = D20RaceSystem.GetBaseRace(race);
        }

        var alignment  = playerObj.GetAlignment();
        var classEnum  = (Stat)playerObj.GetInt32(obj_f.critter_level_idx, 0);
        var deityClass = D20ClassSystem.GetDeityClass(classEnum);

        var isCleric = deityClass == Stat.level_cleric;

        if (isCleric)
        {
            if (deityId == DeityId.NONE)
            {
                // Clerics MUST have a deity.
                return(false);
            }
        }

        var hasRace = deity.FavoredRaces.Contains(race);

        if (hasRace && !isCleric) // can't have Clerics casting spells of opposed alignments
        {
            return(true);
        }

        // doesn't have race automatic, so check the supported calsses
        var hasClass = deity.FavoredClasses.Count == 0 || deity.FavoredClasses.Contains(deityClass);

        if (!hasClass && !isCleric)
        {
            return(false);
        }

        // special casing - probably buggy but that's how it was in the original
        if (deity.FavoredRaces.Count > 0)
        {
            var isException = false;
            if (deityId == DeityId.CORELLON_LARETHIAN)
            {
                // Corellon Larethian for Bards
                isException = deityClass == Stat.level_bard;
            }
            else if (deityId == DeityId.EHLONNA)
            {
                // Ehlonna
                isException = deityClass == Stat.level_cleric;
            }

            if (!isException && !hasRace)
            {
                return(false);
            }
        }

        // check alignment
        if (deityId == DeityId.ST_CUTHBERT) // St. Cuthbert special case
        {
            return(alignment == Alignment.LAWFUL_GOOD || alignment == Alignment.LAWFUL);
        }

        var deityAlignment = deity.Alignment;

        if (deityAlignment == Alignment.NEUTRAL && !isCleric)
        {
            return(true);
        }

        if (alignment == deityAlignment)
        {
            return(true);
        }

        return(GameSystems.Stat.AlignmentsUnopposed(alignment, deityAlignment, true));
    }
예제 #7
0
 public bool AllowsAtonement(DeityId casterDeity)
 {
     return(GoodDeities.Contains(casterDeity));
 }
예제 #8
0
    public string GetPrayerHeardMessage(DeityId deity)
    {
        var lineId = 910 + (int)deity;

        return(GameSystems.Skill.GetSkillUiMessage(lineId));
    }
예제 #9
0
 public string GetHelpTopic(DeityId deity)
 {
     return(DeitiesById[deity].HelpTopic ?? "TAG_RELIGION");
 }