Commit 938b42a9 authored by Nemo Ma's avatar Nemo Ma

fix

parent 89e03d53
--pearl of dragon palace
local m=11451423
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -67,7 +66,7 @@ function cm.filter2(c)
return not c:IsType(TYPE_MONSTER) or not c:IsType(TYPE_RITUAL)
end
function cm.filter3(c)
return c:IsFaceup() and bit.band(c:GetType(),0x81)==0x81 and c:IsSetCard(0x6978) and c:IsSummonType(SUMMON_TYPE_RITUAL) and c:GetMaterialCount()>0 and c:GetFlagEffect(m)>0
return c:IsFaceup() and bit.band(c:GetType(),0x81)==0x81 and c:IsSetCard(0x6978) and c:IsSummonType(SUMMON_TYPE_RITUAL) --and c:GetMaterialCount()>0 and c:GetFlagEffect(m)>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
......
......@@ -127,7 +127,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_MOVE)
e4:SetLabelObject(e3)
e4:SetOperation(cm.resop)
e4:SetOperation(cm.resop2)
tc:RegisterEffect(e4,true)
tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
......@@ -322,28 +322,42 @@ end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
e:GetHandler():RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVED)
e2:SetLabel(ev)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetLabelObject(e1)
e2:SetCondition(cm.rescon)
e2:SetOperation(cm.resop)
e2:SetOperation(cm.disop5)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EVENT_CHAIN_NEGATED)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetLabelObject(e2)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e3,tp)
Duel.AdjustInstantly()
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetLabel(ev)
e4:SetLabelObject(e3)
e4:SetCondition(cm.rescon)
e4:SetOperation(cm.resop)
e4:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e5,tp)
end
function cm.rescon(e,tp,eg,ep,ev,re,r,rp)
return ev==e:GetLabel()
end
function cm.resop(e,tp,eg,ep,ev,re,r,rp)
function cm.resop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsLocation(LOCATION_SZONE) then return end
local te=e:GetLabelObject()
if te~=nil and aux.GetValueType(te)=="Effect" then
......@@ -352,4 +366,23 @@ function cm.resop(e,tp,eg,ep,ev,re,r,rp)
te:Reset()
end
e:Reset()
end
function cm.resop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if te~=nil and aux.GetValueType(te)=="Effect" then
local te2=te:GetLabelObject()
if te2~=nil and aux.GetValueType(te2)=="Effect" then
local te3=te2:GetLabelObject()
if te3~=nil and aux.GetValueType(te3)=="Effect" then te3:Reset() end
te2:Reset()
end
te:Reset()
end
e:Reset()
end
function cm.disop5(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if bit.band(loc,LOCATION_ONFIELD)~=0 then
Duel.NegateEffect(ev)
end
end
\ No newline at end of file
--魔人★双子相杀
local m=11451484
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SPSUMMON_COUNT)
--Activate
......@@ -26,16 +25,16 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
end
function cm.chkfilter1(c,e,tp)
return c:IsSetCard(0x151) and c:IsType(TYPE_MONSTER) and not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,c) and Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
return c:IsSetCard(0x97b) and c:IsType(TYPE_MONSTER) and not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,c) and Duel.IsExistingMatchingCard(cm.chkfilter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
end
function cm.chkfilter2(c,e,tp,att)
return c:IsSetCard(0x151) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(att) and not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,1-tp,c)
return c:IsSetCard(0x97b) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(att) and not c:IsHasEffect(EFFECT_REVIVE_LIMIT) and Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,1-tp,c)
end
function cm.filter1(c,e,tp)
return c:IsSetCard(0x151) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
return c:IsSetCard(0x97b) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetAttribute())
end
function cm.filter2(c,e,tp,att)
return c:IsSetCard(0x151) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,1-tp)
return c:IsSetCard(0x97b) and c:IsType(TYPE_MONSTER) and not c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK,1-tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local sp=Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)
......
--幽玄龙象※坎寄沧波
--21.09.21
local m=11451616
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
......@@ -159,7 +158,7 @@ function cm.fsop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(mat1,POS_FACEUP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
if tc:IsType(TYPE_MONSTER) then
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SSet(tp,tc)
......
......@@ -33,7 +33,7 @@ function cm.initial_effect(c)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetRange(LOCATION_SZONE)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetCode(EVENT_CHAIN_SOLVING)
e5:SetOperation(cm.desop2)
e5:SetLabelObject(e3)
c:RegisterEffect(e5)
......@@ -205,9 +205,16 @@ function cm.desop2(e,tp,eg,ep,ev,re,r,rp)
if re==e:GetLabelObject():GetLabelObject() and c:GetFlagEffect(m)>0 then
if Duel.GetCurrentPhase()==PHASE_DAMAGE and not Duel.IsDamageCalculated() then
e:GetLabelObject():SetLabel(1)
elseif e:GetCode()==EVENT_CHAIN_SOLVING then
e:GetLabelObject():SetLabel(1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetLabelObject(e:GetLabelObject())
e5:SetOperation(cm.desop3)
Duel.RegisterEffect(e5,tp)
else
if c:IsHasEffect(EFFECT_DISABLE) then return end
if not c:IsDisabled() then cm.spop(e,tp,eg,ep,ev,re,r,rp) end
cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
......@@ -215,7 +222,6 @@ function cm.desop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local des=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(0)
if c:IsHasEffect(EFFECT_DISABLE) then return end
if des==1 and not c:IsDisabled() then
cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
......
......@@ -28,7 +28,7 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ct=Duel.GetMatchingGroupCount(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() end
if chkc then return chkc:IsOnField() and chkc~=c end
if chk==0 then return ct>0 and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,c) end
Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,ct,ct,c)
Duel.RegisterFlagEffect(0,11451760,RESET_CHAIN,0,1)
......
......@@ -33,9 +33,9 @@ function cm.initial_effect(c)
--act limit & def position
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetTarget(cm.actg)
c:RegisterEffect(e3)
local e4=e3:Clone()
......@@ -82,6 +82,9 @@ end
function cm.c2filter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsPreviousLocation(LOCATION_EXTRA)
end
function cm.c3filter(c)
return c:IsFaceup() and not c:IsAttack(c:GetBaseAttack())
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(cm.atkfilter,tp,0,LOCATION_MZONE,nil)
......@@ -94,19 +97,19 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc1:RegisterEffect(e1)
tc1=g1:GetNext()
if Duel.IsExistingMatchingCard(cm.c2filter,tp,0,LOCATION_MZONE,1,nil) then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc2=g2:GetFirst()
local atk=0
while tc2 do
local batk=tc2:GetBaseAttack()
local catk=tc2:GetAttack()
atk=math.abs(catk-batk)+atk
tc2=g2:GetNext()
end
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
if Duel.IsExistingMatchingCard(cm.c2filter,tp,0,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.c3filter,tp,0,LOCATION_MZONE,1,nil) then
Duel.BreakEffect()
local g2=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc2=g2:GetFirst()
local atk=0
while tc2 do
local batk=tc2:GetBaseAttack()
local catk=tc2:GetAttack()
atk=math.abs(catk-batk)+atk
tc2=g2:GetNext()
end
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
function cm.actg(e,c)
......
......@@ -85,7 +85,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.fusop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,2))
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_FUSION_MATERIAL)
e1:SetTargetRange(LOCATION_DECK,LOCATION_MZONE)
......
......@@ -16,6 +16,7 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activate)
c:RegisterEffect(e2)
......
......@@ -6,7 +6,7 @@ function c9910419.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,9910419)
e2:SetTarget(c9910419.thtg)
e2:SetOperation(c9910419.thop)
......
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