brunolcarli / ggj23_server

MMO server for Global Game Jam 2023
0 stars 0 forks source link

Implementar models e serializadores da API #13

Open brunolcarli opened 1 year ago

brunolcarli commented 1 year ago

URL da API: https://ggj23server.brunolcarli.repl.co/graphql/

brunolcarli commented 1 year ago

Implementar models conforme:

https://github.com/brunolcarli/ggj23_server/issues/11

brunolcarli commented 1 year ago

Implementar consultas GraphQL na API conforme https://github.com/brunolcarli/ggj23_server/issues/11

brunolcarli commented 1 year ago

Requisição para criar personagem

🆗

Image

Snippet de exemplo:

mutation create_char{
  createCharacter(input: {
       name: "spam"
    characterClass: TANKER
    username: "spam"
    email: "spam@eggs"
  }){
    character {
      name
      lv
      nextLv
      exp
      maxHp
      maxSp
      currentHp
      currentSp
      power
      resistance
      agility
      isKo
      isLogged
      lastActivity
      positionX
      positionY
      areaLocation
      classType
      aim
      skills {
        name
        spCost
        power
        range
        description
        effect {
          duration
          value
          condition
        }
      }
    }
  }
}
brunolcarli commented 1 year ago

Consultar personagens

🆗

Image

Snippet d exemplo:

query characters{
  characters {
    name
    lv
    nextLv
    exp
    maxHp
    maxSp
    currentHp
    currentSp
    power
    resistance
    agility
    isKo
    isLogged
    lastActivity
    positionX
    positionY
    areaLocation
    classType
    aim
    quests{
      name
      completed
      description
    }
    equipment{
      head {
        name
        description
      }
      torso{
        name
        description
      }
      legs{
        name
        description
      }
      weapon{
        name
        description
      }
      shield{
        name
        description
      }
      accessory1{
        name
        description
      }
      accessory2{
        name
        description
      }
    }
    effects{
      targetAttributes
      duration
      value
      condition
    }
    items{
      name
      kind
      effect{
        targetAttributes
        duration
        value
        condition
      }
      count
    }
    skills{
      name
      spCost
      power
      range
      description
      classes
      effect{
        targetAttributes
        duration
        value
        condition
      }
    }
  }
}
brunolcarli commented 1 year ago

Consultar skills

🆗

Image

Snippet de exemplo:

query skills {
  skills {
    name
    spCost
    power
    range
    description
    effect {
      targetAttributes
      duration
      value
      condition
    }
  }
}
brunolcarli commented 1 year ago

Consultar mapas

Image

Snippet de exemplo:


query map_areas{
  mapAreas {
    name
    sizeX
    sizeY
    connections
  }
}
brunolcarli commented 1 year ago

Logar com personagem

Image

Snippet de exemplo:


mutation charlogin {
  characterLogin(input: {
    id: "1"
  }){
    logStatus
  }
}
brunolcarli commented 1 year ago

Deslogar personagem

Image

Snippet de exemplo:

mutation charlogout {
  characterLogout(input: {
    id: "1"
  }){
    logStatus
  }
}
brunolcarli commented 1 year ago

Mover personagem

Image

Snippet de exemplo:

mutation update_pos{
  updatePosition(input: {
    id: "1"
    location: {
      x: 240
      y: 240
    }
  }){
    character{
      positionX
      positionY
      name
    }
  }
}
brunolcarli commented 1 year ago

Usar skill

Image

Snippet de exemplo:

mutation use_skill {
  characterUseSkill(input:{
    skillUserId: "1"
    targetId: "2"
    skillName: "base_attack"
  }){
    result
  }
}