Fork of https://github.com/modality/charred-black.
Short term, has some fixes.
Long term, may include a tool to create and edit stock/lifepath/skill/trait data.
http://charred.obscuritus.ca:8080/#/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
735 B
34 lines
735 B
module Charred
|
|
class Stock
|
|
@@default_stride = 7
|
|
|
|
attr :key
|
|
attr :name
|
|
attr :stride
|
|
attr :common_traits
|
|
attr :starting_stats
|
|
|
|
def initialize(h)
|
|
@key = h["key"]
|
|
@name = h["name"] || @key
|
|
@stride = h["stride"] || @@default_stride
|
|
@adjective = h["adjective"] || @key+"ish"
|
|
@common_traits = h["common_traits"]
|
|
@starting_stats = h["starting_stats"]
|
|
end
|
|
|
|
def as_json(options = {})
|
|
{
|
|
"key" => @key,
|
|
"name" => @name,
|
|
"stride" => @stride,
|
|
"adjective" => @adjective,
|
|
"common_traits" => @common_traits,
|
|
"starting_stats" => @starting_stats
|
|
}
|
|
end
|
|
def to_json(*a)
|
|
as_json.to_json(*a)
|
|
end
|
|
end
|
|
end
|
|
|