Пример #1
0
 private static void SetSelfPathFlag(Life life, AIEventData data)
 {
     if (life == null)
     {
         return;
     }
     if (life is Role)
     {
         Role        w = life as Role;
         RoleGridRun m = w.run;
         if (m != null)
         {
             m.SetUpdataPath(data);
         }
     }
     if (life is Pet)
     {
         Pet w = life as Pet;
         if (w.PetMoveAI != null && w.PetMoveAI is PetWalk1002)
         {
             PetGridRun m = (w.PetMoveAI as PetWalk1002).m_run;
             m.SetUpdataPath(data);
         }
     }
 }
Пример #2
0
    public override void Init(AIEventData data, BaseEntity owner)
    {
        base.Init(data, owner);
        HungerAboveAIEventData hungerAboveData = data.hungerAboveData;

        Value = hungerAboveData.value;
    }
    public override void Init(AIEventData data, BaseEntity owner)
    {
        base.Init(data, owner);
        AggressionTimerAIEventData aggressionTimerData = data.aggressionTimerData;

        Value = aggressionTimerData.value;
    }
Пример #4
0
    public override void Init(AIEventData data, BaseEntity owner)
    {
        base.Init(data, owner);
        AmmoBelowAIEventData ammoBelowData = data.ammoBelowData;

        Value = ammoBelowData.value;
    }
Пример #5
0
    public bool DoPathCheck(AIEventData data)
    {
        if (data.Event == AIEvent.EVENT_MAP)
        {
            if (MapGrid.GetMG(m_Owner.MapPos).Type == GridType.GRID_HOLE || MapGrid.GetMG(run.NGrid).Type == GridType.GRID_HOLE)
            {
                return(true);
            }
        }

        if (run.m_FindAttackpos)
        {
            return(false);
        }
        if (data.Event == AIEvent.EVENT_SELFSP)
        {
            return(true);
        }
        if (m_Owner.m_Skill.CheckAttackTarget())
        {
            return(false);
        }
        if (CurrentAction is GridActionCmdFall)
        {
            return(false);
        }

        return(true);
    }
Пример #6
0
    public override void Init(AIEventData data, BaseEntity owner)
    {
        base.Init(data, owner);
        HealthBelowAIEventData healthBelowData = data.healthBelowData;

        HealthFraction = healthBelowData.healthFraction;
    }
Пример #7
0
    public override void Init(AIEventData data, BaseEntity owner)
    {
        base.Init(data, owner);
        InRangeAIEventData inRangeData = data.inRangeData;

        Range = inRangeData.range;
    }
Пример #8
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.hungerAboveData       = new HungerAboveAIEventData();
        aIEventData.hungerAboveData.value = Value;
        return(aIEventData);
    }
Пример #9
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.inRangeData       = new InRangeAIEventData();
        aIEventData.inRangeData.range = Range;
        return(aIEventData);
    }
Пример #10
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.ammoBelowData       = new AmmoBelowAIEventData();
        aIEventData.ammoBelowData.value = Value;
        return(aIEventData);
    }
Пример #11
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.aggressionTimerData       = new AggressionTimerAIEventData();
        aIEventData.aggressionTimerData.value = Value;
        return(aIEventData);
    }
Пример #12
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.chanceData       = new ChanceAIEventData();
        aIEventData.chanceData.value = Chance;
        return(aIEventData);
    }
Пример #13
0
    public override AIEventData ToProto()
    {
        AIEventData aIEventData = base.ToProto();

        aIEventData.healthBelowData = new HealthBelowAIEventData();
        aIEventData.healthBelowData.healthFraction = HealthFraction;
        return(aIEventData);
    }
Пример #14
0
 // true data1 大。
 public static bool ComareEvent(AIEventData data1, AIEventData data2)
 {
     if (data1.Event > data2.Event)
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Пример #15
0
    private static void SetUpdataPathFlag(List <Life> RoleList, AIEventData data)
    {
        if (RoleList == null || RoleList.Count == 0)
        {
            return;
        }

        foreach (Life life in RoleList)
        {
            SetSelfPathFlag(life, data);
        }
    }
Пример #16
0
    /// <summary>
    /// 个体寻路事件
    /// </summary>
    public static void AIPathEvent(AIEventData data, Life life)
    {
        switch (data.Event)
        {
        case AIEvent.EVENT_SELFSP:
            SetSelfPathFlag(life, data);
            break;

        case AIEvent.EVENT_CHANGETARGET:
            SetSelfPathFlag(life, data);
            break;

        default:
            break;
        }
    }
Пример #17
0
 public void SetUpdataPath(AIEventData data)
 {
     m_UpdataPathFlag = true;
     if (m_AIEventData == null)
     {
         m_AIEventData = data;
         if (this is RoleGridRun)
         {
             (this as RoleGridRun).RoleParent.InterruptAction(data);
         }
     }
     else
     {
         if (AIPathConditions.ComareEvent(data, m_AIEventData))
         {
             m_AIEventData = data;
             if (this is RoleGridRun)
             {
                 (this as RoleGridRun).RoleParent.InterruptAction(data);
             }
         }
     }
 }
Пример #18
0
 public override void Init(AIEventData data, BaseEntity owner)
 {
     base.Init(data, owner);
 }
Пример #19
0
 public override void Init(AIEventData data, BaseEntity owner)
 {
     base.Init(data, owner);
     Chance = data.chanceData.value;
 }
Пример #20
0
 //Event 事件类型
 /// <summary>
 /// 群体寻路事件
 /// </summary>
 public static void AIPathEvent(AIEventData data, List <Life> list)
 {
     SetUpdataPathFlag(list, data);
 }
Пример #21
0
 public virtual void Init(AIEventData data, BaseEntity owner)
 {
     Init(data.triggerStateContainer, data.id, owner, data.inputMemorySlot, data.outputMemorySlot, data.inverted);
 }