diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/__pycache__/parser.cpython-34.pyc b/src/__pycache__/parser.cpython-34.pyc new file mode 100644 index 0000000..3c0874d --- /dev/null +++ b/src/__pycache__/parser.cpython-34.pyc Binary files differ diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/__pycache__/parser.cpython-34.pyc b/src/__pycache__/parser.cpython-34.pyc new file mode 100644 index 0000000..3c0874d --- /dev/null +++ b/src/__pycache__/parser.cpython-34.pyc Binary files differ diff --git a/src/atlantis.py b/src/atlantis.py new file mode 100644 index 0000000..7b79720 --- /dev/null +++ b/src/atlantis.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +VERSION = (0, 0, 1) #release, major revision, minor revision + +import sys +from parser import Parser + + +def print_version(): + version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) + print("Atlantis "+version_string) + print("Licensed under the terms of the GNU General Public License v3.") + +def print_help(): + print_version() + print("\nHelp text not yet available.") + +def main(): + if "--version" in sys.argv or "-v" in sys.argv: print_version() + elif "--help" in sys.argv or "-h" in sys.argv: print_help() + elif "--world" in sys.argv: + world_file = sys.argv[sys.argv.index("--world")+1] + Parser(world_file) + else: + print("Interactive mode not yet available!") + +if __name__ == "__main__": + main() diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/__pycache__/parser.cpython-34.pyc b/src/__pycache__/parser.cpython-34.pyc new file mode 100644 index 0000000..3c0874d --- /dev/null +++ b/src/__pycache__/parser.cpython-34.pyc Binary files differ diff --git a/src/atlantis.py b/src/atlantis.py new file mode 100644 index 0000000..7b79720 --- /dev/null +++ b/src/atlantis.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +VERSION = (0, 0, 1) #release, major revision, minor revision + +import sys +from parser import Parser + + +def print_version(): + version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) + print("Atlantis "+version_string) + print("Licensed under the terms of the GNU General Public License v3.") + +def print_help(): + print_version() + print("\nHelp text not yet available.") + +def main(): + if "--version" in sys.argv or "-v" in sys.argv: print_version() + elif "--help" in sys.argv or "-h" in sys.argv: print_help() + elif "--world" in sys.argv: + world_file = sys.argv[sys.argv.index("--world")+1] + Parser(world_file) + else: + print("Interactive mode not yet available!") + +if __name__ == "__main__": + main() diff --git a/src/parser.py b/src/parser.py new file mode 100644 index 0000000..d17135e --- /dev/null +++ b/src/parser.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# This module reads in a world file and parses it. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +class DefineCommand(object): + ''' + This is the super class for all define commands. It should be extended + for each individual command, like define-place, define-monster, etc. + ''' + + def __init__(self): + pass + + +class Parser(object): + ''' + The actual parser class. It reads in a world file and transforms it into + a series of DefineCommands. + ''' + + def __init__(self, world_file): + print("Loading world file '"+world_file+"'...") diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/__pycache__/parser.cpython-34.pyc b/src/__pycache__/parser.cpython-34.pyc new file mode 100644 index 0000000..3c0874d --- /dev/null +++ b/src/__pycache__/parser.cpython-34.pyc Binary files differ diff --git a/src/atlantis.py b/src/atlantis.py new file mode 100644 index 0000000..7b79720 --- /dev/null +++ b/src/atlantis.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +VERSION = (0, 0, 1) #release, major revision, minor revision + +import sys +from parser import Parser + + +def print_version(): + version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) + print("Atlantis "+version_string) + print("Licensed under the terms of the GNU General Public License v3.") + +def print_help(): + print_version() + print("\nHelp text not yet available.") + +def main(): + if "--version" in sys.argv or "-v" in sys.argv: print_version() + elif "--help" in sys.argv or "-h" in sys.argv: print_help() + elif "--world" in sys.argv: + world_file = sys.argv[sys.argv.index("--world")+1] + Parser(world_file) + else: + print("Interactive mode not yet available!") + +if __name__ == "__main__": + main() diff --git a/src/parser.py b/src/parser.py new file mode 100644 index 0000000..d17135e --- /dev/null +++ b/src/parser.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# This module reads in a world file and parses it. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +class DefineCommand(object): + ''' + This is the super class for all define commands. It should be extended + for each individual command, like define-place, define-monster, etc. + ''' + + def __init__(self): + pass + + +class Parser(object): + ''' + The actual parser class. It reads in a world file and transforms it into + a series of DefineCommands. + ''' + + def __init__(self, world_file): + print("Loading world file '"+world_file+"'...") diff --git a/src/ui.py b/src/ui.py new file mode 100644 index 0000000..b78baae --- /dev/null +++ b/src/ui.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# This is the (text) UI module - all commandline IO should pass through here. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + + +# +# DO NOT USE YET !!! +# + +class IO(object): + ''' + A wrapper to stdout, stderr and stdin. + Intendend for development work only! + ''' + + def __init__(self): + pass + + def error(self, error_text): + pass diff --git a/src/Atlantis.py b/src/Atlantis.py deleted file mode 100644 index 144f983..0000000 --- a/src/Atlantis.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python3 -# -# Atlantis is a framework for creating multi-user dungeon worlds. -# -# Licensed under the terms of the GPLv3 -# author: Daniel Vedder -# date: 02/05/2015 -# - -VERSION = (0, 0, 1) #release, major revision, minor revision - -import sys - - -def print_version(): - version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) - print("Atlantis "+version_string) - print("Licensed under the terms of the GNU General Public License v3.") - -def print_help(): - print_version() - print("\nHelp text not yet available.") - -def main(): - if "--version" in sys.argv or "-v" in sys.argv: print_version() - elif "--help" in sys.argv or "-h" in sys.argv: print_help() - -if __name__ == "__main__": - main() diff --git a/src/__pycache__/parser.cpython-34.pyc b/src/__pycache__/parser.cpython-34.pyc new file mode 100644 index 0000000..3c0874d --- /dev/null +++ b/src/__pycache__/parser.cpython-34.pyc Binary files differ diff --git a/src/atlantis.py b/src/atlantis.py new file mode 100644 index 0000000..7b79720 --- /dev/null +++ b/src/atlantis.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +VERSION = (0, 0, 1) #release, major revision, minor revision + +import sys +from parser import Parser + + +def print_version(): + version_string = str(VERSION[0])+"."+str(VERSION[1])+"."+str(VERSION[2]) + print("Atlantis "+version_string) + print("Licensed under the terms of the GNU General Public License v3.") + +def print_help(): + print_version() + print("\nHelp text not yet available.") + +def main(): + if "--version" in sys.argv or "-v" in sys.argv: print_version() + elif "--help" in sys.argv or "-h" in sys.argv: print_help() + elif "--world" in sys.argv: + world_file = sys.argv[sys.argv.index("--world")+1] + Parser(world_file) + else: + print("Interactive mode not yet available!") + +if __name__ == "__main__": + main() diff --git a/src/parser.py b/src/parser.py new file mode 100644 index 0000000..d17135e --- /dev/null +++ b/src/parser.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# This module reads in a world file and parses it. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + +class DefineCommand(object): + ''' + This is the super class for all define commands. It should be extended + for each individual command, like define-place, define-monster, etc. + ''' + + def __init__(self): + pass + + +class Parser(object): + ''' + The actual parser class. It reads in a world file and transforms it into + a series of DefineCommands. + ''' + + def __init__(self, world_file): + print("Loading world file '"+world_file+"'...") diff --git a/src/ui.py b/src/ui.py new file mode 100644 index 0000000..b78baae --- /dev/null +++ b/src/ui.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 +# +# Atlantis is a framework for creating multi-user dungeon worlds. +# This is the (text) UI module - all commandline IO should pass through here. +# +# Licensed under the terms of the GPLv3 +# author: Daniel Vedder +# date: 02/05/2015 +# + + +# +# DO NOT USE YET !!! +# + +class IO(object): + ''' + A wrapper to stdout, stderr and stdin. + Intendend for development work only! + ''' + + def __init__(self): + pass + + def error(self, error_text): + pass diff --git a/worlds/Example/example.atl b/worlds/Example/example.atl new file mode 100644 index 0000000..1087d86 --- /dev/null +++ b/worlds/Example/example.atl @@ -0,0 +1,69 @@ +# This is an example Atlantis file - I use it to explore what the language +# should end up looking like. + +load races.atl +load classes.atl + + +define-quest Kill hellhound + objective kill hellhound + reward gold 300 + + +define-spell Ray of death + type kill + min-intelligence 12 + success-rate 35 + + +define-npc Hades + say Oh, amazing, you actually got here! Who did you bribe? + sell 30 Ambrosia + quest Kill hellhound + + +define-item Scroll of light + value 80 + add-experience 20 + add-spell Ray of death + +define-item Ambrosia + category Food + add-health 5 + + +define-monster Hellhound + armor-class 8 + strength 10 + melee-weapon 2 claws + experience 50 + spawn 2 + aggression 60 + +define-monster Fury + armor-class 5 + strength 8 + melee-weapon 10 fire whip + experience 74 + spawn 0.8 + aggression 30 + + +define-place Nowhere + description Welcome to Nowhere! You are in the void, the space between \ +the worlds. Around you is black. Black, except for one tiny pin-prick of light \ +to the north. + north Elysium + +define-place Elysium + description Congratulations! You have achieved Elysium! + south Nowhere + west Fields of punishment + npc Hades + item Scroll of light + +define-place Fields of punishment + description You really, really don't want to end up here... + east Elysium + monster Hellhound + monster Fury