예제 #1
0
 public Ship(
     LifeSpan lifeTime,
     PhysicsState physicsState,
     BodyFlags flags,
     RigidBodyTemplate template,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     ShipSounds shipSounds,
     IWeaponsLogic weaponsLogic,
     ActionList actions,
     IShip[] subShips)
     : base(
         lifeTime,
         physicsState,
         flags,
         template,
         movementInfo,
         shipState,
         controlableSounds, weaponsLogic)
 {
     this.UQMFlags       |= ContFlags.CanDoGravityWhip;
     this.shipSounds      = shipSounds;
     this.subShips        = subShips;
     this.actions         = actions;
     this.controlableType = ControlableType.Ship;
 }
예제 #2
0
        public Controlable(
            LifeSpan lifeTime,
            MassInertia massInfo,
            PhysicsState physicsState,
            BodyFlags flags,
            ICollidableBodyPart[] collidableParts,
            ShipMovementInfo movementInfo,
            ShipState shipState,
            ControlableSounds controlableSounds,
            IWeaponsLogic weaponInfo)
            : this(
                lifeTime,
                massInfo,
                physicsState,
                flags, collidableParts,
                movementInfo,
                shipState,
                controlableSounds)
        {
            this.CollisionState.GenerateCollisionEvents = true;
            this.CollisionState.GenerateContactEvents   = true;
            this.weaponInfo = weaponInfo;

            this.controlableType = ControlableType.Weapon;
        }
 /// <summary>
 /// Is called when the effect is created.
 /// </summary>
 /// <param name="weaponInfo"></param>
 public override void OnCreation(IWeaponsLogic weaponInfo)
 {
     diff = new PhysicsState();
     // sets a random Linear displacement.
     diff.Position.Linear = Vector2D.FromLengthAndAngle((float)rand.NextDouble() * maxDistance, (float)rand.NextDouble() * 2 * MathHelper.PI);
     base.OnCreation(weaponInfo);
 }
예제 #4
0
        protected ControlableWave(ControlableWave copy)
            : base(copy)
        {
            this.Killed       = Functions.Clone <EventHandler>(copy.Killed);
            this.shipState    = new ShipState(copy.shipState);
            this.movementInfo = new ShipMovementInfo(copy.movementInfo);
            foreach (IControler controler in copy.controlers)
            {
                AddControler(null, (IControler)controler.Clone());
            }
            this.target         = copy.target;
            this.ControlHandler = Functions.Clone <IControlHandler>(copy.ControlHandler);

            this.currentControlInput              = copy.currentControlInput;
            this.direction                        = copy.direction;
            this.controlableType                  = copy.controlableType;
            this.controlableSounds                = copy.controlableSounds;
            this.attachedEffectCollection         = new EffectCollection(copy.attachedEffectCollection);
            this.contFlags                        = copy.contFlags;
            this.CollisionState.GenerateRayEvents = true;


            this.colors       = copy.colors;
            this.primaryColor = copy.primaryColor;
            if (copy.weaponInfo != null)
            {
                this.weaponInfo = (IWeaponsLogic)copy.weaponInfo.Clone();
            }
        }
예제 #5
0
 public ControlableWave(
     LifeSpan lifeTime,
     float mass,
     PhysicsState physicsState,
     float initialRadius,
     float expansionRate,
     int[] colors,
     int primaryColor,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     IWeaponsLogic weaponInfo)
     : this(
         lifeTime,
         mass,
         physicsState, initialRadius,
         expansionRate,
         colors,
         primaryColor,
         movementInfo,
         shipState, null, controlableSounds)
 {
     this.weaponInfo = weaponInfo;
     this.CollisionState.GenerateCollisionEvents = true;
     this.CollisionState.GenerateContactEvents   = true;
     this.controlableType = ControlableType.Weapon;
 }
예제 #6
0
 public Ship(
     LifeSpan lifeTime,
     MassInertia massInfo,
     PhysicsState physicsState,
     BodyFlags flags,
     ICollidableBodyPart[] collidableParts,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     ShipSounds shipSounds,
     ActionList actions,
     IWeaponsLogic weaponsLogic,
     IShip[] subShips)
     : base(
         lifeTime,
         massInfo,
         physicsState,
         flags,
         collidableParts,
         movementInfo,
         shipState,
         controlableSounds, weaponsLogic)
 {
     this.UQMFlags       |= ContFlags.CanDoGravityWhip;
     this.shipSounds      = shipSounds;
     this.subShips        = subShips;
     this.actions         = actions;
     this.controlableType = ControlableType.Ship;
 }
예제 #7
0
 public RayWeapon(
     LifeSpan lifeTime,
     IWeaponsLogic weaponInfo)
     : base(lifeTime, weaponInfo)
 {
     this.lifeTime = lifeTime;
 }
예제 #8
0
 public TargetedRayWeapon(
     LifeSpan lifeTime,
     IWeaponsLogic weaponInfo,
     float impulse,
     float distance)
     : base(lifeTime, weaponInfo)
 {
     this.impulse  = impulse;
     this.distance = distance;
 }
 protected BaseEffect(BaseEffect copy)
 {
     this.exhausted          = copy.exhausted;
     this.harmfulEffectTypes = copy.harmfulEffectTypes;
     this.weaponInfo         = copy.weaponInfo;
     this.attachie           = copy.attachie;
     this.effectsWho         = copy.effectsWho;
     this.effectSounds       = copy.effectSounds;
     this.isHarmful          = copy.isHarmful;
 }
예제 #10
0
 public void OnCreation(GameResult gameResult, IWeaponsLogic weaponInfo)
 {
     if (isWeaponCreated)
     {
         return;
     }
     isWeaponCreated = true;
     this.weaponInfo.OnCreation(gameResult, this, weaponInfo);
     this.OnCreation(gameResult, weaponInfo.Source.FactionInfo);
 }
 public virtual void OnCreation(GameResult gameResult, IWeapon host, IWeaponsLogic parentWeapon)
 {
     this.host         = host;
     this.parentWeapon = parentWeapon;
     this.source       = parentWeapon.Source;
     this.actionSource = parentWeapon.ActionSource;
     this.target       = parentWeapon.ActionSource.Target;
     this.factionInfo  = new FactionInfo(source.FactionInfo);
     this.effectCollection.OnCreation(source, this);
     //this.effectsWho = TargetingInfo.Merge(effectsWho, effectCollection.EffectsWho);
 }
 public WeaponsLogic(WeaponsLogic copy)
 {
     this.effectCollection = new EffectCollection(copy.effectCollection);
     this.actionSource     = copy.actionSource;
     this.source           = copy.source;
     this.parentWeapon     = copy.parentWeapon;
     this.target           = copy.target;
     this.factionInfo      = copy.factionInfo;
     this.effectsWho       = copy.effectsWho;
     this.host             = copy.host;
     this.solidHost        = copy.solidHost;
 }
예제 #13
0
 public LightningRayWeapon(
     LifeSpan lifeTime,
     IWeaponsLogic weaponInfo,
     float impulse,
     float distance,
     float displace,
     float detail)
     : base(lifeTime, weaponInfo, impulse, distance)
 {
     this.displace = displace;
     this.detail   = detail;
 }
예제 #14
0
 public void OnCreation(IShip source, IWeaponsLogic weaponInfo)
 {
     this.weaponInfo = weaponInfo;
     foreach (IEffect effect in effects)
     {
         effect.OnCreation(weaponInfo);
         effectsWho = TargetingInfo.Merge(effectsWho, effect.EffectsWho);
     }
     foreach (IProlongedEffect prolongedEffect in prolongedEffects)
     {
         prolongedEffect.OnCreation(weaponInfo);
         effectsWho = TargetingInfo.Merge(effectsWho, prolongedEffect.EffectsWho);
     }
 }
예제 #15
0
 public DirectedRayWeapon(
     LifeSpan lifeTime,
     IWeaponsLogic weaponInfo,
     float[] impulses,
     float[] positions,
     float[] directions,
     float[] distances)
     : base(lifeTime, weaponInfo)
 {
     this.impulses   = impulses;
     this.positions  = positions;
     this.directions = directions;
     this.distances  = distances;
 }
예제 #16
0
 public EffectCollection(EffectCollection copy)
 {
     this.effects          = new List <IEffect>(copy.effects.Count);
     this.prolongedEffects = new List <IProlongedEffect>(copy.prolongedEffects.Count);
     this.effectsWho       = copy.effectsWho;
     this.weaponInfo       = copy.weaponInfo;
     this.attachmentFlags  = copy.attachmentFlags;
     foreach (IEffect effect in copy.effects)
     {
         this.effects.Add((IEffect)effect.Clone());
     }
     foreach (IProlongedEffect prolongedEffect in copy.prolongedEffects)
     {
         this.prolongedEffects.Add((IProlongedEffect)prolongedEffect.Clone());
     }
 }
예제 #17
0
 public MultiStageDirectedRayWeapon(
     IWeaponsLogic weaponInfo,
     float[] impulses,
     float[] positions,
     float[] directions,
     float[] distances,
     float[] startTimes,
     float[] lifeTimes)
     : base(GetLifeTime(startTimes, lifeTimes), weaponInfo)
 {
     this.impulses   = impulses;
     this.positions  = positions;
     this.directions = directions;
     this.distances  = distances;
     this.startTimes = startTimes;
     this.lifeTimes  = lifeTimes;
     this.totalTime  = this.lifeTime.TimeLeft;
 }
 public virtual void OnCreation(GameResult gameResult, IWeapon host, IShip source, IAction actionSource)
 {
     this.host         = host;
     this.source       = source;
     this.actionSource = actionSource;
     this.target       = actionSource.Target;
     this.parentWeapon = null;
     if (source != null)
     {
         this.factionInfo = new FactionInfo(source.FactionInfo);
     }
     else
     {
         this.factionInfo = new FactionInfo(solidHost.FactionInfo);
     }
     this.effectCollection.OnCreation(source, this);
     this.effectsWho = TargetingInfo.Merge(effectsWho, effectCollection.EffectsWho);
 }
예제 #19
0
        public Controlable(
            LifeSpan lifeTime,
            PhysicsState physicsState,
            BodyFlags flags,
            RigidBodyTemplate template,
            ShipMovementInfo movementInfo,
            ShipState shipState,
            ControlableSounds controlableSounds,
            IWeaponsLogic weaponInfo)
            : this(
                lifeTime,
                physicsState,
                flags, template,
                movementInfo,
                shipState,
                controlableSounds)
        {
            this.weaponInfo = weaponInfo;

            this.CollisionState.GenerateCollisionEvents = true;
            this.CollisionState.GenerateContactEvents   = true;
            this.controlableType = ControlableType.Weapon;
        }
 public SpawningSolidWeapon(
     LifeSpan lifeTime,
     PhysicsState physicsState,
     BodyFlags flags,
     RigidBodyTemplate template,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     IWeaponsLogic weaponInfo,
     ISolidWeapon spawn,
     bool diesOnSpawn)
     : base(
         lifeTime,
         physicsState,
         flags, template,
         movementInfo,
         shipState,
         controlableSounds,
         weaponInfo)
 {
     this.spawn       = spawn;
     this.diesOnSpawn = diesOnSpawn;
 }
 public SpawningSolidWeapon(
     LifeSpan lifeTime,
     MassInertia massInfo,
     PhysicsState physicsState,
     BodyFlags flags, ICollidableBodyPart[] collidableParts,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     IWeaponsLogic weaponInfo,
     ISolidWeapon spawn,
     bool diesOnSpawn)
     : base(
         lifeTime,
         massInfo,
         physicsState,
         flags, collidableParts,
         movementInfo,
         shipState,
         controlableSounds,
         weaponInfo)
 {
     this.spawn       = spawn;
     this.diesOnSpawn = diesOnSpawn;
 }
 public InstantWeapon(IWeaponsLogic weaponInfo)
 {
     this.weaponInfo = weaponInfo;
 }
 public BaseCollidableWeapon(BaseCollidableWeapon copy)
     : base(copy)
 {
     this.weaponInfo = (IWeaponsLogic)copy.weaponInfo.Clone();
 }
 public virtual void OnCreation(GameResult gameResult, IWeaponsLogic weaponInfo)
 {
     this.weaponInfo.OnCreation(gameResult, this, weaponInfo);
 }
 public InstantWeapon(InstantWeapon copy)
     : base(copy)
 {
     this.weaponInfo = (IWeaponsLogic)copy.weaponInfo.Clone();
 }
 public BaseCollidableWeapon(IWeaponsLogic weaponInfo)
 {
     this.weaponInfo = weaponInfo;
 }
예제 #27
0
 public void OnCreation(GameResult gameResult, IWeaponsLogic weaponInfo)
 {
     this.weaponInfo.OnCreation(gameResult, this, weaponInfo);
     this.OnCreation(gameResult, weaponInfo.Source.FactionInfo);
 }
 public BaseCollidableWeapon(LifeSpan lifeTime, IWeaponsLogic weaponInfo)
     : base(lifeTime)
 {
     this.weaponInfo = weaponInfo;
 }
 public override void OnCreation(IWeaponsLogic weaponInfo)
 {
     wave = (ControlableWave)weaponInfo.SolidHost;
     base.OnCreation(weaponInfo);
 }
 public InstantWeapon(LifeSpan lifeTime, IWeaponsLogic weaponInfo)
     : base(lifeTime)
 {
     this.weaponInfo = weaponInfo;
 }