Exemplo n.º 1
0
 public override void Apply(GameEventOwner owner, Character ownerChar, int moveType, int targetType, ref int effectiveness)
 {
     if (effectiveness == PreTypeEvent.N_E && moveType == AttackElement && targetType == TargetElement)
     {
         effectiveness = PreTypeEvent.NVE;
     }
 }
Exemplo n.º 2
0
 public override void Apply(GameEventOwner owner, Character ownerChar, int moveType, int targetType, ref int effectiveness)
 {
     if ((moveType == Element1 || moveType == Element2) && effectiveness == 0)
     {
         effectiveness = PreTypeEvent.NRM;
     }
 }
Exemplo n.º 3
0
 public override void Apply(GameEventOwner owner, Character ownerChar, int moveType, int targetType, ref int effectiveness)
 {
     if (effectiveness == PreTypeEvent.NVE)
     {
         effectiveness = PreTypeEvent.NRM;
     }
 }
Exemplo n.º 4
0
        public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
        {
            MonsterID proxy = ((StatusEffect)owner).StatusStates.GetWithDefault <MonsterIDState>().MonID;

            character.ProxySprite = proxy;
            character.ProxyName   = Character.GetFullFormName(character.Appearance);
        }
Exemplo n.º 5
0
 public override void Apply(GameEventOwner owner, Character ownerChar, int moveType, int targetType, ref int effectiveness)
 {
     if (targetType == Element)
     {
         effectiveness = PreTypeEvent.S_E;
     }
 }
Exemplo n.º 6
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     if (character.EquippedItem.ID == -1)
     {
         character.MovementSpeed += 1;
     }
 }
Exemplo n.º 7
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     if (ZoneManager.Instance.CurrentMap != null && ZoneManager.Instance.CurrentMap.Status.ContainsKey(WeatherID))
     {
         character.MovementSpeed += 1;
     }
 }
Exemplo n.º 8
0
        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;
        }
Exemplo n.º 9
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (character == null)
            {
                yield break;
            }

            if (character.CurrentForm.Species != ReqSpecies)
            {
                yield break;
            }

            //get the forme it should be in
            int forme = DefaultForme;

            foreach (int weather in WeatherPair.Keys)
            {
                if (ZoneManager.Instance.CurrentMap.Status.ContainsKey(weather))
                {
                    forme = WeatherPair[weather];
                    break;
                }
            }

            if (forme != character.CurrentForm.Form)
            {
                //transform it
                character.Transform(new MonsterID(character.CurrentForm.Species, forme, character.CurrentForm.Skin, character.CurrentForm.Gender));
                DungeonScene.Instance.LogMsg(String.Format(new StringKey("MSG_FORM_CHANGE").ToLocal(), character.GetDisplayName(false)));
            }

            yield break;
        }
Exemplo n.º 10
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, BattleContext context)
        {
            Character targetChar = ZoneManager.Instance.CurrentMap.GetCharAtLoc(context.ExplosionTile);

            if (targetChar == null)
            {
                yield break;
            }

            if (DungeonScene.Instance.GetMatchup(context.User, targetChar) == Alignment.Friend)
            {
                //remove all MoveHit effects (except for the post-effect)
                context.Data.OnHits.Clear();
                context.Data.OnHitTiles.Clear();
                //remove BasePower component
                if (context.Data.SkillStates.Contains <BasePowerState>())
                {
                    context.Data.SkillStates.Remove <BasePowerState>();
                }

                //add the alternative effects
                foreach (BattleEvent battleEffect in BaseEvents)
                {
                    context.Data.OnHits.Add(0, (BattleEvent)battleEffect.Clone());
                }
            }
        }
Exemplo n.º 11
0
 public override void Apply(GameEventOwner owner, Character ownerChar, ref int hpChange)
 {
     if (hpChange > 0)
     {
         hpChange *= Numerator;
         hpChange /= Denominator;
     }
 }
Exemplo n.º 12
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (status != owner || character != null)
            {
                yield break;
            }

            ////remove existing spawns
            //ZoneManager.Instance.CurrentMap.TeamSpawns.Clear();

            ShopSecurityState securityState = status.StatusStates.Get <ShopSecurityState>();

            ////add guard spawns
            //for (int ii = 0; ii < securityState.Security.Count; ii++)
            //{
            //    SpecificTeamSpawner post_team = new SpecificTeamSpawner(securityState.Security.GetSpawn(ii).Copy());
            //    ZoneManager.Instance.CurrentMap.TeamSpawns.Add(post_team, securityState.Security.GetSpawnRate(ii));
            //}

            //set spawn rate
            ZoneManager.Instance.CurrentMap.RespawnTime = 0;

            //set spawn max
            ZoneManager.Instance.CurrentMap.MaxFoes = 0;

            //spawn 10 times
            List <Loc> randLocs = ZoneManager.Instance.CurrentMap.GetFreeToSpawnTiles();

            for (int ii = 0; ii < 10; ii++)
            {
                if (randLocs.Count == 0)
                {
                    break;
                }

                int      randIndex = DataManager.Instance.Save.Rand.Next(randLocs.Count);
                Loc      dest      = randLocs[randIndex];
                MobSpawn spawn     = securityState.Security.Pick(DataManager.Instance.Save.Rand);
                yield return(CoroutineManager.Instance.StartCoroutine(PeriodicSpawnEntranceGuards.PlaceGuard(spawn, dest, GuardStatus)));

                randLocs.RemoveAt(randIndex);
            }

            List <Loc> exitLocs = WarpToEndEvent.FindExits();

            //spawn once specifically on the stairs
            foreach (Loc exitLoc in exitLocs)
            {
                Loc?dest = ZoneManager.Instance.CurrentMap.GetClosestTileForChar(null, exitLoc);
                if (!dest.HasValue)
                {
                    continue;
                }

                MobSpawn spawn = securityState.Security.Pick(DataManager.Instance.Save.Rand);
                yield return(CoroutineManager.Instance.StartCoroutine(PeriodicSpawnEntranceGuards.PlaceGuard(spawn, dest.Value, GuardStatus)));
            }
        }
Exemplo n.º 13
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (character != null)
            {
                yield break;
            }

            yield return(CoroutineManager.Instance.StartCoroutine(DungeonScene.Instance.RemoveMapStatus(((MapStatus)owner).ID)));
        }
Exemplo n.º 14
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (status != owner || character == null)
            {
                yield break;
            }

            yield return(CoroutineManager.Instance.StartCoroutine(BaseEvent.Apply(owner, ownerChar, character)));
        }
Exemplo n.º 15
0
        public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
        {
            CharIndex charIndex = ZoneManager.Instance.CurrentMap.GetCharIndex(character);

            if (charIndex.Faction == Faction)
            {
                BaseEvent.Apply(owner, ownerChar, character);
            }
        }
Exemplo n.º 16
0
 public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, BattleContext context)
 {
     if (context.Data.Category == BattleData.SkillCategory.Magical &&
         context.User.HasIntrinsic(SupportAbility))
     {
         context.AddContextStateMult <DmgMult>(false, 4, 3);
     }
     yield break;
 }
Exemplo n.º 17
0
        public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
        {
            ParalyzeState para = ((StatusEffect)owner).StatusStates.GetWithDefault <ParalyzeState>();

            if (para.Recent)
            {
                character.CantWalk   = true;
                character.AttackOnly = true;
            }
        }
Exemplo n.º 18
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     for (int ii = 0; ii < character.Skills.Count; ii++)
     {
         if (character.Skills[ii].Element.SkillNum > -1 && DataManager.Instance.GetSkill(character.Skills[ii].Element.SkillNum).Data.Category == BattleData.SkillCategory.Status)
         {
             character.Skills[ii].Element.Sealed = true;
         }
     }
 }
Exemplo n.º 19
0
        public override void Apply(GameEventOwner owner, Character character, int[] moveIndices)
        {
            SlotState statusState = ((StatusEffect)owner).StatusStates.GetWithDefault <SlotState>();

            statusState.Slot = moveIndices[statusState.Slot];
            if (statusState.Slot == -1)
            {
                character.SilentRemoveStatus(((StatusEffect)owner).ID);
            }
        }
Exemplo n.º 20
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (status != owner || character != null)
            {
                yield break;
            }

            GameManager.Instance.BGM(BGM, true);
            yield break;
        }
Exemplo n.º 21
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     for (int ii = 0; ii < character.Skills.Count; ii++)
     {
         if (character.Skills[ii].Element.SkillNum > -1)
         {
             character.Skills[ii].Element.Sealed = false;
         }
     }
 }
Exemplo n.º 22
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     for (int ii = 0; ii < character.Skills.Count; ii++)
     {
         if (character.Skills[ii].Element.SkillNum == ((MapStatus)owner).StatusStates.GetWithDefault <MapIndexState>().Index)
         {
             character.Skills[ii].Element.Sealed = true;
         }
     }
 }
Exemplo n.º 23
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     if (WallItems)
     {
         character.SeeWallItems = true;
     }
     else
     {
         character.SeeItems = true;
     }
 }
Exemplo n.º 24
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     if (CharSight)
     {
         character.CharSight = Sight;
     }
     else
     {
         character.TileSight = Sight;
     }
 }
Exemplo n.º 25
0
 public override void Apply(GameEventOwner owner, Character ownerChar, Character character)
 {
     foreach (StatusEffect status in character.IterateStatusEffects())
     {
         if (status.StatusStates.Contains <MajorStatusState>())
         {
             character.MovementSpeed += 1;
             break;
         }
     }
 }
Exemplo n.º 26
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (character != null)
            {
                yield break;
            }

            yield return(CoroutineManager.Instance.StartCoroutine(DungeonScene.Instance.RemoveMapStatus(status.ID)));

            ZoneManager.Instance.CurrentMap.Status.Add(status.ID, status);
            status.StartEmitter(DungeonScene.Instance.Anims);
        }
Exemplo n.º 27
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (character != null)
            {
                yield break;
            }

            if (((MapStatus)owner).StatusStates.GetWithDefault <MapCountDownState>().Counter > -1 &&
                ((MapStatus)owner).StatusStates.GetWithDefault <MapCountDownState>().Counter < status.StatusStates.GetWithDefault <MapCountDownState>().Counter)
            {
                ((MapStatus)owner).StatusStates.GetWithDefault <MapCountDownState>().Counter = status.StatusStates.GetWithDefault <MapCountDownState>().Counter;
            }
        }
Exemplo n.º 28
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, BattleContext context)
        {
            if (context.ContextStates.Contains <Redirected>())
            {
                yield break;
            }

            if (context.ActionType == BattleActionType.Trap || context.ActionType == BattleActionType.Item)
            {
                yield break;
            }

            if (Element != 00 && context.Data.Element != Element)
            {
                yield break;
            }

            Character targetChar = ZoneManager.Instance.CurrentMap.GetCharAtLoc(context.ExplosionTile);

            if (targetChar == null)
            {
                yield break;
            }

            //the attack needs to be able to hit foes
            if ((context.HitboxAction.TargetAlignments & Alignment.Foe) == Alignment.None)
            {
                yield break;
            }

            //original target char needs to be a friend of the target char
            if ((DungeonScene.Instance.GetMatchup(ownerChar, targetChar) & DrawFrom) == Alignment.None)
            {
                yield break;
            }

            CharAnimSpin spinAnim = new CharAnimSpin();

            spinAnim.CharLoc   = ownerChar.CharLoc;
            spinAnim.CharDir   = ownerChar.CharDir;
            spinAnim.MajorAnim = true;

            yield return(CoroutineManager.Instance.StartCoroutine(ownerChar.StartAnim(spinAnim)));

            yield return(new WaitWhile(ownerChar.OccupiedwithAction));

            DungeonScene.Instance.LogMsg(String.Format(Msg.ToLocal(), ownerChar.GetDisplayName(false), owner.GetDisplayName()));
            context.ExplosionTile   = ownerChar.CharLoc;
            context.Explosion.Range = 0;
            context.ContextStates.Set(new Redirected());
        }
Exemplo n.º 29
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, BattleContext context)
        {
            if (Element != 00 && context.Data.Element != Element)
            {
                yield break;
            }

            if (ZoneManager.Instance.CurrentMap.GetCharAtLoc(context.ExplosionTile) != ownerChar)
            {
                yield break;
            }

            context.Explosion.Range = 0;
        }
Exemplo n.º 30
0
        public override IEnumerator <YieldInstruction> Apply(GameEventOwner owner, Character ownerChar, Character character, MapStatus status, bool msg)
        {
            if (status != owner || character != null)
            {
                yield break;
            }

            if (status.StatusStates.GetWithDefault <MapCountDownState>().Counter > -1)
            {
                status.Hidden = false;
            }

            yield break;
        }