Skip to content

Commit

Permalink
捏脸增加动画判断和心情增加
Browse files Browse the repository at this point in the history
  • Loading branch information
LorisYounger committed Nov 24, 2023
1 parent f13a2fd commit f84dfd0
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions VPet-Simulator.Windows/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ await Dispatcher.InvokeAsync(new Action(() =>
var pin = Core.Graph.GraphConfig.Data["pinch"];
Main.Core.TouchEvent.Insert(0, new TouchArea(
new Point(pin[(gdbe)"px"], pin[(gdbe)"py"]), new Size(pin[(gdbe)"sw"], pin[(gdbe)"sh"])
, () => { DisplayPinch(); return true; }, true));
, DisplayPinch, true));
}


Expand Down Expand Up @@ -1752,9 +1752,14 @@ await Dispatcher.InvokeAsync(new Action(() =>
/// <summary>
/// 显示捏脸情况
/// </summary>
public void DisplayPinch()
public bool DisplayPinch()
{
if (Core.Graph.FindGraphs("pinch", AnimatType.A_Start, Core.Save.Mode) == null)
{
return false;
}
Main.CountNomal = 0;

if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
{
Core.Save.StrengthChange(-2);
Expand All @@ -1765,28 +1770,36 @@ public void DisplayPinch()
if (Main.DisplayType.Name == "pinch")
{
if (Main.DisplayType.Animat == AnimatType.A_Start)
return;
return false;
else if (Main.DisplayType.Animat == AnimatType.B_Loop)
if (Dispatcher.Invoke(() => Main.PetGrid.Tag) is IGraph ig && ig.GraphInfo.Name == "pinch" && ig.GraphInfo.Animat == AnimatType.B_Loop)
{
ig.IsContinue = true;
return;
return true;
}
else if (Dispatcher.Invoke(() => Main.PetGrid2.Tag) is IGraph ig2 && ig2.GraphInfo.Name == "pinch" && ig2.GraphInfo.Animat == AnimatType.B_Loop)
{
ig2.IsContinue = true;
return;
return true;
}
}
Main_Event_TouchHead();
Main_Event_TouchBody();
Main.Display("pinch", AnimatType.A_Start, () =>
Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop));
return true;
}
private void DisplayPinch_loop()
{
if (Main.isPress && Main.DisplayType.Name == "pinch" && Main.DisplayType.Animat == AnimatType.B_Loop)
{
if (Core.Controller.EnableFunction && Core.Save.Strength >= 10 && Core.Save.Feeling < 100)
{
Core.Save.StrengthChange(-2);
Core.Save.FeelingChange(1);
Core.Save.Mode = Core.Save.CalMode();
Main.LabelDisplayShowChangeNumber(LocalizeCore.Translate("体力-{0:f0} 心情+{1:f0}"), 2, 1);
}
Main.Display("pinch", AnimatType.B_Loop, DisplayPinch_loop);
}
else
Expand Down

0 comments on commit f84dfd0

Please sign in to comment.