private void OnTriggerEnter2D(Collider2D enemyColl) { Vector2 enemySideDistance = hitDistance; enemyHP = enemyColl.gameObject.GetComponentInParent <EnemyHealthManager>(); bossHP = enemyColl.GetComponentInParent <BossPatrolManager>(); bombHP = enemyColl.GetComponent <BombController>(); bulletController = enemyColl.GetComponent <BulletHit>(); if (enemyHP != null) { if (enemyColl.transform.position.x < transform.position.x) { enemySideDistance.x *= -1;//is on ur right } else { enemySideDistance.x *= 1;//is on ur left } enemyHP.TakeDamage(damageToGive, knockbackDuration, enemySideDistance, hitStopDuration); if (shouldScreenshakeOnHit) { Screenshake(); } if (player != null) { player.AddMeter(meterToGive); } } if (bombHP != null) { if (enemyColl.transform.position.x < transform.position.x) { enemySideDistance.x *= -1;//is on ur right } else { enemySideDistance.x *= 1;//is on ur left } bombHP.TakeDamage(damageToGive); //bombHP.DoStopAndKnockback(knockbackDuration, enemySideDistance, hitStopDuration); if (shouldScreenshakeOnHit) { Screenshake(); } } if (bulletController != null) { bulletController.ReverseForce(); } if (shouldHitStop) { player.DoHitStop(hitStopDuration); } if (hitSpark != null) { hitSpark.Play(); } }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); ShotTimerSet = false; InAir = false; justJumped = false; shotOneAngled = false; shotTwoAngled = false; WillGroundShot = false; pullBackSoundPlayed = false; initialSecondTimer = SecondShotTimer; initialJumpTimer = jumpTimer; Health = GetComponent <EnemyHealthManager>(); FirstDeath = false; if (FirstTimeAlive) { HitTheGroundFirstTime = false; anim.SetInteger("State", 3); } else { HitTheGroundFirstTime = true; } }
void Start() { myVars = GetComponent <Squadron>(); healthMgr = GetComponent <EnemyHealthManager>(); powerupMgr = GetComponent <FodderPowerupMgr>(); deathEffect = myVars.DeathEffect; }
// Use this for initialization void Start() { StartingPos = transform.localPosition; StartingScale = transform.localScale; startingSpeedX = speedX; startingSpeedY = speedY; hasShot = false; startFight = false; EHM = GetComponent <EnemyHealthManager>(); anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); //BossMove(speedX, speedY); SORL = FindObjectOfType <StartOrResetLevel>(); initChangeAnimTimer = ChangeAnimTimer; projectilePos = transform.Find("projectilePos"); projectilePos2 = transform.Find("projectilePos2"); FirstShot = 2f; AnimTransition = false; AnimTimeIncrement = 1; }
//public AudioSource starHitSound; // Use this for initialization void Start() { theLevelManager = GetComponent <LevelManager> (); myEnemyHealthManager = GetComponent <EnemyHealthManager> (); myRigidbody = GetComponent <Rigidbody2D> (); //starHitSound = GameObject.Find ("Star Hit Sound").GetComponent<AudioSource> (); }
// Use this for initialization void Start() { thePS = FindObjectOfType <PlayerStats> (); damageToGiveHelp = FindObjectOfType <FloatingNumbersEnemy> (); theWeapon = FindObjectOfType <WeaponManager> (); theEHM = FindObjectOfType <EnemyHealthManager> (); }
// Use this for initialization void Start() { GameObject BlackBee = GameObject.FindGameObjectWithTag("Enemy"); health = BlackBee.GetComponent <EnemyHealthManager>(); slider = GetComponent <Slider>(); }
void Awake() { player = GameObject.Find("Champ").GetComponent <EnemyHealthManager>(); what = GameObject.Find("DmgCounter").GetComponent <WhatIsMyDmg>(); Invoke("WakeMeUpBeforeYouGoGo", 0.8f); Invoke("destroy", 4f); }
// Use this for initialization void Start() { StartingLoc.position = transform.localPosition; phaseOneActivated = false; phaseTwoActivated = false; phaseThreeActivated = false; hasMovedForPhase3 = false; beginPhaseThreeTimer = 3f; movedUpPhase3 = false; movedDownPhase3 = false; hasMovedForPhase4 = false; movedDownPhase4 = false; movedLeftPhase4 = false; P3 = false; EHM = GetComponent <EnemyHealthManager>(); SORL = FindObjectOfType <StartOrResetLevel>(); sr = GetComponent <SpriteRenderer>(); HurtPlayer = GetComponent <HurtPlayerOnContact>(); }
// Use this for initialization void Start() { boneProjPos = transform.Find("boneProjectilePos"); bloodProjPos = transform.Find("bloodProjectilePos"); phaseTwoCounter = 1.5f; Wendigo = GetComponent <Boss03Manager>(); // = GetComponent<Phase2BoneProj>(); BloodChangeTimer = 0; BloodRotationAngle = 0; isPushingBack = false; player = GetComponent <PlayerManager>(); PBR = GetComponent <PushBackRoar>(); rain = GetComponent <RainingBlood>(); EHM = GetComponent <EnemyHealthManager>(); SORL = FindObjectOfType <StartOrResetLevel>(); pushBackTimer = 7f; phaseTwoActivated = false; BeginPhaseTwo = 3f; RainBloodCounter = 2f; StartedRaining = false; isSpitting = false; isRoaring = false; hasSpitOnce = false; hasJumpedTwice = 0; hasWaited = false; rainRoarAnim = false; }
// Use this for initialization void Start() { thePlayerStats = FindObjectOfType <PlayerStats> (); hurtEn = FindObjectOfType <HurtEnemy> (); theEHM = FindObjectOfType <EnemyHealthManager> (); theWeapon = FindObjectOfType <WeaponManager> (); }
// 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; }
// Use this for initialization void Start() { //starting variables StartingPos = transform.localPosition; StartingScale = transform.localScale; facingLeft = true; anim = GetComponent <Animator>(); rb = GetComponent <Rigidbody2D>(); isIdle = true; player = GameObject.FindGameObjectWithTag("Player"); distanceBetween = player.transform.position.x - transform.position.x; EHM = GetComponent <EnemyHealthManager>(); P2 = GetComponent <Boss03Phase2>(); SORL = FindObjectOfType <StartOrResetLevel>(); //phase 1 variables playerFound = false; atPlayerLoc = false; swingCountdown = 0; swingFinished = false; jumpFinished = false; count = 0.8f; hasJumped = false; isJumping = false; isSwinging = false; jumpCounter = 0; phaseOneCounter = 1.5f; phaseOneActivated = false; BeginFightTimer = 3f; BatTimer = 0f; SquatTimer = 0.5f; }//end Start()
// Use this for initialization void Start() { LeftWarning.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0); RightWarning.GetComponent <SpriteRenderer>().color = new Color(1, 1, 1, 0); HorizProjTop = transform.Find("Top"); HorizProjBottom = transform.Find("Bottom"); VertProjLeft = transform.Find("Left"); VertProjRight = transform.Find("Right"); EHM = FindObjectOfType <EnemyHealthManager>(); BM = FindObjectOfType <Boss02Manager>(); SORL = FindObjectOfType <StartOrResetLevel>(); BeginCastingAll = false; projDelayCounter = projDelay; count3shots = 0; count2shots = 0; firstCast = false; WarningOpacity = false; SealCounter = 0; WhichWarning = LeftWarning; }
void Awake() { enemyHealthManager = GetComponent <EnemyHealthManager>(); enemy5Animator = GetComponent <Animator>(); enemySpriteRenderer = GetComponent <SpriteRenderer>(); enemyMovementHandler = GetComponent <EnemyFollowerMovement>(); }
private void Start() { numberOfDrops = 1; itemFactory = GetComponent <ItemFactory>(); enemyHealthManager = GetComponent <EnemyHealthManager>(); enemyHealthManager.OnDeath += DropItem; }
void Awake() { isInvincible = true; canShoot = true; scoreManager = FindObjectOfType <ScoreManager> (); formationController = FindObjectOfType <FormationController> (); enemyHealthManager = GetComponent <EnemyHealthManager> (); if (scoreManager.score <= 50) { difficulty = (scoreManager.score / 10); } else { difficulty = 5; } enemySpeed = formationController.formationSpeed + difficulty; if (difficulty < 3) { enemyHealthManager.enemyHealth = 1 + difficulty; } else { enemyHealthManager.enemyHealth = 3; } pauseManager = FindObjectOfType <PauseManager> (); shootCooldown = 0f; }
private void Start() { if (enemyHM == null) { enemyHM = GetComponentInParent <EnemyHealthManager>(); } }
//Clown_EnemyHealthManager clown; private void OnCollisionEnter2D(Collision2D col) { // if hits anything with tag "Environment", destroy the instance of the bullet if (col.transform.tag == "Environment") { //Debug.Log ("hit"); Destroy(this.gameObject); } if (col.transform.tag == "Enemy") { //Debug.Log ("Enemy Hit"); e = col.gameObject.GetComponent <EnemyHealthManager>(); e.Water_HurtEnemy(1); Destroy(this.gameObject); } if (col.transform.tag == "ClownEnemy") { //Debug.Log ("Enemy Hit"); //clown=col.gameObject.GetComponent<Clown_EnemyHealthManager>(); Destroy(this.gameObject); } }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); RotatingSkullIsOut = false; EmitTimerSet = false; isBeingDestroyed = false; initExploTimer = skullExploTimer; fanAttackSent = false; Health = GetComponent <EnemyHealthManager>(); FirstDeath = false; fadeInc = 0f; sr = GetComponent <SpriteRenderer>(); if (FirstTimeAlive) { readyToAttack = false; readyToMove = false; anim.SetInteger("State", 0); } else { readyToAttack = true; } }
void Start() { nav = GetComponent <NavMeshAgent>(); if (tag == "EnemyRed") { changeMe.tag = "MinionCenterRed"; } if (tag == "EnemyBlue") { changeMe.tag = "MinionCenterBlue"; } health = GetComponent <EnemyHealthManager>(); anim = GetComponent <Animator>(); GameObject[] minion; minion = GameObject.FindGameObjectsWithTag("Minion"); agent = GetComponent <NavMeshAgent>(); agent.updatePosition = true; state = MinonAI.State.PATROL; alive = true; StartCoroutine("FSM"); }
void Start() { target = GameObject.FindGameObjectWithTag("Player").transform; enemyHealthManager = transform.GetComponent <EnemyHealthManager>(); enemyEmitterManager = transform.GetComponentInChildren <EnemyAttackManager>(); StartCoroutine("AttackTargetDelay"); }
public void ApplyEffectsOnEnemies(GameObject enemy, PowerUpController.Effects activatedEffect) { EnemyStateMachine enemyStateMachine = enemy.GetComponent <EnemyStateMachine>(); EnemyHealthManager enemyHealthManager = enemy.GetComponent <EnemyHealthManager>(); // Even when the list is empty // ICE LV 2 doesn't needs ICE LV 1 to happen in the same attack if (PowerUpController.IceLevel > 1 && enemyStateMachine.IsFrozen) { Debug.Log("SHATTERING ENEMY"); PowerUpEffects.ShatterEnemy(enemy, PlayerStatsController.ShatterDamage); } // Choosing between all the activated effects switch (activatedEffect) { case PowerUpController.Effects.Fire: //Debug.Log("FIRE CHOSEN"); PowerUpEffects.BurnEnemy(enemy, PlayerStatsController.FireDamage); if (PowerUpController.FireLevel > 1 && enemyStateMachine.IsOnFire && enemyStateMachine.WillDieBurned) { // FIRE LV 2 Debug.Log("BURNING ENEMY TO THE DEATH"); PowerUpEffects.BurnEnemyToDeath(enemy); } break; case PowerUpController.Effects.Ice: if (!enemyStateMachine.IsParalyzed) { PowerUpEffects.FreezeEnemy(enemy, PlayerStatsController.FrostDuration); } break; case PowerUpController.Effects.Thunder: //Debug.Log("THUNDER CHOSEN"); PowerUpEffects.FindCloseEnemies(enemy, PlayerStatsController.ElectricRange, PlayerStatsController.ElectricalDamage); // AND DEALS DAMAGE TO THEM // THUNDER LV 2 if (PowerUpController.ElectricLevel >= 2) { if (enemyStateMachine.IsPrimaryTarget && Random.Range(1, 100) < PlayerStatsController.ElectricAttackRate) { if (!enemyStateMachine.IsFrozen) { PowerUpEffects.ParalyzeEnemy(enemy, PlayerStatsController.ParalyzeDuration); //Debug.Log("PARALIZADO"); } } } enemyStateMachine.IsPrimaryTarget = false; break; } }
private void Start() { enemyHp = transform.parent.GetComponent <EnemyHealthManager>(); if (enemyHp) { StartCoroutine(CountDown()); } }
public void ShatterEnemy(GameObject enemy, float shatterDamage) { EnemyStateMachine enemyStateMachine = enemy.GetComponent <EnemyStateMachine>(); EnemyHealthManager enemyHealthManager = enemy.GetComponent <EnemyHealthManager>(); enemyStateMachine.DefrostCurrentTimer = enemyStateMachine.DefrostTime; enemyHealthManager.TakeDamage(shatterDamage); }
// Use this for initialization void Start () { enemy = FindObjectOfType<EnemyHealthManager>(); killer = FindObjectOfType<Killer>(); room = FindObjectOfType<Target>(); anim = room.GetComponent<Animator>(); sound = FindObjectOfType<EffectsManager>(); StartCoroutine(Sound()); }
void Start() { currentLevel = GameObject.Find("Level").GetComponent <Level>(); healthMgr = GetComponent <EnemyHealthManager>(); myColorManager = GetComponent <PFMColorManager>(); currentHP = healthMgr.CurrentHP; newShipPrefab = (GameObject)Resources.Load("Enemies/Minions/ColorPFMinion"); }
// Use this for initialization void Awake() { rb = this.GetComponent <Rigidbody2D>(); m_animator = GetComponent <Animator>(); m_spriteRenderer = GetComponent <SpriteRenderer>(); m_playerTransform = GameObject.FindGameObjectWithTag("Player").transform; enemyHealthScript = GetComponent <EnemyHealthManager>(); }
// Use this for initialization void Start() { mainCamera = Camera.main; EnemyHealthManager ehm = gameObject.GetComponentInParent <EnemyHealthManager> (); ehm.OnHealthChangedAction += HandleHealthChangedAction; healthRectTransform = (RectTransform)gameObject.transform.Find("Health").transform; }
void DamageEnemy(EnemyHealthManager _damageCollisionObject) { Debug.Log("damageCollisionobject = " + _damageCollisionObject); if (_damageCollisionObject) { _damageCollisionObject.Damage(amount); } }
void Start() { if (GetComponent<EnemyMovement> ()) { if (GetComponent<EnemyAnimation> () != null) { enemyAnimation = FindObjectOfType<EnemyAnimation> (); enemyDefeatedAnimDuration = enemyAnimation.enemyDefeatedAnimDuration; } else { enemyAnimation = null; } //Auto Hook if (GetComponent<EnemyHealthManager> ()) { enemyHealthManager = GetComponent<EnemyHealthManager> (); } //else { // enemyHealthManager = GetComponentInChildren<EnemyHealthManager> (); //} // Adding "In Chidren" fixes errors, but generates whorst ones. Its probably necesary though. enemyAttack = GetComponent<EnemyAttack> (); enemyMovement = GetComponent<EnemyMovement> (); enemyAnimator = GetComponent<Animator> (); //Initial Save startingPosition = gameObject.transform.position; startingHP = enemyHealthManager.enemyHP; } else { if (GetComponentInChildren<EnemyAnimation> () != null) { enemyAnimation = FindObjectOfType<EnemyAnimation> (); enemyDefeatedAnimDuration = enemyAnimation.enemyDefeatedAnimDuration; } else { enemyAnimation = null; } //Auto Hook if (GetComponentInChildren<EnemyHealthManager> ()) { enemyHealthManager = GetComponentInChildren<EnemyHealthManager> (); } //else { // enemyHealthManager = GetComponentInChildren<EnemyHealthManager> (); //} // Adding "In Chidren" fixes errors, but generates whorst ones. Its probably necesary though. enemyAttack = GetComponentInChildren<EnemyAttack> (); enemyMovement = GetComponentInChildren<EnemyMovement> (); enemyAnimator = GetComponentInChildren<Animator> (); //Initial Save startingPosition = gameObject.transform.position; startingHP = enemyHealthManager.enemyHP; } }
void Start() { //rb2d = GetComponent<Rigidbody2D>(); //collider2d = GetComponent<BoxCollider2D>(); healthManager = GetComponent<EnemyHealthManager>(); }
void Start() { rb2d = GetComponent<Rigidbody2D>(); healthManager = GetComponent<EnemyHealthManager>(); player = GameObject.FindGameObjectWithTag("Player"); starting = true; startPosition = transform.position; GetComponent<CircleCollider2D>().enabled = false; }
void Start() { rb2d = GetComponent<Rigidbody2D>(); //collider2d = GetComponent<CircleCollider2D>(); collider2d = GetComponent<BoxCollider2D>(); anim = GetComponent<Animator>(); healthManager = GetComponent<EnemyHealthManager>(); }
void Start() { rb2d = GetComponent<Rigidbody2D>(); //collider2d = GetComponent<CircleCollider2D>(); //anim = GetComponent<Animator>(); healthManager = GetComponent<EnemyHealthManager>(); player = GameObject.FindGameObjectWithTag("Player"); }
void Start() { movement = GetComponent<EnemyMovement>(); AI = GetComponent<EnemyAttack>(); if(gameObject.name == "Sasuke") { sasuke = FindObjectOfType<SasukeController>(); } else { health = GetComponent<EnemyHealthManager>(); hp = health.enemyHP; } rb2D = GetComponent<Rigidbody2D>(); anim = GetComponent<Animator>(); moveSpeed = movement.speed; }