public CardEffect(string card_Id, float damage, ElementType element_type, BuffCode buff_name_1, int add_Buff_1_Tier, BuffTarget buff_1_Target, BuffCode buff_name_2, int add_Buff_2_Tier, BuffTarget buff_2_Target, BuffCode buff_name_3, int add_Buff_3_Tier, BuffTarget buff_3_Target, BuffCode buff_name_4, int add_Buff_4_Tier, BuffTarget buff_4_Target) { this.Card_Id = card_Id; this.Damage = damage; this.Element_type = element_type; this.Buff_name_1 = buff_name_1; this.Add_Buff_1_Tier = add_Buff_1_Tier; this.Buff_1_Target = buff_1_Target; this.Buff_name_2 = buff_name_2; this.Add_Buff_2_Tier = add_Buff_2_Tier; this.Buff_2_Target = buff_2_Target; this.Buff_name_3 = buff_name_3; this.Add_Buff_3_Tier = add_Buff_3_Tier; this.Buff_3_Target = buff_3_Target; this.Buff_name_4 = buff_name_4; this.Add_Buff_4_Tier = add_Buff_4_Tier; this.Buff_4_Target = buff_4_Target; }
} //对应战斗 /// <summary> /// BaseBuff构造函数 /// </summary> /// <param name="buff_id">ID</param> /// <param name="buff_name">中文名字</param> /// <param name="buff_ename">英文名字及对应BuffCode</param> /// <param name="element_type">元素类型</param> /// <param name="buff_dispel">驱散类型</param> /// <param name="buff_type">正面、负面效果</param> /// <param name="buffFlag">普通、高级、领域、技能</param> /// <param name="v1">参数1</param> /// <param name="v2">参数2</param> /// <param name="v3">参数3</param> /// <param name="v4">参数4</param> /// <param name="v5">参数5</param> /// <param name="v6">参数6</param> /// <param name="v7">参数7</param> /// <param name="v8">参数8</param> /// <param name="durationTime">持续时间</param> /// <param name="oneActionTime">跳一次时间</param> /// <param name="max_tier">最大层数</param> public BaseBuff(int buff_id, string buff_name, BuffCode buff_ename, ElementType element_type, BuffDispelType buff_dispel, BuffType buff_type, BuffFlag buffFlag, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float v8, float durationTime, float oneActionTime, int max_tier) { this.Buff_Id = buff_id; this.BuffName = buff_name; this.Buff_Ename = buff_ename; this.Element_Type = element_type; this.Buff_Dispel_Type = buff_dispel; this.Buff_Type = buff_type; this.Buff_Flag = buffFlag; this.Value_1 = v1; this.Value_2 = v2; this.Value_3 = v3; this.Value_4 = v4; this.Value_5 = v5; this.Value_6 = v6; this.Value_7 = v7; this.Value_8 = v8; this.DurationTime = durationTime; this.OrgDurationTime = durationTime; this.OneActionTime = oneActionTime; this.NextActionTime = oneActionTime; this.Max_Tier = max_tier; this.isOneDamage = true; this.isOneAssist = true; }
public void SetCardPreviewInfo() { //cardPreview_Panel.transform.Find("").GetComponent<Image>().sprite = ""; string data = outCardData.Replace("|", ""); int count = int.Parse(outCardData.Split('|')[0]) + int.Parse(outCardData.Split('|')[1]) + int.Parse(outCardData.Split('|')[2]) + int.Parse(outCardData.Split('|')[3]) + int.Parse(outCardData.Split('|')[4]) + int.Parse(outCardData.Split('|')[5]); SpecialBuff spBuff = new SpecialBuff(); string combineName = ""; string fixedDamage = ""; if (card_info_dict.ContainsKey(data)) { spBuff = card_info_dict[data]; combineName = spBuff.CombineName; fixedDamage = spBuff.FixedDamage; } else { combineName = count == 4 ? "圣者遗物" : "圣剑"; fixedDamage = count == 4 ? "45" : "60"; cardPreview_Panel.transform.Find("ImageGrade").transform.GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/Icon/A"); } cardPreview_Panel.transform.Find("CombineName_Text").GetComponent <Text>().text = combineName + "(造成" + fixedDamage + "点伤害)"; cardPreview_Panel.transform.Find("CombineDes_Text").GetComponent <Text>().text = ""; if (!card_info_dict.ContainsKey(data)) { return; } string combineDes = ""; if (spBuff.buffID1 != "0") { BuffCode buffcode = (BuffCode)Enum.Parse(typeof(BuffCode), spBuff.buffID1); Buff buffInfo = buff_info_dict[buffcode]; combineDes += buffInfo.BuffName + "(+" + spBuff.addNumber1 + "层)\n" + buffInfo.BuffDes; } if (spBuff.buffID2 != "0") { BuffCode buffcode = (BuffCode)Enum.Parse(typeof(BuffCode), spBuff.buffID2); Buff buffInfo = buff_info_dict[buffcode]; combineDes += buffInfo.BuffName + "(+" + spBuff.addNumber2 + "层)\n" + buffInfo.BuffDes; } if (spBuff.buffID3 != "0") { BuffCode buffcode = (BuffCode)Enum.Parse(typeof(BuffCode), spBuff.buffID3); Buff buffInfo = buff_info_dict[buffcode]; combineDes += buffInfo.BuffName + "(+" + spBuff.addNumber3 + "层)\n" + buffInfo.BuffDes; } if (spBuff.buffID4 != "0") { BuffCode buffcode = (BuffCode)Enum.Parse(typeof(BuffCode), spBuff.buffID4); Buff buffInfo = buff_info_dict[buffcode]; combineDes += buffInfo.BuffName + "(+" + spBuff.addNumber4 + "层)\n" + buffInfo.BuffDes; } cardPreview_Panel.transform.Find("CombineDes_Text").GetComponent <Text>().text = combineDes; cardPreview_Panel.transform.Find("ImageGrade").transform.GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/Icon/" + spBuff.Grade); }
public bool RegisterBuff(uint currentTick, BuffCode id) { var buff = (Buff)BuffManager.table[id]; if (buff == null) { return(false); } buffs.Push(new BuffPiece(id, buff.duration + currentTick)); buff.plusStat.ForEach(stat => extraStats[(int)stat.Item1] += stat.Item2); buff.plusParam.ForEach(param => effectParams[(int)param.Item1] += param.Item2); // 바뀌었으니 다시 계산 CalcStat(); return(true); }
public CardGroup(string cardGroup_id, float cardGroup_damage, ElementType damage_Type, BuffCode buffCode_1, BuffCode buffCode_2, BuffCode buffCode_3, BuffCode buffCode_4, int buff_1_Tire, int buff_2_Tire, int buff_3_Tire, int buff_4_Tire, string buff_1_Target, string buff_2_Target, string buff_3_Target, string buff_4_Target) { this.CardGroup_ID = cardGroup_id; this.CardGroup_Damage = cardGroup_damage; this.Damage_Type = damage_Type; this.BuffCode_1 = buffCode_1; this.BuffCode_2 = buffCode_2; this.BuffCode_3 = buffCode_3; this.BuffCode_4 = buffCode_4; this.Buff_1_Tire = buff_1_Tire; this.Buff_2_Tire = buff_2_Tire; this.Buff_3_Tire = buff_3_Tire; this.Buff_4_Tire = buff_4_Tire; this.Buff_1_Target = buff_1_Target; this.Buff_2_Target = buff_2_Target; this.Buff_3_Target = buff_3_Target; this.Buff_4_Target = buff_4_Target; }
//同步buff列表 private void SynchroBuffList(string buffInfo, Dictionary <BuffCode, GameObject> targetBuffDict, Transform buffScrollView, Vector3 scale) { List <BuffCode> DictHasBuffList = new List <BuffCode>(); DictHasBuffList.AddRange(targetBuffDict.Keys); if (buffInfo == "{}") { if (DictHasBuffList.Count == 0) { return; } foreach (BuffCode bc in DictHasBuffList) { GameObject go = targetBuffDict[bc]; targetBuffDict.Remove(bc); Destroy(go); } return; } List <BuffCode> targetHasBuffList = new List <BuffCode>(); string data = buffInfo.Replace("{", ""); data = data.Replace("}", ""); string[] dataList = data.Split(';'); foreach (string s in dataList) { string info = s.Replace("[", ""); info = info.Replace("]", ""); BuffCode buffcode = (BuffCode)Enum.Parse(typeof(BuffCode), info.Split(',')[0]); int tier = int.Parse(info.Split(',')[1]); float time = float.Parse(info.Split(',')[2]); targetHasBuffList.Add(buffcode); if (targetBuffDict.ContainsKey(buffcode)) { targetBuffDict[buffcode].transform.Find("ImageFill").GetComponent <Image>().fillAmount = 1 - time / float.Parse(buff_info_dict[buffcode].BuffDuration); targetBuffDict[buffcode].transform.Find("ImageFill/Text").GetComponent <Text>().text = tier.ToString(); } else { GameObject buffGO = GameObject.Instantiate(Resources.Load <GameObject>("Prefab/buff"), buffScrollView); //Destroy(buffGO.GetComponent<BuffCtrl>()); buffGO.GetComponent <BuffCtrl>().isPVP = true; buffGO.GetComponent <BuffCtrl>().BuffName = buff_info_dict[buffcode].BuffName; buffGO.GetComponent <BuffCtrl>().BuffDescription = buff_info_dict[buffcode].BuffDes; buffGO.transform.localScale = scale; if (scale.x < 0) { buffGO.transform.Find("Text").transform.localPosition = new Vector3(buffGO.transform.Find("Text").transform.localPosition.x *-1, buffGO.transform.Find("Text").transform.localPosition.y, buffGO.transform.Find("Text").transform.localPosition.z); } buffGO.transform.Find("icon").GetComponent <Image>().sprite = Resources.Load <Sprite>("Image/Icon/" + buffcode.ToString() + "Buff"); buffGO.transform.Find("ImageFill").GetComponent <Image>().fillAmount = 1 - time / float.Parse(buff_info_dict[buffcode].BuffDuration); buffGO.transform.Find("ImageFill/Text").GetComponent <Text>().text = tier.ToString(); //buffGO.transform.Find("Text").GetComponent<Text>().text = buff_info_dict[buffcode].BuffDes; targetBuffDict.Add(buffcode, buffGO); } } foreach (BuffCode bc in DictHasBuffList) { if (!targetHasBuffList.Contains(bc)) { GameObject go = targetBuffDict[bc]; targetBuffDict.Remove(bc); Destroy(go); } } }
public BuffPiece(BuffCode id, uint expireTime) { this.id = id; this.expireTime = expireTime; }
//移除持续时间未归0buff,不触发移除效果 private void RemoveBuffNotUseRemoveEffect(FightHero target, BuffCode buffCode) { target.BuffDict.Remove(buffCode); }
//移除持续时间未归0buff,触发移除效果 private void RemoveBuffUseRemoveEffect(FightHero target, BuffCode buffCode) { target.BuffDict[buffCode].LastAssistEffect(target); target.BuffDict[buffCode].LastDamageEffect(target); target.BuffDict.Remove(buffCode); }