Final Project developed for the SCC0240 - Database course.
Giovanni Shibaki Camargo – 11796444
João Pedro Gavassa Favoretti – 11316055
Lucas Keiti Anbo Mihara – 11796472
Lucas Pilla Pimentel – 10633328
Rodrigo Lopes Assaf – 11795530
The envisioned application belongs to the reality created within the Pokémon World, a fictional reality. In a general scope, it aims to help manage some of the experiences lived by people in this reality, such as: managing their battles, their items, and their Pokémon. The target user of the application will be the Trainers of the Pokémon World. The term "Trainer" refers to a person in the Pokémon World who has the task of interacting with Pokémon (animals of the fictional world) and training them to make them stronger.
Among the functionalities that the user will find when using the application are: the possibility of creating new battles or joining existing battles in the system, consulting their battle history or that of other trainers, creating new tournaments, which consist of a series of knockout battles so that only the best competitors remain in the final battles, joining tournaments already created by other trainers, creating or joining item or Pokémon trading operations with another trainer, registering the Pokémon obtained in their backpack, which refers to the part of the interface that stores the Pokémon of each trainer. Additionally, the system should record actions during a battle, such as item usage, Pokémon exchange, attack moves, or exiting the battle.
In more detail, below are listed all the concepts used to describe the application: The trainer is an ordinary person in the Pokémon World, but who collects Pokémon and can train them for battles and/or tournaments. Each trainer has a set of Pokémon that belong to him, and these are called pets. Additionally, a trainer can have a set of items, called belongings. He can also have a history of his battles and tournaments he has participated in. To participate in a battle, the trainer can use only a subset of the pets. Each trainer can be distinguished from others by their CPF (Taxpayer Identification Number). Additionally, each trainer has a name, gender, date of birth, and hometown. The trainer can specialize and become a Pokémon Master; for this, the trainer must have a gym and various specialties such as ice, lightning, water, fire, etc. Also, when the trainer becomes a Pokémon Master, he can organize tournaments. The trainer can also register a Pokémon as discovered if he encounters it in nature or in a battle.
Pokémon are creatures that trainers capture, collect, name, and use in battles. Each Pokémon has a unique number to differentiate it from others. When a trainer captures a wild Pokémon, the Pokémon becomes his pet and is stored in the trainer's backpack. Each creature can have 1 or 2 types (fire, water, electric, etc.). Each Pokémon has a set of possible attacks that can be used and can have a maximum of 4 attacks at a time. In addition to the number, each Pokémon has a name and description.
An attack is a move that the Pokémon can perform during battle to harm the opponent Pokémon, with each attack always having exactly 1 type. This attack can
be distinguished from others by its name. Each attack contains a description of the attack, as well as its power, whether it is a strong or weak attack, and the condition it leaves the opponent such as paralyzed, poisoned, burned, etc.
The specific attacks that each Pokémon can have are a subset of all the attacks existing in the Pokémon World. This means that among all the attacks existing in the Pokémon World, each species of Pokémon can have only some of them. Additionally, within the four attacks that each Pokémon currently has, all of them must be within the subset of specific attacks for that species.
There are 18 types in the Pokémon World, among them we can mention fire, water, grass, bug, fairy, dragon, etc. Each of these types can be strong, weak, or immune to other types. The type is uniquely known by a name and has a color associated with it for the interface. Each type has certain advantages over others, meaning an attack of type A has a certain impact multiplier on Pokémon of other types. The value of this multiplier has values between 0, 0.5, 1, and 2, and is used as a factor when calculating the power of each attack. Both Pokémon and attacks have types, with each attack having only one type and the Pokémon can have one or two types.
A pet is a Pokémon of a certain species, but it has been captured by a trainer. Instead of having general information about its species, this entity has specific information about the creature that was captured, such as a name, its nature (if it is calm, aggressive, restless, etc.), its gender, weight, height, and special ability. An example of a special ability is the characteristic of not receiving damage from attacks of a certain type. Additionally, the Pokémon can have special colors, unlike others in its species, and thus will be called shiny. The limit quantity of pets that a trainer has is not defined, being able to have more than one Pokémon of the same species. Each pet is identified by its trainer, its name, and its species.
The Pet's Attacks represent the attacks that a certain pet has. These attacks can be at least 1 and at most 4 per Pokémon. These attacks must always belong to the set of attacks that the Pokémon species can possess. Finally, these are the attacks, or moves, that the pet can use during a battle.
Battles are interactions between two teams, each team being formed by a trainer with at most six of their pets. Each battle has a date/time, the final result, and a description of the battle itself, as well as its category. The battle can be identified among others by the trainers who participated in the battle and the date/time of occurrence. A battle is also associated with the items that may have been used in it. The concept of battle can be of two different types: Individual and Competitive. The battle is identified as Competitive when it belongs to a tournament; otherwise, it is identified as Individual. Specifically, the individual battle has the location of occurrence. Similarly, the competitive battle has information about the stage that occurred during the championship, such as elimination, round of 16, quarterfinals, semi-finals, and final, etc.
Tournaments involve several competitive battles and are created by Pokémon Masters. Thus, they have multiple teams. With the tournament bracketing, only one winner will remain at the end. Tournaments are identified by their location and date.
Items are all kinds of products that a trainer can have. Each type of item provides different effects and can be used to increase Pokémon's life, improve a Pokémon's ability, or facilitate the capture of the Pokémon. Items are uniquely identified by their name and have a description of the effect that the item provides.
Belongings are with the goods of each trainer. Each belonging corresponds to an item in a certain quantity. Each belonging can only be used once and has a record of use in battle when used during combat.
We used Intellij to provide a graphical and user-friendly interface to perform the operational prototype, and in the developed application, we used the Oracle relational DBMS provided by the course professor, as well as the Java language in the Oracle OpenJDK 17.0.2 version. In order to enable the connection between the application and the database, the Oracle JDBC Driver was used. The executable code is located in the directory SCC0240_Projeto_BD\out\artifacts\PokemonDB_jar. To execute, just perform the following command:
- java -jar PokemonDB.jar
For the registration functionality, the selected query was the addition of a new trainer to the system, where the interface checks if the data is in the correct format, and there is a check to not insert two trainers with the same key (CPF), accepting null values for non-key attributes.
For the query functionality, the selected query was the selection of a Pokémon in the system, where the interface accepts searches by number, name, and Pokémon types, checking substrings in the case of the name. More than one filter can be applied at a time.
Projeto Final desenvolvido para a matéria SCC0240 - Base de Dados.
Giovanni Shibaki Camargo – 11796444
João Pedro Gavassa Favoretti – 11316055
Lucas Keiti Anbo Mihara – 11796472
Lucas Pilla Pimentel – 10633328
Rodrigo Lopes Assaf – 11795530
A aplicação idealizada pertencerá à realidade criada dentro do Mundo Pokémon, uma realidade fictícia. Em um escopo geral, ela visa ajudar a gerenciar algumas das experiências vividas por parte das pessoas dessa realidade, como: gerenciar suas batalhas, seus itens e seus pokémons. O usuário alvo da aplicação serão os Treinadores do Mundo Pokémon. O nome “Treinador” é a denominação para uma pessoa do Mundo Pokémon que possui o trabalho de interagir com os Pokémons (animais do mundo fictício) e treiná-los para torná-los mais fortes.
Dentre as funcionalidades que o usuário encontrará ao utilizar a aplicação estão: a possibilidade de criar novas batalhas ou entrar em batalhas existentes no sistema, consultar seu histórico de batalhas ou de outros treinadores, criar novos torneios, que consistem em uma série de batalhas chaveadas de forma que nas últimas batalhas só reste os melhores competidores, entrar em torneios já criados por outros treinadores, criar ou entrar em operações de trocas de itens ou pokémons com outro treinador, cadastrar os pokémons obtidos em sua mochila, que se refere à parte da interface que armazena os pokémons de cada treinador. Além disso, o sistema deve registrar as ações durante uma batalha, tais como o uso de itens, troca de pokémon, movimento de ataque ou saída da batalha.
De forma mais detalhada, abaixo serão listados todos os conceitos utilizados para descrever a aplicação: O treinador é uma pessoa comum no Mundo Pokémon, mas que coleciona pokémons e pode treiná-los para batalhas e/ou torneios. Cada treinador possui um conjunto de pokémons que pertencem a ele e estes são chamados de pets. Além disso, um treinador pode possuir um conjunto de itens, chamado de pertences. Ele também pode possuir um histórico de suas batalhas e torneios que participou. Para participar de uma batalha, o treinador pode utilizar somente um subconjunto dos pets. Cada treinador pode ser distinguido dos demais pelo seu CPF. Além disso, cada treinador possui nome, gênero, data de nascimento e sua cidade natal. O treinador pode se especializar e se tornar um Mestre Pokémon, para isso o treinador deve possuir um ginásio e várias especialidades tais como gelo, raio, água, fogo, etc. Além disso, quando o treinador se torna um Mestre Pokémon, ele pode organizar torneios. O treinador também pode cadastrar um pokémon como descoberto caso encontre ele na natureza ou em uma batalha.
Os pokémons são criaturas que os treinadores capturam, colecionam, nomeiam e usam em batalhas. Cada pokémon possui um número único para ser diferenciado dos demais. Quando um treinador captura um pokémon selvagem, o pokémon se torna seu pet e é armazenado na mochila do treinador. Cada criatura pode possuir 1 ou 2 tipos (fogo, água, elétrico, etc). Cada pokémon tem um conjunto de ataques possíveis que podem ser utilizados e podem ter no máximo 4 ataques por vez. Além do número, cada pokémon tem um nome e sua descrição.
Um ataque é um movimento que o pokémon pode realizar durante a batalha para ferir o pokémon oponente, sendo que cada ataque sempre tem exatamente 1 tipo. Este ataque pode ser diferenciado dos demais pelo seu nome. Cada ataque contém uma descrição do ataque, além de sua potência, se ele é um ataque forte ou fraco, e a condição em que ele deixa ao adversário tal como paralizado, envenenado, queimado, e etc.
Os ataques específicos que cada pokémon pode possuir é um subconjunto de todos os ataques existentes no Mundo Pokémon. Isso significa que dentre todos os ataques existentes no Mundo Pokémon, cada espécie de pokémon pode ter somente alguns. Além disso, dentro dos quatro ataques que cada pokémon possui atualmente, todos devem estar dentro do conjunto de ataques específicos para aquela espécie.
Existem 18 tipos no Mundo Pokémon, dentre eles podemos citar fire, water, grass, bug, fairy, dragon, etc. Cada um desses tipos podem ser fortes, fracos ou imunes em relação a outros tipos. O tipo é conhecido univocamente por um nome, e tem uma cor associada a ele para a interface. Cada tipo possui certa vantagem sobre as demais, ou seja, um ataque do tipo A possui certo multiplicador de impacto sobre pokémons dos demais tipos. O valor desse multiplicador possui valores entre 0, 0.5, 1 e 2, e é utilizado como um fator na hora de calcular o poder de cada ataque. Tanto os pokémons quanto os ataques têm tipos, sendo que cada ataque tem apenas um tipo e o pokémon pode ter um ou dois tipos.
Um pet é um pokémon de certa espécie, mas que foi capturado por um treinador. Ao invés de possuir informações gerais da sua espécie, essa entidade possuí informações específicas da criatura que foi capturada, como um nome, a natureza dele (se ele é calmo, agressivo, inquieto, etc.), o sexo dele, seu peso, sua altura, e sua habilidade especial. Um exemplo de habilidade especial é a característica de não receber dano de ataques de certo tipo. Além disso, o pokémon pode ter cores especiais, diferentemente de outros na sua espécie, e assim será chamado de shiny. A quantidade limite de pets que um treinador possui não é definida, podendo ter até mais de um pokémon da mesma espécie. Cada pet é identificado pelo seu treinador, pelo seu nome e pela sua espécie.
Os Ataques do Pet representam os ataques que certo pet possui. Esses ataques podem ser no mínimo 1 e no máximo 4 por pokémon. Esses ataques sempre devem pertencer ao conjunto de ataques que a espécie do pokémon pode possuir. Por fim, esses são os ataques, ou movimentos, que o pet poderá utilizar durante uma batalha.
As batalhas são interações entre dois times, cada time é formado por um treinador com no máximo seis de seus pets. Cada batalha possui data/hora, o resultado final, e uma descrição da batalha em si, assim como sua categoria. A batalha pode ser identificada dentre as demais pelos treinadores que participaram da batalha e a data/hora de acontecimento. Uma batalha também é associada aos itens que podem ter sido utilizados nela. O conceito de batalha pode ser de dois diferentes tipos: Individual e Competitiva. A batalha é identificada como Competitiva quando pertence à um torneio, caso contrário é identificada como Individual. De modo específico, a batalha individual possui o local de acontecimento. Do mesmo modo, a batalha competitiva possui a informação da etapa que aconteceu durante o campeonato, como eliminatória, oitavas, quartas, semi e final, etc.
Os torneios envolvem diversas batalhas competitivas e são criadas por Mestres Pokémon. Dessa forma possuem múltiplos times. Com o chaveamento do torneio só restará um vencedor no final. Os torneios são identificados por seu local e data.
Os itens são todos os tipos de produtos que um treinador pode ter. Cada tipo de item fornece diferentes efeitos e podem ser utilizados para aumentar a vida dos pokémons, melhorar alguma habilidade do pokémon ou facilitar a captura do pokémon. Os itens são identificados unicamente pelo seu nome e possuem uma descrição do efeito que o item proporciona.
Os pertences são com bens de cada treinador. Cada pertence corresponde a um item em determinada quantidade. Cada pertence pode ser utilizado somente uma vez e possui registro de uso em batalha quando utilizado durante um combate.
Utilizamos o Intellij para oferecer uma interface gráfica e user friendly para realizar o protótipo operacional e na aplicação desenvolvida utilizou-se o SGBD relacional Oracle disponibilizado pela professora da disciplina, além da linguagem Java na versão Oracle OpenJDK 17.0.2. De forma a possibilitar a conexão entre a aplicação e a base de dados, fez-se uso do Driver Oracle JDBC. O código executável se encontra no diretório SCC0240_Projeto_BD\out\artifacts\PokemonDB_jar. Para executar, basta realizar o seguinte comando:
- java -jar PokemonDB.jar
Para a funcionalidade de cadastro, a query selecionada foi a de adição de um novo treinador no sistema, em que a interface verifica se os dados estão no formato certo, e há a verificação para não inserir dois treinadores com mesma chave (CPF), aceitando valores nulos para atributos não chave.
Para a funcionalidade de consulta, a query selecionada foi a de seleção de um pokémons no sistema, em que a interface aceita buscas por número, nome, e tipos do pokémon, verificando substrings no caso do nome. Pode se aplicar mais que um filtro por vez.