2022-12-13 07:10:18 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Security.AccessControl;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
using System.Windows;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
using System.Windows.Controls;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
using System.Windows.Threading;
|
2023-01-20 07:08:28 +00:00
|
|
|
|
using static VPet_Simulator.Core.GraphCore;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
|
|
|
|
|
namespace VPet_Simulator.Core
|
|
|
|
|
{
|
|
|
|
|
public partial class Main
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 当前动画类型
|
|
|
|
|
/// </summary>
|
2023-01-19 15:26:58 +00:00
|
|
|
|
public GraphCore.GraphType DisplayType = GraphCore.GraphType.Default;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// <summary>
|
2023-01-20 07:08:28 +00:00
|
|
|
|
/// 默认循环次数
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int CountNomal = 0;
|
|
|
|
|
/// <summary>
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// 显示默认情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayNomal()
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
CountNomal++;
|
2023-01-18 18:00:30 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode), DisplayNomal);
|
2022-12-13 07:10:18 +00:00
|
|
|
|
}
|
2023-01-19 15:26:58 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示结束动画
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="EndAction">结束后接下来</param>
|
|
|
|
|
/// <returns>是否成功结束</returns>
|
|
|
|
|
public bool DisplayStopMove(Action EndAction)
|
|
|
|
|
{
|
|
|
|
|
switch (DisplayType)
|
|
|
|
|
{
|
|
|
|
|
case GraphCore.GraphType.Boring_B_Loop:
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Boring_C_End, Core.Save.Mode), EndAction);
|
|
|
|
|
return true;
|
|
|
|
|
case GraphCore.GraphType.Squat_B_Loop:
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Squat_C_End, Core.Save.Mode), EndAction);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示摸头情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayTouchHead()
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
if (DisplayType == GraphCore.GraphType.Touch_Head_B_Loop)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
if (PetGrid.Child is IGraph ig && ig.GraphType == GraphCore.GraphType.Touch_Head_B_Loop)
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
ig.IsContinue = true;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (PetGrid2.Child is IGraph ig2 && ig2.GraphType == GraphCore.GraphType.Touch_Head_B_Loop)
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
ig2.IsContinue = true;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2022-12-13 07:10:18 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_B_Loop, Core.Save.Mode), () =>
|
2022-12-14 18:17:13 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_C_End, Core.Save.Mode), DisplayNomal
|
|
|
|
|
)));
|
2022-12-13 07:10:18 +00:00
|
|
|
|
}
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示无聊情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayBoring()
|
|
|
|
|
{
|
|
|
|
|
looptimes = 0;
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Boring_A_Start, Core.Save.Mode), DisplayBoringing);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示无聊情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void DisplayBoringing()
|
|
|
|
|
{
|
|
|
|
|
if (Function.Rnd.Next(++looptimes) > 10)
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Boring_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
else
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Boring_B_Loop, Core.Save.Mode), DisplayBoringing);
|
|
|
|
|
}
|
|
|
|
|
int looptimes;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示蹲下情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplaySquat()
|
|
|
|
|
{
|
|
|
|
|
looptimes = 0;
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Squat_A_Start, Core.Save.Mode), DisplaySquating);
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示蹲下情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplaySquating()
|
|
|
|
|
{
|
|
|
|
|
if (Function.Rnd.Next(++looptimes) > 10)
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Squat_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
else
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Squat_B_Loop, Core.Save.Mode), DisplaySquating);
|
|
|
|
|
}
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示拖拽情况
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayRaised()
|
|
|
|
|
{
|
|
|
|
|
//位置迁移: 254-128
|
|
|
|
|
MainGrid.MouseMove += MainGrid_MouseMove;
|
|
|
|
|
rasetype = 0;
|
|
|
|
|
DisplayRaising();
|
|
|
|
|
//if (((IGraph)PetGrid.Child).GraphType == GraphCore.GraphType.Touch_Head_B_Loop)
|
|
|
|
|
//{
|
|
|
|
|
// ((IGraph)PetGrid.Child).IsContinue = true;
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
//Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Dynamic, Core.Save.Mode), () =>
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_B_Loop, Core.Save.Mode), () =>
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_C_End, Core.Save.Mode), () =>
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode)
|
|
|
|
|
//))));
|
|
|
|
|
}
|
2023-01-20 07:08:28 +00:00
|
|
|
|
int rasetype = int.MinValue;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
int walklength = 0;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示拖拽中
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayRaising()
|
2022-12-13 07:10:18 +00:00
|
|
|
|
{
|
|
|
|
|
switch (rasetype++)
|
|
|
|
|
{
|
|
|
|
|
case -1:
|
2023-01-18 18:00:30 +00:00
|
|
|
|
DisplayFalled_Left();
|
2023-01-20 07:08:28 +00:00
|
|
|
|
rasetype = int.MinValue;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
return;
|
|
|
|
|
case 0:
|
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Dynamic, Core.Save.Mode), DisplayRaising);
|
|
|
|
|
return;
|
|
|
|
|
case 3:
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Static_A_Start, Core.Save.Mode), DisplayRaising);
|
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Raised_Static_B_Loop, Core.Save.Mode), DisplayRaising);
|
|
|
|
|
rasetype = 4;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2023-01-18 18:00:30 +00:00
|
|
|
|
/// 显示掉到地上 从左边
|
2022-12-13 07:10:18 +00:00
|
|
|
|
/// </summary>
|
2023-01-18 18:00:30 +00:00
|
|
|
|
public void DisplayFalled_Left()
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Fall_Left_B_End, Core.Save.Mode),
|
|
|
|
|
() => Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Up_Left, Core.Save.Mode), DisplayNomal));
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示掉到地上 从左边
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayFalled_Right()
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Fall_Right_B_End, Core.Save.Mode),
|
|
|
|
|
() => Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Up_Right, Core.Save.Mode), DisplayNomal));
|
2022-12-13 07:10:18 +00:00
|
|
|
|
}
|
2022-12-14 18:17:13 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示向左走 (有判断)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayWalk_Left()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceLeft() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedWalk, 0);
|
2022-12-14 18:17:13 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayWalk_Lefting();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示向左走
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayWalk_Lefting()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceLeft() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认 or/爬墙
|
|
|
|
|
switch (Function.Rnd.Next(3))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2022-12-14 19:08:12 +00:00
|
|
|
|
DisplayClimb_Left_UP(() =>
|
|
|
|
|
{
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
|
|
|
|
case 1:
|
2022-12-14 19:08:12 +00:00
|
|
|
|
DisplayClimb_Left_DOWN(() =>
|
|
|
|
|
{
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续右边走or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_B_Loop, Core.Save.Mode), DisplayWalk_Lefting);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
/// 显示向右走 (有判断)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayWalk_Right()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceRight() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedWalk, 0);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayWalk_Righting();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-20 07:08:28 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示向右走
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void DisplayWalk_Righting()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceRight() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认 or/爬墙
|
|
|
|
|
switch (Function.Rnd.Next(3))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
DisplayClimb_Right_UP(() =>
|
|
|
|
|
{
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
case 1:
|
|
|
|
|
DisplayClimb_Right_DOWN(() =>
|
|
|
|
|
{
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续右边走or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_B_Loop, Core.Save.Mode), DisplayWalk_Righting);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-19 15:26:58 +00:00
|
|
|
|
///// <summary>
|
|
|
|
|
///// 显示向左爬 (有判断)
|
|
|
|
|
///// </summary>
|
|
|
|
|
//public void DisplayClimb_Bottom_Left()
|
|
|
|
|
//{
|
|
|
|
|
// //看看距离是否满足调节
|
|
|
|
|
// if (Core.Controller.GetWindowsDistanceLeft() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
// {
|
|
|
|
|
// walklength = 0;
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Bottom_Left, Core.Save.Mode), () =>
|
|
|
|
|
// {
|
|
|
|
|
// MoveTimerPoint = new Point(-20, 0);//TODO:锚定设置
|
|
|
|
|
// MoveTimer.Start();
|
|
|
|
|
// DisplayWalk_Lefting();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
///// <summary>
|
|
|
|
|
///// 显示向左爬
|
|
|
|
|
///// </summary>
|
|
|
|
|
//private void DisplayClimb_Bottom_Lefting()
|
|
|
|
|
//{
|
|
|
|
|
// //看看距离是不是不足
|
|
|
|
|
// if (Core.Controller.GetWindowsDistanceLeft() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
// {//是,停下恢复默认 or/爬墙
|
|
|
|
|
// switch (Function.Rnd.Next(3))
|
|
|
|
|
// {
|
|
|
|
|
// case 0:
|
|
|
|
|
// DisplayClimb_Left_UP(() =>
|
|
|
|
|
// {
|
|
|
|
|
// MoveTimer.Stop();
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// case 1:
|
|
|
|
|
// DisplayClimb_Left_DOWN(() =>
|
|
|
|
|
// {
|
|
|
|
|
// MoveTimer.Stop();
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// default:
|
|
|
|
|
// MoveTimer.Stop();
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// //不是:继续右边走or停下
|
|
|
|
|
// if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
// {
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_B_Loop, Core.Save.Mode), DisplayWalk_Lefting);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {//停下来
|
|
|
|
|
// MoveTimer.Stop();
|
|
|
|
|
// Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_C_End, Core.Save.Mode), DisplayNomal);
|
|
|
|
|
// }
|
|
|
|
|
//}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
/// <summary>
|
2022-12-14 18:17:13 +00:00
|
|
|
|
/// 显示左墙壁爬行 上
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
public void DisplayClimb_Left_UP(Action ifNot = null)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
2023-01-19 15:26:58 +00:00
|
|
|
|
if (Core.Controller.GetWindowsDistanceLeft() < 100 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceUp() > 300 * Core.Controller.ZoomRatio)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
|
|
|
|
Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - 145, 0);//TODO:锚定设置
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Lefting_UP();
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
else
|
|
|
|
|
ifNot?.Invoke();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示左墙壁爬行 上
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayClimb_Lefting_UP()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceUp() < 100 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认 or/爬上面的墙
|
2022-12-14 19:08:12 +00:00
|
|
|
|
switch (0)//Function.Rnd.Next(3))
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
DisplayClimb_Top_Right();
|
|
|
|
|
return;
|
|
|
|
|
//case 1://TODO:落下
|
|
|
|
|
// return;
|
|
|
|
|
default:
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
2023-01-19 15:26:58 +00:00
|
|
|
|
if (Function.Rnd.Next(walklength++) < 8)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Left, Core.Save.Mode), DisplayClimb_Lefting_UP);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示左墙壁爬行 下
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
public void DisplayClimb_Left_DOWN(Action ifNot = null)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceLeft() < 50 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceDown() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
2022-12-14 18:17:13 +00:00
|
|
|
|
|
|
|
|
|
Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - 145, 0);//TODO:锚定设置
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new System.Windows.Point(0, Core.Graph.GraphConfig.SpeedClimb);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Lefting_DOWN();
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
else
|
|
|
|
|
ifNot?.Invoke();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示左墙壁爬行 下
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayClimb_Lefting_DOWN()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceDown() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Left, Core.Save.Mode), DisplayClimb_Lefting_DOWN);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示右墙壁爬行 上
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
public void DisplayClimb_Right_UP(Action ifNot = null)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceRight() < 100 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceUp() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
2022-12-14 18:17:13 +00:00
|
|
|
|
|
|
|
|
|
Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + 185, 0);//TODO:锚定设置
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Righting_UP();
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
else
|
|
|
|
|
ifNot?.Invoke();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示右墙壁爬行 上
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayClimb_Righting_UP()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceUp() < 100 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认 or/爬上面的墙
|
|
|
|
|
switch (3)//Function.Rnd.Next(3))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2022-12-14 19:08:12 +00:00
|
|
|
|
DisplayClimb_Top_Left();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
2022-12-14 19:08:12 +00:00
|
|
|
|
//case 1://TODO:落下
|
|
|
|
|
// return;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
default:
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Right, Core.Save.Mode), DisplayClimb_Righting_UP);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示右墙壁爬行 下
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
public void DisplayClimb_Right_DOWN(Action ifNot = null)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceRight() < 100 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceDown() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
2022-12-14 18:17:13 +00:00
|
|
|
|
|
|
|
|
|
Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + 185, 0);//TODO:锚定设置
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(0, Core.Graph.GraphConfig.SpeedClimb);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Righting_DOWN();
|
|
|
|
|
});
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
else
|
|
|
|
|
ifNot?.Invoke();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示右墙壁爬行 下
|
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayClimb_Righting_DOWN()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceDown() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 5)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Right, Core.Save.Mode), DisplayClimb_Righting_DOWN);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示顶部墙壁爬行向右
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayClimb_Top_Right()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
2023-01-19 15:26:58 +00:00
|
|
|
|
if (Core.Controller.GetWindowsDistanceUp() < 100 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceRight() > 400 * Core.Controller.ZoomRatio)
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
|
|
|
|
|
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio - 150);//TODO:锚定设置
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedClimbTop, 0);
|
2022-12-14 18:17:13 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Top_Righting();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
/// 显示顶部墙壁爬行向左
|
2022-12-14 18:17:13 +00:00
|
|
|
|
/// </summary>
|
2022-12-14 19:08:12 +00:00
|
|
|
|
private void DisplayClimb_Top_Righting()
|
2022-12-14 18:17:13 +00:00
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceRight() < 50 * Core.Controller.ZoomRatio)
|
2022-12-14 19:08:12 +00:00
|
|
|
|
{//是,停下恢复默认 or向下爬or掉落
|
2022-12-14 18:17:13 +00:00
|
|
|
|
switch (3)//Function.Rnd.Next(3))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
2022-12-14 19:08:12 +00:00
|
|
|
|
DisplayClimb_Right_DOWN();
|
2022-12-14 18:17:13 +00:00
|
|
|
|
return;
|
2022-12-14 19:08:12 +00:00
|
|
|
|
//case 1://TODO:落下
|
|
|
|
|
// return;
|
2022-12-14 18:17:13 +00:00
|
|
|
|
default:
|
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio);
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 10)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Top_Right, Core.Save.Mode), DisplayClimb_Top_Righting);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio);
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-14 19:08:12 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示顶部墙壁爬行向左
|
|
|
|
|
/// </summary>
|
|
|
|
|
public void DisplayClimb_Top_Left()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是否满足调节
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceUp() < 50 * Core.Controller.ZoomRatio && Core.Controller.GetWindowsDistanceLeft() > 400 * Core.Controller.ZoomRatio)
|
|
|
|
|
{
|
|
|
|
|
walklength = 0;
|
2023-01-19 15:26:58 +00:00
|
|
|
|
|
2022-12-14 18:17:13 +00:00
|
|
|
|
|
2022-12-14 19:08:12 +00:00
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio - 150);//TODO:锚定设置
|
2023-01-20 07:08:28 +00:00
|
|
|
|
MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedClimbTop, 0);
|
2022-12-14 19:08:12 +00:00
|
|
|
|
MoveTimer.Start();
|
|
|
|
|
DisplayClimb_Top_Lefting();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示顶部墙壁爬行向左
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void DisplayClimb_Top_Lefting()
|
|
|
|
|
{
|
|
|
|
|
//看看距离是不是不足
|
|
|
|
|
if (Core.Controller.GetWindowsDistanceLeft() < 50 * Core.Controller.ZoomRatio)
|
|
|
|
|
{//是,停下恢复默认 or向下爬
|
|
|
|
|
switch (3)//Function.Rnd.Next(3))
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
DisplayClimb_Left_DOWN();
|
|
|
|
|
return;
|
|
|
|
|
//case 1://TODO:落下
|
|
|
|
|
// return;
|
|
|
|
|
default:
|
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio);
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//不是:继续or停下
|
|
|
|
|
if (Function.Rnd.Next(walklength++) < 10)
|
|
|
|
|
{
|
|
|
|
|
Display(Core.Graph.FindGraph(GraphCore.GraphType.Climb_Top_Left, Core.Save.Mode), DisplayClimb_Top_Lefting);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{//停下来
|
|
|
|
|
Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio);
|
|
|
|
|
MoveTimer.Stop();
|
|
|
|
|
DisplayNomal();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-12-14 18:17:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-13 07:10:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool petgridcrlf = true;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 显示动画 (自动多层切换)
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="graph">动画</param>
|
|
|
|
|
/// <param name="EndAction">结束操作</param>
|
|
|
|
|
public void Display(IGraph graph, Action EndAction = null)
|
2023-01-20 07:08:28 +00:00
|
|
|
|
{
|
|
|
|
|
//if(graph.GraphType == GraphType.Climb_Up_Left)
|
|
|
|
|
//{
|
|
|
|
|
// Dispatcher.Invoke(() => Say(graph.GraphType.ToString()));
|
|
|
|
|
//}
|
2023-01-19 15:26:58 +00:00
|
|
|
|
DisplayType = graph.GraphType;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
if (PetGrid.Child == graph.This)
|
|
|
|
|
{
|
2023-01-19 15:26:58 +00:00
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
PetGrid.Visibility = Visibility.Visible;
|
2023-01-18 18:00:30 +00:00
|
|
|
|
PetGrid2.Visibility = Visibility.Collapsed;
|
|
|
|
|
});
|
2022-12-13 07:10:18 +00:00
|
|
|
|
((IGraph)(PetGrid.Child)).Run(EndAction);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else if (PetGrid2.Child == graph.This)
|
|
|
|
|
{
|
2023-01-19 15:26:58 +00:00
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
2023-01-20 07:08:28 +00:00
|
|
|
|
PetGrid2.Visibility = Visibility.Visible;
|
2023-01-18 18:00:30 +00:00
|
|
|
|
PetGrid.Visibility = Visibility.Collapsed;
|
|
|
|
|
});
|
2022-12-13 07:10:18 +00:00
|
|
|
|
((IGraph)(PetGrid2.Child)).Run(EndAction);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-12-14 18:17:13 +00:00
|
|
|
|
graph.Run(EndAction);
|
2022-12-13 07:10:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (petgridcrlf)
|
|
|
|
|
{
|
|
|
|
|
((IGraph)(PetGrid.Child)).Stop(true);
|
2023-01-19 15:26:58 +00:00
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
2023-01-18 18:00:30 +00:00
|
|
|
|
PetGrid2.Child = graph.This;
|
2023-01-20 07:08:28 +00:00
|
|
|
|
PetGrid.Visibility = Visibility.Collapsed;
|
|
|
|
|
PetGrid2.Visibility = Visibility.Visible;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
});
|
2023-01-18 18:00:30 +00:00
|
|
|
|
//Task.Run(() =>
|
|
|
|
|
//{
|
|
|
|
|
// Thread.Sleep(25);
|
|
|
|
|
// Dispatcher.Invoke(() => PetGrid.Child = null);
|
|
|
|
|
//});
|
2022-12-13 07:10:18 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
((IGraph)(PetGrid2.Child)).Stop(true);
|
2023-01-19 15:26:58 +00:00
|
|
|
|
Dispatcher.Invoke(() =>
|
|
|
|
|
{
|
2023-01-18 18:00:30 +00:00
|
|
|
|
PetGrid.Child = graph.This;
|
2023-01-20 07:08:28 +00:00
|
|
|
|
PetGrid2.Visibility = Visibility.Collapsed;
|
|
|
|
|
PetGrid.Visibility = Visibility.Visible;
|
2022-12-13 07:10:18 +00:00
|
|
|
|
});
|
2023-01-18 18:00:30 +00:00
|
|
|
|
//Task.Run(() =>
|
|
|
|
|
//{
|
|
|
|
|
// Thread.Sleep(25);
|
|
|
|
|
// Dispatcher.Invoke(() => PetGrid2.Child = null);
|
|
|
|
|
//});
|
2022-12-13 07:10:18 +00:00
|
|
|
|
}
|
|
|
|
|
petgridcrlf = !petgridcrlf;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|