Beispiel #1
0
 public bool currentSummonerCanSummon()
 {
     //must have the minimum mana to summon a unit
     if (Turns.getCurrentSummoner().mana < 2)
     {
         return(false);
     }
     //must be places in range to summon to.
     findPlacesToSummon(summonPositions, Turns.getCurrentSummoner().summonRange, Turns.getCurrentSummoner().onMapTile);
     if (summonPositions.Count > 0)
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 //get some input from the user
 void getInput()
 {
     summonOptions[index].GetComponent <SpriteRenderer>().color = Color.green;
     //move down the list
     if (Turns.getCurrentPlayer().getGamepad().isPressed("down") && Time.time - hub.LAST_TIME_DOWN >= 0.1f)
     {
         hub.LAST_TIME_DOWN = Time.time;
         if (index + 1 < summonOptions.Count)
         {
             summonOptions[index].GetComponent <SpriteRenderer>().color = Color.white;
             index++;
             summonOptions[index].GetComponent <SpriteRenderer>().color = Color.green;
         }
     }
     //move up the list
     else if (Turns.getCurrentPlayer().getGamepad().isPressed("up") && Time.time - hub.LAST_TIME_UP >= 0.1f)
     {
         hub.LAST_TIME_UP = Time.time;
         if (index - 1 > -1)
         {
             summonOptions[index].GetComponent <SpriteRenderer>().color = Color.white;
             index--;
             summonOptions[index].GetComponent <SpriteRenderer>().color = Color.green;
         }
     }
     //select a character
     else if (Turns.getCurrentPlayer().getGamepad().isPressed("confirm"))
     {
         hub.LAST_TIME_CONFIRM = Time.time;
         summonOptions[index].GetComponent <SpriteRenderer>().color = Color.white;
         if (selectedChar.cost <= Turns.getCurrentSummoner().mana)
         {
             SummonCharacter(selectedChar);
         }
     }
     //go back to the map
     else if (Turns.getCurrentPlayer().getGamepad().isPressed("cancel"))
     {
         hub.LAST_TIME_CANCEL = Time.time;
         summonOptions[index].GetComponent <SpriteRenderer>().color = Color.white;
         canMove = false;
         hub.CAMERA_CONTROLLER.moveCamera(hub.CURSOR.transform.position);
         hub.CAMERA_CONTROLLER.toggleChildren();
         MoveMenuController.canMove = true;
     }
 }
Beispiel #3
0
 /*
  * I feel like reading this list of summonable things will be easier if they are set up so you see the things you CAN summon first, and then you see the things
  * that you cannot afford. Each of these lists will also be alphabetized!
  */
 void separateLists()
 {
     canAfford.Clear();
     cannotAfford.Clear();
     for (int i = 0; i < summonOptions.Count; i++)
     {
         if (summonOptions[i].c.cost > Turns.getCurrentSummoner().mana)
         {
             summonOptions[i].GetComponent <SpriteRenderer>().color = Color.black;
             cannotAfford.Add(summonOptions[i]);
         }
         else
         {
             summonOptions[i].GetComponent <SpriteRenderer>().color = Color.white;
             canAfford.Add(summonOptions[i]);
         }
     }
 }
Beispiel #4
0
    void SummonCharacter(Character c)
    {
        //set this menu's canMove flag.
        canMove = false;
        //set the other can move flags.
        MoveMenuController.canMove = false;

        //make an instance of this character
        Turns.getCurrentSummoner().spendMana(c.cost);


        //make tiles showing where they can summon
        hub.MakeTiles("SummonTile");

        //tell the cursor to stop caring about the summoner (if it did)
        if (hub.CURSOR.selectedCharacter != null)
        {
            hub.CURSOR.selectedCharacter.setCanMove(false);
            hub.CURSOR.selectedCharacter = null;
        }

        //put that character onto the cursor
        hub.CURSOR.setOnMapTile((MapTile)hub.summonPositions[0]);

        Character chara = hub.makeCharacter(c.name, hub.CURSOR.getOnMapTile());

        //assign the cursor to the character
        hub.CURSOR.canSelect         = false;
        hub.CURSOR.summoning         = true;
        hub.CURSOR.selectedCharacter = chara;
        //let Confirm button place the character and delete the tiles(done in cursor)

        //move the camera
        hub.CAMERA_CONTROLLER.moveCamera(hub.CURSOR.transform.position);
        hub.CAMERA_CONTROLLER.toggleChildren(true);
        hub.CURSOR.confirmFromMoveMenu();
        hub.MOVE_MENU_CONTROLLER.removeMenu();
    }
Beispiel #5
0
 /*
  * Take the stats from the selected character, and display them
  */
 void fillStatPortion()
 {
     GameObject.Find("SelectedStats").GetComponent <TextMesh>().text = "  ATK: " + summonOptions[index].c.attk + "\t\tRNG: " + summonOptions[index].c.attkRange + "\n  DEF: " + summonOptions[index].c.defense + "\t\tMOV:" + summonOptions[index].c.move + "\n\t\t\tZEAL: " + summonOptions[index].c.zeal + "\n" + summonOptions[index].c.description + "\n\t\t\tCost: " + summonOptions[index].c.cost + "\n\t\t\tMana: " + Turns.getCurrentSummoner().mana;
     GameObject.Find("SelectedName").GetComponent <TextMesh>().text  = summonOptions[index].c.name;
     GameObject.Find("StatDisplay").transform.Find("Icon").GetComponent <SpriteRenderer>().sprite = Resources.Load <UnityEngine.Sprite>(summonOptions[index].c.iconPath);
 }