Git workflow group task.
Choose one member of your group to do these first steps:
Fork and clone this repository. Then add the other members of your group as collaborators, giving them write permission to the repo.
Open the repository:
cd git-quest/Install dependencies:
npm installRun tests:
npm testMake a dev branch from master:
git checkout -b devFor this challenge you will be working together to add features to a pre-existing code base. Each new set of additions should be made on a separate branch before being merged into dev. Take turns with driver and navigator roles to practice the git workflow concepts you've learned. Complete the pull and merge cycle onto dev with each of the following sets of additions:
Make these additions to the Character prototype:
-
Characters should have a
levelproperty at their construction, unless otherwise stated it should be level 1. -
Characters should have a
baseAttackandbaseDefenseproperty at their construction. These should be0unless otherwise stated. -
Characters should have a
get attackTotalandget defenseTotalmethod. It should return the appropriate property added to thelevel. For exampleCharacter.attackTotal()should returnbaseAttack + level.
Make these additions to the Enemy prototype:
-
Enemies no longer need their damage property. Instead, they will base their damage on the
Character.attackTotal()method. Re-write the tests to account for this. -
Enemies should have an
experienceRewardproperty. If this is not set at construction, it should be100by default. -
Enemies should not be able to attack if they are dead. Add a guard clause to prevent this.
Make these additions to the Player prototype:
-
Players should have a
levelUpmethod that increases theirlevelby one. -
Players should have a
nextLevelproperty at creation, this should be1000by default. -
Players should have a
currentExperienceproperty at creation, this should be set to0by default. -
Players should now calculate the damage dealt to targets as
attackTotal+weapon.damage. -
Change the
Player.attack(target)method so that a killing blow will add the target'sexperienceRewardto thePlayer.currentExperience. -
After a killing blow and experience reward, Players should check if their
currentExperienceis equal to or greater than theirnextLevelproperty. If so, thelevelUp()method should be called, and a newnextLeveltarget that is 10% larger should be set.