Open justdanyuen opened 3 months ago
/hero/check_health/{health_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response:
{ "health": 50 } /moster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/2?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''
Response: { "success": true }
/hero/check_health/{health_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response:
{ "health": 46 }
There was a net -4 change in health after attacking, so successful modification to hero's health.
Response: [ { "id": 3, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 4, "name": "Coconut Slime", "level": 5, "health": 11, "power": 4 }, { "id": 5, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 6, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 7, "name": "Coconut Slime", "level": 5, "health": 11, "power": 4 }, { "id": 8, "name": "Coconut Slime", "level": 4, "health": 10, "power": 3 }, { "id": 20, "name": "Cyclops", "level": 13, "health": 80, "power": 35 } ]
We will use Cyclops (id 20) to attack our hero.
/monster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/20?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''
Response: Response: { "success": true }
Let's check the hero's health. /hero/check_health{hero_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response: { "health": 11 }
The attack wasn't enough to kill the hero, let's attack again. /monster/attack_hero/{monster_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/monster/attack_hero/20?hero_id=1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''
Response: Response: { "success": true }
Let's check the hero's health again. /hero/check_health{hero_id} curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_health/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response: { "health": -24 }
The hero has negative health, so let's make sure it dies properly.
/hero/die/{hero_id} curl -X 'POST' \ 'https://arthurslastcrusade.onrender.com/hero/die/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934' \ -d ''
Response:
{ "success": true }
After executing the die command, it was unclear which method to check if the hero was still in the guild.
response: Internal Server Error
Testing on existing heroes instead:
curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/world/view_heroes/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response:
[ { "name": "Olivia", "power": 10, "health": 50 }, { "name": "Madison", "power": 10, "health": 50 } ] /hero/check_xp/{hero_id}
curl -X 'GET' \ 'https://arthurslastcrusade.onrender.com/hero/check_xp/1' \ -H 'accept: application/json' \ -H 'access_token: 4888d45f8ecd9127e7b5aef96fb5f934'
Response: { "xp": 0 }
Unclear which hero this id is associated to without looking at the database. I'd recommend logging which hero we accessed with a print statment.