30 lines
1008 B
ActionScript
30 lines
1008 B
ActionScript
namespace Gen7 {
|
|
[Ability effect=ChangeMoveType]
|
|
class ChangeMoveType : PkmnScript {
|
|
uint8 _fromType;
|
|
uint8 _toType;
|
|
bool _changedLastAttack = false;
|
|
|
|
void OnInitialize(const BattleLibrary@ library, const narray<EffectParameter@>@ parameters) override {
|
|
auto lib = library.StaticLibrary.TypeLibrary;
|
|
_fromType = lib.GetTypeId(parameters[0].AsString());
|
|
_toType = lib.GetTypeId(parameters[1].AsString());
|
|
}
|
|
|
|
void ChangeAttackType(ExecutingMove@ move, Pokemon@ target, uint8 hit, uint8 &inout t) override {
|
|
if (_fromType == t){
|
|
t = _toType;
|
|
_changedLastAttack = true;
|
|
}
|
|
else{
|
|
_changedLastAttack = false;
|
|
}
|
|
}
|
|
|
|
void ModifyDamageModifier(ExecutingMove@, Pokemon@, uint8, float &inout damageMod) override {
|
|
if (_changedLastAttack){
|
|
damageMod *= 1.2f;
|
|
}
|
|
}
|
|
}
|
|
} |