/// <summary> /// Apply an instant health utility to the tank /// </summary> /// <param name="utility">The utility</param> public void ApplyInstantHealth(VTankObject.Utility utility) { int healthBonus = (int)(MaxHealth * utility.healthFactor) + utility.healthIncrease; if (this.Health + healthBonus > MaxHealth) { //For updating the healthbar, inflictdamage heals with negative values this.InflictDamage(-(MaxHealth - Health), false); } else { this.InflictDamage(-healthBonus, false); } ParticleEmitterSettings pset = Renderer.RendererAssetPool.ParticleEmitterSettings["Utility"]; pset.ParticleSystemName = utility.model; ParticleEmitter pemit1 = new ParticleEmitter(pset); pemit1.Position = Position; pemit1.MimicPosition(this, Vector3.Zero); pemit1.MimicRotation(this); ServiceManager.Scene.Add(pemit1, 3); }