Beispiel #1
0
        public override void Run(Combat.Character character)
        {
            SoundId?soundid             = EvaluationHelper.AsSoundId(character, SoundId, null);
            Int32   volume              = EvaluationHelper.AsInt32(character, Volume, 0);
            Int32   channelindex        = EvaluationHelper.AsInt32(character, ChannelNumber, -1);
            Boolean priority            = EvaluationHelper.AsBoolean(character, ChannelPriority, false);
            Single  frequencymultiplier = EvaluationHelper.AsSingle(character, FrequencyMultiplier, 1.0f);
            Boolean loop   = EvaluationHelper.AsBoolean(character, LoopSound, false);
            Int32?  pan    = EvaluationHelper.AsInt32(character, PanSound, null);
            Int32?  abspan = EvaluationHelper.AsInt32(character, PanSoundAbsolute, null);

            if (soundid == null)
            {
                return;
            }

            Audio.SoundManager soundmanager = SoundId.IsCommon(false) ? character.Engine.CommonSounds : character.SoundManager;

            Audio.Channel channel = soundmanager.Play(channelindex, soundid.Value, priority, volume, frequencymultiplier, loop);
            if (channel != null && pan != null)
            {
                channel.RelativePan(pan.Value);
            }
            if (channel != null && abspan != null)
            {
                channel.AbsolutePan(abspan.Value);
            }
        }
Beispiel #2
0
        public override void Run(Combat.Character character)
        {
            int?time       = EvaluationHelper.AsInt32(character, Time, 30);
            var buffertime = EvaluationHelper.AsInt32(character, EndCommandBufferTime, 0);
            var movetime   = EvaluationHelper.AsInt32(character, MoveTime, 0);
            var pausebg    = EvaluationHelper.AsBoolean(character, PauseBackgrounds, true);
            var power      = EvaluationHelper.AsInt32(character, PowerAdd, 0);

#warning Documentation states that default should be 30. Testing looks to be 100.
            var animationnumber = EvaluationHelper.AsInt32(character, AnimationNumber, 100);

            var soundid           = EvaluationHelper.AsSoundId(character, SoundId, null);
            var animationposition = EvaluationHelper.AsPoint(character, AnimationPosition, new Point(0, 0));
            var darkenscreen      = EvaluationHelper.AsBoolean(character, DarkenScreen, true);
            var p2defmul          = EvaluationHelper.AsSingle(character, P2DefenseMultiplier, null);
            var unhittable        = EvaluationHelper.AsBoolean(character, Unhittable, true);

            if (time == null)
            {
                return;
            }

            var pause = character.Engine.SuperPause;
            pause.Set(character, time.Value, buffertime, movetime, false, pausebg);

            character.BasePlayer.Power += power;

            var data = new Combat.ExplodData();
            data.PositionType    = PositionType.P1;
            data.Location        = (Vector2)animationposition;
            data.RemoveTime      = -2;
            data.CommonAnimation = EvaluationHelper.IsCommon(AnimationNumber, true);
            data.AnimationNumber = animationnumber;
            data.Scale           = Vector2.One;
            data.SuperMove       = true;
            data.Creator         = character;
            data.Offseter        = character;
            data.DrawOnTop       = true;

            var explod = new Combat.Explod(character.Engine, data);
            if (explod.IsValid)
            {
                explod.Engine.Entities.Add(explod);
            }

            if (soundid != null)
            {
                Audio.SoundManager soundmanager = SoundId.IsCommon(true) ? character.Engine.CommonSounds : character.SoundManager;
                soundmanager.Play(soundid.Value);
            }
        }