Coder Social home page Coder Social logo

tp2_tep1's Introduction

🐹 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.

tp2_tep1's People

Contributors

samuelcarlos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.