This commit is contained in:
@@ -9,7 +9,7 @@ public class Captivate : Script, IScriptOnSecondaryEffect
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var user = move.User;
|
||||
if (target.Gender == Gender.Genderless || target.Gender == user.Gender)
|
||||
if (target.Gender == Gender.Genderless || target.Gender == user.Gender || user.Gender == Gender.Genderless)
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
|
||||
@@ -16,7 +16,7 @@ public class Conversion2 : Script, IScriptOnSecondaryEffect
|
||||
var typeLibrary = move.User.BattleData!.Battle.Library.StaticLibrary.Types;
|
||||
// Get all types against which the last move would be not very effective
|
||||
var type = typeLibrary.GetAllEffectivenessFromAttacking(lastMoveByTarget.ChosenMove.MoveData.MoveType)
|
||||
.Where(x => x.effectiveness < 1)
|
||||
.Where(x => x.effectiveness < 1 && !move.User.Types.Contains(x.type))
|
||||
// Shuffle them randomly, but deterministically
|
||||
.OrderBy(_ => move.User.BattleData.Battle.Random.GetInt()).ThenBy(x => x.type.Value)
|
||||
// And grab the first one
|
||||
|
||||
@@ -11,8 +11,8 @@ public class CoreEnforcer : Script, IScriptOnSecondaryEffect
|
||||
return;
|
||||
var turnChoices = battleData.Battle.PreviousTurnChoices.Last();
|
||||
var currentChoiceIndex = turnChoices.IndexOf(move.MoveChoice);
|
||||
if (currentChoiceIndex == -1 ||
|
||||
!turnChoices.Take(currentChoiceIndex).Any(choice => choice is IMoveChoice or IItemChoice))
|
||||
if (currentChoiceIndex == -1 || !turnChoices.Take(currentChoiceIndex)
|
||||
.Any(choice => choice is IMoveChoice or IItemChoice && choice.User == target))
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
|
||||
@@ -8,7 +8,9 @@ public class Covet : Script, IScriptOnSecondaryEffect
|
||||
{
|
||||
if (target.HeldItem == null)
|
||||
return;
|
||||
if (!move.User.TryStealHeldItem(out var item))
|
||||
if (move.User.HeldItem is not null)
|
||||
return;
|
||||
if (!target.TryStealHeldItem(out var item))
|
||||
return;
|
||||
_ = move.User.ForceSetHeldItem(item);
|
||||
}
|
||||
|
||||
@@ -16,9 +16,7 @@ public class Curse : Script, IScriptOnSecondaryEffect
|
||||
return;
|
||||
if (move.User.Types.Contains(ghostType))
|
||||
{
|
||||
move.User.Damage(move.User.CurrentHealth / 2, DamageSource.Misc, forceDamage: true);
|
||||
if (move.User.CurrentHealth == 0)
|
||||
return;
|
||||
move.User.Damage(move.User.MaxHealth / 2, DamageSource.Misc, forceDamage: true);
|
||||
target.Volatile.Add(new GhostCurseEffect(target));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user