TC Refine Ratio has no effect

Issue #74 resolved
Former user created an issue

https://bitbucket.org/bloodrizer/kitten-game/src/8627455229ea961d3ccccee94c1d2b697a95507a/js/religion.js?at=master&fileviewer=file-view-default#religion.js-879

The issue causing this is because it searches for the effect on the wrong tab. The function call for getting the ratio should be more like this.game.religion.getEffect("tcRefineRatio")

Comments (11)

  1. JP Sugarbroad

    So I tried patching in that fix -- it causes unicorn generation to go crazy due to double-counting of religion bonuses in resource computation.

  2. Boris Zbarsky

    OK. So we could either remove the "RELIGION EFFECTS" bit in calcResourcePerTick in game.js or we could change the sacrifice function in religion.js to use this.game.religion.getEffect("tcRefineRatio") as this issue's filer suggests. I guess the latter is safer, depending on what other places are calling game.getEffect and expecting it to not pick up religion effects... The former seems better in terms of just centralizing all the effects stuff.

  3. JP Sugarbroad

    My read of the code is that removing RELIGION EFFECTS would cause them to become additive instead of multiplicative. I suggest taking the latter route.

  4. Boris Zbarsky

    Hmm. I'm not sure why you think it would become additive instead of multiplicative. In both codepaths ("BUILDINGS AND SPACE EFFECTS" and "RELIGION EFFECTS") the code ends up multiplying perTick by 1 + getEffect("unicornRatio") (with getEffect called on different objects), right? So moving things so that it does this.getEffect("unicornRatio") and gets nonzero seems the same as the current setup where this.getEffect("unicornRatio") returns 0 and then this.religion.getEffect("unicornRatio") returns nonzero...

  5. JP Sugarbroad

    Hm, okay. I was worried that there might be places where both buildings/space and religion have the same ratio defined, and that would switch it from multiplicative (1+bld+space)*(1+religion) to additive (1+bld+space+religion).

  6. Boris Zbarsky

    Ah, that's fair. I can't speak for whether that can happen right now; I haven't looked through the code closely enough.

  7. Log in to comment