public override void Destroy() { if (HasCloakField && BasicField.TestFieldClear(Position.get())) { HasCloakField = false; CloakingField c = new CloakingField(); ParentLevel.AddObject(c); c.SetPosition(Position.get()); } base.Destroy(); }
public override void Damage(float damage, float pushTime, Vector2 pushSpeed, BasicShipGameObject Damager, AttackType attackType) { if (attackType != AttackType.White && HasCloakField && BasicField.TestFieldClear(Position.get())) { HasCloakField = false; CloakingField c = new CloakingField(); ParentLevel.AddObject(c); c.SetPosition(Position.get()); } if (attackType != AttackType.White) { damage /= 2f; } base.Damage(damage, pushTime, pushSpeed, Damager, attackType); }