Page 1 of 1

The solo time/pain bond timer of Uskayaw seems not to work.

PostPosted: Wednesday, 17th July 2019, 10:14
by sdynet
god-passive.cc
  Code:
void uskayaw_prepares_audience()
{
    int count = apply_area_visible(_check_for_uskayaw_targets, you.pos());
    if (count > 0)
    {
        simple_god_message(" prepares the audience for your solo!");
        apply_area_visible(_prepare_audience, you.pos());

        // Increment a delay timer to prevent players from spamming this ability
        // via piety loss and gain. Timer is in AUT.
        you.props[USKAYAW_AUDIENCE_TIMER] = 300 + random2(201);
    }
    else // Reset the timer because we didn't actually execute.
        you.props[USKAYAW_AUDIENCE_TIMER] = 0;
}

void uskayaw_bonds_audience()
{
    int count = apply_area_visible(_check_for_uskayaw_targets, you.pos());
    if (count > 1)
    {
        simple_god_message(" links your audience in an emotional bond!");
        apply_area_visible(_bond_audience, you.pos());

        // Increment a delay timer to prevent players from spamming this ability
        // via piety loss and gain. Timer is in AUT.
        you.props[USKAYAW_BOND_TIMER] = 300 + random2(201);
    }
    else // Reset the timer because we didn't actually execute.
        you.props[USKAYAW_BOND_TIMER] = 0;
}


according to this code, the timer of solo time/pain bond must be initialized if there are no monsters in sight. Am I right? I don't feel like initialization is applied.

Re: The solo time/pain bond timer of Uskayaw seems not to wo

PostPosted: Wednesday, 17th July 2019, 14:01
by byrel
I don't understand the question, but I can provide some pseudocode for how this works. Hopefully that either answers the question, or helps frame in in a way I can understand.

The player object stores a cooldown on each ability (USKAYAW_AUDIENCE_TIMER and USKAYAW_BOND_TIMER)

After all the monsters and clouds, etc. do their actions for a turn, but before the player make their next move, the game does the following:
  1. Gain Usk Piety based on damage done
  2. Decrement Usk Piety based on how long the turn was and how long its been since we did damage.
  3. If you just hit the Para piety breakpoint and USKAYAW_AUDIENCE_TIMER was 0, OR you have enough piety for Paralysis and make a 1:(10+USKAYAW_AUDIENCE_TIMER/turn_length) roll
    • If there are monsters visible, paralyse them and set USKAYAW_AUDIENCE_TIMER to 299+1d201 auts
    • else, clear USKAYAW_AUDIENCE_TIMER
  4. Else, decrement the USKAYAW_AUDIENCE_TIMER by the turn length.
  5. If you just hit the Pain Bond piety breakpoint and USKAYAW_BOND_TIMER was 0, OR you have enough piety for Pain Bond and make a 1:(10+USKAYAW_BOND_TIMER/turn_length) roll
    • If there are monsters visible, paralyse them and set USKAYAW_BOND_TIMER to 299+1d201 auts
    • else, clear USKAYAW_BOND_TIMER
  6. Else, decrement the USKAYAW_BOND_TIMER by the turn length.

Re: The solo time/pain bond timer of Uskayaw seems not to wo

PostPosted: Thursday, 18th July 2019, 09:40
by sdynet
byrel wrote:else, clear USKAYAW_AUDIENCE_TIMER.

else, clear USKAYAW_BOND_TIMER.


This part. Even if the monster is not visible, it seems that the timer is not cleared.

Re: The solo time/pain bond timer of Uskayaw seems not to wo

PostPosted: Thursday, 18th July 2019, 16:41
by Siegurt
sdynet wrote:
byrel wrote:else, clear USKAYAW_AUDIENCE_TIMER.

else, clear USKAYAW_BOND_TIMER.


This part. Even if the monster is not visible, it seems that the timer is not cleared.

What leads you to conclude that that's true? It certainly *looks* to be false from the code you posted.

(Maybe there's some other relevant bit you didn't post, like if say those functions weren't called if there were no monsters in LOS or something?)

Re: The solo time/pain bond timer of Uskayaw seems not to wo

PostPosted: Friday, 19th July 2019, 08:54
by sdynet
I conducted the experiment in wizard mode. So I can not be sure, but I think their timer is 1d201 auts(not 299+1d201 auts) and no timer clear. The following is one of the "power-invoke intervals" that I investigation.

(tuns) - (power-invoke)
269.3 - solo time

270.7 - pain bond

272.1 - solo time

298.0 - solo time

301.5 - pain bond

332.3 - pain bond

335.8 - pain bond

336.5 - solo time

Re: The solo time/pain bond timer of Uskayaw seems not to wo

PostPosted: Friday, 19th July 2019, 15:11
by advil
There are two things going on here. You are right that these counters don't deterministically reset when no enemies are in sight, but I think that might be the intent. The calls to `uskayaw_prepares_audience` and `uskayaw_bonds_audience` are wrapped in a random check that is affected by the counter's current value:

  Code:
int audience_timer = you.props[USKAYAW_AUDIENCE_TIMER].get_int();
...
if (audience_timer == -1 || (you.piety >= piety_breakpoint(2)
            && x_chance_in_y(time_taken, time_taken * 10 + audience_timer)))
    {
        uskayaw_prepares_audience();
    }
    else
        you.props[USKAYAW_AUDIENCE_TIMER] = max(0, audience_timer - time_taken);


The value of the timer makes it less likely that the `x_chance_in_y` roll succeeds. (The -1 case is set on piety crossing the relevant threshold.)

The second thing, and what I'm less sure is intended is the fact that even if audience timer is 0, that roll still will succeed only 1 in 10 times. That is, I'm not sure what the `* 10` on the denominator there is intended to accomplish, given that there's also a timer.