void gainExperience(Skill.Type type, int amount) { switch (type) { case Skill.Type.ALCHEMY: alchemy.gainExperience(amount); break; case Skill.Type.CRAFTING: crafting.gainExperience(amount); break; case Skill.Type.FISHING: fishing.gainExperience(amount); break; case Skill.Type.COOKING: cooking.gainExperience(amount); break; case Skill.Type.MINING: mining.gainExperience(amount); break; case Skill.Type.BLACKSMITHING: blacksmithing.gainExperience(amount); break; default: Debug.LogError("Gaining experience for unhandled type: " + type); break; } }
public Skill GetSkill(Skill.Type type) { if (playerSkills.ContainsKey(type)) { return(playerSkills[type]); } throw new UnityException($"No such skill[{type}] available"); }
private string GetStatName(Skill.Type statType) { if (statType == Skill.Type.Unknown) { return("Skill Locked"); } else { return(statType.ToString()); } }
private static float SkillBuffModifier(Skill.Type type, float amount) { if (PlayerBuff.HasBuff <Productive>()) { var statIncModifier = new StatIncreaseArgs(amount); PlayerBuff.GetBuff <Productive>()?.TakeEffect(statIncModifier); amount = statIncModifier.Amount; } return(amount); }
public int this[Skill.Type t] { get { return(_marks[(int)t]); } set { _marks[(int)t] = value; NotifyPropertyChanged("Item[]"); } }
public override void SetData(Data data) { _currentSkill = data.statType; statName.text = GetStatName(data.statType); fillImage.fillAmount = (data.xpCurrent / data.xpMax); fillImage.transform.parent.gameObject.SetActive(data.statType != Skill.Type.Unknown); if (data.statType != Skill.Type.Unknown) { xpInfo.text = $"XP: {data.xpCurrent:0}"; } }
public static ISkillEffect Create(Skill.Type type) { switch (type) { case Skill.Type.HpAttackUp: return(new HpAttackUpSkillEffect()); case Skill.Type.Damage: case Skill.Type.Kill: case Skill.Type.MoveUp: throw new System.NotImplementedException("実装されていないスキルがあります。スキル : " + type.ToString()); default: throw new System.ArgumentOutOfRangeException("予期せぬスキルが設定されました。スキル : " + type.ToString()); } }
public Player(SpriteBatch spriteBatch, Level level) { this.spriteBatch = spriteBatch; this.level = level; this.position = this.level.startPosition; this.target = this.position; this.width = texture.Width / 3; this.height = texture.Height / 4; this.path = new List<Vector2>(); pathIndex = 0; this.direction = Vector2.UnitY; this.frame = new Rectangle(0, 0, width, height); this.frameTimer = new Timer(1000 / FPS); this.skillTimer = new Timer(SKILL_DELAY); this.skills = new List<Skill>(); curSkill = Skill.Type.FireBall; }
public int GetSkillLevel(Skill.Type type) { return(playerSkills[type].CurrentLevel); }
public void AddSkillXP(Skill.Type type, float amount) { playerSkills[type].AddXP(amount); }
public virtual void setData(List <object> l, Dictionary <string, int> k) { id = (string)l[k["ID"]]; name = (string)l[k["NAME"]]; Util.parseObject(l[k["LEVEL"]], out baseLevel, true, 0); switch ((string)l[k["SKILLTYPE"]]) { case "ATTACK": skillType = Skill.Type.ATTACK; targetType = Skill.TargetType.ENEMY; checkMissChance = true; break; case "DEBUFF": skillType = Skill.Type.DEBUFF; targetType = Skill.TargetType.ENEMY; checkMissChance = true; break; case "BUFF": skillType = Skill.Type.BUFF; targetType = Skill.TargetType.ME; checkMissChance = false; break; case "HEAL": skillType = Skill.Type.HEAL; targetType = Skill.TargetType.ME; checkMissChance = false; break; } _ti.Clear(); _tiV.Clear(); parseSuccessChance(l[k["SUCCESS_CHANCE_1"]]); parseSuccessChance(l[k["SUCCESS_CHANCE_2"]]); parseSuccessChance(l[k["SUCCESS_CHANCE_3"]]); parseSuccessChance(l[k["SUCCESS_CHANCE_4"]]); parseSuccessChance(l[k["SUCCESS_CHANCE_5"]]); int len = _ti.Count; successChance = new int[len][]; successValueType = new GameValueType.Type[len]; for (int i = 0; i < len; ++i) { successChance[i] = _ti[i]; successValueType[i] = _tiV[i]; } _ti.Clear(); _tiV.Clear(); _temp = null; Util.parseObject(l[k["EXE_TYPE"]], out exeType, true, 0); exeData = AttackData.getAttackData(exeType, l[k["E_ATTR1"]], l[k["E_ATTR2"]], l[k["E_ATTR3"]], l[k["E_ATTR4"]], l[k["E_ATTR5"]], l[k["E_ATTR6"]], l[k["E_ATTR7"]]); Util.parseObject(l[k["TARGETING_TYPE"]], out targeting, true, 0); targetAttr = null; setTargetingChecker(l, k); skillEffects = new SkillEffectData[hasSkillEffect(l[k["EFFECT_1"]], l[k["EFFECT_2"]], l[k["EFFECT_3"]], l[k["EFFECT_4"]], l[k["EFFECT_5"]])]; totalEffectNum = skillEffects.Length; #if UNITY_EDITOR if (successChance.Length < totalEffectNum) { Debug.LogError(id + " successChance error "); } if (successValueType.Length < totalEffectNum) { Debug.LogError(id + " successValueType error "); } #endif for (int i = 0; i < totalEffectNum; ++i) { int startDelay = -1; switch (i) { case 0: skillEffects[i] = SkillEffectData.getSkillEffectData(Util.objectToInt(l[k["EFFECT_1"]]), l[k["E1_ATTR1"]], l[k["E1_ATTR2"]]); if (k.ContainsKey("E1_DEALY")) { Util.parseObject(l[k["E1_DEALY"]], out startDelay, -1); if (startDelay > 0) { skillEffects[i].startDelay = ((float)startDelay * 0.001f); } } break; case 1: skillEffects[i] = SkillEffectData.getSkillEffectData(Util.objectToInt(l[k["EFFECT_2"]]), l[k["E2_ATTR1"]], l[k["E2_ATTR2"]]); if (k.ContainsKey("E2_DEALY")) { Util.parseObject(l[k["E2_DEALY"]], out startDelay, -1); if (startDelay > 0) { skillEffects[i].startDelay = ((float)startDelay * 0.001f); } } break; case 2: skillEffects[i] = SkillEffectData.getSkillEffectData(Util.objectToInt(l[k["EFFECT_3"]]), l[k["E3_ATTR1"]], l[k["E3_ATTR2"]]); if (k.ContainsKey("E3_DEALY")) { Util.parseObject(l[k["E3_DEALY"]], out startDelay, -1); if (startDelay > 0) { skillEffects[i].startDelay = ((float)startDelay * 0.001f); } } break; case 3: skillEffects[i] = SkillEffectData.getSkillEffectData(Util.objectToInt(l[k["EFFECT_4"]]), l[k["E4_ATTR1"]], l[k["E4_ATTR2"]]); if (k.ContainsKey("E4_DEALY")) { Util.parseObject(l[k["E4_DEALY"]], out startDelay, -1); if (startDelay > 0) { skillEffects[i].startDelay = ((float)startDelay * 0.001f); } } break; case 4: skillEffects[i] = SkillEffectData.getSkillEffectData(Util.objectToInt(l[k["EFFECT_5"]]), l[k["E5_ATTR1"]], l[k["E5_ATTR2"]]); if (k.ContainsKey("E5_DEALY")) { Util.parseObject(l[k["E5_DEALY"]], out startDelay, -1); if (startDelay > 0) { skillEffects[i].startDelay = ((float)startDelay * 0.001f); } } break; } skillEffects[i].skillData = this; if (skillEffects[i].type == 29) { isChangeSideSkill = true; } } description = ((string)l[k["DESCRIPTION"]]).Replace("\\n", "\n");; }
public void AddSkillXP(Skill.Type type, float amount) { playerSkills[type].AddXP(SkillBuffModifier(type, amount)); }