-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
75 lines (73 loc) · 1.55 KB
/
script.js
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
var generated;
var colors = [
'red',
'blue',
'black',
'white',
'gray',
'green',
'light blue',
'light green',
'light red',
'mahogany',
'brown',
'gold',
'silver',
'crimson',
'pine green'
];
var hair = [
'pony-tail',
'long',
'short',
'bald',
'to shoulders'
];
var haircolors = [
'red',
'brown',
'blonde',
'brunette',
'black',
'white'
];
var weapons = [
'pistol',
'dual-pistols',
'daggers',
'sword',
'rifle',
'throwing knives'
];
var clothes = [
'casual clothes',
'fancy clothes',
'armor'
];
var bodytype = [
'skinny',
'chubby',
'average'
];
var genders = [
'He',
'She'
]
function generated(){
color1 = colors[Math.floor(Math.random()*colors.length)];
color2 = colors[Math.floor(Math.random()*colors.length)];
gender = genders[Math.floor(Math.random()*genders.length)];
currentclothes = clothes[Math.floor(Math.random()*clothes.length)];
currentbodytype = bodytype[Math.floor(Math.random()*bodytype.length)];
weapon = weapons[Math.floor(Math.random()*weapons.length)];
currenthaircolor = haircolors[Math.floor(Math.random()*haircolors.length)]
return(
'Your character has ' + currenthaircolor + ' hair, is wearing '
+ currentclothes + ' that are/is ' + color1 + ' and ' + color2 + ', has a(n) '
+ currentbodytype + ' body type. ' + gender + ' weilds (a) '
+ weapon + ' that are/is ' + color2 + ' and ' + color1 + '.'
)
}
$('#generatebutton').click(function(){
$('#prompt').html(generated);
})