diff --git a/idk_demo/alfheim.py b/idk_demo/alfheim.py index 5142db3..29250c4 100644 --- a/idk_demo/alfheim.py +++ b/idk_demo/alfheim.py @@ -88,10 +88,26 @@ alfheim = (r""" # * : (27; 54) def alfheim_po(coords): - if coords == (34, 20): return [0, "Quelques arbres au sud vous masque la vue. Au nord, l'imposant palais des Elfes et ses quatres colonnes finement travaillee s'offre a vous. La lourde porte a deux battants en bois massif et fer forge vous fait face. Au sud est, les bruits d'un bourg en pleine activite montent a vos oreilles."] + if coords == (34, 20): return [0, "Quelques arbres au sud vous masque la vue. Au nord, l'imposant palais des Elfes et ses quatres colonnes finement travaillee s'offrent a vous. La lourde porte a deux battants en bois massif et fer forge vous fait face. Au sud est, les bruits d'un bourg en pleine activite montent a vos oreilles."] def alfheim_npc(data, stat): - pass + coords = data[2], data[3] + + if coords == (23, 17): + if stat[9] == -1 or data[0] == stat[9]: + stat[9] = data[0] + return [0, "[LE CONDUCTEUR DE LA CHARRETTE SE TOURNA VERS VOUS] Ou voulez-vous aller ? Je vous emmene pour 5 pieces.\n1. Midgard\n2. Asgard\n3. Vanaheim\n4. Svartalfheim", 4] + + else: + destinations = ("Midgard", "Asgard", "Vanaheim", "Svartalfheim") + dest_coords = ((3, 10, 58), (0, 126, 71), (1, 28, 13), (8, 109, 66)) + for i in range(1, 5): + if data[0] == stat[9] + i: + stat[9] = -1 + if stat[1] < 5: return [-i, "Je ne travaille pas gratuitement."] + else: + data[1], data[2], data[3] = dest_coords[i - 1][0], dest_coords[i - 1][1], dest_coords[i - 1][2] + return [-i, "C'est parti pour {} !".format(destinations[i - 1]), 0, (1, -5), (4, 60)] @@ -121,7 +137,7 @@ h_23 = (r""" (25, 19, 2, 34, 16)) # * : (23, 5) def h_23_npc(data, stat): - pass + pass diff --git a/idk_demo/asgard.py b/idk_demo/asgard.py index 3be926f..dbf0e8c 100644 --- a/idk_demo/asgard.py +++ b/idk_demo/asgard.py @@ -37,7 +37,7 @@ asgard = (r""" ###### /o\ ~~~ * /-\ /Noatun\ | |~~ ### |_| _ ~~/\ / #### |_| ~~~~~~~~~~~~~~~~~ |_/^^\_| ### | |~~~~~~ ##### ##### /o\ ~~/ \ || ~~~~~~~~~~~~~~~~~~~~~~ | | ##### | ~~~~~ ### ### ######### |_| ~~/ \ /\ - ## ___________ ~~~~~~~~| | * ### * ~~~~~ /-\ ##### _ #Landivi# ~/ \ / + ## ___________ ~~~~~~~~| | * ### * ~~~~~ /-\ ##### _ #Landvidi# ~/ \ / #### /Breidablik \ * ~| |~~~~ /-\ ~~~~~~ ### /o\ ######### ~~~ / ##### |o|o|o|o|o|o| ### | | ~~~~~~~~~~~~~ ~~~~~~ /-\ |_| ##### ~~~~ /\ / ##### /_____________\ ##### ### ### ~~~~~~~~~~~~ ~~~~~~~~ |^| _ ~~~~~ / \ /\ @@ -124,6 +124,7 @@ def asgard_npc(data, stat): # * : (138, 71) pass + def asgard_po(coords): 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."] @@ -150,12 +151,7 @@ h_9 = (r""" (15, 13, 0, 30, 11)) # * : (19, 4) def h_9_npc(data, stat): - coords = data[2], data[3] - xp = data[0] - - if coords == (19, 4): return { - "base": [0, "Forseti, fils de Baldr et Nanna, dieu de la Justice. Tu as besoin de moi ?"] - } + pass @@ -191,10 +187,7 @@ h_10 = (r""" (30, 23, 0, 116, 14)) # * : (25, 11) def h_10_npc(data, stat): - coords = data[2], data[3] - xp = data[0] - - return [0, "Je suis Odin, Roi des Ases, dieux de la Guerre."], + pass @@ -336,7 +329,6 @@ def h_15_npc(data, stat): - h_16 = (r""" |======================================| | | diff --git a/idk_demo/idk.py b/idk_demo/idk.py index 4ebdb8c..e050379 100644 --- a/idk_demo/idk.py +++ b/idk_demo/idk.py @@ -35,6 +35,8 @@ maps = ( # Asci functions def npc(data, stat): + from random import choice + npc_data = ( asgard_npc, vanaheim_npc, @@ -59,17 +61,18 @@ def npc(data, stat): event = npc_data[data[1]](data, stat) if not event: - return [0, "Hmm ?"] + msg = ("Hmm ?", "Besoin de quelque chose ?", "Vous cherchez quelqu'un ?", "Vous etes... ?", "Oui ?", "He ! Regarde ou tu vas.") + return [0, choice(msg)] elif type(event) == tuple: issue = fight(stat, event[0], event[1]) if issue == 0: stat[1] += event[2] - if sum(stat[2][:-1]) >= 200: return [1, "Vous avez gagne le combat. [+{}PO]".format(event[2])] + if sum(stat[2][:-1]) >= 200: return [event[3], "Vous avez gagne le combat. [+{}PO]".format(event[2])] print_text("Vous avez gagne le combat. [+{}PO]".format(event[2])) - data[0] += 1 + data[0] += event[3] choice = 0 while not choice: print(" Amelioration ") @@ -122,6 +125,9 @@ def routine(data, stat): if stat[2][4] < stat[0] // 2 and not (stat[4] % 60): stat[2][4] += 1 + if data[0] >= 48 and stat[8] == 2: + stat[8] = 0 + # Game mecanics def fight(stat, opponent_stat, opponent_name): @@ -218,8 +224,6 @@ def fight(stat, opponent_stat, opponent_name): # player_stat = [vitesse, agilité, attaque, défense] player_stat = [stat[2][0], stat[2][1], stat[2][2] + stat[3][0] * 5, stat[2][3] + stat[3][1] * 5] - player = opponent = 0 - end = False while not end: choice = 0 @@ -250,9 +254,14 @@ def fight(stat, opponent_stat, opponent_name): choice = 0 # Who start - while player == opponent: - player = stat_test(player_stat, 0)[1] - opponent = stat_test(opponent_stat[:-1], 0)[1] + player = opponent = False + while player == False and opponent == False: + player = stat_test(player_stat, 0)[0] + opponent = stat_test(opponent_stat[:-1], 0)[0] + + if player == True and opponent == True: + if player_stat[0] < opponent_stat[0]: opponent = False + else: player = False # Fight if player > opponent: @@ -274,6 +283,7 @@ def fight(stat, opponent_stat, opponent_name): def misc_stat(data, stat): if data[1] < 9: place = ("Asgard", "Vanaheim", "Alfheim", "Midgard", "Niflheim", "Jotunheim", "Nidavellir", "Muspellheim", "Svartalfheim")[data[1]] + elif data[1] == 27: place = "chez vous" else: place = "interieur" money, ticks, player_class = stat[1], stat[4], stat[6] @@ -334,29 +344,23 @@ def inventory(data, stat): def sleep(data, stat): - if 360 < stat[4] < 1140: - print_text("Vous ne pouvez pas dormir de jour.") - return - sleep_hours = 0 while not sleep_hours: - print("Combien d'heure\nvoulez-vous dormir ?") - sleep_hours = input(">") - try: sleep_hours = int(sleep_hours) % 24 - except: sleep_hours = 0 + print("Combien d'heures\nvoulez-vous dormir ?") + sleep_hours = get_input() % 25 if sleep_hours < 0: sleep_hours = 0 stat[4] += sleep_hours * 60 - stat[0] += sleep_hours - stat[2][4] += sleep_hours // 2 + if stat[0] < 100: stat[0] += sleep_hours + if stat[2][4] < 50: stat[2][4] += sleep_hours // 2 # If the player is at home if data[1] == 27: if stat[0] < 100: stat[0] += 5 * sleep_hours - stat[2][4] += sleep_hours // 2 + if stat[2][4] < 50: stat[2][4] += sleep_hours // 2 - print_text("Vous vous reposez.") + print_text("Vous vous reposez {0} heure{1}.".format(sleep_hours, ("", "s")[sleep_hours > 1])) def spell(data, stat): @@ -380,8 +384,16 @@ def spell(data, stat): input() +def quick_save(data, stat): + data_copy = data[:] + data_copy[2] += 10 + data_copy[3] += 3 + print("idk({0}, {1})".format(stat[:-1], data_copy)) + input() + + events = {"*": npc, "?": point_of_interest} -keys = {4: display_stat, 7: spell, 8:misc_stat, 6: inventory, 9: sleep} +keys = {4: display_stat, 7: spell, 8: misc_stat, 6: inventory, 9: sleep, "s": quick_save} # Main function def idk(stat=None, data=None): @@ -427,15 +439,18 @@ def idk(stat=None, data=None): # Player's class check if not (0 <= stat[6] <= 5): - raise ValueError("unknown player's class") + raise ValueError("classe du joueur inconnue") + + if len(stat[5]) > 13: + raise ValueError("nom du joueur trop long") idk_game = Asci(maps, events, keys) - stat, data = idk_game.mainloop(100, stat, data, routine=routine, door="^_", walkable=".,`' ", exit_key="q") + stat, data = idk_game.mainloop(102, stat, data, routine=routine, door="^_", walkable=".,`' ", exit_key="q") print("idk({0}, {1})".format(stat[:-1], data)) -# Misc function +# Misc functions def get_input(): string = input(">") try: diff --git a/idk_demo/jotunheim.py b/idk_demo/jotunheim.py index dfb3458..116f369 100644 --- a/idk_demo/jotunheim.py +++ b/idk_demo/jotunheim.py @@ -43,7 +43,7 @@ jotunheim = (r""" /\ / \ \ /\ / \ / \ ______ / \ / \ / \_ / \ /\ ~ / \ \ \/ \ /________\ / \ /________\ |_| / \ / \ / \_ ~ / \ _ / \ | | _______________ /________\ | | / \ / \ - / /\ \ / \ / \ | o o o o| / \ | [] [] | | _ | /\ /\ / /\ \ + / /\ \ / \ / \ | o o o o| / Utgard \ | [] [] | | _ | /\ /\ / /\ \ / \ |_| * |________| / () () () () \ | | |__|^|___| / \_ / \_ / \_ / \ /\ /___________________\ |________| / _ \ / \ / \ / \/ \ ______ |_/ \_/ \_/ \_| / / \ \/ /\ \/ \ @@ -76,9 +76,9 @@ jotunheim = (r""" ~~~~~ ~~~~~~~~ /-\ | | ~~~~~~~~~~~~~~~~~ | ## ## ### |--| ## #### ## ~~~~ ~~~~~~~~~~~~~~~~~ *|___| ~~~~~~~~~~~~~~~~ | #### || ##### ## #### |--| #### ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ## ## | ## ##### #### ###### |--| ###### -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ## #### #### | || ### ###### ######## ######## -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | #### ## /\ /\ | ### |_| ######## ###### ###### -~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~ | /\ #### | ## ##### ###### #### #### +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |~~~~~~~~~~~~~~~~~~~ ## #### #### | || ### ###### ######## ######## +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| |~~~~~~~~~~~~~~ | #### ## /\ /\ | ### |_| ######## ###### ###### +~~~~~~~~~~~~~~~~~~~~ # ~~~~~| |~~ | /\ #### | ## ##### ###### #### #### ~~~~~~~~~~~~~~ ### # |==| () /\ () | #### ##### #### |--| ## |--| ~~~~~~~~~ ##### ### | /__\ __ /__\ | ## ### |--| |--| #### |--| ~~~~~~ # ### # ##### | | |___/()\___| | | || |_| |--| ###### @@ -131,7 +131,7 @@ jotunheim = (r""" (29, 11, 31, 19, 14), (88, 25, 32, 14, 24), (89, 45, 33, 30, 24), - (60, 50, 34, 34, 29), # Palais de Thrym + (60, 50, 34, 34, 29), # Utgard (64, 85, 35, 24, 19), # Manoir du sud (1/2) (65, 85, 35, 25, 19), # Manoir du sud (2/2) (23, 88, 36, 19, 14), # Auberge @@ -154,7 +154,7 @@ jotunheim = (r""" def jotunheim_po(coords): if coords == (60, 57): return [0, "Un bruit de fontaine monte a vos oreilles. A travers les arbres, l'immense palais de Thrym se dresse. Les enormes colonnes qui entourent le batiments sont a elles seules des symboles de demesures. Aux alentours se dresse quelques maisons tout aussi imposantes et enorme, mais moins travaillee."] elif coords == (23, 70): return [0, "Face a la mer, sur une langue de terre, le phare se dresse, eclairant puissemment le large pour signaler l'estuaire."] - elif coords == (60, 86): return [0, "Un imposant manoir se tient devant vous, flanque de deux tours surmontes de domes en ardoise brillantes, l'ensemble est perce de multiples et larges ouvertures. Le parc autour se compose de quelques arbres et est delimite au nord par le fleuve."] + elif coords == (60, 86): return [0, "Un imposant manoir se tient devant vous, flanque de deux tours surmontees de domes en ardoise brillantes, l'ensemble est perce de multiples et larges ouvertures. Le parc autour se compose de quelques arbres et est delimite au nord par le fleuve."] def jotunheim_npc(data, stat): pass @@ -319,11 +319,12 @@ h_35 = (r""" | | |======================\ /======================| |==|/\|=|/\|=|/\|=|/\|=/^^\=|/\|=|/\|=|/\|=|/\|==|""", - (24, 19, 5, 0, 0), - (25, 19, 5, 0, 0)) # * : (17, 5) + (24, 19, 5, 64, 85), + (25, 19, 5, 65, 85)) # * : (17, 5) def h_35_npc(data, stat): pass + diff --git a/idk_demo/midgard.py b/idk_demo/midgard.py index 3cbfcd1..4250c6c 100644 --- a/idk_demo/midgard.py +++ b/idk_demo/midgard.py @@ -24,11 +24,11 @@ midgard = (r""" ~~~~~~~~~~~~~~~~~~~~~~~~~~~ /\ #### ##|| ## #### ##|| #### ## #### ## ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ / \ ## #### || ## #### #### ##|| #### ##|| ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ / \ || #### ? || #### ## #### ## #### ~~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ## ## || #### || #### ~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ /\ || ||#### ## ## ## ~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ _/ \ /\ ## #### ||#### || ## ~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / \ #### ## ## #### #### ~~~~~~~ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ / /\ / \ ' . #### ##|| #### ## ## #### ~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ## || #### || #### ~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ /\ || || ## ## ## ~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ _/ \ /\ ## ||#### || ## ~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / \ #### ## #### #### ~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ / /\ / \ ' . #### ## #### ## ## #### ~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~ / \ ## #### #### ##|| #### ## ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ /\ /\ / \ . || #### ## #### #### ##|| ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ / \ / \ /\ ## || #### ## #### ~~~~~~~~~ @@ -123,21 +123,25 @@ def midgard_npc(data, stat): # (67, 46) # (39, 49) # (66, 56) - # (51, 60) # (68, 71) coords = data[2], data[3] - xp = data[0] - if coords == (8, 59): - return [0, "Laard, je suis marin de mon etat."] + # Charrette + if coords == (39, 49): + if stat[9] == -1 or data[0] == stat[9]: + stat[9] = data[0] + return [0, "[LE CONDUCTEUR DE LA CHARRETTE SE TOURNA VERS VOUS] Ou voulez-vous aller ? Je vous emmene pour 5 pieces.\n1. Vanaheim\n2. Asgard\n3. Nidavellir\n4. Niflheim", 4] - elif coords == (51, 60): - return { - 0: [0, "Vous cherchez quelque chose ?\n1. Oui : Asgard.\n2. Je cherche Vanaheim.\n3. Non, tout va bien.", 3], - 1: [-1, "Vous devriez essayer au nord, en passant par la foret, a l'est."], - 2: [-2, "Hum, vous avez regarde du cote de la petite maison tout a l'ouest ? Un bon ami a moi, Laard est souvent a cote."], - 3: [-3, "Dans ce cas... Bonne journee !"], - } + else: + destinations = ("Vanaheim", "Asgard", "Nidavellir", "Niflheim") + dest_coords = ((1, 54, 29), (0, 126, 71), (6, 93, 8), (4, 78, 19)) + for i in range(1, 5): + if data[0] == stat[9] + i: + stat[9] = -1 + if stat[1] < 5: return [-i, "Je ne travaille pas gratuitement."] + else: + data[1], data[2], data[3] = dest_coords[i - 1][0], dest_coords[i - 1][1], dest_coords[i - 1][2] + return [-i, "C'est parti pour {} !".format(destinations[i - 1]), 0, (1, -5), (4, 60)] @@ -215,7 +219,7 @@ def h_26_npc(data, stat): else: stat[4] = 360 return [-2, "Suivez-moi, je vais vous montrer votre chambre. [VOUS SUIVEZ ROSAHIL DANS L'AUBERGE, LA NUIT PASSA.]", 0, (0, 10), (1, -10)] - + else: return [0, "Ui hips ?"] diff --git a/idk_demo/muspellheim.py b/idk_demo/muspellheim.py index b551b5e..9fe8a06 100644 --- a/idk_demo/muspellheim.py +++ b/idk_demo/muspellheim.py @@ -219,16 +219,16 @@ def h_43_npc(data, stat): if stat[9] == -1 or data[0] == stat[9]: stat[9] = data[0] - return [0, "Bienvenue, dans mon armurerie ! Je suis Bertfrid, besoin d'une armure ?\n1. Oui, d'une rondache. [-10 PO]\n2. d'un pavois [-20 PO]\n3. d'une cotte de mailles [-30 PO]\n4. d'une broigne [-40 PO]\n5. d'un harnois [-50 PO]"] + return [0, "Bienvenue, dans mon armurerie ! Je suis Bertfrid, besoin d'une armure ?\n1. Oui, d'une rondache. [-10 PO]\n2. d'un pavois [-20 PO]\n3. d'une cotte de mailles [-30 PO]\n4. d'une broigne [-40 PO]\n5. d'un harnois [-50 PO]", 5] else: shields = ("UNE RONDACHE", "UN PAVOIS", "UNE COTTE DE MAILLES", "UNE BROIGNE", "UN HARNOIS") for i in range(1, 6): if data[0] == stat[9] + i: stat[9] = -1 - if stat[1] < (i + 1) * 10: return [-i, "Vous n'avez pas assez."] - stat[3][1] = i + 1 - return [-i, "C'est un bon achat. [BERTFRID DECROCHA {}]".format(shields[i - 1]), 0, (1, -(i + 1) * 10)] + if stat[1] < i * 10: return [-i, "Vous n'avez pas assez."] + stat[3][1] = i + return [-i, "C'est un bon achat. [BERTFRID DECROCHA {}]".format(shields[i - 1]), 0, (1, -i * 10)] elif coords == (13, 9): if stat[3][1] == 0: return [0, "J'achete, je ne vend pas ! Allez voir Bertfrid du cote du four a metaux, elle vous renseignera"] diff --git a/idk_demo/nidavellir.py b/idk_demo/nidavellir.py index 995cdc8..b23fd0b 100644 --- a/idk_demo/nidavellir.py +++ b/idk_demo/nidavellir.py @@ -76,13 +76,13 @@ nidavellir = (r""" / / \ / / \ / \/ \ / \ /\ / / """, # Autres mondes (Nidavellir = 6) (93, 8, 3, 77, 62), # Midgard - (9, 57, 7, 92, 2), # Muspellheim + (9, 57, 7, 92, 9), # Muspellheim (39, 19, 8, 109, 66), # Svartalfheim # Maisons (69, 26, 37, 15, 14), # Auberge ( 7, 31, 38, 15, 14), - (35, 38, 39, 14, 14), # Armurerie + (35, 38, 39, 14, 14), # Forge (22, 42, 40, 12, 14), (23, 51, 41, 10, 19), diff --git a/idk_demo/svartalfheim.py b/idk_demo/svartalfheim.py index 51c6f0c..9ba6623 100644 --- a/idk_demo/svartalfheim.py +++ b/idk_demo/svartalfheim.py @@ -97,11 +97,11 @@ def svartalfheim_npc(data, stat): coords = data[2], data[3] if coords == (120, 49) or coords == (104, 30): - if stat[4] >= 1260 and stat[4] <= 300: return [0, "Hmm, hein ? Quoi ? Zavez pas vu l'heure ??"] + if not (360 <= stat[4] <= 1200): return [0, "Hmm, hein ? Quoi ? Zavez pas vu l'heure ??"] if stat[9] == -1 or data[0] == stat[9]: stat[9] = data[0] - return [0, "Hey, toi ! Tu veux traverser ?\n1.Traverser [2 PO]\n2.Ne pas traverser"] + return [0, "Hey, toi ! Tu veux traverser ?\n1. Traverser [2 PO]\n2. Ne pas traverser", 2] elif data[0] == stat[9] + 1: stat[9] = -1 @@ -141,7 +141,7 @@ h_45 = (r""" | |====| |====| | |=================| | | |==================| |^| """, - (24, 19, 4, 90, 15)) # * : (15, 4) + (24, 19, 8, 90, 15)) # * : (15, 4) def h_45_npc(data, stat): pass @@ -161,7 +161,7 @@ h_46 = (r""" | | | | |=======|^|========|""", - (9, 9, 4, 6, 24), + (9, 9, 8, 6, 24), ) # * : (13, 2) * : (13, 4) def h_46_npc(data, stat): @@ -171,6 +171,8 @@ def h_46_npc(data, stat): + + h_47 = (r""" |=========| | [-=-==] | @@ -187,7 +189,7 @@ h_47 = (r""" | |__| |__| | | | |^|==========================|""", - (1, 14, 4, 91, 33)) # * : (3, 4) * : (15, 8) + (1, 14, 8, 91, 33)) # * : (3, 4) * : (15, 8) def h_47_npc(data, stat): pass @@ -212,7 +214,7 @@ h_48 = (r""" | \__/ \__/ \__/ \__/ | |==| |======| |=| |=| |======| |==| | | | | |^=| | | | | """, - (19, 14, 4, 57, 59)) # * : (34, 5) * : (29, 6) + (19, 14, 8, 57, 59)) # * : (34, 5) * : (29, 6) def h_48_npc(data, stat): pass \ No newline at end of file diff --git a/idk_demo/vanaheim.py b/idk_demo/vanaheim.py index 3853033..d08dc0e 100644 --- a/idk_demo/vanaheim.py +++ b/idk_demo/vanaheim.py @@ -44,7 +44,7 @@ vanaheim = (r""" / \ /\ / \ / \ .'' |_| ,'`' ',` |_| /\ / \ / / \ / \ ,., .,`, /\ ', ,` / \ / /\ / \ /\ / \ /\ / \ / \ /\ / - / \ / \ / \ / \ /\ / \ /\ / \ / \ + / \ / \ / \ / \ /\ * / \ /\ / \ / \ / \ / \ / \ / \ /\ / / \ /\ / \ / \ / \ /\ / / \ / \ / \ / \ / \ / \ / / \ / / \ @@ -66,11 +66,23 @@ vanaheim = (r""" def vanaheim_npc(data, stat): coords = data[2], data[3] - xp = data[0] - if coords == (31, 12): return { - "base": [0, "Riethas, simple paysan. Que Nerthus vous garde !"], - } + # Charrette + if coords == (45, 39): + if stat[9] == -1 or data[0] == stat[9]: + stat[9] = data[0] + return [0, "[LE CONDUCTEUR DE LA CHARRETTE SE TOURNA VERS VOUS] Ou voulez-vous aller ? Je vous emmene pour 5 pieces.\n1. Midgard\n2. Jotunheim\n3. Alfheim", 3] + + else: + destinations = ("Midgard", "Jotunheim", "Alfheim") + dest_coords = ((3, 10, 58), (5, 11, 120), (2, 14, 68)) + for i in range(1, 4): + if data[0] == stat[9] + i: + stat[9] = -1 + if stat[1] < 5: return [-i, "Je ne travaille pas gratuitement."] + else: + data[1], data[2], data[3] = dest_coords[i - 1][0], dest_coords[i - 1][1], dest_coords[i - 1][2] + return [-i, "C'est parti pour {} !".format(destinations[i - 1]), 0, (1, -5), (4, 60)] def vanaheim_po(coords): if coords == (42, 20): return [0, "Vous vous trouvez sur le bord d'une large place verdoyante et bien entretenue. Entoure de montagnes, Vanaheim semble hors d'atteinte du temps. Quelques maisons et arbres completent le decor."] @@ -108,7 +120,7 @@ def h_21_npc(data, stat): elif data[0] == stat[9] + 2: stat[9] = -1 if stat[1] < 2: return [0, "La maison ne fait pas credit."] - return [-2, "Et voila ! [L'AUBERGISTE PLACA DEVANT VOUS UNE CHOPPE DE BIERE]", 0, (0, 2), (1, -2)] + return [-2, "Et voila ! [L'AUBERGISTE PLACA DEVANT VOUS UNE CHOPE DE BIERE]", 0, (0, 2), (1, -2)] elif data[0] == stat[9] + 3: stat[9] = -1 @@ -116,7 +128,6 @@ def h_21_npc(data, stat): stat[4] = 360 return [-3, "Votre chambre est a l'etage.\n[VOUS MONTEZ A L'ETAGE ET VOUS ENDORMEZ SANS DIFFICULTES.]", 0, (0, 10), (1, -10)] - return [0, "Ch'rois hips qu'j'ais hips trop buu'hips."] @@ -145,13 +156,4 @@ h_22 = (r""" (20, 19, 1, 52, 35)) # * : (36, 3) * : (2, 8) def h_22_npc(data, stat): - coords = data[2], data[3] - xp = data[0] - - # Freyja - if coords == (2, 8): - return [0, "Bonjour, je suis Freyja, deesse de la beaute et de l'erotisme."] - - # Freyr - elif coords == (36, 3): - return [0, "Freyr, dieu de la vie. Bienvenue a Vanaheim"] + pass \ No newline at end of file