Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        currentHP     = HPLevels[1];
        currentAttack = attackLevels[1];
        equipmentBuffManagerScript = FindObjectOfType <EquipmentBuffManager>();
        thePlayerHealth            = FindObjectOfType <PlayerHealthManager>();
        vitality      = GlobalDataScript.globalPlayerVitality;
        currentLevel  = GlobalDataScript.globalPlayerLevel;
        currentExp    = GlobalDataScript.globalPlayerCurrentXp;
        pointsToSpend = GlobalDataScript.globalPlayerPointsToSpend;
        strength      = GlobalDataScript.globalPlayerStrength;
        dexterity     = GlobalDataScript.globalPlayerDexterity;
        intelligence  = GlobalDataScript.globalPlayerIntelligence;

        if (strength <= 10)
        {
            playerDamage = 2;
        }
        else if (strength >= 11)
        {
            playerDamage = 3;
        }
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        // dodgeDistanceFloat = 3;
        enemyD = FindObjectOfType <EnemyDialogue>();

        dummyGameObject = GameObject.Find("Dummy Object");
        //rayCastHitDodge.size;
        rayCastDodgeArray = new int[100];

        playerObject    = GameObject.Find("Player");
        playerTransform = playerObject.transform;

        layerMaskPlayerInt = 1 << 9;
        layerMaskPlayer    = ~layerMaskPlayerInt;
        layerMaskBoundsInt = 1 << 10;
        layerMaskBounds    = ~layerMaskBoundsInt;
        layerMaskEnemyInt  = 1 << 11;
        layerMaskEnemy     = ~layerMaskEnemyInt;

        rayDodgeDistance = 4;

        playerStats = FindObjectOfType <PlayerStats>();

        playerShield = FindObjectOfType <ShieldBlock>();

        sfxMan = FindObjectOfType <SFXManager>();

        theDM = FindObjectOfType <DialogueManager>();

        staminaMan = GetComponent <PlayerStaminaManager>();

        enemy = FindObjectOfType <EnemyTestScript>();

        playerHealth = FindObjectOfType <PlayerHealthManager>();

        hurtPlayer = FindObjectOfType <HurtPlayerUpdated>();

        hurtEnemy = FindObjectOfType <HurtEnemy>();

        globalData = FindObjectOfType <GlobalDataScript>();

        playerBoundBoxObject = GameObject.Find("Bounds");

        enemyTargetObject = this.gameObject;
        dmObject          = GameObject.Find("Dialogue Manager");
        theDM             = dmObject.GetComponent <DialogueManager>();

        terrainManager = FindObjectOfType <TerrainManager>();

        damagePossible = false;
        attackPossible = true;
        dashPossible   = true;

        anim        = GetComponent <Animator>();
        myRigidbody = GetComponent <Rigidbody2D>();

        if (!playerExists)
        {
            playerExists = true;
            //DontDestroyOnLoad(transform.gameObject);
        }
        else
        {
            //Destroy(gameObject);
        }

        canMove = true;

        lastMove = new Vector2(globalData.globalPlayerLastMoveX, globalData.globalPlayerLastMoveY);

        currentEnemyExists = true;

        if (boundBox == null)
        {
            //boundBox = FindObjectOfType<BoundsScript>().GetComponent<BoxCollider2D>();
            boundBox  = playerBoundBoxObject.GetComponent <BoxCollider2D>();
            minBounds = boundBox.bounds.min;
            maxBounds = boundBox.bounds.max;
        }

        minBounds = boundBox.bounds.min;
        maxBounds = boundBox.bounds.max;

        deathStrike = false;

        playerOldHealth = playerNewHealth;

        strikeBlock = false;

        strikeBlockCounter = 1f;

        noDamageIsTaken = true;

        preAttack   = false;
        recovAttack = false;

        preAttackCounter   = 0.2f;
        recovAttackCounter = 0.3f;
        attackTimeCounter  = 10;

        attackingCounterNew = 0.06f;

        specialMove = false;

        wasMoving      = false;
        wasSprint      = false;
        sprintTimer    = 0.2f;
        sprintPossible = false;

        // if (globalData.globalPlayerLockOn == 1)
        // {
        //     lockOn = false;
        // }
        // else
        // {
        //     lockOn = false;
        // }

        lockOn          = false;
        newListBool     = true;
        switchEnemyBool = true;

        equipmentBuffManagerScript = FindObjectOfType <EquipmentBuffManager>();

        lockOnImage = GameObject.Find("lockOnImage");
        lockOnImage.SetActive(false);
    }