-
Notifications
You must be signed in to change notification settings - Fork 0
/
Status.cs
80 lines (71 loc) · 2.01 KB
/
Status.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Tamana
{
[System.Serializable]
public struct Status
{
public float HP;
public float ST;
public float AT;
public float DF;
public Status(float HP, float ST, float AT, float DF)
{
this.HP = HP;
this.ST = ST;
this.AT = AT;
this.DF = DF;
}
public static Status operator +(Status a, Status b)
{
Status status = new Status();
status.HP = a.HP + b.HP;
status.ST = a.ST + b.ST;
status.AT = a.AT + b.AT;
status.DF = a.DF + b.DF;
return status;
}
public static Status operator -(Status a, Status b)
{
Status status = new Status();
status.HP = a.HP - b.HP;
status.ST = a.ST - b.ST;
status.AT = a.AT - b.AT;
status.DF = a.DF - b.DF;
return status;
}
}
public struct StatusPoint
{
public int HP;
public int ST;
public int AT;
public int DF;
public void Init()
{
HP = 1;
ST = 1;
AT = 1;
DF = 1;
}
public static Status operator +(Status a, StatusPoint b)
{
Status status = new Status();
status.HP = a.HP + (b.HP * 35);
status.ST = a.ST + (b.ST * 10);
status.AT = a.AT + (b.AT * 3);
status.DF = a.DF + (b.DF * 7);
return status;
}
public static Status operator -(Status a, StatusPoint b)
{
Status status = new Status();
status.HP = a.HP - (b.HP * 35);
status.ST = a.ST - (b.ST * 10);
status.AT = a.AT - (b.AT * 3);
status.DF = a.DF - (b.DF * 7);
return status;
}
}
}