Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        player           = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerController>();
        playerGuid       = GameObject.Find("PlayerGUID").GetComponent <PlayerGUID>();
        highScores       = GetComponent <HighScores>();
        mainCamera       = Camera.main;
        startTime        = Time.time;
        obstaclesAvoided = 0;
        tickDifficulty   = 0;
        endTime          = 0;

        Time.timeScale = 1f;

        // if Game not over but GameOver screen is showing - hide it
        if (!gameOver && gameOverScreen.activeSelf)
        {
            gameOverScreen.SetActive(false);
        }
        StartCoroutine("CameraZoom");
        Time.timeScale = 1f;

        //play whooosh sound
        SoundSource.volume = 0.5f;
        SoundSource.clip   = wwwClip;
        SoundSource.Play();
    }
Ejemplo n.º 2
0
 public override void Reset()
 {
     SetCombatMovement(false);
     KillCount = 0;
     PlayerGUID.Clear();
     Summons.DespawnAll();
 }
Ejemplo n.º 3
0
 public override void Reset()
 {
     EndTimer  = 0;
     Completed = false;
     Progress  = false;
     PlayerGUID.Clear();
     WaveTimer = 0;
 }
Ejemplo n.º 4
0
    void Start()
    {
        _playerGUID = GameObject.Find("PlayerGUID").GetComponent <PlayerGUID>();

        if (SceneManager.GetActiveScene().name == "HighScores")
        {
            StartCoroutine(LoadScores());
        }
    }
Ejemplo n.º 5
0
 public override void JustDied(Unit killer)
 {
     if (!PlayerGUID.IsEmpty() && !Completed)
     {
         Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
         if (player)
         {
             player.FailQuest(QuestPoweringOurDefenses);
         }
     }
 }
Ejemplo n.º 6
0
            public override void JustDied(Unit killer)
            {
                me.SetFaction(FactionNormal);

                if (!PlayerGUID.IsEmpty())
                {
                    Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                    if (player)
                    {
                        player.FailQuest(QUEST_UNEXPECTED_RESULT);
                    }
                }
            }
Ejemplo n.º 7
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Ejemplo n.º 8
0
            public override void UpdateAI(uint diff)
            {
                if (KillCount >= 3 && !PlayerGUID.IsEmpty())
                {
                    Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                    if (player)
                    {
                        if (player.GetQuestStatus(QUEST_UNEXPECTED_RESULT) == QuestStatus.Incomplete)
                        {
                            player.CompleteQuest(QUEST_UNEXPECTED_RESULT);
                            me.SetFaction(FactionNormal);
                            me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
                        }
                    }
                }

                _events.Update(diff);
                _events.ExecuteEvents(eventId =>
                {
                    switch (eventId)
                    {
                    case EventTalk:
                        Talk(SayTestSoil);
                        _events.ScheduleEvent(EventAddQuestGiverFlag, 7000);
                        break;

                    case EventAddQuestGiverFlag:
                        me.SetFlag64(UnitFields.NpcFlags, NPCFlags.QuestGiver);
                        break;

                    case EventSummon:
                        me.SummonCreature(NPC_GHARZUL, 8749.505f, -7132.595f, 35.31983f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        me.SummonCreature(NPC_ANGERSHADE, 8755.38f, -7131.521f, 35.30957f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        me.SummonCreature(NPC_ANGERSHADE, 8753.199f, -7125.975f, 35.31986f, 3.816502f, TempSummonType.CorpseTimedDespawn, 180000);
                        break;

                    case EventFireball:
                        if (UpdateVictim())
                        {
                            DoCastVictim(SpellFireball, true);      // Not casting in combat
                            _events.ScheduleEvent(EventFireball, 3000);
                        }
                        break;

                    default:
                        break;
                    }
                });
                DoMeleeAttackIfReady();
            }
Ejemplo n.º 9
0
            public override void UpdateAI(uint diff)
            {
                if (EndTimer < diff && Progress)
                {
                    Talk(Emote);
                    Completed = true;
                    if (!PlayerGUID.IsEmpty())
                    {
                        Player player = Global.ObjAccessor.GetPlayer(me, PlayerGUID);
                        if (player)
                        {
                            player.CompleteQuest(QuestPoweringOurDefenses);
                        }
                    }

                    me.DealDamage(me, (uint)me.GetHealth(), null, DamageEffectType.Direct, SpellSchoolMask.Normal, null, false);
                    me.RemoveCorpse();
                }
                else
                {
                    EndTimer -= diff;
                }

                if (WaveTimer < diff && !Completed && Progress)
                {
                    uint ran1 = RandomHelper.Rand32() % 8;
                    uint ran2 = RandomHelper.Rand32() % 8;
                    uint ran3 = RandomHelper.Rand32() % 8;
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran1].X, SpawnLocations[ran1].Y, SpawnLocations[ran1].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran2].X, SpawnLocations[ran2].Y, SpawnLocations[ran2].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    me.SummonCreature(NpcEnragedWeaith, SpawnLocations[ran3].X, SpawnLocations[ran3].Y, SpawnLocations[ran3].Z, 0, TempSummonType.TimedOrCorpseDespawn, 10000);
                    WaveTimer = 30000;
                }
                else
                {
                    WaveTimer -= diff;
                }
            }