Finishing demo version

This commit is contained in:
Shadow15510 2021-11-21 15:51:50 +01:00
parent 8c39768cc1
commit fef0a86199
24 changed files with 3889 additions and 164 deletions

208
demo/alfheim.py Normal file
View File

@ -0,0 +1,208 @@
alfheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~ ~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~ * ~~~~~~ ## ~~~~~~~~~~~~ ~~~~~~~~ ~~~~~~~~~~~~~~~
~~~~~ ~~~~~~~ #### ~~~~~~~ ## ~~~~~~~~
~~~ ~~~~~ || ~~~~~~~ * #### __ ## ~~~~~~~
~~~ ~~~~~~~~ ## ~~~~~ ## || /[]\ #### ~~~~~
~~~ ~~~~~~~~~~~~ #### ## ## #### ` ' |__| || __ ~~~
~~~ ~~~~~~~~~~~~ ## || #### #### || ,' '.' / \ ~~~
~~~ ~~~~~ ~~~~ #### || || ` ' __ '`' . ` |__| ~~
~~~ ## ~~~ || '' /[]\ ' . ## ~~
~~ #### ## _ _________________ |__| ## `.` #### ~~
~~ || #### / \ / |]O[| |]O[| \ #### __ || ~~
~~~~ || |_| /___________________\ ## ## || /[]\ ~~
~~~~ ## _ |_/ \_/ _ \_/ \_| ## ## |__| ## ~~~~
~~~~ #### / \ |_| |_|/^\|_| |_| __ #### ~~~~
~~~~ || _ |_| * ## ## / \ `' || ~~~~
~~~~ /-\ ### ### ## ## |__| . , ~~~~
~~~~~~~~~ |_| _ ##### ##### `' `_ ,, , ~~~
~~~~~~~~~ /o\ ### ? ### ' _ ``' / \ ~~~
~~~~~~~~~~~ |_| /-\ /-\ , / \ |_| ~~~~ ~~~
~~~~~~~~~~~~ ### ### ' ,|_| .' _ ~~~~~ ~~~
~~~~~~ ~~~~~~~ ### ##### ` ##### . ` .,. /-\ ~~~~~ ~~~
~~~~~ ~~~~~~~ ##### ### ' ### _ ` , _ |_| _ ~~~~~~ ~~~
~~~~~ __ ~~ ### /-\ /-\ ` / \ , /o\ / \ ~~~~~~~~~~
~~~~~~ / \ /-\ ' . '``,'' |_|` |_| |_| ~~~~~~~~~~
~~~~~~ |__| ,. ' .` ', ~~~~~~~~~~
~~~~~~ __ ### ., _ . , _ ,. ~~~~~~~~~~
~~~~~~~~ / \ ##### ### / \ ` ' /o\__ `. ~~~~~~~~~
~~~~~~~~~ |__| ### ##### ### |_| . |_ o \==| .'`. ~~~~~~~
~~~~~~~~~~~~ ### /-\ ### ##### ,.` ||^|__| | . . ~~~~~~~
~~~~~~~~~~~~ ##### /-\ ### | .' ~~~~~~
~~~~~~~~~~~~~ ##### ### /-\ ### ### | ,`','` '',, ~~~~~~
~~~~~~~~~~~ ### ##### ### ##### ##### |==|==|==| ~~~~~
~~~~~~~~~~ ### |_| ##### ##### ### ### _ ~~~~~
~~~~~~~~~ ##### ### ##### /-\ /-\ ### _ / \ _ ~~~~
~~~~~~~~~ ##### |_| ### ### ##### /-\ |_| / \ ~~~~
~~~~~~~~~ ### |_| ##### ### ### |_| |_| ~~~~
~~~~~~~ |_| ~~~~~~~ ##### ##### /-\ _ ~~~~
~~~~~~~ ~~~~~~~~~~~~~~~~~~ ### ##### / \ _ ~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ |_| ### |_| / \ _ ~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ |_| |_| / \ ~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ |_| ~~~~
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~~~~~~
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ #### #### ~~~~~~~~~~~~
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ### ### ~~~~~~~~~~~~
~~~~~~~~~~ __ ~~~~~~~~~~~~~~~~~~~~ __ ### ## ## ~~~~~~~~~~~~
~~~~~~~~~~ / \ ~~~~~~~~~~~~~~~~~~~~ / \ ##### ~~~~~~ ~~~~
~~~~~~~~~~ |__| ~~~~~~~~~~~~~ |__| ##### ## ## ~~~~~ ~~~~
~~~~~~~~~~ ### ~~~~~~~~ ### ### ### ~~ ~~~~
~~~~~~~~~ ##### ,'' |_| #### #### ~~~
~~~~~~~~ ##### ' * ### ,,,. ### ~~~
~~~~~~~~ ### ### ##### `,, ##### ~~~
~~~~~~~ |_| . ##### ##### ',, __ ### ##### ~~~
~~~~~~ ### ,##### ### ` / \ ### ##### ### ~~~
~~~~~~ ##### ### , ### |_|`' ### |__| ##### ##### |_| ~~~
~~~~~~ ##### #####``|_| ### ` ##### ##### ### ~~~
~~~~~~ ### ##### ' ##### ##### ### |_| ### ~~~
~~~~~~ |_| ### ,' ##### ### |_| ##### ~~~
~~~~~~ ## |_| ` ### |_| ~~ ##### ~~~
~~~~~ ## #### ` |_| ~~~~ ~~~~ ### ~~~
~~~~ #### || . ~~~~~~~ ~~~~~~ ~~~~~~~~ |_| ~~~
~~~~~ ## || ,` ' ~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~ ~~~
~~~~ #### _ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~ ~~~
~~~~~ || /-\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~
~~~~~~ ~ |_| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~
~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
# Autres mondes (Alfheim = 2)
(14, 68, 1, 28, 13), # Vanaheim
# Maisons
(34, 16, 23, 25, 19),
(52, 31, 24, 20, 19), # Librairie
)
# * : (11; 4)
# * : (46; 6)
# * : (23; 17)
# * : (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 votre vue. 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
h_23 = (r"""
|==================|
| |
| _ _ |
| / \ / \ |
| \_/ \_/ |
| |_| * |_| |
| |
| _ _ |
| / \ / \ |
| \_/ \_/ |
|===========| |_| |_| |===========|
| |
| |
| _ _ |
|__ __ / \ / \ __ __|
/ \ / \ \_/ \_/ / \ / \
\__/ \__/ |_| |_| \__/ \__/
| | | | | | | |
| | | | | | | |
/ \______/ \_______|^|______/ \______/ \ """,
(25, 19, 2, 34, 16)) # * : (23, 5)
def h_23_npc(data, stat):
pass
h_24 = (r"""
|====|_|======| |=====|_|====|
| /___\ | | /___\ |
| |===| |===========| |===| |
| * | | |
| +---+ | _ _ | +---+ |
| | | | (~) (~) | | | |
| | | | |_| |_| | | | |
| | | | | |
| +---+ +---+ |
| | _ _ | |
|=============| (~) (~) |============|
| | |_| |_| | |
| * |
| |
| | _ _ | |
|=============| (~) (~) |============|
|=============| |_| |_| |============|
| |
|====| |====|
|====|^|====| """,
(20, 19, 2, 52, 31)) # * : (12, 3) * : (36, 12)
def h_24_npc(data, stat):
coords = data[2], data[3]
xp = data[0]
spells = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
levels = ("I", "II", "III", "IV", "V")
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] == stat[9]:
stat[9] = data[0]
return [0, "Quel sort souhaitez-vous oublier ?\n" + "\n".join(["{0}. {1} {2}".format(nb + 1, spells[nb], levels[lvl - 1]) for nb, (name, lvl) in enumerate(stat[7])]), len(stat[7])]
else:
for i in range(1, len(stat[7]) + 1):
if data[0] == stat[9] + i:
stat[9] = -1
stat[7].pop(i - 1)
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 !"]
if coords == (36, 12):
spells_sale = ((0, 2), (1, 2), (2, 4), (4, 1))
if len(stat[7]) >= 3: return [0, "Je suis desolé, vous ne pouvez pas apprendre plus de trois sorts."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Diomwar, pour vous servir. Quel sort voulez-vous acheter ?\n1. Soin II\n2. Flammes II\n3. Givre IV\n4. Fatigue I", 4]
else:
for i in range(1, 5):
if data[0] == stat[9] + i:
stat[9] = -1
if stat[1] < spells_sale[i - 1][1] * 10: return [-i, "Vous n'avez pas les moyens, desole."]
spell_id = -1
for sp_id, sp in enumerate(stat[7]):
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, "[DIOMWAR OUVRIT UN LIVRE RELIE DE CUIR NOIR, L'OUVRIT ET TRACA DU DOIGT DES SIGNES CABALISTIQUES SUR LE SOL. LES RUNES BRILLERENT PUISSAMMENT AVANT DE S'ETEINDRE.]", 0, (1, -spells_sale[i - 1][1] * 10)]

277
demo/asci_lib.py Normal file
View File

@ -0,0 +1,277 @@
# Asci (version 1.5.3)
class Screen:
def __init__(self, screen_width=21, screen_height=6):
# Screen configuration
self.screen_width = screen_width
self.screen_height = screen_height
self._data = [[" " for _ in range(screen_width)] for _ in range(screen_height)]
def clear(self):
print("\n" * self.screen_height)
def set_world(self, world):
self._world = [[char for char in line] for line in world.split("\n")[1:]]
self.map_width = max([len(line) for line in self._world])
self.map_height = len(self._world)
def set_data(self, coords):
x, y = coords
for x_map in range(x, x + self.screen_width):
for y_map in range(y, y + self.screen_height):
self._data[y_map - y][x_map - x] = " "
if 0 <= x_map < self.map_width and 0 <= y_map < self.map_height:
try: self._data[y_map - y][x_map - x] = self._world[y_map][x_map]
except: pass
def set_cell(self, x, y, value):
self._data[y][x] = value
def display(self, return_input=True):
for line in self._data:
print("".join(line))
if return_input: return input(">")
def display_text(self, string):
paragraphs = [i for i in text_formater(string) if i]
nb_par = len(paragraphs)
for index in range(nb_par):
self.clear()
print(paragraphs[index])
if index + 1 == nb_par: return input(">")
else: input()
def get_cell(self, x, y):
return self._data[y][x]
def get_map_size(self):
return self.map_width, self.map_height
class Asci:
def __init__(self, maps, events_mapping, keys_mapping, screen_width=21, screen_height=6):
# Load maps
self.maps = [Map(*i) for i in maps]
# Custom functions
self.legend = list(events_mapping.keys())
self._game_events_mapping = [events_mapping[i] for i in self.legend]
self._game_keys_mapping = {key: keys_mapping[key] for key in keys_mapping if not key in (1, 2, 3, 5)}
# Screen initialisation
self.screen = Screen(screen_width, screen_height)
def _looked_case(self, direction):
# Left
if direction == 1:
return self.data[2] + 9, self.data[3] + 3
# Right
elif direction == 3:
return self.data[2] + 11, self.data[3] + 3
# Up
elif direction == 5:
return self.data[2] + 10, self.data[3] + 2
# Down
elif direction == 2:
return self.data[2] + 10, self.data[3] + 4
return self.data[2] + 10, self.data[3] + 3
def _cell_test(self, direction):
if direction == 1:
if self.data[-2] + 9 < 0: return -1
else: cell = self.screen.get_cell(9, 3)
if direction == 3:
if self.data[-2] + 11 >= self.map_width: return -1
else: cell = self.screen.get_cell(11, 3)
if direction == 5:
if self.data[-1] + 2 < 0: return -1
else: cell = self.screen.get_cell(10, 2)
if direction == 2:
if self.data[-1] + 4 >= self.map_height: return -1
else: cell = self.screen.get_cell(10, 4)
cell_patterns = self.legend
for pattern_index in range(len(cell_patterns)):
if cell in cell_patterns[pattern_index]: return pattern_index
return -1
def _keyboard(self, key):
# Interaction while moving
if key in (1, 3, 5, 2):
cell_test = self._cell_test(key)
# Change map
if cell_test == len(self.legend) - 2: # or (self.data[1] and cell_test < 0):
self.data[1], self.data[2], self.data[3] = self._get_map(key)
self.screen.set_world(self.maps[self.data[1]].map_data)
self.map_width, self.map_height = self.screen.get_map_size()
# Move
elif cell_test == len(self.legend) - 1:
if key == 1: self.data[2] -= 1
if key == 3: self.data[2] += 1
if key == 5: self.data[3] -= 1
if key == 2: self.data[3] += 1
# Interaction
elif cell_test >= 0: self._interaction(key, cell_test)
# Custom functions
elif key in self._game_keys_mapping:
self.screen.clear()
self._game_keys_mapping[key](self.data, self.stat)
# Quit
elif key == 9:
self.screen.clear()
def _interaction(self, direction, cell_content):
x, y = self._looked_case(direction)
data_copy = [self.data[0], self.data[1], x, y]
# Get the event
event = self._game_events_mapping[cell_content](data_copy, self.stat)
# data modification
self.data[0] = data_copy[0]
if self.data[1] != data_copy[1]:
self.data[1] = data_copy[1]
self.screen.set_world(self.maps[self.data[1]].map_data)
self.map_width, self.map_height = self.screen.get_map_size()
if data_copy[2] != x: self.data[2] = data_copy[2] - 10
if data_copy[3] != y: self.data[3] = data_copy[3] - 3
if not event: return
event = read_event(self.data[0], event)
# XP and stat modification
self.data[0] += event.xp_earned
for index, value in event.stat:
self.stat[index] += value
# Display and get answer
if event.text:
answer_selected = convert(self.screen.display_text(event.text), True)
if event.answer and (0 < answer_selected <= event.answer):
self.data[0] += answer_selected
self._interaction(direction, cell_content)
def _get_map(self, direction):
current_coords = self._looked_case(direction)
current_map = self.data[1]
for coords in self.maps[current_map].coords:
if coords[:2] == current_coords:
return coords[2], coords[3] - 10, coords[4] - 3
return current_map, self.data[2], self.data[3]
def mainloop(self, end_game, stat=None, data=None, routine=None, player="@", door="^", walkable=" ", exit_key=9):
if exit_key in self._game_keys_mapping:
raise ValueError("'{}' is already assigned to a function.".format(exit_key))
# Load save ; data = [XP, map_id, x, y]
if not stat or type(stat) != list: self.stat = [100]
else: self.stat = stat
if not data: self.data = [0, 0, 0, 0]
else: self.data = [data[0], data[1], data[2] - 10, data[3] - 3]
self.legend.append(door)
self.legend.append(walkable)
# Screen and map configuration
self.screen.set_world(self.maps[data[1]].map_data)
self.map_width, self.map_height = self.screen.get_map_size()
key = key_buffer = 0
while key != exit_key and self.stat[0] > 0 and self.data[0] < end_game:
self.screen.set_data(self.data[-2:])
self.screen.set_cell(10, 3, player)
key = convert(self.screen.display())
if not key: key = key_buffer
else: key_buffer = key
self._keyboard(key)
# Launching the game routine
if routine: routine(self.data, self.stat)
if self.stat[0] <= 0: self.stat[0] = 100
self.data[2] += 10
self.data[3] += 3
return self.stat, self.data
class Event:
def __init__(self, xp_earned, text, answer=0, *stat):
self.xp_earned = xp_earned
self.text = text
self.answer = answer
self.stat = stat
class Map:
def __init__(self, map_data, *coords):
self.map_data = map_data
self.coords = coords
def convert(string, force_int=False):
try: return int(string)
except:
if force_int: return 0
else: return string
def text_formater(string, screen_width=21, screen_height=6):
def line_formater(string, screen_width):
if len(string) <= screen_width: return string
stop_index = screen_width
while stop_index > 0 and not string[stop_index].isspace(): stop_index -= 1
if not stop_index: stop_index = screen_width
return string[:stop_index] + "\n" + line_formater(string[stop_index + 1:], screen_width)
def paragraph_formater(lines, screen_height):
if len(lines) < screen_height: return "\n".join(lines)
return "\n".join(lines[:screen_height]) + "\n\n" + paragraph_formater(lines[screen_height:], screen_height)
lines = []
for line in string.split("\n"):
for formated_line in line_formater(line, screen_width).split("\n"):
lines.append(formated_line)
return paragraph_formater(lines, screen_height).split("\n\n")
def read_event(xp, event):
if type(event) == dict:
if xp in event: event = event[xp]
else: event = event["base"]
if type(event) != list:
raise TypeError("event is of type {} instead of list".format(type(event)))
return Event(*event)
def print_text(text):
for i in text_formater(text):
if not i: continue
print("\n" * 7)
print(i)
input()

505
demo/asgard.py Normal file
View File

@ -0,0 +1,505 @@
asgard = (r"""
/\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\ /\
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
/\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \ /\ / \
\ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ /
\ /\ / \ /\ / \ /\ / \ / \ / \ / \ /\ / \ /\ / \ /\ / \ /\ / \ / \ / \ / \ / \ /\ /
/ \ / \ / \ / \ / \ / \ / \ \ / \ / \ / \ / / \
/\ / \ /\ / \ /\ / \ /\ /\ / \ /\ / \ /\ / \ /\ / \ \/ \/ \/ \/ /\ / \
\ / \ / \ * / \ / \ _ / \ / \ / \ / \ /
\ / \ / \ / \ /\ / \ /\ /o\ / \ / \ / \ / \ /\ /
\ / /\ \ / \ _______ / ~\ / \ |_| \ / \ / \ ___________________________ / / \
/ \ /\ /Glitnir\ /\ / ~~\ /\ / \ /\ /\ \/ \ /___________________________\ \
/ \ / \ |__|^|__| / \ ~~ / \ / \ / \ /\ /\ | Valaskjalf | /\ \
/\ / \ /\ /\ / \ /\~/ \ /\ / \ /\ / \ / \ / \ /_______________________________\ / \
/ \ / \ * / \ / \~ / \ / \ \ / \ /\ / \ |_/ \_/ \_/ _ \_/ \_/ \_| /\ / \ /\
/\ /\ / \ /\ / \ / \ / \~ / \ / \ \ / / \ /\ \ |_| |_| |_|/^\|_| |_| |_| / \ /
/ \ / \ / \ / ~ \ / \ / \ / \ | | / \ /\ /
/ \/ \ /\ / \ ### _ ~ _________ / /\ / \ /\ -|--|--|--|-/ | /\ / / \
/ \ ##### ## /o\ ~ /Gladsheim\ / \ / \ / / / \ / \
/\ / \ ### #### |_| ~~ ## |<o> _ <o>| ## / \ /\ / \ | |--|--|--|--|- /\ / \ /\ / /\\
/ \~ /-\ ## ###### ------- #### |___|^|___| #### / / \ \ \ / \ / \ / \
/\ / \~ * #### ###### ###### ###### / \ /\ -|--|--|--|--| | / \ /\ / \ / \
/ \ ~~ ###### #### ###### ###### / /\ / \ / / * / \ \/ \
/ \ /\ ~~ ### ###### || -------- #### #### /\ / \ \ | |--|--|--|--|- /\ / \ /\
\ / \ ~~ ##### #### ## ~~~ || __ || / \ \ \ \ /\ / \ /\ \/ \
\ /\ / \ ~~ ### || #### ~~~~ / \ ## / \ /\ -|--|--|--|--| | / \ /\ / \ \ /\
/ \ ~~ /-\ ###### ~~~ |__| _ #### /\ / \ / / \ \ \ / \
/ \ ~~ * ### ###### ~~~~ / \ ###### /\ / \ \ /\ /\ ? / \ /\ / \
## ## ~~ ##### #### ### ~~~~~~ |_| ###### _ / \ \ /\ / \ / \ /\ /\ / \ / \
### #### ~~ ________ ### || ##### ~~~~~~ #### /o\ / \ / \ / / \ / \ /\ / \ /\ /
#### ###### ~~ / Ydalir \ /-\ ### ~~~~~ || |_| / \ / \ / / \ /\/ \/ \ /
#### ###### ~~~ /__________\ ### /-\ ~~~~~ / / \ / \ /
### #### ~~ |_//^^\\_| ##### ~~~ ### _________ / \ /\ / \/
|| ## || ~~ |_| |_| _ ### ### ~~~~~ | | ##### /Folkvangr\ * / \ ~/\
#### ~~~ |_| |_| /o\ /-\ ##### ~~~~~| | ### |[O] _ [O]| _ / \ ~~/ \
###### _ ~~~ |_| ### ______ ~~| | /-\ |___|^|___| /o\ ~~~~~/
###### /o\ ~~~ * /-\ /Noatun\ | |~~ ### |_| _ ~~/\ /
#### |_| ~~~~~~~~~~~~~~~~~ |_/^^\_| ### | |~~~~~~ ##### ##### /o\ ~~/ \
|| ~~~~~~~~~~~~~~~~~~~~~~ | | ##### | ~~~~~ ### ### ######### |_| ~~/ \ /\
## ___________ ~~~~~~~~| | * ### * ~~~~~ /-\ ##### _ #Landivi# ~/ \ /
#### /Breidablik \ * ~| |~~~~ /-\ ~~~~~~ ### /o\ ######### ~~~ /
##### |o|o|o|o|o|o| ### | | ~~~~~~~~~~~~~ ~~~~~~ /-\ |_| ##### ~~~~ /\ /
##### /_____________\ ##### ### ### ~~~~~~~~~~~~ ~~~~~~~~ |^| _ ~~~~~ / \ /\
#### |_/ \_/ \_| ### ##### ##### ### ~~~~~~~~~~~~~~~~ ~~~~~~~~~ /o\ ~~~~ / \ / \
|| |_| |^| |_| /-\ ### ### ### ##### ~~~~~~~~~~~~~~| |~~~~~~~~~~~~~~~ |_| ~~~~ / \ / \
## * /-\ /-\ ##### ### ~~~~~~~| |~~~~~~~~~~~~~~~~~~ ~~~~ / /
#### ### ### /-\ ~~~~~~~~~~~~~ ~~~~~ /\ /
###### ##### ### ### ### /-\ ### ___________ ~~~~~~~~~~ ~~~~~~ / \ /
###### ### ##### ##### ##### ~~~ ##### /Thrymrheimr\ ~~~~~~~~~~~~~~~~~~ /\ / \ /
#### _ ### /-\ ### ### ### ~(~)~ ### /_____________\ _ ~~~~~~~~~~~~~~ ### / \ \
|| /o\ ##### /-\ /-\ /-\ /~(___)~\ /-\ |_/ \_/ \_| ### ### /o\ ~~~~~~~~~~~ ##### / \ /\
## |_| ### \~~~~~~~/ * |_| |^| |_| ##### ##### |_| ~~~~~~~~~~ ### / \ / \
~ #### /-\ * ### ### ### ~~~~~~~~~~ /|\ ### / \
~###### ____________ #### #### ### /-\ /|\ ### ##### ~~~~~~~~~~ ### ##### /\ \
~###### / Himinbjorg \ #### #### ##### ### ### ##### ### ~~~~~~~~ ##### ### / \
~ #### /______________\ ### ### ### ##### ##### ### ### /|\ ~~~~~~~~~ _ ### /|\ / \ /
~ || ### | ]O[ __ ]O[ | ? /-\ ### ### _ ##### _ /|\ ~~~~~~~~~ /o\ /|\ / \ /
~ _ ##### |_____|^^|_____| ### ### ### /-\ /-\ ### /o\ ### /o\ ------------- |_| ### /
~ /o\ ### ##### #### #### ##### |_| /|\ |_| ### ##### ###/
~ |_| /-\ ### #### #### ### ### ##### ### #####
~ * /-\ ##### ### /-\ ### ### ------------- /|\ ###
~~ ### ### _ ### ### ##### ##### /|\ ~~~~~~~ ### /|\ ###
~~ ##### ##### ### ### ### /o\ /-\ ##### ### ### ### ~~~~~~~ ### ##### ####
~~ ### ### ##### ##### ##### |_| ### ### /-\ ##### ### /|\ ### ~~~~~~ ### ##### ### ###
~~ /-\ /-\ ### ### ### ___________ /-\ ##### ### ##### * ##### ~~~~~ ##### ### /|\ /|\
~~ |_| |_| |_| /Sokkvabekkr\ ### /|\ ### ### ~~~~~~ ### /|\ ###
~~ * /_____________\ /-\ ### /|\ /|\ ~~~~~~~ /|\ ### #####
~~ ________ ### ### ### _ /_|_/__\_/__\_|_\ ##### ### ### ~~~~~~~~ ##### ###
~~ /Alfheimr\ ##### ##### ##### /o\ |_| |^| |_| _ ### ##### ### ##### ~~~~~~~~ ### /|\
~~~ |]O[__]O[| ### ### ### |_| /o\ /-\ ### ##### ### ~~~~~~~~~ _ /|\ ###
~~~ |__|^^|__| |_| |_| |_| ##### ##### |_| /-\ ### /|\ ~~~~~~~~~~ _ /o\ #####
~~~ ##### ##### /|\ ~~~~~~~~~~ /-\ |_| ### ~
~~~ * ~~~~~~~~~~~~ |_| * /|\ ~~
~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
# Autres mondes (Asgard = 0)
(126, 71, 3, 72, 6), # Midgard
# Maisons
( 30, 11, 9, 15, 13), # Glitnir
(116, 14, 10, 29, 23), # Valaskjalf
( 70, 19, 11, 24, 19), # Gladsheim
( 25, 31, 12, 24, 19), # Ydalir (1/2)
( 26, 31, 12, 25, 19), # Ydalir (2/2)
(110, 34, 13, 20, 14), # Folkvangr
( 63, 36, 14, 14, 14), # Noatun (1/2)
( 64, 36, 14, 15, 14), # Noatun (2/2)
(120, 41, 15, 14, 14), # Landivi
( 13, 43, 16, 29, 29), # Breidablik
( 75, 50, 17, 24, 24), # Thrymrheimr
( 27, 56, 18, 24, 24), # Himinbjorg (1/2)
( 28, 56, 18, 25, 24), # Himinbjorg (2/2)
( 57, 67, 19, 25, 14), # Sokkvabekkr
( 10, 69, 20, 34, 24), # Alfheimr (1/2)
( 11, 69, 20, 35, 24), # Alfheimr (2/2)
)
def asgard_npc(data, stat):
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
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."]
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 ?"]
}
h_10 = (r"""
|====================================================|
| |
| |
| |
| |================\ /=================| |
| | | |
| | | |
| \ __ / |
| |<>| |
| |__| |
| /____\ \ |
| / * | |
| | | |
| | | |
| |================/ \=================| |
| |
| |
| |
|_______________________ _______________________|
|__/ \__/ \__/ \__/ \__/ \__|
|__| |__| |__| |__| |__| |__|
|__| |__| |__| |__| |__| |__|
|__| |__| |__| |__| |__| |__|
/__\ /__\ /__\__^^__/__\ /__\ /__\ """,
(29, 23, 0, 116, 14),
(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."],
h_11 = (r"""
|============================|
| _ |
| |o| |
| /___\ |
| (___ ___) |
| (____ ____) |
|=========| (_____ _____) |========|
| * |
| |
| __ ### __ |
| |__| +-#####-+ |__| |
| |__| | ### | |__| |
| |__| | /|\ | |__| |
| |__| +-------+ |__| |
| |__| |__| |
| |
| |
|======================| |======================|
|=+<>+=+<>+=+<>+=+<>+==| |==+<>+=+<>+=+<>+=+<>+=|
|^| """,
(24, 19, 0, 70, 19)) # * : (34, 7)
def h_11_npc(data, stat):
pass
h_12 = (r"""
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| __ |
| |()| |
| |__| |
| * |====| |
| |
| ~~~~ |
|=-=-=-=-=| ~~\/~~ |=-=-=-=-=|
| [=====] /~~~||~~~\ [=====] |
| [=====] [==========] [=====] |
| _ _ |
| (_) (_) |
| _ /_\ /_\ _ |
| (_) (_) |
| /_\ ______ ______ /_\ |
| \- - / \ - -/ |
|-=-=-=-=-=-| - -| |- - |-=-=-=-=-=-|
|=-=-=-=-=-=|- - | | - -|=-=-=-=-=-=|
| - -| |- - |
/- - \_____|^^|_____/ - -\ """,
(24, 19, 0, 25, 31),
(25, 19, 0, 26, 31)) # * : (19, 4)
def h_12_npc(data, stat):
pass
h_13 = (r"""
||
|===================================||==|
|================|===o===o===o=====/ \=|
|[==-==/ \==-==]| |__| |
|[-===/ \==--]| _ |
|[=-=/ \-==]| |o| __ |
|[==/ \==]| (___) | | |
| | |__| |
|======/ \======| * | | |
| |__| |
| | | |
| |__| |
| |
|==================| |==================|
|^| """,
(20, 14, 0, 110, 34)) # * : (21, 8)
def h_13_npc(data, stat):
pass
h_14 = (r"""
|=|\/|==|\/|=|\/|=|\/|==|\/|=|
| |
| * |
| |
| |================| |
| | __ __ | |
| | | | | | | |
| | |__| |__| | |
| | | |
| |======\ /======| |
|### ###|
|### ###|
||_| |_||
|=|\/|==|\/|=| |=|\/|==|\/|=|
|^^| """,
(14, 14, 0, 63, 36),
(15, 14, 0, 64, 36)) # * : (26, 2)
def h_14_npc(data, stat):
pass
h_15 = (r"""
#########
## [=====] ##
# [=====] #
# #
#_ _#
#(_) [] (_)#
#|~| * |__| |~|#
# #
# _ _ #
# (_) (_) #
#|~| |~|#
## ##
#### ####
| |
|^| """,
(14, 14, 0, 120, 41)) # * : (10, 6)
def h_15_npc(data, stat):
pass
h_16 = (r"""
|======================================|
| |
| |
| ### ~~~~ ### |
| ##### ~(~~)~ ##### |
| ##### /~~~(____)~~~\ ##### |
| ### \~~~~~~~~~~~~/ ### |
| |=| |============| |=| |
| |
|========\ /========|
|==================| |==================|
| [=====][=====] | | [=====][=====] |
| [=====][=====] _ _ [=====][=====] |
| (_) (_) |
| |=| |=| * |
| ___ ___ ___ ___ |
| | | | | | | | | |
| |___| |___| _ _ |___| |___| |
| | | | | (_) (_) | | | | |
| |___| |___| |=| |=| |___| |___| |
| | | | | | | | | |
| |___| |___| |___| |___| |
| | | | | _ _ | | | | |
| |___| |___| (_) (_) |___| |___| |
| |=| |=| |
| |
| |======| |=======| |
|===================| _ | | _ |===================|
(_) | | (_)
|=| |/^\| |=| """,
(29, 29, 0, 13, 43)) # * : (50, 14)
def h_16_npc(data, stat):
pass
h_17 = (r"""
### |============================| ###
##### | | #####
### | | ###
|_| | ~~~~~~~~~~~~~~~~~~ | |_|
| ~~~~~~~~~~~~~~~~~~~~ |
### | ~~~~~~~~~~~~~~~~~~~~ | ###
##### | ~~~~~~~~~~~~~~~~~~~~ | #####
### | ~~~~~~~~~~~~~~~~~~ | ###
|_| | | |_|
| |
|===================/ \===================|
| |
| _ _ _ _ |
| (-) (-) (-) (-) |
| |_| |_| |_| * |_| |
| |
| |
| |
| |
| _ _ _ _ |
| (-) (-) (-) (-) |
| |_| |_| |_| |_| |
| |
|======================| |=======================|
|^| """,
(24, 24, 0, 75, 50)) # * : (36, 14)
def h_17_npc(data, stat):
pass
h_18 = (r"""
|================================================|
|================================================|
| |
| |
| __ __ |
| (~~) (~~) |
| |--| __ |--| |
| | | |<>| | | |
| | | |--| | | |
| |__| |____| * |__| |
| |
| |
| __ __ |
| (~~) ## (~~) |
| |--| #### |--| |
| | | #### | | |
| | | ## | | |
| |__| || |__| |
| |
| |
| |
|=====================\| |/=====================|
|=====================/| |\=====================|
\| |/
/|^^|\ """,
(24, 24, 0, 27, 56),
(25, 24, 0, 28, 56)) # * : (30, 9)
def h_18_npc(data, stat):
pass
h_19 = (r"""
|================================================|
| |
| ########## |
| ########## |
| ###### ###### |
| ###### __ |===[]===| __ ###### |
| (__) | |__| | (__) |
| |--| | *| |--| |
| |__| | | |__| |
| ###### |==/ \==| ###### |
| ###### ###### |
| |
| |
| |
|=======================|^|======================|""",
(25, 14, 0, 57, 67)) # * : (28, 7)
def h_19_npc(data, stat):
pass
h_20 = (r"""
|============================|
| |
| _ _ |
|===================| (-) (-) |
| | |_| __ |_| |
| | |[]| |
| ~~~ | | | |
| ~~~(~)~~~ | _ |____| _ |
| /~~(_____)~~\ | (-) (-) |
| \___________/ | |_| * |_| |
| |
| |
| |
| |
| |
| ~~~ | _ _ |
| ~~~(~)~~~ | (-) (-) |
| /~~(_____)~~\ | |_| |_| |
| \___________/ | |
| | |
| | _ _ |
|===================| (-) (-) |
| |_| |_| |
| |
|============|^^|============|""",
(34, 24, 0, 10, 69),
(35, 24, 0, 11, 69)) # * : (39, 9)
def h_20_npc(data, stat):
pass

446
demo/idk.py Normal file
View File

@ -0,0 +1,446 @@
from asci_lib import Asci, print_text
from random import randint
from math import floor, ceil
from asgard import *
from vanaheim import *
from alfheim import *
from midgard import *
from niflheim import *
from jotunheim import *
from nidavellir import *
from muspellheim import *
from svartalfheim import *
maps = (
asgard,
vanaheim,
alfheim,
midgard,
niflheim,
jotunheim,
nidavellir,
muspellheim,
svartalfheim,
h_9, h_10, h_11, h_12, h_13, h_14, h_15, h_16, h_17, h_18, h_19, h_20,
h_21, h_22,
h_23, h_24,
h_25, h_26, h_27, h_28,
h_29, h_30,
h_31, h_32, h_33, h_34, h_35, h_36,
h_37, h_38, h_39, h_40, h_41,
h_42, h_43, h_44,
h_45, h_46, h_47, h_48)
# Asci functions
def npc(data, stat):
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)
event = npc_data[data[1]](data, stat)
if not event:
return [0, "Hmm ?"]
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])]
print_text("Vous avez gagne le combat. [+{}PO]".format(event[2]))
data[0] += 1
choice = 0
while not choice:
print("<o> Amelioration <o>")
print(" |1. Vitesse |")
print(" |2. Agilite |")
print(" |3. Attaque |")
print(" |4. Defense |")
print("<o> ============= <o>")
choice = get_input()
if (choice < 0 or choice > 4) and stat[2][choice - 1] >= 50: choice = 0
print_text("Vous gagnez 2 points {}".format(("de vitesse", "d'agilite", "d'attaque", "de defense")[choice - 1]))
stat[2][choice - 1] += 2
if stat[2][choice -1] > 50: stat[2][choice - 1] = 50
return None
elif issue == 1: return [0, "Vous etes mort."]
elif issue == 2: return [0, "Vous avez fuit."]
else:
return event
def point_of_interest(data, stat):
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]
event = po_data[data[1]](coords)
if not event: return [0, "Il n'y a rien à voir ici."]
else: return event
def routine(data, stat):
stat[4] = (stat[4] + 1) % 1440
# Mana regeneration
if stat[2][4] < stat[0] // 2 and not (stat[4] % 60):
stat[2][4] += 1
# Game mecanics
def fight(stat, opponent_stat, opponent_name):
def player_turn():
end = False
msg = "Tour de {}".format(stat[5])
if choice == 1:
damage = stat_test(player_stat, 2)[1] - opponent_stat[3]
if damage < 0: damage = 0
if damage == 0:
msg += "\n{} bloque l'attaque.".format(opponent_name)
elif stat_test(opponent_stat[:-1], 1)[0]:
msg += "\n{} esquive le coup.".format(opponent_name)
else:
opponent_stat[4] -= damage
msg += "\n{0} perd {1} PV.".format(opponent_name, damage)
elif choice == 2:
if len(stat[7]) == 0:
msg += "\nVous ne connaissez pas de sort."
else:
spell_data = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
spell_level = ("I", "II", "III", "IV", "V")
spell_choice = 0
while not spell_choice:
print("\n" * 6 + "Sort(s) connu(s) :")
count = 0
for spell_id, level in stat[7]:
print("{0}. {1} {2}".format(count + 1, spell_data[spell_id], spell_level[level - 1]))
count += 1
spell_choice = get_input()
if spell_choice < 0 or spell_choice > 3: spell_choice = 0
spell_choice -= 1
name, level = spell_data[stat[7][spell_choice][0]], stat[7][spell_choice][1]
if stat[2][4] >= level * 10:
msg += "\nVous lancez {0} de niveau {1} [-{2} PM].".format(name, spell_level[level - 1], level * 10)
stat[2][4] -= level * 10
pts = 12 * level + randint(-5, 5)
if stat[7][spell_choice][0] == 0:
stat[0] += pts
msg += "\nVous gagnez {} PV".format(pts)
elif stat[7][spell_choice][0] == 1:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[7][spell_choice][0] == 2:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[7][spell_choice][0] == 3:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[7][spell_choice][0] == 4:
opponent_stat[0] -= pts
msg += "\n{0} perd {1} points de vitesse".format(opponent_name, 12 * level)
else:
msg += "\nVous ne parvenez pas a lancer le sort."
elif choice == 3:
if stat_test(player_stat, 1)[0]:
end = True
else:
msg += "\nVotre tentative de fuite echoue."
print_text(msg)
return end
def opponent_turn():
msg = "Tour de {}".format(opponent_name)
damage = stat_test(opponent_stat, 2)[1] - player_stat[3]
if damage < 0: damage = 0
if damage == 0:
msg += "\n{} bloque l'attaque.".format(stat[5])
elif stat_test(player_stat, 1)[0]:
msg += "\n{} esquive le coup.".format(stat[5])
else:
stat[0] -= damage
msg += "\n{0} perd {1} PV.".format(stat[5], damage)
print_text(msg)
# opponent_stat = [vitesse, agilité, attaque, défense, vie]
# 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
while not choice:
print("<o> Combat <o>")
print(" | 1. Attaquer |")
print(" | 2. Ensorceler |")
print(" | 3. Fuir |")
print(" | 4. Statistiques |")
print("<o> ============= <o>")
choice = get_input()
if choice < 0 or choice > 4: choice = 0
if choice == 4:
p_capacities = ["{} ".format(i) if i < 10 else str(i) for i in player_stat]
o_capacities = ["{} ".format(i) if i < 10 else str(i) for i in opponent_stat[:-1]]
p_health = str(stat[0]) + " " * (3 - len(str(stat[0])))
o_health = str(opponent_stat[4]) + " " * (3 - len(str(opponent_stat[4])))
print(" Joueur | Ennemi")
print("Vit: {0} | {1}".format(p_capacities[0], o_capacities[0]))
print("Agi: {0} | {1}".format(p_capacities[1], o_capacities[1]))
print("Att: {0} | {1}".format(p_capacities[2], o_capacities[2]))
print("Def: {0} | {1}".format(p_capacities[3], o_capacities[3]))
print("Vie: {0} | {1}".format(p_health, o_health))
input()
choice = 0
# Who start
while player == opponent:
player = stat_test(player_stat, 0)[1]
opponent = stat_test(opponent_stat[:-1], 0)[1]
# Fight
if player > opponent:
end = player_turn()
if end: return 2
if opponent_stat[4] <= 0: return 0
opponent_turn()
else:
opponent_turn()
if stat[0] <= 0: return 1
end = player_turn()
if opponent_stat[4] <= 0: return 0
if stat[0] <= 0: return 1
return 2
def misc_stat(data, stat):
if data[1] < 9: place = ("Asgard", "Vanaheim", "Alfheim", "Midgard", "Niflheim", "Jotunheim", "Nidavellir", "Muspellheim", "Svartalfheim")[data[1]]
else: place = "interieur"
money, ticks, player_class = stat[1], stat[4], stat[6]
hours = ticks // 60
if 4 <= hours <= 5:
hours = " |aube - {}h".format(hours)
elif 6 <= hours <= 12:
hours = " |matin - {}h".format(hours)
elif 13 <= hours <= 18:
hours = " |apres-midi - {}h".format(hours)
elif 19 <= hours <= 20:
hours = " |crepuscule - {}h".format(hours)
else:
hours = " |nuit - {}h".format(hours)
player_class = (" |Guerrier", " |Voleur", " |Moine", " |Mage", " |Assassin")[player_class]
money = " |Argent: {} PO".format(money)
print("<o> Informations <o>")
print(" |" + center(place, 17, " ") + "|")
print(player_class + " " * (19 - len(player_class)) + "|")
print(hours + " " * (19 - len(hours)) + "|")
print(money + " " * (19 - len(money)) + "|")
print("<o> ============= <o>")
input()
def display_stat(data, stat):
capacities = ["{} ".format(i) if i < 10 else str(i) for i in stat[2]]
first_line = " |Vit : {0} Agi : {1}|".format(capacities[0], capacities[1])
second_line = " |Att : {0} Def : {1}|".format(capacities[2], capacities[3])
health = " |Vie : {} PV".format(stat[0])
mana = " |Magie : {} PM".format(stat[2][4])
print("<o> {} <o>".format(center(stat[5], 13, " ")))
print(first_line)
print(second_line)
print(mana + " " * (19 - len(mana)) + "|")
print(health + " " * (19 - len(health)) + "|")
print("<o> ============= <o>")
input()
def inventory(data, stat):
weapon = ("<aucune>", "Dague", "Marteau", "Masse", "Fleau", "Hache", "Epee", "Espadon", "Hache double")[stat[3][0]]
shield = ("<aucune>", "Rondache", "Pavois", "Cote de maille", "Broigne", "Harnois")[stat[3][1]]
weapon = " |" + weapon + " " * (17 - len(weapon)) + "|"
shield = " |" + shield + " " * (17 - len(shield)) + "|"
print("<o> Inventaire <o>")
print(" |- Arme : |\n{}".format(weapon))
print(" |- Armure : |\n{}".format(shield))
print("<o> ============= <o>")
input()
def sleep(data, stat):
if 360 < stat[4] < 1140:
print_text("Vous ne pouvez pas dormir de jour.")
return
stat[4] = 360
# If the player is at home
if data[1] == 27:
if stat[0] < 100: stat[0] += 10
stat[2][4] += 2
print_text("Vous vous reposez.")
def spell(data, stat):
spell_data = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
spell_level = ("I", "II", "III", "IV", "V")
to_disp = "Magie : {} PM".format(stat[2][4])
print("<o> Sorts <o>")
print(" |" + to_disp + " " * (16 - len(to_disp)) + "|")
for i in range(3):
if i < len(stat[7]):
spell_id, level = stat[7][i]
if spell_id >= 0:
to_disp = "{0} {1}".format(spell_data[spell_id], spell_level[level - 1])
print(" |" + to_disp + " " * (16 - len(to_disp)) + "|")
else:
print(" |<aucun> |")
print("<o> ============ <o>")
input()
events = {"*": npc, "?": point_of_interest}
keys = {4: display_stat, 7: spell, 8:misc_stat, 6: inventory, 9: sleep}
# Main function
def idk(stat=None, data=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ête en cours]
if not stat:
name = ""
while len(name) == 0 or len(name) > 13:
name = input("Entrez votre nom :\n>")
player_class = 0
while(not player_class):
print("Choisissez une classe\n1. Guerrier\n2. Voleur\n3. Moine\n4. Mage\n5. Assassin")
player_class = get_input()
if player_class < 0 or player_class > 5: player_class = 0
if player_class == 1:
stat = [5, 5, 10, 5, 5]
elif player_class == 2:
stat = [5, 10, 5, 5, 5]
elif player_class == 3:
stat = [5, 5, 5, 10, 5]
elif player_class == 4:
stat = [5, 5, 5, 5, 20]
elif player_class == 5:
stat = [10, 5, 5, 5, 5]
stat = [100, 1000, stat, [0, 0], 360, name, player_class - 1, [], 0, -1]
if player_class == 4:
stat[7].append((1, 1))
data = [0, 3, 44, 66]
else:
stat.append(-1)
# Money check
if stat[1] < 0: stat[1] = 0
if stat[1] > 100000: stat[1] = 100000
# Stat check
for i in range(len(stat[2])):
if stat[2][i] > 50: stat[2][i] = 50
if stat[2][i] < 0: stat[2][i] = 0
# Player's class check
if not (0 <= stat[6] <= 5):
raise ValueError("unknown player's class")
idk_game = Asci(maps, events, keys)
stat, data = idk_game.mainloop(100, stat, data, routine=routine, door="^_", walkable=".,`' ", exit_key="q")
print("idk({0}, {1})".format(stat[:-1], data))
# Misc function
def get_input():
string = input(">")
try:
return int(string)
except:
return 0
def center(string, total_length, symbol):
left = floor((total_length - len(string)) / 2)
right = ceil((total_length - len(string)) / 2)
return left * symbol + string + right * symbol
def stat_test(stat, test_id):
score = (80 + randint(-20, 20)) * stat[test_id] / 50
return randint(1, 100) <= score, floor(score)

375
demo/jotunheim.py Normal file
View File

@ -0,0 +1,375 @@
jotunheim = (r"""
/\ /\ / / \ / \ /\ / \ ~~~~~~~~~~~~~~~~~~~~~~~
/ \ / \ / / \ /\ / \ / \ /\ / \ /\ ~~~~~~~~~~~~~~~~~~
/ \ /\ / \ /\ / / \ / \ / / / \ / \ / \ /\ ~~~~~~~~~~~~~~~~
/ \ / \ /\ / \ / \ /\ / \ / \ /\ / / \ / /\ / / \ ~~~~~~~~~~~~~~
/ /\ / / \ / / / \ / \ / \ /\ / / \ / \ / \ ~~~~~~~~~~~~
/ \ / / \ / / \ /\ / / / \ / \ / \ /\ \ ~~~~~~~~~~
/ \ / /\ / \ / / \ / \ / / \ /\ / \ / \ /\ \ ~~~~~~~~
/ \ / \ /\ \ / \ / \ /\ / / \ / \ / / / \ ~~~~~
/ / / \ ___ ### / \ / \ /\ / \ / \ /\ / / \ ~~~
/\ / / \ /O O\ ##### / ### / / \ \ / \ / \ /\ / / \ /\ ~~
/ \ /\ / / \ * |_ | |=| ##### / / \ / ~/ / \ / \ / \ ~
/ \ / ### \ |^|_| |=| / / \ ### ### ~/ / \ /\ / \ /\
/ \ ##### ### / ### \ ##### ##### ~/ / \ / \ / \ / \
\ / \ |=| ### ##### _______ ##### |=| |=| ~ / _ \ / \ /\ / /
\ \ ##### |=| /[] []\ |=| ### ~~~~ __/o\ / ## \ / \ /\ / /
\ /\ /\ |=| / \ ______ ##### ~~~~~ / | / #### / / \ / /
~ \ / \ /\ / \ ### /___________\ ### / \ |=| ### ~~~~~ |____| ## / / \ /
~~ / / \ / \ /\ ##### | | ##### /________\ ##### ~~~~~~ || / / \ /\
~~ / / \ / \ / \ /\ |=| |[] |]O[| []| |=| |<o> <o>| ### |=| ~~~~~ / / \__
~ / / \/ / / \ |___________| | __ | ##### ~~ _____ /\ / \
~ / / / \ * ### |__|__|__| |=| _ / \___ / \_ / \
~~~ /\ / / \ /\ ### ##### __/o\ / \ / \ / \
~~ / \__ / / \__ ##### |=| ### ### / o | /____________\ / \ ~
~~~ / \ /\ / \ |=| ##### ### ##### |____| | O O O | _ /\ ~~~
~~ / \ /\ / \__ / \ /\ ### |=| ##### |=| ## | _ | __/ \ / \_ ~~~
~ / \/ \__ / \ \ / \ ##### |=| ## #### ## |__|^|_______| / | / \ ~~
~ /\ / \ / \ /\ / \ |=| ## #### ## ## #### |____| / \ /\ ~~
/ \__ / \ \ / \ / \ _ #### ## #### || ## ## ## / \_ ~
/ * \ / \ /\ /\ / \ __/ \ ## || ## || #### ## #### /\ / \ ~
~~ \ / \ / \ \ /\ / | || || ## ## #### ## / \_ / \~
~~ \ /\ / \ / \ / \ |____| ## ## #### ## || ## || / \ ~~
~ /\ \/ \ /\ / \ \ /\ / \ #### #### ## #### || / \ /\ ~~~
~ / \ / \ / \ /\ / \/ \ ## ## ## || ## ______ / \_ ~~
/ \ / \ / \ / \ /\ / \ ## #### || || _ || / \ _ / \ ~~
/ \ /\ /\ \ / \ / \ / _ \ #### ## / \ /________\ / \ /\ / \ ~~~~
/\ / \ / \ / \ / \ / \ ## || ___ |_| |<o> <o>| |_| / \_ ~~~~
/ \ / \ / \ / \ |_| || /[O]\ ___ | __ | /\ / \ /\ ~~
/\ / \ / \ /\ | | /<o>\ |__|__|__| / \_ / \ / \_ ~~~
\ \ /\ / \ ___ |___| | | / \ / \ ~~~
\ /\ /\ / \ / \ / \ |___| / \ /\ \ ~~
\ / \ / \ / \ / \ ______ |___| ______ _ /\ / \_ ~~
/\ / \ \ /\ / \ / \ ______ / \ / \ / \_ / \ /\ ~
/ \ \ \/ \ /________\ / \ /________\ |_| / \ / \ / \_ ~
/ \ _ / \ | | _______________ /________\ |<o> <o>| / \ / \
/ /\ \ / \ / \ | o o o o| / \ | [] [] | | _ | /\ /\ / /\ \
/ \ |_| * |________| / () () () () \ | | |__|^|___| / \_ / \_ / \_
/ \ /\ /___________________\ |________| / _ \ / \ / \
/ \/ \ ______ |_/ \_/ \_/ \_| / / \ \/ /\ \/ \
/ \ _ / \ ### |I| |I| _ |I| |I| ______ |_| _/ \
/ \ / \ /________\ ##### |I|* |I|/_\|I| |I| / \ / \ /\
/\ |_| ___ |<o> <o>| ### |I| |I|[^]|I| |I| ### /________\ _ \ _/ \
/ \ /\ * /<o>\ | | /-\ ##### ||]O[| | / \ /\ / \
/ \ \ | | |________| ### ### ### | | |_| _/ \ / \
/ \ \ /\ |___| ### ##### ##### /-\ |________| /\ / \ /\
\/ \ ##### |=| |=| _/ \ / _/ \
/\ / \ ~~~~~~~ ### ### / \ / \
/ \ /\ / ~~~~~~~~~~|----* ### /-\ ### ### ### ##### / \ /\ / \ /\
/ \ / \ ~~~~~~~~~~~~~~| ##### ##### ? ##### ##### ### _/ \ _/ \
\/ \ ~~~~~~~~~~~~~~~| ### |=| |=| ### /-\ / \ /\ / \
~~~ / \~~~~~~~~~~~~~~~|---- /-\ ### ~~~ /-\ / _/ \ / \
~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ### ##### _~/~\~_ ### ___ / \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##### ### ### /~~|~|~~\ ##### /<o>\ /\ \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ### ##### /-\ \_______/ ### | | /\ _/ \ /\ /\
~~~~~~~~~~~~~~~~~~~~~~~~~~ /-\ ### ### |=======| /-\ |___| _/ \ / \ _/ \ _/ \
~~~~~~~~~~~~~~~~~~~~~~~ /-\ ##### * ### /~ \/ / \ / \
~~~~~~~~~~~~~~~~~~~~ ### ### ### ##### /~ / \/ ## \
~~~~~~~~~~~~~~~~ ##### ##### ### /-\ ___ ### ### ~~ ## ####
~~~~~~~~~~~~ __ ### ### ##### /[O]\ ##### /-\ ~~ #### ## ######
~~~~~~~~~~~ /()\ /-\ /-\ ### ___ | | ___ ___ ### ~~~ ###### #### ########
~~~~~~~~~~ | =| /-\ /O O\ |___| /<o>\ /() \ /-\ ~~~ ######## ###### ## ######
~~~~~~~~~ |= | ? ### | | * | | | | ~~~~ ###### ######## #### ####
~~~~~~~~ | =| ### ##### |___| |___| |___| ~~~~~~~ #### ###### ###### |--|
~~~~~~ * |= | ##### ### ___ ~~~~~~~~~~ ## |--| #### ########|--|
~~~~~ /____\ ### /-\ /<o>\ ~~~~~~~~~~~~~~~~ #### |--| |--| ######
~~~~~ ~~~~~~~~ /-\ | | ~~~~~~~~~~~~~~~~~ | ## ## ### |--| ## #### ##
~~~~ ~~~~~~~~~~~~~~~~~ *|___| ~~~~~~~~~~~~~~~~ | #### || ##### ## #### |--| ####
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ## ## | ## ##### #### ###### |--| ######
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ## #### #### | || ### ###### ######## ########
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | #### ## /\ /\ | ### |_| ######## ###### ######
~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~ | /\ #### | ## ##### ###### #### ####
~~~~~~~~~~~~~~ ### # |==| () /\ () | #### ##### #### |--| ## |--|
~~~~~~~~~ ##### ### | /__\ __ /__\ | ## ### |--| |--| #### |--|
~~~~~~ # ### # ##### | | |___/()\___| | | || |_| |--| ######
~~~~~ ### __ |-| ### ### | ## |[]| [] [] |[]| | ### ### ######## ##
~~~~ # ##### /()\ ##### |-| |#### | | __ | | | ##### ##### ## ###### ####
~~~~ ### ### | \____ ### # | /\ |__|___|^^|___|__| ## | ##### ##### #### #### ######
~~~~ ##### |-| | |]O[|\ |-| ### | ? #### | ### ### ###### ## |--| ########
~~~~ ### | _ | ##### | * /\ | |_| |_| ######## #### |--| ######
~~~~~ |-| |____|^|_| # ### # | # # | ### ###### ###### ####
~~~~~~ ### |-| ### |==|==|==|===| |=|==|==|==|==| ##### ## #### ######## |--|
~~~~~~~~~ # ##### ##### ### ##### #### |--| ###### |--|
~~~~~~~~~~~~ ### # ### ### # # ### ##### ### ###### |--| #### ##
~~~~~~~~~~~~~ ##### ### |-| # |-| ### ### ##### ##### |_| ######## |--| ####
~~~~~~~~~~~~~~ ### # ##### ### ##### ##### ##### ### ### ### ###### |--| ######
~~~~~~~~~~~~~~~ |-| ### ### ##### ### ### ### ##### |_| ### ##### #### ## ## ########
~~~~~~~~~~~~~~ ##### |-| ### |-| |-| |_| ##### ##### ##### |--| #### #### ######
~~~~~~~~~~~~~ ### |-| ### ##### ### |--| ###### ###### ####
~~~~~ ~~~~ |-| ~~~~~ # ### |_| ### ### |_| ######## ########|--|
~~~~ * ~~ ~~~~~~~ ~~~~~~~~~~ ### ##### ##### |_| ### ###### ###### |--|
~~~ ~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ##### ##### ##### ### ##### #### ## ####
~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ### ### ### ### ### ##### ##### |--| #### |--|
~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##### |-| |_| ##### |_| ##### ### |--| ######|--|
~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~ ### ##### ### |_| ######## ##
~~~~ ~~~~~~~~~~~~ ~~~~~~~~ # |-| ### ### ### ### |_| ## ###### ####
~~~~~ # ~~~~~ # ~~~~~~ ### ##### |_| ##### ##### #### #### ######
~~~~~ ### # ~~ ### ~~~~~ ##### ##### ##### ##### ### ###### |--| ########
~~~~ ##### ### ##### ### ### ### ### ##### ######## |--| ######
~~~ ### ##### ### ### |-| ### |_| |_| |_| ##### ###### #### ##
~~ |-| ### |-| ##### ##### ### ### ### #### ## |--| ####
~~ |-| _ ##### ##### ##### |_| ##### |--| #### |--| ######
~~ ## ## __/o\ ### ### ### ##### ### ##### |--| ###### ########
~~~ #### #### / o | |_| |_| ### ##### ### ##### ### ######## ######
~~~~~ ## ## |____| ### ########## ### |_| ##### |_| ###### ## #### ~
~~~~~~~ || ___ || ## ##### ##### ### ##### ### ### ### #### #### |--| ~
~~~~~~~~ /o o\ #### ##### ### |_| ##### |_|##### ##### |--| ###### |--| ~
~~~~~~~~ |___| ~~~ ## ### ### ### |_| ### ##### ### ##### ## |--| ######## ~
~~~~~ ~(~)~ || ## |_| ##### ##### ### |_| ### ### ##### ### #### ###### ~~
~~~ (_____) #### ##### ##### ##### ##### |_| ##### |_| ###### ## #### ~~
~~ _ |-----| ## ### ### ### ##### ### ##### ### ### ######## #### |--| ~~
~~~ /-\ _ || ##### |_| |_| ### ### ##### ### ##### |_| ###### ###### |--| ~~
~~~~ |_| __/o\ ~~~~ ##### ### ##### |_| ##### |_| ### ##### ### #### ######## ~~~~~~
~~~~~~ / o | ~~~~~~~~~ ### ##### ##### ### ##### ### ##### |--| ###### ~~~~~~
~~~~~~~~ |____| ~~~~~~~~~~~~~~ |_| ##### ### |_| ##### |_| ##### |--| #### ~~~~~~~~~~
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ### |_| ### ~~~~ ### |--| ~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|_| ~~~~~~~~~~~~~~~~|_| ~~~~~~~~~|_|~~~~~~~~~~~~|--|~~~~~~~~~~~~~~""",
# Autres mondes (Jotunheim = 5)
(11, 120, 1, 56, 42), # Vanaheim
# Maisons
(29, 11, 31, 19, 14),
(88, 25, 32, 14, 24),
(89, 45, 33, 30, 24),
(60, 50, 34, 34, 29), # Palais de Thrym
(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
)
# * : (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)
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."]
def jotunheim_npc(data, stat):
pass
h_31 = (r"""
|=====||=====|===========|======||=====|
| /__\ | | /__\ |
| |==| | _ | |==| |
| (_) | |
| |_| | * __ |
| ____ | | | |
| |____| | |__| |
| | _ | | | |
|============| (_) | |__| |
| | |_| | |
| |=============|
| | |
| | |
| | | |
|============|====|^|====|=============|""",
(19, 14, 5, 29, 11)) # * : (28, 4)
def h_31_npc(data, stat):
pass
h_32 = (r"""
|=============================|
|=============================|
| |
| |
| |============================|
| ____ ____ |=====____==========____=====|
| \__/ \__/ * \__/ \__/ |
| | | | | | | | | |
| | | | | | | | | |
| |__| |__| |__| |__| |
| |
| |
| |
| |
| |
| ____ ____ ____ ____ |
| \__/ \__/ \__/ \__/ |
| | | | | | | | | |
| | | | | | | | | |
| |__| |__| |__| |__| |
| |============================|
| |============================|
| |
|============| |==============|
|============|^|==============| """,
(14, 24, 5, 88, 25)) # * : (28, 6)
def h_32_npc(data, stat):
pass
h_33 = (r"""
|=======|---|=======| |=======|---|=======|
|=======|---|=======| |=======|---|=======|
| /_____\ | | /_____\ |
| |=====| |===|]O[|==|]O[|===| |=====| |
| |==================| |
| _ _ * |
| (~) (~) |
| __ __ |_| * |_| __ __ |
| | | | | | | | | |
| |__| |__| |__| |__| |
| | | | | | | | | |
| |__| |__| _ _ |__| |__| |
| | | | | (~) (~) | | | | |
| |__| |__| |_| |_| |__| |__| |
| |
| |
| |
| _ _ _ _ |
| (~) (~) (~) (~) |
| |_| |_| |_| |_| |
| |
| |
| |
|============================| |===========================|
|=[]=[]=[]=[]=[]=[]=[]=[]=[]=|^|=[]=[]=[]=[]=[]=[]=[]=[]=[]|""",
(30, 24, 5, 89, 45)) # * : (48, 5) * : (24, 7)
def h_33_npc(data, stat):
pass
h_34 = (r"""
|======================| |======================|
|======================| |======================|
| | | |
| | | |
| |============| |
| |============| |
| ####### * ####### |
| ######### ######### |
| ######### ######### |
| ######### ######### |
| ####### __ __ ####### |
| (==) (==) |
| |TT| |TT| |
| |__| |__| |
| ~~~ ~~~ |
| ~~(~)~~ ~~(~)~~ |
| /~~~T~~~\ /~~~T~~~\ |
| \=======/ __ __ \=======/ |
| (==) (==) |
| |TT| |TT| |
| |__| |__| |
| ####### ####### |
| ######### ######### |
| ######### ######### |
| ____######## ____ ____ ########____ |
| |II|####### |II| |II| #######|II| |
|==|II|================|II| |II|================|II|==|
|==|II|================|II| |II|================|II|==|
|II| |II| |II| |II|
|II| |II|/|^=|\|II| |II| """,
(34, 29, 5, 60, 50)) # * : (26, 6)
def h_34_npc(data, stat):
pass
h_35 = (r"""
|================================================|
|==|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|==|
| |
| _ _ |
| ### (~) (~) ### |
| ##### * |=| |=| ##### |
| ### ### |
| |=| |=| |
| ### _ _ ### |
| ##### (~) (~) ##### |
| ### |=| |=| ### |
| |=| |=| |
| ### ### |
| ##### _ _ ##### |
| ### (~) (~) ### |
| |=| |=| |=| |=| |
| |
| |
|======================\ /======================|
|==|/\|=|/\|=|/\|=|/\|=/^^\=|/\|=|/\|=|/\|=|/\|==|""",
(24, 19, 5, 0, 0),
(25, 19, 5, 0, 0)) # * : (17, 5)
def h_35_npc(data, stat):
pass
h_36 = (r"""
|======================================|
| |
| _ _ _ _ |
| (_) *(_) (_) (_) |
| |_| |_| |_| |_| |
| |
| |
|=================| |====== =======|
| | | [I] [I] |
| +---+ +---+ | | /|\ /|\ |
| | | | | | * |
| | | | | | |
| +---+ * +---+ | | [====] [====] |
| | | [====] [====] |
|=================|^^|=================|""",
(19, 14, 5, 23, 88),
(20, 14, 5, 23, 88)) # * : (11, 3) * : (27, 10) * : (9, 12)
def h_36_npc(data, stat):
coords = data[2], data[3]
if coords == (27, 10):
if not (300 <= stat[4] <= 1380): return [0, "Je suis desole, nous somme ferme la nuit."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Vous voulez quelque-chose ?\n1. Je mangerai bien un truc [-4 PO]\n2. Il vous reste une chambre ? [-12 PO]", 2]
if data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 4: return [-1, "Reviens quand tu auras de quoi me payer."]
return [-1, "Et voila ! [LE TAVERNIER POSA UNE ASSIETTE FUMANTE DEVANT VOUS ET UN VERRE DE VIN]", 0, (0, 5), (1, -4)]
if data[0] == stat[9] + 2:
stat[9] = -1
if 360 < stat[4] < 1140: return [-2, "Il est trop tot, reviens vers 19h."]
elif stat[1] < 12: return [-2, "Tu n'as pas assez."]
stat[4] = 360
return [-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)]

272
demo/midgard.py Normal file
View File

@ -0,0 +1,272 @@
midgard = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~ ~~~~~~ ~~~ _ ~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ~~~ ~~~ ~~~ /-\ ~~~~~~~ ~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~~~~~ ~~~ ~~~~ ~~~ |_| ~~~~~~~ ~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~ ~~ ~~~~ ~~ ~~ ~~~~~ ~ ~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~ ~ ~~~~~ ~~ ~~~ ~~~ ~~~~ ~~~~~ ~ ~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ? ~~~~~~~ ~ ~~ ~~~~~ ~~~ ~~ ~~~~ ~~~ ~ ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~ ~~~~~ ~~~~ ~~~ ~~~ ~~ ~ ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ~ ~ ~~~~~ ~~~~ ~~~~ ~~~ ~~~~ ~~ ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~ ~~~~~~ ~~~ ~~~~ ~~~ ~~~ ~ ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~ ~~ ~~ ~~~ ~~~ ~~~ ~~~~ ~ ~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~ ~~ ~~ ~~~ ~~~ ~~~~ ~~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ ~ ## ~~~~ ~~~~ ~~~~~ ~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /\ ~~ #### ~~~~~ ~~~ ~ ~~~ ~~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~~~ / \ ## #### ~~ ~~ ~ ~~ ~ ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~ / \ ## #### ## ## ~ ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ ~ /\ #### #### ##|| #### ## ## ~~~~~~
~~~~~~~~~~~~~~~~~~~~~ ~~~~ / \ ## #### ## #### ## #### #### #### ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~ ~ ~ \ #### ## || ######## ## ## #### ## #### ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~ /\ #### ##|| ## #### ##|| #### ## #### ## ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~ / \ ## #### || ## #### #### ##|| #### ##|| ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ / \ || #### ? || #### ## #### ## #### ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## ## ## || #### || #### ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~ /\ || ||#### ## ## ## ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ _/ \ /\ ## #### ||#### || ## ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ / \ / \ #### ## ## #### #### ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ / /\ / \ ' . #### ##|| #### ## ## #### ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ ~~~ / \ ## #### #### ##|| #### ## ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ /\ /\ / \ . || #### ## #### #### ##|| ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~ / \ / \ /\ ## || #### ## #### ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~ / \ \ / \ . ' || ## || #### ~~~~~~~~~
~~~~~~~~~~~~~~~~ ~~~~~~~~ / \ . || ## ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~ ~ /\ ., ~~~ || ~~~~~~~~~
~~~~~~~~~~~~~~~~~~ ~~ / \ . , ~(~)~ ### ~~~~~~~~~
~~~~~~~~~~~ ~ ~~ ### / \ . /~(___)~\ ##### ~~~~~~~~~~
~~~~~~~~~~~~~~~ ##### , . ### \~~~~~~~/ ### ~~~~~~~~~~
~~~~~~~~~~~~~~~~~ ### ##### /-\ ### ~~~~~~~~~~
~~~~~~~~~~~~~~~~ ~~ /-\ ### . ### ##### ~~~~~~~~~~
~~~~~~~~~~~~~~~ ~~ ~~ ##### , /-\ _____________ ### ~~~~~~~~~
~~~~~~~~~~~~~ ~~ ~~~ ~~~ ### , ' / Midgard \ /-\ ~~~~~~~~~
~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~ /-\ . ' ' / \ ### ~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ , , . ' /_ __ _ ___ _ __ _\ ##### ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ |_/ \_/ ? \_/ \_| ### ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __ ### |_| |_| *|_| |_| /-\ ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~ ### /[]\____ ##### ### ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##### |_ o o \ ### _ ##### ~~~~~~
~~~~~~~~~~~~~~~~~~~~~ ~~~~ ### * |^|_____| /-\ _ /o\___ ### ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ /-\ /o\ |_ ]O[\ /-\ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~ |_| |^|___| ~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~ ### ' __ , ### _ ~~~~~~~
~~~~~~~~~~~~~~~~~~~ ##### / \ ##### / \ ~~~~~~~
~~~~~~~~~~~~~~~~~ ### ### ' |__| , ### |_| _ ~~~~~~
~~~~~~~~ ##### /-\ ### /-\ /o\ ~~~~~~
~~~~~~~~ _ ### ##### . , , * |_| ~~~~~~
~~~~~ /-\ ### /-\ ### . , . __ _ ~~~~~~
~~~~~~~ |_| ##### /-\ ,. ' /[]\ / \ ~~~~~~~
~~~~~~ * ### ' . |__| |_| ~~~~~~~~~~
~~~~~~~~~~~~~~ /-\ . ' . * __ _ ~~~~~~~~~~~
~~~~~~~~~~~~~~~~ /<>\ _ /-\ ~~~~~~~~~~~
~~~~~~~~~~~~~~~~ __ ' ' . |__| /o\ |_| ~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~ /<>\ ' ___ |_| _ ~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~ |__| / _\ .. /o\ ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~ ' . |_|^| . _ _ |_| ~~~~~~~
~~~~~~~~~~~~~~~~~~~ ' /o\____/o\ ~~~~~~
~~~~~~~~~~~~~~~~~~~~ ' ' __ |==|==| o o |==|==| __ ~~~~~
~~~~~~~~~~~~~~~~~~~~ ' /[]\ | | __ | | /<>\ ~~~~~
~~~~~~~~~~~~~~~ ' |__| | |__|^^|__| | |__| ~~~~
~~~~~~~~~~~~~~~~~ ___ | | ~~~~~
~~~~~~~~~~~~~~~~~~~ . /]O[\ | #### #### * | ~~~~~~~
~~~~~~~~~~~~~~~~~~~ . |___| | #### #### | ~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~ ' , __ | #### #### | ~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~ / \ | | ~~~~~~~~~~~~~~
~~~~~~~~~~~~~~ . |__| | #### #### | ~~~~~~~~~~~~~~~
~~~~~~~~~~ | #### #### | ~~~~~~~~~~~~~~
~~~~~~~~~~~ | #### #### | ~~~~~~~~~~~~
~~~~~~~ ### ### | | ~~~~~~~~~~~
~~~~~~~~~ ### ##### ##### ### | ? + + | ~~~~~~~~~~~
~~~~~~~~~ ##### ### ##### ##### |==|==|==| |==|==|==| ~~~~~~~~~~~
~~~~~~~~~ ##### /|\ ### ### ### ~~~~~~~~~~
~~~~~~~~~ ### ### /|\ ##### /|\ ~~~~~~~~~~
~~~~~~~~ /|\ ##### ### ### ### ### ~~~~~~~~~
~~~~~~~~ ##### ### /|\ ##### ##### ##### ### |--|--|--|~~~~
~~~~~~~~~ ### ### ##### ##### ### ### ##### *|~~~~
~~~~~~~~~~ ##### /|\ ##### ### ### /|\ /|\ ### |~~~~
~~~~~~~~~~~ ##### ### ##### /|\ /|\ |--|--|--|~~~~
~~~~~~~~~~~~~ ### _ /|\ ##### ### ### ~~~~~~~~~~~
~~~~~~~~~~~~~~~ /|\ /-\ ### ### ##### ##### ~~~~~~~~~~~~
~~~~~~~~~~~~~~~~ |_| _ /|\ ##### ##### ##### ### ~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~ / \ _ ##### ### ### ### ##### ~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~ |_| / \ ### /|\ ##### /|\ ### ~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~ |_| /|\ ### /|\ ~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /|\ ~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
# Autres mondes (Migard = 3)
(72, 6, 0, 126, 71), # Asgard
(77, 62, 6, 93, 8), # Nidavellir
(24, 90, 4, 78, 19), # Niflheim
(10, 58, 1, 54, 29), # Vanaheim
# Maisons
(42, 49, 25, 4, 16), # Ferme
(76, 51, 26, 5, 11), # Auberge
(44, 65, 27, 9, 16), # Maison du joueur
(60, 69, 28, 24, 14), # Mesnie fortifiée (1/2)
(61, 69, 28, 25, 14), # Mesnie fortifiée (2/2)
)
def midgard_po(coords):
if coords == (29, 9): return [0, "Du haut des falaises, vous regardez vers le nord. La mer s'etale, infinie. Le vent porte des embruns a votre visage. 30 metres plus bas, les vagues se dechainent contre le calcaire de la roche dans un fracas assourdissant."]
elif coords == (53, 24): return [0, "Vous regardez la clairiere autour de vous, l'endroit est agreable. Une douce chaleur traine dans l'air sec. Au dela des grands pins qui vous entourent, vous parvenez a voir quelques sommets de montanges."]
elif coords == (66, 45): return [0, "Les imposantes colonnes du palais de Midgard vous entourent. Un peu au sud, le bourg est actif : marchands de toutes sortent deambulent, entoures d'une population dense et bruyante."]
elif coords == (52, 79): return [0, "Tournant le dos a l'epais mur qui delimite la propriete, vous observez le manoir. Le corps du batiment etait clairement une ancienne ferme a laquelle deux tours on ete rajoute a posteriori. L'ensemble garde un aspect massif et froid. Neanmoins, le reste de la propriete a fait l'objet d'un certain soin, en particulier le jardin en 4 parties dans lequel un vieux jardinier s'affaire."]
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."]
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 !"],
}
h_25 = (r"""
|==|-|=======================|=========|
|==|-|=======================|=========|
| /-\ | | |
| |___| | ______ | |
| | |______| | |
| | | |
| | | |
| |--| |--------| |--| |------|
| |
| |--| |--------| |--| |------|
| | | |
| | | |
| | | |
| | | |
| |==============================|
| |=|\/|=|\/|=|\/|=|\/|=|\/|=|\/||
|\/|^|\/| """,
(4, 16, 3, 42, 49))
def h_25_npc(data, stat):
pass
h_26 = (r"""
|---------|------------------|
| | |
| |==============[]==|
| | |
| | _ _ _ |
| | |_| |_| |_|* |
| |_|* |_|* |_| |
| |_|* |_| |_|* |
| | |
| |------------------|
| |
|---|^|---| """,
(5, 12, 3, 76, 51))
def h_26_npc(data, stat):
# * : (17, 7)
# * : (22, 7)
# * : (17, 8)
# * : (27, 8)
coords = data[2], data[3]
xp = data[0]
# Rosahil Green
if coords == (27, 6):
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] == stat[9]:
stat[9] = data[0]
return [0, "Rosahil Green, tenanciere de cette auberge. Vous desirez quelque chose ?\n1.De quoi manger s'il vous plait. [-5 PO]\n2.Je voudrais une chambre pour la nuit. [-10 PO]", 2]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Reviens quand tu auras assez de pieces d'or."]
return [-1, "Et voila pour vous ! [ROSAHIL POSA UNE ASSIETTE DE RAGOUT CHAUD DEVANT VOUS.]", 0, (0, 5), (1, -5)]
elif data[0] == stat[9] + 2:
stat[9] = -1
if stat[1] < 10: return [-2, "Je suis desolee, tu n'as pas assez !"]
elif 360 < stat[4] < 1140: return [-2, "Il est trop tot, reviens vers 19h."]
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 ?"]
h_27 = (r"""
|-----------------|
|[====] | [====]|
|[====] /_\ [====]|
| |
| + + |
| | |=======|
| | | |
| | | |
| | + |
|=======| |
| | + |
| |- | | _ |
| |_| + | |_| |
| | |_| |
| + | |_| |
| | | |_| |
|=======|^|=======| """,
(9, 16, 3, 44, 65))
def h_27_npc(data, stat):
pass
h_28 = (r"""
|__|
|__|
|------------| |--|__|--| |------------|
| [===][===] | | /" "\ | | [===][===] |
| [===][===] | | |____| | | [===][===] |
| |------| |------| |
| * |
| |
| ______ ______ |
| |\/||\/| |\/||\/| |
| | | | | |
|____________| | | |____________|
|\/|=|\/|=|\/| | | |\/|=|\/|=|\/|
|__+ +__|
|\/|^^|\/| """,
(24, 14, 3, 60, 69),
(25, 14, 3, 61, 69)) # * : (27, 6)
def h_28_npc(data, stat):
pass

287
demo/muspellheim.py Normal file
View File

@ -0,0 +1,287 @@
muspellheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _ ~~~~~~
~~~~~~~~ _ ### ~~~~~~~~~~~~~~~~~~~~~~~~~~~ /o\ ~~~~~
~~~~~~~ /o\ ##### ~~~~~~~~~~~~~~~~~~~~~ ### /_|_\ ~~~~
~~~~~~~ /_|_\ ### ~~~~~~~~~~~~~ ##### ~~~~~
~~~~~~~~ /_\ ### ### ### _ _ _ ~~~~~
~~~~~~~~~ ##### /_\ ##### ? / \__ /o\ /-\ ~~~~
~~~~~~~~~ _ ### _ ### | <>\ /_|_\ |_| ~~~~
~~~~~~~~ _ /o\ /_\ / \__ ### ### /_\ |____| ~~~~~
~~~~ /o\ /_|_\ | <>\ ##### ##### _ ~~~~~~
~~~ /_|_\ ### * |____| ### ### ### /o\__ ~~~~~~
~~~ ### ##### ##### /_\ /_\ ` |_ \ ~~~~~~
~~~##### ### ##### ### `,.` , * |^|__| ~~~~~~
~~~############ ### ### ` /_\ ',` `, ~~~~~~
~~~ ### ##### |=|### ##### , ' ` ' . ' ,, ` ```,'' . ~~~~~~
~~~ |=| ### ##### ### ##### `' ., ` ' ','., ,`.. ,,`,,` ,`'. ` `` ~~~~~~~
~~~ |=|### ########### ### , . ` ,.. ' ` ~~~~~~~~
### ##### ### ##### |=|. ` ### `,. ### ~~~~~~~~~
##### ### ##### |=| ### ### ##### ` ### ### ##### ~~~~~~~~~
##### ##### ### |=| ` ' ##### ### ##### ### ##### ##### ### ##### ~~~~~~~~~
### ##### |=| ### ,` ` ##### ##### ### ##### ### ##### ##### ##### ### ~~~~~~~~~
|=| ### ### ##### , , ' ### ##### |=| ##### ##### ### ### ##### |=| ~~~~~~~~
|=|##### ### ###### ' `. ` |=| ### ### ##### |=| |=| ### ### ~~~~~
########### ### ,. `.,''. |=| |=| ### ', |=| ##### ###
### ##### |=| ' `' ### `, |=| .''` ### . ##### #####
|=| ### ### ##### . ### ### ` ##### `'`. ### #####
|=| ##### ### ##### ### ##### ##### ### ,##### ' . |=| ###
### `,., ##### ##### ### ` ##### ### ##### ##### ##### ### ' |=|
### #####` ### ##### |=| ##### ##### ### ### ##### ,|=| ` ,. . `` , #
###### ### ######. .` |=| ### .,` ### ##### |=| |=| ### ` . .,, ' ###
########### ### . |=| ' ### |=| ' ### |=| '. ', ### #####
### ##### |=| ### ### ` ##### |=| ### ` ` ##### ### #####
|=| ### ### `. ##### ##### ### ##### ### ##### '' ##### ##### ###
|=|##### ### ,##### ##### ##### ### ' , ##### ### ##### `' `` ### ##### |=|
##### ##### '### ### ##### |=| ,', ##### ##### ### ,`` ` |=| ### ~~
### ##### '|=| |=| ### `.`' ### ##### |=| , ' |=| ~~~~
|=| ### |=| ### . ' . |=| ### .,` ### ~~~~~~
### |=| , ### ##### `` ' |=| , . ### ##### ~~~~~~
##### , ##### ### ##### ,,' ##### ### ##### ~~~~~~~
##### .,` ##### ##### ### `. , ` .,'. ##### ##### ### ~~~~~~~~~
### ` ` . ` ### ##### |=| ` , , ,` , ` ### ##### |=| ~~~~~~~~~
|=| ' |=| ### . ' ' `' `' |=| ### ~~~~~~~~~
### ., |=| , . .' '' ., |=| ### ~~~~~~~~~
##### .` . ### ##### ~~~~~~~~~
|=| ,, '' '` `,.` , ' '` ` ..` ##### ### ~~~~~~~~~
### .'. .'` ' ,`,, ' , `'.. ### ### /_\ ~~~~~~~~~
##### ### ` .'' ... `' . '` ### `,, /_\ ##### ~~~~~~~~
/\ ### ##### ### .` ` ##### ',' . ### ~~~~~~~~
/ \_ /_\ ### ##### .' ' ### ### ` `, ### /_\ ~~~~~~~~~
/ \ /_\ ### ### `.` ,, __ #####/_\ .`,, `, ##### ~~~~~~~~~~
/ \ /\ ##### /_ ` ### /o_\ ### ,.`,' ### ### ~~~~~~~~~~~~
/ \_ ### .,. ##### |_^| /_\ ### .``,.` /_\ ##### ~~~~~~~~~~~~~
\ / \ /_\ '' ### ### ##### .`` ### ~~~~~~~~~~~~~
\ /\ / \ /\ '` /_\ ### ##### ### . ### /_\ ~~~~~~~~~~~~
/ \_ / \_ ,,' ##### ### /_\ ,'' ##### ### ~~~~~~~~~
/ \ / \ ` ### /_\ ### `.''. ### ##### ### ~~~~~~~~
/ \ /\ / \ /\ '. /_\ ##### .'.', /_\ ### ##### ~~~~~~~
/ \_ / \_ `' ### ### ,.. '` /_\ ### ~~~~~~~
/ \ / \ `.'. ### ##### /_\ .` ',, ', /_\ ### ~~~~~
/\ / \ /\ / \ ' . ##### ### `. ' ,` ### ##### ~~~
/ \_ / \_ , '' , ., ### /_\ ### ' . ,` ##### ### ~~~
/ \ / \ ,, '...`, , /_\ ##### . . ### ### /_\ ~~
/ \ /\ / \ /\ . ,.`` ### ### ,. ` /_\ ##### ### ~~
/ \_ / \_ .., ' ### ### /_\ ##### `` `' ### ##### ~~~~
\ / \ / \ .,,##### ##### ### .`.``''` ### /_\ ### ~~~~~
\ /\ / \ /\ / \ /\ . ,### ### /_\ '',. ##### ### /_\~~~~~~
/ \_ / \_ / \_ ' /_\ /_\ ### , '` ### ##### ~~~~~~~
/ \ / \ / \ '.. ### ##### ### ' ` /_\ ### ~~~~~~~
/ \ /\ / \ /\ / ',' \ ,`''##### ### ##### '.,,` ,' /_\ ~~ ~~~~
/ \_ / \_ ` .,'`'.,' `### /_\ ### , ',,,. ### ~~ ~~~~
\ / \ / \ ',`. , `,,/_\ ### /_\ ',,`. ##### ~~ ~~~~
\ /\ / \ /\ / \ /\ ' `. ` ', ##### '' ### ### ~~~~~ ~~~~
/ \_ / \_ / \_ ` `., ### , ##### /_\ ~~~~~~ ~~~~
/ \ / \ / \ .' /_\ ### ,` ### ~~~~ ~~~~
/ \ /\ / \ /\ / \ /\ .. ##### ### `,' ### /_\ ### ~~~~~ ~~~~
/ \_ / \_ / \_ ### ##### ` ##### #####~~~~~ ~~~~
\ / \ / \ / \ ,. /_\ ### , ### ### ~~~ ~~~~
\ /\ / \ /\ / \ /\ / \ . /_\ /_\ /_\ ~~~ ~~~~
/ \_ / \_ / \_ .. * ` .' ,' ~~~ ~~~~
/ \ / \ / \ . .'''. ''`. ` `````..', ' ,..,, , . ~~~~ ~~~~
/ \ /\ / \ /\ / \ /\ .,. . _ ,' ..,` ,', _ ` ~~~~ ~~~~
/ \_ / \_ / \_ . (_) (_) ., ~~~~~ ~~~
\ / \ / \ / \ |=|==|==|==|==||==|==|==|==|=| , ~~~~ ~~~
\ /\ / \ /\ / \ /\ / \ /\ | () () | ~~~~~~ ~~~
/ \_ / \_ / \_ / \_ | /__\ __ /__\ | . ~~~~~~ ~~~
/ \ / \ / \ / \ | |o |__/()\__| o| | ~~~~~ ~~~~
/ \ /\ / \ /\ / \ /\ / \ | | o|[] __ []|o | | `. ~~~~ ~~~~
~~ / \_ / \_ / \_ | |__|__|^^|__|__| | , ~~~~~~~
~~~~ / \ / \ / \ __ | | ~~~~~~~
~~~~~ / \ / \ / \ /o \ | * #### #### | .`' ~~~~~
~~~~~~~ __ |__| | #### #### | `. ~~~~
~~~~~~~ __ / \ __ | #### #### | , '` ~~~
~~~~~~~ /()\|__| * /<>\ | | ,,', ~~~
~~~~~~~~ ~~~ |__| |__| |_ _ _ _| ` .'` ~~~
~~~~~~~~~ ~~~~~~~~~~~ ~~~ (_) oo (_) (_) oo (_) . , ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ',.. |=|==||==|=|?'` |=|==||==|=| ', ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ` ..` . . ` .'' ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ` '` '' . . ` ``.` ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ ', ''', ',. , , , ` ,.' ` ~~
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~ ` . ' , ', ~~
~~~~~~~~~~~~~~~~~ ~~~~~ __ ' ' , ~~
~~~~~~~~~~~~~~~~~~~~ ~~~~~~ / o\ ### , ~~~~
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ |__| ` ##### ~~~~ ,, ~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ `' ### ~~~~~~~~~ .` ~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ |_| ~~~~~~~~~~~ . . ' ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ,, ,` ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ' , ' ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ . . ` ` ~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' . ` ~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ ~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
# Autres mondes (Muspellheim = 7)
(92, 9, 6, 9, 57), # Nidavellir
# Maisons
(87, 14, 42, 16, 14), # Auberge
(47, 53, 43, 32, 14), # Armurerie
(67, 89, 44, 24, 24),
(68, 89, 44, 25, 24),
)
# * : (20, 12)
# * : (78, 14)
# * : (54, 80)
# * : (59, 91)
# * : (39, 94)
# * : (29, 113)
def muspellheim_po(coords):
if coords == (66, 8): return [0, "La mer s'etendait, calme. Bosquets et maisons peuplaient la cote, dont plusieurs petite tentes."]
elif coords == (64, 97): return [0, "La cloture de la propriete etait ouvragee, le manoir aussi. Constitue d'un corps de ferme rehabilite et entoure de deux tours decoratives, l'ensemble conservait un air propre et entretenu. Le jardin taille en temoigne."]
def muspellheim_npc(data, stat):
pass
h_42 = (r"""
|===================|
| * |
|--[]---------------|
| |
| |
| * |=============|
| |
| * |
| +------+ +------+ +------+ |
| | | | | | |* |
| | | | | | | |
| *+------+ +------+ +------+ |
| |
| |
|==============|^|================|""",
(16, 14, 7, 87, 14)) # * : (11, 5) * : (6, 7) * : (31, 9) * : (2, 11)
def h_42_npc(data, stat):
coords = data[2], data[3]
if coords == (6, 7):
if not (300 <= stat[4] <= 1380): return [0, "Nous sommes ouverts de 5 a 23 heures."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Besoin de quelque chose messire ?\n1. Hum, oui, j'aimerais manger. [-5 PO]\n2. Je voudrais dormir [-10 PO]", 2]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Je regrette, vous n'avez pas assez."]
return [-1, "Et voila pour vous !", 0, (0, 5), (1, -5)]
elif data[0] == stat[9] + 2:
stat[9] = -1
if stat[1] < 10: return [-2, "Nous ne pouvons pas nous permettre de faire credit."]
stat[4] = 360
return [-2, "Bien sur, si vous voulez bien me suivre. [VOUS VOUS ALLONGEZ SUR LE LIT ET VOUS ENDORMEZ RAPIDEMENT.]", 0, (0, 10), (1, -10)]
h_43 = (r"""
|====|--|============|--|=========|
|====|--|============|--|=========|
| /____\ /____\ |
| |====| |====| |
| * |
| * |
| +----+ +----+ +----+ |
| | | | | | | |
| +----+ +----+ +----+ |
| * |
|=============================| |
|=============================| |
| |
| |
|[^]|""",
(32, 14, 7, 47, 53)) # * : (24, 4) * : (6, 5) * : (13, 9)
def h_43_npc(data, stat):
coords = data[2], data[3]
if not (480 <= stat[4] <= 1140): return [0, "L'armurerie est ouverte de 8 heures a 18 heures."]
if coords == (24, 4):
if stat[3][1]: return [0, "Vous portez deja une armure, allez voir mon confrere."]
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]"]
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)]
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] == stat[9]:
stat[9] = data[0]
return [0, "Vous voulez vendre votre piece d'armure ?\n1. Oui\n2. Non", 2]
elif data[0] == 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] == stat[9] + 2:
stat[9] = -1
return [-2, "Revenez quand vous voulez !"]
elif coords == (6, 5):
return [0, "Je ne suis qu'apprenti monseigneur. Adressez-vous plutot a Bertfrid."]
h_44 = (r"""
|==|==|==|==|==|==|==|==|==|==|==|
| |
| * ### ### |
| ##### ##### |
| ### ### |
| ### |_| |_| ### |
| ##### ##### |
| ### ### |
| |_| |_| |
| |
|=|/\|==|/\|=|/\|=| |=|/\|=|/\|==|/\|=|
|=|\/|==|\/|=|\/|=| |=|\/|=|\/|==|\/|=|
| |
| ___ ___ ___ ___ |
| | | | | | | | | |
| |___| |___| |___| |___| |
| | | | | | | | | |
| |___| |___| |___| |___| |
| |
| [I] [I] |
| * /|\ /|\ |
| [========] [========] |
| [========] [========] |
|=|/\|==|/\|=|/\|=|/\|=| |=|/\|=|/\|=|/\|==|/\|=|
|=|\/|==|\/|=|\/|=|\/|=|^^|=|\/|=|\/|=|\/|==|\/|=|""",
(24, 24, 7, 67, 89),
(25, 24, 7, 68, 89)) # * : (13, 2) * : (13, 20)
def h_44_npc(data, stat):
pass

307
demo/nidavellir.py Normal file
View File

@ -0,0 +1,307 @@
nidavellir = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~
~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ _ ~~
~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ? ~~~~~~~~~~~~ /-\ ~
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ |_| ~
/\ ~~~~~~~ /\ ~~~~~~~~~~~~~~~ `.
\ /\ ~~~~~~ / \ /\ ~~~~~~~~ /\ ,. . ,, /\ /\
\ / \ ~~~~~ / \ / \ /\ / \ /\ '` ,` / \ / \
/ \ ~~~~ / / \ / \ / \ / \ /\ `, , / \ /
/ ~~~~~ / / / \ /\ / / \ / \ / \ /
/ ~~~~~ /\ / / \ / \ /\ / / / \ /\ / \ /\ /
~~~~ / \ /\ / \ / \ / \ /\ / / \ / \ / \
/\ ~~~~ / \ / _\ / / \ / \ / \ / \ / \
/ \ /\ ~~~~ / / /^\\ /_ / / \ / \ / \
\ / \ ~~~ / / \ /-\ / / \ / \ / \
/ ~~~~~ / \ |_| / \ /\ /\
/ ~~~~~~ /\ / \ /\ / \ /\
/ ~~~~~~ / \ /\ * / \ / \ /\ / \ / \ /\
/\ ~~~ / \ / \ /\ /\ / / \ / \ / / \ / \
/ \ /\ ~~~ / / \ / \ /_ \ /\ / / / \/ / / \
\ / \ /\ ~~~~ / / \ //^\ \ / \ /\ / /\ / \ / / \
/ \ / \ ~~~~~ / / \ / / \ / \ / _\ /\ \ / \
/ / \ ~~~~~~ / / / / \ / /^\\ / \ /\
/ / \ ~~~~~~~~~~ ## / / \ / / \ / \
/\ / ## \ ~~~~~~~~~ #### / \ / / / \ /\
/ \ /\ #### ## ~~~~~~~ ## / ## / \ \ /\
\ /_ \ ## #### ~~~~~~~ || /\ #### / ## \ \ / \ /\
//^\ \ || ## * ~~~~~~~ / \ /\ ## #### / \ / \
/ \ || ~~~~~~ /^\ \ / \ /\ || ## / /
/ \ /\ ~~~~ / / \ / \ || / /
\ /\ /_ \ /\ ~~~~~~ / / / \ ## /\ /
\ / \ /\ //^\ \ / \ /\ ~~~~ / / \ #### / \ /\
/ \ / \ / / \ / \ ~~~~ / \ ## / \ / \ /\
/ / \ / / / _ \ ------ || / / \ / \
/ / \ / / /^\ \ /\ ## / / /
/ \ / \ -------- / \ /\ #### / /
\ /\ /\ ~~~~ / \ / \ /\ ## /\ /
\ / \ /\ / _\ /\ ~~~ / / \ / \ || / \ /\
/ \ / \ / /^\\ / \ /\ ~~~ / / / /^\ / \ / \ /\
/ / \ / / \ / \ ~~~~~ / / \ / / \ / \
/ / \ / / / \ ~~~~~~ /\ / \ / / /
/ \ / / \ ~~~~~ / \ /\ ## / /
\ /\ / \ ~~~~ / \ / \ /\ * #### /\ /
\ / \ /\ ~~~ / / \ / \ ## ## / \ /\
/ \ / \ /\ ~~~ / / / \ #### || / \ / \ /\
/ /^\ \ //^\ /\ ~~~~ / / \ ## . / / \ / \
/ / \ / \ / \ /\ ~~~~~~~~~~ / \ || .'' / / /
/ ~~/ /^\ \ / \ ~~~~~~~~~~~~ , / /
\ /\ ~~ / / \ /\ ~~~~~~~~~~~~ . /\ /
\ / \ /\ ~~~~~ / / \ / \ /\ ~~~~~~~~~~~~~~~~ .'` / \ /\
/ \ / \ ~~~~) / \/ \ / \ /\ ~~~~~~~~~~~~~~ `.` / \ / \
/ /_ \ * (~~~~~ / / \ / \ ~~~~~~ ` / / \ /
/ //-\ \ ~~~/ / / \ /\ ~~~~ . / / /
/ |_| \ ~~~~~~~/ / \ / \ /\ ~~~~ ' / /
\ /\ /\ ~~~~ / / \ / \? /\ ~~~~ , /
\ / \ /\ / \ /\ ~~~~~~~ / / \ / \ ~~~~~ . /\
/ \ / \ / \ / \ /\ ~~~~~~ / / \ ~~~~ / \
/ / \ / / \ / _\ , ~~~~ / / ~~ \ * ~~~~ .' / \ /
/ / \ / / / /^\\ ` ~~~~~~ / ~~ \ ~~~~ / /
/ \ / / \ .,` (~~~~~~~~~~~~~~~~ ~~~~ ~~~~ .`, / /
\ /\ / \ . ~~~~~~~~~~~~~~~ . /
\ / \ /\ /\ ~~)/\ , ' ,, (~~~~~ ` /\
/ \ / \ / \ /\ ~~ / \ /\ ,, / \
/ / \ / \ / \ /\ ~~~ / \ / \ /\ /\ ~~) '., / \ /
/ / \ / / \ / \~ / / \ / \ / \~~ /\ ` / /
/\ / \/ / / \ / / / \ / \ / \ /\ /\ / /
/ \ /\ / / \ / / \ / / \ / \ / \ /\ /
/ \ / \ /\ /\ / \ / \/ / / \ / \ / \ /\
/ \ / \ / \ /\ /\ / / \ / / \ / \
/ / \ / \ / \ /\ / \ /\ / \/ / /
/ / \ / / \ / \/ \ / \ /\ / / """,
# Autres mondes (Nidavellir = 6)
(93, 8, 3, 77, 62), # Midgard
(9, 57, 7, 92, 2), # 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
(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):
pass
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

184
demo/niflheim.py Normal file
View File

@ -0,0 +1,184 @@
niflheim = (r"""
## ##### ##### ##### ##### ### ### ##### ##### ##### ### ### ### ### #####
### ### ##### ### ##### /_\ ##### ##### ### ##### ##### ##### ##### ##### #####
### /_\ ### /_\ ### ### ##### ### /_\ ### ### ### ##### ### ##### ##### ##### ###
## /_\ ###/_\ ##### ### /_\ #####/_\##### ### ##### ### ### ### ### ### ### /_\
_\ ### ##### ### ##### /_\ ### ##### ##### /_\ ##### /_\ /_\#####/_\##### ##### ###
### ##### ########## ### ### ##### ### ### ### ### ### ### ##### ##### ##### #####
##### ##### ### ##### /_\ ########## /_\ ### /_\##### ### /_\##### ##### ### ### ### ### ### #####
##### ### /_\ ### ##### ### ### ##### ########## ##### ### ##### /_\#####/_\#####/_\ ###
### ### /_\ ### /_\ ### /_\##### ##### ### ##### ### ##### ### ##### ##### /_\
/_\##### ##### _ /_\ ##### ### /_\ ### /_\ ##### /_\ ### ### ###
### ##### ### ##### _ |+| ### ### ### /_\ /_\ ### /_\ _ /_\ ##### ###
#### ### ##### ### |+| |_| ##### /_\##### /_\ |+| #########
#### /_\ ##### /_\ |_| ##### ##### _ |_| ### ####
### ### ### ### |+| ___ ### /_\ ###
/_\ /_\ _ /_\ /_\ |_| /[O]\ ##### /_\
### ### |+| |___| ##### ###
##### ##### ' ' |_| ___ _ ### #####
##### ##### __ / \ ` ' _ |+| /_\ #####
### ### _ .' ,` /()\ |___| /-\ |_| ### ###
/_\ /_\ |+| .` | |____ |_| _ ##### /_\
### ### |_| '' |_ () \ _ `' ` |+| #####
#### ##### ,, |^|_____| |+| ___ , |_| ###
#### ##### , `` |_| /o o\ , ,., /_\ ###
### ### ,` ` |___| ,, #####
/_\ /_\ _ ' .` _ , _ #####
### |+| _ , |+| .., |+| ###
##### |_| _ |+| , |_| __ __ . |_| /_\
##### |+| |_| . `, /<>\ ____ /<>\ ` ###
### |_| , , ' | |____/O O\____| | ' _ ##### ###
/_\ '' ' |[]| [] | | [] |[]| , |+| ##### ####
### _ `` '' | | | __ | | | ,'. *|_| ### ### ####
##### ### / \ ` . * |__|____|/^^\|____|__| ,`` #####/_\ ###
# ########## _ |_| ' ',, ` ?, ##### /_\
## ### ##### |+| '` ` `' , ###
## /_\ ### |_| `` _ ` _ .. _ ` /_\ ###
# /_\ |+| . (o) ',',, (o) ``` _ ### #####
\ ### '` . |_| ` /-\ ., /-\ , |+| ##### #####
### ##### _ ,,, ` ` , , . |_| ##### ###
##### ##### |+| ` ,` , '' . ` ` ` . ### /_\
##### ### |_| _ _ ' .' _ ,'., ,, /_\ #
### /_\ . |+| ___ (o) . (o) .`. ___ ### ##
/_\ ### ` |_| /___\ /-\ '', /-\ ', , / \ ##### ##
##### ### , |___| , |___| ##### #
##### ##### , ___ _ . _ `,.,`. ### /
### #### ##### .`.` , , /---\ (o) ' (o) ' . /_\ ###
##### /_\ ### ', , |___| /-\ ,.` /-\ .. ___ _ #####
##### /_\ _ `, ','. , `. /<o>\ ` |+| #####
### ### |+| '' _ ___ . . ` |___| ` |_| ###
/_\ ##### |_| ' |+| / \ , , _ ... ### /_\
### ##### _ ', |_| |___| ', /-\ ', ,''`' #####
##### ### ___ |+| , |_| ` #####
##### /_\ _ / \ |_| '.` '` _ , ###
### /-\ |___| ,. ` ' ``', , |+| , ### /_\###
## /_\ ### |_| _ . _ ` _ |_| . ##### #####
### ##### , ___ |+| _ |+| . |+| ##### #####
### ##### ., / \ |_| ' |+| |_| . |_| , ### ###
## ### ., |___| _ ' |_| .`,` . /_\ /_\
_\ /_\ ### ', |+| ___ ' '. ``,..' '.`.``` ,`..`'' ,, ###
### ##### , |_| / \ `.`` ' ,..' ``'` .' ` , . ##### ###
##### ##### . , |___| ' _ _ ##########
##### ### '`` * ,` |+| |+| ### ### #####
### ### /_\ , ,' `` _ |_| |_| ### ##### /_\ ###
/_\##### '. '``, ,.. ``, |+| ##### ##### ### /_\
##### ### ### |_| ### ##### ### ##### ###
### ##### ##### ##### ### /_\ ##### #####
/_\ ##### ### ##### ### ### ##### /_\ ### #####
### ### ##### ### ### ### ### ##### ##### ### ### /_\ ### ###
##### /_\ ##### /_\ ##### ##### ##### ##### ##### ##### /_\ ### ### * #####/_\
##### ### ### ### ##### ##### ##### ### ### ### ##### ##### ##### #####
### ##### /_\ ##### ### ### ### ### /_\ ### /_\ ##### ### ### ##### ### ##### ### ###
/_\ ##### ### ##### /_\ ### /_\ ### /_\##### ##### ### ##### ### /_\ ##### ### ##### ### #####/_\
### ### ##### ### ##### ##### ##### ##### ##### ### ##### ### ##### /_\ ##### /_\ #####
### /_\ ##### ##### /_\ ##### ##### ### ### ### ##### /_\ ##### ##### ### ### ###
##### ##### ### ### ### /_\ /_\##### ### ### ##### /_\ /_\ /_\
##### ### /_\ /_\ /_\ ##### /_\ /_\ ### """,
# Autres monde (Niflheim = 4)
(78, 19, 3, 24, 90), # Midgard
# Maisons
(38, 21, 29, 15, 14), # Librairie
(70, 31, 30, 24, 19),
(71, 31, 30, 25, 19),
)
# * : (95, 30)
# * : (57, 31)
# * : (39, 60)
# * : (108, 67)
def niflheim_po(coords):
if coords == (88, 32): return [0, "Entoure de pierre tombales, de nombreux chemins serpentent. De lourd nuages fonces entretiennent une atmosphere pesante et une brume noiratres flotte dans l'air. Dans la penombre ambiante, une haute maison se detache, masse plus sombre encore que le reste, percee de fines fenetres et encadree de deux tours."]
def niflheim_npc(data, stat):
pass
h_29 = (r"""
|============================|
| [===][=--==/ \==-=-][===] |
| [=-=][===-/ \==--][--=] |
| [==-][=-=/ \-==][==-] |
| |
| * |
| [I] [I] [I] [I] |
| /|\ /|\ /|\ /|\ |
| |
| |
| [=--] [==-] [-=] [==-] |
| [-==] [--=] [==] [--=] |
| [===] [=-=] [==] [-==] |
| |
|=============|^|============|""",
(15, 14, 4, 38, 21)) # * : (5, 5)
def h_29_npc(data, stat):
coords = data[2], data[3]
spells_sale = ((0, 5), (1, 5), (2, 5), (3, 5), (4, 5))
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] == stat[9]:
stat[9] = data[0]
return [0, "Merath, je vend les sorts les plus puissants de tout l'Yggdrasil ! Quel sort voulez-vous ?\n1. Soin V\n2. Flammes V\n3. Givre V\n4. Etincelles V\n4. Fatigue V", 4]
else:
for i in range(1, 5):
if data[0] == stat[9] + i:
stat[9] = -1
if stat[1] < 50: return [-i, "Vous n'avez pas les moyens, desolee."]
spell_id = -1
for sp_id, sp in enumerate(stat[7]):
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)]
h_30 = (r"""
|======|----|=======| |=======|----|======|
| /______\ | | /______\ |
| | | |========| | | |
| |======| |======| |
| _ _ * |
| (_) (_) |
| __ __ * |_| |_| __ __ |
| | | | | | | | | |
| |__| |__| |__| |__| |
| | | | | _ _ | | | | |
| |__| |__| (_) (_) |__| |__| |
| |_| |_| |
| |
| __ __ |
| | | _ _ | | |
| |__| (_) (_) |__| |
| | | |_| |_| | | |
| |__| |__| |
| |========| |========| |
|=============| |^^| |=============|""",
(24, 19, 4, 70, 31),
(25, 19, 4, 71, 31)) # * : (37, 4) * : (17, 6)
def h_30_npc(data, stat):
pass

218
demo/svartalfheim.py Normal file
View File

@ -0,0 +1,218 @@
svartalfheim = (r"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~ __ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~ /<>\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __ ~~~~~~~~~~~~~~
~~~~~~~~~~~~~ ## |__| ## ## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /<>\ ~~~~~~~~~~~~~
~~~~~~~~~~~~ #### ## |__| #### ## #### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |__| ~~~~~~~~~~~
~~~~~~~~~~~ #### #### |__| #### #### #### ~~~~~~~~~~~~~~~~~~~~~~~~~ ## |__| ~~~~~~~~~~
~~~~~~~~~ ## #### ## #### ## /\ __ ## #### |__| ~~~~~~~~
~~~~~~~~ || ## ## || ## || / \ /\ /<>\ #### #### ## ## ~~~~~~~
~~~~~~~ ## || #### || /\ / \ /\ / \ |__| #### ## #### #### ~~~~~~
~~~~~~ #### ## #### ## ## / \ / \ \ /\ |__| ## || #### #### ## ~~~~~~
~~~~~ #### #### ## ## #### #### / \ /\ / /\ / \ |__| __ || __ ## ## #### ~~~~~
~~~~ ## ## #### #### || #### #### / \ / \ / \ ## /<>\ /<>\ || ## || #### ~~~~
~~~ #### || ## ## #### ## ## / \ /\ \ /\ #### |__|_____|__| #### ## ~~~
~~~ #### #### || ## ## || || /\_ / \ / \ #### |__|O _ O|__| ## #### ## || ~~~
~~~ ## #### || #### /\_ / \ / \ /\ \ ## ## |__|_|^|_|__| #### ## #### ~~~
~~~ || ## #### / \ / \ / \ || #### #### || #### ## ~~~
~~ ## || ## ## / \ /\ / \ /\ #### ~~~~~~ ## ## #### ~~~
~~ #### #### || /\ / \ ~~~~~ / \ ## ~~~~~~ || || #### ~~~~
~~ #### #### ## ## / \ \ /\ ~~~ / \ ## || ## ~~~~ ## ~~~ ## ~~~~~
~~ __ ## ## ## #### #### / \ /\ / \ ~~ #### #### #### ##~~~~ __ || ~~~~~~
~~ /<>\ || #### || #### #### /\_ /\ / \ /\ ~~~ #### #### ## ######## ~~~ /<>\ ~~~~~~~~~
~~ |__| #### ## ## / \ / \ \ / \ ~~~~ ## ## #### ## ## #### ~~~ |__| ~~~~~~~~~~~
~~~ |__| ## || ## || / \ /\/ \ /\ / \ /\ ~~~~~ || || #### #### || ## ~~ |__| ~~~~~~~~~~~
~~~~ |^_| || ## #### / \ / \ / \ ~~~~~~~ ## #### || ~~~ |__| ~~~~~~~~~~~~
~~~~~ #### #### /\ / \ /\/ \ / \ ~~~~~~~ || ## ~~~~~~ ~~~~~~~~~~~~~
~~~~~~~ ### #### ## / \ / \ ~ ~~~~~~ || ~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
~~~~~~~~ ##### ## || / \ /\ / \ /\ ~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~ ### || ### / \ / \ ~~~~ ~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~ /-\ ##### /\_ / \ /\ / \ /\ ~~~~~ __ |==|~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~ ### / \ / \ / \ ### ### /<>\___ | *|~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~ ### /-\ / \ / \ /\ / \ /\_ ##### ##### | <o>\ | | ~~~~~~~~~~~~~~~~~~
~~~~~~~~~~ ##### ### /\ / \ / \ ### ### |_ | ~~~~~~~~~~~~~~~~~~
~~~~~~~~~~ ### ##### ### / \ / \ /\ / \ ### /|\ /|\ |^|____| ~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~ /-\ ### ##### / \ /\ / \ ##### ### ~~~~~ ~~~~~~~~~
~~~~~~~~~~~~ ### /-\ ### / \ ~ / \ /\_ ### ### ##### ~~ ~~~~~~~~
~~~~~~~~~~~~ ### ##### /-\ /\_ / \ ~~~ / \ /|\ ##### ### ~~~~~~~
~~~~~~~~~~~~ ##### ### ### / \ ~~~ / \ ### /|\ ### ? ~~~~~~
~~~~~~~~~~~ ### /-\ ##### / \ /\_ ~~~ ### /|\ ##### ### __ ~~~~~
~~~~~~~~~~ /-\ ### / \ ~~~ ##### ### ##### /<>\ ~~~~~
~~~~~~~~~ ### /-\ /\_ / \ ~~ ### /|\ ### |__| ~~~~~~
~~~~ __ ##### / \ /\ ~~~~~~ /|\ ~~~~~~~~~ /|\ |__| ~~~~~~~
~~~ /<>\ ### ### /\ / \ /\_ / \ ~~~~~~~~~~~~~ ~~~~~~~~ |__| ~~~~~~~~~
~~~ |__| ### /-\ #####/ \ / \ /\ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~
~~~ |__| ##### ### /\ / \ / \ ### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~ |__| ### /-\ /\ / \ /\ /\ ##### ### ~~~~~~~~~~~~~~~~~~~~~
~~~~~~ /-\ _ __ / \ / \ /\ / \ ####### ##### * ~~~~~~~~~~~~~
~~~~~~~~~ / \ / \ /\ /\ / \ #|-|# ### ### ### __ ~~~~~~~~~~~~
~~~~~~~~~ ## |_| |__| / \ /\ / \ ### ### |_| ##### /-\ ### ##### /<>\ ~~~~|==|~~~
~~~~~~~~~~ #### ## / \ ## ##### ##### ####### ### ##### ### |__| ~~~~| *|~~~
~~~~~~~~~~~ * _ #### #### ####### ####### #|-|# ##### ### ### /-\ |__| ~~~~ | |~~~
~~~~~~~~~~~ ## __ / \ _ __ ## #|-|# #|-|# |_| ### ##### /-\ |__| ~~~~~~ ~~~
~~~~~~~~~~ #### / \ |_| / \ / \ #### |_| |_| ### /-\ ### ~~~~~~~ ~~~
~~~~~~~ ## |__| ## |_| |__| ##### /-\ ### ~~~~~~~~~~~ ~~~
~~~~~~ #### * #### ####### ##### ~~~~~~~~~~~~ ~~~
~~~~ _ __ ## ___________________ #|-|# ### ~~~~~~~~~~~~ ~~~
~~~ ## __ / \ / \ #### /_|]O[|_|]O[|_|]O[|_\ |_| ### ### /-\ ~~~~~~~~~~ ### ~~~
~~~ __ #### / \ |_| |__| /_____________________\ ##### ##### __ ~~~~~~~~~ ##### ~~~~
~~ /<>\ |__| __ |_/___\_/___\_/___\_| ####### ### /<>\ ~~~~~~~~~~ ### ~~~~~
~~~ |__| / \ |_| |_|/^\|_| |_| #|-|# /-\ |__| ~~~~~~~~~~ /-\ ~~~~~
~~~ |__| __ |__| |_| ### |__| ~~~~~~~ ### ~~~~~
~~~~~ |__| ## ## * / \ _ ##### ### |__| ~~~~~~ ##### ~~~~~
~~~~~~~ #### #### |__| ## ### / \ ### ### ##### ~~~~~~~ ### ### ~~~~~
~~~~~~~~~~~~~ #### ##### |_| ##### /-\ ### ~~~~~~~~~~ /-\ ##### ~~~~
~~~~~~~~~~~~~~~ ## ####### ####### /-\ ~~~~~~~~~~ _ ### ~~~
~~~~~~~~~~~~~~~~~ #### __ #|-|# ### __ #|-|# ### ~~~~~~~~~~ /-\ /-\ ~~
~~~~~~~~~~~~~~~~~ /<>\ |_| ##### /<>\ |_| ##### ~~~~~~~~~~~ |_| ~~
~~~~~~~~~~~~~~~~~~ |__| ####### ### |__| ####### ~~~~~~~~~~~~ ### ~~
~~~~~~~~~~~~~~~~~~~~~~ |__| ~~~~ #|-|# ##### |__| #|-|# ~~~~~~~~~~~~ ##### * ~~
~~~~~~~~~~~~~~~~~~~~~~~~ |__| ~~~~~~ |_| ####### |__| ~~~ |_| ~~~~~~~~~~~ ### ### ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ #|-|# ~~~~~~~~~ ~~~~~~~~~~~~~ ##### /-\ ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ |_| ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ ### ~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ /-\ ~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
# Autres mondes (Svartalfheim = 8)
(109, 66, 6, 39, 19), # Nidavellir
# Maisons
(90, 15, 45, 24, 19), # Manoir au Nord
( 6, 24, 46, 9, 9), # Tour de guet
(91, 33, 47, 1, 14), # Mesnie à côté du quai
(57, 59, 48, 19, 14), # Palais des Elfes noirs
)
# * : (105; 46)
# * : (22; 50)
# * : (15; 54)
# * : (25; 61)
# * : (121; 68)
def svartalfheim_po(coords):
if coords == (113, 37): return [0, "Des tours de guets parsement la cote, plus loin, a l'ouest, une chaine de petites montagnes s'etend, coupant Svartalfheim en deux. Mais la partie est du monde est plus habitee et plus animee que la partie ouest qui reste majoritairement consitituee de denses forets."]
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 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"]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 2: return [-1, "Reviens quand tu auras de quoi me payer."]
if coords == (104, 30): data[2], data[3] = 119, 49
else: data[2], data[3] = 103, 30
return [-1, "C'est parti !", 0, (1, -2)]
elif data[0] == stat[9] + 2:
stat[9] = -1
return [0, "Reviens quand tu voudras traverser."]
h_45 = (r"""
|=================| |==================|
| | | |
| |===========| |
| __ * __ |
| | | | | |
| |__| [O] [O] |__| |
| | | |_| |_| | | |
| |__| |__| |
| |
| [O] [O] |
| __ |_| |_| __ |
| | | | | |
| |__| |__| |
| | | [O] [O] | | |
| |__| |_| |_| |__| |
| |
| |====| |====| |
|=================| | | |==================|
|^| """,
(24, 19, 4, 90, 15)) # * : (15, 4)
def h_45_npc(data, stat):
pass
h_46 = (r"""
|===||=============|
| /__\ |
| |==| *+--+ |
| | | |
| *| | |
| | | |
| +--+ |
| |
| |
|=======|^|========|""",
(9, 9, 4, 6, 24),
) # * : (13, 2) * : (13, 4)
def h_46_npc(data, stat):
pass
h_47 = (r"""
|=========|
| [-=-==] |
| [===--] |
| |
| * |==================|
| |
| __ __ |
| | | | | |
| *|__| |__| |
| | | | | |
| |__| |__| |
| | | | | |
| |__| |__| |
| |
|^|==========================|""",
(1, 14, 4, 91, 33)) # * : (3, 4) * : (15, 8)
def h_47_npc(data, stat):
pass
h_48 = (r"""
|======================================|
| |
| |
| ~~~~ |
| __ ~~(~~)~~ __ |
| | | ~(______)~ | |* |
| |__| (__________) *|__| |
| | | | | |
| |__| |__| |
| |
| |
| |
| \__/ \__/ \__/ \__/ |
|==| |======| |=| |=| |======| |==|
| | | | |^=| | | | | """,
(19, 14, 4, 57, 59)) # * : (34, 5) * : (29, 6)
def h_48_npc(data, stat):
pass

157
demo/vanaheim.py Normal file
View File

@ -0,0 +1,157 @@
vanaheim = (r"""
/ \ / \ /\ / \ / \ /\ /
/\ / \ / \ / \ /\ / \ / \ / \ /
/ \ / \ /\ / \ / \ / \ / /\ / \
/ \ /\ / \ / /\ / \ / \ / \
/\ / \ / \ / \ / \ / /\ \ /\/ \
/ \ / \ / \ /\ / \ / \ / \ /\ /
/ \ / \ / \ / / \ / / \ /\ /\ /
/ \ /\ /\ / \ / \ / \/ \ / \ /
/ \ / \ / \ _ / / \ \ /\ /
/\ / \ / \ / \_ / / \
/ \ / \ /\ / \ __ |_ o\ /\ / \
/ \ / \ _ /<>\ |^|_| / \
/ \ /\ / \ /o\ * |__| / \ /\
/ \ / \ |_| _ / \ / \
/\ / \ /\ ### . ###### ###### /o\ /\ /
\ / / \ ##### ### ###### ###### |_| / \ /
\ /\ / \ ### '. ##### ##### ##### / \ /\
\ / \ / \ /|\ ` ### #### #### ### / \ / \
/ \ __ /|\ ##### /\ / \
/\ / \ /\ / \ .`' #### #### ### / \ /
/ \ / \ |__| #####? ##### /|\ / \
\ / \ ,' . `` ###### ###### / \ /\
\ /\ / \ /\ '`'., ###### ###### * ### / \
/ \ / \ ### ``' ##### / \ /
/\ / \ / \ ##### _ __ ### /\ / \ /
\ / \ /\ / ### / \ ' /<>\ ` /|\ / \ /
\ / \ /|\ |_| . |__| .' / \ /\ /
\ /\ / \ ` ``' ### , _ / \ / \
/ \ / \ /\ _ ##### ', /o\ / \
/ \ / \ . / \ ### , |_| /\ \ /
/ \ /\ / \ |_| /|\ , * ` / \ /
/ \ / \ ,. _ ',` '' / \ /\
/ \ ### _/ \ ### _____ ' / \ / \
/ \ /\ ##### /o | ##### /_____\ `' /\ / \
/\ / \ ### `'.|___| ### |<>_<>| / \ /
/ \ / \ /|\ '',., /|\ |_|^|_| , / \
/ \ /\ / \ __ `,'.``` .', .``' ` / \ /\
/ \ / \ /<>\ ### ,,.' / \
/ \ |__| ##### ### / \
/\ / \ /\ ' ### * ##### /\ \
/ \ / \ ` /|\ _ ### _ / \
/ \ / \ /\ .. /o\ ./|\ /o\ / \ /\
/ \ /\ / \ / \ .'' |_| ,'`' ',` |_| /\ / \ /
/ \ / \ ,., .,`, /\ ', ,` / \ /
/\ / \ /\ / \ /\ / \ / \ /\ /
/ \ / \ / \ / \ /\ / \ /\ / \ / \
/ \ / \ / \ / \ /\ / / \ /\ / \
/ \ / \ /\ / / \ / \ / \ / \ / \
/ \ / / \ / / \
/ \ / \ / \ """,
# Autres mondes (Vanaheim = 1)
(28, 13, 2, 14, 68), # Alfheim
(54, 29, 3, 10, 58), # Midgard
(56, 42, 5, 11, 120), # Jotunheim
# Maisons
(44, 11, 21, 5, 9), # Auberge
(52, 35, 22, 20, 19),
)
# * : (31; 12)
# * : (52; 22)
# * : (52; 30)
# * : (45; 39)
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 !"],
}
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."]
h_21 = (r"""
|=======================|
| * | |
| |-------------|
| |
| +--+ +--+ +--+ |
| | | | | | | |
| +--+ +--+ +--+* |
| |
| |
|===|^|=================|""",
(5, 9, 1, 44, 11)) # * : (8, 1) * : (21, 6)
def h_21_npc(data, stat):
coords = data[2], data[3]
if coords == (8, 1):
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Cher client bonjour ! Que puis-je faire pour vous ?\n1. Manger [5 PO]\n2. Boire [2 PO]\n3. Dormir [10 PO]", 3]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Tsst, quand on ne peut pas payer, on ne rentre pas."]
return [-1, "Et un plat chaud, un ! [VOUS VOUS ASSEYEZ DEVANT UN TRANCHOIR DE PAIN ET UNE ASSIETTE DE SOUPE EPAISSE.]", 0, (0, 5), (1, -5)]
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)]
elif data[0] == stat[9] + 3:
stat[9] = -1
if stat[1] < 10: return [-3, "Allez donc voir ailleurs."]
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."]
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"]

View File

@ -79,7 +79,7 @@ alfheim = (r"""
# Maisons
(34, 16, 23, 25, 19),
(52, 31, 24, 20, 19), # Armurerie
(52, 31, 24, 20, 19), # Librairie
)
# * : (11; 4)
@ -151,4 +151,58 @@ h_24 = (r"""
(20, 19, 2, 52, 31)) # * : (12, 3) * : (36, 12)
def h_24_npc(data, stat):
pass
coords = data[2], data[3]
xp = data[0]
spells = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
levels = ("I", "II", "III", "IV", "V")
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] == stat[9]:
stat[9] = data[0]
return [0, "Quel sort souhaitez-vous oublier ?\n" + "\n".join(["{0}. {1} {2}".format(nb + 1, spells[nb], levels[lvl - 1]) for nb, (name, lvl) in enumerate(stat[7])]), len(stat[7])]
else:
for i in range(1, len(stat[7]) + 1):
if data[0] == stat[9] + i:
stat[9] = -1
stat[7].pop(i - 1)
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 !"]
if coords == (36, 12):
spells_sale = ((0, 2), (1, 2), (2, 4), (4, 1))
if len(stat[7]) >= 3: return [0, "Je suis desolé, vous ne pouvez pas apprendre plus de trois sorts."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Diomwar, pour vous servir. Quel sort voulez-vous acheter ?\n1. Soin II\n2. Flammes II\n3. Givre IV\n4. Fatigue I", 4]
else:
for i in range(1, 5):
if data[0] == stat[9] + i:
stat[9] = -1
if stat[1] < spells_sale[i - 1][1] * 10: return [-i, "Vous n'avez pas les moyens, desole."]
spell_id = -1
for sp_id, sp in enumerate(stat[7]):
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, "[DIOMWAR OUVRIT UN LIVRE RELIE DE CUIR NOIR, L'OUVRIT ET TRACA DU DOIGT DES SIGNES CABALISTIQUES SUR LE SOL. LES RUNES BRILLERENT PUISSAMMENT AVANT DE S'ETEINDRE.]", 0, (1, -spells_sale[i - 1][1] * 10)]

View File

@ -106,7 +106,7 @@ class Asci:
if key in (1, 3, 5, 2):
cell_test = self._cell_test(key)
# Enter house
# Change map
if cell_test == len(self.legend) - 2: # or (self.data[1] and cell_test < 0):
self.data[1], self.data[2], self.data[3] = self._get_map(key)
self.screen.set_world(self.maps[self.data[1]].map_data)
@ -140,9 +140,13 @@ class Asci:
# data modification
self.data[0] = data_copy[0]
self.data[1] = data_copy[1]
if data_copy[2] != x: self.data[2] = data_copy[2]
if data_copy[3] != y: self.data[3] = data_copy[3]
if self.data[1] != data_copy[1]:
self.data[1] = data_copy[1]
self.screen.set_world(self.maps[self.data[1]].map_data)
self.map_width, self.map_height = self.screen.get_map_size()
if data_copy[2] != x: self.data[2] = data_copy[2] - 10
if data_copy[3] != y: self.data[3] = data_copy[3] - 3
if not event: return
event = read_event(self.data[0], event)
@ -155,7 +159,9 @@ class Asci:
# Display and get answer
if event.text:
answer_selected = convert(self.screen.display_text(event.text), True)
if event.answer and (0 < answer_selected <= event.answer): self.data[0] += answer_selected
if event.answer and (0 < answer_selected <= event.answer):
self.data[0] += answer_selected
self._interaction(direction, cell_content)
def _get_map(self, direction):
current_coords = self._looked_case(direction)
@ -265,6 +271,7 @@ def read_event(xp, event):
def print_text(text):
for i in text_formater(text):
if not i: continue
print("\n" * 7)
print(i)
input()

View File

@ -194,7 +194,6 @@ def h_10_npc(data, stat):
coords = data[2], data[3]
xp = data[0]
print(coords)
if coords == (25, 11):
if xp == 0:
stat[3][0] = 1
@ -203,7 +202,7 @@ def h_10_npc(data, stat):
else: return {
"base": [0, "Je suis Odin, Roi des Ases, dieux de la Guerre."],
1: [0, "Deja revenu !?"],
3: [1, "Bien. Tu peux garder la dague, une guerre se prepare, ce serait bete de mourrir deux fois quand meme ? [UN SOURIRE PASSA SUR LES LEVRES D'ODIN] Jadis Freyja m'enseigna la magie et l'astrologie. [ODIN SE FIT PENSIF]. Je te ferais savoir mes instructions en temps voulu. Je crois qu'il te reste quelques mondes a decouvrir."]
3: [1, "Bon travail. Tu peux garder la dague, une guerre se prepare, ce serait bete de mourrir deux fois quand meme ? [UN SOURIRE PASSA SUR LES LEVRES D'ODIN] Jadis Freyja m'enseigna la magie et l'astrologie. [ODIN SE FIT PENSIF. IL SE RETROURNA VERS VOUS BRUTALEMENT] Je te ferais savoir mes instructions en temps voulu. Je crois qu'il te reste quelques mondes a decouvrir."]
}

View File

@ -27,11 +27,11 @@ maps = (
h_21, h_22,
h_23, h_24,
h_25, h_26, h_27, h_28,
h_29, h_30,)
# h_31, h_32, h_33, h_34, h_35, h_36,
# h_37, h_38, h_39, h_40, h_41,
# h_42, h_43, h_44,
# h_45, h_46, h_47, h_48)
h_29, h_30,
h_31, h_32, h_33, h_34, h_35, h_36,
h_37, h_38, h_39, h_40, h_41,
h_42, h_43, h_44,
h_45, h_46, h_47, h_48)
# Asci functions
def npc(data, stat):
@ -49,11 +49,11 @@ def npc(data, stat):
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)
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)
event = npc_data[data[1]](data, stat)
@ -122,10 +122,6 @@ def routine(data, stat):
if stat[2][4] < stat[0] // 2 and not (stat[4] % 60):
stat[2][4] += 1
# Leave dialogue
if stat[6][0] != -1 and stat[4] - stat[6][0] >= 2:
stat[6] = (-1, -1)
# Game mecanics
def fight(stat, opponent_stat, opponent_name):
@ -147,7 +143,7 @@ def fight(stat, opponent_stat, opponent_name):
msg += "\n{0} perd {1} PV.".format(opponent_name, damage)
elif choice == 2:
if len(stat[8]) == 0:
if len(stat[7]) == 0:
msg += "\nVous ne connaissez pas de sort."
else:
spell_data = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
@ -157,37 +153,37 @@ def fight(stat, opponent_stat, opponent_name):
while not spell_choice:
print("\n" * 6 + "Sort(s) connu(s) :")
count = 0
for spell_id, level in stat[8]:
for spell_id, level in stat[7]:
print("{0}. {1} {2}".format(count + 1, spell_data[spell_id], spell_level[level - 1]))
count += 1
spell_choice = get_input()
if spell_choice < 0 or spell_choice > 3: spell_choice = 0
spell_choice -= 1
name, level = spell_data[stat[8][spell_choice][0]], stat[8][spell_choice][1]
name, level = spell_data[stat[7][spell_choice][0]], stat[7][spell_choice][1]
if stat[2][4] >= level * 10:
msg += "\nVous lancez {0} de niveau {1} [-{2} PM].".format(name, spell_level[level - 1], level * 10)
stat[2][4] -= level * 10
pts = 12 * level + randint(-5, 5)
if stat[8][spell_choice][0] == 0:
if stat[7][spell_choice][0] == 0:
stat[0] += pts
msg += "\nVous gagnez {} PV".format(pts)
elif stat[8][spell_choice][0] == 1:
elif stat[7][spell_choice][0] == 1:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[8][spell_choice][0] == 2:
elif stat[7][spell_choice][0] == 2:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[8][spell_choice][0] == 3:
elif stat[7][spell_choice][0] == 3:
opponent_stat[4] -= pts
msg += "\n{0} perd {1} PV".format(opponent_name, pts)
elif stat[8][spell_choice][0] == 4:
elif stat[7][spell_choice][0] == 4:
opponent_stat[0] -= pts
msg += "\n{0} perd {1} points de vitesse".format(opponent_name, 12 * level)
@ -220,9 +216,9 @@ def fight(stat, opponent_stat, opponent_name):
# opponent_stat = [vitesse, agilité, attaque, défense, vie]
# player_stat = [vitesse, agilité, attaque, défense]
player_stat = [stat[2][0], stat[2][1], stat[2][2] + stat[3][0] * 10, stat[2][3] + stat[3][1] * 10]
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, 0
player = opponent = 0
end = False
while not end:
@ -279,7 +275,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]]
else: place = "interieur"
money, ticks, player_class = stat[1], stat[4], stat[7]
money, ticks, player_class = stat[1], stat[4], stat[6]
hours = ticks // 60
if 4 <= hours <= 5:
@ -361,8 +357,8 @@ def spell(data, stat):
print(" |" + to_disp + " " * (16 - len(to_disp)) + "|")
for i in range(3):
if i < len(stat[8]):
spell_id, level = stat[8][i]
if i < len(stat[7]):
spell_id, level = stat[7][i]
if spell_id >= 0:
to_disp = "{0} {1}".format(spell_data[spell_id], spell_level[level - 1])
print(" |" + to_disp + " " * (16 - len(to_disp)) + "|")
@ -378,7 +374,7 @@ keys = {4: display_stat, 7: spell, 8:misc_stat, 6: inventory, 9: sleep}
# Main function
def idk(stat=None, data=None):
# stat = [0 - PV, 1 - pièces d'or, 2 - [vitesse, agilité, attaque, defense, magie], 3 - [arme, armure], 4 - ticks, 5 - nom, 6 - (temps, xp), 7 - classe, 8 - sorts connus : (id, level), 9 - sous-quête en cours]
# 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ête en cours]
if not stat:
name = ""
while len(name) == 0 or len(name) > 13:
@ -401,20 +397,36 @@ def idk(stat=None, data=None):
elif player_class == 5:
stat = [10, 5, 5, 5, 5]
stat = [100, 10, stat, [0, 0], 360, name, (-1, -1), player_class - 1, [], 0]
stat = [100, 10, stat, [0, 0], 360, name, player_class - 1, [], 0, -1]
if player_class == 4:
stat[8].append((1, 1))
stat[7].append((1, 1))
data = [0, 3, 44, 66]
print_text("Au alentour du Ve siecle, quelque part en Scandinavie. La bataille prenait place dans un champ saccage, et la nuit etait tombe depuis quelques heures lorsque l'assaut debuta.")
print_text("Hache levee, a la seule lueur des torches, {0} et sa division se jeterent sur le camp adverse, mais, pris a revers, le combat tourna vite a la defaveur des assaillants qui furent reduit sans autres difficultes.".format(name))
print_text("Au alentour du Ve siecle, quelque part en Scandinavie. La bataille prenait place dans un champ saccage, et la nuit etait tombee depuis quelques heures lorsque l'assaut debuta.")
print_text("Hache levee, a la seule lueur de la pleine lune, {0} et sa division se jeterent sur le camp adverse, mais, pris a revers, le combat tourna vite a la defaveur des assaillants qui furent reduit sans autres difficultes.".format(name))
print_text("Blesse a plusieurs endroit, {0} se trainait sur le sol, tentant de se refugier dans la nuit lorsqu'une forme humaine portant un espadon dans le dos et une lourde armure d'argent s'arreta devant lui. La Valkyrie prit {0} dans ses bras. Une lueur aveuglante le forca a fermer les yeux et Vahalla lui apparu.".format(name))
print_text("Mais Odin avait d'autres plan pour {0} qu'une retraite parmi les meilleurs guerriers, et il le renvoya dans le vaste monde avec cet ultimatum : si il trouve la voie jusqu'a Asgard et le Valaskjalf, Odin conscent a le garder a son service, sinon il sera condamne a errer dans le monde sans jamais trouver le repos.".format(name))
else:
stat.append(-1)
# Money check
if stat[1] < 0: stat[1] = 0
if stat[1] > 100000: stat[1] = 100000
# Stat check
for i in range(len(stat[2])):
if stat[2][i] > 50: stat[2][i] = 50
if stat[2][i] < 0: stat[2][i] = 0
# Player's class check
if not (0 <= stat[6] <= 5):
raise ValueError("unknown player's class")
idk_game = Asci(maps, events, keys)
stat, data = idk_game.mainloop(100, stat, data, routine=routine, door="^_", walkable=".,`' ", exit_key="q")
print("idk({0}, {1})".format(stat, data))
print("idk({0}, {1})".format(stat[:-1], data))
# Misc function

View File

@ -132,9 +132,9 @@ jotunheim = (r"""
(88, 25, 32, 14, 24),
(89, 45, 33, 30, 24),
(60, 50, 34, 34, 29), # Palais de Thrym
(64, 85, 35, 0, 0), # Manoir du sud (1/2)
(65, 85, 35, 0, 0), # Manoir du sud (2/2)
(23, 88, 36, 0, 0), # Auberge
(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
)
# * : (25; 10)
@ -292,4 +292,84 @@ h_34 = (r"""
(34, 29, 5, 60, 50)) # * : (26, 6)
def h_34_npc(data, stat):
pass
pass
h_35 = (r"""
|================================================|
|==|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|=|/\|==|
| |
| _ _ |
| ### (~) (~) ### |
| ##### * |=| |=| ##### |
| ### ### |
| |=| |=| |
| ### _ _ ### |
| ##### (~) (~) ##### |
| ### |=| |=| ### |
| |=| |=| |
| ### ### |
| ##### _ _ ##### |
| ### (~) (~) ### |
| |=| |=| |=| |=| |
| |
| |
|======================\ /======================|
|==|/\|=|/\|=|/\|=|/\|=/^^\=|/\|=|/\|=|/\|=|/\|==|""",
(24, 19, 5, 0, 0),
(25, 19, 5, 0, 0)) # * : (17, 5)
def h_35_npc(data, stat):
pass
h_36 = (r"""
|======================================|
| |
| _ _ _ _ |
| (_) *(_) (_) (_) |
| |_| |_| |_| |_| |
| |
| |
|=================| |====== =======|
| | | [I] [I] |
| +---+ +---+ | | /|\ /|\ |
| | | | | | * |
| | | | | | |
| +---+ * +---+ | | [====] [====] |
| | | [====] [====] |
|=================|^^|=================|""",
(19, 14, 5, 23, 88),
(20, 14, 5, 23, 88)) # * : (11, 3) * : (27, 10) * : (9, 12)
def h_36_npc(data, stat):
coords = data[2], data[3]
if coords == (27, 10):
if not (300 <= stat[4] <= 1380): return [0, "Je suis desole, nous somme ferme la nuit."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Vous voulez quelque-chose ?\n1. Je mangerai bien un truc [-4 PO]\n2. Il vous reste une chambre ? [-12 PO]", 2]
if data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 4: return [-1, "Reviens quand tu auras de quoi me payer."]
return [-1, "Et voila ! [LE TAVERNIER POSA UNE ASSIETTE FUMANTE DEVANT VOUS ET UN VERRE DE VIN]", 0, (0, 5), (1, -4)]
if data[0] == stat[9] + 2:
stat[9] = -1
if 360 < stat[4] < 1140: return [-2, "Il est trop tot, reviens vers 19h."]
elif stat[1] < 12: return [-2, "Tu n'as pas assez."]
stat[4] = 360
return [-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)]

View File

@ -129,20 +129,20 @@ def midgard_npc(data, stat):
xp = data[0]
if coords == (8, 59):
if stat[9] == 1: return {
if stat[8] == 1: return {
7: [0, "En clair, j'aimerais que tu elimines Gardim. La paye sera bonne."],
8: [1, "C'est un grand service que tu m'a rendu l'ami, je ne l'oublierai pas ! [+10 PO] Un courrier est passe, je crois qu'Odin requiert ta presence au plus vite.", 0, (1, 10), (9, -1)]
8: [1, "C'est un grand service que tu m'a rendu l'ami, je ne l'oublierai pas ! [+5 PO] Un courrier est passe, je crois qu'Odin requiert ta presence au plus vite.", 0, (1, 5), (8, -1)]
}
else: return {
"base": [0, "Laard, je suis marin de mon etat."],
4: [0, "Laard, marin. Vous cherchez un engagement ?\n1. Hmm ? Proposez toujours ?\n2. Désolé, j'ai d'autres affaires a regler.", 2],
5: [2, "Voila, il y a quelques temps j'ai embarque dans un navire. Malheureusement, Njord ne nous a pas ete favorable : la tempete nous a surpris. La situation a bord est devenue tendue, nous nous sommes mutines. En represailles, Gardim, le capitaine, a fait passer quelques matelots par dessus bord. J'ai jure de les venger, mais je ne connais rien aux armes. Tu peux t'en charger pour moi ?", 0, (9, 1)],
5: [2, "Voila, il y a quelques temps j'ai embarque dans un navire. Malheureusement, Njord ne nous a pas ete favorable et la tempete fut rude. La situation a bord est devenue tendue, nous nous sommes mutines. En represailles, Gardim, le capitaine, a fait passer quelques matelots par dessus bord. J'ai jure de les venger, mais je ne connais rien aux armes. Tu peux t'en charger pour moi ?", 0, (8, 1)],
6: [-2, "Je comprends."],
}
elif coords == (94, 85):
if stat[9] == 1:
if stat[8] == 1:
if xp < 7:
return [0, "Gardim, capitaine du Mantree [IL DESIGNA UN DRAKKAR]"]
elif xp == 7:
@ -153,9 +153,9 @@ def midgard_npc(data, stat):
elif coords == (51, 60):
return {
0: [0, "Vous cherchez quelque chose ?\n1. Oui : Asgard.\n2. Je cherche Vanaheim.\n3. Non, tout va bien, merci.", 3],
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 regardez du cote de la petite maison tout a l'ouest ? Un bon ami a moi, Laard est souvent a cote."],
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 !"],
}
@ -219,17 +219,17 @@ def h_26_npc(data, stat):
if coords == (27, 6):
if stat[4] >= 1320 or stat[4] <= 340: return [0, "Je suis desolee, nous sommes fermes. Revenez plus tard !"]
if stat[6][1] == -1:
stat[6] = stat[4], data[0]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Rosahil Green, tenanciere de cette auberge. Vous desirez quelque chose ?\n1.De quoi manger s'il vous plait. [-5 PO]\n2.Je voudrais une chambre pour la nuit. [-10 PO]", 2]
elif data[0] == stat[6][1] + 1:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Reviens quand tu auras assez de pieces d'or."]
return [-1, "Et voila pour vous ! [ROSAHIL POSA UNE ASSIETTE DE RAGOUT CHAUD DEVANT VOUS.]", 0, (0, 5), (1, -5)]
elif data[0] == stat[6][1] + 2:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 2:
stat[9] = -1
if stat[1] < 10: return [-2, "Je suis desolee, tu n'as pas assez !"]
elif 360 < stat[4] < 1140: return [-2, "Il est trop tot, reviens vers 19h."]
else:
@ -237,16 +237,16 @@ def h_26_npc(data, stat):
return [-2, "Suivez-moi, je vais vous montrer votre chambre. [VOUS SUIVEZ ROSAHIL DANS L'AUBERGE, LA NUIT PASSA.]", 0, (0, 10), (1, -10)]
elif coords == (17, 7):
if stat[9] == 2: return {
if stat[8] == 2: return {
7: [0, "Aller, file !"],
8: [1, "Merci de ton aide, voila quelques pieces. [+5 PO], un messager est passe, Odin te demande.", 0, (1, 5)],
8: [1, "Merci de ton aide, voila quelques pieces. [+10 PO], un messager est passe, Odin te demande.", 0, (1, 10), (8, -2)],
}
else: return {
"base": [0, "Ui hips ?"]
4: [0, "Hey toi ! J'ai besoin de toi.\n1. Vous devez vous tromper, bonne journee.\n2. Je vous ecoute.", 2],
"base": [0, "Ui hips ?"],
4: [0, "Hey toi ! J'ai besoin de toi.\n1. Je ne crois pas, bonne journee.\n2. Je vous ecoute.", 2],
5: [-1, "Tu ne sais pas ce que tu rates l'ami."],
6: [1, "Bien. Tu vas aller au sud ouest, au fond d'un bois, il y a trois maisons. Je sais que l'une d'elle mene a Niflheim. Trouve un esprit du nom d'Asufaih et donne-lui ce mot. [L'HOMME VOUS DONNE UNE LETTRE CACHETEE D'UN SCEAU DE CIRE NOIRE.].", 0, (9, 2)],
6: [1, "Bien. Tu vas aller au sud ouest, au fond d'un bois, il y a trois maisons. Je sais que l'une d'elle mene a Niflheim. Trouve un esprit du nom d'Asufaih et donne-lui ce mot. [L'HOMME VOUS DONNE UNE LETTRE CACHETEE D'UN SCEAU DE CIRE NOIRE.].", 0, (8, 2)],
}

View File

@ -40,12 +40,12 @@ muspellheim = (r"""
|=| ### |=| ### . ' . |=| ### .,` ### ~~~~~~
### |=| , ### ##### `` ' |=| , . ### ##### ~~~~~~
##### , ##### ### ##### ,,' ##### ### ##### ~~~~~~~
# ########## .,` ##### ##### ### `. , ` .,'. ##### ##### ### ~~~~~~~~~
####### ### ` ` . ` ### ##### |=| ` , , ,` , ` ### ##### |=| ~~~~~~~~~
##### |=| ' |=| ### . ' ' `' `' |=| ### ~~~~~~~~~
### ., |=| , . .' '' ., |=| ### ~~~~~~~~~
|=| .` . ### ##### ~~~~~~~~~
,, '' '` `,.` , ' '` ` ..` ##### ### ~~~~~~~~~
##### .,` ##### ##### ### `. , ` .,'. ##### ##### ### ~~~~~~~~~
### ` ` . ` ### ##### |=| ` , , ,` , ` ### ##### |=| ~~~~~~~~~
|=| ' |=| ### . ' ' `' `' |=| ### ~~~~~~~~~
### ., |=| , . .' '' ., |=| ### ~~~~~~~~~
##### .` . ### ##### ~~~~~~~~~
|=| ,, '' '` `,.` , ' '` ` ..` ##### ### ~~~~~~~~~
### .'. .'` ' ,`,, ' , `'.. ### ### /_\ ~~~~~~~~~
##### ### ` .'' ... `' . '` ### `,, /_\ ##### ~~~~~~~~
/\ ### ##### ### .` ` ##### ',' . ### ~~~~~~~~
@ -123,10 +123,10 @@ muspellheim = (r"""
(92, 9, 6, 9, 57), # Nidavellir
# Maisons
(87, 14, 42, 0, 0), # Auberge
(47, 53, 43, 0, 0), # Armurerie
(67, 89, 44, 0, 0),
(68, 89, 44, 0, 0),
(87, 14, 42, 16, 14), # Auberge
(47, 53, 43, 32, 14), # Armurerie
(67, 89, 44, 24, 24),
(68, 89, 44, 25, 24),
)
# * : (20, 12)
@ -141,4 +141,147 @@ def muspellheim_po(coords):
elif coords == (64, 97): return [0, "La cloture de la propriete etait ouvragee, le manoir aussi. Constitue d'un corps de ferme rehabilite et entoure de deux tours decoratives, l'ensemble conservait un air propre et entretenu. Le jardin taille en temoigne."]
def muspellheim_npc(data, stat):
pass
pass
h_42 = (r"""
|===================|
| * |
|--[]---------------|
| |
| |
| * |=============|
| |
| * |
| +------+ +------+ +------+ |
| | | | | | |* |
| | | | | | | |
| *+------+ +------+ +------+ |
| |
| |
|==============|^|================|""",
(16, 14, 7, 87, 14)) # * : (11, 5) * : (6, 7) * : (31, 9) * : (2, 11)
def h_42_npc(data, stat):
coords = data[2], data[3]
if coords == (6, 7):
if not (300 <= stat[4] <= 1380): return [0, "Nous sommes ouverts de 5 a 23 heures."]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Besoin de quelque chose messire ?\n1. Hum, oui, j'aimerais manger. [-5 PO]\n2. Je voudrais dormir [-10 PO]", 2]
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Je regrette, vous n'avez pas assez."]
return [-1, "Et voila pour vous !", 0, (0, 5), (1, -5)]
elif data[0] == stat[9] + 2:
stat[9] = -1
if stat[1] < 10: return [-2, "Nous ne pouvons pas nous permettre de faire credit."]
stat[4] = 360
return [-2, "Bien sur, si vous voulez bien me suivre. [VOUS VOUS ALLONGEZ SUR LE LIT ET VOUS ENDORMEZ RAPIDEMENT.]", 0, (0, 10), (1, -10)]
h_43 = (r"""
|====|--|============|--|=========|
|====|--|============|--|=========|
| /____\ /____\ |
| |====| |====| |
| * |
| * |
| +----+ +----+ +----+ |
| | | | | | | |
| +----+ +----+ +----+ |
| * |
|=============================| |
|=============================| |
| |
| |
|[^]|""",
(32, 14, 7, 47, 53)) # * : (24, 4) * : (6, 5) * : (13, 9)
def h_43_npc(data, stat):
coords = data[2], data[3]
if not (480 <= stat[4] <= 1140): return [0, "L'armurerie est ouverte de 8 heures a 18 heures."]
if coords == (24, 4):
if stat[3][1]: return [0, "Vous portez deja une armure, allez voir mon confrere."]
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]"]
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)]
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] == stat[9]:
stat[9] = data[0]
return [0, "Vous voulez vendre votre piece d'armure ?\n1. Oui\n2. Non", 2]
elif data[0] == 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] == stat[9] + 2:
stat[9] = -1
return [-2, "Revenez quand vous voulez !"]
elif coords == (6, 5):
return [0, "Je ne suis qu'apprenti monseigneur. Adressez-vous plutot a Bertfrid."]
h_44 = (r"""
|==|==|==|==|==|==|==|==|==|==|==|
| |
| * ### ### |
| ##### ##### |
| ### ### |
| ### |_| |_| ### |
| ##### ##### |
| ### ### |
| |_| |_| |
| |
|=|/\|==|/\|=|/\|=| |=|/\|=|/\|==|/\|=|
|=|\/|==|\/|=|\/|=| |=|\/|=|\/|==|\/|=|
| |
| ___ ___ ___ ___ |
| | | | | | | | | |
| |___| |___| |___| |___| |
| | | | | | | | | |
| |___| |___| |___| |___| |
| |
| [I] [I] |
| * /|\ /|\ |
| [========] [========] |
| [========] [========] |
|=|/\|==|/\|=|/\|=|/\|=| |=|/\|=|/\|=|/\|==|/\|=|
|=|\/|==|\/|=|\/|=|\/|=|^^|=|\/|=|\/|=|\/|==|\/|=|""",
(24, 24, 7, 67, 89),
(25, 24, 7, 68, 89)) # * : (13, 2) * : (13, 20)
def h_44_npc(data, stat):
pass

View File

@ -15,32 +15,32 @@ nidavellir = (r"""
/ ~~~~~ / / / \ /\ / / \ / \ / \ /
/ ~~~~~ /\ / / \ / \ /\ / / / \ /\ / \ /\ /
~~~~ / \ /\ / \ / \ / \ /\ / / \ / \ / \
/\ ~~~~ / \ / \ / / \ / \ / \ / \ / \
/\ ~~~~ / \ / _\ / / \ / \ / \ / \ / \
/ \ /\ ~~~~ / / /^\\ /_ / / \ / \ / \
\ / \ ~~~ / / \ /-\ / / \ / \ / \
/ ~~~~~ / \ |_| / \ /\ /\
/ ~~~~~~ /\ / \ /\ / \ /\
/ ~~~~~~ / \ /\ * / \ / \ /\ / \ / \ /\
/\ ~~~ / \ / \ /\ /\ / / \ / \ / / \ / \
/ \ /\ ~~~ / / \ / \ / \ /\ / / / \/ / / \
/ \ /\ ~~~ / / \ / \ /_ \ /\ / / / \/ / / \
\ / \ /\ ~~~~ / / \ //^\ \ / \ /\ / /\ / \ / / \
/ \ / \ ~~~~~ / / \ / / \ / \ / \ /\ \ / \
/ \ / \ ~~~~~ / / \ / / \ / \ / _\ /\ \ / \
/ / \ ~~~~~~ / / / / \ / /^\\ / \ /\
/ / \ ~~~~~~~~~~ ## / / \ / / \ / \
/\ / ## \ ~~~~~~~~~ #### / \ / / / \ /\
/ \ /\ #### ## ~~~~~~~ ## / ## / \ \ /\
\ / \ ## #### ~~~~~~~ || /\ #### / ## \ \ / \ /\
\ /_ \ ## #### ~~~~~~~ || /\ #### / ## \ \ / \ /\
//^\ \ || ## * ~~~~~~~ / \ /\ ## #### / \ / \
/ \ || ~~~~~~ /^\ \ / \ /\ || ## / /
/ \ /\ ~~~~ / / \ / \ || / /
\ /\ / \ /\ ~~~~~~ / / / \ ## /\ /
\ /\ /_ \ /\ ~~~~~~ / / / \ ## /\ /
\ / \ /\ //^\ \ / \ /\ ~~~~ / / \ #### / \ /\
/ \ / \ / / \ / \ ~~~~ / \ ## / \ / \ /\
/ / \ / / / \ ------ || / / \ / \
/ / \ / / / _ \ ------ || / / \ / \
/ / \ / / /^\ \ /\ ## / / /
/ \ / \ -------- / \ /\ #### / /
\ /\ /\ ~~~~ / \ / \ /\ ## /\ /
\ / \ /\ / \ /\ ~~~ / / \ / \ || / \ /\
\ / \ /\ / _\ /\ ~~~ / / \ / \ || / \ /\
/ \ / \ / /^\\ / \ /\ ~~~ / / / /^\ / \ / \ /\
/ / \ / / \ / \ ~~~~~ / / \ / / \ / \
/ / \ / / / \ ~~~~~~ /\ / \ / / /
@ -60,7 +60,7 @@ nidavellir = (r"""
\ /\ /\ ~~~~ / / \ / \? /\ ~~~~ , /
\ / \ /\ / \ /\ ~~~~~~~ / / \ / \ ~~~~~ . /\
/ \ / \ / \ / \ /\ ~~~~~~ / / \ ~~~~ / \
/ / \ / / \ / \ , ~~~~ / / ~~ \ * ~~~~ .' / \ /
/ / \ / / \ / _\ , ~~~~ / / ~~ \ * ~~~~ .' / \ /
/ / \ / / / /^\\ ` ~~~~~~ / ~~ \ ~~~~ / /
/ \ / / \ .,` (~~~~~~~~~~~~~~~~ ~~~~ ~~~~ .`, / /
\ /\ / \ . ~~~~~~~~~~~~~~~ . /
@ -76,26 +76,26 @@ nidavellir = (r"""
/ / \ / / \ / \/ \ / \ /\ / / """,
# Autres mondes (Nidavellir = 6)
(93, 8, 3, 77, 62), # Midgard
(9, 57, 7, 92, 2), # Muspellheim
(39, 19, 8, 109, 66), # Svartalfheim
(9, 57, 7, 92, 2), # Muspellheim
(39, 19, 8, 109, 66), # Svartalfheim
# Maisons
(69, 26, 37, 0, 0), # Auberge
( 7, 31, 38, 0, 0),
(35, 38, 39, 0, 0),
(22, 42, 40, 0, 0), # Armurerie
(23, 51, 41, 0, 0),
(69, 26, 37, 15, 14), # Auberge
( 7, 31, 38, 15, 14),
(35, 38, 39, 14, 14), # Armurerie
(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),
(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)
@ -105,8 +105,203 @@ nidavellir = (r"""
# * : (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."]
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):
pass
pass
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

View File

@ -111,7 +111,7 @@ h_29 = (r"""
| [==-][=-=/ \-==][==-] |
| |
| * |
| [=] [=] [=] [=] |
| [I] [I] [I] [I] |
| /|\ /|\ /|\ /|\ |
| |
| |
@ -123,7 +123,40 @@ h_29 = (r"""
(15, 14, 4, 38, 21)) # * : (5, 5)
def h_29_npc(data, stat):
pass
coords = data[2], data[3]
spells_sale = ((0, 5), (1, 5), (2, 5), (3, 5), (4, 5))
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] == stat[9]:
stat[9] = data[0]
return [0, "Merath, je vend les sorts les plus puissants de tout l'Yggdrasil ! Quel sort voulez-vous ?\n1. Soin V\n2. Flammes V\n3. Givre V\n4. Etincelles V\n4. Fatigue V", 4]
else:
for i in range(1, 5):
if data[0] == stat[9] + i:
stat[9] = -1
if stat[1] < 50: return [-i, "Vous n'avez pas les moyens, desolee."]
spell_id = -1
for sp_id, sp in enumerate(stat[7]):
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)]

View File

@ -99,12 +99,12 @@ def svartalfheim_npc(data, stat):
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 stat[6][0] == -1:
stat[6] = stat[4], data[0]
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"]
elif data[0] == stat[6][1] + 1:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 2: return [-1, "Reviens quand tu auras de quoi me payer."]
if coords == (104, 30): data[2], data[3] = 119, 49
@ -112,8 +112,8 @@ def svartalfheim_npc(data, stat):
return [-1, "C'est parti !", 0, (1, -2)]
elif data[0] == stat[6][1] + 2:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 2:
stat[9] = -1
return [0, "Reviens quand tu voudras traverser."]

View File

@ -96,25 +96,25 @@ def h_21_npc(data, stat):
coords = data[2], data[3]
if coords == (8, 1):
if stat[6][0] == -1:
stat[6] = stat[4], data[0]
if stat[9] == -1 or data[0] == stat[9]:
stat[9] = data[0]
return [0, "Cher client bonjour ! Que puis-je faire pour vous ?\n1. Manger [5 PO]\n2. Boire [2 PO]\n3. Dormir [10 PO]", 3]
elif data[0] == stat[6][1] + 1:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 1:
stat[9] = -1
if stat[1] < 5: return [-1, "Tsst, quand on ne peut pas payer, on ne rentre pas."]
return [-1, "Et un plat chaud, un !", 0, (0, 5), (1, -5)]
return [-1, "Et un plat chaud, un ! [VOUS VOUS ASSEYEZ DEVANT UN TRANCHOIR DE PAIN ET UNE ASSIETTE DE SOUPE EPAISSE.]", 0, (0, 5), (1, -5)]
elif data[0] == stat[6][1] + 2:
stat[6] = (-1, -1)
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 !", 0, (0, 2), (1, -2)]
return [-2, "Et voila ! [L'AUBERGISTE PLACA DEVANT VOUS UNE CHOPPE DE BIERE]", 0, (0, 2), (1, -2)]
elif data[0] == stat[6][1] + 3:
stat[6] = (-1, -1)
elif data[0] == stat[9] + 3:
stat[9] = -1
if stat[1] < 10: return [-3, "Allez donc voir ailleurs."]
stat[4] = 360
return [-3, "Votre chambre est a l'etage.\n[LA NUIT PASSE]", 0, (0, 10), (1, -10)]
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."]
@ -155,7 +155,7 @@ def h_22_npc(data, stat):
else: return {
"base": [0, "Bonjour, je suis Freyja, deesse de la beaute et de l'erotisme."],
1: [1, "Hum. [FREYJA REGARDE LA DAGUE] Odin me propose la paix... Mais cela ne se passera pas comme ca. [ELLE VOUS REND LA DAGUE]. Rendez sa dague a Odin. Avant que vous ne partiez pour Asgard, allez voir Freyr, il est dans la piece adjacente."],
1: [1, "Hum. [FREYJA REGARDE LA DAGUE] Odin me propose la paix... Mais cela ne se passera pas comme ca. [ELLE VOUS REND LA DAGUE]. Rendez sa dague a Odin. Avant que vous ne partiez pour Asgard, allez voir Freyr, il est dans la piece adjacente, il te renverra directement a Asgard."],
}
@ -166,13 +166,19 @@ def h_22_npc(data, stat):
if xp == 2:
check = True
for spell_id, spell_level in stat[8]:
for spell_id, spell_level in stat[7]:
if spell_id == 0: check = False
data[1] = 0
data[2], data[3] = 126, 71
if check:
stat[8].append((0, 1))
return [1, "Chez les Vanes, nous rendons hommage aux messagers, en guise de remerciement, je vais vous apprendre le sort de Soin [FREYR DESSINA DANS L'AIR DES RUNES VIOLETTE QUI TOURNOYERENT UN INSTANT AVANT DE S'ESTOMPER PEU A PEU.]"]
stat[7].append((0, 1))
return [1, "Chez les Vanes, nous rendons hommage aux messagers, en guise de remerciement, je vais vous apprendre le sort de Soin [FREYR DESSINA DANS L'AIR DES RUNES VIOLETTE QUI TOURNOYERENT UN INSTANT AVANT DE S'ESTOMPER PEU A PEU.]\n[UNE LOURDE TORPEUR S'ABATTIT SUR VOUS. VOUS VOUS SENTEZ LEGER. LE DUR CHOC CONTRE LE SOL VOUS REVEILLA.]"]
else:
return [1, "Chez les Vanes, nous rendons hommage aux messagers, voici quelques pieces d'or, faites en bon usage !", 0, (1, 5)]
return [1, "Chez les Vanes, nous rendons hommage aux messagers, voici quelques pieces d'or, faites en bon usage ! [UNE LOURDE TORPEUR S'ABATTIT SUR VOUS. VOUS VOUS SENTEZ LEGER. LE DUR CHOC CONTRE LE SOL VOUS REVEILLA.]", 0, (1, 5)]
else: return {
"base": [0, "Freyr, dieu de la vie. Bienvenue a Vanaheim"]

View File

@ -1,17 +0,0 @@
maison = (r"""
|============================|
| [===][=--==/ \==-=-][===] |
| [=-=][===-/ \==--][--=] |
| [==-][=-=/ \-==][==-] |
| |
| * |
| [=] [=] [=] [=] |
| /|\ /|\ /|\ /|\ |
| |
| |
| [=--] [==-] [-=] [==-] |
| [-==] [--=] [==] [--=] |
| [===] [=-=] [==] [-==] |
| |
|=============|^|============|""",
(15, 14, , 0, 0)) # * : (5, 5)

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.7.2" orientation="orthogonal" renderorder="right-down" width="30" height="15" tilewidth="42" tileheight="85" infinite="0" nextlayerid="2" nextobjectid="1">
<tileset firstgid="1" source="Asci_tileset.tsx"/>
<layer id="1" name="Calque de Tuiles 1" width="30" height="15">
<data encoding="csv">
93,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,93,
93,0,60,30,30,30,62,60,30,30,30,30,30,16,0,0,61,30,30,30,30,30,62,60,30,30,30,62,0,93,
93,0,60,30,30,30,62,60,30,30,30,30,16,0,0,0,0,61,30,30,30,30,62,60,30,30,30,62,0,93,
93,0,60,30,30,30,62,60,30,30,30,16,0,0,0,0,0,0,61,30,30,30,62,60,30,30,30,62,0,93,
93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,
93,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,
93,0,0,60,30,62,0,0,60,30,62,0,0,0,0,0,0,0,0,60,30,62,0,0,60,30,62,0,0,93,
93,0,0,16,93,61,0,0,16,93,61,0,0,0,0,0,0,0,0,16,93,61,0,0,16,93,61,0,0,93,
93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,
93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,
93,0,60,30,30,30,62,0,0,60,30,30,30,62,0,0,0,60,30,30,62,0,0,60,30,30,30,62,0,93,
93,0,60,30,30,30,62,0,0,60,30,30,30,62,0,0,0,60,30,30,62,0,0,60,30,30,30,62,0,93,
93,0,60,30,30,30,62,0,0,60,30,30,30,62,0,0,0,60,30,30,62,0,0,60,30,30,30,62,0,93,
93,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,
93,30,30,30,30,30,30,30,30,30,30,30,30,30,93,63,93,30,30,30,30,30,30,30,30,30,30,30,30,93
</data>
</layer>
</map>