예제 #1
0
    public void cbStartUsingSkill(Object target, params object[] args)
    {
        //If this is a proper skill, then update the character portrait to an acting one
        if (((Skill)args[0]).skillslot != null)
        {
            statePortrait = PortraitState.ACTING;

            SetPortrait();
        }
    }
예제 #2
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();
        }
    }
예제 #3
0
    public void cbOnInjured(Object target, params object[] args)
    {
        //First, double check that we're actually losing health
        if ((int)args[0] >= 0)
        {
            return;
        }

        statePortrait = PortraitState.INJURED;

        SetPortrait();
    }
예제 #4
0
        public async Task changeToHuman()
        {
            switch (currentState)
            {
            case PortraitState.CPU:
                await cursor.changeController();

                await cursor.changeController();

                break;

            case PortraitState.NA:
                await cursor.changeController();

                break;

            default:
                break;
            }
            currentState = PortraitState.CPU;
        }
예제 #5
0
 public MeleePortrait(DolphinAsyncController controller, int player)
 {
     this.controller   = controller;
     this.cursor       = new MeleeCharacterCursor(controller, player);
     this.currentState = PortraitState.NA;
 }
예제 #6
0
    public void cbStopUsingSkill(Object target, params object[] args)
    {
        statePortrait = PortraitState.IDLE;

        SetPortrait();
    }