chore: initialize OshimaBot repository (rename from Enhancement)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class CHAOS : Character
|
||||
{
|
||||
public CHAOS() : base()
|
||||
{
|
||||
Id = 16;
|
||||
Name = "CHAO";
|
||||
FirstName = "SHI";
|
||||
NickName = "超市";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 27;
|
||||
InitialHP = 100;
|
||||
InitialMP = 40;
|
||||
InitialSTR = 14;
|
||||
STRGrowth = 1.8;
|
||||
InitialAGI = 12;
|
||||
AGIGrowth = 1.1;
|
||||
InitialINT = 4;
|
||||
INTGrowth = 0.1;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class ColdBlue : Character
|
||||
{
|
||||
public ColdBlue() : base()
|
||||
{
|
||||
Id = 10;
|
||||
Name = "Cold";
|
||||
FirstName = "Blue";
|
||||
NickName = "冷蓝";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 28;
|
||||
InitialHP = 95;
|
||||
InitialMP = 25;
|
||||
InitialSTR = 22;
|
||||
STRGrowth = 1.9;
|
||||
InitialAGI = 4;
|
||||
AGIGrowth = 0.6;
|
||||
InitialINT = 4;
|
||||
INTGrowth = 0.6;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class CustomCharacter : Character
|
||||
{
|
||||
public CustomCharacter(long user_id, string name, string firstname = "", string nickname = "", PrimaryAttribute primaryAttribute = PrimaryAttribute.None) : base()
|
||||
{
|
||||
Id = user_id;
|
||||
Name = name;
|
||||
FirstName = firstname;
|
||||
NickName = nickname;
|
||||
PrimaryAttribute = (PrimaryAttribute)Random.Next(1, 4);
|
||||
InitialATK = Random.Next(15, 26);
|
||||
InitialHP = Random.Next(40, 86);
|
||||
InitialMP = Random.Next(20, 56);
|
||||
|
||||
int reduce = 0;
|
||||
int reduceGrowth = 0;
|
||||
if (primaryAttribute != PrimaryAttribute.None)
|
||||
{
|
||||
int attribute = Random.Next(15, 31);
|
||||
int growth = Random.Next(15, 31);
|
||||
switch (primaryAttribute)
|
||||
{
|
||||
case PrimaryAttribute.STR:
|
||||
InitialSTR = attribute;
|
||||
STRGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
case PrimaryAttribute.AGI:
|
||||
InitialAGI = attribute;
|
||||
AGIGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
case PrimaryAttribute.INT:
|
||||
InitialINT = attribute;
|
||||
INTGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
}
|
||||
PrimaryAttribute = primaryAttribute;
|
||||
reduce = attribute;
|
||||
reduceGrowth = growth;
|
||||
}
|
||||
|
||||
int value = 31 - reduce;
|
||||
int valueGrowth = 31 - reduceGrowth;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
if (value == 0) break;
|
||||
int attribute = i < 2 ? Random.Next(value) : (value - 1);
|
||||
int growth = i < 2 ? Random.Next(0, valueGrowth) : (valueGrowth - 1);
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
if (primaryAttribute == PrimaryAttribute.AGI) continue;
|
||||
InitialAGI = attribute;
|
||||
AGIGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
case 2:
|
||||
if (primaryAttribute == PrimaryAttribute.INT) continue;
|
||||
InitialINT = attribute;
|
||||
INTGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
if (primaryAttribute == PrimaryAttribute.STR) continue;
|
||||
InitialSTR = attribute;
|
||||
STRGrowth = Calculation.Round(Convert.ToDouble(growth) / 10, 2);
|
||||
break;
|
||||
}
|
||||
value -= attribute;
|
||||
valueGrowth -= growth;
|
||||
}
|
||||
InitialSPD = Random.Next(220, 291);
|
||||
InitialHR = Random.Next(1, 6);
|
||||
InitialMR = Random.Next(1, 6);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Dddovo : Character
|
||||
{
|
||||
public Dddovo() : base()
|
||||
{
|
||||
Id = 11;
|
||||
Name = "ddd";
|
||||
FirstName = "ovo";
|
||||
NickName = "绿拱门";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 22;
|
||||
InitialHP = 65;
|
||||
InitialMP = 22;
|
||||
InitialSTR = 10;
|
||||
STRGrowth = 1;
|
||||
InitialAGI = 20;
|
||||
AGIGrowth = 2;
|
||||
InitialINT = 0;
|
||||
INTGrowth = 0;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class DokyoMayor : Character
|
||||
{
|
||||
public DokyoMayor() : base()
|
||||
{
|
||||
Id = 6;
|
||||
Name = "Dokyo";
|
||||
FirstName = "Mayor";
|
||||
NickName = "铎京市长";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 21;
|
||||
InitialHP = 120;
|
||||
InitialMP = 20;
|
||||
InitialSTR = 7;
|
||||
STRGrowth = 1;
|
||||
InitialAGI = 21;
|
||||
AGIGrowth = 1.8;
|
||||
InitialINT = 2;
|
||||
INTGrowth = 0.2;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class MagicalGirl : Character
|
||||
{
|
||||
public MagicalGirl() : base()
|
||||
{
|
||||
Id = 7;
|
||||
Name = "Magical";
|
||||
FirstName = "Girl";
|
||||
NickName = "魔法少女";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 20;
|
||||
InitialHP = 95;
|
||||
InitialMP = 35;
|
||||
InitialSTR = 7;
|
||||
STRGrowth = 0.3;
|
||||
InitialAGI = 15;
|
||||
AGIGrowth = 2.3;
|
||||
InitialINT = 8;
|
||||
INTGrowth = 0.4;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class NanGanYu : Character
|
||||
{
|
||||
public NanGanYu() : base()
|
||||
{
|
||||
Id = 4;
|
||||
Name = "Nan";
|
||||
FirstName = "Ganyu";
|
||||
NickName = "男甘雨";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 17;
|
||||
InitialHP = 115;
|
||||
InitialMP = 80;
|
||||
InitialSTR = 6;
|
||||
STRGrowth = 0.6;
|
||||
InitialAGI = 7;
|
||||
AGIGrowth = 0.7;
|
||||
InitialINT = 17;
|
||||
INTGrowth = 1.7;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Neptune : Character
|
||||
{
|
||||
public Neptune() : base()
|
||||
{
|
||||
Id = 15;
|
||||
Name = "Nep";
|
||||
FirstName = "tune";
|
||||
NickName = "海王星";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 26;
|
||||
InitialHP = 95;
|
||||
InitialMP = 55;
|
||||
InitialSTR = 16;
|
||||
STRGrowth = 1.4;
|
||||
InitialAGI = 7;
|
||||
AGIGrowth = 1;
|
||||
InitialINT = 7;
|
||||
INTGrowth = 0.6;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class NiuNan : Character
|
||||
{
|
||||
public NiuNan() : base()
|
||||
{
|
||||
Id = 5;
|
||||
Name = "Niu";
|
||||
FirstName = "Nan";
|
||||
NickName = "牛腩";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 16;
|
||||
InitialHP = 75;
|
||||
InitialMP = 90;
|
||||
InitialSTR = 0;
|
||||
STRGrowth = 0;
|
||||
InitialAGI = 0;
|
||||
AGIGrowth = 0;
|
||||
InitialINT = 30;
|
||||
INTGrowth = 3;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Organisms
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class OshimaShiya : Character
|
||||
{
|
||||
public OshimaShiya() : base()
|
||||
{
|
||||
Id = 1;
|
||||
Name = "Oshima";
|
||||
FirstName = "Shiya";
|
||||
NickName = "大島シヤ";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 25;
|
||||
InitialHP = 85;
|
||||
InitialMP = 10;
|
||||
InitialSTR = 30;
|
||||
STRGrowth = 3;
|
||||
InitialAGI = 0;
|
||||
AGIGrowth = 0;
|
||||
InitialINT = 0;
|
||||
INTGrowth = 0;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class QWQAQW : Character
|
||||
{
|
||||
public QWQAQW() : base()
|
||||
{
|
||||
Id = 9;
|
||||
Name = "QWQ";
|
||||
FirstName = "AQW";
|
||||
NickName = "LUOLI66";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 18;
|
||||
InitialHP = 100;
|
||||
InitialMP = 45;
|
||||
InitialSTR = 0;
|
||||
STRGrowth = 0;
|
||||
InitialAGI = 15;
|
||||
AGIGrowth = 1.5;
|
||||
InitialINT = 15;
|
||||
INTGrowth = 1.5;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class QingXiang : Character
|
||||
{
|
||||
public QingXiang() : base()
|
||||
{
|
||||
Id = 8;
|
||||
Name = "Qing";
|
||||
FirstName = "Xiang";
|
||||
NickName = "清香";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 26;
|
||||
InitialHP = 110;
|
||||
InitialMP = 80;
|
||||
InitialSTR = 6;
|
||||
STRGrowth = 0.5;
|
||||
InitialAGI = 4;
|
||||
AGIGrowth = 0.5;
|
||||
InitialINT = 20;
|
||||
INTGrowth = 2;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Quduoduo : Character
|
||||
{
|
||||
public Quduoduo() : base()
|
||||
{
|
||||
Id = 12;
|
||||
Name = "Qu";
|
||||
FirstName = "Duoduo";
|
||||
NickName = "趣多多";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 19;
|
||||
InitialHP = 90;
|
||||
InitialMP = 40;
|
||||
InitialSTR = 13;
|
||||
STRGrowth = 1.5;
|
||||
InitialAGI = 13;
|
||||
AGIGrowth = 1.2;
|
||||
InitialINT = 4;
|
||||
INTGrowth = 0.3;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Ryuko : Character
|
||||
{
|
||||
public Ryuko() : base()
|
||||
{
|
||||
Id = 17;
|
||||
Name = "Ryu";
|
||||
FirstName = "ko";
|
||||
NickName = "流";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 22;
|
||||
InitialHP = 100;
|
||||
InitialMP = 45;
|
||||
InitialSTR = 11;
|
||||
STRGrowth = 0.8;
|
||||
InitialAGI = 15;
|
||||
AGIGrowth = 1.9;
|
||||
InitialINT = 4;
|
||||
INTGrowth = 0.3;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class ShiYu : Character
|
||||
{
|
||||
public ShiYu() : base()
|
||||
{
|
||||
Id = 13;
|
||||
Name = "Shi";
|
||||
FirstName = "Yu";
|
||||
NickName = "时雨";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 20;
|
||||
InitialHP = 105;
|
||||
InitialMP = 65;
|
||||
InitialSTR = 7;
|
||||
STRGrowth = 0.7;
|
||||
InitialAGI = 14;
|
||||
AGIGrowth = 1.5;
|
||||
InitialINT = 9;
|
||||
INTGrowth = 0.8;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class TheGodK : Character
|
||||
{
|
||||
public TheGodK() : base()
|
||||
{
|
||||
Id = 18;
|
||||
Name = "The God";
|
||||
FirstName = "K";
|
||||
NickName = "K神";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 23;
|
||||
InitialHP = 80;
|
||||
InitialMP = 70;
|
||||
InitialSTR = 6;
|
||||
STRGrowth = 0.6;
|
||||
InitialAGI = 11;
|
||||
AGIGrowth = 1.1;
|
||||
InitialINT = 13;
|
||||
INTGrowth = 1.3;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class XReouni : Character
|
||||
{
|
||||
public XReouni() : base()
|
||||
{
|
||||
Id = 14;
|
||||
Name = "X";
|
||||
FirstName = "Reouni";
|
||||
NickName = "雷欧尼";
|
||||
PrimaryAttribute = PrimaryAttribute.INT;
|
||||
InitialATK = 19;
|
||||
InitialHP = 90;
|
||||
InitialMP = 75;
|
||||
InitialSTR = 9;
|
||||
STRGrowth = 0.9;
|
||||
InitialAGI = 9;
|
||||
AGIGrowth = 0.6;
|
||||
InitialINT = 12;
|
||||
INTGrowth = 1.5;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class XinYin : Character
|
||||
{
|
||||
public XinYin() : base()
|
||||
{
|
||||
Id = 2;
|
||||
Name = "Xiyue";
|
||||
FirstName = "XinYin";
|
||||
NickName = "心音";
|
||||
PrimaryAttribute = PrimaryAttribute.AGI;
|
||||
InitialATK = 22;
|
||||
InitialHP = 85;
|
||||
InitialMP = 60;
|
||||
InitialSTR = 8;
|
||||
STRGrowth = 0.9;
|
||||
InitialAGI = 19;
|
||||
AGIGrowth = 1.7;
|
||||
InitialINT = 3;
|
||||
INTGrowth = 0.4;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
|
||||
namespace OshimaBot.Content.Characters
|
||||
{
|
||||
public class Yang : Character
|
||||
{
|
||||
public Yang() : base()
|
||||
{
|
||||
Id = 3;
|
||||
Name = "Ya";
|
||||
FirstName = "Yang";
|
||||
NickName = "吖养";
|
||||
PrimaryAttribute = PrimaryAttribute.STR;
|
||||
InitialATK = 23;
|
||||
InitialHP = 105;
|
||||
InitialMP = 55;
|
||||
InitialSTR = 11;
|
||||
STRGrowth = 1.8;
|
||||
InitialAGI = 9;
|
||||
AGIGrowth = 0.5;
|
||||
InitialINT = 10;
|
||||
INTGrowth = 0.7;
|
||||
InitialSPD = 300;
|
||||
InitialHR = 4;
|
||||
InitialMR = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.ClassPlan;
|
||||
using FunGame.Core.Model.Framework;
|
||||
using OshimaBot.Content.Skills;
|
||||
|
||||
namespace OshimaBot.Content.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// 首个真实职业内容:职业「剑士」与流派「剑豪」
|
||||
/// <para/>· 技能池:4 个真实战技 + 2 个被动,供路线图「职业技能选择权」消耗
|
||||
/// <para/>· 天赋池:核心 / 先锋 / 近卫 三系(核心天赋由内核自动附加「全等级 +1」)
|
||||
/// <para/>· 固有被动:1 级与 6 级各 1 个,与路线图 InherentPassive 档位一致
|
||||
/// <para/>· 职业模板属性上下限:约束 1 级初始分配(30 点 + 3.0 成长)
|
||||
/// <para/>· 路线图数值:沿用 <see cref="EquilibriumConstant.ClassLevelUpRewards"/> 默认表,不做职业专属覆盖
|
||||
/// </summary>
|
||||
public static class OshimaClasses
|
||||
{
|
||||
/// <summary>职业编号:剑士</summary>
|
||||
public const long 剑士职业 = 7001;
|
||||
|
||||
/// <summary>流派编号:剑豪</summary>
|
||||
public const long 剑豪流派 = 7002;
|
||||
|
||||
/// <summary>天赋编号:核心·剑心通明</summary>
|
||||
public const long 剑心通明 = 7010;
|
||||
|
||||
/// <summary>天赋编号:先锋·疾风剑势</summary>
|
||||
public const long 疾风剑势 = 7011;
|
||||
|
||||
/// <summary>天赋编号:近卫·铁壁架势</summary>
|
||||
public const long 铁壁架势 = 7012;
|
||||
|
||||
/// <summary>天赋编号:核心·剑意凝聚(与剑心通明同定位,用于验证同定位多天赋)</summary>
|
||||
public const long 剑意凝聚 = 7013;
|
||||
|
||||
/// <summary>固有被动编号:剑士体魄(1 级)</summary>
|
||||
public const long 剑士体魄 = 7020;
|
||||
|
||||
/// <summary>固有被动编号:剑豪意志(6 级)</summary>
|
||||
public const long 剑豪意志 = 7021;
|
||||
|
||||
/// <summary>
|
||||
/// 创建职业「剑士」定义(每次返回新实例,供规划器 Copy 为玩家职业记录)
|
||||
/// </summary>
|
||||
public static Class Create剑士()
|
||||
{
|
||||
Class definition = new() { Id = 剑士职业, Name = "剑士" };
|
||||
|
||||
// 职业模板属性上下限:1 级初始分配必须落在该区间内(与角色模板限值取交集)
|
||||
definition.AttributeLimit = new ClassAttributeLimit(
|
||||
strMin: 8, strMax: 24,
|
||||
agiMax: 16,
|
||||
intMax: 10,
|
||||
strGrowthMax: 2.4,
|
||||
agiGrowthMax: 1.6,
|
||||
intGrowthMax: 1.0);
|
||||
|
||||
// 技能池:战技
|
||||
definition.Skills.Add(new 绞丝棍 { Level = 1 });
|
||||
definition.Skills.Add(new 金刚击 { Level = 1 });
|
||||
definition.Skills.Add(new 旋风轮 { Level = 1 });
|
||||
definition.Skills.Add(new 双连击 { Level = 1 });
|
||||
|
||||
// 技能池:被动(消耗被动选择权习得)
|
||||
definition.PassiveSkills.Add(new 强攻 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 征服者 { Level = 1 });
|
||||
|
||||
// 天赋池:按定位索引,战斗天赋绑定职业;同一定位可提供多个候选
|
||||
definition.CombatTalents[RoleType.Core] =
|
||||
[
|
||||
new OpenSkill(剑心通明, "剑心通明", []) { Level = 1 },
|
||||
new OpenSkill(剑意凝聚, "剑意凝聚", []) { Level = 1 }
|
||||
];
|
||||
definition.CombatTalents[RoleType.Vanguard] = [new OpenSkill(疾风剑势, "疾风剑势", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Guardian] = [new OpenSkill(铁壁架势, "铁壁架势", []) { Level = 1 }];
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「剑豪」定义(提供核心 / 先锋 / 近卫定位候选与 1 / 6 级固有被动)
|
||||
/// </summary>
|
||||
/// <param name="owner">所属职业记录(流派等级委托给该职业)</param>
|
||||
public static SubClass Create剑豪(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 剑豪流派, Name = "剑豪" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Vanguard);
|
||||
definition.RoleTypes.Add(RoleType.Guardian);
|
||||
definition.InherentPassives[1] = [new OpenSkill(剑士体魄, "剑士体魄", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(剑豪意志, "剑豪意志", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建【转换战斗天赋】战技实例,交给 <see cref="FunGame.Core.Model.ClassPlanner.SetCombatTalentSwitchSkill"/> 注入
|
||||
/// </summary>
|
||||
/// <param name="targetRoleType">目标定位;null 时由内核自动选择当前未激活的已学天赋</param>
|
||||
public static Skill Create转换战斗天赋(RoleType? targetRoleType = null)
|
||||
{
|
||||
return new 转换战斗天赋(null, targetRoleType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 把本模块的职业 / 流派 / 转换战斗天赋战技注册到核心库定义注册表(进程启动时调用一次)
|
||||
/// <para>注册后职业计划存档才能按 IdName 重建职业与流派记录</para>
|
||||
/// </summary>
|
||||
public static void RegisterAll()
|
||||
{
|
||||
ClassDefinitionRegistry.Register(Create剑士, Create剑豪);
|
||||
ClassDefinitionRegistry.RegisterSwitchSkill(Create转换战斗天赋().GetIdName(), () => Create转换战斗天赋());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.ClassPlan;
|
||||
using OshimaBot.Content.Skills;
|
||||
|
||||
namespace OshimaBot.Content.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// 筽祀牻世界观职业内容:3 个职业,每个职业 2 个流派(共 6 组)
|
||||
/// <para/>世界观依据见 <c>docs_internal/筽祀牻-世界观.md</c>(来源 https://docs.milimoe.com/story/)
|
||||
/// <para/>· 职业取自大陆三方势力:铎京(科技中枢 · 秩序)、META🐴(熵之吞噬 · 混沌)、深海同盟(潮汐复仇 · 第三方)
|
||||
/// <para/>· 技能池一律从模组**通用战技 / 通用被动**中取材(<c>Skills/战技/</c> 与 <c>Skills/被动/</c>),
|
||||
/// 每职业 10 个战技 + 4 个被动:路线图共发放 8 次主动技能选择权、3 份「被动或数值提升」共享份额,池子略大于额度以保留取舍
|
||||
/// <para/>· 战斗天赋池按 <see cref="RoleType"/> 索引,每职业 4 个(核心 / 先锋 / 近卫 / 特色定位)
|
||||
/// <para/>· 流派提供 1 级与 6 级各 1 个固有被动,并按设定开放相应的角色定位
|
||||
/// <para/>· 职业模板属性上下限约束 1 级初始分配(30 点 + 3.0 成长):导械师偏敏捷智力、熵噬者偏力量、深潮行者均衡偏力量
|
||||
/// <para/>· 号段:职业 7x01、流派 7x11 / 7x12、天赋 7x21–7x24、固有被动 7x31–7x34(x = 1 铎京 / 2 META🐴 / 3 深海)
|
||||
/// </summary>
|
||||
public static class OshimaWorldClasses
|
||||
{
|
||||
#region 铎京:导械师(7101)
|
||||
|
||||
/// <summary>职业编号:导械师(铎京 · 导力机械与能量研究)</summary>
|
||||
public const long 导械师职业 = 7101;
|
||||
|
||||
/// <summary>流派编号:晶枢术士(能量节点操控者)</summary>
|
||||
public const long 晶枢术士流派 = 7111;
|
||||
|
||||
/// <summary>流派编号:铳械猎手(远程精准打击)</summary>
|
||||
public const long 铳械猎手流派 = 7112;
|
||||
|
||||
/// <summary>天赋编号:核心·晶枢共鸣</summary>
|
||||
public const long 晶枢共鸣 = 7121;
|
||||
|
||||
/// <summary>天赋编号:先锋·过载推进</summary>
|
||||
public const long 过载推进 = 7122;
|
||||
|
||||
/// <summary>天赋编号:近卫·力场护盾</summary>
|
||||
public const long 力场护盾 = 7123;
|
||||
|
||||
/// <summary>天赋编号:辅助·后勤补给</summary>
|
||||
public const long 后勤补给 = 7124;
|
||||
|
||||
/// <summary>固有被动编号:能量感知(晶枢术士 · 1 级)</summary>
|
||||
public const long 能量感知 = 7131;
|
||||
|
||||
/// <summary>固有被动编号:节点共鸣(晶枢术士 · 6 级)</summary>
|
||||
public const long 节点共鸣 = 7132;
|
||||
|
||||
/// <summary>固有被动编号:枪械精通(铳械猎手 · 1 级)</summary>
|
||||
public const long 枪械精通 = 7133;
|
||||
|
||||
/// <summary>固有被动编号:穿透弹头(铳械猎手 · 6 级)</summary>
|
||||
public const long 穿透弹头 = 7134;
|
||||
|
||||
/// <summary>
|
||||
/// 创建职业「导械师」:铎京的导力技师,以精密机械、枪械与能量节点研究为业
|
||||
/// </summary>
|
||||
public static Class Create导械师()
|
||||
{
|
||||
Class definition = new() { Id = 导械师职业, Name = "导械师" };
|
||||
|
||||
// 铎京技师:主敏捷与智力,力量受机械外骨骼限制
|
||||
definition.AttributeLimit = new ClassAttributeLimit(
|
||||
strMax: 16,
|
||||
agiMin: 8, agiMax: 24,
|
||||
intMin: 6, intMax: 22,
|
||||
strGrowthMax: 1.6,
|
||||
agiGrowthMax: 2.4,
|
||||
intGrowthMax: 2.0);
|
||||
|
||||
// 技能池:战技(导力、枪械、机动、指挥)
|
||||
definition.Skills.Add(new 导力装甲 { Level = 1 });
|
||||
definition.Skills.Add(new 快速狙击 { Level = 1 });
|
||||
definition.Skills.Add(new 精准射击 { Level = 1 });
|
||||
definition.Skills.Add(new 跳跃点射 { Level = 1 });
|
||||
definition.Skills.Add(new 回复弹 { Level = 1 });
|
||||
definition.Skills.Add(new 闪现 { Level = 1 });
|
||||
definition.Skills.Add(new 疾走 { Level = 1 });
|
||||
definition.Skills.Add(new 号令 { Level = 1 });
|
||||
definition.Skills.Add(new 助威 { Level = 1 });
|
||||
definition.Skills.Add(new 挑拨 { Level = 1 });
|
||||
|
||||
// 技能池:被动(先手、持续输出、机动、续航)
|
||||
definition.PassiveSkills.Add(new 先攻 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 致命节奏 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 迅捷步法 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 饼干配送 { Level = 1 });
|
||||
|
||||
// 天赋池
|
||||
definition.CombatTalents[RoleType.Core] = [new OpenSkill(晶枢共鸣, "晶枢共鸣", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Vanguard] = [new OpenSkill(过载推进, "过载推进", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Guardian] = [new OpenSkill(力场护盾, "力场护盾", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Support] = [new OpenSkill(后勤补给, "后勤补给", []) { Level = 1 }];
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「晶枢术士」:操控能量节点的铎京技术官,兼顾防护与支援
|
||||
/// </summary>
|
||||
public static SubClass Create晶枢术士(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 晶枢术士流派, Name = "晶枢术士" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Guardian);
|
||||
definition.RoleTypes.Add(RoleType.Support);
|
||||
definition.InherentPassives[1] = [new OpenSkill(能量感知, "能量感知", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(节点共鸣, "节点共鸣", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「铳械猎手」:铎京军备体系下的远程射手,追求精准与输出
|
||||
/// </summary>
|
||||
public static SubClass Create铳械猎手(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 铳械猎手流派, Name = "铳械猎手" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Vanguard);
|
||||
definition.InherentPassives[1] = [new OpenSkill(枪械精通, "枪械精通", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(穿透弹头, "穿透弹头", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region META🐴:熵噬者(7201)
|
||||
|
||||
/// <summary>职业编号:熵噬者(META🐴 · 信奉「力量即真理」,驾驭熵之力)</summary>
|
||||
public const long 熵噬者职业 = 7201;
|
||||
|
||||
/// <summary>流派编号:熵灭剑徒(承袭大岛シヤ双手剑「熵灭」的剑之道路)</summary>
|
||||
public const long 熵灭剑徒流派 = 7211;
|
||||
|
||||
/// <summary>流派编号:实验体(META🐴 人体实验的成品,以极致回复换取失控力量)</summary>
|
||||
public const long 实验体流派 = 7212;
|
||||
|
||||
/// <summary>天赋编号:核心·熵灭回响</summary>
|
||||
public const long 熵灭回响 = 7221;
|
||||
|
||||
/// <summary>天赋编号:先锋·噬能突进</summary>
|
||||
public const long 噬能突进 = 7222;
|
||||
|
||||
/// <summary>天赋编号:近卫·熵壁</summary>
|
||||
public const long 熵壁 = 7223;
|
||||
|
||||
/// <summary>天赋编号:医疗·熵愈(掠夺他人生气填补自身,呼应主角「流」的极致回复)</summary>
|
||||
public const long 熵愈 = 7224;
|
||||
|
||||
/// <summary>固有被动编号:熵之亲和(熵灭剑徒 · 1 级)</summary>
|
||||
public const long 熵之亲和 = 7231;
|
||||
|
||||
/// <summary>固有被动编号:剑势·灭(熵灭剑徒 · 6 级)</summary>
|
||||
public const long 剑势灭 = 7232;
|
||||
|
||||
/// <summary>固有被动编号:再生因子(实验体 · 1 级)</summary>
|
||||
public const long 再生因子 = 7233;
|
||||
|
||||
/// <summary>固有被动编号:熵核觉醒(实验体 · 6 级)</summary>
|
||||
public const long 熵核觉醒 = 7234;
|
||||
|
||||
/// <summary>
|
||||
/// 创建职业「熵噬者」:META🐴 的战斗人员,通过吞噬能量换取压倒性的破坏力
|
||||
/// </summary>
|
||||
public static Class Create熵噬者()
|
||||
{
|
||||
Class definition = new() { Id = 熵噬者职业, Name = "熵噬者" };
|
||||
|
||||
// 熵噬者:主力量,智力被熵之力侵蚀而受限
|
||||
definition.AttributeLimit = new ClassAttributeLimit(
|
||||
strMin: 10, strMax: 26,
|
||||
agiMax: 18,
|
||||
intMax: 12,
|
||||
strGrowthMax: 2.6,
|
||||
agiGrowthMax: 1.8,
|
||||
intGrowthMax: 1.0);
|
||||
|
||||
// 技能池:战技(剑技、收割、暗影、灾厄)
|
||||
definition.Skills.Add(new 千剑之雨 { Level = 1 });
|
||||
definition.Skills.Add(new 无尽剑制 { Level = 1 });
|
||||
definition.Skills.Add(new 光破斩 { Level = 1 });
|
||||
definition.Skills.Add(new 光鬼斩 { Level = 1 });
|
||||
definition.Skills.Add(new 断罪斩 { Level = 1 });
|
||||
definition.Skills.Add(new 血腥旋转 { Level = 1 });
|
||||
definition.Skills.Add(new 死亡制裁 { Level = 1 });
|
||||
definition.Skills.Add(new 灾难一掷 { Level = 1 });
|
||||
definition.Skills.Add(new 绝影 { Level = 1 });
|
||||
definition.Skills.Add(new 魔眼 { Level = 1 });
|
||||
|
||||
// 技能池:被动(征服、收割、贪欲、爆发)
|
||||
definition.PassiveSkills.Add(new 征服者 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 黑暗收割 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 贪欲猎手 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 电刑 { Level = 1 });
|
||||
|
||||
// 天赋池
|
||||
definition.CombatTalents[RoleType.Core] = [new OpenSkill(熵灭回响, "熵灭回响", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Vanguard] = [new OpenSkill(噬能突进, "噬能突进", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Guardian] = [new OpenSkill(熵壁, "熵壁", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Medic] = [new OpenSkill(熵愈, "熵愈", []) { Level = 1 }];
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「熵灭剑徒」:以剑承载熵之力,追求极致的歼灭
|
||||
/// </summary>
|
||||
public static SubClass Create熵灭剑徒(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 熵灭剑徒流派, Name = "熵灭剑徒" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Vanguard);
|
||||
definition.RoleTypes.Add(RoleType.Guardian);
|
||||
definition.InherentPassives[1] = [new OpenSkill(熵之亲和, "熵之亲和", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(剑势灭, "剑势·灭", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「实验体」:META🐴 人体实验的成品,拥有极致回复能力,代价是体内熵之力持续失控
|
||||
/// </summary>
|
||||
public static SubClass Create实验体(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 实验体流派, Name = "实验体" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Guardian);
|
||||
definition.RoleTypes.Add(RoleType.Medic);
|
||||
definition.InherentPassives[1] = [new OpenSkill(再生因子, "再生因子", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(熵核觉醒, "熵核觉醒", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 深海同盟:深潮行者(7301)
|
||||
|
||||
/// <summary>职业编号:深潮行者(深海同盟 · 驾驭潮汐与海兽之力的复仇者)</summary>
|
||||
public const long 深潮行者职业 = 7301;
|
||||
|
||||
/// <summary>流派编号:潮汐守卫(以肉身与潮汐抵御冲击的守护者)</summary>
|
||||
public const long 潮汐守卫流派 = 7311;
|
||||
|
||||
/// <summary>流派编号:深渊猎手(在暗流中猎杀目标的刺杀者)</summary>
|
||||
public const long 深渊猎手流派 = 7312;
|
||||
|
||||
/// <summary>天赋编号:核心·潮汐共鸣</summary>
|
||||
public const long 潮汐共鸣 = 7321;
|
||||
|
||||
/// <summary>天赋编号:先锋·暗流突袭</summary>
|
||||
public const long 暗流突袭 = 7322;
|
||||
|
||||
/// <summary>天赋编号:近卫·深渊庇佑</summary>
|
||||
public const long 深渊庇佑 = 7323;
|
||||
|
||||
/// <summary>天赋编号:医疗·生命之泉(源自筽祀牻之眼的净化之力)</summary>
|
||||
public const long 生命之泉 = 7324;
|
||||
|
||||
/// <summary>固有被动编号:潮汐之躯(潮汐守卫 · 1 级)</summary>
|
||||
public const long 潮汐之躯 = 7331;
|
||||
|
||||
/// <summary>固有被动编号:海兽庇佑(潮汐守卫 · 6 级)</summary>
|
||||
public const long 海兽庇佑 = 7332;
|
||||
|
||||
/// <summary>固有被动编号:深渊感知(深渊猎手 · 1 级)</summary>
|
||||
public const long 深渊感知 = 7333;
|
||||
|
||||
/// <summary>固有被动编号:猎杀本能(深渊猎手 · 6 级)</summary>
|
||||
public const long 猎杀本能 = 7334;
|
||||
|
||||
/// <summary>
|
||||
/// 创建职业「深潮行者」:深海同盟的战士,以海兽般的体魄与洋流操控立足战场
|
||||
/// </summary>
|
||||
public static Class Create深潮行者()
|
||||
{
|
||||
Class definition = new() { Id = 深潮行者职业, Name = "深潮行者" };
|
||||
|
||||
// 深潮行者:力量为主、敏捷次之,深海环境限制了智力发展
|
||||
definition.AttributeLimit = new ClassAttributeLimit(
|
||||
strMin: 8, strMax: 24,
|
||||
agiMax: 20,
|
||||
intMax: 16,
|
||||
strGrowthMax: 2.4,
|
||||
agiGrowthMax: 2.0,
|
||||
intGrowthMax: 1.4);
|
||||
|
||||
// 技能池:战技(锚击、鞭缚、洋流、回旋)
|
||||
definition.Skills.Add(new 鲨鱼锚击 { Level = 1 });
|
||||
definition.Skills.Add(new 雷索吸缚 { Level = 1 });
|
||||
definition.Skills.Add(new 拘束之鞭 { Level = 1 });
|
||||
definition.Skills.Add(new 风之鞭 { Level = 1 });
|
||||
definition.Skills.Add(new 岚 { Level = 1 });
|
||||
definition.Skills.Add(new 螺旋之刃 { Level = 1 });
|
||||
definition.Skills.Add(new 陀螺舞 { Level = 1 });
|
||||
definition.Skills.Add(new 落叶 { Level = 1 });
|
||||
definition.Skills.Add(new 狂刃剑舞 { Level = 1 });
|
||||
definition.Skills.Add(new 旋风轮 { Level = 1 });
|
||||
|
||||
// 技能池:被动(深海外壳、重击、坚韧、反击)
|
||||
definition.PassiveSkills.Add(new 海妖外壳 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 深海重击 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 不灭之握 { Level = 1 });
|
||||
definition.PassiveSkills.Add(new 反击螺旋 { Level = 1 });
|
||||
|
||||
// 天赋池
|
||||
definition.CombatTalents[RoleType.Core] = [new OpenSkill(潮汐共鸣, "潮汐共鸣", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Vanguard] = [new OpenSkill(暗流突袭, "暗流突袭", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Guardian] = [new OpenSkill(深渊庇佑, "深渊庇佑", []) { Level = 1 }];
|
||||
definition.CombatTalents[RoleType.Medic] = [new OpenSkill(生命之泉, "生命之泉", []) { Level = 1 }];
|
||||
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「潮汐守卫」:如利维坦般承受冲击,守护同袍与海域
|
||||
/// </summary>
|
||||
public static SubClass Create潮汐守卫(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 潮汐守卫流派, Name = "潮汐守卫" };
|
||||
definition.RoleTypes.Add(RoleType.Guardian);
|
||||
definition.RoleTypes.Add(RoleType.Vanguard);
|
||||
definition.RoleTypes.Add(RoleType.Medic);
|
||||
definition.InherentPassives[1] = [new OpenSkill(潮汐之躯, "潮汐之躯", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(海兽庇佑, "海兽庇佑", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建流派「深渊猎手」:潜行于暗流之中,一击定生死
|
||||
/// </summary>
|
||||
public static SubClass Create深渊猎手(Class owner)
|
||||
{
|
||||
SubClass definition = new(owner) { Id = 深渊猎手流派, Name = "深渊猎手" };
|
||||
definition.RoleTypes.Add(RoleType.Core);
|
||||
definition.RoleTypes.Add(RoleType.Vanguard);
|
||||
definition.InherentPassives[1] = [new OpenSkill(深渊感知, "深渊感知", []) { Level = 1 }];
|
||||
definition.InherentPassives[6] = [new OpenSkill(猎杀本能, "猎杀本能", []) { Level = 1 }];
|
||||
return definition;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 把本文件的职业 / 流派注册到核心库定义注册表(进程启动时调用一次)
|
||||
/// <para/>共 3 职业 × 2 流派 = 6 组;【转换战斗天赋】战技复用 <see cref="OshimaClasses"/> 的全局注册,此处不重复注册
|
||||
/// </summary>
|
||||
public static void RegisterAll()
|
||||
{
|
||||
ClassDefinitionRegistry.Register(Create导械师, Create晶枢术士);
|
||||
ClassDefinitionRegistry.Register(Create导械师, Create铳械猎手);
|
||||
ClassDefinitionRegistry.Register(Create熵噬者, Create熵灭剑徒);
|
||||
ClassDefinitionRegistry.Register(Create熵噬者, Create实验体);
|
||||
ClassDefinitionRegistry.Register(Create深潮行者, Create潮汐守卫);
|
||||
ClassDefinitionRegistry.Register(Create深潮行者, Create深渊猎手);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public enum EffectID : long
|
||||
{
|
||||
/// <summary>
|
||||
/// 被动特效起点
|
||||
/// </summary>
|
||||
Passive_Start = 8000,
|
||||
|
||||
/// <summary>
|
||||
/// 数值攻击力,参数:exatk
|
||||
/// </summary>
|
||||
ExATK = 8001,
|
||||
|
||||
/// <summary>
|
||||
/// 数值物理护甲,参数:exdef
|
||||
/// </summary>
|
||||
ExDEF = 8002,
|
||||
|
||||
/// <summary>
|
||||
/// 数值力量,参数:exstr
|
||||
/// </summary>
|
||||
ExSTR = 8003,
|
||||
|
||||
/// <summary>
|
||||
/// 数值敏捷,参数:exagi
|
||||
/// </summary>
|
||||
ExAGI = 8004,
|
||||
|
||||
/// <summary>
|
||||
/// 数值智力,参数:exint
|
||||
/// </summary>
|
||||
ExINT = 8005,
|
||||
|
||||
/// <summary>
|
||||
/// 数值技能硬直时间减少,参数:shtr
|
||||
/// </summary>
|
||||
SkillHardTimeReduce = 8006,
|
||||
|
||||
/// <summary>
|
||||
/// 数值普攻硬直时间减少,参数:nahtr
|
||||
/// </summary>
|
||||
NormalAttackHardTimeReduce = 8007,
|
||||
|
||||
/// <summary>
|
||||
/// 加速系数%,参数:exacc
|
||||
/// </summary>
|
||||
AccelerationCoefficient = 8008,
|
||||
|
||||
/// <summary>
|
||||
/// 数值行动速度,参数:exspd
|
||||
/// </summary>
|
||||
ExSPD = 8009,
|
||||
|
||||
/// <summary>
|
||||
/// 行动系数%,参考:exac
|
||||
/// </summary>
|
||||
ExActionCoefficient = 8010,
|
||||
|
||||
/// <summary>
|
||||
/// 冷却缩减%,参数:excdr
|
||||
/// </summary>
|
||||
ExCDR = 8011,
|
||||
|
||||
/// <summary>
|
||||
/// 数值生命值,参数:exhp
|
||||
/// </summary>
|
||||
ExMaxHP = 8012,
|
||||
|
||||
/// <summary>
|
||||
/// 数值魔法值,参数:exmp
|
||||
/// </summary>
|
||||
ExMaxMP = 8013,
|
||||
|
||||
/// <summary>
|
||||
/// 暴击率%,参数:excr
|
||||
/// </summary>
|
||||
ExCritRate = 8014,
|
||||
|
||||
/// <summary>
|
||||
/// 暴击伤害%,参数:excrd
|
||||
/// </summary>
|
||||
ExCritDMG = 8015,
|
||||
|
||||
/// <summary>
|
||||
/// 闪避率%,参数:exer
|
||||
/// </summary>
|
||||
ExEvadeRate = 8016,
|
||||
|
||||
/// <summary>
|
||||
/// 物理穿透%,参数:exppt
|
||||
/// </summary>
|
||||
PhysicalPenetration = 8017,
|
||||
|
||||
/// <summary>
|
||||
/// 魔法穿透%,参数:exmpt
|
||||
/// </summary>
|
||||
MagicalPenetration = 8018,
|
||||
|
||||
/// <summary>
|
||||
/// 物理伤害减免%,参数:expdr
|
||||
/// </summary>
|
||||
ExPDR = 8019,
|
||||
|
||||
/// <summary>
|
||||
/// 魔法抗性%<para/>
|
||||
/// 参数:<para/>
|
||||
/// 魔法类型(对应MagicType,0为所有):mdftype<para/>
|
||||
/// 魔法抗性%:mdfvalue
|
||||
/// </summary>
|
||||
ExMDF = 8020,
|
||||
|
||||
/// <summary>
|
||||
/// 数值生命回复,参数:exhr
|
||||
/// </summary>
|
||||
ExHR = 8021,
|
||||
|
||||
/// <summary>
|
||||
/// 数值魔法回复,参数:exmr
|
||||
/// </summary>
|
||||
ExMR = 8022,
|
||||
|
||||
/// <summary>
|
||||
/// 攻击力%,参数:exatk
|
||||
/// </summary>
|
||||
ExATK2 = 8023,
|
||||
|
||||
/// <summary>
|
||||
/// 物理护甲%,参数:exdef
|
||||
/// </summary>
|
||||
ExDEF2 = 8024,
|
||||
|
||||
/// <summary>
|
||||
/// 力量%,参数:exstr
|
||||
/// </summary>
|
||||
ExSTR2 = 8025,
|
||||
|
||||
/// <summary>
|
||||
/// 敏捷%,参数:exagi
|
||||
/// </summary>
|
||||
ExAGI2 = 8026,
|
||||
|
||||
/// <summary>
|
||||
/// 智力%,参数:exint
|
||||
/// </summary>
|
||||
ExINT2 = 8027,
|
||||
|
||||
/// <summary>
|
||||
/// 技能硬直时间减少%,参数:shtr
|
||||
/// </summary>
|
||||
SkillHardTimeReduce2 = 8028,
|
||||
|
||||
/// <summary>
|
||||
/// 普攻硬直时间减少%,参数:nahtr
|
||||
/// </summary>
|
||||
NormalAttackHardTimeReduce2 = 8029,
|
||||
|
||||
/// <summary>
|
||||
/// 最大生命值%,参数:exhp
|
||||
/// </summary>
|
||||
ExMaxHP2 = 8030,
|
||||
|
||||
/// <summary>
|
||||
/// 最大魔法值%,参数:exmp
|
||||
/// </summary>
|
||||
ExMaxMP2 = 8031,
|
||||
|
||||
/// <summary>
|
||||
/// 动态扩展特效
|
||||
/// </summary>
|
||||
DynamicsEffect = 8032,
|
||||
|
||||
/// <summary>
|
||||
/// 无视闪避率,参数:p
|
||||
/// </summary>
|
||||
IgnoreEvade = 8033,
|
||||
|
||||
/// <summary>
|
||||
/// 数值攻击距离,参数:exatr
|
||||
/// </summary>
|
||||
ExATR = 8034,
|
||||
|
||||
/// <summary>
|
||||
/// 数值移动距离,参数:exmov
|
||||
/// </summary>
|
||||
ExMOV = 8035,
|
||||
|
||||
/// <summary>
|
||||
/// 生命偷取%,参数:exls
|
||||
/// </summary>
|
||||
ExLifesteal = 8038,
|
||||
|
||||
/// <summary>
|
||||
/// 被动特效终点
|
||||
/// </summary>
|
||||
Passive_End = 8699,
|
||||
|
||||
/// <summary>
|
||||
/// 主动特效起点
|
||||
/// </summary>
|
||||
Active_Start = 8700,
|
||||
|
||||
/// <summary>
|
||||
/// 立即回复生命值,参数:hp
|
||||
/// </summary>
|
||||
RecoverHP = 8701,
|
||||
|
||||
/// <summary>
|
||||
/// 立即回复魔法值,参数:mp
|
||||
/// </summary>
|
||||
RecoverMP = 8702,
|
||||
|
||||
/// <summary>
|
||||
/// 立即回复生命值%,参数:hp
|
||||
/// </summary>
|
||||
RecoverHP2 = 8703,
|
||||
|
||||
/// <summary>
|
||||
/// 立即回复魔法值%,参数:mp
|
||||
/// </summary>
|
||||
RecoverMP2 = 8704,
|
||||
|
||||
/// <summary>
|
||||
/// 立即获得能量值,参数:ep
|
||||
/// </summary>
|
||||
GetEP = 8705,
|
||||
|
||||
/// <summary>
|
||||
/// 立即获得经验值,参数:exp
|
||||
/// </summary>
|
||||
GetEXP = 8706,
|
||||
|
||||
/// <summary>
|
||||
/// 主动特效终点
|
||||
/// </summary>
|
||||
Active_End = 8999
|
||||
}
|
||||
|
||||
public enum PassiveEffectID : long
|
||||
{
|
||||
完全行动不能 = 4101,
|
||||
行动受限 = 4102,
|
||||
战斗不能 = 4103,
|
||||
封技 = 4104,
|
||||
缴械 = 4105,
|
||||
标记 = 4106,
|
||||
眩晕 = 4107,
|
||||
石化 = 4108,
|
||||
冻结 = 4109,
|
||||
烧伤 = 4110,
|
||||
中毒 = 4111,
|
||||
诅咒 = 4112,
|
||||
愤怒 = 4113,
|
||||
混乱 = 4114,
|
||||
气绝 = 4115,
|
||||
虚弱 = 4116,
|
||||
迟滞 = 4117,
|
||||
易伤 = 4118,
|
||||
物理护盾 = 4119,
|
||||
魔法护盾 = 4120,
|
||||
物理免疫 = 4121,
|
||||
魔法免疫 = 4122,
|
||||
技能免疫 = 4123,
|
||||
完全免疫 = 4124,
|
||||
持续性弱驱散 = 4125,
|
||||
持续性强驱散 = 4126,
|
||||
累积之压标记 = 4127,
|
||||
易损 = 4128,
|
||||
电刑标记 = 4129,
|
||||
海王星的野望标记 = 4130,
|
||||
持续回复 = 4131,
|
||||
禁止治疗 = 4132,
|
||||
长期监视 = 4133,
|
||||
时雨标记 = 4134,
|
||||
宫监手标记 = 4135,
|
||||
复制技能 = 4136,
|
||||
持续伤害 = 4137,
|
||||
强运 = 4138,
|
||||
巡诊标记 = 4139,
|
||||
共鸣标记 = 4140,
|
||||
信标标记 = 4141
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using FunGame.Core.Entity;
|
||||
|
||||
namespace OshimaBot.Content.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 统一的「魔法效能 → 命中率」口径(2026-09-23 建立)。
|
||||
/// <para/>⚙ 背景:`Skill.MagicEfficacy` 是**乘算系数**
|
||||
/// (`clamp(1 + (施法者INT − 魔法瓶颈) / 魔法瓶颈, 0.01, 2.0)`)。
|
||||
/// 此前各处写法不一:`施加概率负面/增益`、`银色荆棘` 只把效能乘在**等级成长项**上
|
||||
/// (`基础 + 成长×(Lv−1)×效能`)⇒ **效能对基础概率完全无效**,最终命中率算不直观;
|
||||
/// 而纯机制魔法(削决策点、施加状态)根本不吃效能乘算,瓶颈形同虚设。
|
||||
/// <para/>✅ 统一口径(唯一实现点):
|
||||
/// <code>
|
||||
/// 命中率 = clamp( (基础概率 + 概率等级成长 × (Level − 1)) × 魔法效能 , 0, 1 )
|
||||
/// </code>
|
||||
/// ⇒ 效能 100% 时命中率 = 基础概率(**与旧版 Lv6 的数值一致,不改变既有平衡**);
|
||||
/// 效能 200% 时翻倍(封顶 100%);效能 → 0% 时 → 0%。
|
||||
/// <para/>✅ **被非魔法技能混用也安全(无需分流)**:全库 55 处重写 `MagicBottleneck` 的技能
|
||||
/// **清一色是魔法**,战技 / 爆发技 / 物品 / 被动都不重写 ⇒ 瓶颈取默认 **0**
|
||||
/// ⇒ `MagicEfficacy` 在 `瓶颈 == 0` 时**直接返回 1.0**(精确值)
|
||||
/// ⇒ 本口径对它们退化成**恒等变换**(`(基础+成长×(Lv−1)) × 1.0` ≡ 旧写法)。
|
||||
/// 因此「必中型控制」在非魔法技能上也不会被拉低,**一个类型判断分支都不需要**。
|
||||
/// <para/>📌 反过来说:**只有重写了 `MagicBottleneck` 的技能**才会真正吃到效能检定。
|
||||
/// <para/>📌 **纯机制魔法**(无自身概率,如"削 N 点决策点")取
|
||||
/// <see cref="默认基础概率"/> = 0.5、成长 0 ⇒ 恰好得到
|
||||
/// <b>效能 200% 必中 / 100% 命中 50% / 0% 命中 0%</b>。
|
||||
/// </summary>
|
||||
public static class EfficacyHit
|
||||
{
|
||||
/// <summary>纯机制魔法的默认基础概率(效能 100% 时命中 50%)</summary>
|
||||
public const double 默认基础概率 = 0.5;
|
||||
|
||||
/// <summary>统一命中率:基础概率(含等级成长)再乘魔法效能,封顶 [0, 1]。</summary>
|
||||
public static double 命中率(double 基础概率, double 概率等级成长, double 指定等级, double 魔法效能)
|
||||
{
|
||||
int level = (int)指定等级;
|
||||
double baseProb = level > 0 ? 基础概率 + 概率等级成长 * (level - 1) : 基础概率;
|
||||
return Math.Clamp(baseProb * 魔法效能, 0.0, 1.0);
|
||||
}
|
||||
|
||||
/// <summary>按 <see cref="Skill.MagicEfficacy"/> 求命中率(自动取技能等级)。</summary>
|
||||
public static double 命中率(Skill skill, double 基础概率 = 默认基础概率, double 概率等级成长 = 0)
|
||||
=> 命中率(基础概率, 概率等级成长, skill.Level, skill.MagicEfficacy);
|
||||
|
||||
/// <summary>
|
||||
/// 命中检定:**效能 ≥ 200%(命中率封顶 100%)时视为必中,且不消耗随机数** ——
|
||||
/// 避免无谓推进随机序列,保持整局确定性稳定。
|
||||
/// </summary>
|
||||
public static bool 检定(double 命中率, System.Random random)
|
||||
=> 命中率 >= 1.0 || random.NextDouble() <= 命中率;
|
||||
|
||||
/// <summary>日志用:统一的效能/命中率文本。</summary>
|
||||
public static string 文本(Skill skill, double 命中率)
|
||||
=> $"魔法效能 {skill.MagicEfficacy * 100:0.##}%,命中率 {命中率 * 100:0.##}%";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class GetEP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.GetEP;
|
||||
public override string Name => "立即获得能量值";
|
||||
public override string Description => $"{Skill.TargetDescription()}立即获得 {实际获得:0.##} 点能量值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际获得 = 0;
|
||||
|
||||
public GetEP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("ep", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double ep) && ep > 0)
|
||||
{
|
||||
实际获得 = ep;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EP += 实际获得;
|
||||
WriteLine($"[ {target} ] 获得了 {实际获得:0.##} 点能量值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EP += 实际获得;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class GetEXP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.GetEXP;
|
||||
public override string Name => "立即获得经验值";
|
||||
public override string Description => $"{Skill.TargetDescription()}立即获得 {实际获得:0.##} 点经验值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际获得 = 0;
|
||||
|
||||
public GetEXP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exp) && exp > 0)
|
||||
{
|
||||
实际获得 = exp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EXP += 实际获得;
|
||||
WriteLine($"[ {target} ] 获得了 {实际获得:0.##} 点经验值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.EXP += 实际获得;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverHP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverHP;
|
||||
public override string Name => "立即回复生命值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {实际回复:0.##} 点生命值({(能复活 ? "" : "不")}可用于复活)。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
private readonly bool 能复活 = false;
|
||||
|
||||
public RecoverHP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("hp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double hp) && hp > 0)
|
||||
{
|
||||
实际回复 = hp;
|
||||
}
|
||||
key = Values.Keys.FirstOrDefault(s => s.Equals("respawn", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && bool.TryParse(Values[key].ToString(), out bool respawn) && respawn)
|
||||
{
|
||||
能复活 = respawn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
HealToTarget(caster, target, 实际回复, 能复活);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.HP += 实际回复;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverHP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverHP2;
|
||||
public override string Name => "立即回复生命值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {回复比例 * 100:0.##}% 最大生命值({(能复活 ? "" : "不")}可用于复活)。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 回复比例 = 0;
|
||||
private readonly bool 能复活 = false;
|
||||
|
||||
public RecoverHP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("hp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double hp) && hp > 0)
|
||||
{
|
||||
回复比例 = hp;
|
||||
}
|
||||
key = Values.Keys.FirstOrDefault(s => s.Equals("respawn", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && bool.TryParse(Values[key].ToString(), out bool respawn) && respawn)
|
||||
{
|
||||
能复活 = respawn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
HealToTarget(caster, target, 回复比例 * (target?.MaxHP ?? 0), 能复活);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.HP += 回复比例 * (target?.MaxHP ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverMP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverMP;
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {实际回复:0.##} 点魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
|
||||
public RecoverMP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("mp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double mp) && mp > 0)
|
||||
{
|
||||
实际回复 = mp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 实际回复;
|
||||
WriteLine($"[ {target} ] 回复了 {实际回复:0.##} 点魔法值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 实际回复;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.ItemEffects
|
||||
{
|
||||
public class RecoverMP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.RecoverMP2;
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复{Skill.TargetDescription()} {回复比例 * 100:0.##}% 最大魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public override EffectType EffectType { get; set; } = EffectType.Item;
|
||||
|
||||
private readonly double 回复比例 = 0;
|
||||
|
||||
public RecoverMP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("mp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double mp) && mp > 0)
|
||||
{
|
||||
回复比例 = mp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCasted(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character caster) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
double mp = 回复比例 * target.MaxMP;
|
||||
target.MP += mp;
|
||||
WriteLine($"[ {target} ] 回复了 {mp:0.##} 点魔法值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnSkillCastedOutside(SkillCastContext ctx)
|
||||
{
|
||||
if (ctx.User is not User user) return;
|
||||
List<Character> targets = ctx.Targets;
|
||||
base.OnSkillCastedOutside(ctx);
|
||||
foreach (Character target in targets)
|
||||
{
|
||||
target.MP += 回复比例 * (target?.MaxHP ?? 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class AccelerationCoefficient : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.AccelerationCoefficient;
|
||||
public override string Name { get; set; } = "加速系数加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 加速系数。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExAccelerationCoefficient += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExAccelerationCoefficient -= 实际加成;
|
||||
}
|
||||
|
||||
public AccelerationCoefficient(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exacc", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exACC))
|
||||
{
|
||||
实际加成 = exACC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,654 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class DynamicsEffect : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.DynamicsEffect;
|
||||
public override string Name { get; set; } = "动态扩展特效";
|
||||
public override string Description => string.Join("", Descriptions) + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public HashSet<string> Descriptions { get; } = [];
|
||||
public Dictionary<string, double> RealDynamicsValues { get; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// 加成是否已生效,用于保证移除与重复触发都只结算一次
|
||||
/// </summary>
|
||||
private bool 已应用 = false;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用,避免重复叠加
|
||||
Resolve(character, true);
|
||||
}
|
||||
Resolve(character);
|
||||
已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!已应用) return;
|
||||
Resolve(character, true);
|
||||
RealDynamicsValues.Clear();
|
||||
已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!已应用) return;
|
||||
// 各键的加成要么是配置常量、要么是百分比(会随基础属性实时变化),属性侧无需重新结算;
|
||||
// 这里通过「先还原再套用」重新生成描述中展示的点数,并保护剩余时间不被重置
|
||||
double remainDuration = RemainDuration;
|
||||
int remainDurationTurn = RemainDurationTurn;
|
||||
Resolve(character, true);
|
||||
Resolve(character);
|
||||
RemainDuration = remainDuration;
|
||||
RemainDurationTurn = remainDurationTurn;
|
||||
}
|
||||
|
||||
private void Resolve(Character character, bool remove = false)
|
||||
{
|
||||
Descriptions.Clear();
|
||||
foreach (string key in Values.Keys)
|
||||
{
|
||||
string value = Values[key].ToString() ?? "";
|
||||
switch (key.ToLower())
|
||||
{
|
||||
case "exatk":
|
||||
if (double.TryParse(value, out double exATK))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExATK2 += exATK;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exatk", out double current))
|
||||
{
|
||||
character.ExATK2 -= current;
|
||||
}
|
||||
RealDynamicsValues["exatk"] = exATK;
|
||||
Descriptions.Add($"{(exATK >= 0 ? "增加" : "减少")}角色 {Math.Abs(exATK):0.##} 点攻击力。");
|
||||
}
|
||||
break;
|
||||
case "exdef":
|
||||
if (double.TryParse(value, out double exDEF))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExDEF2 += exDEF;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exdef", out double current))
|
||||
{
|
||||
character.ExDEF2 -= current;
|
||||
}
|
||||
RealDynamicsValues["exdef"] = exDEF;
|
||||
Descriptions.Add($"{(exDEF >= 0 ? "增加" : "减少")}角色 {Math.Abs(exDEF):0.##} 点物理护甲。");
|
||||
}
|
||||
break;
|
||||
case "exstr":
|
||||
if (double.TryParse(value, out double exSTR))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExSTR += exSTR;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exstr", out double current))
|
||||
{
|
||||
character.ExSTR -= current;
|
||||
}
|
||||
RealDynamicsValues["exstr"] = exSTR;
|
||||
Descriptions.Add($"{(exSTR >= 0 ? "增加" : "减少")}角色 {Math.Abs(exSTR):0.##} 点力量。");
|
||||
}
|
||||
break;
|
||||
case "exagi":
|
||||
if (double.TryParse(value, out double exAGI))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExAGI += exAGI;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exagi", out double current))
|
||||
{
|
||||
character.ExAGI -= current;
|
||||
}
|
||||
RealDynamicsValues["exagi"] = exAGI;
|
||||
Descriptions.Add($"{(exAGI >= 0 ? "增加" : "减少")}角色 {Math.Abs(exAGI):0.##} 点敏捷。");
|
||||
}
|
||||
break;
|
||||
case "exint":
|
||||
if (double.TryParse(value, out double exINT))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExINT += exINT;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exint", out double current))
|
||||
{
|
||||
character.ExINT -= current;
|
||||
}
|
||||
RealDynamicsValues["exint"] = exINT;
|
||||
Descriptions.Add($"{(exINT >= 0 ? "增加" : "减少")}角色 {Math.Abs(exINT):0.##} 点智力。");
|
||||
}
|
||||
break;
|
||||
case "shtr":
|
||||
if (double.TryParse(value, out double shtr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime -= shtr;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime -= shtr;
|
||||
}
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("shtr", out double current))
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime += current;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime += current;
|
||||
}
|
||||
}
|
||||
RealDynamicsValues["shtr"] = shtr;
|
||||
Descriptions.Add($"{(shtr < 0 ? "增加" : "减少")}角色的所有主动技能 {Math.Abs(shtr):0.##} {GameplayEquilibriumConstant.InGameTime}硬直时间。");
|
||||
}
|
||||
break;
|
||||
case "nahtr":
|
||||
if (double.TryParse(value, out double nahtr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.NormalAttack.ExHardnessTime -= nahtr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("nahtr", out double current))
|
||||
{
|
||||
character.NormalAttack.ExHardnessTime += current;
|
||||
}
|
||||
RealDynamicsValues["nahtr"] = nahtr;
|
||||
Descriptions.Add($"{(nahtr < 0 ? "增加" : "减少")}角色的普通攻击 {Math.Abs(nahtr):0.##} {GameplayEquilibriumConstant.InGameTime}硬直时间。");
|
||||
}
|
||||
break;
|
||||
case "shtr2":
|
||||
if (double.TryParse(value, out double shtr2))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime2 -= shtr2;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime2 -= shtr2;
|
||||
}
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("shtr2", out double current))
|
||||
{
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime2 += current;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime2 += current;
|
||||
}
|
||||
}
|
||||
RealDynamicsValues["shtr2"] = shtr2;
|
||||
Descriptions.Add($"{(shtr2 < 0 ? "增加" : "减少")}角色的所有主动技能 {Math.Abs(shtr2 * 100):0.##}% 硬直时间。");
|
||||
}
|
||||
break;
|
||||
case "nahtr2":
|
||||
if (double.TryParse(value, out double nahtr2))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.NormalAttack.ExHardnessTime2 -= nahtr2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("nahtr2", out double current))
|
||||
{
|
||||
character.NormalAttack.ExHardnessTime2 += current;
|
||||
}
|
||||
RealDynamicsValues["nahtr2"] = nahtr2;
|
||||
Descriptions.Add($"{(nahtr2 < 0 ? "增加" : "减少")}角色的普通攻击 {Math.Abs(nahtr2 * 100):0.##}% 硬直时间。");
|
||||
}
|
||||
break;
|
||||
case "exacc":
|
||||
if (double.TryParse(value, out double exacc))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExAccelerationCoefficient += exacc;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exacc", out double current))
|
||||
{
|
||||
character.ExAccelerationCoefficient -= current;
|
||||
}
|
||||
RealDynamicsValues["exacc"] = exacc;
|
||||
Descriptions.Add($"{(exacc >= 0 ? "增加" : "减少")}角色 {Math.Abs(exacc) * 100:0.##}% 加速系数。");
|
||||
}
|
||||
break;
|
||||
case "exspd":
|
||||
if (double.TryParse(value, out double exspd))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExSPD += exspd;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exspd", out double current))
|
||||
{
|
||||
character.ExSPD -= current;
|
||||
}
|
||||
RealDynamicsValues["exspd"] = exspd;
|
||||
Descriptions.Add($"{(exspd >= 0 ? "增加" : "减少")}角色 {Math.Abs(exspd):0.##} 点行动速度。");
|
||||
}
|
||||
break;
|
||||
case "exac":
|
||||
if (double.TryParse(value, out double exac))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExActionCoefficient += exac;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exac", out double current))
|
||||
{
|
||||
character.ExActionCoefficient -= current;
|
||||
}
|
||||
RealDynamicsValues["exac"] = exac;
|
||||
Descriptions.Add($"{(exac >= 0 ? "增加" : "减少")}角色 {Math.Abs(exac) * 100:0.##}% 行动系数。");
|
||||
}
|
||||
break;
|
||||
case "excdr":
|
||||
if (double.TryParse(value, out double excdr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExCDR += excdr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("excdr", out double current))
|
||||
{
|
||||
character.ExCDR -= current;
|
||||
}
|
||||
RealDynamicsValues["excdr"] = excdr;
|
||||
Descriptions.Add($"{(excdr >= 0 ? "增加" : "减少")}角色 {Math.Abs(excdr) * 100:0.##}% 冷却缩减。");
|
||||
}
|
||||
break;
|
||||
case "exhp":
|
||||
if (double.TryParse(value, out double exhp))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExHP2 += exhp;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exhp", out double current))
|
||||
{
|
||||
character.ExHP2 -= current;
|
||||
}
|
||||
RealDynamicsValues["exhp"] = exhp;
|
||||
Descriptions.Add($"{(exhp >= 0 ? "增加" : "减少")}角色 {Math.Abs(exhp):0.##} 点最大生命值。");
|
||||
}
|
||||
break;
|
||||
case "exmp":
|
||||
if (double.TryParse(value, out double exmp))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExMP2 += exmp;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exmp", out double current))
|
||||
{
|
||||
character.ExMP2 -= current;
|
||||
}
|
||||
RealDynamicsValues["exmp"] = exmp;
|
||||
Descriptions.Add($"{(exmp >= 0 ? "增加" : "减少")}角色 {Math.Abs(exmp):0.##} 点最大魔法值。");
|
||||
}
|
||||
break;
|
||||
case "excr":
|
||||
if (double.TryParse(value, out double excr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExCritRate += excr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("excr", out double current))
|
||||
{
|
||||
character.ExCritRate -= current;
|
||||
}
|
||||
RealDynamicsValues["excr"] = excr;
|
||||
Descriptions.Add($"{(excr >= 0 ? "增加" : "减少")}角色 {Math.Abs(excr) * 100:0.##}% 暴击率。");
|
||||
}
|
||||
break;
|
||||
case "excrd":
|
||||
if (double.TryParse(value, out double excrd))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExCritDMG += excrd;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("excrd", out double current))
|
||||
{
|
||||
character.ExCritDMG -= current;
|
||||
}
|
||||
RealDynamicsValues["excrd"] = excrd;
|
||||
Descriptions.Add($"{(excrd >= 0 ? "增加" : "减少")}角色 {Math.Abs(excrd) * 100:0.##}% 暴击伤害。");
|
||||
}
|
||||
break;
|
||||
case "exer":
|
||||
if (double.TryParse(value, out double exer))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExEvadeRate += exer;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exer", out double current))
|
||||
{
|
||||
character.ExEvadeRate -= current;
|
||||
}
|
||||
RealDynamicsValues["exer"] = exer;
|
||||
Descriptions.Add($"{(exer >= 0 ? "增加" : "减少")}角色 {Math.Abs(exer) * 100:0.##}% 闪避率。");
|
||||
}
|
||||
break;
|
||||
case "exppt":
|
||||
if (double.TryParse(value, out double exppt))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.PhysicalPenetration += exppt;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exppt", out double current))
|
||||
{
|
||||
character.PhysicalPenetration -= current;
|
||||
}
|
||||
RealDynamicsValues["exppt"] = exppt;
|
||||
Descriptions.Add($"{(exppt >= 0 ? "增加" : "减少")}角色 {Math.Abs(exppt) * 100:0.##}% 物理穿透。");
|
||||
}
|
||||
break;
|
||||
case "exmpt":
|
||||
if (double.TryParse(value, out double exmpt))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.MagicalPenetration += exmpt;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exmpt", out double current))
|
||||
{
|
||||
character.MagicalPenetration -= current;
|
||||
}
|
||||
RealDynamicsValues["exmpt"] = exmpt;
|
||||
Descriptions.Add($"{(exmpt >= 0 ? "增加" : "减少")}角色 {Math.Abs(exmpt) * 100:0.##}% 魔法穿透。");
|
||||
}
|
||||
break;
|
||||
case "expdr":
|
||||
if (double.TryParse(value, out double expdr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExPDR += expdr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("expdr", out double current))
|
||||
{
|
||||
character.ExPDR -= current;
|
||||
}
|
||||
RealDynamicsValues["expdr"] = expdr;
|
||||
Descriptions.Add($"{(expdr >= 0 ? "增加" : "减少")}角色 {Math.Abs(expdr) * 100:0.##}% 物理伤害减免。");
|
||||
}
|
||||
break;
|
||||
case "exhr":
|
||||
if (double.TryParse(value, out double exhr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExHR += exhr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exhr", out double current))
|
||||
{
|
||||
character.ExHR -= current;
|
||||
}
|
||||
RealDynamicsValues["exhr"] = exhr;
|
||||
Descriptions.Add($"{(exhr >= 0 ? "增加" : "减少")}角色 {Math.Abs(exhr):0.##} 点生命回复。");
|
||||
}
|
||||
break;
|
||||
case "exmr":
|
||||
if (double.TryParse(value, out double exmr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExMR += exmr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exmr", out double current))
|
||||
{
|
||||
character.ExMR -= current;
|
||||
}
|
||||
RealDynamicsValues["exmr"] = exmr;
|
||||
Descriptions.Add($"{(exmr >= 0 ? "增加" : "减少")}角色 {Math.Abs(exmr):0.##} 点魔法回复。");
|
||||
}
|
||||
break;
|
||||
case "exatk2":
|
||||
if (double.TryParse(value, out double exATK2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.BaseATK * exATK2;
|
||||
character.ExATKPercentage += exATK2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exatk2", out double percentage))
|
||||
{
|
||||
character.ExATKPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exatk2"] = exATK2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exATK2) * 100:0.##}% [ {(real == 0 ? "基于基础攻击力" : $"{Math.Abs(real):0.##}")} ] 点攻击力。");
|
||||
}
|
||||
break;
|
||||
case "exdef2":
|
||||
if (double.TryParse(value, out double exDEF2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.BaseDEF * exDEF2;
|
||||
character.ExDEFPercentage += exDEF2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exdef2", out double percentage))
|
||||
{
|
||||
character.ExDEFPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exdef2"] = exDEF2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exDEF2) * 100:0.##}% [ {(real == 0 ? "基于基础物理护甲" : $"{Math.Abs(real):0.##}")} ] 点物理护甲。");
|
||||
}
|
||||
break;
|
||||
case "exstr2":
|
||||
if (double.TryParse(value, out double exSTR2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.BaseSTR * exSTR2;
|
||||
character.ExSTRPercentage += exSTR2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exstr2", out double percentage))
|
||||
{
|
||||
character.ExSTRPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exstr2"] = exSTR2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exSTR2) * 100:0.##}% [ {(real == 0 ? "基于基础力量" : $"{Math.Abs(real):0.##}")} ] 点力量。");
|
||||
}
|
||||
break;
|
||||
case "exagi2":
|
||||
if (double.TryParse(value, out double exAGI2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.BaseAGI * exAGI2;
|
||||
character.ExAGIPercentage += exAGI2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exagi2", out double percentage))
|
||||
{
|
||||
character.ExAGIPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exagi2"] = exAGI2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exAGI2) * 100:0.##}% [ {(real == 0 ? "基于基础敏捷" : $"{Math.Abs(real):0.##}")} ] 点敏捷。");
|
||||
}
|
||||
break;
|
||||
case "exint2":
|
||||
if (double.TryParse(value, out double exINT2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.BaseINT * exINT2;
|
||||
character.ExINTPercentage += exINT2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exint2", out double percentage))
|
||||
{
|
||||
character.ExINTPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exint2"] = exINT2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exINT2) * 100:0.##}% [ {(real == 0 ? "基于基础智力" : $"{Math.Abs(real):0.##}")} ] 点智力。");
|
||||
}
|
||||
break;
|
||||
case "exhp2":
|
||||
if (double.TryParse(value, out double exhp2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.MaxHP * exhp2;
|
||||
character.ExHPPercentage += exhp2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exhp2", out double percentage))
|
||||
{
|
||||
character.ExHPPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exhp2"] = exhp2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exhp2) * 100:0.##}% [ {(real == 0 ? "基于基础生命值" : $"{Math.Abs(real):0.##}")} ] 点最大生命值。");
|
||||
}
|
||||
break;
|
||||
case "exmp2":
|
||||
if (double.TryParse(value, out double exmp2))
|
||||
{
|
||||
double real = 0;
|
||||
if (!remove)
|
||||
{
|
||||
real = character.MaxMP * exmp2;
|
||||
character.ExMPPercentage += exmp2;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exmp2", out double percentage))
|
||||
{
|
||||
character.ExMPPercentage -= percentage;
|
||||
}
|
||||
RealDynamicsValues["exmp2"] = exmp2;
|
||||
Descriptions.Add($"{(real >= 0 ? "增加" : "减少")}角色 {Math.Abs(exmp2) * 100:0.##}% [ {(real == 0 ? "基于基础魔法值" : $"{Math.Abs(real):0.##}")} ] 点最大魔法值。");
|
||||
}
|
||||
break;
|
||||
case "mdftype":
|
||||
if (int.TryParse(value, out int mdftype))
|
||||
{
|
||||
double mdfValue = 0;
|
||||
MagicType magicType = MagicType.None;
|
||||
if (!remove)
|
||||
{
|
||||
magicType = (MagicType)mdftype;
|
||||
string mdfvalueKey = Values.Keys.FirstOrDefault(s => s.Equals("mdfvalue", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (mdfvalueKey.Length > 0 && double.TryParse(Values[mdfvalueKey].ToString(), out mdfValue))
|
||||
{
|
||||
character.MDF[magicType] += mdfValue;
|
||||
}
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("mdftype", out double currentType))
|
||||
{
|
||||
magicType = (MagicType)(int)currentType;
|
||||
if (RealDynamicsValues.TryGetValue("mdfvalue", out mdfValue))
|
||||
{
|
||||
character.MDF[magicType] -= mdfValue;
|
||||
}
|
||||
}
|
||||
RealDynamicsValues["mdftype"] = mdftype;
|
||||
RealDynamicsValues["mdfvalue"] = mdfValue;
|
||||
Descriptions.Add($"{(mdfValue >= 0 ? "增加" : "减少")}角色 {Math.Abs(mdfValue) * 100:0.##}% {CharacterSet.GetMagicResistanceName(magicType)}。");
|
||||
}
|
||||
break;
|
||||
case "exls":
|
||||
if (double.TryParse(value, out double exls))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.Lifesteal += exls;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exls", out double current))
|
||||
{
|
||||
character.Lifesteal -= current;
|
||||
}
|
||||
RealDynamicsValues["exls"] = exls;
|
||||
Descriptions.Add($"{(exls >= 0 ? "增加" : "减少")}角色 {Math.Abs(exls) * 100:0.##}% 生命偷取。");
|
||||
}
|
||||
break;
|
||||
case "exatr":
|
||||
if (int.TryParse(value, out int exatr))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExATR += exatr;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exatr", out double current))
|
||||
{
|
||||
character.ExATR -= (int)current;
|
||||
}
|
||||
RealDynamicsValues["exatr"] = exatr;
|
||||
Descriptions.Add($"{(exatr >= 0 ? "增加" : "减少")}角色 {Math.Abs(exatr)} 格攻击距离。");
|
||||
}
|
||||
break;
|
||||
case "exmov":
|
||||
if (int.TryParse(value, out int exmov))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
character.ExMOV += exmov;
|
||||
}
|
||||
else if (RealDynamicsValues.TryGetValue("exmov", out double current))
|
||||
{
|
||||
character.ExMOV -= (int)current;
|
||||
}
|
||||
RealDynamicsValues["exmov"] = exmov;
|
||||
Descriptions.Add($"{(exmov >= 0 ? "增加" : "减少")}角色 {Math.Abs(exmov)} 格移动距离。");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public DynamicsEffect(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExAGI : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExAGI;
|
||||
public override string Name { get; set; } = "敏捷加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点敏捷。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExAGI += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExAGI -= 实际加成;
|
||||
}
|
||||
|
||||
public ExAGI(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exagi", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exAGI))
|
||||
{
|
||||
实际加成 = exAGI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExAGI2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExAGI2;
|
||||
public override string Name { get; set; } = "敏捷加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础敏捷" : $"{Math.Abs(实际加成):0.##}")} ] 点敏捷。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExAGIPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseAGI * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExAGIPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExAGIPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础敏捷变化时会实时反映到 ExAGI3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseAGI * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExAGI2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exagi", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exAGI))
|
||||
{
|
||||
加成比例 = exAGI;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExATK : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExATK;
|
||||
public override string Name { get; set; } = "攻击力加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点攻击力。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExATK2 += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExATK2 -= 实际加成;
|
||||
}
|
||||
|
||||
public ExATK(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exatk", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exATK))
|
||||
{
|
||||
实际加成 = exATK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExATK2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExATK2;
|
||||
public override string Name { get; set; } = "攻击力加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础攻击力" : $"{Math.Abs(实际加成):0.##}")} ] 点攻击力。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExATKPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseATK * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExATKPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExATKPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础攻击力变化时会实时反映到 ExATK3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseATK * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExATK2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exatk", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exATK))
|
||||
{
|
||||
加成比例 = exATK;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExATR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExATR;
|
||||
public override string Name { get; set; } = "攻击距离加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成)} 格攻击距离。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public int Value => 实际加成;
|
||||
|
||||
private readonly int 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExATR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExATR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExATR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exatr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && int.TryParse(Values[key].ToString(), out int exATR))
|
||||
{
|
||||
实际加成 = exATR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExActionCoefficient : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExActionCoefficient;
|
||||
public override string Name { get; set; } = "行动系数加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 行动系数。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExActionCoefficient += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExActionCoefficient -= 实际加成;
|
||||
}
|
||||
|
||||
public ExActionCoefficient(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exac", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exAC))
|
||||
{
|
||||
实际加成 = exAC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExCDR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExCDR;
|
||||
public override string Name { get; set; } = "冷却缩减加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 冷却缩减。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExCDR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExCDR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExCDR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("excdr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exCDR))
|
||||
{
|
||||
实际加成 = exCDR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExCritDMG : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExCritDMG;
|
||||
public override string Name { get; set; } = "暴击伤害加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 暴击伤害。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExCritDMG += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExCritDMG -= 实际加成;
|
||||
}
|
||||
|
||||
public ExCritDMG(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("excrd", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exCRD))
|
||||
{
|
||||
实际加成 = exCRD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExCritRate : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExCritRate;
|
||||
public override string Name { get; set; } = "暴击率加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 暴击率。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExCritRate += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExCritRate -= 实际加成;
|
||||
}
|
||||
|
||||
public ExCritRate(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("excr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exCR))
|
||||
{
|
||||
实际加成 = exCR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExDEF : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExDEF;
|
||||
public override string Name { get; set; } = "物理护甲加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点物理护甲。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExDEF2 += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExDEF2 -= 实际加成;
|
||||
}
|
||||
|
||||
public ExDEF(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exdef", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exDEF))
|
||||
{
|
||||
实际加成 = exDEF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExDEF2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExDEF2;
|
||||
public override string Name { get; set; } = "物理护甲加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础物理护甲" : $"{Math.Abs(实际加成):0.##}")} ] 点物理护甲。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExDEFPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseDEF * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExDEFPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExDEFPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础物理护甲变化时会实时反映到 ExDEF3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseDEF * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExDEF2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exdef", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exDEF))
|
||||
{
|
||||
加成比例 = exDEF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExEvadeRate : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExEvadeRate;
|
||||
public override string Name { get; set; } = "闪避率加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 闪避率。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExEvadeRate += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExEvadeRate -= 实际加成;
|
||||
}
|
||||
|
||||
public ExEvadeRate(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exer", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exER))
|
||||
{
|
||||
实际加成 = exER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExHR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExHR;
|
||||
public override string Name { get; set; } = "生命回复加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点生命回复。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExHR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExHR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExHR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exhr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exHR))
|
||||
{
|
||||
实际加成 = exHR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExINT : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExINT;
|
||||
public override string Name { get; set; } = "智力加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点智力。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExINT += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExINT -= 实际加成;
|
||||
}
|
||||
|
||||
public ExINT(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exint", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exINT))
|
||||
{
|
||||
实际加成 = exINT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExINT2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExINT2;
|
||||
public override string Name { get; set; } = "智力加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础智力" : $"{Math.Abs(实际加成):0.##}")} ] 点智力。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExINTPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseINT * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExINTPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExINTPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础智力变化时会实时反映到 ExINT3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseINT * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExINT2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exint", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exINT))
|
||||
{
|
||||
加成比例 = exINT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExLifesteal : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExLifesteal;
|
||||
public override string Name { get; set; } = "生命偷取加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 生命偷取。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.Lifesteal += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.Lifesteal -= 实际加成;
|
||||
}
|
||||
|
||||
public ExLifesteal(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exls", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exLS))
|
||||
{
|
||||
实际加成 = exLS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMDF : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMDF;
|
||||
public override string Name { get; set; } = "魔法抗性加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% {CharacterSet.GetMagicResistanceName(魔法类型)}。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
private readonly MagicType 魔法类型 = MagicType.None;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.MDF[魔法类型] += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.MDF[魔法类型] -= 实际加成;
|
||||
}
|
||||
|
||||
public ExMDF(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("mdftype", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && int.TryParse(Values[key].ToString(), out int mdfType))
|
||||
{
|
||||
if (Enum.IsDefined(typeof(MagicType), mdfType))
|
||||
{
|
||||
魔法类型 = (MagicType)mdfType;
|
||||
}
|
||||
else
|
||||
{
|
||||
魔法类型 = MagicType.None;
|
||||
}
|
||||
}
|
||||
key = Values.Keys.FirstOrDefault(s => s.Equals("mdfvalue", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double mdfValue))
|
||||
{
|
||||
实际加成 = mdfValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMOV : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMOV;
|
||||
public override string Name { get; set; } = "移动距离加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成)} 格移动距离。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public int Value => 实际加成;
|
||||
|
||||
private readonly int 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExMOV += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExMOV -= 实际加成;
|
||||
}
|
||||
|
||||
public ExMOV(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exmov", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && int.TryParse(Values[key].ToString(), out int exMOV))
|
||||
{
|
||||
实际加成 = exMOV;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMR;
|
||||
public override string Name { get; set; } = "魔法回复加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点魔法回复。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExMR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExMR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExMR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exmr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exMR))
|
||||
{
|
||||
实际加成 = exMR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMaxHP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMaxHP;
|
||||
public override string Name { get; set; } = "最大生命值加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点最大生命值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExHP2 += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExHP2 -= 实际加成;
|
||||
}
|
||||
|
||||
public ExMaxHP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exhp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exHP))
|
||||
{
|
||||
实际加成 = exHP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMaxHP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMaxHP2;
|
||||
public override string Name { get; set; } = "最大生命值加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础生命值" : $"{Math.Abs(实际加成):0.##}")} ] 点最大生命值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExHPPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseHP * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExHPPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExHPPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础生命值变化时会实时反映到 ExHP3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseHP * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExMaxHP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exhp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exHP))
|
||||
{
|
||||
加成比例 = exHP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMaxMP : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMaxMP;
|
||||
public override string Name { get; set; } = "最大魔法值加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点最大魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExMP2 += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExMP2 -= 实际加成;
|
||||
}
|
||||
|
||||
public ExMaxMP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exMP))
|
||||
{
|
||||
实际加成 = exMP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExMaxMP2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExMaxMP2;
|
||||
public override string Name { get; set; } = "最大魔法值加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础魔法值" : $"{Math.Abs(实际加成):0.##}")} ] 点最大魔法值。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExMP2 -= 已应用加成;
|
||||
}
|
||||
实际加成 = character.BaseMP * 加成比例;
|
||||
已应用加成 = 实际加成;
|
||||
character.ExMP2 += 已应用加成;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExMP2 -= 已应用加成;
|
||||
已应用加成 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 注意:此处与 ExATK2 等百分比加成不同,ExMP2 是固定点数加成,
|
||||
// 基础魔法值变化后不会自动跟随,必须重算并替换已生效的数值
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
character.ExMP2 -= 已应用加成;
|
||||
实际加成 = character.BaseMP * 加成比例;
|
||||
已应用加成 = 实际加成;
|
||||
character.ExMP2 += 已应用加成;
|
||||
}
|
||||
}
|
||||
|
||||
public ExMaxMP2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exmp", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exMP))
|
||||
{
|
||||
加成比例 = exMP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExPDR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExPDR;
|
||||
public override string Name { get; set; } = "物理伤害减免加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 物理伤害减免。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExPDR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExPDR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExPDR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("expdr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exPDR))
|
||||
{
|
||||
实际加成 = exPDR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExSPD : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExSPD;
|
||||
public override string Name { get; set; } = "行动速度加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点行动速度。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExSPD += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExSPD -= 实际加成;
|
||||
}
|
||||
|
||||
public ExSPD(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exspd", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exSPD))
|
||||
{
|
||||
实际加成 = exSPD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExSTR : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExSTR;
|
||||
public override string Name { get; set; } = "力量加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点力量。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExSTR += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExSTR -= 实际加成;
|
||||
}
|
||||
|
||||
public ExSTR(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exstr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exSTR))
|
||||
{
|
||||
实际加成 = exSTR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class ExSTR2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.ExSTR2;
|
||||
public override string Name { get; set; } = "力量加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(加成比例) * 100:0.##}% [ {(实际加成 == 0 ? "基于基础力量" : $"{Math.Abs(实际加成):0.##}")} ] 点力量。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 加成比例 = 0;
|
||||
private double 实际加成 = 0;
|
||||
private bool 加成已应用 = false;
|
||||
private double 已应用加成比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用)
|
||||
{
|
||||
// 仅首次获得时初始化剩余时间,避免后续刷新时被重置
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 已生效过:先还原旧值再套用新值,避免重复叠加
|
||||
character.ExSTRPercentage -= 已应用加成比例;
|
||||
}
|
||||
实际加成 = character.BaseSTR * 加成比例;
|
||||
已应用加成比例 = 加成比例;
|
||||
character.ExSTRPercentage += 已应用加成比例;
|
||||
加成已应用 = true;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!加成已应用) return;
|
||||
character.ExSTRPercentage -= 已应用加成比例;
|
||||
已应用加成比例 = 0;
|
||||
实际加成 = 0;
|
||||
加成已应用 = false;
|
||||
}
|
||||
|
||||
public override void OnAttributeChanged(HookContext ctx)
|
||||
{
|
||||
// 属性侧是百分比加成,基础力量变化时会实时反映到 ExSTR3,无需重新结算;
|
||||
// 此处只更新描述中展示的点数
|
||||
if (ctx.Trigger is Character character && 加成已应用)
|
||||
{
|
||||
实际加成 = character.BaseSTR * 加成比例;
|
||||
}
|
||||
}
|
||||
|
||||
public ExSTR2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exstr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exSTR))
|
||||
{
|
||||
加成比例 = exSTR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class IgnoreEvade : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.IgnoreEvade;
|
||||
public override string Name { get; set; } = "无视闪避";
|
||||
public override string Description => $"普通攻击有 {概率 * 100:0.##}% 概率无视闪避。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 概率;
|
||||
|
||||
private readonly double 概率 = 0;
|
||||
|
||||
public override BeforeEvadeCheckResult BeforeEvadeCheck(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character actor) return default;
|
||||
if (actor == Skill.Character && Random.NextDouble() < 概率)
|
||||
{
|
||||
if (GamingQueue != null) WriteLine($"[ {actor} ] 的普通攻击无视了 [ {ctx.Enemy} ] 的闪避!");
|
||||
return new BeforeEvadeCheckResult { SkipEvadeCheck = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public IgnoreEvade(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("p", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double p) && p >= 0 && p <= 1)
|
||||
{
|
||||
概率 = p;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class MagicalPenetration : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.MagicalPenetration;
|
||||
public override string Name { get; set; } = "魔法穿透加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 魔法穿透。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.MagicalPenetration += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.MagicalPenetration -= 实际加成;
|
||||
}
|
||||
|
||||
public MagicalPenetration(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exmpt", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exMPT))
|
||||
{
|
||||
实际加成 = exMPT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class NormalAttackHardTimeReduce : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.NormalAttackHardTimeReduce;
|
||||
public override string Name { get; set; } = "普通攻击硬直减少";
|
||||
public override string Description => $"{(实际硬直时间减少 < 0 ? "增加" : "减少")}角色的普通攻击 {实际硬直时间减少:0.##} {GameplayEquilibriumConstant.InGameTime}硬直时间。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
|
||||
private readonly double 实际硬直时间减少 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.NormalAttack.ExHardnessTime -= 实际硬直时间减少;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.NormalAttack.ExHardnessTime += 实际硬直时间减少;
|
||||
}
|
||||
|
||||
public NormalAttackHardTimeReduce(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("nahtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double nahtr) && nahtr > 0)
|
||||
{
|
||||
实际硬直时间减少 = nahtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class NormalAttackHardTimeReduce2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.NormalAttackHardTimeReduce2;
|
||||
public override string Name { get; set; } = "普通攻击硬直减少";
|
||||
public override string Description => $"{(减少比例 < 0 ? "增加" : "减少")}角色的普通攻击 {减少比例 * 100:0.##}% 硬直时间。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
|
||||
private readonly double 减少比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.NormalAttack.ExHardnessTime2 -= 减少比例;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.NormalAttack.ExHardnessTime2 += 减少比例;
|
||||
}
|
||||
|
||||
public NormalAttackHardTimeReduce2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("nahtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double nahtr) && nahtr > 0)
|
||||
{
|
||||
减少比例 = nahtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class PhysicalPenetration : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.PhysicalPenetration;
|
||||
public override string Name { get; set; } = "物理穿透加成";
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成) * 100:0.##}% 物理穿透。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
public double Value => 实际加成;
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.PhysicalPenetration += 实际加成;
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.PhysicalPenetration -= 实际加成;
|
||||
}
|
||||
|
||||
public PhysicalPenetration(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("exppt", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double exPPT))
|
||||
{
|
||||
实际加成 = exPPT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class SkillHardTimeReduce : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.SkillHardTimeReduce;
|
||||
public override string Name { get; set; } = "主动技能硬直减少";
|
||||
public override string Description => $"减少角色的所有主动技能 {实际硬直时间减少:0.##} {GameplayEquilibriumConstant.InGameTime}硬直时间。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
|
||||
private readonly double 实际硬直时间减少 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime -= 实际硬直时间减少;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime -= 实际硬直时间减少;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime += 实际硬直时间减少;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime += 实际硬直时间减少;
|
||||
}
|
||||
}
|
||||
|
||||
public SkillHardTimeReduce(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("shtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double shtr) && shtr > 0)
|
||||
{
|
||||
实际硬直时间减少 = shtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
|
||||
namespace OshimaBot.Content.Effects.OpenEffects
|
||||
{
|
||||
public class SkillHardTimeReduce2 : Effect
|
||||
{
|
||||
public override long Id => (long)EffectID.SkillHardTimeReduce2;
|
||||
public override string Name { get; set; } = "主动技能硬直减少";
|
||||
public override string Description => $"减少角色的所有主动技能 {减少比例 * 100:0.##}% 硬直时间。" + (Source != null && (Skill.Character != Source || Skill is not OpenSkill) ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : (Skill is OpenSkill ? "" : $" 的 [ {Skill.Name} ]")) : "");
|
||||
|
||||
private readonly double 减少比例 = 0;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (Durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime2 -= 减少比例;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime2 -= 减少比例;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
foreach (Skill s in character.Skills)
|
||||
{
|
||||
s.ExHardnessTime2 += 减少比例;
|
||||
}
|
||||
foreach (Skill? s in character.Items.Select(i => i.Skills.Active))
|
||||
{
|
||||
if (s != null)
|
||||
s.ExHardnessTime2 += 减少比例;
|
||||
}
|
||||
}
|
||||
|
||||
public SkillHardTimeReduce2(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
{
|
||||
EffectType = EffectType.Item;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
Source = source;
|
||||
if (Values.Count > 0)
|
||||
{
|
||||
string key = Values.Keys.FirstOrDefault(s => s.Equals("shtr", StringComparison.CurrentCultureIgnoreCase)) ?? "";
|
||||
if (key.Length > 0 && double.TryParse(Values[key].ToString(), out double shtr) && shtr > 0)
|
||||
{
|
||||
减少比例 = shtr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// 装备【接力信标】的指引标记 —— 装备期间由穿戴者挂到每名队友的状态栏上。
|
||||
/// <para/>与前两个标记不同,本标记<b>自身即收益</b>:硬直钩子只通知「行动者自己」的特效,
|
||||
/// 因此把标记挂在队友身上,等价于把"硬直减免"当作一层光环施加给队友。
|
||||
/// <para/>无状态增减(只在钩子里返回比率),因此天然幂等;
|
||||
/// 卸装 / 换装时由【接力信标特效】撤回,撤销光环。
|
||||
/// </summary>
|
||||
public class 信标标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.信标标记;
|
||||
public override string Name => "信标标记";
|
||||
public override string Description => $"此角色正受 [ {Source} ] 的接力信标指引,普攻与技能硬直减少 {_硬直减免 * 100:0.##}%。";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
|
||||
/// <summary>友方标记,非负面效果</summary>
|
||||
public override bool IsDebuff => false;
|
||||
|
||||
/// <summary>无具体时长,随装备存续</summary>
|
||||
public override bool DurativeWithoutDuration => true;
|
||||
|
||||
/// <summary>内部簿记标记,不可被任何形态的驱散移除</summary>
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
public override Character Source => _sourceCharacter;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly double _硬直减免;
|
||||
|
||||
/// <summary>标记宿主(由 <see cref="OnEffectGained"/> 捕获;标记总是通过 <see cref="Effect.AddToCharacter"/> 挂载)</summary>
|
||||
private Character? _host;
|
||||
|
||||
public 信标标记(Skill skill, Character sourceCharacter, double 硬直减免) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_硬直减免 = 硬直减免;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
_host = ctx.Trigger;
|
||||
}
|
||||
|
||||
public override AlterHardnessTimeResult AlterHardnessTimeAfterNormalAttack(HardnessContext ctx)
|
||||
{
|
||||
return 计算(ctx);
|
||||
}
|
||||
|
||||
public override AlterHardnessTimeResult AlterHardnessTimeAfterCastSkill(HardnessContext ctx)
|
||||
{
|
||||
return 计算(ctx);
|
||||
}
|
||||
|
||||
private AlterHardnessTimeResult 计算(HardnessContext ctx)
|
||||
{
|
||||
// 硬直钩子按「行动者的特效」分发,本标记只可能挂在行动中的队友身上;仍做一次归属校验
|
||||
if (_host is null || ctx.Trigger != _host) return default;
|
||||
// Factor 语义:最终硬直 = 基础硬直 × (1 + Factor),故"减少 N%"传 -N;default(0) 即不干预
|
||||
return new AlterHardnessTimeResult { Factor = -_硬直减免 };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using OshimaBot.Content.Items;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// 装备【共鸣核心】的监听标记 —— 穿戴时由穿戴者挂到每名队友的状态栏上。
|
||||
/// <para/>与【巡诊标记】同理:框架中大部分细粒度钩子只通知「触发者 + 目标」的特效,
|
||||
/// 穿戴者无法直接监听队友的出手,必须把本标记挂进队友状态栏,
|
||||
/// 让标记以宿主的身份收到 <see cref="Effect.AfterDamageCalculation"/>,再转发给【共鸣核心特效】。
|
||||
/// <para/>本标记自身不产生任何收益,是内部簿记用标记,不可被驱散;
|
||||
/// 卸装 / 换装时由控制器统一撤回,保证幂等。
|
||||
/// </summary>
|
||||
public class 共鸣标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.共鸣标记;
|
||||
public override string Name => "共鸣标记";
|
||||
public override string Description => $"此角色与 [ {Source} ] 的共鸣核心产生了共鸣。";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
|
||||
/// <summary>友方标记,非负面效果</summary>
|
||||
public override bool IsDebuff => false;
|
||||
|
||||
/// <summary>无具体时长,随装备存续</summary>
|
||||
public override bool DurativeWithoutDuration => true;
|
||||
|
||||
/// <summary>内部簿记标记,不可被任何形态的驱散移除</summary>
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
public override Character Source => _sourceCharacter;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly 共鸣核心特效 _controller;
|
||||
|
||||
/// <summary>标记宿主(由 <see cref="OnEffectGained"/> 捕获;标记总是通过 <see cref="Effect.AddToCharacter"/> 挂载)</summary>
|
||||
private Character? _host;
|
||||
|
||||
public 共鸣标记(Skill skill, Character sourceCharacter, 共鸣核心特效 controller) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_controller = controller;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
_host = ctx.Trigger;
|
||||
}
|
||||
|
||||
public override void AfterDamageCalculation(DamageContext ctx)
|
||||
{
|
||||
// 本标记会随宿主收到「宿主参与的所有伤害结算」,只关心宿主作为攻击方造成伤害的那一次
|
||||
Character? host = _host;
|
||||
if (host is null || ctx.Trigger != host) return;
|
||||
if (ctx.DamageResult != DamageResult.Normal && ctx.DamageResult != DamageResult.Critical) return;
|
||||
if (ctx.ActualDamage <= 0) return;
|
||||
_controller.TryGainEnergy(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 冻结(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : 完全行动不能(nameof(冻结), EffectType.Petrify, skill, sourceCharacter, durative, duration, durationTurn)
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.冻结;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 复制技能 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.复制技能;
|
||||
public override string Name => "复制技能";
|
||||
public override string Description => $"此角色持有技能 [ {_skill.Name} ] 的复制品。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
public Skill CopiedSkill => _skill;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly Skill _skill;
|
||||
|
||||
public 复制技能(Skill skill, Character sourceCharacter, Skill copiedSkill) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_skill = copiedSkill.Copy();
|
||||
_skill.Level = copiedSkill.Level;
|
||||
}
|
||||
|
||||
public CharacterActionType LastType { get; set; } = CharacterActionType.None;
|
||||
public Skill? LastSkill { get; set; } = null;
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
_skill.Character = character;
|
||||
_skill.OnLevelUp();
|
||||
character.Skills.Add(_skill);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
_skill.RemoveSkillFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 完全免疫 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.完全免疫;
|
||||
public override string Name => "完全免疫";
|
||||
public override string Description => $"此角色处于完全免疫状态,无法选中其作为普通攻击和技能的目标(自释放技能除外),免疫物理伤害和魔法伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.PhysicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 完全免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.All]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public override OnImmuneCheckResult OnImmuneCheck(ImmuneContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
Character? target = ctx.Target;
|
||||
if (character == target)
|
||||
{
|
||||
return new OnImmuneCheckResult { IgnoreImmunity = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 完全行动不能 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.完全行动不能;
|
||||
public override string Name => _name;
|
||||
public override string Description => $"此角色被{Name}了,不能行动。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => _type;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly string _name;
|
||||
private readonly EffectType _type;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 完全行动不能(string name, EffectType type, Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
_name = name;
|
||||
_type = type;
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectStatesToCharacter(character, [CharacterState.NotActionable]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Interface.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using OshimaBot.Content.Skills;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 宫监手标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.宫监手标记;
|
||||
public override string Name => "宫监手标记";
|
||||
public override string Description => $"{放监.任务要求}。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override DispelledType DispelledType { get; set; } = DispelledType.CannotBeDispelled;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly 放监特效 放监;
|
||||
private bool 已完成普攻任务 = false;
|
||||
private bool 已完成指向性技能任务 = false;
|
||||
|
||||
public 宫监手标记(Skill skill, Character sourceCharacter, Character targetCharacter, 放监特效 effect) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_targetCharacter = targetCharacter;
|
||||
放监 = effect;
|
||||
}
|
||||
|
||||
public void 普攻任务完成(Character character)
|
||||
{
|
||||
WriteLine($"[ {character} ] 的「放监」任务 [ 对友方角色普通攻击 ] 完成!");
|
||||
已完成普攻任务 = true;
|
||||
CheckComplete(character);
|
||||
}
|
||||
|
||||
public void 指向性技能任务完成(Character character)
|
||||
{
|
||||
WriteLine($"[ {character} ] 的「放监」任务 [ 对{Source}释放指向性技能 ] 完成!");
|
||||
已完成指向性技能任务 = true;
|
||||
CheckComplete(character);
|
||||
}
|
||||
|
||||
public void CheckComplete(Character character)
|
||||
{
|
||||
if (已完成普攻任务 && 已完成指向性技能任务)
|
||||
{
|
||||
character.Effects.Remove(this);
|
||||
WriteLine($"[ {character} ] 已消除宫监手标记!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void AlterSelectListBeforeSelection(SelectionContext ctx)
|
||||
{
|
||||
ISkill? skill = ctx.Skill;
|
||||
List<Character> enemys = ctx.Enemys;
|
||||
List<Character> teammates = ctx.Teammates;
|
||||
if (skill is NormalAttack)
|
||||
{
|
||||
enemys.AddRange(teammates);
|
||||
}
|
||||
}
|
||||
|
||||
public override BeforeCriticalCheckResult BeforeCriticalCheck(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character actor) return default;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
if (actor == _targetCharacter && isNormalAttack)
|
||||
{
|
||||
return new BeforeCriticalCheckResult { ThrowingBonusDelta = 300 };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public override BeforeEvadeCheckResult BeforeEvadeCheck(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character actor) return default;
|
||||
if (actor == _targetCharacter)
|
||||
{
|
||||
return new BeforeEvadeCheckResult { SkipEvadeCheck = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public override void AfterDamageCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (ctx.Enemy is not Character enemy) return;
|
||||
bool isNormalAttack = ctx.IsNormalAttack;
|
||||
DamageResult damageResult = ctx.DamageResult;
|
||||
if (character == _targetCharacter && isNormalAttack && (damageResult == DamageResult.Normal || damageResult == DamageResult.Critical))
|
||||
{
|
||||
if (GamingQueue != null && GamingQueue.IsTeammate(character, enemy))
|
||||
{
|
||||
普攻任务完成(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AfterDeathCalculation(DeathContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character death) return;
|
||||
if (death == _targetCharacter)
|
||||
{
|
||||
death.Effects.Remove(this);
|
||||
}
|
||||
if (death == _sourceCharacter)
|
||||
{
|
||||
_targetCharacter.Effects.Remove(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (!已完成普攻任务 || !已完成指向性技能任务)
|
||||
{
|
||||
放监.造成伤害(character, !已完成普攻任务 && !已完成指向性技能任务 ? 2 : 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 封技 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.封技;
|
||||
public override string Name => "封技";
|
||||
public override string Description => $"此角色被封技了,不能使用技能(魔法、战技和爆发技)。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Silence;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 封技(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectStatesToCharacter(character, [CharacterState.SkillRestricted]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using OshimaBot.Content.Items;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// 装备【行军医箱】的监听标记 —— 穿戴时由穿戴者挂到每名队友的状态栏上。
|
||||
/// <para/>存在意义:框架中大部分细粒度钩子(如 <see cref="Effect.AfterDamageCalculation"/>)
|
||||
/// 只通知「触发者 + 目标」的特效,穿戴者无法直接监听队友的受击事件。
|
||||
/// 因此必须像【开宫】挂【长期监视】那样,把本标记挂进队友状态栏,
|
||||
/// 让标记以宿主自己的身份收到钩子,再把信号转发给穿戴者侧的【行军医箱特效】。
|
||||
/// <para/>本标记自身不产生任何收益,是内部簿记用标记,<b>不可被驱散</b>;
|
||||
/// 当装备被卸下 / 被空投替换时,由控制器统一撤回,保证幂等。
|
||||
/// </summary>
|
||||
public class 巡诊标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.巡诊标记;
|
||||
public override string Name => "巡诊标记";
|
||||
public override string Description => $"此角色处于 [ {Source} ] 的行军医箱巡诊范围内。";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
|
||||
/// <summary>友方标记,非负面效果</summary>
|
||||
public override bool IsDebuff => false;
|
||||
|
||||
/// <summary>无具体时长,随装备存续</summary>
|
||||
public override bool DurativeWithoutDuration => true;
|
||||
|
||||
/// <summary>内部簿记标记,不可被任何形态的驱散移除</summary>
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
public override Character Source => _sourceCharacter;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly 行军医箱特效 _controller;
|
||||
|
||||
/// <summary>标记宿主(由 <see cref="OnEffectGained"/> 捕获;标记总是通过 <see cref="Effect.AddToCharacter"/> 挂载)</summary>
|
||||
private Character? _host;
|
||||
|
||||
public 巡诊标记(Skill skill, Character sourceCharacter, 行军医箱特效 controller) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_controller = controller;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
_host = ctx.Trigger;
|
||||
}
|
||||
|
||||
public override void AfterDamageCalculation(DamageContext ctx)
|
||||
{
|
||||
// 本标记会随宿主收到「宿主参与的所有伤害结算」,只关心宿主作为受击方的那一次
|
||||
Character? host = _host;
|
||||
if (host is null || ctx.Enemy != host) return;
|
||||
if (ctx.DamageResult != DamageResult.Normal && ctx.DamageResult != DamageResult.Critical) return;
|
||||
if (ctx.ActualDamage <= 0) return;
|
||||
_controller.TryEmergencyHeal(host);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using FunGame.Core.Api;
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
using Milimoe.FunGameTesting.Others;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// 强运:被动状态(由【十二宫星环】等来源施加,按回合计时)
|
||||
/// <para/>· 所属角色每个回合结束时,随机生成 2~3 份绑定自身的【回合奖励】
|
||||
/// <para/>· 奖励取自模组公共的 <see cref="RoundRewardPool"/>(与队列内置奖励同构):
|
||||
/// 用 <see cref="Factory.OpenFactory"/> 构造奖励技能(Skill 由 OpenSkill 承载、Effect 按 EffectID 构造),
|
||||
/// 再经 <see cref="FunGame.Core.Interface.Base.IGamingQueue.AddRoundReward"/> 绑定到角色名下
|
||||
/// <para/>· 仅在启用「角色绑定的回合奖励」时才能真正生成(否则 <c>AddRoundReward</c> 返回 false)
|
||||
/// </summary>
|
||||
public class 强运 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.强运;
|
||||
public override string Name => "强运";
|
||||
public override string Description =>
|
||||
$"此角色处于强运状态:每个回合结束时,随机生成 {最小生成数量}~{最大生成数量} 份绑定自身的回合奖励,并顺延到其下一个行动回合。持续 {DurationTurn} 回合。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override bool IsDebuff => false;
|
||||
public override Character? Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
/// <summary>每次触发最少生成的奖励数量</summary>
|
||||
public const int 最小生成数量 = 2;
|
||||
|
||||
/// <summary>每次触发最多生成的奖励数量</summary>
|
||||
public const int 最大生成数量 = 3;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 强运(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTurnEnd(TurnContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character || character != _targetCharacter || character.HP <= 0) return;
|
||||
if (GamingQueue is null) return;
|
||||
|
||||
Dictionary<EffectID, Dictionary<string, object>> 奖励池 = RoundRewardPool.Create(Random);
|
||||
EffectID[] ids = [.. 奖励池.Keys];
|
||||
int count = Random.Next(最小生成数量, 最大生成数量 + 1);
|
||||
List<string> generatedNames = [];
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
EffectID id = ids[Random.Next(ids.Length)];
|
||||
Skill reward = 构造奖励(id, 奖励池[id]);
|
||||
if (!GamingQueue.AddRoundReward(character, 1, reward))
|
||||
{
|
||||
break;
|
||||
}
|
||||
generatedNames.Add(reward.Name);
|
||||
}
|
||||
|
||||
if (generatedNames.Count > 0)
|
||||
{
|
||||
WriteLine($"[ {character} ] 受到强运眷顾,为下一行动回合生成了 {generatedNames.Count} 份回合奖励:{string.Join("、", generatedNames)}!");
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteLine($"[ {character} ] 的强运未能生成回合奖励(未启用角色绑定的回合奖励)。");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从公共奖励池构造一份奖励技能(与队列的 CreateRoundRewardSkill 同构)
|
||||
/// </summary>
|
||||
private static Skill 构造奖励(EffectID id, Dictionary<string, object> effectArgs)
|
||||
{
|
||||
Dictionary<string, object> skillArgs = [];
|
||||
if (RoundRewardPool.IsActive(id))
|
||||
{
|
||||
skillArgs.Add("active", true);
|
||||
skillArgs.Add("self", true);
|
||||
skillArgs.Add("enemy", false);
|
||||
}
|
||||
|
||||
Skill skill = Factory.OpenFactory.GetInstance<Skill>((long)id, "", skillArgs);
|
||||
Effect effect = Factory.OpenFactory.GetInstance((long)id, "", skill, new(effectArgs));
|
||||
skill.Effects.Add(effect);
|
||||
skill.Name = $"[R] {effect.Name}";
|
||||
return skill;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 愤怒 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.愤怒;
|
||||
public override string Name => "愤怒";
|
||||
public override string Description => $"此角色处于愤怒状态,行动受限且失控,行动回合中无法自主行动,仅能对 [ {_targetCharacter} ] 发起普通攻击。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Taunt;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 愤怒(Skill skill, Character sourceCharacter, Character targetCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_targetCharacter = targetCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void AlterSelectListBeforeAction(SelectionContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
List<Character> enemys = ctx.Enemys;
|
||||
List<Character> teammates = ctx.Teammates;
|
||||
// 为了确保角色能够自动化行动,这里需要将角色设置为可行动
|
||||
if (character.CharacterState == CharacterState.ActionRestricted)
|
||||
{
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
character.CharacterState = CharacterState.Actionable;
|
||||
}
|
||||
enemys.Clear();
|
||||
teammates.Clear();
|
||||
if (_targetCharacter.HP > 0)
|
||||
{
|
||||
enemys.Add(_targetCharacter);
|
||||
}
|
||||
}
|
||||
|
||||
public override AlterActionTypeResult AlterActionTypeBeforeAction(DecisionContext ctx)
|
||||
{
|
||||
if (_targetCharacter.HP > 0)
|
||||
{
|
||||
// 目标存活:强制倾向普通攻击,禁止使用物品与技能
|
||||
return new AlterActionTypeResult { ForceAction = true, PNormalAttack = 1, CanUseItem = false, CanCastSkill = false };
|
||||
}
|
||||
// 如果目标已死亡,则放弃本回合行动,并在回合结束后自动移除愤怒状态
|
||||
RemainDuration = 0;
|
||||
RemainDurationTurn = 0;
|
||||
return new AlterActionTypeResult { ForceAction = true, ActionType = CharacterActionType.EndTurn };
|
||||
}
|
||||
|
||||
public override void AfterDeathCalculation(DeathContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character death) return;
|
||||
if (death == _targetCharacter)
|
||||
{
|
||||
// 如果目标死亡,则在下次时间流逝时自动移除愤怒状态
|
||||
RemainDuration = 0;
|
||||
RemainDurationTurn = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTurnEnd(TurnContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.UpdateCharacterState();
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
AddEffectStatesToCharacter(character, [CharacterState.ActionRestricted]);
|
||||
AddEffectTypeToCharacter(character, [EffectType.Taunt]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
GamingQueue?.SetCharactersToAIControl(true, true, character);
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 战斗不能 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.战斗不能;
|
||||
public override string Name => "战斗不能";
|
||||
public override string Description => $"此角色处于战斗不能状态,无法普通攻击和使用技能(魔法、战技和爆发技),无法对敌人或者队友使用物品。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Cripple;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 战斗不能(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectStatesToCharacter(character, [CharacterState.BattleRestricted]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 技能免疫 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.技能免疫;
|
||||
public override string Name => "技能免疫";
|
||||
public override string Description => $"此角色处于技能免疫状态,无法选中其作为技能目标(自释放技能除外),并免疫来自技能的伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.SkilledImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 技能免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.Skilled]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public override OnImmuneCheckResult OnImmuneCheck(ImmuneContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
Character? target = ctx.Target;
|
||||
if (character == target)
|
||||
{
|
||||
return new OnImmuneCheckResult { IgnoreImmunity = true };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.Framework;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 持续伤害 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.持续伤害;
|
||||
public override string Name { get; set; } = "持续伤害";
|
||||
public override string Description => $"此角色正受到持续伤害,每{GameplayEquilibriumConstant.InGameTime}受到 {(_isPercentage ? $"{_durationDamagePercent * 100:0.##}% 当前生命值 [ {Damage:0.##} ]" : Damage.ToString("0.##"))} 点{CharacterSet.GetDamageTypeName(_damageType)}。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override bool IsDebuff { get; set; } = true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly bool _isPercentage;
|
||||
private readonly double _durationDamage;
|
||||
private readonly double _durationDamagePercent;
|
||||
private readonly DamageType _damageType = DamageType.Physical;
|
||||
private readonly DamageCalculationOptions? _options = null;
|
||||
private double Damage => _isPercentage ? _targetCharacter.HP * _durationDamagePercent : _durationDamage;
|
||||
|
||||
public 持续伤害(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1,
|
||||
bool isPercentage = true, double durationDamage = 100, double durationDamagePercent = 0.02, DamageType damageType = DamageType.Physical, DamageCalculationOptions? options = null) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_isPercentage = isPercentage;
|
||||
_durationDamage = durationDamage;
|
||||
_durationDamagePercent = durationDamagePercent;
|
||||
_damageType = damageType;
|
||||
_options = options;
|
||||
}
|
||||
|
||||
private double GetDamage(double hp, double elapsed)
|
||||
{
|
||||
if (hp <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
double damage = _isPercentage ? hp * _durationDamagePercent : _durationDamage;
|
||||
return damage * elapsed;
|
||||
}
|
||||
|
||||
public override void OnTimeElapsed(TimeLapseContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
double elapsed = ctx.Elapsed;
|
||||
if (character == _targetCharacter && character.HP > 0)
|
||||
{
|
||||
double hp = character.HP;
|
||||
double damage = GetDamage(hp, elapsed);
|
||||
if (elapsed > 1)
|
||||
{
|
||||
damage = 0;
|
||||
int loop = 0;
|
||||
int elapsedSecond = (int)elapsed;
|
||||
for (; loop < elapsedSecond; loop++)
|
||||
{
|
||||
double current = GetDamage(hp, 1);
|
||||
damage += current;
|
||||
hp -= current;
|
||||
elapsed--;
|
||||
}
|
||||
if (elapsed > 0)
|
||||
{
|
||||
damage += GetDamage(hp, elapsed);
|
||||
}
|
||||
}
|
||||
DamageToEnemy(Source, character, _damageType, MagicType, damage, _options);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 持续回复 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.持续回复;
|
||||
public override string Name => "持续回复";
|
||||
public override string Description => $"此角色处于持续回复状态,每{GameplayEquilibriumConstant.InGameTime}回复 {(_isPercentage ? $"{_durationHealPercent * 100:0.##}% [ {Heal:0.##} ]" : Heal.ToString("0.##"))} 点当前生命值。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.HealOverTime;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly bool _isPercentage;
|
||||
private readonly double _durationHeal;
|
||||
private readonly double _durationHealPercent;
|
||||
private double Heal => _isPercentage ? _targetCharacter.HP * _durationHealPercent : _durationHeal;
|
||||
|
||||
public 持续回复(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1,
|
||||
bool isPercentage = true, double durationHeal = 100, double durationHealPercent = 0.02) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_isPercentage = isPercentage;
|
||||
_durationHeal = durationHeal;
|
||||
_durationHealPercent = durationHealPercent;
|
||||
}
|
||||
|
||||
private double GetHeal(double hp, double elapsed)
|
||||
{
|
||||
if (hp <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
double heal = _isPercentage ? hp * _durationHealPercent : _durationHeal;
|
||||
return heal * elapsed;
|
||||
}
|
||||
|
||||
public override void OnTimeElapsed(TimeLapseContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
double elapsed = ctx.Elapsed;
|
||||
if (character == _targetCharacter && character.HP > 0)
|
||||
{
|
||||
double hp = character.HP;
|
||||
double heal = GetHeal(hp, elapsed);
|
||||
if (elapsed > 1)
|
||||
{
|
||||
heal = 0;
|
||||
int loop = 0;
|
||||
int elapsedSecond = (int)elapsed;
|
||||
for (; loop < elapsedSecond; loop++)
|
||||
{
|
||||
double current = GetHeal(hp, 1);
|
||||
heal += current;
|
||||
hp -= current;
|
||||
elapsed--;
|
||||
}
|
||||
if (elapsed > 0)
|
||||
{
|
||||
heal += GetHeal(hp, elapsed);
|
||||
}
|
||||
}
|
||||
HealToTarget(Source, character, heal, triggerEffects: false);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType.HealOverTime]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 持续性弱驱散 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.持续性弱驱散;
|
||||
public override string Name => "持续性弱驱散";
|
||||
public override string Description => $"此角色正在被持续性弱驱散。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.WeakDispelling;
|
||||
public override DispelType DispelType => DispelType.DurativeWeak;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool DurativeWithoutDuration => _durativeWithoutDuration;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durativeWithoutDuration;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 持续性弱驱散(Skill skill, Character sourceCharacter, bool durativeWithoutDuration = false, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
DispelledType = DispelledType.Weak;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durativeWithoutDuration = durativeWithoutDuration;
|
||||
if (!_durativeWithoutDuration)
|
||||
{
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
}
|
||||
|
||||
public override BeforeSkillCastWillBeInterruptedResult BeforeSkillCastWillBeInterrupted(SkillCastContext ctx)
|
||||
{
|
||||
return new BeforeSkillCastWillBeInterruptedResult { BlockInterruption = true };
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 持续性强驱散 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.持续性强驱散;
|
||||
public override string Name => "持续性强驱散";
|
||||
public override string Description => $"此角色正在被持续性强驱散。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.StrongDispelling;
|
||||
public override DispelType DispelType => DispelType.DurativeStrong;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool DurativeWithoutDuration => _durativeWithoutDuration;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durativeWithoutDuration;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 持续性强驱散(Skill skill, Character sourceCharacter, bool durativeWithoutDuration = false, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
DispelledType = DispelledType.Strong;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durativeWithoutDuration = durativeWithoutDuration;
|
||||
if (!_durativeWithoutDuration)
|
||||
{
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
}
|
||||
|
||||
public override BeforeSkillCastWillBeInterruptedResult BeforeSkillCastWillBeInterrupted(SkillCastContext ctx)
|
||||
{
|
||||
return new BeforeSkillCastWillBeInterruptedResult { BlockInterruption = true };
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 时雨标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.时雨标记;
|
||||
public override string Name => "时雨标记";
|
||||
public override string Description => $"此角色持有时雨标记。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override DispelledType DispelledType { get; set; } = DispelledType.Weak;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
|
||||
public 时雨标记(Skill skill, Character sourceCharacter) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
}
|
||||
|
||||
public override void OnTurnStart(TurnContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (GamingQueue is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<Character> enemies = GamingQueue.GetEnemies(character);
|
||||
if (enemies.Contains(Source) && Random.NextDouble() < 0.65)
|
||||
{
|
||||
WriteLine($"[ {character} ] 受到了{nameof(时雨标记)}的影响,陷入了混乱!!!");
|
||||
Effect e = new 混乱(Skill, character, false, 0, 1);
|
||||
character.Effects.Add(e);
|
||||
e.OnEffectGained(new HookContext(GamingQueue, character));
|
||||
}
|
||||
}
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
if (ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
if (GamingQueue is null)
|
||||
{
|
||||
return default;
|
||||
|
||||
}
|
||||
List<Character> teammates = GamingQueue.GetTeammates(character);
|
||||
if ((character == Source || teammates.Contains(Source)) && character.Effects.Any(e => e is 时雨标记) && enemy.Effects.Any(e => e is 时雨标记))
|
||||
{
|
||||
double bonus = damage * 0.25;
|
||||
WriteLine($"[ {character} ] 受到了{nameof(时雨标记)}的影响,伤害提高了 {bonus:0.##} 点!");
|
||||
return new AlterActualDamageResult { DamageDelta = bonus };
|
||||
|
||||
}
|
||||
return default;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 易伤 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.易伤;
|
||||
public override string Name => "易伤";
|
||||
public override string Description => $"此角色处于易伤状态,额外受到 {_exDamagePercent * 100:0.##}% {CharacterSet.GetDamageTypeName(_damageType)}。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Vulnerable;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly DamageType _damageType;
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _exDamagePercent;
|
||||
|
||||
public 易伤(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1,
|
||||
DamageType damageType = DamageType.Magical, double exDamagePercent = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_damageType = damageType;
|
||||
_exDamagePercent = exDamagePercent;
|
||||
}
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
DamageType damageType = ctx.DamageType;
|
||||
if (enemy == _targetCharacter && damageType == _damageType)
|
||||
{
|
||||
return new AlterActualDamageResult { DamageDelta = damage * _exDamagePercent };
|
||||
|
||||
}
|
||||
return default;
|
||||
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType.Vulnerable]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 易损 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.易损;
|
||||
public override string Name => "易损";
|
||||
public override string Description => $"此角色处于易损状态,承受伤害提升 {_exDamagePercent * 100:0.##}%。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Vulnerable;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _exDamagePercent;
|
||||
|
||||
public 易损(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1, double exDamagePercent = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_exDamagePercent = exDamagePercent;
|
||||
}
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Enemy is not Character enemy) return default;
|
||||
double damage = ctx.Damage;
|
||||
if (enemy == _targetCharacter)
|
||||
{
|
||||
return new AlterActualDamageResult { DamageDelta = damage * _exDamagePercent };
|
||||
|
||||
}
|
||||
return default;
|
||||
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType.Vulnerable]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.标记;
|
||||
public override string Name => $"{_name}标记";
|
||||
public override string Description => $"此角色持有{Name}。{OtherDescription}来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public string OtherDescription { get; set; } = "";
|
||||
|
||||
private readonly string _name;
|
||||
private readonly Character _sourceCharacter;
|
||||
|
||||
public 标记(Skill skill, string name, Character sourceCharacter) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_name = name;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 气绝 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.气绝;
|
||||
public override string Name => "气绝";
|
||||
public override string Description => $"此角色处于气绝状态,行动受限并且每{GameplayEquilibriumConstant.InGameTime}流失 {(_isPercentage ? $"{_durationDamagePercent * 100:0.##}% [ {Damage:0.##} ]" : Damage.ToString("0.##"))} 点当前生命值,此生命流失效果不会导致角色死亡。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Bleed;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly bool _isPercentage;
|
||||
private readonly double _durationDamage;
|
||||
private readonly double _durationDamagePercent;
|
||||
private double Damage => _isPercentage ? _targetCharacter.HP * _durationDamagePercent : _durationDamage;
|
||||
|
||||
public 气绝(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1,
|
||||
bool isPercentage = true, double durationDamage = 100, double durationDamagePercent = 0.02) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_isPercentage = isPercentage;
|
||||
_durationDamage = durationDamage;
|
||||
_durationDamagePercent = durationDamagePercent;
|
||||
}
|
||||
|
||||
private double GetDamage(double hp, double elapsed)
|
||||
{
|
||||
if (hp <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
double damage = _isPercentage ? hp * _durationDamagePercent : _durationDamage;
|
||||
return damage * elapsed;
|
||||
}
|
||||
|
||||
public override void OnTimeElapsed(TimeLapseContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
double elapsed = ctx.Elapsed;
|
||||
if (character == _targetCharacter && character.HP > 0)
|
||||
{
|
||||
double hp = character.HP;
|
||||
double damage = GetDamage(hp, elapsed);
|
||||
if (elapsed > 1)
|
||||
{
|
||||
damage = 0;
|
||||
int loop = 0;
|
||||
int elapsedSecond = (int)elapsed;
|
||||
for (; loop < elapsedSecond; loop++)
|
||||
{
|
||||
double current = GetDamage(hp, 1);
|
||||
damage += current;
|
||||
hp -= current;
|
||||
elapsed--;
|
||||
}
|
||||
if (elapsed > 0)
|
||||
{
|
||||
damage += GetDamage(hp, elapsed);
|
||||
}
|
||||
}
|
||||
character.HP -= damage;
|
||||
if (character.HP <= 0)
|
||||
{
|
||||
character.HP = 1;
|
||||
}
|
||||
GamingQueue?.CalculateCharacterDamageStatistics(Source, character, damage, DamageType.True);
|
||||
WriteLine($"[ {character} ] 因气绝而流失了 {damage:0.##} 点生命值!");
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType.Bleed]);
|
||||
AddEffectStatesToCharacter(character, [CharacterState.ActionRestricted]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 海王星的野望标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.海王星的野望标记;
|
||||
public override string Name => "海王星的野望标记";
|
||||
public override string Description => $"此角色持有海王星的野望标记。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
|
||||
public 海王星的野望标记(Skill skill, Character sourceCharacter) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using FunGame.Core.Model.Framework;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 混乱 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.混乱;
|
||||
public override string Name => "混乱";
|
||||
public override string Description => $"此角色处于混乱状态,行动受限且失控,行动回合中无法自主行动而是随机行动,在进行攻击指令时,可能会选取友方角色为目标。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Confusion;
|
||||
public override DispelledType DispelledType => DispelledType.Strong;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 混乱(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void AlterSelectListBeforeAction(SelectionContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
List<Character> enemys = ctx.Enemys;
|
||||
List<Character> teammates = ctx.Teammates;
|
||||
// 为了确保角色能够混乱行动,这里需要将角色设置为可行动
|
||||
if (character.CharacterState == CharacterState.ActionRestricted)
|
||||
{
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
character.CharacterState = CharacterState.Actionable;
|
||||
}
|
||||
enemys.AddRange(teammates);
|
||||
teammates.AddRange(enemys);
|
||||
}
|
||||
|
||||
public override AlterActionTypeResult AlterActionTypeBeforeAction(DecisionContext ctx)
|
||||
{
|
||||
DecisionPoints dp = ctx.DP;
|
||||
return new AlterActionTypeResult
|
||||
{
|
||||
ForceAction = true,
|
||||
ActionType = GamingQueue?.GetActionType(dp, ctx.PUseItem, ctx.PCastSkill, ctx.PNormalAttack) ?? CharacterActionType.EndTurn
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnTurnEnd(TurnContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.UpdateCharacterState();
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
GamingQueue?.SetCharactersToAIControl(true, false, character);
|
||||
AddEffectStatesToCharacter(character, [CharacterState.ActionRestricted]);
|
||||
AddEffectTypeToCharacter(character, [EffectType.Confusion]);
|
||||
InterruptCasting(character, Source);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
GamingQueue?.SetCharactersToAIControl(true, true, character);
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 物理免疫 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.物理免疫;
|
||||
public override string Name => "物理免疫";
|
||||
public override string Description => $"此角色处于物理免疫状态,免疫物理伤害。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.PhysicalImmune;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 物理免疫(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddImmuneTypesToCharacter(character, [ImmuneType.Physical]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveImmuneTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 物理护盾 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.物理护盾;
|
||||
public override string Name => "物理护盾";
|
||||
public override string Description => $"此角色拥有物理护盾{CurrentShield}。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Shield;
|
||||
public override DispelledType DispelledType => DispelledType.CannotBeDispelled;
|
||||
public override bool DurativeWithoutDuration => true;
|
||||
public override bool IsDebuff => false;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
private string CurrentShield
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_targetCharacter != null && _targetCharacter.Shield.ShieldOfEffects.TryGetValue(this, out ShieldOfEffect? value) && value != null)
|
||||
{
|
||||
return $",护盾值:{value.Shield:0.##} 点";
|
||||
}
|
||||
else return "";
|
||||
}
|
||||
}
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly double _shield;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 物理护盾(Skill skill, Character targetCharacter, Character sourceCharacter, double shield, bool durative = false, double duration = 0, int durationTurn = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_shield = shield;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.Shield.AddShieldOfEffect(new(this, _shield, ShieldType.Physical, MagicType.None));
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.Shield.RemoveShieldOfEffect(this);
|
||||
}
|
||||
|
||||
public override OnShieldBrokenResult OnShieldBroken(ShieldContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
Effect? effet = ctx.ShieldEffect;
|
||||
if (effet == this)
|
||||
{
|
||||
character.Shield.RemoveShieldOfEffect(this);
|
||||
character.Effects.Remove(this);
|
||||
}
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 电刑标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.电刑标记;
|
||||
public override string Name => "电刑标记";
|
||||
public override string Description => $"此角色持有电刑标记,层数:{层数} 层。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public int 层数 { get; set; } = 1;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
|
||||
public 电刑标记(Skill skill, Character sourceCharacter) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 眩晕(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : 完全行动不能(nameof(眩晕), EffectType.Stun, skill, sourceCharacter, durative, duration, durationTurn)
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.眩晕;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 石化(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : 完全行动不能(nameof(石化), EffectType.Petrify, skill, sourceCharacter, durative, duration, durationTurn)
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.石化;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 禁止治疗 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.禁止治疗;
|
||||
public override string Name => "禁止治疗";
|
||||
public override string Description => $"此角色已被禁止治疗{禁止类型}。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.GrievousWound;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
|
||||
public string 禁止类型
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_allowRecovery && _allowLifeSteal && _allowHealing)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
List<string> strings = [];
|
||||
if (!_allowRecovery)
|
||||
{
|
||||
strings.Add("自然回复");
|
||||
}
|
||||
if (!_allowLifeSteal)
|
||||
{
|
||||
strings.Add("生命偷取");
|
||||
}
|
||||
if (!_allowHealing)
|
||||
{
|
||||
strings.Add("应用治疗");
|
||||
}
|
||||
return $"({string.Join("、", strings)})";
|
||||
}
|
||||
}
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _allowRecovery;
|
||||
private readonly bool _allowLifeSteal;
|
||||
private readonly bool _allowHealing;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 禁止治疗(Skill skill, Character sourceCharacter, bool allowRecovery = false, bool allowLifeSteal = false, bool allowHealing = false, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_allowRecovery = allowRecovery;
|
||||
_allowLifeSteal = allowLifeSteal;
|
||||
_allowHealing = allowHealing;
|
||||
if (!_allowHealing)
|
||||
{
|
||||
_allowLifeSteal = false;
|
||||
_allowRecovery = false;
|
||||
}
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override BeforeApplyRecoveryResult BeforeApplyRecoveryAtTimeLapsing(TimeLapseContext ctx)
|
||||
{
|
||||
return new BeforeApplyRecoveryResult { CancelRecovery = !_allowRecovery };
|
||||
}
|
||||
|
||||
public override BeforeLifestealResult BeforeLifesteal(LifestealContext ctx)
|
||||
{
|
||||
return new BeforeLifestealResult { CancelLifesteal = !_allowLifeSteal };
|
||||
}
|
||||
|
||||
public override BeforeHealToTargetResult BeforeHealToTarget(HealContext ctx)
|
||||
{
|
||||
return new BeforeHealToTargetResult { CancelHeal = !_allowHealing };
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_allowRecovery && _allowLifeSteal && _allowHealing)
|
||||
{
|
||||
character.Effects.Remove(this);
|
||||
return;
|
||||
}
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 累积之压标记 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.累积之压标记;
|
||||
public override string Name => "累积之压标记";
|
||||
public override string Description => $"此角色持有累积之压标记。来自:[ {Source} ]";
|
||||
public override EffectType EffectType => EffectType.Mark;
|
||||
public override bool IsDebuff => true;
|
||||
public override bool DurativeWithoutDuration => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
|
||||
public 累积之压标记(Skill skill, Character sourceCharacter) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 缴械 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.缴械;
|
||||
public override string Name => "缴械";
|
||||
public override string Description => $"此角色被缴械了,不能使用普通攻击。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Disarm;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
|
||||
public 缴械(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectStatesToCharacter(character, [CharacterState.AttackRestricted]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectStatesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 虚弱 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.虚弱;
|
||||
public override string Name => "虚弱";
|
||||
public override string Description => $"此角色处于虚弱状态,伤害降低 {_damageReductionPercent * 100:0.##}%," +
|
||||
$"物理护甲降低 {_DEFReductionPercent * 100:0.##}%,魔法抗性降低 {_MDFReductionPercent * 100:0.##}%,治疗效果降低 {_healingReductionPercent * 100:0.##}%。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Weaken;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _targetCharacter;
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _damageReductionPercent;
|
||||
private readonly double _DEFReductionPercent;
|
||||
private readonly double _MDFReductionPercent;
|
||||
private readonly double _healingReductionPercent;
|
||||
|
||||
public 虚弱(Skill skill, Character targetCharacter, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1,
|
||||
double damageReductionPercent = 0, double DEFReductionPercent = 0, double MDFReductionPercent = 0, double healingReductionPercent = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_targetCharacter = targetCharacter;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_damageReductionPercent = damageReductionPercent;
|
||||
_DEFReductionPercent = DEFReductionPercent;
|
||||
_MDFReductionPercent = MDFReductionPercent;
|
||||
_healingReductionPercent = healingReductionPercent;
|
||||
}
|
||||
|
||||
public override AlterActualDamageResult AlterActualDamageAfterCalculation(DamageContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return default;
|
||||
double damage = ctx.Damage;
|
||||
if (character == _targetCharacter)
|
||||
{
|
||||
return new AlterActualDamageResult { DamageDelta = -(damage * _damageReductionPercent) };
|
||||
|
||||
}
|
||||
return default;
|
||||
|
||||
}
|
||||
|
||||
public override AlterHealValueResult AlterHealValueBeforeHealToTarget(HealContext ctx)
|
||||
{
|
||||
if (ctx.Target is not Character target) return default;
|
||||
double heal = ctx.Heal;
|
||||
if (target == _targetCharacter)
|
||||
{
|
||||
return new AlterHealValueResult { HealDelta = -(heal * _healingReductionPercent) };
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
character.ExDEFPercentage -= _DEFReductionPercent;
|
||||
character.MDF[character.MagicType] -= _MDFReductionPercent;
|
||||
AddEffectTypeToCharacter(character, [EffectType.Weaken, EffectType.GrievousWound]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
character.ExDEFPercentage += _DEFReductionPercent;
|
||||
character.MDF[character.MagicType] += _MDFReductionPercent;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using FunGame.Core.Entity;
|
||||
using FunGame.Core.Library.Constant;
|
||||
using FunGame.Core.Model.EffectContext;
|
||||
using FunGame.Core.Model.EffectResult;
|
||||
using OshimaBot.Content.Effects.OpenEffects;
|
||||
|
||||
namespace OshimaBot.Content.Effects.PassiveEffects
|
||||
{
|
||||
public class 迟滞 : Effect
|
||||
{
|
||||
public override long Id => (long)PassiveEffectID.迟滞;
|
||||
public override string Name { get; set; } = "迟滞";
|
||||
public override string Description => $"此角色处于迟滞状态,普通攻击和技能的硬直时间、当前行动等待时间延长 {_hardnessReductionPercent * 100:0.##}%。来自:[ {Source} ] 的 [ {Skill.Name} ]";
|
||||
public override EffectType EffectType => EffectType.Slow;
|
||||
public override DispelledType DispelledType => DispelledType.Weak;
|
||||
public override bool IsDebuff => true;
|
||||
public override Character Source => _sourceCharacter;
|
||||
public override bool Durative => _durative;
|
||||
public override double Duration => _duration;
|
||||
public override int DurationTurn => _durationTurn;
|
||||
public override bool ExemptDuration => true;
|
||||
|
||||
private readonly Character _sourceCharacter;
|
||||
private readonly bool _durative;
|
||||
private readonly double _duration;
|
||||
private readonly int _durationTurn;
|
||||
private readonly double _hardnessReductionPercent;
|
||||
|
||||
public 迟滞(Skill skill, Character sourceCharacter, bool durative = false, double duration = 0, int durationTurn = 1, double healingReductionPercent = 0) : base(skill)
|
||||
{
|
||||
GamingQueue = skill.GamingQueue;
|
||||
_sourceCharacter = sourceCharacter;
|
||||
_durative = durative;
|
||||
_duration = duration;
|
||||
_durationTurn = durationTurn;
|
||||
_hardnessReductionPercent = healingReductionPercent;
|
||||
}
|
||||
|
||||
public override AlterHardnessTimeResult AlterHardnessTimeAfterCastSkill(HardnessContext ctx)
|
||||
{
|
||||
return new AlterHardnessTimeResult { Factor = _hardnessReductionPercent };
|
||||
}
|
||||
|
||||
public override AlterHardnessTimeResult AlterHardnessTimeAfterNormalAttack(HardnessContext ctx)
|
||||
{
|
||||
return new AlterHardnessTimeResult { Factor = _hardnessReductionPercent };
|
||||
}
|
||||
|
||||
public override void OnEffectGained(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
if (_durative && RemainDuration == 0)
|
||||
{
|
||||
RemainDuration = Duration;
|
||||
}
|
||||
else if (RemainDurationTurn == 0)
|
||||
{
|
||||
RemainDurationTurn = DurationTurn;
|
||||
}
|
||||
AddEffectTypeToCharacter(character, [EffectType.Slow]);
|
||||
}
|
||||
|
||||
public override void OnEffectLost(HookContext ctx)
|
||||
{
|
||||
if (ctx.Trigger is not Character character) return;
|
||||
RemoveEffectTypesFromCharacter(character);
|
||||
}
|
||||
|
||||
public void ApplyChange(Character character)
|
||||
{
|
||||
GamingQueue?.ChangeCharacterHardnessTime(character, _hardnessReductionPercent, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user