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\ /\ / \ /\ /
~~~~ / \ /\ / \ / \ / \ /\ / / \ / \ / \
/\ ~~~~ / \ / _\ / / \ / \ / \ / \ / \
/ \ /\ ~~~~ / / /^\\ /_ / / \ / \ / \
\ / \ ~~~ / / \ /-\ / / \ / \ / \
/ ~~~~~ / \ |_| / \ /\ /\
/ ~~~~~~ /\ / \ /\ / \ /\
/ ~~~~~~ / \ /\ * / \ / \ /\ / \ / \ /\
/\ ~~~ / \ / \ /\ /\ / / \ / \ / / \ / \
/ \ /\ ~~~ / / \ / \ /_ \ /\ / / / \/ / / \
\ / \ /\ ~~~~ / / \ //^\ \ / \ /\ / /\ / \ / / \
/ \ / \ ~~~~~ / / \ / / \ / \ / _\ /\ \ / \
/ / \ ~~~~~~ / / / / \ / /^\\ / \ /\
/ / \ ~~~~~~~~~~ ## / / \ / / \ / \
/\ / ## \ ~~~~~~~~~ #### / \ / / / \ /\
/ \ /\ #### ## ~~~~~~~ ## / ## / \ \ /\
\ /_ \ ## #### ~~~~~~~ || /\ #### / ## \ \ / \ /\
//^\ \ || ## * ~~~~~~~ / \ /\ ## #### / \ / \
/ \ || ~~~~~~ /^\ \ / \ /\ || ## / /
/ \ /\ ~~~~ / / \ / \ || / /
\ /\ /_ \ /\ ~~~~~~ / / / \ ## /\ /
\ / \ /\ //^\ \ / \ /\ ~~~~ / / \ #### / \ /\
/ \ / \ / / \ / \ ~~~~ / \ ## / \ / \ /\
/ / \ / / / _ \ ------ || / / \ / \
/ / \ / / /^\ \ /\ ## / / /
/ \ / \ -------- / \ /\ #### / /
\ /\ /\ ~~~~ / \ / \ /\ ## /\ /
\ / \ /\ / _\ /\ ~~~ / / \ / \ || / \ /\
/ \ / \ / /^\\ / \ /\ ~~~ / / / /^\ / \ / \ /\
/ / \ / / \ / \ ~~~~~ / / \ / / \ / \
/ / \ / / / \ ~~~~~~ /\ / \ / / /
/ \ / / \ ~~~~~ / \ /\ ## / /
\ /\ / \ ~~~~ / \ / \ /\ * #### /\ /
\ / \ /\ ~~~ / / \ / \ ## ## / \ /\
/ \ / \ /\ ~~~ / / / \ #### || / \ / \ /\
/ /^\ \ //^\ /\ ~~~~ / / \ ## . / / \ / \
/ / \ / \ / \ /\ ~~~~~~~~~~ / \ || .'' / / /
/ ~~/ /^\ \ / \ ~~~~~~~~~~~~ , / /
\ /\ ~~ / / \ /\ ~~~~~~~~~~~~ . /\ /
\ / \ /\ ~~~~~ / / \ / \ /\ ~~~~~~~~~~~~~~~~ .'` / \ /\
/ \ / \ ~~~~) / \/ \ / \ /\ ~~~~~~~~~~~~~~ `.` / \ / \
/ /_ \ * (~~~~~ / / \ / \ ~~~~~~ ` / / \ /
/ //-\ \ ~~~/ / / \ /\ ~~~~ . / / /
/ |_| \ ~~~~~~~/ / \ / \ /\ ~~~~ ' / /
\ /\ /\ ~~~~ / / \ / \? /\ ~~~~ , /
\ / \ /\ / \ /\ ~~~~~~~ / / \ / \ ~~~~~ . /\
/ \ / \ / \ / \ /\ ~~~~~~ / / \ ~~~~ / \
/ / \ / / \ / _\ , ~~~~ / / ~~ \ * ~~~~ .' / \ /
/ / \ / / / /^\\ ` ~~~~~~ / ~~ \ ~~~~ / /
/ \ / / \ .,` (~~~~~~~~~~~~~~~~ ~~~~ ~~~~ .`, / /
\ /\ / \ . ~~~~~~~~~~~~~~~ . /
\ / \ /\ /\ ~~)/\ , ' ,, (~~~~~ ` /\
/ \ / \ / \ /\ ~~ / \ /\ ,, / \
/ / \ / \ / \ /\ ~~~ / \ / \ /\ /\ ~~) '., / \ /
/ / \ / / \ / \~ / / \ / \ / \~~ /\ ` / /
/\ / \/ / / \ / / / \ / \ / \ /\ /\ / /
/ \ /\ / / \ / / \ / / \ / \ / \ /\ /
/ \ / \ /\ /\ / \ / \/ / / \ / \ / \ /\
/ \ / \ / \ /\ /\ / / \ / / \ / \
/ / \ / \ / \ /\ / \ /\ / \/ / /
/ / \ / / \ / \/ \ / \ /\ / / """,
# Autres mondes (Nidavellir = 6)
(93, 8, 3, 77, 62), # Midgard
(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), # Forge
(22, 42, 40, 12, 14),
(23, 51, 41, 10, 19),
# Mines
(27, 17, 6, 45, 24),
(45, 24, 6, 27, 17),
(23, 35, 6, 36, 62),
(36, 62, 6, 23, 35),
(51, 32, 6, 19, 49),
(19, 49, 6, 51, 32),
(72, 42, 6, 9, 49),
(9, 49, 6, 72, 42),
)
# * : (49, 21)
# * : (25, 31)
# * : (74, 46)
# * : (16, 55)
# * : (77, 61)
def nidavellir_po(coords):
if coords == (65, 7): return [0, "La mer etendait ses rouleaux sur le sable noir. Au sud s'etend le rocheux royaume de Nidavellir. Le monde des nains a pour seul maison les montagnes. D'ancienne legendes racontent que certaines communiquent entre elles par des passages oublies."]
elif coords == (66, 58): return [0, "Coupee en deux par le fleuve, la chaine de montagne semble s'etendre a l'infini. De toute part le meme paysage rocailleux. Le terrain est si inhospitalier que les nains eux-meme restent dans leurs mines."]
def nidavellir_npc(data, stat):
coords = data[2], data[3]
if coords == (25, 31):
return {
"base": [0, "Skirnir, messager de Freyr..."],
68: [0, "Skirnir, messager de Freyr...\n1. J'ai un message pour vous", 1],
69: [1, "[VOUS TENDEZ LE PARCHEMIN MODIFIE A SKIRNIR] Je vais de ce pas transmettre ce message aux Ases. Nous allons attirer les Ases dans un piege dans une tour de guet de Svartalfheim. Il ne doit pas y avoir beaucoup de soldats Ases present. Tu rendras directement compte a Freyja. Avant que tu ne partes, achetes-toi un equimement digne de ce nom. [+30 PO]", 0, (1, 30)],
}
h_37 = (r"""
|============|===|===========|
| * | | * |
| +---+ |
| | | |
| | | | | |
| +---+ * | |===========|
| | | |
|============| | +---+ |
| | | | | * |
| __ | | | | |
| *| | +---+ |
| | | |
| |__| | | |
| | | |
|=============|^|============|""",
(15, 14, 6, 69, 26)) # * : (2, 1) * : (26, 1) * : (10, 5) * : (27, 8) * : (3, 10)
def h_37_npc(data, stat):
coords = data[2], data[3]
if coords == (2, 1):
if not (340 <= stat[4] <= 1380): return [0, "Nous sommes ouverts de 5 heures a 23."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Bonjour, Muin pour vous servir.\n1. Bonjour je voudrais manger. [-5 PO]\n2. Vous reste-t-il des chambres ? [-15 PO]\n3. A boire ! [-3 PO]", 3]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Hey la ! Reviens quand tu pourras me payer."]
return [-1, "Pas de probleme ! [MUIN REVINT QUELQUES MINUTES PLUS TARD, ET POSA UNE ASSIETTE FUMANTE DEVANT VOUS.]", 0, (0, 5), (1, -5)]
elif data[0] == stat[9] + 2:
stat[9] = -1
if 360 < stat[4] < 1140: return [-2, "Une chambre !? Il n'est que {} heures. Reviens dans la soiree.".format(stat[4] // 60)]
elif stat[1] < 15: return [-2, "Desole, je n'ai plus une seule chambre de libre."]
else:
stat[4] = 360
return [-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)]
elif data[0] == stat[9] + 3:
stat[9] = -1
if stat[1] < 3: return [-3, "Allez donc voir un autre etablissement, nous ne servons pas gratuitement."]
return [-3, "[MUIN POSA UNE CHOPPE DE BIERE MOUSSEUSE DEVANT VOUS.]", 0, (0, 3), (1, -3)]
return [0, "Hmm ?"]
h_38 = (r"""
|=========|
| [=====] |
| |
| *+---+ |
| | | |
|=========| +---+ |========|
| [====] [====] |
| _ * |
| (_) |
| |_| |
|=========| |========|
| |
| |
| |
|===|^|===| """,
(15, 14, 6, 7, 31)) # * : (12, 3) * : (19, 7)
def h_38_npc(data, stat):
pass
h_39 = (r"""
|===================|---|====|
| /_____\ |
| +---+* |=====| |
| | | |
| | |* |
| +---+ +------+ |
| | | |
| +------+ |
| |
| |
| _ _ |
| (O) (O) |
| |_| |_| |
| |
|=|/\|=|/\|==|^|===|/\|=|/\|=|""",
(14, 14, 6, 35, 38)) # * : (9, 2) * : (9, 4)
def h_39_npc(data, stat):
coords = data[2], data[3]
if not (480 <= stat[4] <= 1140): return [0, "La forge de Nivallir est ouverte de 8 heures a 18 heures."]
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."]
elif stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Bienvenue a la forge de Nidavellir ! Vous desirez une piece particulière ?\n1. Un marteau [-20 PO]\n2. Une masse [-30 PO]\n3. Un fleau [-40 PO]\n4. Une hache [-50 PO]", 4]
else:
weapons = ("UN MARTEAU", "UNE MASSE", "UN FLEAU", "UNE HACHE")
for i in range(1, 5):
if data[0] == stat[9] + i:
stat[9] = -1
if stat[1] < (i+1) * 10: return [-i, "Vous n'avez pas assez."]
stat[3][0] = i + 1
return [-i, "Tres bon choix ! [LE NAIN DECROCHA {} DU RATELIER ET VOUS TENDIT L'ARME.]".format(weapons[i - 1]), 0, (1, -(i+1) * 10)]
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] == stat[9]:
stat[9] = data[0]
return [0, "Bienvenue dans notre forge. Vous souhaitez me vendre votre arme ?\n1. Oui\n2. Non", 2]
elif data[0] == 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] == stat[9] + 2:
stat[9] = -1
return [-2, "A votre guise, revenez quand vous voulez !"]
h_40 = (r"""
|=======|-|==================|
|=======|-|==================|
| /___\ |
| |===| +------+ |
| | | |
| * | | |
| | | |
| +------+ |
| |
| |
| |
| |
| |
|=========| |==============|
|==========|^|===============|""",
(12, 14, 6, 22, 22)) # * : (14, 5)
def h_40_npc(data, stat):
pass
h_41 = (r"""
|==|==|==||==|==|==|
| |
| ### * ### |
| ##### #####|
| ### ### |
| /|\ /|\ |
|==| |============|
| _ [I] [I] |
| (_) /*\ /|\ |
| |_| |
| __ |
| _ | | |
| (_) |__| |
| |_| | | |
| |__| |
| _ |
| (_) [I] |
| |_| /|\ |
| |
|========|^|=======|""",
(10, 19, 6, 23, 51)) # * : (12, 2) * : (10, 8)
def h_41_npc(data, stat):
pass