Skip to content

Commit

Permalink
Merge pull request #74 from Edern76/AstarAlgoithmWithSecondary
Browse files Browse the repository at this point in the history
Astar algoithm with secondary
  • Loading branch information
Edern76 authored May 2, 2017
2 parents 4eb64d2 + 50ff70d commit 7666492
Show file tree
Hide file tree
Showing 64 changed files with 12,030 additions and 1,413 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ build
save
__pycache__
code/__pycache__

*.pyc
code/__pycache__/charGen.cpython-35.pyc
code/__pycache__/constants.cpython-35.pyc
code/__pycache__/menu.cpython-35.pyc
.pydevproject
New-Gitmessage.ps1
tags.txt
rectangles.txt
rectangles.txt
metasave/meta.bak
metasave/meta.dat
metasave/meta.dir
assets/sound/Bumpy_Roots.wav
assets/sound/Dusty_Feelings.wav
assets/sound/Hoxton_Princess.wav
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The files in the tdlib folder are from Kyle Stewart's TDL module, and have therefore their own license. See the TDL-License.txt file in the tdlib folder for more details.
The file DilledShelve.py in the code package is a modification of the shelve module of the Python Standard Library, which falls under the Python Software Fundation License. See shelve-License.txt in the code folder for more details.
The file XpLoaderPy3.py is a modification of Sean Hagar's XpLoader module, which falls under the MIT License. See XPl-License.txt file in the code folder for more details.
This software uses libraries from the FFmpeg project under the LGPLv2.1

If you downloaded this software as 'frozen' binaries, be aware that some other thrid-party libraries and/or modules might have been included by cx_Freeze. Such libraries/modules belong to their respective owners.

Expand Down
Binary file modified assets/ascii/longSword.xp
Binary file not shown.
Binary file added assets/ascii/rustyLongSword.xp
Binary file not shown.
Binary file added assets/ascii/rustyShortSword.xp
Binary file not shown.
Binary file added assets/ascii/sharpLongSword.xp
Binary file not shown.
Binary file added assets/ascii/sharpShortSword.xp
Binary file not shown.
Binary file added assets/ascii/shield.xp
Binary file not shown.
Binary file added assets/ascii/spellbook.xp
Binary file not shown.
Binary file added assets/music/Bumpy_Roots.mp3
Binary file not shown.
Binary file added assets/music/Dusty_Feelings.mp3
Binary file not shown.
Binary file added assets/music/Hoxton_Princess.mp3
Binary file not shown.
Binary file added assets/sound/miss.wav
Binary file not shown.
Binary file added assets/sound/selectClic.wav
Binary file not shown.
2 changes: 2 additions & 0 deletions code/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
vowels = ["a", "e", "i", "o", "u", "y"]
consonants = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "z"]

killerSyn = ['slayer', 'bane', 'killer', 'butcher', 'executioner', 'exterminator', 'assassin', 'liquidator', 'annihilator', 'destructor', 'headhunter', 'torturer', 'massacrer']

K_LIMIT = 2
W_LIMIT = 1
X_LIMIT = 1
Expand Down
14 changes: 14 additions & 0 deletions code/custom_except.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class UnusableMethodException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message


class IllegalTileInvasion(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
warningToPrint = ("A room cannot claim a tile that doesn't belong to it. \n")
finalMessage = warningToPrint + self.message
return finalMessage
35 changes: 34 additions & 1 deletion code/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def formatText(text, w):

return outputText

creditText = "Created by Erwan CASTIONI and Gawein LE GOFF. \n \n Using a modified version of the TDL module by Kyle Stewart and a modified version of the XpLoader module by Sean Hagar \n This software uses libraries from the FFmpeg project under the LGPLv2.1 \n Made with Python 3. \n \n Music from Jukedeck - create your own at http://jukedeck.com \n \n Special thanks to Francesco V. who launched the game once."

class DialogTree:
def __init__(self, screenList, name, origScreen):
self.screenList = screenList
Expand Down Expand Up @@ -74,6 +76,8 @@ def select(self):
raise AttributeError('No previous screen found')
elif self.idT == 'END':
return 'END'
elif self.idT == 'SHOP':
return 'SHOP'

else:
for screen in rootTree.screenList:
Expand All @@ -86,6 +90,13 @@ def select(self):


######################PUKIL THE DEBUGGER#########################
'''
@race : Human
@gender : Male
@age : Old/Very old
@profession : Former 'debugger'
'''


#######Intro Screen########
pukIntText = "'It is a rare event to encounter a new face around here, and a even rarer one to find a new face which doesn't belongs to something which wants nothing but your death. \n I am Pukil the Debugger, but you can call me Pukil if you want. Make yourself at home here, but please tell me if you see any bug'"
Expand Down Expand Up @@ -156,4 +167,26 @@ def select(self):

pukScrList = [pukIntScr, pukStrScr, pukDbgScr, pukBugScr, pukDgrScr, pukStpScr]

pukTree = DialogTree(screenList= pukScrList, name = 'Pukil', origScreen= pukScrList[0])
pukTree = DialogTree(screenList= pukScrList, name = 'Pukil', origScreen= pukScrList[0])


######################AYETH THE INSECTOID MERCHANT#########################
'''
@race : Insectoid
@gender : Female
@age : Child
@profession : Merchant
TO-DO : Add more dialog than jusy the 'enter shop' option
'''

ayeIntText = 'Greetings adventurer ! Would you buy me a little something ? I make the best pies of all [INSERT WORLD NAME HERE] !'
ayeIntId = 'intro'
ayeIntCh1 = DialogChoice(idT= 'SHOP', text = 'Sure, let me take a look at your wares. (Enter shop)')
ayeIntCh2 = DialogChoice(idT = 'END', text = "I'm busy right now, maybe at a later time ? (End conversation)")

ayeIntClist = [ayeIntCh1, ayeIntCh2]
ayeIntScr = DialogScreen(idT= 'intro', dialogText= ayeIntText, choicesList = ayeIntClist)

ayeScrList = [ayeIntScr]
ayeTree = DialogTree(screenList = ayeScrList, name = 'Ayeth', origScreen= ayeScrList[0])
6 changes: 5 additions & 1 deletion code/dunbranches.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import colors

class Branch:
def __init__(self, shortName, name = None, maxDepth = 99999, branchesFrom = None, branchesTo = None, lightStairsColor = colors.white, darkStairsColor = colors.dark_gray,
monsterChances = {'darksoul': 600, 'ogre': 200, 'snake': 50, 'cultist': 150, 'highCultist' : 0},
Expand All @@ -9,7 +10,7 @@ def __init__(self, shortName, name = None, maxDepth = 99999, branchesFrom = None
weaponChances = {'sword': 25, 'axe': 25, 'hammer': 25, 'mace': 25},
foodChances = {'bread' : 500, 'herbs' : 501, 'rMeat' : 300, 'pie' : 200, 'pasta' : 200, 'meat' : 100, 'hBaguette' : 10}, # TO-DO : Add dumb stuff here with very low chances of spawning (maybe more on Gluttony's branch ?) and dumb effects, aka easter eggs.
color_dark_wall = colors.darkest_grey, color_light_wall = colors.darker_grey, color_dark_ground = colors.darkest_sepia, color_dark_gravel = (27, 20, 0),
color_light_ground = colors.darker_sepia, color_light_gravel = (50, 37, 0), bossLevels = [3, 6], bossNames = {'High Inquisitor': 3, 'Gluttony': 6}, fixedMap = None):
color_light_ground = colors.darker_sepia, color_light_gravel = (50, 37, 0), bossLevels = [3, 6], bossNames = {'High Inquisitor': 3, 'Gluttony': 6}, fixedMap = None, genType = 'dungeon'):
"""
A branch of the dungeon. Please note that the main dungeon is also considered as a branch.
@type shortName: str
Expand Down Expand Up @@ -48,11 +49,14 @@ def __init__(self, shortName, name = None, maxDepth = 99999, branchesFrom = None
self.bossLevels = bossLevels
self.bossNames = bossNames
self.fixedMap = fixedMap
self.genType = genType

mainDungeon = Branch(shortName = "main", name = "Main", branchesTo = None)
gluttonyDungeon = Branch(shortName = "glutt", name = "Gluttony Dungeon", maxDepth = 5, branchesFrom = (mainDungeon, 1), lightStairsColor = colors.desaturated_chartreuse, darkStairsColor = colors.darkest_chartreuse, monsterChances = {'darksoul': 400, 'ogre': 200, 'starveling': 250, 'cultist': 150}, itemChances = {'potion': 360, 'scroll': 20, 'weapon': 20, 'shield': 100, 'food': 500}, bossLevels = [5], bossNames = {'Gluttony': 5})
hiddenTown = Branch(shortName = 'town',name = "Hidden Refuge", maxDepth = 1, branchesFrom = (mainDungeon, 1),lightStairsColor = colors.azure, darkStairsColor = colors.darker_azure, fixedMap = 'town')
greedDungeon = Branch(shortName = 'greed', name = 'Greed Cavern', maxDepth = 5, branchesFrom= (mainDungeon, 2), lightStairsColor = colors.yellow, darkStairsColor = colors.darker_yellow, genType = 'cave', monsterChances = {'darksoul': 400, 'ogre': 100, 'snake': 10, 'cultist': 150, 'greedyFiend' : 200}, color_light_wall = colors.darker_yellow, color_dark_wall = colors.darkest_yellow, color_light_ground = colors.darker_sepia, color_dark_ground = colors.darkest_sepia, itemChances = {'potion': 100, 'scroll': 150, 'weapon': 50, 'shield': 50, 'food': 90, 'money' : 300})

mainDungeon.branchesTo.append((gluttonyDungeon, 1))
mainDungeon.branchesTo.append((hiddenTown, 1))
mainDungeon.branchesTo.append((greedDungeon, 2))

Loading

0 comments on commit 7666492

Please sign in to comment.