사용자:초코나무숲/common.js

리버티게임, 모두가 만들어가는 자유로운 게임
< 사용자:초코나무숲
초코나무숲 (토론 | 기여)님의 2023년 7월 21일 (금) 15:33 판 (플러그인 RPGinCity설치)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다.

  • 파이어폭스 / 사파리: Shift 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5 또는 Ctrl-R을 입력 (Mac에서는 ⌘-R)
  • 구글 크롬: Ctrl-Shift-R키를 입력 (Mac에서는 ⌘-Shift-R)
  • 인터넷 익스플로러 / 엣지: Ctrl 키를 누르면서 새로 고침을 클릭하거나, Ctrl-F5를 입력.
  • 오페라: Ctrl-F5를 입력.




/** 플러그인 UncyBeat***************************
* 버그 수정
* 버전 => 1.03
* 작성자 : [[사용자:Bd3076|Bd3076]] 
* JSON => UncyBeat = {"name":"UncyBeat","descript":"버그 수정","version":"1.03","local":true,"creat":"Bd3076","state":"UncyBeat/plugin","executable":true}; 
*/ 
function plugin_UncyBeat(){
  if($("[data-name='UncyBeat']").length >= 1){
		  // 이부분에 코드 입력 //



var getParameters = function (paramName) {
    var returnValue;

    var url = location.href;
    
    console.log(url);
    
    if(url[8] == 'f'){
      return 0;
    }

    var parameters = (url.slice(url.indexOf('?') + 1, url.length)).split('&');

    for (var i = 0; i < parameters.length; i++) {
        var varName = parameters[i].split('=')[0];
        if (varName.toUpperCase() == paramName.toUpperCase()) {
            returnValue = parameters[i].split('=')[1];
            return decodeURIComponent(returnValue);
        }
    }
};

function updateURLParameter(url, param, paramVal){
    var newAdditionalURL = "";
    var tempArray = url.split("?");
    var baseURL = tempArray[0];
    var additionalURL = tempArray[1];
    var temp = "";
    if (additionalURL) {
        tempArray = additionalURL.split("&");
        for (var i=0; i<tempArray.length; i++){
            if(tempArray[i].split('=')[0] != param){
                newAdditionalURL += temp + tempArray[i];
                temp = "&";
            }
        }
    }

    var rows_txt = temp + "" + param + "=" + paramVal;
    return baseURL + "?" + newAdditionalURL + rows_txt;
}

function Queue(){
  this.arr = [];
  this.s = 0;
  this.e = 0;
  this.size = 0;
  this.front = function(){
    return arr[s];
  }
  this.pop = function(){
    s++;
    size--;
    return;
  }
  this.push = function(k){
    arr[e++] = k;
    size--;
    return;
  }
  this.empty = function(){
    return size==0;
  }
}

var timer = 0;
function calculateTimer(){
	timer += 1;
}

var cvs = document.getElementById('spanArea');
cvs.innerHTML = "<canvas width='720' height='720' id='spanCanvas'></canvas>"
var canvas = document.getElementById('spanCanvas');
var ctx = canvas.getContext('2d');

var level = getParameters('level');
const levelCount = 1;

const levelNames = [
  'Dreams'
];

const levelMusicLink = [
  'https://k003.kiwi6.com/hotlink/9f13ktbumx/bensound-dreams.mp3'
];

function clearCanvas(){
  ctx.clearRect(0, 0, 720, 720);
}

function makeGameArea(){
  clearCanvas();
  ctx.strokeStyle = "black";
  ctx.strokeRect(20, 20, 680, 680);
  
  for(var i=0; i<5; i++){
  	for(var j=0; j<5; j++){
    	ctx.strokeRect(40+i*132, 40+j*132, 112, 112);
    }
  }
}

function playGameMusic(){
  console.log(level);
  var audioElement = new Audio(levelMusicLink[level]);
  var audio = audioElement.play();
  audioElement.onended = function(){
  	setTimeout(levelEnd, 3000);
  };
  setInterval(calculateTimer, 50);
}

var x = 2;
var y = 2;
var color = 0;

var perfect = 0;
var good = 0;
var miss = 0;

var score = 0;

function levelEnd(){
	var totalNotes = perfect+good+miss;
	score = (perfect / totalNotes) * 1000000 + (good / totalNotes) * 500000;
  clearInterval(calculateTimer);
  clearInterval(showCursor);
  clearInterval(displayNotes);
  
  console.log(score);
  
  var nowScore = getParameters('progress'+level);
  var maxScore = nowScore < score ? score : nowScore;
  location.href = updateURLParameter(location.href, 'progress'+level, maxScore);
}

var noteTimer = new Array(5);
for(var i=0; i<5; i++){
  noteTimer[i] = new Array(5);
  for(var j=0; j<5; j++){
    noteTimer[i][j] = -400;
  }
}

var noteColor = new Array(5);
for(var i=0; i<5; i++){
  noteColor[i] = new Array(5);
}

function showCursor(){
	for(var i=0; i<5; i++){
  	for(var j=0; j<5; j++){
      ctx.fillStyle = noteColor[i][j]==0?"red":"blue";
      if(noteTimer[i][j] > 0){
        ctx.fillRect(40+i*132, 40+j*132, (400-noteTimer[i][j]) * 112 / 400, 112);
      }
      else{
        ctx.clearRect(40+i*132, 40+j*132, 112, 112);
      }
      if(i==x && j==y){
        ctx.strokeStyle = color==0?"red":"blue";
      }
      else{
        ctx.strokeStyle = "black";
      }
    	ctx.strokeRect(40+i*132, 40+j*132, 112, 112);
    }
  }
}

function perfect_(x, y){
  perfect++;
  noteTimer[x][y] = -400;
}

function good_(x, y){
  good++;
  noteTimer[x][y] = -400;
}

function miss_(x, y){
  miss++;
}

function onKeyDown(e){
  var ek = e.keyCode;
  console.log(ek);
  if(37 <= ek && ek <= 40){
  	if(ek == 37){
      if(x!=0) x--;
    }
    else if(ek==38){
      if(y!=0) y--;
    }
    else if(ek==39){
      if(x!=4) x++;
    }
    else if(ek==40){
      if(y!=4) y++;
    }
    console.log(x + "and" + y);
    var point = Math.abs(noteTimer[x][y]);
    if(point <= 20 && color == noteColor[x][y]){
      perfect_(x, y);
    }
    else if((point <= 40 || noteTimer[x][y] > 20) && color == noteColor[x][y]){
      good_(x, y);
    }
  }
  else if(ek==32){
  	color = !color;
  }
}

window.addEventListener("keydown", onKeyDown, false);

var levelData = [
  "0|2|1|0/21|2|2|0/52|2|3|0/72|2|2|0/101|1|2|0/121|2|2|0/153|3|2|0/172|2|2|0/203|2|1|0/223|2|0|0/256|2|1|0/274|2|2|0/305|2|3|0/323|2|4|0/355|2|3|0/375|2|2|0/406|2|1|0/419|3|1|0/431|3|2|0/443|2|2|0/456|1|2|0/469|1|3|0/481|2|3|0/493|2|2|0/506|2|1|0/519|1|1|0/528|1|2|0/544|2|2|0/558|3|2|0/571|3|3|0/583|2|3|0/595|2|2|0/608|2|1|0/621|1|1|0/633|1|2|0/646|2|2|0/659|3|2|0/672|3|1|0/683|2|1|0/697|2|2|0/709|2|3|0/723|3|3|0/735|3|2|0/749|2|2|0/760|1|2|0/772|1|3|0/784|2|3|0/798|2|2|0/811|2|1|0/823|2|0|0/836|2|1|0/850|2|2|0/862|3|2|0/874|4|2|0/888|3|2|0/900|2|2|0/912|1|2|0/924|0|2|0/936|1|2|0/950|2|2|0/964|2|3|0/976|2|4|0/988|2|3|0/1001|2|2|0/1015|2|1|0/1033|2|2|0/1063|2|3|0/1082|2|2|0/1113|1|2|0/1133|2|2|0/1166|3|2|0/1184|2|2|0/1216|2|1|0/1227|2|0|0/1239|1|0|0/1252|0|0|0/1265|0|1|0/1277|0|2|0/1290|1|2|0/1302|2|2|0/1315|3|2|0/1328|4|2|0/1341|4|3|0/1353|4|4|0/1366|3|4|0/1379|2|4|0/1392|2|3|0/1404|2|2|0/1417|3|2|0/1431|4|2|0/1442|3|2|0/1454|2|2|0/1468|1|2|0/1480|0|2|0/1494|1|2|0/1506|2|2|0/1519|3|2|0/1533|4|2|0/1544|4|1|0/1557|4|0|0/1568|3|0|0/1581|2|0|0/1594|2|1|0/1607|2|2|0/1620|2|3|0/1633|2|4|0/1645|2|3|0/1658|2|2|0/1670|2|1|0/1683|2|0|0/1695|2|1|0/1708|2|2|0/1721|2|3|0/1733|2|4|0/1746|1|4|0/1759|0|4|0/1771|0|3|0/1783|0|2|0/1796|1|2|0/1809|2|2|0/1822|2|1|0/1837|2|0|0/1847|2|1|0/1859|2|2|0/1871|1|2|0/1885|0|2|0/1898|1|2|0/1910|2|2|0/1922|2|3|0/1935|2|4|0/1948|2|3|0/1959|2|2|0/1972|3|2|0/1984|4|2|0/1998|3|2|0/2010|2|2|0/2024|2|1|0/2042|2|0|0/2073|1|0|0/2091|0|0|0/2121|0|1|0/2142|0|2|0/2173|1|2|0/2193|2|2|0/2225|3|2|0/2244|4|2|0/2277|4|3|0/2295|4|4|0/2326|3|4|0/2345|2|4|0/2380|2|3|0/2396|2|2|0/2427|1|2|0/2445|0|2|0/2477|1|2|0/2496|2|2|0/2528|3|2|0/2547|4|2|0/2578|3|2|0/2597|2|2|0/2629|2|3|0/2655|2|2|0/2680|2|1|0/2705|2|2|0/2730|1|2|0/2754|2|2|0/2781|3|2|0/2804|2|2|0/2832|2|3|0/2841|3|3|0/2850|3|2|0/2856|3|1|0/2863|2|1|0/2866|1|1|0/2880|1|2|0/2891|1|3|0/2900|2|3|0/2907|3|3|0/2912|4|3|0/2932|3|3|0/2941|2|3|0/2951|1|3|0/2957|1|2|0/2961|1|1|0/2963|1|0|0/2982|2|0|0/2991|2|1|0/3001|2|2|0/3034|1|2|0/3044|0|2|0/3052|1|2|0/3059|2|2|0/3063|3|2|0/3069|3|3|0/3084|2|3|0/3095|2|2|0/3104|2|1|0/3109|1|1|0/3112|0|1|0/3115|0|2|0/3118|0|3|0/3134|1|3|0/3144|2|3|0/3152|2|2|0/3155|2|1|0/3158|2|0|0/3160|3|0|0/3185|3|1|0/3195|3|2|0/3202|2|2|0/3205|1|2|0/3208|1|3|0/3211|2|3|0/3236|2|2|0/3254|2|1|0/3285|2|2|0/3304|2|3|0/3330|2|2|0/3336|1|2|0/3356|2|2|0/3387|2|1|0/3406|2|2|0/3436|3|2|0/3457|2|2|0/3487|1|2|0/3507|2|2|0/3538|2|1|0/3557|2|2|0/3589|2|3|0/3608|2|2|0/3639|1|2|0/3660|2|2|0/3691|3|2|0/3712|2|2|0/3741|2|1|0/3759|2|2|0/3791|2|3|0/3810|2|2|0/3842|1|2|0/3860|2|2|0/3892|3|2|0/3912|2|2|0/3943|2|1|0/3960|2|2|0/3991|2|3|0/4011|2|2|0/4045|1|2|0/4063|2|2|0/4093|3|2|0/4113|2|2|0/"
];

var startIndex = 0;
var endIndex = 0;
var data;
var dataLength;

function calculateNotes(t, x, y, c){
  noteTimer[x][y] = 400;
  noteColor[x][y] = c;
}

function displayNotes(){
	for(var i=0; i<5; i++){
    for(var j=0; j<5; j++){
      if(noteTimer[i][j] != -400) noteTimer[i][j] -= 20;
      if(noteTimer[i][j] < -40 && noteTimer[i][j] != -400){
        noteTimer[i][j] = -400;
        miss_(i, j);
      }
    }
  }
}

function setInit(){
  data = levelData[level];
  dataLength = String(data).length;
}

function playNotes(){
	setInterval(displayNotes, 20);
  
  console.log(dataLength + ', ' + data);
  
  for(; endIndex < dataLength;){
    var tt, tx, ty, tc;
    while(data[endIndex] != '|') endIndex++;
    tt = data.substring(startIndex, endIndex);
    startIndex = ++endIndex;
    while(data[endIndex] != '|') endIndex++;
    tx = data.substring(startIndex, endIndex);
    startIndex = ++endIndex;
    while(data[endIndex] != '|') endIndex++;
    ty = data.substring(startIndex, endIndex);
    startIndex = ++endIndex;
    while(data[endIndex] != '/') endIndex++;
    tc = data.substring(startIndex, endIndex);
    startIndex = ++endIndex;
    
    console.log(tt + ', ' + tx + ', ' + ty + ', ' + tc);
    
    setTimeout(calculateNotes, tt*50-400+3100, tt, tx, ty, tc);
  }
}

function playGame(){
  makeGameArea();
  setInterval(showCursor, 30);
  setTimeout(playGameMusic, 3000);
  setInit();
  playNotes();
}

playGame();



 // 여기까지 코드 입력 //

		
  }

}
$( plugin_UncyBeat );
/* UncyBeat 끝 */


/** 플러그인 p21***************************
* 블랙잭
* 버전 => 0.833
* 작성자 : [[사용자:Riemann|Riemann]] 
* JSON => p21 = {"name":"p21","descript":"블랙잭","version":"0.833","local":true,"creat":"Riemann","state":"사용자:Riemann/p21","executable":true}; 
*/ 
function plugin_p21(){
  if($("[data-name='p21']").length >= 1){
		 var title = mw.config.get('wgPageName');
if (title.slice( 1, 2 ) == "라") {
    var blind = true;
    var defa = 20;
} else {
    var blind = false;
    var defa = 10;
}
var mult = defa;
$("#multiplier").text(mult);

// Taken from w3schools
function getCookie(cname) {
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for(var i = 0; i <ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}
function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*1000));
    var expires = "expires="+ d.toUTCString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}

if (getCookie("p21_coins") == "") {
    var coins = 100;
    $("#console").text("소지금: " + coins + " 코인");
    $("#console").append("<br/>블랙잭에 오신 것을 환영합니다.");
} else {
    var coins = parseInt(getCookie("p21_coins"));
    $("#console").text("소지금: " + coins + " 코인");
    $("#console").append("<br/>다시 오셨군요.");
}
const pcLst = [
0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAD,0xAE,
0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBD,0xBE,
0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCD,0xCE,
0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDD,0xDE];
const pointData = {a1:1,a2:2,a3:3,a4:4,a5:5,a6:6,a7:7,a8:8,a9:9,aa:10,ab:10,ad:10,ae:10,b1:1,b2:2,b3:3,b4:4,b5:5,b6:6,b7:7,b8:8,b9:9,ba:10,bb:10,bd:10,be:10,c1:1,c2:2,c3:3,c4:4,c5:5,c6:6,c7:7,c8:8,c9:9,ca:10,cb:10,cd:10,ce:10,d1:1,d2:2,d3:3,d4:4,d5:5,d6:6,d7:7,d8:8,d9:9,da:10,db:10,dd:10,de:10};
var pcSet = [];
function hexToChar(x) {
    return String.fromCharCode(0xD83C) +String.fromCharCode(x + 0xDC00);
}
function hexToStr(x) {
    return x.toString(16);
}
var dealerD, guestD;
$("#deal").click(function(){
    $("#console").text("소지금: " + coins + " 코인");
    $("#console").append("<br/>새 판을 엽니다.");
    $("#deal").css("display", "none");
    $("#dealerDeck").text("");
    $("#guestDeck").text("");
    pcSet = Object.create(pcLst);
    deal();
    return 0;
});
$("#hit").click(function(){
    hit();
    return 0;
});
$("#stand").click(function(){
    stand();
    return 0;
});
$("#surrender").click(function(){
    surrender();
    return 0;
});
$("#plus").click(function(){
    inc();
    return 0;
});
$("#minus").click(function(){
    dec();
    return 0;
});
$("#reset").click(function(){
    reset();
    return 0;
});
function reset() {
    mult = defa;
    $("#multiplier").text(mult);
}

function inc() {
    if (mult < 100) {
        mult += 2;
    } else {
        alert("최대 100 코인까지만 걸 수 있습니다.");
    }
    $("#multiplier").text(mult);
}

function dec() {
    if (mult > 2) {
        mult -= 2;
    } else {
        alert("설마 빚을 판돈으로 거시려고요?");
    }
    $("#multiplier").text(mult);
}

function deal() {
    dealerD = [];
    guestD = [];
    dealerD.push(cardPop());
    guestD.push(cardPop());
    dealerD.push(cardPop());
    guestD.push(cardPop());
    if (blind == true) {
        $("#dealerDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#dealerDeck").text(hexToChar(dealerD[0]) + "\u{1F0A0}");
    }
    $("#dealerS").text("?");
    if (blind == true) {
        $("#guestDeck").text("\u{1F0A0}\u{1F0A0}");
    } else {
        $("#guestDeck").text(hexToChar(guestD[0]) + hexToChar(guestD[1]));
    }
    var guestScore = [];
    var score = pointData[hexToStr(guestD[0])] + pointData[hexToStr(guestD[1])];
    $("#guestS").text(score);
    if ((pointData[hexToStr(guestD[0])] == 1 && pointData[hexToStr(guestD[1])] == 10) || (pointData[hexToStr(guestD[0])] == 10 && pointData[hexToStr(guestD[1])] == 1)) {
        $("#guestS").text(21);
        jack();
    } else {
        $("#hit").css("display", "inline-flex");
        $("#stand").css("display", "inline-flex");
        $("#surrender").css("display", "inline-flex");
    }
};
function hit() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    guestD.push(cardPop());
    var guestDeq = "";
    for (i = 0; i < guestD.length; i++) {
        guestDeq += hexToChar(guestD[i]);
    }
    if (blind == true) {
        $("#guestDeck").text("\u{1F0A0}".repeat(guestDeq.length / 2));
    } else {
        $("#guestDeck").text(guestDeq);
    }
    var guestScore = [];
    var score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    $("#guestS").text(score);
    if (score == 21 || (score == 11 && guestScore.includes(1))) {
        $("#console").append("<br/>21점이므로 자동으로 스탠드를 외쳤습니다.")
        stand(dealerD,guestD);
    } else if (score > 21) {
        bust();
    } else  {
        $("#hit").css("display", "inline-flex");
        $("#stand").css("display", "inline-flex");
    }
    return 0;
}
function stand() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    var dScore = 0;
    var dealerScore = []
    for (i = 0; i < dealerD.length; i++) {
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        dScore += dealerScore[i];
    }
    while (dScore < 17) {
        dealerD.push(cardPop());
        $("#console").append("<br/>딜러가 카드를 뽑았습니다.")
        dealerScore = [];
        dScore = 0;
        for (i = 0; i < dealerD.length; i++) {
            dealerScore.push(pointData[hexToStr(dealerD[i])]);
            dScore += dealerScore[i];
            dealerDeq += hexToChar(dealerD[i]);
        }
    }
    var dealerDeq = "";
    for (i = 0; i < dealerD.length; i++) {
            dealerDeq += hexToChar(dealerD[i]);
        }
    $("#dealerS").text(dScore);
    $("#dealerDeck").text(dealerDeq);
    guestScore = [];
    score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    $("#guestS").text(score);
    if (score > 21) {
        bust()
    } else if (dScore > 21) {
        $("#console").append("<br/>딜러의 버스트.")
        win()
    } else {
        $("#console").append("<br/>딜러의 스탠드.")
        compare(dealerD,guestD);
    }
    return 0;
}
function compare() {
    var dealerScore = [];
    var dScore = 0;
    for (i = 0; i < dealerD.length; i++) {
        dealerScore.push(pointData[hexToStr(dealerD[i])]);
        dScore += dealerScore[i];
    }
    var guestScore = [];
    var score = 0;
    for (i = 0; i < guestD.length; i++) {
        guestScore.push(pointData[hexToStr(guestD[i])]);
        score += guestScore[i];
    }
    if (dScore < 12 && dealerScore.includes(1)) {
        dScore += 10
    }
    if (score < 12 && guestScore.includes(1)) {
        score += 10
    }
    $("#dealerS").text(dScore);
    $("#guestS").text(score);
    if (dScore > score) {
        lose()
    } else if (dScore == score) {
        push()
    } else {
        win()
    }
    return 0;
}
function win() {
    $("#console").append("<br/>축하합니다! 이겼습니다.")
    $("#console").append("<br/>" + mult + " 코인을 얻었습니다.")
    coins += mult;
    setCookie("p21_coins", coins, 30);
    $("#deal").css("display", "inline-flex");
    return 0;
}
function lose() {
    $("#console").append("<br/>졌습니다...")
    $("#console").append("<br/>" + mult + " 코인을 잃었습니다.")
    coins -= mult;
    setCookie("p21_coins", coins, 30);
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function push() {
    $("#console").append("<br/>비겼습니다.")
    setCookie("p21_coins", coins, 30);
    $("#deal").css("display", "inline-flex");
    return 0;
}
function surrender() {
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#surrender").css("display", "none");
    $("#console").append("<br/>이번 판을 포기하셨습니다.")
    $("#console").append("<br/>" + (0.5 * mult) + " 코인을 잃었습니다.")
    coins -= 0.5 * mult;
    setCookie("p21_coins", coins, 30);
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function bust() {
    $("#console").append("<br/>버스트! 유감입니다. 졌습니다...")
    $("#console").append("<br/>" + mult + " 코인을 잃었습니다.")
    coins -= mult;
    setCookie("p21_coins", coins, 30);
    $("#hit").css("display", "none");
    $("#stand").css("display", "none");
    $("#deal").css("display", "inline-flex");
    publicAd();
    return 0;
}
function jack() {
    $("#console").append("<br/>블랙잭 달성! 축하합니다. 이겼습니다!")
    $("#console").append("<br/>" + (1.5 * mult) + " 코인을 획득했습니다.")
    coins += 1.5 * mult;
    setCookie("p21_coins", coins, 30);
    $("#deal").css("display", "inline-flex");
    return 0;
}
function publicAd() {
    if (coins < -100) {
        $("#notice").text("돈을 잃어서 기분이 좋지 않으십니까? 가치가 전혀 없는 사이버머니를 잃게 된 것을 다행으로 생각하십시오.");
    }
    return 0;
}
function cardPop() {
    var j, ret;
    j = Math.floor(Math.random() * pcSet.length);
    ret = pcSet[j];
    pcSet.splice(j,1);
    return ret;
}

		
  }

}
$( plugin_p21 );
/* p21 끝 */





/** 플러그인 testOfSomething***************************
* 플러그인의 용도
* 버전 => 0.02
* 작성자 : [[사용자:bd3076|bd3076]] 
* JSON => testOfSomething = {"name":"testOfSomething","descript":"플러그인의 용도","version":"0.02","local":false,"creat":"bd3076","state":"사용자:Bd3076/그냥/plugin2","executable":true}; 
*/ 
function plugin_testOfSomething(){
		  // 이부분에 코드 입력 //

var dataOfSomethingStrange = "1";

 // 여기까지 코드 입력 //

		
}
$( plugin_testOfSomething );
/* testOfSomething 끝 */





/** 플러그인 uncyrhythm***************************
* 플러그인 전체적 테스트. 리듬게임
* 버전 => 1.7.3.4
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => uncyrhythm = {"name":"uncyrhythm","descript":"플러그인 전체적 테스트. 리듬게임","version":"1.7.3.4","local":true,"creat":"BANIP","state":"백괴리겜/플레이/uncyrhythm","executable":true}; 
*/ 
function plugin_uncyrhythm(){
  if($("[data-name='uncyrhythm']").length >= 1){
		 $("#mw-content-text").prepend("<audio controls class='gameaudio hide'><source src='https://s0.vocaroo.com/media/download_temp/Vocaroo_s0OAXRN8eUas.mp3'></audio>");
$("#mw-content-text").prepend("<svg class='note cloneable' width='50px' height='50px'><circle cx=25 cy=25 r=25 /></svg>");
var rankingSystem = plugin_RankingSystem()("백괴리겜/랭킹", function(prev, next) {
    return Number(next.score) - Number(prev.score)
});

var noteInfo = [[2088,0],[2156,2],[2223,1],[2291,2],[2358,3],[2426,2],[2493,1],[2561,0],[2628,1],[2696,2],[2763,1],[2831,2],[2898,3],[2966,2],[3033,1],[3101,0],[3168,1],[3236,2],[3303,1],[3371,2],[3438,3],[3506,2],[3573,1],[3641,0],[3708,1],[3776,2],[3843,1],[3911,2],[3978,3],[4046,2],[4113,1],[4181,0],[4248,1],[4248,3],[4316,2],[4383,1],[4451,2],[4518,3],[4586,2],[4653,1],[4721,0],[4788,1],[4856,2],[4923,1],[4991,2],[5059,3],[5126,2],[5195,1],[5261,0],[5329,1],[5396,2],[5464,1],[5531,2],[5599,3],[5666,2],[5734,1],[5801,0],[5869,1],[5936,2],[6004,3],[6071,1],[6139,2],[6206,3],[6274,1],[6341,2],[6409,1],[6409,0],[6476,2],[6544,1],[6611,2],[6679,3],[6746,2],[6814,1],[6881,0],[6949,1],[7016,2],[7084,1],[7151,2],[7219,3],[7286,2],[7354,1],[7421,0],[7489,1],[7556,2],[7624,1],[7691,2],[7759,3],[7826,2],[7894,1],[7961,0],[8029,1],[8096,2],[8164,1],[8231,2],[8299,3],[8366,2],[8434,1],[8501,0],[8569,1],[8569,3],[8636,2],[8704,1],[8771,2],[8839,3],[8906,2],[8974,1],[9041,0],[9109,1],[9109,3],[9176,2],[9244,1],[9311,2],[9379,3],[9446,2],[9514,1],[9581,0],[9649,1],[9649,3],[9716,2],[9784,1],[9851,2],[9919,3],[9919,0],[9986,2],[10054,1],[10121,2],[10189,0],[10256,3],[10324,0],[10391,3],[10459,1],[10526,2],[10594,1],[10661,2],[10729,1],[10729,0],[10796,2],[10864,1],[10931,3],[10999,1],[10999,0],[11066,2],[11134,1],[11201,3],[11269,0],[11336,2],[11404,1],[11471,3],[11539,1],[11539,0],[11606,3],[11674,1],[11741,2],[11809,0],[11876,2],[11944,1],[12011,3],[12079,0],[12079,1],[12146,2],[12214,1],[12281,3],[12349,0],[12416,3],[12484,1],[12551,2],[12619,0],[12619,1],[12686,2],[12754,1],[12821,3],[12889,1],[12889,0],[12956,3],[13024,2],[13091,0],[13159,1],[13226,3],[13294,2],[13361,0],[13429,1],[13496,2],[13564,1],[13631,3],[13699,1],[13699,0],[13766,2],[13834,1],[13901,3],[13969,0],[14036,2],[14104,1],[14171,3],[14239,1],[14239,0],[14306,2],[14374,1],[14441,3],[14509,1],[14509,0],[14576,3],[14644,1],[14711,0],[14711,2],[14779,1],[14846,3],[14914,1],[14914,0],[14981,2],[15049,1],[15049,0],[15116,3],[15184,1],[15251,2],[15319,0],[15319,1],[15386,2],[15454,1],[15521,3],[15589,0],[15656,2],[15724,1],[15791,3],[15859,0],[15859,1],[15926,2],[15994,1],[15994,0],[16061,3],[16129,0],[16196,2],[16264,1],[16264,0],[16331,3],[16399,1],[16399,0],[16466,3],[16534,1],[16601,2],[16669,1],[16669,0],[16736,3],[16804,2],[16804,1],[16871,0],[16939,2],[16939,3],[17006,1],[17074,3],[17141,2],[17209,0],[17209,1],[17276,3],[17344,1],[17411,2],[17479,0],[17546,2],[17614,1],[17681,3],[17749,0],[17749,1],[17816,3],[17884,1],[17951,2],[18019,0],[18086,2],[18154,1],[18221,3],[18289,1],[18289,0],[18356,2],[18424,3],[18491,2],[18559,1],[18559,0],[18626,3],[18694,2],[18761,1],[18829,2],[18829,3],[18896,1],[18964,0],[19031,1],[19099,2],[19166,1],[19234,0],[19301,1],[19369,2],[19369,3],[19436,0],[19504,3],[19571,1],[19639,2],[19639,3],[19706,1],[19774,2],[19841,0],[19909,2],[19976,1],[20044,3],[20111,0],[20179,2],[20179,3],[20246,0],[20314,2],[20381,1],[20449,3],[20516,0],[20584,2],[20651,0],[20719,2],[20719,3],[20786,0],[20854,3],[20921,1],[20989,3],[21056,0],[21124,2],[21191,1],[21259,2],[21259,3],[21326,0],[21394,2],[21461,1],[21529,3],[21529,0],[21596,1],[21664,2],[21731,1],[21799,2],[21799,3],[21866,1],[21934,2],[22001,0],[22069,2],[22136,1],[22204,3],[22271,0],[22339,3],[22339,2],[22406,0],[22474,2],[22541,1],[22609,3],[22676,1],[22744,2],[22811,0],[22879,2],[22879,3],[22946,0],[23014,2],[23081,1],[23149,2],[23149,3],[23216,0],[23284,1],[23351,2],[23351,3],[23419,1],[23486,0],[23554,2],[23554,3],[23621,1],[23689,2],[23689,3],[23756,0],[23824,3],[23891,1],[23959,2],[23959,3],[24026,1],[24094,2],[24161,0],[24229,3],[24296,1],[24364,2],[24431,0],[24499,2],[24499,3],[24566,1],[24634,2],[24634,3],[24701,0],[24769,3],[24836,1],[24904,2],[24904,3],[24971,0],[25039,2],[25039,3],[25106,1],[25174,2],[25241,0],[25309,2],[25309,3],[25376,0],[25444,1],[25444,2],[25511,3],[25579,1],[25579,0],[25646,2],[25714,3],[25781,2],[25849,0],[25916,1],[25984,2],[26051,3],[26119,0],[26186,1],[26254,2],[26321,3],[26389,0],[26456,1],[26524,2],[26591,3],[26659,0],[26726,1],[26794,2],[26861,3],[26929,0],[26996,3],[27064,1],[27131,2],[27199,0],[27266,3],[27334,1],[27401,2],[27469,0],[27536,3],[27604,1],[27671,2],[27739,0],[27806,3],[27874,1],[27941,2],[28009,1],[28009,0],[28549,2],[29089,1],[29629,0],[30169,3],[30709,2],[31249,0],[31519,0],[31789,1],[31924,2],[32059,2],[32194,3],[32329,3],[32869,1],[33139,2],[33409,3],[33679,2],[33949,1],[34219,0],[34489,3],[34759,2],[35029,1],[35299,2],[35569,1],[36109,0],[36649,0],[36649,2],[36649,3],[36919,1],[37189,2],[37459,3],[37729,2],[37819,3],[37909,2],[37999,1],[38269,2],[38539,1],[38809,3],[38809,2],[38809,0],[39079,1],[39349,2],[39619,0],[39889,3],[40159,2],[40429,1],[40699,2],[40969,3],[40969,1],[40969,0],[41509,1],[41711,1],[41914,2],[42049,0],[42049,1],[42049,3],[42319,2],[42589,3],[42589,2],[42589,0],[42791,1],[42926,2],[43129,0],[43129,3],[43129,2],[43669,0],[43669,1],[43804,3],[43939,1],[43939,0],[44074,2],[44209,1],[44209,2],[44209,3],[44209,0],[44479,1],[44479,0],[44479,2],[44479,3],[44749,1],[44749,0],[44749,3],[44749,2],[45019,1],[45019,2],[45019,3],[45019,0],[45289,0],[45356,1],[45424,2],[45491,3],[45559,0],[45626,1],[45694,2],[45761,3],[45829,0],[45896,1],[45964,2],[46031,3],[46099,0],[46166,1],[46234,2],[46301,3],[46369,0],[46436,3],[46504,1],[46571,2],[46639,0],[46706,3],[46774,1],[46841,2],[46909,0],[46976,3],[47044,1],[47111,2],[47179,0],[47246,3],[47314,1],[47381,2],[47449,1],[47449,0],[47516,2],[47584,1],[47651,0],[47719,2],[47719,3],[47786,1],[47854,2],[47921,0],[47989,2],[47989,3],[48058,1],[48125,3],[48193,0],[48260,3],[48260,2],[48328,0],[48395,2],[48463,1],[48530,2],[48530,3],[48598,1],[48665,3],[48733,0],[48800,2],[48800,3],[48868,1],[48935,2],[49003,1],[49070,0],[49070,3],[49138,1],[49205,2],[49273,1],[49340,2],[49340,3],[49408,0],[49475,1],[49543,0],[49610,2],[49610,3],[49678,1],[49745,2],[49813,0],[49880,1],[49880,2],[49948,0],[50015,3],[50083,0],[50150,2],[50150,3],[50218,0],[50285,2],[50353,1],[50420,2],[50420,3],[50488,0],[50555,3],[50623,1],[50690,3],[50690,2],[50758,1],[50825,2],[50893,0],[50960,1],[50960,3],[51028,0],[51095,2],[51163,0],[51230,1],[51230,2],[51298,0],[51365,3],[51433,0],[51500,3],[51500,2],[51568,0],[51635,2],[51703,1],[51770,2],[51770,3],[51838,1],[51905,2],[51973,0],[52040,1],[52108,0],[52175,3],[52243,1],[52310,2],[52310,3],[52378,0],[52445,3],[52513,1],[52580,2],[52580,3],[52648,0],[52715,1],[52783,0],[52850,2],[52850,3],[52918,0],[52985,2],[53053,1],[53120,2],[53120,3],[53188,0],[53255,1],[53323,2],[53390,3],[53390,1],[53458,0],[53525,2],[53593,0],[53660,2],[53660,3],[53728,1],[53795,2],[53863,1],[53930,2],[53930,3],[53998,0],[54065,2],[54133,1],[54200,2],[54200,3],[54268,0],[54335,2],[54403,3],[54470,2],[54470,1],[54538,0],[54605,2],[54673,1],[54740,2],[54740,3],[54808,1],[54875,3],[54943,0],[55010,3],[55078,1],[55145,2],[55213,0],[55280,2],[55280,3],[55348,1],[55415,0],[55483,1],[55550,2],[55550,3],[55618,0],[55685,1],[55753,0],[55820,2],[55820,3],[55888,0],[55955,1],[56023,2],[56023,3],[56090,1],[56090,0],[56158,3],[56225,1],[56293,2],[56360,0],[56428,3],[56495,1],[56563,2],[56630,1],[56630,0],[56698,3],[56765,2],[56833,1],[56900,2],[56900,0],[56968,3],[57035,1],[57103,2],[57170,1],[57170,0],[57238,2],[57305,1],[57373,3],[57440,2],[57440,1],[57508,3],[57575,2],[57643,3],[57710,1],[57710,0],[57778,3],[57845,1],[57913,2],[57980,1],[57980,0],[58048,2],[58115,0],[58183,3],[58250,2],[58250,1],[58318,3],[58385,0],[58453,2],[58520,1],[58520,0],[58588,3],[58655,2],[58723,3],[58790,1],[58790,0],[58858,3],[58925,1],[58993,2],[59060,1],[59060,0],[59128,2],[59195,0],[59263,3],[59330,1],[59330,0],[59398,2],[59465,1],[59533,3],[59600,2],[59600,0],[59668,3],[59735,1],[59803,2],[59870,1],[59870,0],[59938,2],[60005,1],[60073,3],[60140,2],[60140,1],[60208,3],[60275,0],[60343,1],[60410,2],[60410,3],[60478,1],[60545,0],[60613,3],[60680,1],[60680,2],[60748,3],[60815,2],[60883,3],[60950,0],[60950,1],[61018,3],[61085,2],[61153,0],[61220,1],[61220,2],[61288,3],[61355,0],[61423,2],[61490,0],[61490,1],[61558,2],[61625,1],[61693,3],[61760,2],[61760,0],[61828,3],[61895,1],[61963,2],[62030,1],[62030,0],[62098,3],[62165,0],[62233,1],[62300,3],[62300,2],[62368,1],[62435,0],[62503,3],[62570,1],[62570,0],[62705,1],[62705,2],[62840,2],[62840,3],[62975,2],[62975,1],[63110,1],[63110,0],[63245,1],[63245,2],[63380,2],[63380,3],[63515,2],[63515,1],[63650,0],[63650,1],[63785,2],[63785,3],[63920,1],[63920,0],[64055,2],[64055,3],[64190,0],[64190,2],[64325,3],[64325,0],[64460,3],[64460,1],[64595,3],[64595,0],[64730,0],[64730,1],[64798,2],[64865,3],[64933,1],[64933,0],[65000,2],[65068,1],[65135,2],[65135,3],[65203,0],[65270,1],[65338,2],[65338,3],[65405,1],[65473,2],[65540,1],[65540,0],[65675,2],[65675,3],[65810,1],[65810,2],[65878,3],[65945,0],[66013,2],[66013,3],[66080,1],[66148,2],[66215,1],[66215,0],[66283,2],[66350,1],[66418,2],[66418,3],[66485,0],[66553,2],[66620,1],[66620,0],[66755,2],[66755,1],[66890,2],[66890,3],[66958,1],[67025,2],[67093,1],[67093,0],[67160,2],[67228,1],[67295,2],[67295,3],[67363,0],[67430,2],[67498,1],[67498,0],[67565,3],[67633,1],[67700,2],[67700,3],[67835,0],[67835,1],[67970,3],[67970,2],[68038,0],[68105,2],[68173,1],[68173,0],[68240,2],[68308,3],[68375,0],[68375,1],[68510,1],[68510,2],[68645,2],[68645,3],[68780,1],[68780,0],[68915,2],[68915,3],[69050,1],[69050,0],[69118,2],[69185,1],[69253,2],[69253,3],[69320,1],[69388,3],[69455,2],[69455,1],[69523,3],[69590,1],[69590,0],[69658,2],[69725,1],[69725,0],[69860,3],[69860,2],[69928,1],[69995,2],[69995,3],[70131,0],[70131,2],[70198,1],[70266,2],[70266,0],[70401,3],[70401,1],[70468,2],[70536,1],[70536,3],[70671,1],[70671,2],[70738,0],[70806,1],[70806,2],[70941,2],[70941,1],[71008,3],[71076,2],[71076,1],[71211,0],[71211,2],[71278,1],[71346,0],[71346,2],[71481,3],[71481,1],[71548,2],[71616,3],[71616,1],[71751,1],[71751,0],[71818,2],[71886,1],[71886,0],[72021,3],[72021,2],[72088,1],[72156,2],[72156,3],[72291,2],[72291,1],[72358,0],[72426,3],[72493,2],[72493,1],[72561,3],[72628,0],[72696,2],[72696,3],[72763,1],[72831,2],[72898,1],[72898,0],[72966,3],[73033,1],[73101,2],[73101,3],[73236,2],[73236,1],[73371,0],[73371,2],[73506,2],[73506,0],[73641,3],[73641,0],[73776,3],[73776,0],[73911,3],[73911,1],[74046,3],[74046,1],[74181,3],[74181,0],[74316,3],[74316,0],[74451,0],[74451,1],[74541,2],[74541,3],[74631,1],[74631,0],[74721,2],[74721,3],[74856,2],[74991,3],[75058,2],[75126,0],[75193,3],[75261,2],[75328,0],[75396,3],[75531,1],[75531,0],[75531,2],[75666,1],[75666,2],[75801,2],[75801,3],[75936,3],[75936,2],[76071,2],[76071,3],[76206,2],[76206,3],[76341,2],[76341,0],[76476,2],[76476,0],[76611,2],[76611,2],[76611,0],[76746,2],[76746,2],[76881,2],[76881,3],[76881,2],[77016,3],[77016,2],[77151,0],[77151,2],[77151,2],[77286,2],[77286,0],[77421,2],[77421,3],[77421,2],[77556,3],[77556,2],[77691,3],[77691,2],[77758,0],[77826,3],[77893,2],[77893,0],[77961,2],[78028,2],[78096,3],[78096,2],[78163,2],[78231,3],[78298,2],[78298,0],[78366,2],[78501,2],[78501,0],[78636,2],[78636,2],[78771,2],[78771,3],[78838,0],[78906,2],[78906,2],[78973,3],[79041,2],[79041,0],[79108,3],[79176,2],[79176,2],[79243,3],[79311,2],[79311,0],[79378,2],[79446,0],[79513,2],[79513,3],[79581,2],[79648,2],[79716,2],[79716,0],[79851,2],[79851,3],[79918,0],[79986,3],[80053,0],[80053,2],[80121,2],[80188,3],[80256,2],[80256,0],[80323,3],[80391,2],[80458,2],[80458,3],[80526,0],[80593,2],[80661,2],[80661,3],[80796,2],[80796,2],[80931,2],[80931,3],[80931,2],[81066,2],[81066,2],[81201,2],[81201,3],[81201,0],[81336,0],[81336,2],[81471,0],[81471,2],[81471,2],[81606,2],[81606,0],[81741,3],[81741,2],[81741,0],[81876,2],[81876,0],[81876,3],[82011,3],[82011,2],[82011,2],[82011,0],[82146,0],[82281,1],[82416,2],[82551,2],[82686,2],[82821,2],[82956,1],[83091,2],[83226,2],[83361,2],[83496,1],[83631,3],[83766,3],[83901,3],[84036,1],[84171,2],[84306,1],[84441,0],[84576,1],[84711,2],[84846,1],[84981,2],[85116,3],[85251,0],[85386,1],[85521,2],[85656,3],[85791,3],[85926,3],[86061,2],[86196,1],[86331,0],[86466,0],[86601,1],[86736,2],[86871,2],[87006,2],[87141,2],[87276,1],[87411,2],[87546,3],[87681,3],[87816,3],[87951,3],[88086,2],[88221,1],[88356,0],[88491,0],[88626,0],[88761,1],[88896,2],[89031,2],[89166,3],[89301,3],[89436,3],[89571,0],[89706,2],[89841,2],[89976,3],[90111,2],[90111,2],[90111,0],[90381,2],[90381,3],[90381,2],[90651,0],[90651,2],[90651,2],[90651,3],[90786,0],[90921,2],[91056,2],[91191,2],[91326,2],[91461,2],[91596,2],[91731,2],[91866,2],[92001,2],[92136,3],[92271,3],[92406,3],[92541,3],[92676,2],[92811,2],[92811,3],[92811,0],[92946,2],[93081,0],[93216,2],[93351,2],[93486,2],[93621,2],[93756,3],[93891,0],[94026,1],[94161,2],[94296,3],[94431,3],[94566,3],[94701,2],[94836,1],[94971,0],[94971,2],[94971,3],[95106,0],[95241,1],[95376,2],[95511,2],[95646,2],[95781,2],[95916,1],[96051,2],[96051,3],[96051,0],[96186,2],[96321,2],[96456,3],[96591,1],[96591,2],[96591,0],[96726,3],[96861,3],[96861,0],[96996,2],[97131,1],[97131,3],[97266,0],[97401,0],[97401,3],[97536,0],[97671,1],[97671,3],[97806,2],[97941,2],[97941,3],[98076,3],[98211,3],[98211,2],[98211,1],[98211,0],[98346,0],[98481,0],[98616,0],[98751,0],[98886,0],[99021,0],[99156,0],[99291,0],[99291,1],[99291,2],[99291,3],[99426,0],[99426,1],[99561,1],[99561,0],[99696,1],[99696,0],[99831,1],[99831,0],[99966,1],[99966,0],[100101,1],[100101,0],[100236,1],[100236,0],[100371,1],[100371,2],[100371,0],[100371,3],[100506,1],[100506,2],[100506,0],[100641,2],[100641,1],[100641,0],[100776,2],[100776,1],[100776,0],[100911,2],[100911,1],[100911,0],[101046,2],[101046,1],[101046,0],[101181,2],[101181,1],[101181,0],[101316,2],[101316,1],[101316,0],[101451,2],[101451,1],[101451,0],[101451,3],[101586,1],[101586,2],[101586,0],[101586,3],[101721,2],[101721,3],[101721,1],[101721,0],[101856,2],[101856,3],[101856,1],[101856,0],[101991,2],[101991,3],[101991,1],[101991,0],[102126,2],[102126,3],[102126,1],[102126,0],[102261,2],[102261,3],[102261,1],[102261,0],[102396,2],[102396,3],[102396,1],[102396,0],[102531,0],[102531,2],[102531,3],[102666,0],[102801,0],[102936,0],[103071,0],[103206,0],[103341,0],[103476,0],[103611,0],[103611,2],[103611,3],[103746,2],[103746,0],[103881,2],[103881,0],[104016,2],[104016,0],[104151,2],[104151,0],[104286,2],[104286,0],[104421,2],[104421,0],[104556,2],[104556,0],[104691,2],[104691,3],[104691,0],[104826,0],[104826,2],[104826,3],[104961,0],[104961,2],[104961,3],[105096,0],[105096,2],[105096,3],[105231,0],[105231,2],[105231,3],[105366,2],[105366,0],[105366,3],[105501,0],[105501,2],[105501,3],[105636,0],[105636,2],[105636,3],[105771,3],[105771,0],[105838,2],[105838,1],[105906,0],[105906,3],[105973,2],[105973,1],[106041,3],[106041,0],[106108,2],[106108,1],[106176,3],[106176,0],[106243,2],[106243,1],[106311,3],[106311,0],[106378,2],[106378,1],[106446,3],[106446,0],[106513,2],[106513,1],[106581,3],[106581,0],[106648,2],[106648,1],[106716,3],[106716,0],[106783,2],[106783,1],[106851,3],[106851,0],[106918,2],[106986,0],[107053,2],[107121,3],[107188,2],[107256,0],[107323,2],[107391,3],[107458,2],[107526,0],[107593,2],[107661,3],[107661,0],[107931,2],[107931,3],[107931,0],[107998,1],[108066,2],[108133,1],[108133,0],[108201,3],[108268,1],[108336,2],[108403,3],[108403,0],[108471,2],[108538,1],[108538,0],[108606,2],[108673,0],[108741,1],[108741,3],[108876,1],[108876,0],[109011,2],[109011,3],[109078,0],[109146,1],[109213,2],[109213,3],[109281,0],[109348,3],[109416,1],[109416,0],[109483,2],[109551,0],[109618,1],[109618,2],[109686,0],[109753,3],[109821,1],[109821,0],[109956,3],[109956,2],[110091,0],[110091,1],[110158,2],[110226,0],[110293,1],[110293,3],[110361,0],[110428,2],[110496,1],[110496,0],[110563,3],[110631,1],[110698,2],[110698,3],[110766,0],[110833,3],[110901,1],[110901,0],[111036,3],[111036,2],[111171,0],[111171,1],[111238,2],[111306,0],[111373,2],[111373,3],[111441,1],[111508,2],[111576,1],[111576,0],[111711,1],[111711,2],[111846,2],[111846,3],[111981,1],[111981,0],[112116,3],[112116,2],[112251,0],[112251,1],[112318,3],[112386,1],[112453,2],[112453,3],[112521,0],[112588,3],[112656,2],[112656,1],[112723,0],[112791,2],[112791,3],[112858,1],[112926,2],[112926,3],[113061,0],[113061,1],[113128,2],[113196,1],[113196,0],[113331,3],[113331,1],[113398,2],[113466,3],[113466,1],[113601,0],[113601,2],[113668,1],[113736,2],[113736,0],[113871,2],[113871,1],[113938,3],[114006,2],[114006,1],[114141,1],[114141,2],[114208,0],[114276,1],[114276,2],[114411,3],[114411,1],[114478,2],[114546,1],[114546,3],[114681,0],[114681,2],[114748,1],[114816,0],[114816,2],[114951,2],[114951,3],[115018,1],[115086,2],[115086,3],[115221,0],[115221,1],[115288,2],[115356,1],[115356,0],[115491,3],[115491,2],[115558,0],[115626,3],[115693,1],[115693,0],[115761,2],[115828,0],[115896,2],[115896,3],[115963,0],[116031,1],[116098,2],[116098,3],[116166,0],[116233,3],[116301,1],[116301,0],[116436,3],[116436,2],[116571,1],[116571,2],[116571,0],[116706,2],[116706,1],[116841,2],[116841,3],[116841,0],[116976,3],[116976,2],[117111,2],[117111,3],[117111,1],[117246,2],[117246,3],[117381,2],[117381,3],[117381,0],[117516,3],[117516,2],[117651,0],[117651,1],[117741,2],[117741,3],[117831,1],[117831,0],[117921,2],[117921,3],[118056,2],[118191,3],[118258,2],[118326,0],[118393,3],[118461,2],[118528,0],[118596,3],[118731,0],[118731,1],[118731,2],[118866,2],[118866,1],[119001,2],[119001,3],[119001,0],[119136,3],[119136,2],[119271,2],[119271,3],[119271,1],[119406,2],[119406,3],[119541,2],[119541,1],[119541,0],[119676,2],[119676,1],[119811,2],[119811,1],[119811,3],[119946,3],[119946,2],[120081,0],[120081,1],[120081,2],[120216,0],[120216,1],[120351,2],[120351,3],[120351,1],[120486,1],[120486,2],[120621,0],[120621,1],[120621,2],[120756,2],[120756,1],[120891,3],[121431,0],[121634,0],[121836,1],[121971,2],[122511,2],[122714,3],[123051,2],[123726,2],[123861,3],[123996,2],[124131,0],[124131,1],[124131,3],[124401,1],[124401,0],[124401,3],[124671,1],[124671,0],[124671,2],[124941,1],[124941,0],[124941,2],[125211,0],[125211,2],[125211,3],[125279,1],[125346,3],[125414,1],[125414,0],[125481,2],[125549,0],[125616,1],[125616,3],[125684,2],[125751,1],[125819,3],[125819,0],[125886,1],[125954,0],[126021,1],[126021,3],[126021,2],[126156,1],[126156,2],[126291,3],[126291,0],[126291,2],[126359,1],[126426,0],[126494,2],[126494,3],[126561,1],[126629,2],[126696,3],[126696,0],[126764,1],[126831,2],[126899,3],[126899,0],[126966,1],[126966,2],[127034,0],[127101,1],[127101,3],[127101,2],[127236,2],[127236,0],[127371,3],[127371,1],[127371,0],[127439,2],[127506,0],[127574,1],[127574,3],[127641,0],[127709,2],[127776,1],[127776,0],[127844,3],[127844,2],[127911,0],[127979,1],[127979,2],[128046,3],[128114,0],[128181,2],[128181,3],[128316,0],[128316,1],[128451,3],[128451,2],[128451,0],[128519,1],[128586,3],[128654,2],[128654,0],[128721,3],[128789,0],[128856,2],[128856,1],[128991,1],[128991,0],[128991,2],[129126,3],[129126,2],[129126,0],[129261,3],[129261,2],[129261,1],[129396,2],[129396,3],[129396,0],[129531,2],[129531,1],[129531,3],[129599,0],[129666,2],[129734,0],[129734,1],[129801,2],[129869,3],[129936,2],[129936,1],[130004,0],[130071,1],[130071,2],[130071,3],[130139,0],[130206,1],[130206,2],[130206,3],[130341,1],[130341,0],[130341,2],[130409,3],[130476,2],[130476,1],[130476,0],[130611,3],[130611,1],[130611,0],[130679,2],[130746,3],[130746,1],[130746,0],[130881,2],[130881,0],[130881,3],[130949,1],[131016,2],[131016,3],[131016,0],[131151,3],[131151,2],[131219,1],[131219,0],[131286,3],[131286,2],[131421,0],[131421,1],[131489,2],[131489,3],[131556,1],[131556,0],[131691,3],[131691,1],[131759,2],[131759,0],[131826,1],[131826,3],[131961,0],[131961,2],[132029,1],[132029,3],[132096,2],[132096,0],[132231,0],[132231,3],[132299,2],[132299,1],[132366,3],[132366,0],[132501,2],[132501,1],[132569,0],[132569,3],[132636,1],[132636,2],[132771,2],[132771,3],[132771,1],[132839,0],[132906,2],[132974,1],[132974,0],[133041,3],[133109,2],[133176,1],[133176,0],[133244,2],[133311,0],[133379,1],[133379,2],[133446,3],[133514,0],[133581,1],[133581,2],[133581,3],[133716,2],[133716,3],[133851,3],[133851,0],[133851,2],[133986,2],[133986,3],[134121,0],[134121,1],[134121,2],[134256,2],[134256,1],[134391,2],[134391,3],[134391,0],[134526,2],[134526,3],[134661,3],[134661,2],[134661,1],[134796,2],[134796,3],[134931,1],[134931,0],[135021,2],[135021,3],[135111,1],[135111,0],[135201,2],[135201,3],[135336,2],[135336,1],[135471,3],[135539,2],[135606,0],[135674,3],[135741,2],[135809,0],[135876,3],[136011,0],[136011,1],[136011,2],[136146,1],[136146,0],[136281,2],[136281,3],[136281,0],[136416,2],[136416,0],[136551,3],[136551,2],[136551,1],[136686,1],[136686,2],[136821,1],[136821,0],[136821,2],[136956,1],[136956,0],[137091,3],[137091,1],[137091,2],[137226,1],[137226,2],[137226,3],[137361,3],[137361,2],[137361,0],[137496,2],[137496,3],[137496,0],[137631,0],[137631,1],[137631,2],[137766,2],[137766,1],[137766,0],[137901,2],[137901,0],[137901,3],[138036,2],[138036,3],[138036,0],[138171,3],[138171,2],[138171,0],[138239,1],[138306,0],[138374,2],[138374,1],[138441,3],[138509,2],[138576,1],[138576,0],[138644,2],[138711,1],[138779,0],[138779,2],[138779,3],[138846,1],[138914,0],[138981,1],[138981,2],[139049,3],[139116,2],[139116,1],[139184,0],[139251,1],[139251,2],[139319,3],[139386,1],[139386,0],[139454,3],[139521,2],[139521,1],[139589,0],[139656,1],[139656,3],[139724,2],[139791,1],[139791,3],[139791,0],[139859,2],[139926,0],[139994,1],[139994,3],[140061,2],[140129,0],[140196,1],[140196,2],[140331,2],[140331,3],[140331,0],[140399,1],[140466,0],[140534,1],[140534,2],[140601,3],[140669,0],[140736,1],[140736,2],[140804,3],[140871,0],[140939,1],[140939,3],[141006,2],[141074,1],[141141,2],[141141,3],[141141,0],[141209,1],[141276,2],[141276,3],[141344,0],[141411,1],[141411,3],[141411,2],[141546,2],[141546,3],[141546,1],[141681,3],[141681,2],[141681,0],[141816,3],[141816,2],[141816,0],[141951,2],[141951,0],[141951,1],[142086,2],[142086,1],[142086,0],[142221,2],[142221,3],[142221,0],[142356,3],[142356,2],[142356,0],[142491,1],[142491,0],[142559,3],[142626,2],[142694,3],[142761,0],[142829,2],[142896,1],[142964,3],[143031,1],[143099,3],[143166,0],[143234,2],[143301,1],[143369,3],[143436,2],[143504,3],[143571,0],[143571,1],[143639,2],[143706,0],[143774,1],[143841,3],[143841,2],[143909,0],[143976,1],[144044,3],[144111,1],[144111,0],[144179,2],[144246,1],[144314,0],[144381,2],[144381,3],[144449,1],[144516,2],[144584,3],[144651,1],[144651,0],[144719,3],[144786,1],[144786,2],[144854,3],[144921,2],[144921,0],[144989,1],[145056,0],[145056,3],[145124,1],[145191,2],[145191,0],[145191,3],[145259,1],[145326,2],[145326,3],[145326,0],[145394,1],[145461,0],[145461,2],[145529,3],[145596,2],[145596,1],[145664,3],[145731,1],[145731,0],[145799,2],[145799,3],[145866,1],[145866,0],[145934,2],[145934,3],[146001,1],[146001,0],[146069,2],[146069,3],[146136,1],[146136,0],[146204,2],[146204,3],[146271,1],[146271,0],[146339,2],[146339,3],[146406,1],[146406,0],[146474,2],[146474,3],[146541,1],[146541,0],[146609,2],[146609,3],[146676,1],[146676,0],[146744,2],[146744,3],[146811,1],[146811,0]]; 
var nowTime = 0,
    interval = 1000,
    offset = 1350,
    perpectTop = 465,
    speed = 600;
var playInterval;

function showMessage(pclass, descript) {
    var mes = $(".cloneable.message").clone();
    mes.text(descript);
    mes[0].classList.remove("cloneable");
    mes[0].classList.add(pclass);
    mes.appendTo("#display");
    mes.animate({
        "top": "350px",
        "opacity": "0"
    }, "slow", "swing", function() {
        $(this).remove();
    });
}

function pushnote(pclass) {
    $(pclass + ".key-intro")[0].classList.add("push");
    var note = $(pclass + ".note:first")
    var timing = note.css("top").toString().replace("px", "");
    /*
	$(pclass+".note").each(function(){
		var thisTimeing = $(this).css("top").toString().replace("px","");
		if(thisTimeing > timing && thisTimeing < perpectTop+100){
			note = $(this);
			timing = thisTimeing;
		}
	})
*/

    if (timing == undefined) return;
    pclass = pclass.substring(1);
    if (perpectTop - 30 < timing && perpectTop + 30 > timing) {
        $(".n-great").text(function(i, v) {
            return parseInt(v) + 1
        });
        $(".n-score").text(function(i, v) {
            return parseInt(v) + 2
        });
        addCombo(true);
        showMessage(pclass, "따봉!!");

        note[0].classList.add("pushed");
        note.remove();
    } else if (perpectTop - 130 < timing && perpectTop + 130 > timing) {
        $(".n-good").text(function(i, v) {
            return parseInt(v) + 1
        });
        $(".n-score").text(function(i, v) {
            return parseInt(v) + 1
        });
        addCombo(true);
        showMessage(pclass, "굿잡!!");

        note[0].classList.add("pushed");
        note.remove();
    } else if (perpectTop - 170 < timing && perpectTop + 170 > timing) {
        $(".n-miss").text(function(i, v) {
            return parseInt(v) + 1
        });
        addCombo(false);
        showMessage(pclass, "이런..");

        note[0].classList.add("pushed");
        note.remove();
    }
}

function addCombo(status) {
    if (status == true) {
        $(".combo").text(function(i, v) {
            return parseInt(v) + 1
        });
        var combo = parseInt($(".combo").text());
        $(".n-maxcombo").text(function(i, v) {
            var maxcombo;
            if (parseInt(v) < combo) {
                maxcombo = combo;
            } else {
                maxcombo = parseInt(v);
            }
            return maxcombo;
        });
    } else {
        $(".combo").text(0);
    }
}
$("bo" + "dy").on("keydown", function(e) {
    switch (e.keyCode) {
        case 90:
            pushnote(".position-0");
            break;
        case 88:
            pushnote(".position-1");
            break;
        case 190:
            pushnote(".position-2");
            break;
        case 191:
            pushnote(".position-3");
            break;
    }
});

$("bo" + "dy").on("keyup", function(e) {
    switch (e.keyCode) {
        case 90:
            $(".position-0.key-intro")[0].classList.remove("push");
            break;
        case 88:
            $(".position-1.key-intro")[0].classList.remove("push");
            break;
        case 190:
            $(".position-2.key-intro")[0].classList.remove("push");
            break;
        case 191:
            $(".position-3.key-intro")[0].classList.remove("push");
            break;
    }
});


$("audio").on("canplaythrough", function() {
    setTimeout(function() {
        $("audio")[0].play();
    }, offset);
    playInterval = setInterval(function() {
        var isNoteZero = noteInfo.length == 0;
        if (isNoteZero == false) {
            //겜중
            while (noteInfo[0][0] < nowTime + interval) {
                (function() {
                    var notearr = noteInfo.shift();
                    setTimeout(function() {
                        var note = $(".note.cloneable").clone();
                        var noteHorizon = "position-" + notearr[1];
                        note[0].classList.remove("cloneable");
                        note[0].classList.add(noteHorizon);
                        note.appendTo("#display")
                            .animate({
                                top: "550px"
                            }, speed, "linear", function() {
                                if (this.classList.contains("pushed") == false) {
                                    showMessage(noteHorizon, "이런...")
                                    addCombo(false);
                                    $(".n-miss").text(function(i, v) {
                                        return parseInt(v) + 1
                                    });
                                    $(this).remove();
                                }
                            });
                    }, notearr[0] - nowTime);
                })()
            }
        } else {
            // 겜끝
            var allScore = 2 * (parseInt($(".n-great").text()) + parseInt($(".n-good").text()) + parseInt($(".n-miss").text()));
            var percent = parseInt($(".n-score").text()) * 100 / allScore;
            var rank = "";
            if (percent > 95) {
                rank = "S";
            } else if (percent > 90) {
                rank = "AAA";
            } else if (percent > 80) {
                rank = "AA";
            } else if (percent > 70) {
                rank = "A";
            } else if (percent > 60) {
                rank = "B";
            } else if (percent > 50) {
                rank = "C";
            }
            $(".result").removeClass("hide");
            $(".score").html(rank + "랭크 축하드려용!!");
            clearInterval(playInterval);
        }
        nowTime += interval;
    }, interval);

    $(".moveDebate").click(function() {
        //플러그인의 모든 키 순회
        function forEach(object, callback) {
            for (var key in object) {
                var variable = object[key];
                callback(variable, key);
            }
        }

        function getValue(selector) {
            return parseInt($(selector).text());
        }

        function getRankingJSON(rankingDoc) {
            var regexp = /\<includeonly\>(.*)\<\/includeonly\>/;
            var stringRanking = regexp.exec(rankingDoc)[1];
            return JSON.parse(stringRanking);
        }

        var userName = mw.config.get("wgUserName");
        var thisScore = {
            name: userName,
            great: getValue(".n-great"),
            good: getValue(".n-good"),
            miss: getValue(".n-miss"),
            score: getValue(".n-score"),
            combo: getValue(".n-maxcombo"),
        }


        rankingSystem.update(
            thisScore,
            function(rankingScore, thisScore) {
                return rankingScore.score < thisScore.score
            }, {
                score: "점수",
                combo: "콤보",
                great: "따봉!",
                good: "굿잡!",
                miss: "이런.."
            });
    })
});
		
  }

}
$( plugin_uncyrhythm );
/* uncyrhythm 끝 */



/** 플러그인 RankingSystem***************************
* 랭킹시스템 라이브러리
* 버전 => 1.0.7
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => RankingSystem = {"name":"RankingSystem","descript":"랭킹시스템 라이브러리","version":"1.0.7","local":true,"creat":"BANIP","state":"사용자:BANIP/플러그인/랭킹시스템","executable":false}; 
*/ 
function plugin_RankingSystem(){
  if($("[data-name='RankingSystem']").length >= 1){
		 // 이부부분에 코드 입력 //

/**
  * @param 
  		{string} documentTitle 랭킹정보가 있는 문서의 제목.
  		{function} sortCallback 랭킹을 정렬할때 기준으로 사용하는 함수
  		    {any} prev 랭킹 정렬 기준으로 사용할 왼쪽의 값
  		   	{any} next 랭킹 정렬 기준으로 사용할 오른쪽의 값
  		{object} api MediaWikiapi의 인스턴스, 없어도 됨.

  	@return {Object}
  		{function} get 랭킹정보를 object형태로 획득
  		{function} update 랭킹정보 업데이트
  			{object} updateInfo 업데이트할 사용자 정보
  			{function} updateCriteria 사용자정보의 업데이트 기준
  			@param {any} rankingScore 랭킹에서 사용중인 스코어
  				   {any} thisScore 사용자 스코어
  			@return{bool} true가 반환되면 업데이트
  			{object} alternateKeys 랭킹에서 보여지는 대체 키
*/
return function(documentTitle, sortCallback, api) {
    function forEach(object, callback) {
        for (var key in object) {
            var variable = object[key];
            callback(variable, key);
        }
    }

    function getRankingJSON(rankingDoc) {
        console.log(rankingDoc)
        if (!rankingDoc) return {};
        var regexp = /\<includeonly\>(.*)\<\/includeonly\>/;
        var stringRanking = regexp.exec(rankingDoc)[1];
        return JSON.parse(stringRanking);
    }

    function updateDoc(rankingJSON, api, alternateKeys) {
        //alternateKeys가 반영된 개개인의 랭킹정보 획득
        function getOutputJSON(json) {
            var result = {};
            forEach(json, function(value, key) {
                key = alternateKeys[key] || key;
                result[key] = value;
            })
            return result;
        }

        //보여지는 형태의 랭킹정보 획득
        function getOutputString(json) {
            var name = json.name;
            var result = "* '''" + name + "''' : ";
            forEach(json, function(value, key) {
                if (key === "name") return;
                key = alternateKeys[key] || key;
                result += key + ": " + value + ", ";
            })
            result += "\n"
            return result
        }

        var stringRanking = JSON.stringify(rankingJSON);
        var result = "<includ" + "eonly>" + stringRanking + "</inclu" + "deonly>\n";
        result += "<onlyin" + "clude>\n";

        var rankingList = Object.entries(rankingJSON).sort(function(prev,next){
          return sortCallback(prev[1],next[1])
        }).map(function(value){
          return value[0]
        });

        rankingList.forEach(function(key) {
            var json = rankingJSON[key];
            var outputJSON = getOutputJSON(json);
            result += getOutputString(outputJSON)
        });

        result += "</only" + "include>";
        var reply = documentTitle.replace(new RegExp("\/.*"),"") + " 점수 갱신";
        api.changeDocument(documentTitle, reply, result, true);
        return result;
    }

    function updateUserScore(rankingJSON, thisScore, updateCriteria) {
        updateCriteria = updateCriteria || function(rankingScore, thisScore) {
            return rankingScore.score < thisScore.score;
        }

        var userName = thisScore.name;
        var rankingScore = rankingJSON[userName];

        if (!rankingScore || updateCriteria(rankingScore, thisScore)) {
            rankingJSON[userName] = thisScore;
        }
    }

    api = api || MediaWikiAPI();
    var userName = mw.config.get("wgUserName");
    var rankingDoc = api.getDocument(documentTitle);
    var rankingJSON = getRankingJSON(rankingDoc);

    var actions = {
        get: function() {
            return rankingJSON;
        },
        update: function(updateInfo, updateCriteria, alternateKeys) {
            rankingJSON = actions.get();
            updateUserScore(rankingJSON, updateInfo, updateCriteria);
            updateDoc(rankingJSON, api, alternateKeys);
        }
    }
    return actions;
}

		
  }

}
/* RankingSystem 끝 */

/** 플러그인 jsRULLET***************************
* 랜덤 룰렛을 위한 플러그인
* 버전 => 1.0.4
* 작성자 : [[사용자:Cheongseong9473|Cheongseong9473]] 
* JSON => jsRULLET = {"name":"jsRULLET","descript":"랜덤 룰렛을 위한 플러그인","version":"1.0.4","local":true,"creat":"Cheongseong9473","state":"자바월드/랜덤룰렛/플러그인","executable":true}; 
*/ 
function plugin_jsRULLET(){
  if($("[data-name='jsRULLET']").length >= 1){
		 for (var i=0;i<6;i++)
{
  alert(randomRange(1,60));
}

function randomRange(n1, n2) {
  return Math.floor( (Math.random() * (n2 - n1 + 1)) + n1 );
}

		
  }

}
$( plugin_jsRULLET );
/* jsRULLET 끝 */


/** 플러그인 SimMD5***************************
* 마법의 MD-5 시뮬레이터 게임에 사용되는 스크립트로, 인터페이스와 배틀시스템을 구현합니다.
* 버전 => 1.3
* 작성자 : [[사용자:Gustmd7410|Gustmd7410]] 
* JSON => SimMD5 = {"name":"SimMD5","descript":"마법의 MD-5 시뮬레이터 게임에 사용되는 스크립트로, 인터페이스와 배틀시스템을 구현합니다.","version":"1.3","local":true,"creat":"Gustmd7410","state":"마법의 MD-5 시뮬레이터/플러그인","executable":true}; 
*/ 
function plugin_SimMD5(){
  if($("[data-name='SimMD5']").length >= 1){
		  // 이부분에 코드 입력 //
mw.loader.using('oojs-ui-widgets').done(function() {
	function prepare() {
		function responsible(event) {
			var button = $('#input-time .oo-ui-numberInputWidget-plusButton, #input-time .oo-ui-numberInputWidget-minusButton');
			
			if(event.matches) {
				button.css('display', 'none');
				input.time.$label.css('margin-right', null);
			} else {
				button.css('display', 'null');
				input.time.$label.css('margin-right', '30px');
			}
		}
		
		function encode(string) {
			return string
			.replace(/&/g, '&#38;')
			.replace(/</g, '&#60;')
			.replace(/>/g, '&#62;')
			.replace(/{/g, '&#123;')
			.replace(/\|/g, '&#124;')
			.replace(/=/g, '&#61;')
			.replace(/}/g, '&#125;')
			.replace(/\[/g, '&#91;')
			.replace(/\]/g, '&#93;')
			.replace(/_/g, '&#95;');
		}
		
		function cancel(btn) {
			if(stat.length) {
				battle.done = null;
				battle.turn = 0;
				battle.attack = null;
				battle.sequence = null;
				battle.combo = null;
				battle.temp = null;
				
				bar = [];
				bar[0] = new OO.ui.ProgressBarWidget({
					progress: 100
				});
				bar[1] = new OO.ui.ProgressBarWidget({
					progress: 100
				});
				
				bar[0].$bar.css({
					background: '#3366CC'
				});
				bar[0].$element.css({
					'border-right': 'none',
					'border-top-right-radius': 0,
					'border-bottom-right-radius': 0
				});
				bar[1].$bar.css({
					background: '#FF5500'
				});
				bar[1].$element.css({
					'border-left': 'none',
					'border-top-left-radius': 0,
					'border-bottom-left-radius': 0
				});
				
				input.start.setLabel('재시작');
				input.reset.setLabel('초기화');
				$('#stat-turn').text(0);
				$('.stat-0.stat-currentHP').data('value', stat[0].HP).text(stat[0].HP.toFixed(2)).css('color', '#3366CC');
				$('.stat-1.stat-currentHP').data('value', stat[1].HP).text(stat[1].HP.toFixed(2)).css('color', '#FF5500');
				$('.stat-0.stat-HPbar').html(bar[0].$element);
				$('.stat-1.stat-HPbar').html(bar[1].$element);
				if(btn) $('#log')[0].innerText += '\n다시 시작하려면 재시작 버튼을 눌러주세요.';
			}
		}
		
		function stop() {
			clearInterval(battle.work);
			
			$('#input-stop').hide();
			$('#input-start').show();
			input.reset.setDisabled(false);
			input[0].setDisabled(false);
			input[1].setDisabled(false);
			input.time.setDisabled(false);
			input.swap.setDisabled(false);
		}
		
		var input = {};
		input[0] = new OO.ui.TextInputWidget({
			placeholder: '선',
			title: '후',
			value: new URLSearchParams(location.search).get('p0') || ''
		});
		input.start = new OO.ui.ButtonInputWidget({
			type: 'submit',
			flags: ['primary', 'progressive'],
			label: '시작'
		});
		input.stop = new OO.ui.ButtonInputWidget({
			flags: ['primary', 'destructive'],
			label: '정지'
		});
		input[1] = new OO.ui.TextInputWidget({
			placeholder: '후',
			title: '후',
			value: new URLSearchParams(location.search).get('p1') || ''
		});
		input.time = new OO.ui.NumberInputWidget({
			value: 1,
			min: 0,
			label: '초 간격'
		});
		input.reset = new OO.ui.ButtonInputWidget({
			type: 'reset',
			flags: ['destructive'],
			label: '초기화'
		});
		input.swap = new OO.ui.ButtonInputWidget({
			label: $('<div />').css({
				height: '20px',
				width: '20px',
				'background-image': 'url("/wiki/Special:Redirect/file/Ambox_move_black.svg")',
				'background-size': 'cover'
			}),
			title: '교체',
			framed: false
		});
		input.table = new OO.ui.ToggleSwitchWidget({
			value: true
		});
		input.icon = new OO.ui.ButtonWidget({
			framed: false,
			icon: $('#mw-customcollapsible-input-option').hasClass('mw-collapsed')? 'expand' : 'collapse'
		});
		input.log = new OO.ui.ButtonWidget({
			label: '기록 복사'
		});
		input.url = new OO.ui.ButtonWidget({
			label: 'URL 복사'
		});
		input.box = new OO.ui.MultilineTextInputWidget();
		var media = matchMedia('(max-width: 800px)');
		var stat = [];
		var bar = [];
		var battle = {
			turn: 0,
			attack: null,
			done: null,
			work: null,
			sequence: null,
			combo: null,
			temp: null
		};
		
		$('#input').wrap('<form />');
		$('#input-0').html(input[0].$element);
		$('#input-start').html(input.start.$element);
		$('#input-stop').html(input.stop.$element);
		$('#input-1').html(input[1].$element);
		$('#input-time').html(input.time.$element);
		$('#input-reset').html(input.reset.$element);
		$('#input-swap').html(input.swap.$element);
		$('#input-table').html(input.table.$element).append(' 스탯');
		$('#input-icon').html(input.icon.$element);
		$('#stat-load').html(new OO.ui.ProgressBarWidget().$element);
		$('#log').text('시작하시려면 상단에 대결할 상대의 이름을 입력해 주세요. (1.3)');
		$('#share-log').html(input.log.$element);
		$('#share-url').html(input.url.$element);
		$('#share-cvbox').html(input.box.$element);
		
		input.box.$input.attr('readonly', '').css('height', '2.5em');
		
		$('#stat-bar').hide();
		$('#share').hide();
		
		responsible(media);
		media.addListener(responsible);
		
		new MutationObserver(function(mutation) {
			input.icon.setIcon($(mutation[0].target).hasClass('mw-collapsed')? 'expand' : 'collapse');
		}).observe($('#mw-customcollapsible-input-option')[0], {
			attributes: true,
			attributeFilter: ['class']
		});
		
		input.swap.$element.click(function() {
			if(!input.swap.disabled) {
				var val = [input[1].value, input[0].value];
				input[0].setValue(val[0]);
				input[1].setValue(val[1]);
				
				if(stat.length) {
					stat = [stat[1], stat[0]];
					
					$('#stat-turn').text(0);
					$('.stat-0').each(function() {
						if($(this).hasClass('stat-name')) $(this).text(stat[0].name);
						else if($(this).hasClass('stat-attack')) $(this).text(stat[0].attack);
						else if($(this).hasClass('stat-quick')) $(this).text(stat[0].quick);
						else if($(this).hasClass('stat-defense')) $(this).text(stat[0].defense);
						else if($(this).hasClass('stat-hit')) $(this).text(stat[0].hit);
						else if($(this).hasClass('stat-luck')) $(this).text(stat[0].luck);
						else if($(this).hasClass('stat-fullHP')) $(this).text(stat[0].HP);
						else if($(this).hasClass('stat-currentHP')) $(this).data('value', stat[0].HP).text(stat[0].HP.toFixed(2));
						else if($(this).hasClass('stat-HPbar')) $(this).html(bar[0].$element);
					});
					$('.stat-1').each(function() {
						if($(this).hasClass('stat-name')) $(this).text(stat[1].name);
						else if($(this).hasClass('stat-attack')) $(this).text(stat[1].attack);
						else if($(this).hasClass('stat-quick')) $(this).text(stat[1].quick);
						else if($(this).hasClass('stat-defense')) $(this).text(stat[1].defense);
						else if($(this).hasClass('stat-hit')) $(this).text(stat[1].hit);
						else if($(this).hasClass('stat-luck')) $(this).text(stat[1].luck);
						else if($(this).hasClass('stat-fullHP')) $(this).text(stat[1].HP);
						else if($(this).hasClass('stat-currentHP')) $(this).data('value', stat[1].HP).text(stat[1].HP.toFixed(2));
						else if($(this).hasClass('stat-HPbar')) $(this).html(bar[1].$element);
					});
					
					var url = new URL(location);
					url.searchParams.set('p0', input[0].value);
					url.searchParams.set('p1', input[1].value);
					history.replaceState(null, '', url);
					
					cancel();
					
					input.start.setLabel('시작');
				}
			}
		});
		input.table.$element.click(function() {
			if(input.table.value) {
				if($('#stat-turn').text()) $('#stat-table').show(500);
			} else {
				$('#stat-table').hide(500);
			}
		});
		input.reset.$button[0].form.addEventListener('reset', function(event) {
			event.preventDefault();
			
			if(!input.reset.disabled) {
				if(battle.done || battle.done === null) {
					var url = new URL(location);
					url.searchParams['delete']('p0');
					url.searchParams['delete']('p1');
					history.replaceState(null, '', url);
					stat = [];
					input[0].setValue();
					input[1].setValue();
					input.time.setValue(1);
					input.table.setValue(true);
					input.start.setLabel('시작');
					$('#share').hide();
					$('#share-cvbox').hide();
					$('#stat-table').hide(500);
					$('#stat-bar').hide(500);
					$('#stat-turn, .stat-0, .stat-1').text('');
					$('#log-time').hide();
					$('#log').show();
					$('#log').text('시작하시려면 상단에 대결할 상대의 이름을 입력해 주세요.');
					$('.stat-HPbar').html('');
				} else cancel(true);
			}
		});
		input.start.$button[0].form.addEventListener('submit', function(event) {
			function last() {
				$('#input-stop').show();
				$('#input-start').hide();
				input.reset.setLabel('취소');
				input[0].setDisabled(true);
				input[1].setDisabled(true);
				input.time.setDisabled(true);
				input.reset.setDisabled(true);
				input.swap.setDisabled(true);
				input.start.setLabel('재개');
				
				battle.work = start(battle, stat.map(function(obj, index) {
					return new Proxy(obj, {
						get: function(target, key, receiver) {
							if(key === 'HP') return +$('.stat-' + index + '.stat-currentHP').data('value');
							else return Reflect.get(target, key, receiver);
						},
						set: function(target, key, value) {
							if(key === 'HP') {
								if(value < 0) {
									value = 0;
									$('.stat-' + index + '.stat-currentHP').css('color', '#000000');
								}
								$('.stat-' + index + '.stat-currentHP').data('value', value).text(value.toFixed(2));
								bar[index].setProgress(value / target.HP * 100);
							}
						}
					});
				}), input.time.value * 1000, function(msg) {
					$('#log')[0].innerText += msg;
					$('#log').scrollTop($('#log')[0].scrollHeight);
					
					if(battle.sequence === 0) {
						$('#stat-turn').text(battle.turn);
						$('.stat-' + battle.attack + '.stat-name').css({
							background: battle.attack? '#FF5500' : '#3366CC',
							color: '#FFFFFF'
						});
						$('.stat-' + (battle.attack ^ 1) + '.stat-name').css({
							background: '#EAECF0',
							color: battle.attack? '#3366CC' : '#FF5500'
						});
					}
				}, function(msg) {
					$('#log')[0].innerText += msg;
					$('#log')[0].innerText += '\n\n백괴스러운 MD-5 시뮬레이터 [https://game.uncyclopedia.kr/wiki/마법의_MD-5_시뮬레이터]';
					$('#log').scrollTop($('#log')[0].scrollHeight);
					
					$('#share').show();
					
					stop();
					
					battle.done = true;
					battle.turn = 0;
					battle.attack = null;
					battle.sequence = null;
					battle.combo = null;
					battle.temp = null;
					
					input.start.setLabel('재시작');
					input.reset.setLabel('초기화');
				});
			}
			
			event.preventDefault();
			
			if(!input.start.disabled) {
				$('#share').hide();
				$('#share-cvbox').hide();
				
				if(input.time.value >= 0) {
					$('#log-time').hide();
					$('#log').show();
					
					if(!stat.length) $.get({
						url: '/w/api.php',
						data: {
							action: 'parse',
							format: 'json',
							title: '마법의 MD-5 시뮬레이터',
							text: '[{{#invoke:SimMD5|stat|' + encode(input[0].value) + '|AJAX}},{{#invoke:SimMD5|stat|' + encode(input[1].value) + '|AJAX}}]',
							prop: 'text',
							disablelimitreport: true,
							formatversion: 2
						},
						beforeSend: function() {
							if($('#stat-bar').html()) {
								$('#stat-bar').hide();
								$('#stat-load').show();
							} else $('#stat-load').show(500);
							$('#log').text('스탯 계산중입니다. 잠시만 기다려 주세요.');
							
							var url = new URL(location);
							url.searchParams.set('p0', input[0].value);
							url.searchParams.set('p1', input[1].value);
							history.replaceState(null, '', url);
						},
						success: function(callback) {
							stat = JSON.parse($(callback.parse.text).text());
							
							bar = [];
							bar[0] = new OO.ui.ProgressBarWidget({
								progress: 100
							});
							bar[1] = new OO.ui.ProgressBarWidget({
								progress: 100
							});
							
							bar[0].$bar.css({
								background: '#3366CC'
							});
							bar[0].$element.css({
								'border-right': 'none',
								'border-top-right-radius': 0,
								'border-bottom-right-radius': 0
							});
							bar[1].$bar.css({
								background: '#FF5500'
							});
							bar[1].$element.css({
								'border-left': 'none',
								'border-top-left-radius': 0,
								'border-bottom-left-radius': 0
							});
							
							$('#stat-turn').text(0);
							$('.stat-0').each(function() {
								if($(this).hasClass('stat-name')) $(this).text(stat[0].name);
								else if($(this).hasClass('stat-attack')) $(this).text(stat[0].attack);
								else if($(this).hasClass('stat-quick')) $(this).text(stat[0].quick);
								else if($(this).hasClass('stat-defense')) $(this).text(stat[0].defense);
								else if($(this).hasClass('stat-hit')) $(this).text(stat[0].hit);
								else if($(this).hasClass('stat-luck')) $(this).text(stat[0].luck);
								else if($(this).hasClass('stat-fullHP')) $(this).text(stat[0].HP);
								else if($(this).hasClass('stat-currentHP')) $(this).data('value', stat[0].HP).text(stat[0].HP.toFixed(2));
								else if($(this).hasClass('stat-HPbar')) $(this).html(bar[0].$element);
							});
							$('.stat-1').each(function() {
								if($(this).hasClass('stat-name')) $(this).text(stat[1].name);
								else if($(this).hasClass('stat-attack')) $(this).text(stat[1].attack);
								else if($(this).hasClass('stat-quick')) $(this).text(stat[1].quick);
								else if($(this).hasClass('stat-defense')) $(this).text(stat[1].defense);
								else if($(this).hasClass('stat-hit')) $(this).text(stat[1].hit);
								else if($(this).hasClass('stat-luck')) $(this).text(stat[1].luck);
								else if($(this).hasClass('stat-fullHP')) $(this).text(stat[1].HP);
								else if($(this).hasClass('stat-currentHP')) $(this).data('value', stat[1].HP).text(stat[1].HP.toFixed(2));
								else if($(this).hasClass('stat-HPbar')) $(this).html(bar[1].$element);
							});
							
							$('.stat-0.stat-currentHP').css('color', '#3366CC');
							$('.stat-1.stat-currentHP').css('color', '#FF5500');
							
							$('#stat-load').hide();
							if(input.table.value) $('#stat-table').show(500);
							$('#stat-bar').show();
							$('#log').text('');
							$('#log')[0].innerText += '[' + stat[0].name + '] 공격력: ' + stat[0].attack + ' / 방어력: ' + stat[0].defense + ' / 민첩: ' + stat[0].quick + ' / 명중: ' + stat[0].quick + ' / 운: ' + stat[0].luck + ' / HP: ' + stat[0].HP + '\n';
							$('#log')[0].innerText += '[' + stat[1].name + '] 공격력: ' + stat[1].attack + ' / 방어력: ' + stat[1].defense + ' / 민첩: ' + stat[1].quick + ' / 명중: ' + stat[1].quick + ' / 운: ' + stat[1].luck + ' / HP: ' + stat[1].HP + '\n';
							$('#log')[0].innerText += '\n';
							
							battle.turn = 1;
							battle.done = false;
							battle.attack = 0;
							battle.sequence = 0;
							battle.combo = [0, 0];
							battle.temp = {};
							
							last();
						},
						error: function(error) {
							$('#stat-load').hide(500);
							$('#log').text('스탯 계산에 오류가 발생하였습니다. 다시 시도해 주십시오. (' + error.status + ')');
						}
					});
					else if(battle.done || battle.done === null) {
						if(battle.done) cancel();
						
						$('#log').text('');
						$('#log')[0].innerText += '[' + stat[0].name + '] 공격력: ' + stat[0].attack + ' / 방어력: ' + stat[0].defense + ' / 민첩: ' + stat[0].quick + ' / 명중: ' + stat[0].quick + ' / 운: ' + stat[0].luck + ' / HP: ' + stat[0].HP + '\n';
						$('#log')[0].innerText += '[' + stat[1].name + '] 공격력: ' + stat[1].attack + ' / 방어력: ' + stat[1].defense + ' / 민첩: ' + stat[1].quick + ' / 명중: ' + stat[1].quick + ' / 운: ' + stat[1].luck + ' / HP: ' + stat[1].HP + '\n';
						$('#log')[0].innerText += '\n';
						
						battle.turn = 1;
						battle.done = false;
						battle.attack = 0;
						battle.sequence = 0;
						battle.combo = [0, 0];
						battle.temp = {};
						
						last();
					} else last();
				} else {
					$('#log-time').show();
					$('#log').hide();
				}
			}
		});
		input.stop.$element.click(function() {
			if(!input.stop.disabled) stop();
		});
		input[0].$input.focus(function() {
			cancel();
			stat = [];
			input.start.setLabel('시작');
			$(this).select();
		});
		input[1].$input.focus(function() {
			cancel();
			stat = [];
			input.start.setLabel('시작');
			$(this).select();
		});
		input.log.$button.click(function() {
			input.box.setValue($('#log').text());
			$('#share-cvbox').show();
			input.box.$input.select();
			document.execCommand('copy');
		});
		input.url.$button.click(function() {
			var url = new URL('/wiki/마법의_MD-5_시뮬레이터', location);
			var search = new URLSearchParams(location.search);
			url.searchParams.set('p0', search.get('p0'));
			url.searchParams.set('p1', search.get('p1'));
			input.box.setValue(url);
			$('#share-cvbox').show();
			input.box.$input.select();
			document.execCommand('copy');
		});
		input.box.$input.click(function() {
			$(this).select();
		});
	}
	
	function start(battle, stat, time, each, last) {
		function rand(min, max) {
		    return Math.floor(Math.random() * (max - min + 1)) + min;
		}
		
		function range(weight) {
	        var range = [-0.5, -0.25, 0, 0.25, 0.5].map(function(ratio, index) {
	        	return 20 + (weight - 50) * ratio;
	        });
	        range.reduce(function(acc, current, index, prob) {
	        	return prob[index] += acc;
	        });
	        return range;
		}
		
	    function rank(range, val) {
	        return range.findIndex(function(current, index) {
	        	return (index === 0 || range[index - 1] < val) && val <= current;
	        });
	    }
	    
		function power(stat, rank) {
		    return stat * (((rank === 0)? 0 : rand(1 + 25 * (rank - 1), 25 * rank)) / 100);
		}
		
		function bonus(plus, minus, rank) {
			rank -= 2;
			if(rank === 0) return 0;
		    return ((rank > 0)? plus : minus) * (rand(1 + 50 * (rank - 1), 50 * rank) / 100);
		}
		
		function josa(text, exist, not, only) {
			text = text.normalize('NFD');
			var code = text.charCodeAt(text.length - 1);
			
			if(0x1161 <= code && code <= 0x11A7) return ((only)? '' : text) + not;
			else if(0x11A8 <= code && code <= 0x11FF) return ((only)? '' : text) + exist;
			else return ((only)? '' : text) + exist + '(' + not + ')';
		}
		
		return setInterval(function() {
			var attacker = battle.attack;
			var defender = attacker ^ 1;
			
			if(stat[0].HP > 0 && stat[1].HP > 0) {
				switch(battle.sequence) {
					case 0:
						var scale = range(stat[attacker].luck);
						var adv = bonus(stat[attacker].hit, stat[defender].quick, rank(range(50), 50 + ((battle.combo[defender])? 0 : battle.combo[defender]) - ((battle.combo[attacker])? 0: battle.combo[attacker])));
						var grade = {
							attack: rank(scale, rand(1, 100)),
							defense: rank(range(stat[defender].luck), rand(1, 100)),
						};
						var damage = power(stat[attacker].attack, grade.attack) - power(stat[defender].defense, grade.defense) + adv;
						battle.temp = {
							rank: rank(scale, damage),
							damage: (damage > 0)? damage : 0
						};
						
						if(battle.temp.damage > stat[attacker].attack) battle.temp.rank = 5;
						if(battle.temp.damage) {
							if(!battle.temp.rank) battle.temp.rank = 1;
							if(battle.combo[attacker] < 0) battle.combo[attacker] = 0;
							battle.combo[attacker]++;
						} else {
							battle.temp.rank = 0;
							if(battle.combo[attacker] > 0) battle.combo[attacker] = 0;
							battle.combo[attacker]--;
						}
						
						each('[' + stat[attacker].name + ']의 공격 ');
						battle.sequence++;
					break;
					case 1:
						var rankText = ['MISS', 'HIT', 'GOOD', 'NICE', 'PERFECT', 'CRITICAL'][battle.temp.rank];
						each(rankText + '! ');
						battle.sequence++;
					break;
					case 2:
						stat[defender].HP -= battle.temp.damage;
						var msg = (battle.temp.rank === 0)? '공격을 피했다. (' : (+battle.temp.damage.toFixed(2)) + '의 대미지를 받았다. (' + ((battle.combo[attacker] > 0)? battle.combo[attacker] : 0) + ' COMBO, ';
						each('[' + stat[defender].name + ']' + josa(stat[defender].name, '은', '는', true) + ' ' + msg + '남은 HP: ' + (+stat[defender].HP.toFixed(2)) + ')\n');
						if(attacker === 1) battle.turn++;
						battle.sequence = 0;
						battle.attack = defender;
					break;
				}
			} else last('\n[' + stat[defender].name + '] 승! (' + battle.turn + '턴)');
		}, time);
	}
	
	$(prepare);
});
 // 여기까지 코드 입력 //

		
  }

}
$( plugin_SimMD5 );
/* SimMD5 끝 */


/** 플러그인 autosave***************************
* 자동저장 시스템을 위한 플러그인
* 버전 => 2.0.2
* 작성자 : [[사용자:Manymaster|Manymaster]] 
* JSON => autosave = {"name":"autosave","descript":"자동저장 시스템을 위한 플러그인","version":"2.0.2","local":false,"creat":"Manymaster","state":"틀:자동저장/플러그인","executable":true}; 
*/ 
function plugin_autosave(){
		 
/* 작동 가능한 네임스페이스 */
var safeNameSpace = [""];
/* autosave 편집모드가 아닐 경우 플러그인 종료 */
var searchParams = geturlSearch(location);
var isEditMode = searchParams.action === "edit";
var isAutosaveMode = searchParams.autosave === "1";
if (!(isEditMode && isAutosaveMode)) return "";

/* 자동 저장하기에 안전한 네임스페이스가 아닌 경우 플러그인 종료 */
var thisNamespaceNumber = mw.config.get("wgNamespaceNumber");
var nameSpaceIds = mw.config.get("wgNamespaceIds");
var isSafeNameSpace = safeNameSpace
    .map(function (namespace) { return nameSpaceIds[namespace]; })
    .some(function (nsNumber) { return nsNumber == thisNamespaceNumber; });
if (!(isSafeNameSpace)) return "";

/* 자동 인증된 사용자가 아닌 경우 플러그인 종료 */
var userGroups = mw.config.get('wgUserGroups');
var autocheck = 0;
if (userGroups) {
    for (var i = 0; i < userGroups.length; i++) {
        if (userGroups[i] === 'autoconfirmed') {
            autocheck++;
        }
    }
}
if (autocheck != 1) return "";

/* 지정된 단락에서 불러오기 */
var savetempDom = $(".game-autosave");
if ($(".game-autosave").length === 0)
    throw new Error("autosave => game-autosave를 클래스명으로 가진 돔을 찾을 수 없습니다.");
var savetemp = $(".game-autosave").html();

/* 문제가 되는 문자열 치환 */
savetemp = savetemp.replace(/(<([^>]+)>)/ig, "");
savetemp = savetemp.replace(/\n+/gi, "\n");
savetemp = savetemp.replace("\n", "");
savetemp = savetemp.replace(/&lt;/gi, "<");
savetemp = savetemp.replace(/&gt;/gi, ">");

/* 기록, 저장하고 빠져나오기 */
$("#wpTextbox1").val(savetemp);
$("#wpSave").click();
return;

/** 이 플러그인 제작을 도와주신 분들
 * Ver 2 제작자: [[사용자:BANIP|BANIP]]
 * 원 코드 작성자: [[사용자:*devunt]]
*/ 

		
}
$( plugin_autosave );
/* autosave 끝 */


/** 플러그인 uncyslide***************************
* 백괴슬라이드 실행
* 버전 => 1.1.0
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => uncyslide = {"name":"uncyslide","descript":"백괴슬라이드 실행","version":"1.1.0","local":true,"creat":"BANIP","state":"백괴슬라이드/플러그인","executable":true}; 
*/ 
function plugin_uncyslide(){
  if($("[data-name='uncyslide']").length >= 1){
		 // 이부부분에 코드 입력 //
var slideable = plugin_Slideable();
var create = slideable.create;
var execute = slideable.execute;
var dispose = slideable.dispose;

var rankingSystem = plugin_RankingSystem()("백괴슬라이드/랭킹", function(prev,next){ return Number(prev.time) - Number(next.time)});
var outputKeys = {time:"소요시간"};
var startMap = localStorage.getItem("uncySlide/startmap") || 0;
var game = {
    0: {
        center: "아래로 밀어주세요.",
        bottom: 1
    },
    1: {
        center: "오른쪽으로 밀어보세요.",
        right: 2
    },
    2: {
        center: "어디로 밀어보실래요?",
        top: 3,
        bottom: 3,
    },
    3: {
        center: "반갑습니다. <br>백괴슬라이드입니다.",
        bottom: 4,
    },
    4: {
        center: "어디로 당기고 미느냐에 따라, 게임의 결과가 달라집니다.",
        bottom: 5,
    },
    5: {
        center: "는 개뿔 이겜 시스템만든다고 그런 장황한거 만들 정신머리는 없었습니다",
        bottom: 5.1,
    },
    5.1: {
        center: "진심 힘들었습니다.",
        bottom: 5.2,
    },
    5.2: {
        center: "잘했죠?",
        bottom: 5.3,
    },
    5.3: {
        center: "위로 밀어서 칭찬하거나 아래로 밀어서 욕해주세요.",
        top: 5.4,
        bottom: 5.5,
    },
    5.4: {
        center: "감사합니다. 헤헤",
        bottom: 6,
    },
    5.5: {
        center: "흑흑.. 힘들었는데..",
        bottom: 6,
    },
    6: {
        center: "그래도 미디어위키의 틀에서 벗어난 겜인만큼 최대한 나은 경험을 선사하고자 노력했습니다. 잘부탁드립니다.",
        bottom: function(){
            localStorage.setItem("uncySlide/startmap","main");
            execute("main");
        },
    },
    main: {
        center: "<ul><li>아래: 게임시작</li><li>토론: 위</li><li>설명: 오른쪽</li></ul>",
        bottom: function(){ execute("start",{count:100,time:Date.now()}) },
        top: "debate",
        right: "i0",
    },
    i0: {
        center:"가장자리에 화살표 보이죠?",
        bottom:"i1"
    },
    i1: {
        center:"화면을 넘겨서 드래그해서 진행하는 게임이에요.",
        bottom:"i2"
    },
    i2: {
        center:"원래라면 좀 큰 스케일의 게임으로 만들고 싶었는데..",
        bottom:"i3"
    },
    i3: {
        center:"제 역량이 겜 크기에서 다 드러나네요...",
        bottom:"i4"
    },
    i4: {
        center:"아무쪼록 힘들게 만들었으니 재밌게 즐겨주세요.",
        right:"main"
    },
    debate: function(){
        location.href = "https://game.uncyclopedia.kr/wiki/%ED%86%A0%EB%A1%A0:%EB%B0%B1%EA%B4%B4%EC%8A%AC%EB%9D%BC%EC%9D%B4%EB%93%9C";
    },
    start: function(arg){
        function getRandomDirection(){
            switch( Math.ceil(Math.random() * 4) ){
                case 1: return "top"; break;
                case 2: return "bottom"; break;
                case 3: return "left"; break;
                case 4: return "right"; break;
            }
        }
        function getColorCode(count,maxcount){
            var code = "hsl(" + count / maxcount * 360 +",100%,70%)";
            console.log(code);
            return code
        }
        
        var count = arg.count;
        var maxcount = arg.maxcount || count;
        var time = arg.time;
        var $this = $(this);
        var timerInterval;
        var slideableItem = {
            center: function(){
                var $this = $(this);
                $this.css({
                    "background": getColorCode(count,maxcount)
                });
                
                timerInterval = setInterval(function(){
                    var overtime = (Date.now() - time) * 0.001;
                    var printableTime = overtime.toFixed(2);
                    $this.find(".counter").html(printableTime + "초");
                },5)
                
                return "<div class='counter' style='font-size:5vw;'></div><div style='font-size:20vw;'>" + count + "</div>";
            }
        };

        slideableItem[getRandomDirection()] = function(){
            clearInterval(timerInterval);
            if(count === 1) return execute("result",{count:count - 1,time:time,maxcount:maxcount});
            execute("start",{count:count - 1,time:time,maxcount:maxcount}) 
        };

        create(slideableItem);
    },
    result: function(arg){
        var maxcount = arg.maxcount || count;
        var time = ( (Date.now() - arg.time) / 1000 ).toFixed(2);
        var updateParam = {
        	time: time,
        	name: mw.config.get("wgUserName")
        };
        rankingSystem.update(updateParam,function(rankingScore,thisScore){ return rankingScore.time > thisScore.time},outputKeys);

        create({
            center: "갯수: " + maxcount + " <br/>시간: " + time + "<ul><li>왼쪽: 메인으로</li><li>오른쪽: 토론으로</li></ul>",
            left:"main",
            right:"debate",
        });
    }
}
dispose(game, startMap, {});
		
  }

}
$( plugin_uncyslide );
/* uncyslide 끝 */



/** 플러그인 Slideable***************************
* 슬라이드 플러그인 라이브러리
* 버전 => 1.0.0
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => Slideable = {"name":"Slideable","descript":"슬라이드 플러그인 라이브러리","version":"1.0.0","local":true,"creat":"BANIP","state":"사용자:BANIP/플러그인/슬라이드","executable":false}; 
*/ 
function plugin_Slideable(){
  if($("[data-name='Slideable']").length >= 1){
		 // 이부부분에 코드 입력 //
    //모든 키 순회
    function forEach(object, callback) {
        for (var key in object) {
            var variable = object[key];
            callback(variable, key);
        }
    }

function create(directionData) {
    function initClassName($target, data) {
        forEach(data, function(value, direction) {
            $target.find("." + direction).addClass("on");
        })
    }

    function initDOM($target, data) {
        $target[0].data = data;
        $target.find(".center").html(data.center);
        $target.find(".top.on").css("background","url('https://upload.wikimedia.org/wikipedia/commons/8/85/Arrow_top_svg.svg') no-repeat center");
        $target.find(".bottom.on").css("background","url('https://upload.wikimedia.org/wikipedia/commons/f/f2/Arrow_bottom_svg.svg') no-repeat center");
        $target.find(".left.on").css("background","url('https://upload.wikimedia.org/wikipedia/commons/4/40/Arrowleft_svg.svg') no-repeat center");
        $target.find(".right.on").css("background","url('https://upload.wikimedia.org/wikipedia/commons/9/96/Arrow2right_svg.svg') no-repeat center");
    }

    var slideUtil = {
        moveObject: function($this, axis) {
            var x = axis[0], y = axis[1];

            var data = $this[0].data;
            if (!data.right && x > 0) x = 0;
            if (!data.left && x < 0) x = 0;
            if (!data.top && y < 0) y = 0;
            if (!data.bottom && y > 0) y = 0;
            $this.css("transform", "translate(" + x + "px," + y + "px)");
        },
        isHideable: function($this, axis, limit) {
            var x = axis[0], y = axis[1];
            var data = $this[0].data;
            if (data.right && x > limit) return "right";
            if (data.left && x < limit * -1) return "left";
            if (data.bottom && y > limit) return "bottom";
            if (data.top && y < limit * -1) return "top";
        },
        hide: function(direction, $this) {
            function getCss(direction) {
                var css = {
                    opacity: 0.01
                };
                var interval = 50;
                switch (direction) {
                    case "left":
                        css.left = -1 * interval + "vw";
                        break;
                    case "right":
                        css.left = interval + "vw";
                        break;
                    case "bottom":
                        css.top = interval + "vh";
                        break;
                    case "top":
                        css.top = -1 * interval + "vh";
                        break;
                }

                return css;
            }

            var self = $this[0];
            var data = self.data;
            if (self.isHide === true) {
                return;
            }
            self.isHide = true;
            $this.animate(getCss(direction), {
                duration: 300,
                easing: "swing",
                start: data[direction],
                complete: function() {
                    $this.remove();
                }
            });
        }
    }

    function setEvent($target, data) {
        var util = slideUtil;
        var moveLimit = 50;

        $(".slideable").mousedown(function(e) {
            this.isMouseDown = true;
            this.startAxis = [e.clientX, e.clientY];
        })

        $(".slideable").mousemove(function(e) {
            if (this.isMouseDown) {
                event.preventDefault()
                var axis = [e.clientX, e.clientY];
                var startAxis = this.startAxis;
                var moveInterval = [axis[0] - startAxis[0], axis[1] - startAxis[1]]
                util.moveObject($(this), moveInterval);
                var hideDirection = util.isHideable($(this), moveInterval, moveLimit);
                console.log(hideDirection)
                if (hideDirection) util.hide(hideDirection, $(this));
            }
        })

        $(".slideable").mouseup(function(e) {
            this.isMouseDown = false;
        })

        function getTouchEvent(e) {
            return e.originalEvent.touches[0]
        }

        $(".slideable").on("touchstart", function(e) {
            var touch = getTouchEvent(e);

            this.isMouseDown = true;
            this.startAxis = [touch.clientX, touch.clientY];
        })

        $(".slideable").on("touchmove", function(e) {
            event.preventDefault()
            if (this.isMouseDown) {
                event.preventDefault()
                var touch = getTouchEvent(e);
                var axis = [touch.clientX, touch.clientY];
                var startAxis = this.startAxis;
                var moveInterval = [axis[0] - startAxis[0], axis[1] - startAxis[1]]
                util.moveObject($(this), moveInterval);
                var hideDirection = util.isHideable($(this), moveInterval, moveLimit);
                console.log(hideDirection)
                if (hideDirection) util.hide(hideDirection, $(this));
            }
        })

        $(".slideable").on("touchend", function(e) {
            this.isMouseDown = false;
        })

    }

    //슬라이드아이템의 방향키로 숫자 혹은 문자로 지정된 경우
    //함수로 변환
    function setExecutable(target, item){
        forEach(item,function(value,direction){
            new Promise(function(resolve, reject){
                 if(direction === "center"){
                    switch( typeof value ){
                    case "function":
                        resolve( value.bind(target)() );
                    break;
                  }
              } else {
                switch( typeof value ){
                    case "string": case "number":
                        resolve(function(){ execute(value); }.bind(target));
                    break;
                }
              }
            }).then(function(result){
                 item[direction] = result;
            })

        })
    }
    
    var $target = $(".slideable.cloneable").clone().removeClass("cloneable");
    $("body").prepend($target);
    setExecutable($target[0], directionData);
    initClassName($target, directionData);
    initDOM($target, directionData);
    setEvent($target, directionData);
}

// create는 다른 함수들에 의존하지 않음 //
var game;

function execute(number, argument) {
    dispose(game, number, argument);
}

function dispose(slideableArray, start, argument) {
    game = slideableArray;
    
    var slideableItem = slideableArray[start];
    console.log(slideableItem);
    switch (typeof slideableItem) {
        case "function":
            slideableItem(argument);
            break;
        case "object":
            create(slideableItem);
            break;
    }
}

//모바일 전체화면으로 수정
var setFullScreen = (function(){
    //window.scrollTo(0,1);
})();

return {
    create: create,
    execute: execute,
    dispose: dispose
}
		
  }

}
/* Slideable 끝 */


/** 플러그인 uncytick***************************
* 게임 실행용 플러그인
* 버전 => 1.0.0
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => uncytick = {"name":"uncytick","descript":"게임 실행용 플러그인","version":"1.0.0","local":true,"creat":"BANIP","state":"사용자:BANIP/틱택토 live/플러그인","executable":true}; 
*/ 
function plugin_uncytick(){
  if($("[data-name='uncytick']").length >= 1){
		  // 이부분에 코드 입력 //

jQuery.getScript("https://socket-io-chat.now.sh/socket.io/socket.io.js")
.done(function(){
var Socket = /** @class */ (function () {
    function Socket(url, username) {
        if (username === void 0) { username = Math.random().toString(); }
        this.username = username;
        this.socket = io(url);
        this.defineJoin();
        this.bindSocketListener();
    }
    Socket.prototype.defineJoin = function () {
        this.socket.emit("join", { username: this.username });
    };
    Socket.prototype.bindSocketListener = function () {
        var _this = this;
        var socket = this.socket;
        socket.on("newuser", function (_a) {
            var username = _a.username;
            Chat.server(username + "\uB2D8\uC774 \uB4E4\uC5B4\uC654\uC5B4\uC694.");
        });
        socket.on("passuser", function (_a) {
            var username = _a.username;
            Chat.server(username + "\uB2D8\uC774 \uB098\uAC14\uC5B4\uC694.");
        });
        socket.on("getuserlist", function (data) {
            var buttonClickListener = function ($li, username, id) {
                socket.emit("requestjoin", { targetId: id });
                $(".activePull").removeClass();
                $li.addClass("activePull");
                Chat.server(username + "에게 게임신청을 했어요.");
            };
            var $lis = data
                .map(function (userData) {
                if (userData == null)
                    return;
                var username = userData.username, id = userData.id;
                var $li = $("<li />")
                    .text(username)
                    .data("id", id);
                if (username != _this.username) {
                    var $button = $("<button>").text("게임 신청").addClass("btn-request");
                    $button.click(function () { return buttonClickListener($li, username, id); });
                    $li.append($button);
                }
                return $li;
            });
            $("#userlist").html($lis);
        });
        socket.on("servermessage", function (data) {
            Chat.server(data.message);
        });
        socket.on("receivemessage", function (data) {
            Chat.client(data.username, data.message);
        });
        socket.on("gamestart", function (_a) {
            var enemyUsername = _a.enemyUsername;
            var canStartGame = _this.game == undefined || _this.game.isGameEnd == true;
            if (canStartGame) {
                _this.game = new Game(socket, _this.username, enemyUsername);
            }
            else {
                Chat.server(_this.game.enemyUsername + "\uACFC\uC758 \uAC8C\uC784\uC774 \uC544\uC9C1 \uB05D\uB098\uC9C0 \uC54A\uC558\uC5B4\uC694.");
            }
        });
    };
    return Socket;
}());
var Chat = /** @class */ (function () {
    function Chat() {
    }
    Chat.server = function (message) {
        var $li = $("<li></li>").text(message);
        $("#messages").append($li);
        Chat.moveBottom();
    };
    Chat.client = function (username, message) {
        var $li = $("\n            <li>\n                <span class='username' /> : <span class='message'>\n            </li>");
        $li.find(".username").text(username);
        $li.find(".message").text(message);
        $("#messages").append($li);
        Chat.moveBottom();
    };
    Chat.moveBottom = function () {
        $("#messages").scrollTop($("#messages")[0].scrollHeight);
    };
    return Chat;
}());
var Game = /** @class */ (function () {
    function Game(socket, username, ememyusername) {
        this.socket = socket;
        this.isGameEnd = false;
        this.enemyUsername = ememyusername;
        Chat.server(ememyusername + "과의 게임이 시작되었어요!");
        $(".btn-request").fadeOut();
        var bindClick = function ($target, axis) {
            var x = axis[0], y = axis[1];
            $target.text("H").click(function () {
                console.log([x, y]);
                socket.emit("draw", {
                    axis: [x, y]
                });
            });
        };
        $("#gamepan").slideDown().find("> div")
            .each(function (x) {
            $(this).find("> a").each(function (y) { bindClick($(this), [x, y]); });
        });
        this.bindSocketListener();
    }
    Game.prototype.bindSocketListener = function () {
        var socket = this.socket;
        var self = this;
        socket.on("renewgamepan", function (_a) {
            var gamepan = _a.gamepan;
            gamepan.forEach(function (hori, x) {
                return hori.forEach(function (cell, y) {
                    var textType = {
                        "1": "O",
                        "0": "H",
                        "-1": "X",
                    };
                    var text = textType[cell];
                    $("#gamepan").find("div").eq(x).find("a").eq(y)
                        .data("x", x).data("y", y)
                        .text(text);
                    console.log(x, y);
                });
            });
        });
        socket.on("gameend", function (_a) {
            var state = _a.state;
            var hideGamePan = function () { return $("#gamepan").slideUp(); };
            var messageType = {
                "win": "게임 승리!! 축하드려요!",
                "lose": "윽... 져버렸네요...",
                "draw": "비겼어요!",
            };
            var endMessage = messageType[state];
            Chat.server(endMessage);
            $(".btn-request").fadeIn();
            setTimeout(hideGamePan, 3000);
            self.isGameEnd = true;
            self.removesocketListener();
        });
    };
    Game.prototype.removesocketListener = function () {
        $("#gamepan").find("a").off("click");
        this.socket.off("gameend").off("renewgamepan");
    };
    return Game;
}());
var gamehtml = '<div id="gamepan"><div><a></a><a></a><a></a></div><div><a></a><a></a><a></a></div><div><a></a><a></a><a></a></div></div><div class="wrap"><ul id="userlist" class="scrollbox"></ul><ul id="messages" class="scrollbox"></ul><input id="chat" placeholder="메세지를 입력하세요..."/></div>';
$("#gamewindow").html(gamehtml);
var thisSocket = new Socket("https://banip.tk" + "/uncytt",mw.config.values.wgUserName);

$("#chat").keypress(function (e) {
    if (e.key === "Enter" && $(this).val() != "") {
        thisSocket.socket.emit("sendmessage", { message: $(this).val() });
        $(this).val("");
    }
});

});
 // 여기까지 코드 입력 //

		
  }

}
$( plugin_uncytick );
/* uncytick 끝 */


/** 플러그인 showmmd***************************
* threejs 로딩
* 버전 => 1.0.1
* 작성자 : [[사용자:BANIP|BANIP]] 
* JSON => showmmd = {"name":"showmmd","descript":"threejs 로딩","version":"1.0.1","local":true,"creat":"BANIP","state":"낙서장:BANIP/MMD/plugin","executable":true}; 
*/ 
function plugin_showmmd(){
  if($("[data-name='showmmd']").length >= 1){
		 
 // 이부부분에 코드 입력 //
   $(".showmmd").html("<iframe src='https://threejs.org/examples/webgl_loader_mmd.html' style='width:100%;height:100vw;border:none'></iframe>")
 // 여기까지 코드 입력 //

		
  }

}
$( plugin_showmmd );
/* showmmd 끝 */


/** 플러그인 haircut***************************
* 게임 진행에 필요합니다.
* 버전 => 2.0
* 작성자 : [[사용자:Lemminkäinen|Lemminkäinen]] 
* JSON => haircut = {"name":"haircut","descript":"게임 진행에 필요합니다.","version":"2.0","local":true,"creat":"Lemminkäinen","state":"머리 자르기/js","executable":true}; 
*/ 
function plugin_haircut(){
  if($("[data-name='haircut']").length >= 1){
		  // 이부분에 코드 입력 //
/*Elements Load 시작*/
var cut_res_container=document.getElementById("cut_res_container");
var cut_container=document.getElementById("cut_container");
var cut_linehair=document.getElementById("cut_line");
var cuthair=document.getElementById("cuthair");
/*Load 끝*/
var rand=function(r1,r2){
  return Math.floor(Math.random()*r1)+r2;
}
var cut_now=rand(400,600);
var cut_line=rand(200,300);
var cut_initial=cut_now-cut_line;
var cdf=document.getElementById("cut_diff").innerHTML;
var cut_diff=(cdf<=0 || isNaN(cdf) || cdf>2)?(0.5):(Number(cdf));
var cut_speed=cut_now/cut_diff;
var cut_result1=0; var cut_result2=0;
cut_res_container.style.display="none";
cut_container.style.height=cut_now+"px";
cut_linehair.style.height=cut_line+"px";
if(cut_initial<=0) { alert('머리가 너무 짧아 자를 수 없습니다!'); throw("WTF your hair is already short"); }
function cut_again(){
$('#scissors').animate({ top:"100%" },cut_speed,'linear',function(){ $('#scissors').animate({ top:0 },cut_speed,'linear',function(){ cut_again() }); });
}//animate는 자스로 대체하려니 setInterval이나 setTimeout 등으로 해야 하는데 여어어엉 귀찮아서..
cut_again();
function cut_calc(pos){
	if(pos<cut_line){
		cut_rescalc(pos);
		return;
	}
	cut_now=pos;
	cut_speed=cut_now/cut_diff;
	cut_container.style.height=cut_now+"px";
	cuthair.innerHTML=cut_now;
}
function cut_rescalc(pos){
        document.getElementById("cuthair_info").style.display="none";
		cut_container.style.display="none";
		document.getElementById("cut").style.display="none";
		cut_res_container.style.display="block";
		cut_result1=(100*(1-(cut_now-cut_line)/cut_initial));
		cut_result2=(100*(pos/cut_line));
		document.getElementById("cut_result1").innerHTML=cut_result1;
		document.getElementById("cut_result2").innerHTML=cut_result2;
		var cut_stories1=document.getElementsByClassName("cut_story");
		var cut_stories2=document.getElementsByClassName("cuts_story");
		if(cut_result1===0){	cut_stories1[0].style.display="block"; document.getElementById('cuts_story').style.display="none";		}
		else if(cut_result1<90){			cut_stories1[1].style.display="block";		}
		else if(cut_result1<95){			cut_stories1[2].style.display="block";		}
		else if(cut_result1<98){			cut_stories1[3].style.display="block";		}
		else if(cut_result1<=100){			cut_stories1[4].style.display="block";		}
		/* story2 (cut_result2, cuts) */
		if(cut_result2<90){			cut_stories2[0].style.display="block";		}
		else if(cut_result2<95){		cut_stories2[1].style.display="block";		}
		else if(cut_result2<98){		cut_stories2[2].style.display="block";		}
		else if(cut_result2<=100){		cut_stories2[3].style.display="block";		}
}
$('#cut').click(function(){ cut_calc($('#scissors').position().top ); });//addEventListener...그냥 생각하길 관두고
 // 여기까지 코드 입력 //

		
  }

}
$( plugin_haircut );
/* haircut 끝 */

/** 플러그인 RPGinCity***************************
* RPG in City 자바스크립트 동작 제어
* 버전 => 1.2.3.19
* 작성자 : [[사용자:Senouis|Senouis]] 
* JSON => RPGinCity = {"name":"RPGinCity","descript":"RPG in City 자바스크립트 동작 제어","version":"1.2.3.19","local":true,"creat":"Senouis","state":"RPG in City/플러그인","executable":true}; 
*/ 
function plugin_RPGinCity(){
  if($("[data-name='RPGinCity']").length >= 1){
		  // 이부분에 코드 입력 //
function RPGinCity(){
	var usernameStr = mw.user.getName();
	var currentpage = mw.config.get("wgPageName");
	var pagenode = currentpage.split('/');
	console.log("사용자:"+ usernameStr + "/RPG_in_City.json");
	if (pagenode[0] !== "RPG_in_City"){
		if (currentpage !== "사용자:"+ usernameStr + "/RPG_in_City.json") {
			console.log("Current page is "+ currentpage +", not playing RPG in City");
			return;
		}
	}
	var fullbasepagename = "";
	for (var node = 0 ; node < pagenode.length - 2; node++){
		fullbasepagename = fullbasepagename + pagenode[node] + "/";
	}
	fullbasepagename = fullbasepagename + pagenode[pagenode.length - 2];
	console.log(fullbasepagename);
	
	/*
	function RPGinCity_Title() {
		var startbuttondiv = document.getElementById("RPGinCityStart");
		var loadbuttondiv =  document.getElementById("RPGinCityLoad");
		if (startbuttondiv !== null && loadbuttondiv !== null){
			if (usernameStr === null) {
				startbuttondiv.innerHTML = "로그인이 필요합니다";
			} else {
				var UserDBTitle = new mw.Title("사용자:"+usernameStr+"/RPG in City.json");
				startbuttondiv.innerHTML = "시작하기";
				loadbuttondiv.innerHTML = "계속하기";
	
			}
		}
	}
	*/
    /*
	function RPGinCity_GoToCheckpoint () {
		var JSONDatalist = document.getElementsByClassName("mw-json-value");
		if (currentpage === ("사용자:"+usernameStr+"/RPG_in_City.json") && JSONDatalist.length !== 0) {
			var MWContent = document.getElementById("mw-content-text"); 
			var GotoLink= document.createElement("a");
			GotoLink.href = mw.util.getUrl((JSONDatalist[0].innerText.substring(1, JSONDatalist[0].innerText.length-1)));
			console.log(GotoLink.href);
			GotoLink.innerText = "게임 계속하기";
			MWContent.appendChild(GotoLink);
		}
	}
	*/
	function RPGinCity_pushFightInfo(targetUri, Mhp, Ehp, Jam, PJam, BanBomb, Etype, Elevel, Turn) {
		targetUri.extend({mhp:Mhp});
		targetUri.extend({ehp:Ehp});
		targetUri.extend({j:Jam});
		targetUri.extend({bj:PJam});
		targetUri.extend({bb:BanBomb});
		targetUri.extend({etype:Etype});
		targetUri.extend({elevel:Elevel});
		targetUri.extend({turn:Turn});
		return targetUri;
	}
	
	function RPGinCity_HandleBattle(jsonfile) {
		var Battlelink = new mw.Uri(window.location.href);
		console.log("building battle phase...");
		var queryparams = Battlelink.query;
		// 이제 필요한 값을 구해 화면에 표시한다.
		// 플레이어 체력부터...
		var mhp = 0;
		var playerhealth = document.getElementById("RPGinCity-playerhealth");
		if (isNaN(queryparams.mhp)) {
			mhp = jsonfile.체력;
		} else {
			mhp = queryparams.mhp; // mhp는 이전 문서의 값을 받는다.
		}
		playerhealth.innerText = mhp;
		//적의 레벨
		var enemylevel = document.getElementById("RPGinCity-enemylevel");
		enemylevel.innerText = queryparams.elevel; // elevel는 항상 undefined이 아니다.
		//적의 체력
		var enemyhealth = document.getElementById("RPGinCity-enemyhealth");
		enemyhealth.innerText = queryparams.ehp; // ep는 항상 undefined이 아니다.
		//공격 페이즈
		var nextPhaseUri = new mw.Uri("https://liberty.banipest.com/index.php?title="+currentpage);
        console.log("nextPhaseUri is "+nextPhaseUri);
		var attackEnemy = document.getElementById("RPGinCity-attackEnemy");
		var attackPower = Math.round(Math.random() * jsonfile.레벨*3) + jsonfile.무기;
		var attackEnemyUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), mhp, (queryparams.ehp - attackPower) >= 0?queryparams.ehp - attackPower : 0, queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 2);
        console.log(attackEnemyUri.toString());
		if (attackEnemy !== undefined && attackEnemy !== null){
            var attackEnemyLink = document.createElement("a");
            attackEnemyLink.href = attackEnemyUri.toString();
            attackEnemyLink.innerHTML="그냥 공격!";
            attackEnemy.appendChild(attackEnemyLink);
        }
		var useJam = document.getElementById("RPGinCity-useJam");
		var useJamUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), jsonfile.체력, queryparams.ehp, queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 2);
		if (useJam !== undefined && useJam !== null) {
            var useJamLink = document.createElement("a");
            useJamLink.href = useJamUri.toString();
            useJamLink.innerHTML="잼으로 회복!";
            useJam.appendChild(useJamLink);
        }
		var usePJ = document.getElementById("RPGinCity-usePJ");
		var usePJUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), mhp, queryparams.ehp > 20 ? queryparams.ehp - 20 : 0, queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 2);
		if (usePJ !== undefined && usePJ !== null) {
            var usePJLink = document.createElement("a");
            usePJLink.href = usePJUri.toString();
            usePJLink.innerHTML="배쨈 열기!";
            usePJ.appendChild(usePJLink);
        }
		var useBanbomb = document.getElementById("RPGinCity-useBanbomb");
		var useBanbombUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), mhp, queryparams.ehp/2, queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 2);
		if (useBanbomb !== undefined && useBanbomb !== null) {
            var useBanbombLink = document.createElement("a");
            useBanbombLink.href = useBanbombUri.toString();
            useBanbombLink.innerHTML="차단폭탄!";
            useBanbomb.appendChild(useBanbombLink);
        }
		//방어 페이즈
		var Blocking = document.getElementById("RPGinCity-Block");
		var BlockingUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), mhp- Math.round(Math.random() * queryparams.elevel * 0.75), queryparams.ehp , queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 1);
		if (Blocking !== undefined && Blocking !== null) {
            var BlockingLink = document.createElement("a");
            BlockingLink.href = BlockingUri.toString();
            BlockingLink.innerHTML="방어";
            Blocking.appendChild(BlockingLink);
        }
		var FailRunning = document.getElementById("RPGinCity-FailRunning");
		var FailRunningUri = RPGinCity_pushFightInfo(nextPhaseUri.clone(), mhp - Math.round(Math.random() * queryparams.elevel), queryparams.ehp, queryparams.j, queryparams.bj, queryparams.bb, queryparams.etype, queryparams.elevel, 1);
        console.log(FailRunningUri.toString());
		if (FailRunning !== undefined && FailRunning !== null) {
            var FailRunningLink = document.createElement("a");
            FailRunningLink.href = FailRunningUri.toString();
            FailRunningLink.innerHTML="도망치자!";
            FailRunning.appendChild(FailRunningLink);
        }
		var RunFromEnemy = document.getElementById("RPGinCity-RunFromEnemy");
		var MustKill = document.getElementById("mustKill");
		if (RunFromEnemy !== undefined && RunFromEnemy !== null && (MustKill === undefined || MustKill === null))RunFromEnemy.style.visibility = "visible";
	}
	
	function RPGinCity_SaveHandle(saveGameHandle) {
		var api = new mw.Api();
		var Templink = new mw.Uri(window.location.href);
		var queryparams = Templink.query;
		switch (saveGameHandle.innerText){
			case "서브퀘스트완료":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.추가1 = 0;
                    jsondata.경험치 = jsondata.경험치 + 100;
					jsondata.최근페이지 = fullbasepagename;
					return {text: JSON.stringify(jsondata), summary: "서브퀘스트완료"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "서브퀘스트수행":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					var questID = document.getElementById("RPGinCity-questID");
					if (questID !== undefined && questID !== null){
						jsondata.추가1 = parseInt(questID.innerText);
						jsondata.최근페이지 = fullbasepagename;
					}
					return {text: JSON.stringify(jsondata), summary: "서브퀘스트수행"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "메인퀘스트수행":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					var mainQuestPoint = document.getElementById("mainQuestPoint");
					if (mainQuestPoint !== undefined && mainQuestPoint !== null) jsondata.최근페이지 = mainQuestPoint.innerText;
					var questID = document.getElementById("questID");
					if (questID !== undefined && questID !== null)jsondata.추가2 = parseInt(questID.innerText);
					return {text: JSON.stringify(jsondata), summary: "메인퀘스트수행"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "동부요금지불":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.돈 -= 500*1;
					jsondata.추가2 = 5*1; // force to parse it a number
					jsondata.최근페이지 = "RPG in City/만남의 광장";
					return {text: JSON.stringify(jsondata), summary: "동부요금지불"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "전투승리":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.체력 = parseInt(queryparams.mhp);
					jsondata.경험치 += queryparams.elevel*4;
					jsondata.돈 += queryparams.elevel*5;
					jsondata.최근페이지 = currentpage.substring(0, currentpage.length-3);
					return {text: JSON.stringify(jsondata), summary: "전투승리"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "레벨업":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.레벨 += (jsondata.경험치 - jsondata.경험치 % 128)/128;
					jsondata.경험치 = jsondata.경험치 % 128;
					return {text: JSON.stringify(jsondata), summary: "레벨업"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    if (currentpage !== "RPG in City/레벨 업")document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "회복":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.체력 = jsondata.레벨 * 16;
					return {text: JSON.stringify(jsondata), summary: "회복"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			case "결제":
				new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
					var jsondata = JSON.parse(revision.content);
					jsondata.잼 += queryparams.j*1;
					jsondata.배쨈 += queryparams.bj*1;
					jsondata.차단폭탄 += queryparams.bb*1;
					jsondata.무기 += queryparams.weapon*1;
					jsondata.돈 -= 50* queryparams.j + 75*queryparams.bj + 150*queryparams.bb + 1000 * queryparams.weapon;
					jsondata.최근페이지 = currentpage.substring(0, currentpage.length-3);
					return {text: JSON.stringify(jsondata), summary: "결제"};
				}
				).then(function () {
				    alert( 'Saved!' );
				    document.getElementById("RPGinCity-searchphase").style.display = "block";
				});
				break;
			default:
				    alert( 'No proper parameters' );
				break;
		}
	}
	
	function RPGinCity_HandleStore(jsondata, storeNumber) {
		var i = storeNumber;
		var Jam = document.getElementsByClassName("RPGinCity-JamAmount")[i];
		if (Jam !== undefined && Jam !== null && Jam.innerText === "") Jam.innerText = "0";
		var PearJam = document.getElementsByClassName("RPGinCity-PearJamAmount")[i];
		if (PearJam !== undefined && PearJam !== null && PearJam.innerText === "") PearJam.innerText = "0";
		var BB = document.getElementsByClassName("RPGinCity-BanBombAmount")[i];
		if (BB !== undefined && BB !== null && BB.innerText === "") BB.innerText = "0";
		var WeaponLevelUp = document.getElementsByClassName("RPGinCity-WeaponLevelUp")[i];
		if (WeaponLevelUp !== undefined && WeaponLevelUp !== null && WeaponLevelUp.innerText === "") WeaponLevelUp.innerText = "0";
		var BuyButton = document.getElementsByClassName("RPGinCity-BuyButton")[i];
		if (BuyButton !== undefined && BuyButton !== null) {
			if (50 * parseInt(Jam.innerText) + 75 * parseInt(PearJam.innerText) + 150* parseInt(BB.innerText) + 1000*parseInt(WeaponLevelUp.innerText) > jsondata.돈) {
				BuyButton.innerText = "돈이 부족하다. 나가서 돈을 구해오자.";
			}
			BuyButton.style.visibility = "visible";
		}
	}
	
	function RPGinCity_Callback_fetchUserInformation(jsonfile) {
		// 정보 틀 관련
		var playerinfo = document.getElementsByClassName("RPGinCity-Playerinfo");
		var LevelUpButton = document.getElementById("RPGinCity-LevelUp");
		if ( playerinfo !== undefined && playerinfo !== null && playerinfo.length > 0)  {
			playerinfo[0].innerText = jsonfile['레벨'];
			playerinfo[1].innerText = jsonfile['체력'];
			playerinfo[2].innerText = jsonfile['경험치'];
			playerinfo[3].innerText = jsonfile['잼'];
			playerinfo[4].innerText = jsonfile['배쨈'];
			playerinfo[5].innerText = jsonfile['차단폭탄'];
			playerinfo[6].innerText = jsonfile['돈'];
			playerinfo[7].innerText = jsonfile['무기'];
			if (LevelUpButton !== undefined && LevelUpButton !== null && jsonfile.경험치 > 128 && jsonfile.레벨 + jsonfile.경험치 /128 <= 50) {
                var levelup = document.createElement("a");
                levelup.href = "https://liberty.banipest.com/index.php?title=RPG_in_City/레벨_업&lastgamepage=" + currentpage;
                levelup.innerHTML = "레벨업하기";
				LevelUpButton.appendChild(levelup);
			}
		}
		// RPG in City/집 쉬기 기능
		var RestingInHouse = document.getElementById("RPGinCity-House");
		if (RestingInHouse !== undefined && RestingInHouse != null) {
			if (jsonfile.체력 < jsonfile.레벨 * 16){
                document.getElementById("RPGinCity-needRest").innerHTML = "너는 한숨 자고 개운한 마음으로 이곳을 나가려고 한다.\n";
                var resting = document.createElement("a");
                resting.href = "https://liberty.banipest.com/index.php/"+currentpage+"/회복";
                resting.innerHTML = "\n쉬기";
				RestingInHouse.appendChild(resting);
			} else {
                RestingInHouse.innerHTML = "너는 몸 상태가 좋아 여기에 머물지 않기로 결정했다.";
            }
			RestingInHouse.style.visibility = "visible";
		}
		// RPG in City 전투 관련 스크립트
		var inBattle = document.getElementById("RPGinCity-Fight");
		if (inBattle !== undefined && inBattle !== null){ 
			RPGinCity_HandleBattle(jsonfile);
		} // 전투 틀 처리 완료
		// 일반적인 상점(문서 내에 단 한 개 존재) 처리
		var storeHandle = document.getElementById("RiCStore");
		if (storeHandle !== undefined && storeHandle !== null){
			RPGinCity_HandleStore(jsonfile, 0);
		}
		//동부2구역구 - 중부구역구 이동 가능 여부 처리
		var DowntownRoadOpen = document.getElementById("DowntownRoad");
		if (DowntownRoadOpen !== undefined && DowntownRoadOpen !== null) {
			if (jsonfile.추가2 < 60) {
				DowntownRoadOpen.innerText = "이런!!! 다운타운 로드는 반달로 인해 막혀있다.";
			}
			DowntownRoadOpen.style.visibility = "visible";
		}
		//남부 1구역구 메인퀘스트
		var south1st = document.getElementById("south1st");
		if (south1st !== undefined && south1st !== null) {
			var displaypart;
			if (jsonfile.추가2 < 10){
				displaypart = document.getElementById("beforeBossfight");
				displaypart.style.display = "block";
			} else {
				displaypart = document.getElementById("afterBossfight");
				displaypart.style.display = "block";
			}
		}
		//중부구역구
		var toWest = document.getElementById("toWest");
		if (toWest !== undefined && toWest !== null) {
			if (jsonfile.추가2 < 25) {
				toWest.innerText = "서부 구역구 방향으로 가기 - <중부 구역구가 파괴된 시점에서 서부 구역구를 분리하는 장벽은 강력한 반달러들로 인해 봉쇄 상태를 유지하고 있다>";
			}
			toWest.style.visibility = "visible";
		}
		var toCentralOffice = document.getElementById("toCentralOffice");
		if (toCentralOffice !== undefined && toCentralOffice !== null) {
			if (jsonfile.추가2 < 40) {
				toCentralOffice.innerText = "시청으로 들어가기 - < 시청에 들어갈 방법을 찾아야 한다 >";
			}
			toCentralOffice.style.visibility = "visible";
		}
		var peacefulCentral = document.getElementById("peacefulCentral");
		var dangerousCentral = document.getElementById("dangerousCentral");
		if (peacefulCentral !== undefined && peacefulCentral !== null && dangerousCentral !== undefined && dangerousCentral !== null) {
			if (jsonfile.추가2 >= 70) {
				peacefulCentral.style.visibility = "visible";
			} else {
				dangerousCentral.style.visibility = "visible";
			}
		}
		// 중부 구역구 대피소 퀘스트
		var rescuePeregirl = document.getElementsByClassName("rescuePeregirl");
		if (rescuePeregirl !== undefined && rescuePeregirl !== null && rescuePeregirl.length > 0) {
			if (jsonfile.추가2 < 15) {
				rescuePeregirl[1].remove();
				rescuePeregirl[0].style.display = "block";
			} else if (jsonfile.추가2 === 20) {
				rescuePeregirl[0].remove();
				rescuePeregirl[0].style.display = "block";
			} else {
				rescuePeregirl[0].remove();
				rescuePeregirl[0].remove();
				rescuePeregirl[0].style.display = "block";
			}
		}
		var meetPeregirl = document.getElementsByClassName("meetPeregirl");
		if (meetPeregirl !== undefined && meetPeregirl !== null && meetPeregirl.length > 0) {
			if (jsonfile.추가2 < 20) {
				meetPeregirl[0].style.display = "block";
			} else {
				meetPeregirl[0].remove();
				meetPeregirl[0].style.display = "block";
			}
		}
		//남부 1구역구 상점, 문서 구조상 좀 구현이 복잡하여 분리한다.
		var south1stStore = document.getElementsByClassName("south1stStore");
		if (south1stStore !== undefined && south1stStore !== null && south1stStore.length > 0) {
			if (jsonfile.추가2 < 10) {
				south1stStore[0].style.display = "block";
				RPGinCity_HandleStore(jsonfile, 0);
			} else {
				south1stStore[1].style.display = "block";
				RPGinCity_HandleStore(jsonfile, 1);
			}
		}
		//시청 안의 산토끼 몰매 맞고 가나요~
		var cityOffice = document.getElementsByClassName("cityOffice");
		if (cityOffice !== undefined && cityOffice !== null && cityOffice.length > 0) {
			if (jsonfile.추가2 < 70) {
				cityOffice[0].style.display = "block";
			} else {
				cityOffice[1].style.display = "block";
			}
		}
		var cityOfficeInternal = document.getElementsByClassName("cityOfficeInternal");
		if (cityOfficeInternal !== undefined && cityOfficeInternal !== null && cityOfficeInternal.length > 0) {
			if (jsonfile.추가2 >= 65) {
				cityOfficeInternal[0].style.display = "block";
			} else {
				cityOfficeInternal[1].style.display = "block";
			}
		}
		var cityOffice3F = document.getElementsByClassName("cityOffice3F");
		if (cityOffice3F !== undefined && cityOffice3F !== null && cityOffice3F.length > 0) {
			if (jsonfile.추가2 >= 65) {
				cityOffice3F[0].style.display = "block";
			} else {
				cityOffice3F[1].style.display = "block";
			}
		}
		var mayorRoom = document.getElementsByClassName("mayorRoom");
		if (mayorRoom !== undefined && mayorRoom !== null && mayorRoom.length > 0) {
			if (jsonfile.추가2 >= 70) {
				mayorRoom[0].style.display = "block";
			} else {
				mayorRoom[1].style.display = "block";
			}
		}
		// 서브 퀘스트 관련
		var subQuestContent = document.getElementById("SubQuestContent");
		var parentNode;
		if (subQuestContent !== undefined && subQuestContent !== null){
			parentNode = subQuestContent.parentElement;
		}
		if (parentNode !== undefined && parentNode !== null && subQuestContent !== undefined && subQuestContent !== null) {
			if (jsonfile.추가1 !== 0) {
				parentNode.removeChild( subQuestContent );
			} else {
				subQuestContent.style.display = "block";
			}
		}
		var subQuestEnd = document.getElementById("SubQuestEnd");
		if (parentNode !== undefined && parentNode !== null &&subQuestEnd !== undefined && subQuestEnd !== null) {
			if (jsonfile.추가1 !== 1) {
				parentNode.removeChild( subQuestEnd );
			} else {
				subQuestEnd.style.display = "block";
			}
		}
		var subQuestNotEnd = document.getElementsByClassName("SubQuestNotEnd");
		if (parentNode !== undefined && parentNode !== null && subQuestNotEnd !== undefined && subQuestNotEnd !== null) {
			if (jsonfile.추가1 < 2) {
				parentNode.removeChild( subQuestNotEnd[0] );
			} else {
				subQuestNotEnd[0].style.display = "block";
			}
		}
		// 자동 세이브 처리 - 가장 마지막에 와야 하는 것
		var saveGameHandle = document.getElementById("RPGinCity-saveGame");
		if (saveGameHandle !== undefined && saveGameHandle !== null) {
			console.log("Saving...");
			RPGinCity_SaveHandle(saveGameHandle);
		}
	}
	
	
	// ----------------------------------------------------Main------------------------------------------------------------
	
	// RPGinCity_Title();
	
	// if (currentpage === "사용자:"+usernameStr+"/RPG_in_City.json"){
	// 	RPGinCity_GoToCheckpoint();
	// }
	// else if (currentpage.substring(0,11) === "RPG_in_City") { // in game but not in title screen
		var api = new mw.Api();
		console.log("fetching player info...");
		fetch("https://liberty.banipest.com/index.php?title="+"사용자:"+usernameStr+"/RPG_in_City.json"+"&action=raw")
			.then(function(response) {
				if (!response.ok) {
			        // make the promise be rejected if we didn't get a 2xx response
			        throw new Error("Not 2xx response", {cause: response});
			    }
				return response.json();
			})
			.then(function(response) {
				var parsedata = response;
				RPGinCity_Callback_fetchUserInformation(parsedata);
			}
			)
			.catch(function(e){
				console.log(e);
				document.getElementById("RPGinCityLoad").style.display = "none";
			});
	// }
}
$(RPGinCity);
 // 여기까지 코드 입력 //

		
  }

}
$( plugin_RPGinCity );
/* RPGinCity 끝 */