public override void Damage(float damage, float pushTime, Vector2 pushSpeed, BasicShipGameObject Damager, AttackType attackType) { if ((InvTime < 1 && (FieldStateTime < 1 || fieldState != FieldState.Cloaked)) || attackType == AttackType.Explosion || attackType == AttackType.Melee) { if (CanCloak) { SoundManager.Play3DSound("UnitCloak", new Vector3(Position.X(), Y, Position.Y()), 0.25f, 800, 2); fieldState = FieldState.Cloaked; HasCloaked = true; CanCloak = false; FieldStateTime = GetCloakTime(); } else { if (attackType != AttackType.White) { SummonUnits(); } NoShootTime = MaxNoShootTime; if (attackType == AttackType.White) { ThreatLevel *= 1.5f; } if (!PathFindingManager.CollisionLine(Position.get(), Damager.Position.get())) { AngerTime = MaxAngerTime; CurrentAttackTarget = Damager; } base.Damage(damage, pushTime, pushSpeed, Damager, attackType); if (HullDamage >= HullToughness && Damager.FactionNumber != NeutralManager.NeutralFaction && ScoreToGive > 0) { if (CanDeathSound) { SoundManager.Play3DSound(DeathSound, new Vector3(Position.X(), Y, Position.Y()), DeathVolume * 0.5f, DeathDistance, DeathExponenent * 2); } ScoreToGive = (int)(ScoreToGive * (0.75f + 0.25f * UnitLevel) * (IsHuge ? 1.25f : 1) * (HasCloaked || CanCloak ? 1.5f : 1) * (CanSummon || HasSummoned ? 4 : 1)); TextParticleSystem.AddParticle(new Vector3(Position.X(), Y, Position.Y()), ScoreToGive.ToString(), (byte)Damager.GetTeam()); FactionManager.AddScore(Damager.FactionNumber, ScoreToGive); FactionManager.Factions[Damager.FactionNumber].roundReport.UnitKills++; ScoreToGive = 0; } } } }