public void DestroyMinion() { if (_MinionCount > 0) { // Get the last minion in the pool GameObject minionObj = _POOL_Minions[_POOL_Minions.Count - 1]; Proj_ShieldMinion minion = minionObj.GetComponent <Proj_ShieldMinion>(); // Kill it minion.ForceDeath(); // Set new score _Owner._Player.SetScore(_MinionCount); } }
public void CollisionChecks() { // Check against all alive minions foreach (var minion in AiManager._pInstance.GetActiveMinions()) { Char_Crystal crystal = minion.GetComponent <Char_Crystal>(); // Precaution if (crystal != null) { // If minion has valid collision reference set if (crystal.GetCollider() != null) { // Has the fireball collided with the minion's collision? if (_Collision.bounds.Intersects(crystal.GetCollider().bounds)) { // Damage minion crystal.Damage(_Owner.GetOwner(), _Damage); // Play impact sound SoundManager._pInstance.PlayFireballImpact(); // Check if minion has been killed if (crystal.GetHealth() <= 0) { // Add to instigator's kill count _Owner.GetOwner()._Player.AddKillCount(); } // Destroy fireball FreeProjectile(); break; } } } } if (MatchManager._pInstance.GetGameState() == MatchManager.GameState.Phase2) { // Check against all alive players foreach (var necromancer in PlayerManager._pInstance.GetActiveNecromancers()) { // If necromancer has valid collision reference set if (necromancer.GetCollider() != null) { // If it isnt the instigator who is being tested against if (necromancer != _Owner.GetOwner()) { // Check against all meat shield minions associated to the player foreach (GameObject meatMinion in necromancer.GetSpecialWeapon().GetComponent <Wep_Shield>().GetMeatMinionPool()) { Proj_ShieldMinion minion = meatMinion.GetComponent <Proj_ShieldMinion>(); // Has the fireball collided with the minions's collision? if (_Collision.bounds.Intersects(minion.GetCollision().bounds)) { // Damage minion minion.Damage(_Owner.GetOwner(), _Damage); // Play impact sound SoundManager._pInstance.PlayFireballImpact(); // Check if minion has been killed if (minion.GetHealth() <= 0) { // Add to instigator's kill count _Owner.GetOwner()._Player.AddKillCount(); // Remove minion from the shield count (-1) ///meatMinion.GetOwner().GetOwner().GetComponentInChildren<Wep_Shield>().SetMinionCount(meatMinion.getowner) ///meatMinion.GetOwner().GetComponent<Wep_Shield>().SetMinionCount(meatMinion.GetOwner().GetComponent<Wep_Shield>().GetMinionCount() - 1); } // Destroy fireball FreeProjectile(); _Active = false; break; } } // Has the fireball collided with the necromancer's collision? if (_Collision.bounds.Intersects(necromancer.GetCollider().bounds) && _Active) { // Damage necromancer necromancer.Damage(_Owner.GetOwner(), _Damage); // Apply burn necromancer.GetComponent <Char_Geomancer>().SetBurnState(true); // Play impact sound SoundManager._pInstance.PlayFireballImpact(); // Check if necromancer has been killed if (necromancer.GetHealth() <= 0) { // Add to instigator's kill count _Owner.GetOwner()._Player.AddKillCount(); } // Destroy fireball FreeProjectile(); break; } } } } } }
public override void OnDeath(Character instigator) { // Get last known alive position and store it base.OnDeath(instigator); // Destroy all minions in the character's shield Wep_Shield shield = _WeaponSpecial.GetComponent<Wep_Shield>(); foreach (var item in shield.GetMeatMinionPool()) { Proj_ShieldMinion minion = item.GetComponent<Proj_ShieldMinion>(); minion.ForceDeath(); } // Play OnDeath effect if (_EffectOnDeath != null) Instantiate(_EffectOnDeath, transform.position, Quaternion.identity); if (_Player.GetRespawnsLeft() > 0) { // Disable controller input _Active = false; // Deduct life from respawn cap _Player.DeductRespawn(); // Move character to its respawn point gameObject.transform.position = _RespawnPoint.position; // Start respawn timer _WaitingToRespawn = true; } // Player is out of lives and is eliminated from the match else { // Deduct life from respawn cap _Player.DeductRespawn(); // hide character & move out of playable space GetComponentInChildren<Renderer>().enabled = false; transform.position = new Vector3(1000, 0, 1000); // Show popup that a player has been eliminated MatchManager._pInstance.OnPlayerEliminated(_Player); // Find self in active pool foreach (var necromancer in PlayerManager._pInstance.GetActiveNecromancers()) { // Once we have found ourself in the pool if (necromancer == this) { // Move to inactive pool PlayerManager._pInstance.GetEliminatedNecromancers().Add(necromancer); PlayerManager._pInstance.GetActiveNecromancers().Remove(necromancer); break; } } // Set our match placement depending on how many other players are still alive in the game int playersRemaining = PlayerManager._pInstance.GetActiveNecromancers().Count; _Player.SetPlacement(playersRemaining + 1); // Disable controller input _Active = false; } // Instigator plays a taunt if (instigator.GetComponent<Char_Geomancer>().GetDialog() != null) instigator.GetComponent<Char_Geomancer>().GetDialog().PlayTaunt(); // Play death sound if (_CharacterDialog != null) _CharacterDialog.PlayOnDeath(); }
public void GeomancerCollisionChecks() { // Check against enemy player character if (MatchManager._pInstance.GetGameState() == MatchManager.GameState.Phase2) { if (PlayerManager._pInstance.GetActiveNecromancers().Count > 0) { // Check against all alive players foreach (var necromancer in PlayerManager._pInstance.GetActiveNecromancers()) { // If necromancer has valid collision reference set if (necromancer.GetCollider() != null) { // If it isnt the instigator who is being tested against if (necromancer != _Owner.GetOwner()) { // Check against all meat shield minions associated to the player foreach (GameObject meatMinion in necromancer.GetSpecialWeapon().GetComponent <Wep_Shield>().GetMeatMinionPool()) { Proj_ShieldMinion minion = meatMinion.GetComponent <Proj_ShieldMinion>(); // Has the fireball collided with the minions's collision? if (_Collision.bounds.Intersects(minion.GetCollision().bounds)) { // Damage minion minion.Damage(_Owner.GetOwner(), _ImpactDamage); // Play impact sound SoundManager._pInstance.PlayFireballImpact(); // Check if minion has been killed if (minion.GetHealth() <= 0) { // Add to instigator's kill count _Owner.GetOwner()._Player.AddKillCount(); } // Play impact effect ParticleSystem effect = Instantiate(WeaponManager._pInstance._FireballImpactEffect, gameObject.transform.position, Quaternion.identity); effect.gameObject.GetComponent <DestroyAfterTime>().enabled = true; // Destroy fireball FreeProjectile(); _Active = false; break; } } // Has the fireball collided with the necromancer's collision? if (_Collision.bounds.Intersects(necromancer.GetCollider().bounds) && _Active) { // Damage necromancer necromancer.Damage(_Owner.GetOwner(), _ImpactDamage /*+ (_ImpactDamage * _DamageMultiplier)*/); // Play impact sound SoundManager._pInstance.PlayFireballImpact(); // Check if necromancer has been killed if (necromancer.GetHealth() <= 0) { // Add to instigator's kill count _Owner.GetOwner()._Player.AddKillCount(); } // Play impact effect ParticleSystem effect = Instantiate(WeaponManager._pInstance._FireballImpactEffect, gameObject.transform.position, Quaternion.identity); effect.gameObject.GetComponent <DestroyAfterTime>().enabled = true; // Destroy fireball FreeProjectile(); break; } } } } } } }