From 00a920d354479a8abc288ebad6d589b7804ec0ed Mon Sep 17 00:00:00 2001 From: ZouJin Date: Fri, 9 Feb 2024 22:00:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=A8=E5=B9=B4=E7=9A=84=E6=97=B6=E5=80=99?= =?UTF-8?q?=E4=B9=9F=E4=BC=9A=E8=AF=B4=E6=96=B0=E5=B9=B4=E7=A5=9D=E7=A6=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.cs | 85 +++++++++++++++++----------- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 644bb3e..e014fb3 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -1792,44 +1792,13 @@ namespace VPet_Simulator.Windows } #if NewYear //仅新年功能 + Main.TimeHandle += NewYearHandle; if (DateTime.Now < new DateTime(2024, 2, 18)) { Task.Run(() => { Thread.Sleep(5000); - string sayny; - switch (DateTime.Now.Day) - { - default: - case 9: - sayny = "除夕除夕,燃炮祭祖,贴春联,换窗花,主人来一起吃年夜饭!一起包饺砸!{0}祝主人新年快乐!饺子饺子饺饺子!".Translate(GameSavesData.GameSave.Name); - break; - case 10: - sayny = "初一初一,开门炮仗,主人~恭喜发财,红包拿来~".Translate(); - break; - case 11: - sayny = "初二初二,回娘家去,左手一只鸡,右手一只鸭,一起回家吧主人~".Translate(); - break; - case 12: - sayny = "初三初三,晚起早睡,不待客,过年辛苦了主人,好好休息吧~".Translate(); - break; - case 13: - sayny = "初四初四,接五路,迎灶神,吃折箩,恭迎灶神爷!绝对不是肚子饿了!".Translate(); - break; - case 14: - sayny = "初五初五,赶五穷!拿扫帚把垃圾清扫出去!把脏东西都赶出去!今日宜,清屏工作。".Translate(); - break; - case 15: - sayny = "初六初六,送穷鬼,辞旧迎新,送走旧日贫穷困苦,迎接新一年!诶诶,别赶我啊。".Translate(); - break; - case 16: - sayny = "初七初七,登高出游,戴人胜,人胜是一种头饰,又叫彩胜,华胜,从晋朝开始有剪彩为花、剪彩戴在头发上哦。主人我好看吗~".Translate(); - break; - case 17: - sayny = "初八初八,放生祈福,拜谷神,今天是假期最后一天了,和主人过年很开心哦,最后~主人~您还有许多事需要处理,现在还不能休息哦~".Translate(); - break; - } - Main.SayRnd(sayny); + NewYearSay(); }); } #endif @@ -1858,6 +1827,56 @@ namespace VPet_Simulator.Windows //} } +#if NewYear + int newyearsay = 0; + private void NewYearHandle(Main main) + { + if (DateTime.Now.Hour == 0 && newyearsay != DateTime.Now.Day) + {//跨时间 + NewYearSay(); + } + } + /// + /// 新年说 + /// + private void NewYearSay() + { + newyearsay = DateTime.Now.Day; + string sayny; + switch (newyearsay) + { + default: + case 9: + sayny = "除夕除夕,燃炮祭祖,贴春联,换窗花,主人来一起吃年夜饭!一起包饺砸!{0}祝主人新年快乐!饺子饺子饺饺子!".Translate(GameSavesData.GameSave.Name); + break; + case 10: + sayny = "初一初一,开门炮仗,主人~恭喜发财,红包拿来~".Translate(); + break; + case 11: + sayny = "初二初二,回娘家去,左手一只鸡,右手一只鸭,一起回家吧主人~".Translate(); + break; + case 12: + sayny = "初三初三,晚起早睡,不待客,过年辛苦了主人,好好休息吧~".Translate(); + break; + case 13: + sayny = "初四初四,接五路,迎灶神,吃折箩,恭迎灶神爷!绝对不是肚子饿了!".Translate(); + break; + case 14: + sayny = "初五初五,赶五穷!拿扫帚把垃圾清扫出去!把脏东西都赶出去!今日宜,清屏工作。".Translate(); + break; + case 15: + sayny = "初六初六,送穷鬼,辞旧迎新,送走旧日贫穷困苦,迎接新一年!诶诶,别赶我啊。".Translate(); + break; + case 16: + sayny = "初七初七,登高出游,戴人胜,人胜是一种头饰,又叫彩胜,华胜,从晋朝开始有剪彩为花、剪彩戴在头发上哦。主人我好看吗~".Translate(); + break; + case 17: + sayny = "初八初八,放生祈福,拜谷神,今天是假期最后一天了,和主人过年很开心哦,最后~主人~您还有许多事需要处理,现在还不能休息哦~".Translate(); + break; + } + Main.SayRnd(sayny); + } +#endif /// /// 显示捏脸情况 ///