| | 25 | =head2 baby_form |
| | 26 | |
| | 27 | Returns the baby Pokemon in this chain, if any. |
| | 28 | |
| | 29 | =cut |
| | 30 | |
| | 31 | sub baby_form { |
| | 32 | my ($self) = @_; |
| | 33 | |
| | 34 | return $self->pokemon( \ 'FIND_IN_SET(flags, "baby")' )->single; |
| | 35 | } |
| | 36 | |
| | 37 | =head2 basic_form |
| | 38 | |
| | 39 | Returns the basic form of this Pokemon. |
| | 40 | |
| | 41 | =cut |
| | 42 | |
| | 43 | sub basic_form { |
| | 44 | my ($self) = @_; |
| | 45 | |
| | 46 | return $self->pokemon( |
| | 47 | \ 'NOT FIND_IN_SET(flags, "baby")', |
| | 48 | { |
| | 49 | order_by => 'id ASC', |
| | 50 | })->first; |
| | 51 | } |
| | 52 | |
| | 53 | =head2 egg_forms |
| | 54 | |
| | 55 | Returns any Pokemon that can result from a breeding in this chain. |
| | 56 | |
| | 57 | =cut |
| | 58 | |
| | 59 | sub egg_forms { |
| | 60 | my ($self) = @_; |
| | 61 | my @ret; |
| | 62 | |
| | 63 | my $baby_form = $self->baby_form; |
| | 64 | if ($baby_form) { |
| | 65 | push @ret, $baby_form; |
| | 66 | } |
| | 67 | |
| | 68 | my $basic_form = $self->basic_form; |
| | 69 | if (not $baby_form |
| | 70 | or $self->baby_item) # e.g. Munchlax with incense |
| | 71 | { |
| | 72 | push @ret, $basic_form; |
| | 73 | } |
| | 74 | |
| | 75 | return @ret; |
| | 76 | } |
| | 77 | |