You can now rig power cells to explode.

VERY funny.
This commit is contained in:
Pieter-Jan Briers
2021-01-24 16:21:18 +01:00
parent 436694e376
commit 526c3d1ebf
4 changed files with 61 additions and 7 deletions

View File

@@ -169,7 +169,11 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
// Multiply the entity's damage / whatever by the percentage of charge the shot has.
IEntity entity;
var chargeChange = Math.Min(capacitor.CurrentCharge, _baseFireCost);
capacitor.UseCharge(chargeChange);
if (capacitor.UseCharge(chargeChange) < _lowerChargeLimit)
{
// Handling of funny exploding cells.
return null;
}
var energyRatio = chargeChange / _baseFireCost;
if (_ammoContainer.ContainedEntity != null)