/////////////////////////////////////////////////////////////////////////////
// Name: pokemod/AbilityEffect.h
// Purpose: Define an effect of an ability
// Author: Ben Boeckel
// Modified by: Ben Boeckel
// Created: Thu Mar 22 19:06:58 2007
// Copyright: ©2007 Ben Boeckel and Nerdy Productions
// Licence:
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program. If not, see .
/////////////////////////////////////////////////////////////////////////////
#ifndef __POKEMOD_ABILITYEFFECT__
#define __POKEMOD_ABILITYEFFECT__
#include
#include
#include "../general/Frac.h"
#include "../general/Ref.h"
#include "Object.h"
#include "Pokemod.h"
#include "Ability.h"
#include "Type.h"
namespace PokeGen
{
namespace PokeMod
{
class AbilityEffect : public Object
{
public:
enum Effect
{
E_DamageToHP = 0,
E_PreventDamage = 1,
E_AutoHeal = 2,
E_DealDamage = 3,
E_Wilds = 4,
E_Stats = 5,
E_Status = 6,
E_Ability = 7,
E_AccuracyPowerTrade = 8,
E_Bullseye = 9,
E_ItemEffect = 10,
E_Type = 11,
E_FastHatch = 12,
E_Weather = 13,
E_End = 14
};
static const char* EffectStr[E_End];
enum Trigger
{
T_Anything = 0,
T_Contact = 1,
T_Weather = 2,
T_Damage = 3,
T_Type = 4,
T_HPBoundary = 5,
T_StatChange = 6,
T_Status = 7,
T_End = 8
};
static const char* TriggerStr[T_End];
enum Interact
{
I_Trade = 0,
I_Shadow = 1,
I_Block = 2,
I_End = 3
};
static const char* InteractStr[I_End];
enum PowerAccuracy
{
PA_Power = 0,
PA_Accuracy = 1,
PA_End = 2
};
static const char* PowerAccStr[PA_End];
enum Item
{
IT_Stat = 0,
IT_TypeBoost = 1,
IT_Flinch = 2,
IT_Quick = 3,
IT_End = 4
};
static const char* ItemStr[IT_End];
enum Cause
{
C_Prevent = 0,
C_Inflict = 1,
C_End = 2
};
static const char* CauseStr[C_End];
enum Boost
{
B_Boost = 0,
B_Hinder = 1,
B_End = 2
};
static const char* BoostStr[B_End];
enum Side
{
S_Above = 0,
S_Below = 1,
S_End = 2
};
static const char* SideStr[S_End];
AbilityEffect(const Pokemod* par, const unsigned _id);
AbilityEffect(const Pokemod* par, Ini& ini, const unsigned _id = UINT_MAX);
void ImportIni(Ini& ini, const unsigned _id = UINT_MAX);
void ExportIni(QFile& fout, const QString& ability) const;
bool SetChance(const unsigned n, const unsigned d);
bool SetChanceNum(const unsigned n);
bool SetChanceDenom(const unsigned d);
bool SetEffect(const unsigned e);
bool SetVal1(const unsigned v1);
bool SetVal2(const unsigned v2);
bool SetVal3(const int v3);
bool SetTrigger(const unsigned t);
bool SetTval1(const unsigned tv1);
bool SetTval2(const unsigned n, const unsigned d);
bool SetTval2Num(const unsigned n);
bool SetTval2Denom(const unsigned d);
Frac GetChance() const;
unsigned GetChanceNum() const;
unsigned GetChanceDenom() const;
unsigned GetEffect() const;
unsigned GetVal1() const;
unsigned GetVal2() const;
int GetVal3() const;
unsigned GetTrigger() const;
unsigned GetTval1() const;
Frac GetTval2() const;
unsigned GetTval2Num() const;
unsigned GetTval2Denom() const;
private:
bool Validate();
Frac chance;
unsigned effect;
unsigned val1;
unsigned val2;
int val3;
unsigned trigger;
unsigned tval1;
Frac tval2;
};
}
}
#endif