示例#1
0
    private void SetupGuiFaction(AgeTransform tableItem, GuiFaction guiFaction, int index)
    {
        FactionCard component = tableItem.GetComponent <FactionCard>();

        component.SetContent(guiFaction, base.gameObject);
        ISessionService service = Services.GetService <ISessionService>();

        Diagnostics.Assert(service != null);
        bool lobbyData = service.Session.GetLobbyData <bool>("CustomFactions", true);

        if (guiFaction.IsCustom && !lobbyData)
        {
            component.AgeTransform.Enable             = false;
            component.AgeTransform.AgeTooltip.Content = "%CustomFactionsNotAllowed";
        }
        else
        {
            component.AgeTransform.Enable             = true;
            component.AgeTransform.AgeTooltip.Content = string.Empty;
        }
        IDownloadableContentService service2 = Services.GetService <IDownloadableContentService>();
        bool flag;

        if (service2 != null && service2.TryCheckAgainstRestrictions(DownloadableContentRestrictionCategory.LobbyFaction, component.GuiFaction.Faction.Name, out flag) && !flag)
        {
            component.AgeTransform.Enable             = false;
            component.AgeTransform.AgeTooltip.Content = "%RestrictedDownloadableContentTitle";
        }
        if ((service.Session.SessionMode == SessionMode.Single || !service.Session.GetLobbyData <bool>("SpectatorMode", false) || service.Session.GetLobbyData <int>("NumberOfMajorFactions", 0) < 3) && guiFaction.Name == "FactionELCPSpectator")
        {
            component.AgeTransform.Enable             = false;
            component.AgeTransform.AgeTooltip.Content = "%GameOptionSpectatorModeDisabled";
        }
    }
 public WaveUnit(FactionCard Card, int UnitCount, float Level)
 {
     this.Card = Card;
     this.StartingUnitCount = UnitCount;
     this.Level             = Level;
 }
示例#3
0
        public Character(int level, string characterClass, string characterRace)
        {
            this.actionAttack   = new List <ActionModel> {
            };
            this.actionBonus    = new List <ActionModel> {
            };
            this.actionOption   = new List <ActionModel> {
            };
            this.actionReaction = new List <ActionModel> {
            };

            // Get required character data
            this.charBackgroundCard  = Decks.BackgroundDeck.Cards.PullRandomCardFromDeck();
            this.charClassCard       = Decks.ClassDeck.Cards.Find(x => x.Name == characterClass);
            this.charFactionCard     = Decks.FactionDeck.Cards.PullRandomCardFromDeck();
            this.charRaceCard        = Decks.RaceDeck.Cards.Find(x => x.Name == characterRace);
            this.charRaceVariantCard = this.charRaceCard.Variants.PullRandomCardFromDeck(true);

            // Define classes and totalLevel
            this.charClass = new Dictionary <string, CharacterClassModel> {
                {
                    this.charClassCard.Name,
                    new CharacterClassModel()
                    {
                        Level = level,
                        Name  = this.charClassCard.Name,
                    }
                }
            };

            //Test Multiclass
            //if (!this.charClass.ContainsKey(ClassEnum.Wizard.ToString()))
            //{
            //    this.charClass.Add(
            //        ClassEnum.Wizard.ToString(),
            //        new CharacterClassModel()
            //        {
            //            Level = 1,
            //            Name = ClassEnum.Wizard.ToString()
            //        }
            //    );
            //}

            this.totalLevel = GetTotalLevel();

            // Calculate modifiers
            this.abilityScores    = GetAbilityScores(this.charClassCard.AbilityScores, this.charRaceCard.AbilityScores, this.charRaceVariantCard.AbilityScores);
            this.age              = rng.Next(this.charRaceCard.AgeRange.Min, this.charRaceCard.AgeRange.Max);
            this.charBackground   = GetBackground();
            this.charClassPrimary = GetPrimaryClass();
            this.id               = CreateGuid();
            this.immunity         = GetImmunities();
            this.proficiencyBonus = GetProficiencyBonus();
            this.raceTraits       = GetRaceTraits();
            this.resistance       = GetResistances();
            this.speed            = this.charRaceVariantCard.Speed != 30 ? this.charRaceVariantCard.Speed : this.charRaceCard.Speed;

            GetEquipment();
            GetClassFeatures();
            CalculateHitPoints();
            GetProficiencies();
            GetActions();
        }