Pokemon Unity
A pokemon clone made using Unity
Loading...
Searching...
No Matches
Pokemon Class Reference

The Pokemon class manages all logic for pokemon More...

Public Member Functions

 Pokemon (PokemonBase pBase, int pLevel)
 
 Pokemon (PokemonSaveData saveData)
 
void Init ()
 Initializes the Pokemon More...
 
PokemonSaveData GetSaveData ()
 
DamageDetails TakeDamage (Move move, Pokemon attacker)
 Causes the specified pokemon to take damage More...
 
Move GetRandomMove ()
 Get a random move from the pokemon's move list More...
 
void SetStatus (ConditionID conditionID)
 Set the status of the pokemon More...
 
void CureStatus ()
 Remove all status effects from the pokemon More...
 
void ApplyBoosts (List< StatBoost > statBoosts)
 Apply stat boosts to the pokemon More...
 
void SetVolatileStatus (ConditionID conditionID)
 Set the volatile status of the pokemon More...
 
void CureVolatileStatus ()
 Remove all volatile status effects from the pokemon More...
 
void DecreaseHP (int damage)
 Decrease the HP of the pokemon More...
 
void IncreaseHP (int amt)
 
void OnAfterTurn ()
 Ran after a pokemon's turn More...
 
bool OnBeforeTurn ()
 Ran before a pokemon's turn More...
 
void OnBattleOver ()
 Resets pokemon More...
 
bool CheckForLevelUp ()
 Check if the pokemon should level up and if it should, then level it up More...
 
LearnableMove GetLearnableMoveAtCurrentLevel ()
 
void LearnMove (LearnableMove moveToLearn)
 

Properties

PokemonBase Base [get]
 
int Level [get]
 
int HP [get, set]
 
int Exp [get, set]
 
List< MoveMoves [get, set]
 
Move CurrentMove [get, set]
 
Dictionary< Stat, int > Stats [get]
 
Dictionary< Stat, int > StatBoosts [get]
 
Condition Status [get]
 
Condition VolatileStatus [get]
 
int StatusTime [get, set]
 
int VolatileStatusTime [get, set]
 
Queue< string > StatusChanges [get]
 
int Attack [get]
 
int Defense [get]
 
int SpecialAttack [get]
 
int SpecialDefense [get]
 
int Speed [get]
 
int MaxHp [get]
 

Events

System.Action OnStatusChanged
 
System.Action OnHPChanged
 

Detailed Description

The Pokemon class manages all logic for pokemon

Definition at line 9 of file Pokemon.cs.

Constructor & Destructor Documentation

◆ Pokemon() [1/2]

Pokemon.Pokemon ( PokemonBase  pBase,
int  pLevel 
)

Definition at line 60 of file Pokemon.cs.

◆ Pokemon() [2/2]

Pokemon.Pokemon ( PokemonSaveData  saveData)

Definition at line 68 of file Pokemon.cs.

Member Function Documentation

◆ ApplyBoosts()

void Pokemon.ApplyBoosts ( List< StatBoost statBoosts)

Apply stat boosts to the pokemon

Parameters
statBoostsThe boosts to apply

Definition at line 211 of file Pokemon.cs.

◆ CheckForLevelUp()

bool Pokemon.CheckForLevelUp ( )

Check if the pokemon should level up and if it should, then level it up

Returns
Whether the pokemon leveled up

Definition at line 318 of file Pokemon.cs.

◆ CureStatus()

void Pokemon.CureStatus ( )

Remove all status effects from the pokemon

Definition at line 201 of file Pokemon.cs.

◆ CureVolatileStatus()

void Pokemon.CureVolatileStatus ( )

Remove all volatile status effects from the pokemon

Definition at line 245 of file Pokemon.cs.

◆ DecreaseHP()

void Pokemon.DecreaseHP ( int  damage)

Decrease the HP of the pokemon

Parameters
damageHow much HP to decrease by

Definition at line 254 of file Pokemon.cs.

◆ GetLearnableMoveAtCurrentLevel()

LearnableMove Pokemon.GetLearnableMoveAtCurrentLevel ( )

Definition at line 329 of file Pokemon.cs.

◆ GetRandomMove()

Move Pokemon.GetRandomMove ( )

Get a random move from the pokemon's move list

Definition at line 176 of file Pokemon.cs.

◆ GetSaveData()

PokemonSaveData Pokemon.GetSaveData ( )

Definition at line 116 of file Pokemon.cs.

◆ IncreaseHP()

void Pokemon.IncreaseHP ( int  amt)

Definition at line 260 of file Pokemon.cs.

◆ Init()

void Pokemon.Init ( )

Initializes the Pokemon

Definition at line 91 of file Pokemon.cs.

◆ LearnMove()

void Pokemon.LearnMove ( LearnableMove  moveToLearn)

Definition at line 334 of file Pokemon.cs.

◆ OnAfterTurn()

void Pokemon.OnAfterTurn ( )

Ran after a pokemon's turn

Definition at line 273 of file Pokemon.cs.

◆ OnBattleOver()

void Pokemon.OnBattleOver ( )

Resets pokemon

Definition at line 301 of file Pokemon.cs.

◆ OnBeforeTurn()

bool Pokemon.OnBeforeTurn ( )

Ran before a pokemon's turn

Returns
A bool representing whether or not the pokemon can perform their move

Definition at line 283 of file Pokemon.cs.

◆ SetStatus()

void Pokemon.SetStatus ( ConditionID  conditionID)

Set the status of the pokemon

Parameters
ConditionIDThe ConditionID of the status to set

Definition at line 188 of file Pokemon.cs.

◆ SetVolatileStatus()

void Pokemon.SetVolatileStatus ( ConditionID  conditionID)

Set the volatile status of the pokemon

Parameters
ConditionIDThe ConditionID of the volatile status to set

Definition at line 233 of file Pokemon.cs.

◆ TakeDamage()

DamageDetails Pokemon.TakeDamage ( Move  move,
Pokemon  attacker 
)

Causes the specified pokemon to take damage

Parameters
moveThe move to apply to the pokemon
attackerThe attacking pokemon
Returns
A DamageDetails class containing the effectiveness of the attack, whether it was a critical, and whether or not the pokemon fainted

Definition at line 142 of file Pokemon.cs.

Property Documentation

◆ Attack

int Pokemon.Attack
get

Definition at line 33 of file Pokemon.cs.

◆ Base

PokemonBase Pokemon.Base
get

Definition at line 14 of file Pokemon.cs.

◆ CurrentMove

Move Pokemon.CurrentMove
getset

Definition at line 20 of file Pokemon.cs.

◆ Defense

int Pokemon.Defense
get

Definition at line 38 of file Pokemon.cs.

◆ Exp

int Pokemon.Exp
getset

Definition at line 17 of file Pokemon.cs.

◆ HP

int Pokemon.HP
getset

Definition at line 16 of file Pokemon.cs.

◆ Level

int Pokemon.Level
get

Definition at line 15 of file Pokemon.cs.

◆ MaxHp

int Pokemon.MaxHp
get

Definition at line 58 of file Pokemon.cs.

◆ Moves

List<Move> Pokemon.Moves
getset

Definition at line 19 of file Pokemon.cs.

◆ SpecialAttack

int Pokemon.SpecialAttack
get

Definition at line 43 of file Pokemon.cs.

◆ SpecialDefense

int Pokemon.SpecialDefense
get

Definition at line 48 of file Pokemon.cs.

◆ Speed

int Pokemon.Speed
get

Definition at line 53 of file Pokemon.cs.

◆ StatBoosts

Dictionary<Stat, int> Pokemon.StatBoosts
get

Definition at line 22 of file Pokemon.cs.

◆ Stats

Dictionary<Stat, int> Pokemon.Stats
get

Definition at line 21 of file Pokemon.cs.

◆ Status

Condition Pokemon.Status
get

Definition at line 24 of file Pokemon.cs.

◆ StatusChanges

Queue<string> Pokemon.StatusChanges
get

Definition at line 28 of file Pokemon.cs.

◆ StatusTime

int Pokemon.StatusTime
getset

Definition at line 26 of file Pokemon.cs.

◆ VolatileStatus

Condition Pokemon.VolatileStatus
get

Definition at line 25 of file Pokemon.cs.

◆ VolatileStatusTime

int Pokemon.VolatileStatusTime
getset

Definition at line 27 of file Pokemon.cs.

Event Documentation

◆ OnHPChanged

System.Action Pokemon.OnHPChanged

Definition at line 31 of file Pokemon.cs.

◆ OnStatusChanged

System.Action Pokemon.OnStatusChanged

Definition at line 30 of file Pokemon.cs.


The documentation for this class was generated from the following file: