30 lines
964 B
C#
30 lines
964 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
|
|
namespace Activity.Condition
|
|
{
|
|
/// <summary>
|
|
/// 钓鱼次数条件检查器
|
|
/// </summary>
|
|
public class FishCountConditionChecker : IConditionChecker
|
|
{
|
|
public int Priority => 30;
|
|
public List<Type> CareDataChangeWithType => new() { typeof(PlayerData) };
|
|
public bool NeedContinueListenAfterSatisfied => false;
|
|
|
|
public bool CanOpen(FishingEvent fishingEvent)
|
|
{
|
|
foreach (var condition in fishingEvent.ConditionList)
|
|
{
|
|
if (condition.Condition != ConditionType.GetFishCount) continue;
|
|
var requiredCount = GlobalUtils.TryParseInt(condition.Param[0], 0);
|
|
var currentCount =GContext.container.Resolve<PlayerData>()._fishingFrequency;
|
|
return currentCount >= requiredCount;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
} |