Learn R Programming

dndR (version 3.0.0)

spell_list: List Spells Based on Criteria

Description

Query list of all fifth edition Dungeons & Dragons spells (2014 version) based on partial string matches between user inputs and the relevant column of the spell information data table. Currently supports users querying the spell list by spell name, which class lists allow the spell, spell's level, the school of magic the spell belongs in, whether or not the spell can be cast as a ritual, and the time it takes to cast the spell. All character arguments are case-insensitive (note that the ritual argument expects a logical). Any argument set to `NULL` (the default) will not be used to include/exclude spells from the returned set of spells

Usage

spell_list(
  name = NULL,
  class = NULL,
  level = NULL,
  school = NULL,
  ritual = NULL,
  cast_time = NULL,
  ver = "2014"
)

Value

(dataframe) 10 columns of information with one row per spell(s) that fit(s) the user-specified criteria. If no spells fit the criteria, returns a message to that effect instead of a data object

Arguments

name

(character) text to look for in spell names

class

(character) character class(es) with the spell(s) on their list

level

(character) "cantrip" and/or the minimum required spell slot level

school

(character) school(s) of magic within which the spell belongs (e.g., 'evocation', 'necromancy', etc.)

ritual

(logical) whether the spell can be cast as a ritual

cast_time

(character) either the phase of a turn needed to cast the spell or the in-game time required (e.g., "reaction", "1 minute", etc.)

ver

(character) which version of fifth edition to use ("2014" or "2024"). Note that only 2014 is supported and entering "2024" will print a warning to that effect

Examples

Run this code
# Search for evocation spells with 'fire' in the name that a wizard can cast
dndR::spell_list(name = "fire", class = "wizard", school = "evocation")

Run the code above in your browser using DataLab