Ejemplo n.º 1
0
    public DataEnemyParam Create(bool _bIsBoss)
    {
        DataEnemyParam ret = new DataEnemyParam();

        ret.enemy_id  = enemy_id;
        ret.is_battle = false;

        ret.hp_max = HP_BASE + HP_PITCH * level_hp;

        ret.attack  = ATTACK_BASE + ATTACK_PITCH * level_attack;
        ret.defence = DEFENCE_BASE + DEFENCE_PITCH * level_defence;
        ret.speed   = SPEED_BASE + SPEED_PITCH * level_speed;

        if (_bIsBoss)
        {
            ret.hp_max *= 2;

            ret.attack  += boss_level_add;
            ret.defence += boss_level_add;
        }

        ret.hp = ret.hp_max;

        ret.attribute = attribute;

        ret.enemy_param = this;

        return(ret);
    }
Ejemplo n.º 2
0
	public void Initialize( DataEnemyParam _data  , MasterEnemyParam _master)
	{
		m_goRoot.SetActive(true);

		m_dataEnemyParam = _data;
		m_masterEnemyParam = _master;

		m_txtBossName.text = m_masterEnemyParam.name;

		m_barBossHp.SetValueMax(m_dataEnemyParam.hp_max);
	}
Ejemplo n.º 3
0
        private void create_enemies(int _iCurrentFloor, string _strDungeonId)
        {
            gameMain.ClearEnemy();

            MasterFloorParam floor_param = DataManager.Instance.masterFloor.list.Find(p =>
                                                                                      p.dungeon_id == _strDungeonId &&
                                                                                      (p.start <= _iCurrentFloor && _iCurrentFloor <= p.end));

            int[] enemy_index_prob = floor_param.GetEnemyIndexProb();

            int enemy_num = UtilRand.GetRand(10, 3);

            int[] pos_index      = new int[enemy_num];
            int[] pos_index_prob = new int[10];
            for (int i = 0; i < 10; i++)
            {
                pos_index_prob[i] = 100;
            }
            for (int i = 0; i < enemy_num; i++)
            {
                int iResult = UtilRand.GetIndex(pos_index_prob);
                pos_index[i]            = iResult;
                pos_index_prob[iResult] = 0;

                //Debug.Log(iResult);
            }



            for (int i = 0; i < enemy_num; i++)
            {
                //float x = UtilRand.GetRange(8.5f, 3.5f);
                float x = 3.5f + ((8.5f - 3.5f) / 10.0f) * pos_index[i];

                int index = UtilRand.GetIndex(enemy_index_prob);

                int enemy_id           = floor_param.GetEnemyId_fromIndex(index);
                MasterEnemyParam enemy = DataManager.Instance.masterEnemy.list.Find(p => p.enemy_id == enemy_id);

                gameMain.CreateEnemy(enemy, x, false);
            }

            if (_iCurrentFloor % 10 == 0)
            {
                MasterEnemyParam boss = DataManager.Instance.masterEnemy.list.Find(p => p.enemy_id == floor_param.boss);
                DataEnemyParam   data = gameMain.CreateEnemy(boss, 9.0f, true);
                gameMain.panelBossStatus.Initialize(data, boss);
            }
            else
            {
                gameMain.panelBossStatus.Disable();
            }
        }
Ejemplo n.º 4
0
    /*
     * [SerializeField]
     * private int show_hp;
     * [SerializeField]
     * private int show_hp_max;
     * [SerializeField]
     * private int show_attack;
     * [SerializeField]
     * private int show_defence;
     * [SerializeField]
     * private int show_speed;
     */

    public void Initialize(MasterEnemyParam _master, float _fPos, GameMain _game, bool _isBoss, Vector3 _scale)
    {
        enemy_param  = _master.Create(_isBoss);
        master_param = _master;
        m_gameMain   = _game;
        SetSprite(_master.sprite_name);
        if (_isBoss)
        {
            gameObject.name += "boss";
        }
        m_goSpriteRoot.transform.localScale = _scale;
        Touched = false;

        /*
         * show_hp = enemy_param.hp;
         * show_hp_max = enemy_param.hp_max;
         * show_attack = enemy_param.attack;
         * show_defence = enemy_param.defence;
         * show_speed = enemy_param.speed;
         */

        transform.localPosition = new Vector3(_fPos, 0.0f, 0.0f);
    }
Ejemplo n.º 5
0
 public void Initialize(DataEnemyParam _data)
 {
     m_dataEnemy = _data;
 }