Skip to content

SamuelCarlos/tp2_tep1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐹 TP2 - CPokémon 🐯

Bruno Carneiro Izoton

Samuel Carlos Xavier de Carvalho

🚀 What is CPokemon?

CPokemon is a coursework to Tópicos Especiais em Programação class. The objective is the implementation of Dispatch Tables and Dynamic Chained List.

🔨 How it works?

Basically we have Dispatch Tables to hold all the pokémon attacks and to hold the attacks debuffs.

We used the "debuff" logic to apply effects like sleep, burn, and paralyzed to the pokémons. Everytime a pokémon uses a skill that applies a debuff, we call the attack dispatch and inside the attack function calls the debuff dispatch and add the debuff in a "debuff list" to the respective pokémon that is taking damage, after this, we turn to true (1) the condition in the conditions array.

Every debuff have a countdown and every turn we count -1 to the total turns remaining. When it comes to 0, we remove this debuff and its respective condition from the pokémon.

All damage is calculated as required.

🔢 Menus

🎮 1 - Jogar

Choose your name and your pokemons and go to the fight.

📊 2 - Melhores pontuações

Displays the scores of all players in an orderly manner on the screen.

🚪 3 - Sair

Exit the application.

♻️ Obs

📁 Files: To make it easier to save pokemons and attacks in the lists created in the program, we made use of files. In the file "pokemons.csv" we list all pokemons available for use and their respective attacks. In the file "attacks.csv" we list all available attacks.

🌲 Trees: We've used trees while reading the file to save the score ordenated. We have a score based tree, and inside each ramification, we have another tree. In case of 2 players have the same score the secondary tree is used to organize the names in order. We used recursive functions to walk in the tree.

📋 Lists: We used chained lists to hold on every data like player pokemons and it's debuffs.

💣 Troubles: We had some troubles with debuffs aplication, that resulted in many variable uses and many conditionals at Battle.c, where the turns are counted and the battle occurs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages