Tutorial

Launch an attack

Launch an attack by calling /fights/:gameToken/players/:playerKey/actions/:actionName in POST with :

  • gameToken : the token of the game
  • playerKey : the key or id of your player
  • actionName : the name of the attack, available inside character informations.
curl -X POST --header 'Content-Type: application/json'
    --header 'Accept: application/json'
    'https://coding-game.swat-sii.fr/api/fights/9nrrx5/players/vog/actions/SWORD_STROKE'

The response of the API is a JSON with these informations about the state of the game :

{
  "token": "9nrrx5",
  "status": "PLAYING",
  "countDown": 0,
  "me": {
    "healthPoints": 1000,
    "armor": 20,
    "character": {
      "armor": 20,
      "name": "WARRIOR",
      "actions": [
        {
          "name": "SWORD_STROKE",
          "description": null,
          "coolDown": 1
        },
        {
          "name": "THRUST",
          "description": null,
          "coolDown": 2
        },
        {
          "name": "STRONG_STROKE",
          "description": null,
          "coolDown": 4
        },
        {
          "name": "HEATER_SHIELD",
          "description": null,
          "coolDown": 1
        }
      ]
    }
  },
  "foe": {
    "healthPoints": 920,
    "armor": 40,
    "character": {
      "armor": 40,
      "name": "PALADIN",
      "actions": [
        {
          "name": "CLAYMORE_STROKE",
          "description": null,
          "coolDown": 1
        },
        {
          "name": "POTION",
          "description": null,
          "coolDown": 1
        },
        {
          "name": "MIGHTY_STROKE",
          "description": null,
          "coolDown": 4
        },
        {
          "name": "BIG_SHIELD",
          "description": null,
          "coolDown": 1
        }
      ]
    },
    "history": [],
    "isBehindShield": false
  }
}

results matching ""

    No results matching ""