-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
201 lines (183 loc) · 6.83 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fallout: New Vegas Character Generator</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.3/css/bulma.min.css">
</head>
<body>
<section class="hero is-dark">
<div class="hero-body">
<div class="container">
<h1 class="title is-size-1-desktop">Fallout: New Vegas Character Generator</h1>
<h2 class="subtitle">Spice up your New Vegas playthrough with this spiffy character generator.</h2>
</div>
</div>
</section>
<section class="section">
<div class="container">
<h1 class="title">Appearance</h1>
<h2 class="subtitle">
How your character looks.
</h2>
<div class="columns" id="appearance">
<div class="column has-text-centered">
<p class="heading">Gender</p>
<p class="title" id="gender"></p>
</div>
<div class="column has-text-centered">
<p class="heading">Hair Colour</p>
<span class="tag is-large" id="hair-colour"></span>
</div>
<div class="column has-text-centered">
<p class="heading">Hairstyle</p>
<p class="title" id="hairstyle"></p>
</div>
</div>
</section>
<section class="section">
<div class="container">
<h1 class="title">S.P.E.C.I.A.L.</h1>
<h2 class="subtitle">
SPECIAL is the ruleset that powers all Fallout games. The name "SPECIAL" is an acronym
standing for the primary statistics in the system: <strong>S</strong>trength,
<strong>P</strong>erception, <strong>E</strong>ndurance, <strong>C</strong>harisma,
<strong>I</strong>ntelligence, <strong>A</strong>gility and <strong>L</strong>uck.
</h2>
<div class="columns">
<div class="column has-text-centered">
<p class="heading">Strength</p>
<p class="title" id="special-strength">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Perception</p>
<p class="title" id="special-perception">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Endurance</p>
<p class="title" id="special-endurance">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Charisma</p>
<p class="title" id="special-charisma">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Intelligence</p>
<p class="title" id="special-intelligence">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Agility</p>
<p class="title" id="special-agility">1</p>
</div>
<div class="column has-text-centered">
<p class="heading">Luck</p>
<p class="title" id="special-luck">1</p>
</div>
</div>
</div>
</section>
<section class="section">
<div class="container" id="tag-skills">
<h1 class="title">Tag Skills</h1>
<h2 class="subtitle">
Tag skills are the player character's specializations. At the start of the game,
the player chooses three Tag skills which will be their character's specialties
throughout the game.
</h2>
</div>
</section>
<section class="section">
<div class="container" id="traits">
<h1 class="title">Traits</h1>
<h2 class="subtitle">
Traits are optional character modifications that affect the player character.
</h2>
</div>
</section>
<section class="section">
<div class="container" id="companions">
<h1 class="title">Companions</h1>
<h2 class="subtitle">
Companions are the allies of player characters who accompany and aid them during
their adventures.
</h2>
</div>
</section>
<section class="section">
<div class="container">
<h1 class="title">Faction</h1>
<h2 class="subtitle">
The major factions the player can choose to align themselves with.
</h2>
<div class="columns">
<div class="column has-text-centered">
<p class="title" id="faction"></p>
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container">
<div class="content has-text-centered">
<p>
Created by <a href="https://sjm.io">Simon Morgan</a>.
</p>
<p>
The website uses content from
<a href="http://fallout.wikia.com/">Nukapedia</a> and is licensed under
the <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC BY-SA 3.0</a>.
</p>
</div>
</div>
</footer>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/random-js/1.0.8/random.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Colors.js/1.2.3/colors.min.js"></script>
<script src="js/nvcg.js"></script>
<script>
function buildListElement(list) {
let element = $('<div class="columns"></div>');
if (list.length === 0) {
element.append(
'<div class="column has-text-centered"><p class="title">None</p></div>'
);
return element;
}
list.forEach(item => element.append(
'<div class="column has-text-centered"><p class="title">' + item +
'</p></div>'));
return element;
}
let special = chooseSpecial();
$('#special-strength').text(special['strength']);
$('#special-perception').text(special['perception']);
$('#special-endurance').text(special['endurance']);
$('#special-charisma').text(special['charisma']);
$('#special-intelligence').text(special['intelligence']);
$('#special-agility').text(special['agility']);
$('#special-luck').text(special['luck']);
let appearance = chooseAppearance();
if (appearance.male) {
$('#gender').text("Male");
if (appearance.hasOwnProperty('facialHair')) {
$('#appearance').append(
'<div class="column has-text-centered"><p class="heading">Facial Hair</p><p class="title">' +
appearance.facialHair + '</p></div>');
}
} else {
$('#gender').text("Female");
}
$('#hairstyle').text(appearance.hairstyle);
let hairColour = $c.rand();
$('#hair-colour').text($c.hex2rgb(hairColour).RGB);
$('#hair-colour').css("color", $c.complement(hairColour));
$('#hair-colour').css("background-color", hairColour);
$('#tag-skills').append(buildListElement(chooseTagSkills()));
$('#traits').append(buildListElement(chooseTraits()));
$('#companions').append(buildListElement(chooseCompanions()));
$('#faction').text(chooseFaction());
</script>
</body>
</html>