Class: Studio::Group::Encounter

Inherits:
Object
  • Object
show all
Defined in:
scripts/00800 Studio/00001 Data/00011 Group.rb

Overview

Data class describing an Encounter for a wild group

Defined Under Namespace

Classes: LevelSetup, ShinySetup

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encounter_rateInteger (readonly)

Encounter rate of the creature in its group

Returns:



97
98
99
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 97

def encounter_rate
  @encounter_rate
end

#extraHash (readonly)

Additional info for the creature (to generate it)

Returns:

  • (Hash)


101
102
103
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 101

def extra
  @extra
end

#formInteger (readonly)

Form of the creature that should be encountered

Returns:



85
86
87
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 85

def form
  @form
end

#level_setupLevelSetup (readonly)

Level setup of the creature that should be encountered

Returns:



93
94
95
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 93

def level_setup
  @level_setup
end

#shiny_setupShinySetup (readonly)

Shiny attribute setup for the creature

Returns:



89
90
91
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 89

def shiny_setup
  @shiny_setup
end

#specieSymbol (readonly)

db_symbol of the creature that should be encountered

Returns:

  • (Symbol)


81
82
83
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 81

def specie
  @specie
end

Instance Method Details

#to_creature(level = nil) ⇒ PFM::Pokemon

Convert the encounter to an actual creature

Parameters:

  • level (Integer) (defaults to: nil)

    level generated through outside factor (ability / other)

Returns:



106
107
108
109
# File 'scripts/00800 Studio/00001 Data/00011 Group.rb', line 106

def to_creature(level = nil)
  level ||= rand(level_setup.range)
  return PFM::Pokemon.new(specie, level, shiny_setup.shiny, shiny_setup.not_shiny, form, extra)
end