Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using existing FixedPoint2 for popup message, instead of raw float #9820

Merged
merged 1 commit into from
Jul 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,10 @@ private void TryDraw(InjectorComponent component, EntityUid targetEntity, Soluti
return;
}

/// We have some snowflaked behavior for streams.
// We have some snowflaked behavior for streams.
if (stream != null)
{
DrawFromBlood(user, targetEntity, component, solution, stream, (float) realTransferAmount);
DrawFromBlood(user, targetEntity, component, solution, stream, realTransferAmount);
return;
}

Expand All @@ -378,10 +378,11 @@ private void TryDraw(InjectorComponent component, EntityUid targetEntity, Soluti
AfterDraw(component);
}

private void DrawFromBlood(EntityUid user, EntityUid target, InjectorComponent component, Solution injectorSolution, BloodstreamComponent stream, float drawAmount)
private void DrawFromBlood(EntityUid user, EntityUid target, InjectorComponent component, Solution injectorSolution, BloodstreamComponent stream, FixedPoint2 transferAmount)
{
float bloodAmount = drawAmount;
float chemAmount = 0f;
var drawAmount = (float) transferAmount;
var bloodAmount = drawAmount;
var chemAmount = 0f;
if (stream.ChemicalSolution.CurrentVolume > 0f) // If they have stuff in their chem stream, we'll draw some of that
{
bloodAmount = drawAmount * 0.85f;
Expand All @@ -395,7 +396,7 @@ private void DrawFromBlood(EntityUid user, EntityUid target, InjectorComponent c
_solutions.TryAddSolution(component.Owner, injectorSolution, chemTemp);

_popup.PopupEntity(Loc.GetString("injector-component-draw-success-message",
("amount", drawAmount),
("amount", transferAmount),
("target", Identity.Entity(target, EntityManager))), component.Owner, Filter.Entities(user));

Dirty(component);
Expand Down