ISolidWeapon CreatePrimaryWeapon() { EffectCollection DefaultEffectCollection = new EffectCollection(); DefaultEffectCollection.Effects.Add(new ShipStateEffect(TargetingInfo.All, EffectTypes.None, new EffectSounds(), new ShipStateChange(-4, 0, 0, 0))); ISolidWeapon w = new SpawningSolidWeapon( new LifeSpan(TimeWarp.RangeToTime(60, 80)), new PhysicsState(), BodyFlags.None, GetPrimaryWeaponShape(), new ShipMovementInfo( new Bounded <float>(TimeWarp.AngularAcceleration), new Bounded <float>(TimeWarp.ScaleTurning(3)), new Bounded <float>(TimeWarp.ScaleAcceleration(80, 0)), new Bounded <float>(TimeWarp.ScaleVelocity(80))), new ShipState( new Bounded <float>(1), new Bounded <float>(0), new Bounded <float>(0), new Bounded <float>(0)), new ControlableSounds(), new WeaponsLogic( new TargetingInfo(TargetingTypes.All, TargetingTypes.None, TargetingTypes.None), new EffectCollection(DefaultEffectCollection)), CreatePrimarySpawn(), true); w.ControlHandler = new DefaultControlHandler(); w.AddControler(null, new MissileControler(TargetingInfo.FromRequireAll(TargetingTypes.Enemy | TargetingTypes.Ship))); return(w); }
static ISolidWeapon CreateWeapon() { ISolidWeapon w = ChenjesuBroodhomeDogi.Create(); w.ControlHandler = new DefaultControlHandler(); w.AddControler(null, new SmartMissileControler(TargetingInfo.FromRequireAll(TargetingTypes.Enemy | TargetingTypes.Ship))); return(w); }
static ISolidWeapon CreateWeapon() { ISolidWeapon w = EarthlingFighter.Create(); w.ControlHandler = new DefaultControlHandler(); w.AddControler(null, new MannedOrbitControler(TargetingInfo.FromRequireAll(TargetingTypes.Enemy | TargetingTypes.Ship), TimeWarp.ScaleRange(2))); w.AddControler(null, new FireAllControler()); return(w); }
static ISolidWeapon CreateWeapon() { ISolidWeapon w = new Controlable( DefaultLifeTime, new PhysicsState(), DefaultBodyFlags, DefaultShape, new ShipMovementInfo(DefaultMovementInfo), new ShipState(DefaultState), new ControlableSounds(), new WeaponsLogic(TargetingInfo.All, new EffectCollection(DefaultEffectCollection))); w.ControlHandler = new DefaultControlHandler(); w.AddControler(null, new MissileControler(TargetingInfo.FromRequireAll(TargetingTypes.Enemy | TargetingTypes.Ship))); return(w); }
static ISolidWeapon CreateWeapon() { ISolidWeapon w = new ControlableWave( (LifeSpan)DefaultLifeTime.Clone(), DefaultMass, new PhysicsState(), DefaultInitialRadius, DefaultExpansionRate, DefaultPodColors, DefaultPodPrimaryColor, new ShipMovementInfo(DefaultMovementInfo), new ShipState(DefaultState), new ControlableSounds(), new WeaponsLogic(TargetingInfo.All, new EffectCollection(DefaultEffectCollection))); w.ControlHandler = new DefaultControlHandler(); w.AddControler(null, new MissileControler(TargetingInfo.FromRequireAll(TargetingTypes.Enemy | TargetingTypes.Ship))); w.Flags = w.Flags & ~BodyFlags.NoImpulse; return(w); }
protected override bool CheckTarget() { if (host.LifeTime.TimeLeft < host.LifeTime.Age || base.CheckTarget()) { this.IsExpired = true; if (host is IWeapon) { this.host.Target = ((IWeapon)host).WeaponInfo.Source; this.target = this.host.Target; } else { this.host.Target = null; this.target = this.host.Target; } host.AddControler(null, new MissileControler(TargetingInfo.FromRequireAll(TargetingTypes.Ally | TargetingTypes.Ship))); return(true); } return(false); }