Пример #1
0
    /// <summary>
    /// 使用技能
    /// </summary>
    /// <param name="_playerActor">PlayerActor 实例</param>
    /// <param name="_myActor">MonsterActor 实例</param>
    public void UseSkill(PlayerActor _playerActor, MonsterActor _myActor)
    {
        Actor target = _playerActor;

        switch (this.subjectTo)
        {
        case Enum.SubjectToEnum.player:
            target = _playerActor;
            _playerActor.SanChange(this.sanValue);
            _playerActor.StaminaChange(this.staminaValue);
            break;

        case Enum.SubjectToEnum.enemy:
            target = _myActor;

            break;

        default:
            break;
        }

        if (this.buffId > -1)
        {
            BuffCreater.AddBuffToActor(target, this.buffId);
        }

        Debug.Log("[Monster Attck]");
    }
Пример #2
0
 public void AddAllMonster(MonsterActor monster)
 {
     if (m_AllMonsterActors == null)
     {
         m_AllMonsterActors = new List <MonsterActor> ();
     }
     m_AllMonsterActors.Add(monster);
 }
Пример #3
0
    private void Start()
    {
        cardListTransform = GameObject.Find("CardList").transform;
        this.monsterActor = null;
        this.UIBindToEvent();

        this.CreateNewMonster(true);
        NextRound();
    }
Пример #4
0
 public void AddFrontMonster(MonsterActor monster)
 {
     if (m_FrontMonsterActors == null)
     {
         m_FrontMonsterActors = new List <MonsterActor> ();
     }
     m_FrontMonsterActors.Add(monster);
     m_BackMonsterActors.Remove(monster);
 }
Пример #5
0
 public void SettingData(MonsterActor _actorComponent)
 {
     _actorComponent.SettingData(
         this.monster_ID,
         this.monster_Name,
         this.init_RoundNum,
         this.monsterskillid_Array,
         this.spineAnime_Name
         );
 }
Пример #6
0
    public IEnumerator ActiveContactSkill(MonsterActor monster)
    {
        if (m_SkillReady)
        {
            Debug.Log("Contact skill : applying damages");
            monster.ApplyDamage(m_Damages);
            yield return(new WaitForSeconds(0.5f));

            m_CurrentCooldown = m_CooldownDuration;
        }
    }
Пример #7
0
 protected IEnumerator ContactTriggerRoutine(MonsterActor monster, List <HeroActor> heroes)
 {
     foreach (HeroActor hero in heroes)
     {
         hero.ActiveContactSkill(monster);
         yield return(new WaitForSeconds(0.3f));
     }
     foreach (HeroActor hero in heroes)
     {
         monster.ActiveContactSkill(hero);
     }
 }
Пример #8
0
    public void InitiateEnemies(DungeonNode node)
    {
        foreach (Transform t in node.enemies)
        {
            //move the moster above the ground
            t.position = new Vector3(t.position.x, 0, t.position.z);

            //enable the moster script to take damage and take actions
            MonsterActor actor = t.GetComponent <MonsterActor>();
            actor.enabled = true;

            //enable the navmesh if the moster uses it
            t.GetComponent <NavMeshAgent>().enabled = actor.useNavMeshOnSpawn;
        }
    }
Пример #9
0
    void OptionChange()
    {
        UIWarManager.instance.PushHpBar(this);
        switch (nowActor.tag)
        {
        case "Monster":
            MonsterActor tempMonster = (MonsterActor)nowActor;
            tempMonster.SetHpBarExist = false;
            nowActor    = null;
            tempMonster = null;
            break;

        default:
            break;
        }
    }
Пример #10
0
    public void ContactTrigger(MonsterActor monster)
    {
        List <HeroActor> heroes = new List <HeroActor> ();

        foreach (int laneNumber in monster.m_CurrentLaneNumbers)
        {
            foreach (HeroActor hero in GameManager.Instance.m_HeroActors)
            {
                if (hero.GetLaneNumber() == laneNumber)
                {
                    heroes.Add(hero);
                }
            }
        }
        StartCoroutine(ContactTriggerRoutine(monster, heroes));
    }
Пример #11
0
    /// <summary>
    /// 创建新的怪物 若当前 nowMonsterIndex 索引以大于总数量,则游戏结束
    /// </summary>
    public void CreateNewMonster(bool _roundRun = false)
    {
        if (this.monsterPrefab == null)
        {
            return;
        }


        MonsterData monsterData = null;

        //MonsterActor monster = null;
        while (monsterData == null)
        {
            this.nowMonsterIndex++;
            if (this.nowMonsterIndex > LevelData.monsterList.Count)
            {
                this.GameOver();
                return;
            }

            //monsterData = LevelData.CreateMonsterActor(this.nowMonsterIndex);
            monsterData = LevelData.FindMonsterDataByIndex(this.nowMonsterIndex);
        }


        GameObject monsterObject = Instantiate(this.monsterPrefab);

        MonsterActor actor = monsterObject.GetComponent <MonsterActor>();

        actor.roundRun = _roundRun;
        monsterData.SettingData(actor);

        this.monsterActor = actor;

        Debug.Log("[New Monster]" + actor.monsterName);

        // 创建怪物预制体并添加 MonsterActor
        // todo...
    }
Пример #12
0
    public void MakeParty()
    {
        ++PartyCount;
        monsterList = new List <MonsterActor>();

        GameObject newPartyObj = new GameObject(PartyCount.ToString());

        newPartyObj.transform.SetParent(DungeonManager.instance.MonsterPartyManager);
        Monster haveData;

        for (int i = 0; i < 4; ++i)
        {
            int          index   = Random.Range(0, DungeonManager.instance.GetMonsterTypeMax);
            GameObject   obj     = DungeonManager.instance.PopMonster((MONSTER_TYPE)index);
            MonsterActor monster = obj.GetComponentInChildren <MonsterActor>();
            haveData = new Monster(index);
            monster.RegistCharacter(haveData);
            obj.transform.SetParent(newPartyObj.transform);
            monster.SetPartyCommader = this;
            monster.TargetEventAdd();
            monster.MonsterIndex = index;
            monsterList.Add(monster);
        }


        float randomvalue = 3f;

        float RandomposX;
        float RandomposZ;

        for (int i = 0; i < 4; ++i)
        {
            RandomposX = Random.Range(-randomvalue, randomvalue);
            RandomposZ = Random.Range(-randomvalue, randomvalue);
            monsterList[i].transform.parent.position = new Vector3(transform.position.x + RandomposX, 0, transform.position.z + RandomposZ);
            monsterList[i].SetStartPos(monsterList[i].transform.parent.position);
        }
    }
Пример #13
0
 protected virtual void ApplyEffect(MonsterActor monster)
 {
     monster.ApplyDamage(m_Damages);
 }
Пример #14
0
 public void OnMonsterKilled(MonsterActor m, Component source)
 {
     OnMonsterKilled2();
 }
Пример #15
0
 public void ActiveContactSkill(MonsterActor monster)
 {
     m_ContactSkill.StartCoroutine(m_ContactSkill.ActiveContactSkill(monster));
 }