游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Origin for each line in script/c0.lua from check-in 6bc844fccc:

e59d27b43b 2023-07-17  顽雨沉风: local str = {}
6f9888787e 2023-08-02  顽雨沉风: local string = string
6f9888787e 2023-08-02  顽雨沉风: local table = table
6bc844fccc 2024-02-13  顽雨沉风: local s = {}
6f9888787e 2023-08-02  顽雨沉风: _G.fun = {}
ad4e2a7693 2023-08-02  顽雨沉风: str["效果卡的种类表"] = {
674765ddf2 2024-02-13  顽雨沉风:   TYPE_SPELL,
674765ddf2 2024-02-13  顽雨沉风:   TYPE_TRAP,
674765ddf2 2024-02-13  顽雨沉风:   TYPE_EFFECT,
a2e76b01c2 2024-01-26  顽雨沉风: }
ad4e2a7693 2023-08-02  顽雨沉风: str["无效果灵摆怪兽表"] = {
674765ddf2 2024-02-13  顽雨沉风:   28363749,
674765ddf2 2024-02-13  顽雨沉风:   19474136,
674765ddf2 2024-02-13  顽雨沉风:   17390179,
674765ddf2 2024-02-13  顽雨沉风:   83980492,
674765ddf2 2024-02-13  顽雨沉风: }
0dd37b287e 2024-02-13  顽雨沉风: local h1
0dd37b287e 2024-02-13  顽雨沉风: --~ 区域
0dd37b287e 2024-02-13  顽雨沉风: h1 = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED
0dd37b287e 2024-02-13  顽雨沉风: str["除卡组与额外卡组以外的区域"] = h1
0dd37b287e 2024-02-13  顽雨沉风: h1 = h1 + LOCATION_DECK + LOCATION_EXTRA
0dd37b287e 2024-02-13  顽雨沉风: str["所有区域"] = h1
ad4e2a7693 2023-08-02  顽雨沉风: --第一层-------------------------------
dd1a253607 2023-08-02  顽雨沉风: local cache_1
dd1a253607 2023-08-02  顽雨沉风: local cache_2
dd1a253607 2023-08-02  顽雨沉风: local cache_3
dd1a253607 2023-08-02  顽雨沉风: local cache_4
dd1a253607 2023-08-02  顽雨沉风: local cache_5
dd1a253607 2023-08-02  顽雨沉风: local cache_6
dd1a253607 2023-08-02  顽雨沉风: local cache_7
dd1a253607 2023-08-02  顽雨沉风: local cache_8
dd1a253607 2023-08-02  顽雨沉风: local cache_9
155b00bc3f 2024-01-23  顽雨沉风: local _
155b00bc3f 2024-01-23  顽雨沉风: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
f56b114da9 2024-02-13  顽雨沉风: Debug.ReloadFieldBegin = function(u1, u2)
f56b114da9 2024-02-13  顽雨沉风:   str["不洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
f56b114da9 2024-02-13  顽雨沉风:   str["无BP"] = u1 & DUEL_ATTACK_FIRST_TURN
f56b114da9 2024-02-13  顽雨沉风:   str["无AI"] = u1 & DUEL_SIMPLE_AI
674765ddf2 2024-02-13  顽雨沉风:   str["规则表"] = {
674765ddf2 2024-02-13  顽雨沉风:     [3] = "大师3 ",
674765ddf2 2024-02-13  顽雨沉风:     [4] = "新大师 ",
674765ddf2 2024-02-13  顽雨沉风:     [5] = "大师2020 ",
674765ddf2 2024-02-13  顽雨沉风:   }
f56b114da9 2024-02-13  顽雨沉风:   if u2 then
f56b114da9 2024-02-13  顽雨沉风:     str["规则"] = str["规则表"][u2]
46bd1a8cd5 2024-02-13  顽雨沉风:   else
46bd1a8cd5 2024-02-13  顽雨沉风:     str["规则"] = str["规则表"][5]
46bd1a8cd5 2024-02-13  顽雨沉风:   end
f56b114da9 2024-02-13  顽雨沉风:   fun["Debug.ReloadFieldBegin"](u1, u2)
46bd1a8cd5 2024-02-13  顽雨沉风: end
f56b114da9 2024-02-13  顽雨沉风: fun["一_随机抽卡"] = function(u1)
af6ca14c70 2024-02-13  顽雨沉风:   local h1, h2
f56b114da9 2024-02-13  顽雨沉风:   str["随机抽卡的数量"] = u1
af6ca14c70 2024-02-13  顽雨沉风:   --~ 效果
af6ca14c70 2024-02-13  顽雨沉风:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetCode(EVENT_ADJUST)
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetCondition(aux.TRUE)
d3790b56e8 2024-02-13  顽雨沉风:   -- 随机抽卡
951ea1b58f 2024-02-13  顽雨沉风:   --~ 调该效果的效果
951ea1b58f 2024-02-13  顽雨沉风:   function h2(u2)
46bd1a8cd5 2024-02-13  顽雨沉风:     Duel.ShuffleDeck(0)
f56b114da9 2024-02-13  顽雨沉风:     Duel.Draw(0, u1, REASON_RULE)
951ea1b58f 2024-02-13  顽雨沉风:     u2:Reset()
af6ca14c70 2024-02-13  顽雨沉风:     end
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetOperation(h2)
af6ca14c70 2024-02-13  顽雨沉风:   Duel.RegisterEffect(h1, 0)
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风: fun["一_该效果不能被连锁"] = function()
46bd1a8cd5 2024-02-13  顽雨沉风:   Duel.SetChainLimit(aux.FALSE)
46bd1a8cd5 2024-02-13  顽雨沉风:   return true
d3790b56e8 2024-02-13  顽雨沉风:   end
951ea1b58f 2024-02-13  顽雨沉风: do
951ea1b58f 2024-02-13  顽雨沉风:   local h1, h2
951ea1b58f 2024-02-13  顽雨沉风:   --~ 原解邀请
951ea1b58f 2024-02-13  顽雨沉风:   h1 = "残局群181175613"
951ea1b58f 2024-02-13  顽雨沉风:   --~ 二解邀请,备用:圣魔术师
951ea1b58f 2024-02-13  顽雨沉风:   h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
6bc844fccc 2024-02-13  顽雨沉风:   function s["通关之邀"]()
951ea1b58f 2024-02-13  顽雨沉风:     local h3, h4
951ea1b58f 2024-02-13  顽雨沉风:     --~ 效果
951ea1b58f 2024-02-13  顽雨沉风:     h3 = Effect.GlobalEffect()
951ea1b58f 2024-02-13  顽雨沉风:     h3:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
951ea1b58f 2024-02-13  顽雨沉风:     h3:SetCode(EVENT_DAMAGE)
951ea1b58f 2024-02-13  顽雨沉风:     --~ 通关之邀
951ea1b58f 2024-02-13  顽雨沉风:     function h4()
951ea1b58f 2024-02-13  顽雨沉风:       local h5
951ea1b58f 2024-02-13  顽雨沉风:       --~ 对方之血
951ea1b58f 2024-02-13  顽雨沉风:       h5 = Duel.GetLP(1)
951ea1b58f 2024-02-13  顽雨沉风:       if h5 <= 0 then
951ea1b58f 2024-02-13  顽雨沉风:         if h5 == 0 then
951ea1b58f 2024-02-13  顽雨沉风:           Debug.ShowHint(h1)
951ea1b58f 2024-02-13  顽雨沉风:         else
951ea1b58f 2024-02-13  顽雨沉风:           Debug.ShowHint(h2)
951ea1b58f 2024-02-13  顽雨沉风:           end
951ea1b58f 2024-02-13  顽雨沉风:       else
951ea1b58f 2024-02-13  顽雨沉风:         return false
951ea1b58f 2024-02-13  顽雨沉风:         end
951ea1b58f 2024-02-13  顽雨沉风:       end
951ea1b58f 2024-02-13  顽雨沉风:     h3:SetCondition(h4)
951ea1b58f 2024-02-13  顽雨沉风:     h3:SetOperation(aux.NULL)
951ea1b58f 2024-02-13  顽雨沉风:     Duel.RegisterEffect(h3, 0)
951ea1b58f 2024-02-13  顽雨沉风:     end
951ea1b58f 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风: fun["一_是否效果卡"] = function(card)
46bd1a8cd5 2024-02-13  顽雨沉风:   for i = 1, #str["效果卡的种类表"] do
46bd1a8cd5 2024-02-13  顽雨沉风:     if Card.IsType(card, str["效果卡的种类表"][i]) then
46bd1a8cd5 2024-02-13  顽雨沉风:       return true
46bd1a8cd5 2024-02-13  顽雨沉风:     end
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if Card.IsType(card, TYPE_PENDULUM) then
46bd1a8cd5 2024-02-13  顽雨沉风:     for i = 1, #str["无效果灵摆怪兽表"] do
46bd1a8cd5 2024-02-13  顽雨沉风:       if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then
46bd1a8cd5 2024-02-13  顽雨沉风:       else
46bd1a8cd5 2024-02-13  顽雨沉风:         return true
46bd1a8cd5 2024-02-13  顽雨沉风:       end
46bd1a8cd5 2024-02-13  顽雨沉风:     end
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风: end
f56b114da9 2024-02-13  顽雨沉风: fun["一_开局添加手卡"] = function(u1)
46bd1a8cd5 2024-02-13  顽雨沉风:   str["开局添加手卡"] = true
f56b114da9 2024-02-13  顽雨沉风:   str["开局添加手卡的数量"] = u1
46bd1a8cd5 2024-02-13  顽雨沉风:   str["效果"] = Effect.GlobalEffect()
46bd1a8cd5 2024-02-13  顽雨沉风:   str["效果"]:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
46bd1a8cd5 2024-02-13  顽雨沉风:   str["效果"]:SetCode(EVENT_ADJUST)
46bd1a8cd5 2024-02-13  顽雨沉风:   str["效果"]:SetCondition(aux.TRUE)
46bd1a8cd5 2024-02-13  顽雨沉风:   function cache_1(effect_event, player_who_activate_the_effect)
674765ddf2 2024-02-13  顽雨沉风:     str["玩家选定的卡"] = Duel.SelectMatchingCard(
674765ddf2 2024-02-13  顽雨沉风:       player_who_activate_the_effect,
674765ddf2 2024-02-13  顽雨沉风:       Card.IsAbleToHand,
674765ddf2 2024-02-13  顽雨沉风:       player_who_activate_the_effect,
674765ddf2 2024-02-13  顽雨沉风:       LOCATION_DECK,
674765ddf2 2024-02-13  顽雨沉风:       0,
f56b114da9 2024-02-13  顽雨沉风:       u1,
f56b114da9 2024-02-13  顽雨沉风:       u1,
674765ddf2 2024-02-13  顽雨沉风:       nil
674765ddf2 2024-02-13  顽雨沉风:     )
674765ddf2 2024-02-13  顽雨沉风:     Duel.SendtoHand(str["玩家选定的卡"], nil, REASON_RULE)
674765ddf2 2024-02-13  顽雨沉风:     effect_event:Reset()
46bd1a8cd5 2024-02-13  顽雨沉风:   end
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetOperation(cache_1)
674765ddf2 2024-02-13  顽雨沉风:   Duel.RegisterEffect(str["效果"], 0)
46bd1a8cd5 2024-02-13  顽雨沉风: end
f56b114da9 2024-02-13  顽雨沉风: fun["一_禁格"] = function(u1)
af6ca14c70 2024-02-13  顽雨沉风:   local h1
674765ddf2 2024-02-13  顽雨沉风:   str["禁格"] = true
f56b114da9 2024-02-13  顽雨沉风:   str["禁格的数量"] = u1
af6ca14c70 2024-02-13  顽雨沉风:   --~ 效果
af6ca14c70 2024-02-13  顽雨沉风:   h1 = Effect.GlobalEffect()
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetCode(EFFECT_USE_EXTRA_MZONE)
af6ca14c70 2024-02-13  顽雨沉风:   h1:SetValue(u1)
af6ca14c70 2024-02-13  顽雨沉风:   Duel.RegisterEffect(h1, 0)
af6ca14c70 2024-02-13  顽雨沉风:   end
155b00bc3f 2024-01-23  顽雨沉风: --第二层-------------------------------
e59d27b43b 2023-07-17  顽雨沉风: local cache_1
e59d27b43b 2023-07-17  顽雨沉风: local cache_2
e59d27b43b 2023-07-17  顽雨沉风: local cache_3
e59d27b43b 2023-07-17  顽雨沉风: local cache_4
e59d27b43b 2023-07-17  顽雨沉风: local cache_5
27cb01cd8e 2023-07-17  顽雨沉风: local cache_6
27cb01cd8e 2023-07-17  顽雨沉风: local cache_7
27cb01cd8e 2023-07-17  顽雨沉风: local cache_8
27cb01cd8e 2023-07-17  顽雨沉风: local cache_9
c110227920 2023-08-02  顽雨沉风: local _
c110227920 2023-08-02  顽雨沉风: fun["Debug.ReloadFieldEnd"] = Debug.ReloadFieldEnd
f56b114da9 2024-02-13  顽雨沉风: Debug.ReloadFieldEnd = function(u1)
674765ddf2 2024-02-13  顽雨沉风:   fun["Debug.ReloadFieldEnd"]()
f56b114da9 2024-02-13  顽雨沉风:   if u1 then
f56b114da9 2024-02-13  顽雨沉风:     fun["一_随机抽卡"](u1)
0dd37b287e 2024-02-13  顽雨沉风:     end
f56b114da9 2024-02-13  顽雨沉风:   end
04eb866260 2024-02-13  顽雨沉风: fun["二_印卡"] = function(u1, u2, u3)
43ea8c8217 2024-02-13  顽雨沉风:   u3 = u3 or u2
674765ddf2 2024-02-13  顽雨沉风:   Debug.ShowHint(
674765ddf2 2024-02-13  顽雨沉风:     "点击对方额外卡组可以进行印卡。\n手卡只能印 "
f56b114da9 2024-02-13  顽雨沉风:       .. u2
674765ddf2 2024-02-13  顽雨沉风:       .. " 张。\n最多可以印 "
04eb866260 2024-02-13  顽雨沉风:       .. u3
674765ddf2 2024-02-13  顽雨沉风:       .. " 张"
674765ddf2 2024-02-13  顽雨沉风:   )
f56b114da9 2024-02-13  顽雨沉风:   str["效果"] = Effect.CreateEffect(u1)
674765ddf2 2024-02-13  顽雨沉风:   str["当前印卡数"] = 1
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetType(EFFECT_TYPE_IGNITION)
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetProperty(
674765ddf2 2024-02-13  顽雨沉风:     EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE
674765ddf2 2024-02-13  顽雨沉风:   )
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetTarget(fun["一_该效果不能被连锁"])
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetRange(LOCATION_EXTRA)
46bd1a8cd5 2024-02-13  顽雨沉风:   function print_hand(effect_event, player_who_activate_the_effect)
674765ddf2 2024-02-13  顽雨沉风:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
674765ddf2 2024-02-13  顽雨沉风:     card = Duel.CreateToken(player_who_activate_the_effect, announce_card)
f56b114da9 2024-02-13  顽雨沉风:     if str["当前印卡数"] <= u2 then
674765ddf2 2024-02-13  顽雨沉风:       str["当前印卡数"] = str["当前印卡数"] + 1
674765ddf2 2024-02-13  顽雨沉风:       Duel.SendtoHand(card, nil, REASON_RULE)
46bd1a8cd5 2024-02-13  顽雨沉风:     else
04eb866260 2024-02-13  顽雨沉风:       if str["当前印卡数"] <= u3 then
674765ddf2 2024-02-13  顽雨沉风:         str["当前印卡数"] = str["当前印卡数"] + 1
674765ddf2 2024-02-13  顽雨沉风:         Duel.Remove(card, POS_FACEUP, REASON_RULE)
674765ddf2 2024-02-13  顽雨沉风:         Duel.SendtoDeck(card, player_who_activate_the_effect, 0, REASON_RULE)
46bd1a8cd5 2024-02-13  顽雨沉风:       else
674765ddf2 2024-02-13  顽雨沉风:         Debug.ShowHint("印卡过多!")
674765ddf2 2024-02-13  顽雨沉风:         effect_event:Reset()
46bd1a8cd5 2024-02-13  顽雨沉风:       end
46bd1a8cd5 2024-02-13  顽雨沉风:     end
46bd1a8cd5 2024-02-13  顽雨沉风:   end
674765ddf2 2024-02-13  顽雨沉风:   str["效果"]:SetOperation(print_hand)
f56b114da9 2024-02-13  顽雨沉风:   u1:RegisterEffect(str["效果"])
46bd1a8cd5 2024-02-13  顽雨沉风: end
46bd1a8cd5 2024-02-13  顽雨沉风: fun["二_开局说明"] = function()
674765ddf2 2024-02-13  顽雨沉风:   str["这个残局的效果卡数量"] =
674765ddf2 2024-02-13  顽雨沉风:     Duel.GetMatchingGroupCount(fun["是否效果卡"], 0, str["所有区域"], str["所有区域"], nil)
674765ddf2 2024-02-13  顽雨沉风:   str["超量素材组"] = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
46bd1a8cd5 2024-02-13  顽雨沉风:   for k in aux.Next(str["超量素材组"]) do
46bd1a8cd5 2024-02-13  顽雨沉风:     if fun["一_是否效果卡"](k) then
674765ddf2 2024-02-13  顽雨沉风:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
46bd1a8cd5 2024-02-13  顽雨沉风:     end
46bd1a8cd5 2024-02-13  顽雨沉风:   end
674765ddf2 2024-02-13  顽雨沉风:   str["开局说明"] = str["这个残局的效果卡数量"] .. "卡 " .. str["规则"]
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["不洗牌"] == 0 then
46bd1a8cd5 2024-02-13  顽雨沉风:   else
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["无BP"] == 0 then
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "无BP "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["无AI"] == 0 then
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "无AI "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["开局添加手卡"] then
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "选" .. str["开局添加手卡的数量"] .. "卡 "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["禁格"] then
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "禁" .. str["禁格的数量"] .. "格 "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
46bd1a8cd5 2024-02-13  顽雨沉风:   if str["随机抽卡的数量"] then
674765ddf2 2024-02-13  顽雨沉风:     str["开局说明"] = str["开局说明"] .. "抽" .. str["随机抽卡的数量"] .. "卡 "
46bd1a8cd5 2024-02-13  顽雨沉风:   end
674765ddf2 2024-02-13  顽雨沉风:   Debug.ShowHint(str["开局说明"])
46bd1a8cd5 2024-02-13  顽雨沉风: end
1d67d9f6e3 2023-08-02  顽雨沉风: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
f56b114da9 2024-02-13  顽雨沉风: aux.BeginPuzzle = function(u1, u2)
674765ddf2 2024-02-13  顽雨沉风:   fun["aux.BeginPuzzle"]()
f56b114da9 2024-02-13  顽雨沉风:   if u1 then
f56b114da9 2024-02-13  顽雨沉风:     fun["一_开局添加手卡"](u1)
46bd1a8cd5 2024-02-13  顽雨沉风:   end
f56b114da9 2024-02-13  顽雨沉风:   if u2 then
f56b114da9 2024-02-13  顽雨沉风:     fun["一_禁格"](u2)
46bd1a8cd5 2024-02-13  顽雨沉风:   end
674765ddf2 2024-02-13  顽雨沉风:   fun["二_开局说明"]()
6bc844fccc 2024-02-13  顽雨沉风:   s["通关之邀"]()
46bd1a8cd5 2024-02-13  顽雨沉风: end
ba4bd27237 2023-08-02  顽雨沉风: --兼容层-------------------------------
1d67d9f6e3 2023-08-02  顽雨沉风: fun["印卡"] = fun["二_印卡"]
30619e5bbd 2023-08-02  顽雨沉风: fun["开局添加手卡"] = fun["一_开局添加手卡"]
30619e5bbd 2023-08-02  顽雨沉风: fun["是否效果卡"] = fun["一_是否效果卡"]
e61778909e 2023-08-02  顽雨沉风: fun["禁格"] = fun["一_禁格"]
30619e5bbd 2023-08-02  顽雨沉风: fun["随机抽卡"] = fun["一_随机抽卡"]