-
Notifications
You must be signed in to change notification settings - Fork 0
/
NozuchiPanel.cs
140 lines (127 loc) · 4.38 KB
/
NozuchiPanel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace Dx2Timer
{
public partial class NozuchiPanel : UserControl
{
const string TIMESPAN_FORMAT = @"hh\:mm\:ss";
public NozuchiPanel()
{
InitializeComponent();
// 耐性
Point[] points =
{
new Point(0, 66), new Point(0, 88),
new Point(120, 22), new Point(120, 0)
};
byte[] types =
{
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line
};
GraphicsPath path =
new GraphicsPath(points, types);
pictureBoxResist.Region = new Region(path);
// ボタンの形を変更 シバブー
// http://dobon.net/vb/dotnet/form/formregion.html
Point[] points2 =
{
new Point(0, 33),
new Point(0, 75),
new Point(11, 82),
new Point(70, 48),
new Point(70, 5),
new Point(59, 0)
};
byte[] types2 =
{
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line,
(byte) PathPointType.Line
};
GraphicsPath path2 =
new GraphicsPath(points2, types2);
button1.Region = new Region(path2);
}
private async void button1_Click(object sender, EventArgs e)
{
button1.Enabled = false;
try
{
if (labelTitle.Text != "ノズチ")
{
labelTitle.Text = "ノズチ";
pictureBoxResist.BackgroundImage =
Properties.Resources.resist_nozuchi;
}
if (pictureBoxNormal.Visible)
{
pictureBoxNormal.Visible = false;
// https://dobon.net/vb/dotnet/programing/random.html
Random r = new Random(DateTime.Now.Millisecond);
int i = r.Next(3000);
#if DEBUG
int j = 100;
#else
int j = 1;
#endif
if (i < 15 * j)
{
pictureBoxRare.Visible = true;
// http://posnum.hatenablog.com/entry/2014/10/28/222436
await Task.Delay(1500);
if (i < 5 * j)
{
labelTitle.Text = "スルト";
pictureBoxResist.BackgroundImage =
Properties.Resources.resist_surt;
pictureBoxResult.BackgroundImage =
Properties.Resources.nozuchi_surt;
}
else if (i < 10 * j)
{
labelTitle.Text = "ノズチ?";
pictureBoxResult.BackgroundImage =
Properties.Resources.nozuchi_mara;
}
else
{
labelTitle.Text = "ノズチ?";
pictureBoxResult.BackgroundImage =
Properties.Resources.nozuchi_komugiko;
}
pictureBoxRare.Visible = false;
pictureBoxResult.Visible = true;
}
else
{
pictureBoxBinded.Visible = true;
}
}
else
{
pictureBoxBinded.Visible = false;
pictureBoxResult.Visible = false;
pictureBoxNormal.Visible = true;
}
}
finally
{
button1.Enabled = true;
}
}
}
}