Bunch more moves, changes in how additional information for items works.
This commit is contained in:
52
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Magnitude.cs
Normal file
52
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Magnitude.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "magnitude")]
|
||||
public class Magnitude : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref byte basePower)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData == null)
|
||||
return;
|
||||
|
||||
var random = battleData.Battle.Random;
|
||||
|
||||
var magnitudePercentage = random.GetInt(0, 100);
|
||||
var magnitude = magnitudePercentage switch
|
||||
{
|
||||
// 5% chance for 4
|
||||
< 5 => 4,
|
||||
// 10% chance for 5
|
||||
< 15 => 5,
|
||||
// 20% chance for 6
|
||||
< 35 => 6,
|
||||
// 30% chance for 7
|
||||
< 65 => 7,
|
||||
// 20% chance for 8
|
||||
< 85 => 8,
|
||||
// 10% chance for 9
|
||||
< 95 => 9,
|
||||
// 5% chance for 10
|
||||
_ => 10,
|
||||
};
|
||||
battleData.Battle.EventHook.Invoke(new DialogEvent("magnitude", new Dictionary<string, object>()
|
||||
{
|
||||
{ "magnitude", magnitude },
|
||||
{ "user", move.User },
|
||||
{ "target", target },
|
||||
}));
|
||||
basePower = magnitude switch
|
||||
{
|
||||
4 => 10,
|
||||
5 => 30,
|
||||
6 => 50,
|
||||
7 => 70,
|
||||
8 => 90,
|
||||
9 => 110,
|
||||
_ => 150,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user