-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved village generation. Saves migration. Bump to 0.02a
- Loading branch information
Showing
5 changed files
with
67 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@echo off | ||
set NAME=social-emperors_0.01a | ||
set NAME=social-emperors_0.02a | ||
pyinstaller --onefile --add-data "..\..\assets;assets" --add-data "..\..\flash;flash" --add-data "..\..\stub;stub" --add-data "..\..\templates;templates" --paths ..\..\. --workpath .\work --distpath .\dist --specpath .\bundle --noconfirm --name %NAME% ..\server.py | ||
echo Done. | ||
pause>NUL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import random | ||
|
||
from engine import timestamp_now | ||
|
||
version_name = "alpha 0.02" | ||
version_code = "0.02a" | ||
|
||
def migrate_loaded_save(save: dict) -> bool: | ||
# fix 0.01a saves | ||
if "version" not in save: | ||
save["version"] = "0.01a" | ||
|
||
if save["version"] == version_code: # save is from the current version | ||
return False | ||
|
||
# 0.01a -> 0.02a | ||
if save["version"] == "0.01a": | ||
save["maps"][0]["timestamp"] = timestamp_now() | ||
save["privateState"]["dartsRandomSeed"] = abs(int((2**16 - 1) * random.random())) | ||
save["version"] = "0.02a" | ||
|
||
print(" > migrated to 0.02a") | ||
|
||
# # 0.02a -> 0.03a | ||
# if save["version"] == "0.02a": | ||
# save["version"] = "0.03a" | ||
# print(" > migrated to 0.03a") | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters