public override void FormatLong(StringBuilder builder) { if (MesLineId < 1000) { builder.Append(GameSystems.MapObject.GetDisplayNameForParty(obj)); builder.Append(" "); builder.Append(GameSystems.RollHistory.GetTranslation(MesLineId)); } else { var skillId = (SkillId)(MesLineId - 1000); var skillHelpTopic = GameSystems.Skill.GetHelpTopic(skillId); var skillName = GameSystems.Skill.GetSkillName(skillId); builder.Append(GameSystems.MapObject.GetDisplayNameForParty(obj)); builder.Append(" ~"); builder.Append(skillName); builder.Append("~["); builder.Append(skillHelpTopic); builder.Append("]"); } builder.Append("\n\n\n"); BonusList.FormatTo(builder); builder.Append("\n\n"); AppendOverallBonus(builder, BonusList.OverallBonus); }
public void ParseBonus(string _datas) { var num = 1; if (_datas == "") { return; } foreach (var infos in _datas.Split(';')) { if (infos == "") { continue; } lock (BonusList) BonusList.Add(++num, new List <EffectItem>()); foreach (var datas in infos.Split(',')) { if (datas == "") { continue; } var bonus = new EffectItem(); bonus.ID = int.Parse(datas.Split(':')[0]); bonus.Value = int.Parse(datas.Split(':')[1]); lock (BonusList[num]) BonusList[num].Add(bonus); } } }
private void ShowBonusDetails() { var critter = UiSystems.CharSheet.CurrentCritter; var bonuses = BonusList.Create(); critter.dispatch1ESkillLevel(Skill, ref bonuses, null, 0); var historyId = GameSystems.RollHistory.AddMiscBonus(critter, bonuses, 1000 + (int)Skill, 0); GameSystems.Help.ShowRoll(historyId); }
protected void BonusBind(bool current = false) { if (current) { TabPlay("bonus"); } int pageCount = 0; List <WMUserBonus> list = WMUserBonus.GetList(out pageCount, MinDate, MaxDate, UserId, BonusPager.CurrentPageIndex - 1, BonusPager.PageSize); BonusList.DataSource = list; BonusList.DataBind(); BonusPager.RecordCount = pageCount; }
/// <summary> /// 清理小球 /// </summary> /// <param name="isWin"></param> private void ClearBalls(bool isWin) { BonusList.ForEach(x => BrickMgrM.LoaderManager.ReleaseObject(x.gameObject)); var tempList = ListPool <BallEntity> .Allocate(); foreach (var item in BallsSet) { tempList.Add(item); } foreach (var item in tempList) { BrickMgrM.LoaderManager.ReleaseObject(item.gameObject); // BrickMgrM.PoolModule.GetPool<BallEntity>().Return(item); } ListPool <BallEntity> .Free(tempList); }
public static void DispatchSpellResistanceCasterLevelCheck(this GameObject critter, GameObject target, BonusList casterLvlBonus, SpellPacketBody spell) { var dispatcher = critter.GetDispatcher(); if (dispatcher == null) { return; } var dispIo = EvtObjSpellTargetBonus.Default; dispIo.spellPkt = spell; dispIo.target = target; dispIo.bonusList = casterLvlBonus; dispatcher.Process(DispatcherType.SpellResistanceCasterLevelCheck, D20DispatcherKey.NONE, dispIo); }
public static int DispatchGetLevel(this GameObject critter, int classOffset, BonusList bonlist, GameObject contextObj) { var dispatcher = critter.GetDispatcher(); if (dispatcher != null) { DispIoObjBonus dispIo = DispIoObjBonus.Default; dispIo.bonlist = bonlist; dispIo.obj = contextObj; dispatcher.Process(DispatcherType.GetLevel, (D20DispatcherKey.CL_Level + classOffset), dispIo); return(dispIo.bonOut.OverallBonus); } else { return(0); } }
public static int dispatch1ESkillLevel(this GameObject critter, SkillId skill, ref BonusList bonusList, GameObject opposingObj, SkillCheckFlags flag) { var dispatcher = critter.GetDispatcher(); if (dispatcher == null) { return(0); } DispIoObjBonus dispIO = DispIoObjBonus.Default; dispIO.flags = flag; dispIO.obj = opposingObj; dispIO.bonlist = bonusList; dispatcher.Process(DispatcherType.SkillLevel, (D20DispatcherKey)(skill + 20), dispIO); bonusList = dispIO.bonlist; return(dispIO.bonlist.OverallBonus); }
public static float Dispatch40GetMoveSpeedBase(this GameObject critter, out BonusList bonusList, out float factor) { var dispatcher = critter.GetDispatcher(); if (dispatcher != null) { var dispIo = DispIoMoveSpeed.Default; dispatcher.Process(DispatcherType.GetMoveSpeedBase, D20DispatcherKey.NONE, dispIo); bonusList = dispIo.bonlist; factor = dispIo.factor; return(dispIo.bonlist.OverallBonus * dispIo.factor); } else { bonusList = BonusList.Default; factor = 1.0f; return(30.0f); } }
public static float Dispatch41GetMoveSpeed(this GameObject critter, out BonusList bonusList) { var dispatcher = critter.GetDispatcher(); var dispIo = DispIoMoveSpeed.Default; if (dispatcher != null) { critter.Dispatch40GetMoveSpeedBase(out dispIo.bonlist, out dispIo.factor); dispatcher.Process(DispatcherType.GetMoveSpeed, D20DispatcherKey.NONE, dispIo); var movement = dispIo.bonlist.OverallBonus; if (movement < 0) { movement = 0; } if (dispIo.factor < 0.0) { dispIo.factor = 0.0f; } bonusList = dispIo.bonlist; if (dispIo.factor > 0.0f && dispIo.factor != 1.0f) { // Only return full 5 foot increments var remainingMovement = dispIo.factor * movement; return(MathF.Floor(remainingMovement / 5.0f) * 5.0f); } return(movement); } else { bonusList = BonusList.Default; return(30.0f); } }
public static float DispatchGetRunSpeed(this GameObject critter, out BonusList bonusList) { return(Dispatch41GetMoveSpeed(critter, out bonusList) * 4.0f); }
public static bool CheckSpellResistance(GameObject target, SpellPacketBody spellPkt) { // check spell immunity DispIoImmunity dispIo = DispIoImmunity.Default; dispIo.flag = 1; dispIo.spellPkt = spellPkt; if (!GameSystems.Spell.TryGetSpellEntry(spellPkt.spellEnum, out dispIo.spellEntry)) { return(false); } if (target.Dispatch64ImmunityCheck(dispIo)) { return(true); } // does spell allow saving? if (dispIo.spellEntry.spellResistanceCode != SpellResistanceType.Yes) { return(false); } // obtain bonuses // Defender bonus int srMod = target.Dispatch45SpellResistanceMod(dispIo.spellEntry); if (srMod <= 0) { return(false); } var bonlist = BonusList.Create(); var caster = spellPkt.caster; var casterLvlMod = caster.Dispatch35CasterLevelModify(spellPkt); bonlist.AddBonus(casterLvlMod, 0, 203); // TODO: Why are these feats not handled by subdispatchers for SpellResistanceCasterLevelCheck??? in the feat conditions if (caster.HasFeat(FeatId.SPELL_PENETRATION)) { bonlist.AddBonusFromFeat(2, 0, 114, FeatId.SPELL_PENETRATION); } if (caster.HasFeat(FeatId.GREATER_SPELL_PENETRATION)) { bonlist.AddBonusFromFeat(2, 0, 114, FeatId.GREATER_SPELL_PENETRATION); } // New Spell resistance mod caster.DispatchSpellResistanceCasterLevelCheck(target, bonlist, spellPkt); // do the roll and log the result to the D20 window var spellResistanceText = GameSystems.D20.Combat.GetCombatMesLine(5048); var dispelSpellResistanceResult = GameSystems.Spell.DispelRoll(spellPkt.caster, bonlist, 0, srMod, spellResistanceText, out var rollHistId); string outcomeText1, outcomeText2; if (dispelSpellResistanceResult < 0) { // fixed bug - was <= instead of < var spellName = GameSystems.Spell.GetSpellName(spellPkt.spellEnum); Logger.Info("CheckSpellResistance: Spell {0} cast by {1} resisted by target {2}.", spellName, GameSystems.MapObject.GetDisplayName(spellPkt.caster), GameSystems.MapObject.GetDisplayName(target)); GameSystems.Spell.FloatSpellLine(target, 30008, TextFloaterColor.White); GameSystems.Spell.PlayFizzle(target); outcomeText1 = GameSystems.D20.Combat.GetCombatMesLine(119); // Spell ~fails~[ROLL_ outcomeText2 = GameSystems.D20.Combat.GetCombatMesLine(120); // ] to overcome Spell Resistance } else { GameSystems.Spell.FloatSpellLine(target, 30009, TextFloaterColor.Red); outcomeText1 = GameSystems.D20.Combat.GetCombatMesLine(121); // Spell ~overcomes~[ROLL_ outcomeText2 = GameSystems.D20.Combat.GetCombatMesLine(122); // ] Spell Resistance } var histText = $"{outcomeText1}{rollHistId}{outcomeText2}\n\n"; GameSystems.RollHistory.CreateFromFreeText(histText); return(dispelSpellResistanceResult <= 0); }
public void UnRegisteBonus(BonusEntity bonusEntity) { BonusList.Remove(bonusEntity); }
public void RegisteBonus(BonusEntity bonusEntity) { BonusList.Add(bonusEntity); }
public override string Title => GameSystems.RollHistory.GetTranslation(64); // Bonus Detail public HistoryBonusDetail(BonusList bonusList, int mesLineId, int rollResult) { BonusList = bonusList; MesLineId = mesLineId; RollResult = rollResult; }
public void SetBonusList(BonusList bonusList) { bonus = bonusList; }
public Bonus(BonusList bonus, BonusType type, int value) { this.bonus = bonus.ToString(); this.type = type.ToString(); this.value = value; }
public void SetBonusList(BonusList list) { bonusgGenerator.SetBonusList(list); }