Coder Social home page Coder Social logo

wizard's Introduction

Readme

wizaRd

A list of D&D 5e spells and some functions to fiddle with them.

Spell data taken from https://github.com/thebombzen/grimoire, originally https://github.com/ephe/grimoire/.

Dice rolls are taken from @FightClubXML when possible, inferred from text using regex when not.

Installation

devtools::install_github('oganm/wizaRd')

Usage

The package includes a list that include all 5e spells called spells. Each element of this list is a list that holds different attributes of the spells.

spells$`Acid Splash` %>% ls
##  [1] "castingTime" "classes"     "components"  "dice"        "duration"   
##  [6] "level"       "name"        "range"       "ritual"      "school"     
## [11] "source"      "tags"        "text"
spells$`Acid Splash`$components
## [1] "V" "S"

Individual spells have a special print function (print.spell). When a spell is called the text for the spell is printed and any dice roll found to be associated with the spell based on the text is rolled

spells$Immolation
## **5th-level evocation**
## 
## **Casting Time**: 1 action
## 
## **Range**: 90 feet
## 
## **Components**: V
## 
## **Duration**: Concentration, up to 1 minute
## 
## Flames wreathe one creature you can see within range. The target must make a Dexterity saving throw. It takes 8d6 fire damage on a failed save, or half as much damage on a successful one. On a failed save, the target also burns for the spell’s duration. The burning target sheds bright light in a 30-foot radius and dim light for an additional 30 feet. At the end of each of its turns, the target repeats the saving throw. It takes 4d6 fire damage on a failed save, and the spell ends on a successful one. These magical flames can’t be extinguished by nonmagical means.
## 
## If damage from this spell kills a target, the target is turned to ash.
## 8d6 3d6
## [1] "Rolls: [ 2 3 4 *6* 2 *6* *6* 4 ]"
## [1] "Rolls: [ 4 *1* 2 ]"
## 8d6 3d6 
##  33   7

The spells object also has a special print function (print.spellList).

head(spells)
## Cantrips
## ========
## Acid Splash
## 
## Level 1
## =======
## Alarm
## Animal Friendship
## Armor of Agathys
## Arms of Hadar
## Bane

A few utility functions exist to create subset spellLists

spells %>% filterSpells(level=c(0,1),class= 'bard',sources='PHB',school='evocation')
## Cantrips
## ========
## Dancing Lights
## Light
## 
## Level 1
## =======
## Cure Wounds
## Faerie Fire
## Healing Word
## Thunderwave
makeBook(level=3)
## 
## Level 1
## =======
## Detect Magic
## Sleep
## Grease
## Tasha’s Hideous Laughter
## Illusory Script
## Shield
## Snare
## Fog Cloud
## 
## Level 2
## =======
## Pyrotechnics
## Snilloc’s Snowball Swarm

wizard's People

Contributors

oganm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wizard's Issues

Package Install Issue Due to `staplr` Dependency

Hi! I love wizaRd but ran into an error when trying to install it on a new machine.

Here's my error:

devtools::install_github('oganm/wizaRd')

> ERROR: dependency ‘staplr’ is not available for package ‘wizaRd’
> * removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/wizaRd’
> Warning message:
> In i.p(...) :
>  installation of package ‘/var/folders/9m/7tv5z0_j2q34mnkv7907vm540000gn/T//Rtmpkl3V4P/file8f995ab077ff/wizaRd_1.0.0.9000.tar.gz’ had non-zero exit status

I believe this is due to staplr getting removed from CRAN recently (see here). That missing dependency then causes wizaRd's installation to fail.

If you've encountered this before and know the solve please let me know!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.