Exemplo n.º 1
0
        private void ToggleBonusOfExistingFocusTokens(bool isActive)
        {
            FocusToken FocusToken = (FocusToken)HostShip.Tokens.GetToken(typeof(FocusToken));

            if (FocusToken != null)
            {
                FocusToken.Temporary = !isActive;
            }
        }
Exemplo n.º 2
0
    private FocusToken GetFocusToken(Being focusTarget, Being FocusOwner)
    {
        FocusToken ft = new FocusToken(parentBeing, parentBeing, -1f);

        for (int i = 0; i < FocusOwner.focus.Count; i++)
        {
            if (FocusOwner.focus[i].target == focusTarget)
            {
                ft = FocusOwner.focus[i];
            }
        }

        return(ft);
    }
Exemplo n.º 3
0
    //Populate the focus list within a given being
    private void PopulateFocusList()
    {
        ClearMenu();
        if (being.focus.Count == 0)
        {
            //Create a focus token to represent the parent being (the one who's opening this menu) and set the amount of focus to howevermuch the being has
            FocusToken focusToken = new FocusToken(being, being, being.GetResource("FOCUS").current);
            //Add it to the beings focus list so it's always the first/last
            being.focus.Add(focusToken);

            for (int i = 0; i < actionManager.LIST1.Count; i++)
            {
                if (actionManager.LIST1[i].being != being)
                {
                    FocusToken focusToken2 = new FocusToken(being, actionManager.LIST1[i].being, 0f);
                    being.focus.Add(focusToken2);
                }
            }
        }
    }
Exemplo n.º 4
0
    public void OnPointerClick(PointerEventData eventData)
    {
        Debug.Log("Action name: " + this.actionName);
        Debug.Log("PHASE: " + MatchDatas.getCurrentPhase());

        if (MatchDatas.getCurrentPhase() == MatchDatas.phases.ACTION)
        {
            IToken token = null;

            switch (this.actionName)
            {
            case "focus":
                token = new FocusToken();
                break;

            case "evade":
                token = new EvadeToken();
                break;

            case "target lock":
                break;

            case "boost":
                break;

            case "barrel roll":
                break;

            case "slam":
                break;

            case "reinforce":
                break;

            case "cloak":
                break;

            case "decloak":
                break;

            case "coordinate":
                break;

            case "jam":
                break;

            case "recover":
                break;

            case "reload":
                break;

            case "rotate arc":
                break;
            }

            if (token != null)
            {
                Debug.Log("Adding token...");
                MatchDatas.getPlayers()[MatchDatas.getActivePlayerIndex()].getActiveShip().addToken(token);
                MatchDatas.getPlayers()[MatchDatas.getActivePlayerIndex()].getActiveShip().registerPreviousAction(this.actionName);
            }

            // TODO Check if multiple actions can be chosen!
            // TODO Deactivate actions!!!!
        }

        if (GameObject.Find("ActionChoserPopup") != null && MatchDatas.getPlayers()[MatchDatas.getActivePlayerIndex()].getActiveShip().getNumOfActions() == 0)
        {
            GameObject.Find("ActionChoserPopup").gameObject.SetActive(false);
            PhaseHandlerService.endActionPhase();
        }
    }
Exemplo n.º 5
0
 public void Initialize(FocusToken focusToken)
 {
     this.focusToken = focusToken;
     textOb.text     = focusToken.GetFocusTarget().beingName;
     valueOb.text    = "" + focusToken.GetAttibutedFocus();
 }