private void Start()
    {
        gmInstance = GameManager.Instance;

        battleSceneController = FindObjectOfType <BattleSceneController>();
        battleGUIManager      = battleSceneController.battleGUIManager;
        characters            = gmInstance.GetCharactersArrayAsPlayer();

        if (!gmInstance.IsaCharacterAlive())
        {
            var potionAmount = StoreData.Instance.PotionAmount;

            bool tostore = (potionAmount <= 0); // else to backpack

            var message = allDeadMessage + "\n" + ((potionAmount <= 0) ? storeMessage : backpackMessage);

            battleGUIManager.TextMessage(message);
            battleGUIManager.AllDead(tostore);
        }
        else if (gmInstance.SelectedEnemy.IsBoss)
        {
            battleGUIManager.TextMessage(bossMessage + "\n" + normalMessage);
        }
        else
        {
            battleGUIManager.TextMessage(normalMessage);
        }

        Begin();
    }
Beispiel #2
0
    private List <string> viewedTalkList = new List <string>();    //既に表示した会話の再表示を防ぐ用



    // 初期化
    public void Init(BattleMapManager battleMapManager, GameObject talkWindow, GameObject talkView, FadeInOutManager fadeInOutManager)
    {
        this.battleMapManager = battleMapManager;
        this.talkWindow       = talkWindow;
        this.talkView         = talkView;
        battleSceneController = new BattleSceneController(this, talkWindow.GetComponent <GUIManager>(), fadeInOutManager, talkView);
    }
 private void Start()
 {
     battleSceneController = BattleSceneController.Instance;
     scenesController      = FindObjectOfType <ScenesController>();
     EnemySpriteSetup(GameManager.Instance.SelectedEnemy);
     RandomBackground();
 }
Beispiel #4
0
 void OnMouseDown()
 {
     if (!selected)
     {
         BattleSceneController.AddToSelectedShips(shipName);
     }
     else
     {
         BattleSceneController.RemoveFromSelectedShips(shipName);
     }
 }
    private void Awake()
    {
        Debug.Log("Loading BattleSceneController");
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        ModalBlocker.SetActive(true);
        ModalBlocker.transform.Find("LoadingOverlay").gameObject.SetActive(true);
    }
Beispiel #6
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;
            if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100))
            {
                //if we hit the background deselect all
                if (hit.transform.gameObject.CompareTag("spacebg"))
                {
                    oldShips = BattleSceneController.GetSelectedShips().ToList();

                    BattleSceneController.RemoveAllSelectShips();
                }
            }
        }
    }
    public void Awake()
    {
        Main = this;

        if (!GameData.Loaded)
        {
            GameData.Load();
        }

        if (GameData.CurrentBattle == null)
        {
            BattlePlayer playerA = new BattlePlayer("Stryfe");
            BattlePlayer playerB = new BattlePlayer("Player Two");

            playerA.AddWarrior(GameData.WarriorTypes["holy_knight"]);
            playerA.AddWarrior(GameData.WarriorTypes["shadow_cleric"]);
            playerA.AddWarrior(GameData.WarriorTypes["ninja"]);

            playerB.AddWarrior(GameData.WarriorTypes["blood_mage"]);
            playerB.AddWarrior(GameData.WarriorTypes["wild_hunter"]);
            playerB.AddWarrior(GameData.WarriorTypes["sorcerer"]);

            GameData.StartBattle(playerA, playerB);
        }

        controllers = new Dictionary <FlowState, IFlowController>();
        controllers.Add(FlowState.AddingWarriors, new Flow_AddWarriors());
        controllers.Add(FlowState.ChooseActorToPerform, new Flow_ChooseActorToPerform());
        controllers.Add(FlowState.PerformAttackLocation, new Flow_PerformAttack());
        controllers.Add(FlowState.PerformMovementLocation, new Flow_PerformMovement());
        controllers.Add(FlowState.FinishPlayerTurn, new Flow_FinishTurn());
        controllers.Add(FlowState.EnemyTurn, new Flow_EnemyTurn());
        controllers.Add(FlowState.GameFinished, new Flow_GameFinished());

        CanvasUtils.Canvas = Canvas;
    }
Beispiel #8
0
 //コンストラクタ
 public BattleSceneReader(BattleSceneController sceneController, BattleTalkManager battleTalkManager)
 {
     //SceneController、actionsを参照させる
     this.sceneController   = sceneController;
     this.battleTalkManager = battleTalkManager;
 }
 public BattleStateBase(BattleSceneController BattleSceneControllerRef)
 {
     BattleSceneControllerCached = BattleSceneControllerRef;
 }
Beispiel #10
0
 public GameObject[] GetAllShipsOfThisType()
 {
     return(BattleSceneController.GetAllShipTypes(shipName));
 }