nskins / goby

Command-line role-playing game framework
MIT License
122 stars 56 forks source link

Party Class #98

Open nskins opened 7 years ago

nskins commented 7 years ago

We should write a class called Party that can hold a variable number of Entity members. This would make it so that one can control multiple Players on the world map and in battle. Additionally, we can then fight multiple Monsters on the world map.

Many of the functions from the Player class will likely be moved over to Party (such as #battle). We will need to make it so that #save_game and #load_game save the Party instead of the Player. One invariant might be that no Entity can have the same name as another within a Party (fixes ambiguity issue). I will update this issue as I think of any additional needed changes.

Pull requests can be sent to the party branch.

rdavid1099 commented 7 years ago

@nskins I can take a look at this this weekend. My schedule is a bit wonky over these next few weeks, but I should be able to make some progress on this on the weekends and random weeknights when I'm free.

nskins commented 7 years ago

@rdavid1099 Great! I will try to help work on it. It will be nice to have two pairs of eyes looking at this one. I foresee some design choices that I'm not entirely sure about myself...

rdavid1099 commented 7 years ago

@nskins For sure... this seems like a really fun problem to tackle. Like I said, most of my free time will be on the weekends, but I will keep in contact. 😄

nskins commented 7 years ago

Update on this issue: I implemented much of the Party class and rewrote many of the existing functions (switching Entity/Player -> Party). One of the remaining issues is that some commands on the world map must accept a particular member of the Party. For example, in the following command:

$ use apple

becomes

$ nick use apple

since the party member must be specified. The equip and unequip commands must be altered similarly. Also, status might optionally accept a party member. Without a party member, perhaps it would display all party member statuses.

The other issue is that the battle system must be rewritten to account for multiple Entities in battle. Various changes are necessary.

At the very end, we can delete all of the functions that are in Entity and Player that have been migrated over to Party. I've left them in right now to prevent everything from breaking in this strange middle stage.

nskins commented 7 years ago

Hi @rdavid1099, I want to let you know that all that remains is implementing #Party.battle and removing the Entity & Player functions that are no longer needed. Unfortunately, I'm unsure how to write #battle. There needs to be a way to choose the order of attacks (similarly to the current way) along with other issues. I invite you to work on this if you have any ideas, but I'm a bit lost myself right now!