示例#1
0
    IEnumerator InitBuffBaseData()
    {
        JsonData json = null;

        if (buffBaseDataDic == null)
        {
            buffBaseDataDic = new Dictionary <string, BuffBaseData>();
        }

        buffBaseDataDic.Clear();

        yield return(StartCoroutine(AssetLoader.LoadJsonData("data/buff", "Buff", x => json = x)));

        for (int i = 0; i < json.Count; i++)
        {
            BuffBaseData buffBaseData = new BuffBaseData(json[i]);
            buffBaseDataDic.Add(buffBaseData.id, buffBaseData);
        }


        ArtifactBaseDataDic = new Dictionary <string, ArtifactBaseData>();
        yield return(StartCoroutine(AssetLoader.LoadJsonData("json", "Artifact", x => json = x)));

        for (int i = 0; i < json.Count; i++)
        {
            ArtifactBaseData data = new ArtifactBaseData(json[i]);
            ArtifactBaseDataDic.Add(data.id, data);
        }
    }
示例#2
0
	public void OffBuffSlot()
	{
		DeleteIcon();
		m_BaseData = null;
		CloseTooltip();
		timeText.Text = string.Empty;
		if( null != buffTooltip)
			buffTooltip.gameObject.active = false;
		timeText.gameObject.active = false;
	}
示例#3
0
	public void Open(BuffBaseData _data )
	{		
		List<Tbl_Skill_Potency> pntencyList = null;
		bool isMonsterSkill = false;
		if( true == BuffBaseMgr.IsMonsterSkillIndex( _data.GetSkillIdx() ) )
		{
			Tbl_MonsterSkill_Record skillRecord = AsTableManager.Instance.GetTbl_MonsterSkill_Record( _data.GetSkillIdx() );
			if( null == skillRecord )
			{
				Debug.LogError("BuffTooltip::Open()[ null == Tbl_MonsterSkill_Record ] id : " + _data.GetSkillIdx() );
				return;
			}
			
			pntencyList = skillRecord.listSkillPotency;
			isMonsterSkill = true;
		}
		else
		{
			Tbl_Skill_Record skillRecord = AsTableManager.Instance.GetTbl_Skill_Record( _data.GetSkillIdx() );
			if( null == skillRecord )
			{
				Debug.LogError("BuffTooltip::Open()[ null == Tbl_Skill_Record ] id : " + _data.GetSkillIdx() );
				return;
			}
			
			pntencyList = skillRecord.listSkillPotency;
			isMonsterSkill = false;
		}		
		
		if( null == pntencyList )
			return;
		
		
		if( pntencyList.Count <= _data.GetPotencyIdx() )
		{
			Debug.LogError("BuffTooltip::Open()[skillRecord.listSkillPotency.Count <= _data.GetPotencyIdx()] count : " + _data.GetPotencyIdx() );
			return;
		}
		
		Tbl_Skill_Potency skillPotency = pntencyList[_data.GetPotencyIdx()];
		
		string szDesc = AsTableManager.Instance.GetTbl_String( skillPotency.Potency_BuffTooltip);
		if( true == isMonsterSkill )
		{
			txtText.Text = AsUtil.ModifyMonsterDescriptionInTooltip( szDesc, _data.GetSkillIdx(), _data.GetSkillLevel(), _data.GetPotencyIdx() );
		}
		else
		{
			txtText.Text = AsUtil.ModifyDescriptionInTooltip( szDesc, _data.GetSkillIdx(), _data.GetSkillLevel(), _data.GetPotencyIdx() );
		}
		
		
		
		CreateIcon( skillPotency.Potency_BuffIcon );
	}
示例#4
0
	//---------------------------------------------------------------------
	/* Public function*/
	//---------------------------------------------------------------------
	
	public void OpenBuffSlot( BuffBaseData _buffData)
	{
		if( null == _buffData)
		{
			AsUtil.ShutDown( "UIBuffSlot::OpenBuffSlot()[ null == BuffBaseData ]");
			return;
		}
		
		m_BaseData = _buffData;
		
		timeText.gameObject.active = true;
		if( null != buffTooltip)
			buffTooltip.gameObject.active = true;
		CreateIcon( m_BaseData.getIconPath);
	}
示例#5
0
    public Buff AttachBuff(BattleUnit buffOwner, string buffID, int stack = 1, Buff refBuff = null)
    {
        //버프 아이디 없거나, 정의되지 않았으면 버프 적용 안 함
        if (string.IsNullOrEmpty(buffID) || !GameDataManager.buffBaseDataDic.ContainsKey(buffID))
        {
            Debug.LogWarning("[BuffManager]Invalid buff id : " + buffID);
            return(null);
        }

        BuffBaseData buffBaseData = GameDataManager.buffBaseDataDic[buffID];

        if (buffBaseData == null)
        {
            return(null);
        }


        //---------------------------------------------------------
        //이미 적용 중인 버프일 경우
        Buff buff = null;

        if (buffBaseData.isUnique)
        {
            buff = buffList.Find(x => x.id == buffID && x.target == owner);
        }
        else
        {
            buff = buffList.Find(x => x.id == buffID && x.target == owner && x.owner == buffOwner);
        }

        if (buff == null)
        {
            buff = GetBuffFromPool(buffID);
        }

        if (buff == null)
        {
            return(null);
        }

        // maxStack일 경우 더 이상 접근하지 않는다.
        if (buff.baseData != null && buff.stack == buff.baseData.maxStackCount)
        {
            return(null);
        }
        //Debug.Log("버프 적용 : " + buffOwner.heroData.heroName + " / " + buffID);

        //버프 적용 or 갱신
        buff.Init(buffOwner, owner, buffID, stack, refBuff);

        //if(buff.baseData.id.Equals("Buff_Vampire_Passive3"))
        //{
        //    if (owner.skillList.Find(x => x.skillData.id == "Skill_Vampire_NormalAttack"))
        //    {
        //        owner.skillList.Find(x => x.skillData.id == "Skill_Vampire_NormalAttack").skillData.maxTargetCount = 3;
        //    }
        //}

        if (buffList.Count > 0 && owner.buffController.buffList.Find(x => x.baseData.effect == "ImmuneCC") != null && (buff.baseData.blockMove || buff.baseData.blockAttack || buff.baseData.airborne))
        {
            if (owner.onHit != null)
            {
                owner.onHit(0d, "ImmuneDamage");
            }

            return(null);
        }

        //버프 적용될 때 효과
        if (buff.attachBehavior != null)
        {
            buff.attachBehavior.ApplyEffect();
        }

        //지속시간 적용
        if (buff.baseData.duration > 0f)
        {
            if (buff.coroutineDuration != null)
            {
                StopCoroutine(buff.coroutineDuration);
                buff.coroutineDuration = null;
            }

            buff.coroutineDuration = StartCoroutine(ApplyDuration(buff));
        }

        //이동 불가, 공격 불가
        if (buff.baseData.blockMove)
        {
            owner.isBlockMove = true;
        }

        if (buff.baseData.blockAttack)
        {
            owner.isBlockAttack = true;
        }

        //공중에 뜸
        if (buff.baseData.airborne)
        {
            owner.airborne = true;
        }


        //타게팅 방어 효과
        if (buff.baseData.notTargeting)
        {
            owner.notTargeting = true;
        }

        return(buff);
    }