<script>
/* 画像設置ディレクトリ */
dir = "./slotimage/";
/* 最初の所持金 */
pay = 1000;
/* ドラムの回転速度 */
speed = 10;
img = new Array();
for(i = 0; i < 7; i++) {
img[i] = new Image();
img[i].src = dir + i + ".gif";
}
s1 = s2 = s3 = 0;
x = 1;
lock = 0;
img_len = img.length - 1;
function pre() {
document.slot_form.point.value = "\\" + pay;
}
function bet(parts) {
if (lock == 0) {
x = parts.value;
x = eval(x.substring(1,x.length));
x ++;
if (x > 10) x = 1;
parts.value = "x" + x;
}
}
function slot(parts) {
if (parts.value == "START") {
reach = 0;
if (pay <= 0) { over(); return; }
else if (100 * x > pay) {
alert("所持金が足りません!\n\nBET数を減らして下さい!");
return;
}
else lock = 1;
pay -= (100 * x);
pre();
document.slot_form.elements[0].value = "WAIT...";
shfl1();
setTimeout("shfl2()",500);
setTimeout("shfl3(1)",1000);
}
else if (parts.value == "LEFT") {
clearTimeout(id1);
document.slot_form.elements[0].value = "CENTER";
}
else if (parts.value == "CENTER") {
clearTimeout(id2);
document.slot_form.elements[0].value = "RIGHT";
}
else if (parts.value == "RIGHT") {
d = new Date();
min = d.getSeconds();
stop1(1);
}
}
function shfl1() {
s1 ++;
if (s1 > img_len) s1 = 0;
document.slot1.src = img[s1].src;
id1 = setTimeout("shfl1()",speed);
}
function shfl2() {
s2 ++;
if (s2 > img_len) s2 = 0;
document.slot2.src = img[s2].src;
id2 = setTimeout("shfl2()",speed);
}
function shfl3(p) {
if (p) document.slot_form.elements[0].value = "LEFT";
s3 ++;
if (s3 > img_len) s3 = 0;
document.slot3.src = img[s3].src;
id3 = setTimeout("shfl3()",speed);
}
function stop1(n) {
if (n) {
document.slot_form.elements[0].value = "STOP !";
clearTimeout(id3);
key = speed;
}
document.slot3.src = img[s3].src;
if (s1 == s2 && min % 2 == 0 && key < 500) {
s3 ++;
if (s3 > img_len) s3 = 0;
reach = 1;
id3 = setTimeout("stop1()",key+=50);
}
else if (s1 == s2 && min % 3 == 0) {
clearTimeout(id3);
key = 0;
setTimeout("stop2()",500);
}
else {
clearTimeout(id3);
comp();
}
}
function stop2() {
key ++;
s3 ++;
if (s3 > img_len) s3 = 0;
document.slot3.src = img[s3].src;
if (key < 25) id3 = setTimeout("stop2()",5);
else {
clearTimeout(id3);
if (reach == 1) s3 = s1;
document.slot3.src = img[s3].src;
comp();
}
}
function comp() {
document.slot_form.elements[0].value = "START";
lock = 0;
if (s1 == s2 && s2 == s3) {
if (s1 == 5) pay += (100 * x *100);
else if (s1 == 3) pay += (100 * x *20);
else if (s1 == 1) pay += (100 * x *10);
else pay += (100 * x *5);
}
else if (s1 == 3 && s2 == 3) pay += (100 * x *5);
else if (s1 == 3) pay += (100 * x);
if (pay <= 0) over();
else pre();
}
function over() {
if (confirm("もう所持金が有りません!\n\nもう\\1000貸しましょうか?")) {
pay = 1000;
x = 1;
}
else alert("またの挑戦をお待ちしております!");
document.slot_form.elements[1].value = "x1";
pre();
}
onload = pre;
// Copyright (C) 2002-2002 suepon , All rights reserved.
// Script found at http://suepon.com/
</script>
<form name=slot_form>
<table border=5 cellpadding=10><td align=center>
<span style="font-size:10pt;">1BET \100
<br>
<img src="./slotimage/5.gif" name=slot1 width=25 height=25>
<img src="./slotimage/5.gif" name=slot2 width=25 height=25>
<img src="./slotimage/5.gif" name=slot3 width=25 height=25><br>
<input type=button onclick="slot(this);blur()" value="START">
<br>
BET <input type=button onclick="bet(this);blur()" value="x1">
<br>
<input size=10 name=point readonly><br>
</span></td></table>
</form>
|