Esempio n. 1
0
    private void CreateTargetArea()
    {
        _targetAreaObject = ResourceHelper.Load(AppConfig.FOLDER_PROFAB + "skill/TargetArea");

//		InstanceSkill skill = _game.gameSkill.GetCurrentSelectSkill();
        DataSkill dataSkill = _firingSkill.GetDataSkill();

        float scale = dataSkill.hintRange * 2.0f;

        _targetAreaObject.transform.localScale = new Vector3(scale, 1.0f, scale);

        _targetAreaObject.transform.position = _worldPosition;
    }
Esempio n. 2
0
        /// <summary>
        /// 初始化技能配置类数据
        /// </summary>
        /// <returns></returns>
        public bool Init()
        {
            DataSkill dataSkill = GameData <DataSkill> .dataMap[this.m_unskillId];

            if (dataSkill != null)
            {
                this.m_skillConfig = dataSkill;
                return(true);
            }
            else
            {
                this.m_log.Error("m_skillConfig == null,skillId:" + this.m_unskillId);
                return(false);
            }
        }
Esempio n. 3
0
 public void LoadDynamicData()
 {
     this.stuff             = DataStuff.GetStuff();
     this.location          = DataLocations.GetLocations();
     this.actor             = DataActors.GetActors();
     this.lessons.Lesson    = DataLesson.GetLessons();
     this.skills.Skill      = DataSkill.GetSkills();
     this.variables         = new Dictionary <String, dynamic>();
     this.variables_timeout = new Dictionary <String, DateTime>();
     this.player            = DataPlayer.CreatePlayer(this.stuff, lessons, skills);
     this.time = new GameTime()
     {
         time = new DateTime(2011, 9, 1, 7, 0, 0)
     };
     Actor.CurrentTime = time;
 }
Esempio n. 4
0
    /// <summary>
    /// 更新数据
    /// </summary>
    public void UpdateData(int index)
    {
        _currentIndex = index;
        _gameSkill    = BattleGame.instance.gameSkill;
        _skillData    = _gameSkill.GetData(_currentIndex);
        if (_skillData != null)
        {
//			NGUITools.SetActive(this.icon.gameObject, true);
            this._sillName.text        = _skillData.name;
            this._skillIcon.spriteName = "SkillICONS_" + (int)_skillData.type;
        }
        else
        {
            this._sillName.text = "";
//			NGUITools.SetActive(this.icon.gameObject, false);
        }
    }
Esempio n. 5
0
    public void Load(string name)
    {
        byte[] bin     = DynamicFileControl.QueryFileContent(name);
        string content = StringHelper.ReadFromBytes(bin);

        LitJson.JSONNode json = LitJson.JSON.Parse(content);

        _hashMap = new Dictionary <int, DataSkill> ();

        foreach (LitJson.JSONNode subNode in json.Childs)
        {
            DataSkill skill = new DataSkill();
            skill.Load(subNode);

            int hash = GetHash(skill.type, skill.level);
            _hashMap.Add(hash, skill);
        }
    }
Esempio n. 6
0
 /// <summary>
 /// 技能释放中
 /// </summary>
 /// <param name="castSkillParam"></param>
 public virtual void Cast(CastSkillParam castSkillParam)
 {
     DataSkill skillData = GameData <DataSkill> .dataMap[castSkillParam.unTargetSkillID];
     Beast     beast     = Singleton <BeastManager> .singleton.GetBeastById(castSkillParam.m_unMasterBeastId);
 }
 public SkillGameData(int unSkillId)
 {
     this.m_unSkillId   = unSkillId;
     this.m_skillConfig = GameData <DataSkill> .dataMap[unSkillId];
     this.m_bIsError    = false;
 }
Esempio n. 8
0
    public Beast(BeastData beastData)
    {
        if (null == beastData)
        {
            this.m_bIsErrorBeast  = true;
            this.m_skillManager   = new SkillGameManager(0);
            this.m_actWorkManager = new ActWorkManager();
        }
        else
        {
            this.m_bIsErrorBeast = false;
            DataBeastlist dataBeast = null;
            GameData <DataBeastlist> .dataMap.TryGetValue(beastData.BeastTypeId, out dataBeast);

            if (dataBeast != null)
            {
                this.MaxMoveDis = dataBeast.Move;
                this.Hp         = dataBeast.Hp;
                if (dataBeast.Skill_1 > 0)
                {
                    this.m_listBeastOriginActivedSkillID.Add(dataBeast.Skill_1);
                }
                if (dataBeast.Skill_2 > 0)
                {
                    this.m_listBeastOriginActivedSkillID.Add(dataBeast.Skill_2);
                }
                if (dataBeast.Skill_3 > 0)
                {
                    this.m_listBeastOriginActivedSkillID.Add(dataBeast.Skill_3);
                }
                if (dataBeast.Skill_4 > 0)
                {
                    this.m_listBeastOriginActivedSkillID.Add(dataBeast.Skill_4);
                }
            }
            else
            {
                this.m_log.Error(string.Format("null == beastConfig: beastData.BeastTypeId=:{0}", beastData.BeastTypeId));
            }
            this.m_unBeastId      = beastData.Id;
            this.m_unPlayerId     = beastData.PlayerId;
            this.m_dwBeastTypeId  = beastData.BeastTypeId;
            this.m_eCampType      = beastData.CampType;
            this.m_unHp           = beastData.Hp;
            this.m_suitId         = beastData.SuitId;
            this.m_skillManager   = new SkillGameManager(this.m_unBeastId);
            this.m_actWorkManager = new ActWorkManager();
            this.m_skillManager.AddSkill(1, false);
            foreach (var skillData in beastData.Skills)
            {
                this.m_skillManager.AddSkill(skillData, false, ESkillActivateType.SKILL_ACTIVATE_TYPE_INVALID);
            }
        }
        DataSkill data = GameData <DataSkill> .dataMap[1];

        if (data != null)
        {
            int MaxAttackDis = data.UseDis;
            this.m_nMaxAttackDis = MaxAttackDis;
        }
        else
        {
            m_log.Error("找不到该技能的配置文件,SKillID:" + 1);
        }
    }
Esempio n. 9
0
    void UpdataUI()
    {
        if (_heroData != null)
        {
            _iconBg.spriteName = _heroData.IconBgName;
            _icon_Texture.SetHeroSmallTexture(_heroData.id);
            switch (_heroData.team)
            {
            case HeroDataManager.TEAM.NOTEAM:
                _formation_sprite.gameObject.SetActive(false);
                break;

            case HeroDataManager.TEAM.FIRSTTEAM:
                _formation_sprite.gameObject.SetActive(true);
                _formation_sprite.spriteName = "heroTeam_" + (int)_heroData.team;
                break;

            case HeroDataManager.TEAM.SECONDTEAM:
                _formation_sprite.gameObject.SetActive(true);
                _formation_sprite.spriteName = "heroTeam_" + (int)_heroData.team;
                break;

            case HeroDataManager.TEAM.THIRDTEAM:
                _formation_sprite.gameObject.SetActive(true);
                _formation_sprite.spriteName = "heroTeam_" + (int)_heroData.team;
                break;
            }
            _type_Sprite.spriteName = "arms_" + (int)_heroData.heroType;
            _heroName_Label.color   = _heroData.nameColor;
            _heroName_Label.text    = _heroData.data.name;
            int             exp             = 0;
            Model_HeroGroup model_heroGroup = InstancePlayer.instance.model_User.model_heroGroup;
            if (_heroData.recruitType == HeroDataManager.RecruitType.ALREADYRECRUIT)
            {
                Hero hero = model_heroGroup.GetHero(_heroData.id);
                exp = hero.exp;
                _manager_Btn.gameObject.SetActive(true);
                _upLevel_Btn.gameObject.SetActive(true);
                _heroLevel_Label.gameObject.SetActive(true);
                _heroLevel_Label.text = model_heroGroup.GetCurrentLevel(_heroData.id).ToString();
                _rank_sprite.gameObject.SetActive(true);
                _rank_sprite.spriteName = UICommon.HERO_RANK_ICON_PATH + model_heroGroup.GetCurrentStage(_heroData.id);
                DataHero dataHero = DataManager.instance.dataHeroGroup.GetHero(_heroData.id, hero.exp, hero.stage);
                //hp
                _attributeValue_Label_1.text = ((int)dataHero.basicParam.hp).ToString();
                //ap
                _attributeValue_Label_2.text = ((int)dataHero.basicParam.damage).ToString();
                //dp
                _attributeValue_Label_3.text = ((int)dataHero.basicParam.ammo).ToString();
                //hitRate
                float  hitDodDou     = 0.0f;
                string hitDodDouDesc = "";
                if (dataHero.basicParam.hitRate != 0.0f)
                {
                    hitDodDouDesc = "命中";
                    hitDodDou     = dataHero.basicParam.hitRate;
                }
                if (dataHero.basicParam.dodgeRate != 0.0f)
                {
                    hitDodDouDesc = "闪避";
                    hitDodDou     = dataHero.basicParam.dodgeRate;
                }
                if (dataHero.basicParam.doubleDamageRate != 0.0f)
                {
                    hitDodDouDesc = "暴击";
                    hitDodDou     = dataHero.basicParam.doubleDamageRate;
                }
                if (hitDodDou != 0.0f)
                {
                    _attribute_Label_4.gameObject.SetActive(true);
                    _attributeValue_Label_4.text = hitDodDou.ToString();
                }
                else
                {
                    _attribute_Label_4.gameObject.SetActive(false);
                }
            }
            else
            {
                _manager_Btn.gameObject.SetActive(false);
                _upLevel_Btn.gameObject.SetActive(false);
                exp = _heroData.exp;
                _heroLevel_Label.gameObject.SetActive(false);
                _rank_sprite.gameObject.SetActive(false);
                //hp
                _attributeValue_Label_1.text = ((int)_heroData.data.basicParam.hp).ToString();
                //ap
                _attributeValue_Label_2.text = ((int)_heroData.data.basicParam.damage).ToString();
                //dp
                _attributeValue_Label_3.text = ((int)_heroData.data.basicParam.ammo).ToString();
                //hitRate
                _attribute_Label_4.gameObject.SetActive(false);
                _attributeValue_Label_4.text = (_heroData.data.basicParam.hitRate).ToString();
            }

            float heroExpToNextLevel      = (float)DataManager.instance.dataHeroGroup.GetHeroExpToNextLevel(_heroData.id, exp);
            float heroTotalExpToNextLevel = (float)DataManager.instance.dataHeroGroup.GetHeroTotalExpToNextLevel(_heroData.id, exp);
            if (heroExpToNextLevel == 0 || heroTotalExpToNextLevel == 0)
            {
                _expLabel.text = "军官已满级";
            }
            {
                _Timer_Colored_Slider.value = (heroTotalExpToNextLevel - heroExpToNextLevel) / heroTotalExpToNextLevel;
                _expLabel.text = (heroTotalExpToNextLevel - heroExpToNextLevel) + "/" + heroTotalExpToNextLevel;
            }

            DataHeroLeadership heroLeaderData = DataManager.instance.dataHeroGroup.GetHeroLeadership(_heroData.id);
            DataSkill          skillData      = DataManager.instance.dataSkillGroup.GetSkill(heroLeaderData.skill, 1);
            _skillName.text       = skillData.name;
            _skillIcon.spriteName = "SkillICONS_" + (int)heroLeaderData.skill;
//			_skillAttribute_Label.text = skillData.


            _ability_Label_1.text = "坦克" + ((int)(heroLeaderData.kTank * 100)).ToString() + "%";
            _ability_Label_2.text = "导弹" + "\n" + ((int)(heroLeaderData.kMissile * 100)).ToString() + "%";
            _ability_Label_3.text = "反坦" + ((int)(heroLeaderData.kUnknown * 100)).ToString() + "%";
            _ability_Label_4.text = "装甲" + ((int)(heroLeaderData.kGun * 100)).ToString() + "%";
            _ability_Label_5.text = "火炮" + "\n" + ((int)(heroLeaderData.kCannon * 100)).ToString() + "%";
        }
    }
    IEnumerator createBombs()
    {
        DataSkill dataSkill = _skill.GetDataSkill();
        float     range     = dataSkill.hintRange;

        List <Vector3> offsets = new List <Vector3> ();
        int            n       = COUNT;

        for (int i = 0; i < n; ++i)
        {
            float theta  = RandomHelper.Range01();
            float radius = Mathf.Sqrt(RandomHelper.Range01() * RandomHelper.Range01()) * range;

            float   x = radius * Mathf.Cos(2 * Mathf.PI * theta);
            float   z = radius * Mathf.Sin(2 * Mathf.PI * theta);
            Vector3 v = new Vector3(x, 0, z);

            offsets.Add(v);
        }

        /*
         * Vector3[] dropPositionOffsets = new Vector3[]{
         *
         *      new Vector3 (-range * 0.8f, 0, range * 0.2f),
         *      new Vector3 (-range * 0.8f, 0, -range * 0.2f),
         *      new Vector3 (0, -1000, 0),
         *
         *      new Vector3 (-range * 0.4f, 0, range * 0.4f),
         *      new Vector3 (-range * 0.4f, 0, 0),
         *      new Vector3 (-range * 0.4f, 0, -range * 0.4f),
         *      new Vector3 (0, -1000, 0),
         *
         *      new Vector3 (0, 0, +range * 0.6f),
         *      new Vector3 (0, 0, +range * 0.2f),
         *      new Vector3 (0, 0, -range * 0.2f),
         *      new Vector3 (0, 0, -range * 0.6f),
         *      new Vector3 (0, -1000, 0),
         *
         *      new Vector3 (range * 0.4f, 0, range * 0.4f),
         *      new Vector3 (range * 0.4f, 0, 0),
         *      new Vector3 (range * 0.4f, 0, -range * 0.4f),
         *      new Vector3 (0, -1000, 0),
         *
         *      new Vector3 (range * 0.8f, 0, range * 0.2f),
         *      new Vector3 (range * 0.8f, 0, -range * 0.2f),
         *      new Vector3 (0, -1000, 0),
         *
         * };
         */

        for (int i = 0; i < offsets.Count; i++)
        {
            Vector3 offset = offsets[i];

            GameObject bomoObject = ResourceHelper.Load(AppConfig.FOLDER_PROFAB + "skill/BombAirStrike");
            BattleFactory.AddUnitToLayer(bomoObject, BattleConfig.LAYER.BULLET);

            SkillBombBase bomb = bomoObject.GetComponent <SkillBombBase>();
            bomb.Init(_skill, _targetPosition + offset);

            spawnBombs.Add(bomb);

            yield return(new WaitForSeconds(DROP_INTERVAL));

            /*
             * if(offset.y < 0)
             * {
             *      yield return new WaitForSeconds(DROP_INTERVAL_LONG);
             * }
             * else
             * {
             *      yield return new WaitForSeconds(DROP_INTERVAL_SHORT);
             * }
             */
        }

        _isStart = true;
    }