//全局

{

    "ID": 2010813,

    "EventTypeTag": [

        "Empty"

    ],

    "Specials":{

        "test":0,

        //屏蔽首个onturn

        "turn":1,



        //位置信息

        "playerX":0,

        "playerY":0,

        //GoldenBuddyX_2010813

        //GoldenBuddyY_2010813

        //GoldenBuddyIndex_2010813

        //GoldenBuddyLeftIndex_2010813

        //GoldenBuddyRightIndex_2010813

        //GoldenBuddyUpIndex_2010813

        //GoldenBuddyButtonIndex_2010813



        //事件存活信息

        // GoldenBuddyDead_2010813



        //距离信息

        "Dir":0,    //顺序左右下上，0原1左2右3下4上

        "maxdist":0,   //玩家位置与事件相邻点的最大距离

        "curdist":0,    //当前方向距离

        "defaultdist":0 //事件点和玩家距离

    },

    "Events": {

        "OnCreate":{

            "Actions":[

                //记录玩家位置

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "playerX",

                    "SpecialValue": "playerpos(X)"

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "playerY",

                    "SpecialValue": "playerpos(Y)"

                }

            ]

        },

        "OnPlayerMove":{

            "Actions":[

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd",

                    "Predicates":[

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyDead_2010813",

                            "CompareType": "Equal",

                            "Count": 1

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "turn",

                    "SpecialValue": 0

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "playerX",

                    "SpecialValue": "playerpos(X)"

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "playerY",

                    "SpecialValue": "playerpos(Y)"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnTurn_custom",

                    "Predicates":[

                        {

                            "$type":"Share.CConfigEventByEventState",

                            "X":0,

                            "Y":0,

                            "NodeType":"All",

                            "Position":"Relative",

                            "EventID":[2010814],

                            "Count":1,

                            "CompareType":"NotEqual"

                        }

                    ]

                }

            ]

        },

        "OnTurn_custom":{

            "Actions":[

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "turn",

                            "Param":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd",

                    "Predicates":[

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyDead_2010813",

                            "CompareType": "Equal",

                            "Count": 1

                        }

                    ]

                },

                //寻找方向

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "FindDirect"

                }

            ]

        },

        "FindDirect":{

            "Actions":[

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": 0

                },

                {

                    //原地不动

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 0

                },

                {

                    "$type":"Share.CConfigGoto",

                    "GotoID":101,

                    "Predicates": [

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyIndex_2010813",

                            "CompareType": "Equal",

                            "Count": "scenevar(GoldenBuddyLeftIndex_2010813)"

                        }

                    ]

                },

                {

                    //左侧距离

                    "$type":"Share.CConfigHollowDistance",

                    "Index1":"getindex(0,0,0,0,0)",

                    "Index2":"scenevar(GoldenBuddyLeftIndex_2010813)",

                    "Special":"curdist"

                },

                {

                    //向左移动

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 1,

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },

                {

                    //左侧最远

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": "specials(curdist)",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },



                {

                    "$type":"Share.CConfigGoto",

                    "ID":101,

                    "GotoID":102,

                    "Predicates": [

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyIndex_2010813",

                            "CompareType": "Equal",

                            "Count": "scenevar(GoldenBuddyRightIndex_2010813)"

                        }

                    ]

                },

                {

                    //右侧距离

                    "$type":"Share.CConfigHollowDistance",

                    "Index1":"getindex(0,0,0,0,0)",

                    "Index2":"scenevar(GoldenBuddyRightIndex_2010813)",

                    "Special":"curdist"

                },

                {

                    //向右移动

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 2,

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },

                {

                    //右侧最远

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": "specials(curdist)",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },



                {

                    "$type":"Share.CConfigGoto",

                    "ID":102,

                    "GotoID":103,

                    "Predicates": [

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyIndex_2010813",

                            "CompareType": "Equal",

                            "Count": "scenevar(GoldenBuddyButtonIndex_2010813)"

                        }

                    ]

                },

                {

                    //下侧距离

                    "$type":"Share.CConfigHollowDistance",

                    "Index1":"getindex(0,0,0,0,0)",

                    "Index2":"scenevar(GoldenBuddyButtonIndex_2010813)",

                    "Special":"curdist"

                },

                {

                    //向下移动

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 3,

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },

                {

                    //下侧最远

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": "specials(curdist)",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },



                {

                    "$type":"Share.CConfigGoto",

                    "ID":103,

                    "GotoID":104,

                    "Predicates": [

                        {

                            "$type": "Share.CConfigEventByHollowVariable",

                            "Key": "GoldenBuddyIndex_2010813",

                            "CompareType": "Equal",

                            "Count": "scenevar(GoldenBuddyUpIndex_2010813)"

                        }

                    ]

                },

                {

                    //上侧距离

                    "$type":"Share.CConfigHollowDistance",

                    "Index1":"getindex(0,0,0,0,0)",

                    "Index2":"scenevar(GoldenBuddyUpIndex_2010813)",

                    "Special":"curdist"

                },

                {

                    //向上移动

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 4,

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },

                {

                    //上侧最远

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": "specials(curdist)",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "maxdist",

                            "Param":"specials(curdist)",

                            "CompareType":"Less"

                        }

                    ]

                },

                //修正

                // {

                //     //赋值擂台初始值

                //     "$type":"Share.CConfigHollowDistance",

                //     "Index1":"getindex(0,0,0,0,0)",

                //     "Index2":"scenevar(GoldenBuddyIndex_2010813)",

                //     "Special":"defaultdist"

                // },

                // {

                //     //向上移动

                //     "$type": "Share.CConfigSetSpecial",

                //     "SpecialName": "Dir",

                //     "SpecialValue": 0,

                //     "Predicates": 

                //     [

                //         {

                //             "$type": "Share.CConfigEventBySpecials",

                //             "ParamName": "maxdist",

                //             "Param":"specials(defaultdist)",

                //             "CompareType":"Equal"

                //         }

                //     ]

                // },

                //***//

                // {

                //     "$type": "Share.CConfigSetHollowVariable",

                //     "Key": "test_Dir",

                //     "Value": "specials(Dir)"

                // },

                //****//

                {

                    "$type": "Share.CConfigJump",

                    "ID":104,

                    "Jump": "SetNewPos"

                }

            ]

        },

        "SetNewPos":{

            "Actions":[

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "Dir",

                            "Param":0,

                            "CompareType":"Equal"

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigEventModification",

                    "X": "scenevar(GoldenBuddyX_2010813)",

                    "Y": "scenevar(GoldenBuddyY_2010813)",

                    "Position": "Absolute",

                    "Radius": 0,

                    "ModificationNum": 1,

                    "ModificationType": 1,

                    "TargetEventID": [ 2010814 ],

                    "TargetEventType": 1,

                    //"TargetEventState": "Locked",

                    //"TargetVisibleState": "Visible",

                    "EventID": [ 1003 ],

                    "EventState": "Locked",

                    "VisibleState": "Visible"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "SetLeft",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "Dir",

                            "Param":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "SetRight",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "Dir",

                            "Param":2,

                            "CompareType":"Equal"

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "SetButton",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "Dir",

                            "Param":3,

                            "CompareType":"Equal"

                        }

                    ]

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "SetUp",

                    "Predicates": 

                    [

                        {

                            "$type": "Share.CConfigEventBySpecials",

                            "ParamName": "Dir",

                            "Param":4,

                            "CompareType":"Equal"

                        }

                    ]

                }

            ]

        },

        "SetLeft":{

            "Actions":[

                //------观测任务------

                {

                    //布布存钱罐

                    "$type":"Share.CConfigSetConditionProgress",

                    "ConditionID":30060114,

                    "Progress":1,

                    "ModifyType":"Add",

                    "Predicates":[

                        {

                            "$type":"Share.CConfigEventByEventState",

                            "X": "scenevar(GoldenBuddyX_2010813)-1",

                            "Y": "scenevar(GoldenBuddyY_2010813)",

                            "NodeType":"All",

                            "EventID":[1016],

                            "Position":"Absolute",

                            "Radius":0,

                            "VisibleState":["Visible"],

                            "State":["ShowEvent"],

                            "Count":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                //------------

                {

                    "$type": "Share.CConfigEventModification",

                    "X": "scenevar(GoldenBuddyX_2010813)-1",

                    "Y": "scenevar(GoldenBuddyY_2010813)",

                    "Position": "Absolute",

                    "Radius": 0,

                    "ModificationNum": 1,

                    "ModificationType": 1,

                    "TargetEventID": [ 1000,1001,1016,1003 ],

                    "TargetEventType": 1,

                    //"TargetEventState": "Locked",

                    //"TargetVisibleState": "Visible",

                    "EventID": [ 2010814 ],

                    "EventState": "ShowEvent",

                    "VisibleState": "Visible"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd"

                }

            ]

        },

        "SetRight":{

            "Actions":[

                //------观测任务------

                {

                    //布布存钱罐

                    "$type":"Share.CConfigSetConditionProgress",

                    "ConditionID":30060114,

                    "Progress":1,

                    "ModifyType":"Add",

                    "Predicates":[

                        {

                            "$type":"Share.CConfigEventByEventState",

                            "X": "scenevar(GoldenBuddyX_2010813)+1",

                            "Y": "scenevar(GoldenBuddyY_2010813)",

                            "NodeType":"All",

                            "EventID":[1016],

                            "Position":"Absolute",

                            "Radius":0,

                            "VisibleState":["Visible"],

                            "State":["ShowEvent"],

                            "Count":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                //------------

                {

                    "$type": "Share.CConfigEventModification",

                    "X": "scenevar(GoldenBuddyX_2010813)+1",

                    "Y": "scenevar(GoldenBuddyY_2010813)",

                    "Position": "Absolute",

                    "Radius": 0,

                    "ModificationNum": 1,

                    "ModificationType": 1,

                    "TargetEventID": [ 1000,1001,1016,1003 ],

                    "TargetEventType": 1,

                    //"TargetEventState": "Locked",

                    //"TargetVisibleState": "Visible",

                    "EventID": [ 2010814 ],

                    "EventState": "ShowEvent",

                    "VisibleState": "Visible"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd"

                }

            ]

        },

        "SetButton":{

            "Actions":[

                //------观测任务------

                {

                    //布布存钱罐

                    "$type":"Share.CConfigSetConditionProgress",

                    "ConditionID":30060114,

                    "Progress":1,

                    "ModifyType":"Add",

                    "Predicates":[

                        {

                            "$type":"Share.CConfigEventByEventState",

                            "X": "scenevar(GoldenBuddyX_2010813)",

                            "Y": "scenevar(GoldenBuddyY_2010813)+1",

                            "NodeType":"All",

                            "EventID":[1016],

                            "Position":"Absolute",

                            "Radius":0,

                            "VisibleState":["Visible"],

                            "State":["ShowEvent"],

                            "Count":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                //------------

                {

                    "$type": "Share.CConfigEventModification",

                    "X": "scenevar(GoldenBuddyX_2010813)",

                    "Y": "scenevar(GoldenBuddyY_2010813)+1",

                    "Position": "Absolute",

                    "Radius": 0,

                    "ModificationNum": 1,

                    "ModificationType": 1,

                    "TargetEventID": [ 1000,1001,1016,1003 ],

                    "TargetEventType": 1,

                    //"TargetEventState": "Locked",

                    //"TargetVisibleState": "Visible",

                    "EventID": [ 2010814 ],

                    "EventState": "ShowEvent",

                    "VisibleState": "Visible"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd"

                }

            ]

        },

        "SetUp":{

            "Actions":[

                //------观测任务------

                {

                    //布布存钱罐

                    "$type":"Share.CConfigSetConditionProgress",

                    "ConditionID":30060114,

                    "Progress":1,

                    "ModifyType":"Add",

                    "Predicates":[

                        {

                            "$type":"Share.CConfigEventByEventState",

                            "X": "scenevar(GoldenBuddyX_2010813)",

                            "Y": "scenevar(GoldenBuddyY_2010813)-1",

                            "NodeType":"All",

                            "EventID":[1016],

                            "Position":"Absolute",

                            "Radius":0,

                            "VisibleState":["Visible"],

                            "State":["ShowEvent"],

                            "Count":1,

                            "CompareType":"Equal"

                        }

                    ]

                },

                //------------

                

                {

                    "$type": "Share.CConfigEventModification",

                    "X": "scenevar(GoldenBuddyX_2010813)",

                    "Y": "scenevar(GoldenBuddyY_2010813)-1",

                    "Position": "Absolute",

                    "Radius": 0,

                    "ModificationNum": 1,

                    "ModificationType": 1,

                    "TargetEventID": [ 1000,1001,1016,1003 ],

                    "TargetEventType": 1,

                    //"TargetEventState": "Locked",

                    //"TargetVisibleState": "Visible",

                    "EventID": [ 2010814 ],

                    "EventState": "ShowEvent",

                    "VisibleState": "Visible"

                },

                {

                    "$type": "Share.CConfigJump",

                    "Jump": "OnEnd"

                }

            ]

        },

        "OnEnd":{

            "Actions":[

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "Dir",

                    "SpecialValue": 0

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "maxdist",

                    "SpecialValue": 0

                },

                {

                    "$type": "Share.CConfigSetSpecial",

                    "SpecialName": "curdist",

                    "SpecialValue": 0

                }

            ]

        }

    }

}

