Class: PoorPokemon::PokedexPokemon

Inherits:
Object
  • Object
show all
Defined in:
lib/poor-pokemon/pokedexPokemon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arr) ⇒ PokedexPokemon



4
5
6
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 4

def initialize(arr)
  @name, @num, @type1,  @type2, @hp, @att, @def, @spAtt, @spDef, @spd, @totalStats = arr
end

Instance Attribute Details

#attObject

Returns the value of attribute att.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def att
  @att
end

#defObject

Returns the value of attribute def.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def def
  @def
end

#hpObject

Returns the value of attribute hp.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def hp
  @hp
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def name
  @name
end

#numObject

Returns the value of attribute num.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def num
  @num
end

#spAttObject

Returns the value of attribute spAtt.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def spAtt
  @spAtt
end

#spdObject

Returns the value of attribute spd.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def spd
  @spd
end

#spDefObject

Returns the value of attribute spDef.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def spDef
  @spDef
end

#totalStatsObject

Returns the value of attribute totalStats.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def totalStats
  @totalStats
end

#type1Object

Returns the value of attribute type1.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def type1
  @type1
end

#type2Object

Returns the value of attribute type2.



2
3
4
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 2

def type2
  @type2
end

Instance Method Details

#clone(flag = false) ⇒ Object



8
9
10
11
12
13
# File 'lib/poor-pokemon/pokedexPokemon.rb', line 8

def clone (flag=false)
  # creates a copy of this pokedexPokemon object as a pokemon object

  # moves is an array of moves

  #flag is for enemy to have perfect stats

  return PoorPokemon::Pokemon.new([@name, @type1, @type2, @hp.to_i, @att.to_i, @def.to_i, @spAtt.to_i, @spDef.to_i, @spd.to_i], flag)
end