/// <summary> /// 更新属性 /// </summary> private void updateAttributes() { rushCombat(); CardBaseAttribute attr = CardManagerment.Instance.getCardWholeAttr(card); CardBaseAttribute attr2 = CardManagerment.Instance.getCardAppendEffectNoSuit(card); attrLabels [0].text = attr.getWholeHp().ToString(); attrLabels [1].text = attr.getWholeAtt().ToString(); attrLabels [2].text = attr.getWholeDEF().ToString(); attrLabels [3].text = attr.getWholeMAG().ToString(); attrLabels [4].text = attr.getWholeAGI().ToString(); if (showAttrTime == true) { addAttrLabels [0].text = " + " + attr2.getWholeHp().ToString(); addAttrLabels [1].text = " + " + attr2.getWholeAtt().ToString(); addAttrLabels [2].text = " + " + attr2.getWholeDEF().ToString(); addAttrLabels [3].text = " + " + attr2.getWholeMAG().ToString(); addAttrLabels [4].text = " + " + attr2.getWholeAGI().ToString(); } else { string fj = LanguageConfigManager.Instance.getLanguage("s0141"); addAttrLabels [0].text = CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.hp) != 0 ? fj + "Lv." + CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.hp) : ""; addAttrLabels [1].text = CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.attack) != 0 ? fj + "Lv." + CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.attack) : ""; addAttrLabels [2].text = CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.defecse) != 0 ? fj + "Lv." + CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.defecse) : ""; addAttrLabels [3].text = CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.magic) != 0 ? fj + "Lv." + CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.magic) : ""; addAttrLabels [4].text = CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.agile) != 0 ? fj + "Lv." + CardManagerment.Instance.getCardAttrAppendLevel(card, AttributeType.agile) : ""; } }
/** 获得当前进化属性比例加成 */ public CardBaseAttribute getEvolutionAttrPer(Card card) { CardBaseAttribute attr = new CardBaseAttribute(); AttrChangeSample[] effects = getAddEffect(card); if (effects == null || effects.Length < 1) { return(attr); } for (int j = 0; j < effects.Length; j++) { if (effects [j].getAttrType() == AttrChangeType.PER_HP) { attr.perHp += effects [j].getAttrValue(card.getLevel()); } else if (effects [j].getAttrType() == AttrChangeType.PER_ATTACK) { attr.perAttack += effects [j].getAttrValue(card.getLevel()); } else if (effects [j].getAttrType() == AttrChangeType.PER_DEFENSE) { attr.perDefecse += effects [j].getAttrValue(card.getLevel()); } else if (effects [j].getAttrType() == AttrChangeType.PER_MAGIC) { attr.perMagic += effects [j].getAttrValue(card.getLevel()); } else if (effects [j].getAttrType() == AttrChangeType.PER_AGILE) { attr.perAgile += effects [j].getAttrValue(card.getLevel()); } } return(attr); }
public void initWindow(Card oldCard, CallBackMsg call) { callback = call; int value = 0; CardBaseAttribute oldCardAttr = CardManagerment.Instance.getCardAllWholeAttr(oldCard); BloodPointSample pointSample = BloodConfigManager.Instance.getBloodPointSampleBySid(CardSampleManager.Instance.getBloodSid(oldCard.sid)); if (pointSample != null) { BloodItemSample itemSample = BloodItemConfigManager.Instance.getBolldItemSampleBySid(BloodConfigManager.Instance.getCurrentItemSid(pointSample, oldCard.cardBloodLevel)); if (itemSample == null) { return; } bloodEffect[] effect = itemSample.effects; for (int i = 0; i < effect.Length; i++) { value = effect[i].perAllAttr; } } int[] costs = CommandConfigManager.Instance.getEvoCostByQuality(oldCard.getQualityId()); oldEvoLevel.text = oldCard.getEvoLevel() + ""; newEvoLevel.text = oldCard.getEvoLevel() + "[FF0000]-" + (oldCard.getEvoLevel() - oldCard.getEvoLevelForBlood(oldCard.getEvoTimes() == 0 ? costs[0] : costs[oldCard.getEvoTimes() - 1])) + "[-]"; oldCombat.text = oldCard.getCardCombat() + ""; newCombat.text = oldCard.getCardCombat() + "[358C35]+" + value + "%" + "[-]"; oldQuality.spriteName = QualityManagerment.qualityIDToStringByBG(oldCard.getQualityId()); newQuality.spriteName = QualityManagerment.qualityIDToStringByBG(oldCard.getQualityId() + 1); }
private void showNewInfo(Card oldCard, Card newCard) { CardBaseAttribute attrNew = CardManagerment.Instance.getCardAllWholeAttr(newCard); CardBaseAttribute attr = CardManagerment.Instance.getCardAllWholeAttr(oldCard); newMsgLabel[0].text = attr.getWholeHp().ToString(); newMsgLabel[1].text = attr.getWholeAtt().ToString(); newMsgLabel[2].text = attr.getWholeDEF().ToString(); newMsgLabel[3].text = attr.getWholeMAG().ToString(); newMsgLabel[4].text = attr.getWholeAGI().ToString(); newMsgLabel[5].text = "Lv." + oldCard.getMaxLevel(); TweenLabelNumber tl = TweenLabelNumber.Begin(combat.gameObject, 0.5f, newCard.getCardCombat()); // combat.text = newCard.getCardCombat ().ToString(); newAddMsgLabel[0].text = (attrNew.getWholeHp() - attr.getWholeHp()) >= 0 ? " + " + (attrNew.getWholeHp() - attr.getWholeHp()) : (attrNew.getWholeHp() - attr.getWholeHp()) + ""; newAddMsgLabel[1].text = (attrNew.getWholeAtt() - attr.getWholeAtt()) >= 0 ? " + " + (attrNew.getWholeAtt() - attr.getWholeAtt()) : (attrNew.getWholeAtt() - attr.getWholeAtt()) + ""; newAddMsgLabel[2].text = (attrNew.getWholeDEF() - attr.getWholeDEF()) >= 0 ? " + " + (attrNew.getWholeDEF() - attr.getWholeDEF()) : (attrNew.getWholeDEF() - attr.getWholeDEF()) + ""; newAddMsgLabel[3].text = (attrNew.getWholeMAG() - attr.getWholeMAG()) >= 0 ? " + " + (attrNew.getWholeMAG() - attr.getWholeMAG()) : (attrNew.getWholeMAG() - attr.getWholeMAG()) + ""; newAddMsgLabel[4].text = (attrNew.getWholeAGI() - attr.getWholeAGI()) >= 0 ? " + " + (attrNew.getWholeAGI() - attr.getWholeAGI()) : (attrNew.getWholeAGI() - attr.getWholeAGI()) + ""; newAddMsgLabel[5].text = (newCard.getMaxLevel() - oldCard.getMaxLevel()) >= 0 ? " + " + (newCard.getMaxLevel() - oldCard.getMaxLevel()) : (newCard.getMaxLevel() - oldCard.getMaxLevel()) + ""; int addQ = newCard.getQualityId() - oldCard.getQualityId(); if (addQ != 0) { addQuality.text = LanguageConfigManager.Instance.getLanguage("beastSummonShow11") + "+" + addQ; } else { addQuality.text = ""; } buttonSkills[1].initSkillData(newCard.getSkills()[0], ButtonSkill.STATE_LEARNED); }
private List <AttrChange> getAttr(CardBaseAttribute cardOld, CardBaseAttribute cardNew) { List <AttrChange> attrs = new List <AttrChange> (); if (cardNew.hp - cardOld.hp != 0) { attrs.Add(new AttrChange(AttrChangeType.HP, cardNew.hp - cardOld.hp)); } if (cardNew.attack - cardOld.attack != 0) { attrs.Add(new AttrChange(AttrChangeType.ATTACK, cardNew.attack - cardOld.attack)); } if (cardNew.defecse - cardOld.defecse != 0) { attrs.Add(new AttrChange(AttrChangeType.DEFENSE, cardNew.defecse - cardOld.defecse)); } if (cardNew.magic - cardOld.magic != 0) { attrs.Add(new AttrChange(AttrChangeType.MAGIC, cardNew.magic - cardOld.magic)); } if (cardNew.agile - cardOld.agile != 0) { attrs.Add(new AttrChange(AttrChangeType.AGILE, cardNew.agile - cardOld.agile)); } return(attrs); }
private void evolutionOver() { fristIn = false; Card oldCard = mainCard.Clone() as Card; oldCard.updateEvoLevel(mainCard.getEvoLevel() - 1); attrOldEff = CardManagerment.Instance.getCardAllWholeAttr(oldCard); attrNewEff = CardManagerment.Instance.getCardAllWholeAttr(mainCard); _oldAttr = new int[5] { attrOldEff.getWholeHp(), attrOldEff.getWholeAtt(), attrOldEff.getWholeDEF(), attrOldEff.getWholeMAG(), attrOldEff.getWholeAGI() }; _newAttr = new int[5] { attrNewEff.getWholeHp(), attrNewEff.getWholeAtt(), attrNewEff.getWholeDEF(), attrNewEff.getWholeMAG(), attrNewEff.getWholeAGI() }; _addAttr = new int[5] { (attrNewEff.getWholeHp() - attrOldEff.getWholeHp()), (attrNewEff.getWholeAtt() - attrOldEff.getWholeAtt()), (attrNewEff.getWholeDEF() - attrOldEff.getWholeDEF()) , (attrNewEff.getWholeMAG() - attrOldEff.getWholeMAG()), (attrNewEff.getWholeAGI() - attrOldEff.getWholeAGI()) }; _step = new int[5] { setStep(attrOldEff.getWholeHp(), attrNewEff.getWholeHp()), setStep(attrOldEff.getWholeAtt(), attrNewEff.getWholeAtt()), setStep(attrOldEff.getWholeDEF(), attrNewEff.getWholeDEF()), setStep(attrOldEff.getWholeMAG(), attrNewEff.getWholeMAG()), setStep(attrOldEff.getWholeAGI(), attrNewEff.getWholeAGI()) }; initStar(); step = 0; nextSetp = 1; canRefresh = true; }
/// <summary> /// 卡片或者召唤兽单个属性战斗力计算 /// </summary> private double getCardAttrCombat(Card _card, int _coeType) { CardBaseAttribute attr = CardManagerment.Instance.getCardAllWholeAttr(_card); switch (_coeType) { case COE_HP: double hp = attr.getWholeHp(); double coehp = getCombatSampleBySid(_card.getJob()).hpCoe; return((int)(hp * coehp)); case COE_ATT: double att = attr.getWholeAtt(); double coeAtt = getCombatSampleBySid(_card.getJob()).attCoe; return((int)(att * coeAtt)); case COE_DEF: double def = attr.getWholeDEF(); double coeDef = getCombatSampleBySid(_card.getJob()).defCoe; return((int)(def * coeDef)); case COE_MAG: double mag = attr.getWholeMAG(); double coeMag = getCombatSampleBySid(_card.getJob()).magCoe; return((int)(mag * coeMag)); case COE_AGI: double agi = attr.getWholeAGI(); double coeAgi = getCombatSampleBySid(_card.getJob()).agiCoe; return((int)(agi * coeAgi)); default: return(0); } }
public void updateBeast(BeastEvolve chooseItem) { if (chooseItem == null) { return; } if (iscacheAudioOK && AudioManager.Instance.IsAudioOpen) { playGoddessSound(chooseItem); } updateSelectedCard(chooseItem); changeButton(); updateCondition(chooseItem); level.text = "Lv." + selectedCard.getLevel() + "/" + selectedCard.getMaxLevel(); int expSid = selectedCard.getEXPSid(); long _exp = selectedCard.getEXP(); long nowExp = EXPSampleManager.Instance.getNowEXPShow(expSid, _exp); long maxExp = EXPSampleManager.Instance.getMaxEXPShow(expSid, _exp); expbar.updateValue(nowExp, maxExp); if (evolveCard != null && evolveCard.getEXP() > 0) { CardBaseAttribute oldAttr = CardManagerment.Instance.getCardWholeAttr(evolveCard); CardBaseAttribute newAttr = CardManagerment.Instance.getCardWholeAttr(selectedCard); hp.text = oldAttr.getWholeHp().ToString(); att.text = oldAttr.getWholeAtt().ToString(); def.text = oldAttr.getWholeDEF().ToString(); mag.text = oldAttr.getWholeMAG().ToString(); dex.text = oldAttr.getWholeAGI().ToString(); jinhua.text = (evolveCard.getQualityId() - 1).ToString() + "/4"; hp.text += "[64ED6E]" + " + " + (newAttr.getWholeHp() - oldAttr.getWholeHp()).ToString() + "[-]"; att.text += "[64ED6E]" + " + " + (newAttr.getWholeAtt() - oldAttr.getWholeAtt()).ToString() + "[-]"; def.text += "[64ED6E]" + " + " + (newAttr.getWholeDEF() - oldAttr.getWholeDEF()).ToString() + "[-]"; mag.text += "[64ED6E]" + " + " + (newAttr.getWholeMAG() - oldAttr.getWholeMAG()).ToString() + "[-]"; dex.text += "[64ED6E]" + " + " + (newAttr.getWholeAGI() - oldAttr.getWholeAGI()).ToString() + "[-]"; evolveCard = null; } else { CardBaseAttribute attr = CardManagerment.Instance.getCardWholeAttr(selectedCard); hp.text = attr.getWholeHp().ToString(); att.text = attr.getWholeAtt().ToString(); def.text = attr.getWholeDEF().ToString(); mag.text = attr.getWholeMAG().ToString(); dex.text = attr.getWholeAGI().ToString(); jinhua.text = (selectedCard.getQualityId() - 1).ToString() + "/4"; } titleName = "horStar" + selectedCard.getTitleName(selectedCard.sid); setTitle(titleName, selectedCard.getName()); quality.spriteName = QualityManagerment.qualityIDToStringByBG(selectedCard.getQualityId()); quality.gameObject.SetActive(true); string str = LanguageConfigManager.Instance.getLanguage("s0371"); InitSkill(); }
/// <summary> /// 坐骑属性战斗力 /// </summary> private double getMountsAttrCombat(Mounts mounts, int Type) { CardBaseAttribute attr = mounts.getMountsAddEffect(); switch (Type) { case COE_HP: double hp = attr.getWholeHp(); double coehp = getCombatSampleBySid(MOUNTS_TYPE).hpCoe; return((int)(hp * coehp)); case COE_ATT: double att = attr.getWholeAtt(); double coeAtt = getCombatSampleBySid(MOUNTS_TYPE).attCoe; return((int)(att * coeAtt)); case COE_DEF: double def = attr.getWholeDEF(); double coeDef = getCombatSampleBySid(MOUNTS_TYPE).defCoe; return((int)(def * coeDef)); case COE_MAG: double mag = attr.getWholeMAG(); double coeMag = getCombatSampleBySid(MOUNTS_TYPE).magCoe; return((int)(mag * coeMag)); case COE_AGI: double agi = attr.getWholeAGI(); double coeAgi = getCombatSampleBySid(MOUNTS_TYPE).agiCoe; return((int)(agi * coeAgi)); default: return(0); } }
//合并卡片基础属性对象 public void mergeCardBasePer(CardBaseAttribute attr) { this.perHp += attr.perHp; this.perAttack += attr.perAttack; this.perAgile += attr.perAgile; this.perDefecse += attr.perDefecse; this.perMagic += attr.perMagic; }
//合并卡片基础属性对象 public void mergeCardBaseNum(CardBaseAttribute attr) { this.hp += attr.hp; this.agile += attr.agile; this.attack += attr.attack; this.defecse += attr.defecse; this.magic += attr.magic; }
/** 计算属性附加数据 */ void computeAddedValue(Card beforeCard, CardBaseAttribute beforeEvoAttr, Card afterCard, CardBaseAttribute afterEvoAttr) { levelAdded = afterCard.getMaxLevel() - beforeCard.getMaxLevel(); lifeAdded = afterEvoAttr.getWholeHp() - beforeEvoAttr.getWholeHp(); attackAdded = afterEvoAttr.getWholeAtt() - beforeEvoAttr.getWholeAtt(); defendAdded = afterEvoAttr.getWholeDEF() - beforeEvoAttr.getWholeDEF(); magicAdded = afterEvoAttr.getWholeMAG() - beforeEvoAttr.getWholeMAG(); agileAdded = afterEvoAttr.getWholeAGI() - beforeEvoAttr.getWholeAGI(); }
public void Initialize(Card beforeCard, Card afterCard, CallBack callback) { CardBaseAttribute beforeEvoAttr = CardManagerment.Instance.getCardWholeAttr(beforeCard); CardBaseAttribute afterEvoAttr = CardManagerment.Instance.getCardWholeAttr(afterCard); this.callback = callback; computeAddedValue(beforeCard, beforeEvoAttr, afterCard, afterEvoAttr); showUI(beforeCard, beforeEvoAttr, afterCard, afterEvoAttr); }
public void showUI(Card beforeCard, CardBaseAttribute beforeEvoAttr, Card afterCard, CardBaseAttribute afterEvoAttr) { showLevelValue(beforeCard.getMaxLevel(), beforeCard.getMaxLevel()); showLifeValue(beforeEvoAttr.getWholeHp(), beforeEvoAttr.getWholeHp()); showAttackValue(beforeEvoAttr.getWholeAtt(), beforeEvoAttr.getWholeAtt()); showDefendValue(beforeEvoAttr.getWholeDEF(), beforeEvoAttr.getWholeDEF()); showMagicValue(beforeEvoAttr.getWholeMAG(), beforeEvoAttr.getWholeMAG()); showAgileValue(beforeEvoAttr.getWholeAGI(), beforeEvoAttr.getWholeAGI()); showMainSkill(beforeCard, afterCard); }
private void initAttr() { CardBaseAttribute attr = CardManagerment.Instance.getCardAllWholeAttr(mainCard); attrNow[0].text = attr.getWholeHp() + ""; attrNow[1].text = attr.getWholeAtt() + ""; attrNow[2].text = attr.getWholeDEF() + ""; attrNow[3].text = attr.getWholeMAG() + ""; attrNow[4].text = attr.getWholeAGI() + ""; }
//0生命,1攻击,2防御,3魔法,4敏捷,5等级上限,6战力 private void showOldInfo(Card oldCard) { CardBaseAttribute attr = CardManagerment.Instance.getCardAllWholeAttr(oldCard); oldMsgLabel[0].text = attr.getWholeHp() + ""; oldMsgLabel[1].text = attr.getWholeAtt() + ""; oldMsgLabel[2].text = attr.getWholeDEF() + ""; oldMsgLabel[3].text = attr.getWholeMAG() + ""; oldMsgLabel[4].text = attr.getWholeAGI() + ""; }
//获得技能属性影响效果 public CardBaseAttribute getSkillEffect() { CardBaseAttribute attr = new CardBaseAttribute(); AttrChangeSample[] effects = getAttcChanges(); if (effects == null || effects.Length < 1) { return(attr); } for (int i = 0; i < effects.Length; i++) { if (effects [i].getAttrType() == AttrChangeType.HP) { attr.hp += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.ATTACK) { attr.attack += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.DEFENSE) { attr.defecse += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.MAGIC) { attr.magic += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.AGILE) { attr.agile += effects [i].getAttrValue(getLevel()); } //技能影响的属性百分比变化 else if (effects [i].getAttrType() == AttrChangeType.PER_HP) { attr.perHp += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.PER_ATTACK) { attr.perAttack += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.PER_DEFENSE) { attr.perDefecse += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.PER_MAGIC) { attr.perMagic += effects [i].getAttrValue(getLevel()); } else if (effects [i].getAttrType() == AttrChangeType.PER_AGILE) { attr.perAgile += effects [i].getAttrValue(getLevel()); } } return(attr); }
/// <summary> /// 获得坐骑属性 /// </summary> public CardBaseAttribute getMountsAddEffect() { CardBaseAttribute attr = new CardBaseAttribute(); attr.attack = getAttrByType(AttributeType.attack); attr.hp = getAttrByType(AttributeType.hp); attr.defecse = getAttrByType(AttributeType.defecse); attr.magic = getAttrByType(AttributeType.magic); attr.agile = getAttrByType(AttributeType.agile); return(attr); }
//0生命,1攻击,2防御,3魔法,4敏捷,5等级上限,6战力 private void showNewInfo(Card oldCard, Card newCard) { CardBaseAttribute attrOld = CardManagerment.Instance.getCardAllWholeAttr(oldCard); CardBaseAttribute attrNew = CardManagerment.Instance.getCardAllWholeAttr(newCard); newMsgLabel[0].text = attrOld.getWholeHp() + " + " + Colors.GREEN + (attrNew.getWholeHp() - attrOld.getWholeHp()); newMsgLabel[1].text = attrOld.getWholeAtt() + " + " + Colors.GREEN + (attrNew.getWholeAtt() - attrOld.getWholeAtt()); newMsgLabel[2].text = attrOld.getWholeDEF() + " + " + Colors.GREEN + (attrNew.getWholeDEF() - attrOld.getWholeDEF()); newMsgLabel[3].text = attrOld.getWholeMAG() + " + " + Colors.GREEN + (attrNew.getWholeMAG() - attrOld.getWholeMAG()); newMsgLabel[4].text = attrOld.getWholeAGI() + " + " + Colors.GREEN + (attrNew.getWholeAGI() - attrOld.getWholeAGI()); }
//获得套装基础属性影响值 public CardBaseAttribute getSuitBaseAttrChange(string[] equips, int starLevel) { CardBaseAttribute attr = new CardBaseAttribute(); SuitAttrChange[] suitAttrs = getEquipsSuitAttrChanges(equips, starLevel); if (suitAttrs == null || suitAttrs.Length < 1) { return(attr); } for (int i = 0; i < suitAttrs.Length; i++) { AttrChangeSample[] effects = suitAttrs [i].effects; if (effects == null || effects.Length < 1) { return(attr); } //套装属性不受等级影响 取第一级 for (int j = 0; j < effects.Length; j++) { if (effects [j].getAttrType() == AttrChangeType.HP) { attr.hp += effects [j].getAttrValue(1); } else if (effects [j].getAttrType() == AttrChangeType.ATTACK) { attr.attack += effects [j].getAttrValue(1); } else if (effects [j].getAttrType() == AttrChangeType.DEFENSE) { attr.defecse += effects [j].getAttrValue(1); } else if (effects [j].getAttrType() == AttrChangeType.MAGIC) { attr.magic += effects [j].getAttrValue(1); } else if (effects [j].getAttrType() == AttrChangeType.AGILE) { attr.agile += effects [j].getAttrValue(1); // } else if (effects [j].getAttrType () == AttrChangeType.PER_HP) { // attr.perHp += effects [j].getAttrValue (1); // } else if (effects [j].getAttrType () == AttrChangeType.PER_ATTACK) { // attr.perAttack += effects [j].getAttrValue (1); // } else if (effects [j].getAttrType () == AttrChangeType.PER_DEFENSE) { // attr.perDefecse += effects [j].getAttrValue (1); // } else if (effects [j].getAttrType () == AttrChangeType.PER_MAGIC) { // attr.perMagic += effects [j].getAttrValue (1); // } else if (effects [j].getAttrType () == AttrChangeType.PER_AGILE) { // attr.perAgile += effects [j].getAttrValue (1); } } } return(attr); }
/// <summary> /// 获得共鸣属性比例加成 /// </summary> public CardBaseAttribute getBeastResonanceEffectByPer() { CardBaseAttribute attr = new CardBaseAttribute(); attr.perHp += getBestResonance(); attr.perAttack += getBestResonance(); attr.perDefecse += getBestResonance(); attr.perMagic += getBestResonance(); attr.perAgile += getBestResonance(); return(attr); }
private void showOldInfo(Card oldCard) { CardBaseAttribute attr = CardManagerment.Instance.getCardAllWholeAttr(oldCard); oldMsgLabel[0].text = attr.getWholeHp() + ""; oldMsgLabel[1].text = attr.getWholeAtt() + ""; oldMsgLabel[2].text = attr.getWholeDEF() + ""; oldMsgLabel[3].text = attr.getWholeMAG() + ""; oldMsgLabel[4].text = attr.getWholeAGI() + ""; oldMsgLabel[5].text = "Lv." + oldCard.getMaxLevel(); // oldMsgLabel [6].text = oldCard.getCardCombat ().ToString(); buttonSkills[0].initSkillData(oldCard.getSkills()[0], ButtonSkill.STATE_LEARNED); }
//合并卡片基础属性对象 public void mergeCardBaseAttr(CardBaseAttribute attr) { this.hp += attr.hp; this.agile += attr.agile; this.attack += attr.attack; this.defecse += attr.defecse; this.magic += attr.magic; this.perHp += attr.perHp; this.perAttack += attr.perAttack; this.perAgile += attr.perAgile; this.perDefecse += attr.perDefecse; this.perMagic += attr.perMagic; }
/// <summary> /// 获得技能基础属性加成 /// </summary> public CardBaseAttribute getMountsSkillEffectNum() { CardBaseAttribute attr = new CardBaseAttribute(); Skill[] tempSkills = getSkills(); if (tempSkills == null || tempSkills.Length < 1) { return(attr); } for (int i = 0; i < tempSkills.Length; i++) { attr.mergeCardBaseNum(tempSkills [i].getSkillEffect()); } return(attr); }
private void showOldInfo() { CardBaseAttribute attr = CardManagerment.Instance.getCardWholeAttr(oldCard); //oldMsgLabel[0].text = attr.getWholeHp () + ""; //oldMsgLabel[1].text = attr.getWholeAtt () + ""; //oldMsgLabel[2].text = attr.getWholeDEF () + ""; //oldMsgLabel[3].text = attr.getWholeMAG () + ""; //oldMsgLabel[4].text = attr.getWholeAGI () + ""; oldMsgLabel[5].text = "Lv." + oldCard.getMaxLevel(); oldMsgLabel[6].text = BeastEvolveManagerment.Instance.getBestResonance().ToString() + "%"; oldMsgLabel[7].text = oldCard.getCardCombat() + ""; oldQuality.spriteName = QualityManagerment.qualityIDToStringByBG(oldCard.getQualityId()); InitOldSkill(oldCard); }
public void initUI(Card _showCard, string _color) { if (_showCard == null) { return; } this.showCard = _showCard; if (roleView != null) { roleView.init(showCard, null, null); } if (labelLevel != null) { labelLevel.text = "" + showCard.getMaxLevel(); } if (labelEvoLevel != null) { labelEvoLevel.text = showCard.getEvoLevel() + " / " + showCard.getMaxEvoLevel(); } if (labelCombat != null) { labelCombat.text = showCard.getCardCombat() + ""; } CardBaseAttribute attr = CardManagerment.Instance.getCardWholeAttr(showCard); labelHp.text = attr.getWholeHp().ToString(); labelAtt.text = attr.getWholeAtt().ToString(); labelDef.text = attr.getWholeDEF().ToString(); labelMag.text = attr.getWholeMAG().ToString(); labelAgi.text = attr.getWholeAGI().ToString(); attrAdd = CardManagerment.Instance.getCardAppendEffectNoSuit(showCard); Skill[] mainSkil = showCard.getSkills(); Skill[] buffSkill = showCard.getBuffSkills(); if (buffSkill != null && mainSkil == null) { mainSkillButton.initSkillData(buffSkill [0], ButtonSkill.STATE_LEARNED); } else if (buffSkill == null && mainSkil != null) { mainSkillButton.initSkillData(mainSkil [0], ButtonSkill.STATE_LEARNED); } }
private void showNewInfo() { CardBaseAttribute attrNew = CardManagerment.Instance.getCardWholeAttr(newCard); CardBaseAttribute attr = CardManagerment.Instance.getCardWholeAttr(oldCard); //newMsgLabel[0].text = attr.getWholeHp () + " [FF0000]+ " + (attrNew.getWholeHp() - attr.getWholeHp()); //newMsgLabel[1].text = attr.getWholeAtt () + " [FF0000]+ " + (attrNew.getWholeAtt() - attr.getWholeAtt()); //newMsgLabel[2].text = attr.getWholeDEF () + " [FF0000]+ " + (attrNew.getWholeDEF() - attr.getWholeDEF()); //newMsgLabel[3].text = attr.getWholeMAG () + " [FF0000]+ " + (attrNew.getWholeMAG() - attr.getWholeMAG()); //newMsgLabel[4].text = attr.getWholeAGI () + " [FF0000]+ " + (attrNew.getWholeAGI() - attr.getWholeAGI()); newMsgLabel[5].text = "Lv." + newCard.getMaxLevel(); newMsgLabel[6].text = "+" + BeastEvolveManagerment.Instance.getNextEvolveBestResonance().ToString() + "%"; newMsgLabel[7].text = "+" + (newCard.getCardCombat() - oldCard.getCardCombat()).ToString(); newQuality.spriteName = QualityManagerment.qualityIDToStringByBG(newCard.getQualityId()); InitNewSkill(newCard); }
public List <AttrChange> oneKeyEquip(string[] array) { CardBaseAttribute attrOld = CardManagerment.Instance.getCardWholeAttr(this); string[] temps = null; if (equips != null) { temps = new string[equips.Length]; Array.Copy(getEquips(), temps, getEquips().Length); } equips = null; equips = new string[array.Length]; Array.Copy(array, equips, array.Length); for (int i = 0; i < equips.Length; i++) { Equip equip = StorageManagerment.Instance.getEquip(equips [i]); if ((equip.state & EquipStateType.OCCUPY) != 1) { equip.state += EquipStateType.OCCUPY; } } if (temps != null) { for (int i = 0; i < temps.Length; i++) { for (int j = 0; j < array.Length; j++) { if (temps [i] == array [j]) { break; } if (j == array.Length - 1) { Equip equip = StorageManagerment.Instance.getEquip(temps [i]); equip.state -= EquipStateType.OCCUPY; } } } } CardBaseAttribute attrNew = CardManagerment.Instance.getCardWholeAttr(this); return(getAttr(attrOld, attrNew)); }
void updateAttrs() { for (int i = 0; i < attrLabel.Length; i++) //清空属性信息 { attrLabel[i].text = ""; evoAddAttrLabel[i].text = ""; } describe.text = ""; CardBaseAttribute cardAttr = CardManagerment.Instance.getCardAllWholeAttr(choosedCard); this.heroName.text = QualityManagerment.getQualityColor(choosedCard.getQualityId()) + choosedCard.getName(); //卡片现在的属性 attrLabel[0].text = cardAttr.getWholeHp() + ""; attrLabel[1].text = cardAttr.getWholeAtt() + ""; attrLabel[2].text = cardAttr.getWholeDEF() + ""; attrLabel[3].text = cardAttr.getWholeMAG() + ""; attrLabel[4].text = cardAttr.getWholeAGI() + ""; }
//脱装备和替换装备 public List <AttrChange> getOffEquip(string equipId, string lastequipId) { //脱装备 if (equipId == "0") { CardBaseAttribute attrOld = CardManagerment.Instance.getCardWholeAttr(this); Equip equip = StorageManagerment.Instance.getEquip(lastequipId); equip.state -= EquipStateType.OCCUPY; string[] temp = new string[equips.Length - 1]; int count = 0; for (int i = 0; i < equips.Length; i++) { if (equips [i] != lastequipId) { temp [count] = equips [i]; count++; } } equips = temp; CardBaseAttribute attrNew = CardManagerment.Instance.getCardWholeAttr(this); return(getAttr(attrOld, attrNew)); } //替换装备 else { CardBaseAttribute attrOld = CardManagerment.Instance.getCardWholeAttr(this); for (int i = 0; i < equips.Length; i++) { if (equips [i] == lastequipId) { equips [i] = equipId; Equip equip = StorageManagerment.Instance.getEquip(lastequipId); equip.state -= EquipStateType.OCCUPY; Equip equipl = StorageManagerment.Instance.getEquip(equipId); equipl.state += EquipStateType.OCCUPY; } } CardBaseAttribute attrNew = CardManagerment.Instance.getCardWholeAttr(this); return(getAttr(attrOld, attrNew)); } }