Skip to content

Kartmaan/fight-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fight-simulator

This program simulates a turn-based fight between two entities, each with its own attack and defense characteristics.

This project was carried out as part of a personal training in Rust. The main goal was to familiarize oneself with as many concepts of the language as possible :

  • structs
  • enum
  • trait
  • HashMap
  • lazy_static
  • rand
  • Generic types
  • ...

Features

  • Bestiary of mobs with their own characteristics that can be easily called to put them into fights
  • Player with different classes (warrior, archer) each directly influencing their characteristics with bonuses and penalties.
  • Simulation of a turn-based fight between the player and a mob or between two players or two mobs.
  • Calculation of damage based on the attributes of the player and the mob like armor value, HP, critical damage probability, etc.
  • Stylized display of information each round until one of the fighters wins
  • A Jupyter notebook to simulate different attack and defense configurations and judge performance graphically.

Screenshots

Fight between a Warrior (Lost) and an Archer (Duriel) :

cap