public void MarksTheAppropriateSkillAsClassSkill() { var yaml = @"--- skills: [Climb, Swim, Diplomacy]"; var clsSkill = new ClassSkills(yaml.ParseYaml()); var character = CharacterTestTemplates.AverageBob().FullInitialize(); character.Add(clsSkill); AssertCharacter.HasClassSkill("Climb", character); AssertCharacter.HasClassSkill("Swim", character); AssertCharacter.HasClassSkill("Diplomacy", character); }
public static ClassSkills Read(IBitReader reader, int playerClass) { var classSkills = new ClassSkills { Header = reader.ReadUInt16() }; uint offset = SKILL_OFFSETS[playerClass]; for (uint i = 0; i < SKILL_COUNT; i++) { var skill = ClassSkill.Read(offset + i, reader.ReadByte()); classSkills.Skills.Add(skill); } return(classSkills); }
private D2S(IBitReader reader) { Header = Header.Read(reader); ActiveWeapon = reader.ReadUInt32(); Name = reader.ReadString(16); Status = Status.Read(reader.ReadByte()); Progression = reader.ReadByte(); Unk0x0026 = reader.ReadBytes(2); ClassId = reader.ReadByte(); Unk0x0029 = reader.ReadBytes(2); Level = reader.ReadByte(); Created = reader.ReadUInt32(); LastPlayed = reader.ReadUInt32(); Unk0x0034 = reader.ReadBytes(4); AssignedSkills = Enumerable.Range(0, 16).Select(_ => Skill.Read(reader)).ToArray(); LeftSkill = Skill.Read(reader); RightSkill = Skill.Read(reader); LeftSwapSkill = Skill.Read(reader); RightSwapSkill = Skill.Read(reader); Appearances = Appearances.Read(reader); Location = Locations.Read(reader); MapId = reader.ReadUInt32(); Unk0x00af = reader.ReadBytes(2); Mercenary = Mercenary.Read(reader); RealmData = reader.ReadBytes(140); Quests = QuestsSection.Read(reader); Waypoints = WaypointsSection.Read(reader); NPCDialog = NPCDialogSection.Read(reader); Attributes = Attributes.Read(reader); ClassSkills = ClassSkills.Read(reader, ClassId); PlayerItemList = ItemList.Read(reader, Header.Version); PlayerCorpses = CorpseList.Read(reader, Header.Version); if (Status.IsExpansion) { MercenaryItemList = MercenaryItemList.Read(reader, Mercenary, Header.Version); Golem = Golem.Read(reader, Header.Version); } }
void DesativeOrActiveTimeSkills(ClassSkills skill, bool setGameObject) { skill.timeForActiveSkillText.gameObject.SetActive(setGameObject); }
public static byte[] Write(ClassSkills classSkills) { using var writer = new BitWriter(); classSkills.Write(writer); return(writer.ToArray()); }
public virtual void AddField(TextSpan field) { if (Condition.TryParse(field, out var condition)) { Conditions.Add(condition); return; } var(k, v) = field.SplitTuple(':'); switch (k.Value) { case "PROHIBITSPELL": ProhibitedSpells.Add(ProhibitedSpell.Parse(v)); return; case "BONUS": Bonuses.Add(Bonus.Parse(v)); return; case "DEFINE": { var parts = v.Split('|').ToArray(); if (parts.Length != 2) { throw new ParseFailedException(field, "Unable to parse variable definition."); } Definitions.Add(new VariableDefinition(parts[0].Value, Helpers.ParseInt(parts[1]))); return; } case "ABILITY": Abilities.Add(AbilityReference.Parse(v)); return; case "DOMAIN": Domains.Add(DomainReference.Parse(v)); return; case "CSKILL": ClassSkills.AddRange(v.Value.Split('|')); return; case "SOURCEPAGE": SourcePage = v.Value; return; case "SPELLLEVEL": SpellLists.AddRange(SpellList.Parse(v)); return; case "WEAPONBONUS": WeaponBonusProficiencySelections.Add(v.Value.Split('|').ToList()); return; case "KIT": // we are ignoring this one return; case "ADD": { var(type, parameter) = v.SplitTuple('|'); switch (type.Value) { case "SPELLCASTER": AddedSpellCasterLevels.Add(AddedSpellCasterLevel.Parse(parameter)); return; } break; } } throw new ParseFailedException(field, $"Unknown field '{field.Value}'"); }