public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg) { //the owner must not be the newly added status if (status.ID != owner.GetID() || character != null) { yield break; } //remove all other weather effects List <int> removingIDs = new List <int>(); foreach (MapStatus removeStatus in ZoneManager.Instance.CurrentMap.Status.Values) { bool hasState = false; foreach (FlagType state in States) { if (removeStatus.StatusStates.Contains(state.FullType)) { hasState = true; } } if (hasState && removeStatus.ID != owner.GetID()) { removingIDs.Add(removeStatus.ID); } } foreach (int removeID in removingIDs) { yield return(CoroutineManager.Instance.StartCoroutine(DungeonScene.Instance.RemoveMapStatus(removeID, Msg && msg))); } yield break; }
public override void Apply(GameEventOwner owner, Character ownerChar, Character character) { ItemData entry = DataManager.Instance.GetItem(owner.GetID()); FamilyState family; if (!entry.ItemStates.TryGet <FamilyState>(out family)) { return; } if (family.Members.Contains(ownerChar.BaseForm.Species)) { BaseEvent.Apply(owner, ownerChar, character); } }
public override void Apply(GameEventOwner owner, Character ownerChar, int moveType, int targetType, ref int effectiveness) { ItemData entry = DataManager.Instance.GetItem(owner.GetID()); FamilyState family; if (!entry.ItemStates.TryGet <FamilyState>(out family)) { return; } if (family.Members.Contains(ownerChar.BaseForm.Species)) { BaseEvent.Apply(owner, ownerChar, moveType, targetType, ref effectiveness); } }