Today wasn't the best of days for me at least... even simplest thing I seem to have gotten right only from 2 - 3 try.
But the battle function is done, I don't think starting battle sequences can get any easier than using it.
Pushed:
- Added A's new girlsmeets
- Added new function for super easy start of battle sequences
-----------------------------------------------
On how to use the function:
def start_battle(player_team, enemy_team, music=None, background=None, pt_ai=False):
'''
Bridge to battle engine, idea is to try and make it as easy as possible.
player_team/enemy_team: iterables
music: path to a music file
background: Displayable
pt_ai: if AI Fighter is required on player team, should be a list of booleans of same length as player_team (True for AI, False for Player control)
'''
in any label:
$ r = start_battle([hero], [copy.deepcopy(choice(pytfall.mobs.values()))], background="bg battle_forest_1")
This will start a fight between hero and randomly chosen mob at it's base powerlevel with forest background for example.
background and music should be obvious.
For iterable a list, tuple or Team should be used. If it's Team, leader will be set to center, if list or tuple, order will be preserved.
It's up to you to give out rewards, take off AP, mod stats or experience as a result of the battle. It will not be possible to die during the battle until death plays a more prominent role in the game. If it's a mob or some NPC you've created, feel free to tell the world that it's dead.
After fight is over, you'll be returned to the same label where you've left of and r or whatever variable you've used will be set to a tuple of (True, <list of dead teammembers> in case of a victory or (False, []) in case of defeat.
I think this is it...