Add maps and fix bugs on magical fights
This commit is contained in:
parent
f0a164dd5a
commit
a523e52f89
392
idk/alfheim.py
392
idk/alfheim.py
|
@ -7,42 +7,42 @@ alfheim = (r"""
|
|||
~~~~~ ~~~~~~~ #### ~~~~~~~ ## ~~~~~~~~
|
||||
~~~ ~~~~~ || ~~~~~~~ #### __ ## ~~~~~~~
|
||||
~~~ ~~~~~~~~ ## ~~~~~ ## || /[]\ #### ~~~~~
|
||||
~~~ ~~~~~~~~~~~~ #### ## ## #### ` ' |__| || __ ~~~
|
||||
~~~ ~~~~~~~~~~~~ #### ## ## #### ` ' |^_| || __ ~~~
|
||||
~~~ ~~~~~~~~~~~~ ## || #### #### || ,' '.' / \ ~~~
|
||||
~~~ ~~~~~ ~~~~ #### || || ` ' __ '`' . ` |__| ~~
|
||||
~~~ ~~~~~ ~~~~ #### || || ` ' __ '`' . ` |^_| ~~
|
||||
~~~ ## ~~~ || '' /[]\ ' . ## ~~
|
||||
~~ #### ## _ _________________ |__| ## `.` #### ~~
|
||||
~~ #### ## _ _________________ |_^| ## `.` #### ~~
|
||||
~~ || #### / \ / |]O[| |]O[| \ #### __ || ~~
|
||||
~~~~ || |_| /___________________\ ## ## || /[]\ ~~
|
||||
~~~~ ## _ |_/ \_/ _ \_/ \_| ## ## |__| ## ~~~~
|
||||
~~~~ || |^| /___________________\ ## ## || /[]\ ~~
|
||||
~~~~ ## _ |_/ \_/ _ \_/ \_| ## ## |^_| ## ~~~~
|
||||
~~~~ #### / \ |_| |_|/^\|_| |_| __ #### ~~~~
|
||||
~~~~ || _ |_| ## ## / \ `' || ~~~~
|
||||
~~~~ / \ ### ### ## ## |__| . , ~~~~
|
||||
~~~~~~~~~ |_| _ ##### ##### `' `_ ,, , ~~~
|
||||
~~~~ || _ |^| ## ## / \ `' || ~~~~
|
||||
~~~~ / \ ### ### ## ## |^_| . , ~~~~
|
||||
~~~~~~~~~ |^| _ ##### ##### `' `_ ,, , ~~~
|
||||
~~~~~~~~~ /o\ ### ### ' _ ``' / \ ~~~
|
||||
~~~~~~~~~~~ |_| /-\ /-\ , / \ |_| ~~~~ ~~~
|
||||
~~~~~~~~~~~~ ### ### ' ,|_| .' _ ~~~~~ ~~~
|
||||
~~~~~~~~~~~ |^| /-\ /-\ , / \ |^| ~~~~ ~~~
|
||||
~~~~~~~~~~~~ ### ### ' ,|^| .' _ ~~~~~ ~~~
|
||||
~~~~~~ ~~~~~~~ ### ##### ` ##### . ` .,. / \ ~~~~~ ~~~
|
||||
~~~~~ ~~~~~~~ ##### ### ' ### _ ` , _ |_| _ ~~~~~~ ~~~
|
||||
~~~~~ ~~~~~~~ ##### ### ' ### _ ` , _ |^| _ ~~~~~~ ~~~
|
||||
~~~~~ __ ~~ ### /-\ /-\ ` / \ , /o\ / \ ~~~~~~~~~~
|
||||
~~~~~~ / \ /-\ ' . '``,'' |_|` |_| |_| ~~~~~~~~~~
|
||||
~~~~~~ |__| ,. ' .` ', ~~~~~~~~~~
|
||||
~~~~~~ / \ /-\ ' . '``,'' |^|` |^| |^| ~~~~~~~~~~
|
||||
~~~~~~ |_^| ,. ' .` ', ~~~~~~~~~~
|
||||
~~~~~~ __ ### ., _ . , _ ,. ~~~~~~~~~~
|
||||
~~~~~~~~ / \ ##### ### / \ ` ' /o\__ `. ~~~~~~~~~
|
||||
~~~~~~~~~ |__| ### ##### ### |_| . |_ o \==| .'`. ~~~~~~~
|
||||
~~~~~~~~~ |^_| ### ##### ### |^| . |_ o \==| .'`. ~~~~~~~
|
||||
~~~~~~~~~~~~ ### /-\ ### ##### ,.` ||^|__| | . . ~~~~~~~
|
||||
~~~~~~~~~~~~ ##### /-\ ### | .' ~~~~~~
|
||||
~~~~~~~~~~~~~ ##### ### /-\ ### ### | ,`','` '',, ~~~~~~
|
||||
~~~~~~~~~~~ ### ##### ### ##### ##### |==|==|==| ~~~~~
|
||||
~~~~~~~~~~ ### |_| ##### ##### ### ### _ ~~~~~
|
||||
~~~~~~~~~ ##### ### ##### /-\ /-\ ### _ / \ _ ~~~~
|
||||
~~~~~~~~~ ##### |_| ### ### ##### / \ |_| / \ ~~~~
|
||||
~~~~~~~~~ ### |_| ##### ### ### |_| |_| ~~~~
|
||||
~~~~~~~~~ ##### |_| ### ### ##### / \ |^| / \ ~~~~
|
||||
~~~~~~~~~ ### |_| ##### ### ### |^| |^| ~~~~
|
||||
~~~~~~~ |_| ~~~~~~~ ##### ##### /-\ _ ~~~~
|
||||
~~~~~~~ ~~~~~~~~~~~~~~~~~~ ### ##### / \ _ ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ |_| ### |_| / \ _ ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ |_| |_| / \ ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ |_| ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ |_| ### |^| / \ _ ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ |_| |^| / \ ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~ |^| ~~~~
|
||||
~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~
|
||||
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~~~~~~
|
||||
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
|
||||
|
@ -50,14 +50,14 @@ alfheim = (r"""
|
|||
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ### ### ~~~~~~~~~~~~
|
||||
~~~~~~~~~~ __ ~~~~~~~~~~~~~~~~~~~~ __ ### ## ## ~~~~~~~~~~~~
|
||||
~~~~~~~~~~ / \ ~~~~~~~~~~~~~~~~~~~~ / \ ##### ~~~~~~ ~~~~
|
||||
~~~~~~~~~~ |__| ~~~~~~~~~~~~~ |__| ##### ## ## ~~~~~ ~~~~
|
||||
~~~~~~~~~~ |^_| ~~~~~~~~~~~~~ |_^| ##### ## ## ~~~~~ ~~~~
|
||||
~~~~~~~~~~ ### ~~~~~~~~ ### ### ### ~~ ~~~~
|
||||
~~~~~~~~~ ##### ,'' |_| #### #### ~~~
|
||||
~~~~~~~~ ##### ' ### ,,,. ### ~~~
|
||||
~~~~~~~~ ### ### ##### `,, ##### ~~~
|
||||
~~~~~~~ |_| . ##### ##### ',, __ ### ##### ~~~
|
||||
~~~~~~ ### ,##### ### ` / \ ### ##### ### ~~~
|
||||
~~~~~~ ##### ### , ### |_|`' ### |__| ##### ##### |_| ~~~
|
||||
~~~~~~ ##### ### , ### |_|`' ### |_^| ##### ##### |_| ~~~
|
||||
~~~~~~ ##### #####``|_| ### ` ##### ##### ### ~~~
|
||||
~~~~~~ ### ##### ' ##### ##### ### |_| ### ~~~
|
||||
~~~~~~ |_| ### ,' ##### ### |_| ##### ~~~
|
||||
|
@ -67,7 +67,7 @@ alfheim = (r"""
|
|||
~~~~~ ## || ,` ' ~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~ ~~~
|
||||
~~~~ #### _ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~~~ ~~~
|
||||
~~~~~ || /-\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~
|
||||
~~~~~~ ~ |_| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~
|
||||
~~~~~~ ~ |^| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~
|
||||
~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -80,6 +80,34 @@ alfheim = (r"""
|
|||
# Maisons
|
||||
(34, 16, 23, 25, 19),
|
||||
(52, 31, 24, 20, 19), # Librairie
|
||||
|
||||
(56, 8, 55, 3, 9),
|
||||
(65, 10, 56, 3, 9),
|
||||
(51, 12, 57, 11, 9),
|
||||
(15, 14, 58, 4, 4),
|
||||
(61, 15, 59, 3, 9),
|
||||
(19, 17, 60, 4, 4),
|
||||
(55, 18, 61, 3, 9),
|
||||
(14, 19, 62, 4, 4),
|
||||
(19, 21, 63, 4, 4),
|
||||
(61, 21, 64, 4, 4),
|
||||
(49, 22, 65, 4, 4),
|
||||
(58, 24, 66, 4, 4),
|
||||
(46, 26, 67, 4, 4),
|
||||
(52, 26, 68, 4, 4),
|
||||
(61, 26, 69, 4, 4),
|
||||
(9, 27, 70, 11, 9),
|
||||
(14, 30, 71, 3, 9),
|
||||
(41, 30, 72, 4, 4),
|
||||
(63, 37, 73, 4, 4),
|
||||
(59, 38, 74, 4, 4),
|
||||
(67, 38, 75, 4, 4),
|
||||
(56, 41, 76, 4, 4),
|
||||
(63, 42, 77, 4, 4),
|
||||
(67, 43, 78, 4, 4),
|
||||
(13, 51, 79, 3, 9),
|
||||
(40, 51, 80, 11, 9),
|
||||
(43, 58, 81, 11, 9),
|
||||
)
|
||||
|
||||
|
||||
|
@ -130,6 +158,326 @@ h_24 = (r"""
|
|||
|====|^|====| """,
|
||||
(20, 19, 2, 52, 31))
|
||||
|
||||
|
||||
h_55 = (r"""
|
||||
|=======|-|===|
|
||||
| _ /___\ |
|
||||
| |_| |+++| |
|
||||
| |_| |
|
||||
| |_| |
|
||||
| |
|
||||
| _ |
|
||||
| (_) |
|
||||
| /=\ |
|
||||
|=/^\=========|""",
|
||||
(3, 9, 1, 56, 8),
|
||||
)
|
||||
|
||||
|
||||
h_56 = (r"""
|
||||
|/=\/=\/=\/=\/|
|
||||
| |
|
||||
| +--+ |
|
||||
| | | |
|
||||
| | | |
|
||||
| +--+ |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|/=\/=\/=\|""",
|
||||
(3, 9, 1, 65, 10),
|
||||
)
|
||||
|
||||
|
||||
h_57 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| [=] [=] |
|
||||
| /-\ /-\ |
|
||||
| |
|
||||
| [=] [=] |
|
||||
| /-\ /-\ |
|
||||
| |
|
||||
| |
|
||||
|=========/^\=|""",
|
||||
(11, 9, 1, 0, 0),
|
||||
)
|
||||
|
||||
|
||||
h_58 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 15, 14),
|
||||
)
|
||||
|
||||
|
||||
h_59 = (r"""
|
||||
|======|======|
|
||||
| /=\ |
|
||||
| |
|
||||
| +--+ |
|
||||
| | | |
|
||||
| +--+ |
|
||||
| (_) |
|
||||
| [I] |
|
||||
| |
|
||||
|=/^\=========|""",
|
||||
(3, 9, 1, 61, 15),
|
||||
)
|
||||
|
||||
h_60 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 19, 17),
|
||||
)
|
||||
|
||||
|
||||
h_61 = (r"""
|
||||
|=========||==|
|
||||
| /__\ |
|
||||
| |
|
||||
| |-| |
|
||||
| |-| |
|
||||
| |-| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=/^\=========|""",
|
||||
(3, 9, 1, 55, 18),
|
||||
)
|
||||
|
||||
|
||||
h_62 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 14, 19),
|
||||
)
|
||||
|
||||
|
||||
h_63 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 19, 21),
|
||||
)
|
||||
|
||||
|
||||
h_64 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 61, 21),
|
||||
)
|
||||
|
||||
|
||||
h_65 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 49, 22),
|
||||
)
|
||||
|
||||
|
||||
h_66 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 58, 24),
|
||||
)
|
||||
|
||||
|
||||
h_67 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 46, 26),
|
||||
)
|
||||
|
||||
|
||||
h_68 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 52, 26),
|
||||
)
|
||||
|
||||
|
||||
h_69 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 61, 26),
|
||||
)
|
||||
|
||||
|
||||
h_70 = (r"""
|
||||
|========|-|==|
|
||||
| /---\ |
|
||||
| |###| |
|
||||
| |
|
||||
| +---+ |
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
| +---+ |
|
||||
|=========/^\=|""",
|
||||
(11, 9, 1, 9, 27),
|
||||
)
|
||||
|
||||
|
||||
h_71 = (r"""
|
||||
|-------------|
|
||||
| [===] [===] |
|
||||
| |
|
||||
| [===] [===] |
|
||||
| |
|
||||
| [===] [===] |
|
||||
| |
|
||||
| [===] [===] |
|
||||
| |
|
||||
|-|^|---------|""",
|
||||
(3, 9, 1, 14, 30),
|
||||
)
|
||||
|
||||
|
||||
h_72 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 41, 30),
|
||||
)
|
||||
|
||||
|
||||
h_73 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 63, 37),
|
||||
)
|
||||
|
||||
|
||||
h_74 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 59, 38),
|
||||
)
|
||||
|
||||
|
||||
h_75 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 57, 38),
|
||||
)
|
||||
|
||||
|
||||
h_76 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 56, 41),
|
||||
)
|
||||
|
||||
|
||||
h_77 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 63, 42),
|
||||
)
|
||||
|
||||
|
||||
h_78 = (r"""
|
||||
/======\
|
||||
/ \
|
||||
| |
|
||||
| |
|
||||
|==|^[|==|""",
|
||||
(4, 4, 1, 67, 43),
|
||||
)
|
||||
|
||||
h_79 = (r"""
|
||||
|====|-|======|
|
||||
| /___\ |
|
||||
| |###| |
|
||||
| |
|
||||
| +---+ |
|
||||
| | | |
|
||||
| | | |
|
||||
| +---+ |
|
||||
| |
|
||||
|=/^\=========|""",
|
||||
(3, 9, 1, 13, 51),
|
||||
)
|
||||
|
||||
|
||||
h_80 = (r"""
|
||||
|=============|
|
||||
| _ _ _ |
|
||||
| |_| |_| |_| |
|
||||
| |_| |_| |_| |
|
||||
| |
|
||||
| +---+ |
|
||||
| | | |
|
||||
| +---+ |
|
||||
| |
|
||||
|=========/^\=|""",
|
||||
(11, 9, 1, 40, 51),
|
||||
)
|
||||
|
||||
|
||||
h_81 = (r"""
|
||||
|===|_|=======|
|
||||
|===|_|=======|
|
||||
| /{O}\ |
|
||||
| |###| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========/^\=|""",
|
||||
(11, 9, 1, 43, 58),
|
||||
)
|
||||
|
||||
|
||||
|
||||
alfheim_entities = (
|
||||
[0, '*', 2, 23, 17, 'stand by'],
|
||||
[0, '*', 2, 11, 4, 'stand by'],
|
||||
|
|
64
idk/asci.py
64
idk/asci.py
|
@ -1,12 +1,15 @@
|
|||
# Asci (1.9.1)
|
||||
# Asci (1.9.3)
|
||||
from math import floor, ceil
|
||||
|
||||
SCREEN_WIDTH = 21
|
||||
SCREEN_HEIGHT = 7
|
||||
|
||||
|
||||
class Asci:
|
||||
def __init__(self, maps, entities, events_mapping, keys_mapping, behaviors=None, screen_width=21, screen_height=7):
|
||||
def __init__(self, maps, entities, events_mapping, keys_mapping, behaviors=None):
|
||||
# Load maps and entities
|
||||
self.maps = [Map(*i) for i in maps]
|
||||
self.entities = dict()
|
||||
self.entities = {}
|
||||
entity_id = 0
|
||||
for i in entities:
|
||||
if not i[0]:
|
||||
|
@ -27,7 +30,7 @@ class Asci:
|
|||
for i in behaviors: self._behaviors[i] = behaviors[i]
|
||||
|
||||
# Screen initialisation
|
||||
self.screen = Screen(screen_width, screen_height)
|
||||
self.screen = Screen()
|
||||
self.current_map = None
|
||||
|
||||
def _looked_case(self, direction):
|
||||
|
@ -184,7 +187,7 @@ class Asci:
|
|||
data_copy = self.data[:]
|
||||
for entity in self.current_map.entities.values():
|
||||
self._behaviors[entity.behavior](entity, data_copy, self.stat, self.screen, walkable)
|
||||
if entity.map_id == self.data[1] and (0 <= entity.pos_x - self.data[2] + self.screen.pos_player[0] < self.screen.screen_width) and (0 <= entity.pos_y - self.data[3] + self.screen.pos_player[1] < self.screen.screen_height):
|
||||
if entity.map_id == self.data[1] and (0 <= entity.pos_x - self.data[2] + self.screen.pos_player[0] < SCREEN_WIDTH) and (0 <= entity.pos_y - self.data[3] + self.screen.pos_player[1] < SCREEN_HEIGHT):
|
||||
self.screen.set_cell(entity.pos_x, entity.pos_y, entity.symbol)
|
||||
|
||||
self.screen.set_cell(self.data[2], self.data[3], player)
|
||||
|
@ -219,12 +222,10 @@ class Asci:
|
|||
|
||||
# Classes used by Asci
|
||||
class Screen:
|
||||
def __init__(self, screen_width=21, screen_height=7):
|
||||
def __init__(self):
|
||||
# Screen configuration
|
||||
self.screen_width = screen_width
|
||||
self.screen_height = screen_height
|
||||
self.pos_player = (screen_width // 2, screen_height // 2)
|
||||
self._on_screen = [[" " for _ in range(screen_width)] for _ in range(screen_height)]
|
||||
self.pos_player = (SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2)
|
||||
self._on_screen = [[" " for _ in range(SCREEN_WIDTH)] for _ in range(SCREEN_HEIGHT)]
|
||||
self._asci_data = []
|
||||
|
||||
def load_data(self, data):
|
||||
|
@ -240,8 +241,8 @@ class Screen:
|
|||
|
||||
def set_screen(self):
|
||||
x = self._asci_data[2] - self.pos_player[0] ; y = self._asci_data[3] - self.pos_player[1]
|
||||
for x_map in range(x, x + self.screen_width):
|
||||
for y_map in range(y, y + self.screen_height):
|
||||
for x_map in range(x, x + SCREEN_WIDTH):
|
||||
for y_map in range(y, y + SCREEN_HEIGHT):
|
||||
self._on_screen[y_map - y][x_map - x] = " "
|
||||
if 0 <= x_map < self.map_width and 0 <= y_map < self.map_height:
|
||||
try: self._on_screen[y_map - y][x_map - x] = self._world[y_map][x_map]
|
||||
|
@ -250,7 +251,7 @@ class Screen:
|
|||
def display(self, return_input=True, low_bar=None):
|
||||
for line_no in range(len(self._on_screen)):
|
||||
line = "".join(self._on_screen[line_no])
|
||||
if line_no + 1 == self.screen_height and return_input:
|
||||
if line_no + 1 == SCREEN_HEIGHT and return_input:
|
||||
if not low_bar: line = line[:-6] + ">"
|
||||
else: line = low_bar + ">"
|
||||
print(line, end="")
|
||||
|
@ -259,10 +260,10 @@ class Screen:
|
|||
print(line)
|
||||
|
||||
def clear(self):
|
||||
print("\n" * self.screen_height)
|
||||
print("\n" * SCREEN_HEIGHT)
|
||||
|
||||
def display_text(self, string):
|
||||
paragraphs = [i for i in text_formater(string, self.screen_width, self.screen_height) if i]
|
||||
paragraphs = [i for i in text_formater(string) if i]
|
||||
nb_par = len(paragraphs)
|
||||
for index in range(nb_par):
|
||||
self.clear()
|
||||
|
@ -273,13 +274,13 @@ class Screen:
|
|||
def set_cell(self, x, y, value):
|
||||
x = x - (self._asci_data[2] - self.pos_player[0])
|
||||
y = y - (self._asci_data[3] - self.pos_player[1])
|
||||
if 0 <= x < self.screen_width and 0 <= y < self.screen_height:
|
||||
if 0 <= x < SCREEN_WIDTH and 0 <= y < SCREEN_HEIGHT:
|
||||
self._on_screen[y][x] = value
|
||||
|
||||
def get_cell(self, x, y):
|
||||
x = x - (self._asci_data[2] - self.pos_player[0])
|
||||
y = y - (self._asci_data[3] - self.pos_player[1])
|
||||
if 0 <= x < self.screen_width and 0 <= y < self.screen_height:
|
||||
if 0 <= x < SCREEN_WIDTH and 0 <= y < SCREEN_HEIGHT:
|
||||
return self._on_screen[y][x]
|
||||
else: return " "
|
||||
|
||||
|
@ -326,34 +327,35 @@ def convert(string, force_int=False):
|
|||
else: return string
|
||||
|
||||
|
||||
def text_formater(string, screen_width=21, screen_height=6):
|
||||
def text_formater(string):
|
||||
screen_displayable_height = SCREEN_HEIGHT - 1
|
||||
|
||||
def line_formater(string, screen_width):
|
||||
def line_formater(string):
|
||||
string_result = ""
|
||||
while len(string) > screen_width:
|
||||
stop_index = screen_width
|
||||
while len(string) > SCREEN_WIDTH:
|
||||
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
|
||||
if not stop_index: stop_index = SCREEN_WIDTH
|
||||
|
||||
string_result += string[:stop_index].strip() + "\n"
|
||||
string = string[stop_index:].strip()
|
||||
|
||||
return string_result + string
|
||||
|
||||
def paragraph_formater(lines, screen_height):
|
||||
def paragraph_formater(lines):
|
||||
paragraphs = ""
|
||||
while len(lines) >= screen_height:
|
||||
paragraphs += "\n".join(lines[:screen_height]) + "\n\n"
|
||||
lines = lines[screen_height:]
|
||||
while len(lines) >= screen_displayable_height:
|
||||
paragraphs += "\n".join(lines[:screen_displayable_height]) + "\n\n"
|
||||
lines = lines[screen_displayable_height:]
|
||||
|
||||
return paragraphs + "\n".join(lines)
|
||||
|
||||
lines = []
|
||||
for line in string.split("\n"):
|
||||
for formated_line in line_formater(line, screen_width).split("\n"):
|
||||
for formated_line in line_formater(line).split("\n"):
|
||||
lines.append(formated_line)
|
||||
|
||||
return paragraph_formater(lines, screen_height).split("\n\n")
|
||||
return paragraph_formater(lines).split("\n\n")
|
||||
|
||||
|
||||
def read_event(data, event, quest):
|
||||
|
@ -464,7 +466,7 @@ def follow_by_player(entity, data, stat, screen, walkable):
|
|||
|
||||
|
||||
def _walk_engine(entity, frame):
|
||||
delta_x, delta_y = list(map(lambda x, y: y - x, (entity.pos_x, entity.pos_y), entity.args[1][frame]))
|
||||
delta_x, delta_y = list(map(lambda x,y: y - x, (entity.pos_x, entity.pos_y), entity.args[1][frame]))
|
||||
new_x = entity.pos_x
|
||||
new_y = entity.pos_y
|
||||
if delta_x: new_x += abs(delta_x) // delta_x
|
||||
|
@ -473,8 +475,8 @@ def _walk_engine(entity, frame):
|
|||
|
||||
|
||||
# Extra functions
|
||||
def print_text(text, min_value=0, max_value=0, default_value=0, screen_width=21, screen_height=7):
|
||||
paragraphs = [i for i in text_formater(text, screen_width, screen_height) if i]
|
||||
def print_text(text, min_value=0, max_value=0, default_value=0):
|
||||
paragraphs = [i for i in text_formater(text) if i]
|
||||
nb = len(paragraphs)
|
||||
for index in range(nb):
|
||||
print("\n" * 7)
|
||||
|
|
|
@ -70,10 +70,10 @@ asgard = (r"""
|
|||
### |]O[__]O[| ### ### ### |_| /o\ /-\ ### ##### ### ~~~~~~~~~ _ /|\ ### ~
|
||||
#####|__|^^|__| |_| |_| |_| ##### ##### |_| /-\ ### /|\ ~~~~~~~~~~ _ /o\ ##### ~
|
||||
### ##### ##### ~~~~~~~~~ /|\ ~~~~~~~~~~ /-\ |_| ### ~~
|
||||
/-\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ |_| /|\ ~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
|
||||
/-\ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ |^| /|\ ~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~""",
|
||||
# Autres mondes (Asgard = 0)
|
||||
(126, 71, 3, 72, 6), # Midgard
|
||||
|
||||
|
|
24
idk/idk.py
24
idk/idk.py
|
@ -1,18 +1,5 @@
|
|||
from idk_lib import *
|
||||
|
||||
try:
|
||||
import dlc_idk as dlc
|
||||
spells = dlc.dlc_spells
|
||||
spells_level = dlc.dlc_spells_level
|
||||
spells_effect = dlc.dlc_spells_effect
|
||||
weapons = dlc.dlc_weapons
|
||||
armors = dlc.dlc_armors
|
||||
dlc_entities = dlc.dlc_entities
|
||||
except:
|
||||
dlc = None
|
||||
dlc_entities = ()
|
||||
|
||||
|
||||
|
||||
# Game
|
||||
def npc(data, stat, entities, identifiant):
|
||||
|
@ -36,11 +23,6 @@ def npc(data, stat, entities, identifiant):
|
|||
h_42_npc, h_43_npc, h_44_npc,
|
||||
h_45_npc, h_46_npc, h_47_npc, h_48_npc)
|
||||
|
||||
|
||||
if dlc:
|
||||
event = dlc.dlc_npc(data, stat, entities, identifiant)
|
||||
if event: return "dlc", event
|
||||
|
||||
return npc_core(npc_data[data[1]], data, stat, entities, identifiant)
|
||||
|
||||
|
||||
|
@ -84,14 +66,14 @@ poi = (
|
|||
[0, '?', 8, 113, 37, 'stand by']
|
||||
)
|
||||
|
||||
entities = asgard_entities + vanaheim_entities + alfheim_entities + midgard_entities + niflheim_entities + jotunheim_entities + nidavellir_entities + muspellheim_entities + svartalfheim_entities + poi + dlc_entities
|
||||
entities = asgard_entities + vanaheim_entities + alfheim_entities + midgard_entities + niflheim_entities + jotunheim_entities + nidavellir_entities + muspellheim_entities + svartalfheim_entities + poi
|
||||
|
||||
print(center("Island of the Dead", 21, " "))
|
||||
print(center("* Kings *", 21, " "))
|
||||
print("---------------------")
|
||||
if dlc: print(center("DLC : {}".format(dlc.dlc_title), 21, " "))
|
||||
else: print()
|
||||
print()
|
||||
print("Entrez 'idk()' pour\nune nouvelle partie.")
|
||||
|
||||
events = {"*": npc, "?": point_of_interest}
|
||||
keys = {4: display_stat, 7: spell, 8: misc_stat, 6: inventory, 9: sleep, "s": quick_save}
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from asci import Asci, print_text, center, enumerate
|
||||
import asci
|
||||
from random import randint, choice
|
||||
from math import floor
|
||||
|
||||
from asgard import *
|
||||
from vanaheim import *
|
||||
|
@ -22,9 +24,9 @@ maps = (
|
|||
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_9, h_10, h_11, h_12, h_13, h_14, h_15, h_16, h_17, h_18, h_19, h_20, # asgard's houses
|
||||
h_21, h_22, # vanaheim's houses
|
||||
h_23, h_24, # alfheim's houses
|
||||
h_25, h_26, h_27, h_28,
|
||||
h_29, h_30,
|
||||
h_31, h_32, h_33, h_34, h_35, h_36,
|
||||
|
@ -32,13 +34,16 @@ maps = (
|
|||
h_42, h_43, h_44,
|
||||
h_45, h_46, h_47, h_48,
|
||||
|
||||
h_49, h_50, h_51, h_52, h_53, h_54,
|
||||
h_49, h_50, h_51, h_52, h_53, h_54, # vanaheim's extra houses
|
||||
h_55, h_56, h_57, h_58, h_59, h_60, h_61, h_62, h_63, h_64, h_65, h_66, h_67, h_68, h_69, h_70, h_71, h_72, h_73, h_74, h_75, h_76, h_77, h_78, h_79, h_80, h_81, # alfheim's extra house
|
||||
h_82, h_83, h_84, h_85, h_86, h_87, h_88, h_89, h_90, h_91, h_92, h_93, h_94, h_95, h_96, h_97, # midgard's extra houses
|
||||
h_98, h_99, h_100, h_101, h_102, h_103, h_104, h_105, h_106, h_107, h_108, h_109, h_110, # niflheim's extra houses
|
||||
|
||||
|
||||
)
|
||||
|
||||
spells = ("Soin", "Flammes", "Givre", "Etincelles", "Fatigue")
|
||||
spells = (("Soin", 4, 1, True), ("Flammes", 4, -1, False), ("Givre", 4, -1, False), ("Etincelles", 4, -1, False), ("Fatigue", 0, -1, False)) # (capacity, factor, True on player; False on opponent)
|
||||
spells_level = ("I", "II", "III", "IV", "V")
|
||||
spells_effect = ((4, 1, True), (4, -1, False), (4, -1, False), (4, -1, False), (0, -1, False)) # (capacity, factor, True on player; False on opponent)
|
||||
weapons = ("<aucune>", "Dague", "Marteau", "Masse", "Fleau", "Hache", "Epee", "Espadon", "Hache double")
|
||||
armors = ("<aucune>", "Rondache", "Pavois", "Cote de maille", "Broigne", "Harnois")
|
||||
|
||||
|
@ -52,7 +57,7 @@ def inn_interaction(data, stat, nb_choice, text, *events):
|
|||
|
||||
|
||||
def spell_selection(text, spells_to_display):
|
||||
message = text + "\n" + "\n".join(["{0}. {1} {2}".format(nb + 1, spells[spells_to_display[nb][0]], spells_level[spells_to_display[nb][1] - 1]) for nb in range(len(spells_to_display))])
|
||||
message = text + "\n" + "\n".join(["{0}. {1} {2}".format(nb + 1, spells[spells_to_display[nb][0]][0], spells_level[spells_to_display[nb][1] - 1]) for nb in range(len(spells_to_display))])
|
||||
return print_text(message, 1, len(spells_to_display), 0) - 1
|
||||
|
||||
|
||||
|
@ -276,7 +281,7 @@ def fight(stat, opponent_stat, opponent_name):
|
|||
print("\n" * 6 + "Sort(s) connu(s) :")
|
||||
count = 0
|
||||
for spell_id, level in stat[7]:
|
||||
print("{0}. {1} {2}".format(count + 1, spells[spell_id], spells_level[level - 1]))
|
||||
print("{0}. {1} {2}".format(count + 1, spells[spell_id][0], spells_level[level - 1]))
|
||||
count += 1
|
||||
spell_choice = get_input()
|
||||
if spell_choice < 0 or spell_choice > len(stat[7]): spell_choice = 0
|
||||
|
@ -285,11 +290,11 @@ def fight(stat, opponent_stat, opponent_name):
|
|||
spell_id, level = 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(spells[spell_id], spells_level[level - 1], level * 10)
|
||||
msg += "\nVous lancez {0} de niveau {1} [-{2} PM].".format(spells[spell_id][0], spells_level[level - 1], level * 10)
|
||||
stat[2][4] -= level * 10
|
||||
pts = 12 * level + randint(-5, 5)
|
||||
|
||||
capacity, factor, apply_on_player = spells_effect[spell_id]
|
||||
capacity, factor, apply_on_player = spells[spell_id][1:]
|
||||
|
||||
if apply_on_player:
|
||||
player_stat[capacity] += factor * pts
|
||||
|
@ -482,7 +487,7 @@ def spell(data, stat):
|
|||
if i < len(stat[7]):
|
||||
spell_id, level = stat[7][i]
|
||||
if spell_id >= 0:
|
||||
to_disp = "{0} {1}".format(spells[spell_id], spells_level[level - 1])
|
||||
to_disp = "{0} {1}".format(spells[spell_id][0], spells_level[level - 1])
|
||||
print(" |{}.".format(i + 1) + to_disp + " " * (14 - len(to_disp)) + "|")
|
||||
else:
|
||||
print(" |<aucun> |")
|
||||
|
@ -493,7 +498,7 @@ def spell(data, stat):
|
|||
if spell_choice:
|
||||
spell_choice -= 1
|
||||
spell_id, level = stat[7][spell_choice][0], stat[7][spell_choice][1]
|
||||
capacity, factor, apply_on_player = spells_effect[spell_id]
|
||||
spell_name, capacity, factor, apply_on_player = spells[spell_id]
|
||||
|
||||
if not apply_on_player:
|
||||
print_text("Vous ne pouvez pas lancer ce sort.")
|
||||
|
@ -503,11 +508,13 @@ def spell(data, stat):
|
|||
stat[2][4] -= level * 10
|
||||
pts = 12 * level + randint(-5, 5)
|
||||
|
||||
if capacity == 4:
|
||||
if capacity == 4: # Health
|
||||
stat[0] += factor * pts
|
||||
else:
|
||||
stat[2][capacity] += factor * pts
|
||||
print_text("Vous lancez {0} de niveau {1} [-{2} PM] et {3} {4} points de {5}".format(spells[spell_id], spells_level[level - 1], level * 10, ("perdez", "gagnez")[factor > 0], pts, ("vitesse", "agilité", "attaque", "défense", "vie")[capacity]))
|
||||
cost = level * 10
|
||||
if stat[6] == 3: cost = level * 8
|
||||
print_text("Vous lancez {0} de niveau {1} [-{2} PM] et {3} {4} points de {5}".format(spell_name, spells_level[level - 1], level * 10, ("perdez", "gagnez")[factor > 0], pts, ("vitesse", "agilité", "attaque", "défense", "vie")[capacity]))
|
||||
|
||||
else:
|
||||
print_text("Vous n'avez plus assez de points de Magie.")
|
||||
|
@ -547,17 +554,22 @@ def init_stat():
|
|||
if player_class == 1:
|
||||
stat = [6, 6, 10, 6, 6]
|
||||
elif player_class == 2:
|
||||
stat = [6, 10, 6, 6, 6]
|
||||
stat = [6, 20, 6, 6, 6]
|
||||
elif player_class == 3:
|
||||
stat = [6, 6, 6, 10, 6]
|
||||
stat = [6, 6, 6, 20, 6]
|
||||
elif player_class == 4:
|
||||
stat = [6, 6, 6, 6, 20]
|
||||
stat = [6, 6, 6, 6, 12]
|
||||
elif player_class == 5:
|
||||
stat = [10, 6, 6, 6, 6]
|
||||
|
||||
stat = [100, 10, stat, [0, 0], 360, name, player_class - 1, [], 1, -1]
|
||||
if player_class == 4:
|
||||
|
||||
if player_class == 1:
|
||||
stat[3][1] = 1
|
||||
elif player_class == 4:
|
||||
stat[7].append((1, 1))
|
||||
elif player_class == 5:
|
||||
stat[3][0] = 1
|
||||
|
||||
return stat
|
||||
|
||||
|
|
229
idk/midgard.py
229
idk/midgard.py
|
@ -5,7 +5,7 @@ midgard = (r"""
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~ ~~ ~~~~~~ ~~~ _ ~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ ~~~ ~~~ ~~~ /-\ ~~~~~~~ ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~~~~~ ~~~ ~~~~ ~~~ |_| ~~~~~~~ ~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~ ~~~~~ ~~~ ~~~~ ~~~ |^| ~~~~~~~ ~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ ~~~~~~ ~~ ~~~~ ~~ ~~ ~~~~~ ~ ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~ ~ ~~~~~ ~~ ~~~ ~~~ ~~~~ ~~~~~ ~ ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ ~ ~~ ~~~~~ ~~~ ~~ ~~~~ ~~~ ~ ~~~~~~~~~
|
||||
|
@ -50,31 +50,31 @@ midgard = (r"""
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ##### |_ o o \ ### _ ##### ~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~ ~~~~ ### |^|_____| /-\ _ /o\___ ### ~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~ /-\ /o\ |_ ]O[\ /-\ ~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~ |_| |^|___| ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~ |^| |^|___| ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~ ### ' __ , ### _ ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ ##### / \ ##### / \ ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~ ### ### ' |__| , ### |_| _ ~~~~~~
|
||||
~~~~~~~~~~~~~~~~~ ### ### ' |^_| , ### |^| _ ~~~~~~
|
||||
~~~~~~~~ ##### /-\ ### /-\ /o\ ~~~~~~
|
||||
~~~~~~~~ _ ### ##### . , , |_| ~~~~~~
|
||||
~~~~~~~~ _ ### ##### . , , |^| ~~~~~~
|
||||
~~~~~ /-\ ### /-\ ### . , . __ _ ~~~~~~
|
||||
~~~~~~~ |_| ##### /-\ ,. ' /[]\ / \ ~~~~~~~
|
||||
~~~~~~ ### ' . |__| |_| ~~~~~~~~~~
|
||||
~~~~~~~ |^| ##### /-\ ,. ' /[]\ / \ ~~~~~~~
|
||||
~~~~~~ ### ' . |^_| |^| ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~ /-\ . ' . __ _ ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~ /<>\ _ /-\ ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~ __ ' ' . |__| /o\ |_| ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~ /<>\ ' ___ |_| _ ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ |__| / _\ .. /o\ ~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ ' . |_|^| . _ _ |_| ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~ __ ' ' . |_^| /o\ |^| ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~ /<>\ ' ___ |^| _ ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ |^_| / _\ .. /o\ ~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ ' . |_|^| . _ _ |^| ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ ' /o\____/o\ ~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ ' ' __ |==|==| o o |==|==| __ ~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ ' /[]\ | | __ | | /<>\ ~~~~~
|
||||
~~~~~~~~~~~~~~~ ' |__| | |__|^^|__| | |__| ~~~~
|
||||
~~~~~~~~~~~~~~~ ' |^_| | |__|^^|__| | |_^| ~~~~
|
||||
~~~~~~~~~~~~~~~~~ ___ | | ~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ . /]O[\ | #### #### | ~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ . |___| | #### #### | ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ . |__^| | #### #### | ~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~ ' , __ | #### #### | ~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~ / \ | | ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~ . |__| | #### #### | ~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~ . |_^| | #### #### | ~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~ | #### #### | ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~ | #### #### | ~~~~~~~~~~~~
|
||||
~~~~~~~ ### ### | | ~~~~~~~~~~~
|
||||
|
@ -89,10 +89,10 @@ midgard = (r"""
|
|||
~~~~~~~~~~~ ##### ### ##### /|\ /|\ |--|--|--|~~~~
|
||||
~~~~~~~~~~~~~ ### _ /|\ ##### ### ### ~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~ /|\ /-\ ### ### ##### ##### ~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~ |_| _ /|\ ##### ##### ##### ### ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~ |^| _ /|\ ##### ##### ##### ### ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~ / \ _ ##### ### ### ### ##### ~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ |_| / \ ### /|\ ##### /|\ ### ~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~ |_| /|\ ### /|\ ~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~ |^| / \ ### /|\ ##### /|\ ### ~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~ |^| /|\ ### /|\ ~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /|\ ~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -111,6 +111,23 @@ midgard = (r"""
|
|||
(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)
|
||||
|
||||
(58, 51, 82, 5, 4),
|
||||
(51, 54, 83, 4, 9),
|
||||
(69, 54, 84, 5, 4),
|
||||
(89, 56, 85, 5, 4),
|
||||
(71, 59, 86, 4, 9),
|
||||
(81, 59, 87, 5, 4),
|
||||
(61, 62, 88, 5, 4),
|
||||
(69, 63, 89, 5, 4),
|
||||
(29, 64, 90, 4, 9),
|
||||
(82, 65, 91, 5, 4),
|
||||
(36, 69, 92, 4, 9),
|
||||
(88, 69, 93, 10, 9),
|
||||
(32, 72, 94, 10, 9),
|
||||
(42, 75, 95, 10, 9),
|
||||
(33, 92, 96, 5, 4),
|
||||
(38, 93, 97, 5, 4),
|
||||
)
|
||||
|
||||
|
||||
|
@ -192,6 +209,186 @@ h_28 = (r"""
|
|||
(24, 14, 3, 60, 69),
|
||||
(25, 14, 3, 61, 69))
|
||||
|
||||
|
||||
h_82 = (r"""
|
||||
|==|=====|
|
||||
| /#\ |
|
||||
| |
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 58, 51))
|
||||
|
||||
|
||||
h_83 = (r"""
|
||||
|<><><>|~|<><>|
|
||||
| |~| |
|
||||
| /{O}\ |
|
||||
| |###| |
|
||||
| +--+ |
|
||||
| | | |
|
||||
| | | |
|
||||
| +--+ |
|
||||
| |
|
||||
|<>|^|<><><><>|""",
|
||||
(4, 9, 3, 51, 54))
|
||||
|
||||
|
||||
h_84 = (r"""
|
||||
|========|
|
||||
| [=]|
|
||||
| /-\|
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 69, 54))
|
||||
|
||||
|
||||
h_85 = (r"""
|
||||
|<><><><>|
|
||||
|[===] |
|
||||
| |
|
||||
| |
|
||||
|<o>|^|<>|""",
|
||||
(5, 4, 3, 89, 56))
|
||||
|
||||
|
||||
h_86 = (r"""
|
||||
|=-=-=-=-=-=-=|
|
||||
|[====] _ |
|
||||
| (_) |
|
||||
|[====] [I] |
|
||||
| |
|
||||
|[====] _ |
|
||||
| (_) |
|
||||
|[====] [I] |
|
||||
| |
|
||||
|<>|^|<><><><>|""",
|
||||
(4, 9, 3, 71, 59))
|
||||
|
||||
|
||||
h_87 = (r"""
|
||||
|==|=====|
|
||||
| /_\ |
|
||||
| |
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 81, 59))
|
||||
|
||||
|
||||
h_88 = (r"""
|
||||
|========|
|
||||
|+-+ |
|
||||
|| | |
|
||||
|+-+ |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 61, 62))
|
||||
|
||||
|
||||
h_89 = (r"""
|
||||
|========|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 69, 63))
|
||||
|
||||
|
||||
h_90 = (r"""
|
||||
|=======|_|====|
|
||||
| /###\ |
|
||||
| |
|
||||
| +---+ |
|
||||
| | | |
|
||||
| | | |
|
||||
| | | |
|
||||
| +---+ |
|
||||
| |
|
||||
|==|^|========|""",
|
||||
(4, 9, 3, 29, 64))
|
||||
|
||||
|
||||
h_91 = (r"""
|
||||
|==|=====|
|
||||
| /#\ |
|
||||
| |
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 82, 65))
|
||||
|
||||
|
||||
h_92 = (r"""
|
||||
|<><><[I]><><>|
|
||||
| [I] |
|
||||
| /-\ [====]|
|
||||
| |
|
||||
| [====]|
|
||||
| [I] |
|
||||
| /-\ [====]|
|
||||
| |
|
||||
| [====]|
|
||||
|<>|^|<><><><>|""",
|
||||
(4, 9, 3, 36, 69))
|
||||
|
||||
|
||||
h_93 = (r"""
|
||||
|/\/\/\|/\/\/\|
|
||||
|\/\/\/|\/\/\/|
|
||||
| [I] |
|
||||
| _ /-\ _ |
|
||||
| |_| |_| |
|
||||
| |_| |_| |
|
||||
| |_| |_| |
|
||||
| |
|
||||
| |
|
||||
|========|^|==|""",
|
||||
(10, 9, 3, 88, 69))
|
||||
|
||||
|
||||
h_94 = (r"""
|
||||
|<><><><><o><><><><>|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|<><><><>|^|<><><><>|""",
|
||||
(10, 9, 3, 32, 72))
|
||||
|
||||
|
||||
h_95 = (r"""
|
||||
|<><><>|<><><>|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|<><><><>|^|<>|""",
|
||||
(10, 9, 3, 42, 75))
|
||||
|
||||
|
||||
h_96 = (r"""
|
||||
|========|
|
||||
| +-+|
|
||||
| | ||
|
||||
| +-+|
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 33, 92))
|
||||
|
||||
|
||||
h_97 = (r"""
|
||||
|=====|==|
|
||||
| /-\ |
|
||||
| |
|
||||
| |
|
||||
|===|^|==|""",
|
||||
(5, 4, 3, 38, 93))
|
||||
|
||||
|
||||
midgard_entities = (
|
||||
[0, '*', 3, 39, 49, 'stand by'],
|
||||
[0, '*', 3, 8, 59, 'stand by'],
|
||||
|
|
245
idk/niflheim.py
245
idk/niflheim.py
|
@ -13,16 +13,16 @@ _\ ### ##### ### ##### /_\ ### ##### ##### /_\ ##### /_
|
|||
#### ### ##### ### |+| |_| ##### /_\##### /_\ |+| #########
|
||||
#### /_\ ##### /_\ |_| ##### ##### _ |_| ### ####
|
||||
### ### ### ### |+| ___ ### /_\ ###
|
||||
/_\ /_\ _ /_\ /_\ |_| / \ ##### /_\
|
||||
### ### |+| |___| ##### ###
|
||||
/_\ /_\ _ /_\ /_\ |_| / _\ ##### /_\
|
||||
### ### |+| |_|^| ##### ###
|
||||
##### ##### ' ' |_| ___ _ ### #####
|
||||
##### ##### __ / \ ` ' _ |+| /_\ #####
|
||||
### ### _ .' ,` /()\ |___| /-\ |_| ### ###
|
||||
##### ##### __ / _\ ` ' _ |+| /_\ #####
|
||||
### ### _ .' ,` /()\ |_|^| /-\ |_| ### ###
|
||||
/_\ /_\ |+| .` | |____ |^| _ ##### /_\
|
||||
### ### |_| '' |_ () \ _ `' ` |+| #####
|
||||
#### ##### ,, |^|_____| |+| ___ , |_| ###
|
||||
#### ##### , `` |_| / \ , ,., /_\ ###
|
||||
### ### ,` ` |___| ,, #####
|
||||
#### ##### , `` |_| /_ \ , ,., /_\ ###
|
||||
### ### ,` ` |^|_| ,, #####
|
||||
/_\ /_\ _ ' .` _ , _ #####
|
||||
### |+| _ , |+| .., |+| ###
|
||||
##### |_| _ |+| , |_| __ __ . |_| /_\
|
||||
|
@ -30,8 +30,8 @@ _\ ### ##### ### ##### /_\ ### ##### ##### /_\ ##### /_
|
|||
### |_| , , ' | |____/O O\____| | ' _ ##### ###
|
||||
/_\ '' ' |[]| [] | | [] |[]| , |+| ##### ####
|
||||
### ___ `` '' | | | __ | | | ,'. |_| ### ### ####
|
||||
##### ### / \ ` . |__|____|/^^\|____|__| ,`` #####/_\ ###
|
||||
# ########## _ |___| ' ',, ` , ##### /_\
|
||||
##### ### /_ \ ` . |__|____|/^^\|____|__| ,`` #####/_\ ###
|
||||
# ########## _ |^|_| ' ',, ` , ##### /_\
|
||||
## ### ##### |+| '` ` `' , ###
|
||||
## /_\ ### |_| `` _ ` _ .. _ ` /_\ ###
|
||||
# /_\ |+| . (o) ',',, (o) ``` _ ### #####
|
||||
|
@ -40,25 +40,25 @@ _\ ### ##### ### ##### /_\ ### ##### ##### /_\ ##### /_
|
|||
##### ##### |+| ` ,` , '' . ` ` ` . ### /_\
|
||||
##### ### |_| _ _ ' .' _ ,'., ,, /_\ #
|
||||
### /_\ . |+| ___ (o) . (o) .`. ___ ### ##
|
||||
/_\ ### ` |_| / \ /-\ '', /-\ ', , / \ ##### ##
|
||||
##### ### , |___| , |___| ##### #
|
||||
/_\ ### ` |_| / _\ /-\ '', /-\ ', , /_ \ ##### ##
|
||||
##### ### , |_|^| , |^|_| ##### #
|
||||
##### ##### , ___ _ . _ `,.,`. ### /
|
||||
### #### ##### .`.` , , / \ (o) ' (o) ' . /_\ ###
|
||||
##### /_\ ### ', , |___| /-\ ,.` /-\ .. ___ _ #####
|
||||
##### /_\ _ `, ','. , `. / \ ` |+| #####
|
||||
### ### |+| '' _ ___ . . ` |___| ` |_| ###
|
||||
/_\ ##### |_| ' |+| / \ , , ___ ... ### /_\
|
||||
### ##### _ ', |_| |___| ', / \ ', ,''`' #####
|
||||
##### ### ___ |+| , |___| ` #####
|
||||
##### /_\ ___ / \ |_| '.` '` _ , ###
|
||||
### / \ |___| ,. ` ' ``', , |+| , ### /_\###
|
||||
## /_\ ### |___| _ . _ ` _ |_| . ##### #####
|
||||
### #### ##### .`.` , , / _\ (o) ' (o) ' . /_\ ###
|
||||
##### /_\ ### ', , |_|^| /-\ ,.` /-\ .. ___ _ #####
|
||||
##### /_\ _ `, ','. , `. / _\ ` |+| #####
|
||||
### ### |+| '' _ ___ . . ` |_|^| ` |_| ###
|
||||
/_\ ##### |_| ' |+| /_ \ , , ___ ... ### /_\
|
||||
### ##### _ ', |_| |^|_| ', /_ \ ', ,''`' #####
|
||||
##### ### ___ |+| , |^|_| ` #####
|
||||
##### /_\ ___ /[] \ |_| '.` '` _ , ###
|
||||
### /_ \ |___| ,. ` ' ``', , |+| , ### /_\###
|
||||
## /_\ ### |^|_| _ . _ ` _ |_| . ##### #####
|
||||
### ##### , ___ |+| _ |+| . |+| ##### #####
|
||||
### ##### ., / \ |_| ' |+| |_| . |_| , ### ###
|
||||
## ### ., |___| _ ' |_| .`,` . /_\ /_\
|
||||
### ##### ., / _\ |_| ' |+| |_| . |_| , ### ###
|
||||
## ### ., |_|^| _ ' |_| .`,` . /_\ /_\
|
||||
_\ /_\ ### ', |+| ___ ' '. ``,..' '.`.``` ,`..`'' ,, ###
|
||||
### ##### , |_| / \ `.`` ' ,..' ``'` .' ` , . ##### ###
|
||||
##### ##### . , |___| ' _ _ ##########
|
||||
### ##### , |_| / _\ `.`` ' ,..' ``'` .' ` , . ##### ###
|
||||
##### ##### . , |_|^| ' _ _ ##########
|
||||
##### ### '`` ,` |+| |+| ### ### #####
|
||||
### ### /_\ , ,' `` _ |_| |_| ### ##### /_\ ###
|
||||
/_\##### '. '``, ,.. ``, |+| ##### ##### ### /_\
|
||||
|
@ -81,6 +81,20 @@ _\ /_\ ### ', |+| ___ ' '. ``,..' '.`.`
|
|||
(38, 21, 29, 15, 14), # Librairie
|
||||
(70, 31, 30, 24, 19),
|
||||
(71, 31, 30, 25, 19),
|
||||
|
||||
(73, 15, 98, 11, 9),
|
||||
(66, 18, 99, 11, 9),
|
||||
(68, 23, 100, 3, 9),
|
||||
(31, 32, 101, 3, 9),
|
||||
(37, 42, 102, 11, 9),
|
||||
(96, 42, 103, 3, 9),
|
||||
(54, 45, 104, 11, 9),
|
||||
(93, 47, 105, 11, 9),
|
||||
(52, 49, 106, 3, 9),
|
||||
(82, 50, 107, 3, 9),
|
||||
(18, 53, 108, 11, 9),
|
||||
(25, 56, 109, 11, 9),
|
||||
(43, 59, 110, 11, 9),
|
||||
)
|
||||
|
||||
|
||||
|
@ -125,7 +139,188 @@ h_30 = (r"""
|
|||
| |========| |========| |
|
||||
|=============| |^^| |=============|""",
|
||||
(24, 19, 4, 70, 31),
|
||||
(25, 19, 4, 71, 31))
|
||||
(25, 19, 4, 71, 31))
|
||||
|
||||
h_98 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 73, 15))
|
||||
|
||||
|
||||
h_99 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 66, 18))
|
||||
|
||||
|
||||
h_100 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|=========|""",
|
||||
(3, 9, 4, 68, 23))
|
||||
|
||||
|
||||
h_101 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|=========|""",
|
||||
(3, 9, 4, 31, 32))
|
||||
|
||||
h_102 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 37, 42))
|
||||
|
||||
|
||||
h_103 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|=========|""",
|
||||
(3, 9, 4, 96, 42))
|
||||
|
||||
|
||||
h_104 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 54, 45))
|
||||
|
||||
|
||||
h_105 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 93, 47))
|
||||
|
||||
|
||||
h_106 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|=========|""",
|
||||
(3, 9, 4, 52, 49))
|
||||
|
||||
|
||||
h_107 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=|^|=========|""",
|
||||
(3, 9, 4, 82, 50))
|
||||
|
||||
|
||||
h_108 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 18, 53))
|
||||
|
||||
|
||||
h_109 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 25, 56))
|
||||
|
||||
|
||||
h_110 = (r"""
|
||||
|=============|
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
| |
|
||||
|=========|^|=|""",
|
||||
(11, 9, 4, 43, 59))
|
||||
|
||||
|
||||
niflheim_entities = (
|
||||
[0, '*', 4, 95, 30, 'stand by'],
|
||||
|
|
|
@ -12,7 +12,7 @@ vanaheim = (r"""
|
|||
/ \ / \ /\ / \ __ |_ o\ /\ / \
|
||||
/ \ / \ _ /<>\ |^|_| / \
|
||||
/ \ /\ / \ /o\ |_^| / \ /\
|
||||
/ \ / \ |_| _ / \ / \
|
||||
/ \ / \ |^| _ / \ / \
|
||||
/\ / \ /\ ### . ###### ###### /o\ /\ /
|
||||
\ / / \ ##### ### ###### ###### |^| / \ /
|
||||
\ /\ / \ ### '. ##### ##### ##### / \ /\
|
||||
|
@ -28,7 +28,7 @@ vanaheim = (r"""
|
|||
\ / \ /|\ |^| . |^_| .' / \ /\ /
|
||||
\ /\ / \ ` ``' ### , _ / \ / \
|
||||
/ \ / \ /\ _ ##### ', /-\ / \
|
||||
/ \ / \ . / \ ### , |_| /\ \ /
|
||||
/ \ / \ . / \ ### , |^| /\ \ /
|
||||
/ \ /\ / \ |^| /|\ , ` / \ /
|
||||
/ \ / \ ,. _ ',` '' / \ /\
|
||||
/ \ ### _/ \ ### _____ ' / \ / \
|
||||
|
@ -41,7 +41,7 @@ vanaheim = (r"""
|
|||
/\ / \ /\ ' ### ##### /\ \
|
||||
/ \ / \ ` /|\ _ ### _ / \
|
||||
/ \ / \ /\ .. /o\ ./|\ /o\ / \ /\
|
||||
/ \ /\ / \ / \ .'' |^| ,'`' ',` |_| /\ / \ /
|
||||
/ \ /\ / \ / \ .'' |^| ,'`' ',` |^| /\ / \ /
|
||||
/ \ / \ ,., .,`, /\ ', ,` / \ /
|
||||
/\ / \ /\ / \ /\ / \ / \ /\ /
|
||||
/ \ / \ / \ / \ /\ / \ /\ / \ / \
|
||||
|
|
Loading…
Reference in New Issue