Commit 4d3341fd authored by VanillaSalt's avatar VanillaSalt

fix script

parent 5431ae83
......@@ -1734,7 +1734,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
if(tp == infos.turn_player) {
for(auto tpit = core.tpchain.begin(); tpit != core.tpchain.end(); ++tpit) {
if(!(clit->triggering_effect->flag & EFFECT_FLAG_MULTIACT_HAND)) {
if(tpit->triggering_location == LOCATION_HAND) {
if(clit->triggering_location == LOCATION_HAND) {
if(tpit->triggering_location == LOCATION_HAND || tpit->triggering_effect->handler->data.code == clit->triggering_effect->handler->data.code) {
act = false;
break;
......@@ -1755,7 +1755,7 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
} else {
for(auto ntpit = core.ntpchain.begin(); ntpit != core.ntpchain.end(); ++ntpit) {
if(!(clit->triggering_effect->flag & EFFECT_FLAG_MULTIACT_HAND)) {
if(ntpit->triggering_location == LOCATION_HAND) {
if(clit->triggering_location == LOCATION_HAND) {
if(ntpit->triggering_location == LOCATION_HAND || ntpit->triggering_effect->handler->data.code == clit->triggering_effect->handler->data.code) {
act = false;
break;
......
......@@ -66,7 +66,7 @@ function c102380.spcop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_PHASE+RESET_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e2,tp)
end
......@@ -15,13 +15,16 @@ end
function c10925955.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c10925955.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c10925955.filter(c)
return c:IsFacedown() and c:GetSequence()~=5
end
function c10925955.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1
or Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
or Duel.IsExistingMatchingCard(c10925955.filter,tp,0,LOCATION_SZONE,1,nil) end
local sel=0
local ac=0
if Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) then sel=sel+1 end
if Duel.IsExistingMatchingCard(c10925955.filter,tp,0,LOCATION_SZONE,1,nil) then sel=sel+1 end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>1 then sel=sel+2 end
if sel==1 then
ac=Duel.SelectOption(tp,aux.Stringid(10925955,0))
......@@ -37,7 +40,7 @@ end
function c10925955.activate(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel()
if ac==0 or ac==2 then
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil)
local g=Duel.GetMatchingGroup(c10925955.filter,tp,0,LOCATION_SZONE,nil)
Duel.ConfirmCards(tp,g)
end
if ac==1 or ac==2 then
......
......@@ -9,9 +9,12 @@ function c11136371.initial_effect(c)
e1:SetOperation(c11136371.plop)
c:RegisterEffect(e1)
end
function c11136371.plfilter(c)
return c:GetSequence()~=5 and c:IsAbleToGraveAsCost()
end
function c11136371.plcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_SZONE,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGraveAsCost,tp,LOCATION_SZONE,0,e:GetHandler())
if chk==0 then return Duel.IsExistingMatchingCard(c11136371.plfilter,tp,LOCATION_SZONE,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(c11136371.plfilter,tp,LOCATION_SZONE,0,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c11136371.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -31,7 +31,7 @@ end
function c12174035.eqlimit(e,c)
return c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_WATER)
end
function c12174035.filter(c,tp)
function c12174035.filter(c)
return c:IsFaceup() and c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_WATER)
end
function c12174035.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -14,7 +14,7 @@ end
function c12624008.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c12624008.filter(c,e,tp)
function c12624008.filter(c)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_LIGHT)) and c:IsDestructable()
end
function c12624008.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -14,7 +14,7 @@ end
function c13846680.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c13846680.filter(c,e,tp)
function c13846680.filter(c)
return (c:IsFacedown() or c:IsAttribute(0xff-ATTRIBUTE_FIRE)) and c:IsDestructable()
end
function c13846680.target(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -22,8 +22,8 @@ function c14472500.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c14472500.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c14472500.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c14472500.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -4,23 +4,22 @@ function c15150365.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15150365,0))
e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c15150365.condition)
e1:SetTarget(c15150365.target)
e1:SetOperation(c15150365.operation)
c:RegisterEffect(e1)
end
function c15150365.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler()
return ep~=tp
end
function c15150365.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c15150365.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0,nil)
local g=Duel.GetFieldGroup(ep,LOCATION_HAND,0)
local sg=g:RandomSelect(ep,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
......@@ -17,11 +17,11 @@ function c15313433.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c15313433.filter(c,e,tp)
return c:IsSetCard(0xb) and c:GetPreviousControler()==tp
return c:IsSetCard(0xb) and c:IsLocation(LOCATION_GRAVE) and c:GetPreviousControler()==tp
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c15313433.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return eg:IsContains(chkc) end
if chkc then return eg:IsContains(chkc) and c15313433.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and eg:IsExists(c15313433.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=eg:FilterSelect(tp,c15313433.filter,1,1,nil,e,tp)
......@@ -30,8 +30,7 @@ function c15313433.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,1-tp,1000)
end
function c15313433.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
......
......@@ -36,6 +36,7 @@ function c15893860.operation(e,tp,eg,ep,ev,re,r,rp)
end
if ct>=3 and Duel.SelectYesNo(tp,aux.Stringid(15893860,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
......
......@@ -41,7 +41,7 @@ function c1644289.tglimit(e,re)
local rc=re:GetOwner()
return e:GetHandler():GetControler()~=rc:GetControler() and rc:IsType(TYPE_TRAP+TYPE_MONSTER)
end
function c1644289.filter(c,tp)
function c1644289.filter(c)
return c:IsFaceup() and c:IsSetCard(0x30)
end
function c1644289.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -40,7 +40,7 @@ end
function c16550875.eqlimit(e,c)
return c:IsSetCard(0x56)
end
function c16550875.filter(c,tp)
function c16550875.filter(c)
return c:IsFaceup() and c:IsSetCard(0x56)
end
function c16550875.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -15,7 +15,8 @@ end
function c16678947.condition(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=eg:GetFirst()
local bc=tc:GetBattleTarget()
return tc:GetPreviousControler()==tp and tc:IsRace(RACE_PSYCHO) and bit.band(tc:GetBattlePosition(),POS_FACEUP)~=0
return tc:GetPreviousControler()==tp and tc:IsLocation(LOCATION_GRAVE) and tc:IsRace(RACE_PSYCHO)
and bit.band(tc:GetBattlePosition(),POS_FACEUP)~=0
and bc:IsRelateToBattle() and bc:IsControler(1-tp) and bc==Duel.GetAttacker()
end
function c16678947.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -31,7 +31,7 @@ end
function c18060565.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local eq=Duel.SelectMatchingCard(tp,c18060565.eqfilter,tp,LOCATION_DECK,0,1,1,nil)
local eqc=eq:GetFirst()
......
......@@ -21,7 +21,7 @@ function c1896112.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(g,nil,0,REASON_COST)
end
function c1896112.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1896112.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......
......@@ -34,7 +34,7 @@ end
function c20457551.eqlimit(e,c)
return c:IsSetCard(0x1d)
end
function c20457551.filter(c,tp)
function c20457551.filter(c)
return c:IsFaceup() and c:IsSetCard(0x1d)
end
function c20457551.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -16,7 +16,7 @@ function c21507589.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c21507589.filter(c)
return c:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT) and c:IsAbleToHand()
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT) and c:IsAbleToHand()
end
function c21507589.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c21507589.filter(chkc) end
......
......@@ -30,7 +30,7 @@ function c21702241.initial_effect(c)
end
function c21702241.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAIINING)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
......
......@@ -37,7 +37,7 @@ function c22339232.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c22339232.tgfilter(c)
local code=c:GetCode()
return code==32274490 or code==22339232
return c:IsFaceup() and (code==32274490 or code==22339232)
end
function c22339232.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c22339232.tgfilter(chkc) end
......@@ -54,7 +54,7 @@ function c22339232.tgop(e,tp,eg,ep,ev,re,r,rp)
end
function c22339232.spfilter(c,e,tp)
local code=c:GetCode()
return (code==36021814 or code==40991587) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and (code==36021814 or code==40991587) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22339232.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c22339232.spfilter(chkc,e,tp) end
......
......@@ -31,7 +31,7 @@ function c22842214.initial_effect(c)
c:RegisterEffect(e3)
end
function c22842214.filter(c)
return c:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_AQUA+RACE_SEASERPENT)
end
function c22842214.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c22842214.filter(chkc) end
......@@ -70,6 +70,7 @@ function c22842214.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c22842214.eqfilter,tp,LOCATION_SZONE,0,1,nil,c) end
if Duel.SelectYesNo(tp,aux.Stringid(22842214,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local tc=Duel.SelectMatchingCard(tp,c22842214.eqfilter,tp,LOCATION_SZONE,0,1,1,nil,c):GetFirst()
e:SetLabelObject(tc)
return true
......
......@@ -18,7 +18,7 @@ function c23327298.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c23327298.cfilter,1,nil,tp)
end
function c23327298.filter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToHand()
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c23327298.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c23327298.filter(chkc) end
......
......@@ -11,7 +11,7 @@ function c23557835.initial_effect(c)
c:RegisterEffect(e1)
end
function c23557835.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c23557835.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
......
......@@ -16,7 +16,7 @@ function c2362787.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,800)
end
function c2362787.filter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function c2362787.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c2362787.filter(chkc) end
......
......@@ -12,17 +12,18 @@ function c25173686.initial_effect(c)
c:RegisterEffect(e1)
end
function c25173686.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)==5 and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)==nil
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)
return ct==6 or (ct==5 and Duel.GetFieldCard(1-tp,LOCATION_SZONE,5)==nil)
end
function c25173686.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
return c:GetSequence()~=5 and c:IsDestructable()
end
function c25173686.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25173686.filter,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c25173686.filter,tp,0,LOCATION_SZONE,1,nil) end
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_SZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c25173686.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_ONFIELD,nil)
local sg=Duel.GetMatchingGroup(c25173686.filter,tp,0,LOCATION_SZONE,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
......@@ -16,7 +16,7 @@ function c25401880.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,800)
end
function c25401880.filter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
end
function c25401880.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c25401880.filter(chkc) end
......
......@@ -11,7 +11,7 @@ function c27174286.initial_effect(c)
c:RegisterEffect(e1)
end
function c27174286.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c27174286.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -33,24 +33,6 @@ end
function c29424328.tlimit(e,c)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
function c29424328.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c29424328.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function c29424328.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local c1=Duel.GetMatchingGroupCount(c29424328.filter,tp,LOCATION_ONFIELD,0,nil)
if c1<2 then
Duel.Damage(tp,1000-c1*500,REASON_EFFECT)
end
local c2=Duel.GetMatchingGroupCount(c29424328.filter,1-tp,LOCATION_ONFIELD,0,nil)
if c2<2 then
Duel.Damage(1-tp,1000-c2*500,REASON_EFFECT)
end
end
function c29424328.cfcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0
end
......
......@@ -28,18 +28,18 @@ function c29590752.descon(e,tp,eg,ep,ev,re,r,rp)
return st>=(SUMMON_TYPE_SPECIAL+100) and st<(SUMMON_TYPE_SPECIAL+150)
end
function c29590752.desfilter(c)
return not c:IsFaceup() and c:IsDestructable() and c:IsType(TYPE_SPELL+TYPE_TRAP)
return c:IsFacedown() and c:GetSequence()~=5 and c:IsDestructable()
end
function c29590752.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c29590752.desfilter(chkc) end
if chkc then return chkc:IsLocation(LOCATION_SZONE) and c29590752.desfilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c29590752.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c29590752.desfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c29590752.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and not tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc and tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......
......@@ -5,8 +5,8 @@ function c3072808.initial_effect(c)
e1:SetDescription(aux.Stringid(3072808,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c3072808.condition)
e1:SetTarget(c3072808.target)
......@@ -16,25 +16,26 @@ end
c3072808[0]=true
c3072808[1]=true
function c3072808.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)~=0 and ev>=2000 and Duel.GetAttackTarget()==nil and c3072808[tp]
return ep==tp and ev>=2000 and Duel.GetAttackTarget()==nil and c3072808[tp]
end
function c3072808.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsSetCard(0x33) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c3072808.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c3072808.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,0)>1
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(c3072808.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c3072808.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
c3072808[tp]=false
end
function c3072808.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE,0)<2 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
if not tc:IsRelateToEffect(e) or not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then return end
local e1=Effect.CreateEffect(c)
......
......@@ -33,7 +33,7 @@ function c31828916.check(e,tp,eg,ep,ev,re,r,rp)
dg:KeepAlive()
end
function c31828916.cfilter(c,cg,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and cg:IsContains(c)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and cg:IsContains(c)
and Duel.IsExistingMatchingCard(c31828916.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack(),c:GetAttribute(),e,tp)
end
function c31828916.filter(c,atk,att,e,tp)
......
......@@ -13,17 +13,18 @@ function c33248692.initial_effect(c)
c:RegisterEffect(e1)
end
function c33248692.filter(c,tp)
return c:GetPreviousControler()==tp
return c:GetPreviousControler()==tp and c:IsLocation(LOCATION_GRAVE)
end
function c33248692.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return eg:IsExists(c33248692.filter,1,nil,tp)
end
function c33248692.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=eg:Filter(c33248692.filter,nil,tp):GetFirst()
local rec=eg:Filter(c33248692.filter,nil,tp):GetFirst():GetBaseAttack()
if rec<0 then rec=0 end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(tc:GetBaseAttack())
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,tc:GetBaseAttack())
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function c33248692.operation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
......
......@@ -50,7 +50,7 @@ function c36733451.thcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetPreviousControler()==tp
end
function c36733451.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c36733451.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c36733451.filter(chkc) end
......
......@@ -24,7 +24,7 @@ function c36931229.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackPos()
end
function c36931229.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(Card.IsLevelBelow,nil,1,nil,5) end
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsLevelBelow,1,nil,5) end
local sg=Duel.SelectReleaseGroup(tp,Card.IsLevelBelow,1,1,nil,5)
e:SetLabel(sg:GetFirst():GetBaseAttack())
Duel.Release(sg,REASON_COST)
......
......@@ -43,13 +43,13 @@ function c41077745.descon(e,tp,eg,ep,ev,re,r,rp,chk)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c41077745.filter(c)
return c:IsFacedown() and c:GetSequence()~=5 and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
return c:IsFacedown() and c:GetSequence()~=5 and c:IsDestructable()
end
function c41077745.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c41077745.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c41077745.filter,tp,0,LOCATION_ONFIELD,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and c41077745.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c41077745.filter,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c41077745.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
local g=Duel.SelectTarget(tp,c41077745.filter,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c41077745.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -27,7 +27,7 @@ function c43586926.regop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c43586926.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if chk==0 then return c43586926[tp] end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
c43586926[tp]=false
end
......
......@@ -10,7 +10,7 @@ function c46508640.initial_effect(c)
c:RegisterEffect(e1)
end
function c46508640.cfilter(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:IsAbleToGraveAsCost()
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS and c:GetSequence()~=5
end
function c46508640.atkval(e,c)
return Duel.GetMatchingGroupCount(c46508640.cfilter,c:GetControler(),LOCATION_SZONE,0,nil)*300
......
......@@ -35,19 +35,19 @@ function c49514333.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetLabelObject(e)
c:RegisterEffect(e1)
end
function c49514333.repfilter(c)
function c49514333.repfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY)
and bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:IsCanTurnSet()
and c:GetReasonPlayer()~=tp and c:GetOwner()==tp and bit.band(c:GetOriginalType(),TYPE_TRAP)~=0 and c:IsCanTurnSet()
end
function c49514333.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local count=eg:FilterCount(c49514333.repfilter,e:GetHandler())
local count=eg:FilterCount(c49514333.repfilter,e:GetHandler(),tp)
return count>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=count
end
if Duel.SelectYesNo(tp,aux.Stringid(49514333,0)) then
local container=e:GetLabelObject():GetLabelObject()
container:Clear()
local g=eg:Filter(c49514333.repfilter,e:GetHandler())
local g=eg:Filter(c49514333.repfilter,e:GetHandler(),tp)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
......
......@@ -19,15 +19,18 @@ function c5014629.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c5014629.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c5014629.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_REMOVED,0,1,nil,TYPE_MONSTER) end
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_REMOVED,0,nil,TYPE_MONSTER)
if chk==0 then return Duel.IsExistingMatchingCard(c5014629.filter,tp,LOCATION_REMOVED,0,1,nil) end
local ct=Duel.GetMatchingGroupCount(c5014629.filter,tp,LOCATION_REMOVED,0,nil)
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct*100)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*100)
end
function c5014629.damop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_REMOVED,0,nil,TYPE_MONSTER)
local ct=Duel.GetMatchingGroupCount(c5014629.filter,tp,LOCATION_REMOVED,0,nil)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,ct*100,REASON_EFFECT)
end
......@@ -8,7 +8,7 @@ function c51281878.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1)
e1:SetTarget(c51281878.cost)
e1:SetCost(c51281878.cost)
e1:SetTarget(c51281878.target)
e1:SetOperation(c51281878.operation)
c:RegisterEffect(e1)
......
......@@ -11,7 +11,7 @@ function c56514812.initial_effect(c)
c:RegisterEffect(e1)
end
function c56514812.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAIINING) end
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,ep,1)
end
function c56514812.operation(e,tp,eg,ep,ev,re,r,rp)
......
--コアキメイル·グールズスレイブ
function c5817857.initial_effect(c)
--cost
e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
......
......@@ -16,7 +16,7 @@ function c61592395.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,61592395,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c61592395.filter(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:GetCode()~=61592395 and c:IsAbleToHand()
return c:IsFaceup() and c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) and c:GetCode()~=61592395 and c:IsAbleToHand()
end
function c61592395.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c61592395.filter(chkc) end
......
......@@ -11,12 +11,12 @@ function c6343408.initial_effect(c)
e1:SetOperation(c6343408.activate)
c:RegisterEffect(e1)
end
function c6343408.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_REMOVED,0,5,nil,TYPE_MONSTER)
end
function c6343408.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function c6343408.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c6343408.filter,tp,LOCATION_REMOVED,0,5,nil)
end
function c6343408.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c6343408.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c6343408.filter,tp,LOCATION_REMOVED,0,3,nil) end
......
......@@ -25,18 +25,21 @@ function c64379430.initial_effect(c)
e3:SetOperation(c64379430.retop)
c:RegisterEffect(e3)
end
function c64379430.filter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK)
end
function c64379430.value(e,c)
return Duel.GetMatchingGroupCount(Card.IsAttribute,0,LOCATION_REMOVED,LOCATION_REMOVED,nil,ATTRIBUTE_DARK)*300
return Duel.GetMatchingGroupCount(c64379430.filter,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)*300
end
function c64379430.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
function c64379430.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAttribute,0,LOCATION_REMOVED,LOCATION_REMOVED,nil,ATTRIBUTE_DARK)
local g=Duel.GetMatchingGroup(c64379430.filter,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c64379430.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAttribute,0,LOCATION_REMOVED,LOCATION_REMOVED,nil,ATTRIBUTE_DARK)
local g=Duel.GetMatchingGroup(c64379430.filter,0,LOCATION_REMOVED,LOCATION_REMOVED,nil)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
end
......@@ -44,7 +44,7 @@ function c65422840.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(p,d,REASON_EFFECT)
end
function c65422840.filter(c)
return c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck()
return c:IsFaceup() and c:IsRace(RACE_ZOMBIE) and c:IsAbleToDeck()
end
function c65422840.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c65422840.filter(chkc) end
......
......@@ -25,7 +25,7 @@ function c72056560.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(g,REASON_COST)
end
function c72056560.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c72056560.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c72056560.tgfilter(chkc) end
......
......@@ -13,7 +13,7 @@ function c75198893.initial_effect(c)
c:RegisterEffect(e1)
end
function c75198893.filter(c)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_XYZ) and not c:IsHasEffect(EFFECT_FORBIDDEN)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_XYZ) and not c:IsHasEffect(EFFECT_FORBIDDEN)
end
function c75198893.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(1-tp) and c75198893.filter(chkc) end
......
......@@ -52,8 +52,8 @@ function c81254059.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(sg:GetFirst():GetLevel())
Duel.Release(sg,REASON_COST)
end
function c81254059.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
function c81254059.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c81254059.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -26,7 +26,7 @@ function c84653834.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c84653834.filter,tp,LOCATION_MZONE,0,nil)
local c=e:GetHandler()
local tc=sg:GetFirst()
local atk=Duel.GetMatchingGroupCount(Card.IsRace,tp,LOCATION_REMOVED,0,nil,RACE_PSYCHO)*300
local atk=Duel.GetMatchingGroupCount(c84653834.filter,tp,LOCATION_REMOVED,0,nil)*300
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......
......@@ -4,9 +4,8 @@ function c8487449.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_SPSUM_PARAM)
e1:SetProperty(EFFECT_FLAG_SPSUM_PARAM+EFFECT_FLAG_UNCOPYABLE)
e1:SetTargetRange(POS_FACEUP_ATTACK,0)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c8487449.spcon)
e1:SetValue(1)
......
......@@ -33,11 +33,14 @@ function c91895091.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c91895091.filter(c)
return c:IsFacedown() and c:GetSequence()~=5
end
function c91895091.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and chkc:IsFacedown() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFacedown,tp,0,LOCATION_SZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(1-tp) and c91895091.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c91895091.filter,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(91895091,2))
Duel.SelectTarget(tp,Card.IsFacedown,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SelectTarget(tp,c91895091.filter,tp,0,LOCATION_SZONE,1,1,nil)
end
function c91895091.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -48,7 +48,7 @@ function c94283662.thcon(e,tp,eg,ep,ev,re,r,rp)
and e:GetHandler():GetPreviousControler()==tp
end
function c94283662.filter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c94283662.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c94283662.filter(chkc) end
......
......@@ -21,13 +21,15 @@ function c9622164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c9622164.filter(c,e,tp)
return c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9622164.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_REMOVED and chkc:GetControler()==tp
and chkc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c9622164.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(Card.IsCanBeSpecialSummoned,tp,LOCATION_REMOVED,0,1,nil,e,0,tp,false,false) end
and Duel.IsExistingTarget(c9622164.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,Card.IsCanBeSpecialSummoned,tp,LOCATION_REMOVED,0,1,1,nil,e,0,tp,false,false)
local g=Duel.SelectTarget(tp,c9622164.filter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
......
......@@ -18,7 +18,7 @@ function c98147766.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000)
end
function c98147766.filter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
return c:IsFaceup() and c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
end
function c98147766.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_REMOVED) and c98147766.filter(chkc) 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