Undertale: Bug fix pr (#1937)
This commit is contained in:
parent
153125a5ea
commit
857364fa78
|
@ -360,7 +360,7 @@ async def process_undertale_cmd(ctx: UndertaleContext, cmd: str, args: dict):
|
||||||
elif cmd == "Bounced":
|
elif cmd == "Bounced":
|
||||||
tags = args.get("tags", [])
|
tags = args.get("tags", [])
|
||||||
if "Online" in tags:
|
if "Online" in tags:
|
||||||
data = args.get("worlds/undertale/data", {})
|
data = args.get("data", {})
|
||||||
if data["player"] != ctx.slot and data["player"] is not None:
|
if data["player"] != ctx.slot and data["player"] is not None:
|
||||||
filename = f"FRISK" + str(data["player"]) + ".playerspot"
|
filename = f"FRISK" + str(data["player"]) + ".playerspot"
|
||||||
with open(os.path.join(ctx.save_game_folder, filename), "w") as f:
|
with open(os.path.join(ctx.save_game_folder, filename), "w") as f:
|
||||||
|
@ -406,34 +406,40 @@ async def game_watcher(ctx: UndertaleContext):
|
||||||
ctx.syncing = False
|
ctx.syncing = False
|
||||||
if ctx.got_deathlink:
|
if ctx.got_deathlink:
|
||||||
ctx.got_deathlink = False
|
ctx.got_deathlink = False
|
||||||
with open(os.path.join(ctx.save_game_folder, "/WelcomeToTheDead.youDied"), "w") as f:
|
with open(os.path.join(ctx.save_game_folder, "WelcomeToTheDead.youDied"), "w") as f:
|
||||||
f.close()
|
f.close()
|
||||||
sending = []
|
sending = []
|
||||||
victory = False
|
victory = False
|
||||||
found_routes = 0
|
found_routes = 0
|
||||||
for root, dirs, files in os.walk(path):
|
for root, dirs, files in os.walk(path):
|
||||||
for file in files:
|
for file in files:
|
||||||
if "DontBeMad.mad" in file and "DeathLink" in ctx.tags:
|
if "DontBeMad.mad" in file:
|
||||||
os.remove(root+"/"+file)
|
os.remove(root+"/"+file)
|
||||||
await ctx.send_death()
|
if "DeathLink" in ctx.tags:
|
||||||
|
await ctx.send_death()
|
||||||
if "scout" == file:
|
if "scout" == file:
|
||||||
sending = []
|
sending = []
|
||||||
with open(root+"/"+file, "r") as f:
|
try:
|
||||||
lines = f.readlines()
|
with open(root+"/"+file, "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
for l in lines:
|
for l in lines:
|
||||||
if ctx.server_locations.__contains__(int(l)+12000):
|
if ctx.server_locations.__contains__(int(l)+12000):
|
||||||
sending = sending + [int(l)+12000]
|
sending = sending + [int(l)+12000]
|
||||||
await ctx.send_msgs([{"cmd": "LocationScouts", "locations": sending,
|
await ctx.send_msgs([{"cmd": "LocationScouts", "locations": sending,
|
||||||
"create_as_hint": int(2)}])
|
"create_as_hint": int(2)}])
|
||||||
os.remove(root+"/"+file)
|
finally:
|
||||||
|
os.remove(root+"/"+file)
|
||||||
if "check.spot" in file:
|
if "check.spot" in file:
|
||||||
sending = []
|
sending = []
|
||||||
with open(root+"/"+file, "r") as f:
|
try:
|
||||||
lines = f.readlines()
|
with open(root+"/"+file, "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
for l in lines:
|
for l in lines:
|
||||||
sending = sending+[(int(l))+12000]
|
sending = sending+[(int(l))+12000]
|
||||||
message = [{"cmd": "LocationChecks", "locations": sending}]
|
message = [{"cmd": "LocationChecks", "locations": sending}]
|
||||||
await ctx.send_msgs(message)
|
await ctx.send_msgs(message)
|
||||||
|
finally:
|
||||||
|
pass
|
||||||
if "victory" in file and str(ctx.route) in file:
|
if "victory" in file and str(ctx.route) in file:
|
||||||
victory = True
|
victory = True
|
||||||
if ".playerspot" in file and "Online" not in ctx.tags:
|
if ".playerspot" in file and "Online" not in ctx.tags:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from ..generic.Rules import set_rule, add_rule
|
from worlds.generic.Rules import set_rule, add_rule
|
||||||
from BaseClasses import MultiWorld, CollectionState
|
from BaseClasses import MultiWorld, CollectionState
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,13 @@ from multiprocessing import Process
|
||||||
|
|
||||||
def run_client():
|
def run_client():
|
||||||
print('running undertale client')
|
print('running undertale client')
|
||||||
from UndertaleClient import main # lazy import
|
from .UndertaleClient import main # lazy import
|
||||||
p = Process(target=main)
|
p = Process(target=main)
|
||||||
p.start()
|
p.start()
|
||||||
|
|
||||||
|
|
||||||
components.append(Component("Undertale Client", "UndertaleClient"))
|
components.append(Component("Undertale Client", "UndertaleClient"))
|
||||||
|
# components.append(Component("Undertale Client", func=run_client))
|
||||||
|
|
||||||
|
|
||||||
def data_path(file_name: str):
|
def data_path(file_name: str):
|
||||||
|
|
Binary file not shown.
|
@ -13,7 +13,7 @@ the Nicecream bought in Hotland, and anything you cannot get in your chosen rout
|
||||||
## When the player receives an item, what happens?
|
## When the player receives an item, what happens?
|
||||||
|
|
||||||
When the player receives an item in Undertale, it will go into their inventory if they have space, otherwise it will
|
When the player receives an item in Undertale, it will go into their inventory if they have space, otherwise it will
|
||||||
wait until they do have space. That includes items that don't appear in your inventory.
|
wait until they do have space.
|
||||||
|
|
||||||
## What is the victory condition?
|
## What is the victory condition?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue