2025-05-18 01:04:31 +08:00

91 lines
1.7 KiB
C#

// ***********************************************************************
// Assembly : Game
// Author : Kimch
// Created : 2021-03-25
// Description :
// Last Modified By :
// Last Modified On :
// ***********************************************************************
// <copyright file= "Cha_Buff" company="Kunpo"></copyright>
// <summary></summary>
// ***********************************************************************
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace G
{
/// <summary>
/// 角色buff逻辑
/// </summary>
public class Cha_Buff : MonoBehaviour
{
public class BuffInfo
{
public int id;
public int[] args;
}
#region Field
/// <summary>
///
/// </summary>
EntityMainPlayer _scriptCha;
#endregion
#region Method
/// <summary>
/// 增加buff
/// </summary>
/// <param name="id"></param>
/// <param name="args"></param>
public void AddBuff(int id, int[] args)
{
var buff = ItemProxy.Instance.GetStaticItem<ItemBuff>(id);
if (buff != null)
{
if (buff.kind == 1)
{
_scriptCha.AttributeUp(buff.kindArgs[0], buff.kindArgs[1], 0);
}
else if (buff.kind == 2)
{
_scriptCha.AttributeUp(buff.kindArgs[0], 0, buff.kindArgs[1]);
}
else if (buff.kind == 3)//
{
var sf = buff.kindArgs[0];
if (sf == 1)
{
_scriptCha.HpUp(buff.kindArgs[1], 0);
}
}
//特殊类型百分比
else if (buff.kind == 4)//
{
var sf = buff.kindArgs[0];
if (sf == 1)
{
_scriptCha.HpUp(0, buff.kindArgs[1]);
}
}
}
}
#endregion
#region Unity
private void Awake()
{
_scriptCha = GetComponent<EntityMainPlayer>();
}
#endregion
}
}