rrcampbell-exe / who-would-win

A cross-universe combat simulator for fans of Pokémon and Dungeons & Dragons.
https://rrcampbell-exe.github.io/who-would-win/
1 stars 0 forks source link

D&D Character Weapon and Spell Selection #5

Closed rrcampbell-exe closed 3 years ago

rrcampbell-exe commented 3 years ago

Description

Currently, weapon-wielding classes can select items from the /api/magic-items/ subset of melee weapons. This is only potentially problematic, as it may make D&D characters of these classes too OP.

Furthermore, spellcasting classes can select spells that are not offensive in nature. As such, they would do no damage during the course of battle, effectively guaranteeing their loss.

Possible Solutions

Weapon-wielding Classes

For weapon-wielding classes, we might consider building in logic where, after a weapon is selected, it attempts to look for the possible damage that weapon might do (damage_dice). If damage_dice returns undefined, we could re-select a weapon until damage_dice returns a value.

Spellcasting Classes

For spellcasting classes, we might consider building in logic where, after a spell is selected, it attempts to look for the possible damage that spell might do (damage). If damage returns undefined, we could re-select a spell until damage returns a value.

rrcampbell-exe commented 3 years ago

Solutions

Weapon-wielding classes

Ultimately, weapon-wielding classes are prohibited from using magic weapons, as they caused the game engine to choke.

Spellcasting classes

The above-cited issues with spellcasting classes were addressed by re-running the dSpellPower function until a damage-dealing spell is selected.