Files
Fishing2/Assets/Scripts/Configs/Mem/GameLures.cs
2025-05-10 12:49:47 +08:00

123 lines
4.1 KiB
C#

using UnityEngine;
namespace NBF
{
[TableName("gameLures")]
public partial class GameLures : ConfigGearBase
{
public enum Type
{
Natural = 0,
Spinning = 1
}
public Type type;
public FishSpecies[] acceptFish;
public Vector2 weightFishAccept = new Vector2(0f, 3f);
public float weight = 10f;
public float lenght;
public int amount = 1;
public int Level = 1;
/// <summary>
/// 配的鱼钩
/// </summary>
public int[] hook;
private Vector2 startedbaitValues;
private Vector2 _startedbaitValues;
public bool CheckIsFishAccept(FishSpecies fishSpecies, float fishWeight = 0)
{
if (GameFish.Get(fishSpecies).type == GameFish.Type.Predator)
{
Vector2 vector = weightFishAccept;
Debug.Log("诱饵的初始值:" + vector.ToString());
vector = _startedbaitValues;
Debug.Log("下一个诱饵值 1:" + vector.ToString());
Vector2 vector2 = new Vector2(0f, 0f);
if (_startedbaitValues == vector2)
{
if (weightFishAccept.x > 0.01f && weightFishAccept.x <= 2.5f)
{
weightFishAccept.x = 0.01f;
}
else if (weightFishAccept.x > 2.5f && weightFishAccept.x <= 9.2f)
{
weightFishAccept.x = 2.5f;
}
else if (weightFishAccept.x > 9.2f && weightFishAccept.x <= 20f)
{
weightFishAccept.x = 8f;
}
else if (weightFishAccept.x > 20f && weightFishAccept.x <= 50f)
{
weightFishAccept.x = 14f;
}
else if (weightFishAccept.x > 50f && weightFishAccept.x <= 700f)
{
weightFishAccept.x = 22f;
}
else if (weightFishAccept.x > 700f)
{
weightFishAccept.x = 150f;
}
if (weightFishAccept.y > 0.1f && weightFishAccept.y <= 3f)
{
weightFishAccept.y = 3f;
}
else if (weightFishAccept.y > 3f && weightFishAccept.y <= 9f)
{
weightFishAccept.y = 12f;
}
else if (weightFishAccept.y > 9f && weightFishAccept.y <= 24f)
{
weightFishAccept.y = 60f;
}
else if (weightFishAccept.y > 24f && weightFishAccept.y <= 50f)
{
weightFishAccept.y = 120f;
}
else if (weightFishAccept.y > 50f && weightFishAccept.y <= 105f)
{
weightFishAccept.y = 350f;
}
else if (weightFishAccept.y > 105f && weightFishAccept.y <= 170f)
{
weightFishAccept.y = 650f;
}
else if (weightFishAccept.y > 170f && weightFishAccept.y <= 500f)
{
weightFishAccept.y = 900f;
}
else if (weightFishAccept.y > 500f)
{
weightFishAccept.y = 1800f;
}
_startedbaitValues = weightFishAccept;
vector = _startedbaitValues;
Debug.Log("另一个有价值的诱饵: 2" + vector.ToString());
}
if (fishWeight >= weightFishAccept.x && fishWeight <= weightFishAccept.y)
{
vector = weightFishAccept;
Debug.Log("Fish accept lure: " + vector.ToString() + " weight:" + fishWeight);
return true;
}
}
return false;
}
}
}