예제 #1
0
    /*
     * initialize enemy actor with enemy param
     */
    public void Initialize(EnemyData.Param p, EnemyDatabase db, ItemDatabase itemdb)
    {
        //tk2dSpriteAnimation
        m_sprite.Library = db.GetAnimationFromName(p.graphic);

        id = p.id;
        charName = p.name;
        hp = p.hpMax;
        hpMax = p.hpMax;
        hunger = 0;
        hungerMax = 0;
        agility = (float)p.agility;
        doesGetHungry = false;
        for(int i =0; i < (int)ElementType.ET_MAX; ++i) {
            ap[i] 		= (float)p.ApMax[i];
            apMax[i] 	= (float)p.ApMax[i];
            def[i] 		= (float)p.DpMax[i];
            defMax[i] 	= (float)p.DpMax[i];
        }
        canDie = true;
        race = Race.Creature;

        level = p.level;
        exp = p.exp;
        earnExp = p.earnExp;

        attackEffect = p.attackEffect;

        // TODO: item
    }