Player lost.

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Player lost.

Post by Lachu »

How do player lost effect (in effects.ruleset file)?

I need this, because I will demonstrate how counters will work (not yet introduced mechanism) in modified ruleset. Ruleset will be called environmentalism and have player lost effect. Player win in they emit smallest amount of CO2 to atmosphere and amount of CO2 in atmosphere are at least some level. All other players will lost.

Probably, I must also modify Victory effect calculation, because my effect will look like
[effect_win]
type = "Lost"
value = 1
reqs =
{
"type", :"value", :"range", "present"
"CounterAboveZero", "WorldCO2Lev", "World", FALSE
"PlayerCounterAbove", "EmmitedCO2", "Player", TRUE
}
#Player counter above comparing given counter for player and other player range.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Player lost.

Post by Ignatus »

Lachu wrote:How do player lost effect (in effects.ruleset file)?

I need this, because I will demonstrate how counters will work (not yet introduced mechanism) in modified ruleset. Ruleset will be called environmentalism and have player lost effect. Player win in they emit smallest amount of CO2 to atmosphere and amount of CO2 in atmosphere are at least some level. All other players will lost.

Probably, I must also modify Victory effect calculation, because my effect will look like
[effect_win]
type = "Lost"
value = 1
reqs =
{
"type", :"value", :"range", "present"
"CounterAboveZero", "WorldCO2Lev", "World", FALSE
"PlayerCounterAbove", "EmmitedCO2", "Player", TRUE
}
#Player counter above comparing given counter for player and other player range.
Give to the player victory by "Victory" effect. Ones not having it on that turn will lose. "Lost" effect would be necessary if we are going to remove one player and the rest will play some more, but your case probably is soluable by just

Code: Select all

[eft_env_victory]
type = "Victory"
value = 1
reqs = {"type", "name", "range", "present"
 "CounterAboveZero", "WorldCO2Lev", "World", FALSE
 "PlayerCounterAbove???", "EmittedCO2", "Player", FALSE
}
I don't yet know how the minimal value of a counter should be better tracked. (Probably let's leave counter comparison for the next ticket, one introducing them is big enough.) Maybe the req would compare the counter value of current player with each one in the range?

Code: Select all

 "PlayerCounterSmaller", "EmittedCO2", "World", FALSE 
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: Player lost.

Post by nef »

Would you reconsider the more general approach for counters that I mentioned in this post. You could add your CO2 proposal to the list of candidates.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Player lost.

Post by Ignatus »

nef wrote:Would you reconsider the more general approach for counters that I mentioned in this post. You could add your CO2 proposal to the list of candidates.
Actually, Lachu has mostly written another mechanism here. As I have responded on the mentioned topic, unhardcoding output types is not so easy. And counter model with events seems to be even more flexible.
Post Reply