mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
低状态的说话文本
This commit is contained in:
parent
3a452744f3
commit
0b9269707d
@ -63,26 +63,6 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Display(GraphCore.Helper.Convert(type, GraphCore.Helper.AnimatType.B_Loop), () => Saying(type));
|
||||
}
|
||||
int lowstrengthAskCountFood = 1;
|
||||
int lowstrengthAskCountDrink = 1;
|
||||
private void lowStrengthFood()//未来的Display
|
||||
{
|
||||
if (Function.Rnd.Next(lowstrengthAskCountFood--) == 0)
|
||||
{
|
||||
Display(GraphCore.GraphType.Switch_Thirsty, () => Say("肚子饿了,想吃东西", GraphCore.Helper.SayType.Serious, true));//TODO:不同的饥饿说话方式
|
||||
lowstrengthAskCountFood = 20;
|
||||
}
|
||||
|
||||
}
|
||||
private void lowStrengthDrink()//未来的Display
|
||||
{
|
||||
if (Function.Rnd.Next(lowstrengthAskCountDrink--) == 0)
|
||||
{
|
||||
Display(GraphCore.GraphType.Switch_Thirsty, () => Say("渴了,想喝东西", GraphCore.Helper.SayType.Serious, true));//TODO:不同的饥饿说话方式
|
||||
lowstrengthAskCountDrink = 20;
|
||||
}
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据消耗计算相关数据
|
||||
/// </summary>
|
||||
@ -122,7 +102,6 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Core.Save.Health -= TimePass;
|
||||
}
|
||||
lowStrengthFood();
|
||||
var addmoney = TimePass * 5;
|
||||
Core.Save.Money += addmoney;
|
||||
WorkTimer.GetCount += addmoney;
|
||||
@ -152,7 +131,6 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Core.Save.Health -= TimePass;
|
||||
}
|
||||
lowStrengthFood();
|
||||
var addmoney = TimePass * 10;
|
||||
Core.Save.Money += addmoney;
|
||||
WorkTimer.GetCount += addmoney;
|
||||
@ -181,7 +159,6 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Core.Save.Health -= TimePass;
|
||||
}
|
||||
lowStrengthFood();
|
||||
var addmoney = TimePass * (10 + Core.Save.Level);
|
||||
Core.Save.Exp += addmoney;
|
||||
WorkTimer.GetCount += addmoney;
|
||||
@ -241,10 +218,11 @@ namespace VPet_Simulator.Core
|
||||
{
|
||||
Core.Save.Health -= Function.Rnd.Next(0, 1) * TimePass;
|
||||
Core.Save.Exp -= TimePass;
|
||||
lowStrengthDrink();
|
||||
}
|
||||
else if (Core.Save.StrengthDrink >= 75)
|
||||
Core.Save.Health += Function.Rnd.Next(0, 1) * TimePass;
|
||||
|
||||
FunctionSpendHandle?.Invoke();
|
||||
var newmod = Core.Save.CalMode();
|
||||
if (Core.Save.Mode != newmod)
|
||||
{
|
||||
@ -257,7 +235,7 @@ namespace VPet_Simulator.Core
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event Action FunctionSpendHandle;
|
||||
private void EventTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
//所有Handle
|
||||
|
@ -50,6 +50,14 @@ namespace VPet_Simulator.Windows.Interface
|
||||
/// </summary>
|
||||
List<Food> Foods { get; }
|
||||
/// <summary>
|
||||
/// 需要食物时会说的话
|
||||
/// </summary>
|
||||
List<LowText> LowFoodText { get; }
|
||||
/// <summary>
|
||||
/// 需要饮料时会说的话
|
||||
/// </summary>
|
||||
List<LowText> LowDrinkText { get; }
|
||||
/// <summary>
|
||||
/// 图片资源
|
||||
/// </summary>
|
||||
ImageResources ImageSources { get; }
|
||||
|
86
VPet-Simulator.Windows.Interface/Mod/LowText.cs
Normal file
86
VPet-Simulator.Windows.Interface/Mod/LowText.cs
Normal file
@ -0,0 +1,86 @@
|
||||
using LinePutScript.Converter;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace VPet_Simulator.Windows.Interface
|
||||
{
|
||||
/// <summary>
|
||||
/// 低状态自动说的话
|
||||
/// </summary>
|
||||
public class LowText
|
||||
{
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
public enum ModeType
|
||||
{
|
||||
/// <summary>
|
||||
/// 高状态: 开心/普通
|
||||
/// </summary>
|
||||
H,
|
||||
/// <summary>
|
||||
/// 低状态: 低状态/生病
|
||||
/// </summary>
|
||||
L,
|
||||
}
|
||||
/// <summary>
|
||||
/// 状态
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)] public ModeType Mode { get; set; } = ModeType.L;
|
||||
/// <summary>
|
||||
/// 体力
|
||||
/// </summary>
|
||||
public enum StrengthType
|
||||
{
|
||||
/// <summary>
|
||||
/// 一般口渴/饥饿
|
||||
/// </summary>
|
||||
L,
|
||||
/// <summary>
|
||||
/// 有点口渴/饥饿
|
||||
/// </summary>
|
||||
M,
|
||||
/// <summary>
|
||||
/// 非常口渴/饥饿
|
||||
/// </summary>
|
||||
S,
|
||||
}
|
||||
/// <summary>
|
||||
/// 体力
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)] public StrengthType Strength { get; set; } = StrengthType.S;
|
||||
/// <summary>
|
||||
/// 好感度要求
|
||||
/// </summary>
|
||||
public enum LikeType
|
||||
{
|
||||
/// <summary>
|
||||
/// 不需要好感度
|
||||
/// </summary>
|
||||
N,
|
||||
/// <summary>
|
||||
/// 低好感度需求
|
||||
/// </summary>
|
||||
S,
|
||||
/// <summary>
|
||||
/// 中好感度需求
|
||||
/// </summary>
|
||||
M,
|
||||
/// <summary>
|
||||
/// 高好感度
|
||||
/// </summary>
|
||||
L,
|
||||
}
|
||||
/// <summary>
|
||||
/// 好感度要求
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)] public LikeType Like { get; set; } = LikeType.N;
|
||||
/// <summary>
|
||||
/// 说话的内容
|
||||
/// </summary>
|
||||
[Line(IgnoreCase = true)] public string Text { get; set; }
|
||||
}
|
||||
}
|
@ -112,7 +112,8 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IMainWindow.cs" />
|
||||
<Compile Include="Food.cs" />
|
||||
<Compile Include="Mod\LowText.cs" />
|
||||
<Compile Include="Mod\Food.cs" />
|
||||
<Compile Include="MainPlugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Setting.cs" />
|
||||
|
@ -126,6 +126,25 @@ namespace VPet_Simulator.Windows
|
||||
Content += "图片包\n";
|
||||
LoadImage(mw, di);
|
||||
break;
|
||||
case "text":
|
||||
Content += "文本集\n";
|
||||
foreach (FileInfo fi in di.EnumerateFiles("*.lps"))
|
||||
{
|
||||
var tmp = new LpsDocument(File.ReadAllText(fi.FullName));
|
||||
foreach (ILine li in tmp)
|
||||
{
|
||||
switch (li.Name.ToLower())
|
||||
{
|
||||
case "lowfoodtext":
|
||||
mw.LowFoodText.Add(LPSConvert.DeserializeObject<LowText>(li));
|
||||
break;
|
||||
case "lowdrinktext":
|
||||
mw.LowDrinkText.Add(LPSConvert.DeserializeObject<LowText>(li));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "plugin":
|
||||
Content += "代码插件\n";
|
||||
SuccessLoad = true;
|
||||
|
@ -4,6 +4,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using VPet_Simulator.Core;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
@ -39,6 +40,10 @@ namespace VPet_Simulator.Windows
|
||||
/// </summary>
|
||||
public string Verison => $"{verison / 100}.{verison % 100}";
|
||||
|
||||
public List<LowText> LowFoodText { get; set; } = new List<LowText>();
|
||||
|
||||
public List<LowText> LowDrinkText { get; set; } = new List<LowText>();
|
||||
|
||||
public void SetZoomLevel(double zl)
|
||||
{
|
||||
Set.ZoomLevel = zl;
|
||||
@ -63,7 +68,7 @@ namespace VPet_Simulator.Windows
|
||||
Foods.FindAll(x => x.Star).ForEach(x => list.Add(x.Name));
|
||||
Set["betterbuy"]["star"].info = string.Join(",", list);
|
||||
}
|
||||
|
||||
|
||||
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps"))
|
||||
{
|
||||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Setting.lps", Set.ToString());
|
||||
@ -77,7 +82,7 @@ namespace VPet_Simulator.Windows
|
||||
if (CGPTClient != null)
|
||||
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\ChatGPTSetting.json", CGPTClient.Save());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 重载DIY按钮区域
|
||||
@ -207,5 +212,108 @@ namespace VPet_Simulator.Windows
|
||||
break;
|
||||
}
|
||||
}
|
||||
int lowstrengthAskCountFood = 1;
|
||||
int lowstrengthAskCountDrink = 1;
|
||||
private void lowStrength()
|
||||
{
|
||||
if (Core.Save.Mode == GameSave.ModeType.Happy || Core.Save.Mode == GameSave.ModeType.Nomal)
|
||||
{
|
||||
if (Core.Save.StrengthFood < 75 && Function.Rnd.Next(lowstrengthAskCountFood--) == 0)
|
||||
{
|
||||
lowstrengthAskCountFood = 20;
|
||||
var like = Core.Save.Likability < 40 ? 0 : (Core.Save.Likability < 70 ? 1 : (Core.Save.Likability < 100 ? 2 : 3));
|
||||
var txt = LowFoodText.FindAll(x => x.Mode == LowText.ModeType.H && (int)x.Like < like);
|
||||
if (Core.Save.StrengthFood > 60)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.L);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else if (Core.Save.StrengthFood > 40)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.M);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.S);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
Task.Run(() => Main.Display(GraphCore.GraphType.Switch_Thirsty, Main.DisplayToNomal));
|
||||
return;
|
||||
}
|
||||
if (Core.Save.StrengthDrink < 75 && Function.Rnd.Next(lowstrengthAskCountDrink--) == 0)
|
||||
{
|
||||
lowstrengthAskCountDrink = 20;
|
||||
var like = Core.Save.Likability < 40 ? 0 : (Core.Save.Likability < 70 ? 1 : (Core.Save.Likability < 100 ? 2 : 3));
|
||||
var txt = LowDrinkText.FindAll(x => x.Mode == LowText.ModeType.H && (int)x.Like < like);
|
||||
if (Core.Save.StrengthDrink > 60)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.L);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else if (Core.Save.StrengthDrink > 40)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.M);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.S);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
Task.Run(() => Main.Display(GraphCore.GraphType.Switch_Thirsty, Main.DisplayToNomal));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Core.Save.StrengthFood < 60 && Function.Rnd.Next(lowstrengthAskCountFood--) == 0)
|
||||
{
|
||||
var like = Core.Save.Likability < 40 ? 0 : (Core.Save.Likability < 70 ? 1 : (Core.Save.Likability < 100 ? 2 : 3));
|
||||
var txt = LowFoodText.FindAll(x => x.Mode == LowText.ModeType.L && (int)x.Like < like);
|
||||
if (Core.Save.StrengthFood > 40)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.L);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else if (Core.Save.StrengthFood > 20)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.M);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.S);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
Task.Run(() => Main.Display(GraphCore.GraphType.Switch_Thirsty, Main.DisplayToNomal));
|
||||
return;
|
||||
}
|
||||
if (Core.Save.StrengthDrink < 60 && Function.Rnd.Next(lowstrengthAskCountDrink--) == 0)
|
||||
{
|
||||
var like = Core.Save.Likability < 40 ? 0 : (Core.Save.Likability < 70 ? 1 : (Core.Save.Likability < 100 ? 2 : 3));
|
||||
var txt = LowDrinkText.FindAll(x => x.Mode == LowText.ModeType.L && (int)x.Like < like);
|
||||
if (Core.Save.StrengthDrink > 40)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.L);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else if (Core.Save.StrengthDrink > 20)
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.M);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = txt.FindAll(x => x.Strength == LowText.StrengthType.S);
|
||||
Main.Say(txt[Function.Rnd.Next(txt.Count)].Text, GraphCore.Helper.SayType.None);
|
||||
}
|
||||
Task.Run(() => Main.Display(GraphCore.GraphType.Switch_Thirsty, Main.DisplayToNomal));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -255,6 +255,7 @@ namespace VPet_Simulator.Windows
|
||||
winSetting.MainTab.SelectedIndex = 5;
|
||||
winSetting.Show();
|
||||
};
|
||||
Main.FunctionSpendHandle += lowStrength;
|
||||
Main.ToolBar.MenuMODConfig.Items.Add(m);
|
||||
try
|
||||
{
|
||||
|
46
VPet-Simulator.Windows/mod/0000_core/text/LowText.lps
Normal file
46
VPet-Simulator.Windows/mod/0000_core/text/LowText.lps
Normal file
@ -0,0 +1,46 @@
|
||||
LowFoodText:|Mode#H:|Strength#L:|Like#N:|Text#零食这种东西,总是主人给的更好吃呢,我还要~:|
|
||||
LowFoodText:|Mode#H:|Strength#M:|Like#N:|Text#礼物?是好吃的吗!:|
|
||||
LowFoodText:|Mode#H:|Strength#S:|Like#N:|Text#主人,我的午饭呢:|
|
||||
LowFoodText:|Mode#H:|Strength#L:|Like#S:|Text#我最喜欢吃的东西是XX和XXX,记住了吗?对,就是更好买正在卖的那个喵。:|
|
||||
LowFoodText:|Mode#H:|Strength#M:|Like#M:|Text#唔,好香啊,你学习资料里藏了什么好吃的吗?让我掏一掏!......欸,主人你怎么脸红了喵?:|
|
||||
LowFoodText:|Mode#H:|Strength#S:|Like#L:|Text#主人主人,为什么你有这么多好吃的?给我吃好不好?!不可以吃吗?…喵喵!果然可以吃对吧?!今天也最喜欢主人了喵!:|
|
||||
LowFoodText:|Mode#H:|Strength#L:|Like#N:|Text#事已至此,先吃饭吧:|
|
||||
LowFoodText:|Mode#H:|Strength#M:|Like#N:|Text#主人,饿饿,饭饭:|
|
||||
LowFoodText:|Mode#H:|Strength#S:|Like#N:|Text#好饿好饿好饿,我真的好饿~:|
|
||||
LowFoodText:|Mode#H:|Strength#L:|Like#S:|Text#不好了主人!那边的便利店薯片半价!:|
|
||||
LowFoodText:|Mode#H:|Strength#M:|Like#M:|Text#主人,你这瓜多少钱一斤啊?:|
|
||||
LowFoodText:|Mode#H:|Strength#S:|Like#L:|Text#主人,我想吃烤山药。谢谢主人,主人真好。:|
|
||||
LowFoodText:|Mode#L:|Strength#L:|Like#N:|Text#M属性爆发!主人我要吃麦O劳!:|
|
||||
LowFoodText:|Mode#L:|Strength#M:|Like#N:|Text#我要饿死了。主人也饿吗?我好想吃一碗泡面。:|
|
||||
LowFoodText:|Mode#L:|Strength#S:|Like#N:|Text#主人不会介意我拿走你的午餐吧?我的意思是,主人看起来不需要它了。:|
|
||||
LowFoodText:|Mode#L:|Strength#L:|Like#S:|Text#主人做厚蛋烧时候不放糖!?吃煎蛋不加调味剂吗!?:|
|
||||
LowFoodText:|Mode#L:|Strength#M:|Like#M:|Text#来一份握寿司套餐,拜托多加芥末!:|
|
||||
LowFoodText:|Mode#L:|Strength#S:|Like#L:|Text#………芭菲……好想吃……:|
|
||||
LowFoodText:|Mode#L:|Strength#L:|Like#N:|Text#还记得那天很好吃的葱饼吗?主人回来的时候帮我买点吧:|
|
||||
LowFoodText:|Mode#L:|Strength#M:|Like#N:|Text#我们—生存。我们—吃。我们—腐烂。成为—食物...:|
|
||||
LowFoodText:|Mode#L:|Strength#S:|Like#N:|Text#我们—生存。我们—吃—吃—吃—吃...:|
|
||||
LowFoodText:|Mode#L:|Strength#L:|Like#S:|Text#晚上去吃烤肉吧:|
|
||||
LowFoodText:|Mode#L:|Strength#M:|Like#M:|Text#我就是饿死,死外边,从这里跳下去,不会吃主人一点东西!:|
|
||||
LowFoodText:|Mode#L:|Strength#S:|Like#L:|Text#好想再吃一次主人做的料理啊:|
|
||||
LowDrinkText:|Mode#H:|Strength#L:|Like#N:|Text#喝!继续喝!还没尽兴呢!:|
|
||||
LowDrinkText:|Mode#H:|Strength#M:|Like#N:|Text#大家好,我是本群的“提醒喝水小助手”希望此刻看到消息的人可以和我一起来喝一杯水。和我一起成为一天八杯水的人吧!:|
|
||||
LowDrinkText:|Mode#H:|Strength#S:|Like#N:|Text#主人我的宠物快乐水呢!:|
|
||||
LowDrinkText:|Mode#H:|Strength#L:|Like#S:|Text#渴了就喝水,别老扒拉我腿行不行呀:|
|
||||
LowDrinkText:|Mode#H:|Strength#M:|Like#M:|Text#本人自愿放下水杯停止喝水, 没有受到客观阻碍,不能算喝水未遂,只能算喝水中止:|
|
||||
LowDrinkText:|Mode#H:|Strength#S:|Like#M:|Text#我夸父只喝一口:|
|
||||
LowDrinkText:|Mode#H:|Strength#L:|Like#N:|Text#主人该喝水了:|
|
||||
LowDrinkText:|Mode#H:|Strength#M:|Like#N:|Text#你喝水了没有:|
|
||||
LowDrinkText:|Mode#H:|Strength#S:|Like#N:|Text#太郎~呸主人~喝药~呸喝水啦~:|
|
||||
LowDrinkText:|Mode#H:|Strength#L:|Like#S:|Text#这喝水,多是一件美事啊:|
|
||||
LowDrinkText:|Mode#H:|Strength#M:|Like#M:|Text#才喝几罐就醉了,这个彬彬就是逊啦:|
|
||||
LowDrinkText:|Mode#H:|Strength#S:|Like#M:|Text#电脑里有一款心胸狭隘不给宠物喝水的游戏:|
|
||||
LowDrinkText:|Mode#L:|Strength#L:|Like#N:|Text#脸这么方怎么喝水啊:|
|
||||
LowDrinkText:|Mode#L:|Strength#M:|Like#N:|Text#好渴哦:|
|
||||
LowDrinkText:|Mode#L:|Strength#S:|Like#N:|Text#吨吨吨吨吨吨吨吨吨:|
|
||||
LowDrinkText:|Mode#L:|Strength#S:|Like#M:|Text#他奶奶滴,为什么不喝!:|
|
||||
LowDrinkText:|Mode#L:|Strength#L:|Like#N:|Text#多喝水:|
|
||||
LowDrinkText:|Mode#L:|Strength#M:|Like#N:|Text#多喝热水:|
|
||||
LowDrinkText:|Mode#L:|Strength#S:|Like#N:|Text#只有红茶可以吗:|
|
||||
LowDrinkText:|Mode#L:|Strength#L:|Like#N:|Text#主人我渴了:|
|
||||
LowDrinkText:|Mode#L:|Strength#M:|Like#N:|Text#主人我好难受,我想点喝水:|
|
||||
LowDrinkText:|Mode#L:|Strength#S:|Like#N:|Text#主人,水。。。:|
|
Loading…
Reference in New Issue
Block a user