예제 #1
0
 public NpcActorAction(NpcActorActionType actiontype, NpcActorActionFinish finish = NpcActorActionFinish.OnEndTimer, LiveActor attacktargetactor = null, Vector3 walkposition = default(Vector3), NpcActorActionTypeAnimation performedanimation = NpcActorActionTypeAnimation.Idle, float actionexecutiontime = 0, bool isloop = false)
 {
     actionType               = actiontype;
     this.finish              = finish;
     attackTargetActor        = attacktargetactor;
     walkPosition             = walkposition;
     performedAnimation       = performedanimation;
     this.actionExecutionTime = actionexecutiontime;
     isLoop = isloop;
 }
예제 #2
0
 private void AttackLiveActor(LiveActor actor)
 {
     if (actor == null)
     {
         return;
     }
     if (!actor.isDead)
     {
         QueueAction(new NpcActorAction(NpcActorActionType.AttackLiveActor, attacktargetactor: actor));
     }
 }
예제 #3
0
        public void ReceiveDamage(float damage, DamageType dt, LiveActor dd)
        {
            if (isDead)
            {
                return;
            }
            if (isImmortal)
            {
                return;
            }
            if (dt == DamageType.Poison && isPoisonImmune)
            {
                return;
            }

            attributes[AttributeType.CurrentHealth] -= damage;
            if (attributes[AttributeType.CurrentHealth] <= 0)
            {
                attributes[AttributeType.CurrentHealth] = 0;
            }
        }
예제 #4
0
        private void FinishCurrentAction()
        {
            switch (currentAction.actionType)
            {
            case NpcActorActionType.AttackLiveActor:
                enemyTarget = null;
                break;

            case NpcActorActionType.GotoPosition:
                // If walkTarget = new Vector3(0, 0, 0) the npc will run to this position
                break;

            case NpcActorActionType.PerformAnimation:
                specialAnimation = NpcActorActionTypeAnimation.Idle;
                break;
            }

            currentActionExecutionTime = 0;
            if (!currentAction.isLoop)
            {
                SelectNextAction();
            }
        }
예제 #5
0
 public AbilityInvokationInfo(LiveActor castinvoker, Vector3 castposition, LiveActor casttarget)
 {
     castInvoker  = castinvoker;
     castPosition = castposition;
     castTarget   = casttarget;
 }
예제 #6
0
 public virtual void OnUnapply(LiveActor affected)
 {
 }