Commit 4fe1edcd authored by POLYMER's avatar POLYMER

fix

parent 704a3b2b
No preview for this file type
......@@ -44,10 +44,23 @@ function c12866650.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c12866650.spfilter(c,e,tp)
return not c:IsType(TYPE_TOKEN) and c:IsFaceup() and c:IsLocation(LOCATION_REMOVED) and not c:IsReason(REASON_REDIRECT)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c12866650.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 then
local og=Duel.GetOperatedGroup():Filter(c12866650.spfilter,nil,e,tp)
if #og<=0 then return end
local tc1=og:GetFirst()
if not (c:IsRelateToEffect(e) or c:IsLocation(LOCATION_MZONE)) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(12866650,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(tc1,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c12866650.eqcon(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -9,6 +9,7 @@ function c22022580.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,22022580)
e1:SetCondition(c22022580.condition2)
e1:SetCost(c22022580.cost)
e1:SetTarget(c22022580.target2)
......@@ -20,7 +21,7 @@ function c22022580.initial_effect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,22020441)
e2:SetCountLimit(1,22022581)
e2:SetCondition(c22022580.spcon)
e2:SetTarget(c22022580.pentg)
e2:SetOperation(c22022580.penop)
......@@ -31,7 +32,7 @@ function c22022580.initial_effect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,22020441)
e2:SetCountLimit(1,22022581)
e3:SetCondition(c22022580.spcon1)
e3:SetCost(c22022580.erecost)
e3:SetTarget(c22022580.pentg)
......
--方舟骑士团-摩根
function c29014596.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29014596,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,29014596)
e1:SetTarget(c29014596.thtg)
e1:SetOperation(c29014596.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
c29014596.summon_effect=e1
--Equip or SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29014597)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c29014596.tg)
e3:SetOperation(c29014596.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCategory(CATEGORY_EQUIP)
e4:SetRange(LOCATION_HAND)
e4:SetTarget(c29014596.eqtg)
e4:SetOperation(c29014596.eqop)
c:RegisterEffect(e4)
--effect indestructable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e6:SetValue(1)
c:RegisterEffect(e6)
end
function c29014596.Unionfilter(c)
return c:IsSetCard(0x87af)
end
--e1
function c29014596.thfilter(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].Text_ArknightsUnionMonster) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c29014596.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29014596.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29014596.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c29014596.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--e3
function c29014596.filter(c)
return c:IsFaceup() and c:IsSetCard(0x87af)
end
function c29014596.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x87af)
end
function c29014596.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29014596.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29014596.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c29014596.op(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29014596.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29014596.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1),aux.Stringid(29014596,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,2))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29014596.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29014596.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29014596.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c29014596.eqlimit(e,c)
return c==e:GetLabelObject()
end
--e4
function c29014596.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c29014596.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c29014596.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29014596.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29014596.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
--e6
--方舟骑士团-因陀罗
function c29023199.initial_effect(c)
--Search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29023199,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,29023199)
e1:SetTarget(c29023199.thtg)
e1:SetOperation(c29023199.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
c29023199.summon_effect=e1
--Equip or SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29023200)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c29023199.tg)
e3:SetOperation(c29023199.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCategory(CATEGORY_EQUIP)
e4:SetRange(LOCATION_HAND)
e4:SetTarget(c29023199.eqtg)
e4:SetOperation(c29023199.eqop)
c:RegisterEffect(e4)
--NegateAttack
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(29023199,5))
e5:SetCode(EVENT_BE_BATTLE_TARGET)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCountLimit(1)
e5:SetOperation(c29023199.neop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(29023199,6))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_BE_BATTLE_TARGET)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetCondition(c29023199.necon)
e6:SetOperation(c29023199.neop)
c:RegisterEffect(e6)
end
--e1
function c29023199.thfilter(c)
return c:IsSetCard(0x87af) and c:IsType(TYPE_MONSTER)and c:IsType(TYPE_UNION) and c:IsAbleToHand()
end
function c29023199.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29023199.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29023199.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c29023199.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--e3
function c29023199.filter(c)
return c:IsFaceup() and c:IsSetCard(0x87af)
end
function c29023199.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x87af)
end
function c29023199.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29023199.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29023199.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c29023199.op(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29023199.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29023199.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29023199,1),aux.Stringid(29023199,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29023199,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29023199,2))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29023199.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29023199.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29023199.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c29023199.eqlimit(e,c)
return c==e:GetLabelObject()
end
--e4
function c29023199.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c29023199.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c29023199.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29023199.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29023199.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
--e5
function c29023199.necon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ec=e:GetHandler():GetEquipTarget()
local at=Duel.GetAttacker()
return tc==ec and at
end
function c29023199.neop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SelectEffectYesNo(tp,c,aux.Stringid(29023199,3)) then
Duel.Hint(HINT_CARD,0,29023199)
Duel.NegateAttack()
end
end
\ No newline at end of file
--典范军集结
c29025338.Text_ArknightsUnionMonster=1
function c29025338.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,29025338+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c29025338.target)
e1:SetOperation(c29025338.activate)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29025338,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c29025338.sptg)
e2:SetOperation(c29025338.spop)
c:RegisterEffect(e2)
end
--e1
function c29025338.thfilter(c)
return c:IsType(TYPE_UNION) and c:IsSetCard(0x87af) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c29025338.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c29025338.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c29025338.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c29025338.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--e2
function c29025338.filter(c,e,tp)
return c:IsFaceup() and c:GetEquipTarget() and c:GetEquipTarget():IsSetCard(0x87af) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c29025338.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c29025338.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c29025338.filter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c29025338.filter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c29025338.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--方舟骑士团-推进之王
function c29080482.initial_effect(c)
--to grave and spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29080482,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,29080482)
e1:SetCost(c29080482.tgcost)
e1:SetTarget(c29080482.tgtg)
e1:SetOperation(c29080482.tgop)
c:RegisterEffect(e1)
--Equip or SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29080483)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c29080482.tg)
e3:SetOperation(c29080482.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(29080482,3))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetRange(LOCATION_HAND)
e4:SetTarget(c29080482.eqtg)
e4:SetOperation(c29080482.eqop)
c:RegisterEffect(e4)
--effect indestructable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
end
--e4
function c29080482.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c29080482.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c29080482.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29080482.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29080482.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
--e3
function c29080482.filter(c)
return c:IsFaceup() and c:IsSetCard(0x87af)
end
function c29080482.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x87af)
end
function c29080482.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29080482.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29080482.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c29080482.op(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29080482.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29080482.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1),aux.Stringid(29014596,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,2))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29080482.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29080482.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29080482.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c29080482.eqlimit(e,c)
return c==e:GetLabelObject()
end
--e1
function c29080482.costfilter(c,ec,e,tp)
if not c:IsSetCard(0x87af) or not c:IsType(TYPE_MONSTER) or c:IsPublic() then return false end
local g=Group.FromCards(c,ec)
return g:IsExists(c29080482.tgspfilter,1,nil,g,e,tp)
end
function c29080482.tgspfilter(c,g,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) --and g:IsExists(Card.IsAbleToGrave,1,c)
end
function c29080482.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c29080482.costfilter,tp,LOCATION_HAND,0,1,c,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sc=Duel.SelectMatchingCard(tp,c29080482.costfilter,tp,LOCATION_HAND,0,1,1,c,c,e,tp):GetFirst()
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
sc:CreateEffectRelation(e)
e:SetLabelObject(sc)
end
function c29080482.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c29080482.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=e:GetLabelObject()
local g=Group.FromCards(c,sc)
local fg=g:Filter(Card.IsRelateToEffect,nil,e)
if fg:GetCount()~=2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=fg:FilterSelect(tp,c29080482.tgspfilter,1,1,nil,fg,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
local tc=sg:GetFirst()
local sg2=g-sg
local tc2=sg2:GetFirst()
if not Duel.Equip(tp,tc2,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29080482.eqlimit)
e1:SetLabelObject(tc)
tc2:RegisterEffect(e1)
end
end
function c29080482.eqlimit(e,c)
return c==e:GetLabelObject()
end
\ No newline at end of file
--方舟骑士团-维娜·维多利亚
function c29095790.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFun(c,c29095790.ffilter,aux.FilterBoolFunction(Card.IsFusionSetCard,0x87af),3,true)
aux.AddContactFusionProcedure(c,aux.FilterBoolFunction(Card.IsReleasable,REASON_SPSUMMON),LOCATION_MZONE,0,Duel.Release,REASON_SPSUMMON+REASON_MATERIAL)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29095790,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c29095790.eqtg)
e1:SetOperation(c29095790.eqop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32710364,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,29095790)
e2:SetTarget(c29095790.sptg)
e2:SetOperation(c29095790.spop)
c:RegisterEffect(e2)
--Cannot Activate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetValue(c29095790.actcon)
c:RegisterEffect(e3)
end
--fusion
function c29095790.ffilter(c)
return c:IsOriginalCodeRule(c,29080482)
end
--e1
function c29095790.eqfilter(c,tp)
return c:IsSetCard(0x87af) and c:IsType(TYPE_MONSTER)
end
function c29095790.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c29095790.eqfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) end
end
function c29095790.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c29095790.eqfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp,e:GetHandler())
local g1=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,4))
local tc=g1:GetFirst()
while tc do
Duel.Equip(tp,tc,c,true,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e1:SetLabelObject(c)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29095790.eqlimit)
tc:RegisterEffect(e1)
tc=g1:GetNext()
end
Duel.EquipComplete()
end
function c29095790.eqlimit(e,c)
return c==e:GetLabelObject()
end
--e2
function c29095790.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c29095790.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c29095790.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c29095790.rmfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function c29095790.refilter(c,tp)
local cg=c:GetColumnGroup()
return cg:IsExists(c29095790.rmfilter,1,nil)
end
function c29095790.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29095790.spfilter,tp,LOCATION_SZONE,0,1,ft,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) then
local g1=Duel.GetMatchingGroup(c29095790.refilter,tp,0,LOCATION_ONFIELD,nil)
Duel.Remove(g1,POS_FACEUP,REASON_EFFECT)
end
end
end
--e3
function c29095790.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
function c29095790.actcon(e,re)
local tp=e:GetHandlerPlayer()
local rc=re:GetHandler()
local b1,eg1=Duel.CheckEvent(EVENT_SUMMON_SUCCESS,true)
local b2,eg2=Duel.CheckEvent(EVENT_SPSUMMON_SUCCESS,true)
local event=(b1 and eg1:IsExists(c29095790.cfilter,1,nil,tp)) or (b2 and eg2:IsExists(c29095790.cfilter,1,nil,tp))
local ev=Duel.GetCurrentChain()
local trigger=re:GetType()&(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FLIP)~=0 and (not rc:IsLocation(LOCATION_HAND) or rc:IsPublic())
return event and (ev==0 or trigger)
end
\ No newline at end of file
--方舟骑士团-达格达
function c29099870.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29099870,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,29099870)
e1:SetCondition(c29099870.spcon)
e1:SetTarget(c29099870.sptg)
e1:SetOperation(c29099870.spop)
c:RegisterEffect(e1)
--Equip or SpecialSummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,29099871)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetTarget(c29099870.tg)
e3:SetOperation(c29099870.op)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetDescription(aux.Stringid(29099870,1))
e4:SetCategory(CATEGORY_EQUIP)
e4:SetRange(LOCATION_HAND)
e4:SetTarget(c29099870.eqtg)
e4:SetOperation(c29099870.eqop)
c:RegisterEffect(e4)
end
--e1
function c29099870.cfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x87af)
end
function c29099870.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(c29099870.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c29099870.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c29099870.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--e3
function c29099870.filter(c)
return c:IsFaceup() and c:IsSetCard(0x87af)
end
function c29099870.spfilter(c,e,tp)
return c:GetEquipTarget()==e:GetHandler() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x87af)
end
function c29099870.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29099870.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29099870.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
end
function c29099870.op(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c29099870.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp)
local b2=Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():CheckUniqueOnField(tp) and Duel.IsExistingMatchingCard(c29099870.filter,tp,LOCATION_MZONE,0,1,e:GetHandler())
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1),aux.Stringid(29014596,2))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(29014596,1))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(29014596,2))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c29099870.spfilter,tp,LOCATION_SZONE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
else
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29099870.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29099870.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
end
function c29099870.eqlimit(e,c)
return c==e:GetLabelObject()
end
--e4
function c29099870.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and e:GetHandler():CheckUniqueOnField(tp)
and Duel.IsExistingTarget(c29099870.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c29099870.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.SelectMatchingCard(tp,c29099870.filter,tp,LOCATION_MZONE,0,1,1,aux.ExceptThisCard(e),tp)
local tc=g:GetFirst()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsControler(1-tp) or tc:IsFacedown() or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c29099870.eqlimit)
e1:SetLabelObject(tc)
c:RegisterEffect(e1)
end
\ No newline at end of file
......@@ -111,7 +111,7 @@ function s.initial_effect(c)
Duel.RegisterEffect(sge5,0)
local sge6=sge4:Clone()
sge6:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(sge6,0)
Duel.RegisterEffect(sge6,0)
end
local control_player=0
if _Duel.GetFieldGroupCount(1,LOCATION_DECK,0)>0 then control_player=1 end
......@@ -1176,8 +1176,14 @@ function s.mindcontrol(e,tp)
s.Control_Mode=not s.Control_Mode
if s.Control_Mode then
Debug.Message("骇入开始")
function Group.Select(g,sp,min,max,nc) Duel.ConfirmCards(tp,g:Filter(s.confirmfilter,nil,tp)) return _Group.Select(g,tp,min,max,nc) end
function Group.FilterSelect(g,sp,...) Duel.ConfirmCards(tp,g:Filter(s.confirmfilter,nil,tp)) return _Group.FilterSelect(g,tp,...) end
function Group.Select(g,sp,min,max,nc)
Duel.ConfirmCards(tp,g:Filter(s.confirmfilter,nil,tp))
return _Group.Select(g,tp,min,max,nc)
end
function Group.FilterSelect(g,sp,...)
Duel.ConfirmCards(tp,g:Filter(s.confirmfilter,nil,tp))
return _Group.FilterSelect(g,tp,...)
end
function Group.SelectUnselect(cg,sg,sp,...) Duel.ConfirmCards(tp,cg:Filter(s.confirmfilter,nil,tp)) return _Group.SelectUnselect(cg,sg,tp,...) end
function Card.RemoveOverlayCard(oc,sp,...) return _Card.RemoveOverlayCard(oc,tp,...) end
function Duel.SelectFusionMaterial(sp,c,g,...) Duel.ConfirmCards(tp,g:Filter(s.confirmfilter,nil,tp)) return _Duel.SelectFusionMaterial(tp,c,g,...) end
......@@ -1191,7 +1197,13 @@ function s.mindcontrol(e,tp)
local dg=Duel.SelectMatchingCard(tp,f,sp,LOCATION_HAND,0,min,max,nc,...)
return Duel.SendtoGrave(dg,r)
end
function Duel.RemoveOverlayCard(sp,...) return _Duel.RemoveOverlayCard(tp,...) end
function Duel.RemoveOverlayCard(sp,s,o,...)
if sp==tp then
return _Duel.RemoveOverlayCard(tp,s,o,...)
else
return _Duel.RemoveOverlayCard(tp,o,s,...)
end
end
function Duel.SelectMatchingCard(sp,f,p,sl,ol,max,min,ex,...)
local sg=Duel.GetMatchingGroup(f,p,sl,ol,ex,...)
Duel.ConfirmCards(tp,sg:Filter(s.confirmfilter,nil,tp))
......@@ -1199,26 +1211,75 @@ function s.mindcontrol(e,tp)
end
function Duel.SelectReleaseGroup(sp,...) return _Duel.SelectReleaseGroup(tp,...) end
function Duel.SelectReleaseGroupEx(sp,...) return _Duel.SelectReleaseGroupEx(tp,...) end
function Duel.SpecialSummon(tg,stype,sp,...) return _Duel.SpecialSummon(tg,stype,tp,...) end
function Duel.SpecialSummonStep(tg,stype,sp,...) return _Duel.SpecialSummonStep(tg,stype,tp,...) end
function Duel.MoveToField(c,mp,...) return _Duel.MoveToField(c,tp,...) end
function Duel.SSet(p,tg,sp,...) if not sp then sp=p end return _Duel.SSet(tp,tg,sp,...) end
function Duel.GetControl(tg,p,rphase,rcount,zone,...)
if zone==nil then zone=0x1f end
local flag=0x1f-zone
for i=0,4 do
if not Duel.CheckLocation(p,LOCATION_MZONE,i) then
function Duel.SpecialSummon(tg,stype,sp,trp,check,limit,pos,zone)
local num=0
if aux.GetValueType(tg)=="Card" then
if Duel.SpecialSummonStep(tg,stype,sp,trp,check,limit,pos,zone) then num=num+1 end
elseif aux.GetValueType(tg)=="Group" then
for tc in aux.Next(tg) do
if Duel.SpecialSummonStep(tc,stype,sp,trp,check,limit,pos,zone) then num=num+1 end
end
end
if num>0 then _Duel.SpecialSummonComplete() end
return num
end
function Duel.SpecialSummonStep(tg,stype,sp,trp,check,limit,pos,zone)
if not zone then zone=0xff end
local flag=0xff-zone
for i=0,7 do
if not tg:IsCanBeSpecialSummoned(e,0,sp,false,false,pos,trp,2^i) then
flag=flag|2^i
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
if tp==p then
flag=_Duel.SelectField(tp,1,LOCATION_MZONE,0,flag+0x60)
if flag==0xff then return end
if tp==trp then
flag=_Duel.SelectField(tp,1,LOCATION_MZONE,0,flag,tg:GetOriginalCode())
else
flag=_Duel.SelectField(tp,1,0,LOCATION_MZONE,(flag+0x60)<<16)>>16
flag=_Duel.SelectField(tp,1,0,LOCATION_MZONE,flag<<16,tg:GetOriginalCode())>>16
end
pos=_Duel.SelectPosition(tp,tg,pos)
return _Duel.SpecialSummonStep(tg,stype,sp,trp,check,limit,pos,flag)
end
function Duel.MoveToField(c,mp,...) return _Duel.MoveToField(c,tp,...) end
function Duel.SSet(p,tg,sp,...) if not sp then sp=p end return _Duel.SSet(tp,tg,sp,...) end
function Duel.GetControl(tg,p,rphase,rcount,zone,...)
if not zone then zone=0x1f end
if aux.GetValueType(tg)=="Card" then
local flag=0x1f-zone
for i=0,4 do
if not Duel.CheckLocation(p,LOCATION_MZONE,i) then
flag=flag|2^i
end
end
if flag==0x1f then return end
if tp==p then
flag=_Duel.SelectField(tp,1,LOCATION_MZONE,0,flag+0x60,tg:GetOriginalCode())
else
flag=_Duel.SelectField(tp,1,0,LOCATION_MZONE,(flag+0x60)<<16,tg:GetOriginalCode())>>16
end
return _Duel.GetControl(tg,p,rphase,rcount,flag,...)
elseif aux.GetValueType(tg)=="Group" then
local num=0
for tc in aux.Next(tg) do
local flag=0x1f-zone
for i=0,4 do
if not Duel.CheckLocation(p,LOCATION_MZONE,i) then
flag=flag|2^i
end
end
if flag==0x1f then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ZONE,tc)
if tp==p then
flag=_Duel.SelectField(tp,1,LOCATION_MZONE,0,flag+0x60,tc:GetOriginalCode())
else
flag=_Duel.SelectField(tp,1,0,LOCATION_MZONE,(flag+0x60)<<16,tc:GetOriginalCode())>>16
end
if _Duel.GetControl(tc,p,rphase,rcount,flag,...)==1 then
num=num+1
end
end
return num
end
return _Duel.GetControl(tg,p,rphase,rcount,flag,...)
end
function Duel.SelectDisableField(p,count,sl,ol,filter)
if tp==p then
......@@ -1250,9 +1311,17 @@ function s.mindcontrol(e,tp)
local ge0=Effect.GlobalEffect()
ge0:SetType(EFFECT_TYPE_FIELD)
ge0:SetCode(EFFECT_PUBLIC)
ge0:SetLabel(id)
ge0:SetTargetRange(0,LOCATION_HAND)
Duel.RegisterEffect(ge0,tp)
function Card.IsPublic(c)
local pet={c:IsHasEffect(EFFECT_PUBLIC)}
for _,pe in pairs(pet) do
if pe:GetLabel()~=id then return true end
end
return false
end
--attack redirect
local age=Effect.GlobalEffect()
age:SetType(EFFECT_TYPE_FIELD)
......@@ -1261,7 +1330,7 @@ function s.mindcontrol(e,tp)
age:SetTargetRange(0,1)
Duel.RegisterEffect(age,tp)
local hintcard=Duel.CreateToken(tp,id+1)
--local hintcard=Duel.CreateToken(tp,id+1)
local sge=Effect.CreateEffect(e:GetHandler())
sge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
sge:SetCode(EVENT_FREE_CHAIN)
......@@ -1363,6 +1432,8 @@ function s.mindcontrol(e,tp)
end
else
Debug.Message("骇入结束")
Card.IsPublic=_Card.IsPublic
Group.Select=_Group.Select
Group.FilterSelect=_Group.FilterSelect
Group.SelectUnselect=_Group.SelectUnselect
......@@ -1373,7 +1444,7 @@ function s.mindcontrol(e,tp)
Duel.SelectTarget=_Duel.SelectTarget
Duel.SelectTribute=_Duel.SelectTribute
Duel.DiscardHand=_Duel.DiscardHand
Duel.RemoveOverlayCard=_Duel.DRemoveOverlayCard
Duel.RemoveOverlayCard=_Duel.RemoveOverlayCard
Duel.SelectFusionMaterial=_Duel.SelectFusionMaterial
Duel.SpecialSummon=_Duel.SpecialSummon
......@@ -1403,10 +1474,11 @@ function s.mindcontrol(e,tp)
end
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
s.SummonUnit=e:GetHandler()
local res=s.SummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false)
s.SummonUnit=nil
return s.Control_Mode and tp~=e:GetHandler():GetOwner() and res
return s.Control_Mode and tp~=c:GetOwner() and res
end
function s.sumfilter(c)
return c:IsSummonable(false,nil) or c:IsMSetable(false,nil)
......@@ -1431,7 +1503,7 @@ function s.sumzone(c,tp)
e1:SetValue((1<<i)*0x10000)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSummonable(false,nil) or c:IsMSetable(false,nil) then
zone=zone|((1<<i)*0x10000)
end
e1:Reset()
......@@ -1445,7 +1517,7 @@ function s.sumzone(c,tp)
e1:SetValue(1<<i)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSummonable(false,nil) or c:IsMSetable(false,nil) then
zone=zone|((1<<i))
end
e1:Reset()
......@@ -1457,15 +1529,16 @@ function s.sumactivate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local s1=c:IsSummonable(false,nil)
local s2=c:IsMSetable(false,nil)
if (s1 and s2 and _Duel.SelectPosition(s.mindplayer,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or (s1 and not s2) then
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,LOCATION_MZONE,~s.sumzone(c,1-tp),c:GetOriginalCode())
local flag=s.sumzone(c,1-tp)
if (s1 and s2 and _Duel.SelectPosition(s.mindplayer,c,POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)==POS_FACEUP_ATTACK) or (s1 and not s2) then
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,LOCATION_MZONE,~flag,c:GetOriginalCode())
if zone<0x10000 then
Duel.Summon(1-s.mindplayer,c,false,nil,0,zone)
else
Duel.Summon(1-s.mindplayer,c,false,nil,0,zone/0x10000)
end
elseif s2 then
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,LOCATION_MZONE,~s.sumzone(c,1-tp),c:GetOriginalCode())
local zone=Duel.SelectField(tp,1,LOCATION_MZONE,LOCATION_MZONE,~flag,c:GetOriginalCode())
if zone<0x10000 then
Duel.MSet(1-s.mindplayer,c,false,nil,0,zone)
else
......@@ -1475,7 +1548,10 @@ function s.sumactivate(e,tp,eg,ep,ev,re,r,rp)
end
function s.spscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return s.Control_Mode and tp~=e:GetHandler():GetOwner() and c:IsSpecialSummonable()
s.SpecialSummonUnit=c
local res=s.SpecialSummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false)
s.SpecialSummonUnit=nil
return s.Control_Mode and tp~=c:GetOwner() and res
end
function s.sptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -1519,14 +1595,13 @@ end
function s.sptarget2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if s.SpecialSummonUnit then
return s.SpecialSummonUnit:IsSpecialSummonable() or s.SpecialSummonUnit:IsSynchroSummonable(nil) or s.SpecialSummonUnit:IsXyzSummonable(nil) or s.SpecialSummonUnit:IsLinkSummonable(nil)
return s.SpecialSummonUnit:IsSpecialSummonable()
end
return Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA+LOCATION_HAND,0,1,nil)
end
end
function s.spsumzone(c,tp)
local zone=0
s.SpecialSummonUnit=c
for i=0,4 do
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
......@@ -1536,7 +1611,7 @@ function s.spsumzone(c,tp)
e1:SetValue((1<<i)*0x10000)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SpecialSummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSpecialSummonable() then
zone=zone|((1<<i)*0x10000)
end
e1:Reset()
......@@ -1550,7 +1625,7 @@ function s.spsumzone(c,tp)
e1:SetValue(1<<i)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SpecialSummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSpecialSummonable() then
zone=zone|((1<<i))
end
e1:Reset()
......@@ -1564,7 +1639,7 @@ function s.spsumzone(c,tp)
e1:SetValue(0x200040)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SpecialSummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSpecialSummonable() then
zone=zone|0x200040
end
e1:Reset()
......@@ -1578,12 +1653,11 @@ function s.spsumzone(c,tp)
e1:SetValue(0x400020)
e1:SetCountLimit(1)
Duel.RegisterEffect(e1,tp)
if s.SpecialSummonCheckEffect[1-tp]:IsActivatable(1-tp,true,false) then
if c:IsSpecialSummonable() then
zone=zone|0x400020
end
e1:Reset()
end
s.SpecialSummonUnit=nil
return zone
end
function s.pspcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -1593,8 +1667,7 @@ function s.pspcon(e,tp,eg,ep,ev,re,r,rp)
if lpz==nil then return false end
local g=Duel.GetMatchingGroup(Card.IsType,p,LOCATION_HAND+LOCATION_EXTRA,0,nil,TYPE_MONSTER)
if #g==0 then return false end
local pcon=aux.PendCondition()
return s.Control_Mode and p~=e:GetHandler():GetOwner() and pcon(e,lpz,g)
return s.Control_Mode and p~=e:GetHandler():GetOwner() and aux.PendCondition(e,lpz,g)
end
function s.pspactivate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -1615,8 +1688,7 @@ function s.pspop(e,tp,eg,ep,ev,re,r,rp)
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,TYPE_MONSTER)
if #g==0 then return end
local pop=aux.PendOperation()
pop(e,tp,eg,ep,ev,re,r,rp,lpz,sg,g)
aux.PendOperation(e,tp,eg,ep,ev,re,r,rp,lpz,sg,g)
Duel.RaiseEvent(sg,EVENT_SPSUMMON_SUCCESS_G_P,e,REASON_EFFECT,tp,tp,0)
Duel.SpecialSummon(sg,SUMMON_TYPE_PENDULUM,tp,tp,true,true,POS_FACEUP)
e:Reset()
......@@ -1679,7 +1751,6 @@ function s.setactop(e,tp,eg,ep,ev,re,r,rp)
eff:SetDescription(aux.Stringid(id+1,9))
eff:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
eff:SetCode(id+code)
eff:SetCountLimit(1)
eff:SetCost(s.addeffcost(effect))
eff:SetCondition(s.addeffcon(effect))
eff:SetTarget(s.addefftg(effect))
......@@ -1765,6 +1836,7 @@ function s.addeffcost(effect)
return (not c:IsLocation(LOCATION_HAND) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,chk,...))
else
e:SetType(EFFECT_TYPE_ACTIVATE)
e:Reset()
if c:IsLocation(LOCATION_SZONE) then Duel.ChangePosition(c,POS_FACEUP) end
if c:IsLocation(LOCATION_HAND) then
if c:IsType(TYPE_FIELD) then
......@@ -1777,10 +1849,11 @@ function s.addeffcost(effect)
end
else
if chk==0 then
return (not cost or cost(e,tp,eg,ep,ev,re,r,rp,chk,...))
return not cost or cost(e,tp,eg,ep,ev,re,r,rp,chk,...)
else
e:SetType(effect:GetType())
e:SetCode(effect:GetCode())
--e:SetType(effect:GetType())
--e:SetCode(effect:GetCode())
e:Reset()
if cost then cost(e,tp,eg,ep,ev,re,r,rp,chk,...) end
end
end
......@@ -1830,7 +1903,7 @@ function s.mindtg(e,tp,eg,ep,ev,re,r,rp,chk)
local code=c:GetOriginalCode()
if eff and aux.GetValueType(eff)=="Effect"then
if effect:GetType()&EFFECT_TYPE_ACTIVATE~=0 then
eff:SetProperty(effect:GetProperty()|EFFECT_FLAG_BOTH_SIDE|EFFECT_FLAG_SET_AVAILABLE)
eff:SetProperty(effect:GetProperty()|EFFECT_FLAG_SET_AVAILABLE)
eff:SetRange(LOCATION_HAND+LOCATION_SZONE)
end
eff:SetDescription(aux.Stringid(id+1,9))
......@@ -1858,7 +1931,7 @@ function s.mindtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local code=c:GetOriginalCode()
if eff and aux.GetValueType(eff)=="Effect"then
if effect:GetType()&EFFECT_TYPE_ACTIVATE~=0 then
eff:SetProperty(effect:GetProperty()|EFFECT_FLAG_BOTH_SIDE|EFFECT_FLAG_SET_AVAILABLE)
eff:SetProperty(effect:GetProperty()|EFFECT_FLAG_SET_AVAILABLE)
eff:SetRange(LOCATION_HAND+LOCATION_SZONE)
end
eff:SetDescription(aux.Stringid(id+1,9))
......
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