Class: GameData::Type

Inherits:
Base show all
Extended by:
DataSource
Defined in:
scripts/00800 GameData/00100 Serializable/00300 Type.rb

Overview

Type data structure

Author:

  • Nuri Yuri

Constant Summary collapse

DEFAULT_NAME =

Name of the unknown type

'???'

Constants included from DataSource

DataSource::SOURCES

Instance Attribute Summary collapse

Attributes inherited from Base

#db_symbol, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DataSource

[], all, convert_to_symbols, db_symbol, get_id, id_valid?, load

Constructor Details

#initialize(text_id, on_hit_tbl) ⇒ Type

Create a new Type

Parameters:

  • text_id (Integer)

    id of the type name text in the 3rd text file

  • on_hit_tbl (Array<Numeric>)

    table of multiplier when an offensive type hit this defensive type

Instance Attribute Details

#on_hit_tblArray<Numeric>

Result multiplier when a offensive type hit on this defensive type

Returns:

  • (Array<Numeric>)

#text_idInteger

ID of the text that gives the type name

Returns:

Class Method Details

.data_filename

Filename of the file containing the data

Instance Method Details

#hit_by(offensive_type_id) ⇒ Numeric

Return the damage multiplier

Parameters:

  • offensive_type_id (Integer)

    id of the offensive type

Returns:

  • (Numeric)

#nameString

Return the name of the type

Returns: