コード例 #1
0
    //private List<string> listOfDragonTypes = new List<string>() {
    //    "Basic Drakling", "Earthen Drakling", "Flame Drakling", "Tidal Drakling",
    //    "Basic Wyrm", "Earthen Wyrm", "Flame Wyrm", "Tidal Wyrm",
    //    "Basic Serpent", "Earthen Serpent", "Flame Serpent", "Tidal Serpent"};
    //private int numberOfDragonTypes;


    // Use this for initialization
    void Awake()
    {
        GlobalFlags.GetCombatManagerFlags(out Player, out Dragon, out Enemy);

        if (GlobalFlags.GetBossFlag())
        {
            GameObject.Find("Enemy").GetComponent <Transform>().position = new Vector3(-4.0f, 1.0f, 0f);
        }
        else
        {
            GameObject.Find("Enemy").GetComponent <Transform>().position = new Vector3(-6.0f, 0.6f, 0f);
        }
        GameObject.Find("Enemy").GetComponent <SpriteRenderer>().sprite = Enemy.battleSprite;

        string sceneName = GlobalFlags.GetCurrentOverworldScene();

        if (sceneName == "Overworld")
        {
            bkgdRenderer.sprite = grasslandBkgd;
        }
        if (sceneName == "Overworld - West")
        {
            bkgdRenderer.sprite = skyBkgd;
        }
        if (sceneName == "Caves")
        {
            bkgdRenderer.sprite = cavesBkgd;
        }
        if (sceneName == "Boss")
        {
            bkgdRenderer.sprite = bossBkgd;
        }
    }
コード例 #2
0
    void ShowMainMenu(bool active)
    {
        //MainPanel.SetActive(active);

        if (PlayerQueued)
        {
            PlayerButton.interactable = false;
        }
        else
        {
            PlayerButton.interactable = active;
        }

        if (DragonQueued || CM.Player.AllDragonsDead())
        {
            DragonButton.interactable = false;
        }
        else
        {
            DragonButton.interactable = active;
        }

        if (CM.Dragon == null)
        {
            DragonButton.interactable = false;
        }

        if (PlayerQueued || DragonQueued || GlobalFlags.GetBossFlag() == true)
        {
            CaptureButton.interactable = false;
        }
        else
        {
            CaptureButton.interactable = active;
        }

        if (GlobalFlags.GetBossFlag() == true)
        {
            FleeButton.interactable = false;
        }
        else
        {
            FleeButton.interactable = active;
        }

        if (DragonCaptured)
        {
            PlayerButton.interactable  = false;
            DragonButton.interactable  = false;
            CaptureButton.interactable = false;
            FleeButton.interactable    = false;
        }

        //ES.SetSelectedGameObject(PlayerButton.gameObject);
    }
コード例 #3
0
        //public ScriptableObject PlayerData = Resources.Load<ScriptableObject>("ScriptableObjects/Player");
        //public ScriptableObject DragonData = Resources.Load<ScriptableObject>("ScriptableObjects/Dragon");
        //public ScriptableObject EnemyData = Resources.Load<ScriptableObject>("ScriptableObjects/ExampleEnemy");

        public void OnStateEnter(params object[] parameters)
        {
            SceneManager.LoadScene(GlobalFlags.GetCurrentBattleScene());
            if (GlobalFlags.GetBossFlag() == false)
            {
                SoundManager.Instance.PlayMusic("SuperHero_original", 0.55f);
            }
            else
            {
                SoundManager.Instance.PlayMusic("Boss Battle", 0.55f);
            }
        }
コード例 #4
0
 public void EndCombat()
 {
     SoundManager.Instance.StopMusic();
     if (!Player.IsDead() && !Player.AllDragonsDead())
     {
         //Was this the final boss???
         if (GlobalFlags.GetBossFlag() == true)
         {
             GameManager.instance.PushState(StateManagement.GameStateType.Credits);
         }
         else
         {
             GameManager.instance.PopState();
         }
     }
     else
     {
         GameManager.instance.PopState();
         GameManager.instance.PopState();
     }
 }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        ColorInit();
        ES.SetSelectedGameObject(MainPanel);

        PlayerButton.onClick.AddListener(() => PlayerButtonClick());
        DragonButton.onClick.AddListener(() => DragonButtonClick());
        CaptureButton.onClick.AddListener(CaptureButtonClick);
        FleeButton.onClick.AddListener(FleeButtonClick);

        PlayerAttack.onClick.AddListener(PlayerAttackClick);

        PlayerInventory.onClick.AddListener(PlayerInventoryClick);
        InventoryCanvasController.instance.UseButton.onClick.AddListener(PlayerInventoryUseClick);
        InventoryCanvasController.instance.CancelButton.onClick.AddListener(PlayerInventoryCancelClick);

        PlayerDefend.onClick.AddListener(PlayerDefendClick);
        PlayerBack.onClick.AddListener(() => PlayerBackClick());

        DragonAttack.onClick.AddListener(DragonAttackClick);
        DragonMagic.onClick.AddListener(DragonMagicClick);
        DragonDefend.onClick.AddListener(DragonDefendClick);
        DragonSwitch.onClick.AddListener(DragonSwitchClick);
        DragonBack.onClick.AddListener(() => DragonBackClick());

        DragonSelectButton1.onClick.AddListener(() => DragonSelect(0, dst));
        DragonSelectButton2.onClick.AddListener(() => DragonSelect(1, dst));
        DragonSelectButton3.onClick.AddListener(() => DragonSelect(2, dst));
        DragonSelectButton4.onClick.AddListener(() => DragonSelect(3, dst));

        SpellButton1.onClick.AddListener(() => SpellSelect(0));
        SpellButton2.onClick.AddListener(() => SpellSelect(1));
        SpellButton3.onClick.AddListener(() => SpellSelect(2));
        SpellButton4.onClick.AddListener(() => SpellSelect(3));

        TargetSelectPlayer.onClick.AddListener(() => TargetSelect(0));
        TargetSelectDragon.onClick.AddListener(() => TargetSelect(1));
        TargetSelectEnemy.onClick.AddListener(() => TargetSelect(2));

        SpellNames = CM.GetDragonSpells();
        SpellButton1.GetComponentInChildren <Text>().text = SpellNames[0];
        SpellButton2.GetComponentInChildren <Text>().text = SpellNames[1];
        SpellButton3.GetComponentInChildren <Text>().text = SpellNames[2];
        SpellButton4.GetComponentInChildren <Text>().text = SpellNames[3];

        DragonNames = CM.GetDragonNames();
        DragonSelectButton1.GetComponentInChildren <Text>().text = DragonNames[0];
        DragonSelectButton2.GetComponentInChildren <Text>().text = DragonNames[1];
        DragonSelectButton3.GetComponentInChildren <Text>().text = DragonNames[2];
        DragonSelectButton4.GetComponentInChildren <Text>().text = DragonNames[3];

        PlayerSlider.onValueChanged.AddListener(PlayerCheat);
        DragonSlider.onValueChanged.AddListener(DragonCheat);
        DragonManaSlider.onValueChanged.AddListener(DragonCheat);
        EnemySlider.onValueChanged.AddListener(EnemyCheat);

        PlayerSlider.interactable     = false;
        DragonSlider.interactable     = false;
        DragonManaSlider.interactable = false;
        EnemySlider.interactable      = false;

        ShowMainMenu(true);

        GetSliderInfo();

        //IsBossBattle = CM.IsFightingBoss();

        for (int i = 0; i < TextQueueLength; i++)
        {
            TextQueue[i] = "";
        }

        if (GlobalFlags.GetBossFlag())
        {
            DisplayLine("This is your final challenge!");
        }
        else
        {
            DisplayLine("An enemy appeared!");
        }
    }