private BeamType GetWreckBeamType() { var robot = _unit as Robot; var definition = robot?.GetRobotComponent(RobotComponentType.Leg).Definition ?? _unit.Definition; return(BeamHelper.GetBeamByDefinition(definition)); }
private int CreateBeam(Position location, BeamState beamState, int duration, double bulletTime, int visibility) { var delay = 0; var beamType = GetBeamType(); if (beamType <= 0) { return(delay); } delay = BeamHelper.GetBeamDelay(beamType); if (duration == 0) { duration = (int)CycleTime.TotalMilliseconds; } Debug.Assert(ParentComponent != null, "ParentComponent != null"); var slot = ParentComponent.Type == RobotComponentType.Chassis ? Slot : 0xff; // -1 var builder = Beam.NewBuilder().WithType(beamType) .WithSlot(slot) .WithSource(ParentRobot) .WithState(beamState) .WithBulletTime(bulletTime) .WithDuration(duration) .WithTargetPosition(location) .WithVisibility(visibility); Zone.CreateBeam(builder); return(delay); }
public void CreateSuccessBeam(Player player) { //success beam by alarm switch definition var builder = Beam.NewBuilder().WithType(BeamHelper.GetBeamByDefinition(Definition)) .WithPosition(CurrentPosition) .WithState(BeamState.AlignToTerrain) .WithDuration(TimeSpan.FromSeconds(3)); if (IsBeamPublic()) { //mindenki latja Zone.CreateBeam(builder); } else { //csak 1 player latja player.Session.SendBeam(builder); } }
private BeamType GetBeamType() { var ammo = GetAmmo(); return(ammo != null?BeamHelper.GetBeamByDefinition(ammo.Definition) : BeamHelper.GetBeamByDefinition(Definition)); }