-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Player needs to meet job requirements before switching
The player needs a certain amount of stat points in order to change. The player needs to be the correct race. The player needs to have mastered X number of skills from job Y in order to change. Added a Rogue class. Player starts as Soldier. Improve readability of SkillDirectoryProcessor. Added message feedback when trying to swtich jobs. Reduce duplicate code in WearableProcessor. Change structure of SkillDirectoryComponent, and updated codebase to reflect this.
- Loading branch information
Showing
9 changed files
with
165 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,39 @@ | ||
class Job: | ||
def __init__(self, description, name, races, upkeep): | ||
def __init__(self, description, name, races, skills, upkeep): | ||
self.description = description # Type: str | ||
self.name = name # Type: str | ||
self.races = races # Type: list | ||
self.skills = skills # Type: dict {'job': number} | ||
self.upkeep = upkeep # Type: dict {'stat': penalty value} | ||
|
||
|
||
JOBS = { | ||
'soldier': Job( | ||
description="Baby's first job.", | ||
name='soldier', | ||
upkeep={}, | ||
races=('human',) | ||
races=('human',), | ||
skills={}, | ||
upkeep={} | ||
), | ||
'warrior': Job( | ||
description='Has access to more devastating skills.', # Not rly. | ||
name='warrior', | ||
upkeep={'magic': 1, 'speed': 2}, | ||
races=('human',) | ||
races=('human',), | ||
skills={}, | ||
upkeep={'magic': 1, 'speed': 2} | ||
), | ||
'beserker': Job( | ||
description='Classic orc.', | ||
name='beserker', | ||
upkeep={'speed': 1, 'hp': 1}, | ||
races=('orc',) | ||
races=('orc',), | ||
skills={}, | ||
upkeep={'speed': 1, 'hp': 1} | ||
), | ||
'rogue': Job( | ||
description='A job for seasoned fighters.', | ||
name='rogue', | ||
races=('human', 'goblin'), | ||
skills={'soldier': 1}, | ||
upkeep={'speed': 1, 'hp': 15} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
class SkillDirectoryComponent: | ||
def __init__(self): | ||
self.skill_directory = {} | ||
def __init__(self, job='unemployed'): | ||
self.skill_directory = {job: {}} | ||
|
||
""" | ||
Usage Example: | ||
self.skill_directory = { | ||
'bash': (85, 100), | ||
'slash': (100, 100), | ||
'skill_name': (current_ap, max_ap) | ||
'soldier': { | ||
'bash': (85, 100), | ||
'slash': (100, 100), | ||
'skill_name': (current_ap, max_ap) | ||
}, | ||
'job_name': { | ||
} | ||
} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,5 @@ def main(): | |
|
||
if __name__ == '__main__': | ||
# cProfile.run('main()') # This runs the profiler | ||
main() | ||
main() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters