Exemplo n.º 1
0
    void Update()
    {
        system = MasterScript.RefreshCurrentSystem(heroLocation);

        if (heroMovement.heroIsMoving == false)
        {
            gameObject.transform.position = heroMovement.HeroPositionAroundStar(heroLocation);
        }
    }
Exemplo n.º 2
0
    public void CheckIfCanHire(TurnInfo player, string heroType)
    {
        if (player.wealth >= 50 && player.playerOwnedHeroes.Count < 7)
        {
            int i = MasterScript.RefreshCurrentSystem(GameObject.Find(player.homeSystem));

            GameObject instantiatedHero = (GameObject)Instantiate(MasterScript.heroGUI.heroObject, MasterScript.systemListConstructor.systemList[i].systemObject.transform.position,
                                                                  MasterScript.systemListConstructor.systemList[i].systemObject.transform.rotation);

            instantiatedHero.name = "Basic Hero_" + heroCounter;

            HeroScriptParent tempHero = instantiatedHero.GetComponent <HeroScriptParent>();

            tempHero.heroType = heroType;

            tempHero.heroLocation = MasterScript.systemListConstructor.systemList[i].systemObject;

            tempHero.heroOwnedBy = player.playerRace;

            HeroMovement tempMove = instantiatedHero.GetComponent <HeroMovement>();

            instantiatedHero.transform.position = tempMove.HeroPositionAroundStar(tempHero.heroLocation);

            ++heroCounter;

            player.wealth -= 50;

            player.playerOwnedHeroes.Add(instantiatedHero);

            switch (tempHero.heroType)
            {
            case "Soldier":
                tempHero.classModifier = 1.75f;
                break;

            case "Infiltrator":
                tempHero.classModifier = 1f;
                break;

            case "Diplomat":
                tempHero.classModifier = 1.5f;
                break;
            }
        }
    }