Beispiel #1
0
        public static UnitStatus CreateFromType(statusTypes type, float duration, float power)
        {
            UnitStatus tmp = null;

            switch (type)
            {
            case statusTypes.Stun:
                tmp = new StunStatus();
                break;

            case statusTypes.Root:
                tmp = new RootStatus();
                break;

            case statusTypes.Speed:
                tmp = new SpeedStatus();
                ((SpeedStatus)tmp).speedModifier = power;
                break;
            }
            if (tmp != null)
            {
                tmp.duration = duration;
            }
            return(tmp);
        }
Beispiel #2
0
        private void PhaseChange()
        {
            foreach (Launcher launcher in activeLaunchers)
            {
                launcher.active = false;
                Destroy(launcher);
            }
            activeLaunchers.Clear();

            foreach (UnitStatus status in activeStatus)
            {
                status.OnStatusEnd(unit);
            }
            activeStatus.Clear();

            BossPhase      currentPhase = bossRef.phases[phase];
            int            end          = currentPhase.launchers.Length - currentPhase.activeLaunchers;
            int            start        = Random.Range(0, end);
            Launcher       tmpLauncher;
            BulletLauncher bulletLauncher;

            for (int i = 0; i < currentPhase.activeLaunchers; i++)
            {
                tmpLauncher = Instantiate(currentPhase.launchers[i], unit.transform);
                activeLaunchers.Add(tmpLauncher);
                if ((bulletLauncher = tmpLauncher.gameObject.GetComponent <BulletLauncher>()) != null)
                {
                    bulletLauncher.objectPool = EncounterController.instance.bulletPool;
                }
                tmpLauncher.active = true;
            }

            foreach (GameEvent gameEvent in currentPhase.mapEvents)
            {
                gameEvent.Raise();
            }

            UnitStatus tmpStatus;

            foreach (BossPhaseStatus status in currentPhase.phaseStatus)
            {
                tmpStatus = UnitStatus.CreateFromType(status.type, status.duration, status.power);
                activeStatus.Add(tmpStatus);
                tmpStatus.Init(unit);
            }
        }
Beispiel #3
0
 public void UnRegisterTimedStatus(UnitStatus status)
 {
     timedStatus.Remove(status);
 }
Beispiel #4
0
 public void UnRegisterStatus(UnitStatus status)
 {
     this.status.Remove(status);
 }
Beispiel #5
0
 public void RegisterTimedStatus(UnitStatus status)
 {
     timedStatus.Add(status);
 }
Beispiel #6
0
 public void RegisterStatus(UnitStatus status)
 {
     this.status.Add(status);
 }