|
|
|
|
@ -9,14 +9,12 @@ using Game;
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
private IGroup<GameEntity> _entities;
|
|
|
|
|
private List<int> _tempList = new List<int>();
|
|
|
|
|
public void Initialize()
|
|
|
|
|
{
|
|
|
|
|
_entities = Util.GetGroup(GameMatcher.Hp);
|
|
|
|
|
EventManager.Instance.AddEvent<PPlayerInput>(EEvent.PlayerInput, OnPlayerAction);
|
|
|
|
|
EventManager.Instance.AddEvent<PEntityMoveInput>(EEvent.EntityMoveInput, OnEntityMove);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Execute()
|
|
|
|
|
{
|
|
|
|
|
var entity = Util.GetMaster();
|
|
|
|
|
@ -24,8 +22,9 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
UpdateComboStance(entity); //更新技能姿态
|
|
|
|
|
UpdateCheckCacheTime(entity); //技能缓存时间检查
|
|
|
|
|
|
|
|
|
|
UpdateComboStance(entity); //更新技能姿态
|
|
|
|
|
UpdateCheckCacheTime(entity); //技能缓存时间检查
|
|
|
|
|
|
|
|
|
|
//检查技能取消 可清除buff
|
|
|
|
|
if (UpdateCheckCancel(entity))
|
|
|
|
|
@ -36,16 +35,17 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
//硬直状态无法释放技能
|
|
|
|
|
if (!Util.EntityIsStagger(entity))
|
|
|
|
|
{
|
|
|
|
|
UpdateComboCast(entity);//技能释放
|
|
|
|
|
UpdateComboCast(entity); //技能释放
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public void RemoveControl(GameEntity entity)
|
|
|
|
|
|
|
|
|
|
private static void RemoveControl(GameEntity entity)
|
|
|
|
|
{
|
|
|
|
|
Util.RemoveControlBuffAll(entity.ID());
|
|
|
|
|
entity.move.IsFlowing = false;
|
|
|
|
|
}
|
|
|
|
|
public void UpdateComboStance(GameEntity entity)
|
|
|
|
|
|
|
|
|
|
private static void UpdateComboStance(GameEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var skill = entity.skill;
|
|
|
|
|
@ -55,6 +55,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
combo.Stance = isGround ? EComboStance.Idle : EComboStance.AirIdle;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var hasSkill = skill.IsRunning;
|
|
|
|
|
if (isGround && hasSkill)
|
|
|
|
|
{
|
|
|
|
|
@ -66,7 +67,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateCheckCacheTime(GameEntity entity)
|
|
|
|
|
private static void UpdateCheckCacheTime(GameEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var dt = Time.deltaTime;
|
|
|
|
|
@ -82,6 +83,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
info.Active = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = count - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
var info = combo.InputQueue[i];
|
|
|
|
|
@ -90,6 +92,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
combo.InputQueue.RemoveAt(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//取消缓存的保护时间
|
|
|
|
|
var safeTime = combo.TriggerCancelSafeTime;
|
|
|
|
|
if (safeTime > 0)
|
|
|
|
|
@ -99,10 +102,12 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
safeTime = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
combo.TriggerCancelSafeTime = safeTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public bool UpdateCheckCancel(GameEntity entity)
|
|
|
|
|
|
|
|
|
|
private static bool UpdateCheckCancel(GameEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var isCancel = false;
|
|
|
|
|
@ -115,6 +120,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isCancel)
|
|
|
|
|
{
|
|
|
|
|
//删除取消指令之前的所有指令
|
|
|
|
|
@ -125,12 +131,15 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
info.Active = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return isCancel;
|
|
|
|
|
}
|
|
|
|
|
public void UpdateComboCast(GameEntity entity)
|
|
|
|
|
|
|
|
|
|
private static void UpdateComboCast(GameEntity entity)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var skill = entity.skill;
|
|
|
|
|
@ -153,6 +162,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var stanceNow = combo.Stance;
|
|
|
|
|
var triggerType = GetSkillTriggerType(input.InputInfo);
|
|
|
|
|
if (triggerType == EComboTriggerType.Jump)
|
|
|
|
|
@ -197,12 +207,14 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
skillCastId = Util.GetCombo(entity, skillKey);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(skillCastId))
|
|
|
|
|
{
|
|
|
|
|
ComboCast(entity, skillCastId);
|
|
|
|
|
isTrigger = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isTrigger)
|
|
|
|
|
{
|
|
|
|
|
//成功触发技能,对指令队列进行更新
|
|
|
|
|
@ -229,15 +241,17 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新combo最后触发时间
|
|
|
|
|
combo.TriggerCancelSafeTime = GameConst.InputRecordTriggerCancelSafeTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private void ComboCast(GameEntity entity, string skillCastId)
|
|
|
|
|
|
|
|
|
|
private static void ComboCast(GameEntity entity, string skillCastId)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var skill = entity.skill;
|
|
|
|
|
@ -250,9 +264,9 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
var castDir = GetSkillCastDir(entity, skillCfgCombo.FreeLock);
|
|
|
|
|
|
|
|
|
|
Util.CastSkill(entity, skillCastId, skillCfg.Skill.Timeline, castDir);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
private Vector3 GetSkillCastDir(GameEntity entity, bool isFreeLock)
|
|
|
|
|
|
|
|
|
|
private static Vector3 GetSkillCastDir(GameEntity entity, bool isFreeLock)
|
|
|
|
|
{
|
|
|
|
|
var combo = entity.combo;
|
|
|
|
|
var move = entity.move;
|
|
|
|
|
@ -270,19 +284,22 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
castDir = moveDir;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (castDir.x == 0 && castDir.z == 0)
|
|
|
|
|
{
|
|
|
|
|
castDir = move.IsRight ? Vector3.right : Vector3.left;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return castDir;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnEntityMove(PEntityMoveInput param)
|
|
|
|
|
private static void OnEntityMove(PEntityMoveInput param)
|
|
|
|
|
{
|
|
|
|
|
var master = Util.GetMaster();
|
|
|
|
|
master.combo.MoveCommand = param.Command;
|
|
|
|
|
}
|
|
|
|
|
private void OnPlayerAction(PPlayerInput info)
|
|
|
|
|
|
|
|
|
|
private static void OnPlayerAction(PPlayerInput info)
|
|
|
|
|
{
|
|
|
|
|
var master = Util.GetMaster();
|
|
|
|
|
var pressSet = master.combo.KeyPressSet;
|
|
|
|
|
@ -297,11 +314,13 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
pressSet.Remove(info.Key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Util.IsControl())
|
|
|
|
|
{
|
|
|
|
|
//处于Combo系统不接收输入的状态
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var weaponChangeType = GetEWeaponChangeType(info);
|
|
|
|
|
if (weaponChangeType != EWeaponChangeType.None)
|
|
|
|
|
{
|
|
|
|
|
@ -309,6 +328,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
ChangeWeapon(weaponChangeType);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GetSkillTriggerType(info) != EComboTriggerType.None)
|
|
|
|
|
{
|
|
|
|
|
//技能指令输入
|
|
|
|
|
@ -321,7 +341,8 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private void ChangeWeapon(EWeaponChangeType changeType)
|
|
|
|
|
|
|
|
|
|
private static void ChangeWeapon(EWeaponChangeType changeType)
|
|
|
|
|
{
|
|
|
|
|
var master = Util.GetMaster();
|
|
|
|
|
var combo = master.combo;
|
|
|
|
|
@ -342,12 +363,14 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
weaponNew = (int)changeType;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
weaponNow.Value = (weaponNew + weaponNum) % weaponNum;
|
|
|
|
|
//切换武器时重置姿态
|
|
|
|
|
// combo.stance = EComboStance.Idle;
|
|
|
|
|
// combo.preStance = EComboStance.Idle;
|
|
|
|
|
}
|
|
|
|
|
private EComboTriggerType GetSkillTriggerType(PPlayerInput info)
|
|
|
|
|
|
|
|
|
|
private static EComboTriggerType GetSkillTriggerType(PPlayerInput info)
|
|
|
|
|
{
|
|
|
|
|
if (info.Action == EKeyActionType.Press)
|
|
|
|
|
{
|
|
|
|
|
@ -355,39 +378,47 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.LightAttack;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Key == EFunctionKey.HeavyAttack)
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.HeavyAttack;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Key == EFunctionKey.Flash)
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.Flash;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Key == EFunctionKey.Jump)
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.Jump;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Action == EKeyActionType.Release)
|
|
|
|
|
{
|
|
|
|
|
if (info.Key == EFunctionKey.LightAttack)
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.LightAttackRelease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (info.Key == EFunctionKey.HeavyAttack)
|
|
|
|
|
{
|
|
|
|
|
return EComboTriggerType.HeavyAttackRelease;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return EComboTriggerType.None;
|
|
|
|
|
}
|
|
|
|
|
private EWeaponChangeType GetEWeaponChangeType(PPlayerInput info)
|
|
|
|
|
|
|
|
|
|
private static EWeaponChangeType GetEWeaponChangeType(PPlayerInput info)
|
|
|
|
|
{
|
|
|
|
|
var ret = EWeaponChangeType.None;
|
|
|
|
|
if (info.Action != EKeyActionType.Press)
|
|
|
|
|
{
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (info.Key)
|
|
|
|
|
{
|
|
|
|
|
case EFunctionKey.WeaponPre:
|
|
|
|
|
@ -409,6 +440,7 @@ public class ComboSystem : IExecuteSystem, IInitializeSystem
|
|
|
|
|
ret = EWeaponChangeType.Set3;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
}
|