Пример #1
0
 private void ReadCurrentLifies()
 {
     Lifies = new List <GameObject>();
     foreach (GameObject Lifie in GameObject.FindGameObjectsWithTag("Lifie"))
     {
         Lifies.Add(Lifie);
         Debug.Log("added: " + Lifie.GetComponent <Lifie>().Name);
     }
 }
Пример #2
0
 public void ReadLifieLists()
 {
     Player1Lifies.Clear();
     Player2Lifies.Clear();
     ReadCurrentLifies();
     foreach (GameObject Lifie in Lifies)
     {
         if (Lifie.GetComponent <LifiePlayer>() != null)
         {
             Player1Lifies.Add(Lifie);
         }
         else if (Lifie.GetComponent <LifieCPU>() != null)
         {
             Player2Lifies.Add(Lifie);
         }
     }
     Debug.Log("Lifie Lists: playable: " + Player1Lifies.Count + "\n opponent lifies: " + Player2Lifies.Count);
 }
Пример #3
0
    public void nextTurn()
    {
        playerTurn = !playerTurn;
        ReadLifieLists();

        List <GameObject> tempList1;
        List <GameObject> tempList2;

        if (playerTurn)
        {
            tempList1 = Player1Lifies;
            tempList2 = Player2Lifies;
        }
        else
        {
            tempList1 = Player2Lifies;
            tempList2 = Player1Lifies;
        }

        foreach (GameObject Lifie in tempList1.ToArray())
        {
            Lifie templifie = Lifie.GetComponent <Lifie>();
            templifie.Enable();
            templifie.AP += 20;
            if (templifie.AP > templifie.TotalAP)
            {
                templifie.AP = templifie.TotalAP;
            }
        }

        foreach (GameObject Lifie in tempList2.ToArray())
        {
            Lifie.GetComponent <Lifie>().Disable();
        }


        GameObject.Find("LogBox").GetComponent <LogBox>().SetLogBoxText("Next Turn! Select a Lifie.");
    }
Пример #4
0
    public void CheckForNextTurn()
    {
        ReadLifieLists();
        List <GameObject> tempList;

        if (playerTurn)
        {
            tempList = Player1Lifies;
        }
        else
        {
            tempList = Player2Lifies;
        }
        foreach (GameObject Lifie in tempList)
        {
            if (Lifie.GetComponent <Lifie>().CanWalk)
            {
                return;
            }
        }

        nextTurn();
    }
Пример #5
0
    private void ShowHoveringInfo()
    {
        //GameObject.Find("InfoUI").transform.position = new Vector3(9f, 2, 3.5f);
        GameObject.Find("InfoUI").GetComponent <UI>().AskMovement(InfoUIShownPosition, UITransitionDelay);
        GameObject.Find("HoveringInfoSprite").GetComponent <SpriteRenderer>().sprite = HoveringLifie.GetComponent <SpriteRenderer>().sprite;
        GameObject.Find("HoveringLifieName").GetComponent <Text>().text             = HoveringLifie.Name;
        GameObject.Find("HoveringLifieElement").GetComponent <Text>().text          = HoveringLifie.ElementToString();
        GameObject.Find("HoveringLifieLevel").GetComponent <Text>().text            = HoveringLifie.LevelToString();
        GameObject.Find("HoveringLifieLP").GetComponent <Text>().text               = HoveringLifie.LPToString() + " / " + HoveringLifie.TotalLPToString();
        GameObject.Find("HoveringLifieAP").GetComponent <Text>().text               = HoveringLifie.APToString() + " / " + HoveringLifie.TotalAPToString();
        GameObject.Find("HoveringLifieStatus").GetComponent <Text>().text           = HoveringLifie.StatusConditionToString();
        GameObject.Find("HoveringLifieMovementCapacity").GetComponent <Text>().text = HoveringLifie.MovementCapacityToString();
        GameObject.Find("HoveringLifieStrength").GetComponent <Text>().text         = HoveringLifie.StrengthToString();
        GameObject.Find("HoveringLifieDefense").GetComponent <Text>().text          = HoveringLifie.DefenseToString();
        GameObject.Find("HoveringLifieMagic").GetComponent <Text>().text            = HoveringLifie.MagicToString();
        GameObject.Find("HoveringLifieMagicDefense").GetComponent <Text>().text     = HoveringLifie.MagicDefenseToString();

        Color tempcolor = new Color32(50, 50, 50, 255);

        GameObject.Find("HoveringLifieTileBuffArrow").GetComponent <Text>().enabled = false;
        GameObject.Find("HoveringLifieStrength").GetComponent <Text>().color        = tempcolor;
        GameObject.Find("HoveringLifieDefense").GetComponent <Text>().color         = tempcolor;
        GameObject.Find("HoveringLifieMagic").GetComponent <Text>().color           = tempcolor;
        GameObject.Find("HoveringLifieMagicDefense").GetComponent <Text>().color    = tempcolor;

        string tempstring = "";
        string el1, el2;

        switch (HoveringTile.type)
        {
        case 1:
            el1 = "Strength";
            el2 = "Magic";
            break;

        case 2:
            el1 = "Defense";
            el2 = "Magic Defense";
            break;

        case 3:
            el1 = "Strength";
            el2 = "Defense";
            break;

        case 4:
            el1 = "Strength";
            el2 = "Magic Defense";
            break;

        case 5:
            el1 = "Magic";
            el2 = "Magic Defense";
            break;

        default:
            el1 = el2 = "";
            break;
        }

        if (el1 != "" && el2 != "")
        {
            tempstring = "+50% " + el1 + " and " + el2;
            el1        = Regex.Replace(el1, " ", "");
            el2        = Regex.Replace(el2, " ", "");
            GameObject.Find("HoveringLifieTileBuffArrow").GetComponent <Text>().enabled = true;
            GameObject.Find("HoveringLifie" + el1).GetComponent <Text>().color          = new Color32(0, 183, 0, 255);
            Debug.Log("element 2: " + el2);
            GameObject.Find("HoveringLifie" + el2).GetComponent <Text>().color = new Color32(0, 183, 0, 255);
        }
        GameObject.Find("HoveringLifieTileBuff").GetComponent <Text>().text = tempstring;
    }