UQcsse3200 / 2024-studio-2

MIT License
6 stars 1 forks source link

Bug Fix to Incorrect Handling of Losing in Combat #621

Closed ChristianMario4 closed 1 month ago

ChristianMario4 commented 1 month ago

Description

Previously, nothing special would happen when a combat loss with a regular enemy NPC was experienced. However now, combat loss is handled properly. When the player loses to a regular enemy NPC, upon spawning back into the main map, their whole inventory is wiped and all their current experience progress in this level (eg they're level 2 with 80 experience points on the way to level 3, but once they lose, they're still level 2 but with no experience points on the way to level 3). However, they are respawned with half of their hunger and health so that they have something to work with after dying.

Fixes / Closes # (issue)

Type of change

How Has This Been Tested?

Visual Testing through play throughs has been completed to ensure this works to test this there's two ways.

Quick Way: Walk around and pick-up some items before going into combat (don't need much, literally one or two will do). Go into combat and kill one animal (so that you gain some exp)(You can use insta-kill if you want). Then after this go into combat again and click the insta-lose button. You will see that when returning to the overworld, you lose all your progress experience, your health and hunger are now at 50%, and your inventory is gone (on the sidebar).

Long Way: Exactly the same as the short way, except you defeat the first enemy manually using attack button. And before going into the second combat, find a monkey that can damage you enough so that when you go into combat with it, you can almost guarantee that if you keep guarding or sleeping that if it attacks, it will kill you (this way is kind of painful because it takes a minute for the monkey to throw enough bananas to damage you enough).

Checklist: