2025-05-18 01:04:31 +08:00

128 lines
2.3 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace G
{
/// <summary>
/// Generated from: kungfu.xlsx
/// </summary>
public partial class ItemBookGroup
{
/// <summary>
/// 掉落章节id
/// </summary>
public int dropChapterId
{
get => id;
}
public int dropLevelId
{
get
{
var chapter = ItemProxy.Instance.GetStaticItem<ItemChapter>(dropChapterId);
if (chapter != null && chapter.isUnlock)
{
return chapter.levels[0];
}
return 0;
}
}
public bool isUnlock
{
get
{
var chapter = ItemProxy.Instance.GetStaticItem<ItemChapter>(dropChapterId);
if (chapter != null)
{
return chapter.isUnlock;
}
return false;
}
}
private bool _isActive;
public bool isActive
{
get { return activeBookCount == maxBookCount; }
}
/// <summary>
///
/// </summary>
public int maxBookCount
{
get { return books.Length; }
}
/// <summary>
/// 是否需要整理书籍
/// </summary>
public bool isClearUp
{
get
{
if (_isActive)
return false;
for (int i = 0; i < books.Length; i++)
{
var book = ItemProxy.Instance.GetStaticItem<ItemBook>(books[i]);
if (book.canActive)
return true;
}
return false;
}
}
/// <summary>
///
/// </summary>
public int activeBookCount
{
get
{
if (_isActive)
return books.Length;
int result = 0;
for (int i = 0; i < books.Length; i++)
{
var book = ItemProxy.Instance.GetStaticItem<ItemBook>(books[i]);
if (book.isActive)
result++;
}
_isActive = result == books.Length;
return result;
}
}
public int CalcCombatValue()
{
if (isActive)
return combatValue;
return 0;
}
public override void Init()
{
for (int i = 0; i < books.Length; i++)
{
var book = ItemProxy.Instance.GetStaticItem<ItemBook>(books[i]);
book.bookGroup = this;
}
base.Init();
}
public override void Reset()
{
_isActive = false;
}
}
}