function initReward_superBomb(type) {
    console.log('init ' + type)
    changetypeTo_superBomb();
    
    // 奖励回写
    console.log('reward_info ', reward_info)
    if (!reward_info) {
        return
    }

    for (const field in reward_info) {
        if (["attackNums", "shootRate", "minFloorAttack", "maxFloorAttack"].includes(field)) {
            $(`input[name="superBombConfig[${field}]"]`).val(reward_info[field])
        }
        if ("robotConf" === field) {
            for (const field2 in reward_info[field]) {
                reward_info[field][field2].forEach((value, index) => {
                    $(`input[name="superBombConfig[robotConf][${field2}][${index}]"]`).val(value)
                })
            }
        }
    }

}

function changetypeTo_superBomb() {
    $("#reward_info").empty();
    initSuperBombWrap();
}

function initSuperBombWrap() {
    var html = SuperBombWrapStageTable();
    $("#reward_info").append(html);
}

function SuperBombWrapStageTable() {
    return `
    <table class="table table-bordered">
        <thead>
            <tr>
                <td>盾宠物使用次数（最多3次）</td>
                <td>使用0次</td>
                <td>使用1次</td>
            <tr>
        </thead>
        <tr>
            <td>概率(%)</td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][useShieldPet][0]" value="0" class="form-control"></td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][useShieldPet][1]" value="0" class="form-control"></td>
        </tr>
    </table>
    <table class="table table-bordered">
        <thead>
            <tr>
                <td>盾牌数量（最多3个）</td>
                <td>0盾</td>
                <td>1盾</td>
                <td>2盾</td>
                <td>3盾</td>
                <td>4盾</td>
            <tr>
        </thead>
        <tr>
            <td>概率(%)</td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][shieldNums][0]" value="0" class="form-control"></td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][shieldNums][1]" value="0" class="form-control"></td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][shieldNums][2]" value="0" class="form-control"></td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][shieldNums][3]" value="0" class="form-control"></td>
            <td><input type="number" placeholder="" name="superBombConfig[robotConf][shieldNums][4]" value="0" class="form-control"></td>
        </tr>
    </table>

    <div class="form-group" style="margin-top: 50px">
        <label class="col-sm-2" style="text-align: center">超级攻击机会数量（最大10）：</label>
        <input class="col-sm-3" oninput="if (this.value>10) this.value=10" type="number" name="superBombConfig[attackNums]" value="0">
        <label class="col-sm-3" style="text-align: center">每个超级攻击里包含的攻击次数（最大4）：</label>
        <input class="col-sm-2" oninput="if (this.value>4) this.value=4" type="number" name="superBombConfig[shootRate]" value="0">
    </div>
    <div class="form-group" style="margin-top: 50px">
        <label class="col-sm-2" style="text-align: center">保底触发次数范围：</label>
        <input class="col-sm-2"  type="number" name="superBombConfig[minFloorAttack]" value="0" style="margin-right: 50px">
        <input class="col-sm-2"  type="number" name="superBombConfig[maxFloorAttack]" value="0">
    </div>
    `;
}


