Exemple #1
0
        public override bool OnMessage(NpcActor owner, IStateEvent t)
        {
            switch (t.EventType)
            {
            case StateEventType.BossCome:
                owner.ShowBoom(true);
                return(true);

            case StateEventType.BossLeave:
                owner.ShowBoom(false);
                return(true);

            case StateEventType.BossHit:
                EventDispatcher.TriggerEvent(BattleEvent.BossAngry);
                owner.StateMachine.ChangeState(new NpcStateScare());
                return(true);

            case StateEventType.BossAbuse:
                EventDispatcher.TriggerEvent(BattleEvent.BossAngry);
                owner.ShowWater();
                owner.RefreshWorkSate(WorkState.HitToWork);
                owner.StateMachine.ChangeState(new NpcStateWork());
                return(true);
            }

            return(false);
        }
Exemple #2
0
 public override void Enter(NpcActor owner)
 {
     base.Enter(owner);
     owner.ChangeState(NpcState.Sleep);
     if (owner.IsBossShow)
     {
         owner.ShowBoom(true);
     }
 }
Exemple #3
0
        public override bool OnMessage(NpcActor owner, IStateEvent t)
        {
            switch (t.EventType)
            {
            case StateEventType.BossCome:
                owner.StateMachine.ChangeState(new NpcStateWork());
                owner.RefreshWorkSate(WorkState.HitToWork);

                return(true);
            }

            return(false);
        }
Exemple #4
0
 public override void Enter(NpcActor owner)
 {
     base.Enter(owner);
     owner.ChangeState(NpcState.Internet);
 }