Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summon several kinds of kittycat from Bag of Cats #40656

Merged
merged 6 commits into from
May 19, 2020

Conversation

wapcaplet
Copy link
Contributor

@wapcaplet wapcaplet commented May 17, 2020

Summary

SUMMARY: Features "Allow summoning spells to spawn from a monster group"

Purpose of change

To get all different kinds of cats from the Magiclysm "Bag of Cats" spell, which I've been wanting to do ever since #38889.

Describe the solution

Add a new flag spell_flag::SPAWN_GROUP, which can be provided in a spells "flags" list.

For spells with "effect": "summon", the flag causes the spell to treat the "effect_str" entry as a monster group ID, rather than a monster ID.

In other words, summoning spells used to be limited to a single monster type:

"effect": "summon",
"effect_str": "mon_cat"

Now, they can summon a monster from a group, like so:

"effect": "summon",
"effect_str": "GROUP_STRAY_CATS",
"flags": [ "SPAWN_GROUP" ]

The new flag is documented in a new "Spell Flags" section of MAGIC.md.

Describe alternatives you've considered

I poked at some dead-ends with an effect_list and hard-coded random monster spawns before @KorGgenT pointed me toward this more reasonable solution.

The SPAWN_GROUP flag may be useful for the item-spawning (and possibly vehicle-spawning) spell effects as well, but I did not attempt to implement such for this PR.

Testing

Casting "Bag of Cats" gave a variety of feline forms, as intended.

image

image

image

Tested "Cause Bear" and "Summon Decayed Pouncer" to ensure original summoning behavior still works.

Additional context

There is still one problem I want to solve, which is the way the spell displays in the spell menu. Because monster group IDs do not really have player-readable names, and the spell description layout appears to have a maximum usable width for this field, the full name of the group will not fit:

image

This is fixed now in e5433e4 - see comment below.

@wapcaplet wapcaplet requested a review from KorGgenT as a code owner May 17, 2020 21:09
@wapcaplet
Copy link
Contributor Author

wapcaplet commented May 17, 2020

I found what I think is a good solution to the cutoff of the summoned monster name - effectively swapping the positions of the "Damage" and "Range" sections of the spell info display, so the "Damage" (or "Summon") section gets its own line, and "Range" shares the first line with "AOE".

Here, pictures. Before:

image

After:

image

And this is what "Bag of Cats" looks like now:

image

(Note, final terminology is "2 from GROUP" instead of "2 of GROUP")

This makes the typically shorter strings (Range and AOE) share a line in
two colums, while Damage (or Summon, Spawn, etc.) gets its own line.
@wapcaplet wapcaplet changed the title [WIP] Summon several kinds of kittycat from Bag of Cats Summon several kinds of kittycat from Bag of Cats May 17, 2020
@kwl01skz
Copy link
Contributor

What surprised me was that so many cats were wandering around in my house without even breaking my can.

@wapcaplet
Copy link
Contributor Author

wapcaplet commented May 18, 2020

Travis CI shows an error that appears unrelated to anything in this PR:

src/character.cpp:9477 [Character::migrate_items_to_storage(bool)::<lambda(const item*)>]
ERROR: Could not put telescoping umbrella into inventory.
Check if the profession has enough space.
...
Treating result as failure due to error logged during initialization.

@curstwist curstwist added [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Mods: Magiclysm Anything to do with the Magiclysm mod labels May 18, 2020
@ZhilkinSerg ZhilkinSerg merged commit 593791b into CleverRaven:master May 19, 2020
@wapcaplet wapcaplet deleted the multi-kitties branch May 22, 2020 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON Mods: Magiclysm Anything to do with the Magiclysm mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants