diff --git a/OshimaModules/Regions/Anomaly.cs b/OshimaModules/Regions/Anomaly.cs index 2d12c62..3228d98 100644 --- a/OshimaModules/Regions/Anomaly.cs +++ b/OshimaModules/Regions/Anomaly.cs @@ -137,7 +137,7 @@ namespace Oshima.FunGame.OshimaModules.Regions NPCs.Add("认知矫正师"); NPCs.Add("洛伦佐"); Areas.Add("梦境交易所"); - Areas.Add("​​幻疡医院"); + Areas.Add("幻疡医院"); ContinuousQuestList.Add("谵妄梦境的思维隔离", new("在谵妄海市建立认知过滤系统,阻断思维寄生虫对市民意识的寄生感染路径。")); ImmediateQuestList.Add("谵妄认知病毒爆发", new("谵妄海市的思维寄生虫释放II型认知病毒,感染市民产生现实扭曲能力,必须一小时内建立精神隔离区。")); ProgressiveQuestList.Add("梦境碎片毒性分析", new("在谵妄海市分析 {0} 份不同的梦境碎片(需全程佩戴认知过滤器)。", item: "梦境碎片")); diff --git a/OshimaModules/Regions/Ecology.cs b/OshimaModules/Regions/Ecology.cs index a20637b..ad7152f 100644 --- a/OshimaModules/Regions/Ecology.cs +++ b/OshimaModules/Regions/Ecology.cs @@ -49,7 +49,7 @@ namespace Oshima.FunGame.OshimaModules.Regions Crops.Add(new(180901, "菌类样本", "锻造物品的材料。", "共生母体上生长的奇异菌类,能释放麻痹毒素,具有高度研究价值。")); NPCs.Add("伊芙琳"); NPCs.Add("溃烂猎人"); - Areas.Add("母体神经丛​​"); + Areas.Add("母体神经丛"); Areas.Add("诱捕菌林"); ContinuousQuestList.Add("腐萤沼渊的共生调查", new("深入腐萤沼渊,研究共生母体的生态系统,记录菌类模仿动物叫声的频率和模式。")); ContinuousQuestList.Add("腐沼菌群的声波分析", new("在腐萤沼渊建立声纹实验室,解析共生母体菌类发出的动物模拟叫声,建立声波防御系统。")); @@ -77,8 +77,8 @@ namespace Oshima.FunGame.OshimaModules.Regions Crops.Add(new(181001, "影玫瑰", "锻造物品的材料。", "永夜侧绽放的奇异植物,散发幽光,只在绝对黑暗中盛开。", QualityType.White, [(r => r.Weather == "永夜")])); Crops.Add(new(181002, "星锚晶石", "锻造物品的材料。", "引雷柱上脱落的晶体碎片,蕴含空间束缚能量,能暂时固定空间结构。", QualityType.White, [(r => r.Weather == "永昼")])); NPCs.Add("守夜人卡尔"); - NPCs.Add("星锚祭司​​"); - Areas.Add("永昼庭园​​"); + NPCs.Add("星锚祭司"); + Areas.Add("永昼庭园"); Areas.Add("永夜墓园"); Areas.Add("星锚之地"); Areas.Add("中央之岛"); diff --git a/OshimaModules/Regions/Machine.cs b/OshimaModules/Regions/Machine.cs index 079d6f4..f8b7ce0 100644 --- a/OshimaModules/Regions/Machine.cs +++ b/OshimaModules/Regions/Machine.cs @@ -22,7 +22,7 @@ namespace Oshima.FunGame.OshimaModules.Regions Crops.Add(new(180502, "活体魔力血", "锻造物品的材料。", "具有自我修复能力的液态魔力,接触会导致身体不可预知的异变。")); NPCs.Add("\"噬罪者\""); NPCs.Add("7号改造体"); - Areas.Add("​​忏悔教堂​​"); + Areas.Add("忏悔教堂"); Areas.Add("造物车间"); ContinuousQuestList.Add("机械坟场的改造危机", new("潜入齿轮坟场被活体建筑同化的造物车间,研究其机械与生物融合的改造机制,寻找控制方法。")); ContinuousQuestList.Add("齿轮活血的污染控制", new("在齿轮坟场建立液态魔力隔离区,防止活体魔力血的生物污染扩散至外部环境。")); diff --git a/OshimaModules/Regions/Mineral.cs b/OshimaModules/Regions/Mineral.cs index 4156b8c..22dc804 100644 --- a/OshimaModules/Regions/Mineral.cs +++ b/OshimaModules/Regions/Mineral.cs @@ -22,7 +22,7 @@ namespace Oshima.FunGame.OshimaModules.Regions Crops.Add(new(180302, "深渊火钻", "锻造物品的材料。", "火山深处开采的珍稀矿石,只有被矿工灵魂烙印认可者才能安全触碰。")); NPCs.Add("\"铁颚\"巴拉克"); NPCs.Add("苔丝夫人"); - Areas.Add("鱿熔血池​​"); + Areas.Add("鱿熔血池"); Areas.Add("活体锻炉"); ContinuousQuestList.Add("元素裂隙的熵增警告", new("使用抗魔探针扫描永燃坩埚第47层矿道,绘制元素裂缝的扩张轨迹,评估其引发位面坍缩的风险等级。")); ContinuousQuestList.Add("坩埚熔岩的生命观测", new("在永燃坩埚的火山灰层建立实验室,监测活体金属苔藓与岩浆鱿鱼的共生进化过程。")); diff --git a/OshimaModules/Regions/Outworld.cs b/OshimaModules/Regions/Outworld.cs index 73d58d4..b47b98e 100644 --- a/OshimaModules/Regions/Outworld.cs +++ b/OshimaModules/Regions/Outworld.cs @@ -23,7 +23,7 @@ namespace Oshima.FunGame.OshimaModules.Regions Crops.Add(new(181203, "矿脉神经纤维", "锻造物品的材料。", "连接神经宝石的活体纤维,触碰导致剧烈痛苦和神经感染。")); NPCs.Add("泰坦刻录员"); NPCs.Add("矿痛共生体"); - Areas.Add("神经矿脉​​"); + Areas.Add("神经矿脉"); Areas.Add("雷霆王座"); Areas.Add("裁决矩阵"); ContinuousQuestList.Add("泰坦遗迹的符文解读", new("攀登泰坦遗迹,记录裁决尖碑在月圆之夜投射的泰坦符文,破译其蕴含的宇宙法则。")); diff --git a/OshimaModules/Skills/SkillID.cs b/OshimaModules/Skills/SkillID.cs index b788bfa..aa70378 100644 --- a/OshimaModules/Skills/SkillID.cs +++ b/OshimaModules/Skills/SkillID.cs @@ -348,7 +348,7 @@ namespace Oshima.FunGame.OshimaModules.Skills * 冰川增幅 = 普攻或技能减敌人的行动速度,减速期间友军对其伤害提升 * 先攻 = 先手攻击英雄时,造成额外真实伤害并获得金币。一段时间内相互未攻击,将重置先手判定 * 饼干配送 = 每过一段时间获得免费饼干,回复生命值和魔法值 - * 折射​ = 受到伤害时,减少受到的伤害,并反弹一部分伤害给攻击者 + * 折射 = 受到伤害时,减少受到的伤害,并反弹一部分伤害给攻击者 * 恩赐解脱 = 攻击敌人时,有一定概率提升暴击伤害 * 静电场 = 技能命中时,造成额外真实伤害 * 竭心光环 = 造成伤害后,对敌人施加持续百分比真实伤害,并无视其生命回复 @@ -398,7 +398,7 @@ namespace Oshima.FunGame.OshimaModules.Skills 冰川增幅 = 4029, 先攻 = 4030, 饼干配送 = 4031, - 折射​ = 4032, + 折射 = 4032, 恩赐解脱 = 4033, 静电场 = 4034, 竭心光环 = 4035, diff --git a/OshimaModules/Skills/dddovo/平衡强化.cs b/OshimaModules/Skills/dddovo/平衡强化.cs index ae3ae19..7ae93a5 100644 --- a/OshimaModules/Skills/dddovo/平衡强化.cs +++ b/OshimaModules/Skills/dddovo/平衡强化.cs @@ -25,11 +25,12 @@ namespace Oshima.FunGame.OshimaModules.Skills { public override long Id => Skill.Id; public override string Name => Skill.Name; - public override string Description => $"敏捷提高 20%,然后将目前的力量补充到与敏捷持平,持续 {Duration:0.##} {GameplayEquilibriumConstant.InGameTime}。"; + public override string Description => $"敏捷提高 20% [ {敏捷提升:0.##} ] 点,然后将目前的力量补充到与敏捷持平,持续 {Duration:0.##} {GameplayEquilibriumConstant.InGameTime}。"; public override bool Durative => true; public override double Duration => 30; public override DispelledType DispelledType => DispelledType.CannotBeDispelled; + private double 敏捷提升 => 0.2 * Skill.Character?.BaseAGI ?? 0; private double 本次提升的敏捷 = 0; private double 本次提升的力量 = 0; @@ -41,10 +42,14 @@ namespace Oshima.FunGame.OshimaModules.Skills double pastMaxMP = character.MaxMP; 本次提升的敏捷 = character.BaseAGI * 0.2; character.ExAGI += 本次提升的敏捷; - 本次提升的力量 = character.AGI - character.STR; - character.ExSTR += 本次提升的力量; + 本次提升的力量 = 0; + if (character.STR < character.AGI) + { + 本次提升的力量 = character.AGI - character.STR; + character.ExSTR += 本次提升的力量; + } character.Recovery(pastHP, pastMP, pastMaxHP, pastMaxMP); - WriteLine($"[ {character} ] 敏捷提升了 {本次提升的敏捷:0.##},力量提升了 {本次提升的力量:0.##}!"); + WriteLine($"[ {character} ] 敏捷提升了 {本次提升的敏捷:0.##} 点,力量提升了 {本次提升的力量:0.##} 点!"); } public override void OnEffectLost(Character character) diff --git a/OshimaModules/Skills/魔法/冰狱冥嚎.cs b/OshimaModules/Skills/魔法/冰狱冥嚎.cs index b8e8bb9..7413690 100644 --- a/OshimaModules/Skills/魔法/冰狱冥嚎.cs +++ b/OshimaModules/Skills/魔法/冰狱冥嚎.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 冰狱冥嚎(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.INT, 40, 45, 0.2, 0.2)); + Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.INT, 30, 35, 0.2, 0.2)); } } } diff --git a/OshimaModules/Skills/魔法/地狱之门.cs b/OshimaModules/Skills/魔法/地狱之门.cs index fc32c8d..885ba1a 100644 --- a/OshimaModules/Skills/魔法/地狱之门.cs +++ b/OshimaModules/Skills/魔法/地狱之门.cs @@ -32,7 +32,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 地狱之门(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 75, 60, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 55, 25, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Bleed, true, 3, 0, 0.5, 0.24, 0.08, false, 85.0)); } } diff --git a/OshimaModules/Skills/魔法/导力停止.cs b/OshimaModules/Skills/魔法/导力停止.cs index a34e0e2..59ef943 100644 --- a/OshimaModules/Skills/魔法/导力停止.cs +++ b/OshimaModules/Skills/魔法/导力停止.cs @@ -18,7 +18,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 导力停止(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 35, 50, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 45, 20, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Silence, true, 8, 0, 1.2, 0.24, 0.08)); } } diff --git a/OshimaModules/Skills/魔法/岩石之息.cs b/OshimaModules/Skills/魔法/岩石之息.cs index 3409a6b..37bdcf7 100644 --- a/OshimaModules/Skills/魔法/岩石之息.cs +++ b/OshimaModules/Skills/魔法/岩石之息.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 岩石之息(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.STR, 40, 20, 0.35, 0.2)); + Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.STR, 30, 10, 0.30, 0.2)); } } } diff --git a/OshimaModules/Skills/魔法/弧形日珥.cs b/OshimaModules/Skills/魔法/弧形日珥.cs index f9fca0b..7af585c 100644 --- a/OshimaModules/Skills/魔法/弧形日珥.cs +++ b/OshimaModules/Skills/魔法/弧形日珥.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 弧形日珥(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.AGI, 55, 35, 0.2, 0.15)); + Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.AGI, 45, 25, 0.2, 0.12)); } } } diff --git a/OshimaModules/Skills/魔法/时间减速.cs b/OshimaModules/Skills/魔法/时间减速.cs index 4d5a6ef..82d89b5 100644 --- a/OshimaModules/Skills/魔法/时间减速.cs +++ b/OshimaModules/Skills/魔法/时间减速.cs @@ -9,14 +9,14 @@ namespace Oshima.FunGame.OshimaModules.Skills public override long Id => (long)MagicID.时间减速; public override string Name => "时间减速"; public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; - public override double MPCost => Level > 0 ? 110 + (100 * (Level - 1)) : 110; + public override double MPCost => Level > 0 ? 75 + (85 * (Level - 1)) : 75; public override double CD => Level > 0 ? 60 - (1 * (Level - 1)) : 60; public override double CastTime => Level > 0 ? 7 + (1.5 * (Level - 1)) : 7; public override double HardnessTime { get; set; } = 8; public 时间减速(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 降低敌方行动速度(this, 30, 20)); + Effects.Add(new 降低敌方行动速度(this, 60, 30)); } } } diff --git a/OshimaModules/Skills/魔法/时间加速.cs b/OshimaModules/Skills/魔法/时间加速.cs index acdf826..764fa75 100644 --- a/OshimaModules/Skills/魔法/时间加速.cs +++ b/OshimaModules/Skills/魔法/时间加速.cs @@ -9,8 +9,8 @@ namespace Oshima.FunGame.OshimaModules.Skills public override long Id => (long)MagicID.时间加速; public override string Name => "时间加速"; public override string Description => Effects.Count > 0 ? Effects.First().Description : ""; - public override double MPCost => Level > 0 ? 100 + (115 * (Level - 1)) : 100; - public override double CD => Level > 0 ? 75 - (1 * (Level - 1)) : 75; + public override double MPCost => Level > 0 ? 95 + (105 * (Level - 1)) : 95; + public override double CD => Level > 0 ? 65 - (1 * (Level - 1)) : 65; public override double CastTime => Level > 0 ? 2 + (1.5 * (Level - 1)) : 2; public override double HardnessTime { get; set; } = 6; public override bool CanSelectSelf => true; @@ -20,7 +20,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 时间加速(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 提升友方行动速度(this, 65, 25)); + Effects.Add(new 提升友方行动速度(this, 65, 30)); } } } diff --git a/OshimaModules/Skills/魔法/死亡咆哮.cs b/OshimaModules/Skills/魔法/死亡咆哮.cs index 21a5c4c..c12852a 100644 --- a/OshimaModules/Skills/魔法/死亡咆哮.cs +++ b/OshimaModules/Skills/魔法/死亡咆哮.cs @@ -32,7 +32,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 死亡咆哮(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 65, 75, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 55, 25, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Cripple, true, 3, 0, 1, 0.24, 0.08)); } } diff --git a/OshimaModules/Skills/魔法/水蓝轰炸.cs b/OshimaModules/Skills/魔法/水蓝轰炸.cs index 66095c4..7d3cf5a 100644 --- a/OshimaModules/Skills/魔法/水蓝轰炸.cs +++ b/OshimaModules/Skills/魔法/水蓝轰炸.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 水蓝轰炸(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于核心属性的伤害(this, 30, 25, 0.15, 0.2)); + Effects.Add(new 基于核心属性的伤害(this, 15, 35, 0.15, 0.2)); } } } diff --git a/OshimaModules/Skills/魔法/火山咆哮.cs b/OshimaModules/Skills/魔法/火山咆哮.cs index f440ec7..1f187ae 100644 --- a/OshimaModules/Skills/魔法/火山咆哮.cs +++ b/OshimaModules/Skills/魔法/火山咆哮.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 火山咆哮(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于核心属性的伤害(this, 25, 30, 0.2, 0.15)); + Effects.Add(new 基于核心属性的伤害(this, 35, 15, 0.2, 0.15)); } } } diff --git a/OshimaModules/Skills/魔法/灾难冲击波.cs b/OshimaModules/Skills/魔法/灾难冲击波.cs index 7bbe5da..7bc0996 100644 --- a/OshimaModules/Skills/魔法/灾难冲击波.cs +++ b/OshimaModules/Skills/魔法/灾难冲击波.cs @@ -34,7 +34,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 灾难冲击波(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于攻击力的伤害_带基础伤害(this, 120, 35, 0.25, 0.04)); + Effects.Add(new 基于攻击力的伤害_带基础伤害(this, 50, 15, 0.1, 0.04)); Effects.Add(new 灾难冲击波特效(this, false, 0, 2, 0, 0.03, 0.02)); } } diff --git a/OshimaModules/Skills/魔法/破碎虚空.cs b/OshimaModules/Skills/魔法/破碎虚空.cs index 044cebb..c62c995 100644 --- a/OshimaModules/Skills/魔法/破碎虚空.cs +++ b/OshimaModules/Skills/魔法/破碎虚空.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 破碎虚空(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于攻击力的伤害_无基础伤害(this, 0.65, 0.12)); + Effects.Add(new 基于攻击力的伤害_无基础伤害(this, 0.60, 0.1)); } } } diff --git a/OshimaModules/Skills/魔法/等离子之波.cs b/OshimaModules/Skills/魔法/等离子之波.cs index cb1ea5a..e742255 100644 --- a/OshimaModules/Skills/魔法/等离子之波.cs +++ b/OshimaModules/Skills/魔法/等离子之波.cs @@ -32,7 +32,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 等离子之波(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 65, 55, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 60, 20, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Silence, false, 0, 2, 0, 0.24, 0.08)); } } diff --git a/OshimaModules/Skills/魔法/苍白地狱.cs b/OshimaModules/Skills/魔法/苍白地狱.cs index d8e254f..a175b37 100644 --- a/OshimaModules/Skills/魔法/苍白地狱.cs +++ b/OshimaModules/Skills/魔法/苍白地狱.cs @@ -17,7 +17,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 苍白地狱(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.INT, 40, 25, 0.25, 0.25)); + Effects.Add(new 基于属性的伤害(this, PrimaryAttribute.INT, 30, 25, 0.25, 0.2)); } } } diff --git a/OshimaModules/Skills/魔法/钻石星尘.cs b/OshimaModules/Skills/魔法/钻石星尘.cs index a4bca87..1482397 100644 --- a/OshimaModules/Skills/魔法/钻石星尘.cs +++ b/OshimaModules/Skills/魔法/钻石星尘.cs @@ -32,7 +32,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 钻石星尘(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 45, 55, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 65, 25, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Freeze, false, 0, 2, 0, 0.24, 0.08)); Effects.Add(new 施加概率负面(this, EffectType.Vulnerable, false, 0, 3, 0, 0.24, 0.08, DamageType.Magical, 0.3)); } diff --git a/OshimaModules/Skills/魔法/银色荆棘.cs b/OshimaModules/Skills/魔法/银色荆棘.cs index 7d7d896..2b0e522 100644 --- a/OshimaModules/Skills/魔法/银色荆棘.cs +++ b/OshimaModules/Skills/魔法/银色荆棘.cs @@ -49,7 +49,7 @@ namespace Oshima.FunGame.OshimaModules.Skills private double 实际持续时间 => _durative && _duration > 0 ? _duration + _levelGrowth * (Level - 1) : (!_durative && _durationTurn > 0 ? _durationTurn + _levelGrowth * (Level - 1) : 0); private double Damage => Skill.Level > 0 ? 基础数值伤害 + 基础伤害等级成长 * (Skill.Level - 1) : 基础数值伤害; private double 基础数值伤害 { get; set; } = 50; - private double 基础伤害等级成长 { get; set; } = 50; + private double 基础伤害等级成长 { get; set; } = 40; private double ActualConfusionProbability => Level > 0 ? _confusionProbability + _confusionProbabilityLevelGrowth * (Level - 1) : _confusionProbability; private readonly bool _durative; private readonly double _duration; diff --git a/OshimaModules/Skills/魔法/鬼魅之痛.cs b/OshimaModules/Skills/魔法/鬼魅之痛.cs index 68b8d39..ad753f7 100644 --- a/OshimaModules/Skills/魔法/鬼魅之痛.cs +++ b/OshimaModules/Skills/魔法/鬼魅之痛.cs @@ -32,7 +32,7 @@ namespace Oshima.FunGame.OshimaModules.Skills public 鬼魅之痛(Character? character = null) : base(SkillType.Magic, character) { - Effects.Add(new 纯数值伤害(this, 55, 70, DamageType.Magical)); + Effects.Add(new 纯数值伤害(this, 60, 40, DamageType.Magical)); Effects.Add(new 施加概率负面(this, EffectType.Stun, true, 6, 0, 0.7, 0.24, 0.08)); } } diff --git a/OshimaServers/Service/FunGameService.cs b/OshimaServers/Service/FunGameService.cs index 3199024..6c1f1bd 100644 --- a/OshimaServers/Service/FunGameService.cs +++ b/OshimaServers/Service/FunGameService.cs @@ -651,36 +651,36 @@ namespace Oshima.FunGame.OshimaServers.Service switch (r) { case 1: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; - Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && i.QualityType == type)]; + Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Weapon && i.QualityType == type)]; Item a = 武器[Random.Shared.Next(武器.Length)].Copy(); + if (a.QualityType >= QualityType.Orange) a.IsLock = true; SetSellAndTradeTime(a); user.Inventory.Items.Add(a); msg += ItemSet.GetQualityTypeName(a.QualityType) + ItemSet.GetItemTypeName(a.ItemType) + "【" + a.Name + "】!\r\n" + a.Description; break; case 2: - if ((int)type > (int)QualityType.Green) type = QualityType.Green; - Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && i.QualityType == type)]; + Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Armor && i.QualityType == type)]; Item b = 防具[Random.Shared.Next(防具.Length)].Copy(); + if (b.QualityType >= QualityType.Orange) b.IsLock = true; SetSellAndTradeTime(b); user.Inventory.Items.Add(b); msg += ItemSet.GetQualityTypeName(b.QualityType) + ItemSet.GetItemTypeName(b.ItemType) + "【" + b.Name + "】!\r\n" + b.Description; break; case 3: - if ((int)type > (int)QualityType.Green) type = QualityType.Green; - Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && i.QualityType == type)]; + Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Shoes && i.QualityType == type)]; Item c = 鞋子[Random.Shared.Next(鞋子.Length)].Copy(); + if (c.QualityType >= QualityType.Orange) c.IsLock = true; SetSellAndTradeTime(c); user.Inventory.Items.Add(c); msg += ItemSet.GetQualityTypeName(c.QualityType) + ItemSet.GetItemTypeName(c.ItemType) + "【" + c.Name + "】!\r\n" + c.Description; break; case 4: - if ((int)type > (int)QualityType.Purple) type = QualityType.Purple; - Item[] 饰品 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && i.QualityType == type)]; + Item[] 饰品 = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Accessory && i.QualityType == type)]; Item d = 饰品[Random.Shared.Next(饰品.Length)].Copy(); + if (d.QualityType >= QualityType.Orange) d.IsLock = true; SetSellAndTradeTime(d); user.Inventory.Items.Add(d); msg += ItemSet.GetQualityTypeName(d.QualityType) + ItemSet.GetItemTypeName(d.ItemType) + "【" + d.Name + "】!\r\n" + d.Description; @@ -702,8 +702,8 @@ namespace Oshima.FunGame.OshimaServers.Service break; case 6: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item mfk = GenerateMagicCard(type); + if (mfk.QualityType >= QualityType.Orange) mfk.IsLock = true; SetSellAndTradeTime(mfk); user.Inventory.Items.Add(mfk); msg += ItemSet.GetQualityTypeName(mfk.QualityType) + ItemSet.GetItemTypeName(mfk.ItemType) + "【" + mfk.Name + "】!\r\n" + mfk.Description; @@ -711,17 +711,22 @@ namespace Oshima.FunGame.OshimaServers.Service case 7: Item 物品 = FunGameConstant.DrawCardItems[Random.Shared.Next(FunGameConstant.DrawCardItems.Count)].Copy(); + if (物品.QualityType >= QualityType.Orange) 物品.IsLock = true; SetSellAndTradeTime(物品); user.Inventory.Items.Add(物品); msg += ItemSet.GetQualityTypeName(物品.QualityType) + ItemSet.GetItemTypeName(物品.ItemType) + "【" + 物品.Name + "】!\r\n" + 物品.Description; + // 连接到任务系统 + AddExploreItemCache(user.Id, 物品.Name); + // 连接到活动系统 + ActivitiesItemCache.Add(物品.Name); break; case 0: default: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item? mfkb = GenerateMagicCardPack(3, type); if (mfkb != null) { + if (mfkb.QualityType >= QualityType.Orange) mfkb.IsLock = true; SetSellAndTradeTime(mfkb); user.Inventory.Items.Add(mfkb); msg += ItemSet.GetQualityTypeName(mfkb.QualityType) + ItemSet.GetItemTypeName(mfkb.ItemType) + "【" + mfkb.Name + "】!\r\n" + mfkb.Description; @@ -767,44 +772,44 @@ namespace Oshima.FunGame.OshimaServers.Service switch (r) { case 1: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item[] 武器 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && i.QualityType == type)]; Item a = 武器[Random.Shared.Next(武器.Length)].Copy(); + if (a.QualityType >= QualityType.Orange) a.IsLock = true; SetSellAndTradeTime(a); user.Inventory.Items.Add(a); msg += ItemSet.GetQualityTypeName(a.QualityType) + ItemSet.GetItemTypeName(a.ItemType) + "【" + a.Name + "】!\r\n" + a.Description; break; case 2: - if ((int)type > (int)QualityType.Green) type = QualityType.Green; Item[] 防具 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && i.QualityType == type)]; Item b = 防具[Random.Shared.Next(防具.Length)].Copy(); + if (b.QualityType >= QualityType.Orange) b.IsLock = true; SetSellAndTradeTime(b); user.Inventory.Items.Add(b); msg += ItemSet.GetQualityTypeName(b.QualityType) + ItemSet.GetItemTypeName(b.ItemType) + "【" + b.Name + "】!\r\n" + b.Description; break; case 3: - if ((int)type > (int)QualityType.Green) type = QualityType.Green; Item[] 鞋子 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && i.QualityType == type)]; Item c = 鞋子[Random.Shared.Next(鞋子.Length)].Copy(); + if (c.QualityType >= QualityType.Orange) c.IsLock = true; SetSellAndTradeTime(c); user.Inventory.Items.Add(c); msg += ItemSet.GetQualityTypeName(c.QualityType) + ItemSet.GetItemTypeName(c.ItemType) + "【" + c.Name + "】!\r\n" + c.Description; break; case 4: - if ((int)type > (int)QualityType.Purple) type = QualityType.Purple; Item[] 饰品 = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && i.QualityType == type)]; Item d = 饰品[Random.Shared.Next(饰品.Length)].Copy(); + if (d.QualityType >= QualityType.Orange) d.IsLock = true; SetSellAndTradeTime(d); user.Inventory.Items.Add(d); msg += ItemSet.GetQualityTypeName(d.QualityType) + ItemSet.GetItemTypeName(d.ItemType) + "【" + d.Name + "】!\r\n" + d.Description; break; case 5: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item mfk = GenerateMagicCard(type); + if (mfk.QualityType >= QualityType.Orange) mfk.IsLock = true; SetSellAndTradeTime(mfk); user.Inventory.Items.Add(mfk); msg += ItemSet.GetQualityTypeName(mfk.QualityType) + ItemSet.GetItemTypeName(mfk.ItemType) + "【" + mfk.Name + "】!\r\n" + mfk.Description; @@ -812,10 +817,10 @@ namespace Oshima.FunGame.OshimaServers.Service case 0: default: - if ((int)type > (int)QualityType.Orange) type = QualityType.Orange; Item? mfkb = GenerateMagicCardPack(3, type); if (mfkb != null) { + if (mfkb.QualityType >= QualityType.Orange) mfkb.IsLock = true; SetSellAndTradeTime(mfkb); user.Inventory.Items.Add(mfkb); msg += ItemSet.GetQualityTypeName(mfkb.QualityType) + ItemSet.GetItemTypeName(mfkb.ItemType) + "【" + mfkb.Name + "】!\r\n" + mfkb.Description; @@ -1116,6 +1121,10 @@ namespace Oshima.FunGame.OshimaServers.Service msgs.Add($"{item.Name} 的剩余使用次数为 0,无法使用!"); result = false; } + if (!result) + { + continue; + } bool tempResult = item.UseItem(user, args); if (item.EntityState == EntityState.Deleted) { @@ -1165,6 +1174,7 @@ namespace Oshima.FunGame.OshimaServers.Service for (int i = 0; i< cardBox.Count; i++) { Item newItem = GenerateMagicCard(item.QualityType); + if (newItem.QualityType >= QualityType.Orange) newItem.IsLock = true; SetSellAndTradeTime(newItem); newItem.User = user; user.Inventory.Items.Add(newItem); @@ -1196,6 +1206,7 @@ namespace Oshima.FunGame.OshimaServers.Service for (int i = 0; i < box.Gifts[name]; i++) { Item newItem = currentItem.Copy(); + if (newItem.QualityType >= QualityType.Orange) newItem.IsLock = true; SetSellAndTradeTime(newItem); newItem.User = user; user.Inventory.Items.Add(newItem); @@ -1656,15 +1667,44 @@ namespace Oshima.FunGame.OshimaServers.Service QuestType type = (QuestType)Random.Shared.Next(3); long id = quests.Count > 0 ? quests.Values.Max(q => q.Id) + 1 : 1; + // 定义概率 + Dictionary pE = new() + { + { QualityType.Blue, 0.5 }, + { QualityType.Purple, 0.37 }, + { QualityType.Orange, 0.1 }, + { QualityType.Red, 0.03 }, + }; + // 生成任务奖励物品 + QualityType qualityType = QualityType.Blue; + foreach (QualityType qt in pE.Keys.OrderByDescending(q => (int)q)) + { + if (Random.Shared.NextDouble() <= pE[qt]) + { + qualityType = qt; + break; + } + } + HashSet items = []; Dictionary itemsCount = []; - int index = Random.Shared.Next(FunGameConstant.DrawCardItems.Count); - Item item = FunGameConstant.DrawCardItems[index]; + Item? item = FunGameConstant.DrawCardItems.Where(i => qualityType == QualityType.Blue ? (int)i.QualityType <= (int)qualityType : (int)i.QualityType == (int)qualityType).OrderBy(o => Random.Shared.Next()).FirstOrDefault(); + item ??= FunGameConstant.DrawCardItems.OrderBy(o => Random.Shared.Next()).First(); items.Add(item); itemsCount[item.Name] = 1; - index = Random.Shared.Next(FunGameConstant.DrawCardItems.Count); - Item item2 = FunGameConstant.DrawCardItems[index]; + + foreach (QualityType qt in pE.Keys.OrderByDescending(q => (int)q)) + { + if (Random.Shared.NextDouble() <= pE[qt]) + { + qualityType = qt; + break; + } + } + + Item? item2 = FunGameConstant.DrawCardItems.Where(i => qualityType == QualityType.Blue ? (int)i.QualityType <= (int)qualityType : (int)i.QualityType == (int)qualityType).OrderBy(o => Random.Shared.Next()).FirstOrDefault(); + item2 ??= FunGameConstant.DrawCardItems.OrderBy(o => Random.Shared.Next()).First(); items.Add(item2); if (!itemsCount.TryAdd(item2.Name, 1)) { @@ -1689,8 +1729,8 @@ namespace Oshima.FunGame.OshimaServers.Service NeedyExploreItemName = exploration.Item, QuestType = QuestType.Continuous, EstimatedMinutes = minutes, - CreditsAward = minutes * 20, - MaterialsAward = minutes / 8 * 1, + CreditsAward = minutes * 40, + MaterialsAward = minutes / 4, Awards = items, AwardsCount = itemsCount }; @@ -1708,8 +1748,8 @@ namespace Oshima.FunGame.OshimaServers.Service RegionId = region.Id, NeedyExploreItemName = exploration.Item, QuestType = QuestType.Immediate, - CreditsAward = difficulty * 80, - MaterialsAward = difficulty / 2 * 1, + CreditsAward = difficulty * 160, + MaterialsAward = difficulty, Awards = items, AwardsCount = itemsCount }; @@ -1729,8 +1769,8 @@ namespace Oshima.FunGame.OshimaServers.Service QuestType = QuestType.Progressive, Progress = 0, MaxProgress = maxProgress, - CreditsAward = maxProgress * 80, - MaterialsAward = maxProgress / 2 * 1, + CreditsAward = maxProgress * 160, + MaterialsAward = maxProgress, Awards = items, AwardsCount = itemsCount, Status = QuestState.InProgress @@ -1814,6 +1854,7 @@ namespace Oshima.FunGame.OshimaServers.Service { Item newItem = item.Copy(); newItem.User = user; + if (newItem.QualityType >= QualityType.Orange) newItem.IsLock = true; SetSellAndTradeTime(newItem); user.Inventory.Items.Add(newItem); // 连接到任务系统 @@ -1947,6 +1988,7 @@ namespace Oshima.FunGame.OshimaServers.Service for (int i = 0; i < count; i++) { Item newItem = item.Copy(true); + if (newItem.QualityType >= QualityType.Orange) newItem.IsLock = true; SetSellAndTradeTime(newItem); if (goods.GetPrice(General.GameplayEquilibriumConstant.InGameCurrency, out double price) && price > 0) { @@ -1954,6 +1996,10 @@ namespace Oshima.FunGame.OshimaServers.Service } newItem.User = user; user.Inventory.Items.Add(newItem); + // 连接到任务系统 + AddExploreItemCache(user.Id, item.Name); + // 连接到活动系统 + ActivitiesItemCache.Add(item.Name); } } @@ -2345,11 +2391,10 @@ namespace Oshima.FunGame.OshimaServers.Service // 初始化掉落装备的概率 Dictionary pE = new() { - { QualityType.Blue, 0.4 }, - { QualityType.Purple, 0.27 + (0.01 * (characterCount - 1)) }, - { QualityType.Orange, 0.2 + (0.01 * (characterCount - 1)) }, - { QualityType.Red, 0.1 + (0.0075 * (characterCount - 1)) }, - { QualityType.Gold, 0.03 + (0.0075 * (characterCount - 1)) } + { QualityType.Blue, 0.5 }, + { QualityType.Purple, 0.37 + (0.01 * (characterCount - 1)) }, + { QualityType.Orange, 0.1 + (0.01 * (characterCount - 1)) }, + { QualityType.Red, 0.03 + (0.0075 * (characterCount - 1)) }, }; // 生成奖励 @@ -2400,7 +2445,7 @@ namespace Oshima.FunGame.OshimaServers.Service break; case ExploreResult.Fight: // 小队信息 - Character[] squad = [.. user.Inventory.Characters.Where((c, index) => characterIds.Contains(index + 1)).Select(c => CharacterBuilder.Build(c, true, true, user.Inventory, FunGameConstant.AllItems, FunGameConstant.AllSkills, false))]; + Character[] squad = [.. user.Inventory.Characters.Where((c, index) => characterIds.Contains(index + 1)).Select(c => CharacterBuilder.Build(c, true, true, null, FunGameConstant.AllItems, FunGameConstant.AllSkills, false))]; if (squad.All(c => c.HP <= 0)) { model.Result = ExploreResult.Nothing; @@ -2478,7 +2523,7 @@ namespace Oshima.FunGame.OshimaServers.Service break; } } - Item? itemDrop = region.Items.Where(i => qualityType == QualityType.Blue ? (int)i.QualityType <= (int)qualityType : (int)i.QualityType == (int)qualityType).FirstOrDefault(); + Item? itemDrop = region.Items.Where(i => qualityType == QualityType.Blue ? (int)i.QualityType <= (int)qualityType : (int)i.QualityType == (int)qualityType).OrderBy(o => Random.Shared.Next()).FirstOrDefault(); if (itemDrop != null) { string itemquality = ItemSet.GetQualityTypeName(itemDrop.QualityType); @@ -2518,7 +2563,7 @@ namespace Oshima.FunGame.OshimaServers.Service break; } } - Item? itemEarned = region.Items.OrderBy(i => quality == QualityType.Blue ? (int)i.QualityType <= (int)quality : (int)i.QualityType == (int)quality).FirstOrDefault(); + Item? itemEarned = region.Items.Where(i => quality == QualityType.Blue ? (int)i.QualityType <= (int)quality : (int)i.QualityType == (int)quality).OrderBy(o => Random.Shared.Next()).FirstOrDefault(); if (itemEarned is null) { model.Result = ExploreResult.Nothing; @@ -2584,6 +2629,7 @@ namespace Oshima.FunGame.OshimaServers.Service { Item newItem = item.Copy(); newItem.User = user; + if (newItem.QualityType >= QualityType.Orange) newItem.IsLock = true; SetSellAndTradeTime(newItem); user.Inventory.Items.Add(newItem); // 连接到任务系统 diff --git a/OshimaServers/Service/FunGameSimulation.cs b/OshimaServers/Service/FunGameSimulation.cs index 4955a49..af77099 100644 --- a/OshimaServers/Service/FunGameSimulation.cs +++ b/OshimaServers/Service/FunGameSimulation.cs @@ -823,13 +823,13 @@ namespace Oshima.FunGame.OshimaServers.Service IEnumerable canBuys = store.Where(i => i.Price <= character.User.Inventory.Credits); // 然后看能买的东西里,是否品质符合 - Item[] weapons = [.. canBuys.Where(i => i.Id.ToString().StartsWith("11") && + Item[] weapons = [.. canBuys.Where(i => i.ItemType == ItemType.Weapon && (onlyLarger ? (int)i.QualityType > Convert.ToInt32(character.EquipSlot.Weapon?.QualityType) : (int)i.QualityType >= Convert.ToInt32(character.EquipSlot.Weapon?.QualityType)))]; - Item[] armors = [.. canBuys.Where(i => i.Id.ToString().StartsWith("12") && + Item[] armors = [.. canBuys.Where(i => i.ItemType == ItemType.Armor && (onlyLarger ? (int)i.QualityType > Convert.ToInt32(character.EquipSlot.Armor?.QualityType) : (int)i.QualityType >= Convert.ToInt32(character.EquipSlot.Armor?.QualityType)))]; - Item[] shoes = [.. canBuys.Where(i => i.Id.ToString().StartsWith("13") && + Item[] shoes = [.. canBuys.Where(i => i.ItemType == ItemType.Shoes && (onlyLarger ? (int)i.QualityType > Convert.ToInt32(character.EquipSlot.Shoes?.QualityType) : (int)i.QualityType >= Convert.ToInt32(character.EquipSlot.Shoes?.QualityType)))]; - Item[] accessories = [.. canBuys.Where(i => i.Id.ToString().StartsWith("14") && + Item[] accessories = [.. canBuys.Where(i => i.ItemType == ItemType.Accessory && (onlyLarger ? (int)i.QualityType > Math.Min(Convert.ToInt32(character.EquipSlot.Accessory1?.QualityType), Convert.ToInt32(character.EquipSlot.Accessory2?.QualityType)) : (int)i.QualityType >= Math.Min(Convert.ToInt32(character.EquipSlot.Accessory1?.QualityType), Convert.ToInt32(character.EquipSlot.Accessory2?.QualityType))))]; @@ -1002,10 +1002,10 @@ namespace Oshima.FunGame.OshimaServers.Service public static void DropItems(GamingQueue queue, int mQuality, int wQuality, int aQuality, int sQuality, int acQuality, bool addLevel = true) { - Item[] weapons = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("11") && (int)i.QualityType == wQuality)]; - Item[] armors = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("12") && (int)i.QualityType == aQuality)]; - Item[] shoes = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("13") && (int)i.QualityType == sQuality)]; - Item[] accessories = [.. FunGameConstant.Equipment.Where(i => i.Id.ToString().StartsWith("14") && (int)i.QualityType == acQuality)]; + Item[] weapons = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Weapon && (int)i.QualityType == wQuality)]; + Item[] armors = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Armor && (int)i.QualityType == aQuality)]; + Item[] shoes = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Shoes && (int)i.QualityType == sQuality)]; + Item[] accessories = [.. FunGameConstant.Equipment.Where(i => i.ItemType == ItemType.Accessory && (int)i.QualityType == acQuality)]; Item[] consumables = [.. FunGameConstant.AllItems.Where(i => i.ItemType == ItemType.Consumable && i.IsInGameItem)]; foreach (Character character in queue.AllCharacters) { diff --git a/OshimaWebAPI/Controllers/FunGameController.cs b/OshimaWebAPI/Controllers/FunGameController.cs index f1faa30..cbb5c43 100644 --- a/OshimaWebAPI/Controllers/FunGameController.cs +++ b/OshimaWebAPI/Controllers/FunGameController.cs @@ -995,13 +995,13 @@ namespace Oshima.FunGame.WebAPI.Controllers { itemsEquipableIndex = string.Join(",", itemsEquipable.Take(10).Select(i => items.IndexOf(i) + 1)) + ",..."; } - IEnumerable itemsSellable = objs.Where(i => i.IsSellable); + IEnumerable itemsSellable = objs.Where(i => i.IsSellable && !i.IsLock); string itemsSellableIndex = string.Join(",", itemsSellable.Select(i => items.IndexOf(i) + 1)); if (itemsSellable.Count() > 10) { itemsSellableIndex = string.Join(",", itemsSellable.Take(10).Select(i => items.IndexOf(i) + 1)) + ",..."; } - IEnumerable itemsTradable = objs.Where(i => i.IsTradable); + IEnumerable itemsTradable = objs.Where(i => i.IsTradable && !i.IsLock); string itemsTradableIndex = string.Join(",", itemsTradable.Select(i => items.IndexOf(i) + 1)); if (itemsTradable.Count() > 10) { @@ -1012,7 +1012,7 @@ namespace Oshima.FunGame.WebAPI.Controllers if (itemsSellableIndex != "") str += $"可出售序号:{itemsSellableIndex}\r\n"; if (itemsTradableIndex != "") str += $"可交易序号:{itemsTradableIndex}\r\n"; str += $"拥有数量:{objs.Count}(" + (first.IsEquipment ? $"可装备数量:{itemsEquipable.Count()}," : "") + - (FunGameConstant.ItemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0)}," : "") + + (FunGameConstant.ItemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0 && !i.IsLock)}," : "") + $"可出售数量:{itemsSellable.Count()},可交易数量:{itemsTradable.Count()})"; list.Add(str); } @@ -1101,13 +1101,13 @@ namespace Oshima.FunGame.WebAPI.Controllers { itemsEquipableIndex = string.Join(",", itemsEquipable.Take(10).Select(i => items.IndexOf(i) + 1)) + ",..."; } - IEnumerable itemsSellable = objs.Where(i => i.IsSellable); + IEnumerable itemsSellable = objs.Where(i => i.IsSellable && !i.IsLock); string itemsSellableIndex = string.Join(",", itemsSellable.Select(i => items.IndexOf(i) + 1)); if (itemsSellable.Count() > 10) { itemsSellableIndex = string.Join(",", itemsSellable.Take(10).Select(i => items.IndexOf(i) + 1)) + ",..."; } - IEnumerable itemsTradable = objs.Where(i => i.IsTradable); + IEnumerable itemsTradable = objs.Where(i => i.IsTradable && !i.IsLock); string itemsTradableIndex = string.Join(",", itemsTradable.Select(i => items.IndexOf(i) + 1)); if (itemsTradable.Count() > 10) { @@ -1118,7 +1118,7 @@ namespace Oshima.FunGame.WebAPI.Controllers if (itemsSellableIndex != "") str += $"可出售序号:{itemsSellableIndex}\r\n"; if (itemsTradableIndex != "") str += $"可交易序号:{itemsTradableIndex}\r\n"; str += $"拥有数量:{objs.Count}(" + (first.IsEquipment ? $"可装备数量:{itemsEquipable.Count()}," : "") + - (FunGameConstant.ItemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0)}," : "") + + (FunGameConstant.ItemCanUsed.Contains(first.ItemType) ? $"可使用数量:{objs.Count(i => i.RemainUseTimes > 0 && !i.IsLock)}," : "") + $"可出售数量:{itemsSellable.Count()},可交易数量:{itemsTradable.Count()})"; list.Add(str); } @@ -2056,6 +2056,11 @@ namespace Oshima.FunGame.WebAPI.Controllers item = user.Inventory.Items.ToList()[itemIndex - 1]; if (FunGameConstant.ItemCanUsed.Contains(item.ItemType)) { + if (item.IsLock) + { + return $"此物品已上锁,请先解锁:{itemIndex}. {item.Name}"; + } + if (item.ItemType == ItemType.MagicCard) { return "此物品为魔法卡,请使用【使用魔法卡】指令!"; @@ -2127,7 +2132,7 @@ namespace Oshima.FunGame.WebAPI.Controllers { User user = FunGameService.GetUser(pc); - IEnumerable items = user.Inventory.Items.Where(i => i.Name == name && i.Character is null && i.ItemType != ItemType.MagicCard); + IEnumerable items = user.Inventory.Items.Where(i => i.Name == name && i.Character is null && i.ItemType != ItemType.MagicCard && !i.IsLock); if (!items.Any()) { return $"库存中不存在名称为【{name}】的物品!如果是魔法卡,请用【使用魔法卡】指令。"; @@ -2202,6 +2207,11 @@ namespace Oshima.FunGame.WebAPI.Controllers item = user.Inventory.Items.ToList()[itemIndex - 1]; if (item.ItemType == ItemType.MagicCard) { + if (item.IsLock) + { + return $"此物品已上锁,请先解锁:{itemIndex}. {item.Name}"; + } + if (item.RemainUseTimes <= 0) { return "此物品剩余使用次数为0,无法使用!"; @@ -2651,7 +2661,7 @@ namespace Oshima.FunGame.WebAPI.Controllers int successCount = 0; double totalGained = 0; Dictionary dict = user.Inventory.Items.Select((item, index) => new { item, index }) - .Where(x => ids.Contains(x.index) && x.item.Character is null) + .Where(x => ids.Contains(x.index) && x.item.Character is null && !x.item.IsLock) .ToDictionary(x => x.index, x => x.item); foreach (int id in dict.Keys) @@ -2716,7 +2726,7 @@ namespace Oshima.FunGame.WebAPI.Controllers { User user = FunGameService.GetUser(pc); - IEnumerable items = user.Inventory.Items.Where(i => i.Name == name && i.Character is null); + IEnumerable items = user.Inventory.Items.Where(i => i.Name == name && i.Character is null && !i.IsLock); if (!items.Any()) { return $"库存中不存在名称为【{name}】的物品!"; @@ -2794,7 +2804,7 @@ namespace Oshima.FunGame.WebAPI.Controllers User user = FunGameService.GetUser(pc); string qualityName = ItemSet.GetQualityTypeName((QualityType)qType); - IEnumerable items = user.Inventory.Items.Where(i => (int)i.QualityType == qType && i.Character is null); + IEnumerable items = user.Inventory.Items.Where(i => (int)i.QualityType == qType && i.Character is null && !i.IsLock); if (!items.Any()) { return $"库存中{qualityName}物品数量为零!"; @@ -2866,7 +2876,11 @@ namespace Oshima.FunGame.WebAPI.Controllers if (itemIndex > 0 && itemIndex <= user.Inventory.Items.Count) { item = user.Inventory.Items.ToList()[itemIndex - 1]; - if (item.ItemType == ItemType.MagicCard && item.RemainUseTimes > 0) + if (item.IsLock) + { + return $"此物品已上锁,请先解锁:{itemIndex}. {item.Name}"; + } + else if (item.ItemType == ItemType.MagicCard && item.RemainUseTimes > 0) { mfks.Add(item); } @@ -5366,7 +5380,7 @@ namespace Oshima.FunGame.WebAPI.Controllers { exploreTimes -= reduce; - msg = $"开始探索【{region.Name}】,探索时间预计 {FunGameConstant.ExploreTime} 分钟(系统会自动结算,届时会有提示)。" + + msg = $"开始探索【{region.Name}】,探索时间预计 {FunGameConstant.ExploreTime} 分钟(系统会自动结算,届时会有提示)。注意:探索期间的角色状态已被锁定,在此期间修改角色属性不会影响战斗结果。" + $"探索成员:[ {FunGameService.GetCharacterGroupInfoByInventorySequence(user.Inventory.Characters, characterIds, " ] / [ ")} ]"; ExploreModel model = await FunGameService.GenerateExploreModel(region, characterIds, user); exploreId = model.Guid; @@ -5634,7 +5648,70 @@ namespace Oshima.FunGame.WebAPI.Controllers return noSaved; } } - + + [HttpPost("lockitem")] + public string LockItem([FromQuery] long? uid = null, [FromQuery] bool unlock = false, [FromBody] int[]? seq = null) + { + try + { + long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11)); + int[] items = seq ?? []; + + PluginConfig pc = new("saved", userid.ToString()); + pc.LoadConfig(); + + if (pc.Count > 0) + { + User user = FunGameService.GetUser(pc); + string msg = ""; + List failedItems = []; + foreach (int itemIndex in items) + { + if (itemIndex > 0 && itemIndex <= user.Inventory.Items.Count) + { + Item item = user.Inventory.Items.ToList()[itemIndex - 1]; + if (msg != "") msg += "\r\n"; + if (unlock) + { + item.IsLock = false; + msg += $"物品解锁成功:{itemIndex}. {item.Name}"; + } + else + { + item.IsLock = true; + msg += $"物品上锁成功:{itemIndex}. {item.Name}"; + } + } + else + { + failedItems.Add(itemIndex); + } + } + + if (failedItems.Count > 0) + { + if (msg != "") msg += "\r\n"; + msg += "没有找到与这个序号相对应的物品:" + string.Join(",", failedItems); + } + + user.LastTime = DateTime.Now; + pc.Add("user", user); + pc.SaveConfig(); + + return msg; + } + else + { + return noSaved; + } + } + catch (Exception e) + { + Logger.LogError(e, "Error: "); + return busy; + } + } + [HttpPost("template")] public string Template([FromQuery] long? uid = null) { diff --git a/OshimaWebAPI/Services/RainBOTService.cs b/OshimaWebAPI/Services/RainBOTService.cs index e02129f..8759b6e 100644 --- a/OshimaWebAPI/Services/RainBOTService.cs +++ b/OshimaWebAPI/Services/RainBOTService.cs @@ -2190,6 +2190,54 @@ namespace Oshima.FunGame.WebAPI.Services return result; } + if (e.Detail.StartsWith("上锁") || e.Detail.StartsWith("锁定")) + { + string detail = e.Detail.Replace("上锁", "").Replace("锁定", "").Trim(); + string msg = ""; + string[] strings = detail.Split(' ', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); + List indexs = []; + foreach (string s in strings) + { + if (int.TryParse(s, out int c)) + { + indexs.Add(c); + } + } + if (indexs.Count > 0) + { + msg = Controller.LockItem(uid, true, [.. indexs]); + if (msg.Trim() != "") + { + await SendAsync(e, "上锁", msg); + } + } + return result; + } + + if (e.Detail.StartsWith("解锁")) + { + string detail = e.Detail.Replace("解锁", "").Trim(); + string msg = ""; + string[] strings = detail.Split(' ', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); + List indexs = []; + foreach (string s in strings) + { + if (int.TryParse(s, out int c)) + { + indexs.Add(c); + } + } + if (indexs.Count > 0) + { + msg = Controller.LockItem(uid, true, [.. indexs]); + if (msg.Trim() != "") + { + await SendAsync(e, "解锁", msg); + } + } + return result; + } + if (uid == GeneralSettings.Master && e.Detail.StartsWith("重载FunGame", StringComparison.CurrentCultureIgnoreCase)) { string msg = Controller.Relaod(uid);