Beispiel #1
0
 void NecromancerShootingState_StateExit(On.NecromancerShootingState.orig_StateExit orig, NecromancerShootingState self)
 {
     specialArrows = false;
     orig(self);
 }
Beispiel #2
0
        IEnumerator NecromancerShootingState_ShootCoroutine(On.NecromancerShootingState.orig_ShootCoroutine orig, NecromancerShootingState self)
        {
            DynData <NecromancerShootingState> selfData = new DynData <NecromancerShootingState>(self);
            NecromancerBoss boss      = selfData.Get <NecromancerBoss>("boss");
            Vector3         targetPos = (!(Manager <PlayerManager> .Instance.Player.transform.position.x > boss.arenaCenter.position.x)) ? boss.castingPosRight.position : boss.castingPosLeft.position;

            boss.Invincibru       = true;
            boss.hurtZone.enabled = false;
            boss.Animator.Update(0f);
            boss.Animator.SetTrigger("TeleportOut");
            yield return(new WaitForSeconds(1f));

            Vector3 position3 = boss.arenaCenter.position;

            if (targetPos.x < position3.x)
            {
                boss.transform.localScale = new Vector3(-1f, 1f, 1f);
            }
            else
            {
                boss.transform.localScale = Vector3.one;
            }

            boss.transform.position = targetPos;
            boss.Animator.SetTrigger("TeleportIn");
            yield return(new WaitForSeconds(0.25f));

            boss.hurtZone.enabled = true;
            boss.Invincibru       = false;
            specialArrows         = true;
            while (selfData.Get <int>("maxWaveCount") > 0)
            {
                boss.Animator.SetBool("Shooting", true);
                yield return(new WaitForSeconds(0.3f));

                float[] pattern = GetRandomShotPattern();
                foreach (float wait in pattern)
                {
                    boss.Animator.SetTrigger("DoShot");
                    yield return(new WaitForSeconds(wait));
                }
                boss.Animator.SetBool("Shooting", false);
                selfData.Set("maxWaveCount", selfData.Get <int>("maxWaveCount") - 1);
                yield return(new WaitForSeconds(1f));
            }
            selfData.Set("allDone", true);
        }