Improve contract creator & add few more leggacy contracts
authorJoann Mõndresku <joann@cernodile.com>
Sat, 11 May 2024 16:28:44 +0000 (19:28 +0300)
committerJoann Mõndresku <joann@cernodile.com>
Sat, 11 May 2024 16:28:44 +0000 (19:28 +0300)
data/contract-creator.py
data/contracts.json

index 19993b1a6e4b3d0a20d7160df50ea4282b4c393e..40ec44981169bd47679753c1bf4daab329ee6fa7 100755 (executable)
@@ -4,16 +4,6 @@ import sys
 sys.path.append("..")
 import ei_pb2 as EIProto
 
-#                        [
-#                                {"deliver": 250000000000000000, "reward_type": "SOUL_EGGS", "reward_amt": 250000},
-#                                {"deliver": 500000000000000000, "reward_type": "EGGS_OF_PROPHECY", "reward_amt": 1}
-#                        ],
-#                        [
-#                                {"deliver": 50000000000000, "reward_type": "SOUL_EGGS", "reward_amt": 10000},
-#                                {"deliver": 1000000000000000, "reward_type": "EGGS_OF_PROPHECY", "reward_amt": 1}
-#                        ]
-#                ]
-#        }
 boost_defs = {
 "Supreme tachyon prism": "tachyon_prism_orange_big",
 "Legendary tachyon prism (1000x 10m)": "tachyon_prism_orange",
@@ -46,6 +36,38 @@ def ask_for_float(preprint):
                except:
                        continue
 
+def parse_time(preprint):
+       while True:
+               print(preprint, end="")
+               x = input()
+               vals = x.split(" ")
+               if len(vals) == 1:
+                       try:
+                               val = int(x)
+                               return val
+                       except:
+                               continue
+               else:
+                       if len(vals) % 2 == 1:
+                               print("Write in following format: x d x h x m - or plain amount in minutes.")
+                       fail = False
+                       total = 0
+                       for i in range(0, len(vals), 2):
+                               try:
+                                       intval = int(vals[i])
+                                       suffix = vals[i + 1]
+                                       if suffix.upper() == "D":
+                                               intval *= 1440
+                                       elif suffix.upper() == "H":
+                                               intval *= 60
+                                       total += intval
+                               except:
+                                       fail = True
+                                       break
+                       if fail:
+                               continue
+                       return total
+
 def ask_for_quantity(preprint):
        while True:
                print(preprint, end="")
@@ -137,6 +159,8 @@ def create_goalset(type):
                goal["reward_type"] = parse_reward_type("Enter reward type - type '?' for reference: ")
                if goal["reward_type"] == "BOOST":
                        goal["reward_str"] = parse_boost_type("Type in boost type - type '?' for reference: ")
+               elif goal["reward_type"] == "EPIC_RESEARCH_ITEM":
+                       goal["reward_str"] = ask_for_string("Type in epic research (check your backup for reference): ")
                goal["reward_amt"] = ask_for_float("How many rewarded? ")
                goals.append(goal)
        return goals
@@ -144,7 +168,7 @@ def create_goalset(type):
 obj["id"] = ask_for_string("Enter contract ID: ")
 obj["name"] = ask_for_string("Enter contract name: ")
 obj["description"] = ask_for_string("Enter contract description: ")
-obj["duration"] = ask_for_float("How many minutes does the contract last: ") * 60.0
+obj["duration"] = parse_time("How many minutes does the contract last: ") * 60.0
 obj["token_interval"] = ask_for_float("How many minutes to wait per reward token: ")
 obj["egg"] = parse_egg_type("Enter egg type - type '?' if need reference: ")
 obj["goalsets"].append(create_goalset("Elite"))
index 53e2930559e30bbf398c30c738cb28de6ad17427..0202e05385de1d824eecd7b4c95cabc6a8d9ccda 100644 (file)
           }
         ]
       ]
+    },
+    {
+      "id": "space-eggs",
+      "name": "LEGGACY: SpaceEggs",
+      "description": "Spaceflight is booming due to re-usable rockets.\nHelp fill the demand with this contract.",
+      "duration": 604800.0,
+      "token_interval": 120.0,
+      "egg": "ROCKET_FUEL",
+      "goalsets": [
+        [
+          {
+            "deliver": 30000000000000000,
+            "reward_type": "PIGGY_LEVEL_BUMP",
+            "reward_str": "",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 500000000000000000,
+            "reward_type": "GOLD",
+            "reward_str": "",
+            "reward_amt": 50000.0
+          }
+        ],
+        [
+          {
+            "deliver": 25000000000000,
+            "reward_type": "PIGGY_LEVEL_BUMP",
+            "reward_str": "",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 1000000000000000,
+            "reward_type": "GOLD",
+            "reward_str": "",
+            "reward_amt": 5000.0
+          }
+        ]
+      ]
+    },
+    {
+      "id": "anxiety-attack",
+      "name": "LEGGACY: Anxiety Attack",
+      "description": "A new school year and political turmoil have everyone stressed out! A regimen of medical eggs are needed.",
+      "duration": 259200.0,
+      "token_interval": 90.0,
+      "egg": "MEDICAL",
+      "goalsets": [
+        [
+          {
+            "deliver": 25000000000000000,
+            "reward_type": "PIGGY_LEVEL_BUMP",
+            "reward_str": "",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 75000000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ],
+        [
+          {
+            "deliver": 10000000000000,
+            "reward_type": "PIGGY_LEVEL_BUMP",
+            "reward_str": "",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 500000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ]
+      ]
+    },
+    {
+      "id": "terraform-heavy",
+      "name": "LEGGACY: New Civilization",
+      "description": "A group of explorers are setting out to find new worlds, new civilizations.\\nThey are in need of fuel!",
+      "duration": 399960.0,
+      "token_interval": 30.0,
+      "egg": "ANTIMATTER",
+      "goalsets": [
+        [
+          {
+            "deliver": 50000000000000000,
+            "reward_type": "PIGGY_MULTIPLIER",
+            "reward_str": "",
+            "reward_amt": 2.0
+          },
+          {
+            "deliver": 150000000000000000,
+            "reward_type": "EPIC_RESEARCH_ITEM",
+            "reward_str": "comfy_nests",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 300000000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ],
+        [
+          {
+            "deliver": 100000000000000,
+            "reward_type": "PIGGY_MULTIPLIER",
+            "reward_str": "",
+            "reward_amt": 2.0
+          },
+          {
+            "deliver": 750000000000000,
+            "reward_type": "EPIC_RESEARCH_ITEM",
+            "reward_str": "comfy_nests",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 1500000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ]
+      ]
+    },
+    {
+      "id": "tool-time",
+      "name": "LEGGACY: Tool Time!",
+      "description": "It's father's day around the galaxy and power tools are flying off the shelves.\\nHelp restock!",
+      "duration": 345600.0,
+      "token_interval": 120.0,
+      "egg": "SUPER_MATERIAL",
+      "goalsets": [
+        [
+          {
+            "deliver": 50000000000000000,
+            "reward_type": "BOOST",
+            "reward_str": "soul_beacon_orange",
+            "reward_amt": 1.0
+          },
+          {
+            "deliver": 400000000000000000,
+            "reward_type": "PIGGY_FILL",
+            "reward_str": "",
+            "reward_amt": 200000.0
+          },
+          {
+            "deliver": 1000000000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ],
+        [
+          {
+            "deliver": 50000000000000,
+            "reward_type": "SOUL_EGGS",
+            "reward_str": "",
+            "reward_amt": 1000.0
+          },
+          {
+            "deliver": 500000000000000,
+            "reward_type": "PIGGY_FILL",
+            "reward_str": "",
+            "reward_amt": 25000.0
+          },
+          {
+            "deliver": 4000000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ]
+      ]
+    },
+    {
+      "id": "fday-ouch",
+      "name": "LEGGACY: Ouch!",
+      "description": "With all those new power tools out there, there are lots of minor injuries.\\nFirst Aid!",
+      "duration": 259200.0,
+      "token_interval": 60.0,
+      "egg": "MEDICAL",
+      "goalsets": [
+        [
+          {
+            "deliver": 20000000000000000,
+            "reward_type": "BOOST",
+            "reward_str": "tachyon_prism_orange",
+            "reward_amt": 2.0
+          },
+          {
+            "deliver": 80000000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ],
+        [
+          {
+            "deliver": 10000000000000,
+            "reward_type": "GOLD",
+            "reward_str": "",
+            "reward_amt": 1500.0
+          },
+          {
+            "deliver": 400000000000000,
+            "reward_type": "EGGS_OF_PROPHECY",
+            "reward_str": "",
+            "reward_amt": 1.0
+          }
+        ]
+      ]
     }
   ],
   "normal": []