Esempio n. 1
0
    void AddObstacle(Layer layer, float posX, int stageObjectId, ItemDropManager itemDropManager, FSM parentFsm, bool lastMonster)
    {
        FieldInstance instance = null;
        ObjectField objectField = TableLoader.GetTable<ObjectField>().Get(stageObjectId);
        ObjectStage objectStage = TableLoader.GetTable<ObjectStage>().Get(stageObjectId);

        if (objectStage.Type == E_StageObjectType.Monster)
        {
            ObjectMonster objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID);
            if (objectMonster.MonsterType == E_MonsterType.Boss)
            {
                BossAlertTrigger alertTrigger = new BossAlertTrigger(parentFsm);
                layer.AddSubject(alertTrigger, posX - Constants.Instance.Field.CameraWidth, 0);
                AddFieldInstance(alertTrigger);

                instance = new BossMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else if (lastMonster)
            {
                instance = new LastMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else
            {
                instance = new BattleObstacle(objectField, objectStage, itemDropManager, parentFsm);
            }
        }
        else if (objectStage.Type == E_StageObjectType.Chest)
        {
            instance = new Chest(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.EndPoint)
        {
            instance = new StageEndDoor(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Trap)
        {
            instance = new Trap(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Etc)
        {
            instance = new StageObject(objectField, objectStage, itemDropManager, parentFsm);
        }
        else
        {
            Assert.Fail("not implemented");
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }
Esempio n. 2
0
    void AddObstacle(Layer layer, float posX, int stageObjectId, FSM parentFsm)
    {
        FieldObject instance = null;
        FieldObjectEntity objectField = TableLoader.GetTable<FieldObjectEntity>().Get(stageObjectId);
        StageObjectEntity2 objectStage = TableLoader.GetTable<StageObjectEntity2>().Get(stageObjectId);

        if (objectStage.stageObjectType == StageObjectType.Monster)
        {
            instance = new Monster(objectField, objectStage, parentFsm);
        }
        else
        {
            instance = new StageObject(objectField, objectStage, parentFsm);
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }