コード例 #1
0
 public override void Reset()
 {
     Name  = "Template";
     Notes = String.Empty;
     Skills.Clear();
     Stats.Clear();
 }
コード例 #2
0
 public void UpdateProperties()
 {
     RelationToMainHeroText = "";
     GovernorOfText         = "";
     Skills.Clear();
     Traits.Clear();
     UpdateLearningSkillSelection();
     foreach (SkillObject item in SkillObject.All)
     {
         Skills.Add(new EncyclopediaSkillVM(item, _hero.GetSkillValue(item)));
     }
     foreach (TraitObject heroTrait in CampaignUIHelper.GetHeroTraits())
     {
         if (_hero.GetTraitLevel(heroTrait) != 0)
         {
             Traits.Add(new EncyclopediaTraitItemVM(heroTrait, _hero));
         }
     }
     IsChild = _hero.IsChild;
     if (_hero != Hero.MainHero)
     {
         RelationToMainHeroText = CampaignUIHelper.GetHeroRelationToHeroText(_hero, Hero.MainHero).ToString();
     }
     if (_hero.GovernorOf != null)
     {
         GameTexts.SetVariable("SETTLEMENT_NAME", _hero.GovernorOf.Owner.Settlement.EncyclopediaLinkWithName);
         GovernorOfText = GameTexts.FindText("str_governor_of_label").ToString();
     }
     HeroModel = new HeroViewModel();
     HeroModel.FillFrom(_hero);
     Banner_9 = new ImageIdentifierVM(BannerCode.CreateFrom(_hero.ClanBanner), nineGrid: true);
 }
コード例 #3
0
ファイル: PlayerEntity.cs プロジェクト: FeXyK/Authory
 public override void Tick()
 {
     if (EntityTick % 20 == 0)
     {
         DistanceTravelled = 0;
     }
     if (!isDead)
     {
         Regen();
         SkillTick();
         BuffTick();
     }
     else
     {
         if (Buffs.Count > 0)
         {
             RemoveAllBuffs();
         }
         if (Skills.Count > 0)
         {
             Skills.Clear();
         }
     }
     if (EntityTick > 50)
     {
         IsTargetable = true;
     }
     EntityTick++;
 }
コード例 #4
0
ファイル: Player.cs プロジェクト: Amarinal/S3
        public void LoadFromText(string heroString)
        {
            //Hitpoints;Skill;Skill...



            try
            {
                string[] parts = heroString.Split('-');
                Skill    skill = null;
                this.HitPoints = Convert.ToInt32(parts[0]);

                for (int i = 1; i < parts.Length; i++)
                {
                    skill = new Skill();
                    skill.LoadSkillFromText(parts[i]);
                    Skills.Add(skill);
                }
            }
            catch (Exception ex)
            {
                this.maxHitPoints = 0;
                this.HitPoints    = 50;
                Skills.Clear();
            }
        }
コード例 #5
0
        public override void Load()
        {
            Skills.Clear();
            for (var i = 0; i <= 12; i++)
            {
                Skills.Add((Class)i, new Dictionary <uint, Skill>());
            }
            Skills.Add(Class.Common, new Dictionary <uint, Skill>());
            Skills.Add(Class.None, new Dictionary <uint, Skill>());

            //var f = File.OpenText(FullPath);
            var lines = File.ReadAllLines(FullPath);

            foreach (var line in lines)
            {
                //var line = f.ReadLine();
                if (line == null)
                {
                    break;
                }
                var s  = line.Split('\t');
                var id = Convert.ToUInt32(s[0]);
                Enum.TryParse(s[3], out Class c);
                var name     = s[4];
                var detail   = s[6];
                var iconName = s[7];

                var sk = new Skill(id, c, name, "")
                {
                    IconName = iconName,
                    Detail   = detail.ToLowerInvariant()
                };
                Skills[c][id] = sk;
            }
        }
コード例 #6
0
        public override void Respawn()
        {
            if (Level < 10)
            {
                GetAttribute(Attribute.Endurance)    += 10;
                GetAttribute(Attribute.Strength)     += 10;
                GetAttribute(Attribute.Agility)      += 10;
                GetAttribute(Attribute.Intelligence) += 10;
                GetAttribute(Attribute.Knowledge)    += 10;
                GetAttribute(Attribute.Luck)         += 10;

                Level++;
                CalculateResources();
            }
            Skills.Clear();
            RemoveAllBuffs();

            SetTarget(null);
            SetPosition(SpawnPosition);
            Health.SetFull();

            MovementDirection = new Vector3(0, 0, 0);

            DeathTimer = 0;

            Server.OutgoingMessageHandler.SendEntityRespawn(this);
        }
コード例 #7
0
        public async Task Clear()
        {
            var character = await _database.Characters.Include(x => x.Skills).FirstAsync(x => x.Id == _ownerId);

            character.SkillPoint = SkillPoints;
            character.Skills.Clear();

            foreach (var skill in Skills)
            {
                // Save char and learned skill.
                var skillToAdd = new DbCharacterSkill()
                {
                    CharacterId = _ownerId,
                    SkillId     = skill.Value.SkillId,
                    SkillLevel  = skill.Value.SkillLevel,
                    Number      = skill.Key
                };

                character.Skills.Add(skillToAdd);
            }

            await _database.SaveChangesAsync();

            Skills.Clear();
        }
コード例 #8
0
ファイル: Restrictions.cs プロジェクト: LordEnigma/UO
 public override void Clear()
 {
     Items.Clear();
     Pets.Clear();
     Skills.Clear();
     Spells.Clear();
 }
コード例 #9
0
 public SkillPickList(Func <SkillCollection> skillCollectionFactory, Func <ISkill> skillFactory)
 {
     _skillFactory           = skillFactory;
     _skillCollectionFactory = skillCollectionFactory;
     Skills = _skillCollectionFactory.Invoke();
     Skills.Clear();
     _selectedSkill = null;
 }
コード例 #10
0
 private void LoadExistingData()
 {
     Skills.Clear();
     foreach (var loaded in _moduleDataService.LoadAll <SkillData>())
     {
         SkillDataObservable skill = _observableDataFactory.CreateAndMap <SkillDataObservable, SkillData>(loaded);
         Skills.Add(skill);
     }
 }
コード例 #11
0
        private async Task LoadData()
        {
            var skills = await _playerService.GetSkills(Apply.PlayerId);

            Skills.Clear();
            foreach (Skill s in skills)
            {
                Skills.Add(s);
            }
        }
コード例 #12
0
ファイル: CharGenResult.cs プロジェクト: fartwhif/ACE.Network
        public void Unpack(BinaryReader reader)
        {
            var temp1 = reader.ReadUInt32(); // Unused value

#if NETWORKVALIDATION
            if (temp1 != 1)
            {
                throw new Exception("Recieved value different from static on CharGenResult, expected: 1, actual " + temp1);
            }
#endif
            HeritageGroup = (HeritageGroup)reader.ReadUInt32();
            Gender        = (Gender)reader.ReadUInt32();
            EyesStrip     = reader.ReadUInt32();
            NoseStrip     = reader.ReadUInt32();
            MouthStrip    = reader.ReadUInt32();
            HairColor     = reader.ReadUInt32();
            EyeColor      = reader.ReadUInt32();
            HairStyle     = reader.ReadUInt32();
            HeadgearStyle = reader.ReadUInt32();
            HeadgearColor = reader.ReadUInt32();
            ShirtStyle    = reader.ReadUInt32();
            ShirtColor    = reader.ReadUInt32();
            TrousersStyle = reader.ReadUInt32();
            TrousersColor = reader.ReadUInt32();
            FootwearStyle = reader.ReadUInt32();
            FootwearColor = reader.ReadUInt32();
            SkinShade     = reader.ReadUInt64();
            HairShade     = reader.ReadUInt64();
            HeadgearShade = reader.ReadUInt64();
            ShirtShade    = reader.ReadUInt64();
            TrousersShade = reader.ReadUInt64();
            FootwearShade = reader.ReadUInt64();
            TemplateNum   = reader.ReadUInt32();
            Strength      = reader.ReadUInt32();
            Endurance     = reader.ReadUInt32();
            Coordination  = reader.ReadUInt32();
            Quickness     = reader.ReadUInt32();
            Focus         = reader.ReadUInt32();
            Self          = reader.ReadUInt32();
            Slot          = reader.ReadUInt32();
            ClassID       = reader.ReadUInt32();
            NumSkills     = reader.ReadUInt32();
            Skills.Clear();
            for (int i = 0; i < NumSkills; i++)
            {
                Skills.Add((SkillState)reader.ReadUInt32());
            }
            Name       = reader.ReadString16L();
            StartArea  = reader.ReadUInt32();
            IsAdmin    = reader.ReadUInt32();
            IsEnvoy    = reader.ReadUInt32();
            Validation = reader.ReadUInt32();
        }
コード例 #13
0
ファイル: PlayerViewModel.cs プロジェクト: Vitor-Xavier/Sveit
        private async Task LoadProfile()
        {
            Player = await _playerService.GetPlayerById(_playerId);

            var skills = await _playerService.GetSkills(_playerId);

            Skills.Clear();
            foreach (Skill skill in skills)
            {
                Skills.Add(skill);
            }
        }
コード例 #14
0
        public void AddAndClear()
        {
            var skills = new Skills();

            Assert.AreEqual(0, skills.Count());
            var firstSkill = GetFirstSkill();

            skills.Add(firstSkill);
            Assert.AreEqual(1, skills.Count());
            skills.Clear();
            Assert.AreEqual(0, skills.Count());
        }
コード例 #15
0
    /// Recreates the skill set based on the relevant factory.
    public virtual void Recreate()
    {
        // Clear all the skills.
        Skills.Clear();

        // Get skills from factories and place them into the skill set. Call once after creating the cursor object at the start of combat.
        foreach (ModuleFactory module in GetComponents <ModuleFactory>())
        {
            if (module.FactoryType == "Skill")
            {
                foreach (GameObject skill in module.Modules)
                {
                    if (skill == null)
                    {
                        Debug.LogError("Skill is null");
                    }
                    AddSkill(skill);
                }
            }
        }

        int offensiveIndex = 0;
        int defensiveIndex = 0;

        for (int i = 0; i < Skills.Count; i++)
        {
            // Makes the skill and gives passes a refence to the ship that this skill set belongs to.
            GameObject skill       = Skills[i];
            Ability    abilityBase = skill.GetComponent <Ability>();
            abilityBase.Ship = gameObject;

            // Adds GUI content for the palyer
            GameObject skillBar = Instantiate(SkillBarPrefab) as GameObject;
            SkillBar   script   = skillBar.GetComponent <SkillBar>();

            script.OffensiveSkillCount = offensiveCount;
            script.DefensiveSkillCount = Skills.Count - offensiveCount;

            if (abilityBase.isOffensive)
            {
                script.SkillIndex = offensiveIndex++;
            }
            else
            {
                script.SkillIndex = defensiveIndex++;
            }

            // Contorller is a reference to the ability (the skills super class), which the GUI object reads from.
            script.Controller = abilityBase;
            script.Init();
        }
    }
コード例 #16
0
ファイル: HeroDetail.cs プロジェクト: mliuzailin/GitGame
 public void ClearView()
 {
     HeroImage        = null;
     HeroNameText     = "";
     HeroPhoneticText = "";
     MessageText      = "";
     m_GradeNum       = 0;
     m_NextGradeNum   = 0;
     IllustratorText  = "";
     Skills.Clear();
     Stories.Clear();
     ContentPosY = 0;
 }
コード例 #17
0
        public static void Initialize()
        {
            using (Database.TemporarySchema(Database.SchemaMCDB))
            {
                IsInitialized = false;

                Styles?.Skins.Clear();
                Styles?.MaleHairs.Clear();
                Styles?.MaleFaces.Clear();
                Styles?.FemaleHairs.Clear();
                Styles?.FemaleFaces.Clear();

                Items?.Clear();

                Skills?.Clear();

                Mobs?.Clear();

                Maps?.Clear();

                Quests?.Clear();

                Database.Test();

                Stopwatch sw = new Stopwatch();

                sw.Start();

                Log.Inform("Loading data...");

                Styles       = new AvailableStyles();
                Items        = new CachedItems();
                Skills       = new CachedSkills();
                Mobs         = new CachedMobs();
                Reactors     = new CachedReactors();
                Quests       = new CachedQuests();
                CreationData = new CreationData();
                Maps         = new CachedMaps();

                CommandFactory.Initialize();

                sw.Stop();

                Log.SkipLine();
                Log.Success("Maple data loaded in {0}ms.", sw.ElapsedMilliseconds);
                Log.SkipLine();

                IsInitialized = true;
            }
        }
コード例 #18
0
 /// <summary>
 /// Vide les propriétés de navigation.
 /// </summary>
 protected virtual void ClearNavigationProperties()
 {
     Actions.Clear();
     RefResources.Clear();
     Ref1.Clear();
     Ref2.Clear();
     Ref3.Clear();
     Ref4.Clear();
     Ref5.Clear();
     Ref6.Clear();
     Ref7.Clear();
     RefActionCategories.Clear();
     Skills.Clear();
     DocumentationActionDrafts.Clear();
 }
コード例 #19
0
ファイル: Hero.cs プロジェクト: BlueBerryBread/sgs_byCsharp
        public void LoseAllSkills()
        {
            if (Skills.Count == 0)
            {
                return;
            }
            List <ISkill> backup = new List <ISkill>(Skills);

            Skills.Clear();
            OnPropertyChanged("Skills");
            foreach (var sk in backup)
            {
                sk.HeroTag = null;
                sk.Owner   = null;
            }
        }
コード例 #20
0
        private void LoadInfo()
        {
            Skills.Clear();

            foreach (var item in Access.Select <Skill>())
            {
                Skills.Add(new SkillGrid(item.SkillID)
                {
                    SkillName = item.SkillName, Description = item.SkillDescription
                });
            }

            grid.DataSource = Skills;

            lbCount.Text = Skills.Count.ToString();
        }
コード例 #21
0
        public void Load(string file)
        {
            Skills.Clear();
            XmlDocument doc = new XmlDocument();

            doc.Load(file);
            if (int.TryParse(doc.DocumentElement.GetAttribute("delay"), out int i))
            {
                Delay = i;
            }
            foreach (XmlElement node in doc.GetElementsByTagName("skill"))
            {
                SimpleSkill skill = new SimpleSkill();
                skill.LoadXml(node);
                Skills.Add(skill);
            }
        }
コード例 #22
0
    private void ResetCreation()
    {
        int spentCharPointsOnAttributes = 0;

        foreach (CharacterAttribute stat in minimumStats.Keys)
        {
            statModifiers[stat]          = 0;
            spentCharPointsOnAttributes += pointsSpent[stat];
            pointsSpent[stat]            = 0;
        }

        statPointsLeft = StartingStatPoints + BonusStatPoints;

        if (Skills != null)
        {
            Skills.Clear();
        }
    }
コード例 #23
0
 private void ModuleClosed()
 {
     Skills.Clear();
 }