mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-04-23 04:19:36 +08:00
执行代码清理
This commit is contained in:
parent
0b022fe9c1
commit
e77ac767ef
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
using Milimoe.FunGame.Core.Api.Utility;
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
|
@ -204,7 +204,7 @@
|
||||
/// 立即获得能量值,参数:ep
|
||||
/// </summary>
|
||||
GetEP = 8705,
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 立即获得经验值,参数:exp
|
||||
/// </summary>
|
||||
|
@ -10,7 +10,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
|
||||
public override string Name => "立即获得能量值";
|
||||
public override string Description => $"角色立即获得 {实际获得:0.##} 点能量值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
|
||||
public override EffectType EffectType => EffectType.Item;
|
||||
|
||||
|
||||
private readonly double 实际获得 = 0;
|
||||
|
||||
public GetEP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
|
@ -10,7 +10,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
|
||||
public override string Name => "立即回复生命值";
|
||||
public override string Description => $"立即回复角色 {实际回复:0.##} 点生命值(不可用于复活)。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
|
||||
public override EffectType EffectType => EffectType.Item;
|
||||
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
|
||||
public RecoverHP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
|
@ -10,7 +10,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复角色 {实际回复:0.##} 点魔法值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
|
||||
public override EffectType EffectType => EffectType.Item;
|
||||
|
||||
|
||||
private readonly double 实际回复 = 0;
|
||||
|
||||
public RecoverMP(Skill skill, Dictionary<string, object> args, Character? source = null) : base(skill, args)
|
||||
|
@ -10,7 +10,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.ItemEffects
|
||||
public override string Name => "立即回复魔法值";
|
||||
public override string Description => $"立即回复角色 {回复比例 * 100:0.##}% [ {实际回复:0.##} ] 点魔法值。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
|
||||
public override EffectType EffectType => EffectType.Item;
|
||||
|
||||
|
||||
private double 实际回复 => 回复比例 * (Skill.Character?.MaxMP ?? 0);
|
||||
private readonly double 回复比例 = 0;
|
||||
|
||||
|
@ -10,7 +10,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.OpenEffects
|
||||
public override string Description => $"{(实际加成 >= 0 ? "增加" : "减少")}角色 {Math.Abs(实际加成):0.##} 点力量。" + (Source != null && Skill.Character != Source ? $"来自:[ {Source} ]" + (Skill.Item != null ? $" 的 [ {Skill.Item.Name} ]" : "") : "");
|
||||
public override EffectType EffectType => EffectType.Item;
|
||||
public double Value => 实际加成;
|
||||
|
||||
|
||||
private readonly double 实际加成 = 0;
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成 {BaseDamage:0.##} + {ATKCoefficient * 100:0.##}% 攻击力 [ {Damage:0.##} ] 点{(IsMagic ? CharacterSet.GetMagicDamageName(MagicType) : "物理伤害")}。";
|
||||
|
||||
|
||||
private double BaseDamage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double ATKCoefficient => Skill.Level > 0 ? 基础攻击力系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础攻击力系数;
|
||||
private double Damage => BaseDamage + (ATKCoefficient * Skill.Character?.ATK ?? 0);
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成 {ATKCoefficient * 100:0.##}% 攻击力 [ {Damage:0.##} ] 点{(IsMagic ? CharacterSet.GetMagicDamageName(MagicType) : "物理伤害")}。";
|
||||
|
||||
|
||||
private double ATKCoefficient => Skill.Level > 0 ? 基础攻击力系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础攻击力系数;
|
||||
private double Damage => ATKCoefficient * Skill.Character?.ATK ?? 0;
|
||||
private double 基础攻击力系数 { get; set; } = 1.5;
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成 {BaseDamage:0.##} + {AttributeCoefficient * 100:0.##}% {CharacterSet.GetPrimaryAttributeName(Skill.Character?.PrimaryAttribute ?? PrimaryAttribute.INT)} [ {Damage:0.##} ] 点{(IsMagic ? CharacterSet.GetMagicDamageName(MagicType) : "物理伤害")}。";
|
||||
|
||||
|
||||
private double BaseDamage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double AttributeCoefficient => Skill.Level > 0 ? 基础属性系数 + 基础系数等级成长 * (Skill.Level - 1) : 基础属性系数;
|
||||
private double Damage => BaseDamage + (AttributeCoefficient * Skill.Character?.PrimaryAttributeValue ?? 0);
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成 {Damage:0.##} 点{(IsMagic ? CharacterSet.GetMagicDamageName(MagicType) : "物理伤害")}。";
|
||||
|
||||
|
||||
private double Damage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害;
|
||||
private double 基础数值伤害 { get; set; } = 200;
|
||||
private double 基础伤害等级成长 { get; set; } = 100;
|
||||
|
@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"为{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}目标回复 {Heal:0.##} 点生命值。";
|
||||
|
||||
|
||||
private double Heal => Skill.Level > 0 ? 基础回复 + 回复成长 * (Skill.Level - 1) : 基础回复;
|
||||
private double 基础回复 { get; set; } = 100;
|
||||
private double 回复成长 { get; set; } = 30;
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成封技 {封技时间},无法使用技能(魔法、战技和爆发技),并打断当前施法。";
|
||||
|
||||
|
||||
private string 封技时间 => _durative && _duration > 0 ? 实际封技时间 + " 时间" : (!_durative && _durationTurn > 0 ? 实际封技时间 + " 回合" : "0 时间");
|
||||
private double 实际封技时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
|
@ -8,7 +8,7 @@ namespace Oshima.FunGame.OshimaModules.Effects.SkillEffects
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"对目标{(Skill.CanSelectTargetCount > 1 ? $"至多 {Skill.CanSelectTargetCount} 个" : "")}敌人造成眩晕 {眩晕时间}。";
|
||||
|
||||
|
||||
private string 眩晕时间 => _durative && _duration > 0 ? 实际眩晕时间 + " 时间" : (!_durative && _durationTurn > 0 ? 实际眩晕时间 + " 回合" : "0 时间");
|
||||
private double 实际眩晕时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0);
|
||||
private readonly bool _durative;
|
||||
|
@ -56,7 +56,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
Skills.Passives.Add(new 攻击之爪技能(character, this, 50));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class 攻击之爪技能 : Skill
|
||||
{
|
||||
public override long Id => (long)ItemPassiveID.攻击之爪;
|
||||
|
@ -109,7 +109,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
return 回复药.OnItemUsed(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class 大回复药 : Item, 回复药.HPRecovery
|
||||
{
|
||||
public override long Id => (long)ConsumableID.大回复药;
|
||||
|
@ -109,7 +109,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
return 经验书.OnItemUsed(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class 大经验书 : Item, 经验书.EXPBook
|
||||
{
|
||||
public override long Id => (long)ConsumableID.大经验书;
|
||||
|
@ -109,7 +109,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
return 能量饮料.OnItemUsed(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class 能量饮料3 : Item, 能量饮料.EPAdd
|
||||
{
|
||||
public override long Id => (long)ConsumableID.能量饮料3;
|
||||
|
@ -109,7 +109,7 @@ namespace Oshima.FunGame.OshimaModules.Items
|
||||
return 魔力填充剂.OnItemUsed(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class 魔力填充剂3 : Item, 魔力填充剂.MPRecovery
|
||||
{
|
||||
public override long Id => (long)ConsumableID.魔力填充剂3;
|
||||
|
@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"每次造成伤害都可以叠一层标记,累计 4 层时回收该角色所有标记并造成眩晕 1 回合,额外对该角色造成 {系数 * 100:0.##}% 最大生命值的物理伤害。";
|
||||
|
||||
|
||||
private readonly double 系数 = 0.12;
|
||||
private bool 是否是嵌套伤害 = false;
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"每时间提升 {伤害提升 * 100:0.##}% 所有伤害,无上限,但受到伤害时效果清零。" + (累计伤害 > 0 ? $"(当前总提升:{累计伤害 * 100:0.##}%)" : "");
|
||||
|
||||
|
||||
private readonly double 伤害提升 = 0.03;
|
||||
private double 累计伤害 = 0;
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"暴击伤害提升 70%。";
|
||||
|
||||
|
||||
public override void OnEffectGained(Character character)
|
||||
{
|
||||
character.ExCritDMG += 0.7;
|
||||
|
@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override string Name => "三重叠加";
|
||||
public override string Description => $"使 [ 灵能反射 ] 支持普通攻击,且当前释放魔法次数归零,最大硬直消除次数提高到 {灵能反射次数} 次;在魔法命中和普通攻击命中时能够回复所回复能量值的 10 倍魔法值,持续 {技能持续次数} 次(灵能反射每消除次数达到最大时算一次)。" +
|
||||
$"(剩余:{剩余持续次数} 次)";
|
||||
|
||||
|
||||
public int 剩余持续次数 { get; set; } = 0;
|
||||
private readonly int 灵能反射次数 = 3;
|
||||
private readonly int 技能持续次数 = 2;
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"每释放 {触发硬直次数:0.##} 次魔法才会触发硬直时间,且魔法命中时基于 25% 智力 [ {获得额外能量值:0.##} ] 获得额外能量值。";
|
||||
|
||||
|
||||
public bool 是否支持普攻 { get; set; } = false;
|
||||
public int 触发硬直次数 { get; set; } = 2;
|
||||
public int 释放次数 { get; set; } = 0;
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => "变幻之心";
|
||||
public override string Description => $"检查 [ 智慧与力量 ] 的模式。在力量模式下,立即回复 {生命值回复 * 100:0.##}% 生命值;智力模式下,下一次魔法伤害提升 {伤害提升 * 100:0.##}%。";
|
||||
|
||||
|
||||
private double 生命值回复 => 0.25 + 0.03 * (Level - 1);
|
||||
private double 伤害提升 => 0.55 + 0.25 * (Level - 1);
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Milimoe.FunGame.Core.Entity;
|
||||
using Milimoe.FunGame.Core.Interface.Entity;
|
||||
using Milimoe.FunGame.Core.Library.Constant;
|
||||
|
||||
namespace Oshima.FunGame.OshimaModules.Skills
|
||||
@ -27,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"当生命值低于 30% 时,进入力量模式,核心属性转为力量,将所有基础智力转化为额外力量;当生命值高于或等于 30% 时,进入智力模式,核心属性转为智力,还原所有基础智力。力量模式下,造成伤害必定暴击;智力模式下,获得 15% 闪避率和 15% 魔法抗性。" +
|
||||
(Skill.Character != null ? "(当前模式:" + CharacterSet.GetPrimaryAttributeName(Skill.Character.PrimaryAttribute) + ")" : "");
|
||||
|
||||
|
||||
private double 交换的基础智力 = 0;
|
||||
private double 实际增加闪避率 = 0.15;
|
||||
private double 实际增加魔法抗性 = 0.15;
|
||||
|
@ -31,7 +31,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"最大生命值减少 20%。破釜沉舟:生命值高于 30% 时,受到额外的 [ {高于30额外伤害下限}~{高于30额外伤害上限}% ] 伤害,但是获得 [ 累计所受伤害的 {高于30的加成下限}~{高于30的加成上限}% ] 伤害加成;生命值低于等于 30% 时,不会受到额外的伤害,仅能获得 [ 累计受到的伤害 {低于30的加成下限}~{低于30的加成上限}% ] 伤害加成。" +
|
||||
$"在没有受到任何伤害的时候,将获得 {常规伤害加成 * 100:0.##}% 伤害加成。" + (累计受到的伤害 > 0 ? $"(当前累计受到伤害:{累计受到的伤害:0.##})" : "");
|
||||
|
||||
|
||||
private double 累计受到的伤害 = 0;
|
||||
private double 这次的伤害加成 = 0;
|
||||
private double 受到伤害之前的HP = 0;
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"每次造成伤害都会随机减少对方 [ 7~15 ] 点能量值,对能量值低于一半的角色额外造成 30% 伤害。对于枯竭打击而言,能量值大于100且小于150时,视为低于一半。";
|
||||
|
||||
|
||||
private bool 是否是嵌套伤害 = false;
|
||||
|
||||
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"优先攻击血量更低的角色,对生命值百分比低于自己的角色造成 150% 伤害。";
|
||||
|
||||
|
||||
public override double AlterExpectedDamageBeforeCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, Dictionary<Effect, double> totalDamageBonus)
|
||||
{
|
||||
if (character == Skill.Character && (enemy.HP / enemy.MaxHP) <= (character.HP / character.MaxHP))
|
||||
|
@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"普通攻击硬直时间减少 20%。每次使用普通攻击时,额外再发动一次普通攻击,伤害特效可叠加,冷却 {基础冷却时间:0.##} 时间。" +
|
||||
(冷却时间 > 0 ? $"(正在冷却:剩余 {冷却时间:0.##} 时间)" : "");
|
||||
|
||||
|
||||
public double 冷却时间 { get; set; } = 0;
|
||||
public double 基础冷却时间 { get; set; } = 20;
|
||||
private bool 是否是嵌套普通攻击 = false;
|
||||
|
@ -26,7 +26,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"造成魔法伤害时有 35% 几率使敌人眩晕 1 回合。";
|
||||
|
||||
|
||||
public override void AfterDamageCalculation(Character character, Character enemy, double damage, bool isNormalAttack, bool isMagicDamage, MagicType magicType, DamageResult damageResult)
|
||||
{
|
||||
if (character == Skill.Character && isMagicDamage && damageResult != DamageResult.Evaded && new Random().NextDouble() < 0.35)
|
||||
|
@ -25,7 +25,7 @@ namespace Oshima.FunGame.OshimaModules.Skills
|
||||
public override long Id => Skill.Id;
|
||||
public override string Name => Skill.Name;
|
||||
public override string Description => $"每次普通攻击都将附带基于 {敏捷系数 * 100:0.##}% 敏捷 [ {敏捷伤害} ] 的魔法伤害。";
|
||||
|
||||
|
||||
private double 敏捷伤害 => 敏捷系数 * Skill.Character?.AGI ?? 0;
|
||||
private readonly double 敏捷系数 = 2.5;
|
||||
private bool 是否是嵌套伤害 = false;
|
||||
|
@ -407,7 +407,7 @@ namespace Oshima.FunGame.OshimaServers
|
||||
|
||||
return result.Trim();
|
||||
}
|
||||
|
||||
|
||||
public string SCRecord(Dictionary<string, object> data)
|
||||
{
|
||||
string result = "";
|
||||
@ -433,7 +433,7 @@ namespace Oshima.FunGame.OshimaServers
|
||||
string remark = Convert.ToString(dr["remark"]) ?? "";
|
||||
string record = Convert.ToString(dr["record"]) ?? "";
|
||||
result += $"用户:{qq},圣人点数:{sc} 分{(remark.Trim() != "" ? $" ({remark})" : "")},排在圣人榜第 {index} / {sql.DataSet.Tables[0].Rows.Count} 名。\r\n" +
|
||||
$"{(record != "" ? "显示近期点数变动信息:\r\n" + record + "\r\n": "")}本系统仅供娱乐,不代表任何官方立场或真实情况。";
|
||||
$"{(record != "" ? "显示近期点数变动信息:\r\n" + record + "\r\n" : "")}本系统仅供娱乐,不代表任何官方立场或真实情况。";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -527,7 +527,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
user.Inventory.Squad.Add(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach (long cid in training.Keys)
|
||||
{
|
||||
if (user.Inventory.Characters.FirstOrDefault(c => c.Id == cid) is Character t)
|
||||
@ -624,7 +624,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
user.Inventory.Items.Add(mfk);
|
||||
msg += ItemSet.GetQualityTypeName(mfk.QualityType) + ItemSet.GetItemTypeName(mfk.ItemType) + "【" + mfk.Name + "】!\r\n" + mfk.Description;
|
||||
break;
|
||||
|
||||
|
||||
case 7:
|
||||
Item 物品 = FunGameConstant.DrawCardItems[Random.Shared.Next(FunGameConstant.DrawCardItems.Count)].Copy();
|
||||
SetSellAndTradeTime(物品);
|
||||
@ -650,7 +650,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
|
||||
public static string GetSignInResult(User user, int days)
|
||||
{
|
||||
string msg = $"签到成功,你已连续签到 {days +1} 天!\r\n本次签到获得:";
|
||||
string msg = $"签到成功,你已连续签到 {days + 1} 天!\r\n本次签到获得:";
|
||||
int currency = Random.Shared.Next(1000, 3000) + 10 * days;
|
||||
msg += $"{currency} {General.GameplayEquilibriumConstant.InGameCurrency} 和 ";
|
||||
int material = Random.Shared.Next(5, 15) + days / 7;
|
||||
@ -1006,7 +1006,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static bool UseItems(IEnumerable<Item> items, User user, IEnumerable<Character> targets, List<string> msgs)
|
||||
{
|
||||
Dictionary<string, object> args = new()
|
||||
@ -1382,7 +1382,7 @@ namespace Oshima.FunGame.OshimaServers.Service
|
||||
super.Character = boss;
|
||||
super.Level = sLevel;
|
||||
boss.Skills.Add(super);
|
||||
|
||||
|
||||
boss.Recovery();
|
||||
SetCharacterPrimaryAttribute(boss);
|
||||
|
||||
|
@ -502,7 +502,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
return NetworkUtility.JsonSerialize("创建存档失败!");
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("restoresaved")]
|
||||
public string RestoreSaved([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -634,7 +634,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("randomcustom")]
|
||||
public string RandomCustomCharacter([FromQuery] long? uid = null, [FromQuery] bool? confirm = null)
|
||||
{
|
||||
@ -643,7 +643,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
|
||||
PluginConfig pc = new("saved", userid.ToString());
|
||||
pc.LoadConfig();
|
||||
|
||||
|
||||
EntityModuleConfig<Character> emc = new("randomcustom", userid.ToString());
|
||||
emc.LoadConfig();
|
||||
|
||||
@ -799,7 +799,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("inventoryinfo")]
|
||||
public string GetInventoryInfo([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -1010,7 +1010,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("inventoryinfo4")]
|
||||
public List<string> GetInventoryInfo4([FromQuery] long? uid = null, [FromQuery] int? page = null, [FromQuery] int? type = null)
|
||||
{
|
||||
@ -1208,7 +1208,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("drawcard")]
|
||||
public string DrawCard([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -1478,7 +1478,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showcharacterskills")]
|
||||
public string GetCharacterSkills([FromQuery] long? uid = null, [FromQuery] int? seq = null)
|
||||
{
|
||||
@ -1521,7 +1521,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showcharacteritems")]
|
||||
public string GetCharacterItems([FromQuery] long? uid = null, [FromQuery] int? seq = null)
|
||||
{
|
||||
@ -1600,7 +1600,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showiteminfoname")]
|
||||
public string GetItemInfoFromInventory_Name([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] int? page = null)
|
||||
{
|
||||
@ -1711,7 +1711,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("equipitem")]
|
||||
public string EquipItem([FromQuery] long? uid = null, [FromQuery] int? c = null, [FromQuery] int? i = null)
|
||||
{
|
||||
@ -1777,7 +1777,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("unequipitem")]
|
||||
public string UnEquipItem([FromQuery] long? uid = null, [FromQuery] int? c = null, [FromQuery] int? i = null)
|
||||
{
|
||||
@ -1836,7 +1836,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
|
||||
PluginConfig pc = new("saved", userid.ToString());
|
||||
pc.LoadConfig();
|
||||
|
||||
|
||||
PluginConfig pc2 = new("saved", enemyid.ToString());
|
||||
pc2.LoadConfig();
|
||||
|
||||
@ -1882,7 +1882,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return [e.ToString()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("fightcustom2")]
|
||||
public List<string> FightCustom2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
@ -2040,7 +2040,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
targets.Add(character);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (FunGameService.UseItem(item, user, targets, out string msg))
|
||||
{
|
||||
user.LastTime = DateTime.Now;
|
||||
@ -2069,7 +2069,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("useitem2")]
|
||||
public string UseItem2([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] int? count = null, [FromBody] int[]? characters = null)
|
||||
{
|
||||
@ -2698,7 +2698,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("decomposeitem3")]
|
||||
public string DecomposeItem3([FromQuery] long? uid = null, [FromQuery] int? q = null)
|
||||
{
|
||||
@ -2883,7 +2883,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("starttraining")]
|
||||
public string StartTraining([FromQuery] long? uid = null, [FromQuery] int? c = null)
|
||||
{
|
||||
@ -2930,7 +2930,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("stoptraining")]
|
||||
public string StopTraining([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -3004,7 +3004,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("gettraininginfo")]
|
||||
public string GetTrainingInfo([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -3098,7 +3098,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("skilllevelup")]
|
||||
public string SkillLevelUp([FromQuery] long? uid = null, [FromQuery] int? c = null, [FromQuery] string? s = null)
|
||||
{
|
||||
@ -3435,7 +3435,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
return bosses;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("fightboss")]
|
||||
public List<string> FightBoss([FromQuery] long? uid = null, [FromQuery] int? index = null, [FromQuery] bool? all = null)
|
||||
{
|
||||
@ -3521,7 +3521,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize($"小队人数已满 4 人,无法继续添加角色!当前小队角色如下:\r\n" +
|
||||
string.Join("\r\n", user.Inventory.Characters.Where(c => user.Inventory.Squad.Contains(c.Id))));
|
||||
}
|
||||
|
||||
|
||||
if (user.Inventory.Squad.Contains(character.Id))
|
||||
{
|
||||
return NetworkUtility.JsonSerialize($"此角色已经在小队中了!");
|
||||
@ -3544,7 +3544,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("removesquad")]
|
||||
public string RemoveSquad([FromQuery] long? uid = null, [FromQuery] int? c = null)
|
||||
{
|
||||
@ -3639,7 +3639,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("clearsquad")]
|
||||
public string ClearSquad([FromQuery] long? uid = null, [FromBody] int[]? c = null)
|
||||
{
|
||||
@ -3671,7 +3671,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showsquad")]
|
||||
public string ShowSquad([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -3788,7 +3788,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("checkworkingquest")]
|
||||
public string CheckWorkingQuest([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -3825,7 +3825,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("acceptquest")]
|
||||
public List<string> AcceptQuest([FromQuery] long? uid = null, [FromQuery] int? id = null)
|
||||
{
|
||||
@ -3930,12 +3930,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showmaincharacterorsquadstatus")]
|
||||
public string ShowMainCharacterOrSquadStatus([FromQuery] long? uid = null, [FromQuery] bool? squad = null)
|
||||
{
|
||||
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
|
||||
bool showSquad = squad ?? false;
|
||||
bool showSquad = squad ?? false;
|
||||
|
||||
PluginConfig pc = new("saved", userid.ToString());
|
||||
pc.LoadConfig();
|
||||
@ -4016,7 +4016,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("joinclub")]
|
||||
public string JoinClub([FromQuery] long? uid = null, [FromQuery] long? id = null)
|
||||
{
|
||||
@ -4064,7 +4064,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
}
|
||||
emc.Add("club", club);
|
||||
emc.SaveConfig();
|
||||
|
||||
|
||||
user.LastTime = DateTime.Now;
|
||||
pc.Add("user", user);
|
||||
pc.SaveConfig();
|
||||
@ -4075,7 +4075,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("quitclub")]
|
||||
public string QuitClub([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -4119,7 +4119,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
club.MemberJoinTime.Remove(userid);
|
||||
emc.Add("club", club);
|
||||
emc.SaveConfig();
|
||||
|
||||
|
||||
string msg = $"退出社团 [ {club.Name} ] 成功!";
|
||||
user.LastTime = DateTime.Now;
|
||||
pc.Add("user", user);
|
||||
@ -4132,7 +4132,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("createclub")]
|
||||
public string CreateClub([FromQuery] long? uid = null, [FromQuery] bool? @public = null, [FromQuery] string? prefix = null)
|
||||
{
|
||||
@ -4196,7 +4196,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
emc.LoadConfig();
|
||||
emc.Add("club", club);
|
||||
emc.SaveConfig();
|
||||
|
||||
|
||||
string msg = $"创建社团 [ {club.Name} ] (编号 {clubid})成功!";
|
||||
user.LastTime = DateTime.Now;
|
||||
pc.Add("user", user);
|
||||
@ -4209,7 +4209,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showclubinfo")]
|
||||
public string ShowClubInfo([FromQuery] long? uid = null)
|
||||
{
|
||||
@ -4276,7 +4276,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("showclubmemberlist")]
|
||||
public string ShowClubMemberList([FromQuery] long? uid = null, [FromQuery] int? type = null, [FromQuery] int? page = null)
|
||||
{
|
||||
@ -4962,7 +4962,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
|
||||
return NetworkUtility.JsonSerialize(noSaved);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost("dailystoreshowinfo")]
|
||||
public string DailyStoreShowInfo([FromQuery] long? uid = null, [FromQuery] long? id = null)
|
||||
{
|
||||
|
@ -83,7 +83,7 @@ namespace Oshima.FunGame.WebAPI.Models
|
||||
public string OpenId { get; }
|
||||
public string AuthorOpenId { get; }
|
||||
}
|
||||
|
||||
|
||||
public class ThirdPartyMessage : IBotMessage
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
|
@ -47,7 +47,8 @@ namespace Oshima.FunGame.WebAPI
|
||||
builder.Services.AddScoped<RainBOTService>();
|
||||
builder.Services.AddScoped<FunGameController>();
|
||||
builder.Services.AddScoped<QQController>();
|
||||
builder.Services.AddTransient(provider => {
|
||||
builder.Services.AddTransient(provider =>
|
||||
{
|
||||
SQLHelper? sql = Factory.OpenFactory.GetSQLHelper();
|
||||
if (sql != null) return sql;
|
||||
throw new Milimoe.FunGame.SQLServiceException();
|
||||
@ -62,7 +63,7 @@ namespace Oshima.FunGame.WebAPI
|
||||
{
|
||||
if (GeneralSettings.TokenList.Contains(token))
|
||||
{
|
||||
return "APIUser";
|
||||
return "APIUser";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
51、清空小队
|
||||
发送【帮助6】查看第 6 页");
|
||||
}
|
||||
|
||||
|
||||
if (e.Detail == "帮助6")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 6 / 7 页)
|
||||
@ -205,7 +205,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
62、社团设置 <设置项> <{参数...}>
|
||||
发送【帮助7】查看第 7 页");
|
||||
}
|
||||
|
||||
|
||||
if (e.Detail == "帮助7")
|
||||
{
|
||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 7 / 7 页)
|
||||
@ -1935,7 +1935,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
if (e.Detail.StartsWith("商店查看", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
string detail = e.Detail.Replace("商店查看", "").Trim();
|
||||
|
Loading…
x
Reference in New Issue
Block a user