main.floors.MT0=
{
    "floorId": "MT0",
    "title": "战斗层",
    "name": "0",
    "canFlyTo": true,
    "canUseQuickShop": true,
    "cannotViewMap": false,
    "defaultGround": "X10051",
    "images": [],
    "ratio": 1,
    "map": [
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,30001,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,30000,  0,30002,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,30003,  0,  0,  0,  0,  0,  0,  0]
],
    "firstArrive": [],
    "parallelDo": "",
    "events": {
        "7,12": [
            {
                "type": "if",
                "condition": "(!core.isReplaying())",
                "true": [
                    {
                        "type": "function",
                        "async": true,
                        "function": "function(){\ncore.openToolbox(false);\n}"
                    }
                ]
            }
        ],
        "7,14": [
            "\t[hero]师父教导我：三十六计走为上。",
            {
                "type": "function",
                "async": true,
                "function": "function(){\ncore.battleFinish(1);\n}"
            },
            {
                "type": "clearMap"
            },
            {
                "type": "showHero",
                "time": 0
            }
        ],
        "8,13": [
            {
                "type": "if",
                "condition": "(core.getFlag(\"atkTurn\")[core.getFlag(\"curHero\")] != 1)",
                "true": [
                    "本回合已经攻击过！",
                    {
                        "type": "function",
                        "function": "function(){\ncore.changeHero();\n}"
                    },
                    {
                        "type": "exit"
                    }
                ]
            },
            {
                "type": "if",
                "condition": "core.getFlag(\"curHero\")",
                "true": [
                    {
                        "type": "choices",
                        "text": "选择技能",
                        "choices": [
                            {
                                "text": "吐姆心经",
                                "condition": "core.getFlag(\"hero2\").lv>=14&&core.getFlag(\"hero2\").mana>=core.getSkillExperience(2)",
                                "action": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.getFlag(\"hero2\").mana -= core.getSkillExperience(2);\ncore.updateStatusBar();\n}"
                                    },
                                    {
                                        "type": "if",
                                        "condition": "0 in core.getFlag(\"atkTurn\")",
                                        "true": [
                                            {
                                                "type": "choices",
                                                "text": "选择加血对象",
                                                "choices": [
                                                    {
                                                        "text": "慕容天",
                                                        "action": [
                                                            {
                                                                "type": "setValue",
                                                                "name": "flag:addHp",
                                                                "value": "0",
                                                                "norefresh": true
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "text": "大师兄",
                                                        "action": [
                                                            {
                                                                "type": "setValue",
                                                                "name": "flag:addHp",
                                                                "value": "1",
                                                                "norefresh": true
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ],
                                        "false": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:addHp",
                                                "value": "1",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar hero = core.getFlag(\"addHp\") ? core.getFlag(\"hero2\") : core.status.hero;\n\tvar damage = Math.min(core.getSkillDamage(2), hero.hpmax - hero.hp);\n\thero.hp += damage;\n\tcore.setFlag(\"damage\", damage);\n})();\n}"
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "1",
                                                "to": "4",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\ncore.clearMap(\"effect\");\nif (core.getFlag(\"addHp\"))\n\tcore.fillText(\"effect\", \"+\" + core.getFlag(\"damage\").toString(), 390, 276 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\nelse\n\tcore.fillText(\"effect\", \"+\" + core.getFlag(\"damage\").toString(), 350, 316 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\n}"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "吐姆心经",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.getFlag(\"hero2\").lv>=14&&core.getFlag(\"hero2\").mana<core.getSkillExperience(2)",
                                "action": [
                                    "用功疗伤之心法",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "飞空剑冢",
                                "condition": "core.getFlag(\"hero2\").lv>=17&&core.getFlag(\"hero2\").mana>=core.getSkillExperience(4)",
                                "action": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.getFlag(\"hero2\").mana -= core.getSkillExperience(4);\ncore.updateStatusBar();\n}"
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:damage",
                                        "value": "core.getSkillDamage(4)",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:enemyHp",
                                        "operator": "-=",
                                        "value": "core.getFlag(\"damage\")",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(core.getFlag(\"enemyHp\")<0)",
                                        "true": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:enemyHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (0 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                                            },
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "1",
                                                "to": "4",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tvar t = core.getFlag(\"@temp@A\");\n\tcore.drawImage(\"effect\", \"light.png\", 300 - (t - 1) * 32, 224 - (t - 1) * 12);\n\tcore.drawImage(\"effect\", \"light.png\", 300 - t * 32, 224 - t * 12);\n\tcore.drawImage(\"effect\", \"light.png\", 300 - (t + 1) * 32, 224 - (t + 1) * 12);\n})();\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 150
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n}"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "text": "飞空剑冢",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.getFlag(\"hero2\").lv>=17&&core.getFlag(\"hero2\").mana<core.getSkillExperience(4)",
                                "action": [
                                    "万千剑气汇聚攻向敌人",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "取消",
                                "action": [
                                    {
                                        "type": "exit"
                                    }
                                ]
                            }
                        ]
                    }
                ],
                "false": [
                    {
                        "type": "choices",
                        "text": "选择技能",
                        "choices": [
                            {
                                "text": "百精聚神",
                                "condition": "core.status.hero.mana>=core.getSkillExperience(0)",
                                "action": [
                                    {
                                        "type": "setValue",
                                        "name": "status:mana",
                                        "operator": "-=",
                                        "value": "core.getSkillExperience(0)"
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:damage",
                                        "value": "core.getSkillDamage(0)",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:enemyHp",
                                        "operator": "-=",
                                        "value": "core.getFlag(\"damage\")",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(core.getFlag(\"enemyHp\")<0)",
                                        "true": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:enemyHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\ncore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\ncore.drawImage(\"effect\", \"air.png\", 260, 260);\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 150
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\ncore.drawImage(\"effect\", \"air.png\", 180, 210);\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 150
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\ncore.drawImage(\"effect\", \"air.png\", 100, 160);\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 150
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "text": "百精聚神",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.status.hero.mana<core.getSkillExperience(0)",
                                "action": [
                                    "精气汇聚一线，无坚不摧",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "吐姆心经",
                                "condition": "core.status.hero.mana>=core.getSkillExperience(2)",
                                "action": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.status.hero.mana -= core.getSkillExperience(2);\ncore.updateStatusBar();\n}"
                                    },
                                    {
                                        "type": "if",
                                        "condition": "1 in core.getFlag(\"atkTurn\")",
                                        "true": [
                                            {
                                                "type": "choices",
                                                "text": "选择加血对象",
                                                "choices": [
                                                    {
                                                        "text": "慕容天",
                                                        "action": [
                                                            {
                                                                "type": "setValue",
                                                                "name": "flag:addHp",
                                                                "value": "0",
                                                                "norefresh": true
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "text": "大师兄",
                                                        "action": [
                                                            {
                                                                "type": "setValue",
                                                                "name": "flag:addHp",
                                                                "value": "1",
                                                                "norefresh": true
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ],
                                        "false": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:addHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar hero = core.getFlag(\"addHp\") ? core.getFlag(\"hero2\") : core.status.hero;\n\tvar damage = Math.min(core.getSkillDamage(2), hero.hpmax - hero.hp);\n\thero.hp += damage;\n\tcore.setFlag(\"damage\", damage);\n})();\n}"
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "1",
                                                "to": "4",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\ncore.clearMap(\"effect\");\nif (core.getFlag(\"addHp\"))\n\tcore.fillText(\"effect\", \"+\" + core.getFlag(\"damage\").toString(), 390, 276 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\nelse\n\tcore.fillText(\"effect\", \"+\" + core.getFlag(\"damage\").toString(), 350, 316 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\n}"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "吐姆心经",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.status.hero.mana<core.getSkillExperience(2)",
                                "action": [
                                    "用功疗伤之心法",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "玄一无象",
                                "condition": "core.status.hero.lv>=11&&core.status.hero.mana>=core.getSkillExperience(1)",
                                "action": [
                                    {
                                        "type": "setValue",
                                        "name": "status:mana",
                                        "operator": "-=",
                                        "value": "core.getSkillExperience(1)"
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:damage",
                                        "value": "core.getSkillDamage(1)",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:enemyHp",
                                        "operator": "-=",
                                        "value": "core.getFlag(\"damage\")",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(core.getFlag(\"enemyHp\")<0)",
                                        "true": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:enemyHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\ncore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\ncore.drawImage(\"effect\", \"flame.png\", 60, 176);\ncore.drawImage(\"effect\", \"flame.png\", 100, 160);\ncore.drawImage(\"effect\", \"flame.png\", 60, 144);\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 250
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\ncore.drawImage(\"effect\", \"flame.png\", 82, 142);\ncore.drawImage(\"effect\", \"flame.png\", 86, 138);\ncore.drawImage(\"effect\", \"flame.png\", 82, 134);\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 250
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "text": "玄一无象",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.status.hero.lv>=11&&core.status.hero.mana<core.getSkillExperience(1)",
                                "action": [
                                    "剑气如虚影，杀人于无意之间",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "玄空噬魂",
                                "condition": "core.status.hero.lv>=16&&core.status.hero.mana>=core.getSkillExperience(3)",
                                "action": [
                                    {
                                        "type": "setValue",
                                        "name": "status:mana",
                                        "operator": "-=",
                                        "value": "core.getSkillExperience(3)"
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:damage",
                                        "value": "core.getSkillDamage(3)",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:enemyHp",
                                        "operator": "-=",
                                        "value": "core.getFlag(\"damage\")",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(core.getFlag(\"enemyHp\")<0)",
                                        "true": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:enemyHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n}"
                                            },
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "0",
                                                "to": "4",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tcore.drawImage(\"effect\", core.getHeroAttackImage(0), 310, 280);\n\tvar x = 260 - 20 * core.getFlag(\"@temp@A\"),\n\t\ty = 260 - 12 * core.getFlag(\"@temp@A\");\n\tcore.drawImage(\"effect\", \"air.png\", x, y);\n\tcore.drawImage(\"effect\", \"light.png\", x - 16, y - 32);\n\tcore.drawImage(\"effect\", \"light.png\", x - 36, y - 44);\n\tcore.drawImage(\"effect\", \"light.png\", x - 56, y - 56);\n})();\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 150
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "text": "玄空噬魂",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.status.hero.lv>=16&&core.status.hero.mana<core.getSkillExperience(3)",
                                "action": [
                                    "霹雳三招，令对方无法招架",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "移星拆月",
                                "condition": "core.status.hero.lv>=21&&core.status.hero.mana>=core.getSkillExperience(5)",
                                "action": [
                                    {
                                        "type": "setValue",
                                        "name": "status:mana",
                                        "operator": "-=",
                                        "value": "core.getSkillExperience(5)"
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:damage",
                                        "value": "core.getSkillDamage(5)",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "setValue",
                                        "name": "flag:enemyHp",
                                        "operator": "-=",
                                        "value": "core.getFlag(\"damage\")",
                                        "norefresh": true
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(core.getFlag(\"enemyHp\")<0)",
                                        "true": [
                                            {
                                                "type": "setValue",
                                                "name": "flag:enemyHp",
                                                "value": "0",
                                                "norefresh": true
                                            }
                                        ]
                                    },
                                    {
                                        "type": "if",
                                        "condition": "(!core.isReplaying())",
                                        "true": [
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\ncore.drawImage(\"uievent\", core.getHeroAttackImage(0), 310, 280);\n}"
                                            },
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "1",
                                                "to": "3",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tvar t = core.getFlag(\"@temp@A\");\n\tcore.drawImage(\"effect\", \"light.png\", 280 + (3 - t) * 14, 270 - (3 - t) * 14);\n\tcore.drawImage(\"effect\", \"light.png\", 280 - (3 - t) * 18, 270 - (3 - t) * 5);\n\tcore.drawImage(\"effect\", \"light.png\", 280 + (3 - t) * 5, 270 + (3 - t) * 18);\n})();\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "for",
                                                "name": "temp:A",
                                                "from": "4",
                                                "to": "9",
                                                "step": "1",
                                                "data": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tvar t = core.getFlag(\"@temp@A\");\n\tcore.drawImage(\"effect\", \"light.png\", 280 - (t - 4) * 30, 270 - (t - 4) * 20);\n})();\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.clearMap(\"effect\");\ncore.clearMap(\"uievent\", 310, 260, 170, 220);\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\ncore.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "text": "移星拆月",
                                "color": [
                                    153,
                                    153,
                                    153,
                                    1
                                ],
                                "condition": "core.status.hero.lv>=21&&core.status.hero.mana<core.getSkillExperience(5)",
                                "action": [
                                    "三光球，炫耀飞向敌人",
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "text": "取消",
                                "action": [
                                    {
                                        "type": "exit"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "type": "if",
                "condition": "(!core.isReplaying())",
                "true": [
                    {
                        "type": "for",
                        "name": "temp:A",
                        "from": "1",
                        "to": "4",
                        "step": "1",
                        "data": [
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\", 38, 120, 200, 200);\ncore.drawImage(\"uievent\", core.getEnemyPictureId(core.getFlag(\"enemyId\")), 38 + core.getFlag(\"@temp@A\") % 2 * 4, 120);\ncore.clearMap(\"effect\");\ncore.fillText(\"effect\", \"-\" + core.getFlag(\"damage\").toString(), 60, 136 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\n}"
                            },
                            {
                                "type": "sleep",
                                "time": 100
                            }
                        ]
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"effect\");\n}"
                    }
                ]
            },
            {
                "type": "function",
                "function": "function(){\ncore.clearMap(\"uievent\", 142, 22, 300, 12);\ncore.fillRect(\"uievent\", 142, 22, 300 * core.getFlag(\"enemyHp\") / core.getFlag(\"enemyHpMax\"), 12, [255, 0, 0]);\n}"
            },
            {
                "type": "trigger",
                "loc": [
                    6,
                    14
                ]
            }
        ],
        "6,13": [
            {
                "type": "if",
                "condition": "(core.getFlag(\"atkTurn\")[core.getFlag(\"curHero\")] != 1)",
                "true": [
                    "本回合已经攻击过！",
                    {
                        "type": "function",
                        "function": "function(){\ncore.changeHero();\n}"
                    },
                    {
                        "type": "exit"
                    }
                ]
            },
            {
                "type": "comment",
                "text": "勇士普攻"
            },
            {
                "type": "function",
                "function": "function(){\n(function () {\n\tvar damage = core.heroAtkDamage(core.getFlag(\"curHero\"));\n\tcore.setFlag(\"damage\", damage);\n\tvar enemyHp = core.getFlag(\"enemyHp\");\n\tenemyHp -= damage;\n\tif (enemyHp < 0) enemyHp = 0;\n\tcore.setFlag(\"enemyHp\", enemyHp);\n})();\n}"
            },
            {
                "type": "if",
                "condition": "(!core.isReplaying())",
                "true": [
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"uievent\", 350, 260, 130, 220);\nif (core.getFlag(\"curHero\")) {\n\tcore.drawImage(\"effect\", core.getHeroAttackImage(1), 110, 150);\n\tif (0 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n} else {\n\tcore.drawImage(\"effect\", core.getHeroAttackImage(0), 110, 150);\n\tif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n}\n}"
                    },
                    {
                        "type": "sleep",
                        "time": 100
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"effect\");\nif (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\nif (0 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n}"
                    },
                    {
                        "type": "for",
                        "name": "temp:A",
                        "from": "1",
                        "to": "4",
                        "step": "1",
                        "data": [
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\", 38, 120, 200, 200);\ncore.drawImage(\"uievent\", core.getEnemyPictureId(core.getFlag(\"enemyId\")), 38 + core.getFlag(\"@temp@A\") % 2 * 4, 120);\ncore.clearMap(\"effect\");\ncore.fillText(\"effect\", \"-\" + core.getFlag(\"damage\").toString(), 60, 136 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 0], \"16px 黑体\");\n}"
                            },
                            {
                                "type": "sleep",
                                "time": 100
                            }
                        ]
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"effect\");\n}"
                    }
                ]
            },
            {
                "type": "function",
                "function": "function(){\ncore.clearMap(\"uievent\", 142, 22, 300, 12);\ncore.fillRect(\"uievent\", 142, 22, 300 * core.getFlag(\"enemyHp\") / core.getFlag(\"enemyHpMax\"), 12, [255, 0, 0]);\n}"
            },
            {
                "type": "trigger",
                "loc": [
                    6,
                    14
                ]
            }
        ],
        "6,14": [
            {
                "type": "comment",
                "text": "勇士攻击后的全部事件"
            },
            {
                "type": "if",
                "condition": "(core.getFlag(\"enemyHp\")==0)",
                "true": [
                    {
                        "type": "comment",
                        "text": "击败当前怪物"
                    },
                    {
                        "type": "comment",
                        "text": "战斗胜利"
                    },
                    {
                        "type": "function",
                        "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar money = (core.getEnemyMoney(enemyId) + core.rand(3)) * 10;\n\tvar items = core.getEnemyItem(enemyId);\n\tvar experience = core.getEnemyExperience(enemyId);\n\tvar winMsg = \"战斗胜利。得到\" + money.toString() + \"两银子\";\n\tcore.status.hero.money += money;\n\tfor (var i in items) {\n\t\tcore.setItem(i, core.itemCount(i) + items[i]);\n\t\twinMsg += \"，\" + items[i].toString() + \"个\" + core.material.items[i].name;\n\t}\n\tvar eachExp = [experience, experience];\n\tvar atkTurn = core.getFlag(\"atkTurn\");\n\tif (!(0 in atkTurn)) eachExp[0] = Math.floor(eachExp[0] * 0.8);\n\tif (!(1 in atkTurn)) eachExp[1] = Math.floor(eachExp[1] * 0.8);\n\tvar lastAtk = core.getFlag(\"curHero\");\n\teachExp[1 - lastAtk] = Math.floor(eachExp[1 - lastAtk] * 0.8);\n\tcore.status.hero.up -= eachExp[0];\n\twinMsg += \"，慕容天获得\" + eachExp[0].toString() + \"点经验\";\n\tvar lvUp = core.checkHeroUp(0);\n\tif (lvUp) {\n\t\twinMsg += \"，升为\" + (lvUp[0] + core.getFlag(\"baselv\")) + \"级\";\n\t\tif (1 in lvUp) winMsg += \"，学会\" + lvUp[1];\n\t}\n\tif (core.getFlag(\"2hero\")) {\n\t\tcore.getFlag(\"hero2\").up -= eachExp[1];\n\t\twinMsg += \"，大师兄获得\" + eachExp[1].toString() + \"点经验\";\n\t\tvar lvUp = core.checkHeroUp(1);\n\t\tif (lvUp) {\n\t\t\twinMsg += \"，升为\" + (lvUp[0] + core.getFlag(\"baselv\")) + \"级\";\n\t\t\tif (1 in lvUp) winMsg += \"，学会\" + lvUp[1];\n\t\t}\n\t}\n\twinMsg += \"。\";\n\tcore.insertAction(winMsg);\n})();\n}"
                    },
                    {
                        "type": "if",
                        "condition": "(core.getFlag(\"enemyId\")==46)",
                        "true": [
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\");\n}"
                            },
                            {
                                "type": "hide",
                                "loc": [
                                    [
                                        7,
                                        8
                                    ]
                                ],
                                "floorId": "MT32",
                                "remove": true
                            },
                            {
                                "type": "hide",
                                "loc": [
                                    [
                                        7,
                                        9
                                    ]
                                ],
                                "floorId": "MT32",
                                "remove": true
                            },
                            {
                                "type": "setCurtain",
                                "color": [
                                    0,
                                    0,
                                    0,
                                    1
                                ],
                                "time": 0,
                                "keep": true
                            },
                            "魔君被消灭，冰莲也魂飞天外",
                            {
                                "type": "changeFloor",
                                "floorId": "MT35",
                                "loc": [
                                    0,
                                    0
                                ],
                                "direction": "down",
                                "time": 0
                            }
                        ],
                        "false": [
                            {
                                "type": "showHero",
                                "time": 0
                            },
                            {
                                "type": "function",
                                "async": true,
                                "function": "function(){\ncore.battleFinish();\n}"
                            }
                        ]
                    }
                ],
                "false": [
                    {
                        "type": "function",
                        "function": "function(){\ncore.getFlag(\"atkTurn\")[core.getFlag(\"curHero\")] = 0;\n}"
                    },
                    {
                        "type": "if",
                        "condition": "(core.getFlag(\"atkTurn\")[1 - core.getFlag(\"curHero\")] == 1)",
                        "true": [
                            {
                                "type": "comment",
                                "text": "换另一个人攻击"
                            },
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\", 38, 120, 200, 200);\ncore.drawImage(\"uievent\", core.getEnemyPictureId(core.getFlag(\"enemyId\")), 40, 120);\ncore.changeHero();\n}"
                            }
                        ],
                        "false": [
                            {
                                "type": "comment",
                                "text": "本回合结束，轮到怪物攻击"
                            },
                            {
                                "type": "if",
                                "condition": "(core.getFlag(\"enemyId\")==46)",
                                "true": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.getFlag(\"atkTurn\")[core.getFlag(\"curHero\")] = 1;\n}"
                                    },
                                    {
                                        "type": "exit"
                                    }
                                ]
                            },
                            {
                                "type": "comment",
                                "text": "怪物普攻"
                            },
                            {
                                "type": "function",
                                "function": "function(){\n(function () {\n\tvar t = core.rand(9);\n\tvar atkTurn = core.getFlag(\"atkTurn\");\n\tvar atkedHero = {};\n\tif (t == 0) {\n\t\tfor (var i = 0; i < 2; ++i)\n\t\t\tif (i in atkTurn)\n\t\t\t\tatkedHero[i] = core.heroDefDamage(i);\n\t} else {\n\t\tt = t % 2;\n\t\tif (!(t in atkTurn)) t = 1 - t;\n\t\tatkedHero[t] = core.heroDefDamage(t);\n\t}\n\tcore.setFlag(\"atkedHero\", atkedHero);\n\tfor (var i = 0; i < 2; ++i)\n\t\tif (i in atkedHero) {\n\t\t\tvar hero = i ? core.getFlag(\"hero2\") : core.status.hero;\n\t\t\thero.hp -= atkedHero[i];\n\t\t\tif (hero.hp < 0) {\n\t\t\t\thero.hp = 0;\n\t\t\t\tdelete atkTurn[i];\n\t\t\t}\n\t\t}\n})();\n}"
                            },
                            {
                                "type": "if",
                                "condition": "(!core.isReplaying())",
                                "true": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 38, 120, 200, 200);\n}"
                                    },
                                    {
                                        "type": "switch",
                                        "condition": "core.getEnemyAttackMode(core.getFlag(\"enemyId\"))",
                                        "caseList": [
                                            {
                                                "case": "0",
                                                "action": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\ncore.drawImage(\"effect\", core.getEnemyAttackPictureId(core.getFlag(\"enemyId\")), 80, 140);\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            },
                                            {
                                                "case": "1",
                                                "action": [
                                                    {
                                                        "type": "for",
                                                        "name": "temp:A",
                                                        "from": "0",
                                                        "to": "3",
                                                        "step": "1",
                                                        "data": [
                                                            {
                                                                "type": "function",
                                                                "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tcore.drawImage(\"effect\", core.getEnemyAttackPictureId(core.getFlag(\"enemyId\")), 80, 140);\n\tvar t = core.getFlag(\"@temp@A\");\n\tvar dy;\n\tvar atkedHero = core.getFlag(\"atkedHero\");\n\tif (0 in atkedHero)\n\t\tif (1 in atkedHero) dy = 40;\n\t\telse dy = 60;\n\telse dy = 25;\n\tvar x = 180 + t * 80;\n\tvar y = 190 + t * dy;\n\tcore.drawImage(\"effect\", \"flame.png\", x + 40, y + 24);\n\tcore.drawImage(\"effect\", \"flame.png\", x + 20, y + 12);\n\tcore.drawImage(\"effect\", \"flame.png\", x, y);\n})();\n}"
                                                            },
                                                            {
                                                                "type": "sleep",
                                                                "time": 100
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "case": "2",
                                                "action": [
                                                    {
                                                        "type": "function",
                                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tvar x, y;\n\tvar atkedHero = core.getFlag(\"atkedHero\");\n\tif (0 in atkedHero)\n\t\tif (1 in atkedHero) {\n\t\t\tx = 280;\n\t\t\ty = 230;\n\t\t}\n\telse {\n\t\tx = 260;\n\t\ty = 260;\n\t} else {\n\t\tx = 300;\n\t\ty = 210;\n\t}\n\tcore.drawImage(\"effect\", core.getEnemyAttackPictureId(core.getFlag(\"enemyId\")), x, y);\n})();\n}"
                                                    },
                                                    {
                                                        "type": "sleep",
                                                        "time": 100
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"effect\");\ncore.drawImage(\"uievent\", core.getEnemyPictureId(core.getFlag(\"enemyId\")), 40, 120);\n}"
                                    },
                                    {
                                        "type": "for",
                                        "name": "temp:A",
                                        "from": "1",
                                        "to": "4",
                                        "step": "1",
                                        "data": [
                                            {
                                                "type": "function",
                                                "function": "function(){\n(function () {\n\tvar atkedHero = core.getFlag(\"atkedHero\");\n\tvar a = core.getFlag(\"@temp@A\");\n\tcore.clearMap(\"uievent\", 348, 220, 132, 260);\n\tif (1 in atkedHero) {\n\t\tcore.drawImage(\"uievent\", core.getHeroImage(1), 388 + a % 2 * 4, 260);\n\t\tcore.fillText(\"uievent\", \"-\" + atkedHero[1].toString(), 390, 276 - a * 4, [255, 255, 0], \"16px 黑体\");\n\t} else if (1 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n\tif (0 in atkedHero) {\n\t\tcore.drawImage(\"uievent\", core.getHeroImage(0), 348 + a % 2 * 4, 300);\n\t\tcore.fillText(\"uievent\", \"-\" + atkedHero[0].toString(), 350, 316 - a * 4, [255, 255, 0], \"16px 黑体\");\n\t} else if (0 in core.getFlag(\"atkTurn\")) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n})();\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 100
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "if",
                                "condition": "(Object.keys(core.getFlag(\"atkTurn\")).length == 0)",
                                "true": [
                                    {
                                        "type": "comment",
                                        "text": "全死了"
                                    },
                                    "\t[hero]看来我还需要好好练功。",
                                    {
                                        "type": "showHero",
                                        "time": 0
                                    },
                                    {
                                        "type": "function",
                                        "async": true,
                                        "function": "function(){\ncore.battleFinish(1);\n}"
                                    }
                                ],
                                "false": [
                                    {
                                        "type": "if",
                                        "condition": "(!(core.getFlag(\"curHero\") in core.getFlag(\"atkTurn\")))",
                                        "true": [
                                            {
                                                "type": "comment",
                                                "text": "当前勇士死了，换人"
                                            },
                                            {
                                                "type": "function",
                                                "function": "function(){\ncore.changeHero();\n}"
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tcore.clearMap(\"uievent\", 348, 220, 132, 260);\n\tvar atkTurn = core.getFlag(\"atkTurn\");\n\tif (1 in atkTurn) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n\tif (0 in atkTurn) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n\tfor (var i in atkTurn) atkTurn[i] = 1;\n})();\n}"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "changeFloor": {},
    "afterBattle": {},
    "afterGetItem": {},
    "afterOpenDoor": {},
    "cannotMove": {},
    "bgmap": [

],
    "fgmap": [

],
    "width": 15,
    "height": 15,
    "autoEvent": {},
    "eachArrive": [
        {
            "type": "hideHero",
            "time": 0
        },
        {
            "type": "function",
            "function": "function(){\n(function () {\n\t// Initialize enemy data\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar enemyLevel = core.getEnemyLevel(enemyId);\n\tvar enemyHp = enemyLevel * enemyLevel * 75 - enemyLevel * 49 - 2131;\n\tif (core.getFlag(\"eventId\") == -1 && enemyId != 45) enemyHp *= 2;\n\tcore.setFlag(\"enemyHp\", enemyHp);\n\tcore.setFlag(\"enemyHpMax\", enemyHp);\n\tvar enemyName = core.getEnemyName(enemyId);\n\t// Initialize hero data\n\tvar hero = core.getFlag(\"curHero\") ? core.getFlag(\"hero2\") : core.status.hero;\n\tvar atkTurn = { 0: 1 };\n\tif (core.getFlag(\"2hero\")) atkTurn[1] = 1;\n\tcore.setFlag(\"atkTurn\", atkTurn);\n\t// Draw ui\n\tcore.ui._createUIEvent();\n\tif (!core.dymCanvas.effect) core.createCanvas(\"effect\", 0, 0, 480, 480, 136);\n\t// Blood of monster\n\tcore.fillBoldText(\"uievent\", enemyName, 22, 38, [0, 0, 0, 1], [255, 255, 255], \"28px 黑体\");\n\tcore.strokeRect(\"uievent\", 141, 21, 302, 14, [0, 0, 0], 2);\n\tcore.fillRect(\"uievent\", 142, 22, 300, 12, [255, 0, 0]);\n\t// Blood of hero\n\tcore.strokeRect(\"uievent\", 141, 53, 302, 14, [0, 0, 0], 2);\n\tcore.strokeRect(\"uievent\", 141, 73, 302, 14, [0, 0, 0], 2);\n\t// Monster image\n\tcore.drawImage(\"uievent\", core.getEnemyPictureId(enemyId), 40, 120);\n\t// Hero image\n\tif (1 in atkTurn) core.drawImage(\"uievent\", core.getHeroImage(1), 390, 260);\n\tif (0 in atkTurn) core.drawImage(\"uievent\", core.getHeroImage(0), 350, 300);\n\tcore.status.holdingKeys = [];\n})();\n}"
        },
        {
            "type": "if",
            "condition": "(core.getFlag(\"enemyId\")==46)",
            "true": [
                "\t[冰莲,role3.png]快！天哥！我已经用我的元神锁住了魔君的真魂！快杀了他！",
                "\t[hero]不行！这样连你也会丧命的！",
                "\t[冰莲,role3.png]天哥，快啊！呜呜……“离魂之术”坚持不了多久，到时，即使我不魂飞魄散，也会又变成魔物的！快出剑啊，不要辜负天下苍生，不要辜负我的爱！",
                "\t[hero]不！莲妹……我、我不能再失去你了……可、可是天下苍生怎么办？谁来告诉我……",
                "\t[hero]莲妹，原谅我……"
            ]
        },
        {
            "type": "autoSave",
            "nohint": true
        }
    ]
}