Add phase begin and end signals
Logically, player_phase_end signal should be called where now there is do_reveal_effects() since it is also kinda a gimmick bonus worth unhardcoding (unlikely tech_parasite stuff that is pretty much calculatable; and maybe some nearby functions may go to Lua as well), just it is the very end of the end_phase() code. When the game is played in the concurrent mode, turn_started signal can do pretty the same task as well. But might we want more signals?..
Actually, I decided to add 3 signals. One that is designed to be used for #42659 is player_alive_phase_end(Player). "End of the end" (and also events for all phase players, including lost ones) is held by player_phase_end(Player) that is called after all phase cities are processed and tech upkeeps are paid. player_phase_begin(Player, bool) is added for symmetry, the second parameter says if the phase really begins or just was loaded from a savegame.
Looks good, and has value also outside the autoupgrade work, so should go in on its own right.
Will you provide also a version that applies to master?
Reply To cazfi
Looks good, and has value also outside the autoupgrade work, so should go in on its own right. Will you provide also a version that applies to master?
Here it is.
Add signals "player_phase_begin" and "player_phase_end" with argument of the player (and maybe some specifications of other players sharing the phase?) Called from srv_main.c, the former in begin_phase() after update_unit_activities() and the latter in end_phase() after do_tech_parasite_effect(). Purposes: