Exemplo n.º 1
0
    private void Update()
    {
        move             = CM.getIsMoved();
        side             = CM.getSide();
        atackStatus      = FM._getProcess();
        atackStatusClass = FM._getAnimationProcessAttackClass();

        findChange();
    }
    void getPresentReason()
    {
        presentReason = new int[12];

        for (int i = 0; i < presentReason.Length; i++)
        {
            presentReason[i] = -1;
        }

        // 0 - Target type
        // 1 - Target move
        // 2 - Target action
        // 3 - Target HP
        // 4 - Target Balance
        // 5 - Target Mana

        // 6 -  distance
        // 7 -  Self Move
        // 8 -  Self Action
        // 9 -  Self HP
        // 10 - Self Balance
        // 11 - Self Mana



        bool tst = Target.tag == "Char";

        presentReason[0] = tst?1:0;

        if (tst)
        {
            presentReason[1] = TargetCharMove.getIsMoved() ? 1:0;
            presentReason[2] = TargetFightManager._getProcess();
            presentReason[3] = (int)(((float)TargetHelth._getHealth() / (float)TargetHelth._getHealthMax()) * 100);
            presentReason[4] = (int)(((float)TargetHelth._getBalance() / (float)TargetHelth._getBalancehMax()) * 100);
            presentReason[5] = (int)(((float)TargetHelth._getMana() / (float)TargetHelth._getManaMax()) * 100);

            presentReason[6] = (int)(Vector2.Distance(
                                         new Vector2(transform.position.x, transform.position.y),
                                         new Vector2(Target.transform.position.x, Target.transform.position.y)) * 10);

            presentReason[7]  = SelfCharMove.getIsMoved() ? 1 : 0;
            presentReason[8]  = SelfFightManager._getProcess();
            presentReason[9]  = (int)(((float)SelfHelth._getHealth() / (float)SelfHelth._getHealthMax()) * 100);
            presentReason[10] = (int)(((float)SelfHelth._getBalance() / (float)SelfHelth._getBalancehMax()) * 100);
            presentReason[11] = (int)(((float)SelfHelth._getMana() / (float)SelfHelth._getManaMax()) * 100);
        }
    }