Пример #1
0
    public QuestMonster(QuestData.UniqueMonster qm) : base()
    {
        Game game = Game.Get();

        // Get base derived monster type
        MonsterData baseObject = null;

        if (game.cd.monsters.ContainsKey(qm.baseMonster))
        {
            derivedType = qm.baseMonster;
            baseObject  = game.cd.monsters[qm.baseMonster];
        }

        name = qm.monsterName;
        if (name.Length == 0 && baseObject != null)
        {
            name = baseObject.name;
        }

        sets        = new List <string>();
        sectionName = qm.name;
        priority    = 0;

        traits = qm.traits;
        if (traits.Length == 0 && baseObject != null)
        {
            traits = baseObject.traits;
        }

        info = EventManager.SymbolReplace(qm.info);
        if (info.Length == 0 && baseObject != null)
        {
            info = baseObject.info;
        }

        image = qm.GetImagePath();
        if (image.Length == 0 && baseObject != null)
        {
            image = baseObject.image;
        }

        imagePlace = qm.GetImagePlacePath();
        if (imagePlace.Length == 0 && baseObject != null)
        {
            imagePlace = baseObject.image;
        }
        if (imagePlace.Length == 0)
        {
            imagePlace = image;
        }


        activations = qm.activations;
        if (activations.Length == 0 && baseObject != null)
        {
            useMonsterTypeActivations = true;
        }
    }
Пример #2
0
    // Construct with quest data
    public QuestMonster(QuestData.UniqueMonster qm) : base()
    {
        Game game = Game.Get();

        // Get base derived monster type
        MonsterData baseObject = null;

        // Check for content data monster defined as base
        if (game.cd.monsters.ContainsKey(qm.baseMonster))
        {
            // Set base monster type
            derivedType = qm.baseMonster;
            baseObject  = game.cd.monsters[qm.baseMonster];
        }

        // TODO: We get only the name inherited from fixed
        // monsters. It can be edited in next Pull Request
        // when Valkyrie is translated
        // Set name
        name = new StringKey(qm.monsterName, false);
        // If name not set use base type
        if (name.key.Length == 0 && baseObject != null)
        {
            name = baseObject.name;
        }

        // Initialise sets
        sets = new List <string>();

        // define data
        sectionName = qm.sectionName;
        priority    = 0;

        // Read traits from quest data or base type
        traits = qm.traits;
        if (traits.Length == 0 && baseObject != null)
        {
            traits = baseObject.traits;
        }

        // Read info from quest data or base type
        info = new StringKey(EventManager.SymbolReplace(qm.info.key), false);
        if (info.key.Length == 0 && baseObject != null)
        {
            info = baseObject.info;
        }

        // Read image from quest data or base type
        image = qm.GetImagePath();
        if (image.Length == 0 && baseObject != null)
        {
            image = baseObject.image;
        }

        // Read placement image from quest data or base type
        imagePlace = qm.GetImagePlacePath();
        if (imagePlace.Length == 0 && baseObject != null)
        {
            imagePlace = baseObject.image;
        }
        if (imagePlace.Length == 0)
        {
            imagePlace = image;
        }

        // Read activations  from quest data or base type
        activations = qm.activations;
        if (activations.Length == 0 && baseObject != null)
        {
            useMonsterTypeActivations = true;
        }

        // Read activations  from quest data or base type
        activations = qm.activations;
        if (activations.Length == 0 && baseObject != null)
        {
            useMonsterTypeActivations = true;
        }
    }
Пример #3
0
    // Construct with quest data
    public QuestMonster(QuestData.UniqueMonster qm) : base()
    {
        Game game = Game.Get();

        // Get base derived monster type
        MonsterData baseObject = null;

        // Check for content data monster defined as base
        if (game.cd.monsters.ContainsKey(qm.baseMonster))
        {
            // Set base monster type
            derivedType = qm.baseMonster;
            baseObject  = game.cd.monsters[qm.baseMonster];
        }

        // Set name
        name = qm.monsterName;
        // If name not set use base type
        if (name.Length == 0 && baseObject != null)
        {
            name = baseObject.name;
        }

        // Initialise sets
        sets = new List <string>();

        // define data
        sectionName = qm.name;
        priority    = 0;

        // Read traits from quest data or base type
        traits = qm.traits;
        if (traits.Length == 0 && baseObject != null)
        {
            traits = baseObject.traits;
        }

        // Read info from quest data or base type
        info = EventManager.SymbolReplace(qm.info);
        if (info.Length == 0 && baseObject != null)
        {
            info = baseObject.info;
        }

        // Read image from quest data or base type
        image = qm.GetImagePath();
        if (image.Length == 0 && baseObject != null)
        {
            image = baseObject.image;
        }

        // Read placement image from quest data or base type
        imagePlace = qm.GetImagePlacePath();
        if (imagePlace.Length == 0 && baseObject != null)
        {
            imagePlace = baseObject.image;
        }
        if (imagePlace.Length == 0)
        {
            imagePlace = image;
        }

        // Read activations  from quest data or base type
        activations = qm.activations;
        if (activations.Length == 0 && baseObject != null)
        {
            useMonsterTypeActivations = true;
        }
    }