2024-12-04 02:09:23 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public enum DamageType
|
|
|
|
|
{
|
2024-12-05 16:25:46 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
physicalDamage,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ħ<><C4A7><EFBFBD>˺<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
magicDamage,
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
noAttributeDamage,
|
2024-12-04 02:09:23 +08:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class BUff
|
|
|
|
|
{
|
|
|
|
|
public float timeLeft = 0;//ʣ<><CAA3>ʱ<EFBFBD><CAB1>
|
|
|
|
|
public float executionInterval = 0;//buffִ<66>м<EFBFBD><D0BC><EFBFBD>
|
|
|
|
|
public float executionInterval_max = 100;//buffִ<66>м<EFBFBD><D0BC><EFBFBD>
|
|
|
|
|
public Action<object[]> Funaction;//<2F><><EFBFBD>õĺ<C3B5><C4BA><EFBFBD>
|
|
|
|
|
public object[] value;//<2F><><EFBFBD>ú<EFBFBD><C3BA><EFBFBD><EFBFBD><EFBFBD>ֵ
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class Fun : Base
|
|
|
|
|
{
|
2024-12-12 17:06:08 +08:00
|
|
|
|
|
2024-12-04 02:09:23 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <20>ж<EFBFBD> //Ŀ<><C4BF> // <20>Լ<EFBFBD>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="objects"></param>
|
|
|
|
|
public void poisoning(object[] objects)
|
|
|
|
|
{
|
2024-12-04 05:50:39 +08:00
|
|
|
|
Role targetAudience = (Role)objects[0];
|
|
|
|
|
Role myPalye = (Role)objects[1];
|
2024-12-04 02:09:23 +08:00
|
|
|
|
Debug.Log("<22><><EFBFBD><EFBFBD><EFBFBD>ж<EFBFBD>");
|
|
|
|
|
Debug.Log(myPalye.name);
|
|
|
|
|
}
|
2024-12-12 17:06:08 +08:00
|
|
|
|
|
|
|
|
|
|
2024-12-04 02:09:23 +08:00
|
|
|
|
/// <summary>
|
2024-12-18 20:43:54 +08:00
|
|
|
|
/// <20><>Ѫ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŀ<><C4BF>,<2C>˺<EFBFBD>ֵ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ʹ<><CAB9><EFBFBD>ߣ<EFBFBD><DFA3>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><30><EFBFBD>ұߣ<D2B1>1<EFBFBD><31><EFBFBD><EFBFBD><EFBFBD>ߣ<EFBFBD>
|
2024-12-04 02:09:23 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="objects"></param>
|
2024-12-18 20:43:54 +08:00
|
|
|
|
public void bloodLoss(object[] objects,int direction=1)//Ŀ<><C4BF>,<2C>˺<EFBFBD>ֵ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,ʹ<><CAB9><EFBFBD><EFBFBD>,<2C>ӵ<EFBFBD><D3B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
|
2024-12-04 02:09:23 +08:00
|
|
|
|
{
|
2024-12-04 05:50:39 +08:00
|
|
|
|
Role targetAudience = (Role)objects[0];
|
2024-12-04 02:09:23 +08:00
|
|
|
|
float harm = (float)objects[1];
|
|
|
|
|
DamageType damageType = (DamageType)objects[2];
|
2024-12-04 05:50:39 +08:00
|
|
|
|
Role UserObj = (Role)objects[3];
|
2024-12-18 20:43:54 +08:00
|
|
|
|
|
2024-12-19 19:01:39 +08:00
|
|
|
|
|
2024-12-04 02:09:23 +08:00
|
|
|
|
|
|
|
|
|
float finalDamage = harm;
|
|
|
|
|
switch (damageType)
|
|
|
|
|
{
|
|
|
|
|
case DamageType.physicalDamage://<2F><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>
|
|
|
|
|
finalDamage -= targetAudience.physicalArmor;
|
|
|
|
|
break;
|
|
|
|
|
case DamageType.magicDamage://ħ<><C4A7><EFBFBD>˺<EFBFBD>
|
|
|
|
|
finalDamage -= targetAudience.magicArmor;
|
|
|
|
|
break;
|
|
|
|
|
case DamageType.noAttributeDamage://<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>
|
|
|
|
|
finalDamage -= 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (finalDamage < 0)
|
|
|
|
|
{
|
|
|
|
|
finalDamage = 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
targetAudience.Hp -= finalDamage;
|
2024-12-18 20:43:54 +08:00
|
|
|
|
targetAudience.HurtDirectin = direction;
|
2024-12-04 02:09:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|