diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs')
-rw-r--r-- | Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs b/Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs new file mode 100644 index 00000000..ceca8e32 --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/XPlayerAttributes.cs @@ -0,0 +1,143 @@ +using System;
+using KKSG;
+using XMainClient.UI;
+using XMainClient.UI.UICommon;
+using XUtliPoolLib;
+
+namespace XMainClient
+{
+ internal class XPlayerAttributes : XRoleAttributes
+ {
+ public override uint ID
+ {
+ get
+ {
+ return XPlayerAttributes.uuID;
+ }
+ }
+
+ public uint SkillPageIndex { get; set; }
+
+ public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("Player_Attributes");
+
+ public byte[] openedSystem = new byte[32];
+
+ public bool AutoPlayOn = false;
+
+ public XPlayerAttributes()
+ {
+ this._manualUnitBuff = true;
+ this._security_Statistics = new XSecurityStatistics();
+ }
+
+ public override void InitAttribute(KKSG.Attribute attr)
+ {
+ base.InitAttribute(attr);
+ }
+
+ public bool IsSystemOpened(uint sysID)
+ {
+ uint num = sysID / 8u;
+ int num2 = (int)(sysID % 8u);
+ int num3 = 1 << num2;
+ bool flag = (ulong)num >= (ulong)((long)this.openedSystem.Length);
+ bool result;
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("sys id out of range: ", sysID.ToString(), null, null, null, null);
+ result = false;
+ }
+ else
+ {
+ result = (((int)this.openedSystem[(int)num] & num3) != 0);
+ }
+ return result;
+ }
+
+ public void CacheOpenSystem(uint sysID)
+ {
+ bool flag = !XSingleton<XTutorialMgr>.singleton.IsImmediatelyOpenSystem(sysID);
+ if (flag)
+ {
+ XSingleton<XTutorialHelper>.singleton.AddNewOpenSystem(sysID);
+ XSingleton<XTutorialMgr>.singleton.SetExternalString("OpenSys" + sysID);
+ }
+ else
+ {
+ this.ReallyOpenSystem(sysID);
+ bool flag2 = DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.IsVisible();
+ if (flag2)
+ {
+ DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.OnSysChange((XSysDefine)sysID);
+ XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState((XSysDefine)sysID, true);
+ }
+ }
+ }
+
+ public void ReallyOpenSystem(uint sysID)
+ {
+ uint num = sysID / 8u;
+ int num2 = (int)(sysID % 8u);
+ int num3 = 1 << num2;
+ bool flag = (ulong)num >= (ulong)((long)this.openedSystem.Length);
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("open sys id out of range: ", sysID.ToString(), null, null, null, null);
+ }
+ else
+ {
+ byte[] array = this.openedSystem;
+ uint num4 = num;
+ array[(int)num4] = (byte)((int)array[(int)num4] | num3);
+ XSingleton<XGameSysMgr>.singleton.RecalculateRedPointState((XSysDefine)sysID, true);
+ XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
+ specificDocument.OnSysOpen();
+ }
+ }
+
+ public void CloseSystem(uint sysID)
+ {
+ uint num = sysID / 8u;
+ int num2 = (int)(sysID % 8u);
+ int num3 = 1 << num2;
+ bool flag = (ulong)num >= (ulong)((long)this.openedSystem.Length);
+ if (flag)
+ {
+ XSingleton<XDebug>.singleton.AddErrorLog("close sys id out of range: ", sysID.ToString(), null, null, null, null);
+ }
+ else
+ {
+ byte[] array = this.openedSystem;
+ uint num4 = num;
+ array[(int)num4] = (byte)(array[(int)num4] & (int)(~(byte)num3));
+ XSingleton<XGameSysMgr>.singleton.SetSysRedPointState((XSysDefine)sysID, false);
+ XMainInterfaceDocument specificDocument = XDocuments.GetSpecificDocument<XMainInterfaceDocument>(XMainInterfaceDocument.uuID);
+ specificDocument.OnSysChange();
+ }
+ }
+
+ public void HPMPReset()
+ {
+ double attr = base.GetAttr(XAttributeDefine.XAttr_MaxHP_Total);
+ base.SetAttr(XAttributeDefine.XAttr_CurrentHP_Basic, attr);
+ double attr2 = base.GetAttr(XAttributeDefine.XAttr_MaxMP_Total);
+ base.SetAttr(XAttributeDefine.XAttr_CurrentMP_Basic, attr2);
+ }
+
+ public long GetLevelUpExp(int level)
+ {
+ PlayerLevelTable.RowData byLevel = XSingleton<XEntityMgr>.singleton.LevelTable.GetByLevel(level);
+ bool flag = byLevel != null;
+ long result;
+ if (flag)
+ {
+ result = byLevel.Exp;
+ }
+ else
+ {
+ result = 0L;
+ }
+ return result;
+ }
+ }
+}
|