Gen7Data/Scripts/Moves/2_5HitMove.as

26 lines
770 B
ActionScript

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");
}
}
}
}