Commit 0d24659b authored by JoyJ's avatar JoyJ

delete conflict items

parent 1f4dc25d
--村规决斗:打开盲盒
--开局时,双方将1张吓人手中盒(51697825)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--1回合1次,自己主要阶段才能处理这个效果。盲选对方卡组的1张卡加入手卡。
--这个回合的结束阶段,那张卡仍在自己手卡的场合,自己受到2000点伤害。
--这个效果不会无效化,不受【不能加入手卡】的效果影响。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,51697825)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetCurrentChain()<1
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_DECK,1,1,nil)
if #g<1 then return end
local tc = g:GetFirst()
Duel.SendtoHand(tc,tp,REASON_RULE)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(CUNGUI.damcon)
e2:SetOperation(CUNGUI.damop)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(tc)
e2:SetLabel(tc:GetFieldID())
Duel.RegisterEffect(e2,tp)
end
function CUNGUI.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():IsLocation(LOCATION_HAND) and e:GetLabelObject():GetFieldID() == e:GetLabel()
end
function CUNGUI.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,2000,REASON_EFFECT)
end
--村规决斗:形态变化
--【三形金字塔】卡不在任何场地区域表侧表示存在的场合,
--那个场地区域的控制者从卡组外选1张【三形金字塔】场地,表侧放置到场地区域。
--三型金字塔场地效果修改:
--三形金字塔·大要塞
--①:自己场上怪兽的守备力上升500。
--②:自己场上的怪兽不会被效果破坏。
--③:场地区域的表侧表示的这张卡被送去墓地的场合,以自己墓地1张卡为对象才能发动。那只怪兽加入手卡。
--三形金字塔·巡航机
--①:只要这张卡在场地区域存在,每次怪兽召唤·特殊召唤,自己回复500基本分。
--②:场上有怪兽召唤的场合才能发动。自己从卡组抽1张,那之后选1张手卡丢弃。
--③:场地区域的表侧表示的这张卡被送去墓地的场合才能发动。从卡组把1张卡加入手卡。
--三形金字塔·巨人王
--①:自己场上怪兽的攻击力上升2000。
--②:自己的怪兽进行战斗的场合,直到伤害步骤结束时对方不能把魔法·陷阱·怪兽的效果发动。
--③:场地区域的表侧表示的这张卡被送去墓地的场合才能发动。从手卡把1只怪兽特殊召唤。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
e1=e1:Clone()
Duel.RegisterEffect(e1,1)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(CUNGUI.setlimit)
Duel.RegisterEffect(e2,0)
--cannot activate
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(CUNGUI.filter)
Duel.RegisterEffect(e3,0)
end
function CUNGUI.setlimit(e,c,tp)
return c:IsType(TYPE_FIELD)
end
function CUNGUI.filter(e,re,tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function CUNGUI.AdjustFilter(c)
return c:IsCode(9989792,45383307,72772445) and c:IsFaceup()
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()>0 then return end
if Duel.GetMatchingGroupCount(CUNGUI.AdjustFilter,tp,LOCATION_FZONE,0,nil)<1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local code=Duel.AnnounceCard(tp,9989792,OPCODE_ISCODE,45383307,OPCODE_ISCODE,OPCODE_OR,72772445,OPCODE_ISCODE,OPCODE_OR)
local tc=Duel.CreateToken(tp,code)
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
end
--村规决斗:止战之殇
--所有怪兽得到以下效果:
--这个效果不会被无效化。这张卡不会被战斗破坏,攻击守备表示怪兽时,超出的部分给予战斗伤害。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsType,0,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA+LOCATION_MZONE,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA+LOCATION_MZONE,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
--battle indestructable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
c:RegisterEffect(e4)
end
--村规决斗:等价交换
--所有卡得到以下效果:
--这个类型的效果1回合只能使用最多(回合数-1)次。
--把这张卡从手卡返回卡组,支付25%的基本分才能发动。从卡组选1张卡加入手卡。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(nil,0,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3431737,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(CUNGUI.cost)
e1:SetTarget(CUNGUI.target)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
end
CUNGUI.LastUsedTurn = {}
CUNGUI.LastUsedNum = {}
CUNGUI.LastUsedTurn[0] = 0
CUNGUI.LastUsedTurn[1] = 0
CUNGUI.LastUsedNum[0] = 0
CUNGUI.LastUsedNum[1] = 0
function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local now=Duel.GetTurnCount()
if chk==0 then return c:IsAbleToDeckAsCost() end
Duel.SendtoDeck(c, nil, 2, REASON_COST)
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/4))
end
function CUNGUI.filter(c)
return c:IsAbleToHand()
end
function CUNGUI.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local now=Duel.GetTurnCount()-1
if chk==0 then return
Duel.IsExistingMatchingCard(CUNGUI.filter,tp,LOCATION_DECK,0,1,nil)
and (now>CUNGUI.LastUsedTurn[tp] or CUNGUI.LastUsedNum[tp]<CUNGUI.LastUsedTurn[tp]-1) end
local now=Duel.GetTurnCount()
if CUNGUI.LastUsedTurn[tp] ~= now then
CUNGUI.LastUsedTurn[tp]=now
CUNGUI.LastUsedNum[tp]=0
end
CUNGUI.LastUsedNum[tp] = CUNGUI.LastUsedNum[tp] + 1
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,CUNGUI.filter,tp,LOCATION_DECK,0,1,1,nil)
if tc then
if Duel.SendtoHand(tc,nil,REASON_EFFECT) > 0 then
Duel.ConfirmCards(1-tp,tc)
end
end
end
--村规决斗:收支平衡
--开局时,双方将1张【霰弹式洗牌】(12183332)从卡组外除外。这张卡不在除外状态的场合立刻除外。
--这张【霰弹式洗牌】得到以下效果:
--在自己的回合,场面每次因这张卡以外的原因发生变化,依次进行如下动作:
--如果自己的卡组数量比墓地数量多,从卡组随机将1张卡送去墓地。
--如果自己的墓地数量比卡组数量多,从墓地随机将1张卡返回卡组。
CUNGUI = {}
CUNGUI.disabled={}
CUNGUI.RuleCards=Group.CreateGroup()
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
--adjust
e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation2)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
if (CUNGUI.RuleCards:Filter(Card.IsLocation,nil,LOCATION_REMOVED):GetCount()~=2) then
Duel.Remove(CUNGUI.RuleCards,POS_FACEUP,REASON_RULE)
end
end
function CUNGUI.RegisterRuleEffect(c)
--return
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST)
e2:SetCondition(CUNGUI.condition)
e2:SetOperation(CUNGUI.operation)
Duel.RegisterEffect(e2,c:GetControler())
end
function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()==tp) then return false end
if CUNGUI.disabled[tp] then
CUNGUI.disabled[tp]=false
return false
end
return true
end
function CUNGUI.filter(c)
return CUNGUI.RuleCards:IsContains(c)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local g2=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0)
local g3=nil
if #g1>#g2 then
g3=g1:RandomSelect(tp,1)
Duel.SendtoGrave(g3,REASON_EFFECT)
end
g1=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0)
g2=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if #g1>#g2 then
g3=g1:RandomSelect(tp,1)
Duel.SendtoDeck(g3,nil,2,REASON_EFFECT)
end
CUNGUI.disabled[tp]=true
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local card1 = Duel.CreateToken(0,12183332)
local card2 = Duel.CreateToken(1,12183332)
CUNGUI.RegisterRuleEffect(card1)
CUNGUI.RegisterRuleEffect(card2)
CUNGUI.RuleCards:AddCard(card1)
CUNGUI.RuleCards:AddCard(card2)
Duel.Remove(card1,POS_FACEUP,REASON_RULE)
Duel.Remove(card2,POS_FACEUP,REASON_RULE)
e:Reset()
end
\ No newline at end of file
--村规决斗:孪生兄弟
--所有额外卡组的卡(开始游戏后送去额外的灵摆卡不算)得到以下效果:
--这张卡特殊召唤成功的场合发动。
--将1张这张卡原本卡名的同名卡从卡组外加入额外卡组,
--将这场决斗中上次用于这张卡特殊召唤的一组素材无视召唤条件从任何区域特殊召唤到场上。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
CUNGUI.Used={}
CUNGUI.Used[0]={}
CUNGUI.Used[1]={}
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
CUNGUI.Used[0]={}
CUNGUI.Used[1]={}
local g = Duel.GetMatchingGroup(nil,0,LOCATION_EXTRA,LOCATION_EXTRA,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
if c:IsFaceup() then return end
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(66666004,4))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(CUNGUI.distg2)
e2:SetOperation(CUNGUI.disop2)
c:RegisterEffect(e2)
end
function CUNGUI.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function CUNGUI.distg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return not CUNGUI.Used[tp][e:GetHandler():GetOriginalCode()] end
if not g then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,0)
else
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,#g,tp,0)
end
end
function CUNGUI.disop2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetMaterial()
local code = e:GetHandler():GetOriginalCode()
if not g or #g==0 then return end
CUNGUI.Used[tp][code]=true
local tc=Duel.CreateToken(tp,code)
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
\ No newline at end of file
--村规决斗:魔术大师
--所有卡得到以下效果:
--支付500点基本分才能发动。查看自己卡组最上方的卡。
--那之后,可以将那张卡加入手卡,或洗切自己的卡组。
--加入手卡的场合,自己这回合不能再发动此类效果。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsType,0,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(51351302,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(CUNGUI.cond)
e1:SetCost(CUNGUI.cost)
e1:SetTarget(CUNGUI.target)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
end
CUNGUI.Used={}
CUNGUI.Used[0]=0
CUNGUI.Used[1]=0
function CUNGUI.cond(e,tp)
return CUNGUI.Used[tp]<Duel.GetTurnCount()
end
function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function CUNGUI.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,1)
if g:GetCount()~=0 then
Duel.ConfirmCards(tp,g)
if Duel.SelectYesNo(tp,aux.Stringid(123709,2)) then
CUNGUI.Used[tp] = Duel.GetTurnCount()
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
Duel.ShuffleDeck(tp)
end
end
--村规决斗:岁月如梭
--开局时,双方将1张【所罗门的律法书】(23471572)从卡组外除外。这张卡不在除外状态的场合立刻除外。
--这张【所罗门的律法书】得到以下效果:
--每个对方的结束阶段发动。掷1个骰子。
--1:跳过自己的下个抽卡阶段。
--2:跳过自己的下个准备阶段。
--3:跳过自己的下个主要阶段1。
--4:跳过自己的下个主要阶段2。
--5:跳过自己的下个战斗阶段。
--6:跳过自己的下个回合。
--这个效果从T2开始发动和处理。
--细则:投掷到6的场合,会因为未经过结束阶段而跳过1次投掷。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RuleCards=Group.CreateGroup()
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
if (CUNGUI.RuleCards:Filter(Card.IsLocation,nil,LOCATION_REMOVED):GetCount()~=2) then
Duel.Remove(CUNGUI.RuleCards,POS_FACEUP,REASON_RULE)
end
end
function CUNGUI.RegisterRuleEffect(c)
--skip phase
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(66666004,4))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_REMOVED)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(CUNGUI.condition)
e2:SetOperation(CUNGUI.operation)
c:RegisterEffect(e2)
end
function CUNGUI.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()>1 and Duel.GetTurnPlayer()~=tp
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp)
local dice=Duel.TossDice(tp,1)
local code=EFFECT_SKIP_DP
if dice==2 then code=EFFECT_SKIP_SP end
if dice==3 then code=EFFECT_SKIP_M1 end
if dice==4 then code=EFFECT_SKIP_BP end
if dice==5 then code=EFFECT_SKIP_M2 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(code)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END,2)
if dice==6 then
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e1:SetTargetRange(0,1)
Duel.RegisterEffect(e1,1-tp)
else
Duel.RegisterEffect(e1,tp)
end
end
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
if not CUNGUI.INIT then
CUNGUI.INIT = true
local card1 = Duel.CreateToken(0,23471572)
local card2 = Duel.CreateToken(1,23471572)
CUNGUI.RegisterRuleEffect(card1)
CUNGUI.RegisterRuleEffect(card2)
CUNGUI.RuleCards:AddCard(card1)
CUNGUI.RuleCards:AddCard(card2)
Duel.Remove(card1,POS_FACEUP,REASON_RULE)
Duel.Remove(card2,POS_FACEUP,REASON_RULE)
end
--return
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EVENT_ADJUST)
e2:SetOperation(CUNGUI.AdjustOperation2)
Duel.RegisterEffect(e2,0)
e:Reset()
end
\ No newline at end of file
--村规决斗:幻神之战
--开局时,双方将1张缚神冢(269012)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--自己结束阶段发动。从卡组外将1张随机5星通常怪兽在自己场上表侧表示放置。
--如果放置的卡是狮子男巫(4392470) 海马兽(47922711) 莫林芬(55784832)
--再给予对方4000点伤害。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
Duel.LoadScript("random.lua")
math.randomseed(_G.RANDOMSEED)
for i=1,10 do math.random(1000) end
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,269012)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
CUNGUI.cards={2971090,4035199,4179849,4392470,7562372,10538007,11250655,11714098,12146024,14977074,15023985,16972957,17192817,18246479,19474136,19737320,20624263,26378150,28279543,28546905,29172562,29402771,29616941,30090452,31477025,32012841,32012842,32344688,33178416,33621868,33878931,34690519,35322812,35565537,36904469,38116136,40155554,42418084,42599677,43785278,43793530,44865098,47319141,47922711,48202661,48365709,48766543,49587396,50176820,50407691,51194046,51228280,52584282,54615781,55291359,55784832,55998462,62762898,65518099,66989694,67273917,67284908,67494157,68182934,68339286,69455834,69893315,70345785,73051941,73081602,73911410,74637266,75622825,75850803,76634149,77998771,78060096,78780140,80141480,81386177,81686058,82818645,85326399,85771020,86088138,87511987,90876561,96981563,97612389,98795934}
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
local code=math.random(#CUNGUI.cards)
local c=Duel.CreateToken(tp,CUNGUI.cards[code])
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true) and (code==4392470 or code==47922711 or code==55784832) then
Duel.BreakEffect()
Duel.Damage(1-tp,4000,REASON_EFFECT)
end
end
--村规决斗:战争和平
--开局时,双方将1张灰篮撞击(2759860)从卡组外表侧表示除外。
--这场决斗中这张卡不是表侧表示除外的场合,这张卡表侧表示除外。
--这张卡得到以下效果。
--这张卡的①②效果1回合只能有1次使用其中任意1个。
--①:1回合1次,自己主要阶段才能处理这个效果。选自己场上和对方场上1张卡破坏。
--②:1回合1次,自己结束阶段才能处理这个效果。从卡组选1张卡加入手卡。
--这些效果的处理不会被无效,且不受【不能加入手卡】类效果的影响。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterCardRule(0)
CUNGUI.RegisterCardRule(1)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and (not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[1]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
function CUNGUI.RegisterCardRule(tp)
local c=Duel.CreateToken(tp,3285551)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(66666004,4))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,66666666)
e1:SetProperty(EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetCondition(CUNGUI.rulecond)
e1:SetOperation(CUNGUI.ruleop)
c:RegisterEffect(e1)
end
function CUNGUI.rulecond(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()<1 and
(((Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)*Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)>0)
or (Duel.GetCurrentPhase()==PHASE_END and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0))
end
function CUNGUI.ruleop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentPhase()==PHASE_END then
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_RULE)
else
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
local g2=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
g:Merge(g2)
Duel.Destroy(g,REASON_EFFECT)
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment