Skip to content

Commit

Permalink
Merge pull request #1868 from avrae/jokeen/2022w42
Browse files Browse the repository at this point in the history
Jokeen/2022w42
  • Loading branch information
Croebh committed Oct 18, 2022
2 parents 56d6dbc + 354a276 commit f3ce1ba
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions aliasing/api/statblock.py
Expand Up @@ -782,6 +782,17 @@ def max_pact_slots(self):
"""
return self._spellbook.max_pact_slots

def find(self, spell_name: str):
"""
Returns a list of the spells of the given name in the spellbook, case-insensitive.
:rtype: List[AliasSpellbookSpell]
"""
if self._spells is None:
self._spells = [AliasSpellbookSpell(s) for s in self._spellbook.spells]

return [spell for spell in self._spells if spell_name.lower() == spell.name.lower()]

def slots_str(self, level):
"""
:param int level: The level of spell slot to return.
Expand Down
6 changes: 6 additions & 0 deletions cogs5e/initiative/cog.py
Expand Up @@ -524,6 +524,7 @@ async def reroll(self, ctx, *args):
Rerolls initiative for all combatants, and starts a new round of combat.
__Valid Arguments__
`-restart` - Resets the round counter (effectively restarting initiative).
`-effects` - Removes all effects from all combatants
"""
combat = await ctx.get_combat()
a = argparse(args)
Expand All @@ -535,6 +536,11 @@ async def reroll(self, ctx, *args):
if a.last("restart"):
combat.round_num = 0

# -reset (#1867)
if a.last("effects"):
[combatant.remove_all_effects() for combatant in combat.combatants]
await ctx.send("Removed effects from all combatants.")

# repost summary message
old_summary = combat.get_summary_msg()
new_summary = await ctx.send(combat.get_summary())
Expand Down
2 changes: 1 addition & 1 deletion cogs5e/pbpUtils.py
Expand Up @@ -43,7 +43,7 @@ async def embed(self, ctx, *, args):
-image <image url>
-footer <footer text>
-f "<Field Title>|<Field Text>[|inline]"
(e.g. "Donuts|I have 15 donuts|inline" for an inline field, or "Donuts|I have 15 donuts" for one with its own line.)
(e.g. "Donuts|I have 15 donuts|inline" for up to 3 inline fields on a single line, or "Donuts|I have 15 donuts" for one with its own line.)
-color [hex color]
Leave blank for random color.
-t <timeout (0..600)>
Expand Down
5 changes: 5 additions & 0 deletions ddb/client.py
Expand Up @@ -93,6 +93,11 @@ async def get_accessible_entities(self, ctx, user_id, entity_type):
if entity.is_free or user_licenses & entity.license_ids:
accessible.add(entity.entity_id)

# source 14 is TftYP, and 16-22 are the modules within.
# DDB only gives entitlements for the modules
if entity_type == "source" and {16, 17, 18, 19, 20, 21, 22}.issubset(user_licenses):
accessible.add(14)

log.debug(f"Discord user {user_id} can see {entity_type}s {accessible}")

return accessible
Expand Down

0 comments on commit f3ce1ba

Please sign in to comment.