mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 00:22:34 +00:00
First tilde projects commit
This commit is contained in:
1 parent
9bcadfc4a7
commit
726861fae6
40 files changed
+20890
No files matched your search
@@ -0,0 +1,48 @@
|
||||
module Mission
|
||||
|
||||
@adjectives = []
|
||||
@nouns = []
|
||||
@colors = []
|
||||
@animals = []
|
||||
@mission_grammars = []
|
||||
|
||||
|
||||
def Mission.get_name()
|
||||
adj, bad_nouns = get_adj();
|
||||
noun = get_noun(bad_nouns)
|
||||
|
||||
adj2 = adj
|
||||
noun2 = noun
|
||||
while adj2[0] == adj[0] || noun2 == noun
|
||||
adj2, bad_nouns = get_adj();
|
||||
noun2 = get_noun(bad_nouns)
|
||||
end
|
||||
|
||||
color = get_color()
|
||||
animal = get_animal()
|
||||
|
||||
name = ""
|
||||
case rand(1..100)
|
||||
when 1..10
|
||||
name += "Project "
|
||||
when 11..20
|
||||
name += "Operation "
|
||||
end
|
||||
|
||||
total_prob = 0
|
||||
@mission_grammars.each{|grammar|
|
||||
grammar[0] = grammar[0].to_i
|
||||
total_prob += grammar[0]
|
||||
}
|
||||
chance = rand(1..total_prob)
|
||||
@mission_grammars.each{|grammar|
|
||||
if chance < grammar[0]
|
||||
name += eval(grammar[1])
|
||||
break
|
||||
end
|
||||
chance -= grammar[0]
|
||||
}
|
||||
|
||||
return name
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user