Example #1
0
    private void OnCellHighlighted(object sender, EventArgs e)
    {
        //TODO: Käy läpi kaikki naapurit...

        /*(sender as Cell).GetNeighbours(Cells).ForEach(each => {
         *  //Värjätään kaikki cellit, joihin isketään AOE:lla
         * });*/
        CellGridState.OnCellSelected(sender as Cell);
    }
Example #2
0
 public void CanMove()
 {
     //Selects current unit
     if (!canAct)
     {
         canMove = true;
         CellGridState.OnUnitClicked(CurrentUnit);
         CellGridState.SelectMove();
     }
 }
Example #3
0
    public void CanAttack()
    {
        if (!canMove)
        {
            canAct = true;
            CellGridState.OnUnitClicked(CurrentUnit);

            CurrentUnit.CurrentSkill = Skills [0];
            CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit);

            CellGridState.OnCellAttack();
        }
    }
Example #4
0
    private void OnCellClicked(object sender, EventArgs e)
    {
        //Can only move when is units turn and player selected move

        /*if (canMove) CellGridState.OnCellClicked(sender as Cell);
         * else
         * {*/
        if (CellGridState is CellGridStateUnitSelected)
        {
            //TODO: Käy läpi kaikki naapurit...

            /*(sender as Cell).GetNeighbours(Cells).ForEach(each => {
             *  //Värjätään kaikki cellit, joihin isketään AOE:lla
             * });*/
            CellGridState.OnCellClicked(sender as Cell);
        }
    }
Example #5
0
    public void Magic()
    {
        if (!canMove)
        {
            canAct = true;
            CellGridState.OnUnitClicked(CurrentUnit);

            Debug.Log("enters magic");
            CurrentUnit.CurrentSkill = Skills[1];
            if (CurrentUnit.ImaginationPoints >= CurrentUnit.CurrentSkill.IPcost)
            {
                Debug.Log("passes if");
                CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit);
                CellGridState.OnCellAttack();
            }
        }
    }
Example #6
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     if (!EventSystem.current.IsPointerOverGameObject())
     {
         GenericUnit unit = sender as GenericUnit;
         CellGridStateUnitSelected selected = CellGridState as CellGridStateUnitSelected;
         if (unit.PlayerNumber == 0)
         {
         }
         else
         {
             CellGridState.OnUnitClicked(sender as Unit);
             if (!isActionDone && selected.IsUnitInRange(sender as Unit))
             {
                 EndTurn();
             }
         }
     }
 }
Example #7
0
    public void RealityBreak()
    {
        if (!canMove)
        {
            canAct = true;
            CellGridState.OnUnitClicked(CurrentUnit);

            Debug.Log("enters magic");
            CurrentUnit.CurrentSkill = Skills [2];
            if (CurrentUnit.RealityBreak == 100)
            {
                Debug.Log("passes if");

                CurrentUnit.CurrentSkill.SkillActivator(CurrentUnit);

                CellGridState.OnCellAttack();
            }
        }
    }
Example #8
0
    /// <summary>
    /// Method makes turn transitions. It is called by player at the end of his turn.
    /// </summary>

    public void TurnCycle(object sender, System.EventArgs e)//code for a single turn of a unit
    {
        Unit shifted = unitTurnOrder[0];

        unitTurnOrder.RemoveAt(0);
        unitTurnOrder.Add(shifted);

        unitTurnOrder[0].OnTurnStart();

        CurrentPlayerNumber = unitTurnOrder[0].PlayerNumber;
        if (unitTurnOrder[0].PlayerNumber == 0)
        {
            Players[0].Play(this);
            CellGridState.OnUnitClicked(unitTurnOrder[0]);
        }
        else
        {
            Players[1].GetComponent <NaiveAiPlayer>().SinglePlay(this, unitTurnOrder[0]);
        }

        print("Current Num: " + CurrentPlayerNumber);
    }
Example #9
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     CellGridState.OnUnitClicked(sender as Unit);
 }
Example #10
0
 private void OnCellClicked(object sender, EventArgs e)
 {
     CellGridState.OnCellClicked(sender as Cell);
 }
Example #11
0
 private void OnCellHighlighted(object sender, EventArgs e)
 {
     CellGridState.OnCellSelected(sender as Cell);
 }
Example #12
0
 private void OnUnitClicked(Unit unit)
 {
     CellGridState.OnUnitClicked(unit);
 }
Example #13
0
 private void OnCellClicked(Cell cell)
 {
     CellGridState.OnCellClicked(cell);
 }
Example #14
0
 private void OnCellHighlighted(Cell cell)
 {
     CellGridState.OnCellSelected(cell);
 }
Example #15
0
 private void OnCellDehighlighted(Cell cell)
 {
     CellGridState.OnCellDeselected(cell);
 }
Example #16
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     CellGridState.OnUnitClicked(sender as Unit);
     UnityEngine.Debug.Log("選ばれました");
 }
Example #17
0
 private void OnUnitForTargetDeselected(object sender, EventArgs e)
 {
     CellGridState.OnUnitForTargetDeselected(sender as Unit);
 }
Example #18
0
 private void OnCellDehighlighted(object sender, EventArgs e)
 {
     // if(CellGridState != null)
     CellGridState.OnCellDeselected(sender as Cell);
 }
Example #19
0
 public void ActivateAbility(int index)
 {
     CellGridState.OnAbilityActive(index);
 }
Example #20
0
 private void OnUnitClicked(object sender, EventArgs e)
 {
     //Can only attack when is units turn and player selected action
     CellGridState.OnUnitClicked(sender as Unit);
 }
Example #21
0
 // Entity events
 private void OnEntityClicked(object sender, EventArgs e)
 {
     CellGridState.OnEntityClicked(sender as Entity);
 }