Example #1
0
        /// <summary>
        /// el: selfswitch
        /// switch [map:"integer"] [id:"integer"] local:"A-Z"
        /// [set "true|false"]
        /// </summary>
        /// <returns></returns>
        static void SelfSwitch()
        {
            MakeCommand.Category("switch");
            int mapId = MakeCommand.MapId;
            int id    = MakeCommand.EventId;

            if (MakeCommand.Optional("map"))
            {
                mapId = MakeCommand.Parameter("map").ToInteger();
            }
            if (MakeCommand.Optional("id"))
            {
                id = MakeCommand.Parameter("id").ToInteger();
            }
            string     local = MakeCommand.Parameter("local").ToString();
            GameSwitch s     = new GameSwitch(mapId, id, local);

            if (MakeCommand.Optional("set"))
            {
                InGame.System.GameSelfSwitches[s] = MakeCommand.Command("set").ToBoolean();
                if (mapId == InGame.Map.MapId)
                {
                    InGame.Map.IsNeedRefresh = true;
                }
            }
            else
            {
                LastCondition = InGame.System.GameSelfSwitches[s];
            }
        }
Example #2
0
 /// <summary></summary>
 /// el: screenzoom
 /// targetx "integer"
 /// targety "integer"
 /// duration "integer"
 static void ScreenZoom()
 {
     InGame.Screen.StartZoom(
         MakeCommand.Command("targetx").ToInteger() / 100f,
         MakeCommand.Command("targety").ToInteger() / 100f,
         MakeCommand.Command("duration").ToInteger());
 }
Example #3
0
        /// <summary></summary>
        /// el: zone
        /// x "integer"
        /// y "integer"
        /// [width "integer"]=1
        /// [height "integer"]=1
        /// [tox "integer"]
        /// [toy "integer"]
        /// </summary>
        static bool Zone()
        {
            int x = MakeCommand.Command("x").ToInteger();
            int y = MakeCommand.Command("y").ToInteger();
            int w = 1;
            int h = 1;

            if (MakeCommand.Optional("width"))
            {
                w = MakeCommand.Command("width").ToInteger();
            }
            if (MakeCommand.Optional("height"))
            {
                h = MakeCommand.Command("height").ToInteger();
            }
            if (MakeCommand.Optional("tox"))
            {
                w = MakeCommand.Command("tox").ToInteger() - x;
            }
            if (MakeCommand.Optional("toy"))
            {
                h = MakeCommand.Command("toy").ToInteger() - y;
            }
            return(InGame.Player.X > x * 32 && InGame.Player.Y > y * 32 && InGame.Player.X < (x + w) * 32 && InGame.Player.Y < (y + h) * 32);
        }
Example #4
0
        /// <summary>
        /// el: :  Picture EraseRect
        /// num "integer"
        /// </summary>
        static void PictureErase()
        {
            GamePicture picture = MakeCommand.Command("num").ToPicture();

            if (picture != null)
            {
                picture.Erase();
            }
        }
 /// <summary>
 /// EL Script, structure is :
 /// stringParams[0] = command Name
 /// stringParams[1] = command type (command,option,object)
 /// stringParam[2..n] = command and parameters
 /// </summary>
 bool SetupMakeCommand()
 {
     // Init Geex Make Command
     MakeCommand.Initialize(stringParams);
     MakeCommand.MapId   = mapId;
     MakeCommand.EventId = eventId;
     // Do not read option or object during game running
     // if (MakeCommand.type != MakeCommandType.Command) return true;
     // jump to command Name
     MakeCommand.Start();
     return(true);
 }
Example #6
0
        /// <summary>
        /// el: Picture rotate
        /// num "integer"
        /// [speed "integer"]
        /// [angle "integer"]
        /// </summary>
        static void PictureRotate()
        {
            GamePicture picture = MakeCommand.Command("num").ToPicture();
            int         speed   = 0;

            if (MakeCommand.Optional("speed"))
            {
                speed = MakeCommand.Command("speed").ToInteger();
            }
            if (picture != null)
            {
                picture.Rotate(speed);
            }
        }
Example #7
0
        /// <summary>
        /// el: Picture display
        /// num "integer"
        /// Name "string"
        /// position x:"integer" y:"integer"
        /// [Size zoom_x:"integer" zoom_y:"integer"]
        /// [opacity "0-255"]
        /// [blend "normal|add|sub"]
        /// [locked "boolean"]
        /// [centered "boolean"]
        /// [background "boolean"]=false
        /// </summary>
        static void PictureDisplay()
        {
            int    num  = MakeCommand.Command("num").ToInteger();
            string name = MakeCommand.Command("name").ToString();

            MakeCommand.Category("position");
            int  x          = MakeCommand.Parameter("x").ToInteger();
            int  y          = MakeCommand.Parameter("y").ToInteger();
            int  zoom_x     = 100;
            int  zoom_y     = 100;
            bool background = false;

            if (MakeCommand.Optional("size"))
            {
                MakeCommand.Category("size");
                zoom_x = MakeCommand.Parameter("zoom_x").ToInteger();
                zoom_y = MakeCommand.Parameter("zoom_y").ToInteger();
            }
            int blend_type = 0;

            if (MakeCommand.Optional("blend"))
            {
                blend_type = MakeCommand.Command("blend").ToBlendType();
            }
            byte opacity = 255;

            if (MakeCommand.Optional("opacity"))
            {
                opacity = (byte)MakeCommand.Command("opacity").ToInteger();
            }
            bool locked = false;

            if (MakeCommand.Optional("locked"))
            {
                locked = MakeCommand.Command("locked").ToBoolean();
            }
            if (MakeCommand.Optional("background"))
            {
                background = MakeCommand.Command("background").ToBoolean();
            }
            if (InGame.Temp.IsInBattle)
            {
                InGame.Screen.BattlePictures[num].Show(name, 0, x, y, zoom_x, zoom_y, opacity, blend_type, locked);
            }
            else
            {
                InGame.Screen.Pictures[num].Show(name, 0, x, y, zoom_x, zoom_y, opacity, blend_type, locked, true, background);
            }
        }
Example #8
0
        /// <summary>
        /// el: start Picture tone change
        /// num "integer"
        /// tone red:"0-255" green:"0-255" blue:"0-255" gray:"0-255"
        /// duration "integer"
        /// </summary>
        static void StartPictureToneChange()
        {
            GamePicture picture = MakeCommand.Command("num").ToPicture();

            MakeCommand.Category("tone");
            int red      = MakeCommand.Parameter("red").ToInteger();
            int green    = MakeCommand.Parameter("green").ToInteger();
            int blue     = MakeCommand.Parameter("blue").ToInteger();
            int gray     = MakeCommand.Parameter("gray").ToInteger();
            int duration = MakeCommand.Parameter("duration").ToInteger();

            if (picture != null)
            {
                picture.StartToneChange(new Tone(red, green, blue, gray), duration);
            }
        }
Example #9
0
        /// <summary>
        /// el: Picture move
        /// num "integer"
        /// duration "integer"
        /// position x:"integer" y:"integer"
        /// [Size zoom_x:"integer" zoom_y:"integer"]
        /// [opacity "0-255"]
        /// [blend_type "normaladd|sub"]
        /// [angle "0-360"]
        /// </summary>
        static void PictureMove()
        {
            GamePicture picture  = MakeCommand.Command("num").ToPicture();
            int         duration = MakeCommand.Command("duration").ToInteger();

            MakeCommand.Category("position");
            int   x          = MakeCommand.Parameter("x").ToInteger();
            int   y          = MakeCommand.Parameter("y").ToInteger();
            float zoom_x     = 100f;
            float zoom_y     = 100f;
            byte  opacity    = 255;
            int   blend_type = 0;

            if (picture != null)
            {
                zoom_x     = picture.ZoomX;
                zoom_y     = picture.ZoomY;
                opacity    = picture.Opacity;
                blend_type = picture.BlendType;
            }
            if (MakeCommand.Optional("size"))
            {
                MakeCommand.Category("size");
                zoom_x = MakeCommand.Parameter("zoom_x").ToInteger();
                zoom_y = MakeCommand.Parameter("zoom_y").ToInteger();
            }
            if (MakeCommand.Optional("blend_type"))
            {
                blend_type = MakeCommand.Command("blend_type").ToBlendType();
            }
            int angle = 0;

            if (MakeCommand.Optional("opacity"))
            {
                opacity = (byte)MakeCommand.Command("opacity").ToInteger();
            }
            if (MakeCommand.Optional("angle"))
            {
                angle = MakeCommand.Command("angle").ToInteger();
            }
            if (picture != null)
            {
                picture.Move(duration, picture.Origin, x, y, zoom_x, zoom_y, opacity, blend_type, angle);
            }
        }
Example #10
0
 /// <summary>
 /// Build a Geex Make object
 /// </summary>
 /// <param Name="text"></param>
 public MakeObject(string text)
 {
     expr = MakeCommand.GSub(text, new Regex(@"\\[Vv]\[([0-9]+)\]"), InGame.Variables.Arr);
 }