Example #1
0
 public override void Init(TaskModeMgr mgr, GameObject playerGo)
 {
     m_FightArrowType = FightTaskUiType.KillApointMonster;
     m_OriCount       = m_KillCount;
     m_WaveMgr        = Global.gApp.CurScene.GetWaveMgr();
     base.Init(mgr, playerGo);
 }
Example #2
0
        public Wave(int waveId, WaveMgr waveMgr, PassItem passData, GameObject player, int guid)
        {
            m_WaveId              = waveId;
            m_StartWave           = false;
            m_Guid                = guid;
            m_CreateInfo          = new List <MonsterItem>();
            m_RoundRoleCreateInfo = new List <MonsterItem>();
            m_BornNodeList        = new List <GameObject>();
            m_RoundRoleBornNodes  = (Global.gApp.CurScene as FightScene).GetBornNodes();
            m_NormalScene         = Global.gApp.CurScene.IsNormalPass();
            m_WaveMgr             = waveMgr;
            //m_WaveData = Global.gApp.gGameData.GetWaveData().Find(l => l.id == waveId);
            m_WaveData   = Global.gApp.gGameData.WaveData.Get(waveId);
            m_PassData   = passData;
            m_MainPlayer = player;
            m_Monsters   = new List <Monster>();

            m_TriggerType   = (TriggerType)m_WaveData.trigMode[0];
            m_DtCreateCount = Mathf.Max(m_DtCreateCount, m_WaveData.NumTime);
            if (m_WaveData.enemyNum.Length == 1 && m_WaveData.enemyID.Length > 1)
            {
                m_RandomType = RandomType.RandMonster;
            }
            else
            {
                m_RandomType = RandomType.RandCreateInfo;
            }
            InitMonsterInfo();
            RegisterListeners();
            StartWave();
        }
Example #3
0
 public override void Init(TaskModeMgr mgr, GameObject playerGo)
 {
     m_WaveMgr        = Global.gApp.CurScene.GetWaveMgr();
     m_FightArrowType = FightTaskUiType.Empty;
     base.Init(mgr, playerGo);
     if (m_Waves.Count == 0)
     {
         int[] waveIds = Global.gApp.CurScene.GetPassData().waveID;
         m_Waves.Capacity = waveIds.Length;
         foreach (int id in waveIds)
         {
             m_Waves.Add(id);
         }
     }
     m_AllWave = new List <Wave>(m_Waves.Count);
     foreach (int waveId in m_Waves)
     {
         Wave wave = m_WaveMgr.GetWavesById(waveId);
         if (wave != null)
         {
             m_AllWave.Add(wave);
         }
     }
     RegisterListener();
 }
Example #4
0
 void Start()
 {
     GetComponent <DelayDestroy>().AddLiveTime(m_EndedTime);
     GetComponent <DelayDestroy>().enabled = false;
     m_Gun.enabled    = false;
     m_RotateRoleNode = transform.Find(GameConstVal.RotNode);
     m_WaveMgr        = Global.gApp.CurScene.GetWaveMgr();
 }
Example #5
0
 public void Init(GameObject hitMonster, double damage)
 {
     LinkBullet     = new List <Monster>(LinkTimes + 1);
     m_LinkRangeSqr = LinkRange * LinkRange;
     m_StartObj     = hitMonster;
     m_WaveMgr      = Global.gApp.CurScene.GetWaveMgr();
     m_Damage       = damage * Damping;
     FindNextLink(LinkTimes);
 }
Example #6
0
        private void Start()
        {
            m_WaveMgr          = Global.gApp.CurScene.GetWaveMgr();
            m_DamageRange      = transform.Find("ModelNode/Damage").gameObject;
            m_Rigidbody2D      = GetComponent <Rigidbody2D>();
            m_CircleCollider2D = GetComponent <CircleCollider2D>();
            m_BackAct          = GetComponent <BeatBackAct>();
            m_BackAct.Init(this, m_Weight);
            m_Carrier    = new CarrieMgr(this);
            m_WeaponMgr  = new FightWeaponMgr(this);
            m_PetMgr     = new FightPetMgr(this);
            m_BuffMgr    = new BuffMgr(this);
            m_PlayerData = new PlayerData(this, m_BuffMgr);
            m_PlayerData.Init();
            m_Fight = new Fight(this);
            m_Fight.SetRotateNode(RoleNode);
            m_WeaponMgr.InitGun();

            //int skillLevel = Global.gApp.gSystemMgr.GetSkillMgr().GetSkillLevel(GameConstVal.SExSpeed);
            //Skill_dataItem skillLevelData = Global.gApp.gGameData.SkillDataConfig.Get(skillLevel);
            //float addParam = (skillLevelData == null) ? 1f : skillLevelData.skill_exspeed[0];
            float addParam = 1.0f + 0.2f * (m_WeaponMgr.GetCombatAttrValue(CombatAttr.CombatAttrType.MoveSpeed) /
                                            (m_WeaponMgr.GetCombatAttrValue(CombatAttr.CombatAttrType.MoveSpeed) + 5.0f *
                                             PlayerDataMgr.singleton.GetPlayerLevel() + 1.0f));

            m_Speed *= addParam;

            Debug.Log("m_Speed " + m_Speed);

            m_GoldRate = 1.0f + m_WeaponMgr.GetCombatAttrValue(Game.CombatAttr.CombatAttrType.Gold_Add);

            Debug.Log("m_GoldRate " + m_GoldRate);
            //m_EnableVIT = (Global.gApp.CurScene.GetPassData().enableVIT != 0);
            //if (m_EnableVIT)
            //{
            //    m_BuffMgr.AddBuff(BuffType.PlayerEnergy, 10, 10);
            //}
            m_InNormalScene = Global.gApp.CurScene.IsNormalPass();
            if (m_InNormalScene)
            {
                m_WeaponMgr.SetCurMainWeaponEnabled(false);
                //m_PetMgr.ChangePet(Global.gApp.gSystemMgr.GetWeaponMgr().GetCurPet());
            }
            //if (m_InitCar != null)
            //{
            //    GameObject CarNode = Global.gApp.gResMgr.InstantiateObj(m_InitCar);
            //    SetCarrier(CarNode, 999999999, 6);
            //}
            SetSafe(true, false);

            //m_Damage = 25 * (1 + 0.25f) ^ (怪攻击等级 - 1);
            MonsterDamage = Mathf.Ceil(25 * Mathf.Pow((1 + 0.25f), (PlayerDataMgr.singleton.StageAtkLevel - 1)));


            Global.gApp.gMsgDispatcher.Broadcast <int, Transform>(MsgIds.AddPlayerHpUi, 0, HPNode);
        }
Example #7
0
 public void Init(GameObject hitMonster, double damage)
 {
     m_BouncedGo.Add(hitMonster);
     transform.SetParent(Global.gApp.gBulletNode.transform, false);
     m_LockPos        = hitMonster.transform.position;
     m_BounceTimes    = BounceTimes;
     m_BounceRangeSqr = BounceRange * BounceRange;
     m_StartObj       = hitMonster;
     m_WaveMgr        = Global.gApp.CurScene.GetWaveMgr();
     m_Damage         = damage * Damping;
     InitBulletEffect(hitMonster.transform);
     FindNextLink();
 }
Example #8
0
        private void AddRangeHp()
        {
            WaveMgr mgr = m_Player.GetComponent <Player>().GetWaveMgr();
            Dictionary <int, Wave> waves = mgr.GetWaves();
            Vector3 curPos = transform.position;

            foreach (KeyValuePair <int, Wave> kv in waves)
            {
                List <Monster> monsters = kv.Value.GetMonsters();
                foreach (Monster monster in monsters)
                {
                    if ((monster.transform.position - curPos).sqrMagnitude < m_SqrTriggerRange)
                    {
                        monster.AddBuff(AiBuffType.MoveSpeed, EffectTime, IncreaseSpeedPercentage / 100.0f);
                    }
                }
            }
            GameObject effect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Skill01_2021_1);

            effect.transform.position = transform.position;
        }
Example #9
0
        public Fight(Player player)
        {
            m_FootEffectNode = player.transform.Find("ModelNode/FootEffect");
            m_GndNode        = player.transform.Find("GndNode");
            m_WeaponMgr      = player.GetWeaponMgr();
            m_WaveMgr        = player.GetWaveMgr();
            m_Carrier        = player.GetCarrier();
            m_Transform      = player.transform;
            m_Player         = player;
            m_Anim           = m_Player.transform.Find("ModelNode/hero").GetComponent <Animator>();
            PlayAnim(GameConstVal.Idle, GameConstVal.Idle);
            m_RadiusSqr = m_Radius * m_Radius;

            GameObject lockEffect = Global.gApp.gResMgr.InstantiateObj("Prefabs/Effect/common/chooseenemy");

            m_LockEnemyEffect = lockEffect.GetComponent <FollowEnemy>();
            lockEffect.transform.SetParent(Global.gApp.gRoleNode.transform, false);
            m_InNormalPassType = Global.gApp.CurScene.IsNormalPass();
            m_PassType         = Global.gApp.CurScene.GetSceneType();
            AdaptFireAngle();
        }
Example #10
0
        private void AddRangeHp()
        {
            WaveMgr mgr = m_Player.GetComponent <Player>().GetWaveMgr();
            Dictionary <int, Wave> waves = mgr.GetWaves();
            Vector3 curPos = transform.position;

            foreach (KeyValuePair <int, Wave> kv in waves)
            {
                List <Monster> monsters = kv.Value.GetMonsters();
                foreach (Monster monster in monsters)
                {
                    if ((monster.transform.position - curPos).sqrMagnitude < m_SqrTriggerRange)
                    {
                        monster.AddHpByPercent(HpPercentage / 100);
                        GameObject hpEffect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Skill01_2018_2);
                        hpEffect.transform.SetParent(monster.GetBodyNode(), false);
                    }
                }
            }
            GameObject effect = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Skill01_2018_1);

            effect.transform.position = transform.position;
        }
Example #11
0
 public DynamicCalMst(WaveMgr waveMgr)
 {
     m_WaveMgr = waveMgr;
     m_WaveMgr.MaxCreateCount = 100;
 }
Example #12
0
        public override void Init()
        {
            base.Init();
            CreateColliderMap();
            m_PlayerMgr = new PlayerMgr();
            CreateMainPlayer();

            if (m_SceneType == SceneType.NormalScene)
            {
                Global.gApp.gCamCompt.GetComponentInChildren <MoveToBoss>().Reset();
                base.InitCamera("Prefabs/MapData/Camera/MainCamera");
                QualitySettings.shadowDistance = 35;
                InitBornNodeInfo();
                AddTipNpc(40);
            }
            else if (m_SceneType == SceneType.CarScene)
            {
                Global.gApp.gCamCompt.transform.position = Vector3.zero;
                Global.gApp.gCamCompt.GetComponentInChildren <MoveToBoss>().Reset();
                Global.gApp.gCamCompt.enabled = false;
                base.InitCamera("Prefabs/MapData/Camera/CarCamera2");
                QualitySettings.shadowDistance = 50;
            }
            else
            {
                Global.gApp.gCamCompt.GetComponentInChildren <MoveToBoss>().Reset();
                QualitySettings.shadowDistance           = 50;
                Global.gApp.gCamCompt.transform.position = Vector3.zero;
                Global.gApp.gCamCompt.enabled            = false;
                base.InitCamera("Prefabs/MapData/Camera/CarCamera3");
            }
            Global.gApp.gUiMgr.OpenPanel(Wndid.FightPanel);
            Global.gApp.gUiMgr.OpenPanel(Wndid.RewardEffectUi);
            m_PropMgr = new PropMgr();

            m_WaveMgr = new WaveMgr(m_PassData, m_MainPlayer);
            // lastInit
            m_TaskModeMgr = new TaskModeMgr(m_MapGo.transform, m_MainPlayer, m_PassData);

            m_TaskModeMgr.BeginTask();
            //m_GamePlay.Init(m_PassData, this, m_MapGo,m_MainPlayer.transform);
            //m_GamePlay.BroadMsg();


            DarkEffect de = m_MainCamera.GetComponent <DarkEffect>();

            if (de != null)
            {
                de.enabled = (m_PassData.limitView != 0);
                if (de.enabled)
                {
                    Global.gApp.gMsgDispatcher.Broadcast <GameObject, bool, int>(MsgIds.FocusGameObject, m_MainPlayer, true, 355);
                }
            }

            if (m_PassData.enableVIT != 0)
            {
                Global.gApp.gMsgDispatcher.Broadcast <string, string, float>(MsgIds.AddFightUICountItem, "PlayerEnergyProp", "PlayerEnergyProp", 10);
            }
            if (m_SceneType != SceneType.CarScene)
            {
                Global.gApp.gGameCtrl.EffectCache.CacheEffect(EffectConfig.DeadEffect, 20);
            }
            else
            {
                Global.gApp.gGameCtrl.EffectCache.CacheEffect(EffectConfig.DeadEffect, 5);
                Global.gApp.gGameCtrl.EffectCache.CacheEffect(EffectConfig.DeadEffect1, 20);
            }
            InitSpecialSceneSpeed();
        }
 public override void Init(GameObject playerGo, BasePet pet)
 {
     base.Init(playerGo, pet);
     m_SqrDisThreadHold = DisThreadHold * DisThreadHold;
     m_WaveMgr          = m_PlayerGo.GetComponent <Player>().GetWaveMgr();
 }