-
Notifications
You must be signed in to change notification settings - Fork 2
/
item.rb
48 lines (46 loc) · 1.35 KB
/
item.rb
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
def create_item()
rng = rand()
if rng < 0.6
prefix = "Regulation"
stats = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
value = rand() * 1000
elsif rng < 0.865
prefix = "Industrial"
stats = [0.3, 0.3, 0.3,0.3,0.3,0.3]
value = rand() * 4000
elsif rng < 0.94
prefix = "Aftermarket"
stats = [0.5,0.5,0.5,0.5,0.5,0.5]
value = rand() * 7000
elsif rng < 0.975
prefix = "Illegal"
stats = [0.7,0.7,0.7,0.7,0.7,0.7]
value = rand() * 10000
elsif rng < 0.995
prefix = "Starframed"
stats = [0.9,0.9,0.9,0.9,0.9,0.9]
value = rand() * 15000
else
prefix = "Zekiforged"
stats = [1.5,1.5,1.5,1.5,1.5,1.5]
value = 100000
end
weapon = ["Arclance", "Dynawrench", "Gravaxe", "Fusion Rifle", "Neuralyzer", "Gauss Matrix", "Implant", "Bionics", "Psiglass"].sample
element = ["Aer", "Terra", "Aques", "Fyr", "Flux", "Alica"].sample
if element == "Aer"
stats[0] += 0.2
elsif element =="Terra"
stats[1] += 0.2
elsif element =="Aques"
stats[2] += 0.2
elsif element == "Fyr"
stats[3] += 0.2
elsif element == "Flux"
stats[4] += 0.2
else
stats[5] += 0.2
end
name = "#{prefix} #{weapon} of #{element}"
[name, stats, value]
end
Kernel.loop {puts create_item() }