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

리버티게임, 모두가 만들어가는 자유로운 게임
imported>Regurus
(새 문서: // 이부분에 코드 입력 // mw.loader.using('oojs-ui-widgets').done(function() { function prepare() { function responsible(event) { var button = $('#input-time .oo-ui-numb...)
 
(플러그인 haircut설치)
 
(사용자 2명의 중간 판 5개는 보이지 않습니다)
1번째 줄: 1번째 줄:
// 이부분에 코드 입력 //
 
mw.loader.using('oojs-ui-widgets').done(function() {
 
function prepare() {
/** 플러그인 RPGinCity***************************
function responsible(event) {
* RPG in City 자바스크립트 동작 제어
var button = $('#input-time .oo-ui-numberInputWidget-plusButton, #input-time .oo-ui-numberInputWidget-minusButton');
* 버전 => 1.2.3.19
* 작성자 : [[사용자:Senouis|Senouis]]
if(event.matches) {
* JSON => RPGinCity = {"name":"RPGinCity","descript":"RPG in City 자바스크립트 동작 제어","version":"1.2.3.19","local":true,"creat":"Senouis","state":"RPG in City/플러그인","executable":true};
button.css('display', 'none');
*/
input.time.$label.css('margin-right', null);
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 {
} else {
button.css('display', 'null');
var UserDBTitle = new mw.Title("사용자:"+usernameStr+"/RPG in City.json");
input.time.$label.css('margin-right', '30px');
startbuttondiv.innerHTML = "시작하기";
loadbuttondiv.innerHTML = "계속하기";
}
}
}
}
}
function encode(string) {
*/
return string
    /*
.replace(/&/g, '&#38;')
function RPGinCity_GoToCheckpoint () {
.replace(/</g, '&#60;')
var JSONDatalist = document.getElementsByClassName("mw-json-value");
.replace(/>/g, '&#62;')
if (currentpage === ("사용자:"+usernameStr+"/RPG_in_City.json") && JSONDatalist.length !== 0) {
.replace(/{/g, '&#123;')
var MWContent = document.getElementById("mw-content-text");
.replace(/\|/g, '&#124;')
var GotoLink= document.createElement("a");
.replace(/=/g, '&#61;')
GotoLink.href = mw.util.getUrl((JSONDatalist[0].innerText.substring(1, JSONDatalist[0].innerText.length-1)));
.replace(/}/g, '&#125;')
console.log(GotoLink.href);
.replace(/\[/g, '&#91;')
GotoLink.innerText = "게임 계속하기";
.replace(/\]/g, '&#93;')
MWContent.appendChild(GotoLink);
.replace(/_/g, '&#95;');
}
}
*/
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;
function cancel(btn) {
//적의 레벨
if(stat.length) {
var enemylevel = document.getElementById("RPGinCity-enemylevel");
battle.done = null;
enemylevel.innerText = queryparams.elevel; // elevel는 항상 undefined이 아니다.
battle.turn = 0;
//적의 체력
battle.attack = null;
var enemyhealth = document.getElementById("RPGinCity-enemyhealth");
battle.sequence = null;
enemyhealth.innerText = queryparams.ehp; // ep는 항상 undefined이 아니다.
battle.combo = null;
//공격 페이즈
battle.temp = null;
var nextPhaseUri = new mw.Uri("https://liberty.banipest.com/index.php?title="+currentpage);
        console.log("nextPhaseUri is "+nextPhaseUri);
bar = [];
var attackEnemy = document.getElementById("RPGinCity-attackEnemy");
bar[0] = new OO.ui.ProgressBarWidget({
var attackPower = Math.round(Math.random() * jsonfile.레벨*3) + jsonfile.무기;
progress: 100
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";
});
});
bar[1] = new OO.ui.ProgressBarWidget({
break;
progress: 100
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;
bar[0].$bar.css({
case "전투승리":
background: '#3366CC'
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";
});
});
bar[0].$element.css({
break;
'border-right': 'none',
case "레벨업":
'border-top-right-radius': 0,
new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
'border-bottom-right-radius': 0
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";
});
});
bar[1].$bar.css({
break;
background: '#FF5500'
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";
});
});
bar[1].$element.css({
break;
'border-left': 'none',
case "결제":
'border-top-left-radius': 0,
new mw.Api().edit("사용자:"+usernameStr+"/RPG_in_City.json", function (revision) {
'border-bottom-left-radius': 0
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;
input.start.setLabel('재시작');
default:
input.reset.setLabel('초기화');
    alert( 'No proper parameters' );
$('#stat-turn').text(0);
break;
$('.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);
function RPGinCity_HandleStore(jsondata, storeNumber) {
if(btn) $('#log')[0].innerText += '\n다시 시작하려면 재시작 버튼을 눌러주세요.';
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");
function stop() {
if (meetPeregirl !== undefined && meetPeregirl !== null && meetPeregirl.length > 0) {
clearInterval(battle.work);
if (jsonfile.추가2 < 20) {
meetPeregirl[0].style.display = "block";
$('#input-stop').hide();
} else {
$('#input-start').show();
meetPeregirl[0].remove();
input.reset.setDisabled(false);
meetPeregirl[0].style.display = "block";
input[0].setDisabled(false);
}
input[1].setDisabled(false);
input.time.setDisabled(false);
input.swap.setDisabled(false);
}
}
//남부 1구역구 상점, 문서 구조상 좀 구현이 복잡하여 분리한다.
var input = {};
var south1stStore = document.getElementsByClassName("south1stStore");
input[0] = new OO.ui.TextInputWidget({
if (south1stStore !== undefined && south1stStore !== null && south1stStore.length > 0) {
placeholder: '선',
if (jsonfile.추가2 < 10) {
title: '후',
south1stStore[0].style.display = "block";
value: new URLSearchParams(location.search).get('p0') || ''
RPGinCity_HandleStore(jsonfile, 0);
});
} else {
input.start = new OO.ui.ButtonInputWidget({
south1stStore[1].style.display = "block";
type: 'submit',
RPGinCity_HandleStore(jsonfile, 1);
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) {
var cityOffice = document.getElementsByClassName("cityOffice");
if($('#stat-turn').text()) $('#stat-table').show(500);
if (cityOffice !== undefined && cityOffice !== null && cityOffice.length > 0) {
if (jsonfile.추가2 < 70) {
cityOffice[0].style.display = "block";
} else {
} else {
$('#stat-table').hide(500);
cityOffice[1].style.display = "block";
}
}
});
}
input.reset.$button[0].form.addEventListener('reset', function(event) {
var cityOfficeInternal = document.getElementsByClassName("cityOfficeInternal");
event.preventDefault();
if (cityOfficeInternal !== undefined && cityOfficeInternal !== null && cityOfficeInternal.length > 0) {
if (jsonfile.추가2 >= 65) {
if(!input.reset.disabled) {
cityOfficeInternal[0].style.display = "block";
if(battle.done || battle.done === null) {
} else {
var url = new URL(location);
cityOfficeInternal[1].style.display = "block";
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) {
var cityOffice3F = document.getElementsByClassName("cityOffice3F");
function last() {
if (cityOffice3F !== undefined && cityOffice3F !== null && cityOffice3F.length > 0) {
$('#input-stop').show();
if (jsonfile.추가2 >= 65) {
$('#input-start').hide();
cityOffice3F[0].style.display = "block";
input.reset.setLabel('취소');
} else {
input[0].setDisabled(true);
cityOffice3F[1].style.display = "block";
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();
var mayorRoom = document.getElementsByClassName("mayorRoom");
if (mayorRoom !== undefined && mayorRoom !== null && mayorRoom.length > 0) {
if(!input.start.disabled) {
if (jsonfile.추가2 >= 70) {
$('#share').hide();
mayorRoom[0].style.display = "block";
$('#share-cvbox').hide();
} else {
mayorRoom[1].style.display = "block";
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].hit + ' / 운: ' + 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].hit + ' / 운: ' + 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 subQuestContent = document.getElementById("SubQuestContent");
        var range = [-0.5, -0.25, 0, 0.25, 0.5].map(function(ratio, index) {
var parentNode;
        return 20 + (weight - 50) * ratio;
if (subQuestContent !== undefined && subQuestContent !== null){
        });
parentNode = subQuestContent.parentElement;
        range.reduce(function(acc, current, index, prob) {
}
        return prob[index] += acc;
if (parentNode !== undefined && parentNode !== null && subQuestContent !== undefined && subQuestContent !== null) {
        });
if (jsonfile.추가1 !== 0) {
        return range;
parentNode.removeChild( subQuestContent );
} else {
subQuestContent.style.display = "block";
}
}
}
var subQuestEnd = document.getElementById("SubQuestEnd");
    function rank(range, val) {
if (parentNode !== undefined && parentNode !== null &&subQuestEnd !== undefined && subQuestEnd !== null) {
        return range.findIndex(function(current, index) {
if (jsonfile.추가1 !== 1) {
        return (index === 0 || range[index - 1] < val) && val <= current;
parentNode.removeChild( subQuestEnd );
        });
} else {
    }
subQuestEnd.style.display = "block";
   
}
function power(stat, rank) {
    return stat * (((rank === 0)? 0 : rand(1 + 25 * (rank - 1), 25 * rank)) / 100);
}
}
var subQuestNotEnd = document.getElementsByClassName("SubQuestNotEnd");
function bonus(plus, minus, rank) {
if (parentNode !== undefined && parentNode !== null && subQuestNotEnd !== undefined && subQuestNotEnd !== null) {
rank -= 2;
if (jsonfile.추가1 < 2) {
if(rank === 0) return 0;
parentNode.removeChild( subQuestNotEnd[0] );
    return ((rank > 0)? plus : minus) * (rand(1 + 50 * (rank - 1), 50 * rank) / 100);
} else {
subQuestNotEnd[0].style.display = "block";
}
}
}
// 자동 세이브 처리 - 가장 마지막에 와야 하는 것
function josa(text, exist, not, only) {
var saveGameHandle = document.getElementById("RPGinCity-saveGame");
text = text.normalize('NFD');
if (saveGameHandle !== undefined && saveGameHandle !== null) {
var code = text.charCodeAt(text.length - 1);
console.log("Saving...");
RPGinCity_SaveHandle(saveGameHandle);
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);
});
// ----------------------------------------------------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 끝 */
/** 플러그인 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

2024년 9월 13일 (금) 17:02 기준 최신판

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

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