Class: Studio::Type
- Defined in:
- scripts/00800 Studio/00001 Data/00071 Type.rb
Overview
Data class describing a type
Defined Under Namespace
Classes: DamageTo
Instance Attribute Summary collapse
-
#color ⇒ Color?
readonly
Color of the type.
-
#damage_to ⇒ Array<DamageTo>
readonly
List of damage the type deals to another type.
-
#db_symbol ⇒ Symbol
readonly
db_symbol of the type.
-
#id ⇒ Integer
readonly
ID of the type.
-
#text_id ⇒ Integer
readonly
ID of the text of the type in the text files.
Instance Method Summary collapse
-
#hit(other_type) ⇒ Float
Get the modifier of this type when hitting another type.
-
#name ⇒ String
Get the text name of the type.
Instance Attribute Details
#color ⇒ Color? (readonly)
Color of the type
22 23 24 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 22 def color @color end |
#damage_to ⇒ Array<DamageTo> (readonly)
List of damage the type deals to another type
18 19 20 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 18 def damage_to @damage_to end |
#db_symbol ⇒ Symbol (readonly)
db_symbol of the type
10 11 12 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 10 def db_symbol @db_symbol end |
#id ⇒ Integer (readonly)
ID of the type
6 7 8 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 6 def id @id end |
#text_id ⇒ Integer (readonly)
ID of the text of the type in the text files
14 15 16 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 14 def text_id @text_id end |
Instance Method Details
#hit(other_type) ⇒ Float
Get the modifier of this type when hitting another type
33 34 35 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 33 def hit(other_type) return damage_to.find { |damage| damage.defensive_type == other_type }&.factor || 1 end |
#name ⇒ String
Get the text name of the type
26 27 28 |
# File 'scripts/00800 Studio/00001 Data/00071 Type.rb', line 26 def name return text_get(3, @text_id) end |