safari_zone: R6 Class Representing the Safari Zone from Pokemon Blue...

Description Details Public fields Methods See Also Examples

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## 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)

matt-dray/safar6 documentation built on Feb. 6, 2021, 1:03 p.m.