|
|
@ -1,3 +1,5 @@ |
|
|
|
import base64 |
|
|
|
|
|
|
|
from flask_sqlalchemy import SQLAlchemy |
|
|
|
from ..models import db, BaseModel |
|
|
|
|
|
|
@ -120,7 +122,7 @@ class Spell(BaseModel): |
|
|
|
'is_divine': self.is_divine, |
|
|
|
'arcane': self.arcane, |
|
|
|
'is_arcane': self.is_arcane, |
|
|
|
'description': self.description #.replace('"', '\\"').replace("'", "\\'") |
|
|
|
'description': base64.b64encode(self.description.encode('ascii')).decode('ascii') |
|
|
|
} |
|
|
|
return spell_dict |
|
|
|
|
|
|
@ -283,6 +285,13 @@ class CharacterNPC(BaseModel): |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if self.guild.is_divine_spellcaster or self.guild.is_arcane_spellcaster: |
|
|
|
npc_dict['spells'] = [] |
|
|
|
spell_list = self.spell_list() |
|
|
|
for level in spell_list: |
|
|
|
for spell in spell_list[level]: |
|
|
|
npc_dict['spells'].append(spell.roll20_format) |
|
|
|
|
|
|
|
if self.ranged: |
|
|
|
npc_dict['ranged'] = { |
|
|
|
'name': self.ranged.name, |
|
|
|