void Update() { //if beam, have the turret control it // if (beam) // transform.parent = shooter.transform; if (!shooter) { shooterIff = EnemyShipModular.mobAffiliation.Ally; } }
public void setShooter(GameObject newShooter) { if (!newShooter) { return; } //passes IFF to round shooter = newShooter; EnemyShipModular shooterMob = shooter.GetComponentInParent <EnemyShipModular>(); if (shooterMob != null) { shooterIff = shooterMob.iff; } }
public void BulletHit(GameObject shooter, float damage, EnemyShipModular.mobAffiliation iff) { if ((int)condition < 3 || shooter == gameObject) { return; } //IF ALIVE: take damage if ((int)condition > 2) { eHP -= damage; } // Wake on all bullets? // if (!active) // Invoke("WarmActive", 1); /* * if (bullet.shooterIff == null) * { * Debug.Log(name + "hit by " + bullet.name + " with no shooter"); * return; * }*/ if (!isFriendly()) { DialogueBox.tracking = gameObject; } if (!isFriendly(iff)) { addTarget(shooter, true); RedAlert(); } if (!tenacious && WeaponsActive()) { if (threats.Length > 0) { navigatingTo = threats[0]; } } }
public void setShooter(GameObject newShooter) { if (!newShooter) { //Default to player if no shooter assigned shooterIff = EnemyShipModular.mobAffiliation.Ally; shooter = ScoreKeeper.playerAlive; return; } //passes IFF to round shooter = newShooter; EnemyShipModular shooterMob = shooter.GetComponentInParent <EnemyShipModular>(); if (shooterMob != null) { shooterIff = shooterMob.iff; } }