public override void Reset() { Name = "Template"; Notes = String.Empty; Skills.Clear(); Stats.Clear(); }
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); }
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++; }
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(); } }
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; } }
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); }
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(); }
public override void Clear() { Items.Clear(); Pets.Clear(); Skills.Clear(); Spells.Clear(); }
public SkillPickList(Func <SkillCollection> skillCollectionFactory, Func <ISkill> skillFactory) { _skillFactory = skillFactory; _skillCollectionFactory = skillCollectionFactory; Skills = _skillCollectionFactory.Invoke(); Skills.Clear(); _selectedSkill = null; }
private void LoadExistingData() { Skills.Clear(); foreach (var loaded in _moduleDataService.LoadAll <SkillData>()) { SkillDataObservable skill = _observableDataFactory.CreateAndMap <SkillDataObservable, SkillData>(loaded); Skills.Add(skill); } }
private async Task LoadData() { var skills = await _playerService.GetSkills(Apply.PlayerId); Skills.Clear(); foreach (Skill s in skills) { Skills.Add(s); } }
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(); }
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); } }
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()); }
/// 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(); } }
public void ClearView() { HeroImage = null; HeroNameText = ""; HeroPhoneticText = ""; MessageText = ""; m_GradeNum = 0; m_NextGradeNum = 0; IllustratorText = ""; Skills.Clear(); Stories.Clear(); ContentPosY = 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; } }
/// <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(); }
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; } }
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(); }
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); } }
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(); } }
private void ModuleClosed() { Skills.Clear(); }