-
-
Save anonymous/6cb12e5896652ee17bee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Plasmahandgun | |
attr_accessor :size | |
attr_accessor :emitter | |
attr_accessor :wattage | |
attr_accessor :heat | |
attr_accessor :range | |
attr_accessor :upgradepoints | |
attr_accessor :standardequipment | |
@size = nil | |
@emitter = nil | |
@wattaage = nil | |
@heat = 0 | |
@range = nil | |
@upgradepoints = nil | |
@standardequipment = nil | |
def initialize | |
@size = get_size | |
@emitter = get_emitter | |
@wattage = get_wattage | |
@heat = get_heat | |
@range = get_range | |
@upgradepoints = get_upgradepoints | |
@standardequipment = get_standardequipment | |
end | |
def inspect | |
"I made a #{@size} sized plasma handgun that has a #{@emitter} emmitter(s), in the #{@wattage} range with a #{@heat} heat rating. It has a #{@range} range increment. It has upgrade points on the #{@upgradepoints}. The plasarm arrives #{@standardequipment}" | |
end | |
private | |
def get_wattage | |
if @size == "Tiny" | |
x = rand(1..100) | |
if x.between?(1,35) | |
"10 kW(1d8-2)" | |
elsif x.between?(36,55) | |
"15 kW(1d8)" | |
elsif x.between?(56,70) | |
"25 kW(1d8+1)" | |
@heat = @heat - 3 | |
elsif x.between?(71,95) | |
"35 kW(2d8)" | |
@heat = @heat - 6 | |
else | |
"40 kW(2d8+1)" | |
@heat = @heat - 9 | |
end | |
elsif @size == "Small" | |
x = rand(1..100) | |
if x.between?(1,35) | |
"10 kW(1d8-2)" | |
elsif x.between?(36,50) | |
"15 kW(1d8)" | |
elsif x.between?(51,75) | |
"25 kW(1d8+1)" | |
@heat = @heat - 2 | |
elsif x.between?(76,95) | |
"35 kW(2d8)" | |
@heat = @heat - 4 | |
else | |
"40 kW(2d8+1)" | |
@heat = @heat - 8 | |
end | |
else | |
x = rand(1..100) | |
if x.between?(1,35) | |
"10 kW(1d8-2)" | |
elsif x.between?(36,50) | |
"15 kW(1d8)" | |
elsif x.between?(51,75) | |
"25 kW(1d8+1)" | |
@heat = @heat - 1 | |
elsif x.between?(76,95) | |
"35 kW(2d8)" | |
@heat = @heat - 3 | |
else | |
"40 kW(2d8+1)" | |
@heat = @heat - 5 | |
end | |
end | |
end | |
def get_emitter | |
if @size == "Tiny" | |
x = rand(1..100) | |
if x.between?(1,45) | |
"Standard" | |
elsif x.between?(46,75) | |
"Standard/Stun" | |
elsif x.between?(76,95) | |
"Standard/Charge" | |
else | |
"Standard/Stun/Charge" | |
end | |
else | |
x = rand(1..100) | |
if x.between?(1,20) | |
"Standard" | |
elsif x.between?(21,29) | |
"Standard/Charge" | |
elsif x.between?(30,38) | |
"Standard/Stun" | |
elsif x.between?(39,47) | |
"Standard/Pulse" | |
elsif x.between?(48,56) | |
"Standard/Bounce" | |
elsif x.between?(56,65) | |
"Standard/Bounce/Stun" | |
elsif x.between?(66,74) | |
"Standard/Charge/Bounce" | |
elsif x.between?(75,83) | |
"Standard/Charge/Stun" | |
elsif x.between?(84,92) | |
"Standard/Pulse/Bounce" | |
elsif x.between?(93,99) | |
"Standard/Pulse/Stun" | |
else | |
"Standard/Charge/Pulse" | |
end | |
end | |
end | |
def get_heat | |
if @size == "Tiny" | |
x = rand(1..100) | |
if x.between?(1,45) | |
10 | |
elsif x.between?(46,75) | |
12 | |
elsif x.between?(76,95) | |
14 | |
else | |
16 | |
end | |
elsif @size == "Small" | |
x = rand(1..100) | |
if x.between?(1,30) | |
12 | |
elsif x.between?(31,50) | |
14 | |
elsif x.between?(51,70) | |
16 | |
elsif x.between?(71,90) | |
20 | |
else | |
25 | |
end | |
else | |
x = rand(1..100) | |
if x.between?(1,30) | |
15 | |
elsif x.between?(31,50) | |
18 | |
elsif x.between?(51,70) | |
20 | |
elsif x.between?(71,90) | |
25 | |
else | |
30 | |
end | |
end | |
end | |
def get_size | |
x = rand(1..100) | |
if x.between?(1,25) | |
"Tiny" | |
elsif x.between?(26,75) | |
"Small" | |
else | |
"Medium" | |
end | |
end | |
def get_range | |
if @size == "Tiny" | |
x = rand(1..100) | |
if x.between?(1,5) | |
"10 Feet" | |
elsif x.between?(6,15) | |
"15 Feet" | |
elsif x.between?(16,30) | |
"20 Feet" | |
elsif x.between?(31,70) | |
"25 Feet" | |
elsif x.between?(71,85) | |
"30 Feet" | |
elsif x.between?(86,95) | |
"35 Feet" | |
else | |
"40 Feet" | |
end | |
elsif @size == "Small" | |
x = rand(1..100) | |
if x.between?(1,5) | |
"15 Feet" | |
elsif x.between?(6,15) | |
"20 Feet" | |
elsif x.between?(16,30) | |
"25 Feet" | |
elsif x.between?(31,70) | |
"30 Feet" | |
elsif x.between?(71,85) | |
"35 Feet" | |
elsif x.between?(86,95) | |
"40 Feet" | |
else | |
"45 Feet" | |
end | |
else | |
x = rand(1..100) | |
if x.between?(1,5) | |
"20 Feet" | |
elsif x.between?(6,15) | |
"25 Feet" | |
elsif x.between?(16,30) | |
"30 Feet" | |
elsif x.between?(31,70) | |
"35 Feet" | |
elsif x.between?(71,85) | |
"40 Feet" | |
elsif x.between?(86,95) | |
"45 Feet" | |
else | |
"50 Feet" | |
end | |
end | |
end | |
def get_upgradepoints | |
x = rand(1..100) | |
if x.between?(1,30) | |
"Frame and Emitter" | |
elsif x.between?(31,60) | |
"Frame, Emitter and 1 Tactical" | |
elsif x.between?(61,70) | |
"Frame, Emitter and Optics" | |
elsif x.between?(71,75) | |
"Frame, Emitter, Optics and 1 Tactical" | |
elsif x.between?(76,85) | |
"Frame, Emitter, Optics and 2 Tactical" | |
elsif x.between?(86,95) | |
"Frame, Emitter, Optics and 3 Tactical" | |
else | |
"Frame, Emitter, Optics and 4 Tactical" | |
end | |
end | |
def get_standardequipment | |
x = rand(1..100) | |
if x.between?(1,20) | |
"with Nothing." | |
elsif x.between?(21,40) | |
"with 1 Standard Coolant Pack." | |
elsif x.between?(41,60) | |
"with 2 Standard Coolant Packs." | |
elsif x.between?(61,80) | |
"with 3 Standard Coolant Packs." | |
else | |
"with 4 Standard Coolant Packs." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment