1780 lines
52 KiB
C#
1780 lines
52 KiB
C#
|
using System.Collections.Generic;
|
|||
|
using Games.ChatHistory;
|
|||
|
using Games.DailyMissionData;
|
|||
|
using Games.Events;
|
|||
|
using Games.Fellow;
|
|||
|
using Games.GlobeDefine;
|
|||
|
using Games.ImpactModle;
|
|||
|
using Games.Item;
|
|||
|
using Games.LogicObj;
|
|||
|
using Games.MountModule;
|
|||
|
using Games.SkillModle;
|
|||
|
using Games.TitleInvestitive;
|
|||
|
using Games.UserCommonData;
|
|||
|
using GCGame.Table;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public enum MONEYTYPE
|
|||
|
{
|
|||
|
MONEYTYPE_INVALID = -1,
|
|||
|
MONEYTYPE_COIN = 0, //银两
|
|||
|
MONEYTYPE_YUANBAO = 1, //灵玉
|
|||
|
MONEYTYPE_YUANBAO_BIND = 2, //元宝
|
|||
|
MONEYTYPE_COIN_BIND = 3, //银票
|
|||
|
|
|||
|
MONEYTYPE_USERCHALLENGE, //门派挑战积分
|
|||
|
MONEYTYPE_SNATCHSCORE, //夺宝积分
|
|||
|
//MONEYTYPE_ACT1 = 4, //活动积分
|
|||
|
//MONEYTYPE_ACT2 = 5, //活动积分
|
|||
|
//MONEYTYPE_ACT3 = 6, //活动积分
|
|||
|
//MONEYTYPE_ACT4 = 7, //活动积分
|
|||
|
//MONEYTYPE_ACT5 = 8, //活动积分
|
|||
|
//MONEYTYPE_ACT6 = 9, //活动积分
|
|||
|
//MONEYTYPE_ACT7 = 10, //活动积分
|
|||
|
//MONEYTYPE_ACT8 = 11, //活动积分
|
|||
|
|
|||
|
MONEYTYPE_SKILLEXP,
|
|||
|
MONEYTYPE_ROLEEXP,
|
|||
|
MONEYTYPE_TYPECOUNT
|
|||
|
}
|
|||
|
|
|||
|
public enum CONSUM_TYPE
|
|||
|
{
|
|||
|
INVALID = 0,
|
|||
|
PROPVAL = 1, //奖励或者消耗一种非固定战斗属性,id为属性id,val为属性值
|
|||
|
PROPPER = 2, //增加属性百分比,id为属性id,val为百分比乘以1万
|
|||
|
ITEM = 3, //物品, id是为物品id, cnt为物品数量
|
|||
|
MONEY = 4, // 金钱,id为金钱子类型,val为金钱数量
|
|||
|
SCORE = 5, // 积分
|
|||
|
NUM //类型总数 枚举于此之前添加
|
|||
|
}
|
|||
|
|
|||
|
// 装备槽位强化结构
|
|||
|
public struct StrengthData
|
|||
|
{
|
|||
|
public int lv; // 强化等级
|
|||
|
public int perfect; // 强化完美度
|
|||
|
|
|||
|
public StrengthData(int lv, int perfect)
|
|||
|
{
|
|||
|
this.lv = lv;
|
|||
|
this.perfect = perfect;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public enum SCORE_TYPE
|
|||
|
{
|
|||
|
GUILD_SCORE = 1
|
|||
|
}
|
|||
|
|
|||
|
public class PlayerData
|
|||
|
{
|
|||
|
//丈夫妻子标记
|
|||
|
private int _CoupFlag = -1;
|
|||
|
|
|||
|
private FunctionRewStateManager _functionRewStateManager;
|
|||
|
|
|||
|
private readonly Dictionary<PropID.PropertyID, int> _IntPropValue = new Dictionary<PropID.PropertyID, int>();
|
|||
|
|
|||
|
//是否有队长奖励可以领取
|
|||
|
|
|||
|
//打坐状态
|
|||
|
private bool _IsInMeditataState;
|
|||
|
|
|||
|
//是否已婚
|
|||
|
public float _LastGuildConscribeTime;
|
|||
|
|
|||
|
//寻物任务所需物品ID 及 数量
|
|||
|
public Dictionary<int, int> _MissionLootItemNeedCountDic = new Dictionary<int, int>();
|
|||
|
private float _modelScale = 1f;
|
|||
|
|
|||
|
//人物相思树信息
|
|||
|
private MarryAcaciaData _MyAcaciaData;
|
|||
|
|
|||
|
//人物羁绊信息
|
|||
|
private MarryFetterData _MyFetterData;
|
|||
|
|
|||
|
//人物戒指信息
|
|||
|
private MarryRingCtr _MyRingInfoData;
|
|||
|
|
|||
|
//人物时装信息
|
|||
|
private PlayerFashionData _PlayerFashionData;
|
|||
|
|
|||
|
private int _skillLockMode = int.MaxValue;
|
|||
|
|
|||
|
//结拜
|
|||
|
public SwornBrother _SwornBrother;
|
|||
|
private List<string> AbuseFilterList = new List<string>(); //动态屏蔽字
|
|||
|
public int DragonWar_DayRecvTimes = 0; //战龙堂每日接取次数
|
|||
|
|
|||
|
//战龙堂数据
|
|||
|
public ulong DragonWar_destanceGuildGuid = GlobeVar.INVALID_GUID; //目标帮会guid
|
|||
|
public string DragonWar_destanceGuildName = string.Empty; //目标帮会名称
|
|||
|
|
|||
|
// public int OPenServerDays = 0;
|
|||
|
|
|||
|
// 快捷仓库剩余使用次数,-1代表无限次
|
|||
|
public int FastOPenCangKuLeaveTimes = 0;
|
|||
|
|
|||
|
public bool HasInitOwnSkill = false;
|
|||
|
|
|||
|
public bool InTreasureState;
|
|||
|
|
|||
|
public bool IsHaveActrivityRewCanGet = false;
|
|||
|
|
|||
|
//已经激活的伙伴技能
|
|||
|
|
|||
|
private readonly List<int> m_activeMagicModels = new List<int>();
|
|||
|
|
|||
|
//每个活动对应迎头经验
|
|||
|
private Dictionary<int, int> m_ActivityHeadExpDic;
|
|||
|
//public MountParam ObjMountParam
|
|||
|
//{
|
|||
|
// get { return m_objMountParam; }
|
|||
|
// set { m_objMountParam = value; }
|
|||
|
//}
|
|||
|
|
|||
|
public AdvanceData m_AdvanceData;
|
|||
|
|
|||
|
//出副本自动寻路
|
|||
|
private int m_AutoSearchMissionId = -1;
|
|||
|
|
|||
|
//出副本显示轮次完成
|
|||
|
private int m_AutoShowTurnOverEnsureMissionId = -1;
|
|||
|
|
|||
|
//是否开始自动战斗
|
|||
|
protected bool m_bAutoComabat;
|
|||
|
private int m_bAutoTeamCopySceneDifficult = 1; //记录自动组队状态 难度
|
|||
|
private int m_bAutoTeamCopySceneId = -1; //记录自动组队状态 场景ID
|
|||
|
|
|||
|
// 4技能新手指引,切场景需要 加个标记
|
|||
|
|
|||
|
//玩家黑名单
|
|||
|
|
|||
|
//所属渠道ID
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//聊天记录
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
|
|||
|
//孩子信息
|
|||
|
private ChildData m_ChildData;
|
|||
|
|
|||
|
//角色自动使用药品信息
|
|||
|
private ClientCustomData m_ClientCustomDateManager;
|
|||
|
|
|||
|
// 通用存储数据
|
|||
|
|
|||
|
// 日常任务
|
|||
|
|
|||
|
private int m_dressMagicModelId = -1;
|
|||
|
|
|||
|
private ChatInfoLogic.CHANNEL_TYPE m_eChooseChannel = ChatInfoLogic.CHANNEL_TYPE.CHAT_TYPE_WORLD;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//收到EnterScene包后的数据缓存
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//时装
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
private float m_fCopySceneChange; //判断副本是否发送过传送信息.
|
|||
|
|
|||
|
//伙伴数据
|
|||
|
|
|||
|
//伙伴数据
|
|||
|
|
|||
|
//伙伴抽取CD
|
|||
|
|
|||
|
//当天抽取伙伴次数
|
|||
|
|
|||
|
//伙伴特效
|
|||
|
private float m_FellowTickTime;
|
|||
|
|
|||
|
//上次寄售行吆喝时间
|
|||
|
|
|||
|
//禁言结束时间
|
|||
|
public ulong m_ForbiddenTalkOverTime;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//玩家关系
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//玩家好友列表
|
|||
|
private RelationList m_FriendList;
|
|||
|
|
|||
|
//每个活动单独计时在线时长
|
|||
|
private Dictionary<int, long> m_FuncionOnlineTimeDic;
|
|||
|
|
|||
|
//功能开启状态
|
|||
|
private Dictionary<int, bool> m_FunctionOpenState;
|
|||
|
|
|||
|
//玩家帮派好友列表
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//帮会数据
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
//仇人列表
|
|||
|
|
|||
|
//玩家当前禁言状态
|
|||
|
|
|||
|
//角色物品使用限制
|
|||
|
private ItemLimtInfoCtr m_ItemLimitInfoCtr;
|
|||
|
|
|||
|
private ulong m_LastTellGUID = GlobeVar.INVALID_GUID;
|
|||
|
|
|||
|
private string m_LastTellName = "";
|
|||
|
|
|||
|
//伴侣 GUID
|
|||
|
private ulong m_LoverGUID = GlobeVar.INVALID_GUID;
|
|||
|
|
|||
|
//主角基础属性
|
|||
|
//Obj_MainPlayer已经将自己的BaseAttr屏蔽掉,而直接从这里读取
|
|||
|
|
|||
|
//师门
|
|||
|
public Master m_MasterInfo;
|
|||
|
|
|||
|
// 策划要求 任务追踪界面排序
|
|||
|
|
|||
|
private int m_ModelVisualID = GlobeVar.INVALID_ID;
|
|||
|
|
|||
|
public MONEY m_Money;
|
|||
|
|
|||
|
// 月卡的剩余天数
|
|||
|
// 如果是小于等于0,月卡失效,否则有效
|
|||
|
|
|||
|
//帮会货运马车
|
|||
|
private int m_nGharryObjID = -1;
|
|||
|
private ulong m_nHpDrugGUID = GlobeVar.INVALID_GUID; //血药位置
|
|||
|
private ulong m_nMpDrugGUID = GlobeVar.INVALID_GUID; //魔药位置
|
|||
|
|
|||
|
//VIP
|
|||
|
|
|||
|
//VIP
|
|||
|
|
|||
|
//进阶装备槽位
|
|||
|
private GameItemContainer m_oAdvancePack;
|
|||
|
|
|||
|
private GameItemContainer m_oBackPack;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//坐骑数据
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
public MountParam m_objMountParam;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//回购槽位
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
private GameItemContainer m_oBuyBackPack;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//装备槽位
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
private GameItemContainer m_oEquipPack;
|
|||
|
|
|||
|
// 装备槽位的强化等级和完美度
|
|||
|
private StrengthData[] m_oEquipSlotStrength;
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//法宝槽位
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
private GameItemContainer m_oMagicPack;
|
|||
|
|
|||
|
private CangkuContainer m_oStoragePack;
|
|||
|
|
|||
|
//充值活动
|
|||
|
private PayActivityData m_PayActivity;
|
|||
|
|
|||
|
private PlayerOrnamentInfo m_PlayerOrnamentStateInfo;
|
|||
|
|
|||
|
//角色PVP信息
|
|||
|
private PvpInfo m_PvpInfo;
|
|||
|
|
|||
|
// 滚动公告
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//组队数据
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//称号数据
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|||
|
|
|||
|
private readonly List<int> m_VipRewardState = new List<int>();
|
|||
|
|
|||
|
//帮战推送消息
|
|||
|
|
|||
|
//所属服务器ID
|
|||
|
|
|||
|
//玩家好友申请列表
|
|||
|
public bool NewApplyCheck = false;
|
|||
|
|
|||
|
// 这个变量从来未赋值,将会一直处于false状态
|
|||
|
//是否开启挂机模式
|
|||
|
//private bool m_BeforeChangeSceneAutoCombat;
|
|||
|
//public bool ChangeSceneAutoCombat
|
|||
|
//{
|
|||
|
// get { return m_BeforeChangeSceneAutoCombat; }
|
|||
|
// set { m_BeforeChangeSceneAutoCombat = value; }
|
|||
|
//}
|
|||
|
|
|||
|
////是否开启挂机模式
|
|||
|
//private bool m_IsOpenAutoCombat;
|
|||
|
//public bool IsOpenAutoCombat
|
|||
|
//{
|
|||
|
// get { return m_IsOpenAutoCombat; }
|
|||
|
// set { m_IsOpenAutoCombat = value; }
|
|||
|
//}
|
|||
|
////最近一次打断 自动战斗的时间
|
|||
|
//private float m_fBreakAutoCombatTime;
|
|||
|
//public float BreakAutoCombatTime
|
|||
|
//{
|
|||
|
// get { return m_fBreakAutoCombatTime; }
|
|||
|
// set { m_fBreakAutoCombatTime = value; }
|
|||
|
//}
|
|||
|
|
|||
|
public int OldAutoCombat = -1;
|
|||
|
|
|||
|
//婚车双方OBJ
|
|||
|
public List<Obj_Character> OnWeddingCarObjList;
|
|||
|
|
|||
|
//复活相关数据
|
|||
|
public ReliveLogic.ReLiveData ReliveData;
|
|||
|
|
|||
|
//仓库最大解锁数(只在打开仓库之后才会同步)
|
|||
|
public int SlotTotalUnLockCount = 0;
|
|||
|
|
|||
|
public string TreasureTip = "";
|
|||
|
|
|||
|
public PlayerData()
|
|||
|
{
|
|||
|
IsShowVipTip = false;
|
|||
|
ForthSkillFlag = false;
|
|||
|
AutoTeamState = false;
|
|||
|
StartSweep = false;
|
|||
|
MpItemCDTime = 0;
|
|||
|
HpItemCDTime = 0;
|
|||
|
ReliveEntryTime = 0;
|
|||
|
HasInitEquipPack = false;
|
|||
|
HasInitBackPack = false;
|
|||
|
IsMarried = false;
|
|||
|
LastConsignShareTime = 0.0f;
|
|||
|
IsHaveCaptainWelfareRewCanGetted = false;
|
|||
|
IsForbiddenTalk = false;
|
|||
|
CleanUp();
|
|||
|
}
|
|||
|
|
|||
|
public bool IsFollowTeam
|
|||
|
{
|
|||
|
get { return IsHaveTeam() && !TeamInfo.IsCaptain() && TeamInfo.IsFollowTeam(); }
|
|||
|
}
|
|||
|
|
|||
|
public PlayerOrnamentInfo PlayerOrnamentStateInfo
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_PlayerOrnamentStateInfo == null)
|
|||
|
m_PlayerOrnamentStateInfo = new PlayerOrnamentInfo();
|
|||
|
return m_PlayerOrnamentStateInfo;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public ItemLimtInfoCtr ItemLimitInfo
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_ItemLimitInfoCtr == null)
|
|||
|
m_ItemLimitInfoCtr = new ItemLimtInfoCtr();
|
|||
|
return m_ItemLimitInfoCtr;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public ChildData ChildData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_ChildData == null)
|
|||
|
m_ChildData = new ChildData();
|
|||
|
return m_ChildData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//是否处于门派挑战自动匹配状态
|
|||
|
public bool IsFactionAdvanceAutoMtach { get; set; }
|
|||
|
|
|||
|
public bool IsInMeditateState
|
|||
|
{
|
|||
|
get { return _IsInMeditataState; }
|
|||
|
set
|
|||
|
{
|
|||
|
_IsInMeditataState = value;
|
|||
|
if (MeditateCtr.Instance)
|
|||
|
MeditateCtr.Instance.ShowMeditateHLBtn(_IsInMeditataState);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//结婚游街
|
|||
|
public bool IsInWeddingCar { get; set; }
|
|||
|
|
|||
|
//婚车ObjId
|
|||
|
public int WeddingCarObjId { get; set; }
|
|||
|
|
|||
|
////婚车相机
|
|||
|
//public Camera WCCamera { get; set; }
|
|||
|
//BindObjId
|
|||
|
public Dictionary<ulong, WCBingObjInfo> _WCBindObjDic { get; set; }
|
|||
|
|
|||
|
//当前VIP体验对应ID
|
|||
|
public int VipIdoitId { set; get; }
|
|||
|
|
|||
|
//当前VIP体验状态
|
|||
|
public int VipIdoitStae { set; get; }
|
|||
|
|
|||
|
public PvpInfo pvpIfo
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_PvpInfo == null)
|
|||
|
m_PvpInfo = new PvpInfo();
|
|||
|
return m_PvpInfo;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public ClientCustomData ClientCustomDateManager
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_ClientCustomDateManager == null)
|
|||
|
m_ClientCustomDateManager = new ClientCustomData();
|
|||
|
return m_ClientCustomDateManager;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public FunctionRewStateManager FunctionRemainTimeStateManager
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_functionRewStateManager == null)
|
|||
|
_functionRewStateManager = new FunctionRewStateManager();
|
|||
|
return _functionRewStateManager;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public Dictionary<int, int> ActivityHeadExpDic
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_ActivityHeadExpDic == null)
|
|||
|
m_ActivityHeadExpDic = new Dictionary<int, int>();
|
|||
|
return m_ActivityHeadExpDic;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public Dictionary<int, long> FuncionOnlineTimeDic
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_FuncionOnlineTimeDic == null)
|
|||
|
m_FuncionOnlineTimeDic = new Dictionary<int, long>();
|
|||
|
return m_FuncionOnlineTimeDic;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public Dictionary<int, bool> FunctionOpenState
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_FunctionOpenState == null)
|
|||
|
m_FunctionOpenState = new Dictionary<int, bool>();
|
|||
|
return m_FunctionOpenState;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public bool IsForbiddenTalk { get; set; }
|
|||
|
|
|||
|
public ulong ForbiddenTalkOverTime
|
|||
|
{
|
|||
|
get { return m_ForbiddenTalkOverTime; }
|
|||
|
set { m_ForbiddenTalkOverTime = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int WorldId { set; get; }
|
|||
|
|
|||
|
public string ChannelId { set; get; }
|
|||
|
|
|||
|
public List<int> VipRewardStates
|
|||
|
{
|
|||
|
get { return m_VipRewardState; }
|
|||
|
}
|
|||
|
|
|||
|
// 技能锁定相关数据
|
|||
|
public int SkillLockMode
|
|||
|
{
|
|||
|
get { return _skillLockMode; }
|
|||
|
set
|
|||
|
{
|
|||
|
if (_skillLockMode != value)
|
|||
|
{
|
|||
|
_skillLockMode = value;
|
|||
|
EventDispatcher.Instance.Dispatch(EventId.LockSkillInput, _skillLockMode);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 是否允许输入普攻
|
|||
|
/// </summary>
|
|||
|
public bool AllowSimpleInput
|
|||
|
{
|
|||
|
get { return (SkillLockMode & 1) > 0; }
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 是否允许输入技能
|
|||
|
/// </summary>
|
|||
|
public bool AllowSkillInput
|
|||
|
{
|
|||
|
get { return (SkillLockMode & 2) > 0; }
|
|||
|
}
|
|||
|
|
|||
|
public PlayerFashionData PlerfaFashiuonDataCtr
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_PlayerFashionData == null)
|
|||
|
_PlayerFashionData = new PlayerFashionData();
|
|||
|
return _PlayerFashionData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public MarryRingCtr MyRingInfoData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_MyRingInfoData == null)
|
|||
|
_MyRingInfoData = new MarryRingCtr();
|
|||
|
return _MyRingInfoData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public MarryFetterData MyFetterData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_MyFetterData == null)
|
|||
|
_MyFetterData = new MarryFetterData();
|
|||
|
return _MyFetterData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public MarryAcaciaData MyAcaciaData
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_MyAcaciaData == null)
|
|||
|
_MyAcaciaData = new MarryAcaciaData();
|
|||
|
return _MyAcaciaData;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public bool IsHaveCaptainWelfareRewCanGetted { get; set; }
|
|||
|
|
|||
|
public OwnSkillData[] OwnSkillInfo { get; private set; }
|
|||
|
|
|||
|
public bool IsHaveImperialEligible { set; get; }
|
|||
|
|
|||
|
public int SkillPublicTime { get; set; }
|
|||
|
|
|||
|
public bool IsCanPKLegal { get; set; }
|
|||
|
|
|||
|
public int PkModle { get; set; }
|
|||
|
|
|||
|
public bool AutoComabat
|
|||
|
{
|
|||
|
get { return m_bAutoComabat; }
|
|||
|
set { m_bAutoComabat = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int StealthLev { get; set; }
|
|||
|
|
|||
|
public float LastConsignShareTime { get; set; }
|
|||
|
|
|||
|
//体验VIP
|
|||
|
public int ExperIvpLevel { get; set; }
|
|||
|
|
|||
|
public int VipCost { get; set; }
|
|||
|
|
|||
|
public int VipFreeLive { get; set; }
|
|||
|
|
|||
|
public int MonthlyCardDayRemain { get; set; }
|
|||
|
|
|||
|
public int PoolCombatValue { get; set; }
|
|||
|
|
|||
|
public List<ClientImpactInfo> ClientImpactInfo { get; set; }
|
|||
|
|
|||
|
public int MainBindParent { get; set; }
|
|||
|
|
|||
|
public List<int> MainBindChildren { get; set; }
|
|||
|
|
|||
|
public bool IsMarried { get; set; }
|
|||
|
|
|||
|
public int CoupFlag
|
|||
|
{
|
|||
|
get { return _CoupFlag; }
|
|||
|
set { _CoupFlag = value; }
|
|||
|
}
|
|||
|
|
|||
|
public BaseAttr MainPlayerBaseAttr { get; set; }
|
|||
|
|
|||
|
public PlayerEnterSceneCache EnterSceneCache { get; set; }
|
|||
|
|
|||
|
public GameItemContainer BackPack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oBackPack == null) CleanUpContainers();
|
|||
|
return m_oBackPack;
|
|||
|
}
|
|||
|
set { m_oBackPack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public bool HasInitBackPack { get; set; }
|
|||
|
|
|||
|
public GameItemContainer EquipPack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oEquipPack == null) CleanUpContainers();
|
|||
|
return m_oEquipPack;
|
|||
|
}
|
|||
|
set { m_oEquipPack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public bool HasInitEquipPack { get; set; }
|
|||
|
|
|||
|
public StrengthData[] EquipSlotStrength
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oEquipSlotStrength == null) CleanUpContainers();
|
|||
|
return m_oEquipSlotStrength;
|
|||
|
}
|
|||
|
set { m_oEquipSlotStrength = value; }
|
|||
|
}
|
|||
|
|
|||
|
public GameItemContainer BuyBackPack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oBuyBackPack == null) CleanUpContainers();
|
|||
|
return m_oBuyBackPack;
|
|||
|
}
|
|||
|
set { m_oBuyBackPack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public CangkuContainer StoragePack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oStoragePack == null) CleanUpContainers();
|
|||
|
return m_oStoragePack;
|
|||
|
}
|
|||
|
set { m_oStoragePack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public GameItemContainer MagicPack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oMagicPack == null) CleanUpContainers();
|
|||
|
return m_oMagicPack;
|
|||
|
}
|
|||
|
set { m_oMagicPack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public GameItemContainer AdvancePack
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_oAdvancePack == null) CleanUpContainers();
|
|||
|
return m_oAdvancePack;
|
|||
|
}
|
|||
|
set { m_oAdvancePack = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int DressMagicModelId
|
|||
|
{
|
|||
|
get { return m_dressMagicModelId; }
|
|||
|
}
|
|||
|
|
|||
|
public int ActiveMagicModelCount
|
|||
|
{
|
|||
|
get { return m_activeMagicModels.Count; }
|
|||
|
}
|
|||
|
|
|||
|
public Team TeamInfo { get; set; }
|
|||
|
|
|||
|
public Guild GuildInfo { get; set; }
|
|||
|
|
|||
|
public int nGharryObjID
|
|||
|
{
|
|||
|
get { return m_nGharryObjID; }
|
|||
|
set { m_nGharryObjID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public GuildList guildList { get; set; }
|
|||
|
|
|||
|
public List<GuildWarPushMessageInfo> WarPushMessaeg { get; set; }
|
|||
|
|
|||
|
public GameTitleInvestitive TitleInvestitive { get; set; }
|
|||
|
|
|||
|
public bool IsLockPriorTitle { get; set; }
|
|||
|
|
|||
|
public GameChatHistory ChatHistory { get; set; }
|
|||
|
|
|||
|
public ChatInfoLogic.CHANNEL_TYPE ChooseChannel
|
|||
|
{
|
|||
|
get { return m_eChooseChannel; }
|
|||
|
set { m_eChooseChannel = value; }
|
|||
|
}
|
|||
|
|
|||
|
public ulong LastTellGUID
|
|||
|
{
|
|||
|
get { return m_LastTellGUID; }
|
|||
|
set { m_LastTellGUID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public string LastTellName
|
|||
|
{
|
|||
|
get { return m_LastTellName; }
|
|||
|
set { m_LastTellName = value; }
|
|||
|
}
|
|||
|
|
|||
|
public LastSpeakerRecord TellChatSpeakers { get; set; }
|
|||
|
|
|||
|
public RelationList FriendList
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (m_FriendList.RelationDataList.Count == 0)
|
|||
|
{
|
|||
|
// "系统信息" 好友
|
|||
|
var sysFriend = new Relation();
|
|||
|
sysFriend.Guid = GlobeVar.SYSFRIEND_GUID;
|
|||
|
sysFriend.Name = StrDictionary.GetClientDictionaryString("#{5213}");
|
|||
|
sysFriend.State = 1;
|
|||
|
sysFriend.TimeInfo = 0;
|
|||
|
m_FriendList.AddRelation(sysFriend);
|
|||
|
|
|||
|
// "小精灵" 好友
|
|||
|
//Relation helpFriend = new Relation();
|
|||
|
//helpFriend.Guid = GlobeVar.HELPFRIEND_GUID;
|
|||
|
//helpFriend.Name = StrDictionary.GetClientDictionaryString("#{5214}");
|
|||
|
//helpFriend.State = 1;
|
|||
|
//helpFriend.TimeInfo = 1;
|
|||
|
//m_FriendList.AddRelation(helpFriend);
|
|||
|
}
|
|||
|
|
|||
|
return m_FriendList;
|
|||
|
}
|
|||
|
set { m_FriendList = value; }
|
|||
|
}
|
|||
|
|
|||
|
public RelationList GuildFriendList { get; set; }
|
|||
|
|
|||
|
public RelationList FriendApplyList { get; set; }
|
|||
|
|
|||
|
public RelationList BlackList { get; set; }
|
|||
|
|
|||
|
public RelationList HateList { get; set; }
|
|||
|
|
|||
|
public FellowBookData FellowBookData { get; set; }
|
|||
|
|
|||
|
public FellowContainer FellowContainer { get; set; }
|
|||
|
|
|||
|
public bool FellowPlayerEffect { get; set; }
|
|||
|
|
|||
|
public List<int> ActiveFellowSkill { get; set; }
|
|||
|
|
|||
|
public int FellowGainCount_Free { get; set; }
|
|||
|
|
|||
|
public int FellowGainCount_Coin { get; set; }
|
|||
|
|
|||
|
public int FellowGainCount_YuanBao { get; set; }
|
|||
|
|
|||
|
public int FellowGainCD_Coin { get; set; }
|
|||
|
|
|||
|
public int ReliveEntryTime { get; set; }
|
|||
|
|
|||
|
public UserCommonData CommonData { get; set; }
|
|||
|
|
|||
|
public DailyMissionData DailyMissionData { get; set; }
|
|||
|
|
|||
|
public ulong LoverGUID
|
|||
|
{
|
|||
|
get { return m_LoverGUID; }
|
|||
|
set { m_LoverGUID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public MONEY Money
|
|||
|
{
|
|||
|
get { return m_Money; }
|
|||
|
set { m_Money = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int[] FashionDeadline { get; set; }
|
|||
|
|
|||
|
public int WeaponFashionId { get; set; }
|
|||
|
|
|||
|
public bool ShowFashion { get; set; }
|
|||
|
|
|||
|
public int ModelVisualID
|
|||
|
{
|
|||
|
get { return m_ModelVisualID; }
|
|||
|
set { m_ModelVisualID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public ForceUseModelData ForceUseModel { get; set; }
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 额外的模型尺寸参数
|
|||
|
/// </summary>
|
|||
|
// 注:例如变大变小的buff,需要保障角色模型替换后有效
|
|||
|
public float ModelScale
|
|||
|
{
|
|||
|
get { return _modelScale; }
|
|||
|
set { _modelScale = value; }
|
|||
|
}
|
|||
|
|
|||
|
public List<string> RollNoticeList { get; set; }
|
|||
|
|
|||
|
public float HpItemCDTime { get; set; }
|
|||
|
|
|||
|
public float MpItemCDTime { get; set; }
|
|||
|
|
|||
|
public bool StartSweep { get; set; }
|
|||
|
|
|||
|
public bool CopySceneChange
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (Time.realtimeSinceStartup - m_fCopySceneChange > 10.0f)
|
|||
|
return false;
|
|||
|
return true;
|
|||
|
}
|
|||
|
set
|
|||
|
{
|
|||
|
if (value)
|
|||
|
m_fCopySceneChange = Time.realtimeSinceStartup;
|
|||
|
else
|
|||
|
m_fCopySceneChange = 0;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public PayActivityData PayActivity
|
|||
|
{
|
|||
|
get { return m_PayActivity; }
|
|||
|
set { m_PayActivity = value; }
|
|||
|
}
|
|||
|
|
|||
|
public bool AutoTeamState { get; set; }
|
|||
|
|
|||
|
public int AutoTeamCopySceneId
|
|||
|
{
|
|||
|
get { return m_bAutoTeamCopySceneId; }
|
|||
|
set { m_bAutoTeamCopySceneId = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int AutoTeamCopySceneDifficult
|
|||
|
{
|
|||
|
get { return m_bAutoTeamCopySceneDifficult; }
|
|||
|
set { m_bAutoTeamCopySceneDifficult = value; }
|
|||
|
}
|
|||
|
|
|||
|
public bool ForthSkillFlag { get; set; }
|
|||
|
|
|||
|
public List<int> MissionSortList { get; set; }
|
|||
|
|
|||
|
public Vector3 MissionGridLastPos { get; set; }
|
|||
|
|
|||
|
public bool IsShowVipTip { get; set; }
|
|||
|
|
|||
|
public int AutoSearchMissionId
|
|||
|
{
|
|||
|
get { return m_AutoSearchMissionId; }
|
|||
|
set { m_AutoSearchMissionId = value; }
|
|||
|
}
|
|||
|
|
|||
|
public int AutoShowTurnOverEnsureMissionId
|
|||
|
{
|
|||
|
get { return m_AutoShowTurnOverEnsureMissionId; }
|
|||
|
set { m_AutoShowTurnOverEnsureMissionId = value; }
|
|||
|
}
|
|||
|
|
|||
|
public ulong HpDrugGUID
|
|||
|
{
|
|||
|
get { return m_nHpDrugGUID; }
|
|||
|
set { m_nHpDrugGUID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public ulong MpDrugGUID
|
|||
|
{
|
|||
|
get { return m_nMpDrugGUID; }
|
|||
|
set { m_nMpDrugGUID = value; }
|
|||
|
}
|
|||
|
|
|||
|
public void CleanUpContainers()
|
|||
|
{
|
|||
|
GameItemContainer.InitStaticParams();
|
|||
|
m_oBackPack = new GameItemContainer(GameItemContainer.SIZE_BACKPACK, GameItemContainer.Type.TYPE_BACKPACK);
|
|||
|
m_oEquipPack = new GameItemContainer(GameItemContainer.SIZE_EQUIPPACK, GameItemContainer.Type.TYPE_EQUIPPACK);
|
|||
|
m_oEquipSlotStrength = new StrengthData[GameItemContainer.SIZE_EQUIPPACK];
|
|||
|
m_oBuyBackPack =
|
|||
|
new GameItemContainer(GameItemContainer.MAXSIZE_BUYBACKPACK, GameItemContainer.Type.TYPE_BUYBACKPACK);
|
|||
|
m_oStoragePack =
|
|||
|
new CangkuContainer(GameItemContainer.SIZE_STORAGEPACK, GameItemContainer.Type.TYPE_STORAGEPACK);
|
|||
|
m_oMagicPack = new GameItemContainer(GameItemContainer.SIZE_MAGICPACK, GameItemContainer.Type.TYPE_MAGICPACK);
|
|||
|
m_oAdvancePack =
|
|||
|
new GameItemContainer(GameItemContainer.SIZE_ADVANCPACK, GameItemContainer.Type.TYPE_ADVANCEPACK);
|
|||
|
}
|
|||
|
|
|||
|
public void CleanUp()
|
|||
|
{
|
|||
|
var newAttr = new BaseAttr();
|
|||
|
// 试图将绑定事件传递到新的Attr
|
|||
|
if (MainPlayerBaseAttr != null)
|
|||
|
{
|
|||
|
newAttr.onMoveSpeedUpdate = MainPlayerBaseAttr.onMoveSpeedUpdate;
|
|||
|
MainPlayerBaseAttr.onMoveSpeedUpdate = null;
|
|||
|
}
|
|||
|
|
|||
|
MainPlayerBaseAttr = newAttr;
|
|||
|
|
|||
|
HasInitBackPack = false;
|
|||
|
|
|||
|
//清理玩家切场景缓存数据
|
|||
|
EnterSceneCache = new PlayerEnterSceneCache();
|
|||
|
|
|||
|
//玩家组队信息
|
|||
|
TeamInfo = new Team();
|
|||
|
if (null != TeamInfo) TeamInfo.CleanUp();
|
|||
|
|
|||
|
GuildInfo = new Guild();
|
|||
|
guildList = new GuildList();
|
|||
|
|
|||
|
m_objMountParam = new MountParam();
|
|||
|
m_objMountParam.CleanUp();
|
|||
|
|
|||
|
m_AdvanceData = new AdvanceData();
|
|||
|
// 玩家称号
|
|||
|
TitleInvestitive = new GameTitleInvestitive();
|
|||
|
IsLockPriorTitle = false;
|
|||
|
// 聊天记录
|
|||
|
if (ChatHistory == null)
|
|||
|
//如果聊天记录存在(断线重连/重新登陆),不清除聊天记录
|
|||
|
ChatHistory = new GameChatHistory();
|
|||
|
// 最近私聊对象记录
|
|||
|
TellChatSpeakers = new LastSpeakerRecord();
|
|||
|
|
|||
|
//初始化玩家关系数据
|
|||
|
m_FriendList = new RelationList();
|
|||
|
GuildFriendList = new RelationList();
|
|||
|
FriendApplyList = new RelationList();
|
|||
|
BlackList = new RelationList();
|
|||
|
HateList = new RelationList();
|
|||
|
|
|||
|
//伙伴
|
|||
|
FellowContainer = new FellowContainer();
|
|||
|
FellowPlayerEffect = false;
|
|||
|
ActiveFellowSkill = new List<int>();
|
|||
|
FellowGainCount_Free = 0;
|
|||
|
FellowGainCount_Coin = 0;
|
|||
|
FellowGainCount_YuanBao = 0;
|
|||
|
FellowGainCD_Coin = 0;
|
|||
|
m_FellowTickTime = 0f;
|
|||
|
FellowBookData = new FellowBookData();
|
|||
|
|
|||
|
//初始化
|
|||
|
_MyRingInfoData = new MarryRingCtr();
|
|||
|
|
|||
|
OwnSkillInfo = new OwnSkillData[(int) SKILLDEFINE.MAX_SKILLNUM];
|
|||
|
for (var i = 0; i < (int) SKILLDEFINE.MAX_SKILLNUM; i++)
|
|||
|
{
|
|||
|
OwnSkillInfo[i] = new OwnSkillData();
|
|||
|
OwnSkillInfo[i].CleanUp();
|
|||
|
}
|
|||
|
|
|||
|
SkillPublicTime = 0;
|
|||
|
IsCanPKLegal = false;
|
|||
|
m_Money = new MONEY();
|
|||
|
VipCost = -1;
|
|||
|
ClientImpactInfo = new List<ClientImpactInfo>();
|
|||
|
|
|||
|
CommonData = new UserCommonData(); // 玩家通用数据
|
|||
|
DailyMissionData = new DailyMissionData(); // 日常任务数据
|
|||
|
|
|||
|
FashionDeadline = new int[GlobeVar.MAX_FASHION_SIZE];
|
|||
|
for (var i = 0; i < GlobeVar.MAX_FASHION_SIZE; i++) FashionDeadline[i] = 0;
|
|||
|
WeaponFashionId = GlobeVar.INVALID_ID;
|
|||
|
ShowFashion = false;
|
|||
|
m_ModelVisualID = GlobeVar.INVALID_ID;
|
|||
|
_SwornBrother = new SwornBrother();
|
|||
|
m_MasterInfo = new Master();
|
|||
|
PkModle = -1;
|
|||
|
|
|||
|
//隐身级别
|
|||
|
StealthLev = 0;
|
|||
|
//是否开始自动战斗
|
|||
|
m_bAutoComabat = false;
|
|||
|
|
|||
|
WarPushMessaeg = new List<GuildWarPushMessageInfo>();
|
|||
|
m_LoverGUID = GlobeVar.INVALID_GUID;
|
|||
|
//上次寄售行吆喝时间
|
|||
|
LastConsignShareTime = 0.0f;
|
|||
|
m_PayActivity.CleanUp();
|
|||
|
|
|||
|
RollNoticeList = new List<string>();
|
|||
|
|
|||
|
ForthSkillFlag = false;
|
|||
|
|
|||
|
MainBindChildren = new List<int>();
|
|||
|
MainBindParent = -1;
|
|||
|
AutoTeamState = false;
|
|||
|
|
|||
|
MissionSortList = new List<int>();
|
|||
|
MissionGridLastPos = Vector3.zero;
|
|||
|
|
|||
|
IsShowVipTip = false;
|
|||
|
|
|||
|
ReliveData.ClearUp();
|
|||
|
|
|||
|
_PlayerFashionData = new PlayerFashionData();
|
|||
|
_MyFetterData = new MarryFetterData();
|
|||
|
_MyAcaciaData = new MarryAcaciaData();
|
|||
|
|
|||
|
IsHaveCaptainWelfareRewCanGetted = false;
|
|||
|
|
|||
|
// m_PrivilegeTypeStateDic = new Dictionary<int, bool>();
|
|||
|
|
|||
|
IsForbiddenTalk = false;
|
|||
|
m_ForbiddenTalkOverTime = 0; //0就是没有禁言状态
|
|||
|
|
|||
|
m_FunctionOpenState = new Dictionary<int, bool>();
|
|||
|
|
|||
|
m_FuncionOnlineTimeDic = new Dictionary<int, long>();
|
|||
|
|
|||
|
_functionRewStateManager = new FunctionRewStateManager();
|
|||
|
|
|||
|
m_ClientCustomDateManager = new ClientCustomData();
|
|||
|
|
|||
|
m_ItemLimitInfoCtr = new ItemLimtInfoCtr();
|
|||
|
|
|||
|
m_PvpInfo = new PvpInfo();
|
|||
|
|
|||
|
VipIdoitId = -1;
|
|||
|
VipIdoitStae = 0;
|
|||
|
|
|||
|
_LastGuildConscribeTime = 0.0f;
|
|||
|
|
|||
|
WeddingCarObjId = -1;
|
|||
|
IsInWeddingCar = false;
|
|||
|
_WCBindObjDic = new Dictionary<ulong, WCBingObjInfo>();
|
|||
|
|
|||
|
IsFactionAdvanceAutoMtach = false;
|
|||
|
|
|||
|
//防止切换账号后接到任务不能自动寻路
|
|||
|
GuideLogic._isShowCompleteMissionGuide = false;
|
|||
|
|
|||
|
InTreasureState = false;
|
|||
|
|
|||
|
m_PlayerOrnamentStateInfo = new PlayerOrnamentInfo();
|
|||
|
|
|||
|
m_ChildData = new ChildData();
|
|||
|
}
|
|||
|
|
|||
|
public void AddVipGetRewardState(IList<int> states)
|
|||
|
{
|
|||
|
m_VipRewardState.Clear();
|
|||
|
m_VipRewardState.AddRange(states);
|
|||
|
if (ActiveBtns.Instance() != null)
|
|||
|
ActiveBtns.Instance().VipTipRedPoint();
|
|||
|
}
|
|||
|
|
|||
|
public OwnSkillData GetOwnSkillInfo(int skillBaseID)
|
|||
|
{
|
|||
|
foreach (var ownSkill in OwnSkillInfo)
|
|||
|
{
|
|||
|
if (ownSkill.SkillBaseTable == null)
|
|||
|
continue;
|
|||
|
if (ownSkill.SkillBaseTable.Id == skillBaseID)
|
|||
|
return ownSkill;
|
|||
|
}
|
|||
|
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
public void UpdateOwnSkills()
|
|||
|
{
|
|||
|
for (var i = 0; i < OwnSkillInfo.Length; i++)
|
|||
|
OwnSkillInfo[i].UpdateCooldown();
|
|||
|
}
|
|||
|
|
|||
|
public void AddCooldownModifier(int handle, float substract, float modifier, IList<int> baseIdList)
|
|||
|
{
|
|||
|
for (var i = 0; i < baseIdList.Count; i++)
|
|||
|
{
|
|||
|
// 注:防御委托延迟操作,勿删
|
|||
|
var index = i;
|
|||
|
var ownSkill = OwnSkillInfo.Find(a => a.SkillBaseTable != null && a.SkillBaseTable.Id == baseIdList[index]);
|
|||
|
if (ownSkill != null)
|
|||
|
{
|
|||
|
if (modifier > 0f)
|
|||
|
ownSkill.AddCooldownModifier(handle, modifier);
|
|||
|
if (substract > 0f)
|
|||
|
ownSkill.SubstractCooldown(substract);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void RemoveCooldownModifier(int handle)
|
|||
|
{
|
|||
|
for (var i = 0; i < OwnSkillInfo.Length; i++)
|
|||
|
OwnSkillInfo[i].RemoveCooldownModifier(handle);
|
|||
|
}
|
|||
|
|
|||
|
public void CleanUpOwnSkillInfo()
|
|||
|
{
|
|||
|
for (var i = 0; i < OwnSkillInfo.Length; i++) OwnSkillInfo[i].CleanUp();
|
|||
|
if (GameManager.gameManager != null && GameManager.gameManager.effectPool != null)
|
|||
|
GameManager.gameManager.effectPool.CleanHoldPreload();
|
|||
|
}
|
|||
|
|
|||
|
//特权VIP等级
|
|||
|
//private Dictionary<int, bool> m_PrivilegeTypeStateDic;
|
|||
|
//public Dictionary<int, bool> PrivilegeTypeStateDic
|
|||
|
//{
|
|||
|
// get
|
|||
|
// {
|
|||
|
// if (m_PrivilegeTypeStateDic == null)
|
|||
|
// m_PrivilegeTypeStateDic = new Dictionary<int, bool>();
|
|||
|
// return m_PrivilegeTypeStateDic;
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
public int GetMaxPrivilegeVip()
|
|||
|
{
|
|||
|
var level = 0;
|
|||
|
//foreach (var privilegeType in m_PrivilegeTypeStateDic)
|
|||
|
//{
|
|||
|
// if (privilegeType.Value)
|
|||
|
// {
|
|||
|
// if (privilegeType.Key > level)
|
|||
|
// level = privilegeType.Key;
|
|||
|
// }
|
|||
|
//}
|
|||
|
return level;
|
|||
|
}
|
|||
|
|
|||
|
public void SetPropInt(PropID.PropertyID propID, int value)
|
|||
|
{
|
|||
|
if (_IntPropValue.ContainsKey(propID))
|
|||
|
_IntPropValue[propID] = value;
|
|||
|
else
|
|||
|
_IntPropValue.Add(propID, value);
|
|||
|
}
|
|||
|
|
|||
|
public int GetPropInt(PropID.PropertyID propID)
|
|||
|
{
|
|||
|
if (_IntPropValue.ContainsKey(propID))
|
|||
|
return _IntPropValue[propID];
|
|||
|
return -1;
|
|||
|
}
|
|||
|
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//背包
|
|||
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
//取得背包
|
|||
|
public GameItemContainer GetItemContainer(GameItemContainer.Type type)
|
|||
|
{
|
|||
|
switch (type)
|
|||
|
{
|
|||
|
case GameItemContainer.Type.TYPE_BACKPACK: return m_oBackPack;
|
|||
|
case GameItemContainer.Type.TYPE_EQUIPPACK: return m_oEquipPack;
|
|||
|
case GameItemContainer.Type.TYPE_BUYBACKPACK: return m_oBuyBackPack;
|
|||
|
case GameItemContainer.Type.TYPE_STORAGEPACK: return m_oStoragePack;
|
|||
|
case GameItemContainer.Type.TYPE_MAGICPACK: return m_oMagicPack;
|
|||
|
case GameItemContainer.Type.TYPE_ADVANCEPACK: return m_oAdvancePack;
|
|||
|
}
|
|||
|
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsMagicModelActive(int Id)
|
|||
|
{
|
|||
|
for (var i = 0; i < m_activeMagicModels.Count; i++)
|
|||
|
if (Id == m_activeMagicModels[i])
|
|||
|
return true;
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public int GetActiveMagicModelsByIndex(int index)
|
|||
|
{
|
|||
|
if (index < 0 || index > m_activeMagicModels.Count)
|
|||
|
return -1;
|
|||
|
return m_activeMagicModels[index];
|
|||
|
}
|
|||
|
|
|||
|
public void InitMagicWeaponInfo(int dressId, IList<int> activeModels)
|
|||
|
{
|
|||
|
m_activeMagicModels.Clear();
|
|||
|
m_activeMagicModels.AddRange(activeModels);
|
|||
|
m_dressMagicModelId = dressId;
|
|||
|
if (Singleton<ObjManager>.Instance.MainPlayer != null)
|
|||
|
{
|
|||
|
Singleton<ObjManager>.Instance.MainPlayer.CreateMagicModel(m_dressMagicModelId);
|
|||
|
EventDispatcher.Instance.SendMessage(EventId.MagicShowModel);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public bool IsHaveTeam()
|
|||
|
{
|
|||
|
return null != TeamInfo && TeamInfo.TeamID != GlobeVar.INVALID_ID;
|
|||
|
}
|
|||
|
|
|||
|
//某个Guid是否为队伍成员
|
|||
|
public bool IsTeamMem(ulong guid)
|
|||
|
{
|
|||
|
if (GlobeVar.INVALID_ID == TeamInfo.TeamID ||
|
|||
|
GlobeVar.INVALID_GUID == guid)
|
|||
|
return false;
|
|||
|
for (var i = 0; i < GlobeVar.MAX_TEAM_MEMBER; i++)
|
|||
|
if (null != TeamInfo.GetTeamMember(i) &&
|
|||
|
guid == TeamInfo.GetTeamMember(i).Guid)
|
|||
|
return true;
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsHadCreateGuild()
|
|||
|
{
|
|||
|
return null != GuildInfo && GuildInfo.GuildGuid != GlobeVar.INVALID_GUID;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsHaveGuild()
|
|||
|
{
|
|||
|
return null != GuildInfo && GuildInfo.GuildGuid != GlobeVar.INVALID_GUID && GuildInfo.GuildLevel > 0;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsReserveGuildMember()
|
|||
|
{
|
|||
|
if (null == GuildInfo || GuildInfo.GuildGuid == GlobeVar.INVALID_GUID) return false;
|
|||
|
|
|||
|
var mainPlayerGuid = GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid;
|
|||
|
GuildMember member;
|
|||
|
if (GuildInfo.GuildMemberList.TryGetValue(mainPlayerGuid, out member))
|
|||
|
if (member.Job == (int) GameDefine_Globe.GUILD_JOB.RESERVE)
|
|||
|
return true;
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsGuildMember(Obj_OtherPlayer _otherPlayer)
|
|||
|
{
|
|||
|
if (_otherPlayer != null && _otherPlayer.GuildGUID != GlobeVar.INVALID_GUID &&
|
|||
|
_otherPlayer.GuildGUID == GuildInfo.GuildGuid)
|
|||
|
return _otherPlayer.GuildJob > (int) GameDefine_Globe.GUILD_JOB.INVALID &&
|
|||
|
_otherPlayer.GuildJob < (int) GameDefine_Globe.GUILD_JOB.RESERVE;
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsGuildMember(ulong guid)
|
|||
|
{
|
|||
|
var job = GetGuildJob(guid);
|
|||
|
if (job > GameDefine_Globe.GUILD_JOB.INVALID &&
|
|||
|
// 排除学徒以及预备学徒,或者之后加入的更低级职位
|
|||
|
job < GameDefine_Globe.GUILD_JOB.RESERVE)
|
|||
|
return true;
|
|||
|
// 之前的判定逻辑,最后允许GuildGuid == guid的情况
|
|||
|
return GuildInfo != null && GuildInfo.GuildGuid != GlobeVar.INVALID_GUID && GuildInfo.GuildGuid == guid;
|
|||
|
}
|
|||
|
|
|||
|
public GameDefine_Globe.GUILD_JOB GetGuildJob(ulong guid)
|
|||
|
{
|
|||
|
var result = GameDefine_Globe.GUILD_JOB.INVALID;
|
|||
|
if (guid != GlobeVar.INVALID_GUID &&
|
|||
|
GuildInfo != null &&
|
|||
|
GuildInfo.GuildGuid != GlobeVar.INVALID_GUID)
|
|||
|
{
|
|||
|
GuildMember member;
|
|||
|
if (GuildInfo.GuildMemberList.TryGetValue(guid, out member))
|
|||
|
result = (GameDefine_Globe.GUILD_JOB) member.Job;
|
|||
|
}
|
|||
|
|
|||
|
return result;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsGuildChief()
|
|||
|
{
|
|||
|
return null != Singleton<ObjManager>.GetInstance().MainPlayer && GuildInfo.GuildChiefGuid ==
|
|||
|
GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Guid;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsGuildViceChief(ulong guid)
|
|||
|
{
|
|||
|
if (null == GuildInfo || GuildInfo.GuildGuid == GlobeVar.INVALID_GUID) return false;
|
|||
|
if (guid == GlobeVar.INVALID_GUID) return false;
|
|||
|
GuildMember member;
|
|||
|
if (GuildInfo.GuildMemberList.TryGetValue(guid, out member))
|
|||
|
{
|
|||
|
if (member.Job == (int) GameDefine_Globe.GUILD_JOB.VICE_CHIEF)
|
|||
|
return true;
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
//申请数量
|
|||
|
public int GetNewApplyListCount()
|
|||
|
{
|
|||
|
return FriendApplyList.RelationDataList.Count;
|
|||
|
}
|
|||
|
|
|||
|
public void Tick_FellowGainCD()
|
|||
|
{
|
|||
|
if (FellowGainCD_Coin > 0)
|
|||
|
{
|
|||
|
m_FellowTickTime += Time.deltaTime;
|
|||
|
//一秒触发一次
|
|||
|
if (m_FellowTickTime > 1)
|
|||
|
{
|
|||
|
m_FellowTickTime = 0f;
|
|||
|
FellowGainCD_Coin--;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void HandlePacket(GC_SYNC_PAY_ACTIVITY_DATA packet)
|
|||
|
{
|
|||
|
m_PayActivity.HandlePacket(packet);
|
|||
|
}
|
|||
|
|
|||
|
public static void NoticeLack(int consumType, int consumID)
|
|||
|
{
|
|||
|
var lackStr = "";
|
|||
|
if ((int) CONSUM_TYPE.MONEY == consumType)
|
|||
|
lackStr = MONEY.GetMoneyStr((MONEYTYPE) consumID);
|
|||
|
else if ((int) CONSUM_TYPE.PROPVAL == consumType)
|
|||
|
lackStr = PropID.GetAttrName((PropID.PropertyID) consumID, -1, -1);
|
|||
|
GUIData.AddNotifyData(lackStr + StrDictionary.GetClientDictionaryString("#{1096}"));
|
|||
|
}
|
|||
|
|
|||
|
public void ClearFashionData()
|
|||
|
{
|
|||
|
FashionDeadline = new int[GlobeVar.MAX_FASHION_SIZE];
|
|||
|
for (var i = 0; i < GlobeVar.MAX_FASHION_SIZE; i++) FashionDeadline[i] = 0;
|
|||
|
WeaponFashionId = GlobeVar.INVALID_ID;
|
|||
|
ShowFashion = false;
|
|||
|
m_ModelVisualID = GlobeVar.INVALID_ID;
|
|||
|
}
|
|||
|
|
|||
|
//服务器标记
|
|||
|
//private int m_ServerFlags;
|
|||
|
public void HandlerServerFlags(GC_SERVERFLAGS packet)
|
|||
|
{
|
|||
|
//m_ServerFlags = packet.Flags;
|
|||
|
}
|
|||
|
//public bool IsVipOpen()
|
|||
|
//{
|
|||
|
// if ((m_ServerFlags & (1 << (int)SERVER_FLAGS_ENUM.FLAG_VIP)) == 0)
|
|||
|
// {
|
|||
|
// return false;
|
|||
|
// }
|
|||
|
// return true;
|
|||
|
//}
|
|||
|
|
|||
|
//public bool IsChargeActivityOpen()
|
|||
|
//{
|
|||
|
// if ((m_ServerFlags & (1 << (int)SERVER_FLAGS_ENUM.FLAG_PAYACT)) == 0)
|
|||
|
// {
|
|||
|
// return false;
|
|||
|
// }
|
|||
|
// return true;
|
|||
|
//}
|
|||
|
|
|||
|
//每日首次登陆触发
|
|||
|
public void OnTodayFirstLogin()
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public void AddAbuseFilter(string data)
|
|||
|
{
|
|||
|
var str = "";
|
|||
|
if (string.IsNullOrEmpty(data)) return;
|
|||
|
if (AbuseFilterList == null) AbuseFilterList = new List<string>();
|
|||
|
AbuseFilterList.Add(data);
|
|||
|
}
|
|||
|
|
|||
|
public string GetAbuseFilter(string str)
|
|||
|
{
|
|||
|
if (str == null) return null;
|
|||
|
if (AbuseFilterList == null) return null;
|
|||
|
for (var i = 0; i < AbuseFilterList.Count; i++)
|
|||
|
if (str.IndexOf(AbuseFilterList[i]) != -1)
|
|||
|
return AbuseFilterList[i];
|
|||
|
return null;
|
|||
|
}
|
|||
|
|
|||
|
public void ClearAbuseFilter()
|
|||
|
{
|
|||
|
if (AbuseFilterList != null) AbuseFilterList.Clear();
|
|||
|
}
|
|||
|
|
|||
|
//经济系统
|
|||
|
public class MONEY
|
|||
|
{
|
|||
|
private readonly Dictionary<PropID.PropertyID, int> _ActMoney = new Dictionary<PropID.PropertyID, int>();
|
|||
|
|
|||
|
private readonly long[] m_nMoney;
|
|||
|
|
|||
|
public MONEY()
|
|||
|
{
|
|||
|
m_nMoney = new long[(int) MONEYTYPE.MONEYTYPE_TYPECOUNT];
|
|||
|
for (var i = 0; i < (int) MONEYTYPE.MONEYTYPE_TYPECOUNT; ++i) m_nMoney[i] = 0;
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_Coin()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_COIN);
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_CoinBind()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_COIN_BIND);
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_YuanBao()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_YUANBAO);
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_YuanBaoBind()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_YUANBAO_BIND);
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_ChallengeScore()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_USERCHALLENGE);
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoney_SnatchScore()
|
|||
|
{
|
|||
|
return GetMoneyByType(MONEYTYPE.MONEYTYPE_SNATCHSCORE);
|
|||
|
}
|
|||
|
|
|||
|
public void SetMoney(MONEYTYPE nType, long nValue)
|
|||
|
{
|
|||
|
if (nType > MONEYTYPE.MONEYTYPE_INVALID && nType < MONEYTYPE.MONEYTYPE_TYPECOUNT)
|
|||
|
m_nMoney[(int) nType] = nValue;
|
|||
|
if (MoneyInfoPanel.Instance)
|
|||
|
MoneyInfoPanel.Instance.UpdateMoneyInfo();
|
|||
|
EventDispatcher.Instance.SendMessage(EventId.FRESHSAMEUSETIP);
|
|||
|
if (MeridiaSoulData.Instance != null) MeridiaSoulData.Instance.CheckIsHasUp();
|
|||
|
GameManager.gameManager.PlayerDataPool.GuildInfo.XiulianRedPoint();
|
|||
|
}
|
|||
|
|
|||
|
public long GetMoneyByType(MONEYTYPE nType)
|
|||
|
{
|
|||
|
if (nType > MONEYTYPE.MONEYTYPE_INVALID && nType < MONEYTYPE.MONEYTYPE_TYPECOUNT)
|
|||
|
return m_nMoney[(int) nType];
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
public void SetMoney(PropID.PropertyID nType, int nValue)
|
|||
|
{
|
|||
|
if (_ActMoney.ContainsKey(nType))
|
|||
|
_ActMoney[nType] = nValue;
|
|||
|
else
|
|||
|
_ActMoney.Add(nType, nValue);
|
|||
|
}
|
|||
|
|
|||
|
public int GetMoneyByType(PropID.PropertyID nType)
|
|||
|
{
|
|||
|
if (_ActMoney.ContainsKey(nType)) return _ActMoney[nType];
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
public void PushMoneyLessData(int nType)
|
|||
|
{
|
|||
|
var moneyStrID = nType + 6000;
|
|||
|
GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{" + moneyStrID + "}") +
|
|||
|
StrDictionary.GetClientDictionaryString("#{6000}"));
|
|||
|
}
|
|||
|
|
|||
|
public static string GetMoneySpriteStr(MONEYTYPE currencyType)
|
|||
|
{
|
|||
|
var spriteName = "";
|
|||
|
if (currencyType == MONEYTYPE.MONEYTYPE_COIN)
|
|||
|
spriteName = "qian1";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_YUANBAO)
|
|||
|
spriteName = "qian2";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_YUANBAO_BIND)
|
|||
|
spriteName = "qian3";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_COIN_BIND)
|
|||
|
spriteName = "qian4";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_SKILLEXP)
|
|||
|
spriteName = "skillExp";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_ROLEEXP)
|
|||
|
spriteName = "roleExp";
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_USERCHALLENGE) spriteName = "menpai";
|
|||
|
|
|||
|
return spriteName;
|
|||
|
}
|
|||
|
|
|||
|
public static string GetMoneyStr(MONEYTYPE currencyType)
|
|||
|
{
|
|||
|
var spriteName = "";
|
|||
|
if (currencyType == MONEYTYPE.MONEYTYPE_COIN)
|
|||
|
spriteName = StrDictionary.GetClientDictionaryString("#{6003}");
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_YUANBAO)
|
|||
|
spriteName = StrDictionary.GetClientDictionaryString("#{6001}");
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_YUANBAO_BIND)
|
|||
|
spriteName = StrDictionary.GetClientDictionaryString("#{6002}");
|
|||
|
else if (currencyType == MONEYTYPE.MONEYTYPE_COIN_BIND)
|
|||
|
spriteName = StrDictionary.GetClientDictionaryString("#{6004}");
|
|||
|
|
|||
|
return spriteName;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
#region
|
|||
|
|
|||
|
public int GetIntPropty(int consumType, int consumID)
|
|||
|
{
|
|||
|
if ((int) CONSUM_TYPE.MONEY == consumType)
|
|||
|
{
|
|||
|
long moneyValue = 0;
|
|||
|
switch ((MONEYTYPE) consumID)
|
|||
|
{
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO:
|
|||
|
moneyValue = Money.GetMoney_YuanBao();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 灵玉
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO_BIND:
|
|||
|
moneyValue = Money.GetMoney_YuanBaoBind();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 元宝
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN:
|
|||
|
moneyValue = Money.GetMoney_Coin();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 银两
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN_BIND:
|
|||
|
moneyValue = Money.GetMoney_CoinBind();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 银票
|
|||
|
case MONEYTYPE.MONEYTYPE_USERCHALLENGE:
|
|||
|
moneyValue = Money.GetMoney_ChallengeScore();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 挑战积分
|
|||
|
case MONEYTYPE.MONEYTYPE_SNATCHSCORE:
|
|||
|
moneyValue = Money.GetMoney_SnatchScore();
|
|||
|
if (moneyValue > GlobeVar.MAX_INT_VALUE)
|
|||
|
return GlobeVar.MAX_INT_VALUE;
|
|||
|
return (int) moneyValue; // 夺宝积分
|
|||
|
}
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.PROPVAL == consumType)
|
|||
|
{
|
|||
|
switch ((PropID.PropertyID) consumID)
|
|||
|
{
|
|||
|
case PropID.PropertyID.ACTVAL:
|
|||
|
//return GetPropInt(PropID.PropertyID.ACTVAL); //活力
|
|||
|
return MainPlayerBaseAttr.CurStamina;
|
|||
|
|
|||
|
case PropID.PropertyID.PRIVATEEXP: //专属经验
|
|||
|
|
|||
|
return GetPropInt(PropID.PropertyID.PRIVATEEXP);
|
|||
|
case PropID.PropertyID.PROPUSER_EXP:
|
|||
|
return GetPropInt(PropID.PropertyID.PROPUSER_EXP);
|
|||
|
}
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.SCORE == consumType)
|
|||
|
{
|
|||
|
switch ((SCORE_TYPE) consumID)
|
|||
|
{
|
|||
|
case SCORE_TYPE.GUILD_SCORE:
|
|||
|
//return GetPropInt(PropID.PropertyID.ACTVAL);
|
|||
|
return GameManager.gameManager.PlayerDataPool.GuildInfo.GuildContribute;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
public long GetLongPropty(int consumType, int consumID)
|
|||
|
{
|
|||
|
if ((int) CONSUM_TYPE.MONEY == consumType)
|
|||
|
switch ((MONEYTYPE) consumID)
|
|||
|
{
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO:
|
|||
|
return Money.GetMoney_YuanBao(); //灵玉
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO_BIND:
|
|||
|
return Money.GetMoney_YuanBaoBind(); //元宝
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN:
|
|||
|
return Money.GetMoney_Coin(); //银两
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN_BIND:
|
|||
|
return Money.GetMoney_CoinBind(); //银票
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.PROPVAL == consumType)
|
|||
|
switch ((PropID.PropertyID) consumID)
|
|||
|
{
|
|||
|
case PropID.PropertyID.PRIVATEEXP:
|
|||
|
return MainPlayerBaseAttr.SkillExp; //专用经验
|
|||
|
case PropID.PropertyID.PROPUSER_EXP:
|
|||
|
return MainPlayerBaseAttr.Exp; //非专用经验
|
|||
|
}
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
public bool IsConsumEnough(int consumType, int consumID, int consumValue)
|
|||
|
{
|
|||
|
if (consumType < 0)
|
|||
|
return true;
|
|||
|
|
|||
|
if ((int) CONSUM_TYPE.PROPVAL == consumType)
|
|||
|
switch ((PropID.PropertyID) consumID)
|
|||
|
{
|
|||
|
case PropID.PropertyID.PRIVATEEXP:
|
|||
|
return MainPlayerBaseAttr.SkillExp + MainPlayerBaseAttr.Exp >= consumValue;
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.MONEY == consumType)
|
|||
|
switch ((MONEYTYPE) consumID)
|
|||
|
{
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO:
|
|||
|
return Money.GetMoney_YuanBao() >= consumValue;
|
|||
|
case MONEYTYPE.MONEYTYPE_YUANBAO_BIND:
|
|||
|
return Money.GetMoney_YuanBaoBind() >= consumValue;
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN:
|
|||
|
return Money.GetMoney_Coin() >= consumValue;
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN_BIND:
|
|||
|
return Money.GetMoney_CoinBind() + Money.GetMoney_Coin() >= consumValue;
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.INVALID == consumType) return true;
|
|||
|
|
|||
|
return false;
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 可替代消耗是否满足
|
|||
|
/// </summary>
|
|||
|
/// <param name="consumType"></param>
|
|||
|
/// <param name="consumID"></param>
|
|||
|
/// <param name="consumValue"></param>
|
|||
|
/// <returns>1无需替代即可满足,2.替代满足, 3替代后不满足</returns>
|
|||
|
public int ConsumReplaceEnough(int consumType, int consumID, int consumValue)
|
|||
|
{
|
|||
|
var state = 0;
|
|||
|
if ((int) CONSUM_TYPE.PROPVAL == consumType)
|
|||
|
switch ((PropID.PropertyID) consumID)
|
|||
|
{
|
|||
|
case PropID.PropertyID.PRIVATEEXP:
|
|||
|
if (MainPlayerBaseAttr.SkillExp >= consumValue)
|
|||
|
state = 1;
|
|||
|
else if (MainPlayerBaseAttr.SkillExp + MainPlayerBaseAttr.Exp >= consumValue)
|
|||
|
state = 2;
|
|||
|
else
|
|||
|
state = 3;
|
|||
|
break;
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.MONEY == consumType)
|
|||
|
switch ((MONEYTYPE) consumID)
|
|||
|
{
|
|||
|
case MONEYTYPE.MONEYTYPE_COIN_BIND:
|
|||
|
if (Money.GetMoney_CoinBind() >= consumValue)
|
|||
|
state = 1;
|
|||
|
else if (Money.GetMoney_CoinBind() + Money.GetMoney_Coin() >= consumValue)
|
|||
|
state = 2;
|
|||
|
else
|
|||
|
state = 3;
|
|||
|
break;
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.SCORE == consumType)
|
|||
|
switch ((SCORE_TYPE) consumID)
|
|||
|
{
|
|||
|
case SCORE_TYPE.GUILD_SCORE:
|
|||
|
if (GameManager.gameManager.PlayerDataPool.GuildInfo.GuildContribute >= consumValue)
|
|||
|
state = 1;
|
|||
|
else
|
|||
|
state = 3;
|
|||
|
break;
|
|||
|
}
|
|||
|
else if ((int) CONSUM_TYPE.INVALID == consumType) state = 1;
|
|||
|
|
|||
|
return state;
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
|
|||
|
// //进入新的场景后任务数据更新
|
|||
|
// public void LoadSceneFinish()
|
|||
|
// {
|
|||
|
// // Tab_SceneClass sceneInfo = TableManager.GetSceneClassByID(GameManager.gameManager.RunningScene, 0);
|
|||
|
// // if (sceneInfo == null)
|
|||
|
// // return;
|
|||
|
// // if (sceneInfo.IsAutoFight != 0)
|
|||
|
// // {
|
|||
|
// // m_IsOpenAutoCombat = false;
|
|||
|
// // return;
|
|||
|
// // }
|
|||
|
//
|
|||
|
//
|
|||
|
// }
|
|||
|
|
|||
|
#region equip suit
|
|||
|
|
|||
|
public int EquipSuitID;
|
|||
|
public int NextSuitEquipCnt;
|
|||
|
|
|||
|
public void CalculateEquipSuit()
|
|||
|
{
|
|||
|
var equipList = m_oEquipPack.GetList();
|
|||
|
var suitTabs = TableManager.GetEquipEnchanceSuit().Values;
|
|||
|
EquipSuitID = 0;
|
|||
|
NextSuitEquipCnt = 0;
|
|||
|
foreach (var suitTab in suitTabs)
|
|||
|
{
|
|||
|
var slotCnt = 0;
|
|||
|
for (var i = 0; i < EquipSlotStrength.Length; ++i)
|
|||
|
{
|
|||
|
if (EquipSlotStrength[i].lv < suitTab.EnchanceLevel || EquipSlotStrength[i].perfect < suitTab.PerfectID)
|
|||
|
continue;
|
|||
|
|
|||
|
++slotCnt;
|
|||
|
}
|
|||
|
|
|||
|
if (slotCnt >= suitTab.EquipNum)
|
|||
|
{
|
|||
|
EquipSuitID = suitTab.Id;
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
NextSuitEquipCnt = slotCnt;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|