-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (87 loc) · 3.52 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>GHRnd</title>
<style>
table {text-align: center; width:95vw; font-size: xx-large}
td { border:solid; border-width: 1px; width: 19vw; height: 19vw; }
</style>
</head>
<body>
<table>
<tr><td></td><td id="td_N" colspan=3>N</td><td></td></tr>
<tr><td rowspan=3 id="td_W">W</td><td id="td_1">1</td><td id="td_2">2</td><td id="td_3">3</td><td rowspan=3 id="td_E">E</td></tr>
<tr><td id="td_4">4</td><td id="td_5">5</td><td id="td_6">6</td></tr>
<tr><td id="td_7">7</td><td id="td_8">8</td><td id="td_9">9</td></tr>
<tr><td></td><td colspan=3 id="td_S">S</td><td></td></tr>
</table>
<button id="btn">ROLL</button>
<p>
Legend</br>
<ul>
<li>Y1 - Yellow Enfeeblement Mantra (weaken 1 ghost)</li>
<li>Y2 - Yellow Bottomless Pockets (get 1 token every round)</li>
<li>R1 - Red Dance of the Twin Winds (move other taoist)</li>
<li>R2 - Red Dance of the Peaks (fly)</li>
<li>B1 - Blue Second Wind (fight twice OR aid once)</li>
<li>B2 - Blue Heavenly Gust (fight AND aid)</li>
<li>G1 - Green Strength of the Mountain (extra die, no curses)</li>
<li>G2 - Green Gods‘ favourite (reroll tao and curse dice)</li>
</ul>
<ul>
<li>1 - Pavilon (move ghost, move other taoist)</li>
<li>2 - Tea House (get qi and tao token, spawn a ghost)</li>
<li>3 - Herbalist Shop (get two random tao tokens)</li>
<li>4 - Sorcerer (pay 1 qi to discard a ghost)</li>
<li>5 - Guard (push back all haunters on single board)</li>
<li>6 - blah (reverse haunting from one tile, spawn a ghost)</li>
<li>7 - Shrine (get a buddah)</li>
<li>8 - Cemetary (resurect taoist with 2 qi, get cursed)</li>
<li>9 - Temple (weakn all ghosts by 1 in selected color)</li>
</ul>
</p>
</body>
<script>
function getRndInteger(min, max) {
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
function FisherYatesShuffle(arr)
{
var n = arr.length
for (var i = n - 1; i > 0; i--)
{
// Pick a random index
// from 0 to i
var j = getRndInteger(0, i);
// Swap arr[i] with the
// element at random index
var temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
}
}
function reroll()
{
var tiles = [1,2,3,4,5,6,7,8,9];
FisherYatesShuffle(tiles);
var colors = ["B","R","Y","G"];
FisherYatesShuffle(colors);
document.getElementById("td_N").textContent = colors[0]+getRndInteger(1,2);
document.getElementById("td_E").textContent = colors[1]+getRndInteger(1,2);
document.getElementById("td_W").textContent = colors[2]+getRndInteger(1,2);
document.getElementById("td_S").textContent = colors[3]+getRndInteger(1,2);
document.getElementById("td_1").textContent = tiles[1-1];
document.getElementById("td_2").textContent = tiles[2-1];
document.getElementById("td_3").textContent = tiles[3-1];
document.getElementById("td_4").textContent = tiles[4-1];
document.getElementById("td_5").textContent = tiles[5-1];
document.getElementById("td_6").textContent = tiles[6-1];
document.getElementById("td_7").textContent = tiles[7-1];
document.getElementById("td_8").textContent = tiles[8-1];
document.getElementById("td_9").textContent = tiles[9-1];
}
reroll();
document.getElementById("btn").onclick = reroll;
</script>
</html>