Bug Gene tonic potion buff masks corresponding intrinsic

heeheehee

Developer
Staff member
Starting state: I'm hybridized (in this case, with human-goblin; doesn't really matter which). 0 turns of the potion effect.
Code:
> have_effect human-goblin hybrid

Returned: 2147483647

> up human-goblin hybrid

Searching for "Gene Tonic: Goblin"...
Search complete.
Purchasing Gene Tonic: Goblin (1 @ 9,700)...
Purchases complete.
Using 1 Gene Tonic: Goblin...
You acquire an effect: Human-Goblin Hybrid (duration: 30 Adventures)
Finished using 1 Gene Tonic: Goblin.

> have_effect human-goblin hybrid

Returned: 30
Once I use the gene tonic, I can't see that I have the intrinsic. I looked a bit into this, and it seems like in this case, the effect in question appears multiple times in KoLConstants.activeEffects. I'm not sure how to address this well.
 

Bale

Minion
Umm... Stop doing that? Really, there is no advantage to having both the intrinsic and the temporary at the same time since they do not stack.
 

heeheehee

Developer
Staff member
I know there's no advantage, but if I'm writing a script for someone else, then I can't control how many silly things he does :|
 

Darzil

Developer
Once I use the gene tonic, I can't see that I have the intrinsic. I looked a bit into this, and it seems like in this case, the effect in question appears multiple times in KoLConstants.activeEffects. I'm not sure how to address this well.
You say it appears multiple times? Do you mean twice? In which case if it appears twice, one is the intrinsic ?
 

Theraze

Active member
I know there's no advantage, but if I'm writing a script for someone else, then I can't control how many silly things he does :|

If you're writing a script for someone else, you CAN have it check have_effect before it applies the un-needed effect and therefore avoid him doing silly things...
 

heeheehee

Developer
Staff member
You say it appears multiple times? Do you mean twice? In which case if it appears twice, one is the intrinsic ?

At least, I think this is the case.

Theraze: You're suggesting that I strip existing buffs, then check that he has the intrinsic in question? That seems a bit backwards, if you ask me.
 

Bale

Minion
Does it matter? Since have_effect human-goblin hybrid is greater than 0, you know you have the effect so there is no reason to do anything about it.
 

heeheehee

Developer
Staff member
Okay, I'll say more about what I'm doing. I'm looking at human-mer-kin hybrid, and I'm trying to buff for a larva run. I want to check that have_effect human-mer-kin >= 225. I want to be able to say, "Okay, I don't need to extend this buff, since it's about to run out."

I think the same problem would probably show up if you put said gene tonic in a mood, yeah?
 

Theraze

Active member
No, because it would never lose the effect. If you have the intrinsic, the effect is never going away...
 

heeheehee

Developer
Staff member
Uh, moods trigger right before you lose the effect, not after you lose it. Otherwise you'd potentially lose HP / MP from an effect running out.
 

Theraze

Active member
But according to the wiki, have_effect will always return the infinite turns (2147483647) for intrinsics. And so it will never reach 0 or 1 turns remaining, and as such, will never trigger lose_effect...
 

lostcalpolydude

Developer
Staff member
If you have the effect and the intrinsic, mafia reports turns of the effect (demonstrated in the first post).

I agree that something should be done about this, but I don't know what and I haven't felt particularly motivated to look into it.
 

Darzil

Developer
If you have the effect and the intrinsic, mafia reports turns of the effect (demonstrated in the first post).

I agree that something should be done about this, but I don't know what and I haven't felt particularly motivated to look into it.

Agree on motivation, but I think we should end up counting intrinsics differently from effects, which sounds a rather large task. On the plus side, it might allow us to tell the difference between the effect and intrinsic with the same name. Sounds like KoL does consider them different things.
 

Fluxxdog

Active member
Agree on motivation, but I think we should end up counting intrinsics differently from effects, which sounds a rather large task. On the plus side, it might allow us to tell the difference between the effect and intrinsic with the same name. Sounds like KoL does consider them different things.
Easiest thing to test would be Teleportitis.
 

Bale

Minion
Agree on motivation, but I think we should end up counting intrinsics differently from effects, which sounds a rather large task. On the plus side, it might allow us to tell the difference between the effect and intrinsic with the same name. Sounds like KoL does consider them different things.

So, add $intrinsic[] data type? That seems like the only sane way to distinguish them. And have_effect($intrinsic[human-goblin hybrid]) would return a boolean instead of an integer since numeric values are meaningless for intrinsics. I guess for CLI there'd need to be have_intrinsic?
 
Last edited:

Theraze

Active member
Or change functionality and leave have_effect returning the int if you have_effect, but have_intrinsic returns a boolean. And they don't overlap, so script writers would need to write in whichever check they want.

As a positive side effect, that fixes the issue of the different intrinsic and effect bits for... whatever that was they added 3 months ago.
 
Top