사용자:이의섭/common.js: 두 판 사이의 차이

리버티게임, 모두가 만들어가는 자유로운 게임
백괴게임>이의섭
(플러그인 UncyBeat설치)
 
백괴게임>이의섭
(플러그인 UncyBeat설치)
451번째 줄: 451번째 줄:
$( plugin_inputform );
$( plugin_inputform );
/* inputform 끝 */
/* inputform 끝 */




/** 플러그인 UncyBeat***************************
/** 플러그인 UncyBeat***************************
* UncyBeat
* 버그 수정
* 버전 => 0.0.6
* 버전 => 1.02
* 작성자 : [[사용자:Bd3076|Bd3076]]  
* 작성자 : [[사용자:Bd3076|Bd3076]]  
* JSON => UncyBeat = {"name":"UncyBeat","descript":"UncyBeat","version":"0.0.6","local":true,"creat":"Bd3076","state":"UncyBeat/plugin","executable":true};  
* JSON => UncyBeat = {"name":"UncyBeat","descript":"버그 수정","version":"1.02","local":true,"creat":"Bd3076","state":"UncyBeat/plugin","executable":true};  
*/  
*/  
function plugin_UncyBeat(){
function plugin_UncyBeat(){
486번째 줄: 489번째 줄:
     }
     }
};
};
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');
var cvs = document.getElementById('spanArea');
526번째 줄: 577번째 줄:
   setTimeout(levelEnd, 3000);
   setTimeout(levelEnd, 3000);
   };
   };
   console.log("can i use this music?");
   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(){
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 x = 2;
var noteTimer = new Array(5);
var y = 2;
for(var i=0; i<5; i++){
var color = 0;
  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(){
function showCursor(){
for(var i=0; i<5; i++){
for(var i=0; i<5; i++){
   for(var j=0; j<5; j++){
   for(var j=0; j<5; j++){
      ctx.fillStyle = color==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){
       if(i==x && j==y){
         ctx.strokeStyle = color==0?"red":"blue";
         ctx.strokeStyle = color==0?"red":"blue";
551번째 줄: 638번째 줄:
}
}


function makeNotes(){
function perfect_(x, y){
   setInterval(showCursor, 30);
  perfect++;
  noteTimer[x][y] = -400;
}
 
function good_(x, y){
   good++;
  noteTimer[x][y] = -400;
}
 
function miss_(x, y){
  miss++;
}
}


572번째 줄: 669번째 줄:
     }
     }
     console.log(x + "and" + y);
     console.log(x + "and" + y);
    var point = Math.abs(noteTimer[x][y]);
    if(point <= 20){
      perfect_(x, y);
    }
    else if(point <= 40 || noteTimer[x][y] > 20){
      good_(x, y);
    }
   }
   }
   else if(ek==32){
   else if(ek==32){
579번째 줄: 683번째 줄:


window.addEventListener("keydown", onKeyDown, false);
window.addEventListener("keydown", onKeyDown, false);
// window.addEventListener("keyup", onKeyUp, 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(){
function playGame(){
   makeGameArea();
   makeGameArea();
  setInterval(showCursor, 30);
   setTimeout(playGameMusic, 3000);
   setTimeout(playGameMusic, 3000);
   makeNotes();
   setInit();
  playNotes();
}
}



2018년 7월 27일 (금) 20:29 판

/** 플러그인 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 끝 */

/** 플러그인 Cirno***************************
* 실험실
* 버전 => 초회판
* 작성자 : 이의섭
* JSON => Cirno = {"name":"Cirno","descript":"실험실","version":"초회판","local":true,"creat":"이의섭","state":"사용자:이의섭/놀이터","executable":true}; 
*/ 
function plugin_Cirno(){
  if($("[data-name='Cirno']").length >= 1){
		  // 이부분에 코드 입력 //
if(documentTitle === "사용자:이의섭/놀이터"){
    
$(function() {

  var messageSpace = document.getElementById("message");
  var battleSpace = document.getElementById("battle");
  var hpSpace = document.getElementById("hpbar");

  battleSpace.innerHTML = '<canvas id="cvs" width="150" height="150">게임 화면입니다. 만약 이 화면이 정상적으로 출력되지 않는다면 망한 겁니다.</canvas>';

  var canvasBody = document.getElementById("cvs");
  var canvas = canvasBody.getContext("2d");

  var sheet = document.createElement('style');
  sheet.innerHTML = "canvas {border: 10px solid white;}";
  document.body.appendChild(sheet);


  var x, y, size, speed;
  x = 800;
  y = 600;
  size = 10;
  speed = 5;

  function drawHeart() {
    canvas.fillStyle = "red";
    canvas.beginPath();
    canvas.moveTo(x - size, y);
    canvas.lineTo(x - size, y - size/2);
    canvas.lineTo(x - (size / 2), y - size);
    canvas.lineTo(x, y - size/2);
    canvas.lineTo(x + (size / 2), y - size);
    canvas.lineTo(x + size, y - size/2);
    canvas.lineTo(x + size, y);
    canvas.lineTo(x, y + size);
    canvas.lineTo(x - size, y);
    canvas.fill();
    canvas.closePath();
  }
	
  var isKeyDown = [];
  
  function onKeyDown(e){
  	isKeyDown[e.keyCode] = true;
    console.log("Down " + e.keyCode);
  }
  
  function onKeyUp(e){
  	isKeyDown[e.keyCode] = false;
    console.log("Up " + e.keyCode);
  }
  
  function moveHeart(){
  	if(isKeyDown[37]){
    	x  = Math.max(x-speed, 10);
    }
    if(isKeyDown[38]){
    	y  = Math.max(y-speed, 10);
    }
    if(isKeyDown[39]){
    	x  = Math.min(x+speed, 140);
    }
    if(isKeyDown[40]){
    	y  = Math.min(y+speed, 140);
    }
  }
  
  window.addEventListener("keydown",onKeyDown,false);
	window.addEventListener("keyup",onKeyUp,false);
  
  setInterval(moveHeart, 30);
  
  var type_speed = 100;


  var stringToType = text1;
  var i = 0;

  function switchString() {
    if (stringToType === text1) stringToType = text2;
    else if (stringToType === text2) stringToType = text3;
    else if (stringToType === text3) stringToType = text4;
    else if (stringToType === text4) stringToType = text5;
    else if (stringToType === text5) stringToType = text6;
    else if (stringToType === text6) stringToType = text7;
    else if (stringToType === text7) stringToType = text8;
    else if (stringToType === text8) stringToType = text9;
    else if (stringToType === text9){
    	generateBullets();
      return;
    }

    else if (stringToType === text10) stringToType = text11;
    else if (stringToType === text11){
    	generateBullets();
      return;
    }

    else if (stringToType === text12){
    	messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ' + text13;
    	generateBullets();
      return;
    }

    else if (stringToType === text14) stringToType = text15;
    else if (stringToType === text15) stringToType = text30;

    else if (stringToType === text21) stringToType = text22;
    else if (stringToType === text22) stringToType = text23;
    else if (stringToType === text23) stringToType = text30;

    else{
    	generateUltraBullets();
      return;
    }
  	messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';

    typeMessage();
  }
	
  messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';
  
  function typeMessage() {
    if (i == stringToType.length) {
      setTimeout(switchString, 1000);
      i=0;
      return;
    } else {
      messageSpace.innerHTML += stringToType[i];
      setTimeout(typeMessage, type_speed);
      i++;
    }
  }
  
  var haveToGenerateBullet = 0;
  var bulletY;
  var hp=20;
  
  function generateBullets(){
  	haveToGenerateBullet = 1;
    bulletY = -10;
    setTimeout(cancelGenerateBullets, 3000);
  }
  
  function cancelGenerateBullets(){
  	haveToGenerateBullet = 0;
  	if(hp == 20){
    	if(stringToType === text9){
      	stringToType = text10;
        i=0;
				messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';
        typeMessage();
        return;
      }
    	if(stringToType === text11){
      	stringToType = text12;
        i=0;
				messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';
        typeMessage();
        return;
      }
    	if(stringToType === text12){
      	stringToType = text14;
        i=0;
				messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';
        typeMessage();
        return;
      }
    }
  }
  
  function drawBullet(){
  	for(i=30; i<=120; i+=30){
    	canvas.beginPath();
    	canvas.arc(i, bulletY, 4, 0, Math.PI*2);
      canvas.fillStyle = "white";
      canvas.fill();
      
      if((i-x)*(i-x)+(bulletY-y)*(bulletY-y)<size*size){
      	console.log("collide");
        stringToType = text21;
        typeSpeed = 300;
        i=0;
				messageSpace.innerHTML = '<span style="color:yellow">플라위</span>: ';
        hp -= 19;
      	cancelGenerateBullets();
        typeMessage();
        return;
			}
      
    }
    bulletY += 1.6;
  }
	
	function changeHPbar(){
  	hpSpace.innerHTML = "LV 1 | HP "+hp+"/20";
  }
	
  var haveToGenerateUltraBullet;
  
  function generateUltraBullets(){
  	haveToGenerateUltraBullet = 1;
    bulletY = -10;
  }
  
  function drawUltraBullet(){
  	for(i=10; i<=140; i+=10){
    	canvas.beginPath();
    	canvas.arc(i, bulletY, 4, 0, Math.PI*2);
      canvas.fillStyle = "white";
      canvas.fill();
      
      if((i-x)*(i-x)+(bulletY-y)*(bulletY-y)<size*size){
      	console.log("collide");
      	haveToGenerateUltraBullet = 0;
        hp = 20;
        messageSpace.innerHTML = '<a href="https://game.uncyclopedia.kr/wiki/Cirno: The Challenge/폐허/입구2/토리엘">계속하기</a>';
        return;
			}
      
    }
    bulletY += 1.6;
  }
  
  function drawCanvas(){
  	canvas.clearRect(0, 0, 150, 150);
  	
  	drawHeart();
    if(haveToGenerateBullet === 1) drawBullet();
    if(haveToGenerateUltraBullet === 1) drawUltraBullet();
  }
  
	setInterval(drawCanvas, 30);
  setInterval(changeHPbar);
  
  typeMessage();
});

}

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

		
  }

}
$( plugin_Cirno )


/** 플러그인 inputform***************************
* 완전한 입력기를 구현합니다.
* 버전 => 1.3
* 작성자 : [[사용자:Gustmd7410|Gustmd7410]] 
* JSON => inputform = {"name":"inputform","descript":"완전한 입력기를 구현합니다.","version":"1.3","local":false,"creat":"Gustmd7410","state":"틀:입력 상자/플러그인","executable":true}; 
*/ 
function plugin_inputform(){
		  // 이부분에 코드 입력 //
function parseQuery(param) {
	return JSON.parse('{' + decodeURI(param.replace('?', '').replace(/([-~!*.:/'()%+\w]+)=([-~!*.:/'()%+\w]*)/g, '"$1": "$2"').replace(/&/g, ', ')) + '}');
}

mw.loader.using('oojs-ui-core').done(function() {
	function toBool(value) {
	    switch(value) {
	        case undefined: return false;
	        case '': return true;
	    }
	}
	
	function toArray(value) {
	    if(value) return value.split(' ');
	    else return undefined;
	}
	
	$('.input-form').each(function() {
	    var container = this;
	    $(this).html(new $('<form />', {
	        class: $(container).data('class'),
	        id: $(container).data('id'),
	        style: $(container).data('style'),
	        'accept-charset': 'UTF-8',
	        action: '/w/index.php',
	        method: 'GET',
	        autocomplete: toBool($(container).data('autocomplete')),
	        novalidate: toBool($(container).data('novalidate')),
	        html: $(container).html()
	    })[0].outerHTML);
	    
	    var before = (toBool($(this).data('pass'))) ? parseQuery(location.search) : undefined;
	    var urlget = ($(this).data('get')) ? parseQuery($(this).data('get')) : undefined;
	    var page = new URL('?title=' + $(this).data('title'), $(this).find('form')[0].action);
	    var title = (parseQuery(page.search).title) ? parseQuery(page.search) : undefined;
	    var qdata = $.extend({}, before, urlget, title);
	    if(page.hash) $(this).find('form')[0].action += page.hash.replace(/%/g, '.');
	    for(var key in qdata) {
	    	$(container).find('form').prepend($('<input />', {
	    		type: 'hidden',
	    		name: key,
	    		value: qdata[key]
	    	})[0].outerHTML);
	    }
	});
	
	$('.input-field').each(function() {
	    var container = this;
	    function validate() {
	    	if($(container).data('validatetype') == 'RegExp') {
	    		var value = $(container).data('validate').substr(1).split('/');
	    		return RegExp(value[0], value[1]);
	    	} else return $(container).data('validate');
	    }
	    
        $(this).html(new OO.ui.TextInputWidget({
            accessKey: $(container).data('accessKey'),
            autocomplete: toBool($(container).data('autocomplete')),
            autofocus: toBool($(container).data('autofocus')),
            classes: toArray($(container).data('classes')),
            disabled: toBool($(container).data('disabled')),
            flags: toArray($(container).data('flags')),
            icon: $(container).data('icon'),
            iconTitle: $(container).data('iconTitle'),
            id: $(container).data('id'),
            indicator: $(container).data('indicator'),
            indicatorTitle: $(container).data('indicatorTitle'),
            inputId: $(container).data('inputId'),
            maxLength: Number($(container).data('maxLength')),
            name: $(container).data('name'),
            placeholder: $(container).data('placeholder'),
            readOnly: toBool($(container).data('readOnly')),
            required: toBool($(container).data('required')),
            spellcheck: toBool($(container).data('spellcheck')),
            tabIndex: Number($(container).data('tabIndex')),
            text: $(container).data('text'),
            title: $(container).data('title'),
            type: $(container).data('type'),
            validate: validate(),
            value: $(container).data('value')
        }).$element);
        $(this).find('*').css({
        	display: 'inline',
        	width: 'auto'
        });
	});
	
	$('.input-button').each(function() {
	    var container = this;
        $(container).html(new OO.ui.ButtonInputWidget({
            accessKey: $(container).data('accessKey'),
            classes: toArray($(container).data('classes')),
            disabled: toBool($(container).data('disabled')),
            flags: toArray($(container).data('flags')),
            framed: toBool($(container).data('framed')),
            icon: $(container).data('icon'),
            iconTitle: $(container).data('iconTitle'),
            id: $(container).data('id'),
            indicator: $(container).data('indicator'),
            indicatorTitle: $(container).data('indicatorTitle'),
            inputId: $(container).data('inputId'),
            label: $(container).data('label'),
            name: $(container).data('name'),
            tabIndex: Number($(container).data('tabIndex')),
            text: $(container).data('text'),
            title: $(container).data('title'),
            type: $(container).data('type'),
            value: $(container).data('value')
        }).$element);
        $(this).find('*').css({
        	display: 'inline'
        });
	});
	
	noPlugin('input');
});
 // 여기까지 코드 입력 //

		
}
$( plugin_inputform );
/* inputform 끝 */





/** 플러그인 UncyBeat***************************
* 버그 수정
* 버전 => 1.02
* 작성자 : [[사용자:Bd3076|Bd3076]] 
* JSON => UncyBeat = {"name":"UncyBeat","descript":"버그 수정","version":"1.02","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 = color==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){
      perfect_(x, y);
    }
    else if(point <= 40 || noteTimer[x][y] > 20){
      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 끝 */