[轉錄][程式] DDR - Butterfly / smile.dk (Trick)
請按大P服用
※ [本文轉錄自 BBSLua 看板]
作者: TKirby ( :D) 看板: BBSLua
標題: [程式] DDR - Butterfly / smile.dk (Trick)
時間: Mon Jan 7 00:40:26 2008
--#BBSLUA
-- author : tkirby
speed=4
delay=4+0 -- 4 is the default delay
gauge=8
notes=
{
{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},
{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},
{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},
{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},
{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},{v=0},
{v=3},{v=0},{v=4},{v=0},{v=3},{v=0},{v=1},{v=0},{v=3},{v=0},{v=4},{v=0},{v=0},
{v=0},{v=0},{v=0},{v=4},{v=0},{v=0},{v=0},{v=4},{v=0},{v=4},{v=0},{v=1},{v=0},
{v=0},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=4},{v=0},{v=2},{v=0},{v=1},
{v=0},{v=3},{v=0},{v=4},{v=0},{v=1},{v=0},{v=1},{v=0},{v=4},{v=0},{v=0},{v=0},
{v=4},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},
{v=0},{v=4},{v=0},{v=2},{v=0},{v=1},{v=0},{v=3},{v=0},{v=4},{v=0},{v=1},{v=0},
{v=1},{v=0},{v=0},{v=0},{v=3},{v=0},{v=3},{v=0},{v=4},{v=0},{v=4},{v=0},{v=3},
{v=0},{v=1},{v=0},{v=2},{v=0},{v=3},{v=0},{v=2},{v=0},{v=1},{v=0},{v=0},{v=0},
{v=4},{v=0},{v=1},{v=0},{v=2},{v=0},{v=3},{v=0},{v=0},{v=0},{v=3},{v=0},{v=3},
{v=0},{v=4},{v=0},{v=4},{v=0},{v=3},{v=0},{v=1},{v=0},{v=2},{v=0},{v=3},{v=0},
{v=2},{v=0},{v=4},{v=0},{v=0},{v=0},{v=1},{v=0},{v=4},{v=0},{v=3},{v=0},{v=2},
{v=0},{v=2},{v=0},{v=4},{v=0},{v=2},{v=0},{v=4},{v=0},{v=2},{v=0},{v=1},{v=0},
{v=2},{v=0},{v=1},{v=0},{v=2},{v=0},{v=4},{v=0},{v=2},{v=0},{v=4},{v=0},{v=2},
{v=0},{v=1},{v=0},{v=2},{v=0},{v=1},{v=0},{v=4},{v=0},{v=0},{v=0},{v=4},{v=0},
{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=4},
{v=0},{v=2},{v=0},{v=1},{v=0},{v=3},{v=0},{v=4},{v=0},{v=1},{v=0},{v=4},{v=0},
{v=4},{v=0},{v=0},{v=0},{v=4},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=1},
{v=0},{v=4},{v=0},{v=0},{v=0},{v=4},{v=0},{v=2},{v=0},{v=1},{v=0},{v=3},{v=0},
{v=4},{v=0},{v=1},{v=0},{v=1},{v=0},{v=0},{v=0},{v=3},{v=0},{v=3},{v=0},{v=4},
{v=0},{v=4},{v=0},{v=3},{v=0},{v=1},{v=0},{v=2},{v=0},{v=3},{v=0},{v=2},{v=0},
{v=1},{v=0},{v=0},{v=0},{v=4},{v=0},{v=1},{v=0},{v=2},{v=0},{v=3},{v=0},{v=0},
{v=0},{v=3},{v=0},{v=3},{v=0},{v=4},{v=0},{v=4},{v=0},{v=3},{v=0},{v=1},{v=0},
{v=2},{v=0},{v=3},{v=0},{v=2},{v=0},{v=4},{v=0},{v=0},{v=0},{v=1},{v=0},{v=4},
{v=0},{v=3},{v=0},{v=2},{v=0},{v=0},{v=0}
}
rank={{
{v='██ ██ ██ ██ ██ ██ ██▌'},
{v='█ ▌█ █ ▌█ █ █ ▌ ▌ '},
{v='██ ██ ██ ██ ██ █ ▌ '},
{v='█ █ █▌ █ █ █ ▌ ▌ '},
{v='█ ██ ▌█ █ ██ ██ ▌ '}
},{
{v='███ ███ ███ ██ ███'},
{v='█ █ █ █ █ █ █ '},
{v='█ █▌███ ███ ███ █ '},
{v='█ █ ██ █ █ █ █ '},
{v='███ █ █▌███ █ █ █ '}
},{
{v='███ ███ ███ ██▌'},
{v='█ █ █ █ █ █ █'},
{v='█ █▌█ █ █ █ █ █'},
{v='█ █ █ █ █ █ █ █'},
{v='███ ███ ███ ███'}
},{
{v='██▌ ███ ███'},
{v='█ █ █ █ █ █'},
{v='███ █ █ █ █'},
{v='█ █ █ █ █ █'},
{v='███ ███ ███'}
},{
{v='███ ███ ██▌██▌'},
{v='▌█ ▌ █ █ █ '},
{v='▌█ ▌ █ ██▌██▌'},
{v='▌█ ▌ █ ▌ ▌'},
{v='▌█ ▌███ ██▌██▌'}
}};
lyrics=
{
{v='哎依~呀依呀依呀(請自行想像音樂)'},
{v='哎依~呀依呀依呀'},
{v='哎依~呀依呀依呀(快要開始了)'},
{v='我的殺母賴到哪去啦?(嚇!)'},
{v='(間奏)'}, {v='(間奏2)'}, {v='(間奏3)'}, {v='.......我一直'},
{v='在找一個男人'}, {v='誰可以橫跨日本'}, {v='只是要去找'},
{v='找到我的殺母賴'}, {v='我的他是強壯的'}, {v='害羞的與熊搏鬥'},
{v='是的我需要, '}, {v='我需要來杯殺母賴'}, {v='哎依~呀依呀依呀'},
{v='我是你的小奶油飛'}, {v='綠色、黑色和藍色(的霉菌)'},
{v='把天空染滿色彩'}, {v='哎依~呀依呀依呀'}, {v='我是你的小奶油飛'},
{v='綠色、黑色和藍色(的霉菌)'}, {v='把天空染滿色彩'},
{v='(間奏)'}, {v='(間奏2)'}, {v='(間奏3)'},
{v='.........我已經'}, {v='在木頭堆裡找了很久'}, {v='還有在喜馬拉雅山上'},
{v='這一切只是為了'}, {v='找我那害羞的殺母賴'}, {v='他永遠不會後悔'},
{v='上網跟我交往'}, {v='沒錯我需要'}, {v='我需要找個殺母賴'},
{v='哎依~呀依呀依呀'}, {v='我是你的小奶油飛'}, {v='綠色、黑色和藍色(的霉菌)'},
{v='把天空染滿色彩'}, {v='哎依~呀依呀依呀'}, {v='我是你的小奶油飛'},
{v='綠色、黑色和藍色(的霉菌)'}, {v='把天空染滿色彩'}, {v='(完)'}}
function _ip(pos,line,index)
bbs.move(pos+line,index*6+2)
end
function repose()
_gauge_rep.x=math.floor(math.random()*3);
_gauge_rep.y=math.floor(math.random()*3);
end
function _score(idx,line)
for i=1,5 do
bbs.move(line+i-1+_gauge_rep.y,35+_gauge_rep.x);
bbs.outs(rank[idx][i].v)
end
if combo>10 then
bbs.move(line+6+_gauge_rep.y,40);
bbs.outs("Combo "..combo)
end
end
function score(gap)
local result
bbs.move(2,1)
if gap<0.6 then bbs.color(1,33); _score(1,5); result=2;
elseif gap<0.9 then bbs.color(1,32); _score(2,5); result=1;
elseif gap<1.2 then bbs.color(0,36); _score(3,5); result=0;
elseif gap<1.5 then bbs.color(0,35); _score(4,5); result=-1;
else bbs.color(0,31); _score(5,5); result=-2; end
bbs.color(0,37,40);
return result
end
function icon(pos,index,c)
if index==1 then
_ip(pos,0,index); bbs.color(0,30+c); bbs.outs('◢▄');
_ip(pos,1,index); bbs.outs('◥');bbs.color(0,30,40+c);bbs.outs('▄');
bbs.color();
elseif index==2 then
_ip(pos,0,index); bbs.color(0,30+c); bbs.outs(' █ ');
_ip(pos,1,index); bbs.outs('◥◤');bbs.color();
elseif index==3 then
_ip(pos,0,index); bbs.color(0,30+c); bbs.outs('◢◣');
_ip(pos,1,index); bbs.outs(' █ ');bbs.color();
elseif index==4 then
_ip(pos,0,index); bbs.color(0,30+c); bbs.outs('▄◣');
_ip(pos,1,index); bbs.color(0,30,40+c);bbs.outs('▄');bbs.color(0,30+c);
bbs.outs('◤'); bbs.color();
end
end
function setgaugecolor(gauge)
if gauge<1 then bbs.color(0,30,41);
elseif gauge<4 then bbs.color(0,37,41);
elseif gauge<7 then bbs.color(0,33,42);
elseif gauge>9 then bbs.color(1,33,46);
else bbs.color(0,33,45)
end
end
rptr=-10
ptr=-10
size=table.getn(notes)
rn=table.getn(lyrics)
duration=0.0
start=bbs.clock()
scoring=0
_gauge_rep={x=0,y=0}
combo=0
repeat
bbs.clear()
bbs.title('Ctrl-C 離開 / Dash Dash Revolution - PTT Remix - Butterfly / smile.dk ')
bbs.move(1,1);
setgaugecolor(gauge)
bbs.outs(' ')
bbs.move(2,1)
bbs.outs('◢');
for i=1,math.floor(gauge*2.0) do
bbs.outs('█');
end
bbs.color(0,30)
for i=1,20-math.floor(gauge*2.0) do
bbs.outs('█');
end
setgaugecolor(gauge)
bbs.outs(' ')
bbs.move(3,1);
bbs.outs(' ')
bbs.color(0,37,40);
bbs.color(0,34);
bbs.move(6,4);
bbs.outs('───────────────');
for i=1,4 do icon(6,i,4); end
bbs.color();
for i=-6,10 do
j=ptr+i
if j>0 and j<=size and notes[j].v>0 then
if (i+ptr)%2==1 then c=2; else c=1; end
icon(i+10,notes[j].v,c)
end
end
bbs.move(1,1)
bbs.color(1,30,40);
-- bbs.outs(ptr..' '..size..' time '..((bbs.time()-start)))
ptr = math.floor(speed*(bbs.clock()-start))-10
rptr = math.floor(math.floor(speed*(bbs.clock()-start))/8)
result=0
if bbs.kbhit(duration) then
c=bbs.getch()
time_hit = bbs.clock()
if c=='LEFT' then u=1; end
if c=='DOWN' then u=2; end
if c=='UP' then u=3; end
if c=='RIGHT' then u=4; end
if ptr-delay>0 and ptr-delay<=size then
repose()
if notes[ptr-delay].v==u then
time_perfect = ((ptr+10)/speed)+start
gap = math.abs(speed*(time_hit-time_perfect))
scoring=bbs.clock()+1
result=score(gap)
notes[ptr-delay].v=0
elseif notes[ptr-delay].v>0 then
gap = 10
scoring=bbs.clock()+1
result=score(gap)
notes[ptr-delay].v=0
end
end
end
if ptr-delay-2>0 and ptr-delay-2<=size and notes[ptr-delay-2].v>0 then
gap=10
scoring=bbs.clock()+1
result=score(gap)
repose()
end
gauge = gauge + result/4
if result>0 then combo=combo+1; end
if result<0 then combo=0; end
if gauge<0 then gauge=0; end
if gauge>10 then gauge=10; end
-- bbs.move(1,50); bbs.outs(gap);
-- bbs.outs(' '..rptr..' '..rn);
if scoring-bbs.clock()>0 then
score(gap)
end
if rptr>0 and rptr<=rn then
bbs.move(22,7)
bbs.color(1,37)
bbs.outs(lyrics[rptr].v)
bbs.color(0)
end
bbs.refresh()
until ptr>size+10
--#BBSLUA
--
※ 發信站: 批踢踢兔(ptt2.cc)
◆ From: 140.112.30.51
--
--
我很正吧~~╲ ◤ ◢
─ __太__█
╰˙﹏˙█
﹀◤
▕ ▏
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.128.65.212
推
01/07 16:24, , 1F
01/07 16:24, 1F
→
01/07 16:24, , 2F
01/07 16:24, 2F
→
01/07 16:56, , 3F
01/07 16:56, 3F
推
01/07 16:58, , 4F
01/07 16:58, 4F
→
01/07 17:18, , 5F
01/07 17:18, 5F
推
01/07 17:21, , 6F
01/07 17:21, 6F
推
01/07 17:45, , 7F
01/07 17:45, 7F
推
01/07 19:15, , 8F
01/07 19:15, 8F
推
01/07 19:25, , 9F
01/07 19:25, 9F