From 2bdca925498c2b06de803cd6ec1704faef8eec30 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 18 十月 2018 15:34:27 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/NewBieGuidance/FunctionalGuideBehaviour.cs | 28 +++++++++
System/NewBieGuidance/NewBieCenter.cs | 5 +
System/Pet/PetAttributeWin.cs | 7 +
System/Mount/MountWin.cs | 13 ++--
System/Pet/PlayerPetDatas.cs | 20 ++----
System/OpenServerActivity/OpenServerActivityNotifyWin.cs | 5 +
System/OpenServerActivity/FlashSaleTimeCell.cs | 15 +++-
System/Mount/PlayerMountDatas.cs | 19 ++----
System/OpenServerActivity/OpenServerActivityNotifyModel.cs | 11 +++
System/OpenServerActivity/FlashRushToBuyNotify.cs | 3 +
System/OpenServerActivity/OperationFlashRushToBuy.cs | 19 +++++-
11 files changed, 104 insertions(+), 41 deletions(-)
diff --git a/System/Mount/MountWin.cs b/System/Mount/MountWin.cs
index f069203..21ae695 100644
--- a/System/Mount/MountWin.cs
+++ b/System/Mount/MountWin.cs
@@ -129,6 +129,10 @@
{
RedPointMountDan();
}
+ if (PackSendQuestMgr.Instance.useItemModel != null)//璺宠綁閬镐腑
+ {
+ PackSendQuestMgr.Instance.useItemModel = null;
+ }
}
public void SetHorseID()
@@ -138,7 +142,7 @@
int ItemId = PackSendQuestMgr.Instance.useItemModel.itemInfo.ItemID;
if (ItemId == 181)
{
- int MountID= mountModel.GetMinLvMount();
+ int MountID= mountModel.GetMinExpMount();
if (MountID != 0)
{
signHorseID = MountID;
@@ -358,10 +362,7 @@
CA501_tagPlayerActivateHorse _tagA501 = new CA501_tagPlayerActivateHorse();
_tagA501.HorseID = (uint)signHorseID;
GameNetSystem.Instance.SendInfo(_tagA501);
- if (PackSendQuestMgr.Instance.useItemModel != null)//璺宠綁閬镐腑
- {
- PackSendQuestMgr.Instance.useItemModel = null;
- }
+
}
else
{
@@ -424,7 +425,7 @@
{
m_AutoTrainBtn.gameObject.SetActive(true);
m_StopDomesticateBtn.gameObject.SetActive(false);
- ScrollTip.ShowTip(Language.Get("HorseDan5_text"));
+ //ScrollTip.ShowTip(Language.Get("HorseDan5_text"));
yield break;
}
else if (WindowCenter.Instance.IsOpen<RidingAndPetActivationWin>())//鎵撳紑楠戝疇婵�娲荤晫闈㈢粨鏉熸柟娉�
diff --git a/System/Mount/PlayerMountDatas.cs b/System/Mount/PlayerMountDatas.cs
index c336549..32d3a6a 100644
--- a/System/Mount/PlayerMountDatas.cs
+++ b/System/Mount/PlayerMountDatas.cs
@@ -318,25 +318,20 @@
}
}
- public int GetMinLvMount()
+ public int GetMinExpMount()
{
int GetMountID = 0;
- int GetMountLv = 0;
+ int NeedExp = 99999999;
for (int i = 0; i < SortMount.Count; i++)
{
int horseID = SortMount[i].HorseID;
- if (_DicHorse.ContainsKey(horseID))
+ if (_DicHorse.ContainsKey(horseID) && _DicHorse[horseID].Lv < Config.Instance.Get<HorseConfig>(horseID).MaxLV)
{
- var key = horseID;
- if (GetMountID == 0 && _DicHorse[key].Lv < GetMountSkillMaxLV(key))
+ int _NeedExp = HorseUpConfig.GetHorseIDAndLV(horseID, (_DicHorse[horseID].Lv)).NeedExp;
+ if (_NeedExp - _DicHorse[horseID].Exp < NeedExp)
{
- GetMountID = key;
- GetMountLv = _DicHorse[key].Lv;
- }
- if (_DicHorse[key].Lv < GetMountLv && _DicHorse[key].Lv < GetMountSkillMaxLV(key))
- {
- GetMountID = key;
- GetMountLv = _DicHorse[key].Lv;
+ NeedExp = _NeedExp - _DicHorse[horseID].Exp;
+ GetMountID = horseID;
}
}
}
diff --git a/System/NewBieGuidance/FunctionalGuideBehaviour.cs b/System/NewBieGuidance/FunctionalGuideBehaviour.cs
index 086393d..130b77c 100644
--- a/System/NewBieGuidance/FunctionalGuideBehaviour.cs
+++ b/System/NewBieGuidance/FunctionalGuideBehaviour.cs
@@ -35,6 +35,7 @@
}
float protectTimer = 0f;
+ string clickTargetName;
Transform m_ClickTarget;
RectTransform rectTransform { get { return this.transform as RectTransform; } }
@@ -131,6 +132,7 @@
selectBoxPatternBuf = (int)stepConfig.selectBox;
}
+ clickTargetName = string.Empty;
m_ClickTarget = null;
m_ClickHintRoot.gameObject.SetActive(false);
FindClickTarget();
@@ -140,14 +142,18 @@
private void ReportGuideComplete()
{
UnAttachTrigger();
+ clickTargetName = string.Empty;
m_ClickTarget = null;
FunctionalGuideCenter.Instance.FinishGuide(guide);
+
+ guide = 0;
FunctionalGuideBehaviourPool.Recycle(this.gameObject);
}
private void ClickToCompleteGuide()
{
UnAttachTrigger();
+ clickTargetName = string.Empty;
m_ClickTarget = null;
var config = Config.Instance.Get<GuideConfig>(guide);
@@ -159,12 +165,32 @@
}
}
+ guide = 0;
FunctionalGuideBehaviourPool.Recycle(this.gameObject);
}
private void LateUpdate()
{
+ if (m_ClickTarget != null)
+ {
+ if (clickTargetName != m_ClickTarget.name)
+ {
+ UnAttachTrigger();
+ m_ClickTarget = null;
+ protectTimer = 0f;
+ }
+ }
+
FindClickTarget();
+
+ if (guide == 0 || NewBieCenter.Instance.IsGuideCompleted(guide))
+ {
+ UnAttachTrigger();
+ clickTargetName = string.Empty;
+ m_ClickTarget = null;
+ guide = 0;
+ FunctionalGuideBehaviourPool.Recycle(this.gameObject);
+ }
}
private void FindClickTarget()
@@ -222,9 +248,9 @@
private void FindAndAttachTrigger(string _path)
{
m_ClickTarget = WindowCenter.Instance.uiRoot.transform.Find(_path);
-
if (m_ClickTarget != null)
{
+ clickTargetName = m_ClickTarget.name;
var trigger = NewBieEventTrigger.SetPointClick(m_ClickTarget.gameObject);
if (trigger != null)
{
diff --git a/System/NewBieGuidance/NewBieCenter.cs b/System/NewBieGuidance/NewBieCenter.cs
index 8d80910..58cd9b4 100644
--- a/System/NewBieGuidance/NewBieCenter.cs
+++ b/System/NewBieGuidance/NewBieCenter.cs
@@ -71,6 +71,11 @@
playerDeadModel.playerDieEvent -= OnPlayerDead;
}
+ public bool IsGuideCompleted(int guideId)
+ {
+ return completeGuidesBuf.Contains(guideId);
+ }
+
public void ResetGuideRecords(uint[] _guideRecords)
{
completeGuidesBuf.Clear();
diff --git a/System/OpenServerActivity/FlashRushToBuyNotify.cs b/System/OpenServerActivity/FlashRushToBuyNotify.cs
index c55d371..5755c3c 100644
--- a/System/OpenServerActivity/FlashRushToBuyNotify.cs
+++ b/System/OpenServerActivity/FlashRushToBuyNotify.cs
@@ -3,6 +3,7 @@
public class FlashRushToBuyNotify : OpenServerActivityNotifyBase
{
public FlashRushToBuyModel rushToBuyModel { get { return ModelCenter.Instance.GetModel<FlashRushToBuyModel>(); } }
+ OpenServerActivityNotifyModel activityNotifyModel { get { return ModelCenter.Instance.GetModel<OpenServerActivityNotifyModel>(); } }
private void OnEnable()
{
Display();
@@ -23,11 +24,13 @@
{
base.ClickGotoBtn();
this.gameObject.SetActive(false);
+ activityNotifyModel.SetCloseFlashRushToBuyList();
WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.FlashRushToBuy);
}
protected override void ClickCloseBtn()
{
base.ClickCloseBtn();
+ activityNotifyModel.SetCloseFlashRushToBuyList();
}
}
}
diff --git a/System/OpenServerActivity/FlashSaleTimeCell.cs b/System/OpenServerActivity/FlashSaleTimeCell.cs
index 145b996..0cd6253 100644
--- a/System/OpenServerActivity/FlashSaleTimeCell.cs
+++ b/System/OpenServerActivity/FlashSaleTimeCell.cs
@@ -65,12 +65,19 @@
switch (buyState)
{
case -1:
- this.gameObject.SetActive(true);
- string timeStr = operation.ToDisplayBuyTime(date.month, dayIndex + date.day, operationTime.startHour, operationTime.startMinute);
- remainText.text = Language.Get("FlashRushToBuy106", timeStr);
+ string timeStr = "";
+ if(seconds > 7200)
+ {
+ timeStr = operation.ToDisplayBuyTime(date.month, dayIndex + date.day, operationTime.startHour, operationTime.startMinute);
+ remainText.text = Language.Get("FlashRushToBuy106", timeStr);
+ }
+ else
+ {
+ timeStr = TimeUtility.SecondsToHMS(seconds);
+ remainText.text = Language.Get("FlashRushToBuy108", timeStr);
+ }
break;
case 0:
- this.gameObject.SetActive(true);
remainText.text = Language.Get("FlashRushToBuy105", TimeUtility.SecondsToHMS(seconds));
break;
case 1:
diff --git a/System/OpenServerActivity/OpenServerActivityNotifyModel.cs b/System/OpenServerActivity/OpenServerActivityNotifyModel.cs
index f69a356..ee60dc2 100644
--- a/System/OpenServerActivity/OpenServerActivityNotifyModel.cs
+++ b/System/OpenServerActivity/OpenServerActivityNotifyModel.cs
@@ -182,11 +182,22 @@
public void FlashRushToBuyActivityClose()
{
flashSaleShops.Clear();
+ closeflashSaleShops.Clear();
if (UpdateFlashRushToBuyEvent != null)
{
UpdateFlashRushToBuyEvent();
}
}
+
+ public List<OperationFlashRushToBuy.FlashSaleShop> closeflashSaleShops = new List<OperationFlashRushToBuy.FlashSaleShop>();
+ public void SetCloseFlashRushToBuyList()
+ {
+ if(flashSaleShops.Count > 0)
+ {
+ closeflashSaleShops.Add(flashSaleShops[flashSaleShops.Count - 1]);
+ }
+ }
+
#endregion
}
diff --git a/System/OpenServerActivity/OpenServerActivityNotifyWin.cs b/System/OpenServerActivity/OpenServerActivityNotifyWin.cs
index 758d631..011a4a4 100644
--- a/System/OpenServerActivity/OpenServerActivityNotifyWin.cs
+++ b/System/OpenServerActivity/OpenServerActivityNotifyWin.cs
@@ -41,8 +41,13 @@
private void CheckFlashRushToBuy()
{
+ OperationFlashRushToBuy.FlashSaleShop saleShop = null;
if(activityNotifyModel.flashSaleShops.Count > 0)
{
+ saleShop = activityNotifyModel.flashSaleShops[activityNotifyModel.flashSaleShops.Count - 1];
+ }
+ if (saleShop != null && !activityNotifyModel.closeflashSaleShops.Contains(saleShop))
+ {
flashRushToBuyNotify.gameObject.SetActive(true);
}
else
diff --git a/System/OpenServerActivity/OperationFlashRushToBuy.cs b/System/OpenServerActivity/OperationFlashRushToBuy.cs
index c8036bd..41ac8b8 100644
--- a/System/OpenServerActivity/OperationFlashRushToBuy.cs
+++ b/System/OpenServerActivity/OperationFlashRushToBuy.cs
@@ -91,9 +91,22 @@
{
if(PlayerDatas.Instance.baseData.LV >= limitLv)
{
- if(InAdvanceTime(TimeUtility.ServerNow) || InTime(TimeUtility.ServerNow))
+ if(flashShops.Count > 0)
{
- return true;
+ int openSeconds = 0;
+ int endSeconds = 0;
+ var fristShop = flashShops[0];
+ var lastShop = flashShops[flashShops.Count - 1];
+ int OpenState = GetBuyTimeState(TimeUtility.ServerNow,fristShop.dayIndex,fristShop.timeIndex, out openSeconds);
+ int endState = GetBuyTimeState(TimeUtility.ServerNow,lastShop.dayIndex, lastShop.timeIndex,out endSeconds);
+ if(OpenState == -1 && openSeconds <= inAdvanceMinute*60)
+ {
+ return true;
+ }
+ else if(endState != 1 && OpenState != -1)
+ {
+ return true;
+ }
}
}
return false;
@@ -132,7 +145,7 @@
var item = new FlashSaleItem();
var saleItem = shop.GiftbagInfo[k];
item.shopId = (int)saleItem.GiftID;
- item.shopGuid = shop.DayIndex*1000 + shop.TimeIndex*100 + k;
+ item.shopGuid = shop.DayIndex*10000 + shop.TimeIndex*100 + k;
item.limitNum = saleItem.BuyCountLimit;
item.fullServerLimitNum = saleItem.ServerBuyCountLimit;
item.moneyType = saleItem.MoneyType;
diff --git a/System/Pet/PetAttributeWin.cs b/System/Pet/PetAttributeWin.cs
index cb0aba3..d2f8d68 100644
--- a/System/Pet/PetAttributeWin.cs
+++ b/System/Pet/PetAttributeWin.cs
@@ -93,7 +93,10 @@
{
IsRedPointCultivate();
}
-
+ if (PackSendQuestMgr.Instance.useItemModel != null)
+ {
+ PackSendQuestMgr.Instance.useItemModel = null;
+ }
}
private void AddPet()//鐏靛疇娣诲姞
@@ -309,7 +312,7 @@
int ItemId = PackSendQuestMgr.Instance.useItemModel.itemInfo.ItemID;
if (ItemId == 4151)
{
- int Pet = petmodel.GetMinPetLv();
+ int Pet = petmodel.GetMinPetExp();
if (Pet != 0)
{
TypePetID = Pet;
diff --git a/System/Pet/PlayerPetDatas.cs b/System/Pet/PlayerPetDatas.cs
index 5fb219c..cced869 100644
--- a/System/Pet/PlayerPetDatas.cs
+++ b/System/Pet/PlayerPetDatas.cs
@@ -353,26 +353,20 @@
}
}
- public int GetMinPetLv()
+ public int GetMinPetExp()
{
int GetPetId = 0;
- int petLv = 0;
-
+ int NeedExp = 99999999;
for (int i = 0; i < Sortpet.Count; i++)
{
int petID = Sortpet[i].ID;
- if (_DicPetBack.ContainsKey(petID))
+ if (_DicPetBack.ContainsKey(petID) && _DicPetBack[petID].PetClass < Config.Instance.Get<PetInfoConfig>(petID).MaxRank)
{
- var key = petID;
- if (petLv == 0 && _DicPetBack[key].PetClass < GetPetSkillMaxLv(key))
+ int _NeedExp = PetClassCostConfig.GetPetIdAndRank(petID, _DicPetBack[petID].PetClass).UpNeedExp;
+ if (_NeedExp - _DicPetBack[petID].petExp < NeedExp)
{
- petLv = _DicPetBack[key].PetClass;
- GetPetId = key;
- }
- if (_DicPetBack[key].PetClass < petLv && _DicPetBack[key].PetClass < GetPetSkillMaxLv(key))
- {
- petLv = _DicPetBack[key].PetClass;
- GetPetId = key;
+ NeedExp = _NeedExp - _DicPetBack[petID].petExp;
+ GetPetId = petID;
}
}
}
--
Gitblit v1.8.0