Skip to content

Commit

Permalink
Most Duel.GetLocationCountFromEx fixes in unofficial cards (#214)
Browse files Browse the repository at this point in the history
Most Duel.GetLocationCountFromEx fixes in unofficial cards
  • Loading branch information
larry126 authored Apr 27, 2020
1 parent 5130e01 commit f273350
Show file tree
Hide file tree
Showing 93 changed files with 608 additions and 530 deletions.
8 changes: 5 additions & 3 deletions unofficial/c100000186.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--スフィア・フィールド
--Sphere Field
local s,id=GetID()
function s.initial_effect(c)
--Activate
Expand Down Expand Up @@ -28,17 +29,18 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND,0,nil)
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_XYZ)
return #pg<=0 and Duel.GetLocationCountFromEx(tp)>0 and g:IsExists(s.lvfilter,1,nil,g)
return #pg<=0 and g:IsExists(s.lvfilter,1,nil,g)
and Duel.IsExistingMatchingCard(s.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.xyzfilter(c,e,tp)
return c:IsSetCard(0x48) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,false)
return c:IsSetCard(0x48) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,true,false)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local pg=aux.GetMustBeMaterialGroup(tp,Group.CreateGroup(),tp,nil,nil,REASON_XYZ)
if not e:GetHandler():IsRelateToEffect(e) or Duel.GetLocationCountFromEx(tp)<=0 or #pg>0 then return end
if not e:GetHandler():IsRelateToEffect(e) or #pg>0 then return end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_HAND,0,nil,e)
local sg=Duel.GetMatchingGroup(s.xyzfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if #sg>0 and g:IsExists(s.lvfilter,1,nil,g) then
Expand Down
11 changes: 6 additions & 5 deletions unofficial/c100000312.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--過去世
--Past Life
local s,id=GetID()
function s.initial_effect(c)
--Activate
Expand All @@ -15,11 +16,12 @@ end
function s.cfilter(c,e,tp)
local lv=c:GetLevel()
local atk=c:GetAttack()
return lv>0 and Duel.GetLocationCountFromEx(tp,tp,c)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,lv,atk,e,tp)
return lv>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,lv,atk,e,tp,c)
end
function s.spfilter(c,lv,atk,e,tp)
return c:IsLevel(lv) and c:GetAttack()==atk and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
function s.spfilter(c,lv,atk,e,tp,gc)
return c:IsLevel(lv) and c:GetAttack()==atk
and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and Duel.GetLocationCountFromEx(tp,tp,gc,c)>0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
Expand All @@ -40,7 +42,6 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local val=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local lv=val&0xff
local atk=val>>8
Expand Down
21 changes: 10 additions & 11 deletions unofficial/c100000365.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ function s.initial_effect(c)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
s.listed_names={43378048}
function s.spfilter(c,e,tp)
s.listed_names={43378048,6007213,32491822,69890967}
function s.spfilter(c,e,tp,sg)
return c:IsCode(43378048) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,sg,c)>0
end
function s.filter(c)
return c:IsCode(6007213,32491822,69890967) and c:IsAbleToRemove()
Expand All @@ -28,12 +29,12 @@ function s.fcheck(c,sg,g,code,...)
return res
else return true end
end
function s.fselect(c,tp,mg,sg,...)
function s.fselect(c,tp,mg,sg,e,...)
sg:AddCard(c)
local res=false
if #sg<3 then
res=mg:IsExists(s.fselect,1,sg,tp,mg,sg,...)
elseif Duel.GetLocationCountFromEx(tp,tp,sg)>0 then
res=mg:IsExists(s.fselect,1,sg,tp,mg,sg,e,...)
elseif Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,sg) then
local g=Group.CreateGroup()
res=sg:IsExists(s.fcheck,1,g,sg,g,...)
end
Expand All @@ -42,23 +43,21 @@ function s.fselect(c,tp,mg,sg,...)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil)
if chk==0 then return g:IsExists(s.fselect,1,nil,tp,g,Group.CreateGroup(),6007213,32491822,69890967)
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return g:IsExists(s.fselect,1,nil,tp,g,Group.CreateGroup(),e,6007213,32491822,69890967) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then return end
local mg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,nil)
local sg=Group.CreateGroup()
while #sg<3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=mg:FilterSelect(tp,s.fselect,1,1,sg,tp,mg,sg,6007213,32491822,69890967)
local g=mg:FilterSelect(tp,s.fselect,1,1,sg,tp,mg,sg,e,6007213,32491822,69890967)
if not g or #g<=0 then return false end
sg:Merge(g)
end
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>2 and Duel.GetLocationCountFromEx(tp)>0 then
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)>2 then
local sc=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,sg):GetFirst()
if sc then
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)
end
Expand Down
8 changes: 4 additions & 4 deletions unofficial/c100000530.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ function s.vfilter(c)
end
function s.sfilter(c,e,tp)
return c:GetCode()==44508094 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
if chk==0 then return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.GetMatchingGroup(s.vfilter,tp,LOCATION_GRAVE,0,nil):GetCount()>4 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCountFromEx(tp)<=0 then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.GetFirstMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if c:IsRelateToEffect(e) and Duel.SpecialSummonStep(tg,0,tp,tp,false,false,POS_FACEUP) then
if c:IsRelateToEffect(e) and tg and Duel.SpecialSummonStep(tg,0,tp,tp,false,false,POS_FACEUP) then
c:SetCardTarget(tg)
Duel.Equip(tp,c,tg)
local e1=Effect.CreateEffect(c)
Expand Down
1 change: 1 addition & 0 deletions unofficial/c100000571.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--磁力融合
--Magnet Fusion
local s,id=GetID()
function s.initial_effect(c)
--Activate
Expand Down
10 changes: 6 additions & 4 deletions unofficial/c100000581.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--ランクアップ・スパイダーウェブ
--Rank-Up Spider Web
local s,id=GetID()
function s.initial_effect(c)
--Activate
Expand Down Expand Up @@ -26,11 +27,12 @@ end
function s.filter1(c,e,tp)
local rk=c:GetRank()
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(c),tp,nil,nil,REASON_XYZ)
return #pg<=1 and rk>0 and c:IsFaceup() and c:CheckRemoveOverlayCard(tp,1,REASON_COST) and Duel.GetLocationCountFromEx(tp,tp,c)>0
return #pg<=1 and rk>0 and c:IsFaceup() and c:CheckRemoveOverlayCard(tp,1,REASON_COST)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,rk,e,tp,c,pg)
end
function s.filter2(c,rk,e,tp,mc,pg)
return (#pg<=0 or pg:IsContains(mc)) and c:IsRank(rk+1) and mc:IsCanBeXyzMaterial(c,tp)
return (#pg<=0 or pg:IsContains(mc)) and c:IsRank(rk+1)
and mc:IsCanBeXyzMaterial(c,tp) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
Expand All @@ -44,8 +46,8 @@ function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e)
or Duel.GetLocationCountFromEx(tp,tp,tc)<=0 then return end
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e)
or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
local pg=aux.GetMustBeMaterialGroup(tp,Group.FromCards(tc),tp,nil,nil,REASON_XYZ)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetRank(),e,tp,tc,pg)
Expand Down
15 changes: 8 additions & 7 deletions unofficial/c100100006.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--Sp-突然変異
--Speed Spell - Metamorphosis
local s,id=GetID()
function s.initial_effect(c)
--Activate
Expand All @@ -17,28 +18,28 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function s.cfilter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and Duel.GetLocationCountFromEx(tp,tp,c)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,lv,e,tp)
return lv>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,lv,e,tp,c)
end
function s.spfilter(c,lv,e,tp)
return c:IsType(TYPE_FUSION) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function s.spfilter(c,lv,e,tp,mc)
return c:IsType(TYPE_FUSION) and c:IsLevel(lv)
and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return tc and tc:IsCanRemoveCounter(tp,0x91,8,REASON_COST) and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,e,tp)
return Duel.IsCanRemoveCounter(tp,1,0,0x91,8,REASON_COST) and Duel.CheckReleaseGroupCost(tp,s.cfilter,1,false,nil,nil,e,tp)
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
tc:RemoveCounter(tp,0x91,8,REASON_COST)
Duel.RemoveCounter(tp,1,0,0x91,8,REASON_COST)
local rg=Duel.SelectReleaseGroupCost(tp,s.cfilter,1,1,false,nil,nil,e,tp)
local lv=rg:GetFirst():GetLevel()
Duel.Release(rg,REASON_COST)
Duel.SetTargetParam(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,lv,e,tp)
Expand Down
44 changes: 28 additions & 16 deletions unofficial/c100100030.lua
Original file line number Diff line number Diff line change
@@ -1,58 +1,70 @@
--Sp-簡易融合
--Speed Spell - Instant Fusion
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.con)
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return tc and tc:GetCounter(0x91)>=3
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCounter(tp,1,0,0x91)>=3
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.CheckLPCost(tp,1000) end
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.filter(c,e,tp)
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(5)
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(5) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
if not tc then return end
tc:SetMaterial(nil)
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
tc:CompleteProcedure()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetLabelObject(tc)
e2:SetCondition(s.descon)
e2:SetOperation(s.desop)
tc:RegisterEffect(e2)
tc:CompleteProcedure()
Duel.RegisterEffect(e2,tp)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(id)~=0 then
return true
else
e:Reset()
return false
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
16 changes: 7 additions & 9 deletions unofficial/c100100525.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
--Sp-シンクロパニック
--Speed Spell - Synchro Panic
local s,id=GetID()
function s.initial_effect(c)
--activate
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(s.con)
e2:SetCondition(s.condition)
e2:SetTarget(s.tg)
e2:SetOperation(s.op)
c:RegisterEffect(e2)
Expand All @@ -28,21 +29,19 @@ function s.checkop(e,tp,eg,ep,ev,re,r,rp)
tc=eg:GetNext()
end
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
return tc and tc:GetCounter(0x91)>6
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCounter(tp,1,0,0x91)>=3
end
function s.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetFlagEffect(id)~=0
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:GetFlagEffect(id)~=0
end
function s.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCountFromEx(tp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_SYNCHRO)
if ft<=0 then return end
local gate=Duel.GetMetatable(CARD_SUMMON_GATE)
local ect=gate and Duel.IsPlayerAffectedByEffect(tp,CARD_SUMMON_GATE) and gate[tp]
Expand All @@ -51,7 +50,6 @@ function s.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,ft,ft,nil,e,tp)
if #g>0 then
local tc=g:GetFirst()
for tc in aux.Next(g) do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
Expand Down
7 changes: 4 additions & 3 deletions unofficial/c110000099.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--呪縛牢
--Cursed Prison
local s,id=GetID()
function s.initial_effect(c)
Expand Down Expand Up @@ -27,15 +28,15 @@ function s.initial_effect(c)
end
function s.filter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCountFromEx(tp)<=0 then return end
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
Expand Down
Loading

0 comments on commit f273350

Please sign in to comment.