private Boolean UpdateBuff(Party p_party, EPartyBuffs p_buff, ECharacterSpell p_castSpellToSet) { if (p_party.Buffs.HasBuff(p_buff)) { m_BuffAppliedBySpellMap.Add(p_buff.ToString(), p_castSpellToSet.ToString()); OnBuffEvent(p_party.Buffs.GetBuff(p_buff), null); return(true); } return(false); }
public PartyBuff GetBuff(EPartyBuffs p_buffId) { for (Int32 i = m_buffs.Count - 1; i >= 0; i--) { if (m_buffs[i].StaticData.StaticID == (Int32)p_buffId) { return(m_buffs[i]); } } return(null); }
public Boolean HasBuff(EPartyBuffs p_buffId) { for (Int32 i = m_buffs.Count - 1; i >= 0; i--) { if (m_buffs[i].StaticData.StaticID == (Int32)p_buffId) { return(true); } } return(false); }
public override void Load(SaveGameData p_data) { base.Load(p_data); m_partyBuff = p_data.Get <EPartyBuffs>("PartyBuff", EPartyBuffs.NONE); m_special = p_data.Get <ERechargerSpecial>("Special", ERechargerSpecial.NONE); m_rechargerType = p_data.Get <ERechargerType>("RechargerType", ERechargerType.FOUNTAIN); SaveGameData saveGameData = p_data.Get <SaveGameData>("LastActivation", null); if (saveGameData != null) { m_lastActivationTime.Load(saveGameData); } }
public override void SetData(EInteractiveObjectData p_key, String p_value) { if (p_key == EInteractiveObjectData.RECHARGING_OBJECT_DATA) { Int32 p_staticId; Int32.TryParse(p_value, out p_staticId); RechargingObjectStaticData staticData = StaticDataHandler.GetStaticData <RechargingObjectStaticData>(EDataType.RECHARGING_OBJECTS, p_staticId); if (staticData != null) { Prefab = staticData.Prefab; m_partyBuff = staticData.PartyBuff; m_special = staticData.Special; m_rechargerType = staticData.RechargerType; } } }
public void RemoveBuff(EPartyBuffs p_buffId) { for (Int32 i = m_buffs.Count - 1; i >= 0; i--) { if (m_buffs[i].StaticData.StaticID == (Int32)p_buffId) { RemoveBuffByIndex(i); break; } } for (Int32 j = m_buffsToRemove.Count - 1; j >= 0; j--) { if (m_buffsToRemove[j].StaticData.StaticID == (Int32)p_buffId) { m_buffsToRemove.RemoveAt(j); break; } } }
public void AddBuff(EPartyBuffs p_buffId, Single p_valueFactor) { if (HasBuff(p_buffId)) { PartyBuff buff = GetBuff(p_buffId); buff.ResetDuration(p_valueFactor); if (m_buffsToRemove.Contains(buff)) { m_buffsToRemove.Remove(buff); } return; } PartyBuff partyBuff = new PartyBuff(); partyBuff.Init(p_buffId, p_valueFactor); m_buffs.Add(partyBuff); LegacyLogic.Instance.EventManager.InvokeEvent(partyBuff, EEventType.PARTY_BUFF_ADDED, EventArgs.Empty); if (p_buffId != EPartyBuffs.DANGER_SENSE && p_buffId != EPartyBuffs.TORCHLIGHT && p_buffId != EPartyBuffs.LIGHT_ORB && p_buffId != EPartyBuffs.DARK_VISION && p_buffId != EPartyBuffs.CLAIRVOYANCE) { LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.PARTY_BUFF); } }
public Boolean HasActiveBuff(EPartyBuffs p_buffId) { if (m_buffs.Count == 0) { return(false); } PartyBuff buff = GetBuff(p_buffId); if (buff == null) { return(false); } for (Int32 i = m_buffsToRemove.Count - 1; i >= 0; i--) { if (m_buffsToRemove[i].StaticData.StaticID == (Int32)p_buffId) { return(false); } } m_buffsToRemove.Add(buff); return(true); }
private void HandleCrystalBuffs(EPartyBuffs p_buffId) { if (p_buffId == EPartyBuffs.AIR_WARD) { RemoveBuff(EPartyBuffs.AIR_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.EARTH_WARD) { RemoveBuff(EPartyBuffs.EARTH_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.LIGHT_WARD) { RemoveBuff(EPartyBuffs.LIGHT_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.WATER_WARD) { RemoveBuff(EPartyBuffs.WATER_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.FIRE_WARD) { RemoveBuff(EPartyBuffs.FIRE_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.DARKNESS_WARD) { RemoveBuff(EPartyBuffs.DARKNESS_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.ARCANE_WARD) { RemoveBuff(EPartyBuffs.ARCANE_WARD_CRYSTAL); } if (p_buffId == EPartyBuffs.AIR_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.AIR_WARD); } if (p_buffId == EPartyBuffs.EARTH_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.EARTH_WARD); } if (p_buffId == EPartyBuffs.LIGHT_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.LIGHT_WARD); } if (p_buffId == EPartyBuffs.WATER_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.WATER_WARD); } if (p_buffId == EPartyBuffs.FIRE_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.FIRE_WARD); } if (p_buffId == EPartyBuffs.DARKNESS_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.DARKNESS_WARD); } if (p_buffId == EPartyBuffs.ARCANE_WARD_CRYSTAL) { RemoveBuff(EPartyBuffs.ARCANE_WARD); } if (p_buffId == EPartyBuffs.HEROIC_DESTINY) { RemoveBuff(EPartyBuffs.HEROIC_DESTINY_STATUE); } if (p_buffId == EPartyBuffs.HOUR_OF_POWER) { RemoveBuff(EPartyBuffs.HOUR_OF_POWER_STATUE); } if (p_buffId == EPartyBuffs.HEROIC_DESTINY_STATUE) { RemoveBuff(EPartyBuffs.HEROIC_DESTINY); } if (p_buffId == EPartyBuffs.HOUR_OF_POWER_STATUE) { RemoveBuff(EPartyBuffs.HOUR_OF_POWER); } }
public PartyBuffTarget(Object p_Target, EPartyBuffs p_buff) : base(p_Target) { Buff = p_buff; }