-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
53 lines (36 loc) · 1.61 KB
/
index.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
var selectedChar;
var avaibleWeapons;
var weapons = [
{name: "4-Point Shuriken", slots: 3, category: "shuriken"},
{name: "Boomerang", slots: 3, category: "shuriken"},
{name: "Super Ball", slots: 0, category: "shuriken"},
{name: "Wind Slash", slots: 3, category: "shuriken"},
{name: "Pinwheel", slots: 4, category: "shuriken"},
{name: "Twin Viper", slots: 4, category: "shuriken"},
{name: "Razor Ring", slots: 5, category: "shuriken"},
{name: "Hawkeye", slots: 6, category: "shuriken"},
{name: "Crystal Cross", slots: 6, category: "shuriken"},
{name: "Spiral Shuriken", slots: 8, category: "shuriken"},
{name: "Magic Shuriken", slots: 3, category: "shuriken"},
{name: "Oritsuru", slots: 8, category: "shuriken"},
{name: "Rising Sun", slots: 4, category: "shuriken"},
{name: "Conformer", slots: 8, category: "shuriken"},
{name: "Buster Sword", slots: 2, category: "sword"},
{name: "Hard Edge", slots: 4, category: "sword"}
]
var chars = [
{name: "cloud", category: "sword" },
{name: "barret", category: "prosthesis"},
{name: "tifa", category: "knucles"},
{name: "aerith", category: "staff"},
{name: "red", category: "feather"},
{name: "yuffie", category: "shuriken"},
{name: "cait", category: "megaphone"},
{name: "vincent", category: "gun"},
{name: "cid", category: "spear"}
]
var shurikenWeapons = weapons.filter( weapon => weapon.category === chars.category)
function selectChar(nome){
selectedChar = chars.filter( char => char.name === nome)
avaibleWeapons = weapons.filter( weapon => weapon.category === selectedChar.category)
}