添加礼包;角色重随添加其他属性;修改了物品序号的显示逻辑;社团成员添加分页显示;添加地区

This commit is contained in:
milimoe 2025-02-04 23:26:18 +08:00
parent af1ee22e1e
commit d68a4c86ae
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
14 changed files with 1611 additions and 642 deletions

View File

@ -1,4 +1,5 @@
using Milimoe.FunGame.Core.Api.Utility;
using System;
using Milimoe.FunGame.Core.Api.Utility;
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
@ -47,5 +48,29 @@ namespace Oshima.FunGame.OshimaModules.Characters
InitialHR = Random.Shared.Next(1, 6);
InitialMR = Random.Shared.Next(1, 6);
}
public void SetPrimaryAttribute(PrimaryAttribute? value = null)
{
if (value != null && value.HasValue)
{
PrimaryAttribute = value.Value;
}
else
{
double max = Math.Max(Math.Max(STR, AGI), INT);
if (max == STR)
{
PrimaryAttribute = PrimaryAttribute.STR;
}
else if (max == AGI)
{
PrimaryAttribute = PrimaryAttribute.AGI;
}
else if (max == INT)
{
PrimaryAttribute = PrimaryAttribute.INT;
}
}
}
}
}

View File

@ -0,0 +1,7 @@
namespace Oshima.FunGame.OshimaModules.Characters
{
public class Organisms
{
}
}

View File

@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
public class
{
public interface HPBook
public interface HPRecovery
{
public double HP { get; set; }
}
@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
item.Skills.Active.OnSkillCasted([character]);
string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!";
if (item is HPBook hpBook)
if (item is HPRecovery hpBook)
{
msg += $"回复了 {hpBook.HP} 点生命值!";
}
@ -60,7 +60,7 @@ namespace Oshima.FunGame.OshimaModules.Items
if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0)
{
string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!";
if (item is HPBook expBook)
if (item is HPRecovery expBook)
{
truemsg += $"回复了 {expBook.HP * count} 点生命值!";
}
@ -70,7 +70,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class : Item, .HPBook
public class : Item, .HPRecovery
{
public override long Id => (long)ConsumableID.;
public override string Name => "小回复药";
@ -90,7 +90,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class : Item, .HPBook
public class : Item, .HPRecovery
{
public override long Id => (long)ConsumableID.;
public override string Name => "中回复药";
@ -110,7 +110,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class : Item, .HPBook
public class : Item, .HPRecovery
{
public override long Id => (long)ConsumableID.;
public override string Name => "大回复药";

View File

@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
public class
{
public interface EPBook
public interface EPAdd
{
public double EP { get; set; }
}
@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
item.Skills.Active.OnSkillCasted([character]);
string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!";
if (item is EPBook hpBook)
if (item is EPAdd hpBook)
{
msg += $"获得了 {hpBook.EP} 点能量值!";
}
@ -60,7 +60,7 @@ namespace Oshima.FunGame.OshimaModules.Items
if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0)
{
string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!";
if (item is EPBook expBook)
if (item is EPAdd expBook)
{
truemsg += $"获得了 {expBook.EP * count} 点能量值!";
}
@ -70,7 +70,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 1 : Item, .EPBook
public class 1 : Item, .EPAdd
{
public override long Id => (long)ConsumableID.1;
public override string Name => "能量饮料";
@ -90,7 +90,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 2 : Item, .EPBook
public class 2 : Item, .EPAdd
{
public override long Id => (long)ConsumableID.2;
public override string Name => "能量饮料 Pro";
@ -110,7 +110,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 3 : Item, .EPBook
public class 3 : Item, .EPAdd
{
public override long Id => (long)ConsumableID.3;
public override string Name => "能量饮料 Pro Max";

View File

@ -7,7 +7,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
public class
{
public interface MPBook
public interface MPRecovery
{
public double MP { get; set; }
}
@ -27,7 +27,7 @@ namespace Oshima.FunGame.OshimaModules.Items
{
item.Skills.Active.OnSkillCasted([character]);
string msg = $"对角色 [ {character} ] 使用 [ {item.Name} ] 成功!";
if (item is MPBook hpBook)
if (item is MPRecovery hpBook)
{
msg += $"回复了 {hpBook.MP} 点魔法值!";
}
@ -60,7 +60,7 @@ namespace Oshima.FunGame.OshimaModules.Items
if (key != "" && args.TryGetValue(key, out value) && value is int count && targets.Length > 0)
{
string truemsg = $"对角色 [ {targets[0]} ] 使用 {count} 个 [ {item.Name} ] 成功!";
if (item is MPBook expBook)
if (item is MPRecovery expBook)
{
truemsg += $"回复了 {expBook.MP * count} 点魔法值!";
}
@ -70,7 +70,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 1 : Item, .MPBook
public class 1 : Item, .MPRecovery
{
public override long Id => (long)ConsumableID.1;
public override string Name => "魔力填充剂Ⅰ型";
@ -90,7 +90,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 2 : Item, .MPBook
public class 2 : Item, .MPRecovery
{
public override long Id => (long)ConsumableID.2;
public override string Name => "魔力填充剂Ⅱ型";
@ -110,7 +110,7 @@ namespace Oshima.FunGame.OshimaModules.Items
}
}
public class 3 : Item, .MPBook
public class 3 : Item, .MPRecovery
{
public override long Id => (long)ConsumableID.3;
public override string Name => "魔力填充剂Ⅲ型";

View File

@ -0,0 +1,155 @@
using Milimoe.FunGame.Core.Entity;
using Milimoe.FunGame.Core.Library.Constant;
using Oshima.FunGame.OshimaModules.Skills;
namespace Oshima.FunGame.OshimaModules.Items
{
public class
{
public interface GiftBox
{
public Dictionary<string, int> Gifts { get; set; }
}
public static void Init(Item item, Dictionary<string, int> gifts, int remainUseTimes = 1)
{
if (item is GiftBox box)
{
box.Gifts = gifts;
}
item.Skills.Active = new (item);
item.RemainUseTimes = remainUseTimes;
item.IsInGameItem = false;
item.IsReduceTimesAfterUse = true;
item.IsRemoveAfterUse = true;
}
public static bool OnItemUsed(Item item, Dictionary<string, object> args)
{
string msg = "";
if (item is GiftBox box)
{
}
args["msg"] = msg;
return msg.Trim() != "";
}
}
public class : Item, .GiftBox
{
public override long Id => (long)GiftBoxID.;
public override string Name => "年夜饭";
public override string Description => Skills.Active?.Description ?? "";
public override QualityType QualityType => QualityType.White;
public Dictionary<string, int> Gifts { get; set; } = [];
public (User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
{
User = user;
.Init(this, new()
{
{ General.GameplayEquilibriumConstant.InGameCurrency, 100000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 2000 },
{ new ().Name, 20 },
{ new ().Name, 20 },
{ new ().Name, 10 },
{ new ().Name, 20 },
{ new ().Name, 5 },
{ new 3().Name, 5 },
{ new 3().Name, 5 }
}, remainUseTimes);
}
protected override bool OnItemUsed(Dictionary<string, object> args)
{
return .OnItemUsed(this, args);
}
}
public class : Item, .GiftBox
{
public override long Id => (long)GiftBoxID.;
public override string Name => "蛇年大吉";
public override string Description => Skills.Active?.Description ?? "";
public override QualityType QualityType => QualityType.White;
public Dictionary<string, int> Gifts { get; set; } = [];
public (User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
{
User = user;
.Init(this, new()
{
{ General.GameplayEquilibriumConstant.InGameCurrency, 88888 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 888 },
{ new ().Name, 20 },
{ new ().Name, 10 },
{ new ().Name, 5 },
{ new ().Name, 3 },
{ new ().Name, 20 },
{ new ().Name, 10 },
{ new ().Name, 3 },
{ new ().Name, 20 }
}, remainUseTimes);
}
protected override bool OnItemUsed(Dictionary<string, object> args)
{
return .OnItemUsed(this, args);
}
}
public class : Item, .GiftBox
{
public override long Id => (long)GiftBoxID.;
public override string Name => "新春快乐";
public override string Description => Skills.Active?.Description ?? "";
public override QualityType QualityType => QualityType.White;
public Dictionary<string, int> Gifts { get; set; } = [];
public (User? user = null, int remainUseTimes = 1) : base(ItemType.GiftBox)
{
User = user;
.Init(this, new()
{
{ General.GameplayEquilibriumConstant.InGameCurrency, 100000 },
{ General.GameplayEquilibriumConstant.InGameMaterial, 2000 },
{ new ().Name, 20 },
{ new ().Name, 20 },
{ new ().Name, 10 },
{ new ().Name, 20 },
{ new ().Name, 5 },
{ new 3().Name, 5 },
{ new 3().Name, 5 }
}, remainUseTimes);
}
protected override bool OnItemUsed(Dictionary<string, object> args)
{
return .OnItemUsed(this, args);
}
}
public class : Skill
{
public override long Id => (long)ItemActiveID.;
public override string Name => "礼包";
public override string Description
{
get
{
if (Item is .GiftBox box && box.Gifts.Count > 0)
{
return "打开后可立即获得:" + string.Join("", box.Gifts.Select(kv => $"{kv.Key} * {kv.Value}"));
}
return "";
}
}
public (Item? item = null) : base(SkillType.Item)
{
Level = 1;
Item = item;
}
}
}

View File

@ -34,4 +34,11 @@
= 18006,
= 18007,
}
public enum GiftBoxID : long
{
= 20001,
= 20002,
= 20003
}
}

View File

@ -49,6 +49,9 @@ namespace Oshima.FunGame.OshimaModules
(long)ConsumableID.1 => new 1(),
(long)ConsumableID.2 => new 2(),
(long)ConsumableID.3 => new 3(),
(long)GiftBoxID. => new (),
(long)GiftBoxID. => new (),
(long)GiftBoxID. => new (),
_ => null,
};
};

View File

@ -70,6 +70,7 @@ namespace Oshima.FunGame.OshimaModules
(long)PassiveID. => new (),
(long)ItemPassiveID. => new (),
(long)ItemActiveID. => new (),
(long)ItemActiveID. => new (),
_ => null
};
};

View File

@ -107,6 +107,7 @@
= 6001,
= 6002,
= 6003,
= 6004
= 6004,
= 6005
}
}

View File

@ -8,6 +8,8 @@ namespace Oshima.FunGame.OshimaServers.Service
public class FunGameConstant
{
public const long CustomCharacterId = -1;
public const int ItemsPerPage1 = 6;
public const int ItemsPerPage2 = 10;
public static List<Character> Characters { get; } = [];
public static List<Skill> Skills { get; } = [];
public static List<Skill> PassiveSkills { get; } = [];
@ -21,11 +23,7 @@ namespace Oshima.FunGame.OshimaServers.Service
public static Dictionary<long, User> UserIdAndUsername { get; } = [];
public static ItemType[] ItemCanUsed => [ItemType.Consumable, ItemType.MagicCard, ItemType.SpecialItem, ItemType.GiftBox, ItemType.Others];
public static Dictionary<int, Dictionary<string, int>> LevelBreakNeedyList
{
get
{
return new()
public static Dictionary<int, Dictionary<string, int>> LevelBreakNeedyList { get; } = new()
{
{
0, new()
@ -76,14 +74,8 @@ namespace Oshima.FunGame.OshimaServers.Service
}
},
};
}
}
public static Dictionary<int, Dictionary<string, int>> SkillLevelUpList
{
get
{
return new()
public static Dictionary<int, Dictionary<string, int>> SkillLevelUpList { get; } = new()
{
{
1, new()
@ -146,14 +138,8 @@ namespace Oshima.FunGame.OshimaServers.Service
}
}
};
}
}
public static Dictionary<int, Dictionary<string, int>> NormalAttackLevelUpList
{
get
{
return new()
public static Dictionary<int, Dictionary<string, int>> NormalAttackLevelUpList { get; } = new()
{
{
2, new()
@ -229,14 +215,8 @@ namespace Oshima.FunGame.OshimaServers.Service
}
}
};
}
}
public static Dictionary<EffectID, Dictionary<string, object>> RoundRewards
{
get
{
return new()
public static Dictionary<EffectID, Dictionary<string, object>> RoundRewards { get; } = new()
{
{
EffectID.ExATK,
@ -302,184 +282,443 @@ namespace Oshima.FunGame.OshimaServers.Service
}
}
};
}
}
public static Dictionary<string, string> QuestList
{
get
{
return new()
public static Dictionary<string, string> ContinuousQuestList { get; } = new()
{
{
"丢失的共享单车之谜",
"寻找被魔法传送走的共享单车。"
"悖论引擎的暗涌之息",
"穿梭于银辉城流淌液态月光的街道,侦测悖论引擎释放的异常能量潮汐,揭开可能撕裂现实结构的危险谜团。"
},
{
"咖啡店的神秘顾客",
"调查每天都点奇怪饮品的神秘顾客。"
"林海深处的记忆协奏曲",
"在瑟兰薇歌林海水晶化的树冠建立观测站,记录春季地貌重组时树木根系发出的低频共振波,破译其与旋律古龙苏醒周期的关联。"
},
{
"地铁里的幽灵乘客",
"找出在地铁里出没的半透明乘客。"
"元素裂隙的熵增警告",
"使用抗魔探针扫描赫菲斯托斯之喉第47层矿道绘制元素裂缝的扩张轨迹评估其引发位面坍缩的风险等级。"
},
{
"公园的精灵涂鸦",
"清除公园里突然出现的精灵涂鸦。"
"时间琥珀中的战争回响",
"在永霜裂痕建立时滞力场实验室,分析冻结在冰壁中的古代战争幻象,还原时霜药剂对观察者认知体系的扭曲机制。"
},
{
"手机信号的干扰源",
"找出干扰手机信号的魔法源头。"
"镜像维度的认知污染",
"佩戴反重力拘束装置潜入千瞳镜湖,测绘镜像城的拓扑结构,警惕瞳孔状传送门对记忆模块的逆向写入现象。"
},
{
"外卖小哥的奇遇",
"帮助外卖小哥找回被偷走的魔法外卖。"
"雷霆王座的符文解读",
"攀登雷霆王座山脉,记录裁决尖碑在月圆之夜投射的泰坦符文,破译其蕴含的宇宙法则。"
},
{
"广场舞的魔法节奏",
"调查广场舞音乐中隐藏的魔法节奏。"
"流沙时计的昨日寻踪",
"在流沙时计荒漠中寻找海市蜃楼般的昨日之城,收集散落在其中的时间碎片,还原历史真相。"
},
{
"自动贩卖机的秘密",
"找出自动贩卖机里突然出现的奇怪物品。"
"腐萤沼渊的共生调查",
"深入腐萤沼渊,研究共生母体的生态系统,记录菌类模仿动物叫声的频率和模式。"
},
{
"便利店的异次元入口",
"调查便利店里突然出现的异次元入口。"
"苍穹碎屿的星锚校准",
"前往苍穹碎屿的星锚之地,校准引雷柱的能量输出,防止星空巨兽挣脱束缚。"
},
{
"街头艺人的魔法表演",
"调查街头艺人表演中使用的魔法。"
"齿与血回廊的改造逆转",
"潜入齿与血回廊的造物车间,研究其改造机制,寻找逆转改造的方法。"
},
{
"午夜电台的幽灵来电",
"调查午夜电台收到的奇怪来电。"
"穹顶之泪的星辉观测",
"在穹顶之泪湖畔建立观测点,记录星辉水母群在午夜重构水体重力法则时的变化。"
},
{
"高楼大厦的秘密通道",
"寻找隐藏在高楼大厦里的秘密通道。"
"齿轮坟场的构装残骸",
"在齿轮坟场搜寻构装巨龙的残骸,分析其动力核心,寻找上古机械文明的线索。"
},
{
"城市下水道的神秘生物",
"调查城市下水道里出现的神秘生物。"
"回音棱镜林的记忆共鸣",
"进入回音棱镜林,收集晶体化红杉中储存的亡者记忆,调查影狼嚎叫产生的空间褶皱。"
},
{
"废弃工厂的魔法实验",
"调查废弃工厂里进行的秘密魔法实验。"
"永燃坩埚的活体金属",
"在永燃坩埚的火山灰中采集活体金属苔藓样本,研究其生长特性。"
},
{
"博物馆的活化雕像",
"调查博物馆里突然活化的雕像。"
"骨桥深渊的幽灵航线",
"调查骨桥深渊的幽灵船航线,收集桥底虚空中的能量波动数据。"
},
{
"公园的都市传说",
"调查公园里流传的都市传说。"
"时漏沙漠的时凝液",
"在时漏沙漠中寻找沙漏仙人掌,采集其分泌的时凝液,研究其时间魔法特性。"
},
{
"闹鬼公寓的真相",
"调查闹鬼公寓里的真相。"
"脉轮圣树的蜜蜡编码",
"攀登脉轮圣树,收集树液凝结的可编程蜜蜡,分析其编码模式。"
},
{
"地下酒吧的秘密交易",
"调查地下酒吧里进行的秘密魔法交易。"
"悲鸣矿脉的神经宝石",
"在悲鸣矿脉中采集神经宝石样本,研究其与山体剧痛的关联。"
},
{
"旧书店的魔法书籍",
"寻找旧书店里隐藏的魔法书籍。"
"双生月崖的湮灭边界",
"在双生月崖的边界处进行实验,研究跨越永昼和永夜界限时产生的湮灭现象。"
},
{
"涂鸦墙的预言",
"解读涂鸦墙上出现的神秘预言。"
},
{
"黑客的魔法入侵",
"阻止黑客利用魔法入侵城市网络。"
},
{
"高科技魔法装备的测试",
"测试新型的高科技魔法装备。"
},
{
"无人机的魔法改造",
"改造无人机,使其拥有魔法能力。"
},
{
"人工智能的觉醒",
"调查人工智能觉醒的原因。"
},
{
"虚拟现实的魔法世界",
"探索虚拟现实中出现的魔法世界。"
},
{
"智能家居的魔法故障",
"修复智能家居的魔法故障。"
},
{
"能量饮料的魔法副作用",
"调查能量饮料的魔法副作用。"
},
{
"社交媒体的魔法病毒",
"清除社交媒体上出现的魔法病毒。"
},
{
"共享汽车的魔法漂移",
"调查共享汽车的魔法漂移现象。"
},
{
"城市监控的魔法干扰",
"修复城市监控的魔法干扰。"
},
{
"寻找丢失的魔法宠物",
"寻找在城市里走失的魔法宠物。"
},
{
"参加魔法美食节",
"参加城市举办的魔法美食节。"
},
{
"解开城市谜题",
"解开隐藏在城市各处的谜题。"
},
{
"参加魔法cosplay大赛",
"参加城市举办的魔法cosplay大赛。"
},
{
"寻找隐藏的魔法商店",
"寻找隐藏在城市里的魔法商店。"
},
{
"制作魔法主题的街头艺术",
"在城市里创作魔法主题的街头艺术。"
},
{
"举办一场魔法快闪活动",
"在城市里举办一场魔法快闪活动。"
},
{
"寻找失落的魔法乐器",
"寻找失落的魔法乐器,让城市充满音乐。"
},
{
"参加魔法运动会",
"参加城市举办的魔法运动会。"
},
{
"拯救被困在魔法结界里的市民",
"拯救被困在城市魔法结界里的市民。"
"谵妄海市的梦境碎片",
"进入谵妄海市,收集可食用梦境碎片,分析其对认知的影响。"
}
};
}
}
public static Dictionary<QualityType, double> DrawCardProbabilities
public static Dictionary<string, string> ImmediateQuestList { get; } = new()
{
get
{
return new()
"星银警戒协议·弎级响应",
"星银合金守卫在悖论引擎周边暴走,形成包围核心区的杀戮矩阵,必须在三刻钟内解除警戒协议"
},
{
"音律囚笼突破作战",
"苏醒的旋律古龙释放出高频震波,将精灵们困在水晶共振牢笼中,需在下次地貌重组前切断声波共鸣节点"
},
{
"深渊火种收容危机",
"矿道底层的深渊火钻因元素污染进入链式裂变,引发全矿道魔能过载,立即部署熵减力场遏制反应"
},
{
"时霜逆流救援行动",
"科研小组被困在加速百倍的时间泡内,其肉体正以肉眼可见的速度衰老,必须校准哨塔时钟恢复时间流速"
},
{
"镜像侵蚀净化指令",
"镜像守卫突破湖面屏障入侵现实维度,携带的认知病毒正在改写物理法则,启动银辉城防卫协议实施净化"
},
{
"雷霆风暴紧急预警",
"雷霆王座山脉的悬浮岩块因磁场紊乱开始崩塌,必须在半小时内稳定磁场。"
},
{
"流沙陷阱救援行动",
"一支探险队被困在流沙时计荒漠的昨日之城中,必须在沙暴来临前将其救出。"
},
{
"沼泽毒气泄漏警报",
"腐萤沼渊的毒气浓度超标,必须立即启动通风系统,防止毒气扩散。"
},
{
"星空巨兽挣脱危机",
"苍穹碎屿的星锚之地出现裂缝,星空巨兽即将挣脱束缚,必须立即加固引雷柱。"
},
{
"活体建筑暴走事件",
"齿与血回廊的活体建筑开始失控,必须立即关闭其动力系统。"
},
{
"水母重力失控事件",
"穹顶之泪湖的星辉水母群重力法则失控,必须立即稳定水体。"
},
{
"构装巨龙苏醒警报",
"齿轮坟场的构装巨龙开始苏醒,必须立即启动防御系统。"
},
{
"记忆共鸣失控事件",
"回音棱镜林的记忆共鸣失控,引发空间褶皱,必须立即稳定空间。"
},
{
"活体金属苔藓异变",
"永燃坩埚的活体金属苔藓发生异变,开始吞噬周围的金属,必须立即遏制。"
},
{
"幽灵船袭击事件",
"骨桥深渊的幽灵船开始袭击过往的船只,必须立即击退。"
},
{
"时之蝎暴走事件",
"时漏沙漠的时之蝎因时凝液泄漏而暴走,必须立即控制。"
},
{
"蜜蜡编码泄露危机",
"脉轮圣树的可编程蜜蜡编码泄露,引发未知危机,必须立即阻止。"
},
{
"神经宝石共鸣危机",
"悲鸣矿脉的神经宝石发生共鸣,引发山体震荡,必须立即稳定。"
},
{
"湮灭风暴预警",
"双生月崖的湮灭边界出现不稳定,引发湮灭风暴,必须立即撤离。"
},
{
"思维寄生虫感染事件",
"谵妄海市的思维寄生虫开始感染居民,必须立即隔离。"
}
};
public static Dictionary<string, string> ProgressiveQuestList { get; } = new()
{
{
"月光萃取计划",
"在星银合金建筑的沟壑中采集 {0} 份液态月光(注意避开月光洪流的高潮时段/每夜丑时三刻)。"
},
{
"灵脉汁液采收行动",
"使用抗腐蚀容器收集 {0} 份瑟兰薇歌林海的荧蓝汁液(树木自卫系统激活时汁液会转化为神经毒素)。"
},
{
"火钻精炼协议",
"在矿工灵魂烙印的指引下获取 {0} 颗深渊火钻(未烙印者触碰火钻将引发元素爆燃)。"
},
{
"时霜逆向工程",
"通过时间镜像收集 {0} 份不同历史断片的时霜药剂样本(注意时空回响对记忆的覆盖效应)。"
},
{
"瞳孔密钥重构计划",
"从 {0} 个瞳孔状传送门提取量子纠缠碎片(每个采集点需保持镜像对称操作以避免维度塌缩)。"
},
{
"泰坦符文拓印",
"在雷霆王座山脉的裁决尖碑上拓印 {0} 份不同的泰坦符文(注意避开雷暴时段/每逢子时)。"
},
{
"时间碎片收集",
"在流沙时计荒漠的昨日之城中收集 {0} 份不同的时间碎片(注意时间碎片会随机重组)。"
},
{
"共生母体样本采集",
"从腐萤沼渊的共生母体上采集 {0} 份不同的菌类样本(注意菌类会释放麻痹毒素)。"
},
{
"星锚能量校准",
"在苍穹碎屿的星锚之地校准 {0} 个不同的引雷柱(注意引雷柱会释放高压电流)。"
},
{
"改造逆转实验",
"在齿与血回廊的造物车间进行 {0} 次不同的改造逆转实验(注意改造实验会引发身体异变)。"
},
{
"星辉水母观测记录",
"在穹顶之泪湖记录 {0} 次星辉水母重构水体重力法则的完整过程(注意水母重构时会产生重力波动)。"
},
{
"构装巨龙残骸分析",
"在齿轮坟场分析 {0} 个不同的构装巨龙残骸(注意残骸可能带有自毁装置)。"
},
{
"亡者记忆提取",
"在回音棱镜林提取 {0} 份不同的亡者记忆(注意记忆提取会引发共感)。"
},
{
"活体金属苔藓培养",
"在永燃坩埚培养 {0} 份不同的活体金属苔藓样本(注意苔藓会吸收金属)。"
},
{
"幽灵船能量分析",
"在骨桥深渊收集 {0} 份幽灵船的能量波动数据(注意幽灵船会释放虚空能量)。"
},
{
"时凝液提纯",
"在时漏沙漠提纯 {0} 份时凝液(注意时凝液会加速时间流速)。"
},
{
"蜜蜡编码破解",
"在脉轮圣树破解 {0} 份不同的蜜蜡编码(注意编码会引发精神干扰)。"
},
{
"神经宝石能量分析",
"在悲鸣矿脉分析 {0} 份不同的神经宝石能量(注意宝石会引发山体剧痛)。"
},
{
"湮灭边界观察",
"在双生月崖观察 {0} 次不同的湮灭边界现象(注意湮灭边界会吞噬物质)。"
},
{
"梦境碎片分析",
"在谵妄海市分析 {0} 份不同的梦境碎片(注意梦境碎片会引发幻觉)。"
}
};
public static List<Region> Regions { get; } = [
new Region()
{
Id = 1,
Name = "银辉城",
Description = "悬浮在云海中的倒三角金属都市,建筑由星银合金铸造,街道流淌着液态月光。核心区藏有能改写现实法则的「悖论引擎」",
Weather = "晴朗",
Temperature = 20,
Difficulty = RarityType.TwoStar
},
new Region()
{
Id = 2,
Name = "瑟兰薇歌林海",
Description = "树木枝干中流淌荧蓝汁液,春季行走重组地貌,冬季化为水晶雕塑。深处沉睡着被精灵封印的「旋律古龙」",
Weather = "多云",
Temperature = 15,
Difficulty = RarityType.FourStar
},
new Region()
{
Id = 3,
Name = "赫菲斯托斯之喉",
Description = "螺旋向下的火山矿井,底层矿工开采深渊火钻,矿道会突然熔化成通往元素位面的裂缝",
Weather = "炎热",
Temperature = 45,
Difficulty = RarityType.FourStar
},
new Region()
{
Id = 4,
Name = "永霜裂痕",
Description = "冰晶峡谷冻结着不同时代的战争残影,哨塔时钟随机倒转/加速,需服用「时霜药剂」保持神智",
Weather = "极寒",
Temperature = -25,
Difficulty = RarityType.FiveStar
},
new Region()
{
Id = 5,
Name = "千瞳镜湖",
Description = "湖面倒影展现平行时空,潜入会进入重力颠倒的镜像城,湖底布满瞳孔状传送门",
Weather = "阴沉",
Temperature = 10,
Difficulty = RarityType.TwoStar
},
new Region()
{
Id = 6,
Name = "雷霆王座山脉",
Description = "悬浮岩块组成的三维迷宫,最高峰「裁决尖碑」在月圆之夜投射出泰坦调试世界的符文",
Weather = "雷暴",
Temperature = 5,
Difficulty = RarityType.FourStar
},
new Region()
{
Id = 7,
Name = "流沙时计荒漠",
Description = "沙粒蕴含时间魔法,沙丘每小时重组地形,沙暴中会出现海市蜃楼般的「昨日之城」",
Weather = "沙尘暴",
Temperature = 35,
Difficulty = RarityType.ThreeStar
},
new Region()
{
Id = 8,
Name = "腐萤沼渊",
Description = "荧光毒气沼泽,中心生长直径三公里的脑状肉瘤「共生母体」,菌类模仿动物叫声诱捕猎物",
Weather = "潮湿",
Temperature = 22,
Difficulty = RarityType.OneStar
},
new Region()
{
Id = 9,
Name = "苍穹碎屿",
Description = "破碎天穹形成的浮空岛群,「星锚之地」竖立着束缚星空巨兽的引雷柱",
Weather = "晴朗",
Temperature = 18,
Difficulty = RarityType.ThreeStar
},
new Region()
{
Id = 10,
Name = "齿与血回廊",
Description = "自我扩建的活体建筑群,齿轮血管输送液态魔力,「造物车间」会强制改造闯入者",
Weather = "阴暗",
Temperature = 12,
Difficulty = RarityType.FiveStar
},
new Region()
{
Id = 11,
Name = "穹顶之泪湖",
Description = "破碎天穹下的倒影湖泊,折射多维星空,星辉水母群午夜重构水体重力法则",
Weather = "星光",
Temperature = 16,
Difficulty = RarityType.OneStar
},
new Region()
{
Id = 12,
Name = "齿轮坟场",
Description = "堆积上古机械文明的金属荒漠,沙粒为微缩齿轮,构装巨龙在沙暴中游荡",
Weather = "沙尘",
Temperature = 30,
Difficulty = RarityType.ThreeStar
},
new Region()
{
Id = 13,
Name = "回音棱镜林",
Description = "晶体化红杉储存亡者记忆,荧光孢子引发共感,影狼嚎叫产生空间褶皱",
Weather = "雾气",
Temperature = 14,
Difficulty = RarityType.FourStar
},
new Region()
{
Id = 14,
Name = "永燃坩埚",
Description = "岩浆海上的球形锻造都市,岩浆鱿鱼游弋街道,火山灰培育活体金属苔藓",
Weather = "高温",
Temperature = 60,
Difficulty = RarityType.FiveStar
},
new Region()
{
Id = 15,
Name = "骨桥深渊",
Description = "巨型骸骨形成的呼吸桥梁,幽灵船在桥底虚空航行,骸骨寄生神经蕨类",
Weather = "阴森",
Temperature = 8,
Difficulty = RarityType.ThreeStar
},
new Region()
{
Id = 16,
Name = "时漏沙漠",
Description = "时间碎片组成的流沙领域,时之蝎加速局部时间,沙漏仙人掌分泌时凝液",
Weather = "不稳定",
Temperature = 38,
Difficulty = RarityType.TwoStar
},
new Region()
{
Id = 17,
Name = "脉轮圣树",
Description = "树干直径十公里的螺旋巨树,年轮是立体城市,树液凝结可编程蜜蜡",
Weather = "晴朗",
Temperature = 24,
Difficulty = RarityType.ThreeStar
},
new Region()
{
Id = 18,
Name = "悲鸣矿脉",
Description = "岩层嵌满神经宝石的活体矿山,开采引发山体剧痛,晶簇守卫实体化巡逻",
Weather = "幽暗",
Temperature = 10,
Difficulty = RarityType.FourStar
},
new Region()
{
Id = 19,
Name = "双生月崖",
Description = "撕裂的悬浮山脉,永昼侧栖光鹰,永夜侧绽影玫瑰,跨越界限触发湮灭",
Weather = "昼夜交替",
Temperature = 15,
Difficulty = RarityType.FiveStar
},
new Region()
{
Id = 20,
Name = "谵妄海市",
Description = "需认知干扰剂进入的幻觉城市,思维寄生虫伪装市民,贩卖可食用梦境碎片",
Weather = "迷幻",
Temperature = 20,
Difficulty = RarityType.FourStar
}
];
public static Dictionary<QualityType, double> DrawCardProbabilities { get; } = new()
{
{ QualityType.White, 69.53 },
{ QualityType.Green, 15.35 },
@ -488,14 +727,8 @@ namespace Oshima.FunGame.OshimaServers.Service
{ QualityType.Orange, 1.33 },
{ QualityType.Red, 0.06 }
};
}
}
public static Dictionary<QualityType, (int Min, int Max)> PriceRanges
{
get
{
return new()
public static Dictionary<QualityType, (int Min, int Max)> PriceRanges { get; } = new()
{
{ QualityType.White, (200, 2000) },
{ QualityType.Green, (1500, 15000) },
@ -505,8 +738,6 @@ namespace Oshima.FunGame.OshimaServers.Service
{ QualityType.Red, (100000, 1000000) },
{ QualityType.Gold, (500000, 5000000) }
};
}
}
public static string[] CommonSurnames { get; } = [
"顾", "沈", "陆", "楚", "白", "苏", "叶", "萧", "莫", "司马", "欧阳",
@ -522,7 +753,22 @@ namespace Oshima.FunGame.OshimaServers.Service
"墨", "柏", "安", "晏", "尉", "南", "轩", "竹", "晨", "桓", "晖",
"瑾", "溪", "汐", "沐", "玉", "汀", "归", "羽", "颜", "辰", "琦",
"芷", "尹", "施", "原", "孟", "尧", "荀", "单", "简", "植", "傅",
"司", "钟", "方", "谢"
"司", "钟", "方", "谢",
"赵", "钱", "孙", "李", "周", "吴", "郑", "王", "冯", "陈", "卫", "蒋", "沈", "韩",
"杨", "朱", "秦", "许", "何", "吕", "张", "孔", "曹", "严", "华", "金", "魏", "陶",
"姜", "谢", "罗", "徐", "林", "范", "方", "唐", "柳", "宋", "元", "萧", "程", "陆",
"顾", "楚", "白", "苏", "叶", "萧", "莫", "凌", "寒", "龙", "凤", "蓝", "冷", "华",
"唐", "韩", "庄", "青", "安", "晏", "尹", "施", "孟", "荀", "傅", "钟", "方", "谢",
"司马", "欧阳", "上官", "慕容", "尉迟", "司徒", "轩辕", "端木", "南宫", "长孙",
"百里", "东方", "西门", "独孤", "公孙", "令狐", "宇文", "夏侯", "赫连", "皇甫",
"墨", "君", "月", "紫", "卿", "微", "清", "易", "霜", "兰", "语", "雪", "璃",
"镜", "弦", "珏", "瑾", "璇", "绯", "霁", "溟", "澈", "归", "羽", "辰", "芷",
"风", "花", "江", "河", "湖", "海", "山", "川", "松", "竹", "梅", "菊", "枫",
"梧", "泉", "溪", "岚", "雾", "露", "霓", "霰", "星", "辰",
"沧", "溟", "无", "绝", "孤", "隐", "斩", "破", "惊", "鸿", "御", "玄", "冥",
"烬", "夙", "离",
"东篱", "南笙", "西楼", "北冥", "九歌", "长离", "扶摇", "青丘", "凌霄", "重光",
"子车", "亓官", "巫马", "拓跋", "叱干", "斛律", "沮渠", "秃发", "万俟", "仆固"
];
public static string CommonChineseCharacters { get; } =

View File

@ -47,7 +47,7 @@ namespace Oshima.FunGame.OshimaServers.Service
FunGameConstant.Items.AddRange(exItems.Values.Where(i => (int)i.ItemType > 4));
FunGameConstant.Items.AddRange([new (), new (), new (), new (), new (), new (), new (), new (), new (), new (),
new (), new (), new (), new 1(), new 2(), new 3(), new 1(), new 2(), new 3()]);
new (), new (), new (), new 1(), new 2(), new 3(), new 1(), new 2(), new 3(), new (), new (), new ()]);
FunGameConstant.AllItems.AddRange(FunGameConstant.Equipment);
FunGameConstant.AllItems.AddRange(FunGameConstant.Items);
@ -1052,6 +1052,53 @@ namespace Oshima.FunGame.OshimaServers.Service
public static bool UseItemCustom(Item item, User user, IEnumerable<Character> targets, out string msg)
{
msg = "";
if (item.ItemType == ItemType.GiftBox)
{
if (item is .GiftBox box && box.Gifts.Count > 0)
{
foreach (string name in box.Gifts.Keys)
{
if (name == General.GameplayEquilibriumConstant.InGameCurrency)
{
user.Inventory.Credits += box.Gifts[name];
}
if (name == General.GameplayEquilibriumConstant.InGameMaterial)
{
user.Inventory.Materials += box.Gifts[name];
}
if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == name) is Item currentItem)
{
for (int i = 0; i < box.Gifts[name]; i++)
{
Item newItem = currentItem.Copy();
SetSellAndTradeTime(newItem);
newItem.User = user;
user.Inventory.Items.Add(newItem);
}
}
}
msg = "打开礼包成功!获得了以下物品:\r\n" + string.Join("", box.Gifts.Select(kv => $"{kv.Key} * {kv.Value}"));
if (item.Name == nameof())
{
msg += "\r\n" + "热腾腾的除夕年夜饭,祝您阖家团圆,年味浓浓!";
}
else if (item.Name == nameof())
{
msg += "\r\n" + "金蛇送福,好运连连!!";
}
else if (item.Name == nameof())
{
msg += "\r\n" + "新春纳福,喜乐安康!!";
}
item.RemainUseTimes--;
if (item.RemainUseTimes < 0) item.RemainUseTimes = 0;
if (item.RemainUseTimes == 0)
{
user.Inventory.Items.Remove(item);
}
return true;
}
}
switch (item.Name)
{
default:
@ -1213,7 +1260,7 @@ namespace Oshima.FunGame.OshimaServers.Service
{
int nowIndex = Bosses.Count > 0 ? Bosses.Keys.Max() + 1 : 1;
string bossName = GenerateRandomChineseUserName();
Character boss = new CustomCharacter(nowIndex, bossName, "", bossName);
CustomCharacter boss = new(nowIndex, bossName, "", bossName);
int cutRate = Random.Shared.Next(3) switch
{
0 => 1,
@ -1324,6 +1371,7 @@ namespace Oshima.FunGame.OshimaServers.Service
boss.Skills.Add(super);
boss.Recovery();
boss.SetPrimaryAttribute();
Bosses[nowIndex] = boss;
}
@ -1428,41 +1476,110 @@ namespace Oshima.FunGame.OshimaServers.Service
// 生成任务
for (int i = 0; i < 6; i++)
{
QuestType type = (QuestType)Random.Shared.Next(3);
long id = quests.Count > 0 ? quests.Values.Max(q => q.Id) + 1 : 1;
Quest quest;
if (type == QuestType.Continuous)
{
string name = FunGameConstant.ContinuousQuestList.Keys.OrderBy(o => Random.Shared.Next()).First();
int minutes = Random.Shared.Next(10, 41);
Dictionary<string, int> items = [];
items[General.GameplayEquilibriumConstant.InGameCurrency] = minutes * 20;
items[General.GameplayEquilibriumConstant.InGameMaterial] = minutes / 8 * 1;
HashSet<Item> items = [];
Dictionary<string, int> itemsCount = [];
int index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item = FunGameConstant.AllItems[index];
items.Add(item.Name, 1);
while (true)
items.Add(item);
itemsCount[item.Name] = 1;
index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item2 = FunGameConstant.AllItems[index];
items.Add(item2);
if (!itemsCount.TryAdd(item2.Name, 1))
{
int index2 = Random.Shared.Next(FunGameConstant.AllItems.Count);
if (index2 != index)
{
Item item2 = FunGameConstant.AllItems[index2];
items.Add(item2.Name, 1);
break;
itemsCount[item2.Name]++;
}
}
string name = FunGameConstant.QuestList.Keys.OrderBy(o => Random.Shared.Next()).First();
Quest quest = new()
quest = new()
{
Id = quests.Count > 0 ? quests.Values.Max(q => q.Id) + 1 : 1,
Id = id,
Name = name,
Description = FunGameConstant.QuestList[name],
Description = FunGameConstant.ContinuousQuestList[name],
QuestType = QuestType.Continuous,
EstimatedMinutes = minutes,
Awards = items
CreditsAward = minutes * 20,
MaterialsAward = minutes / 8 * 1,
Awards = items,
AwardsCount = itemsCount
};
}
else if (type == QuestType.Immediate)
{
string name = FunGameConstant.ImmediateQuestList.Keys.OrderBy(o => Random.Shared.Next()).First();
int difficulty = Random.Shared.Next(3, 11);
HashSet<Item> items = [];
Dictionary<string, int> itemsCount = [];
int index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item = FunGameConstant.AllItems[index];
items.Add(item);
itemsCount[item.Name] = 1;
index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item2 = FunGameConstant.AllItems[index];
items.Add(item2);
if (!itemsCount.TryAdd(item2.Name, 1))
{
itemsCount[item2.Name]++;
}
quest = new()
{
Id = id,
Name = name,
Description = FunGameConstant.ImmediateQuestList[name],
QuestType = QuestType.Immediate,
CreditsAward = difficulty * 80,
MaterialsAward = difficulty / 2 * 1,
Awards = items,
AwardsCount = itemsCount
};
}
else
{
string name = FunGameConstant.ProgressiveQuestList.Keys.OrderBy(o => Random.Shared.Next()).First();
int maxProgress = Random.Shared.Next(3, 11);
HashSet<Item> items = [];
Dictionary<string, int> itemsCount = [];
int index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item = FunGameConstant.AllItems[index];
items.Add(item);
itemsCount[item.Name] = 1;
index = Random.Shared.Next(FunGameConstant.AllItems.Count);
Item item2 = FunGameConstant.AllItems[index];
items.Add(item2);
if (!itemsCount.TryAdd(item2.Name, 1))
{
itemsCount[item2.Name]++;
}
quest = new()
{
Id = id,
Name = name,
Description = string.Format(FunGameConstant.ProgressiveQuestList[name], maxProgress),
QuestType = QuestType.Progressive,
Progress = 0,
MaxProgress = maxProgress,
CreditsAward = maxProgress * 80,
MaterialsAward = maxProgress / 2 * 1,
Awards = items,
AwardsCount = itemsCount
};
}
quests.Add(quest.GetIdName(), quest);
}
return "☆--- 今日任务列表 ---☆\r\n" + string.Join("\r\n", quests.Values.Select(q => q.ToString())) + "\r\n温馨提示请务必在次日 4:00 前完成任务结算,未结算的任务都会被取消!";
return "☆--- 今日任务列表 ---☆\r\n" + string.Join("\r\n", quests.Values.Select(q => q.ToString())) + "\r\n温馨提示使用【做任务+任务序号】指令来进行任务。\r\n请务必在次日 4:00 前完成任务结算,未结算的任务都会被取消!";
}
else
{
if (quests.Count > 0)
{
return "☆--- 今日任务列表 ---☆\r\n" + string.Join("\r\n", quests.Values.Select(q => q.ToString())) + "\r\n温馨提示请务必在次日 4:00 前完成任务结算,未结算的任务都会被取消!";
return "☆--- 今日任务列表 ---☆\r\n" + string.Join("\r\n", quests.Values.Select(q => q.ToString())) + "\r\n温馨提示使用【做任务+任务序号】指令来进行任务。\r\n请务必在次日 4:00 前完成任务结算,未结算的任务都会被取消!";
}
else
{
@ -1488,17 +1605,21 @@ namespace Oshima.FunGame.OshimaServers.Service
{
quest.Status = QuestState.Settled;
quest.SettleTime = DateTime.Now;
foreach (string name in quest.Awards.Keys)
if (quest.CreditsAward > 0)
{
if (name == General.GameplayEquilibriumConstant.InGameCurrency)
{
user.Inventory.Credits += quest.Awards[name];
user.Inventory.Credits += quest.CreditsAward;
}
else if (name == General.GameplayEquilibriumConstant.InGameMaterial)
if (quest.MaterialsAward > 0)
{
user.Inventory.Materials += quest.Awards[name];
user.Inventory.Materials += quest.MaterialsAward;
}
else if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == name) is Item item)
foreach (Item item in quest.Awards)
{
if (quest.AwardsCount.TryGetValue(item.Name, out int qty))
{
for (int i = 0; i < qty; i++)
{
if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == item.Name) != null)
{
Item newItem = item.Copy();
newItem.User = user;
@ -1506,8 +1627,10 @@ namespace Oshima.FunGame.OshimaServers.Service
user.Inventory.Items.Add(newItem);
}
}
}
}
TaskUtility.NewTask(async () => await AnonymousServer.PushMessageToClients(user.AutoKey, $"FunGame Web API 推送:你的任务【{quest.Name}】已结算," +
$"获得奖励:【{string.Join("", quest.Awards.Select(kv => kv.Key + " * " + kv.Value))}】!"));
$"获得奖励:【{quest.AwardsString}】!"));
result = true;
}
return result;
@ -1531,7 +1654,7 @@ namespace Oshima.FunGame.OshimaServers.Service
double price = Random.Shared.Next(min, max);
if (price == 0)
{
price = (Random.Shared.NextDouble() + 0.1) * Random.Shared.Next(1000, 10000) * Random.Shared.Next((int)item.QualityType + 2, 6 + ((int)item.QualityType));
price = (Random.Shared.NextDouble() + 0.1) * Random.Shared.Next(1000, 5000) * Random.Shared.Next((int)item.QualityType + 2, 6 + ((int)item.QualityType));
}
item.Price = Calculation.Round2Digits(price);
daily.AddItem(item, Random.Shared.Next(1, 3));

View File

@ -505,28 +505,29 @@ namespace Oshima.FunGame.WebAPI.Controllers
[HttpPost("restoresaved")]
public string RestoreSaved([FromQuery] long? uid = null)
{
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
//long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
PluginConfig pc = new("saved", userid.ToString());
pc.LoadConfig();
//PluginConfig pc = new("saved", userid.ToString());
//pc.LoadConfig();
if (pc.Count > 0)
{
User user = FunGameService.GetUser(pc);
user.Inventory.Credits = 5000;
user.Inventory.Materials = 0;
user.Inventory.Characters.Clear();
user.Inventory.Items.Clear();
user.Inventory.Characters.Add(new CustomCharacter(FunGameConstant.CustomCharacterId, user.Username));
user.LastTime = DateTime.Now;
pc.Add("user", user);
pc.SaveConfig();
return NetworkUtility.JsonSerialize($"你的存档已还原成功。");
}
else
{
return NetworkUtility.JsonSerialize(noSaved);
}
//if (pc.Count > 0)
//{
// User user = FunGameService.GetUser(pc);
// user.Inventory.Credits = 5000;
// user.Inventory.Materials = 0;
// user.Inventory.Characters.Clear();
// user.Inventory.Items.Clear();
// user.Inventory.Characters.Add(new CustomCharacter(FunGameConstant.CustomCharacterId, user.Username));
// user.LastTime = DateTime.Now;
// pc.Add("user", user);
// pc.SaveConfig();
// return NetworkUtility.JsonSerialize($"你的存档已还原成功。");
//}
//else
//{
// return NetworkUtility.JsonSerialize(noSaved);
//}
return NetworkUtility.JsonSerialize($"此功能维护中。");
}
[HttpPost("showsaved")]
@ -543,6 +544,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
StringBuilder builder = new();
builder.AppendLine($"☆★☆ {user.Username}的存档信息 ☆★☆");
builder.AppendLine($"UID{user.Id}");
builder.AppendLine($"{General.GameplayEquilibriumConstant.InGameCurrency}{user.Inventory.Credits:0.00}");
builder.AppendLine($"{General.GameplayEquilibriumConstant.InGameMaterial}{user.Inventory.Materials:0.00}");
builder.AppendLine($"角色数量:{user.Inventory.Characters.Count}");
@ -650,12 +652,18 @@ namespace Oshima.FunGame.WebAPI.Controllers
if (user.Inventory.Characters.FirstOrDefault(c => c.Id == FunGameConstant.CustomCharacterId) is Character character)
{
PrimaryAttribute oldPA = character.PrimaryAttribute;
double oldHP = character.InitialHP;
double oldMP = character.InitialMP;
double oldATK = character.InitialATK;
double oldSTR = character.InitialSTR;
double oldAGI = character.InitialAGI;
double oldINT = character.InitialINT;
double oldSTRG = character.STRGrowth;
double oldAGIG = character.AGIGrowth;
double oldINTG = character.INTGrowth;
double oldSPD = character.InitialSPD;
double oldHR = character.InitialHR;
double oldMR = character.InitialMR;
Character? newCustom = emc.Count > 0 ? emc.Get("newCustom") : null;
if (isConfirm)
@ -663,12 +671,18 @@ namespace Oshima.FunGame.WebAPI.Controllers
if (newCustom != null)
{
character.PrimaryAttribute = newCustom.PrimaryAttribute;
character.InitialHP = newCustom.InitialHP;
character.InitialMP = newCustom.InitialMP;
character.InitialATK = newCustom.InitialATK;
character.InitialSTR = newCustom.InitialSTR;
character.InitialAGI = newCustom.InitialAGI;
character.InitialINT = newCustom.InitialINT;
character.STRGrowth = newCustom.STRGrowth;
character.AGIGrowth = newCustom.AGIGrowth;
character.INTGrowth = newCustom.INTGrowth;
character.InitialSPD = newCustom.InitialSPD;
character.InitialHR = newCustom.InitialHR;
character.InitialMR = newCustom.InitialMR;
user.LastTime = DateTime.Now;
pc.Add("user", user);
pc.SaveConfig();
@ -676,9 +690,15 @@ namespace Oshima.FunGame.WebAPI.Controllers
emc.SaveConfig();
return NetworkUtility.JsonSerialize($"你已完成重随属性确认,新的自建角色属性如下:\r\n" +
$"核心属性:{CharacterSet.GetPrimaryAttributeName(oldPA)} => {CharacterSet.GetPrimaryAttributeName(character.PrimaryAttribute)}\r\n" +
$"初始生命:{oldHP} => {character.InitialHP}\r\n" +
$"初始魔法:{oldMP} => {character.InitialMP}\r\n" +
$"初始攻击:{oldATK} => {character.InitialATK}\r\n" +
$"初始力量:{oldSTR}+{oldSTRG}/Lv=> {character.InitialSTR}+{character.STRGrowth}/Lv\r\n" +
$"初始敏捷:{oldAGI}+{oldAGIG}/Lv=> {character.InitialAGI}+{character.AGIGrowth}/Lv\r\n" +
$"初始智力:{oldINT}+{oldINTG}/Lv=> {character.InitialINT}+{character.INTGrowth}/Lv");
$"初始智力:{oldINT}+{oldINTG}/Lv=> {character.InitialINT}+{character.INTGrowth}/Lv\r\n" +
$"初始速度:{oldSPD} => {character.InitialSPD}\r\n" +
$"生命回复:{oldHR} => {character.InitialHR}\r\n" +
$"魔法回复:{oldMR} => {character.InitialMR}\r\n");
}
else
{
@ -699,6 +719,10 @@ namespace Oshima.FunGame.WebAPI.Controllers
return NetworkUtility.JsonSerialize($"你的{General.GameplayEquilibriumConstant.InGameMaterial}不足 {reduce} 呢,无法重随自建角色属性!");
}
newCustom = new CustomCharacter(FunGameConstant.CustomCharacterId, "");
if (newCustom is CustomCharacter temp)
{
temp.SetPrimaryAttribute();
}
user.LastTime = DateTime.Now;
pc.Add("user", user);
pc.SaveConfig();
@ -706,18 +730,30 @@ namespace Oshima.FunGame.WebAPI.Controllers
emc.SaveConfig();
return NetworkUtility.JsonSerialize($"消耗 {reduce} {General.GameplayEquilibriumConstant.InGameMaterial},获取到重随属性预览如下:\r\n" +
$"核心属性:{CharacterSet.GetPrimaryAttributeName(oldPA)} => {CharacterSet.GetPrimaryAttributeName(newCustom.PrimaryAttribute)}\r\n" +
$"初始生命:{oldHP} => {newCustom.InitialHP}\r\n" +
$"初始魔法:{oldMP} => {newCustom.InitialMP}\r\n" +
$"初始攻击:{oldATK} => {newCustom.InitialATK}\r\n" +
$"初始力量:{oldSTR}+{oldSTRG}/Lv=> {newCustom.InitialSTR}+{newCustom.STRGrowth}/Lv\r\n" +
$"初始敏捷:{oldAGI}+{oldAGIG}/Lv=> {newCustom.InitialAGI}+{newCustom.AGIGrowth}/Lv\r\n" +
$"初始智力:{oldINT}+{oldINTG}/Lv=> {newCustom.InitialINT}+{newCustom.INTGrowth}/Lv\r\n" +
$"初始速度:{oldSPD} => {newCustom.InitialSPD}\r\n" +
$"生命回复:{oldHR} => {newCustom.InitialHR}\r\n" +
$"魔法回复:{oldMR} => {newCustom.InitialMR}\r\n" +
$"请发送【确认角色重随】来确认更新,或者发送【取消角色重随】来取消操作。");
}
else if (newCustom.Id == FunGameConstant.CustomCharacterId)
{
return NetworkUtility.JsonSerialize($"你已经有一个待确认的重随属性如下:\r\n" +
$"核心属性:{CharacterSet.GetPrimaryAttributeName(oldPA)} => {CharacterSet.GetPrimaryAttributeName(newCustom.PrimaryAttribute)}\r\n" +
$"初始生命:{oldHP} => {newCustom.InitialHP}\r\n" +
$"初始魔法:{oldMP} => {newCustom.InitialMP}\r\n" +
$"初始攻击:{oldATK} => {newCustom.InitialATK}\r\n" +
$"初始力量:{oldSTR}+{oldSTRG}/Lv=> {newCustom.InitialSTR}+{newCustom.STRGrowth}/Lv\r\n" +
$"初始敏捷:{oldAGI}+{oldAGIG}/Lv=> {newCustom.InitialAGI}+{newCustom.AGIGrowth}/Lv\r\n" +
$"初始智力:{oldINT}+{oldINTG}/Lv=> {newCustom.InitialINT}+{newCustom.INTGrowth}/Lv\r\n" +
$"初始速度:{oldSPD} => {newCustom.InitialSPD}\r\n" +
$"生命回复:{oldHR} => {newCustom.InitialHR}\r\n" +
$"魔法回复:{oldMR} => {newCustom.InitialMR}\r\n" +
$"请发送【确认角色重随】来确认更新,或者发送【取消角色重随】来取消操作。");
}
else
@ -806,19 +842,19 @@ namespace Oshima.FunGame.WebAPI.Controllers
List<Character> characters = [.. user.Inventory.Characters];
List<Item> items = [.. user.Inventory.Items];
int total = characters.Count + items.Count;
int maxPage = (int)Math.Ceiling((double)total / 10);
int maxPage = (int)Math.Ceiling((double)total / FunGameConstant.ItemsPerPage2);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
List<object> inventory = [.. characters, .. items];
Dictionary<int, object> dict = inventory.Select((obj, index) => new { Index = index + 1, Value = obj }).ToDictionary(k => k.Index, v => v.Value);
List<int> seq = [.. FunGameService.GetPage(dict.Keys, showPage, 10)];
List<int> seq = [.. FunGameService.GetPage(dict.Keys, showPage, FunGameConstant.ItemsPerPage2)];
bool showCharacter = true;
bool showItem = true;
int characterCount = 0;
int itemCount = 0;
int prevSequence = dict.Take((showPage - 1) * 10).Count();
int prevSequence = dict.Take((showPage - 1) * FunGameConstant.ItemsPerPage2).Count();
foreach (int index in seq)
{
@ -917,11 +953,11 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
}
int maxPage = (int)Math.Ceiling((double)itemCategory.Count / 10);
int maxPage = (int)Math.Ceiling((double)itemCategory.Count / FunGameConstant.ItemsPerPage1);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
List<string> keys = [.. FunGameService.GetPage(itemCategory.Keys, showPage, 10)];
List<string> keys = [.. FunGameService.GetPage(itemCategory.Keys, showPage, FunGameConstant.ItemsPerPage1)];
int itemCount = 0;
list.Add("======= 物品 =======");
foreach (string key in keys)
@ -936,10 +972,31 @@ namespace Oshima.FunGame.WebAPI.Controllers
{
itemsIndex = string.Join("", objs.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
IEnumerable<Item> itemsEquipable = objs.Where(i => i.IsEquipment && i.Character is null);
string itemsEquipableIndex = string.Join("", itemsEquipable.Select(i => items.IndexOf(i) + 1));
if (itemsEquipable.Count() > 10)
{
itemsEquipableIndex = string.Join("", itemsEquipable.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
IEnumerable<Item> itemsSellable = objs.Where(i => i.IsSellable);
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<Item> itemsTradable = objs.Where(i => i.IsTradable);
string itemsTradableIndex = string.Join("", itemsTradable.Select(i => items.IndexOf(i) + 1));
if (itemsTradable.Count() > 10)
{
itemsTradableIndex = string.Join("", itemsTradable.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
str += $"物品序号:{itemsIndex}\r\n";
str += $"拥有数量:{objs.Count}" + (first.IsEquipment ? $"可装备数量:{objs.Count(i => i.Character is null)}" : "") +
if (itemsEquipableIndex != "") str += $"可装备序号:{itemsEquipableIndex}\r\n";
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)}" : "") +
$"可出售数量:{objs.Count(i => i.IsSellable)},可交易数量:{objs.Count(i => i.IsTradable)}";
$"可出售数量:{itemsSellable.Count()},可交易数量:{itemsTradable.Count()}";
list.Add(str);
}
list.Add($"页数:{showPage} / {maxPage}");
@ -1002,11 +1059,11 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
}
int maxPage = (int)Math.Ceiling((double)itemCategory.Count / 10);
int maxPage = (int)Math.Ceiling((double)itemCategory.Count / FunGameConstant.ItemsPerPage1);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
List<string> keys = [.. FunGameService.GetPage(itemCategory.Keys, showPage, 10)];
List<string> keys = [.. FunGameService.GetPage(itemCategory.Keys, showPage, FunGameConstant.ItemsPerPage1)];
int itemCount = 0;
list.Add($"======= {ItemSet.GetItemTypeName((ItemType)itemtype)} =======");
foreach (string key in keys)
@ -1021,10 +1078,31 @@ namespace Oshima.FunGame.WebAPI.Controllers
{
itemsIndex = string.Join("", objs.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
IEnumerable<Item> itemsEquipable = objs.Where(i => i.IsEquipment && i.Character is null);
string itemsEquipableIndex = string.Join("", itemsEquipable.Select(i => items.IndexOf(i) + 1));
if (itemsEquipable.Count() > 10)
{
itemsEquipableIndex = string.Join("", itemsEquipable.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
IEnumerable<Item> itemsSellable = objs.Where(i => i.IsSellable);
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<Item> itemsTradable = objs.Where(i => i.IsTradable);
string itemsTradableIndex = string.Join("", itemsTradable.Select(i => items.IndexOf(i) + 1));
if (itemsTradable.Count() > 10)
{
itemsTradableIndex = string.Join("", itemsTradable.Take(10).Select(i => items.IndexOf(i) + 1)) + "...";
}
str += $"物品序号:{itemsIndex}\r\n";
str += $"拥有数量:{objs.Count}" + (first.IsEquipment ? $"可装备数量:{objs.Count(i => i.Character is null)}" : "") +
if (itemsEquipableIndex != "") str += $"可装备序号:{itemsEquipableIndex}\r\n";
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)}" : "") +
$"可出售数量:{objs.Count(i => i.IsSellable)},可交易数量:{objs.Count(i => i.IsTradable)}";
$"可出售数量:{itemsSellable.Count()},可交易数量:{itemsTradable.Count()}";
list.Add(str);
}
list.Add($"页数:{showPage} / {maxPage}");
@ -1060,17 +1138,17 @@ namespace Oshima.FunGame.WebAPI.Controllers
list.Add($"{General.GameplayEquilibriumConstant.InGameMaterial}{user.Inventory.Materials:0.00}");
List<Character> characters = [.. user.Inventory.Characters];
int total = characters.Count;
int maxPage = (int)Math.Ceiling((double)total / 6);
int maxPage = (int)Math.Ceiling((double)total / 15);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
List<object> inventory = [.. characters];
Dictionary<int, object> dict = inventory.Select((obj, index) => new { Index = index + 1, Value = obj }).ToDictionary(k => k.Index, v => v.Value);
List<int> seq = [.. FunGameService.GetPage(dict.Keys, showPage, 6)];
List<int> seq = [.. FunGameService.GetPage(dict.Keys, showPage, 15)];
bool showCharacter = true;
int characterCount = 0;
int prevSequence = dict.Take((showPage - 1) * 6).Count();
int prevSequence = dict.Take((showPage - 1) * 15).Count();
foreach (int index in seq)
{
@ -1525,6 +1603,117 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
}
[HttpPost("showiteminfoname")]
public string GetItemInfoFromInventory_Name([FromQuery] long? uid = null, [FromQuery] string? name = null, [FromQuery] int? page = null)
{
try
{
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
string itemName = name ?? "";
int showPage = page ?? 1;
if (showPage <= 0) showPage = 1;
PluginConfig pc = new("saved", userid.ToString());
pc.LoadConfig();
if (pc.Count > 0)
{
User user = FunGameService.GetUser(pc);
var objs = user.Inventory.Items.Select((item, index) => new { item, index })
.Where(obj => obj.item.Name == itemName);
Dictionary<int, Item> items = [];
if (objs.Any())
{
items = objs.ToDictionary(d => d.index + 1, d => d.item);
}
else
{
return NetworkUtility.JsonSerialize($"你库存中没有任何名为【{itemName}】的物品!");
}
int total = items.Count;
int maxPage = (int)Math.Ceiling((double)total / 100);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
IEnumerable<int> showItems = FunGameService.GetPage(items.Keys, showPage, 100);
if (showItems.Any())
{
int itemIndex = showItems.First();
Item item = items[itemIndex];
string str = $"☆--- [ {item.Name} ] ---☆\r\n";
str += ItemSet.GetQualityTypeName(item.QualityType) + " " +
(item.WeaponType == WeaponType.None ? ItemSet.GetItemTypeName(item.ItemType) : ItemSet.GetItemTypeName(item.ItemType) + "-" + ItemSet.GetWeaponTypeName(item.WeaponType));
str += $"\r\n物品描述{item.Description}\r\n";
string itemsIndex = string.Join("", items.Keys);
var itemsEquipabled = items.Where(kv => kv.Value.Character != null);
var itemsEquipable = items.Where(kv => kv.Value.Character is null);
string itemsEquipabledIndex = "";
string itemsEquipableIndex = "";
if (item.IsEquipment)
{
itemsEquipabledIndex = string.Join("", itemsEquipabled.Select(kv => kv.Key));
itemsEquipableIndex = string.Join("", itemsEquipable.Select(kv => kv.Key));
}
var itemsCanUsed = items.Where(kv => kv.Value.RemainUseTimes > 0);
string itemsCanUsedIndex = "";
if (FunGameConstant.ItemCanUsed.Contains(item.ItemType))
{
itemsCanUsedIndex = string.Join("", itemsCanUsed.Select(kv => kv.Key));
}
var itemsSellable = items.Where(kv => kv.Value.IsSellable);
string itemsSellableIndex = string.Join("", itemsSellable.Select(kv => kv.Key));
var itemsTradable = items.Where(kv => kv.Value.IsTradable);
string itemsTradableIndex = string.Join("", itemsTradable.Select(kv => kv.Key));
str += $"物品序号:{itemsIndex}\r\n";
if (itemsEquipabledIndex != "") str += $"已装备序号:{itemsEquipabledIndex}\r\n";
if (itemsEquipableIndex != "") str += $"可装备序号:{itemsEquipableIndex}\r\n";
if (itemsCanUsedIndex != "") str += $"可使用序号:{itemsCanUsedIndex}\r\n";
if (itemsSellableIndex != "") str += $"可出售序号:{itemsSellableIndex}\r\n";
if (itemsTradableIndex != "") str += $"可交易序号:{itemsTradableIndex}\r\n";
str += $"拥有数量:{items.Count}";
if (item.IsEquipment)
{
str += $"已装备数量:{itemsEquipabled.Count()},可装备数量:{itemsEquipable.Count()}";
}
if (FunGameConstant.ItemCanUsed.Contains(item.ItemType))
{
str += $"可使用数量:{itemsCanUsed.Count()}";
}
str += $"可出售数量:{itemsSellable.Count()},可交易数量:{itemsTradable.Count()}\r\n";
str += $"页数:{showPage} / {maxPage}";
return NetworkUtility.JsonSerialize(str.Trim());
}
else
{
return NetworkUtility.JsonSerialize($"你库存中没有任何名为【{itemName}】的物品!");
}
}
else
{
return NetworkUtility.JsonSerialize($"没有这么多页!当前总页数为 {maxPage},但你请求的是第 {showPage} 页。");
}
}
else
{
return NetworkUtility.JsonSerialize(noSaved);
}
}
catch (Exception e)
{
return NetworkUtility.JsonSerialize(e.ToString());
}
}
[HttpPost("equipitem")]
public string EquipItem([FromQuery] long? uid = null, [FromQuery] int? c = null, [FromQuery] int? i = null)
{
@ -1780,7 +1969,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
character.Recovery(EP: 200);
}
Team team1 = new($"{user1.Username}的小队", squad1);
Team team2 = new($"{user2.Username}的小队", squad2);
Team team2 = new($"{user2.Username}的小队" + (userid == enemyid ? "2" : ""), squad2);
return FunGameActionQueue.NewAndStartTeamGame([team1, team2], 0, 0, false, false, false, false, showAllRound);
}
else
@ -2963,7 +3152,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
else if (key == "角色突破进度")
{
if (character.LevelBreak < needCount)
if (character.LevelBreak + 1 < needCount)
{
return NetworkUtility.JsonSerialize($"角色 [ {character} ] 等级突破进度不足 {needCount} 等阶,无法{isStudy}此技能!");
}
@ -3135,7 +3324,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
else if (key == "角色突破进度")
{
if (character.LevelBreak < needCount)
if (character.LevelBreak + 1 < needCount)
{
return NetworkUtility.JsonSerialize($"角色 [ {character} ] 等级突破进度不足 {needCount} 等阶,无法升级此技能!");
}
@ -3640,7 +3829,7 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
[HttpPost("acceptquest")]
public string AcceptQuest([FromQuery] long? uid = null, [FromQuery] int? id = null)
public List<string> AcceptQuest([FromQuery] long? uid = null, [FromQuery] int? id = null)
{
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
int questid = id ?? 0;
@ -3648,52 +3837,68 @@ namespace Oshima.FunGame.WebAPI.Controllers
PluginConfig pc = new("saved", userid.ToString());
pc.LoadConfig();
List<string> msgs = [];
if (pc.Count > 0)
{
User user = FunGameService.GetUser(pc);
string msg = "";
EntityModuleConfig<Quest> quests = new("quests", userid.ToString());
quests.LoadConfig();
if (quests.Count > 0)
if (quests.Count > 0 && quests.Values.FirstOrDefault(q => q.Id == questid) is Quest quest)
{
if (quests.Values.FirstOrDefault(q => q.Status == QuestState.InProgress) is Quest quest)
if (quest.Status == QuestState.InProgress)
{
msg = $"你正在进行任务【{quest.Name}】,无法开始新任务!\r\n{quest}";
msgs.Add($"你正在进行任务【{quest.Name}】,无法开始新任务!\r\n{quest}");
}
else if (quests.Values.FirstOrDefault(q => q.Id == questid) is Quest quest2)
else if (quest.Status == QuestState.Completed)
{
if (quest2.Status != 0)
msgs.Add($"任务【{quest.Name}】已经完成了!\r\n{quest}");
}
else if (quest.Status == QuestState.Settled)
{
msg = $"这个任务正在进行中,或已经完成,不能重复做任务!";
msgs.Add($"任务【{quest.Name}】已经结算并发放奖励了哦!\r\n{quest}");
}
else
{
quest2.StartTime = DateTime.Now;
quest2.Status = QuestState.InProgress;
quest.StartTime = DateTime.Now;
quest.Status = QuestState.InProgress;
if (quest.QuestType == QuestType.Continuous)
{
// 持续性任务会在持续时间结束后自动完成并结算
msgs.Add($"开始任务【{quest.Name}】成功!任务信息如下:\r\n{quest}\r\n预计完成时间{DateTime.Now.AddMinutes(quest.EstimatedMinutes).ToString(General.GeneralDateTimeFormatChinese)}");
}
else if (quest.QuestType == QuestType.Immediate)
{
msgs.Add($"开始任务【{quest.Name}】成功!任务信息如下:\r\n{quest}");
// TODO实现任务逻辑
quest.Status = QuestState.Completed;
msgs.Add("在任务过程中,你碰巧遇到了米莉,任务直接完成了!");
}
else
{
msgs.Add($"开始任务【{quest.Name}】成功!任务信息如下:\r\n{quest}");
// TODO进度条任务需要完成任务的指标实现任务逻辑
quest.Progress = quest.MaxProgress;
quest.Status = QuestState.Completed;
msgs.Add("在任务过程中,你碰巧遇到了米莉,任务直接完成了!");
}
quests.SaveConfig();
msg = $"开始任务【{quest2.Name}】成功!任务信息如下:\r\n{quest2}\r\n预计完成时间{DateTime.Now.AddMinutes(quest2.EstimatedMinutes).ToString(General.GeneralDateTimeFormatChinese)}";
}
}
else
{
msg = $"没有找到序号为 {questid} 的任务!";
}
}
else
{
msg = "任务列表为空,请等待刷新!";
msgs.Add($"没有找到序号为 {questid} 的任务!请使用【任务列表】指令来检查你的任务列表!");
}
user.LastTime = DateTime.Now;
pc.Add("user", user);
pc.SaveConfig();
return NetworkUtility.JsonSerialize(msg);
return msgs;
}
else
{
return NetworkUtility.JsonSerialize(noSaved);
return [noSaved];
}
}
@ -4048,11 +4253,16 @@ namespace Oshima.FunGame.WebAPI.Controllers
builer.AppendLine($"管理员数量:{club.Admins.Count}");
builer.AppendLine($"申请人数量:{club.Applicants.Count}");
builer.AppendLine($"社团基金:{club.ClubPoins}");
if (club.Master?.Id == userid)
{
builer.AppendLine("你是此社团的社长");
}
if (club.Admins.ContainsKey(userid))
{
builer.AppendLine("你是此社团的管理员");
}
}
builer.AppendLine($"社团描述:{club.Description}");
msg = builer.ToString().Trim();
}
else
@ -4069,10 +4279,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
[HttpPost("showclubmemberlist")]
public string ShowClubMemberList([FromQuery] long? uid = null, [FromQuery] int? type = null)
public string ShowClubMemberList([FromQuery] long? uid = null, [FromQuery] int? type = null, [FromQuery] int? page = null)
{
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
int showType = type ?? 0;
int showPage = page ?? 1;
if (showPage <= 0) showPage = 1;
PluginConfig pc = new("saved", userid.ToString());
pc.LoadConfig();
@ -4099,11 +4311,18 @@ namespace Oshima.FunGame.WebAPI.Controllers
case 1:
builer.AppendLine($"☆--- 社团 [ {club.Name} ] 管理员列表 ---☆");
count = 1;
List<long> admins = [.. club.Admins.Keys];
List<long> admins = [];
if (club.Master != null && club.Master.Id != 0)
{
admins.Add(club.Master.Id);
}
admins.AddRange(club.Admins.Keys);
int maxPage = (int)Math.Ceiling((double)admins.Count / FunGameConstant.ItemsPerPage2);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
admins = [.. FunGameService.GetPage(admins, showPage, FunGameConstant.ItemsPerPage2)];
foreach (long uid2 in admins)
{
if (FunGameConstant.UserIdAndUsername.TryGetValue(uid2, out User? user2) && user2 != null)
@ -4115,13 +4334,24 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
count++;
}
builer.AppendLine($"页数:{showPage} / {maxPage}");
}
else
{
NetworkUtility.JsonSerialize($"没有这么多页!当前总页数为 {maxPage},但你请求的是第 {showPage} 页。");
}
break;
case 2:
if (club.Master?.Id == user.Id || club.Admins.ContainsKey(user.Id))
{
builer.AppendLine($"☆--- 社团 [ {club.Name} ] 申请人列表 ---☆");
count = 1;
foreach (long uid2 in club.Applicants.Keys)
maxPage = (int)Math.Ceiling((double)club.Applicants.Count / FunGameConstant.ItemsPerPage2);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
IEnumerable<long> applicants = FunGameService.GetPage(club.Applicants.Keys, showPage, FunGameConstant.ItemsPerPage2);
foreach (long uid2 in applicants)
{
if (FunGameConstant.UserIdAndUsername.TryGetValue(uid2, out User? user2) && user2 != null)
{
@ -4132,6 +4362,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
count++;
}
builer.AppendLine($"页数:{showPage} / {maxPage}");
}
else
{
NetworkUtility.JsonSerialize($"没有这么多页!当前总页数为 {maxPage},但你请求的是第 {showPage} 页。");
}
}
else
{
@ -4142,7 +4378,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
default:
builer.AppendLine($"☆--- 社团 [ {club.Name} ] 成员列表 ---☆");
count = 1;
foreach (long uid2 in club.Members.Keys)
maxPage = (int)Math.Ceiling((double)club.Members.Count / FunGameConstant.ItemsPerPage2);
if (maxPage < 1) maxPage = 1;
if (showPage <= maxPage)
{
IEnumerable<long> members = FunGameService.GetPage(club.Members.Keys, showPage, FunGameConstant.ItemsPerPage2);
foreach (long uid2 in members)
{
if (FunGameConstant.UserIdAndUsername.TryGetValue(uid2, out User? user2) && user2 != null)
{
@ -4163,6 +4404,12 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
count++;
}
builer.AppendLine($"页数:{showPage} / {maxPage}");
}
else
{
NetworkUtility.JsonSerialize($"没有这么多页!当前总页数为 {maxPage},但你请求的是第 {showPage} 页。");
}
break;
}
@ -4772,6 +5019,95 @@ namespace Oshima.FunGame.WebAPI.Controllers
}
}
[HttpPost("creategiftbox")]
public string CreateGiftBox([FromQuery] long? uid = null, [FromQuery] string? name = null)
{
long userid = uid ?? Convert.ToInt64("10" + Verification.CreateVerifyCode(VerifyCodeType.NumberVerifyCode, 11));
string itemName = name ?? "";
PluginConfig pc = new("saved", userid.ToString());
pc.LoadConfig();
if (pc.Count > 0)
{
User user = FunGameService.GetUser(pc);
if (FunGameConstant.AllItems.FirstOrDefault(i => i.Name == itemName) is Item item)
{
PluginConfig pc2 = new("giftbox", "giftbox");
pc2.LoadConfig();
List<long> list = [];
if (pc2.TryGetValue(itemName, out object? value) && value is List<long> tempList)
{
list = new(tempList);
}
if (list.Contains(user.Id))
{
return NetworkUtility.JsonSerialize($"你已经领取过这个礼包【{itemName}】啦,不能重复领取哦!");
}
Item newItem = item.Copy();
newItem.IsSellable = false;
newItem.IsTradable = false;
newItem.User = user;
user.Inventory.Items.Add(newItem);
string msg = $"恭喜你获得礼包【{itemName}】一份!";
list.Add(user.Id);
pc2.Add(itemName, list);
pc2.SaveConfig();
user.LastTime = DateTime.Now;
pc.Add("user", user);
pc.SaveConfig();
return NetworkUtility.JsonSerialize(msg);
}
else
{
return NetworkUtility.JsonSerialize("没有找到这个礼包,可能已经过期。");
}
}
else
{
return NetworkUtility.JsonSerialize(noSaved);
}
}
[HttpGet("getregion")]
public List<string> GetRegion([FromQuery] int? index = null)
{
List<string> regions = [];
if (index != null)
{
if (FunGameConstant.Regions.FirstOrDefault(kv => kv.Id == index) is Region region)
{
regions.Add(region.ToString());
}
else
{
regions.Add($"找不到指定编号的地区!");
}
}
else if (FunGameConstant.Regions.Count > 0)
{
regions.Add($"世界地图:");
for (int i = 0; i < FunGameConstant.Regions.Count; i++)
{
Region region = FunGameConstant.Regions[i];
regions.Add($"{region.Id}. {region.Name}");
}
regions.Add($"提示:使用【查地区+序号】指令来查看指定地区的信息。");
}
else
{
regions.Add($"世界地图遇到了问题,暂时无法显示……");
}
return regions;
}
[HttpGet("reload")]
public string Relaod([FromQuery] long? master = null)
{

View File

@ -27,12 +27,13 @@ namespace Oshima.FunGame.WebAPI.Services
Statics.RunningPlugin?.Controller.WriteLine(title, Milimoe.FunGame.Core.Library.Constant.LogLevel.Debug);
if (msg is ThirdPartyMessage third)
{
third.Result = content;
third.Result = "\r\n" + content.Trim();
third.IsCompleted = true;
return;
}
if (msg.IsGroup)
{
content = "\r\n" + content.Trim();
await Service.SendGroupMessageAsync(msg.OpenId, content, msgType, media, msg.Id, msgSeq);
}
else
@ -189,7 +190,7 @@ namespace Oshima.FunGame.WebAPI.Services
{
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 5 / 7 页)
43
44 <>
44/ <>
45
46
47
@ -924,15 +925,17 @@ namespace Oshima.FunGame.WebAPI.Services
return result;
}
if (e.Detail.StartsWith("开始任务", StringComparison.CurrentCultureIgnoreCase))
if (e.Detail.StartsWith("开始任务", StringComparison.CurrentCultureIgnoreCase) || e.Detail.StartsWith("做任务", StringComparison.CurrentCultureIgnoreCase))
{
string detail = e.Detail.Replace("开始任务", "").Trim();
string detail = e.Detail.Replace("开始任务", "").Replace("做任务", "").Trim();
if (int.TryParse(detail, out int index))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.AcceptQuest(uid, index)) ?? "";
if (msg != "")
List<string> msgs = Controller.AcceptQuest(uid, index);
int count = 1;
foreach (string msg in msgs)
{
await SendAsync(e, "开始任务", msg);
await SendAsync(e, "开始任务", msg, msgSeq: count++);
await Task.Delay(2000);
}
}
return result;
@ -941,14 +944,21 @@ namespace Oshima.FunGame.WebAPI.Services
if (e.Detail.StartsWith("我的物品", StringComparison.CurrentCultureIgnoreCase))
{
string detail = e.Detail.Replace("我的物品", "").Trim();
string msg;
if (int.TryParse(detail, out int index))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfoFromInventory(uid, index)) ?? "";
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfoFromInventory(uid, index)) ?? "";
if (msg != "")
{
await SendAsync(e, "查库存物品", msg);
return result;
}
}
msg = NetworkUtility.JsonDeserialize<string>(Controller.GetItemInfoFromInventory_Name(uid, detail)) ?? "";
if (msg != "")
{
await SendAsync(e, "查库存物品", msg);
}
return result;
}
@ -1757,33 +1767,69 @@ namespace Oshima.FunGame.WebAPI.Services
return result;
}
if (e.Detail == "查看社团成员")
if (e.Detail.StartsWith("查看社团成员"))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 0)) ?? "";
string detail = e.Detail.Replace("查看社团成员", "").Trim();
if (int.TryParse(detail, out int page) && page > 0)
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 0, page)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
else
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 0, 1)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
return result;
}
if (e.Detail == "查看社团管理")
if (e.Detail.StartsWith("查看社团管理"))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 1)) ?? "";
string detail = e.Detail.Replace("查看社团管理", "").Trim();
if (int.TryParse(detail, out int page) && page > 0)
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 1, page)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
else
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 1, 1)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
return result;
}
if (e.Detail == "查看申请人列表")
if (e.Detail.StartsWith("查看申请人列表"))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 2)) ?? "";
string detail = e.Detail.Replace("查看申请人列表", "").Trim();
if (int.TryParse(detail, out int page) && page > 0)
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 2, page)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
else
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.ShowClubMemberList(uid, 2, 1)) ?? "";
if (msg != "")
{
await SendAsync(e, "社团", "\r\n" + msg);
}
}
return result;
}
@ -1917,6 +1963,25 @@ namespace Oshima.FunGame.WebAPI.Services
return result;
}
if (e.Detail.StartsWith("查地区", StringComparison.CurrentCultureIgnoreCase) || e.Detail.StartsWith("查询地区", StringComparison.CurrentCultureIgnoreCase))
{
string detail = e.Detail.Replace("查地区", "").Replace("查询地区", "").Trim();
List<string> msgs = [];
if (int.TryParse(detail, out int cid))
{
msgs = Controller.GetRegion(cid);
}
else
{
msgs = Controller.GetRegion();
}
if (msgs.Count > 0)
{
await SendAsync(e, "查地区", string.Join("\r\n", msgs));
}
return result;
}
if (uid == GeneralSettings.Master && e.Detail.StartsWith("重载FunGame", StringComparison.CurrentCultureIgnoreCase))
{
string msg = NetworkUtility.JsonDeserialize<string>(Controller.Relaod(uid)) ?? "";