public virtual void Update() { if (Owner.IsDead) {//死亡 DeadAction action = Owner.ActionControl.LookupAction(ActorAction.ENType.enDeadAction) as DeadAction; if (action == null) { action = Owner.ActionControl.AddAction(ActorAction.ENType.enDeadAction) as DeadAction; if (action != null) { action.Init(!Owner.IsRealDead); } } } }
protected bool IsCmdExecute() { DeadAction deadAction = Self.ActionControl.LookupAction(ActorAction.ENType.enDeadAction) as DeadAction; if (deadAction != null) { return(false); } ReliveAction reliveAction = Self.ActionControl.LookupAction(ActorAction.ENType.enReliveAction) as ReliveAction; if (reliveAction != null) { return(false); } return(true); }
void ReliveUI() { #region 活ui DeadAction dead = Owner.ActionControl.LookupAction(ActorAction.ENType.enDeadAction) as DeadAction; if (dead != null) { if (dead.IsPlayOver && !Self.m_isDeadNotify) {//死亡动画已播放完毕 if (ActorManager.Singleton.Chief.IsDead && (ActorManager.Singleton.Deputy == null || ActorManager.Singleton.Deputy.IsDead)) {//主、副角色都死亡 if (Owner.m_isDeposited) { Owner.NotifyChanged((int)Actor.ENPropertyChanged.enCountDown, null); } else { Owner.NotifyChanged((int)Actor.ENPropertyChanged.enRelive, null); } } else { //是否攻击 bool isAttacking = false; if (Self.CurrentCmd != null) { if (Self.CurrentCmd.m_type == Player.ENCmdType.enLoopNormalAttack || Self.CurrentCmd.m_type == Player.ENCmdType.enSkill) { isAttacking = true; } } ActorManager.Singleton.SwitchMainActor(true, isAttacking); } Self.m_isDeadNotify = true; } return; } else { Self.m_isDeadNotify = false; } #endregion }
private void OnDisable() { EventShootAITankAction -= Shoot; EventDeadAction -= ReSpawnTank; }
void OnEnable() { EventShootAITankAction += Shoot; EventDeadAction += ReSpawnTank; }
private void OnEnable() { EventShootAction += MakeShoot; EventDeadAction += ReSpawnTank; }
private ActorAction CreateObj(ActorAction.ENType newType) { ActorAction action = m_pool.GetObjectFromPool(newType) as ActorAction; if (action != null) { return(action); } switch (newType) { case ActorAction.ENType.enStandAction: action = new StandAction(); break; //站立 case ActorAction.ENType.enMoveAction: action = new MoveAction(); break; //移动 case ActorAction.ENType.enAttackAction: action = new AttackAction(); break; //攻击 case ActorAction.ENType.enSpasticityAction: action = new SpasticityAction(); break; //被动僵直 case ActorAction.ENType.enBeAttackAction: action = new BeAttackAction(); break; //受击 case ActorAction.ENType.enUndownAction: action = new UndownAction(); break; //霸体 case ActorAction.ENType.enDeadAction: action = new DeadAction(); break; //死亡 case ActorAction.ENType.enReliveAction: action = new ReliveAction(); break; //复活 case ActorAction.ENType.enPlayEffectAction: action = new PlayEffectAction(); break; //播放特效 case ActorAction.ENType.enSearchEnemyAction: //action = new SearchEnemyAction(); break; //搜索敌人 case ActorAction.ENType.enTeleportAction: action = new TeleportAction(); break; //瞬移 case ActorAction.ENType.enControlMoveAction: action = new ControlMoveAction(); break; //控制技能定身 case ActorAction.ENType.enHoldDownAction: action = new HoldDownAction(); break; //按下状态 case ActorAction.ENType.enSelfSpasticityAction: action = new SelfSpasticityAction(); break; //主动僵直 case ActorAction.ENType.enAlertAction: action = new AlertAction(); break; //警戒 case ActorAction.ENType.enJumpinAction: action = new JumpinAction(); break; //入场 case ActorAction.ENType.enJumpoutAction: action = new JumpoutAction(); break; //退场 case ActorAction.ENType.enRollAction: action = new RollAction(); break; //翻滚 case ActorAction.ENType.enFakeBeAttackAction: action = new FakeBeAttackAction(); break; //假受击 case ActorAction.ENType.enActorExitAction: action = new ActorExitAction(); break; //主控角色退场 case ActorAction.ENType.enActorEnterAction: action = new ActorEnterAction(); break; //主控角色入场 case ActorAction.ENType.enControlAttackAction: action = new ControlAttackAction(); break; //不能攻击 case ActorAction.ENType.enControlBeAttackAction: action = new ControlBeAttackAction(); break; //不能受击 case ActorAction.ENType.enAttackingMoveAction: action = new AttackingMoveAction(); break;//攻击时移动 case ActorAction.ENType.enDragMoveAction: action = new DragMoveAction(); break;//拖拽 default: throw new Exception("Miss Action Create for" + newType.ToString()); } return(action); }
public override void Exec(IResultControl control) { if (m_offExec) { return; } base.Exec(control); Actor actor = ActorManager.Singleton.Lookup(TargetID); if (null == actor) { return; } actor.Props.SetProperty_Int32(ENProperty.islive, 0); {//clear if (actor.Type == ActorType.enMain) { MainPlayer player = actor as MainPlayer; //清除命令 player.CurrentCmd = null; //通知头像 player.NotifyChanged((int)Actor.ENPropertyChanged.enMainHead, EnMainHeadType.enActorDead); } else if (actor.Type == ActorType.enNPC) { NPC npc = actor as NPC; //隐藏警戒 npc.HideWarnTip(); //恢复优先攻击标记 npc.m_priorityAttack = false; if (npc.GetNpcType() != ENNpcType.enBOSSNPC) { //npc.EnableCollider(false); } else { if (!m_isRelive) { ++BattleArena.Singleton.KillBossCount; } //Debug.LogWarning("boss dead, source id:" + SourceID + ",self id:" + TargetID); } Actor source = ActorManager.Singleton.Lookup(SourceID); if (source != null && source.Type == ActorType.enMain) {//只增加主控角色击杀的npc //增加击杀npc的数量 ++BattleArena.Singleton.KillNpcCount; } //清除命令 npc.CurrentCmd = null; //恢复强韧度 npc.Props.SetProperty_Float(ENProperty.stamina, npc.Props.GetProperty_Float(ENProperty.maxStamina)); //test npc.TestBossStamina(); // 掉落表现 开始 DropItemPerformance.Singleton.Start(npc); if (!m_isRelive) {//清除目标 actor.TargetManager.CurrentTarget = null; } } //连击数清零 actor.ComboClear(); //清除buffer actor.MyBuffControl.RemoveAllForDead(control); } {//dead action //是否真的死亡 //actor.IsRealDead = !m_isRelive; if (!m_isRelive) { actor.OnDead(); } //通知所有人自己死亡 ActorManager.Singleton.NotifyAll_ClearTarget(actor.ID); DeadAction action = actor.ActionControl.AddAction(ActorAction.ENType.enDeadAction) as DeadAction as DeadAction; if (null != action) { action.Init(m_isRelive); } } }