diff --git a/resource/infrast.json b/resource/infrast.json new file mode 100644 index 0000000000..789d9150d0 --- /dev/null +++ b/resource/infrast.json @@ -0,0 +1,189 @@ +{ + "facility": [ "Mfg" ], + "Mfg": { + "Mfg_Doc": "制造站", + "skills_Doc": "技能ID默认就是模板名(不带.png),name和intro实际都不产生作用,给人看的", + "skills": [ + { + "name": [ "咪波·制造型" ], + "intro": "进驻制造站时,生产力+30%", + "template": "Bskill_man_spd3.png" + }, + { + "name": [ "标准化·β", "莱茵科技·β", "红松骑士团·β" ], + "intro": "进驻制造站时,生产力+25%", + "template": "Bskill_man_spd2.png" + }, + { + "name": [ "标准化·α", "莱茵科技·α", "红松骑士团·α", "磐蟹·豆豆" ], + "intro": "进驻制造站时,生产力+15%", + "template": "Bskill_man_spd1.png" + }, + { + "name": [ "大就是好!" ], + "intro": "进驻制造站时,当前制造站内干员根据自身提升的仓库容量提供一定的生产力。提升16格以下的,每格仓库容量提供1%生产力;提升大于16格的,每格仓库容量提供3%生产力(无法与回收利用叠加,且优先生效)", + "template": "Bskill_man_spd_variable31.png" + }, + { + "name": [ "配合意识" ], + "intro": "进驻制造站时,当前制造站内其他干员提供的每5%生产力(不包含根据设施数量提供加成的生产力),额外提供5%生产力,最多提供40%生产力", + "template": "Bskill_man_spd_variable21.png" + }, + { + "name": [ "回收利用" ], + "intro": "进驻制造站时,当前制造站内干员提升的每格仓库容量,提供2%生产力", + "template": "Bskill_man_spd_variable11.png" + }, + { + "name": [ "意识实体" ], + "intro": "进驻制造站时,每1点思维链环+1%生产力", + "template": "Bskill_man_spd_bd2.png" + }, + { + "name": [ "念力" ], + "intro": "进驻制造站时,每2点思维链环+1%生产力", + "template": "Bskill_man_spd_bd1.png" + }, + { + "name": [ "超感" ], + "intro": "进驻制造站时,宿舍内每有1名干员则感知信息+1,同时每1点感知信息转化为1点思维链环", + "template": "Bskill_man_spd_bd_n1.png" + }, + { + "name": [ "慢性子", "延时摄影" ], + "intro": "进驻制造站后,生产力首小时+15%,此后每小时+2%,最终达到+25%", + "template": "Bskill_man_spd_add2.png" + }, + { + "name": [ "急性子", "“等不及”" ], + "intro": "进驻制造站后,生产力首小时+20%,此后每小时+1%,最终达到+25%", + "template": "Bskill_man_spd_add1.png" + }, + { + "name": [ "再生能源" ], + "intro": "进驻制造站时,每个贸易站为当前制造站贵金属类配方的生产力+20%", + "template": "Bskill_man_spd&trade.png" + }, + { + "name": [ "仿生海龙" ], + "intro": "进驻制造站时,当前制造站内其他干员提供的生产力全部归零(不包含根据设施数量提供加成的生产力),每个发电站为当前制造站+15%的生产力", + "template": "Bskill_man_spd&power3.png" + }, + { + "name": [ "自动化·β" ], + "intro": "进驻制造站时,当前制造站内其他干员提供的生产力全部归零(不包含根据设施数量提供加成的生产力),每个发电站为当前制造站+10%的生产力", + "template": "Bskill_man_spd&power2.png" + }, + { + "name": [ "自动化·α" ], + "intro": "进驻制造站时,当前制造站内其他干员提供的生产力全部归零(不包含根据设施数量提供加成的生产力),每个发电站为当前制造站+5%的生产力", + "template": "Bskill_man_spd&power1.png" + }, + { + "name": [ "仓库整备·β" ], + "intro": "进驻制造站时,仓库容量上限+10,生产力+10%", + "template": "Bskill_man_spd&limit3.png" + }, + { + "name": [ "仓库整备·α" ], + "intro": "进驻制造站时,仓库容量上限+6,生产力+10%", + "template": "Bskill_man_spd&limit1.png" + }, + { + "name": [ "“可靠”助手" ], + "intro": "进驻制造站时,生产力-20%,仓库容量上限+17,心情每小时消耗-0.25", + "template": "Bskill_man_spd&limit&cost4.png" + }, + { + "name": [ "特立独行", "麻烦制造者" ], + "intro": "", + "template": "Bskill_man_spd&limit&cost3.png" + }, + { + "name": [ "工匠精神·β" ], + "intro": "进驻制造站时,生产力-5%,仓库容量上限+19,心情每小时消耗-0.25", + "template": "Bskill_man_spd&limit&cost2.png" + }, + { + "name": [ "工匠精神·α" ], + "intro": "进驻制造站时,生产力-5%,仓库容量上限+16,心情每小时消耗-0.15", + "template": "Bskill_man_spd&limit&cost1.png" + }, + { + "name": [ "意识协议" ], + "intro": "进驻制造站时,当前制造站内每个标准化类技能为自身+5%的生产力", + "template": "Bskill_man_skill_spd.png" + }, + { + "name": [ "源石工艺·β", "地质学·β", "火山学家", "源石研究" ], + "intro": "进驻制造站时,源石类配方的生产力+35%", + "template": "Bskill_man_originium2.png" + }, + { + "name": [ "源石工艺·α", "地质学·α" ], + "intro": "进驻制造站时,源石类配方的生产力+30%", + "template": "Bskill_man_originium1.png" + }, + { + "name": [ "探险者" ], + "intro": "进驻制造站时,仓库容量上限+16,心情每小时消耗-0.25", + "template": "Bskill_man_limit&cost3.png" + }, + { + "name": [ "囤积者" ], + "intro": "进驻制造站时,仓库容量上限+10,心情每小时消耗-0.25", + "template": "Bskill_man_limit&cost2.png" + }, + { + "name": [ "拾荒者", "智慧之境", "“都想要”", "磐蟹·阿盘" ], + "intro": "进驻制造站时,仓库容量上限+8,心情每小时消耗-0.25", + "template": "Bskill_man_limit&cost1.png" + }, + { + "name": [ "金属工艺·β" ], + "intro": "进驻制造站时,贵金属类配方的生产力+35%", + "template": "Bskill_man_gold2.png" + }, + { + "name": [ "金属工艺·α" ], + "intro": "进驻制造站时,贵金属类配方的生产力+30%", + "template": "Bskill_man_gold1.png" + }, + { + "name": [ "拳术指导录像" ], + "intro": "进驻制造站时,作战记录类配方的生产力+35%", + "template": "Bskill_man_exp3.png" + }, + { + "name": [ "作战指导录像" ], + "intro": "进驻制造站时,作战记录类配方的生产力+30%", + "template": "Bskill_man_exp2.png" + }, + { + "name": [ "胜利之计" ], + "intro": "进驻制造站时,作战记录类配方的生产力+25%", + "template": "Bskill_man_exp1.png" + }, + { + "name": [ "剪辑·β" ], + "intro": "进驻制造站时,生产作战记录类配方时,仓库容量上限+15", + "template": "Bskill_man_exp&limit2.png" + }, + { + "name": [ "剪辑·α" ], + "intro": "进驻制造站时,生产作战记录类配方时,仓库容量上限+12", + "template": "Bskill_man_exp&limit1.png" + }, + { + "name": [ "Vlog" ], + "intro": "进驻制造站时,生产作战记录类配方时,心情每小时消耗-0.25", + "template": "Bskill_man_exp&cost.png" + }, + { + "name": [ "团队精神" ], + "intro": "进驻制造站时,消除当前制造站内所有干员自身心情消耗的影响", + "template": "Bskill_man_cost_all.png" + } + ] + } +} \ No newline at end of file diff --git a/resource/template/Bskill_man_cost_all.png b/resource/template/Bskill_man_cost_all.png new file mode 100644 index 0000000000..fa9175a732 Binary files /dev/null and b/resource/template/Bskill_man_cost_all.png differ diff --git a/resource/template/Bskill_man_exp&cost.png b/resource/template/Bskill_man_exp&cost.png new file mode 100644 index 0000000000..1ebf5f79d9 Binary files /dev/null and b/resource/template/Bskill_man_exp&cost.png differ diff --git a/resource/template/Bskill_man_exp&limit1.png b/resource/template/Bskill_man_exp&limit1.png new file mode 100644 index 0000000000..b8c4c3df8e Binary files /dev/null and b/resource/template/Bskill_man_exp&limit1.png differ diff --git a/resource/template/Bskill_man_exp&limit2.png b/resource/template/Bskill_man_exp&limit2.png new file mode 100644 index 0000000000..de6d5a5991 Binary files /dev/null and b/resource/template/Bskill_man_exp&limit2.png differ diff --git a/resource/template/Bskill_man_exp1.png b/resource/template/Bskill_man_exp1.png new file mode 100644 index 0000000000..3f2f260c9a Binary files /dev/null and b/resource/template/Bskill_man_exp1.png differ diff --git a/resource/template/Bskill_man_exp2.png b/resource/template/Bskill_man_exp2.png new file mode 100644 index 0000000000..15893dfb8b Binary files /dev/null and b/resource/template/Bskill_man_exp2.png differ diff --git a/resource/template/Bskill_man_exp3.png b/resource/template/Bskill_man_exp3.png new file mode 100644 index 0000000000..505038d6de Binary files /dev/null and b/resource/template/Bskill_man_exp3.png differ diff --git a/resource/template/Bskill_man_gold1.png b/resource/template/Bskill_man_gold1.png new file mode 100644 index 0000000000..0c1fb9b0ee Binary files /dev/null and b/resource/template/Bskill_man_gold1.png differ diff --git a/resource/template/Bskill_man_gold2.png b/resource/template/Bskill_man_gold2.png new file mode 100644 index 0000000000..695cbe28b4 Binary files /dev/null and b/resource/template/Bskill_man_gold2.png differ diff --git a/resource/template/Bskill_man_limit&cost1.png b/resource/template/Bskill_man_limit&cost1.png new file mode 100644 index 0000000000..324560530a Binary files /dev/null and b/resource/template/Bskill_man_limit&cost1.png differ diff --git a/resource/template/Bskill_man_limit&cost2.png b/resource/template/Bskill_man_limit&cost2.png new file mode 100644 index 0000000000..a46ba64273 Binary files /dev/null and b/resource/template/Bskill_man_limit&cost2.png differ diff --git a/resource/template/Bskill_man_limit&cost3.png b/resource/template/Bskill_man_limit&cost3.png new file mode 100644 index 0000000000..d21535f22e Binary files /dev/null and b/resource/template/Bskill_man_limit&cost3.png differ diff --git a/resource/template/Bskill_man_originium1.png b/resource/template/Bskill_man_originium1.png new file mode 100644 index 0000000000..055da7df6f Binary files /dev/null and b/resource/template/Bskill_man_originium1.png differ diff --git a/resource/template/Bskill_man_originium2.png b/resource/template/Bskill_man_originium2.png new file mode 100644 index 0000000000..8d034fafb1 Binary files /dev/null and b/resource/template/Bskill_man_originium2.png differ diff --git a/resource/template/Bskill_man_skill_spd.png b/resource/template/Bskill_man_skill_spd.png new file mode 100644 index 0000000000..0a38a8190b Binary files /dev/null and b/resource/template/Bskill_man_skill_spd.png differ diff --git a/resource/template/Bskill_man_spd&limit&cost1.png b/resource/template/Bskill_man_spd&limit&cost1.png new file mode 100644 index 0000000000..b4f642e03f Binary files /dev/null and b/resource/template/Bskill_man_spd&limit&cost1.png differ diff --git a/resource/template/Bskill_man_spd&limit&cost2.png b/resource/template/Bskill_man_spd&limit&cost2.png new file mode 100644 index 0000000000..83a4280731 Binary files /dev/null and b/resource/template/Bskill_man_spd&limit&cost2.png differ diff --git a/resource/template/Bskill_man_spd&limit&cost3.png b/resource/template/Bskill_man_spd&limit&cost3.png new file mode 100644 index 0000000000..16c9c41a5a Binary files /dev/null and b/resource/template/Bskill_man_spd&limit&cost3.png differ diff --git a/resource/template/Bskill_man_spd&limit&cost4.png b/resource/template/Bskill_man_spd&limit&cost4.png new file mode 100644 index 0000000000..100d74295e Binary files /dev/null and b/resource/template/Bskill_man_spd&limit&cost4.png differ diff --git a/resource/template/Bskill_man_spd&limit1.png b/resource/template/Bskill_man_spd&limit1.png new file mode 100644 index 0000000000..082a7666bb Binary files /dev/null and b/resource/template/Bskill_man_spd&limit1.png differ diff --git a/resource/template/Bskill_man_spd&limit3.png b/resource/template/Bskill_man_spd&limit3.png new file mode 100644 index 0000000000..5ffd3ee609 Binary files /dev/null and b/resource/template/Bskill_man_spd&limit3.png differ diff --git a/resource/template/Bskill_man_spd&power1.png b/resource/template/Bskill_man_spd&power1.png new file mode 100644 index 0000000000..77a78ba3bd Binary files /dev/null and b/resource/template/Bskill_man_spd&power1.png differ diff --git a/resource/template/Bskill_man_spd&power2.png b/resource/template/Bskill_man_spd&power2.png new file mode 100644 index 0000000000..2017c4e115 Binary files /dev/null and b/resource/template/Bskill_man_spd&power2.png differ diff --git a/resource/template/Bskill_man_spd&power3.png b/resource/template/Bskill_man_spd&power3.png new file mode 100644 index 0000000000..04f5bf8e71 Binary files /dev/null and b/resource/template/Bskill_man_spd&power3.png differ diff --git a/resource/template/Bskill_man_spd&trade.png b/resource/template/Bskill_man_spd&trade.png new file mode 100644 index 0000000000..40d004c52e Binary files /dev/null and b/resource/template/Bskill_man_spd&trade.png differ diff --git a/resource/template/Bskill_man_spd1.png b/resource/template/Bskill_man_spd1.png new file mode 100644 index 0000000000..506ab2b1c5 Binary files /dev/null and b/resource/template/Bskill_man_spd1.png differ diff --git a/resource/template/Bskill_man_spd2.png b/resource/template/Bskill_man_spd2.png new file mode 100644 index 0000000000..81c8a0e368 Binary files /dev/null and b/resource/template/Bskill_man_spd2.png differ diff --git a/resource/template/Bskill_man_spd3.png b/resource/template/Bskill_man_spd3.png new file mode 100644 index 0000000000..6b0f20bd71 Binary files /dev/null and b/resource/template/Bskill_man_spd3.png differ diff --git a/resource/template/Bskill_man_spd_add1.png b/resource/template/Bskill_man_spd_add1.png new file mode 100644 index 0000000000..6d23739b25 Binary files /dev/null and b/resource/template/Bskill_man_spd_add1.png differ diff --git a/resource/template/Bskill_man_spd_add2.png b/resource/template/Bskill_man_spd_add2.png new file mode 100644 index 0000000000..2f2ecb6d21 Binary files /dev/null and b/resource/template/Bskill_man_spd_add2.png differ diff --git a/resource/template/Bskill_man_spd_bd1.png b/resource/template/Bskill_man_spd_bd1.png new file mode 100644 index 0000000000..5ac1e4a73a Binary files /dev/null and b/resource/template/Bskill_man_spd_bd1.png differ diff --git a/resource/template/Bskill_man_spd_bd2.png b/resource/template/Bskill_man_spd_bd2.png new file mode 100644 index 0000000000..e5d4181124 Binary files /dev/null and b/resource/template/Bskill_man_spd_bd2.png differ diff --git a/resource/template/Bskill_man_spd_bd_n1.png b/resource/template/Bskill_man_spd_bd_n1.png new file mode 100644 index 0000000000..32ae2c3434 Binary files /dev/null and b/resource/template/Bskill_man_spd_bd_n1.png differ diff --git a/resource/template/Bskill_man_spd_variable11.png b/resource/template/Bskill_man_spd_variable11.png new file mode 100644 index 0000000000..ff81e6154f Binary files /dev/null and b/resource/template/Bskill_man_spd_variable11.png differ diff --git a/resource/template/Bskill_man_spd_variable21.png b/resource/template/Bskill_man_spd_variable21.png new file mode 100644 index 0000000000..5e493a5658 Binary files /dev/null and b/resource/template/Bskill_man_spd_variable21.png differ diff --git a/resource/template/Bskill_man_spd_variable31.png b/resource/template/Bskill_man_spd_variable31.png new file mode 100644 index 0000000000..bc3df8fa96 Binary files /dev/null and b/resource/template/Bskill_man_spd_variable31.png differ diff --git a/src/MeoAssistance/InfrastConfiger.cpp b/src/MeoAssistance/InfrastConfiger.cpp new file mode 100644 index 0000000000..e6d8acfc9f --- /dev/null +++ b/src/MeoAssistance/InfrastConfiger.cpp @@ -0,0 +1,26 @@ +#include "InfrastConfiger.h" + +#include + +bool asst::InfrastConfiger::parse(const json::value& json) +{ + for (const json::value& facility : json.at("facility").as_array()) { + for (const json::value& skill_json : json.at(facility.as_string()).as_array()) { + InfrastSkill skill; + skill.templ_name = skill_json.at("template").as_string(); + m_templ_required.emplace(skill.templ_name); + + std::string id = skill_json.get("id", skill.templ_name); + skill.id = id; + if (skill_json.exist("name")) { + for (const json::value& skill_names : skill_json.at("name").as_array()) { + skill.names.emplace_back(skill_names.as_string()); + } + } + skill.intro = skill_json.get("intro", std::string()); + + m_skills.emplace(std::move(id), std::move(skill)); + } + } + return false; +} \ No newline at end of file diff --git a/src/MeoAssistance/InfrastConfiger.h b/src/MeoAssistance/InfrastConfiger.h new file mode 100644 index 0000000000..77d1836c62 --- /dev/null +++ b/src/MeoAssistance/InfrastConfiger.h @@ -0,0 +1,33 @@ +#pragma once +#include "AbstractConfiger.h" + +#include +#include + +namespace asst { + struct InfrastSkill { + std::string id; + std::string templ_name; + std::vector names; // 很多基建技能是一样的,就是名字不同。所以一个技能id可能对应多个名字 + std::string intro; + }; + + class InfrastConfiger : public AbstractConfiger + { + public: + virtual ~InfrastConfiger() = default; + + const std::unordered_set& get_templ_required() const noexcept { + return m_templ_required; + } + const std::unordered_map& get_skills() const noexcept { + return m_skills; + } + + protected: + virtual bool parse(const json::value& json) override; + + std::unordered_map m_skills; + std::unordered_set m_templ_required; + }; +} diff --git a/src/MeoAssistance/MeoAssistance.vcxproj b/src/MeoAssistance/MeoAssistance.vcxproj index 5c1cb849ce..33b9ae105b 100644 --- a/src/MeoAssistance/MeoAssistance.vcxproj +++ b/src/MeoAssistance/MeoAssistance.vcxproj @@ -24,6 +24,7 @@ + @@ -55,6 +56,7 @@ + @@ -82,7 +84,7 @@ - + diff --git a/src/MeoAssistance/MeoAssistance.vcxproj.filters b/src/MeoAssistance/MeoAssistance.vcxproj.filters index 39bc49dcc0..bfda785cde 100644 --- a/src/MeoAssistance/MeoAssistance.vcxproj.filters +++ b/src/MeoAssistance/MeoAssistance.vcxproj.filters @@ -165,6 +165,9 @@ 头文件\ImageAnalyzer\Infrast + + 头文件\Resource + @@ -257,15 +260,18 @@ 源文件\ImageAnalyzer\General + + 源文件\Resource + 资源文件 - + 资源文件 - + 资源文件 diff --git a/src/MeoAssistance/Resource.cpp b/src/MeoAssistance/Resource.cpp index 8661782c03..cb671d705d 100644 --- a/src/MeoAssistance/Resource.cpp +++ b/src/MeoAssistance/Resource.cpp @@ -15,6 +15,7 @@ bool asst::Resource::load(const std::string& dir) constexpr static const char* TaskDataFilename = "tasks.json"; constexpr static const char* RecruitCfgFilename = "recruit.json"; constexpr static const char* ItemCfgFilename = "item_index.json"; + constexpr static const char* InfrastCfgFilename = "infrast.json"; constexpr static const char* UserCfgFilename = "..\\user.json"; constexpr static const char* OcrResourceFilename = "OcrLiteOnnx"; constexpr static const char* PenguinResourceFilename = "penguin-stats-recognize"; @@ -48,7 +49,11 @@ bool asst::Resource::load(const std::string& dir) const auto& opt = m_general_cfg_unique_ins.get_options(); /* 加载模板图片资源 */ - m_templ_resource_unique_ins.set_load_required(m_task_data_unique_ins.get_templ_required()); + // task所需要的模板资源 + m_templ_resource_unique_ins.append_load_required(m_task_data_unique_ins.get_templ_required()); + // 基建所需要的模板资源 + m_templ_resource_unique_ins.append_load_required(m_infrast_cfg_unique_ins.get_templ_required()); + if (!m_templ_resource_unique_ins.load(dir + TemplsFilename)) { m_last_error = m_templ_resource_unique_ins.get_last_error(); return false; diff --git a/src/MeoAssistance/Resource.h b/src/MeoAssistance/Resource.h index 4bad59f1dd..bf4fd654bb 100644 --- a/src/MeoAssistance/Resource.h +++ b/src/MeoAssistance/Resource.h @@ -12,6 +12,7 @@ #include "TaskData.h" #include "RecruitConfiger.h" #include "ItemConfiger.h" +#include "InfrastConfiger.h" #include "UserConfiger.h" #include "OcrPack.h" #include "PenguinPack.h" @@ -44,6 +45,9 @@ namespace asst { ItemConfiger& item() noexcept { return m_item_cfg_unique_ins; } + InfrastConfiger& infrast() noexcept { + return m_infrast_cfg_unique_ins; + } OcrPack& ocr() noexcept { return m_ocr_pack_unique_ins; } @@ -66,6 +70,9 @@ namespace asst { const ItemConfiger& item() const noexcept { return m_item_cfg_unique_ins; } + const InfrastConfiger& infrast() const noexcept { + return m_infrast_cfg_unique_ins; + } const OcrPack& ocr() const noexcept { return m_ocr_pack_unique_ins; } @@ -83,6 +90,7 @@ namespace asst { TaskData m_task_data_unique_ins; RecruitConfiger m_recruit_cfg_unique_ins; ItemConfiger m_item_cfg_unique_ins; + InfrastConfiger m_infrast_cfg_unique_ins; UserConfiger m_user_cfg_unique_ins; OcrPack m_ocr_pack_unique_ins; PenguinPack m_penguin_pack_unique_ins; diff --git a/src/MeoAssistance/TemplResource.cpp b/src/MeoAssistance/TemplResource.cpp index dab002401c..ba7d9d12cb 100644 --- a/src/MeoAssistance/TemplResource.cpp +++ b/src/MeoAssistance/TemplResource.cpp @@ -4,9 +4,11 @@ #include #include -void asst::TemplResource::set_load_required(std::unordered_set required) noexcept +void asst::TemplResource::append_load_required(std::unordered_set required) noexcept { - m_templs_filename = std::move(required); + m_templs_filename.insert( + std::make_move_iterator(required.begin()), + std::make_move_iterator(required.end())); } bool asst::TemplResource::load(const std::string& dir) diff --git a/src/MeoAssistance/TemplResource.h b/src/MeoAssistance/TemplResource.h index 5d9290332e..14fb42100c 100644 --- a/src/MeoAssistance/TemplResource.h +++ b/src/MeoAssistance/TemplResource.h @@ -16,7 +16,7 @@ namespace asst { virtual ~TemplResource() = default; - void set_load_required(std::unordered_set required) noexcept; + void append_load_required(std::unordered_set required) noexcept; virtual bool load(const std::string& dir) override; bool exist_templ(const std::string& key) const noexcept;