Package 'safar6'

Title: Simulate the Safari Zone from Pokemon Blue with R6
Description: An R6-class object to simulate simplified gameplay elements of the Safari Zone sub-area from Pokémon Blue (1998) using OOP.
Authors: Matt Dray [aut, cre]
Maintainer: Matt Dray <[email protected]>
License: MIT + file LICENSE
Version: 0.1.1
Built: 2024-11-11 02:42:31 UTC
Source: https://github.com/matt-dray/safar6

Help Index


Typewriter-style Concatenate and Print

Description

Input text-string and output one character at a time given a delay. Aims to mimic the Pokemon Blue progressive text reveal, like typewriter output.

Usage

cat_tw(x, sleep = 0.02)

Arguments

x

A character string of length 1.

sleep

Numeric, length 1. System delay in seconds.

Value

Output to console.

Examples

## Not run:  cat_typewriter("Example text.", 0.2)

Data for Encounters with Wild Pokemon

Description

A dataset containing the Pokemon you can encounter in the Safari Zone in Pokemon Blue and their statistics.

Usage

pokemon

Format

A data frame with 10 rows and 10 variables:

game

The Pokemon generation 1 game variant. BLUE only for now.

area

The area of the Safari Zone (CENTER only for now)

tile

The terrain on which the player is standing (GRASS only for now).

species

The encounter Pokemon's species.

level

The encounter Pokemon's level.

hp_base

The base speed for the species.

speed_base

The base speed for the species.

catch_base

The base catch rate for the species.

slot

Encounter rate slot, which determines encounter_rate

encounter_rate

Chance of encounter.

Source

https://github.com/pret/pokered and https://bulbapedia.bulbagarden.net/


R6 Class Representing the Safari Zone from Pokemon Blue (1998)

Description

An R6Class object to simulate simplified gameplay elements of the Safari Zone sub-area from Pokemon Blue (1998).

Details

The first generation of Pokemon games were developed for the Nintendo Game Boy by Game Freak (https://www.gamefreak.co.jp/) and published by Nintendo (https://www.nintendo.com). Pokemon as a property is owned by The Pokemon Company (https://www.pokemon.co.jp/).

Public fields

name

Character. Player's name.

steps

Numeric. Steps remaining (500 at start).

balls

Numeric. Safari Balls remaining (30 at start).

captures

Numeric. Count of wild Pokemon captured (0 at start).

bills_pc

Dataframe. Details of wild Pokemon caught (empty at start).

Methods

Public methods


Method new()

Create a new Safari Zone object.

Usage
safari_zone$new()
Returns

A SafariZone-class object.


Method print()

Create a new Safari Zone print method.

Usage
safari_zone$print()
Returns

A console message with steps and balls remaining.

Examples
\dontrun{
    x <- safar6::safari_zone$new()  # initialise class
    x$print()  # print the object, see stats
}

Method pause()

Simulate the pause function from the original game.

Usage
safari_zone$pause()
Returns

A console message with steps and balls remaining.

Examples
\dontrun{
    x <- safar6::safari_zone$new()  # intialise class
    x$pause()  # 'pause' the game, see stats
}

Method step()

Take a step in the Safari Zone.

Usage
safari_zone$step()
Returns

Either nothing, or a wild encounter.

Examples
\dontrun{
    x <- safar6::safari_zone$new()  # initialise class
    x$step()   # take step, prints steps remaining
}

Method clone()

The objects of this class are cloneable with this method.

Usage
safari_zone$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

print

Examples

## Not run:  x <- safar6::safari_zone$new() 

## ------------------------------------------------
## Method `safari_zone$print`
## ------------------------------------------------

## Not run: 
    x <- safar6::safari_zone$new()  # initialise class
    x$print()  # print the object, see stats

## End(Not run)

## ------------------------------------------------
## Method `safari_zone$pause`
## ------------------------------------------------

## Not run: 
    x <- safar6::safari_zone$new()  # intialise class
    x$pause()  # 'pause' the game, see stats

## End(Not run)

## ------------------------------------------------
## Method `safari_zone$step`
## ------------------------------------------------

## Not run: 
    x <- safar6::safari_zone$new()  # initialise class
    x$step()   # take step, prints steps remaining

## End(Not run)