More move effects
This commit is contained in:
@@ -108,6 +108,8 @@ public interface IItem : INamedValue
|
||||
|
||||
ISecondaryEffect? Effect { get; }
|
||||
ISecondaryEffect? BattleEffect { get; }
|
||||
|
||||
byte FlingPower { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether the item has a specific flag.
|
||||
@@ -122,7 +124,7 @@ public class ItemImpl : IItem
|
||||
{
|
||||
/// <inheritdoc cref="ItemImpl"/>
|
||||
public ItemImpl(StringKey name, ItemCategory category, BattleItemCategory battleCategory, int price,
|
||||
IEnumerable<StringKey> flags, ISecondaryEffect? effect, ISecondaryEffect? battleTriggerEffect)
|
||||
IEnumerable<StringKey> flags, ISecondaryEffect? effect, ISecondaryEffect? battleTriggerEffect, byte flingPower)
|
||||
{
|
||||
Name = name;
|
||||
Category = category;
|
||||
@@ -130,6 +132,7 @@ public class ItemImpl : IItem
|
||||
Price = price;
|
||||
Effect = effect;
|
||||
BattleEffect = battleTriggerEffect;
|
||||
FlingPower = flingPower;
|
||||
Flags = [..flags];
|
||||
}
|
||||
|
||||
@@ -154,6 +157,10 @@ public class ItemImpl : IItem
|
||||
/// <inheritdoc />
|
||||
public ISecondaryEffect? BattleEffect { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte FlingPower { get; }
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool HasFlag(string key)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface IReadOnlyTypeLibrary
|
||||
/// Gets the effectiveness for a single attacking type against an amount of defending types.
|
||||
/// This is equivalent to running get_single_effectiveness on each defending type, and multiplying the results with each other.
|
||||
/// </summary>
|
||||
float GetEffectiveness(TypeIdentifier attacking, IReadOnlyList<TypeIdentifier> defending);
|
||||
float GetEffectiveness(TypeIdentifier attacking, IEnumerable<TypeIdentifier> defending);
|
||||
|
||||
IEnumerable<(TypeIdentifier type, float effectiveness)> GetAllEffectivenessFromAttacking(TypeIdentifier attacking);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class TypeLibrary : IReadOnlyTypeLibrary
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public float GetEffectiveness(TypeIdentifier attacking, IReadOnlyList<TypeIdentifier> defending) =>
|
||||
public float GetEffectiveness(TypeIdentifier attacking, IEnumerable<TypeIdentifier> defending) =>
|
||||
defending.Aggregate<TypeIdentifier, float>(1,
|
||||
(current, type) => current * GetSingleEffectiveness(attacking, type));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user