-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflow.txt
81 lines (57 loc) · 2 KB
/
flow.txt
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
Flow:
START::
players[player_idx]>notify(Trigger::Start);
for(int i = 0; i < minions[player_idx].size(); ++i){
minions[player_idx]->notify(Trigger::Start);
}
rituals[player_idx] -> notify(Trigger::Start);
for(int i = 0; i < minions[player_idx].size(); ++i){
minions[player_idx^1]->notify(Trigger::Start);
}
rituals[player_idx^1] -> notify(Trigger::Start);
END::
players[player_idx]>notify(Trigger::End);
for(int i = 0; i < minions[player_idx].size(); ++i){
minions[player_idx]->notify(Trigger::End);
}
rituals[player_idx] -> notify(Trigger::End);
for(int i = 0; i < minions[player_idx].size(); ++i){
minions[player_idx^1]->notify(Trigger::End);
}
rituals[player_idx^1] -> notify(Trigger::End);
player_idx^=1;
ATTACK(i,j)::
Minions[player_idx^1][j]->collision(Minions[player_idx][i]);
die(Minions[player_idx^1][j]);
Minions[player_idx][i]->collision(Minions[player_idx^1][j]);
die(Minions[player_idx][i]);
Attack(i)::
Players[player_idx^1]->collision(Minions[player_idx][i]);
if(Players[player_idx^1]->isDead()) ENDGAME!!
Play(i)::
Card* c = players[player_idx]->getCard(i);
if(c is minion) check the board size. put down notify MEnter
if(c is spell) check if single. single returns false. if not single, apply to the area.
if(c is ritual) replace the current ritual
if(c is enchantment) return false
Play(i,j,ch)::
Card* c = players[player_idx]->getCard(i);
if(c is minion) return false;
if(c is spell) check if single. Not single returns false. Apply to the target
if(c is ritual) return false;
if(c is enchantment) apply to that target.
Use(i)::
Card *c = minions[player_idx][i];
c == nullptr return false;
if(c does not have activation skill) return false;
if(single) return false;
if(not single, and check magic) apply.
Use(i,j,ch)::
Card *c = minions[player_idx][i];
c == nullptr return false;
if(c does not have activation skill) return false;
if(not single) return false;
if(single, and check magic) apply.
Invariant::
Unsummmon and die may cause MLeave
Play(i) and Use(i) may cause MEnter