diff --git a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs index cce7fd8..e907470 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/TalkBoxAPI.xaml.cs @@ -33,6 +33,20 @@ namespace VPet_Simulator.Windows tbTalk.Text = ""; Task.Run(() => OPENAI(cont)); } + public static string[] like_str = new string[] { "陌生", "普通", "喜欢", "爱" }; + public static int like_ts(int like) + { + if (like > 50) + { + if (like < 100) + return 1; + else if (like < 200) + return 2; + else + return 3; + } + return 0; + } /// /// 使用OPENAI API进行回复 /// @@ -56,13 +70,13 @@ namespace VPet_Simulator.Windows var last = vpetapi.messages.LastOrDefault(); if (last != null) { - if(last.role == ChatGPT.API.Framework.Message.RoleType.user) + if (last.role == ChatGPT.API.Framework.Message.RoleType.user) { vpetapi.messages.Remove(last); } } } - + content = "[当前状态: {0}, 好感度:{1}({2})]".Translate(mw.Core.Save.Mode.ToString().Translate(), like_str[like_ts((int)mw.Core.Save.Likability)].Translate(), (int)mw.Core.Save.Likability) + content; var resp = mw.CGPTClient.Ask("vpet", content); var reply = resp.GetMessageContent(); if (resp.choices[0].finish_reason == "length") diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/en/CGPT2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/en/CGPT2309.lps new file mode 100644 index 0000000..4b62f80 --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/en/CGPT2309.lps @@ -0,0 +1,9 @@ +[当前状态: {0}, 好感度:{1}({2})]#[Current status: {0}, Favorability:{1}({2})]:| +陌生#Strange:| +普通#Common:| +喜欢#Favorite:| +爱#Love:| +Happy#Happy:| +Nomal#Ordinary:| +PoorCondition#Bad:| +Ill#Sick:| diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/CGPT2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/CGPT2309.lps new file mode 100644 index 0000000..f99ee6b --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/CGPT2309.lps @@ -0,0 +1,9 @@ +[当前状态: {0}, 好感度:{1}({2})]#[当前状态: {0}, 好感度:{1}({2})]:| +陌生#陌生:| +普通#普通:| +喜欢#喜欢:| +爱#爱:| +Happy#高兴:| +Nomal#普通:| +PoorCondition#状态不佳:| +Ill#生病:| diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/CGPT2309.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/CGPT2309.lps new file mode 100644 index 0000000..e32ab9a --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/CGPT2309.lps @@ -0,0 +1,9 @@ +[当前状态: {0}, 好感度:{1}({2})]#[Current status: {0}, favorability: {1} ({2})]:| +陌生#strange:| +普通#ordinary:| +喜欢#like:| +爱#love:| +Happy#happy:| +Nomal#ordinary:| +PoorCondition#Run down :| +Ill#get sick:|