Ejemplo n.º 1
0
 public InterruptionEffect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, bool blend, long starttime = 0)
     : base(library, baseIndex, count, duration, owner)
 {
     Repeat = true;
     Blend  = blend;
     effectlist.Add(this);
 }
 private bool CheckDownloadRequireLibrary(MLibrary lib)
 {
     return(lib.IsRequire &&
            !string.IsNullOrEmpty(lib.Path) &&
            !string.IsNullOrEmpty(lib.Url) &&
            !CheckFileValidation(Path.Combine(MinecraftPath.Library, lib.Path), lib.Hash));
 }
Ejemplo n.º 3
0
 public BuffEffect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, bool blend, BuffType buffType)
     : base(library, baseIndex, count, duration, owner, 0)
 {
     Repeat   = true;
     Blend    = blend;
     BuffType = buffType;
     Light    = -1;
 }
Ejemplo n.º 4
0
 public SpecialEffect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, bool blend, bool drawBehind, uint type)
     : base(library, baseIndex, count, duration, owner, 0, drawBehind)
 {
     Blend      = blend;
     DrawBehind = drawBehind;
     EffectType = type;
     Light      = -1;
 }
Ejemplo n.º 5
0
        public Missile(MLibrary library, int baseIndex, int count, int duration, Point source, Point target)
            : base(library, baseIndex, count, duration, source)
        {
            Missiles.Add(this);
            Destination = target;

            Direction = MapControl.Direction16(Source, Destination);
        }
Ejemplo n.º 6
0
 public Missile(MLibrary library, int baseIndex, int count, int duration, MapObject owner, Point target, bool direction16 = true)
     : base(library, baseIndex, count, duration, owner)
 {
     Missiles.Add(this);
     Source      = Owner.CurrentLocation;
     Destination = target;
     Direction   = direction16 ? MapControl.Direction16(Source, Destination) : (int)Functions.DirectionFromPoint(Source, Destination);
 }
Ejemplo n.º 7
0
 void App_Exit(object sender, ExitEventArgs e)
 {
     try {
         MLibrary.cleanup();
     } catch (System.Exception ex) {
         MessageBox.Show(ex.Message, "Error during Maya API cleanup");
         return;
     }
 }
Ejemplo n.º 8
0
        bool loopit = false; //soundloop

        public ElementsEffect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, bool blend, int elementType, int killtime, bool loopon = false)
            : base(library, baseIndex, count, duration, owner)
        {
            Repeat = true;
            Blend  = blend;
            myType = elementType;
            killAt = killtime;
            //
            loopit = loopon;
            StopSounds();
            StartSound();
        }
Ejemplo n.º 9
0
        public Effect(MLibrary library, int baseIndex, int count, int duration, Point source, long starttime = 0, bool drawBehind = false)
        {
            Library   = library;
            BaseIndex = baseIndex;
            Count     = count == 0 ? 1 : count;
            Duration  = duration;
            Start     = starttime == 0 ? CMain.Time : starttime;

            NextFrame = Start + (Duration / Count) * (CurrentFrame + 1);
            Source    = source;

            DrawBehind = drawBehind;
        }
Ejemplo n.º 10
0
        public Effect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, long starttime = 0, bool drawBehind = false)
        {
            Library   = library;
            BaseIndex = baseIndex;
            Count     = count == 0 ? 1 : count;
            Duration  = duration;
            Start     = starttime == 0 ? CMain.Time : starttime;

            NextFrame = Start + (Duration / Count) * (CurrentFrame + 1);
            Owner     = owner;
            Source    = Owner.CurrentLocation;

            DrawBehind = drawBehind;
        }
Ejemplo n.º 11
0
        public Effect(MLibrary library, int baseIndex, int count, int duration, Point source, long starttime = 0, bool drawBehind = false, int lightDistance = 6, Color?lightColour = null)
        {
            Library     = library;
            BaseIndex   = baseIndex;
            Count       = count == 0 ? 1 : count;
            Duration    = duration;
            Start       = starttime == 0 ? CMain.Time : starttime;
            Light       = lightDistance;
            LightColour = lightColour == null ? Color.White : (Color)lightColour;

            NextFrame = Start + (Duration / Count) * (CurrentFrame + 1);
            Source    = source;

            DrawBehind = drawBehind;
        }
Ejemplo n.º 12
0
 public DelayedExplosionEffect(MLibrary library, int baseIndex, int count, int duration, MapObject owner, bool blend, int Stage, long until)
     : base(library, baseIndex, count, duration, owner)
 {
     Repeat = (Stage == 2) ? false : true;
     Blend  = blend;
     stage  = Stage;
     effectlist.Add(this);
     if (stage == 1)
     {
         SoundManager.PlaySound(20000 + 125 * 10);
     }
     if (stage == 2)
     {
         SoundManager.PlaySound(20000 + 125 * 10 + 5);
     }
 }
Ejemplo n.º 13
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            try {
                MLibrary.initialize("MayaWpfStandAlone");
                bool bSuccess = MayaTheme.Initialize(this);

                string    fileName;
                string [] args = Environment.GetCommandLineArgs();
                if (args.Length <= 1)
                {
                    Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                    dlg.FileName   = "Maya Files";              // Default file name
                    dlg.DefaultExt = ".ma";                     // Default file extension
                    dlg.Filter     = "Maya Files (.ma/.mb)|*.ma;*.mb|Maya ASCII (.ma)|*.ma|Maya Binary (.mb)|*.mb|All files (*.*)|*.*";
                    Nullable <bool> result = dlg.ShowDialog();
                    if (result == true)
                    {
                        fileName = dlg.FileName;
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    fileName = args [1];
                }

                MFileIO.newFile(true);
                fileName = fileName.Replace('\\', '/');
                MFileIO.open(fileName);
            } catch (System.Exception ex) {
                MessageBox.Show(ex.Message, "Error during Maya API initialization. This program will exit");
                Application.Current.Shutdown();
            }
        }
Ejemplo n.º 14
0
 public virtual Missile CreateProjectile(int baseIndex, MLibrary library, bool blend, int count, int interval, int skip, int lightDistance = 6, bool direction16 = true, Color?lightColour = null, uint targetID = 0)
 {
     return(null);
 }