public void Beam(string testName, BeamType beamType, double startSetback, double endSetback) { this.Name = testName; ICurve cl = null; switch (beamType) { case BeamType.Line: cl = ModelTest.TestLine; break; case BeamType.Arc: cl = ModelTest.TestArc; break; case BeamType.Polygon: cl = ModelTest.TestPolygon; break; case BeamType.Polyline: cl = ModelTest.TestPolyline; break; } var framingType = new StructuralFramingType(Guid.NewGuid().ToString(), this._testProfile, BuiltInMaterials.Steel); var beam = new Beam(cl, framingType, startSetback, endSetback); Assert.Equal(BuiltInMaterials.Steel, beam.ElementType.Material); Assert.Equal(cl, beam.Curve); this.Model.AddElement(beam); }
public Beam(BeamType type, TimeSpan duration) { Id = _idGenerator.GetNextID(); Created = DateTime.Now; Type = type; Duration = duration; }
public void Beam(string testName, BeamType beamType, double startSetback, double endSetback) { this.Name = testName; ICurve cl = null; switch (beamType) { case BeamType.Line: cl = ModelTest.TestLine; break; case BeamType.Arc: cl = ModelTest.TestArc; break; case BeamType.Polygon: cl = ModelTest.TestPolygon; break; case BeamType.Polyline: cl = ModelTest.TestPolyline; break; } var beam = new Beam(cl, this._testProfile, BuiltInMaterials.Steel, startSetback, endSetback); Assert.Equal(BuiltInMaterials.Steel, beam.Geometry[0].Material); Assert.Equal(cl, beam.Curve); this.Model.AddElement(beam); }
public static void CreateDebugBeam(this IZone zone, BeamType beamType, Position position) { if (zone == null) { return; } var builder = Beam.NewBuilder().WithType(beamType).WithPosition(position).WithState(BeamState.Hit).WithDuration(15000); zone.CreateBeam(builder); }
public static void CreateBeam(this IZone zone, BeamType type, Action <BeamBuilder> builderAction) { if (type == BeamType.undefined || type == default(BeamType)) { return; } var builder = Beam.NewBuilder().WithType(type); builderAction(builder); zone.CreateBeam(builder); }
public IEnumerator Beam(Component target, float elapsedTime, BeamType beamType) { var beamFX = (Instantiate(Resources.Load("Beam")) as GameObject).particleSystem; beamFXs.Add(beamFX); beamFX.transform.parent = Beamer; beamFX.transform.position = Beamer.GetComponent<Element>() ? Beamer.WorldCenterOfElement() : Beamer.position; beamFX.startSpeed = Settings.Replay.BeamSpeed; var beamAudio = beamFX.audio; beamAudio.maxDistance = Settings.Audio.MaxAudioDistance; beamAudio.volume = Settings.Audio.Volume.Beam; beamAudio.clip = Resources.Load<AudioClip>("Sounds/Beam_" + beamType); if (Data.GamePaused) beamAudios.Add(beamAudio); else beamAudio.Play(); beamFX.Play(); for (var startTime = Time.time; ((Time.time - startTime) / elapsedTime) < 1;) { if (!Data.GamePaused) { var v = target.transform.WorldCenterOfElement() - beamFX.transform.position; beamFX.transform.rotation = Quaternion.LookRotation(v); beamFX.startLifetime = v.magnitude / beamFX.startSpeed; if (this is Mine) beamFX.startColor = new Color32(245, 245, 220, 255); else if (this is Oilfield) beamFX.startColor = Color.green; else beamFX.startColor = Data.TeamColor.Current[team]; } yield return null; } beamFX.Stop(); var time = Time.time; beamAudio.loop = false; while (Data.GamePaused || beamAudio.isPlaying) yield return null; var loopsLeft = Mathf.RoundToInt((beamFX.startLifetime - Time.time + time) / beamAudio.clip.length); if (loopsLeft <= 0) yield break; beamAudio.loop = true; if (Data.GamePaused) beamAudios.Add(beamAudio); else beamAudio.Play(); yield return new WaitForSeconds(loopsLeft * beamAudio.clip.length); beamAudio.Stop(); beamFXs.Remove(beamFX); Destroy(beamFX.gameObject); }
private static void OnDebugLOS(IZone zone, BeamType beamType, Position position, bool aligned) { if (!Debug) { return; } if (aligned) { zone.CreateAlignedDebugBeam(beamType, zone.FixZ(position)); return; } zone.CreateDebugBeam(beamType, position); }
SupStructure(BeamType bt, double bw, string bn, string loc, string det) { BridgeName = bn; Loc = loc; Detial = det; ClassName = bt; BridgeWidth = bw; XMH = "-"; switch (bt) { case BeamType.F10: break; case BeamType.F15: break; case BeamType.T25: break; case BeamType.T35: break; case BeamType.B50: break; case BeamType.B60: if (bw == 1365) { Q1 = 9.6604 * 60; Q2 = 1; RebarRho = 190; } else if (bw == 1465) { Q1 = 10.0549 * 60; Q2 = 1; RebarRho = 190; } break; default: break; } }
/** * Will Make the Current Light a Revealing Light */ public void makeReveal() { if (type != BeamType.REVEAL) { type = BeamType.REVEAL; base.setWidth(REVEAL_WIDTH); base.setHeight(REVEAL_LENGTH); base.setSprite(light); base.setRotation(0); } if (active) { base.setFrame(0); } else { base.setFrame(1); } }
/** * Will Make the Current Light a Laser Light */ public void makeLaser() { if (type != BeamType.LASER) { type = BeamType.LASER; base.setWidth(LASER_WIDTH); base.setHeight(LASER_LENGTH); base.setSprite(lazer); base.setRotation(180); } if (active) { base.setFrame(0); } else { base.setFrame(1); } }
/** * Will Make the Current Light a Wide Light */ public void makeWide() { if (type != BeamType.WIDE) { type = BeamType.WIDE; base.setWidth(WIDE_WIDTH); base.setHeight(WIDE_LENGTH); base.setSprite(light); base.setRotation(0); } if (active) { base.setFrame(0); } else { base.setFrame(1); } }
public void updateBeamSizes(EnemySet hostSet) { if (hostSet != null) { if ((hostSet.getCollumnSpacing() * 4) != WIDE_WIDTH) { WIDE_WIDTH = hostSet.getCollumnSpacing() * 4; if (type == BeamType.WIDE) { type = BeamType.LASER; makeWide(); } } if ((hostSet.getCollumnSpacing() * 2) != REVEAL_WIDTH) { REVEAL_WIDTH = hostSet.getCollumnSpacing() * 2; if (type == BeamType.REVEAL) { type = BeamType.LASER; makeReveal(); } } } }
internal LootContainerBuilder() { _containerType = LootContainerType.LootOnly; _pinCode = FastRandom.NextInt(1, 9999); _enterBeamType = BeamType.undefined; }
public static void CreateAlignedDebugBeam(this IZone zone, BeamType beamType, Position position) { zone?.CreateBeam(beamType, builder => builder.WithPosition(zone.FixZ(position)).WithState(BeamState.AlignToTerrain).WithDuration(15000)); }
public static int GetBeamDelay(BeamType beamType) { return(_cacheBeamDelays[beamType]); }
public static void CreateSingleBeamToPositions(this IZone zone, BeamType beamType, int cycleTime, IEnumerable <Position> positions) { var builder = Beam.NewBuilder().WithType(beamType).WithDuration(cycleTime); positions.Select(builder.WithPosition).ForEach(zone.CreateBeam); }
internal void FireBeam(int bank, Entity target, BeamType type) { if (!BeamWeapons.Contains(type)) return; switch (type) { case BeamType.StandardPhaser: if (IsEntityCloserThan(target, 150) && Energy > 5 && BeamCoolDownTime(bank) > 2) { target.Damage(100); LastBeamBanksUsed[bank] = DateTime.UtcNow; SpendRawEnergy(5); PlaySound("FireStandardPhaser"); } break; case BeamType.HullPiercing: if (IsEntityCloserThan(target, 50) && SpendRawEnergy(25) && BeamCoolDownTime(bank) > 4) { target.Damage(300); LastBeamBanksUsed[bank] = DateTime.UtcNow; PlaySound("FireHullPiercing"); } break; case BeamType.SuppresionPulse: if (IsEntityCloserThan(target, 150) && SpendRawEnergy(75) && BeamCoolDownTime(bank) > 10) { target.DamagePart(100, target.GetRandomWorkingPart()); LastBeamBanksUsed[bank] = DateTime.UtcNow; PlaySound("FireSuppresionPulse"); } break; case BeamType.PlasmaVent: if (SpendRawEnergy(100) && BeamCoolDownTime(bank) > 60) { foreach (var entity in StarSystem.Entites.ToArray()) // ToArray here to avoid threading issues. Lame I know. { if (IsEntityCloserThan(entity, 50)) target.Damage(250); } LastBeamBanksUsed[bank] = DateTime.UtcNow; PlaySound("FirePlasmaVent"); } break; case BeamType.TractorBeam: if (IsEntityCloserThan(target, 200) && SpendRawEnergy(75) && BeamCoolDownTime(bank) > 5) { //target..Velocity var displacement = this.Position - target.Position; var orientation = Math.Atan2(displacement.Y, displacement.X).NormalizeOrientation(); target.ApplyEnergyForce(75, orientation); LastBeamBanksUsed[bank] = DateTime.UtcNow; PlaySound("FireTractorBeam"); } break; } }
public LootContainerBuilder SetEnterBeamType(BeamType beamType) { _enterBeamType = beamType; return(this); }
public BeamBuilder WithType(BeamType type) { Type = type; return(this); }
public static int CountBeams(int W, BeamType bt) { int bms = 0; switch (bt) { case BeamType.F10: bms = 1; break; case BeamType.F15: bms = 1; break; case BeamType.T25: if (W == 1365) { bms = 8; } else if (W == 1465) { bms = 9; } else if (W == 1715) { bms = 10; } else if (W == 1815) { bms = 11; } break; case BeamType.T35: if (W == 1365) { bms = 7; } else if (W == 1465) { bms = 8; } else if (W == 1715) { bms = 9; } else if (W == 1815) { bms = 10; } break; case BeamType.B50: bms = 1; break; case BeamType.B60: bms = 1; break; default: break; } return(bms); }
public ActionResult FireBeam(int id, int bank, int targetId, BeamType type) { Initalize(id); if (player.Ship != null && player.Station == Station.Weapons) { var target = player.Ship.StarSystem.GetEntity(targetId); if (target != null) player.Ship.FireBeam(bank, target, type); } return null; }