-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame_file.txt
101 lines (75 loc) · 2.06 KB
/
game_file.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# this game is an implementation of Snap, but with ships
# from Eve Online
# it's a lot bigger than it has to be
game TestGame start
visiblestack InPlay
# a hidden stack
hiddenstack Draw
# number of players
# stacks can have member attributes
int Draw.x
# member attributes can even be other stacks!
privatestack Draw.h
# and they can have attributes too!
int Draw.h.y
int Draw.h.a
int Draw.h.b
players 2*1# * 5 + 6
Draw.h.b = 6
int someVarName
someVarName = 5*5
# cards!
card Ship start
# card attributes
int shield
int armour
int hull
int attack
end
# child cards
card Atron Ship start
shield = 300 + 1
armour = 350 * 2 - 1
hull = 400 + 2 * 3
attack = 50 + 60 * 6 - 5 / 4
end
# you dont have to set the attributes
card Kestral Ship start end
card Rifter Ship start end
card Apocolypse Ship start end
card Comet Ship start end
# move random cards into a stack
random Ship -> Draw top 100
# move cards between stacks
Draw -> InPlay top 2
# BUG we shouldn't need the top/bottom here as it's meaningless in a choose scenario
# choose Draw -> InPlay top 2
# a setup block, run once at the beggining of the game
setup start
foreachplayer p start
privatestack p.Hand
random Ship -> Draw top 10
Draw ->_ p.Hand bottom 3
end
end
# a phase declaration, like a function
phase DrawPhase start
Draw -> currentPlayer.Hand top 1
end
phase Place start
# currentPlayer is set while a turn is executing
# random Ship -> InPlay top 1
currentPlayer.Hand -> InPlay top 1
# compare cards from positions in stacks
if InPlay.top == InPlay.top-1 start
# declare a wiener
winneris currentPlayer
end
end
# runs every turn
turn start
# run a phase
do DrawPhase
do Place
end
end