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;
 }
 private void AttackLiveActor(LiveActor actor)
 {
     if (actor == null)
     {
         return;
     }
     if (!actor.isDead)
     {
         QueueAction(new NpcActorAction(NpcActorActionType.AttackLiveActor, attacktargetactor: actor));
     }
 }
Beispiel #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;
            }
        }
        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();
            }
        }
 public AbilityInvokationInfo(LiveActor castinvoker, Vector3 castposition, LiveActor casttarget)
 {
     castInvoker  = castinvoker;
     castPosition = castposition;
     castTarget   = casttarget;
 }
 public virtual void OnUnapply(LiveActor affected)
 {
 }