Tíquete #47756

Multipliers shall use counters

: 2023-04-04 00:31 Última Atualização: 2023-04-04 00:31

Relator:
Dono:
(Nenhum)
Estado:
Aberto
Componente:
Marcos:
(Nenhum)
Prioridade:
2
Gravidade:
5 - Medium
Resolução:
Nenhum
Arquivo:
Nenhum

Details

I think, that multipliers should be able to not just point to player's data, but also other entity, like cities. Way to use: Maximum work time. Increase will increase production, but decrease city's health and cause unhappiness.

So, multipliers should have range and store one's value inside counter. Also, checkpoint is something odd in this case, so we must though how to separate this. Multipliers will only points to special counter type, called user-setable or multiplier.

We also should change name of multipliers (read later).

We shall introduce value calculation vector, which should replace value field of effects and also be part of new entity, called restriction. For example:

  1. values_calc_function = {
  2. "type", "range", "value", "default", "reqs"
  3. "set "static", "start_value", 1, none
  4. "multiply", "unit", "defense", 1, none
  5. "multiply", "player", "propaganda", 1, "gov_nationalism"
  6. "divide", "static", "predefined_value", 100, none
  7. "stop_calculations", "stop_calculations", 0, 0, none
  8. }
  9. qov_nationalism_req =
  10. {
  11. "type", "name", "range"
  12. "Government", "Nationalism", "Player"
  13. }
start_value is value set by previous calculation of effects of the same type or - if it is first effect we calculate - some predefined value (dependent on effect type or 0 for restriction)

none req is always evaluated as true

I place stop_calculation to demonstrate way to stop calculation if reqs are fulfilled. In this case it does nothing - just place it at bottom to demonstrate end of list.

After each step of calculation and after end, result is passed to special range of requirement, called Value. Value could have some new reqs, like isAbove, isBellow, changedFromPrevious (for value of counter, but before any processing takes place).

And restriction is a new entity. It will have three requirements vector (+ value vector as effect). First is processed with old value of counter to check if change is possible. Second is processed with new value (calculated from value vector) to check if change is possible. But before first, additional is processed to check if restriction should apply.

Imagine:

  1. [restrictor_tax_monarchy]
  2. name = "RESTR_TAX_MONARCHY"
  3. range = "player"
  4. values_calc = {
  5. "type", "range", "value", "default", "reqs"
  6. "set", "Player", "tax", 0, none
  7. "add", "Player", "science", 0, none
  8. "add", "Player", "luxury", 0, none
  9. }
  10. apply = {
  11. "type", "name", "range"
  12. "Government", "Monarchy", "Player"
  13. }
  14. before = {
  15. "type", "name", "range"
  16. }
  17. after = {
  18. "type", "name", "range"
  19. "isBellow", 60, "Value"
  20. }

Ticket History (1/1 Histories)

2023-04-04 00:31 Updated by: lachu
  • New Ticket "Multipliers shall use counters" created

Attachment File List

No attachments

Editar

Please login to add comment to this ticket » Login