Skip to contents

This is the general holding class for an sts2 player. It stores the main player data for the run.

Value

A new STS2Player object.

Public fields

run

The STS2Run object that this player object originates from.

playercharacter

The character that the player was playing

deck

The deck of the player at the end of the run. An STS2Deck object.

id

The steam player id or 1 if single player.

max_potion_slot_count

The maximum number of potions a player could hold.

potions

The potions held by the player at the end of the run.

relics

The relics held by the player at the end of the run. An STS2Relics object

Active bindings

max_health

The max health of the character at the end of the run.

Methods


Method new()

Create a new run object from player data.

Usage

STS2Player$new(playerdata, run = NULL, idx = 1)

Arguments

playerdata

The subset of the list output from jsonlite, usually passed in via STS2Run.

run

The STS2Run object that this player object originates from.

idx

The index within the player list from which this player originates.


Method print()

Print an STS2Player object.

Usage

STS2Player$print(..., full = FALSE, floor = FALSE)

Arguments

...

Arguments to pass to print().

full

Whether to show the full deck and relics of the player.

floor

Whether to show the floor on which a card/relic was obtained when full = TRUE.


Method get_cards()

Retrieve the cards of a player.

Usage

STS2Player$get_cards(ignore_basics = FALSE)

Arguments

ignore_basics

If TRUE, don't return basic cards.


Method clone()

The objects of this class are cloneable with this method.

Usage

STS2Player$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.