public override void StartSelection()
    {
        base.StartSelection();

        //Give a small delay before we return the skill selection
        // so that we can give a chance to clear the stack out
        ContTime.Get().Invoke(Mathf.Min(ContTime.Get().fMaxSelectionTime / 2, 1.5f), SubmitNextSkill);
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        fCurTime += ContTime.Get().fDeltaTime;

        if (fCurTime >= fMaxTime)
        {
            sAnnouncement = "";
            SetText();
        }
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        fCurTime -= ContTime.Get().fDeltaTime;

        if (fCurTime < 0)
        {
            Destroy(this.gameObject);
        }

        SetBarWidth();
    }
Example #4
0
    public void UpdateRecoil()
    {
        if (bRecoiling == false)
        {
            return;
        }

        fCurRecoilTime += ContTime.Get().fDeltaTime;
        goPortrait.transform.localPosition += fRecoilSpeed * v3RecoilDirection * ContTime.Get().fDeltaTime;

        //Debug.Log("x coord is " + goPortrait.transform.localPosition.x);

        //If we've moved past the left boundary
        if (v3RecoilDirection.x >= 0 && goPortrait.transform.localPosition.x >= v3BasePosition.x + fMaxRecoilDistance)
        {
            //Make sure we don't move too far past the edge
            goPortrait.transform.localPosition = new Vector3
                                                     (v3BasePosition.x + fMaxRecoilDistance,
                                                     goPortrait.transform.localPosition.y,
                                                     goPortrait.transform.localPosition.z);

            //Reverse the direction
            v3RecoilDirection *= -1;
            //Debug.Log("reversing");
        }
        else if (v3RecoilDirection.x < 0 && goPortrait.transform.localPosition.x <= v3BasePosition.x - fMaxRecoilDistance)
        {
            //Make sure we don't move too far past the edge
            goPortrait.transform.localPosition = new Vector3
                                                     (v3BasePosition.x - fMaxRecoilDistance,
                                                     goPortrait.transform.localPosition.y,
                                                     goPortrait.transform.localPosition.z);

            //Reverse the direction
            v3RecoilDirection *= -1;
            //Debug.Log("reversing");
        }


        if (fCurRecoilTime > fMaxRecoilTime)
        {
            //Debug.Log(mod.sName + " is ending recoil");
            bRecoiling     = false;
            fCurRecoilTime = 0f;

            //Ensure the position is now equal to the original base position
            goPortrait.transform.localPosition = v3BasePosition;

            //And reset our state back to idle
            statePortrait = PortraitState.IDLE;
            SetPortrait();
        }
    }
    public void InitDefaultOptions()
    {
        //Initially Set the default options
        btnPlyr0Human.bSelected = true;
        subPlayer0SelectedInGroup.NotifyObs(btnPlyr0Human);

        btnPlyr1AI.bSelected = true;
        subPlayer1SelectedInGroup.NotifyObs(btnPlyr1AI);

        ContTime.Get().SetMaxSelectionTime(ContTime.DELAYOPTIONS.MEDIUM);
        btnTimerMedium.bSelected = true;
        subTimerSelectedInGroup.NotifyObs(btnTimerMedium);
    }
    public void HandleFastForwarding()
    {
        //Check if we have a stacked up number of stored inputs that we need to plow through

        if (NetworkMatchReceiver.Get().HasNReadyInputs(nFASTFORWARDTHRESHOLD))
        {
            ContTime.Get().SetAutoFastForward(true);
        }
        else
        {
            ContTime.Get().SetAutoFastForward(false);
        }
    }
    public void cbOnEnter(Object target, params object[] args)
    {
        //Move the overlay onto the screen
        this.transform.position = v3OnScreen;

        ContTime.Get().Pause();

        //Initialize all of the button's action subscription and action groups
        btnPlyr0Human.subClick.Subscribe(cbClickPlyr0Human);
        btnPlyr0AI.subClick.Subscribe(cbClickPlyr0AI);
        btnPlyr1Human.subClick.Subscribe(cbClickPlyr1Human);
        btnPlyr1AI.subClick.Subscribe(cbClickPlyr1AI);
        btnTimerFast.subClick.Subscribe(cbClickTimerFast);
        btnTimerMedium.subClick.Subscribe(cbClickTimerMedium);
        btnTimerInf.subClick.Subscribe(cbClickTimerInf);
        btnRestart.subClick.Subscribe(cbClickRestart);

        //And listen for the open menu shortcut
        KeyBindings.SetBinding(cbOnLeave, KeyCode.Escape);
    }
    public void cbOnLeave(Object target, params object[] args)
    {
        //Move the overlay off of the screen
        this.transform.position = v3OffScreen;

        ContTime.Get().UnPause();

        //Unsubscribe each button action
        btnPlyr0Human.subClick.UnSubscribe(cbClickPlyr0Human);
        btnPlyr0AI.subClick.UnSubscribe(cbClickPlyr0AI);
        btnPlyr1Human.subClick.UnSubscribe(cbClickPlyr1Human);
        btnPlyr1AI.subClick.UnSubscribe(cbClickPlyr1AI);
        btnTimerFast.subClick.UnSubscribe(cbClickTimerFast);
        btnTimerMedium.subClick.UnSubscribe(cbClickTimerMedium);
        btnTimerInf.subClick.UnSubscribe(cbClickTimerInf);
        btnRestart.subClick.UnSubscribe(cbClickRestart);

        //And listen for the open menu shortcut
        KeyBindings.SetBinding(cbOnEnter, KeyCode.Escape);
    }
Example #9
0
    public void StartTimeoutTimer(ContTurns.STATETURN stateTurn)
    {
        if (fTimeoutTimer != 0.0f)
        {
            //If the timer is already going, then we don't need to start it again
            return;
        }

        //Save the current turnstate we're processing
        stateTurnWaitingOn = stateTurn;

        if (stateTurn == ContTurns.STATETURN.CHOOSESKILL)
        {
            //TODO - only enforce the full time if we're waiting on the active player
            //just piggy-back off the local player's selection
            // TODO - sync this variable up among all players
            fTimeoutTimer = ContTime.Get().fMaxSelectionTime;
        }
        else
        {
            fTimeoutTimer = fTimeoutStandard;
        }
    }
 public void OnToggleFastForward()
 {
     ContTime.Get().SetManualFastForward(togFastForward.isOn);
 }
    public void cbClickTimerInf(Object target, params object[] args)
    {
        ContTime.Get().SetMaxSelectionTime(ContTime.DELAYOPTIONS.INF);

        subTimerSelectedInGroup.NotifyObs(target);
    }