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

Always set Max?-Capacity-SecondaryStat for WEAPON_BASE_EFFECTS #4557

Merged
merged 9 commits into from Jun 22, 2023

Conversation

agrrr3
Copy link
Contributor

@agrrr3 agrrr3 commented Jun 12, 2023

fixes #4555 and #4517 in master

fix temporary changes to capacity/secondary stat (e.g. from PLC_CHARGING) when not being in supply
  https://freeorion.org/forum/viewtopic.php?t=12778&sid=543cf0256e11cd5c604c55d4e093f769

tested:
* defensive and offensive flanking work out of supply
* md2 upgrade happens only in supply
* flux lance, arc disruptor, flak, md1/md2 have the expected values in the ship designer
@agrrr3 agrrr3 force-pushed the 20230612_Fix4555_BrokenFlak branch from 794afcb to b84c62b Compare June 12, 2023 13:42
@agrrr3 agrrr3 force-pushed the 20230612_Fix4555_BrokenFlak branch from b84c62b to c7ca581 Compare June 12, 2023 13:44
@agrrr3
Copy link
Contributor Author

agrrr3 commented Jun 12, 2023

Ok, seems i finally won against the linters. Ready to merge from my side.

playtested:

  • defensive and offensive flanking work out of supply
  • md2 upgrade happens only in supply
  • flux lance, arc disruptor, flak, md1/md2 have the expected values in the ship designer

@agrrr3 agrrr3 changed the title Always set Max-Capacity-SecondaryStat for WEAPON_BASE_EFFECTS Always set Max?-Capacity-SecondaryStat for WEAPON_BASE_EFFECTS Jun 12, 2023
@geoffthemedio
Copy link
Member

Does using flanking allow a ship to upgrade permanently outside of supply? ie. have 72/72, get upgrade tech so have 72/100, use flanking for a turn to have 100/100, keep 100/100 despite never having been in supply range to get upgrade?

@geoffthemedio geoffthemedio added category:bug The Issue/PR describes or solves a perceived malfunction within the game. component:content scripting The Issue/PR deals with the FOCS language, turn events or the universe generator. labels Jun 12, 2023
@agrrr3
Copy link
Contributor Author

agrrr3 commented Jun 14, 2023

Does using flanking allow a ship to upgrade permanently outside of supply? ie. have 72/72, get upgrade tech so have 72/100, use flanking for a turn to have 100/100, keep 100/100 despite never having been in supply range to get upgrade?

in theory not. there is no state involved - the meters get set to maximum every turn. and the max meters get set to values; not modified.

the weapon upgrade techs fire if last turn resupplied is >= the turn the tech got researched.

i will playtest though.

@agrrr3
Copy link
Contributor Author

agrrr3 commented Jun 14, 2023

playtested OK:

  • two stationary ships out of supply increase their stats with flanking
  • research Laser-2 does not increase
  • unapplying flanking policy makes damages drop to previous values
  • flying into supply upgrades laser damage
  • applying flanking increases damage on top of tech damage

@geoffthemedio
Copy link
Member

the weapon upgrade techs fire if last turn resupplied is >= the turn the tech got researched.

Right, that now works differently from how I remembered.

@o01eg
Copy link
Contributor

o01eg commented Jun 14, 2023

the weapon upgrade techs fire if last turn resupplied is >= the turn the tech got researched.

Can we change it that way it doesn't use turn the tech was researched? Then the other empires' tech info could be disabled.

@geoffthemedio
Copy link
Member

I suppose you could add an empire meter or meters to track various weapon upgrade levels, and key the effect off that. Or add a series of specials to the capital and test for / add effects to that. Not sure how you want it to work though... I assume other empires should be able to predict the weapon levels o an empire, but not know that or when that empire researched a tech? Need to share the info somehow then, but specials on the capital or empire meters probably aren't improvements over sharing tech info, in that case...

@agrrr3
Copy link
Contributor Author

agrrr3 commented Jun 15, 2023

the weapon upgrade techs fire if last turn resupplied is >= the turn the tech got researched.

Can we change it that way it doesn't use turn the tech was researched? Then the other empires' tech info could be disabled.

Is wrong effects accounting a big problem here? For implementation the base is that the other empire needs to observe a source of the effect in order for correct accounting. So specials/meters on the capital planet won't really work. Also I do not know if there are public empire meters.

Hiding the research turns but publishing the researched tech (either per FOCS or via public empire meters) would work partly; the effect accounting for ships which are not upgraded would show an unknown malus, but the upgraded ones would have correct accounting.

Another option would be to add a special per ship set to the current damage value coming from the tech (so lower if not upgraded yet) - the special can be observed by enemies so accounting would work. One could probably also repurpose e.g. the max meter for this - we do not really need a max meter for damage anymore. Some complexity/choices there how to handle gifting though; should the base damage downgrade to highest lower tech?

Anyway I think all of this should not delay merging the PR.

agrrr3 and others added 2 commits June 15, 2023 22:17
Co-authored-by: Geoff <geoffthemedio@users.noreply.github.com>
Co-authored-by: Geoff <geoffthemedio@users.noreply.github.com>
@Vezzra Vezzra linked an issue Jun 16, 2023 that may be closed by this pull request
@Vezzra Vezzra added this to the v0.5.1 milestone Jun 16, 2023
@agrrr3 agrrr3 force-pushed the 20230612_Fix4555_BrokenFlak branch from 2d47c73 to b10463d Compare June 18, 2023 07:10
@agrrr3 agrrr3 force-pushed the 20230612_Fix4555_BrokenFlak branch from fd69ba6 to 4887ff2 Compare June 20, 2023 21:53
@geoffthemedio geoffthemedio merged commit 39498c8 into freeorion:master Jun 22, 2023
3 checks passed
@geoffthemedio geoffthemedio added the status:merged All relevant commits of this PR were merged into the master development branch. label Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bug The Issue/PR describes or solves a perceived malfunction within the game. component:content scripting The Issue/PR deals with the FOCS language, turn events or the universe generator. status:merged All relevant commits of this PR were merged into the master development branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flak seems broken Charge/Flanking policies need supply to upgrade damage
4 participants