---
# System prepended metadata

title: '[DW-Witcher]'

---

# [DW-Witcher]
A simple python text based game inspired by Pokemon and the Witcher series

### Video URL
https://youtu.be/-hSeBCAu8XI

### How to play
This is a 2 player game where each player first selects their character at the beginning of the game. Players will then take turns to attack with the character. Each character has their own unique type and a movepool of 4 moves.

There are 3 types, Witcher, Sorceress and Elder Blood. Type advantages in this game work the same way as traditional 
rock paper scissors. An additional 4th cheat class called vampire is also present. This class absorbs all damage from the 3 main 
classes and intant KOs to them. Vampires can only be killed by other vampires.

Witcher > Elder Blood > Sorceress > Witcher.
Vampire > All types

Weaker enemies deal 0.5x damage and receive 2x damage, Stronger enemies deal 2x damage and receive 0.5x damage

The game ends when either one of the character's hp is reduced to 0

### About the code
Dependencies: ``libdw``, ``numpy``
Standard Python libraries used: ``sys``, ``time``

#### ``slow_print``
simple function use to print lines word by word to emulate text speed in RPGs

#### ``class character``
Creates a class for the characters with all of their assigned attributes as various stats.
- ##### ``__init__()``
    Initialises the variables required for the character class as well as the state machine for the player.
- ##### ``fight``
    Prints ASCII art and the initial battle menu for the game
- ##### ``job``
    Creates the various type matchups for each type of character


##### ``class Witcher(sm.SM)``
State machine for the game. Encompasses the entire battle phase.

- ##### ``get_next_values``
    Used to find each subsequent state during the battle phase depending on current status of each character
    - Initial; state is ``1``
    - During battle, state is ``2``
    - When either character is dead, state is ``0``
- ##### ``run``
    Used to continue battle phase when both characters are still alive and to end battle once a character is defeated
