Beispiel #1
0
    public static Monster CreateMonster(MonsterList monster, Game game, int level)
    {
        Monster newMonster = null;

        switch (monster)
        {
        case MonsterList.Bat:
            newMonster          = Bat.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Banshee:
            newMonster          = Banshee.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;

        case MonsterList.Demon:
            newMonster          = Demon.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Doll:
            newMonster          = Doll.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Ghoul:
            newMonster          = Ghoul.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.LivingArmor:
            newMonster          = LivingArmor.Create(level, game);
            newMonster.Behavior = new DontLookAway();
            break;

        case MonsterList.Spider:
            newMonster          = Spider.Create(level, game);
            newMonster.Behavior = new StandardMoveAndAttack();
            break;

        case MonsterList.Wraith:
            newMonster          = Wraith.Create(level, game);
            newMonster.Behavior = new TeleportAroundPlayer();
            break;
        }

        newMonster.Health = newMonster.Health + (level - 1);
        newMonster.Attack = newMonster.Attack + (level - 1);

        return(newMonster);
    }
Beispiel #2
0
    private void Initialisation()
    {
        //Initialisations
        m_eventSystem = GameObject.Find("EventSystem").GetComponent <EventSystem>();

        m_playerStats = GetComponent <PlayerStats>();
        m_rigidbody   = GetComponent <Rigidbody>();
        m_animator    = GetComponent <Animator>();
        m_audioSource = GetComponent <AudioSource>();

        m_steamBlastComponent          = m_steamBlastObject.gameObject.GetComponent <SteamBlast>();
        m_innerFireComponent           = m_innerFireObject.gameObject.GetComponent <InnerFire>();
        m_naturesRejuvenationComponent = m_naturesRejuvenationObject.gameObject.GetComponent <NaturesRejuvenation>();
        m_livingArmorComponent         = m_livingArmorObject.gameObject.GetComponent <LivingArmor>();
        m_overchargeComponent          = m_overchargeObject.gameObject.GetComponent <Overcharge>();
    }