Skip to content

Instantly share code, notes, and snippets.

@rendicott

rendicott/eowcf.py

Last active Jun 18, 2020
Embed
What would you like to do?
generate utopia game end of war ceasefire throne page message
#!/usr/bin/env python
#
# eowcf.py
#
# Generates the throne page end of war cease fire message for a Utopia kingdom
#
# Run it with the month and first day that the end of war cease fire begins and it will
# generate a timeline of events to post to the throne page so that everyone knows
# when they need to do things.
#
# Usage:
# python eowcf.py <month> <day>
#
# Example:
# python eowcf.py "January" "24th"
import sys
start_month = sys.argv[1]
start_day = sys.argv[2]
eowcf_plan = [
{"Hour": 0, "Message": "explore to desire land mass/drop wages 10%"},
{"Hour": 0, "Message": "flip to banks/towers/ guild build"},
{"Hour": 0, "Message": "Commence affluent ritual( if we have enough runes supply)"},
{"Hour": 12, "Message": "activate affluent ritual( min 40 casts)"},
{"Hour": 23, "Message": "start drafting on emergence/ patriotism( depend on your ppa)"},
{"Hour": 33, "Message": "Commence expedient ritual"},
{"Hour": 47, "Message": "flip stable"},
{"Hour": 63, "Message": "raise wages 200%"},
{"Hour": 69, "Message": "flip 25 % armouries ( with builder boon)"},
{"Hour": 81, "Message": "activate expedient ritual and train army elite/off spec / Def spec/ thieves( with Inspire army)"},
{"Hour": 93, "Message": "commence war ritual"},
{"Hour": 96, "Message": "end of war cease fire"},
]
def build_calendar():
calendar = {}
months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
]
index = 0
days = [
"1st", "2nd", "3rd", "4th", "5th", "6th", "7th",
"8th", "9th", "10th", "11th", "12th", "13th", "14th",
"15th", "16th", "17th", "18th", "19th", "20th", "21st",
"22nd", "23rd", "24th" ]
for month in months:
for day in days:
index+=1
calendar[index] = {"Month": month, "Day": day}
return calendar
def index_from_month_day(calendar, month, day):
for i,v in calendar.iteritems():
if calendar[i].get("Month") == month and calendar[i].get("Day") == day:
return i
def fill_plan(start, calendar):
body = ""
cal_size = len(calendar)
for entry in eowcf_plan:
index = start + entry.get("Hour")
if index >= cal_size:
index = index - cal_size + 1
month = calendar[index].get("Month")
day = calendar[index].get("Day")
message = entry.get("Message")
line = "%s %s - %s\n" % (month, day, message)
body = body + line
return body
def main():
calendar = build_calendar()
start = index_from_month_day(calendar, start_month, start_day)
print(fill_plan(start, calendar))
if __name__ == "__main__":
main()
$ python eowcf.py July 24th
January 1st - explore to desire land mass/drop wages 10%
January 1st - flip to banks/towers/ guild build
January 1st - Commence affluent ritual( if we have enough runes supply)
January 13th - activate affluent ritual( min 40 casts)
January 24th - start drafting on emergence/ patriotism( depend on your ppa)
Februrary 10th - Commence expedient ritual
Februrary 24th - flip stable
March 16th - raise wages 200%
March 22nd - flip 25 % armouries ( with builder boon)
April 10th - activate expedient ritual and train army elite/off spec / Def spec/ thieves( with Inspire army)
April 22nd - commence war ritual
May 1st - end of war cease fire
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment