//도발 '' public void Skill_DefaultPassive(ref SkillSlot List)//게임시스템패시브(치명타, 방어추뎀, 다운추뎀) { CharacterStatus OrderStat; Skill Critical = new Skill("Critical");//치명타 Critical.PassiveCount.Add("Critical", ProbabilityData.Critical); Critical.PassiveCount.Add("BaseCritical", ProbabilityData.Critical); Critical.SetCharacter(List.GetComponent <CharacterStatus>().Controller); Critical.AddPassive( delegate(Skill skil) { OrderStat = gameManager.ins.UserStatus[skil.Order]; if (gameManager.ins.UserStatus[OrderStat.Enemy()].WallDistance == 0) { skil.PassiveCount["Critical"] += 80; } if (Random.Range(0, (100 / skil.PassiveCount["Critical"])) < 1) //5% { Debug.Log("크리티컬"); DamageCalculator.ins.AddDamage(DamageCalculator.MULTIPLE_s, 1.5f, "Critical"); SaveData.ins.AddData(SaveData.TYPE.CRITICAL, skil.Order, 1); } if (gameManager.ins.UserStatus[OrderStat.Enemy()].WallDistance == 0) { skil.PassiveCount["Critical"] -= 80; } } , "Attack"); List.AddPassiveSlot(Critical); Skill SuperArmor = new Skill("SuperArmor"); SuperArmor.SetCharacter(List.GetComponent <CharacterStatus>().Controller); SuperArmor.PassiveCount.Add("isHit", 0); SuperArmor.AddPassive(delegate(Skill skill) { skill.PassiveCount["isHit"] = 1; }, "Hit"); SuperArmor.AddPassive(delegate(Skill skill) { if (gameManager.ins.UserStatus[skill.Order].isSuperArmor && skill.PassiveCount["isHit"] == 1) { CharacterAnim.ChangeAnimation(CharacterAnim.AnimStasis.LAND, skill.Order); WallManager.ins.ResetPivot(); } skill.PassiveCount["isHit"] = 0; }, "WallSetting"); List.AddPassiveSlot(SuperArmor); }
private void SetKnownSkills() { foreach (var skill in player.knownSkills) { SkillSlot skillSlot = Instantiate(skillPrefab, availableSkillsList.transform).GetComponent <SkillSlot>(); //Set icon foreach (var skillIcon in skillIcons) { if (skillIcon.skillID == skill.SkillID) { skillSlot.icon = skillIcon.GetComponent <Image>(); skillSlot.GetComponentInChildren <Image>().sprite = skillSlot.icon.sprite; } } skillSlot.GetComponent <Button>().interactable = true; skillSlot.OnSkillClicked += KnownSkillClicked; skillSlot.skill = skill; Skill newSkill = skillSlot.skill; newSkill.SkillID = skill.SkillID; newSkill.SkillName = skill.SkillName; newSkill.SkillType = skill.SkillType; newSkill.DamageModifier = skill.DamageModifier; newSkill.EnergyCost = skill.EnergyCost; } }
public void UpdateUI() { availableSkillPointsText.text = $"Skill Points: {player.availableSkillPoints}"; var skillSlots = availableSkillsList.GetComponentsInChildren <SkillSlot>(); foreach (var skill in skillSlots) { Destroy(skill.gameObject); } foreach (var skill in SkillFactory.GameSkills) { SkillSlot skillSlot = Instantiate(skillSlotPrefab, availableSkillsList.transform).GetComponent <SkillSlot>(); //Set icon foreach (var skillIcon in skillIcons) { if (skillIcon.skillID == skill.SkillID) { skillSlot.icon = skillIcon.GetComponent <Image>(); skillSlot.GetComponentInChildren <Image>().sprite = skillSlot.icon.sprite; } } skillSlot.GetComponent <Button>().interactable = true; skillSlot.OnSkillClicked += NewSkillClicked; skillSlot.skill = skill; Skill newSkill = skillSlot.skill; newSkill.SkillID = skill.SkillID; newSkill.SkillName = skill.SkillName; newSkill.SkillType = skill.SkillType; newSkill.DamageModifier = skill.DamageModifier; newSkill.EnergyCost = skill.EnergyCost; } }