1
This commit is contained in:
parent
850c6a2714
commit
677249ef1d
@ -102,6 +102,13 @@ namespace GameLogic
|
|||||||
if (isGameState)
|
if (isGameState)
|
||||||
{
|
{
|
||||||
ProtCust.Instance.SendRoundVo_Start();
|
ProtCust.Instance.SendRoundVo_Start();
|
||||||
|
|
||||||
|
// 释放所有暂存逻辑
|
||||||
|
foreach (var action in m_PendingGiftActions)
|
||||||
|
{
|
||||||
|
action.Invoke();
|
||||||
|
}
|
||||||
|
m_PendingGiftActions.Clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -356,8 +363,13 @@ namespace GameLogic
|
|||||||
|
|
||||||
// 统一在这里处理播放音频
|
// 统一在这里处理播放音频
|
||||||
GameModule.Audio.Play(TEngine.AudioType.UISound, giftConfig.EffectAudioName, false, 1);
|
GameModule.Audio.Play(TEngine.AudioType.UISound, giftConfig.EffectAudioName, false, 1);
|
||||||
|
// 判断游戏是否开始
|
||||||
// 整个Buff系统看看如何重构一下,部分礼物效果并不好实现
|
if (!GetGameState())
|
||||||
|
{
|
||||||
|
// 暂存逻辑
|
||||||
|
m_PendingGiftActions.Add(() =>
|
||||||
|
{
|
||||||
|
// 下面原有的逻辑全部放到这里
|
||||||
if (giftConfig.Id == 1)
|
if (giftConfig.Id == 1)
|
||||||
{
|
{
|
||||||
// 点赞
|
// 点赞
|
||||||
@ -503,6 +515,7 @@ namespace GameLogic
|
|||||||
AdbzGiftFunc(giftConfig, num, unitPlayerData);
|
AdbzGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 每次积分变动
|
// 每次积分变动
|
||||||
m_TeamSortList.Sort((a, b) =>
|
m_TeamSortList.Sort((a, b) =>
|
||||||
{
|
{
|
||||||
@ -515,6 +528,167 @@ namespace GameLogic
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (giftConfig.Id == 1)
|
||||||
|
{
|
||||||
|
// 点赞
|
||||||
|
var actor = GetTeamActor(unitPlayerData.teamId);
|
||||||
|
if (actor == null)
|
||||||
|
{
|
||||||
|
Log.Error("actor == null" + unitPlayerData.teamId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成一个Buff添加.并没有特殊效果
|
||||||
|
actor.AddBuff(new Buff()
|
||||||
|
{
|
||||||
|
m_Id = giftConfig.Id,
|
||||||
|
addPower = giftConfig.AddPower * num,
|
||||||
|
m_AllTimer = giftConfig.TimerLen,
|
||||||
|
m_CraeteTimer = Time.deltaTime,
|
||||||
|
}, unitPlayerData, giftConfig);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 2)
|
||||||
|
{
|
||||||
|
// 红仙女棒
|
||||||
|
var actor = GetTeamActor(unitPlayerData.teamId);
|
||||||
|
if (actor == null)
|
||||||
|
{
|
||||||
|
Log.Error("actor == null" + unitPlayerData.teamId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成一个Buff添加.并没有特殊效果
|
||||||
|
actor.AddBuff(new Buff()
|
||||||
|
{
|
||||||
|
m_Id = giftConfig.Id,
|
||||||
|
addPower = giftConfig.AddPower * num,
|
||||||
|
m_AllTimer = giftConfig.TimerLen,
|
||||||
|
m_CraeteTimer = Time.deltaTime,
|
||||||
|
}, unitPlayerData, giftConfig);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 3)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 绿仙女棒
|
||||||
|
var actor = GetTeamActor(unitPlayerData.teamId);
|
||||||
|
if (actor == null)
|
||||||
|
{
|
||||||
|
Log.Error("actor == null" + unitPlayerData.teamId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ActorHItem> m_TempList = new List<ActorHItem>();
|
||||||
|
|
||||||
|
foreach (var item in m_DicTeamList)
|
||||||
|
{
|
||||||
|
if (item.Value != actor)
|
||||||
|
{
|
||||||
|
m_TempList.Add(item.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序
|
||||||
|
m_TempList.Sort((a, b) =>
|
||||||
|
{
|
||||||
|
if (a.GetAllPower() > b.GetAllPower())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 随机取三个阵营,扔减速Buff,并且排除自己
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
if (m_TempList.Count <= 0)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var item = m_TempList[i];
|
||||||
|
// 添加减速Buff
|
||||||
|
Buff m_Buff1 = new Buff();
|
||||||
|
m_Buff1.OnInit(giftConfig.Id, giftConfig.AddPower * num, giftConfig.TimerLen, giftConfig.AddGiftScore, num);
|
||||||
|
item.AddBuff(m_Buff1, unitPlayerData, giftConfig);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//// 生成一个Buff添加.并没有特殊效果
|
||||||
|
//actor.AddBuff(new Buff()
|
||||||
|
//{
|
||||||
|
// m_Id = giftConfig.Id,
|
||||||
|
// addPower = giftConfig.AddPower * num,
|
||||||
|
// m_AllTimer = giftConfig.TimerLen,
|
||||||
|
// m_CraeteTimer = Time.deltaTime,
|
||||||
|
//}, unitPlayerData, giftConfig);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 4)
|
||||||
|
{
|
||||||
|
// 蓝仙女棒
|
||||||
|
var actor = GetTeamActor(unitPlayerData.teamId);
|
||||||
|
if (actor == null)
|
||||||
|
{
|
||||||
|
Log.Error("actor == null" + unitPlayerData.teamId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成一个Buff添加.并没有特殊效果
|
||||||
|
actor.AddBuff(new Buff()
|
||||||
|
{
|
||||||
|
m_Id = giftConfig.Id,
|
||||||
|
addPower = giftConfig.AddPower * num,
|
||||||
|
m_AllTimer = giftConfig.TimerLen,
|
||||||
|
m_CraeteTimer = Time.deltaTime,
|
||||||
|
}, unitPlayerData, giftConfig);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 5)
|
||||||
|
{
|
||||||
|
// 龙卷风
|
||||||
|
NlywGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 6)
|
||||||
|
{
|
||||||
|
// 天机窃算
|
||||||
|
MfjGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 7)
|
||||||
|
{
|
||||||
|
// 陨石撞击
|
||||||
|
TtqGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 8)
|
||||||
|
{
|
||||||
|
// 科技爆发
|
||||||
|
NldcGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
|
}
|
||||||
|
else if (giftConfig.Id == 9)
|
||||||
|
{
|
||||||
|
// 天道推演
|
||||||
|
AdbzGiftFunc(giftConfig, num, unitPlayerData);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_TeamSortList.Sort((a, b) =>
|
||||||
|
{
|
||||||
|
if (a.GetAllPower() > b.GetAllPower())
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 游戏中具体的礼物效果处理
|
#region 游戏中具体的礼物效果处理
|
||||||
@ -782,6 +956,7 @@ namespace GameLogic
|
|||||||
|
|
||||||
public int m_ShiJianTimerId = -1;
|
public int m_ShiJianTimerId = -1;
|
||||||
public bool isHuangJinShiDai = false; // 是否是黄金时代
|
public bool isHuangJinShiDai = false; // 是否是黄金时代
|
||||||
|
private List<Action> m_PendingGiftActions = new List<Action>();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user