初期値が「true」または「false」の新しい駒属性<attribute>を設定します。
駒が生成された時点、または初期配置される駒であればゲーム開始時点での、駒属性<attribute>の初期値を設定します。
(piece XXXX)内で、駒種ごとに設定します。
最大32種類の駒属性<attribute>を設定できます。
(moves <move-def>)内で、移動時に「set-attribute」で変更できます。
駒が生成されてから除去されるまで、ゲーム中ずっと保持されます。
駒が「change-type」で変更になった場合も、変更後の駒に引き継がれます。
(verify <condition>)や(if <condition> <instruction>)において、駒属性<attribute>をフラグのように参照できます。
(verify <attribute>)や(if <attribute> <instruction>)として、(moves <move-def>)内で移動時に利用できます。
- (attribute <attribute> <condition>)
<condition>には「true」または「false」が入ります。
- (attribute <attribute> true)
<attribute>の初期値を「true」に設定します。
- (attribute <attribute> false)
<attribute>の初期値を「false」に設定します。
①
(piece
(attribute never? true)
)
②
(moves
(
(if never?
e add
else
w add)
)
)
③
(moves
(
n
(verify (not never?))
add
)
)
④
(moves
(
s
(set-attribute never? false)
add
)
)
※<attribute>が「true」かどうかを判定する場合は、<attribute>そのままで使用します。
※<attribute>が「false」かどうかを判定する場合は、(not <attribute>)として使用します。
最終更新:2020年08月29日 16:32