Widget:Summon Simulator/20160722

<!doctype html> FFBE Gacha Simulator - exviuswiki.com     /**        * FFBE Gacha Simulator v0.1 *        * https://exviuswiki.com *        * Hayate, Locke, Artemios Banner */

var banner_rate = [ // offbanner - 70% ['3_common',       47.6], ['3_rare',         8.4], ['4_common',       10.6], ['4_rare',         2.7], ['5_rare',         0.7],

// featured - 30% ['3_rare_ft',      24], ['4_rare_ft',      5.7], ['5_rare_ft',      0.3] ];

var type_4 = [ ['base_3',         90], ['base_4',         10] ];

var type_5 = [ ['base_3',         90], ['base_4',         10] ];

var type_4_ft = [ ['base_3',         100], ['base_4',         0] ];

var type_5_ft = [ ['base_3',         100], ['base_4',         0] ];

var units = [ {               name: 'Hayate', featured: true, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Locke', featured: true, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Artemios', featured: true, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Kefka', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Golbez', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Chizuru', featured: false, type: 'rare', base: 4, awakened: false, three_stars: false, four_stars: true, five_stars: true },           {                name: 'Gilbert', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Celes', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Xiao', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Leo', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Rakshasa', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Miyuki', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Medius', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Roselia', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Cerius', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Duane', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Vaan', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Zidane', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Firion', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Bartz', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Terra', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Cecil', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Cloud of Darkness', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Kuja', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Exdeath', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Garland', featured: false, type: 'rare', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: true },           {                name: 'Galuf', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Russell', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Bedile', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Luna', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Anzelm', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Clyne', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Cyan', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Rydia', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Shantotto', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Fran', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Edgar', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Kain', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Krile', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Shadow', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Sabin', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Maria', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Penelo', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false },           {                name: 'Vivi', featured: false, type: 'common', base: 3, awakened: false, three_stars: true, four_stars: true, five_stars: false }       ];

function arrayColumn(arr, n) { return arr.map(x=> x[n]); }

function summon(num) { $('.gacha-result').text("");

$('.loading img').attr("src", "").attr("src", $('.loading img').data("src")); $('.loading').show;

var wikitext = ' ';

$.ajax({               url: "https://exviuswiki.com/api.php?action=parse&format=json&prop=text&contentmodel=wikitext&text=" + wikitext,                dataType: "json"            }) .done(function( data ) {               result = data.parse.text["*"];                result = result.replace(/3_star/g, "  &#9733;&#9733;&#9733;  ");                result = result.replace(/4_star/g, "  &#9733;&#9733;&#9733;&#9733;  ");                result = result.replace(/5_star/g, "  &#9733; &#9733; &#9733; &#9733; &#9733;  ");                $('.gacha-result').html(result);

$('.loading img').attr("src", ""); $('.loading').hide; });       }        Summon (1)         Summon (3)         Summon (10)                 Loading...