Exemple #1
0
 public IState Update()
 {
     if (progression == 0 || progression == 2)
     {
         timer -= Time.deltaTime;
     }
     if (progression == 0 && timer < 0)
     {
         progression++;
         dockingShip = GameObject.Instantiate(dockingShip, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.identity);
     }
     if (progression == 1 && DataDump.GetInt("PlayerDocked") > 0)
     {
         DialogueQueue.AddMessage("Well done!");
         DialogueQueue.AddMessage("This was an entry to Ludum Dare 39: Running out of Power, created by Zak Reynolds in 48 hours.");
         DialogueQueue.AddMessage("Thanks for playing!");
         progression++;
         timer = 15;
         var st = GameObject.FindWithTag("MainCamera").GetComponent <SmoothTrack>();
         st.target         = dockingShip.transform;
         st.smoothTime     = 0.5f;
         st.positionOffset = new Vector3(13, 5, -45);
     }
     if (progression == 2)
     {
         if (timer < 0)
         {
             // TODO: End
             progression++;
             DialogueQueue.AddMessage("END GAME\nESC to quit\nBACKSPACE to restart", 20);
             return(this);
         }
     }
     return(this);
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         DialogueQueue.AddMessage("Great hit!", 2);
         sentMessage = true;
         Doomed();
         DataDump.SetInt("TrainingTargetsHit", DataDump.GetInt("TrainingTargetsHit") + 1);
     }
 }
Exemple #3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("UpperBounds"))
     {
         inSpace = true;
         DialogueQueue.AddMessage("You're too close to the sun, Icarus!");
     }
     if (other.tag.Equals("DockingBay"))
     {
         DataDump.SetInt("PlayerDocked", 1);
         DockingSequence();
     }
 }
 void Update()
 {
     lifeTimer -= Time.deltaTime;
     if (lifeTimer < 0)
     {
         Doomed();
     }
     if (!sentMessage && player.position.x > transform.position.x + 5)
     {
         sentMessage = true;
         DialogueQueue.AddMessage("Shucks, you missed that one. Try to hit the next target!", 2);
     }
 }
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         DialogueQueue.AddMessage("Gah! Shoot them, don't ram them you maniac!", 2);
         sentMessage = true;
         Doomed();
     }
     if (other.tag.Equals("PlayerBullet"))
     {
         DialogueQueue.AddMessage("Boom! Way to go!", 2);
         sentMessage = true;
         Doomed();
         DataDump.SetInt("TrainingTargetsShot", DataDump.GetInt("TrainingTargetsShot") + 1);
     }
 }
Exemple #6
0
        public IState Update()
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                // TODO: skip
            }
            if (progression == 0 && DataDump.GetInt("TrainingTargetsHit") >= ramCount)
            {
                DialogueQueue.AddMessage("Well done! Now try shooting them. Remember to move between the gun and engine using 'A' and 'D'.");
                progression++;
                var targets = GameObject.FindGameObjectsWithTag("TrainingTarget");
                foreach (var t in targets)
                {
                    t.GetComponent <TrainingTarget>().Doomed();
                }

                engineTrainingSpawner.SetActive(false);
                shootTrainingSpawner = GameObject.Instantiate(shootTrainingSpawner, sd.transform.position + spawnerOffset, Quaternion.FromToRotation(Vector3.up, Vector3.left));
                shootTrainingSpawner.GetComponent <SmoothTrack>().target = sd.transform;
            }
            if (progression == 1 && DataDump.GetInt("TrainingTargetsShot") >= shootCount)
            {
                var targets = GameObject.FindGameObjectsWithTag("TrainingTargetShoot");
                foreach (var t in targets)
                {
                    t.GetComponent <TrainingTargetShoot>().Doomed();
                }
                shootTrainingSpawner.SetActive(false);
                DialogueQueue.AddMessage("Nice shooting! You're pretty much a professional at this point.");
                DialogueQueue.AddMessage("Deliver the package safely. There might be a few birds on the way to watch out for, but nothing to worry about.");
                DialogueQueue.AddMessage("...");
                progression++;
            }
            if (progression == 2)
            {
                timer -= Time.deltaTime;
                if (timer < 0)
                {
                    progression++;
                    return(new BirdsState());
                }
            }
            return(this);
        }
Exemple #7
0
 public void OnEnter()
 {
     DialogueQueue.AddMessage("Oh! There's a minor detail that I forgot to mention in your training...");
     DialogueQueue.AddMessage("There's a party that's very interested in taking that package you're carrying.");
     DataDump.SetInt("BossHP", 750);
     MusicBox.ChangeMusic(MusicBox.Song.Boss);
     //birdSpawner = GameObject.Instantiate(birdSpawner, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
     //birdSpawner.GetComponent<SmoothTrack>().target = sd.transform;
     //birdSpawner.SetActive(false);
     //birdTightSpawner = GameObject.Instantiate(birdTightSpawner, sd.transform.position + spawnerOffset + Vector3.up * 5, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
     //birdTightSpawner.GetComponent<SmoothTrack>().target = sd.transform;
     //birdTightSpawner.SetActive(true);
     //birdBomberSpawner = GameObject.Instantiate(birdBomberSpawner, sd.transform.position + spawnerOffset, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
     //birdBomberSpawner.GetComponent<SmoothTrack>().target = sd.transform;
     //birdBomberSpawner.SetActive(false);
     //hpSpawner = GameObject.Instantiate(hpSpawner, sd.transform.position + spawnerOffset + Vector3.up * 5, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
     //hpSpawner.GetComponent<SmoothTrack>().target = sd.transform;
     //hpSpawner.SetActive(true);
 }
    public static void AddMessage(string message, float displayTime)
    {
        DialogueQueue dq = Get();

        if (!dq)
        {
            Debug.LogError("No DialogQueue!");
        }
        if (dq.messageQueue == null)
        {
            dq.messageQueue = new Queue <TextMessage>();
        }
        dq.messageQueue.Enqueue(new TextMessage(message, displayTime));
        if (!dq.showingMessages)
        {
            dq.showingMessages = true;
            dq.DisplayNextMessage();
            dq.textBoxRoot.gameObject.SetActive(true);
        }
    }
 public IState Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         // TODO: skip
     }
     if (progression == 0 && cd.State == CaptainDriver.CrankState.Gun)
     {
         DialogueQueue.AddMessage("You found the gun! Now turn the crank and get it up to MAX POWER! Click the button, a lot.");
         progression++;
     }
     if (progression == 1 && sd.GetGunPowerNormalized() > 0.75)
     {
         DialogueQueue.AddMessage("Feel the power spewing forth from your hands! Ptht ptht ptht ptht!");
         DialogueQueue.AddMessage("Lets start up that engine now. Head back to the stern using 'A' to move.");
         progression++;
     }
     if (progression == 2 && cd.State == CaptainDriver.CrankState.Engine)
     {
         DialogueQueue.AddMessage("It needs some warming up, so give it a good few cranks.");
         progression++;
     }
     if (progression == 3 && sd.GetEnginePowerNormalized() > sd.unDockPowerThreshold)
     {
         DialogueQueue.AddMessage("BY THE POWER PROVIDED BY YOUR OWN TWO HANDS...", 1.2f);
         DialogueQueue.AddMessage("YOU ARE A SOARING EAGLE, AN ICARUS, AN ALMIGHTY BEING!", 3.5f);
         DialogueQueue.AddMessage(" FLY! FLY!");
         progression++;
     }
     if (progression == 4)
     {
         timer -= Time.deltaTime;
         if (timer < 0)
         {
             return(new LearnEngineState());
         }
     }
     return(this);
 }
Exemple #10
0
 public IState Update()
 {
     if (progression == 0 || progression == 4)
     {
         timer -= Time.deltaTime;
     }
     if (progression == 0 && timer < 0)
     {
         DialogueQueue.AddMessage("Here they come!");
         boss = GameObject.Instantiate(boss, sd.transform.position + spawnerOffset + Vector3.up * -5, Quaternion.FromToRotation(Vector3.forward, Vector3.left));
         boss.GetComponent <SmoothTrack>().target = sd.transform;
         progression++;
     }
     if (progression == 1 && DataDump.GetInt("BossHP") < 500)
     {
         DialogueQueue.AddMessage("Keep it up!");
         progression++;
     }
     if (progression == 2 && DataDump.GetInt("BossHP") < 250)
     {
         DialogueQueue.AddMessage("You have them on the ropes!");
         progression++;
     }
     if (progression == 3 && DataDump.GetInt("BossHP") <= 0)
     {
         DialogueQueue.AddMessage("Yeah! Great work comrade! The drop point is just ahead!");
         timer = 5;
         progression++;
     }
     if (progression == 4 && timer < 0)
     {
         progression++;
         return(new DropoffState());
     }
     return(this);
 }
Exemple #11
0
 public void OnEnter()
 {
     DialogueQueue.AddMessage("Dock with the ship to drop off your package.");
     MusicBox.ChangeMusic(MusicBox.Song.Fly);
 }
Exemple #12
0
 private void Doomed()
 {
     DialogueQueue.AddMessage("Welp, you tried. Hit BACKSPACE to give it another shot (buh dum tiss).");
     Destroy(gameObject);
 }
Exemple #13
0
 public void OnEnter()
 {
     DialogueQueue.AddMessage("Ram the targets as they come up. You'll get the hang of flying this thing soon enough.");
     engineTrainingSpawner = GameObject.Instantiate(engineTrainingSpawner, sd.transform.position + spawnerOffset, Quaternion.FromToRotation(Vector3.up, Vector3.left));
     engineTrainingSpawner.GetComponent <SmoothTrack>().target = sd.transform;
 }
Exemple #14
0
    // Use this for initialization
    void Start()
    {
        pausePanel = GameObject.Find("GamePausePanel");

        dialogue = GameObject.Find("DialoguePanel").GetComponent <DialogueQueue>();
        dialogue.gameObject.SetActive(false);

        GameObject[] equipSlots = GameObject.FindGameObjectsWithTag("EquipSlot");
        GameObject[] invSlots   = GameObject.FindGameObjectsWithTag("Slot");
        GameObject[] skillSlots = GameObject.FindGameObjectsWithTag("SkillSlot");

        mapCanvas = GameObject.Find("MapCanvas");
        mapCanvas.gameObject.SetActive(false);

        vendorDialogue = GameObject.Find("ShopCanvas");
        vendorText     = vendorDialogue.GetComponentInChildren <Text>();
        vendorDialogue.SetActive(false);

        enemyInfo     = GameObject.Find("EnemyInfoCanvas");
        enemyInfoText = enemyInfo.GetComponentInChildren <Text>();
        enemyInfo.SetActive(false);

        chestPanel = GameObject.Find("ChestPanel");
        chestPanel.SetActive(false);

        buyCanvas   = GameObject.Find("BuyCanvas");
        buyGoldText = GameObject.Find("PriceText").GetComponent <Text>();
        buyCanvas.SetActive(false);

        sellSlot = GameObject.Find("SellSlot").GetComponent <SellSlot>();

        buySellPanel = GameObject.Find("BuysellPanel");
        buySellPanel.SetActive(false);

        lootPanel = GameObject.Find("LootPanel");
        lootPanel.SetActive(false);

        questCanvas   = GameObject.Find("QuestCanvas");
        questDesc     = GameObject.Find("QuestDesc").GetComponent <Text>();
        questTitle    = GameObject.Find("QuestTitle").GetComponent <Text>();
        questReward   = GameObject.Find("QuestReward").GetComponent <Text>();
        dropAddQuest  = GameObject.Find("DropAddQuest").GetComponentInChildren <Text>();
        questImage    = GameObject.Find("QuestImage").GetComponent <Image>();
        questLogTitle = GameObject.Find("QuestLogTitle").GetComponent <Text>();
        questImage.gameObject.SetActive(false);
        questCanvas.SetActive(false);

        pauseCanvas = GameObject.Find("PauseCanvas");
        pauseCanvas.SetActive(false);

        deathCanvas = GameObject.Find("DeathCanvas");
        deathCanvas.SetActive(false);

        inventoryPanel = GameObject.Find("InventoryPanel");
        skillPanel     = GameObject.Find("SkillsPanel");
        database       = GameObject.FindGameObjectWithTag("ItemDatabase").GetComponent <ItemDatabase> ();
        tooltip        = GameObject.Find("Tooltip");
        playerStat     = GameObject.Find("Player").GetComponent <PlayerStat>();
        player         = playerStat.GetComponent <Player>();

        bubbleSort(equipSlots);
        bubbleSort(invSlots);
        bubbleSort(skillSlots);
        bubbleSort(lootSlots);
        bubbleSort(chestSlots);

        for (int i = 0; i < 8; i++)
        {//Inventory slots for equipment
            items.Add(new Item());
            slots.Add(equipSlots[i]);
            slots[i].GetComponent <Slot>().id = i;
        }

        for (int i = 0; i < 16; i++)
        {//Inventory slots for the inventory
            items.Add(new Item());
            slots.Add(invSlots[i]);
            slots[i + 8].GetComponent <Slot>().id = i + 8;
        }

        for (int i = 0; i < 8; i++)
        {//Slots for the skills
            items.Add(new Item());
            slots.Add(skillSlots[i]);
            slots[i + 24].GetComponent <Slot>().id          = i + 24;
            slots[i + 24].GetComponent <Slot>().isSkillSlot = true;
        }

        items.Add(new Item());
        slots.Add(invSlots[16]);

        items.Add(new Item());
        slots.Add(invSlots[17]);

        for (int i = 0; i < 4; i++)
        {
            items.Add(new Item());
            slots.Add(lootSlots[i]);
        }

        for (int i = 0; i < 16; i++)
        {
            items.Add(new Item());
            slots.Add(chestSlots[i]);
        }

        if (LoadData.instance.dataLoaded)
        {
            Load();
        }
        else
        {
            AddItem(0);
            AddItem(1);
        }
    }
 public void OnEnter()
 {
     DialogueQueue.AddMessage("Let's crank up that gatling gun you have there. Press 'D' to move to the front of your ship.");
 }