public override GeneralChange RemoveEffectTypes(EffectTypes types)
        {
            GeneralChange returnvalue = new GeneralChange();

            returnvalue.MovementInfoChange = smic.RemoveEffectTypes(types);
            return(returnvalue);
        }
示例#2
0
        public override GeneralChange RemoveEffectTypes(EffectTypes types)
        {
            GeneralChange returnvalue = new GeneralChange();
            PhysicsState  psc         = PhysicsStateChange;
            bool          filtered    = false;

            if (((int)types * (int)EffectTypes.Position) != 0)
            {
                if (returnvalue.PhysicsChange == null)
                {
                    returnvalue.PhysicsChange = new PhysicsState();
                }
                returnvalue.PhysicsChange.Position += psc.Position;
                psc.Position = ALVector2D.Zero;
                filtered     = true;
            }
            if (((int)types * (int)EffectTypes.Velocity) != 0)
            {
                if (returnvalue.PhysicsChange == null)
                {
                    returnvalue.PhysicsChange = new PhysicsState();
                }
                returnvalue.PhysicsChange.Velocity += psc.Velocity;
                psc.Velocity = ALVector2D.Zero;
                filtered     = true;
            }
            if (filtered)
            {
                PhysicsStateChange = psc;
            }
            return(returnvalue);
        }
示例#3
0
        public override GeneralChange RemoveEffectTypes(EffectTypes types)
        {
            GeneralChange returnvalue = new GeneralChange();

            returnvalue.ShipStateChange = ssc.RemoveEffectTypes(types);
            return(returnvalue);
        }
示例#4
0
        public override void FilterEffects(float dt, List <IEffect> effects)
        {
            GeneralChange change = new GeneralChange();

            foreach (IEffect effect in effects)
            {
                change.Merge(effect.RemoveEffectTypes(filteredEffectTypes));
            }
            if (change.ShipStateChange != null && change.ShipStateChange.Health < 0)
            {
                ShipStateChange truechange = new ShipStateChange();
                truechange.Energy = MathHelper.Floor(-change.ShipStateChange.Health * absorptionRatio);
                truechange.Health = MathHelper.Ceiling(change.ShipStateChange.Health * (1 - absorptionRatio));
                this.attachie.ShipState.Change(truechange);
            }
        }