add slot

    
      
  • /*
     * @title add slot
     * @description スロット数をBBBに無理矢理表示させます
     * @license MIT License
     * @require jQuery
     */
    
    
    
    var dat = [{
     id: 1,
     name: "クーガーI型",
     parts: {
      head: {slot:2.0},
      body: {slot:2.0},
      arm: {slot:1.5},
      leg: {slot:2.0}
     }
    }, {
     id: 2,
     name: "クーガーII型",
     parts: {
      head: {slot:2.2},
      body: {slot:2.0},
      arm: {slot:1.5},
      leg: {slot:2.0}
     }
    }, {
     id: 3,
     name: "ヘヴィガードI型",
     parts: {
      head: {slot:2.2},
      body: {slot:1.7},
      arm: {slot:2.2},
      leg: {slot:2.5}
     }
    }, {
     id: 4,
     name: "ヘヴィガードIII型",
     parts: {
      head: {slot:1.9},
      body: {slot:1.9},
      arm: {slot:2.3},
      leg: {slot:2.3}
     }
    }, {
     id: 5,
     name: "ヘヴィガードIV型",
     parts: {
      head: {slot:2.2},
      body: {slot:2.0},
      arm: {slot:1.9},
      leg: {slot:2.2}
     }
    }, {
     id: 6,
     name: "シュライクI型",
     parts: {
      head: {slot:2.8},
      body: {slot:2.8},
      arm: {slot:1.1},
      leg: {slot:1.9}
     }
    }, {
     id: 7,
     name: "シュライクII型",
     parts: {
      head: {slot:3.0},
      body: {slot:3.0},
      arm: {slot:0.8},
      leg: {slot:1.9}
     }
    }, {
     id: 8,
     name: "シュライクV型",
     parts: {
      head: {slot:2.5},
      body: {slot:2.8},
      arm: {slot:1.3},
      leg: {slot:1.3}
     }
    }, {
     id: 9,
     name: "ツェーブラ38",
     parts: {
      head: {slot:2.2},
      body: {slot:2.0},
      arm: {slot:1.7},
      leg: {slot:2.5},
     }
    }, {
     id: 10,
     name: "ツェーブラ39",
     parts: {
      head: {slot:2.5},
      body: {slot:1.9},
      arm: {slot:1.8},
      leg: {slot:2.6}
     }
    }, {
     id: 11,
     name: "ツェーブラ41",
     parts: {
      head: {slot:2.1},
      body: {slot:2.1},
      arm: {slot:2.0},
      leg: {slot:2.2}
     }
    }, {
     id: 12,
     name: "エンフォーサーI型",
     parts: {
      head: {slot:2.0},
      body: {slot:1.8},
      arm: {slot:1.2},
      leg: {slot:2.3}
     }
    }, {
     id: 13,
     name: "エンフォーサーII型",
     parts: {
      head: {slot:9.9}, //最強の頭部パーツ
      body: {slot:1.9},
      arm: {slot:1.4},
      leg: {slot:2.1}
     }
    }, {
     id: 14,
     name: "ケーファー42",
     parts: {
      head: {slot:2.4},
      body: {slot:1.9},
      arm: {slot:1.8},
      leg: {slot:1.9}
     }
    }, {
     id: 15,
     name: "ケーファー44",
     parts: {
      head: {slot:2.0},
      body: {slot:1.8},
      arm: {slot:1.4},
      leg: {slot:2.0}
     }
    }, {
     id: 16,
     name: "E.D.G-α",
     parts: {
      head: {slot:2.5},
      body: {slot:2.5},
      arm: {slot:1.0},
      leg: {slot:1.7}
     }
    }, {
     id: 17,
     name: "E.D.G-β",
     parts: {
      head: {slot:2.7},
      body: {slot:2.6},
      arm: {slot:0.6},
      leg: {slot:1.7}
     }
    }, {
     id: 18,
     name: "エンフォーサーIII型",
     parts: {
      head: {slot:2.3},
      body: {slot:2.4},
      arm: {slot:1.6},
      leg: {slot:1.5}
     }
    }, {
     id: 19,
     name: "ケーファー45",
     parts: {
      head: {slot:2.2},
      body: {slot:2.3},
      arm: {slot:2.0},
      leg: {slot:1.8}
     }
    }, {
     id: 20,
     name: "E.D.G-δ",
     parts: {
      head: {slot:2.5},
      body: {slot:2.4},
      arm: {slot:1.3},
      leg: {slot:1.3}
     }
    }, {
     id: 21,
     name: "ヤクシャ",
     parts: {
      head: {slot:1.9},
      body: {slot:2.3},
      arm: {slot:1.0},
      leg: {slot:1.1}
     }
    }, {
     id: 22,
     name: "ヤクシャ・改",
     parts: {
      head: {slot:1.7},
      body: {slot:2.6},
      arm: {slot:0.5},
      leg: {slot:1.2}
     }
    }, {
     id: 23,
     name: "クーガーS型",
     parts: {
      head: {slot:1.5},
      body: {slot:1.5},
      arm: {slot:1.5},
      leg: {slot:1.5}
     }
    }, {
     id: 24,
     name: "セイバーI型",
     parts: {
      head: {slot:0},
      body: {slot:0},
      arm: {slot:0},
      leg: {slot:0}
     }
    }, {
     id: 25,
     name: "セイバーI型R",
     parts: {
      head: {slot:2.6},
      body: {slot:2.6},
      arm: {slot:0.8},
      leg: {slot:1.8}
     }
    }, {
     id: 26,
     name: "ディスカス・プロト",
     parts: {
      head: {slot:1.8},
      body: {slot:1.7},
      arm: {slot:1.4},
      leg: {slot:2.1}
     }
    }, {
     id: 27,
     name: "ディスカス・ダート",
     parts: {
      head: {slot:2.2},
      body: {slot:2.1},
      arm: {slot:1.2},
      leg: {slot:1.9}
     }
    }, {
     id: 28,
     name: "セイバーII型",
     parts: {
      head: {slot:2.7},
      body: {slot:3.0},
      arm: {slot:0.9},
      leg: {slot:1.3}
     }
    }, {
     id: 29,
     name: "ディスカス・ノヴァ",
     parts: {
      head: {slot:1.8},
      body: {slot:1.7},
      arm: {slot:1.8},
      leg: {slot:1.7}
     }
    }, {
     id: 30,
     name: "ヤクシャ・弐",
     parts: {
      head: {slot:2.1},
      body: {slot:2.2},
      arm: {slot:1.0},
      leg: {slot:1.0}
     }
    }, {
     id: 31,
     name: "ネレイド45",
     parts: {
      head: {slot:2.2},
      body: {slot:2.0},
      arm: {slot:1.2},
      leg: {slot:2.0}
     }
    }, {
     id: 32,
     name: "ネレイド45改",
     parts: {
      head: {slot:2.1},
      body: {slot:1.9},
      arm: {slot:1.3},
      leg: {slot:1.9}
     }
    }, {
     id: 33,
     name: "ネレイド46",
     parts: {
      head: {slot:2.4},
      body: {slot:2.5},
      arm: {slot:1.5},
      leg: {slot:2.0}
     }
    }, {
     id: 34,
     name: "迅牙",
     parts: {
      head: {slot:2.2},
      body: {slot:2.1},
      arm: {slot:1.1},
      leg: {slot:1.9}
     }
    }, {
     id: 35,
     name: "迅牙・甲",
     parts: {
      head: {slot:1.8},
      body: {slot:1.9},
      arm: {slot:1.1},
      leg: {slot:1.5}
     }
    }, {
     id: 36,
     name: "ロージーR",
     parts: {
      head: {slot:2.1},
      body: {slot:1.7},
      arm: {slot:2.0},
      leg: {slot:2.2}
     }
    }, {
     id: 37,
     name: "ロージーR+",
     parts: {
      head: {slot:2.1},
      body: {slot:1.7},
      arm: {slot:2.1},
      leg: {slot:2.1}
     }
    }, {
     id: 38,
     name: "迅牙・真",
     parts: {
      head: {slot:2.3},
      body: {slot:2.2},
      arm: {slot:1.5},
      leg: {slot:1.8}
     }
    }, {
     id: 38,
     name: "ロージーLM",
     parts: {
      head: {slot:2.2},
      body: {slot:1.9},
      arm: {slot:1.8},
      leg: {slot:2.3}
     }
    }
    , {
     id: 39,
     name: "B.U.Z.-α",
     parts: {
      head: {slot:2.6},
      body: {slot:2.8},
      arm: {slot:0.7},
      leg: {slot:1.8}
     }
    }, {
     id: 40,
     name: "B.U.Z.-β",
     parts: {
      head: {slot:2.7},
      body: {slot:2.4},
      arm: {slot:0.8},
      leg: {slot:1.8}
     }
    }, {
     id: 41,
     name: "B.U.Z.-γ",
     parts: {
      head: {slot:2.2},
      body: {slot:2.8},
      arm: {slot:0.7},
      leg: {slot:2.0}
     }
    }];
    
    var asmReloadSlot = function(args){
      args = jQuery.extend({
        head: 0,
        body: 0,
        arm: 0,
        leg: 0
      }, args || {});
    
      var result = dat[args.head].parts.head.slot
                   + dat[args.body].parts.body.slot
                   + dat[args.arm].parts.arm.slot
                   + dat[args.leg].parts.leg.slot;
    
      //console.log(result);
      jQuery('#asmSlot').empty().text(result);
    }
    
    // add slot view
    jQuery('#asmArmorAvg').parent().after('<tr><th class="item">スロット</th><td class="asmDetail" id="asmSlot">0.0</td></tr>');
    
    // add change event
    jQuery('#blast_runner_head_part_id').change(function(){ asmReloadSlot({head: parseInt(jQuery(this).children(':selected').val())-1 } )});
    jQuery('#blast_runner_body_part_id').change(function(){ asmReloadSlot({body: parseInt(jQuery(this).children(':selected').val())-1 } )});
    jQuery('#blast_runner_arm_part_id').change(function(){  asmReloadSlot({arm:  parseInt(jQuery(this).children(':selected').val())-1 } )});
    jQuery('#blast_runner_leg_part_id').change(function(){  asmReloadSlot({leg:  parseInt(jQuery(this).children(':selected').val())-1 } )});
    
    jQuery.noConflict();
    asmReloadSlot();
    
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2012/02/29 14:57:00 - 2012-02-29
  2. 2012/02/29 14:55:48 - 2012-02-29
  3. 2012/02/29 14:54:08 - 2012-02-29
  4. 2012/02/29 14:50:29 - 2012-02-29
  5. 2012/02/29 14:48:38 - 2012-02-29
  6. 2012/02/29 14:47:12 - 2012-02-29
  7. 2012/02/29 14:26:41 - 2012-02-29