Skip to content

Commit

Permalink
[PrismBotTShockAdapter]新增进度查询api
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianyiovo committed Jul 12, 2023
1 parent 8e897ae commit 12f6539
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions PrismBotTShockAdapter/PrismBotTShockAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public override void Initialize()

TShockAPI.GetDataHandlers.KillMe.Register(OnPlayerDeath);
TShock.RestApi.Register("/prismbot/death_ranking", OnRestDeathRanking);

TShock.RestApi.Register("/prismbot/progress", Progress);
}

private async void OnJoin(JoinEventArgs args)
Expand Down Expand Up @@ -174,4 +176,38 @@ private object OnRestDeathRanking(RestRequestArgs args)
}

#endregion
private object Progress(RestRequestArgs args)//获取进度详情
{
Dictionary<string, bool> progress = new Dictionary<string, bool>()
{
{"King Slime", NPC.downedSlimeKing}, //史莱姆王
{"Eye of Cthulhu", NPC.downedBoss1}, //克苏鲁之眼
{"Eater of Worlds / Brain of Cthulhu", NPC.downedBoss2}, //世界吞噬者 或 克苏鲁之脑
{"Queen Bee", NPC.downedQueenBee}, //蜂后
{"Skeletron", NPC.downedBoss3}, //骷髅王
{"Deerclops", NPC.downedDeerclops}, //巨鹿
{"Wall of Flesh", Main.hardMode}, //肉山
{"Queen Slime", NPC.downedQueenSlime}, //史莱姆皇后
{"The Twins", NPC.downedMechBoss2}, //双子魔眼
{"The Destroyer", NPC.downedMechBoss1}, //毁灭者
{"Skeletron Prime", NPC.downedMechBoss3}, //机械骷髅王
{"Plantera", NPC.downedPlantBoss}, //世纪之花
{"Golem", NPC.downedGolemBoss}, //石巨人
{"Duke Fishron", NPC.downedFishron}, // 朱鲨
{"Empress of Light", NPC.downedEmpressOfLight}, //光女
{"Lunatic Cultist", NPC.downedAncientCultist}, //教徒
{"Moon Lord", NPC.downedMoonlord}, //月总
{"Solar Pillar", NPC.downedTowerSolar}, //太阳能柱
{"Nebula Pillar", NPC.downedTowerNebula}, //星云柱
{"Vortex Pillar", NPC.downedTowerVortex}, //涡柱
{"Stardust Pillar", NPC.downedTowerStardust}, //星尘柱
};
return new RestObject()
{
{
"response",
progress
}
};
}
}

0 comments on commit 12f6539

Please sign in to comment.