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

Remove hardcoded quick instances #3504

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Shinthoras0815
Copy link
Contributor

This replaces the hardcoded selection of "QUICK" instances in the going_postal job (mad sorcerers in library) with a dynamic instance selection mechanism. This change allows modders to set their own custom "QUICK" instances.

@PieterVdc
Copy link
Member

If I'm reading correctly now warlocks would start shooting navigating missiles at imps, doesn't sound like something we'd want

@walt253
Copy link
Contributor

walt253 commented Oct 6, 2024

If I'm reading correctly now warlocks would start shooting navigating missiles at imps, doesn't sound like something we'd want

For reference this is what I did on a discontinued PR.

CrInstance get_best_quick_range_instance_to_use(const struct Thing *thing)
{
    struct InstanceInfo* inst_inf;
    for (int p = PRIORITY_MAX; p >= 0; p--)
    {
        for (int i = 0; i < game.conf.crtr_conf.instances_count; i++)
        {
            inst_inf = creature_instance_info_get(i);
            if (inst_inf->priority < p) // Instances with low priority are used last.
                continue;
            if (flag_is_set(inst_inf->instance_property_flags, InstPF_Quick))
            {
                INSTANCE_RET_IF_AVAIL(thing, i);
            }
        }
    }
    return CrInst_NULL;
}

It used a priority parameter and in case of ties it's the first instance on the list the creature uses first.

Shinthoras version is better in my opinion, it checks the range min/max (something I intentionnaly neglected since my reasoning was the vanilla experience don't check the range) and it adds some randomness to the mix.

src/creature_states_combt.c Outdated Show resolved Hide resolved
@PieterVdc
Copy link
Member

I'm not fond of the randomness part of choosing an instance, they're supposed to use something weak to scare them off so they'd leave, not intentionally murder them

@walt253
Copy link
Contributor

walt253 commented Oct 6, 2024

I'm not fond of the randomness part of choosing an instance, they're supposed to use something weak to scare them off so they'd leave, not intentionally murder them

It still pick only those with the QUICK attribute, right?

They are not going to use Meteor unless mapmaker give it QUICK, I think?

Edit: maybe I'm missing your point entirely, that's possible too. 🤔

@PieterVdc
Copy link
Member

navigating missile is in the current list, but not something I'd want warlocks to use if fireball is available

- retain original sorcerer behavior by removing the 'Quick' property from the navigation_missile instance in the default config

- Cleaned up redundant code
@Shinthoras0815 Shinthoras0815 marked this pull request as ready for review October 6, 2024 21:41
@@ -448,7 +448,7 @@ Graphics = ATTACK
RangeMin = 156
RangeMax = MAX
PrimaryTarget = 3
Properties = DESTRUCTIVE QUICK RANGED_ATTACK
Properties = DESTRUCTIVE RANGED_ATTACK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe we just want to keep QUICK on fireball and regular missile (for wizard)? So remove from all the others instances? I don't know, just an idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants