-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGwentCode昆特码.txt
More file actions
121 lines (102 loc) · 3.01 KB
/
Copy pathGwentCode昆特码.txt
File metadata and controls
121 lines (102 loc) · 3.01 KB
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
基础操作:
赋值:=
运算赋值:+=, -=, *=, /=
运算符:+, -, *, /, ^
逻辑运算符:==, !=, ~=(同名牌), >=, <=
数据类型:
int, float, bool, None
数据结构:
List
的函数
insert, pop,
流程控制:
?, ?!, !, for, range, as, break, continue
IO:
print
内置函数/常量/变量:
boost, damage, onBattleGround, inGrave, inDeck, addStatus, destroy,
banish, reset, getPower, getBasePower, getArmor, getCommand, setCommand,
getCount, setCount, getTimer, setTimer, getPos, jumpTo, create, random, reveal,
duel, clash, consume, drain, infuse, addWeather, clearWeather, flip, getCoins,
setCoins, in, spawn, play, boostBase, damageBase, setBasePower, setPower
originalDeck, deck, grave, round, turn, allTurn, allyRows, enemyRows, battleGround, unit, artifact, special all
订阅函数
Deploy, WeatherTrigger etc.
选择器(传给前端让它选择一个):
choose num from place where filter as var
num: int,一个整数
place: array,一个数组(列表)
filter: (可选)新增的类型,相当于python的listname.filter(lambda e: e.power>5 and e.color==bronze)
var: 你想要给选出来的卡叫什么,一个变量名
# 从手牌选 1 张战力>5 的铜色单位,给它+3
choose 1 from hand[ally] where {.power>5 and .color==bronze} as target:
boost(target, 3)
# 从战场上选 3 张人口大于10 的大金,消灭
choose 3 from allyRows where {.provision>10 and .color==gold} as target:
destroy(target)
示例代码:
--没完没了的朗维德
人类, 士兵
部署:获得 5 点增益。
己方每打出 1 个“士兵”单位,便从己方墓场召唤自身至己方随机排。--
Deploy[self]
boost(5)
Deploy[ally,'士兵']
inGrave()?
jumpTo(allyRows)
//已弃用
部署[自身]
增益(5)
部署[友方, '士兵']
在墓场中?
召唤(友方排)
Deploy[self]
deck[ally].boost(1)
#hand[ally] <= 3?
addStatus(immune)
Command[self]
v = 0
for deck[ally] as card
v += card.reset(power)
boost(v)
//for循环的形式讨论,已经使用最后一种
deck[ally] => card
v += card.reset(power)
或者
Σ deck[ally] : card
v += card.reset(power)
或者
for deck[ally] as card
v += card.reset(power)
--
那个存霜加血的(应该是?)
damageAmounts = []
WeatherTrigger[enemy, "frost"]
#damageAmounts >= 5?
damageAmounts.pop(0)
!? #damageAmounts >= 3
damageAmounts.pop(1)
!
print(None)
damageAmounts += event.amount
TurnStart[ally]
boostAmount = 0
for damageAmounts as dmg
boostAmount += dmg
boost(boostAmount)
--
史提芬·史凯伦
人类, 密探
部署:己方初始卡组中每有 3 张“谋略”牌,便生成并打出 1 张“袖中王牌”。--
Deploy[self]
count = 0
for originalDeck[ally] as card
card.tags["谋略"]?
count += 1
for range(count/3) as _
play(spawn("袖中王牌"))
--
亨赛特国王
Deploy[self]
choose 1 from deck[ally] where {.tags["操控"]} as target:
play(target)