main.floors.MT0=
{
    "floorId": "MT0",
    "title": "主塔 0 层",
    "name": "0",
    "canFlyTo": true,
    "canUseQuickShop": true,
    "cannotViewMap": false,
    "defaultGround": "ground",
    "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,10001,  0,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,10000,  0,10002,  0,  0,  0,  0,  0,  0],
    [  0,  0,  0,  0,  0,  0,  0,10003,  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": "setValue",
                "name": "flag:enemyId",
                "value": "0",
                "norefresh": true
            },
            {
                "type": "function",
                "function": "function(){\ncore.removeFlag(\"boss1\");\ncore.removeFlag(\"boss2\");\n}"
            },
            {
                "type": "function",
                "async": true,
                "function": "function(){\ncore.battleFinish(1);\n}"
            },
            {
                "type": "clearMap"
            },
            {
                "type": "showHero",
                "time": 0
            }
        ],
        "6,13": [
            {
                "type": "comment",
                "text": "勇士普攻"
            },
            {
                "type": "function",
                "function": "function(){\n(function () {\n\t// Initialize enemy data\n\tvar heroLevel = core.getFlag(\"lv\");\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyLevel = core.getEnemyLevel(realId);\n\tvar enemyHp = core.getFlag(\"enemyHp\");\n\tvar enemyHpMax = enemyLevel * enemyLevel * 20;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tvar damage = (heroLevel + 6) * heroLevel * heroLevel * core.getBuff(\"atk\") / enemyLevel + core.rand(3);\n\tdamage = Math.floor(damage);\n\tcore.setFlag(\"damage\", damage);\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, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 110, 150, 94, 104);\n}"
                    },
                    {
                        "type": "sleep",
                        "time": 100
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"uievent\", 40, 120, 440, 360);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                    },
                    {
                        "type": "for",
                        "name": "temp:A",
                        "from": "1",
                        "to": "4",
                        "step": "1",
                        "data": [
                            {
                                "type": "function",
                                "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 38, 120, 200, 200);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 38 + 4 * (core.getFlag(\"@temp@A\") % 2), 120, boundingBox[2], boundingBox[3]);\n\tvar damage = core.getFlag(\"damage\");\n\tcore.clearMap(\"uievent\", 70, 88, 70, 32);\n\tcore.fillText(\"uievent\", \"-\" + damage.toString(), 70, 116 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 255], \"16px 黑体\");\n})();\n}"
                            },
                            {
                                "type": "sleep",
                                "time": 100
                            }
                        ]
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"uievent\", 70, 88, 70, 32);\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
                ]
            }
        ],
        "8,13": [
            {
                "type": "choices",
                "text": "\t[流浪者,man]选择技能",
                "choices": [
                    {
                        "text": "气血归元",
                        "condition": "flag:skill==1&&status:mana>=core.getSkillExperience(0)",
                        "action": [
                            {
                                "type": "setValue",
                                "name": "status:mana",
                                "operator": "-=",
                                "value": "200"
                            },
                            {
                                "type": "setValue",
                                "name": "flag:damage",
                                "value": "Math.min(160, core.status.hero.hpmax - core.status.hero.hp)",
                                "norefresh": true
                            },
                            {
                                "type": "setValue",
                                "name": "status:hp",
                                "operator": "+=",
                                "value": "flag:damage",
                                "norefresh": true
                            },
                            {
                                "type": "for",
                                "name": "temp:A",
                                "from": "1",
                                "to": "4",
                                "step": "1",
                                "data": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 360, 268, 70, 32);\ncore.fillText(\"uievent\", \"+\" + core.getFlag(\"damage\").toString(), 360, 296 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 255], \"16px 黑体\");\nconsole.log(296 - 4 * core.getFlag(\"@temp@A\"));\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 100
                                    }
                                ]
                            },
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\", 360, 268, 70, 32);\n}"
                            },
                            {
                                "type": "exit"
                            }
                        ]
                    },
                    {
                        "text": "气血归元",
                        "color": [
                            153,
                            153,
                            153,
                            1
                        ],
                        "condition": "flag:skill==1&&status:mana<core.getSkillExperience(0)",
                        "action": [
                            "剑仙特有的运功疗伤技能",
                            {
                                "type": "exit"
                            }
                        ]
                    },
                    {
                        "text": "白虹贯日",
                        "condition": "flag:lv>=3&&status: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": "flag:damage",
                                "norefresh": true
                            },
                            {
                                "type": "if",
                                "condition": "(flag: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, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 350, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 100, 150, 94, 38);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 40, 120, 440, 360);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "text": "白虹贯日",
                        "color": [
                            153,
                            153,
                            153,
                            1
                        ],
                        "condition": "flag:lv>=3&&status:mana<core.getSkillExperience(1)",
                        "action": [
                            "剑仙的初级剑气招式",
                            {
                                "type": "exit"
                            }
                        ]
                    },
                    {
                        "text": "长空三式",
                        "condition": "flag:lv>=8&&status:mana>core.getSkillExperience(2)",
                        "action": [
                            {
                                "type": "setValue",
                                "name": "status:mana",
                                "operator": "-=",
                                "value": "core.getSkillExperience(2)"
                            },
                            {
                                "type": "setValue",
                                "name": "flag:damage",
                                "value": "core.getSkillDamage(2)",
                                "norefresh": true
                            },
                            {
                                "type": "setValue",
                                "name": "flag:enemyHp",
                                "operator": "-=",
                                "value": "flag:damage",
                                "norefresh": true
                            },
                            {
                                "type": "if",
                                "condition": "(flag: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, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 110, 174, 94, 38);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 100, 150, 94, 38);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 124, 150, 94, 38);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 40, 120, 440, 360);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "text": "长空三式",
                        "color": [
                            153,
                            153,
                            153,
                            1
                        ],
                        "condition": "flag:lv>=8&&status:mana<core.getSkillExperience(2)",
                        "action": [
                            "驾御剑气，以一化三",
                            {
                                "type": "exit"
                            }
                        ]
                    },
                    {
                        "text": "万箭穿心",
                        "condition": "flag:lv>=11&&status: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": "flag:damage",
                                "norefresh": true
                            },
                            {
                                "type": "if",
                                "condition": "(flag: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, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 100, 150, 94, 38);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\nif (!core.dymCanvas.effect) core.createCanvas(\"effect\", 40, 60, 102, 150, 136);\n}"
                                    },
                                    {
                                        "type": "for",
                                        "name": "temp:A",
                                        "from": "0",
                                        "to": "6",
                                        "step": "1",
                                        "data": [
                                            {
                                                "type": "function",
                                                "function": "function(){\n(function () {\n\tcore.clearMap(\"effect\");\n\tvar t = core.getFlag(\"@temp@A\");\n\tvar start = [1, 0, 4, 3, 0, 4, 1];\n\tvar end = [3, 4, 2, 3, 4, 2, 3];\n\tfor (var i = 0; i < 7; ++i)\n\t\tif (t >= start[i]) core.drawImage(\"effect\", \"sword.png\", 0, 0, 18, 30, i * 14, Math.min(t - start[i], end[i]) * 30, 18, 30);\n})();\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 100
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"effect\");\ncore.clearMap(\"uievent\", 40, 120, 440, 360);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "text": "万箭穿心",
                        "color": [
                            153,
                            153,
                            153,
                            1
                        ],
                        "condition": "flag:lv>=11&&status:mana<core.getSkillExperience(3)",
                        "action": [
                            "剑仙宗师所创，以气御剑",
                            {
                                "type": "exit"
                            }
                        ]
                    },
                    {
                        "text": "劈星斩月",
                        "condition": "flag:lv>=16&&status:mana>=core.getSkillExperience(4)",
                        "action": [
                            {
                                "type": "setValue",
                                "name": "status:mana",
                                "operator": "-=",
                                "value": "core.getSkillExperience(4)"
                            },
                            {
                                "type": "setValue",
                                "name": "flag:damage",
                                "value": "core.getSkillDamage(4)",
                                "norefresh": true
                            },
                            {
                                "type": "setValue",
                                "name": "flag:enemyHp",
                                "operator": "-=",
                                "value": "flag:damage",
                                "norefresh": true
                            },
                            {
                                "type": "if",
                                "condition": "(flag: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, 300, 94, 94);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 24, 158, 94, 38, Math.PI / 2);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 48, 158, 94, 38, Math.PI / 2);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 198, 94, 38, 72, 158, 94, 38, Math.PI / 2);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 94, 94, 104, 160, 160, 94, 104);\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 250
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 40, 120, 440, 360);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "text": "劈星斩月",
                        "color": [
                            153,
                            153,
                            153,
                            1
                        ],
                        "condition": "flag:lv>=16&&status:mana<core.getSkillExperience(4)",
                        "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(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 38, 120, 200, 200);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 38 + 4 * (core.getFlag(\"@temp@A\") % 2), 120, boundingBox[2], boundingBox[3]);\n\tvar damage = core.getFlag(\"damage\");\n\tcore.clearMap(\"uievent\", 70, 88, 70, 32);\n\tcore.fillText(\"uievent\", \"-\" + damage.toString(), 70, 116 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 255], \"16px 黑体\");\n})();\n}"
                            },
                            {
                                "type": "sleep",
                                "time": 100
                            }
                        ]
                    },
                    {
                        "type": "function",
                        "function": "function(){\ncore.clearMap(\"uievent\", 70, 88, 70, 32);\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": "(flag:enemyHp==0)",
                "true": [
                    {
                        "type": "comment",
                        "text": "击败当前怪物"
                    },
                    {
                        "type": "if",
                        "condition": "(flag:enemyId > 256)",
                        "true": [
                            {
                                "type": "comment",
                                "text": "多个怪物"
                            },
                            {
                                "type": "setValue",
                                "name": "flag:enemyId",
                                "operator": "//=",
                                "value": "256"
                            },
                            {
                                "type": "function",
                                "function": "function(){\n(function () {\n\t// Initialize enemy data\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyLevel = core.getEnemyLevel(realId);\n\tvar enemyHp = enemyLevel * enemyLevel * 20;\n\tcore.setFlag(\"enemyHp\", enemyHp);\n\tcore.setFlag(\"enemyHpMax\", enemyHp);\n\tvar enemyName = core.getEnemyName(realId);\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\t// Clear ui\n\tcore.clearMap(\"uievent\");\n\t// Blood of monster\n\tcore.fillBoldText(\"uievent\", enemyName, 32, 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.fillBoldText(\"uievent\", core.status.hero.name, 32, 80, [0, 0, 0, 1], [255, 255, 255], \"28px 黑体\");\n\tcore.strokeRect(\"uievent\", 141, 53, 302, 14, [0, 0, 0], 2);\n\tcore.fillRect(\"uievent\", 142, 54, 300 * core.status.hero.hp / core.status.hero.hpmax, 12, [255, 0, 0]);\n\tcore.strokeRect(\"uievent\", 141, 73, 302, 14, [0, 0, 0], 2);\n\tcore.fillRect(\"uievent\", 142, 74, 300 * core.status.hero.mana / core.status.hero.manamax, 12, [0, 0, 255]);\n\t// Monster image\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 40, 120, boundingBox[2], boundingBox[3]);\n\t// Hero image\n\tcore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n})();\n}"
                            }
                        ],
                        "false": [
                            {
                                "type": "comment",
                                "text": "战斗胜利"
                            },
                            {
                                "type": "function",
                                "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar money = core.getEnemyMoney(realId) + core.rand(3);\n\tvar items = core.getEnemyItem(realId);\n\tvar experience = core.getEnemyExperience(realId);\n\tvar winMsg = \"战斗胜利。得到\" + money.toString() + \"两银子\";\n\tif (core.getFlag(\"boss1\") == 1) {\n\t\titems = { \"weakWine\": 1, \"sword1\": 1 };\n\t\tcore.removeBlock(0, 9, \"MT7\");\n\t\tcore.removeFlag(\"boss1\");\n\t}\n\tif (core.getFlag(\"boss2\") == 1) {\n\t\titems = { \"curseWine\": 2, \"shield1\": 1 };\n\t\tcore.removeBlock(2, 15, \"MT6\");\n\t\tcore.removeFlag(\"boss2\");\n\t}\n\tif (realId == 4) {\n\t\tcore.removeBlock(10, 40, \"MT3\");\n\t}\n\tcore.status.hero.money += money;\n\tcore.status.hero.exp += experience;\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\twinMsg += \"，获得\" + experience.toString() + \"点经验。\";\n\tcore.insertAction(winMsg);\n})();\n}"
                            },
                            {
                                "type": "showHero",
                                "time": 0
                            },
                            {
                                "type": "function",
                                "async": true,
                                "function": "function(){\ncore.battleFinish();\n}"
                            }
                        ]
                    }
                ],
                "false": [
                    {
                        "type": "comment",
                        "text": "怪物普攻"
                    },
                    {
                        "type": "function",
                        "function": "function(){\n(function () {\n\t// Initialize enemy data\n\tvar heroLevel = core.getFlag(\"lv\");\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyLevel = core.getEnemyLevel(realId);\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tvar damage = enemyLevel * enemyLevel * 20 / heroLevel * (2 - core.getBuff(\"def\")) + core.rand(4);\n\tdamage = Math.floor(damage);\n\tcore.setFlag(\"damage\", damage);\n\tcore.status.hero.hp -= damage;\n\tif (core.status.hero.hp < 0) core.status.hero.hp = 0;\n})();\n}"
                    },
                    {
                        "type": "if",
                        "condition": "(!core.isReplaying())",
                        "true": [
                            {
                                "type": "if",
                                "condition": "((flag:enemyId==11)||(flag:enemyId==20))",
                                "true": [
                                    {
                                        "type": "comment",
                                        "text": "喷火怪物"
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyAttackBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 38, 120, 200, 200);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 40, 120, boundingBox[2], boundingBox[3]);\n})();\n}"
                                    },
                                    {
                                        "type": "for",
                                        "name": "temp:A",
                                        "from": "1",
                                        "to": "7",
                                        "step": "1",
                                        "data": [
                                            {
                                                "type": "function",
                                                "function": "function(){\n(function () {\n\tvar t = core.getFlag(\"@temp@A\");\n\tvar start = [1, 2, 3, 3, 3, 4, 4, 4];\n\tvar end = [2, 3, 4, 4, 4, 7, 7, 7];\n\tvar fx = [0, 8, 23, 18, 16, 48, 22, 46];\n\tvar fy = [0, 8, 18, 23, 16, 32, 38, 46];\n\tcore.clearMap(\"uievent\", 140, 190, 200, 200);\n\tfor (var i = 0; i < 8; ++i)\n\t\tif (t >= start[i] && t <= end[i]) core.drawImage(\"uievent\", \"flame.png\", 0, 0, 32, 34, 140 + fx[i] * 2, 190 + fy[i] * 2, 32, 34);\n})();\n}"
                                            },
                                            {
                                                "type": "sleep",
                                                "time": 100
                                            }
                                        ]
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 40, 120, 310, 300);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 40, 120, boundingBox[2], boundingBox[3]);\n})();\n}"
                                    }
                                ],
                                "false": [
                                    {
                                        "type": "comment",
                                        "text": "普通怪物"
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyAttackBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 38, 120, 200, 200);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 120, 160, boundingBox[2], boundingBox[3]);\n})();\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 100
                                    },
                                    {
                                        "type": "function",
                                        "function": "function(){\n(function () {\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\tcore.clearMap(\"uievent\", 120, 160, 200, 200);\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 40, 120, boundingBox[2], boundingBox[3]);\n})();\n}"
                                    }
                                ]
                            },
                            {
                                "type": "for",
                                "name": "temp:A",
                                "from": "1",
                                "to": "4",
                                "step": "1",
                                "data": [
                                    {
                                        "type": "function",
                                        "function": "function(){\ncore.clearMap(\"uievent\", 348, 300, 132, 180);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 348 + 4 * (core.getFlag(\"@temp@A\") % 2), 300, 94, 94);\ncore.clearMap(\"uievent\", 360, 268, 70, 32);\ncore.fillText(\"uievent\", \"-\" + core.getFlag(\"damage\").toString(), 360, 296 - 4 * core.getFlag(\"@temp@A\"), [255, 255, 255], \"16px 黑体\");\n}"
                                    },
                                    {
                                        "type": "sleep",
                                        "time": 100
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "type": "if",
                        "condition": "(status:hp==0)",
                        "true": [
                            {
                                "type": "function",
                                "function": "function(){\n(function () {\n\tcore.insertAction(\"看来我还需要好好练功。\");\n})();\n}"
                            },
                            {
                                "type": "setValue",
                                "name": "flag:enemyId",
                                "value": "0",
                                "norefresh": true
                            },
                            {
                                "type": "function",
                                "function": "function(){\ncore.removeFlag(\"boss1\");\ncore.removeFlag(\"boss2\");\n}"
                            },
                            {
                                "type": "showHero",
                                "time": 0
                            },
                            {
                                "type": "function",
                                "async": true,
                                "function": "function(){\ncore.battleFinish(1);\n}"
                            }
                        ],
                        "false": [
                            {
                                "type": "function",
                                "function": "function(){\ncore.clearMap(\"uievent\", 360, 268, 70, 32);\ncore.clearMap(\"uievent\", 348, 300, 132, 180);\ncore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n}"
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "changeFloor": {},
    "afterBattle": {},
    "afterGetItem": {},
    "afterOpenDoor": {},
    "cannotMove": {},
    "bgmap": [

],
    "fgmap": [

],
    "width": 15,
    "height": 15,
    "autoEvent": {},
    "eachArrive": [
        {
            "type": "hideHero",
            "time": 0
        },
        {
            "type": "autoSave",
            "nohint": true
        },
        {
            "type": "function",
            "function": "function(){\n(function () {\n\t// Initialize enemy data\n\tvar enemyId = core.getFlag(\"enemyId\");\n\tvar realId = enemyId % 256;\n\tvar enemyLevel = core.getEnemyLevel(realId);\n\tvar enemyHp = enemyLevel * enemyLevel * 20;\n\tcore.setFlag(\"enemyHp\", enemyHp);\n\tcore.setFlag(\"enemyHpMax\", enemyHp);\n\tvar enemyName = core.getEnemyName(realId);\n\tvar enemyPicId = core.getEnemyPictureId(realId);\n\tvar boundingBox = core.getEnemyBoundingBox(enemyPicId);\n\t// Draw ui\n\tcore.ui._createUIEvent();\n\t// Blood of monster\n\tcore.fillBoldText(\"uievent\", enemyName, 32, 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.fillBoldText(\"uievent\", core.status.hero.name, 32, 80, [0, 0, 0, 1], [255, 255, 255], \"28px 黑体\");\n\tcore.strokeRect(\"uievent\", 141, 53, 302, 14, [0, 0, 0], 2);\n\tcore.fillRect(\"uievent\", 142, 54, 300 * core.status.hero.hp / core.status.hero.hpmax, 12, [255, 0, 0]);\n\tcore.strokeRect(\"uievent\", 141, 73, 302, 14, [0, 0, 0], 2);\n\tcore.fillRect(\"uievent\", 142, 74, 300 * core.status.hero.mana / core.status.hero.manamax, 12, [0, 0, 255]);\n\t// Monster image\n\tcore.drawImage(\"uievent\", enemyPicId.toString() + \".png\", boundingBox[0], boundingBox[1], boundingBox[2], boundingBox[3], 40, 120, boundingBox[2], boundingBox[3]);\n\t// Hero image\n\tcore.drawImage(\"uievent\", \"atk.png\", 0, 0, 94, 94, 350, 300, 94, 94);\n})();\n}"
        }
    ]
}