Loads of work on getting data ready.
This commit is contained in:
26
Scripts/Moves/2_5HitMove.as
Normal file
26
Scripts/Moves/2_5HitMove.as
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=2_5HitMove]
|
||||
class MultiHitMove : PkmnScript{
|
||||
void ModifyNumberOfHits(MoveTurnChoice@ choice, uint8 &inout numberHits) override {
|
||||
auto randValue = choice.User.Battle.Random.Get(6);
|
||||
switch (randValue){
|
||||
case 0:
|
||||
case 1:
|
||||
numberHits = 2;
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
numberHits = 3;
|
||||
break;
|
||||
case 4:
|
||||
numberHits = 4;
|
||||
break;
|
||||
case 5:
|
||||
numberHits = 5;
|
||||
break;
|
||||
default:
|
||||
throw("Invalid randValue");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Scripts/Moves/ChangeAllTargetStats.as
Normal file
18
Scripts/Moves/ChangeAllTargetStats.as
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=ChangeAllTargetStats]
|
||||
class ChangeAllTargetStats : PkmnScript{
|
||||
int8 _amount;
|
||||
|
||||
void OnInitialize(const EffectParameter@[] &in parameters) override{
|
||||
_amount = int8(parameters[0].AsInt());
|
||||
}
|
||||
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{
|
||||
target.ChangeStatBoost(Statistic::Attack, _amount);
|
||||
target.ChangeStatBoost(Statistic::Defense, _amount);
|
||||
target.ChangeStatBoost(Statistic::SpecialAttack, _amount);
|
||||
target.ChangeStatBoost(Statistic::SpecialDefense, _amount);
|
||||
target.ChangeStatBoost(Statistic::Speed, _amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
14
Scripts/Moves/ChangeTargetAtt.as
Normal file
14
Scripts/Moves/ChangeTargetAtt.as
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=ChangeTargetAtt]
|
||||
class ChangeTargetAttack : PkmnScript{
|
||||
int8 _amount;
|
||||
|
||||
void OnInitialize(const EffectParameter@[] &in parameters) override{
|
||||
_amount = int8(parameters[0].AsInt());
|
||||
}
|
||||
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{
|
||||
target.ChangeStatBoost(Statistic::Attack, _amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
namespace Gen7{
|
||||
namespace Gen7 {
|
||||
[Move effect=drain]
|
||||
shared class DrainMove : PkmnScript{
|
||||
private float _healModifier = 0;
|
||||
|
||||
void OnInitialize(const array<EffectParameter@> &in parameters) override{
|
||||
void OnInitialize(const array<EffectParameter@> &in parameters) override {
|
||||
_healModifier = parameters[0].AsFloat();
|
||||
}
|
||||
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{
|
||||
auto hitData = attack.GetAttackDataForTarget(target).GetHit(hit);
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override {
|
||||
auto hitData = attack.GetHitData(target, hit);
|
||||
auto damage = hitData.Damage;
|
||||
float mod = _healModifier;
|
||||
if (attack.User.HasHeldItem("big_root")){
|
||||
@@ -17,4 +17,4 @@ namespace Gen7{
|
||||
attack.User.Heal(uint(damage * mod));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Scripts/Moves/HealEachEndOfTurn.as
Normal file
15
Scripts/Moves/HealEachEndOfTurn.as
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=HealEachEndOfTurn]
|
||||
shared class HealEachEndOfTurn : PkmnScript {
|
||||
float _amount;
|
||||
|
||||
void OnInitialize(const EffectParameter@[] &in parameters) override{
|
||||
_amount = float(parameters[0].AsFloat()) / 100;
|
||||
}
|
||||
|
||||
void OnSecondaryEffect(ExecutingMove@, Pokemon@ pokemon, uint8) override {
|
||||
auto script = cast<HealEachEndOfTurnEffect>(pokemon.AddVolatile("HealEachEndOfTurn"));
|
||||
script.SetBaseHealAmount(_amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
9
Scripts/Moves/PreventFoeRunning.as
Normal file
9
Scripts/Moves/PreventFoeRunning.as
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=PreventFoeRunning]
|
||||
shared class PreventFoeRunning : PkmnScript {
|
||||
void OnSecondaryEffect(ExecutingMove@ move, Pokemon@ target, uint8 hit) override {
|
||||
auto script = cast<PreventFoeRunningEffect>(move.User.AddVolatile("PreventFoeRunning"));
|
||||
script.SetLockedOpponent(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
8
Scripts/Moves/Struggle.as
Normal file
8
Scripts/Moves/Struggle.as
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=Struggle]
|
||||
shared class Struggle : PkmnScript {
|
||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{
|
||||
attack.User.Damage(uint(attack.User.MaxHealth / 4), DamageSource::Struggle);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Scripts/Moves/SwapWithTarget.as
Normal file
18
Scripts/Moves/SwapWithTarget.as
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace Gen7 {
|
||||
[Move effect=SwapWithTarget]
|
||||
shared class SwapWithTarget : PkmnScript {
|
||||
void OnSecondaryEffect(ExecutingMove@ move, Pokemon@ target, uint8 hit) override {
|
||||
auto userSide = move.User.BattleSide;
|
||||
auto targetSide = target.BattleSide;
|
||||
if (userSide !is targetSide){
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
auto userIndex = userSide.GetPokemonIndex(move.User);
|
||||
auto targetIndex = userSide.GetPokemonIndex(target);
|
||||
if (!userSide.SwapPositions(userIndex, targetIndex)){
|
||||
move.GetHitData(target, hit).Fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user