2022-01-16 11:39:44 +01:00
from idk_lib import *
2022-04-17 22:29:26 +02:00
try :
import dlc_scenario as dlc
spells = dlc . dlc_spells
spells_level = dlc . dlc_spells_level
spells_effect = dlc . dlc_spells_effect
weapons = dlc . dlc_weapons
armors = dlc . dlc_armors
dlc_entities = dlc . dlc_entities
except :
dlc = None
dlc_entities = ( )
2022-01-16 11:39:44 +01:00
# Game
2022-04-17 22:29:26 +02:00
def npc ( data , stat , entities , identifiant ) :
2022-01-16 11:39:44 +01:00
npc_data = (
asgard_npc ,
vanaheim_npc ,
alfheim_npc ,
midgard_npc ,
niflheim_npc ,
jotunheim_npc ,
nidavellir_npc ,
muspellheim_npc ,
svartalfheim_npc ,
h_9_npc , h_10_npc , h_11_npc , h_12_npc , h_13_npc , h_14_npc , h_15_npc , h_16_npc , h_17_npc , h_18_npc , h_19_npc , h_20_npc ,
h_21_npc , h_22_npc ,
h_23_npc , h_24_npc ,
h_25_npc , h_26_npc , h_27_npc , h_28_npc ,
h_29_npc , h_30_npc ,
h_31_npc , h_32_npc , h_33_npc , h_34_npc , h_35_npc , h_36_npc ,
h_37_npc , h_38_npc , h_39_npc , h_40_npc , h_41_npc ,
h_42_npc , h_43_npc , h_44_npc ,
h_45_npc , h_46_npc , h_47_npc , h_48_npc )
2022-04-17 22:29:26 +02:00
if dlc :
event = dlc . dlc_npc ( data , stat , entities , identifiant )
if event : return " dlc " , event
return npc_core ( npc_data [ data [ 1 ] ] , data , stat , entities , identifiant )
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def point_of_interest ( data , stat , entities , identifiant ) :
2022-01-16 11:39:44 +01:00
po_data = (
asgard_po ,
vanaheim_po ,
alfheim_po ,
midgard_po ,
niflheim_po ,
jotunheim_po ,
nidavellir_po ,
muspellheim_po ,
svartalfheim_po
)
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
event = po_data [ data [ 1 ] ] ( coords , identifiant )
2022-01-16 11:39:44 +01:00
if not event : return [ 0 , " Il n ' y a rien à voir ici. " ]
else : return event
2022-04-17 22:29:26 +02:00
entities = asgard_entities + vanaheim_entities + alfheim_entities + midgard_entities + niflheim_entities + jotunheim_entities + nidavellir_entities + muspellheim_entities + svartalfheim_entities + dlc_entities
print ( " <titre> " )
print ( " Entrez ' ' pour \n une nouvelle partie. " )
2022-01-16 11:39:44 +01:00
events = { " * " : npc , " ? " : point_of_interest }
keys = { 4 : display_stat , 7 : spell , 8 : misc_stat , 6 : inventory , 9 : sleep , " s " : quick_save }
def scenario ( save_code = None ) :
# stat = [0 - PV, 1 - pièces d'or, 2 - [vitesse, agilité, attaque, defense, magie], 3 - [arme, armure], 4 - ticks, 5 - nom, 6 - classe, 7 - sorts connus : (id, level), 8 - sous-quêtes terminées]
if not save_code :
stat = init_stat ( )
name = stat [ 5 ]
data = [ { " main " : 0 } , 3 , 44 , 66 ]
2022-04-17 22:29:26 +02:00
print_text ( " introduction " )
2022-01-16 11:39:44 +01:00
else :
stat , data = decode_save ( save_code )
2022-04-17 22:29:26 +02:00
idk_game = Asci ( maps , entities , events , keys )
stat , data = idk_game . mainloop ( 1 , stat , data , routine = routine , door = " ^_ " , walkable = " .,` ' " , exit_key = " q " )
2022-01-16 11:39:44 +01:00
if stat [ 9 ] != - 1 : data [ 0 ] [ " main " ] - = stat [ 9 ]
2022-04-17 22:29:26 +02:00
if data [ 0 ] [ " main " ] == 1 :
print_text ( " conclusion " )
2022-01-16 11:39:44 +01:00
else :
2022-04-17 22:29:26 +02:00
print ( " idk( \" {} \" ) " . format ( encode_save ( data , stat [ : - 1 ] ) ) )
2022-01-16 11:39:44 +01:00
# Scenario
def shop_interaction ( data , stat , nb_choice , * events ) :
for choice in range ( nb_choice ) :
if data [ 0 ] [ " main " ] == stat [ 9 ] + choice + 1 :
stat [ 9 ] = - 1
if stat [ 1 ] < events [ choice ] [ 0 ] : return events [ choice ] [ 2 ] , choice + 1
else : return events [ choice ] [ 1 ] , choice + 1
# - - - Asgard - - - #
2022-04-17 22:29:26 +02:00
def asgard_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def asgard_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
# * : ( 34, 7)
# * : ( 29, 13)
# * : ( 19, 20)
# * : (121, 21)
# * : ( 28, 26)
# * : (117, 32)
# * : ( 46, 35)
# * : ( 57, 38)
# * : ( 82, 38)
# * : ( 22, 39)
# * : ( 8, 44)
# * : ( 58, 50)
# * : ( 83, 51)
# * : ( 32, 59)
# * : (104, 63)
# * : ( 46, 65)
# * : ( 16, 71)
# * : (138, 71)
pass
# Forseti
2022-04-17 22:29:26 +02:00
def h_9_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
2022-01-16 11:39:44 +01:00
# Odin
2022-04-17 22:29:26 +02:00
def h_10_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_11_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_12_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# Folkvangr
2022-04-17 22:29:26 +02:00
def h_13_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_14_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# Vidar
2022-04-17 22:29:26 +02:00
def h_15_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_16_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_17_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_18_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_19_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_20_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# - - - Vanaheim - - - #
2022-04-17 22:29:26 +02:00
def vanaheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def vanaheim_npc ( data , stat , entites , identifiant ) :
pass
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def h_22_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# - - - Alfheim - - - #
2022-04-17 22:29:26 +02:00
def alfheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def alfheim_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (11; 4)
# * : (46; 6)
# * : (23; 17)
# * : (27; 54)
2022-04-17 22:29:26 +02:00
pass
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def h_23_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_24_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
if not ( 480 < = stat [ 4 ] < = 1140 ) : return [ 0 , " Excusez-moi, nous sommes fermes. " ]
if coords == ( 12 , 3 ) :
if not stat [ 7 ] : return [ 0 , " Je ne peux pas vous faire oublier ce que vous ne connaissez pas. " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
2022-04-17 22:29:26 +02:00
return [ 0 , " Quel sort souhaitez-vous oublier ? \n " + " \n " . join ( [ " {0} . {1} {2} " . format ( nb + 1 , spells [ stat [ 7 ] [ nb ] [ 0 ] ] , spells_level [ stat [ 7 ] [ nb ] [ 1 ] - 1 ] ) for nb in range ( len ( stat [ 7 ] ) ) ] ) , len ( stat [ 7 ] ) ]
2022-01-16 11:39:44 +01:00
else :
for i in range ( 1 , len ( stat [ 7 ] ) + 1 ) :
if data [ 0 ] [ " main " ] == stat [ 9 ] + i :
stat [ 9 ] = - 1
stat [ 7 ] . pop ( i - 1 )
2022-04-17 22:29:26 +02:00
pts = ( 20 * stat [ 0 ] ) / / 100
return [ - i , " Asseyez-vous, je vais vous faire oublier ce sort. [UN PUISSANT MAL DE TETE VOUS PRIT, LES MURS SEMBLERENT TANGUER TANDIS QUE VOTRE VUE DEVINT FLOUE. LE VERTIGE S ' ESTOMPA PROGRESSIVEMENT.] Et voila ! [- {} PV] " . format ( pts ) , 0 , ( 0 , - pts ) ]
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
if coords == ( 36 , 12 ) :
2022-01-16 11:39:44 +01:00
if len ( stat [ 7 ] ) > = 3 : return [ 0 , " Je suis desole, vous ne pouvez pas apprendre plus de trois sorts. " ]
2022-04-17 22:29:26 +02:00
spells_sale = [ ]
formated_spells = " "
while len ( spells_sale ) < 3 :
sp_id = randint ( 0 , len ( spells ) - 1 )
sp_lvl = randint ( 1 , len ( spells_level ) )
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
check = True
for sp in spells_sale :
if sp [ 0 ] == sp_id and sp [ 1 ] == sp_lvl :
check = False
break
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
if check :
spells_sale . append ( ( sp_id , sp_lvl ) )
formated_spells + = " {0} . {1} {2} \n " . format ( len ( spells_sale ) , spells [ sp_id ] , spells_level [ sp_lvl - 1 ] )
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
spell_choice = print_text ( " Diomwar, pour vous servir. Quel sort voulez-vous acheter ? \n {} " . format ( formated_spells ) , 1 , 3 , 0 )
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
if not spell_choice : return [ 0 , " Hmm ? " ]
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
spell_sel = spells_sale [ spell_choice - 1 ]
if stat [ 1 ] < 10 * spell_sel [ 1 ] : return [ 0 , " Vous n ' avez pas les moyens, desole. " ]
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
spell_id = - 1
for sp_id in range ( len ( stat [ 7 ] ) ) :
sp = stat [ 7 ] [ sp_id ]
if spell_sel [ 0 ] == sp [ 0 ] :
if spells_sel [ 1 ] < = sp [ 1 ] : return [ 0 , " Vous connaissez deja ce sort. " ]
else :
spell_id = sp_id
break
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
if spell_id == - 1 :
stat [ 7 ] . append ( spells_sale [ i ] )
2022-01-16 11:39:44 +01:00
else :
2022-04-17 22:29:26 +02:00
stat [ 7 ] [ spell_id ] = spells_sale [ i ]
return [ 0 , " [DIOMWAR OUVRIT UN LIVRE RELIE DE CUIR NOIR, ET TRACA DU DOIGT DES SIGNES CABALISTIQUES SUR LE SOL. LES RUNES BRILLERENT PUISSAMMENT AVANT DE S ' ETEINDRE.] " , 0 , ( 1 , - 10 * spells_sel [ 1 ] ) ]
# - - - Midgard - - - #
def midgard_po ( coords , identifiant ) :
pass
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def midgard_npc ( data , stat , entites , identifiant ) :
# (67, 46)
# (39, 49)
# (66, 56)
# (68, 71)
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_25_npc ( data , stat , entites , identifiant ) :
pass
def h_26_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (17, 7)
# * : (22, 7)
# * : (17, 8)
# * : (27, 8)
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
if identifiant == " Rosahil Green " :
2022-01-16 11:39:44 +01:00
if stat [ 4 ] > = 1320 or stat [ 4 ] < = 340 : return [ 0 , " Je suis desolee, nous sommes fermes. Revenez plus tard ! " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Rosahil Green, tenanciere de cette auberge. Vous desirez quelque chose ? \n 1.De quoi manger s ' il vous plait. [-5 PO] \n 2.Je voudrais une chambre pour la nuit. [-10 PO] " , 2 ]
else :
event , choice = shop_interaction ( data , stat , 2 ,
( 5 , [ - 1 , " Et voila pour vous ! [ROSAHIL POSA UNE ASSIETTE DE RAGOUT CHAUD DEVANT VOUS.] " , 0 , ( 0 , 5 ) , ( 1 , - 5 ) ] , [ - 1 , " Reviens quand tu auras assez de pieces d ' or. " ] ) ,
( 10 , [ - 2 , " Suivez-moi, je vais vous montrer votre chambre. [VOUS SUIVEZ ROSAHIL DANS L ' AUBERGE, LA NUIT PASSA.] " , 0 , ( 0 , 10 ) , ( 1 , - 10 ) , ( 4 , 480 ) ] , [ - 2 , " Je suis desolee, tu n ' as pas assez ! " ] ) )
if choice == 2 and 360 < stat [ 4 ] < 1140 : return [ - 2 , " Il est trop tot, revenez vers 19h. " ]
else : return event
2022-04-17 22:29:26 +02:00
2022-01-16 11:39:44 +01:00
else : return [ 0 , " Ui hips ? " ]
2022-04-17 22:29:26 +02:00
def h_27_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_28_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
2022-01-16 11:39:44 +01:00
# - - - Niflheim - - - #
2022-04-17 22:29:26 +02:00
def niflheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def niflheim_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (95, 30)
# * : (57, 31)
# * : (39, 60)
# * : (108, 67)
pass
2022-04-17 22:29:26 +02:00
def h_29_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
n = len ( spells )
spells_sale = [ ( i , len ( spells_level ) ) for i in range ( n ) ]
formated_spells = " "
for sp in range ( n ) :
formated_spells + = " {0} . {1} {2} \n " . format ( sp + 1 , spells [ spells_sale [ sp ] [ 0 ] ] , spells_level [ spells_sale [ sp ] [ 1 ] - 1 ] )
2022-01-16 11:39:44 +01:00
if not ( 480 < = stat [ 4 ] < = 1140 ) : return [ 0 , " Je suis desolee, nous sommes fermes. " ]
if coords == ( 5 , 5 ) :
if len ( stat [ 7 ] ) > = 3 : return [ 0 , " Vous ne pouvez pas apprendre plus de sort, et je ne pratique pas les sorts d ' oubli. Je crois qu ' une librairie vers Alfheim le fait gratuitement. " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
2022-04-17 22:29:26 +02:00
return [ 0 , " Merath, je vend les sorts les plus puissants de tout l ' Yggdrasil ! Quel sort voulez-vous ? \n {} " . format ( formated_spells ) , n ]
2022-01-16 11:39:44 +01:00
else :
2022-04-17 22:29:26 +02:00
for i in range ( 1 , n + 1 ) :
2022-01-16 11:39:44 +01:00
if data [ 0 ] [ " main " ] == stat [ 9 ] + i :
stat [ 9 ] = - 1
if stat [ 1 ] < 50 : return [ - i , " Vous n ' avez pas les moyens, desolee. " ]
spell_id = - 1
2022-04-17 22:29:26 +02:00
for sp_id in range ( len ( stat [ 7 ] ) ) :
2022-01-16 11:39:44 +01:00
sp = stat [ 7 ] [ sp_id ]
if spells_sale [ i - 1 ] [ 0 ] == sp [ 0 ] :
if spells_sale [ i - 1 ] [ 1 ] < = sp [ 1 ] : return [ - i , " Vous connaissez deja ce sort. " ]
else :
spell_id = sp_id
break
if spell_id == - 1 :
stat [ 7 ] . append ( spells_sale [ i - 1 ] )
else :
stat [ 7 ] [ spell_id ] = spells_sale [ i - 1 ]
return [ - i , " [MERATH SE RETOURNA ET S ' EMPARA D ' UN GRIMOIRE. ELLE L ' OUVRIT ET LUT A HAUTE VOIX. UNE LOURDE TORPEUR S ' ABBATIT SUR VOUS. QUAND VOUS REPRENEZ PLEINEMENT CONSCIENCE, LE SORT EST GRAVE DANS VOTRE MEMOIRE.] " , 0 , ( 1 , - 50 ) ]
2022-04-17 22:29:26 +02:00
def h_30_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# - - - Jotunheim - - - #
2022-04-17 22:29:26 +02:00
def jotunheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def jotunheim_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (25; 10)
# * : (39; 20)
# * : (3; 28)
# * : (34; 45)
# * : (53; 49)
# * : (19; 51)
# * : (34; 56)
# * : (64; 64)
# * : (54; 70)
# * : (8; 72)
# * : (40; 75)
# * : (72; 87)
# * : (6; 98)
pass
2022-04-17 22:29:26 +02:00
def h_31_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_32_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_33_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_34_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_35_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_36_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
if identifiant == " jotunheim_aubergiste " :
2022-01-16 11:39:44 +01:00
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 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Vous voulez quelque-chose ? \n 1. Je mangerai bien un truc [-4 PO] \n 2. Il vous reste une chambre ? [-12 PO] " , 2 ]
else :
event , choice = shop_interaction ( data , stat , 2 ,
( 4 , [ - 1 , " Et voila ! [LE TAVERNIER POSA UNE ASSIETTE FUMANTE DEVANT VOUS ET UN VERRE DE VIN] " , 0 , ( 0 , 5 ) , ( 1 , - 4 ) ] , [ - 1 , " Reviens quand tu auras de quoi me payer. " ] ) ,
( 12 , [ - 2 , " Oui, au premier etage, au bout du couloir sur votre droite. [VOUS SUIVEZ LES INDICATIONS DU TAVERNIER ET TROUVEZ VOTRE CHAMBRE. VOUS SOMBREZ DANS LES BRAS DE NOTT.] " , 0 , ( 0 , 15 ) , ( 1 , - 12 ) , ( 4 , 480 ) ] , [ - 2 , " Tu n ' as pas assez. " ] ) )
if choice == 2 and 360 < stat [ 4 ] < 1140 : return [ - 2 , " Il est trop tot, reviens vers 19h. " ]
else : return event
# - - - Nidavellir - - - #
2022-04-17 22:29:26 +02:00
def nidavellir_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def nidavellir_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (49, 21)
# * : (25, 31)
# * : (74, 46)
# * : (16, 55)
# * : (77, 61)
pass
2022-04-17 22:29:26 +02:00
def h_37_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
if identifiant == " Muin " :
2022-01-16 11:39:44 +01:00
if not ( 340 < = stat [ 4 ] < = 1380 ) : return [ 0 , " Nous sommes ouverts de 5 heures a 23. " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Bonjour, Muin pour vous servir. \n 1. Bonjour je voudrais manger. [-5 PO] \n 2. Vous reste-t-il des chambres ? [-15 PO] \n 3. A boire ! [-3 PO] " , 3 ]
else :
event , choice = shop_interaction ( data , stat , 3 ,
( 5 , [ - 1 , " Pas de probleme ! [MUIN REVINT QUELQUES MINUTES PLUS TARD, ET POSA UNE ASSIETTE FUMANTE DEVANT VOUS.] " , 0 , ( 0 , 5 ) , ( 1 , - 5 ) ] , [ - 1 , " Hey la ! Reviens quand tu pourras me payer. " ] ) ,
( 15 , [ - 2 , " Bien sur ! Suivez-moi. [VOUS SUIVEZ MUIN DANS UNE PIECE TROGLODYTE MUNIE D ' UN LIT ET D ' UN COFFRE. VOUS VOUS ENDORMEZ RAPIDEMENT.] " , 0 , ( 0 , 15 ) , ( 1 , - 15 ) , ( 4 , 480 ) ] , [ - 2 , " Desole, je n ' ai plus une seule chambre de libre. " ] ) ,
( 3 , [ - 3 , " [MUIN POSA UNE CHOPPE DE BIERE MOUSSEUSE DEVANT VOUS.] " , 0 , ( 0 , 3 ) , ( 1 , - 3 ) ] , [ - 3 , " Allez donc voir un autre etablissement, nous ne servons pas gratuitement. " ] ) )
if choice == 2 and 360 < stat [ 4 ] < 1140 : return [ - 2 , " Une chambre !? Il n ' est que {} heures. Reviens dans la soiree. " . format ( stat [ 4 ] / / 60 ) ]
else : return event
return [ 0 , " Hmm ? " ]
2022-04-17 22:29:26 +02:00
def h_38_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_39_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
if not ( 480 < = stat [ 4 ] < = 1140 ) : return [ 0 , " La forge de Nidavellir est ouverte de 8 heures a 18 heures. " ]
2022-01-16 11:39:44 +01:00
if coords == ( 9 , 2 ) :
if stat [ 3 ] [ 0 ] : return [ 0 , " Vous avez deja une arme. Allez voir mon confrere si vous voulez la vendre et revenez me voir. " ]
2022-04-17 22:29:26 +02:00
weapons_sale = [ ]
formated_wpn = " "
while len ( weapons_sale ) < 4 :
wpn = randint ( 1 , len ( weapons ) - 1 )
if not wpn in weapons_sale :
weapons_sale . append ( wpn )
formated_wpn + = " {0} . {1} [- {2} PO] \n " . format ( len ( weapons_sale ) , weapons [ wpn ] , 10 * wpn )
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
wpn_choice = print_text ( " Bienvenue a la forge de Nidavellir ! Vous desirez une piece particulière ? \n {} " . format ( formated_wpn ) , 1 , 4 , 0 )
if not wpn_choice : return [ 0 , " Hmm ? " ]
wpn = weapons_sale [ wpn_choice - 1 ]
if stat [ 1 ] < 10 * wpn : return [ 0 , " Vous n ' avez pas assez. " ]
stat [ 3 ] [ 0 ] = wpn
return [ 0 , " Tres bon choix ! [LE NAIN DECROCHA L ' ARME DU RATELIER ET VOUS LA TENDIT.] " , 0 , ( 1 , - 10 * wpn ) ]
2022-01-16 11:39:44 +01:00
if coords == ( 9 , 4 ) :
if stat [ 3 ] [ 0 ] == 0 : return [ 0 , " Vous n ' avez pas d ' arme a me vendre. Allez voir mon collegue pour en acheter une. " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Bienvenue dans notre forge. Vous souhaitez me vendre votre arme ? \n 1. Oui \n 2. Non " , 2 ]
elif data [ 0 ] [ " main " ] == stat [ 9 ] + 1 :
stat [ 9 ] = - 1
cost = stat [ 3 ] [ 0 ] * 8
stat [ 3 ] [ 0 ] = 0
return [ - 1 , " Marche conclu ! [+ {} PO] " . format ( cost ) , 0 , ( 1 , cost ) ]
elif data [ 0 ] [ " main " ] == stat [ 9 ] + 2 :
stat [ 9 ] = - 1
return [ - 2 , " A votre guise, revenez quand vous voulez ! " ]
2022-04-17 22:29:26 +02:00
def h_40_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_41_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# - - - Muspellheim - - - #
2022-04-17 22:29:26 +02:00
def muspellheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def muspellheim_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (20, 12)
# * : (78, 14)
# * : (54, 80)
# * : (59, 91)
# * : (39, 94)
# * : (29, 113)
2022-04-17 22:29:26 +02:00
coords = data [ 2 ] , data [ 3 ]
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
if coords == ( 39 , 94 ) :
if data [ 0 ] [ " main " ] == 71 : return [ 15 , 20 , 20 , 15 , 100 ] , " Soldat Vane " , 20 , 2
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def h_42_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
2022-04-17 22:29:26 +02:00
if identifiant == " muspellheim_aubergiste " :
2022-01-16 11:39:44 +01:00
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 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Besoin de quelque chose messire ? \n 1. Hum, oui, j ' aimerais manger. [-5 PO] \n 2. Je voudrais dormir [-10 PO] " , 2 ]
else :
event , _ = shop_interaction ( data , stat , 2 ,
( 5 , [ - 1 , " Et voila pour vous ! " , 0 , ( 0 , 5 ) , ( 1 , - 5 ) ] , [ - 1 , " Je regrette, vous n ' avez pas assez. " ] ) ,
( 10 , [ - 2 , " Bien sur, si vous voulez bien me suivre. [VOUS VOUS ALLONGEZ SUR LE LIT ET VOUS ENDORMEZ RAPIDEMENT.] " , 0 , ( 0 , 10 ) , ( 1 , - 10 ) , ( 4 , 480 ) ] , [ - 2 , " Nous ne pouvons pas nous permettre de faire credit. " ] ) )
return event
2022-04-17 22:29:26 +02:00
def h_43_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
coords = data [ 2 ] , data [ 3 ]
if not ( 480 < = stat [ 4 ] < = 1140 ) : return [ 0 , " L ' armurerie est ouverte de 8 heures a 18 heures. " ]
2022-04-17 22:29:26 +02:00
if identifiant == " Bertfrid " :
2022-01-16 11:39:44 +01:00
if stat [ 3 ] [ 1 ] : return [ 0 , " Vous portez deja une armure, allez voir mon confrere. " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Bienvenue, dans mon armurerie ! Je suis Bertfrid, besoin d ' une armure ? \n 1. Oui, d ' une rondache. [-10 PO] \n 2. d ' un pavois [-20 PO] \n 3. d ' une cotte de mailles [-30 PO] \n 4. d ' une broigne [-40 PO] \n 5. 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 ] [ " main " ] == stat [ 9 ] + i :
stat [ 9 ] = - 1
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 " ]
if stat [ 9 ] == - 1 or data [ 0 ] [ " main " ] == stat [ 9 ] :
stat [ 9 ] = data [ 0 ] [ " main " ]
return [ 0 , " Vous voulez vendre votre piece d ' armure ? \n 1. Oui \n 2. Non " , 2 ]
elif data [ 0 ] [ " main " ] == stat [ 9 ] + 1 :
stat [ 9 ] = - 1
cost = stat [ 3 ] [ 1 ] * 8
return [ - 1 , " C ' est une affaire ! [+ {} PO] " . format ( cost ) , 0 , ( 1 , cost ) ]
elif data [ 0 ] [ " main " ] == stat [ 9 ] + 2 :
stat [ 9 ] = - 1
return [ - 2 , " Revenez quand vous voulez ! " ]
elif coords == ( 6 , 5 ) :
2022-04-17 22:29:26 +02:00
return [ 0 , " Je ne suis qu ' apprenti monseigneur. Adressez-vous plutot a Bertfrid. Vous la trouverez pres du four. " ]
2022-01-16 11:39:44 +01:00
2022-04-17 22:29:26 +02:00
def h_44_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
# - - - Svartalfheim - - - #
2022-04-17 22:29:26 +02:00
def svartalfheim_po ( coords , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def svartalfheim_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
# * : (10; 24)
# * : (105; 46)
# * : (22; 50)
# * : (15; 54)
# * : (25; 61)
# * : (121; 68)
pass
2022-04-17 22:29:26 +02:00
def h_45_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_46_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_47_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass
2022-04-17 22:29:26 +02:00
def h_48_npc ( data , stat , entites , identifiant ) :
2022-01-16 11:39:44 +01:00
pass