Exemplo n.º 1
0
    void Roll()
    {
        roolInProgress = true;
        rerolled--;
        RerollsCounter.text = (rerolled + 1) + "/" + GameController.Instance.TacticRerolls;

        TinyMessengerHub.Instance.Publish <Msg.StartFightRound>(new Msg.StartFightRound(GameController.Instance.player.FightingGladiator._Id));
        TinyMessengerHub.Instance.Publish <Msg.StartFightRound>(new Msg.StartFightRound(GameController.Instance.player.Opponent._Id));

        ListOfSkills.gameObject.DeleteAllChildreen();
        List <ActiveAbility> abilities = GameController.Instance.player.FightingGladiator.AttackQueue;

        int i = 0;

        foreach (ActiveAbility a in abilities)
        {
            ActionDetails c = (ActionDetails)Instantiate(_ActionDetailItem);
            c.SetAbility(a);
            c.transform.SetParent(ListOfSkills.transform, false);


            c.gameObject.SetActive(false);
            StartCoroutine(PopUp(c.gameObject, 0.25f + i * 0.05f, i >= abilities.Count - 1));

            i++;
        }
    }
Exemplo n.º 2
0
    public void FillWithGladiatorDetails(Gladiator g)
    {
        name.text       = g.Name;
        level.text      = "LVL: " + g.Level;
        adrenaline.text = "ADR: " + g.BaseAdrenaline;
        health.text     = "HP: " + g.BaseLife;

        List <GameObject> children = new List <GameObject>();

        foreach (Transform child in AvatarContainer.transform)
        {
            children.Add(child.gameObject);
        }
        children.ForEach(child => Destroy(child));

        GameObject o = (GameObject)Instantiate(GameController.Instance.GetPrefabForGladiator(g));

        o.transform.SetParent(AvatarContainer.transform, false);
        RectTransform r = o.GetComponent <RectTransform>();

        o.transform.localPosition = new Vector3(-28, -32, 0);

        SkillsList.gameObject.DeleteAllChildreen();
        #region Loading Passive abilities list
        foreach (PassiveAbility p in g.PassiveAbilities)
        {
            ActionDetails c = (ActionDetails)Instantiate(_ActionDetailItem);
            c.SetAbility(p);
            c.transform.SetParent(SkillsList.transform, false);
        }
        #endregion

        #region Loading Active abilities list
        foreach (ActiveAbility ac in g.ActiveAbilities)
        {
            ActionDetails c = (ActionDetails)Instantiate(_ActionDetailItem);
            c.SetAbility(ac);
            c.transform.SetParent(SkillsList.transform, false);
        }
        #endregion
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        TinyTokenManager.Instance.Register <Msg.UpgradeFinished>("LEVEL_UP" + GetInstanceID() + "FIN", (m) => {
            TinyTokenManager.Instance.Unregister <Msg.UpgradeFinished>("LEVEL_UP" + GetInstanceID() + "FIN");

            Destroy(oldGC.gameObject);

            if (levelProgress)
            {
                GameController.Instance.player.FightingGladiator.Level++;

                Gladiator g2          = GameController.Instance.player.FightingGladiator;
                GladiatorController c = Instantiate(GameController.Instance.GetPrefabForGladiator(g2)).GetComponent <GladiatorController>();
                c.Id = g2._Id;
                c.gameObject.transform.position = new Vector3(0, 110, 0);

                c.transform.SetParent(CharacterHolder.transform, false);
                c.SwitchState(GladiatorController.AnimationState.Idle);
            }

            TinyMessengerHub.Instance.Publish <Msg.HideArrowKeys>(new Msg.HideArrowKeys(false));
            TinyTokenManager.Instance.Register <Msg.SelectPerformed>("LEVEL_UP" + GetInstanceID() + "SELECT", (msg) => {
                Unregister();
                StartCoroutine(Finish());
            });
        });

        if (GameController.Instance.player.FightingGladiator.LastLevelUpedAbility.Level > GameController.Instance.player.FightingGladiator.Level)
        {
            levelProgress = true;
        }

        #region Creating Gladiator
        Gladiator g = GameController.Instance.player.FightingGladiator;
        oldGC = Instantiate(GameController.Instance.GetPrefabForGladiator(g)).GetComponent <GladiatorController>();
        oldGC.gameObject.transform.position = new Vector3(0, 110, 0);
        oldGC.Id = g._Id;

        oldGC.transform.SetParent(CharacterHolder.transform, false);
        if (levelProgress)
        {
            oldGC.SwitchState(GladiatorController.AnimationState.Upgrade);
        }
        else
        {
            oldGC.SwitchState(GladiatorController.AnimationState.Idle);
        }
        #endregion

        ActionDetails ab = (ActionDetails)Instantiate(_AbilityHolder);
        ab.transform.SetParent(NewSKill.transform, false);
        ab.SetAbility(GameController.Instance.player.FightingGladiator.LastLevelUpedAbility);

        foreach (ActiveAbility a in GameController.Instance.player.FightingGladiator.EvolvedAbilities)
        {
            ActionDetails abb = (ActionDetails)Instantiate(_AbilityHolder);
            abb.transform.SetParent(OldSkills.transform, false);
            abb.SetAbility(a);
        }

        GameController.Instance.player.FightingGladiator.LastLevelUpedAbility = null;

        TinyMessengerHub.Instance.Publish <Msg.HideArrowKeys>(new Msg.HideArrowKeys(true));

        if (!levelProgress)
        {
            TinyMessengerHub.Instance.Publish <Msg.UpgradeFinished>(new Msg.UpgradeFinished());
        }
    }
Exemplo n.º 4
0
    void Start()
    {
        if (GameController.Instance.player == null)
        {
            return;
        }

        GameController.Instance.player.NumberOfVictories++;

        #region Creating Gladiator
        Gladiator           g = GameController.Instance.player.Opponent;
        GladiatorController c = Instantiate(GameController.Instance.GetPrefabForGladiator(g)).GetComponent <GladiatorController>();
        c.gameObject.transform.position = new Vector3(0, 40, 0);
        c.Id = g._Id;
        if (g._Id == GameController.Instance.player.Opponent._Id)
        {
            c.gameObject.transform.localScale = new Vector3(-1, 1, 1);
        }
        c.transform.SetParent(LooserContainer.transform, false);
        c.SwitchState(GladiatorController.AnimationState.Kneeling);
        #endregion

        FreeSlot.text = "";
        if (GameController.Instance.player.CanAddToParty())
        {
            FreeSlot.gameObject.SetActive(false);
        }
        else
        {
            FreeSlot.gameObject.SetActive(true);
            FreeSlot.text = "You don't have free slots in your party to fit new gladiator";
        }
        abilityLimitReached = false;
        if (GameController.Instance.player.FightingGladiator.PassiveAbilities.Count + GameController.Instance.player.FightingGladiator.ActiveAbilities.Count >=
            GameController.Instance.MaxAbilitiesPerGladiator)
        {
            FreeSlot.gameObject.SetActive(true);
            abilityLimitReached = true;
            FreeSlot.text      += "\nAbility limit reached: " + GameController.Instance.MaxAbilitiesPerGladiator;
        }

        _SelectedAbility = 0;

        #region Loading Opponent skill list
        _LooserList = new List <Ability>();
        foreach (PassiveAbility p in GameController.Instance.player.Opponent.PassiveAbilities)
        {
            _LooserList.Add(p);
        }
        foreach (ActiveAbility a in GameController.Instance.player.Opponent.ActiveAbilities)
        {
            _LooserList.Add(a);
        }
        //removing passive abilities that player already posses
        foreach (PassiveAbility p in GameController.Instance.player.FightingGladiator.PassiveAbilities)
        {
            if (_LooserList.Contains(p))
            {
                _LooserList.Remove(p);
            }
        }

        foreach (Ability p in _LooserList)
        {
            ActionDetails action = Instantiate(ActionDetailsPrefab);
            action.transform.SetParent(LooserSkillsList.transform, false);
            action.SetAbility(p);
        }
        #endregion

        TinyMessengerHub.Instance.Publish <Msg.HideArrowKeys>(new Msg.HideArrowKeys(true));
        StartCoroutine(DecideFait());
    }