public byte GetSkillLevel(SkillID skill) { byte skillValue; if (m_skillMap.TryGetValue(skill, out skillValue)) return skillValue; return 0; }
public SkillDb(IServiceProvider services) { var db = services.ThrowOrGet <IInterfaceIdDatabase>(); Attack = new SkillID("Attack", 0, db.AttackLevelUpDialog); Defense = new SkillID("Defense", 1, db.DefenceLevelUpDialog); Strength = new SkillID("Strength", 2, db.StrengthLevelUpDialog); Hitpoints = new SkillID("Hitpoints", 3, db.HitpointsLevelUpDialog); Ranged = new SkillID("Ranged", 4, db.RangedLevelUpDialog); Prayer = new SkillID("Prayer", 5, db.PrayerLevelUpDialog); Magic = new SkillID("Magic", 6, db.MagicLevelUpDialog); Cooking = new SkillID("Cooking", 7, db.CookingLevelUpDialog); Woodcutting = new SkillID("Woodcutting", 8, db.WoodcuttingLevelUpDialog); Fletching = new SkillID("Fletching", 9, db.FletchingLevelUpDialog); Fishing = new SkillID("Fishing", 10, db.FishingLevelUpDialog); Firemaking = new SkillID("Firemaking", 11, db.FiremakingLevelUpDialog); Crafting = new SkillID("Crafting", 12, db.CraftingLevelUpDialog); Smithing = new SkillID("Smithing", 13, db.SmithingLevelUpDialog); Mining = new SkillID("Mining", 14, db.MiningLevelUpDialog); Herblore = new SkillID("Herblore", 15, db.HerbloreLevelUpDialog); Agility = new SkillID("Agility", 16, db.AgilityLevelUpDialog); Thieving = new SkillID("Thieving", 17, db.ThievingLevelUpDialog); Slayer = new SkillID("Slayer", 18, db.SlayerLevelUpDialog); Farming = new SkillID("Farming", 19, db.FarmingLevelUpDialog); Runecrafting = new SkillID("Runecrafting", 20, db.RunecraftingLevelUpDialog); }
public Skill GetSkill(SkillID id) { if (id.elementID != 0) { Debug.Log("Invalid element Id (must be 0 for skills, >0 for perks)"); } if (id.treeID >= skillTrees.Count) { Debug.Log("Invalid tree ID"); return(null); } SkillTree tree = skillTrees[id.treeID]; int branchCount = -1; foreach (SkillTree.Level level in tree.levels) { foreach (SkillBranch branch in level.branches) { branchCount++; if (branchCount == id.branchID) { return(branch.rootSkill_); } } } Debug.Log("Invalid branch ID"); return(null); }
public override int GetHashCode() { int hash = 1; if (Id != 0) { hash ^= Id.GetHashCode(); } if (SkillID != 0) { hash ^= SkillID.GetHashCode(); } if (SkillIcon != 0) { hash ^= SkillIcon.GetHashCode(); } if (SkillName.Length != 0) { hash ^= SkillName.GetHashCode(); } if (SkillLevel != 0) { hash ^= SkillLevel.GetHashCode(); } if (SkillType != 0) { hash ^= SkillType.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public SkillResultID method_29() { SkillID skillID_ = this.method_26(); int int_ = this.method_42(); return(new SkillResultID(skillID_, int_)); }
public byte Test1(SkillID skillID) { byte skillLevel; skillLevel = GetSkillLevel(skillID); SetSkillLevel(skillID, 50); skillLevel = GetSkillLevel(skillID); return skillLevel; }
public O_USE_SKILL_2() { Skill = new SkillID(); SkillType = 0; Level = 0; LevelType = 0; Target = new TargetParam(); }
private void Awake() { skillID = GetComponent <SkillID>(); hotkeyController = GameObject.FindGameObjectWithTag("HotkeyWrapper").GetComponent <HotkeyController>(); parent = GameObject.FindGameObjectWithTag("HotkeyWrapper").transform; }
public ISkillModel GetModel(SkillID skill) { if (All.ContainsKey(skill)) { return(All[skill]); } return(null); }
public int Test2(SkillID skillID) { int skillLevel; skillLevel = GetSkillLevel(skillID); SetSkillLevel(skillID, 0); skillLevel = GetSkillLevel(skillID); return(skillLevel); }
public byte Test2(SkillID skillID) { byte skillLevel; skillLevel = GetSkillLevel(skillID); SetSkillLevel(skillID, 0); skillLevel = GetSkillLevel(skillID); return(skillLevel); }
/// <summary> /// If skill was interrupted under casting this will inform the client to reset the cooldown of that skill. /// </summary> /// <param name="caster">The caster of the interrupted skill.</param> /// <param name="skillID">The ID of the skill that got interrupted.</param> public void SendSkillInterrupt(Entity caster, SkillID skillID) { NetOutgoingMessage msgOut = Server.CreateMessage(); msgOut.Write((byte)MessageType.SkillInterrupt); msgOut.Write((byte)skillID); caster.GetConnection()?.SendMessage(msgOut, NetDeliveryMethod.Unreliable, 0); }
public void Read(BinaryReader br) { Skill = new SkillID() { Value = br.ReadUInt32() }; Level = br.ReadUInt32(); Target = TargetStream.Read(br); }
public void SetSkillLevel(SkillID skill, byte level) { byte oldLevel = GetSkillLevel(skill); if (level == 0) m_skillMap.Remove(skill); else m_skillMap[skill] = level; }
public byte GetSkillLevel(SkillID skill) { byte skillValue; if (m_skillMap.TryGetValue(skill, out skillValue)) { return(skillValue); } return(0); }
public byte GetSkillLevel(SkillID skill) { var tuple = m_skills.FirstOrDefault(t => t.Item1 == skill); if (tuple == null) { return(0); } return(tuple.Item2); }
public void Init() { for (int i = 0; i < 3; i++) { { GoSkill[i] = GameObject.Find("Box" + (i + 1).ToString()); Skill[i] = new SkillID(); Skill[i].ID = 0; } } }
public void Initialize() { unitName = DataDefaults.unitName; raceName = DataDefaults.raceName; level = 1; attributes = new UnitAttributesData(); mainAttack = new SkillID(); perks = new List <PerkID>(); skills = new List <SkillID>(); inventory = new InventoryData(); isInitialized = true; }
public Skill getSkill(SkillID skillID) { if (weapon.skills.skillTable.ContainsKey(skillID)) { return(weapon.skills.skillTable[skillID]); } else { return(null); } }
public void SetSkillLevel(SkillID skill, byte level) { byte oldLevel = GetSkillLevel(skill); if (level == 0) { m_skillMap.Remove(skill); } else { m_skillMap[skill] = level; } }
public Skill(SkillData data) { this.data = data; skillName = data._skillName; id = data._id; skillType = data._skillType; mpCost = data._mpCost; description = data._description; }
public UnitData(UnitData other) { unitName = other.unitName; raceName = other.raceName; level = other.level; attributes = new UnitAttributesData(other.attributes); mainAttack = new SkillID(other.mainAttack); perks = new List <PerkID>(other.perks); skills = new List <SkillID>(other.skills); inventory = new InventoryData(other.inventory); usesRootMotion = other.usesRootMotion; isInitialized = other.isInitialized; }
public Skill GetSkill(SkillID id) { if (database.ContainsKey(id)) { return(database[id].GetSkill()); } else { Debug.LogError("Database does not contain a skill with the ID: " + id.ToString()); } return(null); }
/// <summary> /// 准备id对应的技能,检查能否释放 /// </summary> /// <param name="skillId">技能id</param> /// <returns>id对应的技能数据</returns> public SkillData PrepareSkill(SkillID skillId) { for (int i = skills.Length - 1; i >= 0; i--) { if (skills[i] != null && skills[i].id == skillId) { if (skills[i].coolRemain <= 0 && skills[i].costMana <= characterStatus.curBaseMana) { return(skills[i]); } } } return(null); }
public void GainExperience(SkillID skill, float exp) { var model = GetModel(skill); if (model == null) { Parent.SystemMessage($"Tried to gain experience in skill {skill} but no model for it was found.", CoreSystemMessageFlags.Debug | CoreSystemMessageFlags.Skill); return; } Parent.SendMessage(new ExperienceGainMessage(exp, model)); if (model.GainExperience(Parent, exp)) { Parent.SendMessage(new LevelUpMessage(model)); } }
private TauntStartPosition GetStartPosition(SkillID skillID) { if (skillID < 0) { return(TauntStartPosition.FaceDown); } var anmData = SkillDataMan.inst.GetSkillData(skillID)[0].anmData[0]; if (anmData.formDispList[0].formIdx == 101) { return(TauntStartPosition.FaceDown); } else { return(TauntStartPosition.FaceUp); } }
private TauntEndPosition GetEndPosition(SkillID skillID) { if (skillID < 0) { return(TauntEndPosition.Grounded); } var anmData = SkillDataMan.inst.GetSkillData(skillID)[0].anmData[0]; if (anmData.formDispList[anmData.formNum - 1].formIdx != 101 && anmData.formDispList[anmData.formNum - 1].formIdx != 100) { return(TauntEndPosition.Standing); } else { return(TauntEndPosition.Grounded); } }
public HeroData(HeroData other) { isEmpty = other.isEmpty; characterName = other.characterName; raceId = other.raceId; xp = other.xp; level = other.level; rankPoints = other.rankPoints; totalAttributePoints = other.totalAttributePoints; spentAttributePoints = other.spentAttributePoints; skillTreeSlots = other.skillTreeSlots.DeepCopy(); skills = other.skills.DeepCopy(); primarySkill = new SkillID(other.primarySkill); secondarySkills = other.secondarySkills.DeepCopy(); unitData = new UnitData(other.unitData); teleportData = new TeleportData(other.teleportData); }
public void SetSkillLevel(SkillID skill, byte level) { byte oldLevel = GetSkillLevel(skill); if (level == 0) { m_skillMap.Remove(skill); } else { m_skillMap[skill] = level; } if (level != oldLevel) { this.World.AddChange(new SkillChange(this, skill, level)); } }
public void SetSkillLevel(SkillID skill, byte level) { for (int i = 0; i < m_skills.Count; ++i) { if (m_skills[i].Item1 == skill) { if (level == 0) { m_skills.RemoveAt(i); } else { m_skills[i] = new Tuple <SkillID, byte>(skill, level); } return; } } m_skills.Add(new Tuple <SkillID, byte>(skill, level)); }
public WeaponData(WeaponData other) { damage = new Attribute(other.damage); damageSpread = new Attribute(other.damageSpread); reach = new Attribute(other.reach); speedModifier = new Attribute(other.speedModifier); strRequired = new Attribute(other.strRequired); strDamageBonus = new Attribute(other.strDamageBonus); strSpeedBonus = new Attribute(other.strSpeedBonus); strReachBonus = new Attribute(other.strReachBonus); dexRequired = new Attribute(other.dexRequired); dexDamageBonus = new Attribute(other.dexDamageBonus); dexSpeedBonus = new Attribute(other.dexSpeedBonus); dexReachBonus = new Attribute(other.dexReachBonus); intRequired = new Attribute(other.intRequired); intDamageBonus = new Attribute(other.intDamageBonus); intSpeedBonus = new Attribute(other.intSpeedBonus); intReachBonus = new Attribute(other.intReachBonus); basicSkillId = new SkillID(other.basicSkillId); }
public void CorrectInvalidData() { if (string.IsNullOrEmpty(unitName)) { Debug.LogWarning("Unit name not found, changing to " + DataDefaults.unitName); unitName = DataDefaults.unitName; } if (raceName == null || !Main.StaticData.Game.Races.ContainsName(raceName)) { Debug.LogWarning("Invalid race name, changing to " + DataDefaults.raceName); raceName = DataDefaults.raceName; } if (mainAttack == null || !Main.StaticData.Game.Skills.ContainsName(mainAttack.Name)) { Debug.LogWarning("Invalid main attack, changing to " + DataDefaults.skillName); mainAttack = new SkillID(); } Inventory.CorrectInvalidData(); Attributes.CorrectInvalidData(); }
/// <summary> /// 使用指定id的技能 /// </summary> /// <param name="skillId">技能id</param> /// <param name="isBatter">是否为连击</param> public void UseSkill(SkillID skillId, bool isBatter = false) { if (isBatter && curSkill != null) { skillId = curSkill.nextBatterId; } curSkill = skillManager.PrepareSkill(skillId); if (curSkill == null) { Debug.Log("Can't use: " + skillId.ToString()); return; } if (curSkill.attackType == SkillAttackType.Single) { var target = SelectClosestTarget(); if (target == null) { Debug.Log("Can't find target for: " + skillId.ToString()); } else { ShowSelectedFx(false); curTarget = target; curAttackTargetSelected = curTarget.GetComponent <CharacterSelected>(); ShowSelectedFx(true); transform.LookAt(curTarget); } } else { // TODO } characterAnimation.SetTrigger(curSkill.hashAnimationName); }
public int Test2(SkillID skillID) { int skillLevel; skillLevel = GetSkillLevel(skillID); SetSkillLevel(skillID, 0); skillLevel = GetSkillLevel(skillID); return skillLevel; }
public SkillChange(LivingObject ob, SkillID skillID, byte level) : base(ob) { this.SkillID = skillID; this.Level = level; }
public void SetSkillLevel(SkillID skill, byte level) { this.SkillMap[skill] = level; }
public void SetSkillLevel(SkillID skill, byte level) { byte oldLevel = GetSkillLevel(skill); if (level == 0) m_skillMap.Remove(skill); else m_skillMap[skill] = level; if (level != oldLevel) this.World.AddChange(new SkillChange(this, skill, level)); }
public void SetSkillLevel(SkillID skill, byte level) { for (int i = 0; i < m_skills.Count; ++i) { if (m_skills[i].Item1 == skill) { if (level == 0) m_skills.RemoveAt(i); else m_skills[i] = new Tuple<SkillID, byte>(skill, level); return; } } m_skills.Add(new Tuple<SkillID, byte>(skill, level)); }
public byte GetSkillLevel(SkillID skill) { var tuple = m_skills.FirstOrDefault(t => t.Item1 == skill); if (tuple == null) return 0; return tuple.Item2; }
int GetTicks(SkillID skillID) { var lvl = GetSkillLevel(skillID); return 20 / (lvl / 26 + 1); }