public void AddBuff(buff buffname) { switch (buffname) { case buff.加速: actor.Log(actor.GetName() + "は加速した"); break; case buff.混乱: actor.Log(actor.GetName() + "は混乱した"); break; case buff.剛体化: actor.Log(actor.GetName() + "は剛体化した"); break; case buff.毒: actor.Log(actor.GetName() + "は毒を患った"); break; case buff.足: actor.Log(actor.GetName() + "は足が重くなった"); break; } reduceBuffTime[buffname] = buffTime; }
/// <summary> /// Adds the buff. /// </summary> /// <param name="buffID">Buff identifier.</param> /// <param name="buffTypeNum">Buff type number.</param> /// <param name="buffLastTypeNum">Buff last type number.</param> /// <param name="buffTime">Buff time.</param> /// <param name="tempBuffValue">Temp buff value.</param> /// <param name="buffOverlapType">Buff overlap type.</param> public void addBuff(int buffID, BuffConnection buffTypeNum, int buffLastTypeNum, int buffTime, int tempBuffValue, int buffOverlapType) { buff tempbuff = new buff(buffID, buffTypeNum, (BuffLastType)buffLastTypeNum, buffTime, tempBuffValue, (BuffOverlapType)buffOverlapType); //如果是回复持续回合数的技能(比如易伤、虚弱),以新的buff替换原有buff if (tempbuff.buffOverlapType == BuffOverlapType.BuffCountRecover) { for (int i = 0; i < buffList.Count; i++) { if (buffID == buffList[i].buffID) { buffList[i] = tempbuff; return; } } } if (tempbuff.buffOverlapType == BuffOverlapType.BuffValueAdd) { } buffList.Add(tempbuff); }
public void RemoveBuff(float value, buffType type) { buff b = buffValues.Find((bf) => { return(bf.value == value && bf.type == type); }); buffValues.Remove(b); BuffValue = CalcBuffValue(); }
public void ProcesshealBuffer() // called at the beginning of unit turn { for (int i = 0; i < healBuffer.Count; i++) { if (!healBuffer[i].wasProcessed) { HP = HP + healBuffer[i].amount; healBuffer[i] = new buff(healBuffer[i], true); } } }
public void ProcessdamagetBuffer() // called at the beginning of unit turn { for (int i = 0; i < damageBuffer.Count; i++) { if (!damageBuffer[i].wasProcessed) { HP = HP - damageBuffer[i].amount; damageBuffer[i] = new buff(damageBuffer[i], true); } } }
public void ProcessmovementBuffer() // called when effect activated { for (int i = 0; i < movementBuffer.Count; i++) { if (!movementBuffer[i].wasProcessed) { i_MOV = i_MOV + movementBuffer[i].amount; MOV = MOV + movementBuffer[i].amount; movementBuffer[i] = new buff(movementBuffer[i], true); } } }
/****** PROCESS BUFFER *********/ public void ProcesshpBuffer() // called when effect activated { for (int i = 0; i < hpBuffer.Count; i++) { if (!hpBuffer[i].wasProcessed) { i_HP = i_HP + hpBuffer[i].amount; HP = HP + hpBuffer[i].amount; hpBuffer[i] = new buff(hpBuffer[i], true); } } }
public void DecrementAllBuffers() // called at the end of unit's turn { for (int i = hpBuffer.Count - 1; i >= 0; i--) { buff tmp = new buff(hpBuffer[i].amount, hpBuffer[i].turn - 1); // we dont want to add up hp buff every turn hpBuffer[i] = new buff(tmp, true); if (hpBuffer[i].turn == 0) { i_HP = i_HP - hpBuffer[i].amount; HP = HP - hpBuffer[i].amount; hpBuffer.RemoveAt(i); } } for (int i = movementBuffer.Count - 1; i >= 0; i--) { buff tmp = new buff(movementBuffer[i].amount, movementBuffer[i].turn - 1); // we dont want to add up mov buff every turn movementBuffer[i] = new buff(tmp, true); if (movementBuffer[i].turn == 0) { i_MOV = i_MOV - movementBuffer[i].amount; movementBuffer.RemoveAt(i); } } for (int i = damageBuffer.Count - 1; i >= 0; i--) { damageBuffer[i] = new buff(damageBuffer[i].amount, damageBuffer[i].turn - 1); // wasProcessed = false -> new tick processed beggining of next turn if (damageBuffer[i].turn == 0) { damageBuffer.RemoveAt(i); } } for (int i = healBuffer.Count - 1; i >= 0; i--) { healBuffer[i] = new buff(healBuffer[i].amount, healBuffer[i].turn - 1); // wasProcessed = false -> new tick processed beggining of next turn if (healBuffer[i].turn == 0) { healBuffer.RemoveAt(i); } } }
/// <summary> /// Update the buff time wheneven ATKTurn End /// </summary> public void UpdateBuff() { for (int i = 0; i < buffList.Count; ++i) { if (buffList[i].buffType == BuffConnection.Poison) { reduceMonsterHP(buffList[i].buffTime); } buff b = buffList[i]; b.buffTime -= 1; buffList[i] = b; if (b.buffTime <= 0) { buffList.Remove(b); --i; continue; } } }
/// <summary> /// Minuses the buff count. /// </summary> public void checkBuffCount() { for (int i = 0; i < buffList.Count; i++) { if (buffList[i].buffLastType == BuffLastType.Forever) { continue; } int tempTime = buffList[i].buffTime; tempTime--; if (tempTime <= 0) { buffList.Remove(buffList[i]); i--; //avoid skip the next buff judge continue; } //cannot directly modify the attribute of the element in list, desperate. buff tempBuff = buffList[i]; tempBuff.buffTime = tempTime; buffList[i] = tempBuff; } }
public void create_buff(int buff_code, charactor buff_from, charactor buff_to, int time_full, int wait_time) { if (time_full > 0) { if (!charactor_exist(buff_to)) { charactors.Add(buff_to); } buff old_buff = null; if (buff_to.get_buff_map().ContainsKey(buff_code)) { old_buff = buff_to.get_buff_map() [buff_code]; } if (old_buff == null) { buff new_buff = buff.new_buff(buff_code); new_buff.init(buff_code, buff_from, buff_to, time_full, wait_time, this); buff_to.get_buff_map() [buff_code] = new_buff; } else { if (time_full > old_buff.time_now) { old_buff.time_full = time_full; if (old_buff.time_now == 0) { old_buff.time_now = old_buff.time_full + 1; } else if (old_buff.time_now > 0) { old_buff.time_now = old_buff.time_full - 1; } } } } }
public bool GetBuff(buff buffname) { return(reduceBuffTime[buffname] != 0); }
public void ReduceBuff(buff buffname) { reduceBuffTime[buffname] = 0; actor.Log(actor.GetName() + "の" + buffname + "は治まった"); }
=> Write(ref buff, tokens.Select(t =>
public buff(buff b, bool processed) { amount = b.amount; turn = b.turn; wasProcessed = processed; }
public hero() { _maxData = new elementData (); _thisData = new elementData (); _skill = new List<skill> (); _buffNum = new buff (); _buffPer = new buff (); // maxData = new elementData (); // thisData = new elementData (); // skill = new List<skill> (); // buff = new skillType (); }
public buff clone(buff element) { this.hp = element.hp; this.at = element.at; this.ag = element.ag; this.hi = element.hi; this.av = element.av; this.cr = element.cr; this.cpro = element.cpro; this.de = element.de; this.depro = element.depro; this.atpro= element.atpro; this.damage= element.damage; this.enLiMaxPer= element.enLiMaxPer; this.enLiCurPer= element.enLiCurPer; this.thLiMaxPer= element.thLiMaxPer; this.thLiCurPer= element.thLiCurPer; this.clDem= element.clDem; this.goldGetSec= element.goldGetSec; this.goldGet= element.goldGet; this.goldGetKill= element.goldGetKill; this.expGet= element.expGet; this.expNeed= element.expNeed; this.boxGetProb= element.boxGetProb; this.boxGoldAdd= element.boxGoldAdd; this.boxArtProb= element.boxArtProb; this.boxAdvArtProb= element.boxAdvArtProb; this.ArtSmeProb= element.ArtSmeProb; this.ArtSmeNeed= element.ArtSmeNeed; this.resetGold= element.resetGold; this.resetExp= element.resetExp; return this; }