Class: String

Inherits:
Object show all
Defined in:
scripts/01450 Systems/09000 GTS/09000 GTS.rb,
scripts/00002 state.rb,
scripts/00000 Dependencies/00202 PatchRuby.rb

Overview

Class that describe a collection of characters

Instance Method Summary collapse

Instance Method Details

#to_int_version



22
23
24
# File 'scripts/00002 state.rb', line 22

def to_int_version
  split('.').collect(&:to_i).pack('C*').rjust(4, "\x00").unpack1('I>')
end

#to_pokemonPFM::Pokemon?

Convert string to Pokemon if possible

Returns:



1002
1003
1004
1005
1006
# File 'scripts/01450 Systems/09000 GTS/09000 GTS.rb', line 1002

def to_pokemon
  return Marshal.restore(Zlib::Inflate.inflate(unpack('m')[0]))
rescue StandardError
  return nil
end

#to_pokemon_numberself

Convert numeric related chars of the string to corresponding chars in the Pokemon DS font family

Returns:

  • (self)

Author:

  • Nuri Yuri



6
7
8
9
10
11
# File 'scripts/00000 Dependencies/00202 PatchRuby.rb', line 6

def to_pokemon_number
  return self unless Configs.texts.fonts.supports_pokemon_number

  tr!('0123456789n/', '│┤╡╢╖╕╣║╗╝‰▓')
  return self
end