public void SetupBoss(SkillTypes bossType, Transform spawnLocation) { CurrentBoss = bossType; clone_SpawnLocation = spawnLocation; InitBoss(); switch (bossType) { case SkillTypes.Ice: Icetopus.transform.position = SpawnLocation_Icetopus.position; Icetopus bossLogic = Icetopus.GetComponent <Icetopus>(); bossLogic.StartFight(); break; case SkillTypes.Fire: BurnataurGO.transform.position = SpawnLocation_Burnataur.position; Burnataur burn_bossLogic = BurnataurGO.GetComponent <Burnataur>(); burn_bossLogic.StartFight(); burn_bossLogic.firstAction = true; break; case SkillTypes.Normal: UroGO.transform.position = SpawnLocation_Uro.position; Uro uro_bossLogic = UroGO.GetComponent <Uro>(); uro_bossLogic.StartFight(); break; } }
public Skill NewSkill(SkillTypes name, int value = 0) { Skill skill = new Skill(name, value); Add(skill); return(skill); }
public Skill(SkillTypes aSkill, Int32 aValue, Int32 aPriority, Int32 aOrder) { Type = aSkill; Value = aValue; Priority = aPriority; Order = aOrder; }
protected void OnSkillChange(Creature creature, SkillTypes skillType, SkillStruct skill) { var player = creature as Player; if (!player) { return; } if (skillType == SkillTypes.Capacity) { if (skill.level <= -1) { m_CapacityLabel.text = "Cap:\n<color=#00EB00>infinity</color>"; } else { m_CapacityLabel.text = string.Format("Cap:\n{0}", skill.level); } } else if (skillType == SkillTypes.SoulPoints) { m_SoulPointsLabel.text = string.Format("Soul:\n{0}", skill.level); } }
public SkillBasicData(SkillTypes _SkillTypes, string _skillName, int _skillIndex, string _basicExplanation) { skillName = _skillName; skillTypes = _SkillTypes.ToString(); skillIndex = _skillIndex; basicExplanation = _basicExplanation; }
public void Mutate(SkillTypes aSkillType, Int32 aNewValue, LifeForm aLifeForm) { if ((aLifeForm.LfType == LifeFormTypes.MasterEntity) || (aLifeForm.LfType == LifeFormTypes.EnvironmentEntity)) { Mutate(aSkillType, aNewValue); } }
public int GetSkillbase(SkillTypes skill) { if ((int)skill >= m_Skills.Length) { return(0); } return(m_Skills[(int)skill].baseLevel); }
public SkillBasicData(SkillTypes _SkillTypes, string _skillName, int _skillIndex, int _manaCost, int _skillCoolTime, string _basicExplanation) { skillName = _skillName; skillTypes = _SkillTypes.ToString(); skillIndex = _skillIndex; skillCoolTime = _skillCoolTime; manaCost = _manaCost; basicExplanation = _basicExplanation; }
public int GetSKillProgress(SkillTypes skill) { if ((int)skill >= m_Skills.Length) { return(0); } return(m_Skills[(int)skill].percentage); }
private void RemoveSkill(Character chr, SkillTypes skill) { State st = chr.States.FindProperty <State>((p) => p.Name == skill.ToString() && p.CustomState.BooleanValue); if (st != null) { ; } chr.States.Remove(st); }
public void SetPrequesite(SkillTypes skill, int level) { if (PrerequisteSkills.ContainsKey(skill)) { PrerequisteSkills[skill] = level; } else { PrerequisteSkills.Add(skill, level); } }
public static PersonSkill CreateSkill(int skillId = 1, int personId = Defaults.PersonId, SkillTypes skillType = SkillTypes.Technical) { return(new PersonSkill() { SkillId = skillId, Level = "High", PersonId = personId, SkillTypeId = (byte)skillType }); }
public Skill(string xname, string xdescription, SkillTypes xtype, RangeScope xrange, float xbp, int xcost, SecondaryEffects xeffect = SecondaryEffects.None, int xduration = 3, float xactivationrate = 1.0f) { name = xname; description = xdescription; type = xtype; range = xrange; bp = xbp; cost = xcost; duration = xduration; effect = xeffect; activationrate = xactivationrate; }
public void CompareByType_Test(SkillTypes type1, SkillTypes type2, int expectedValue) { var sk1 = new SkillData(1, "Test1") { Type = type1 }; var sk2 = new SkillData(2, "Test2") { Type = type2 }; Assert.That(SkillData.CompareByType(sk1, sk2), Is.EqualTo(expectedValue)); }
public void SetSkill(SkillTypes skillType, int level, int baseLevel = 0, int percentage = 0) { int skill = (int)skillType; if (skill >= m_Skills.Length) { return; } m_Skills[skill].level = level; m_Skills[skill].baseLevel = baseLevel; m_Skills[skill].percentage = percentage; onSkillChange.Invoke(this, skillType, m_Skills[skill]); }
public Int32 GetAttribute(SkillTypes aSkillType) { int res = 0; foreach (Skill sk in SkillList.Values) { if (aSkillType == sk.Type) { res = sk.Value; break; } } return(res); }
/// <summary> /// /// </summary> /// <param name="skillJSONParser">The JSON parser containing the skill's data.</param> private void InitializeSkillValues(SkillJSONParser skillJSONParser) { nameID = skillJSONParser.GetNameID(); descriptionID = skillJSONParser.GetDescriptionID(); longDescriptionID = skillJSONParser.GetLongDescriptionID(); iconFilePath = skillJSONParser.GetIconFilePath(); encounterSkillType = skillJSONParser.GetEncounterSkillType(); targetType = skillJSONParser.GetTargetType(); aiSkillCategory = skillJSONParser.GetAISkillCategory(); costs = skillJSONParser.GetCosts(); cooldown = skillJSONParser.GetCooldown(); hits = skillJSONParser.GetHits(); skillChoreographies = skillJSONParser.GetSkillChoreographies(); skillFunctionName = skillJSONParser.GetSkillFunctionName(); }
public static IEnumerable <SkillDto> GetSkills(this IEnumerable <SkillDto> data, SkillTypes type) { if (data == null) { yield break; } foreach (var d in data) { if (d.Type == type) { yield return(d); } } }
public bool checkForSkill(SkillTypes skillToCheckFor) { foreach (SkillTypes skill in patronSkills) { if (skill == skillToCheckFor) { return(true); } } if (SkillGrantedByDrink == skillToCheckFor) { return(true); } return(false); }
private void Mutate(SkillTypes aSkillType, Int32 aNewValue) { if (SkillList.ContainsKey(aSkillType)) { foreach (Skill sk in SkillList.Values) { if (aSkillType == sk.Type) { sk.Value = aNewValue; break; } } } else { SkillList.Add(aSkillType, new Skill(aSkillType, aNewValue, 1, SkillList.Count + 1)); } }
public static int FindSkillOfType(CharacterInstance ch, string skillName, bool shouldCharacterKnowSkill, SkillTypes expectedType) { SkillData skill; if (ch == null || ch.IsNpc() || !shouldCharacterKnowSkill) { skill = RepositoryManager.Instance.GetEntity <SkillData>(skillName); } else { skill = RepositoryManager.Instance.GetEntity <SkillData>(ch.GetIDOfSkillCharacterKnows(skillName)); } if (skill == null) { return(0); } return(skill.Type == expectedType ? (int)skill.ID : 0); }
internal static async Task SeedSkill(this ILifetimeScope scope, int skillId = 1, int personId = Defaults.PersonId, string name = "Skill", string level = "10", SkillTypes type = SkillTypes.Technical) { var db = scope.Resolve <AppDbContext>(); var toAdd = new PersonSkill() { SkillId = skillId, SkillTypeId = (byte)type, Level = level, Name = name, PersonId = personId }; db.PersonSkill.Add(toAdd); await db.SaveChangesAsync(); }
private void OnSkillChange(Creature creature, SkillTypes skillType, SkillStruct skill) { var player = creature as Player; if (!player || (skillType != SkillTypes.Health && skillType != SkillTypes.Mana)) { return; } RawImage imageComponent; TMPro.TextMeshProUGUI textComponent; if (skillType == SkillTypes.Health) { imageComponent = m_HealthBarImageComponent; textComponent = m_HealthValueText; } else { imageComponent = m_ManaBarImageComponent; textComponent = m_ManaValueText; } var rectTransform = imageComponent.GetComponent <RectTransform>(); // setting new width var percent = skill.level / (float)skill.baseLevel; var rect = new Rect(imageComponent.uvRect); rect.width = percent; imageComponent.uvRect = rect; rect = new Rect(rectTransform.rect); rect.width = BarWidth * percent; rectTransform.sizeDelta = new Vector2(BarWidth * percent, rectTransform.sizeDelta.y); // setting text textComponent.text = skill.level.ToString(); }
public void OnCreatureSkillChange(Creatures.Creature creature, SkillTypes skillType, Creatures.SkillStruct skill) { Components.CreatureStatusPanel statusPanel; if (!m_CreatureStatus.TryGetValue(creature.ID, out statusPanel)) { return; } if (skillType == SkillTypes.HealthPercent) { statusPanel.SetHealthPercent(skill.level); statusPanel.UpdateHealthColor(); } else if (skillType == SkillTypes.Mana) { statusPanel.SetMana(skill.level, skill.baseLevel); } else if (skillType == SkillTypes.Health) { statusPanel.SetHealth(skill.level, skill.baseLevel); statusPanel.UpdateHealthColor(); } }
private void ParsePlayerSkills(InputMessage message) { SkillTypes[] skills = new SkillTypes[] { SkillTypes.Fist, SkillTypes.Club, SkillTypes.Sword, SkillTypes.Axe, SkillTypes.Distance, SkillTypes.Shield, SkillTypes.Fishing }; SkillTypes[] specialSkills = new SkillTypes[] { SkillTypes.CriticalHitChance, SkillTypes.CriticalHitDamage, SkillTypes.LifeLeechChance, SkillTypes.LifeLeechAmount, SkillTypes.ManaLeechChance, SkillTypes.ManaLeechAmount }; foreach (var skill in skills) { int level = message.GetU16(); int baseLevel = message.GetU16(); int percentage = message.GetU8(); m_Player.SetSkill(skill, level, baseLevel, percentage); } foreach (var skill in specialSkills) { int level = message.GetU16(); int baseLevel = message.GetU16(); m_Player.SetSkill(skill, level, baseLevel); } }
private void RollSkill(Character c, SkillTypes skill) { // has skill already if (c.States.FindProperties <State>(s => s.CustomState.BooleanValue && s.Name == skill.ToString()).Count() > 0) { return; } int skillBonus = 0; Skill skillRef = c.Skills.FindProperty <Skill>((s) => s.Name == skill.ToString()); if (skillRef != null) { skillBonus += skillRef.IntegerValue; } int roll = RollerEngine.ExecuteExpression("d20 + " + skillBonus); State sss = c.States.NewState(); sss.CustomState.BooleanValue = true; sss.Name = skill.ToString(); sss.Duration.IntegerValue = -1; sss.Value = roll.ToString(); }
public virtual int GetAttribute(SkillTypes aSkillType) { return((dna != null) ? dna.GetAttribute(aSkillType) : 0); }
public static Skill GetSkill(this string skill) => SkillTypes.GetValueOrDefault(skill);
public Skill(SkillTypes skillType, int value) : base(skillType.ToString(), value) { }
public SkillLevelViewModel(SkillTypes skill) { Skill = skill.ToString(); }