Beispiel #1
0
 internal MonsterDb(MonsterDb monster)
 {
     this.DameType    = monster.DameType;
     this.delayAtk    = monster.delayAtk;
     this.Droplist    = monster.Droplist;
     this.HpDefault   = monster.HpDefault;
     this.IdMonster   = monster.IdMonster;
     this.MCRegen     = monster.MCRegen;
     this.MonterType  = monster.MonterType;
     this.MoveSpeed   = monster.MoveSpeed;
     this.NameMonster = monster.NameMonster;
     this.Ranger      = monster.Ranger;
     this.RateCrist   = monster.RateCrist;
     this.RateDodge   = monster.RateDodge;
     this.RateDrop    = monster.RateDrop;
     this.Score       = monster.Score;
     this.TimeLife    = monster.TimeLife;
     this.ESC         = monster.ESC;
     this.ATKList     = monster.ATKList;
     DameATK1         = monster.DameATK1;
     DameATK2         = monster.DameATK2;
     DameATK3         = monster.DameATK3;
     RateATK1         = monster.RateATK1;
     RateATK2         = monster.RateATK2;
     RateATK3         = monster.RateATK3;
 }
Beispiel #2
0
        public async Task <IActionResult> ConfirmDeleteFromESC_list(int?id)
        {
            if (id != null)
            {
                ESC find_part = await PartsContext.ESCs.FirstOrDefaultAsync(p => p.Id == id);

                return(DeleteView(find_part, "ESC_list"));
            }
            return(NotFound());
        }
Beispiel #3
0
        public async Task <IActionResult> DeleteESC_list(int?id)
        {
            if (id != null)
            {
                ESC find_part = new ESC {
                    Id = id.Value
                };
                await DeletePart(find_part);

                return(RedirectToAction("Index"));
            }
            return(NotFound());
        }
Beispiel #4
0
    ///////////////////////////////////////////////////////////////////////////////////////////////
    // set 'false' to 'start' parameter of the animator, SO the monster will do action idle, after action appear finished
    // load and set 'Player' tranform as the target of the monster
    // check in the monster list to find databases of the monster and monsterFX via ID of the monster and ID of the monsterFX
    // release monster list and monsterFX list after get data
    // load all data we need from db to variables (via db construction)
    // if the monster has timelife, set 'Destroy' method to the monster with a delay equal to monster's timelife, SO it will be die after it's timelife
    void LoadProperties()
    {
        m_animatorController.SetBool("isAppeared", false);
        m_tfTarget = GameObject.FindGameObjectWithTag("Player").transform;

        foreach (var _aMonsterFX in m_dbMonsterFXList.Player.MonsterFxList)
        {
            if (m_nID == _aMonsterFX.IdMonsterFX)
            {
                m_dbMonsterFX = _aMonsterFX;
                break;
            }
        }
        foreach (var _aMonster in m_dbMonsterList.Player.MonsterDbList)
        {
            if (m_nID == _aMonster.IdMonster)
            {
                m_dbMonster = new MonsterDb(_aMonster);
                break;
            }
        }

        m_dbMonsterFXList = null;
        m_dbMonsterList   = null;

        m_nMonsterType   = m_dbMonster.MonterType;
        m_nScore         = m_dbMonster.Score;
        m_fTimeLife      = m_dbMonster.TimeLife;
        m_fMaxHP         = (float)m_dbMonster.HpDefault;
        m_fMovementSpeed = m_dbMonster.MoveSpeed;
        m_fDelayAttack   = m_dbMonster.delayAtk;
        m_nDamageType    = m_dbMonster.DameType;
        m_arATKList      = m_dbMonster.ATKList;
        m_fRateDodge     = m_dbMonster.RateDodge;
        m_fRateDrop      = m_dbMonster.RateDrop;
        m_fMCRegen       = m_dbMonster.MCRegen;
        m_oMonsterEsc    = m_dbMonster.ESC;
        m_arDropList     = m_dbMonster.Droplist;

        foreach (ATK _oTempAttack in m_arATKList)
        {
            if (_oTempAttack.RankATK == 1)
            {
                m_fAttack1Rate = _oTempAttack.Rate;
            }
            if (_oTempAttack.RankATK == 2)
            {
                m_fAttack2Rate = _oTempAttack.Rate;
            }
            if (_oTempAttack.RankATK == 3)
            {
                m_fAttack3Rate = _oTempAttack.Rate;
            }
        }

        m_fCurrentHP  = m_fMaxHP;
        m_fLeftLimit  = Camera.main.GetComponent <CameraFollow>().StartLook + 2.0f;
        m_fRightLimit = Camera.main.GetComponent <CameraFollow>().EndLook + Camera.main.orthographicSize * 2.0f - 3.0f;

        // LOG : check if rate attack of the monster is wrong
        //if (m_fRateATK1 + m_fRateATK2 + m_fRateATK3 != 1.0f) {
        //    Debug.Log("Attack rates of the monster is wrong!");
        //}

        m_fMoveCycle      = Random.Range(1.0f, 4.0f);
        m_fBreakTimeCycle = Random.Range(1.0f, 2.0f);

        if (m_fTimeLife > 0.0f)
        {
            Invoke("ExplodeBeforeDie", m_fTimeLife);
        }

        m_bDataLoaded = true;
    }