Skip to content

Add the new power state Offline.#245

Merged
nthykier merged 4 commits intomasterfrom
testing/offline
Apr 1, 2020
Merged

Add the new power state Offline.#245
nthykier merged 4 commits intomasterfrom
testing/offline

Conversation

@Xenega
Copy link
Member

@Xenega Xenega commented Mar 19, 2020

Offline is used when the base has no cpu.
It's the same than Sleep but cannot be changed.

Idea by @Wuzzy2 in issue #239.

Offline is used when the base has no cpu or building.
It's the same than Sleep but cannot be changed.

Close #238.
Close #239.
@nthykier
Copy link
Member

@Wuzzy2 Great idea. :)
@Xenega Thanks for working on this. :)

I think we need a better way to deal with the g.pl.recalc_cpu() issue during loading of the save game. I was trying to implement a similar change before you submitted this and I had issues getting the recalc_cpu() flow right as well.

What do you think of g.pl.recalc_cpu() checking whether we are loading a save game and then ignoring the call if we are. The flag would be start when loading starts and the finally block for loading will clear it and call g.pl.recalc_cpu() once when we know everything else is loaded correctly?

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Mar 20, 2020

OK, I have finally gotten around to actually test this, and it works fine.

One thing I noticed it that you are now able to change the power state in bases in which the CPU is complete, but you build other items.
Previously, the power state was locked at “Active” while building a non-CPU object in a base with finished CPU. I don't know if this is intentional, I'm just mentioning it to you, just in case.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Mar 20, 2020

Hmmm, another change I noticed:

While you are building CPU, the detection% goes down like in Sleep. Previously, you were fully vulnerable to detection while building CPU.

This is a major gameplay change which might make the game easier (not sure). I hope you know what you're doing …

@Xenega
Copy link
Member Author

Xenega commented Mar 30, 2020

@Wuzzy2 Yes it's intentional. I want to simplify power state to use only cpu.
@nthykier Unfortunately, better solutions needs to add completely new complex abstraction, so I will do that.

Xenega added 2 commits March 30, 2020 21:06
Avoid doing some action when not initialized (recalc_cpu).
Centralize initialization process (task_resets, recalc_cpu, play_music).

Thanks: nthykier
@nthykier nthykier merged commit c9269d0 into master Apr 1, 2020
@nthykier nthykier deleted the testing/offline branch June 27, 2020 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants