示例#1
0
 /// <summary>
 /// Resets the behavior.
 /// </summary>
 public void ResetBehavior()
 {
     behavior = MobBehaviour.BEHAVIOUR_NONE.GetFlag();
     for (int i = 0; i < MAX_STACKED_BEHAVIOR; i++)
     {
         if (stacked[i] == null)
         {
             stacked[i] = new BehaviourData();
         }
         stacked[i].Exists = false;
     }
 }
示例#2
0
 /// <summary>
 /// Creates a new instance of <see cref="IONpcData"/>.
 /// </summary>
 protected IONpcData()
 {
     name    = "";
     stacked = new BehaviourData[MAX_STACKED_BEHAVIOR];
     for (int i = 0; i < MAX_STACKED_BEHAVIOR; i++)
     {
         if (stacked[i] == null)
         {
             stacked[i] = new BehaviourData();
         }
     }
     //pathfinder = new IOPathfind();
 }
示例#3
0
        public void StackBehavior()
        {
            for (int i = 0; i < MAX_STACKED_BEHAVIOR; i++)
            {
                BehaviourData bd = stacked[i];
                if (!bd.Exists)
                {
                    bd.Behaviour     = behavior;
                    bd.BehaviorParam = behavior_param;
                    bd.Tactics       = Tactics;
                    // set pathfinding information
                    // if (io->_npcdata->pathfind.listnb > 0)
                    // bd->target = io->_npcdata->pathfind.truetarget;
                    // else
                    // bd->target = io->targetinfo;

                    bd.MoveMode = Movemode;
                    bd.Exists   = true;
                    break;
                }
            }
        }
示例#4
0
        public void UnstackBehavior()
        {
            for (int i = 0; i < MAX_STACKED_BEHAVIOR; i++)
            {
                BehaviourData bd = stacked[i];
                if (bd.Exists)
                {
                    // AcquireLastAnim(io);
                    behavior        = bd.Behaviour;
                    behavior_param  = bd.BehaviorParam;
                    this.Tactics    = bd.Tactics;
                    this.targetInfo = bd.Target;
                    this.Movemode   = bd.MoveMode;
                    bd.Exists       = false;
                    // ARX_NPC_LaunchPathfind(io, bd->target);

                    if (this.HasBehavior(MobBehaviour.BEHAVIOUR_NONE))
                    {
                        // memcpy(io->animlayer, bd->animlayer,
                        // sizeof(ANIM_USE)*MAX_ANIM_LAYERS);
                    }
                }
            }
        }