Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        playerStamina      = FindObjectOfType <PlayerStaminaManager>();
        playerHealthObject = GameObject.Find("Player");
        playerHealth       = playerHealthObject.GetComponent <PlayerHealthManager>();
        playerRanged       = playerHealthObject.GetComponent <PlayerRangedAttack>();
        shieldBlockScript  = FindObjectOfType <ShieldBlock>();
        playerStatsScript  = FindObjectOfType <PlayerStats>();

        daggerTextObject  = GameObject.Find("DaggerText");
        shieldTextObject  = GameObject.Find("ShieldText");
        shieldImageObject = GameObject.Find("ShieldImage");
        potionText        = GameObject.Find("PotionText").GetComponent <Text>();

        shieldTextObject.SetActive(false);
        shieldImageObject.SetActive(false);

        // daggerImageObject.GetComponent<Image>().Sprite = YourSprite;

        if (!UIExists)
        {
            UIExists = true;
            //DontDestroyOnLoad(transform.gameObject);
        }

        else
        {
            //Destroy(gameObject);
        }

        thePS = GetComponent <PlayerStats>();
    }
Beispiel #2
0
    // Use this for initialization
    void Start()
    {
        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        thePlayer = FindObjectOfType <PlayerController>();

        sfxMan = FindObjectOfType <SFXManager>();

        shield = FindObjectOfType <ShieldBlock>();

        thePS = FindObjectOfType <PlayerStats>();

        enemy = FindObjectOfType <EnemyTestScript>();

        playerHealth = FindObjectOfType <PlayerHealthManager>();
        hurtEnemy    = FindObjectOfType <HurtEnemy>();

        enemyHealth = FindObjectOfType <EnemyHealthManager>();

        playerEngagement = FindObjectOfType <EngagedWithPlayer>();

        // enemyStaminaMan = FindObjectOfType<EnemyStaminaManager>();

        deathStrike = false;

        showBlood          = false;
        playerStaminaDrain = false;
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        playerStamina = FindObjectOfType <PlayerStaminaManager>();

        thePlayer = FindObjectOfType <PlayerController>();

        staminaTellCounter      = 1;
        staminaTellCounterStart = false;
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     playerStamina    = FindObjectOfType <PlayerStaminaManager>();
     hurtPlayer       = FindObjectOfType <HurtPlayerUpdated>();
     sfxMan           = FindObjectOfType <SFXManager>();
     playerEngagement = FindObjectOfType <EngagedWithPlayer>();
     playerShield     = FindObjectOfType <ShieldBlock>();
     counter          = 0;
 }
Beispiel #5
0
    // Use this for initialization
    void Start()
    {
        this.gameObject.name   = "Thomas";
        enemyObject            = this.gameObject;
        engageWithPlayerObject = this.gameObject.transform.GetChild(0).gameObject;
        enemyHealthMan         = enemyObject.GetComponent <EnemyHealthManager>();
        // enemyStaminaMan = enemyObject.GetComponent<EnemyStaminaManager>();
        playerEngagement = engageWithPlayerObject.GetComponent <EngagedWithPlayer>();
        stalkZoneObject  = this.gameObject.transform.GetChild(7).gameObject;
        stalkZone        = stalkZoneObject.GetComponent <RecognizeStalkZone>();

        rangedAttack = enemyObject.GetComponent <EnemyRangedAttack>();

        playerHealthMan  = FindObjectOfType <PlayerHealthManager>();
        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        playerHealth = FindObjectOfType <PlayerHealthManager>();

        hurtPlayer = FindObjectOfType <HurtPlayerUpdated>();
        randomMove = FindObjectOfType <RandomMovement>();

        //this needs to grab child object script
        //playerEngagement = FindObjectOfType<EngagedWithPlayer>();

        playerObject = GameObject.Find("Player");
        thePlayer    = playerObject.GetComponent <PlayerController>();
        target       = playerObject;

        dodgeCounter = 2.2f;

        tellCounter = 0.5f;
        actionTimer = 0.2f;

        enemyHurtCounter = 2;

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

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

        // dodging = true;
        // dodgeFirstTime = true;

        //For now enemy will always have a correct line of sight and the fleeing system is not yet set up.
        fleeTwo      = false;
        dodgingThree = false;

        followToDeath = false;
    }
 private void Start()
 {
     playerStaminaManager    = GetComponent <PlayerStaminaManager>();
     playerAnimationsManager = GetComponent <PlayerAnimationsManager>();
     playerMovementManager   = GetComponent <PlayerMovementManager>();
     playerExperienceManager = GetComponent <PlayerExperienceManager>();
     playerHealthManager     = GetComponent <PlayerHealthManager>();
     audioManager            = FindObjectOfType <AudioManager>();
 }
    // Use this for initialization
    void Start()
    {
        this.gameObject.name   = "Fred";
        enemyObject            = this.gameObject;
        engageWithPlayerObject = this.gameObject.transform.GetChild(0).gameObject;
        enemyHealthMan         = enemyObject.GetComponent <EnemyHealthManager>();
        // enemyStaminaMan = enemyObject.GetComponent<EnemyStaminaManager>();
        playerEngagement = engageWithPlayerObject.GetComponent <EngagedWithPlayer>();
        stalkZoneObject  = this.gameObject.transform.GetChild(7).gameObject;
        stalkZone        = stalkZoneObject.GetComponent <RecognizeStalkZone>();

        raycastPath = enemyObject.GetComponent <TrackingRaycast>();

        playerHealthMan  = FindObjectOfType <PlayerHealthManager>();
        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        playerHealth = FindObjectOfType <PlayerHealthManager>();

        hurtPlayer = FindObjectOfType <HurtPlayerUpdated>();

        playerObject = GameObject.Find("Player");
        thePlayer    = playerObject.GetComponent <PlayerController>();
        target       = playerObject;

        enemyShieldStrike          = false;
        shieldBreakRecoveryCounter = 0.5f;

        dodgeCounter = 2.2f;

        tellCounter = 0.5f;
        actionTimer = 0.2f;

        enemyHurtCounter = 2;

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

        if (!enemyExists)
        {
            enemyExists = true;
        }

        dodging        = true;
        dodgeFirstTime = true;

        isPathfinding   = false;
        retreatingThree = false;
        shieldUpTwo     = false;

        followToDeath = false;

        blockCounterMax   = UnityEngine.Random.Range(2, 4);
        blockCounterTimer = 1.5f;
    }
Beispiel #8
0
 // Update is called once per frame
 void Update()
 {
     thePlayer          = FindObjectOfType <PlayerController>();
     playerHealth       = FindObjectOfType <PlayerHealthManager>();
     playerStamina      = FindObjectOfType <PlayerStaminaManager>();
     playerRangedAttack = FindObjectOfType <PlayerRangedAttack>();
     playerStatsScript  = FindObjectOfType <PlayerStats>();
     startPoint         = FindObjectOfType <PlayerStartPoint>();
     globalDataScript   = FindObjectOfType <GlobalDataScript>();
     itemSlotManager    = FindObjectOfType <ItemSlotManager>();
     curLvl             = SceneManager.GetActiveScene().name;
 }
    // Use this for initialization
    void Start()
    {
        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        thePlayer = FindObjectOfType <PlayerController>();

        FindObjectOfType <HurtPlayer>();
        playerStatsScript = FindObjectOfType <PlayerStats>();

        shieldOn = false;

        shieldLockBool   = false;
        shieldBlocksLeft = ShieldBlocksLeft();
        shieldBlockTimer = 1f;
    }
    // Use this for initialization
    void Start()
    {
        hurtPlayer = FindObjectOfType <HurtPlayerUpdated>();

        playerStaminaMan = FindObjectOfType <PlayerStaminaManager>();

        thePlayer = FindObjectOfType <PlayerController>();

        sfxMan = FindObjectOfType <SFXManager>();

        shield = FindObjectOfType <ShieldBlock>();

        thePS           = FindObjectOfType <PlayerStats>();
        enemyGameObject = this.gameObject.transform.parent.gameObject;
        enemy           = enemyGameObject.GetComponent <EnemyTestScript>();
        rangedEnemy     = enemyGameObject.GetComponent <BasicRangedEnemy>();
        enemyMaster     = enemyGameObject.GetComponent <EnemyMasterScript>();
        enemyTransform  = enemyGameObject.transform;

        rangedAttack = enemyGameObject.GetComponent <EnemyRangedAttack>();

        playerHealth         = FindObjectOfType <PlayerHealthManager>();
        hurtEnemy            = FindObjectOfType <HurtEnemy>();
        playerShield         = FindObjectOfType <ShieldBlock>();
        hitPoint             = GameObject.Find("Player").transform;
        bloodCounter         = 10;
        deathStrike          = false;
        thePlayerDeathStrike = false;

        playerStaminaDrain = false;

        faceOff = false;

        check = 0;

        beforeRecov = true;

        enemyAttackCounter  = 1f;
        enemyDamagePossible = false;

        preAttack   = false;
        recovAttack = false;

        preAttackCounter   = 0.6f;
        recovAttackCounter = 0.3f;
        enemyAttackCounter = 0.06f;
        freezeFrame        = 1f;
    }
    // Use this for initialization
    void Awake()
    {
        playerStats           = FindObjectOfType <PlayerStats>();
        pauseMenuScript       = FindObjectOfType <PauseMenu>();
        playerHealthScript    = FindObjectOfType <PlayerHealthManager>();
        playerStaminaScript   = FindObjectOfType <PlayerStaminaManager>();
        itemSlotManagerScript = FindObjectOfType <ItemSlotManager>();

        VitalityButton     = GameObject.Find("VitalityButton");
        StrengthButton     = GameObject.Find("StrengthButton");
        DexterityButton    = GameObject.Find("DexterityButton");
        IntelligenceButton = GameObject.Find("IntelligenceButton");

        ItemSlot0AButton = GameObject.Find("ItemSlot0AButton");
        ItemSlot0BButton = GameObject.Find("ItemSlot0BButton");
        ItemSlot0CButton = GameObject.Find("ItemSlot0CButton");
        ItemSlot0DButton = GameObject.Find("ItemSlot0DButton");
        ItemSlot0EButton = GameObject.Find("ItemSlot0EButton");
        ItemSlot1AButton = GameObject.Find("ItemSlot1AButton");
        ItemSlot1BButton = GameObject.Find("ItemSlot1BButton");
        ItemSlot1CButton = GameObject.Find("ItemSlot1CButton");
        ItemSlot1DButton = GameObject.Find("ItemSlot1DButton");
        ItemSlot1EButton = GameObject.Find("ItemSlot1EButton");
        ItemSlot2AButton = GameObject.Find("ItemSlot2AButton");
        ItemSlot2BButton = GameObject.Find("ItemSlot2BButton");
        ItemSlot2CButton = GameObject.Find("ItemSlot2CButton");
        ItemSlot2DButton = GameObject.Find("ItemSlot2DButton");
        ItemSlot2EButton = GameObject.Find("ItemSlot2EButton");
        ItemSlot3AButton = GameObject.Find("ItemSlot3AButton");
        ItemSlot3BButton = GameObject.Find("ItemSlot3BButton");
        ItemSlot3CButton = GameObject.Find("ItemSlot3CButton");
        ItemSlot3DButton = GameObject.Find("ItemSlot3DButton");
        ItemSlot3EButton = GameObject.Find("ItemSlot3EButton");

        HeadSlotButton  = GameObject.Find("HeadButton");
        BodyArmorButton = GameObject.Find("BodyArmorButton");
        GlovesButton    = GameObject.Find("GlovesButton");
        BootsButton     = GameObject.Find("BootsButton");
        RingOneButton   = GameObject.Find("RingOneButton");
        RingTwoButton   = GameObject.Find("RingTwoButton");
        RingThreeButton = GameObject.Find("RingThreeButton");
        RingFourButton  = GameObject.Find("RingFourButton");

        descriptionText = GameObject.Find("DescriptionText").GetComponent <Text>();

        justSwitched = true;
    }
    void Start()
    {
        sfxMan = FindObjectOfType <SFXManager>();

        enemyHit       = false;
        thePlayer      = FindObjectOfType <PlayerController>();
        hurtPlayer     = FindObjectOfType <HurtPlayerUpdated>();
        staminaManager = FindObjectOfType <PlayerStaminaManager>();
        playerStats    = FindObjectOfType <PlayerStats>();

        thePS = FindObjectOfType <PlayerStats>();

        recovVar = false;

        damageToGive = thePS.playerDamage;
        freezeFrame  = 0.8f;
    }
    // Use this for initialization
    void Start()
    {
        playerStamina      = FindObjectOfType <PlayerStaminaManager>();
        playerHealthObject = GameObject.Find("Player");
        playerHealth       = playerHealthObject.GetComponent <PlayerHealthManager>();
        playerRanged       = playerHealthObject.GetComponent <PlayerRangedAttack>();
        shieldBlockScript  = FindObjectOfType <ShieldBlock>();
        playerStatsScript  = FindObjectOfType <PlayerStats>();

        daggerTextObject  = GameObject.Find("DaggerText");
        shieldTextObject  = GameObject.Find("ShieldText");
        shieldImageObject = GameObject.Find("ShieldImage");
        potionText        = GameObject.Find("PotionText").GetComponent <Text>();

        shieldTextObject.SetActive(false);
        shieldImageObject.SetActive(false);

        if (!UIExists)
        {
            UIExists = true;
        }

        thePS = GetComponent <PlayerStats>();
    }
Beispiel #14
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);
    }