void Update () { if (Util.hit != null) { if ((tempBuff = Util.hit.GetComponent<Buff>()) != null) { if (hoverBuff == null || hoverBuff != tempBuff) { if (hoverBuff != null) { hoverBuff.setHover(false); } hoverBuff = tempBuff; itemDescriptor.showDescription(hoverBuff); hoverBuff.setHover(true); } } else if ((tempHolder = Util.hit.GetComponent<BuffEquipmentHolder>()) != null && tempHolder.getItem() != null) { if (hoverHolder == null || hoverHolder != tempHolder) { hoverHolder = tempHolder; itemDescriptor.showDescription(hoverHolder.getItem()); itemDescriptor.hideActionMsg(); if (hoverBuff != null) { hoverBuff.setHover(false); hoverBuff = null; } if (tempBuff != null) { tempBuff.setHover(false); tempHolder = null; } } } else { if (hoverBuff != null) { hoverBuff.setHover(false); hoverBuff = null; } if (tempBuff != null) { tempBuff.setHover(false); tempHolder = null; } if (itemDescriptor.isOnScreen()) { itemDescriptor.hideDescription(); } } } else { if (itemDescriptor.isOnScreen()) { itemDescriptor.hideDescription(); } if (tempBuff != null) { tempBuff.setHover(false); tempBuff = null; } if (hoverBuff != null) { hoverBuff.setHover(false); hoverBuff = null; } if (tempHolder != null) { tempHolder = null; } if (hoverHolder != null) { hoverHolder = null; } } if (Input.GetMouseButtonDown(1) && hoverBuff != null) { buyBuff(hoverBuff); itemDescriptor.showDescription(hoverBuff); } }
public void buffFinish(Character character, Buff self) { foreach(GameObject obj in desGameObjectList) { Destroy(obj); } }
public override bool Stack(Buff buff) { // not sure how knockbacks would be combined, so just swallow all knockback stacks for now // updated stacked buff with mover so arrival time can be read for would-be-stacked buff. ((KnockbackBuff)buff)._mover = _mover; return true; }
public override bool Stack(Buff buff) { if (((SimpleBooleanStatusDebuff)buff)._immuneBlocked) return true; // swallow buff if it was blocked return base.Stack(buff); }
public void PerformRitual(List<GameObject> items) { buff = new Buff[] { Buff.HEALTH_REGEN, Buff.HEALTH_REGEN, Buff.HEALTH_REGEN, Buff.REPAIR_TOWERS }[Random.Range(0, 4)]; message.setUIMessage("Ritual complete. " + (buff == Buff.HEALTH_REGEN ? "Regenerating health." : "Repairing towers."), 7); state = State.PERFORMING_RITUAL; timer = 5; }
private void cancelSkill_BETARAYBILL30A(Character character, Buff self) { GameObject caller = objs[1] as GameObject; BetaRayBill betaRayBill = caller.GetComponent<BetaRayBill>(); betaRayBill.isTrigger30A = false; Destroy(bodyLighting); }
public void AddBuffToStats(Buff buff) { if (buff != null) { this.buff.AddBuff (buff); this.stats.AddBuff (buff); } }
public void AddBuff(int buffID, StatServer firerStat, Buff.Handle onBuff, Buff.Handle onDebuff) { StatusEffectEntity2 buffEntity = TableLoader.GetTable<StatusEffectEntity2>().Get(buffID); CheckBuffType(buffEntity); Buff buff = new Buff(buffEntity, firerStat, onBuff, onDebuff); AddBuff(buff); }
public bool add(Buff buff) { if (buff == null) { System.Diagnostics.Debug.Assert (false); } buffs.Add (buff); return true; }
public TrinityBuff(Buff buff) { _buff = buff; InternalName = buff.InternalName; IsCancellable = buff.IsCancelable; StackCount = buff.StackCount; Id = buff.SNOId; }
public void ActivateAbility(Buff inBuff) { BuffInfo mod = inBuff.abilitiesModifier; for (int i = 0; i < buffNames.Length; ++i) { inBuff.SetBuff(buffNames[i], basePower, baseTime, infinite); } }
public override void addToBuffs (Buff buff) { base.addToBuffs(buff); switch (buff.getBuffType()) { case BuffType.POISON_DAMAGE: poisonDamage.gameObject.SetActive(true); break; case BuffType.FASTER_ATTACK: fasterAttack.gameObject.SetActive(true); break; default: Debug.Log("Unknown Buff Type"); break; } }
public bool isOn(Buff buff) { foreach (Buff b in buffs) { if (b.GetType() == buff.GetType()) { return true; } } return false; }
void Awake() { base.Init(); buff = new AimModeBuff(); aimLine = abilityOwner.gameObject.AddComponent<LineRenderer>(); aimLine.material = (Material) Resources.Load ("Characters/Alice/Abilities/AimMode/SniperColorMaterial"); aimLine.enabled = false; aimLine.SetWidth(0.1f, 0.1f); }
/// <summary> /// Creates a new instance of the CheatBuffContainer class /// </summary> /// <param name="i">The Buff of the CheatBuffContainer</param> public CheatBuffContainer(Buff i) { Buff = i; Tooltip = ""; if (Buff.ID > 0) Tooltip = Buff.DisplayName + "\n" + Buff.Tooltip; }
public void specialTechniquesOn(Buff buff) { Debug.Log ("Special On"); if (CoinCount < buff.NeedCoinCount) { return; } CoinCount -= buff.NeedCoinCount; buffContainer.add ((Buff)System.Activator.CreateInstance (buff.GetType ())); }
public bool RemoveBuff(Buff buff) { var removed = buffs.Remove(buff); if (removed) { buff.Unapply(self); } return removed; }
public override void addToBuffs (Buff buff) { base.addToBuffs(buff); switch (buff.getBuffType()) { case BuffType.ANTI_POISON: antiPoison.gameObject.SetActive(true); break; case BuffType.EXTRA_HEALTH: extraHealth.gameObject.SetActive(true); break; case BuffType.REGENERATION: regeneration.gameObject.SetActive(true); break; default: Debug.Log("Unknown Buff Type"); break; } }
public void buffFinish(Character character, Buff self) { StopCoroutine("changeSkillEft_MANTIS15A"); StopCoroutine("moveSkillEft_MANTIS15A1"); StopCoroutine("moveSkillEft_MANTIS15A2"); Destroy(skillEft_MANTIS15A); // character.hurtBeforeState = Character.HurtBeforeState.HURT; character.lossTargetBeforeState = Character.LossTargetBeforeState.NONE; }
protected void buffFinish(Character c, Buff self) { Destroy(shieldEft); Destroy(haloEft); for(int n = PopEftList.Count-1;n >= 0;n--){ Destroy(PopEftList[n].gameObject); } PopEftList.Clear(); }
/// <summary> /// Method applies areo of effect buffs to units. /// </summary> /// <param name="buff"> /// Buff to apply. /// </param> /// <param name="buffer"> /// Unit that "casted" the buff. /// <param name="self"> /// Indicates if buff should be applied to its caster. /// </param> public void SpawnBuff(Buff buff, Cell center, Unit buffer, int range, bool self) { foreach (var unit in unitsList.FindAll(u => u.PlayerNumber.Equals(buffer.PlayerNumber) && u.Cell.GetDistance(center) <= range)) { if (!self && unit.Equals(buffer)) continue; var _buff = buff.Clone(); unit.Buffs.Add(_buff); _buff.Apply(unit); } }
//-- -- -- -- -- public void Add( Buff buff ) { if( !buff.stackable ) { RemoveDuplicates( buff ); } list.Add( buff ); buff.OnApplied(); buff.TerminatedEvent += () => Remove( buff ); }
public override void OnActive(Buff buff) { Buff_Tbl buffTem = buff.Template; BuffParam param = buff.Param; Agent sender = AgentManager.Instance.Find(param.senderID); Agent receiver = AgentManager.Instance.Find(param.receiverID); if (receiver != null) { receiver.ReceiveHeal(sender, 10); } }
private void buffFinish(Character character, Buff self) { //character.attackAnimaName = "Attack"; if(character is Nebula){ Nebula nebula = character as Nebula; nebula.attackAnimaName = "Attack"; }else if(character is Ch2_Nebula){ Ch2_Nebula nebula = character as Ch2_Nebula; nebula.attackAnimaName = "Attack"; } }
public void buffFinish(Character character, Buff self) { foreach(GameObject buffEft in buffEftList){ Destroy(buffEft); } buffEftList.Clear(); foreach(Enemy e in EnemyMgr.enemyHash.Values){ e.addConcentrateFireDelegate -= addConcentrateFireDelegate; } }
// // Constructor that takes the data returned by the // GDEDataManager.Get() method and will now pull out the // individual fields using the TryGet() methods. // public Character(Dictionary<string, object> data) { if (data != null) { // Pull out the individual fields and load our Character stats. data.TryGetString("name", out Name); data.TryGetInt("hp", out baseHP); data.TryGetInt("mana", out baseMana); data.TryGetInt("damage", out baseDamage); // // Get the Buff list // // First get a string list of the buffs using TryGetStringList List<string> buffKeyList; if (data.TryGetStringList("buffs", out buffKeyList)) { // // Spin through each of the Buff names and pull out // the data with the GDEDataManager.Get() method. // Buffs = new List<Buff>(); foreach(string buffKey in buffKeyList) { // // Pull out Buff data with Get() method and pass // it down to the Buff classes constructor where // it will pull out the individual fields and set // it's properties. // Buff curBuff; Dictionary<string, object> curBuffData; GDEDataManager.Instance.Get(buffKey, out curBuffData); // // For each Buff in the string list create a new // object passing it the data from the Get() // method and add it to the Buff's list. // curBuff = new Buff(curBuffData); Buffs.Add(curBuff); // // Now that the Buff's properties have been set // from the data in the Buff's constructor add the // bonuses to the HP, Mana, and Damage. // bonusHP += curBuff.HPDelta; bonusMana += curBuff.ManaDelta; bonusDamage += curBuff.DamageDelta; } } } }
public override void OnEffect(Buff buff) { Buff_Tbl buffTem = buff.Template; BuffParam param = buff.Param; Agent sender = AgentManager.Instance.Find(param.senderID); Agent receiver = AgentManager.Instance.Find(param.receiverID); if (receiver != null) { receiver.ReceiveDamage(sender, buffTem.typePar1[0]); } }
public bool delete(Buff buff) { foreach (Buff b in buffs) { if (b.Equals (buff)) { buffs.Remove (buff); return true; } } System.Diagnostics.Debug.Assert (false); return false; }
public void ApplyBuff(Buff buffToSet) { Debug.Log ("Applying buff to stats"); for (int buffID = 0; buffID < buffs.Length; buffID++) { if (buffs[buffID] == null) { buffs[buffID] = buffToSet; Debug.Log ("Set buff successfully"); break; } } updateStatsRequired = true; }
private void BuffFinish(Character ch, Buff buf) { ch.currentColor = (Color)new Color32(128,128,128,255); ch.model.renderer.material.color = ch.currentColor; ch.isAtkSameTag = false; ch.setAbnormalState(Character.ABNORMAL_NUM.NORMAL); ch.checkOpponent(); Destroy(enemyBubbles[0]); enemyBubbles.RemoveAt(0); }
public void RemoveBuff(Buff b) { activeBuffs.Remove(b); buffBar.RemoveBuff(b); }
/// <summary>Every day: the general buff has to be readded.</summary> private void EveryDay(object sender, EventArgs e) { //Buffs are cleared at the start of every day, so the general buff is definitely not active: generalBuffActive = false; currentBuff = null; }
public static async Task <bool> Execute() { if (await Defensive.TankBusters()) { return(true); } if (BotManager.Current.IsAutonomous) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 4); } if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (await Buff.Oath()) { return(true); } if (Utilities.Routines.Paladin.OnGcd) { if (await Buff.Cover()) { return(true); } if (await Tank.Provoke(PaladinSettings.Instance)) { return(true); } if (await Defensive.Defensives()) { return(true); } if (await Buff.Intervention()) { return(true); } if (await Buff.DivineVeil()) { return(true); } if (await SingleTarget.Requiescat()) { return(true); } if (await Buff.FightOrFlight()) { return(true); } if (await SingleTarget.Interject()) { return(true); } if (await SingleTarget.SpiritsWithin()) { return(true); } if (await Aoe.CircleofScorn()) { return(true); } if (await SingleTarget.Intervene()) { return(true); } if (await Buff.Sheltron()) { return(true); } } if (await SingleTarget.ShieldBash()) { return(true); } if (await SingleTarget.ShieldLobLostAggro()) { return(true); } if (await Aoe.Confiteor()) { return(true); } if (await Aoe.HolyCircle()) { return(true); } if (await Aoe.TotalEclipse()) { return(true); } if (await SingleTarget.HolySpirit()) { return(true); } if (await SingleTarget.Atonement()) { return(true); } if (ActionManager.LastSpell == Spells.RiotBlade && Core.Me.ClassLevel > 25 && Core.Me.ClassLevel < 60) { var rageTarget = Utilities.Combat.Enemies.FirstOrDefault(r => r.TargetGameObject != Core.Me && ActionManager.CanCast(Spells.RageofHalone, r)); if (rageTarget == null || Group.CastableAlliesWithin30.Any(r => r.IsTank())) { return(await Spells.RageofHalone.Cast(Core.Me.CurrentTarget)); } return(await Spells.RageofHalone.Cast(rageTarget)); } #region Last Spell RiotBlade if (ActionManager.LastSpell == Spells.RiotBlade) { if (Core.Me.ClassLevel > 54 && !Core.Me.CurrentTarget.HasAura(Auras.GoringBlade, true, (PaladinSettings.Instance.RefreshGoringBlade) * 1000) && Core.Me.CurrentTarget.HealthCheck(PaladinSettings.Instance.HealthSetting, PaladinSettings.Instance.HealthSettingPercent)) { if (await Spells.GoringBlade.Cast(Core.Me.CurrentTarget)) { return(true); } } if (Core.Me.ClassLevel > 59) { return(await Spells.RoyalAuthority.Cast(Core.Me.CurrentTarget)); } return(await Spells.FastBlade.Cast(Core.Me.CurrentTarget)); } #endregion #region Last Spell FastBlade if (ActionManager.LastSpell == Spells.FastBlade) { // Low level just fast blade if (Core.Me.ClassLevel < 4) { return(await Spells.FastBlade.Cast(Core.Me.CurrentTarget)); } //// if we have RA and RA in shield oath is enabled riot blade //if (ActionManager.HasSpell(Spells.RoyalAuthority.Id)) //{ // if (PaladinSettings.Instance.RoyalAuthorityComboInShieldOath) // { // return await Spells.RiotBlade.Cast(Core.Me.CurrentTarget); // } //} if (!Core.Me.CurrentTarget.HasAura(Auras.GoringBlade, true, PaladinSettings.Instance.RefreshGoringBlade * 1000)) { return(await Spells.RiotBlade.Cast(Core.Me.CurrentTarget)); } if (Core.Me.ClassLevel >= 60) { return(await Spells.RiotBlade.Cast(Core.Me.CurrentTarget)); } return(false); } #endregion if (await Spells.FastBlade.Cast(Core.Me.CurrentTarget)) { return(true); } if (PaladinSettings.Instance.ShieldLobToPull && !Core.Me.InCombat) { return(await Spells.ShieldLob.Cast(Core.Me.CurrentTarget)); } if (PaladinSettings.Instance.HolySpiritWhenOutOfMeleeRange && Core.Me.ClassLevel >= 64 && await Spells.HolySpirit.Cast(Core.Me.CurrentTarget)) { return(true); } return(await SingleTarget.ShieldLob()); }
private void Update() { try { if (ModAPI.Input.GetButtonDown("EquipWeapon")) { if (Inventory.Instance.ItemList[-12] != null) { if (Inventory.Instance.ItemList[-12].Equipped) { PlayerInventoryMod.ToEquipWeaponType = Inventory.Instance.ItemList[-12].weaponModel; LocalPlayer.Inventory.StashEquipedWeapon(false); LocalPlayer.Inventory.Equip(80, false); PlayerInventoryMod.ToEquipWeaponType = BaseItem.WeaponModelType.None; } } } } catch (Exception e) { ModAPI.Log.Write("Custom Weapon error" + e.ToString()); } try { float dmgPerSecond = 0; int poisonCount = 0; int[] keys = new List <int>(BuffDB.activeBuffs.Keys).ToArray(); for (int i = 0; i < keys.Length; i++) { Buff buff = BuffDB.activeBuffs[keys[i]]; if (DebuffImmune && buff.isNegative && buff.DispellAmount <= 2) { BuffDB.activeBuffs[keys[i]].ForceEndBuff(keys[i]); } else if (DebuffResistant && buff.isNegative && buff.DispellAmount <= 1) { BuffDB.activeBuffs[keys[i]].ForceEndBuff(keys[i]); } else { BuffDB.activeBuffs[keys[i]].UpdateBuff(keys[i]); if (buff._ID == 3) { poisonCount++; dmgPerSecond += buff.amount; } } } if (dmgPerSecond != 0) { dmgPerSecond *= 1 - MagicResistance; LocalPlayer.Stats.Health -= dmgPerSecond * Time.deltaTime; LocalPlayer.Stats.HealthTarget -= dmgPerSecond * Time.deltaTime * 2; if (poisonCount > 1) { BuffDB.AddBuff(1, 33, 0.7f, 1); } } if (LocalPlayer.Stats.Health <= 0 && !LocalPlayer.Stats.Dead) { LocalPlayer.Stats.Hit(1000, true, PlayerStats.DamageType.Drowning); } } catch (Exception e) { ModAPI.Log.Write("Poisoning player error" + e.ToString()); } try { if (LocalPlayer.Stats != null) { ////LocalPlayer.Stats.Skills.BreathingSkillLevelBonus = 0.05f; //LocalPlayer.Stats.Skills.BreathingSkillLevelDuration = 1500000; //LocalPlayer.Stats.Skills.RunSkillLevelBonus = 0.05f; //LocalPlayer.Stats.Skills.RunSkillLevelDuration = 6000000; //LocalPlayer.Stats.Skills.TotalRunDuration = 0; //LocalPlayer.Stats.PhysicalStrength.CurrentStrength = 10; if (LocalPlayer.Stats.Health < MaxHealth) { if (LocalPlayer.Stats.Health < LocalPlayer.Stats.HealthTarget) { LocalPlayer.Stats.Health += LifeRegen * (HealthRegenPercent + 1) * HealingMultipier; } else { LocalPlayer.Stats.Health += LifeRegen * (HealthRegenPercent + 1) * HealingMultipier / 10; } } if (Clock.Day > LastDayOfGeneration) { for (int i = 0; i < Clock.Day - LastDayOfGeneration; i++) { foreach (KeyValuePair <int, int> pair in GeneratedResources) { LocalPlayer.Inventory.AddItem(pair.Key, pair.Value); } } LastDayOfGeneration = Clock.Day; } } } catch (Exception e) { ModAPI.Log.Write("Stats error" + e.ToString()); } try { if (TimeUntillMassacreReset > 0) { TimeUntillMassacreReset -= Time.unscaledDeltaTime; if (TimeUntillMassacreReset <= 0) { AddFinalExperience(Convert.ToInt64((double)NewlyGainedExp * MassacreMultipier)); NewlyGainedExp = 0; TimeUntillMassacreReset = 0; MassacreKills = 0; CountMassacre(); } } } catch (Exception e) { ModAPI.Log.Write("Massacre error" + e.ToString()); } if (Rooted) { if (StunImmune || RootImmune) { Rooted = false; } RootDuration -= Time.deltaTime; if (RootDuration < 0) { Rooted = false; } } if (Stunned) { if (StunImmune) { Stunned = false; LocalPlayer.FpCharacter.Locked = false; LocalPlayer.FpCharacter.MovementLocked = false; LocalPlayer.FpCharacter.CanJump = true; } StunDuration -= Time.deltaTime; if (StunDuration < 0) { Stunned = false; LocalPlayer.FpCharacter.Locked = false; LocalPlayer.FpCharacter.MovementLocked = false; LocalPlayer.FpCharacter.CanJump = true; } } if (HexedPantsOfMrM_Enabled) { if (LocalPlayer.FpCharacter.velocity.sqrMagnitude < 0.1)//if standing still { HexedPantsOfMrM_StandTime = Mathf.Clamp(HexedPantsOfMrM_StandTime - Time.deltaTime, -1.1f, 1.1f); if (HexedPantsOfMrM_StandTime <= 1) { if (LocalPlayer.Stats.Health > 5) { LocalPlayer.Stats.Health -= Time.deltaTime * MaxHealth * 0.015f; } } } else //if moving { HexedPantsOfMrM_StandTime = Mathf.Clamp(HexedPantsOfMrM_StandTime + Time.deltaTime, -1.1f, 1.1f); if (HexedPantsOfMrM_StandTime >= 1) { AddBuff(9, 41, 1.2f, 1f); AddBuff(11, 42, 1.2f, 1f); } } } if (DeathPact_Enabled) { DamageOutputMult /= DeathPact_Amount; DeathPact_Amount = 1 + Mathf.RoundToInt((1 - (LocalPlayer.Stats.Health / MaxHealth)) * 100) * 0.03f; AddBuff(12, 43, DeathPact_Amount - 1, 1f); DamageOutputMult *= DeathPact_Amount; } }
/// <summary> 배틀 진행 </summary> IEnumerator BattleProcess() { if (onStartBattle != null) { onStartBattle(); } float startTime = Time.time; float elapsedTime = 0f; ////페이드인 battlePhase = BattlePhase.FadeIn; fadeInProcess = 0f; while (elapsedTime < battleFadeInTime) { fadeInProcess = elapsedTime / battleFadeInTime; elapsedTime = Time.time - startTime; yield return(null); } fadeInProcess = 1f; //전투 준비 battlePhase = BattlePhase.Ready; //전투 battlePhase = BattlePhase.Battle; //영웅들 하나씩 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Red))); //상대 팀 출전 yield return(StartCoroutine(SpawnHero(BattleUnit.Team.Blue))); //스테이지 시작 trigger for (int i = 0; i < redTeamList.Count; i++) { BattleHero hero = redTeamList[i]; for (int a = 0; a < hero.buffController.buffList.Count; a++) { Buff buff = hero.buffController.buffList[a]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } for (int i = 0; i < blueTeamList.Count; i++) { BattleHero hero = blueTeamList[i]; // 던전 버프 적용 string key = UIDayDungeonLobby.Instance.currentTapDay.ToString() + "_" + UIDayDungeonLobby.Instance.dungeonLevel; if (GameDataManager.dayDungeonBaseDataDic.ContainsKey(key)) { DayDungeonBaseData data = GameDataManager.dayDungeonBaseDataDic[key]; hero.buffController.AttachBuff(hero, data.buffID); } for (int a = 0; a < hero.buffController.buffList.Count; a++) { Buff buff = hero.buffController.buffList[a]; if (buff.baseData.trigger != "OnStartStage") { continue; } if (buff.triggerProbability < UnityEngine.Random.Range(1, 10001)) { continue; } BattleUnit target = null; if (buff.baseData.triggerTarget == "SkillTarget") { target = hero; } else if (buff.baseData.triggerTarget == "BuffTarget") { target = hero; } if (target && !target.isDie) { target.buffController.AttachBuff(hero, buff.baseData.triggerBuff, 1, buff); } } } // 전투 시작 시간 체크 pvpStartTime = Time.time + pvpTime; LoadingManager.Close(); isWin = false; //아군 혹은 적군 전부 사망할 때 까지 전투 상태 while (battlePhase == BattlePhase.Battle) { if (battleTeamList[0].isAllDie) { break; } if (battleTeamList[1].isAllDie) { isWin = true; break; } pvpReminingTime = pvpStartTime - Time.time; if (isGiveUp) { isWin = false; break; } if (pvpReminingTime <= 0) { // 남은 체력 비교 if (CompareHp()) { isWin = true; } break; } yield return(null); } battlePhase = BattlePhase.Finish; //yield return new WaitForSeconds(2f); //페이드아웃 battlePhase = BattlePhase.FadeOut; startTime = Time.time; elapsedTime = 0f; fadeOutProcess = 0f; while (elapsedTime < battleFadeOutTime) { fadeOutProcess = elapsedTime / battleFadeOutTime; elapsedTime = Time.time - startTime; yield return(null); } fadeOutProcess = 1f; if (isWin) { BattleDayDungeonManager.DayDungeonServerConnect(DayDungeonServerConnectType.BattleResult, ServerResult); } else { BattleEnd(); } yield break; }
public void NotifyEditBuff(Buff b, int stacks) { var edit = new EditBuff(b.TargetUnit, b.Slot, (byte)b.Stacks); _game.PacketHandlerManager.broadcastPacket(edit, Channel.CHL_S2C); }
public static async Task <bool> Execute() { if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, Core.Me.ClassLevel < 2 ? 3 : 20); } } bool FinisherReady() { if (Casting.SpellCastHistory.Take(5).Any(s => s.Spell == Spells.Verflare || s.Spell == Spells.Verholy)) { return(false); } return(Casting.SpellCastHistory.Take(5).Any(s => s.Spell == Spells.Redoublement)); } if (Core.Me.ClassLevel >= Spells.Verflare.LevelAcquired && FinisherReady() && (BlackMana <= 20 || WhiteMana <= 20)) { await SingleTarget.Displacement(); if (await SingleTarget.Verholy()) { return(true); } return(await SingleTarget.Verflare()); } if (await SingleTarget.Scorch()) { return(true); } if (await Buff.Embolden()) { return(true); } if (await Buff.Manafication()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (Utilities.Routines.RedMage.OnGcd && Casting.LastSpell != Spells.CorpsACorps) { if (await Aoe.ContreSixte()) { return(true); } if (await SingleTarget.Fleche()) { return(true); } } if (RedMageSettings.Instance.UseAoe) { if (await Aoe.Moulinet()) { return(true); } if (await Aoe.Scatter()) { return(true); } if (await Aoe.Veraero2()) { return(true); } if (await Aoe.Verthunder2()) { return(true); } } if (await SingleTarget.CorpsACorps()) { return(true); } if (await SingleTarget.Redoublement()) { return(true); } if (await SingleTarget.Zwerchhau()) { return(true); } if (await SingleTarget.Riposte()) { return(true); } if (await SingleTarget.Displacement()) { return(true); } if (await SingleTarget.Engagement()) { return(true); } if (Casting.LastSpell == Spells.CorpsACorps) { return(true); } if (await SingleTarget.Verstone()) { return(true); } if (await SingleTarget.Verfire()) { return(true); } if (await SingleTarget.Veraero()) { return(true); } if (await SingleTarget.Verthunder()) { return(true); } if (await Buff.Acceleration()) { return(true); } return(await SingleTarget.Jolt()); }
public void HandleSkillActivate(SkillArg arg) { if (arg.Caster.Tasks.ContainsKey("SwordBlocking")) { Buff buff = arg.Caster.Tasks["SwordBlocking"] as Buff; buff.Deactivate(); } Buff add = new Buff(arg.Caster, "SwordBlocking", arg.Skill.BaseData.Duration); Map.Map map = MapManager.Instance.GetMap(arg.Caster.MapInstanceID); add.OnAdditionStart += (actor, addition) => { ((ActorExt)actor).Status.Blocking = true; UpdateEvent evt = new UpdateEvent() { Actor = actor, AdditionSession = 20481, Target = actor, Skill = arg.Skill, AdditionID = motion, SkillSession = arg.SkillSession, ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Activate, UpdateType = UpdateTypes.Actor }; //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.BlockingStance, 1); map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true); evt = new UpdateEvent() { Actor = actor, AdditionSession = 20481, SkillSession = arg.SkillSession }; if (motion > 0) { evt.AdditionID = motion; } else { evt.AdditionID = arg.Skill.ID < 1000000 ? (arg.Skill.ID * 1000 + 11) : (arg.Skill.ID * 10 + 1); } evt.RestTime = arg.Skill.BaseData.Duration; evt.UpdateType = UpdateTypes.ActorExtension; map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true); }; add.OnAdditionEnd += (actor, addition, cancel) => { ((ActorExt)actor).Status.Blocking = false; ((ActorExt)actor).Tasks.TryRemove("SwordBlocking", out Task removed); UpdateEvent evt = new UpdateEvent() { Actor = actor, Target = actor, AdditionSession = 20481, AdditionID = motion, Skill = arg.Skill, ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel, SkillSession = arg.SkillSession, UpdateType = UpdateTypes.Actor, UserData = new byte[] { 9, 1, 0 } }; //evt.AddActorPara(SagaBNS.Common.Packets.GameServer.PacketParameter.BlockingStance, 0); map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true); evt = new UpdateEvent() { Actor = actor, AdditionSession = 20481, SkillSession = arg.SkillSession }; if (motion > 0) { evt.AdditionID = motion; } else { evt.AdditionID = arg.Skill.ID < 1000000 ? (arg.Skill.ID * 1000 + 11) : (arg.Skill.ID * 10 + 1); } evt.ExtraActivateMode = UpdateEvent.ExtraUpdateModes.Cancel; evt.UpdateType = UpdateTypes.ActorExtension; map.SendEventToAllActorsWhoCanSeeActor(MapEvents.EVENT_BROADCAST, evt, actor, true); SkillManager.Instance.BroadcastSkillCast(arg, SkillMode.End); }; arg.Caster.Tasks["SwordBlocking"] = add; add.Activate(); }
void Update() { Player player = Player.localPlayer; if (player != null) { // show nextTarget > target // => feels best in situations where we select another target while // casting a skill on the existing target. // => '.target' doesn't change while casting, but the UI gives the // illusion that we already targeted something else // => this is also great for skills that change the target while casting, // e.g. a buff that is cast on 'self' even though we target an 'npc. // this way the player doesn't see the target switching. // => this is how most MMORPGs do it too. Entity target = player.nextTarget ?? player.target; if (target != null && target != player) { float distance = Utils.ClosestDistance(player, target); // name and health panel.SetActive(true); healthSlider.value = target.health.Percent(); nameText.text = target.name; // target buffs UIUtils.BalancePrefabs(buffSlotPrefab.gameObject, target.skills.buffs.Count, buffsPanel); for (int i = 0; i < target.skills.buffs.Count; ++i) { Buff buff = target.skills.buffs[i]; UIBuffSlot slot = buffsPanel.GetChild(i).GetComponent <UIBuffSlot>(); // refresh slot.image.color = Color.white; slot.image.sprite = buff.image; // only build tooltip while it's actually shown. this // avoids MASSIVE amounts of StringBuilder allocations. if (slot.tooltip.IsVisible()) { slot.tooltip.text = buff.ToolTip(); } slot.slider.maxValue = buff.buffTime; slot.slider.value = buff.BuffTimeRemaining(); } // trade button if (target is Player) { tradeButton.gameObject.SetActive(true); tradeButton.interactable = player.trading.CanStartTradeWith(target); tradeButton.onClick.SetListener(() => { player.trading.CmdSendRequest(); }); } else { tradeButton.gameObject.SetActive(false); } // guild invite button if (target is Player targetPlayer && player.guild.InGuild()) { guildInviteButton.gameObject.SetActive(true); guildInviteButton.interactable = !targetPlayer.guild.InGuild() && player.guild.guild.CanInvite(player.name, target.name) && NetworkTime.time >= player.nextRiskyActionTime && distance <= player.interactionRange; guildInviteButton.onClick.SetListener(() => { player.guild.CmdInviteTarget(); }); } else { guildInviteButton.gameObject.SetActive(false); } // party invite button if (target is Player targetPlayer2) { partyInviteButton.gameObject.SetActive(true); partyInviteButton.interactable = (!player.party.InParty() || !player.party.party.IsFull()) && !targetPlayer2.party.InParty() && NetworkTime.time >= player.nextRiskyActionTime && distance <= player.interactionRange; partyInviteButton.onClick.SetListener(() => { player.party.CmdInvite(target.name); }); } else { partyInviteButton.gameObject.SetActive(false); } } else { panel.SetActive(false); } }
/// <summary>Updates the current speed boost based on the player's location.</summary> private void UpdateTick(object sender, EventArgs e) { //We don't want to modify anything if the player can't move, game is paused, or if the game is inactive: if (!Context.CanPlayerMove || Game1.paused || !Game1.game1.IsActive) { return; } Buff newBoost = GetBoost(); if (newBoost == null) { //currentBuff is only set if we are managing the speed buffs differently due to ShowStatusEffect being //false. if (currentBuff != null && !config.ShowStatusEffect) { currentBuff.removeBuff(); //Game1.player.buffs.Remove(currentBuff); currentBuff = null; } //If the general buff isn't active, then that means we need to add it: if (!generalBuffActive && config.GeneralBoost != 0) { generalBuff.addBuff(); //Game1.player.buffs.Add(generalBuff); generalBuffActive = true; } } else { //Remove the general buff if it is active: if (generalBuffActive && config.GeneralBoost != 0) { //Game1.player.buffs.Remove(generalBuff); generalBuff.removeBuff(); generalBuffActive = false; } if (config.ShowStatusEffect) { //To prevent the display from removing the buff: newBoost.millisecondsDuration = 0; //Add the buff, which the display will already remove the old one and add this one: Game1.buffsDisplay.addOtherBuff(newBoost); currentBuff = newBoost; //If we are not showing status effects to the player, we have to manage the boosts in a different way: } else if (currentBuff != newBoost) { if (currentBuff != null) { currentBuff.removeBuff(); //Game1.player.buffs.Remove(currentBuff); } //Game1.player.buffs.Add(newBoost); newBoost.addBuff(); currentBuff = newBoost; } } }
public override void OnTurnOff() { appliedBuff?.Remove(); appliedBuff = null; }
protected override void RemoveBuffEffect(Unit affectedUnit, Buff buff) { affectedUnit.StatsManager.AttackSpeed.RemovePercentBonus(buff.BuffValue); }
private void BuildMouseDetailUi() { var detail = CreateRootEntity(Camera2D.SortUI + 100); var bg = _assetManager[AssetManager.MobDetailBg]; detail.Renderer = new SpriteRenderer(bg); detail.AddComponent(() => detail.Position = new Vector2(bg.Width, 1024 - bg.Height)); var labelHp = detail.AddChild(new Label(() => { var mob = Camera2D.Instance.CachedMouseMob(_game); if (mob != null) { return($"{mob.MobInstance.Hp}/{mob.MobInfo.MaxHp}"); } else { return("NOMOB"); } }, _assetManager.AbilityFont, Color.White)); labelHp.Position = new Vector2(95, 60); var labelAp = detail.AddChild(new Label(() => { var mob = Camera2D.Instance.CachedMouseMob(_game); if (mob != null) { return($"{mob.MobInstance.Ap}/{mob.MobInfo.MaxAp}"); } else { return("NOMOB"); } }, _assetManager.AbilityFont, Color.White)); labelAp.Position = new Vector2(95, 138); var labelBuff = detail.AddChild(new Label(() => { var mob = Camera2D.Instance.CachedMouseMob(_game); if (mob != null) { return ($"{mob.MobInstance.Buff.HpChange}/{mob.MobInstance.Buff.ApChange} ({mob.MobInstance.Buff.Lifetime} turns)"); } else { return("NOMOB"); } }, _assetManager.AbilityFont, Color.White)); labelBuff.Position = new Vector2(300, 95); var labelAreaBuff = detail.AddChild(new Label(() => { var mob = Camera2D.Instance.CachedMouseMob(_game); if (mob != null) { var areaBuffs = _game.State.BuffsAt(mob.MobInstance.Coord); var areaBuff = areaBuffs.Aggregate(Buff.ZeroBuff(), Buff.Combine); return ($"{areaBuff.HpChange}/{areaBuff.ApChange} ({areaBuff.Lifetime} turns)"); } else { return("NOMOB"); } }, _assetManager.AbilityFont, Color.White)); labelAreaBuff.Position = new Vector2(300, 143); var labelCoord = detail.AddChild(new Label(() => Camera2D.Instance.MouseHex.ToString(), _assetManager.AbilityFont, Color.White)); labelCoord.Position = new Vector2(530, 150); var labelDistance = detail.AddChild(new Label(() => { var mob = _game.CurrentCachedMob; var mouseHex = Camera2D.Instance.MouseHex; if (mob != null && _game.Pathfinder.IsValidCoord(mouseHex)) { return(_game.Pathfinder.Distance(mob.MobInstance.Coord, mouseHex).ToString()); } else { return(""); } }, _assetManager.AbilityFont, Color.White)); labelDistance.Position = new Vector2(130, 95); var labelEmptyAreaBuff = detail.AddChild(new Label(() => { var mouseHex = Camera2D.Instance.MouseHex; if (_game.Pathfinder.IsValidCoord(mouseHex)) { var areaBuffs = _game.State.BuffsAt(mouseHex); var areaBuff = areaBuffs.Aggregate(Buff.ZeroBuff(), Buff.Combine); return ($"{areaBuff.HpChange}/{areaBuff.ApChange} ({areaBuff.Lifetime} turns)"); } else { return("INVALID COORD"); } }, _assetManager.AbilityFont, Color.White)); labelEmptyAreaBuff.Position = new Vector2(323, 120); detail.AddComponent(() => { var mouseHex = Camera2D.Instance.MouseHex; if (_game.Pathfinder.IsValidCoord(mouseHex)) { var mobId = _game.State.AtCoord(mouseHex, true); if (mobId == null) { labelHp.Active = false; labelAp.Active = false; labelBuff.Active = false; labelAreaBuff.Active = false; if (_game.Map[mouseHex] == HexType.Wall) { labelEmptyAreaBuff.Active = false; labelDistance.Active = false; detail.Renderer = new SpriteRenderer(_assetManager[AssetManager.MobDetailBgStone]); } else { labelEmptyAreaBuff.Active = true; labelDistance.Active = true; detail.Renderer = new SpriteRenderer(_assetManager[AssetManager.MobDetailBgEmpty]); } } else { labelHp.Active = true; labelAp.Active = true; labelBuff.Active = true; labelAreaBuff.Active = true; labelEmptyAreaBuff.Active = false; labelDistance.Active = false; detail.Renderer = new SpriteRenderer(_assetManager[AssetManager.MobDetailBg]); } } else { labelEmptyAreaBuff.Active = false; labelDistance.Active = false; detail.Renderer = new SpriteRenderer(_assetManager[AssetManager.MobDetailBgStone]); labelHp.Active = false; labelAp.Active = false; labelBuff.Active = false; labelAreaBuff.Active = false; } }); }
private void SendAddBuff(int senderId, Buff buff) => _packetFactory.SendAddBuff(GameSession.Client, buff.Id, buff.Skill.SkillId, buff.Skill.SkillLevel, buff.CountDownInSeconds);
public void AddBuff(Buff b) { buffs.Add(b); }
protected override ImportFunction[] ParseTarget() { if (_importDescriptors == null) { return(null); } var impFuncs = new List <ImportFunction>(); var sizeOfThunk = (uint)(_is64Bit ? 0x8 : 0x4); // Size of IMAGE_THUNK_DATA var ordinalBit = _is64Bit ? 0x8000000000000000 : 0x80000000; var ordinalMask = (ulong)(_is64Bit ? 0x7FFFFFFFFFFFFFFF : 0x7FFFFFFF); var iat = _dataDirectories[(int)DataDirectoryIndex.IAT]; foreach (var idesc in _importDescriptors) { var dllAdr = idesc.Name.RVAtoFileMapping(_sectionHeaders); var dll = Buff.GetCString(dllAdr); if (IsModuleNameTooLong(dll)) { continue; } var tmpAdr = idesc.OriginalFirstThunk != 0 ? idesc.OriginalFirstThunk : idesc.FirstThunk; if (tmpAdr == 0) { continue; } var thunkAdr = tmpAdr.RVAtoFileMapping(_sectionHeaders); uint round = 0; while (true) { var t = new IMAGE_THUNK_DATA(Buff, thunkAdr + round * sizeOfThunk, _is64Bit); var iatOffset = idesc.FirstThunk + round * sizeOfThunk - iat.VirtualAddress; if (t.AddressOfData == 0) { break; } // Check if import by name or by ordinal. // If it is an import by ordinal, the most significant bit of "Ordinal" is "1" and the ordinal can // be extracted from the least significant bits. // Else it is an import by name and the link to the IMAGE_IMPORT_BY_NAME has to be followed if ((t.Ordinal & ordinalBit) == ordinalBit) // Import by ordinal { impFuncs.Add(new ImportFunction(null, dll, (ushort)(t.Ordinal & ordinalMask), iatOffset)); } else // Import by name { var ibn = new IMAGE_IMPORT_BY_NAME(Buff, ((uint)t.AddressOfData).RVAtoFileMapping(_sectionHeaders)); impFuncs.Add(new ImportFunction(ibn.Name, dll, ibn.Hint, iatOffset)); } round++; } } return(impFuncs.ToArray()); }
/// <summary> /// Таймер исчезновения взрыва /// </summary> void _secondTimer_Completed(object sender, object e) { if (!_unit.Dead && !_unit.Silenced && !_unit.Hexed) { _secondTimer.Completed -= _secondTimer_Completed; _secondTimer = null; ///Тут кординаты ячеек в которых действует тучка _callsPointl = new List <Point>(); Buff buff = _unit.Buffs.FirstOrDefault(p => p.Name == "SoulCount"); if (buff != null) { ///Получаем ячейки которые находятся перед героем ///использывавшим тучку ///Сначала добавляем ячеку с героем int xNew = _unit.PositionX; int yNew = _unit.PositionY; xNew = xNew - 1; Map_Cell call = _map.Calls.FirstOrDefault(p => p.IndexLeft == xNew && p.IndexTop == yNew); if (call != null && !call.Block) { SoulCreator(EAngel.Left, buff); } xNew = _unit.PositionX; yNew = _unit.PositionY; xNew = xNew + 1; Map_Cell callR = _map.Calls.FirstOrDefault(p => p.IndexLeft == xNew && p.IndexTop == yNew); if (callR != null && !callR.Block) { SoulCreator(EAngel.Right, buff); } xNew = _unit.PositionX; yNew = _unit.PositionY; yNew = yNew - 1; Map_Cell callT = _map.Calls.FirstOrDefault(p => p.IndexLeft == xNew && p.IndexTop == yNew); if (callT != null && !callT.Block) { SoulCreator(EAngel.Top, buff); } xNew = _unit.PositionX; yNew = _unit.PositionY; yNew = yNew + 1; Map_Cell callB = _map.Calls.FirstOrDefault(p => p.IndexLeft == xNew && p.IndexTop == yNew); if (callB != null && !callB.Block) { SoulCreator(EAngel.Bottom, buff); } } } if (_player != null) { (_player.GameObject.View as UC_Player).ShowEffect(5, false); } _unit.UnitFrozen = false; }
public void RemoveBuff(Buff b) { buffs.Remove(b); needsUpdate = true; }
private void CreateBullet(EAngel angel, int mode, double speed, Buff buff) { Bullet bullArrow = new Bullet(); bullArrow.GameObject = new Game_Object_In_Call() { EnumCallType = EnumCallType.Bullet, }; ///Создаем визуальный объект стрела UC_Sf_Ult arrow = new UC_Sf_Ult(); arrow.ChengAngel(_unit.Angel); bullArrow.GameObject.View = arrow; bullArrow.UnitUsed = _unit; bullArrow.PositionX = _unit.PositionX; bullArrow.PositionY = _unit.PositionY; bullArrow.Speed = speed; if (buff.SoulCount > _damageMagic) { bullArrow.DemageMagic = buff.SoulCount; } else { bullArrow.DemageMagic = _damageMagic; } //UnitGenerator.MKB_Bush(bullArrow, _unit); ///Магический урон зависит от прокача стрел //bullArrow.DemageMagic = 5 * (int)property; bullArrow.MinusArmor = 3; bullArrow.SpeedSlow = 0.3; bullArrow.Mode = mode; bullArrow.CurrentMap = _map; bullArrow.Angel = angel; SPB_Item_Maelstrom mel = new SPB_Item_Maelstrom() { Name = "Fly" }; mel.HitCount = 10; mel.IsSfUlt = true; bullArrow.Range = 3; ///Поведение такое же как у стрел боника bullArrow.Spells.Add(mel); ///И его же добавим в масив всех объектов _map.GameObjectInCall.Add(bullArrow.GameObject); Canvas.SetLeft(bullArrow.GameObject.View, bullArrow.PositionX * 50); Canvas.SetTop(bullArrow.GameObject.View, bullArrow.PositionY * 50); ///Отображение _map.MapCanvas.Children.Add(bullArrow.GameObject.View); bullArrow.UseSpall("Fly"); }
public void removeBuff(Buff buff) { buffs.Remove(buff); }
public static async Task <bool> Execute() { if (await Chocobo.HandleChocobo()) { return(true); } Group.UpdateAllies(Utilities.Routines.Astrologian.GroupExtension); Globals.HealTarget = Group.CastableAlliesWithin30.OrderBy(x => x.CurrentHealthPercent).FirstOrDefault(); if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Casting.DoHealthChecks = false; Globals.InParty = PartyManager.IsInParty || Globals.InGcInstance; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2) || Core.Me.InCombat; Globals.OnPvpMap = Core.Me.OnPvpMap(); if (Duty.State() == Duty.States.Ended) { return(false); } if (await GambitLogic.Gambit()) { return(true); } if (Globals.OnPvpMap) { if (await Pvp.EssentialDignity()) { return(true); //Heal } if (await Pvp.Purify()) { return(true); //Dispel/Heal } if (await Pvp.Muse()) { return(true); //Self-Buff } if (await Pvp.Lightspeed()) { return(true); //CombatBuff } if (await Pvp.Synastry()) { return(true); //Heal } if (await Pvp.Deorbit()) { return(true); //Heal } if (await Pvp.EmpyreanRain()) { return(true); //Heal } if (await Pvp.Recuperate()) { return(true); //Self-Heal } if (await Pvp.Benefic2()) { return(true); //Heal } if (await Pvp.Benefic()) { return(true); //Heal } if (await Pvp.Concentrate()) { return(true); //CombatBuff/Heal } if (await Pvp.Safeguard()) { return(true); //CombatBuff/Shield } return(false); } if (Globals.PartyInCombat && Globals.InParty) { if (await TankBusters.Execute()) { return(true); } } if (await Logic.Astrologian.Heal.Ascend()) { return(true); } // Scalebound Extreme Rathalos if (Core.Me.HasAura(1495)) { if (await Dispel.Execute()) { return(true); } return(false); } if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Dispel.Execute()) { return(true); } if (await Buff.LucidDreaming()) { return(true); } if (await Buff.Lightspeed()) { return(true); } if (await Buff.Synastry()) { return(true); } if (await Buff.CelestialOpposition()) { return(true); } if (DutyManager.InInstance || Core.Me.InCombat) { if (Globals.InParty) { if (await Logic.Astrologian.Heal.EssentialDignity()) { return(true); } if (await Logic.Astrologian.Heal.AspectedHelios()) { return(true); } if (await Logic.Astrologian.Heal.CollectiveUnconscious()) { return(true); } if (await Logic.Astrologian.Heal.Helios()) { return(true); } if (await Logic.Astrologian.Heal.LadyofCrowns()) { return(true); } if (await Logic.Astrologian.Heal.Benefic2()) { return(true); } } if (await Logic.Astrologian.Heal.Benefic()) { return(true); } if (await Logic.Astrologian.Heal.AspectedBenefic()) { return(true); } if (await Logic.Astrologian.Heal.EarthlyStar()) { return(true); } } if (await Logic.Astrologian.Heal.LadyofCrowns()) { return(true); } return(await Logic.Astrologian.Heal.Benefic()); }
private void SendTargetRemoveBuff(IKillable target, Buff buff) => _packetFactory.SendTargetRemoveBuff(GameSession.Client, target.Id, buff, target is Mob);
public void ShowDesc(Buff rBuff) { desc.SafeSetActive(buff?.ID == rBuff?.ID); }
private void SendRemoveBuff(int senderId, Buff buff) => _packetFactory.SendRemoveBuff(GameSession.Client, buff.Id);
public override void OnDurationUpdate(Sprite Affected, Buff buff) { base.OnDurationUpdate(Affected, buff); }
public void RegisterForVisualReAddOnTroop(Buff buff) { this.AddUniqueRetryBuffToList(buff); Service.Get <EventManager>().RegisterObserver(this, this.troopLoadedEvent, EventPriority.Default); }
private void Initialize(BinaryReader Reader, long CmdPtr) { int Word0 = Reader.ReadInt32(); int Word1 = Reader.ReadInt32(); Type = (IpcMessageType)(Word0 & 0xffff); int PtrBuffCount = (Word0 >> 16) & 0xf; int SendBuffCount = (Word0 >> 20) & 0xf; int RecvBuffCount = (Word0 >> 24) & 0xf; int XchgBuffCount = (Word0 >> 28) & 0xf; int RawDataSize = (Word1 >> 0) & 0x3ff; int RecvListFlags = (Word1 >> 10) & 0xf; bool HndDescEnable = ((Word1 >> 31) & 0x1) != 0; if (HndDescEnable) { HandleDesc = new IpcHandleDesc(Reader); } for (int Index = 0; Index < PtrBuffCount; Index++) { PtrBuff.Add(new IpcPtrBuffDesc(Reader)); } void ReadBuff(List <IpcBuffDesc> Buff, int Count) { for (int Index = 0; Index < Count; Index++) { Buff.Add(new IpcBuffDesc(Reader)); } } ReadBuff(SendBuff, SendBuffCount); ReadBuff(ReceiveBuff, RecvBuffCount); ReadBuff(ExchangeBuff, XchgBuffCount); RawDataSize *= 4; long RecvListPos = Reader.BaseStream.Position + RawDataSize; long Pad0 = GetPadSize16(Reader.BaseStream.Position + CmdPtr); Reader.BaseStream.Seek(Pad0, SeekOrigin.Current); int RecvListCount = RecvListFlags - 2; if (RecvListCount == 0) { RecvListCount = 1; } else if (RecvListCount < 0) { RecvListCount = 0; } RawData = Reader.ReadBytes(RawDataSize); Reader.BaseStream.Seek(RecvListPos, SeekOrigin.Begin); for (int Index = 0; Index < RecvListCount; Index++) { RecvListBuff.Add(new IpcRecvListBuffDesc(Reader)); } }
// Constructor protected AbstractBuffSimulator(ParsedEvtcLog log, Buff buff) { Buff = buff; Log = log; }
public void NotifyAddBuff(Buff b) { var add = new AddBuff(b.TargetUnit, b.SourceUnit, b.Stacks, b.Duration, b.BuffType, b.Name, b.Slot); _game.PacketHandlerManager.broadcastPacket(add, Channel.CHL_S2C); }
public BuffDesc(Buff item) { Name = item.Name; Icon = item.Link; Stacking = item.Type == Buff.BuffType.Intensity; }