Esempio n. 1
0
    public override void Enter()
    {
        base.Enter();
        if (childrenStates.Count == 0)
        {
            ConditionCoolTime_FireSlimeBoss  conditionCoolTime  = new ConditionCoolTime_FireSlimeBoss(3);
            ConditionHaveEnemy_FireSlimeBoss conditionHaveEnemy = new ConditionHaveEnemy_FireSlimeBoss();
            DistanceCondition_FireSlimeBoss  distanceCondition  = new DistanceCondition_FireSlimeBoss();
            NormalAttack_FireSlimeBoss       normalAttack       = new NormalAttack_FireSlimeBoss();

            conditionCoolTime.SetCharacterAI(GetAI());
            conditionHaveEnemy.SetCharacterAI(GetAI());
            distanceCondition.SetCharacterAI(GetAI());
            normalAttack.SetCharacterAI(GetAI());

            conditionCoolTime.currentState  = State.NONE;
            conditionHaveEnemy.currentState = State.NONE;
            distanceCondition.currentState  = State.NONE;
            normalAttack.currentState       = State.NONE;

            AddChild(conditionCoolTime);
            AddChild(conditionHaveEnemy);
            AddChild(distanceCondition);
            AddChild(normalAttack);
        }
        Debug.Log("判断普攻");
    }
Esempio n. 2
0
    public override void Enter()
    {
        base.Enter();
        FireSlimeBossAI fireSlimeBossAI = (FireSlimeBossAI)GetAI();

        if (childrenStates.Count == 0)
        {
            ConditionHaveEnemy_FireSlimeBoss conditionHaveEnemy = new ConditionHaveEnemy_FireSlimeBoss();
            MoveToEnemy_FireSlimeBoss        moveToEnemy        = new MoveToEnemy_FireSlimeBoss();
            moveToEnemy.SetCharacterAI(GetAI());
            conditionHaveEnemy.SetCharacterAI(GetAI());

            AddChild(conditionHaveEnemy);
            AddChild(moveToEnemy);
        }
        Debug.Log("进入移动向敌人状态");
    }
Esempio n. 3
0
    public FireSlimeBossAI() : base()
    {
        SetConditionHaveEnemy(new ConditionHaveEnemy_FireSlimeBoss());
        conditionHaveEnemy.SetCharacterAI(this);

        SetDistanceCondition(new DistanceCondition_FireSlimeBoss());
        distanceCondition.SetCharacterAI(this);

        SetMoveState(new MoveState_FireSlimeBoss());
        moveState.SetCharacterAI(this);

        SetMoveToEnemyState(new MoveToEnemyState_FireSlimeBoss());
        moveToEnemyState.SetCharacterAI(this);

        SetMoveToEnemy(new MoveToEnemy_FireSlimeBoss());
        moveToEnemy.SetCharacterAI(this);

        SetAttackState(new AttackState_FireSlimeBoss());
        attackState.SetCharacterAI(this);

        SetSkill1State(new Skill1State_FireSlimeBoss());
        skill1State.SetCharacterAI(this);

        SetSkill2State(new Skill2State_FireSlimeBoss());
        skill2State.SetCharacterAI(this);

        SetSkill3State(new Skill3State_FireSlimeBoss());
        skill3State.SetCharacterAI(this);

        SetNormalAttackState(new NormalAttackState_FireSlimeBoss());
        normalAttackState.SetCharacterAI(this);

        root_Node = new Selector();
        root_Node.AddChild(attackState);
        root_Node.AddChild(moveState);
        root_Node.currentState = State.NONE;
    }
Esempio n. 4
0
    public override void Enter()
    {
        base.Enter();
        FireSlimeBossAI fireSlimeBossAI = (FireSlimeBossAI)GetAI();
        FireSlimeBoss   fireSlimeBoss   = (FireSlimeBoss)fireSlimeBossAI.getCharacter();

        if (childrenStates.Count == 0)
        {
            ConditionCoolTime_FireSlimeBoss  conditionCoolTime  = new ConditionCoolTime_FireSlimeBoss(0);
            ConditionHaveEnemy_FireSlimeBoss conditionHaveEnemy = new ConditionHaveEnemy_FireSlimeBoss();
            RepeatDecoratorNode          repeatDecoratorNode    = new RepeatDecoratorNode(5);
            LaunchFireBomb_FireSlimeBoss launchFireBomb         = new LaunchFireBomb_FireSlimeBoss();
            conditionCoolTime.SetCharacterAI(GetAI());
            conditionHaveEnemy.SetCharacterAI(GetAI());
            repeatDecoratorNode.SetCharacterAI(GetAI());
            launchFireBomb.SetCharacterAI(GetAI());

            repeatDecoratorNode.AddChild(launchFireBomb);
            AddChild(conditionCoolTime);
            AddChild(conditionHaveEnemy);
            AddChild(repeatDecoratorNode);
        }
        Debug.Log("判断skill1");
    }