Ejemplo n.º 1
0
 public override TaskStatus OnUpdate()
 {
     if (this._entity is BaseMonoAvatar)
     {
         BaseMonoAvatar avatar = this._entity as BaseMonoAvatar;
         for (int i = 0; i < this.animatorTagNamesAvatar.Count; i++)
         {
             if (avatar.IsAnimatorInTag(this.animatorTagNamesAvatar[i]))
             {
                 return(TaskStatus.Success);
             }
         }
     }
     else if (this._entity is BaseMonoMonster)
     {
         BaseMonoMonster monster = this._entity as BaseMonoMonster;
         for (int j = 0; j < this.animatorTagNamesMonster.Count; j++)
         {
             if (monster.IsAnimatorInTag(this.animatorTagNamesMonster[j]))
             {
                 return(TaskStatus.Success);
             }
         }
     }
     return(TaskStatus.Failure);
 }
Ejemplo n.º 2
0
        public void OnClick()
        {
            if (this.canChange)
            {
                BaseMonoAvatar localAvatar = Singleton <AvatarManager> .Instance.GetLocalAvatar();

                if (this._avatar.IsAlive())
                {
                    if ((!this._avatar.IsControlMuted() && localAvatar.IsAnimatorInTag(AvatarData.AvatarTagGroup.AllowTriggerInput)) && (localAvatar.GetRuntimeID() != this.avatarRuntimeID))
                    {
                        Singleton <LevelManager> .Instance.levelActor.TriggerSwapLocalAvatar(localAvatar.GetRuntimeID(), this.avatarRuntimeID, false);
                    }
                }
                else if (Singleton <LevelScoreManager> .Instance.LevelType != 4)
                {
                    Singleton <LevelManager> .Instance.SetPause(true);

                    if (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Single)
                    {
                        Singleton <MainUIManager> .Instance.ShowDialog(new InLevelReviveDialogContext(this.avatarRuntimeID, localAvatar.transform.position, false), UIType.Any);
                    }
                    else if ((Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.Multi) || (Singleton <LevelManager> .Instance.levelActor.levelMode == LevelActor.Mode.MultiRemote))
                    {
                        Singleton <MainUIManager> .Instance.ShowDialog(new InLevelReviveDialogContext(this.avatarRuntimeID, this._avatar.transform.position, false), UIType.Any);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void OnAttackLandedEvt(EvtAttackLanded evt)
        {
            if ((Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.targetID) == 3) && (Singleton <RuntimeIDManager> .Instance.ParseCategory(evt.attackeeID) == 4))
            {
                AvatarActor attackerActor = Singleton <EventManager> .Instance.GetActor <AvatarActor>(evt.targetID);

                if (((attackerActor != null) && (attackerActor.runtimeID != Singleton <AvatarManager> .Instance.GetLocalAvatar().GetRuntimeID())) && !(attackerActor is AvatarMirrorActor))
                {
                    BaseMonoAvatar entity = attackerActor.entity as BaseMonoAvatar;
                    if (entity.IsAnimatorInTag(AvatarData.AvatarTagGroup.AttackTargetLeadDirection))
                    {
                        MonsterActor actor = Singleton <EventManager> .Instance.GetActor <MonsterActor>(evt.attackeeID);

                        if ((this.localAvatarLockedMonsterActor == null) || (this.localAvatarLockedMonsterActor.runtimeID != actor.runtimeID))
                        {
                            if (this.IsMonsterBoss(actor))
                            {
                                this.SetAllSubHPBarDisable();
                            }
                            else
                            {
                                MonoSubMonsterHPBar component;
                                if (this._subMonsterHPBarMap.ContainsKey(actor.runtimeID))
                                {
                                    component = this._subMonsterHPBarMap[actor.runtimeID];
                                }
                                else
                                {
                                    GameObject availableSubMonsterHPBar = this.GetAvailableSubMonsterHPBar();
                                    availableSubMonsterHPBar.transform.SetParent(base.transform, false);
                                    component = availableSubMonsterHPBar.GetComponent <MonoSubMonsterHPBar>();
                                }
                                if (this._avatarHPBarMap.ContainsKey(attackerActor.runtimeID) && (this._avatarHPBarMap[attackerActor.runtimeID] != component))
                                {
                                    this._avatarHPBarMap[attackerActor.runtimeID].RemoveAttacker(attackerActor);
                                }
                                component.SetupView(attackerActor, actor, 0.1f, new Action <MonoSubMonsterHPBar>(this.OnHideHPBar));
                                this._avatarHPBarMap[attackerActor.runtimeID] = component;
                                this._subMonsterHPBarMap[actor.runtimeID]     = component;
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public override TaskStatus OnUpdate()
        {
            BaseMonoEntity attackTarget = this._entity.GetAttackTarget();

            if ((attackTarget != null) && attackTarget.IsActive())
            {
                if (attackTarget is BaseMonoAvatar)
                {
                    BaseMonoAvatar avatar = (BaseMonoAvatar)attackTarget;
                    if (avatar.IsAnimatorInTag(AvatarData.AvatarTagGroup.AttackOrSkill) && !avatar.IsAnimatorInTag(AvatarData.AvatarTagGroup.AttackWithNoTarget))
                    {
                        return(TaskStatus.Success);
                    }
                    return(TaskStatus.Failure);
                }
                if (attackTarget is BaseMonoMonster)
                {
                    BaseMonoMonster monster = (BaseMonoMonster)attackTarget;
                    return(!monster.isGoingToAttack(0.5f) ? TaskStatus.Failure : TaskStatus.Success);
                }
            }
            return(TaskStatus.Failure);
        }