shd?.SetParameter("positionInput", tempCoords);
shd?.SetParameter("range", instance.Range);
var life = (_gameTiming.RealTime - instance.Start).TotalSeconds / instance.Duration;
- shd?.SetParameter("life", (float) life);
+ shd?.SetParameter("life", (float)life);
// There's probably a very good reason not to do this.
// Oh well!
param = sounds.Params.WithLoop(true).WithVolume(component.Volume + 1.5f).WithMaxDistance(component.BroadcastRange);
component.Stream = _audio.PlayPvs(sound, uid, param)?.Entity;
}
- else if(component.User is not null && _player.TryGetSessionByEntity(component.User.Value, out var session))
- component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
+ else if (component.User is not null && _player.TryGetSessionByEntity(component.User.Value, out var session))
+ component.Stream = _audio.PlayGlobal(sound, session, param)?.Entity;
}
public static GeigerDangerLevel RadsToLevel(float rads)
// save resistance into rad protection grid
var gridId = trs.GridUid.Value;
- var tilePos = grid.TileIndicesFor(trs.Coordinates);
+ var tilePos = _maps.TileIndicesFor((trs.GridUid.Value, grid), trs.Coordinates);
AddToTile(gridId, tilePos, component.RadResistance);
// and remember it as last valid position
foreach (var source in _sources)
{
// send ray towards destination entity
- if (Irradiate(source, destUid, destTrs, destWorld, debug) is not {} ray)
+ if (Irradiate(source, destUid, destTrs, destWorld, debug) is not { } ray)
continue;
// add rads to total rad exposure
// if source and destination on the same grid it's possible that
// between them can be another grid (ie. shuttle in center of donut station)
// however we can do simplification and ignore that case
- if (GridcastSimplifiedSameGrid && destTrs.GridUid is {} gridUid && source.GridUid == gridUid)
+ if (GridcastSimplifiedSameGrid && destTrs.GridUid is { } gridUid && source.GridUid == gridUid)
{
if (!_gridQuery.TryGetComponent(gridUid, out var gridComponent))
return ray;
: Vector2.Transform(ray.Destination, grid.Comp2.InvLocalMatrix);
Vector2i sourceGrid = new(
- (int) Math.Floor(srcLocal.X / grid.Comp1.TileSize),
- (int) Math.Floor(srcLocal.Y / grid.Comp1.TileSize));
+ (int)Math.Floor(srcLocal.X / grid.Comp1.TileSize),
+ (int)Math.Floor(srcLocal.Y / grid.Comp1.TileSize));
Vector2i destGrid = new(
- (int) Math.Floor(dstLocal.X / grid.Comp1.TileSize),
- (int) Math.Floor(dstLocal.Y / grid.Comp1.TileSize));
+ (int)Math.Floor(dstLocal.X / grid.Comp1.TileSize),
+ (int)Math.Floor(dstLocal.Y / grid.Comp1.TileSize));
// iterate tiles in grid line from source to destination
var line = new GridLineEnumerator(sourceGrid, destGrid);
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly SharedStackSystem _stack = default!;
+ [Dependency] private readonly SharedMapSystem _maps = default!;
private EntityQuery<RadiationBlockingContainerComponent> _blockerQuery;
private EntityQuery<RadiationGridResistanceComponent> _resistanceQuery;