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