Commit be0d7e92 authored by DailyShana's avatar DailyShana

fix

parent 98bc7eac
......@@ -9,6 +9,7 @@ function c19162134.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(c19162134.spcon1)
......@@ -18,6 +19,7 @@ function c19162134.initial_effect(c)
e3:SetCondition(c19162134.spcon2)
e3:SetOperation(c19162134.drop2)
c:RegisterEffect(e3)
--
local e4=e2:Clone()
e4:SetCode(EVENT_BATTLED)
e4:SetCondition(c19162134.btcon1)
......@@ -26,6 +28,7 @@ function c19162134.initial_effect(c)
e5:SetCode(EVENT_BATTLED)
e5:SetCondition(c19162134.btcon2)
c:RegisterEffect(e5)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -41,14 +44,20 @@ function c19162134.initial_effect(c)
e7:SetCode(EVENT_CHAIN_SOLVING)
e7:SetCondition(c19162134.chcon2)
c:RegisterEffect(e7)
local e8=e2:Clone()
e8:SetCode(EVENT_CHAIN_SOLVED)
e8:SetCondition(c19162134.tosscon1)
--
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_TOSS_COIN)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetRange(LOCATION_FZONE)
e8:SetCode(EVENT_TOSS_COIN)
e8:SetOperation(c19162134.tossop)
c:RegisterEffect(e8)
local e9=e3:Clone()
e9:SetCode(EVENT_CHAIN_SOLVED)
e9:SetCondition(c19162134.tosscon2)
local e9=e8:Clone()
e9:SetCode(EVENT_TOSS_DICE)
e9:SetOperation(c19162134.diceop)
c:RegisterEffect(e9)
--
local ea=e2:Clone()
ea:SetCode(EVENT_DAMAGE)
ea:SetCondition(c19162134.damcon1)
......@@ -99,11 +108,53 @@ end
function c19162134.chcon2(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.GetCurrentChain()>=5 and e:GetHandler():GetFlagEffect(1)>0
end
function c19162134.tosscon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTossedCoinCount(tp)+Duel.GetTossedDiceCount(tp)>=5 and e:GetHandler():GetFlagEffect(1)>0
function c19162134.tossop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp then
for i=1,ev do
c:RegisterFlagEffect(19162135,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
else
for i=1,ev do
c:RegisterFlagEffect(19162136,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
if c:GetFlagEffect(19162135)>=5 and c:GetFlagEffect(19162137)==0 then
c19162134.drop1(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(19162137,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
if c:GetFlagEffect(19162136)>=5 and c:GetFlagEffect(19162138)==0 then
c19162134.drop2(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(19162138,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c19162134.tosscon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTossedCoinCount(1-tp)+Duel.GetTossedDiceCount(1-tp)>=5 and e:GetHandler():GetFlagEffect(1)>0
function c19162134.diceop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct1=bit.band(ev,0xffff)
local ct2=bit.rshift(ev,16)
if ep==tp then
for i=1,ct1 do
c:RegisterFlagEffect(19162135,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
for i=1,ct2 do
c:RegisterFlagEffect(19162136,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
else
for i=1,ct2 do
c:RegisterFlagEffect(19162135,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
for i=1,ct1 do
c:RegisterFlagEffect(19162136,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
if c:GetFlagEffect(19162135)>=5 and c:GetFlagEffect(19162137)==0 then
c19162134.drop1(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(19162137,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
if c:GetFlagEffect(19162136)>=5 and c:GetFlagEffect(19162138)==0 then
c19162134.drop2(e,tp,eg,ep,ev,re,r,rp)
c:RegisterFlagEffect(19162138,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
function c19162134.damcon1(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and Duel.GetLP(tp)<=500
......
......@@ -38,30 +38,29 @@ function c20007374.filter(c,e,tp)
return c:IsCode(44508094) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c20007374.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20007374.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20007374.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c20007374.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20007374.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if c:IsRelateToEffect(e) and tc and Duel.SpecialSummonStep(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c20007374.eqlimit)
c:RegisterEffect(e1)
if tc and Duel.SpecialSummonStep(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP) then
if c:IsRelateToEffect(e) then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--Add Equip limit
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c20007374.eqlimit)
c:RegisterEffect(e1)
end
tc:RegisterFlagEffect(20007374,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,fid)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -74,6 +73,7 @@ function c20007374.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetOperation(c20007374.rmop)
Duel.RegisterEffect(e2,tp)
Duel.SpecialSummonComplete()
tc:CompleteProcedure()
end
end
function c20007374.eqlimit(e,c)
......
......@@ -68,7 +68,6 @@ function c56673480.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c56673480.drop(e,tp,eg,ep,ev,re,r,rp)
if not eg then return end
local c=e:GetHandler()
local pg=e:GetLabelObject()
if c:GetFlagEffect(56673480)==0 then
......
......@@ -15,7 +15,7 @@ function c82768499.thfilter(c)
return c:IsSetCard(0x99) and c:GetLevel()==7 and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA)) and c:IsAbleToHand()
end
function c82768499.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chkc then return chkc:IsOnField() end
local b1=Duel.IsExistingMatchingCard(c82768499.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
local b2=Duel.IsExistingMatchingCard(c82768499.thfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil)
......@@ -36,11 +36,11 @@ function c82768499.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetOperation(c82768499.desop)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
else
e:SetCategory(CATEGORY_TOHAND)
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e:SetProperty(0)
local g=Duel.GetMatchingGroup(c82768499.thfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil)
e:SetOperation(c82768499.thop)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
end
function c82768499.desop(e,tp,eg,ep,ev,re,r,rp)
......
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