Update Asci 1.7.2 -> 1.8.1 and some other fixes

This commit is contained in:
Shadow15510 2022-02-28 16:58:59 +01:00
parent 22f9d6cc03
commit ce3cc9162b
14 changed files with 277 additions and 312 deletions

View File

@ -74,15 +74,6 @@ alfheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
[
("alfheim palais", '?', 34, 20, 'stand by'),
("alfeim_charretier", '*', 23, 17, 'stand by'),
(23, '*', 11, 4, 'stand by'),
(24, '*', 46, 6, 'stand by'),
(25, '*', 27, 54, 'stand by'),
],
# Autres mondes (Alfheim = 2)
(14, 68, 1, 28, 13), # Vanaheim
@ -113,9 +104,6 @@ h_23 = (r"""
| | | | | | | |
| | | | | | | |
/ \______/ \_______|^|______/ \______/ \ """,
[
("Sagriel", '*', 23, 5, 'stand by'),
],
(25, 19, 2, 34, 16))
@ -140,8 +128,15 @@ h_24 = (r"""
| |
|====| |====|
|====|^|====| """,
[
("Diomwar", '*', 36, 12, 'stand by'),
("h_24", '*', 12, 3, 'stand by'),
],
(20, 19, 2, 52, 31))
(20, 19, 2, 52, 31))
alfheim_entities = (
[0, '?', 2, 34, 20, 'stand by'],
["alfeim_charretier", '*', 2, 23, 17, 'stand by'],
[0, '*', 2, 11, 4, 'stand by'],
[0, '*', 2, 46, 6, 'stand by'],
[0, '*', 2, 27, 54, 'stand by'],
["Sagriel", '*', 23, 23, 5, 'stand by'],
["Diomwar", '*', 24, 36, 12, 'stand by'],
[0, '*', 24, 12, 3, 'stand by'],
)

View File

@ -1,17 +1,18 @@
# Asci (1.7.3)
# Asci (1.8.1)
class Asci:
def __init__(self, maps, events_mapping, keys_mapping, behaviors=None, screen_width=21, screen_height=6):
def __init__(self, maps, entities, events_mapping, keys_mapping, behaviors=None, screen_width=21, screen_height=6):
# Load maps and entities
self.maps = []
self.maps = [Map(*i) for i in maps]
self.entities = {}
for index, raw_map in [(i, maps[i]) for i in range(len(maps))]:
for j in raw_map[1]:
if j[0] in self.entities: raise KeyError("'{}' is already a registered entities".format(j[0]))
else: self.entities[j[0]] = Entity(index, *j)
raw_map = list(raw_map)
raw_map.pop(1)
self.maps.append(Map(*raw_map))
entity_id = 0
for i in entities:
if not i[0]:
i[0] = entity_id
entity_id += 1
if i[0] in self.entities: raise KeyError("'{}' is already a registered entities".format(i[0]))
else: self.entities[i[0]] = Entity(*i)
# Custom functions
self._legend = list(events_mapping.keys())
@ -19,7 +20,7 @@ class Asci:
self._game_keys_mapping = {key: keys_mapping[key] for key in keys_mapping if not key in (1, 2, 3, 5)}
# Custom entities behavior
self._behaviors = {"permanent": permanent, "stand by": stand_by, "follow": follow, "walk": walk}
self._behaviors = {"permanent": permanent, "stand by": stand_by, "follow": follow, "walk between": walk_between, "walk to": walk_to, "follow by player": follow_by_player}
if behaviors:
for i in behaviors: self._behaviors[i] = behaviors[i]
@ -100,6 +101,7 @@ class Asci:
# Update map id and data
old_map, self.data[1] = self.data[1], new_map
self.current_map = self.maps[self.data[1]]
self.current_map.entities = {}
# Update entities
for i in self.entities:
@ -167,7 +169,7 @@ class Asci:
# Configuration
self._legend.append(door)
self._legend.append(walkable)
self._change_map(data[1])
self._change_map(self.data[1])
self.screen.load_data(self.data)
key = 0
@ -180,7 +182,7 @@ class Asci:
data_copy = self.data[:]
for entity in self.current_map.entities.values():
self._behaviors[entity.behavior](entity, data_copy, self.stat, self.screen, walkable)
if (0 <= entity.pos_x - self.data[2] + 10 < self.screen.screen_width) and (0 <= entity.pos_y - self.data[3] + 3 < self.screen.screen_height):
if entity.map_id == self.data[1] and (0 <= entity.pos_x - self.data[2] + 10 < self.screen.screen_width) and (0 <= entity.pos_y - self.data[3] + 3 < self.screen.screen_height):
self.screen.set_cell(entity.pos_x, entity.pos_y, entity.symbol)
self.screen.set_cell(self.data[2], self.data[3], player)
@ -286,8 +288,9 @@ class Map:
self.coords = coords
self.entities = {}
class Entity:
def __init__(self, map_id, entity_id, symbol, x, y, behavior, *args):
def __init__(self, entity_id, symbol, map_id, x, y, behavior, *args):
self.entity_id = entity_id
self.symbol = symbol
self.map_id = map_id
@ -299,6 +302,9 @@ class Entity:
def change_behavior(self, new_behavior):
if self.behavior != "permanent": self.behavior = new_behavior
def teleport(self, map_id, x, y):
if self.behavio != "permanent": self.map_id, self.pos_x, self.pos_y = map_id, x, y
# Functions used by Asci
def convert(string, force_int=False):
@ -410,9 +416,46 @@ def follow(entity, data, stat, screen, walkable):
elif screen.get_cell(cases[0], cases[1]) in walkable: entity.pos_x, entity.pos_y = cases
def walk(entity, data, stat, screen, walkable):
def walk_between(entity, data, stat, screen, walkable):
frame = (entity.args[0] + 1) % len(entity.args[1])
new_x, new_y = entity.args[1][frame]
new_x, new_y = _walk_engine(entity, frame)
if screen.get_cell(new_x, new_y) in walkable:
entity.pos_x, entity.pos_y = new_x, new_y
entity.args[0] = frame
def walk_to(entity, data, stat, screen, walkable):
frame = entity.args[0]
if len(entity.args[1]) == frame:
entity.behavior = "stand by"
entity.args = []
return
new_x, new_y = _walk_engine(entity, frame)
if screen.get_cell(new_x, new_y) in walkable:
entity.pos_x, entity.pos_y = new_x, new_y
entity.args[0] += 1
def follow_by_player(entity, data, stat, screen, walkable):
frame = entity.args[0]
if len(entity.args[1]) == frame:
entity.behavior = "stand by"
entity.args = []
return
new_x, new_y = _walk_engine(entity, frame)
if abs(data[2] - new_x) < 5 and abs(data[3] - new_y) < 3 and screen.get_cell(new_x, new_y) in walkable:
entity.pos_x, entity.pos_y = new_x, new_y
if (new_x, new_y) == entity.args[1][frame]: entity.args[0] += 1
def _walk_engine(entity, frame):
delta_x, delta_y = list(map(lambda x,y: y - x, (entity.pos_x, entity.pos_y), entity.args[1][frame]))
new_x = entity.pos_x
new_y = entity.pos_y
if delta_x: new_x += abs(delta_x) // delta_x
if delta_y: new_y += abs(delta_y) // delta_y
return new_x, new_y

View File

@ -74,30 +74,6 @@ asgard = (r"""
~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
[
('asgard valaskjalf', '?', 120, 26, 'stand by'),
('asgard jardin sud', '?', 51, 55, 'stand by'),
(0, '*', 34, 7, 'stand by'),
(1, '*', 121, 21, 'stand by'),
(2, '*', 117, 32, 'stand by'),
(3, '*', 29, 13, 'stand by'),
(4, '*', 19, 20, 'stand by'),
(5, '*', 28, 26, 'stand by'),
(6, '*', 46, 35, 'stand by'),
(7, '*', 57, 38, 'stand by'),
(8, '*', 82, 38, 'stand by'),
(9, '*', 22, 39, 'stand by'),
(10, '*', 8, 44, 'stand by'),
(11, '*', 58, 50, 'stand by'),
(12, '*', 83, 51, 'stand by'),
(13, '*', 32, 59, 'stand by'),
(14, '*', 104, 63, 'stand by'),
(15, '*', 46, 65, 'stand by'),
(16, '*', 16, 71, 'stand by'),
(17, '*', 138, 71, 'stand by'),
],
# Autres mondes (Asgard = 0)
(126, 71, 3, 72, 6), # Midgard
@ -136,9 +112,6 @@ h_9 = (r"""
|============| |=============|
| |
||^|| """,
[
("Forseti", '*', 19, 4, 'stand by'),
],
(15, 13, 0, 30, 11))
@ -167,9 +140,6 @@ h_10 = (r"""
|__| |__| |__| |__| |__| |__|
|__| |__| |__| |__| |__| |__|
/__\ /__\ /__\__^^__/__\ /__\ /__\ """,
[
("Odin", '*', 25, 11, 'stand by'),
],
(29, 23, 0, 116, 14),
(30, 23, 0, 116, 14))
@ -195,9 +165,6 @@ h_11 = (r"""
|======================| |======================|
|=+<>+=+<>+=+<>+=+<>+==| |==+<>+=+<>+=+<>+=+<>+=|
|^| """,
[
("h_11", '*', 34, 7, 'stand by'),
],
(24, 19, 0, 70, 19))
@ -222,9 +189,6 @@ h_12 = (r"""
|=-=-=-=-=-=|- - | | - -|=-=-=-=-=-=|
| - -| |- - |
/- - \_____|^^|_____/ - -\ """,
[
("h_12", '*', 19, 4, 'stand by'),
],
(24, 19, 0, 25, 31),
(25, 19, 0, 26, 31))
@ -245,9 +209,6 @@ h_13 = (r"""
| |
|==================| |==================|
|^| """,
[
("h_13", '*', 21, 8, 'stand by'),
],
(20, 14, 0, 110, 34))
@ -267,9 +228,6 @@ h_14 = (r"""
||_| |_||
|=|\/|==|\/|=| |=|\/|==|\/|=|
|^^| """,
[
("h_14", '*', 26, 2, 'stand by'),
],
(14, 14, 0, 63, 36),
(15, 14, 0, 64, 36))
@ -290,9 +248,6 @@ h_15 = (r"""
#### ####
| |
|^| """,
[
("Vidar", '*', 10, 6, 'stand by'),
],
(14, 14, 0, 120, 41))
@ -327,9 +282,6 @@ h_16 = (r"""
|===================| _ | | _ |===================|
(_) | | (_)
|=| |/^\| |=| """,
[
("h_16", '*', 50, 14, 'stand by'),
],
(29, 29, 0, 13, 43))
@ -359,9 +311,6 @@ h_17 = (r"""
| |
|======================| |=======================|
|^| """,
[
("h_17", '*', 36, 14, 'stand by'),
],
(24, 24, 0, 75, 50))
@ -391,9 +340,6 @@ h_18 = (r"""
|=====================/| |\=====================|
\| |/
/|^^|\ """,
[
("h_18", '*', 30, 9, 'stand by'),
],
(24, 24, 0, 27, 56),
(25, 24, 0, 28, 56))
@ -414,9 +360,6 @@ h_19 = (r"""
| |
| |
|=======================|^|======================|""",
[
("h_19", '*', 28, 7, 'stand by'),
],
(25, 14, 0, 57, 67))
@ -446,8 +389,40 @@ h_20 = (r"""
| |_| |_| |
| |
|============|^^|============|""",
[
("h_20", '*', 39, 9, 'stand by'),
],
(34, 24, 0, 10, 69),
(35, 24, 0, 11, 69))
(35, 24, 0, 11, 69))
asgard_entities = (
[0, '?', 0, 120, 26, 'stand by'],
[0, '?', 0, 51, 55, 'stand by'],
[0, '*', 0, 34, 7, 'stand by'],
[0, '*', 0, 121, 21, 'stand by'],
[0, '*', 0, 117, 32, 'stand by'],
[0, '*', 0, 29, 13, 'stand by'],
[0, '*', 0, 19, 20, 'stand by'],
[0, '*', 0, 28, 26, 'stand by'],
[0, '*', 0, 46, 35, 'stand by'],
[0, '*', 0, 57, 38, 'stand by'],
[0, '*', 0, 82, 38, 'stand by'],
[0, '*', 0, 22, 39, 'stand by'],
[0, '*', 0, 8, 44, 'stand by'],
[0, '*', 0, 58, 50, 'stand by'],
[0, '*', 0, 83, 51, 'stand by'],
[0, '*', 0, 32, 59, 'stand by'],
[0, '*', 0, 104, 63, 'stand by'],
[0, '*', 0, 46, 65, 'stand by'],
[0, '*', 0, 16, 71, 'stand by'],
[0, '*', 0, 138, 71, 'stand by'],
["Forseti", '*', 9, 19, 4, 'stand by'],
["Odin", '*', 10, 25, 11, 'stand by'],
[0, '*', 11, 34, 7, 'stand by'],
[0, '*', 12, 19, 4, 'stand by'],
[0, '*', 13, 21, 8, 'stand by'],
[0, '*', 14, 26, 2, 'stand by'],
["Vidar", '*', 15, 10, 6, 'stand by'],
[0, '*', 16, 50, 14, 'stand by'],
[0, '*', 17, 36, 14, 'stand by'],
[0, '*', 18, 30, 9, 'stand by'],
[0, '*', 19, 28, 7, 'stand by'],
[0, '*', 20, 39, 9, 'stand by'],
)

View File

@ -6,15 +6,26 @@ dlc_spells_effect = ((0, 1, True), (4, -1, False), (4, -1, False), (4, -1, False
dlc_weapons = ("<aucune>", "Dague", "Marteau", "Masse", "Fleau", "Hache", "Epee", "Espadon", "Hache double")
dlc_armors = ("<aucune>", "Rondache", "Pavois", "Cote de maille", "Broigne", "Harnois")
dlc_entities = (
["Khajit", '*', 3, 51, 60, 'stand by'],
)
def dlc_npc(data, stat, entities, identifiant):
if not "dlc" in data[0]: data[0]["dlc"] = 0
if data[1] == 3: return dlc_midgard_npc(data, stat, entities, identifiant)
def dlc_midgard_npc(data, stat, entities, identifiant):
coords = data[2], data[3]
xp = data[0]["dlc"]
if coords == (51, 60):
if xp == 0: return [0, "Bonjour, je suis Khajit, marchand ambulant. Je suis a la recherche d'un partenaire d'affaire, partant ?\n1. J'ai besoin d'y reflechir.\n2. J'en suis !", 2]
main = data[0]["main"]
if identifiant == "Khajit":
if xp == 0: return [0, "Bonjour {}, je suis Khajit, marchand ambulant. Je suis a la recherche d'un partenaire d'affaire, partant ?\n1.J'ai besoin d'y reflechir.\n2.J'en suis !\n3.On se connait ?".format(stat[5]), 3]
elif xp == 1: return [-1, "Je comprends, reviens quand tu veux : je pense rester quelques temps a Midgard."]
elif xp == 2: return [1, "Parfait !"]
elif xp == 2: return [2, "Excellente idee ! Un riche client m'a demande la dague d'Odin. Si tu arrives a te la procurer, cela serait un bon debut."]
elif xp == 3: return [-3, "Hum, non. Mais les nouvelles vont vites et ceux qui peuvent voyager dans tous l'Yggdrasil sont rares."]
elif xp == 4:
if main == 0: return [0, "Alors ?"]
elif main <= 3: return [0, "Oh ! [KHAJIT VOUS PRIS LA DAGUE DES MAINS] Elle est superbe ! Mais je crois que tu en as encore besoin. [KHAJIT VOUS RENDIT LA DAGUE]"]
elif stat[3][0] == 1:
stat[3][0] = 2
return [1, "Magnifique ! [KHAJIT PRIT LA DAGUE ET LA RANGEA] Voici un marteau en echange et quelques pieces ! Revient me voir bientot, j'aurais du travail pour toi. [+10 PO]", 0, (1, 10)]
else: return [1, "Hum, tu n'as plus la dague... Ce n'est pas grave, nous trouveront bien un autre client. Revient me voir bientot, j'aurais du travail pour toi."]

View File

@ -7,8 +7,10 @@ try:
spells_effect = dlc.dlc_spells_effect
weapons = dlc.dlc_weapons
armors = dlc.dlc_armors
dlc_entities = dlc.dlc_entities
except:
dlc = None
dlc_entities = []
@ -62,6 +64,8 @@ def point_of_interest(data, stat, entities, identifiant):
else: return event
entities = asgard_entities + vanaheim_entities + alfheim_entities + midgard_entities + niflheim_entities + jotunheim_entities + nidavellir_entities + muspellheim_entities + svartalfheim_entities + dlc_entities
print(center("Island of the Dead", 21, " "))
print(center("* Kings *", 21, " "))
print("---------------------")
@ -84,7 +88,7 @@ def idk(save_code=None):
else:
stat, data = decode_save(save_code)
idk_game = Asci(maps, events, keys)
idk_game = Asci(maps, entities, events, keys)
stat, data = idk_game.mainloop(102, stat, data, routine=routine, door="^_", walkable=".,`' ", exit_key="q")
if stat[9] != -1: data[0]["main"] -= stat[9]
@ -106,8 +110,8 @@ def shop_interaction(data, stat, nb_choice, *events):
# - - - Asgard - - - #
def asgard_po(coords, identifiant):
if identifiant == "valaskjalf": return [0, "De hautes montagnes vous entourent de toutes part. Taillees dans la roche enneigee, les marches de l'escalier qui mene a Valaskjalf se decoupent nettement. La grande demeure d'Odin et son toit d'argent domine les environs."]
elif identifiant == "jardin sud": return [0, "Tout autour de vous s'etend un riche jardin soigneusement entretenu. Dans l'alignement de l'allee nord, une fontaine complete l'ensemble. Une douce odeur de verdure emplit vos narines, l'ambiance est calme."]
if coords == (120, 26): return [0, "De hautes montagnes vous entourent de toutes part. Taillees dans la roche enneigee, les marches de l'escalier qui mene a Valaskjalf se decoupent nettement. La grande demeure d'Odin et son toit d'argent domine les environs."]
elif coords == (51, 55): return [0, "Tout autour de vous s'etend un riche jardin soigneusement entretenu. Dans l'alignement de l'allee nord, une fontaine complete l'ensemble. Une douce odeur de verdure emplit vos narines, l'ambiance est calme."]
def asgard_npc(data, stat, entites, identifiant):
@ -365,7 +369,7 @@ def vanaheim_npc(data, stat, entites, identifiant):
def h_21_npc(data, stat, entites, identifiant):
coords = data[2], data[3]
if identifiant == "aubergiste":
if identifiant == "vanaheim_aubergiste":
if stat[9] == -1 or data[0]["main"] == stat[9]:
stat[9] = data[0]["main"]
return [0, "Cher client bonjour ! Que puis-je faire pour vous ?\n1. Manger [5 PO]\n2. Boire [2 PO]\n3. Dormir [10 PO]", 3]
@ -885,7 +889,7 @@ def h_35_npc(data, stat, entites, identifiant):
def h_36_npc(data, stat, entites, identifiant):
coords = data[2], data[3]
if identifiant == "aubergiste":
if identifiant == "jotunheim_aubergiste":
if not (300 <= stat[4] <= 1380): return [0, "Je suis desole, nous somme ferme la nuit."]
if stat[9] == -1 or data[0]["main"] == stat[9]:
@ -1022,7 +1026,7 @@ def muspellheim_npc(data, stat, entites, identifiant):
def h_42_npc(data, stat, entites, identifiant):
coords = data[2], data[3]
if identifiant == "aubergiste":
if identifiant == "muspellheim_aubergiste":
if not (300 <= stat[4] <= 1380): return [0, "Nous sommes ouverts de 5 a 23 heures."]
if stat[9] == -1 or data[0]["main"] == stat[9]:

View File

@ -359,9 +359,6 @@ def spell(data, stat):
def quick_save(data, stat):
data_copy = data[:]
data_copy[2] += 10
data_copy[3] += 3
stat_copy = stat[:-1]
print_text("\"{}\"".format(encode_save(data_copy, stat_copy)))

View File

@ -124,26 +124,6 @@ jotunheim = (r"""
~~~~~~~~ |____| ~~~~~~~~~~~~~~ |_| ##### ### |_| ##### |_| ##### |--| #### ~~~~~~~~~~
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ### |_| ### ~~~~ ### |--| ~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|_| ~~~~~~~~~~~~~~~~|_| ~~~~~~~~~|_|~~~~~~~~~~~~|--|~~~~~~~~~~~~~~""",
[
("jotunheim_1", '?', 60, 57, 'stand by'),
("jotunheim_2", '?', 23, 70, 'stand by'),
("jotunheim_3", '?', 60, 86, 'stand by'),
("Utarg", '*', 34, 56, 'stand by'),
(46, '*', 25, 10, 'stand by'),
(47, '*', 39, 20, 'stand by'),
(48, '*', 3, 28, 'stand by'),
(49, '*', 34, 45, 'stand by'),
(50, '*', 53, 49, 'stand by'),
(51, '*', 19, 51, 'stand by'),
(52, '*', 64, 64, 'stand by'),
(53, '*', 54, 70, 'stand by'),
(54, '*', 8, 72, 'stand by'),
(55, '*', 40, 75, 'stand by'),
(56, '*', 72, 87, 'stand by'),
(57, '*', 6, 98, 'stand by'),
],
# Autres mondes (Jotunheim = 5)
(11, 120, 1, 56, 42), # Vanaheim
@ -174,9 +154,6 @@ h_31 = (r"""
| | |
| | | |
|============|====|^|====|=============|""",
[
("h_31", '*', 28, 4, 'stand by'),
],
(19, 14, 5, 29, 11))
@ -206,9 +183,6 @@ h_32 = (r"""
| |
|============| |==============|
|============|^|==============| """,
[
("h_32", '*', 28, 6, 'stand by'),
],
(14, 24, 5, 88, 25))
@ -238,10 +212,6 @@ h_33 = (r"""
| |
|============================| |===========================|
|=[]=[]=[]=[]=[]=[]=[]=[]=[]=|^|=[]=[]=[]=[]=[]=[]=[]=[]=[]|""",
[
("h_33_1", '*', 14, 7, 'stand by'),
("h_33_2", '*', 48, 5, 'stand by'),
],
(30, 24, 5, 89, 45))
@ -276,9 +246,6 @@ h_34 = (r"""
|==|II|================|II| |II|================|II|==|
|II| |II| |II| |II|
|II| |II|/|^=|\|II| |II| """,
[
("Thrym", '*', 26, 6, 'stand by'),
],
(34, 29, 5, 60, 50))
@ -303,9 +270,6 @@ h_35 = (r"""
| |
|======================\ /======================|
|==|/\|=|/\|=|/\|=|/\|=/^^\=|/\|=|/\|=|/\|=|/\|==|""",
[
("Gullveig", '*', 17, 5, 'stand by'),
],
(24, 19, 5, 64, 85),
(25, 19, 5, 65, 85))
@ -326,10 +290,33 @@ h_36 = (r"""
| +---+ +---+ | | [====] [====] |
| | | [====] [====] |
|=================|^^|=================|""",
[
("h_36_aubergiste", '*', 27, 10, 'stand by'),
("h_36_1", '*', 0, 0, 'stand by'),
("h_36_2", '*', 0, 0, 'stand by'),
],
(19, 14, 5, 23, 88),
(20, 14, 5, 23, 88))
(20, 14, 5, 23, 88))
jotunheim_entities = (
[0, '?', 5, 60, 57, 'stand by'],
[0, '?', 5, 23, 70, 'stand by'],
[0, '?', 5, 60, 86, 'stand by'],
["Utarg", '*', 5, 34, 56, 'stand by'],
[0, '*', 5, 25, 10, 'stand by'],
[0, '*', 5, 39, 20, 'stand by'],
[0, '*', 5, 3, 28, 'stand by'],
[0, '*', 5, 34, 45, 'stand by'],
[0, '*', 5, 53, 49, 'stand by'],
[0, '*', 5, 19, 51, 'stand by'],
[0, '*', 5, 64, 64, 'stand by'],
[0, '*', 5, 54, 70, 'stand by'],
[0, '*', 5, 8, 72, 'stand by'],
[0, '*', 5, 40, 75, 'stand by'],
[0, '*', 5, 72, 87, 'stand by'],
[0, '*', 5, 6, 98, 'stand by'],
[0, '*', 31, 28, 4, 'stand by'],
[0, '*', 32, 28, 6, 'stand by'],
[0, '*', 33, 14, 7, 'stand by'],
[0, '*', 33, 48, 5, 'stand by'],
["Thrym", '*', 34, 26, 6, 'stand by'],
["Gullveig", '*', 35, 17, 5, 'stand by'],
["jotunheim_aubergiste", '*', 36, 27, 10, 'stand by'],
[0, '*', 36, 0, 0, 'stand by'],
[0, '*', 36, 0, 0, 'stand by'],
)

View File

@ -99,23 +99,6 @@ midgard = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
[
("midgard falaises nord", '?', 29, 9, 'stand by'),
("midgard clairiere", '?', 53, 24, 'stand by'),
("midgard palais", '?', 66, 45, 'stand by'),
("midgard manoir sud", '?', 52, 79, 'stand by'),
("midgard_charretier", '*', 39, 49, 'stand by'),
(26, '*', 8, 59, 'stand by'),
(27, "*", 66, 56, "stand by"),
(28, '*', 67, 46, 'stand by'),
(29, '*', 66, 56, 'stand by'),
(30, '*', 51, 60, 'stand by'),
(40, '*', 68, 71, 'stand by'),
(41, '*', 94, 85, 'stand by')
],
# Autres mondes (Migard = 3)
(72, 6, 0, 126, 71), # Asgard
(77, 62, 6, 93, 8), # Nidavellir
@ -149,7 +132,6 @@ h_25 = (r"""
| |==============================|
| |=|\/|=|\/|=|\/|=|\/|=|\/|=|\/||
|\/|^|\/| """,
[],
(4, 16, 3, 42, 49))
@ -167,13 +149,6 @@ h_26 = (r"""
| |------------------|
| |
|---|^|---| """,
[
("Rosahil Green", '*', 27, 6, 'stand by'),
("h_26_1", '*', 17, 7, 'stand by'),
("h_26_2", '*', 22, 7, 'stand by'),
("h_26_3", '*', 17, 8, 'stand by'),
("h_26_4", '*', 27, 8, 'stand by'),
],
(5, 12, 3, 76, 51))
@ -195,7 +170,6 @@ h_27 = (r"""
| + | |_| |
| | | |_| |
|=======|^|=======| """,
[],
(9, 16, 3, 44, 65))
@ -215,8 +189,25 @@ h_28 = (r"""
|\/|=|\/|=|\/| | | |\/|=|\/|=|\/|
|__+ +__|
|\/|^^|\/| """,
[
("h_28", '*', 27, 6, 'stand by'),
],
(24, 14, 3, 60, 69),
(25, 14, 3, 61, 69))
(25, 14, 3, 61, 69))
midgard_entities = (
[0, '?', 3, 29, 9, 'stand by'],
[0, '?', 3, 53, 24, 'stand by'],
[0, '?', 3, 66, 45, 'stand by'],
[0, '?', 3, 52, 79, 'stand by'],
["midgard_charretier", '*', 3, 39, 49, 'stand by'],
[0, '*', 3, 8, 59, 'stand by'],
[0, '*', 3, 66, 56, "stand by"],
[0, '*', 3, 67, 46, 'stand by'],
[0, '*', 3, 66, 56, 'stand by'],
[0, '*', 3, 68, 71, 'stand by'],
[0, '*', 3, 94, 85, 'stand by'],
["Rosahil Green", '*', 26, 27, 6, 'stand by'],
[0, '*', 26, 17, 7, 'stand by'],
[0, '*', 26, 22, 7, 'stand by'],
[0, '*', 26, 17, 8, 'stand by'],
[0, '*', 26, 27, 8, 'stand by'],
[0, '*', 28, 27, 6, 'stand by'],
)

View File

@ -119,18 +119,6 @@ muspellheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
[
("muspellheim cote nord", '?', 66, 8, 'stand by'),
("muspeillheim manoir", '?', 65, 97, 'stand by'),
(63, '*', 20, 12, 'stand by'),
(64, '*', 78, 14, 'stand by'),
(65, '*', 54, 80, 'stand by'),
(66, '*', 59, 91, 'stand by'),
(67, '*', 39, 94, 'stand by'),
(68, '*', 29, 113, 'stand by'),
],
# Autres mondes (Muspellheim = 7)
(92, 9, 6, 9, 57), # Nidavellir
@ -158,13 +146,6 @@ h_42 = (r"""
| |
| |
|==============|^|================|""",
[
("h_42_aubergiste", '*', 6, 7, 'stand by'),
("h_42_1", '*', 14, 1, 'stand by'),
("h_42_2", '*', 11, 5, 'stand by'),
("h_42_3", '*', 2, 11, 'stand by'),
("h_42_4", '*', 31, 9, 'stand by'),
],
(16, 14, 7, 87, 14))
@ -184,11 +165,6 @@ h_43 = (r"""
| |
| |
|[^]|""",
[
("Berfrid", '*', 24, 4, 'stand by'),
("h_43_1", '*', 13, 9, 'stand by'),
("h_43_2", '*', 6, 5, 'stand by'),
],
(32, 14, 7, 47, 53))
@ -218,9 +194,26 @@ h_44 = (r"""
| [========] [========] |
|=|/\|==|/\|=|/\|=|/\|=| |=|/\|=|/\|=|/\|==|/\|=|
|=|\/|==|\/|=|\/|=|\/|=|^^|=|\/|=|\/|=|\/|==|\/|=|""",
[
("h_44_1", '*', 13, 20, 'stand by'),
("h_44_2", '*', 13, 2, 'stand by'),
],
(24, 24, 7, 67, 89),
(25, 24, 7, 68, 89))
(25, 24, 7, 68, 89))
muspellheim_entities = (
[0, '?', 7, 66, 8, 'stand by'],
[0, '?', 7, 65, 97, 'stand by'],
[0, '*', 7, 20, 12, 'stand by'],
[0, '*', 7, 78, 14, 'stand by'],
[0, '*', 7, 54, 80, 'stand by'],
[0, '*', 7, 59, 91, 'stand by'],
[0, '*', 7, 39, 94, 'stand by'],
[0, '*', 7, 29, 113, 'stand by'],
["muspellheim_aubergiste", '*', 42, 6, 7, 'stand by'],
[0, '*', 42, 14, 1, 'stand by'],
[0, '*', 42, 11, 5, 'stand by'],
[0, '*', 42, 2, 11, 'stand by'],
[0, '*', 42, 31, 9, 'stand by'],
["Berfrid", '*', 43, 24, 4, 'stand by'],
[0, '*', 43, 13, 9, 'stand by'],
[0, '*', 43, 6, 5, 'stand by'],
[0, '*', 44, 13, 20, 'stand by'],
[0, '*', 44, 13, 2, 'stand by'],
)

View File

@ -74,17 +74,6 @@ nidavellir = (r"""
/ \ / \ / \ /\ /\ / / \ / / \ / \
/ / \ / \ / \ /\ / \ /\ / \/ / /
/ / \ / / \ / \/ \ / \ /\ / / """,
[
("nidavellir plage", '?', 65, 7, 'stand by'),
("nidavellir montanges", '?', 66, 58, 'stand by'),
(58, '*', 49, 21, 'stand by'),
(59, '*', 25, 31, 'stand by'),
(60, '*', 74, 46, 'stand by'),
(61, '*', 16, 55, 'stand by'),
(62, '*', 77, 61, 'stand by'),
],
# Autres mondes (Nidavellir = 6)
(93, 8, 3, 77, 62), # Midgard
(9, 57, 7, 92, 9), # Muspellheim
@ -126,13 +115,6 @@ h_37 = (r"""
| |__| | | |
| | | |
|=============|^|============|""",
[
("Muin", '*', 2, 1, 'stand by'),
("h_37_1", '*', 26, 1, 'stand by'),
("h_37_2", '*', 10, 5, 'stand by'),
("h_37_3", '*', 4, 10, 'stand by'),
("h_37_4", '*', 27, 8, 'stand by'),
],
(15, 14, 6, 69, 26))
@ -152,10 +134,6 @@ h_38 = (r"""
| |
| |
|===|^|===| """,
[
("h_38_1", '*', 12, 3, 'stand by'),
("h_38_2", '*', 19, 7, 'stand by'),
],
(15, 14, 6, 7, 31))
@ -175,10 +153,6 @@ h_39 = (r"""
| |_| |_| |
| |
|=|/\|=|/\|==|^|===|/\|=|/\|=|""",
[
("h_39_1", '*', 9, 2, 'stand by'),
("h_39_2", '*', 9, 4, "stand by"),
],
(14, 14, 6, 35, 38))
@ -198,9 +172,6 @@ h_40 = (r"""
| |
|=========| |==============|
|==========|^|===============|""",
[
("h_40", '*', 14, 5, 'stand by'),
],
(12, 14, 6, 22, 22))
@ -225,8 +196,26 @@ h_41 = (r"""
| |_| /|\ |
| |
|========|^|=======|""",
[
("h_41_1", '*', 10, 8, 'stand by'),
("h_41_2", '*', 12, 2, 'stand by'),
],
(10, 19, 6, 23, 51))
(10, 19, 6, 23, 51))
nidavellir_entities = (
[0, '?', 6, 65, 7, 'stand by'],
[0, '?', 6, 66, 58, 'stand by'],
[0, '*', 6, 49, 21, 'stand by'],
[0, '*', 6, 25, 31, 'stand by'],
[0, '*', 6, 74, 46, 'stand by'],
[0, '*', 6, 16, 55, 'stand by'],
[0, '*', 6, 77, 61, 'stand by'],
["Muin", '*', 37, 2, 1, 'stand by'],
[0, '*', 37, 26, 1, 'stand by'],
[0, '*', 37, 10, 5, 'stand by'],
[0, '*', 37, 4, 10, 'stand by'],
[0, '*', 37, 27, 8, 'stand by'],
[0, '*', 38, 12, 3, 'stand by'],
[0, '*', 38, 19, 7, 'stand by'],
[0, '*', 39, 9, 2, 'stand by'],
[0, '*', 39, 9, 4, "stand by"],
[0, '*', 40, 14, 5, 'stand by'],
[0, '*', 41, 10, 8, 'stand by'],
[0, '*', 41, 12, 2, 'stand by'],
)

View File

@ -74,15 +74,6 @@ _\ /_\ ### ', |+| ___ ' '. ``,..' '.`.`
### /_\ ##### ##### /_\ ##### ##### ### ### ### ##### /_\ ##### ##### ### ### ###
##### ##### ### ### ### /_\ /_\##### ### ### ##### /_\ /_\ /_\
##### ### /_\ /_\ /_\ ##### /_\ /_\ ### """,
[
("niflheim", '?', 88, 32, 'stand by'),
(42, '*', 95, 30, 'stand by'),
(43, '*', 57, 31, 'stand by'),
(44, '*', 39, 60, 'stand by'),
(45, '*', 108, 67, 'stand by'),
],
# Autres monde (Niflheim = 4)
(78, 19, 3, 24, 90), # Midgard
@ -109,9 +100,6 @@ h_29 = (r"""
| [===] [=-=] [==] [-==] |
| |
|=============|^|============|""",
[
("Merath", '*', 5, 5, 'stand by'),
],
(15, 14, 4, 38, 21))
@ -136,9 +124,16 @@ h_30 = (r"""
| |__| |__| |
| |========| |========| |
|=============| |^^| |=============|""",
[
("Hel", '*', 37, 4, 'stand by'),
("h_30", '*', 17, 6, 'stand by'),
],
(24, 19, 4, 70, 31),
(25, 19, 4, 71, 31))
(25, 19, 4, 71, 31))
niflheim_entities = (
[0, '?', 4, 88, 32, 'stand by'],
[0, '*', 4, 95, 30, 'stand by'],
[0, '*', 4, 57, 31, 'stand by'],
[0, '*', 4, 39, 60, 'stand by'],
[0, '*', 4, 108, 67, 'stand by'],
["Merath", '*', 29, 5, 5, 'stand by'],
["Hel", '*', 30, 37, 4, 'stand by'],
[0, '*', 30, 17, 6, 'stand by'],
)

View File

@ -74,17 +74,6 @@ svartalfheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ /-\ ~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
[
("svartalfheim", '?', 113, 37, 'stand by'),
(69, '*', 104, 30, 'stand by'), (70, '*', 120, 49, 'stand by'),
(71, '*', 105, 46, 'stand by'),
(72, '*', 22, 50, 'stand by'),
(73, '*', 15, 54, 'stand by'),
(74, '*', 25, 61, 'stand by'),
(75, '*', 121, 68, 'stand by'),
],
# Autres mondes (Svartalfheim = 8)
(109, 66, 6, 39, 19), # Nidavellir
@ -117,9 +106,6 @@ h_45 = (r"""
| |====| |====| |
|=================| | | |==================|
|^| """,
[
("h_45", '*', 15, 4, 'stand by'),
],
(24, 19, 8, 90, 15))
@ -134,10 +120,6 @@ h_46 = (r"""
| |
| |
|=======|^|========|""",
[
("h_46_1", '*', 13, 2, 'stand by'),
("h_46_2", '*', 13, 4, 'stand by'),
],
(9, 9, 8, 6, 24))
@ -157,10 +139,6 @@ h_47 = (r"""
| |__| |__| |
| |
|^|==========================|""",
[
("h_47_1", '*', 3, 4, 'stand by'),
("h_47_2", '*', 15, 8, 'stand by'),
],
(1, 14, 8, 91, 33))
@ -180,8 +158,21 @@ h_48 = (r"""
| \__/ \__/ \__/ \__/ |
|==| |======| |=| |=| |======| |==|
| | | | |^=| | | | | """,
[
("h_48_1", '*', 34, 5, 'stand by'),
("h_48_2", '*', 29, 8, 'stand by'),
],
(19, 14, 8, 57, 59))
svartalfheim_entities = (
[0, '?', 8, 113, 37, 'stand by'],
[0, '*', 8, 104, 30, 'stand by'], [0, '*', 8, 120, 49, 'stand by'],
[0, '*', 8, 105, 46, 'stand by'],
[0, '*', 8, 22, 50, 'stand by'],
[0, '*', 8, 15, 54, 'stand by'],
[0, '*', 8, 25, 61, 'stand by'],
[0, '*', 8, 121, 68, 'stand by'],
[0, '*', 45, 15, 4, 'stand by'],
[0, '*', 46, 13, 2, 'stand by'],
[0, '*', 46, 13, 4, 'stand by'],
[0, '*', 47, 3, 4, 'stand by'],
[0, '*', 47, 15, 8, 'stand by'],
[0, '*', 48, 34, 5, 'stand by'],
[0, '*', 48, 29, 8, 'stand by'],
)

View File

@ -49,17 +49,6 @@ vanaheim = (r"""
/ \ / \ /\ / / \ / \ / \ / \ / \
/ \ / / \ / / \
/ \ / \ / \ """,
[
("vanaheim_1", '?', 42, 20, 'stand by'),
("vanaheim_2", '?', 26, 29, 'stand by'),
("vanaheim_charretier", '*', 45, 39, 'stand by'),
(19, '*', 31, 12, 'stand by'),
(20, '*', 41, 45, 'stand by'),
(21, '*', 52, 22, 'stand by'),
(22, '*', 52, 30, 'stand by'),
],
# Autres mondes (Vanaheim = 1)
(28, 13, 2, 14, 68), # Alfheim
(54, 29, 3, 10, 58), # Midgard
@ -83,10 +72,6 @@ h_21 = (r"""
| |
| |
|===|^|=================|""",
[
("h_21_aubergiste", '*', 8, 1, 'stand by'),
("h_21", '*', 21, 6, 'stand by'),
],
(5, 9, 1, 44, 11))
@ -111,8 +96,18 @@ h_22 = (r"""
| | | |
|/\=/\=/\=/\=/\=/\=| |=/\=/\=/\=/\=/\==|
|\/=\/=\/=\/=\/=\/=]^[=\/=\/=\/=\/=\/==|""",
[
("Freyja", '*', 2, 8, 'stand by'),
("Freyr", '*', 36, 3, 'stand by'),
],
(20, 19, 1, 52, 35))
vanaheim_entities = (
[0, '?', 1, 42, 20, 'stand by'],
[0, '?', 1, 26, 29, 'stand by'],
["vanaheim_charretier", '*', 1, 45, 39, 'stand by'],
[0, '*', 1, 31, 12, 'stand by'],
[0, '*', 1, 41, 45, 'stand by'],
[0, '*', 1, 52, 22, 'stand by'],
[0, '*', 1, 52, 30, 'stand by'],
["vanaheim_aubergiste", '*', 21, 8, 1, 'stand by'],
[0, '*', 21, 21, 6, 'stand by'],
["Freyja", '*', 22, 2, 8, 'stand by'],
["Freyr", '*', 22, 36, 3, 'stand by'],
)

View File

@ -19,7 +19,6 @@ def convert_to_string(filename, doors, entities):
doors_coords = []
entities_data = []
entities_count = 0
output = r""
for line_index, line in enumerate(data):
for char_index, char_id in enumerate(line):
@ -28,8 +27,8 @@ def convert_to_string(filename, doors, entities):
output += char_list[char_id]
else:
output += " "
entities_data.append(f"({entities_count}, '{char_list[char_id]}', {char_index}, {line_index}, 'stand_by'),")
entities_count += 1
entities_data.append(f"[None, '{char_list[char_id]}', , {char_index}, {line_index}, 'stand_by'],")
if char_list[char_id] in doors:
doors_coords.append(f"\t({char_index}, {line_index}, , 0, 0),")
@ -37,10 +36,10 @@ def convert_to_string(filename, doors, entities):
output += "\n"
doors_coords = "\n".join(doors_coords)
entities_data = "[\n\t" + "\n\t".join(entities_data) + "\n]"
entities_data = "(\n\t" + "\n\t".join(entities_data) + "\n)"
with open(f"{output_filename}.py", "w") as file:
file.write(f"{output_filename} = (r\"\"\"\n{output[:-1]}\"\"\",\n{entities_data},\n\n{doors_coords}\n)")
file.write(f"{output_filename} = (r\"\"\"\n{output[:-1]}\"\"\",\n{doors_coords}\n)\n\n{output_filename}_entities = {entities_data}")
filename, doors, misc = argv[1], "", ""