From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/GuildFarmland.cs | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/GuildFarmland.cs (limited to 'Client/Assets/Scripts/XMainClient/GuildFarmland.cs') diff --git a/Client/Assets/Scripts/XMainClient/GuildFarmland.cs b/Client/Assets/Scripts/XMainClient/GuildFarmland.cs new file mode 100644 index 00000000..77242a8b --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/GuildFarmland.cs @@ -0,0 +1,76 @@ +using System; +using UnityEngine; +using XUtliPoolLib; + +namespace XMainClient +{ + internal class GuildFarmland : Farmland + { + public override int BreakLevel + { + get + { + bool flag = this.m_breakLevel == -1; + if (flag) + { + this.m_breakLevel = 0; + SeqList sequenceList = XSingleton.singleton.GetSequenceList("BreakFarmlandLevel_Guild", true); + for (int i = 0; i < (int)sequenceList.Count; i++) + { + bool flag2 = (long)sequenceList[i, 0] == (long)((ulong)this.m_farmlandId); + if (flag2) + { + this.m_breakLevel = sequenceList[i, 1]; + break; + } + } + } + return this.m_breakLevel; + } + } + + protected override Vector3 BoardRotation + { + get + { + return new Vector3(-90f, 30f, 0f); + } + } + + public GuildFarmland(uint farmlandId) : base(farmlandId) + { + } + + protected override void SetPerfab() + { + base.DestroyPerfab(); + bool flag = !base.IsLock || base.Doc.HomeType != HomeTypeEnum.GuildHome; + if (!flag) + { + XNpc npc = XSingleton.singleton.GetNpc(base.NpcId); + bool flag2 = npc == null; + if (!flag2) + { + string text = ""; + XGuildDocument specificDocument = XDocuments.GetSpecificDocument(XGuildDocument.uuID); + bool flag3 = specificDocument.bInGuild && (long)this.BreakLevel > (long)((ulong)specificDocument.Level); + if (flag3) + { + text = XSingleton.singleton.GetValue("FarmBoardPath1"); + } + bool flag4 = string.IsNullOrEmpty(text); + if (!flag4) + { + this.m_boardGo = XSingleton.singleton.CreateFromPrefab(text, npc.EngineObject.Position, Quaternion.identity, true, false); + bool flag5 = this.m_boardGo != null; + if (flag5) + { + this.m_boardGo.transform.localEulerAngles = this.BoardRotation; + } + base.SetPerfab(); + } + } + } + } + } +} -- cgit v1.1-26-g67d0