HomeWildfire Games

Remove team bonus when the source player is defeated. Reviewed by wraitii.
AuditedrP19093

Description

Remove team bonus when the source player is defeated. Reviewed by wraitii.
Differential Revision: https://code.wildfiregames.com/D12

Event Timeline

leper raised a concern with this commit.Jan 1 2017, 6:29 PM
leper added a subscriber: leper.
leper added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
431

Messed up indentation.

/ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js
131

Messed up indentation.

fatherbushido marked 2 inline comments as done.EditedJan 1 2017, 6:38 PM

Thanks (sorry for that)!

Edit: (Well, I should have add the new diff here instead of commiting directly. Adressed in r19094.)

leper accepted this commit.Jan 1 2017, 6:44 PM

Hard to notice in inline diffs here, guess I'll have to look at plain/raw diffs again...

No clue how to handle that, I'm also not quite sure how to handle you fixing that, but I'll just link to rP19094 (r19094 doesn't work here it seems) and hope it works (in addition to accepting this commit; which is strange given that I can't link to a reason for doing so)

elexis raised a concern with this commit.Mar 31 2018, 5:15 PM
elexis added a subscriber: elexis.

(fixes incoming)

/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

The defeated player still receives team bonuses.

431

This cleans the aura of every entity globally instead of only working on player entities, as pointed out by fatherbushido in the according ticket #5099.

(The defeat message shouldn't be broadcasted to begin with by the looks of things however.)

This commit now has outstanding concerns.Mar 31 2018, 5:15 PM
fatherbushido added inline comments.Apr 2 2018, 5:16 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

That wasn't really a leftover of this commit.
I didn't do anything here at the time as doing something here would have other (design) implications which needed discussions.

fatherbushido added inline comments.Apr 2 2018, 9:32 PM
/ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js
131

testAuras("global", (name, cmpAuras) => {
TS_ASSERT_EQUALS(ApplyValueModificationsToTemplate("Component/Value", 5, playerID[1], template), 15);
playerState = "defeated";
cmpAuras.OnPlayerDefeated();
TS_ASSERT_EQUALS(ApplyValueModificationsToTemplate("Component/Value", 5, playerID[1], template), 5);
}

could have been better

elexis added inline comments.Apr 11 2018, 5:05 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

Which use case could apply to applying auras to defeated players?
Isn't it a clear design if defeated players count as non-existant players?

/ps/trunk/binaries/data/mods/public/simulation/components/tests/test_Auras.js
131

To be continued at D1430.

fatherbushido added inline comments.Apr 11 2018, 6:26 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

Remark was mainly about gaia.
But anyway, the suggested optitmization is not related to this specific commit.

elexis added inline comments.Apr 11 2018, 6:34 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

It said "Remove team bonus when the source player is defeated", so I commented it here as to me it looks like this commit should have therefore introduced a defeated check in this line. But blame is not so important as getting it fixed. Do you agree that I can add the defeated condition here?

fatherbushido added inline comments.Apr 11 2018, 7:10 PM
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

I still don't see the link with that commit ('source' vs 'target').

I have not to agree with anything right now. But removing defeated player when recomputing affected players seems probably wanted and probably an optimization. Though it's hardly noticeable. (All target entities but player entities should already have been caught somewhere when changing ownership to gaia, so the only remaining case is when the player entity is the target. Example : resource counter of a defeated player which continue to increase). I didn't/don't know what is done for techs.

elexis accepted this commit.Apr 13 2018, 6:19 PM
elexis added inline comments.
/ps/trunk/binaries/data/mods/public/simulation/components/Auras.js
97

Which is noticeable to players in the summary graphs or when changing the perspective in observermode.
Thanks for the feedback!

All concerns with this commit have now been addressed.Apr 13 2018, 6:19 PM