| @@ 2-18 (lines=17) @@ | ||
| 1 | # Tipos de pergamino |
|
| 2 | # TODO: Mapear los hechizos |
|
| 3 | class Pergamino < Util |
|
| 4 | def name |
|
| 5 | pergamino(id)['name'] |
|
| 6 | end |
|
| 7 | ||
| 8 | def precio |
|
| 9 | pergamino(id)['precio'] |
|
| 10 | end |
|
| 11 | ||
| 12 | def max # Max num. permitido |
|
| 13 | pergamino(id)['hechizos'] |
|
| 14 | end |
|
| 15 | ||
| 16 | def hechizos |
|
| 17 | spells.map { |s| Elemental.new(id: s).name } |
|
| 18 | end |
|
| 19 | end |
|
| 20 | ||
| @@ 1-13 (lines=13) @@ | ||
| 1 | # Pociones de todo tipo |
|
| 2 | class Pocion < Util |
|
| 3 | def name |
|
| 4 | pocion(id)['name'] |
|
| 5 | end |
|
| 6 | ||
| 7 | def efecto |
|
| 8 | pocion(id)['efecto'] |
|
| 9 | end |
|
| 10 | ||
| 11 | def precio |
|
| 12 | pocion(id)['precio'] |
|
| 13 | end |
|
| 14 | end |
|
| 15 | ||
| @@ 1-13 (lines=13) @@ | ||
| 1 | # Bisuteria variada |
|
| 2 | class Miscelanea < Item |
|
| 3 | def name |
|
| 4 | miscelanea(id)['name'] |
|
| 5 | end |
|
| 6 | ||
| 7 | def fits |
|
| 8 | miscelanea(id)['fits'] |
|
| 9 | end |
|
| 10 | ||
| 11 | def precio |
|
| 12 | miscelanea(id)['precio'] |
|
| 13 | end |
|
| 14 | end |
|
| 15 | ||
| @@ 1-13 (lines=13) @@ | ||
| 1 | # Objetos raros como llaves, setas o mapas. |
|
| 2 | class Pieza < Util |
|
| 3 | def name |
|
| 4 | pieza(id)['name'] |
|
| 5 | end |
|
| 6 | ||
| 7 | def uso |
|
| 8 | pieza(id)['uso'] |
|
| 9 | end |
|
| 10 | ||
| 11 | def precio |
|
| 12 | pieza(id)['precio'] |
|
| 13 | end |
|
| 14 | end |
|
| 15 | ||