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

Adrenaline Pump CBM glitch #14719

Closed
Malkeus opened this issue Jan 5, 2016 · 11 comments

Comments

Projects
None yet
4 participants
@Malkeus
Copy link
Contributor

commented Jan 5, 2016

Ok, so this is another one from the forum. The adrenaline pump cbm gives the player the adrenaline comedown debuff, instantly upon use, but displays the expected "YOu feel a rush of adrenaline" message. During testing with debug mode on, I got this message "Bad Intensity, ID:adrenaline". After waiting one turn, the adrenaline comedown vanished and was replaced with Adrenaline rush and gave all its proper bonuses. The duration at that point for adrenaline rush was 199, so we've lost 1 turn of adrenaline rush to the glitch. Upon reaching 149, adrenaline comedown kicks in as expected. Then I tried activating the pump again...and the counter went to 156. Just 7 more turns of adrenaline rush for 50 power.

I went and found the relevant code, and adrenaline pump cbm gives an initial duration of 200, with additional activations giving 50 duration. I'm trying to work out the math in add_effect, but it's not exactly my strong suit.

So two errors to report;
1 "Bad Intensity, ID:adrenaline" at activation, leading to 1 turn of adrenaline comedown before the rush kicks in.
2. Activating adrenaline pump while already affected with adrenaline only gives about 7 turns of additional bonus, should give 50.

Adrenaline pump cbm : bionics.cpp line 895
add_effect(): creature.cpp line 772

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

This also happens with the regular adrenaline injector. One turn of comedown, the rush kicks in at 199 turns. Additional injections give 30 points on the counter, but the code says 80 (with a side of possible death, woot). I don't think the death code is working either, but I can't find it so...

adrenaline injector : iuse.cpp line 6015

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Hahaha...death code works, no worries there. Help me savescum, you're my only hope...

@evilexecutive

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2016

It's only a minor issue, but I discovered this bug during an extremely critical moment in a fight with a super big monster. It -nearly- costed my character her life, as the one turn of it not applying was absolutely critical. I'm sure lots of other people using their adrenaline during key moments would also be similarly imperiled.

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

The more vexing issue imo is the fact that neither one gives the correct
extension to the duration. The single turn lag wouldn't be an issue,
except...when you need the adrenaline rush you need it RIGHT now. Plus that
single turn of negative effects reduces your speed by 10 percent, which can
be very bad.

And it gives an error message so...mustbefixed.
On Jan 4, 2016 8:27 PM, "evilexecutive" notifications@github.com wrote:

It's only a minor issue, but I discovered this bug during an extremely
critical moment in a fight with a super big monster. It -nearly- costed my
character her life, as the one turn of it not applying was absolutely
critical. I'm sure lots of other people using their adrenaline during key
moments would also be similarly imperiled.


Reply to this email directly or view it on GitHub
#14719 (comment)
.

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Ok, so turns out there's a dur_add_perc field. If the effect is present, then it adds duration * dur_add_perc / 100, so the cbm is giving the correct amount. The injector is giving slightly more than double what it should at 30 turns. 80 * 15 / 100 is 12. I'm confused. And the intensity thing is checked in 3 different spots with the same message at each, good times.

@ejseto

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2016

Heh. The default value for the intensity variable in add_effect() is 0. The function is called to add adrenaline without specifying the intensity, so it always has 0 intensity, leading to the debug message. The CBM and injector should call add_effect() with intensity = 2, corresponding to an adrenaline high. Leaving it to the default of 0 causes it to be reset to 1 (with attendant debug message), causing 1 turn of adrenaline comedown, before again being reset to 2 (because the duration is so long).

The default value for intensity in add_effect() should also probably be changed since it causes an error message in the same function.

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Ah, thanks for explaining what was going on, I got lost trying to follow add_effect. This sounds like an easy fix, something like:
add_effect("adrenaline", 200, 2);
should work, right? I'm going to try it out here at home and see what happens.

@ejseto

This comment has been minimized.

Copy link
Contributor

commented Jan 5, 2016

Not quite, since there are several parameters in between.

virtual void add_effect( efftype_id eff_id, int dur, body_part bp = num_bp, bool permanent = false,
                                 int intensity = 0, bool force = false ) override;
@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

you beat the compiler on correcting me, but just barely haha. I want those to stay at their default value's...hmm. I will study more...GOOGLE!

@Malkeus

This comment has been minimized.

Copy link
Contributor Author

commented Jan 5, 2016

Ok, the compiler didn't choke on
add_effect( "adrenaline", 200, num_bp, false, 2);
I'll try it out and see what happens

Malkeus added a commit to Malkeus/Cataclysm-DDA that referenced this issue Jan 5, 2016

Fixes CleverRaven#14719. Adrenaline CBM and Adrenaline Injector spent…
… 1 turn on causing Adrenaline Comedown before becoming Adrenaline Rush, leading to unexpected delays upon activation.

The default intensity is 0, but the duration given requires intensity 2, leading to the 1 turn lag and a debug message.
Mycus Wrath suffered from the same error, this is corrected as well. There may be more effects with this error, I will look into it.
@TravisDean

This comment has been minimized.

Copy link

commented Jan 16, 2017

Was this ever pushed into origin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.