Commit 9d5c7993 authored by POLYMER's avatar POLYMER

fix

parent daa8a3e0
No preview for this file type
--Fallacio Strawman
function c31000001.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,31000001)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000001.spcon)
e1:SetTarget(c31000001.sptg)
e1:SetOperation(c31000001.spop)
c:RegisterEffect(e1)
--SP Search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,31000002)
e2:SetCost(c31000001.cost)
e2:SetTarget(c31000001.target)
e2:SetOperation(c31000001.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCountLimit(1)
e5:SetCondition(c31000001.sycon)
c:RegisterEffect(e5)
end
function c31000001.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsCode(31000002) and c:IsLevel(e:GetHandler():GetLevel())
end
return Duel.IsExistingMatchingCard(spfilter,tp,nil,LOCATION_MZONE,1,nil)
end
function c31000001.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,tp,0)
end
function c31000001.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
function c31000001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lv=Duel.AnnounceLevel(tp,1,6)
e:SetLabel(lv)
end
function c31000001.target(e,tp,eg,ep,ev,re,r,rp,chk)
local lv=e:GetLabel()
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31000002,0,TYPES_TOKEN_MONSTER,0,0,lv,RACE_PSYCHIC,ATTRIBUTE_DARK,POS_FACEUP,1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c31000001.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lv=e:GetLabel()
local token=Duel.CreateToken(tp,31000002)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
token:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
token:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
token:RegisterEffect(e4,true)
local e5=e2:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e5,true)
local e6=e2:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
token:RegisterEffect(e6,true)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)>0 then
local filter=function(c)
return c:IsSetCard(0x308) and c:IsLevel(lv) and c:IsAbleToHand()
end
local g=Duel.GetMatchingGroup(filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(31000001,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc and Duel.IsPlayerCanSendtoHand(tp,tc) then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
function c31000001.sycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_SYNCHRO)
end
--Fallacio Herring
function c31000003.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,31000003)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000003.spcon)
e1:SetTarget(c31000003.sptg)
e1:SetOperation(c31000003.spop)
c:RegisterEffect(e1)
--SP Fallacio
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,31000004)
e2:SetTarget(c31000003.target)
e2:SetOperation(c31000003.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCountLimit(1)
e5:SetCondition(c31000003.sycon)
c:RegisterEffect(e5)
end
function c31000003.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsCode(31000002) and c:IsLevel(e:GetHandler():GetLevel())
end
return Duel.IsExistingMatchingCard(spfilter,tp,nil,LOCATION_MZONE,1,nil)
end
function c31000003.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 c31000003.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
function c31000003.spfilter(c,lv,e,tp)
return c:IsSetCard(0x308) and not c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c31000003.opfilter(c,e,tp)
return c:IsCode(31000002) and Duel.IsExistingMatchingCard(c31000003.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c:GetLevel(),e,tp)
end
function c31000003.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c31000003.opfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(c31000003.opfilter,tp,0,LOCATION_MZONE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c31000003.opfilter,tp,0,LOCATION_MZONE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c31000003.operation(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c31000003.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,nil,c:GetLevel(),e,tp)
if c:IsRelateToEffect(e) and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc then Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,tc)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c31000003.sycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_SYNCHRO)
end
--Fallacio Gambler
function c31000005.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,31000005)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000005.spcon)
e1:SetTarget(c31000005.sptg)
e1:SetOperation(c31000005.spop)
c:RegisterEffect(e1)
--Dice
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DICE+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,31000006)
e2:SetTarget(c31000005.target)
e2:SetOperation(c31000005.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCountLimit(1)
e5:SetCondition(c31000005.sycon)
c:RegisterEffect(e5)
end
function c31000005.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsCode(31000002) and c:IsLevel(e:GetHandler():GetLevel())
end
return Duel.IsExistingMatchingCard(spfilter,tp,nil,LOCATION_MZONE,1,nil)
end
function c31000005.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 c31000005.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
function c31000005.spfilter(c)
return c:IsSetCard(0x308)
end
function c31000005.difilter(c,r1,r2,r3)
local bool=c:IsLevel(r1) or c:IsLevel(r2) or c:IsLevel(r3)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER) and not bool
end
c31000005.toss_dice=true
function c31000005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31000005.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c31000005.operation(e,tp,eg,ep,ev,re,r,rp)
local d1,d2,d3=Duel.TossDice(tp,3)
local g=Duel.GetMatchingGroup(c31000005.difilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,d1,d2,d3)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc and Duel.IsPlayerCanSendtoHand(tp,tc) then
if tc:IsLocation(LOCATION_DECK) then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
else
Duel.SendtoHand(sg,tp,REASON_EFFECT)
end
end
end
end
function c31000005.sycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_SYNCHRO)
end
--Fallacio Swanbird
function c31000007.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,31000007)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000007.spcon)
e1:SetTarget(c31000007.sptg)
e1:SetOperation(c31000007.spop)
c:RegisterEffect(e1)
--Gain Effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,31000008)
e2:SetTarget(c31000007.target)
e2:SetOperation(c31000007.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCountLimit(1)
e5:SetCondition(c31000007.sycon)
c:RegisterEffect(e5)
end
function c31000007.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsCode(31000002) and c:IsLevel(e:GetHandler():GetLevel())
end
return Duel.IsExistingMatchingCard(spfilter,tp,nil,LOCATION_MZONE,1,nil)
end
function c31000007.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 c31000007.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
function c31000007.spfilter(c)
return c:IsSetCard(0x308)
end
function c31000007.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c31000003.spfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c31000007.spfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c31000007.spfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c31000007.operation(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) then
local con=function(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_SYNCHRO
end
local op=function(e,tp,eg,ep,ev,re,r,rp)
local rc=e:GetHandler():GetReasonCard()
local code=e:GetHandler():GetCode()
rc:CopyEffect(code,RESET_EVENT+RESETS_STANDARD)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e1:SetCondition(con)
e1:SetOperation(op)
c:RegisterEffect(e1)
local fid=c:GetFieldID()
c:RegisterFlagEffect(31000007,RESET_EVENT+RESETS_STANDARD,0,1,fid)
end
end
function c31000007.sycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_SYNCHRO)
end
--Fallacio Sharpshooter
function c31000009.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,31000009)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000009.spcon)
e1:SetCost(c31000009.spcst)
e1:SetTarget(c31000009.sptg)
e1:SetOperation(c31000009.spop)
c:RegisterEffect(e1)
--Remove
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_HANDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,31000010)
e2:SetTarget(c31000009.target)
e2:SetOperation(c31000009.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCountLimit(1)
e5:SetCondition(c31000009.sycon)
c:RegisterEffect(e5)
--Search
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SEARCH)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetTarget(c31000009.tg)
e6:SetOperation(c31000009.op)
c:RegisterEffect(e6)
end
function c31000009.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsCode(31000002) and c:IsLevel(e:GetHandler():GetLevel())
end
return Duel.IsExistingMatchingCard(spfilter,tp,nil,LOCATION_MZONE,1,nil)
end
function c31000009.spcst(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(sg,REASON_COST)
end
function c31000009.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 c31000009.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
function c31000009.cfilter(c,typ)
return c:IsSetCard(0x308) and c:IsType(typ)
end
function c31000009.opfilter(c)
return Duel.IsExistingMatchingCard(c31000009.cfilter,tp,LOCATION_DECK,nil,1,nil,c:GetType()) and c:IsPublic()
end
function c31000009.target(e,tp,eg,ep,ev,re,r,rp,chk)
local filter=function(c) return c:IsSetCard(0x308) end
local gc=Duel.GetMatchingGroupCount(filter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.GetFieldGroup(tp,0,LOCATION_HAND):GetCount()>=gc end
end
function c31000009.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local filter=function(c) return c:IsSetCard(0x308) end
local gc=Duel.GetMatchingGroupCount(filter,tp,LOCATION_MZONE,0,nil)
local rs=g:RandomSelect(tp,gc)
for tc in aux.Next(rs) do
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(31000009,RESET_EVENT+RESETS_STANDARD,nil,1)
end
end
function c31000009.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_HAND) and c31000009.opfilter(chkc) end
if chk==0 then return Duel.IsExistingMatchingCard(c31000009.opfilter,tp,0,LOCATION_HAND,1,nil) end
local g=Duel.GetMatchingGroup(c31000009.opfilter,tp,0,LOCATION_HAND,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local sg=g:Select(tp,1,1,nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK)
end
function c31000009.op(e,tp,eg,ep,ev,re,r,rp)
local c=Duel.GetFirstTarget()
local g=Duel.GetMatchingGroup(c31000009.cfilter,tp,LOCATION_DECK,0,nil,c:GetType())
if c:IsRelateToEffect(e) and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc and Duel.IsPlayerCanSendtoHand(tp,tc) then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function c31000009.sycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_SYNCHRO)
end
--Fallacio Paralogos
function c31000011.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c31000011.spcon)
e1:SetCost(c31000011.spcst)
e1:SetTarget(c31000011.sptg)
e1:SetOperation(c31000011.spop)
c:RegisterEffect(e1)
--Immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(c31000011.target)
e2:SetOperation(c31000011.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
--Search
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetTarget(c31000011.tg)
e5:SetOperation(c31000011.op)
c:RegisterEffect(e5)
Duel.AddCustomActivityCounter(31000011,ACTIVITY_SUMMON,c31000011.counterfilter)
Duel.AddCustomActivityCounter(31000011,ACTIVITY_SPSUMMON,c31000011.counterfilter)
end
function c31000011.counterfilter(c)
return c:IsSetCard(0x308) or not c:IsPreviousLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c31000011.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(31000011,tp,ACTIVITY_SUMMON)==0
and Duel.GetCustomActivityCount(31000011,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c31000011.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c31000011.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x308) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function c31000011.spcon(e,tp,eg,ep,ev,re,r,rp)
local spfilter=function(c)
return c:IsSetCard(0x308) and not c:IsAttribute(ATTRIBUTE_DARK) and c:IsFaceup()
end
local altfilter=function(c)
return not c:IsSetCard(0x308) or c:IsAttribute(ATTRIBUTE_DARK)
end
return Duel.IsExistingMatchingCard(spfilter,tp,LOCATION_MZONE,nil,1,nil)
and not Duel.IsExistingMatchingCard(altfilter,tp,LOCATION_MZONE,nil,1,nil)
end
function c31000011.spcst(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil)
and c31000011.cost(e,tp,eg,ep,ev,re,r,rp,0) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(sg,REASON_COST)
c31000011.cost(e,tp,eg,ep,ev,re,r,rp)
end
function c31000011.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 c31000011.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
function c31000011.spfilter(c)
return c:IsSetCard(0x308)
end
function c31000011.opfilter(c)
return c:IsSetCard(0x308) and (c:IsType(TYPE_SPELL) or c:IsType(TYPE_TRAP))
end
function c31000011.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c31000011.cost(e,tp,eg,ep,ev,re,r,rp,0) end
c31000011.cost(e,tp,eg,ep,ev,re,r,rp)
end
function c31000011.immtg(e,c)
return c31000011.spfilter(c)
end
function c31000011.immval(e,te)
local tp=te:GetOwner():GetControler()
return tp~=e:GetHandler():GetControler() and te:IsActiveType(TYPE_MONSTER)
end
function c31000011.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTarget(c31000011.immtg)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(c31000011.immval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c31000011.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31000011.opfilter,tp,LOCATION_DECK,nil,1,nil)
and c31000011.cost(e,tp,eg,ep,ev,re,r,rp,0) end
c31000011.cost(e,tp,eg,ep,ev,re,r,rp)
Duel.SetOperationInfo(0,CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK)
end
function c31000011.op(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31000011.opfilter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc and Duel.IsPlayerCanSendtoHand(tp,tc) then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
--Fallacio Argumentum
function c31000013.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,31000013+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
--Immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(c31000013.cpcon)
e2:SetOperation(c31000013.cpop)
c:RegisterEffect(e2)
--Negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DISABLE)
e3:SetRange(LOCATION_FZONE)
e3:SetTarget(c31000013.distg)
e3:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e3)
--Search/Level
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_GRAVE_ACTION)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(c31000013.target)
e4:SetOperation(c31000013.operation)
c:RegisterEffect(e4)
end
function c31000013.cpcon(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
local p=e:GetHandler():GetControler()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return p==tp and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x308) and loc==LOCATION_MZONE
end
function c31000013.cpop(e,tp,eg,ep,ev,re,r,rp)
local lb=re:GetLabel()
if lb then e:SetLabel(lb) end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g then Duel.SetTargetCard(g) end
local op=re:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.NegateEffect(ev)
end
function c31000013.spfilter(c)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER)
end
function c31000013.tkfilter(c,lv)
return c:IsCode(31000002) and c:IsLevel(lv) and c:IsPosition(POS_FACEUP)
end
function c31000013.lvfilter(c)
return c:IsType(TYPE_MONSTER) and not (c:IsType(TYPE_XYZ) or c:IsType(TYPE_LINK))
end
function c31000013.distg(e,c)
local tp=e:GetHandler():GetControler()
return (c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0) and
Duel.IsExistingMatchingCard(c31000013.tkfilter,tp,nil,LOCATION_MZONE,1,nil,c:GetLevel())
end
function c31000013.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(c31000013.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if chk==0 then return g1:GetCount()>0 end
end
function c31000013.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c31000013.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g1:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g1:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc and Duel.IsPlayerCanSendtoHand(tp,tc) then
if Duel.SendtoHand(sg,tp,REASON_EFFECT) then
Duel.ConfirmCards(1-tp,sg)
local g=Duel.GetMatchingGroup(c31000013.lvfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(31000013,1)) then
for c in aux.Next(g) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetRange(LOCATION_FZONE)
e1:SetValue(tc:GetLevel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
end
end
end
end
--Fallacio ad Hominem
function c31000014.initial_effect(c)
c:SetUniqueOnField(1,0,31000014)
--Synchro Summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x308),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--Gain ATK/DEF
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c31000014.adval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--Negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_DESTROY+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c31000014.con)
e3:SetTarget(c31000014.tg)
e3:SetOperation(c31000014.op)
c:RegisterEffect(e3)
end
function c31000014.adval(e,c)
local filter=function(c)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER) and c:IsPosition(POS_FACEUP)
end
local tp=c:GetControler()
local g1=Duel.GetMatchingGroup(filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local g2=Duel.GetMatchingGroup(filter,1-tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
return (g1:GetCount()+g2:GetCount())*500
end
function c31000014.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsPosition(POS_FACEUP)
end
function c31000014.con(e,tp,eg,ep,ev,re,r,rp)
local tgp=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER)
return tgp~=tp
end
function c31000014.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsPosition(POS_FACEUP) end
if chk==0 then return Duel.IsExistingTarget(c31000014.tgfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c31000014.tgfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g:GetFirst(),1,1-tp,LOCATION_MZONE)
end
function c31000014.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local dg=Group.CreateGroup()
local g=Duel.GetMatchingGroup(filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local vl=g:GetCount()*(-500)
if tc:IsRelateToEffect(e) then
local preatk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(vl)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
if preatk~=0 and tc:IsAttack(0) then
if Duel.Destroy(tc,REASON_EFFECT)>0 then
for i=1,ev do
local tgp=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_PLAYER)
if tgp~=tp then Duel.NegateEffect(i) end
end
end
end
end
end
--Fallacio ex Silentio
function c31000015.initial_effect(c)
c:SetUniqueOnField(1,0,31000015)
--XYZ Summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),6,2,c31000015.ovfilter,aux.Stringid(31000015,0))
c:EnableReviveLimit()
--Protection
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(31000015,1))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c31000015.condition)
e1:SetCost(c31000015.unitcost)
e1:SetTarget(c31000015.target)
e1:SetOperation(c31000015.operation)
c:RegisterEffect(e1)
--Immunity
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(31000015,2))
e2:SetCategory(CATEGORY_ANNOUNCE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c31000015.cst)
e2:SetTarget(c31000015.tg)
e2:SetOperation(c31000015.op)
c:RegisterEffect(e2)
end
function c31000015.ovfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x308)
end
function c31000015.filter(c)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c31000015.cst(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31000015.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,nil,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,c31000015.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(sg,POS_FACEUP,REASON_COST)
end
function c31000015.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
local ag=Group.CreateGroup()
local codes={}
for c in aux.Next(g) do
if c:IsFaceup() then
local code=c:GetCode()
if not ag:IsExists(Card.IsCode,1,nil,code) then
ag:AddCard(c)
table.insert(codes,code)
end
end
end
local afilter={codes[1],OPCODE_ISCODE,OPCODE_NOT}
if #codes>1 then
for i=2,#codes do
table.insert(afilter,codes[i])
table.insert(afilter,OPCODE_ISCODE)
table.insert(afilter,OPCODE_NOT)
table.insert(afilter,OPCODE_AND)
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp,table.unpack(afilter))
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function c31000015.op(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetValue(c31000015.efilter)
e1:SetLabel(ac)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Duel.RegisterEffect(e1,1-tp)
end
function c31000015.efilter(e,re)
local code=e:GetLabel()
return re:GetHandler():IsOriginalCodeRule(code)
end
function c31000015.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c31000015.unitcost(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 c31000015.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_MZONE,nil,1,nil,0x308) end
end
function c31000015.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x308))
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
--Fallacio Witch Hunt
function c31000017.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,31000017+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c31000017.target)
e1:SetOperation(c31000017.activate)
c:RegisterEffect(e1)
end
function c31000017.spfilter(c,lv,e,tp)
return c:IsSetCard(0x308) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c31000017.target(e,tp,eg,ep,ev,re,r,rp,chk)
local lv=1
local list={}
while lv<=6 do
local b1=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31000002,0,TYPES_TOKEN_MONSTER,0,0,lv,RACE_PSYCHIC,ATTRIBUTE_DARK,POS_FACEUP,1-tp)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c31000017.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp)
if b1 or b2 then table.insert(list,lv) end
lv=lv+1
end
if chk==0 then return #list end
lv=Duel.AnnounceNumber(tp,table.unpack(list))
e:SetLabel(lv)
end
function c31000017.activate(e,tp,eg,ep,ev,re,r,rp)
local op=0
local c=e:GetHandler()
local fid=c:GetFieldID()
local lv=e:GetLabel()
local b1=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,31000002,0,TYPES_TOKEN_MONSTER,0,0,lv,RACE_PSYCHIC,ATTRIBUTE_DARK,POS_FACEUP,1-tp)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c31000017.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp)
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(31000017,0),aux.Stringid(31000017,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(31000017,0))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(31000017,1))+1
else return end
if op==0 then
local token=Duel.CreateToken(tp,31000002)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lv)
token:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
token:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
token:RegisterEffect(e4,true)
local e5=e2:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e5,true)
local e6=e2:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
token:RegisterEffect(e6,true)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP) end
else
local g=Duel.GetMatchingGroup(c31000017.spfilter,tp,LOCATION_DECK,0,nil,lv,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc then Duel.IsPlayerCanSpecialSummon(tp,0,POS_FACEUP,tp,tc)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
tc:RegisterFlagEffect(31000017,RESET_EVENT+RESETS_STANDARD,0,1,fid)
end
end
end
\ No newline at end of file
--Fallacio Non Sequitur
function c31000018.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,31000018+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c31000018.condition)
e1:SetOperation(c31000018.activate)
c:RegisterEffect(e1)
--Set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(c31000018.setcon)
e2:SetTarget(c31000018.settg)
e2:SetOperation(c31000018.setop)
c:RegisterEffect(e2)
if not c31000018.global_check then
c31000018.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_TO_GRAVE)
ge1:SetOperation(c31000018.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c31000018.condition(e,tp,eg,ep,ev,re,r,rp)
local filter=function(c)
return c:IsSetCard(0x308) and c:IsSummonLocation(LOCATION_EXTRA)
end
return Duel.GetMatchingGroupCount(filter,tp,LOCATION_MZONE,0,nil)>0
end
function c31000018.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x308))
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
Duel.RegisterEffect(e3,tp)
end
function c31000018.checkfilter(c,tp)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER) and c:IsControler(tp)
end
function c31000018.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(c31000018.checkfilter,1,nil,0) then Duel.RegisterFlagEffect(0,31000018,RESET_PHASE+PHASE_END,0,1) end
if eg:IsExists(c31000018.checkfilter,1,nil,1) then Duel.RegisterFlagEffect(1,31000018,RESET_PHASE+PHASE_END,0,1) end
end
function c31000018.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,31000018)~=0
end
function c31000018.filter(c)
return c:IsSetCard(0x308) and c:IsType(TYPE_MONSTER)
end
function c31000018.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroupCount(c31000018.filter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return e:GetHandler():IsAbleToHand() and g>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function c31000018.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c31000018.filter,tp,LOCATION_GRAVE,0,nil)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,tp,2,REASON_EFFECT)
Duel.SSet(tp,e:GetHandler())
end
\ No newline at end of file
......@@ -5378,7 +5378,7 @@ function cm.ActivatedAsSpellorTrapCheck(c)
local xe={rc:IsHasEffect(53765099)}
local b=false
local seq,typ=0,0
for _,v in pairs(xe) do if rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
for _,v in pairs(xe) do if v:GetLabelObject() and rc==v:GetLabelObject():GetHandler() then b=true seq,typ=v:GetLabel() end end
if b and typ and typ~=0 and rc:IsHasEffect(53765098) then
local e1=Effect.CreateEffect(rc)
e1:SetCode(EFFECT_CHANGE_TYPE)
......@@ -6189,13 +6189,13 @@ function cm.HelltakerActivate(c,code)
return ADHT_MoveToField(sc,mp,tp,dest,pos,bool,czone)
end
ADHT_GetLocationCount=Duel.GetLocationCount
Duel.GetLocationCount=function(tp,loc,...)
local ct=ADHT_GetLocationCount(tp,loc,...)
if ad_ht_zc then ct=ct+ad_ht_zc end
Duel.GetLocationCount=function(...)
local ct=ADHT_GetLocationCount(...)+ad_ht_zc
return ct
end
end
end
ad_ht_zc=0
function cm.HTAfactarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
......@@ -6256,7 +6256,7 @@ function cm.HTAmvop(e,tp,eg,ep,ev,re,r,rp)
for _,v in pairs(pe) do
local val=v:GetValue()
if aux.GetValueType(val)=="number" then val=aux.TRUE end
v:SetValue(cm.bchval(val,e1))
v:SetValue(cm.AASTbchval(val,e1))
end
local zone=0xff
if te:IsActiveType(TYPE_PENDULUM) then zone=0x11 end
......@@ -6369,22 +6369,24 @@ function cm.HTAfaccost(_cost,fe,zone)
if aux.GetValueType(val)=="number" or val(v,fe,tp) then check=false end
end
if not check then
ad_ht_zc=nil
ad_ht_zc=0
return false
end
ad_ht_zc=0
local c=e:GetHandler()
local xe={c:IsHasEffect(53765099)}
for _,v in pairs(xe) do v:Reset() end
if te:IsActiveType(TYPE_QUICKPLAY) and Duel.GetTurnPlayer()~=tp and not c:IsHasEffect(EFFECT_QP_ACT_IN_NTPHAND) then return false end
if te:IsActiveType(TYPE_TRAP) and not c:IsHasEffect(EFFECT_TRAP_ACT_IN_HAND) then return false end
if not c:CheckUniqueOnField(tp) then return false end
ad_ht_zc=1
if not Duel.IsExistingMatchingCard(cm.HTAmvfilter,tp,LOCATION_SZONE,0,1,nil,e,tp,zone) then
ad_ht_zc=nil
ad_ht_zc=0
return false
end
local res=false
if _cost(e,te,tp) then res=true end
ad_ht_zc=nil
ad_ht_zc=0
--Debug.Message(res)
return res
end
......
......@@ -19,7 +19,7 @@ function c71401001.initial_effect(c)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401001,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
......@@ -68,8 +68,10 @@ function c71401001.filter2(c,e,tp,check)
and (c:IsAbleToHand() or check and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function c71401001.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.IsExistingMatchingCard(c71401001.filter2ext,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(c71401001.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,check) end
if chk==0 then
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
return Duel.IsExistingMatchingCard(c71401001.filter2ext,tp,LOCATION_ONFIELD,0,1,nil) and Duel.IsExistingMatchingCard(c71401001.filter2,tp,LOCATION_DECK,0,1,nil,e,tp,check)
end
end
function c71401001.op2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -25,23 +25,26 @@ function c71401002.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(71401001,tp,ACTIVITY_CHAIN)==0 end
yume.RegButterflyCostLimit(e,tp)
end
function c71401002.filter2(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsAbleToHand() or not c:IsForbidden() and c:CheckUniqueOnField(tp))
function c71401002.filter2(c,tp,check)
return c:IsRace(RACE_SPELLCASTER) and c:IsLevel(4) and c:IsAttribute(ATTRIBUTE_DARK) and (c:IsAbleToHand() or check and not c:IsForbidden() and c:CheckUniqueOnField(tp))
end
function c71401002.filter2a(c)
return c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function c71401002.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401002.filter2a,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(c71401002.filter2,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if chk==0 then
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
return Duel.IsExistingMatchingCard(c71401002.filter2a,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) and Duel.IsExistingMatchingCard(c71401002.filter2,tp,LOCATION_DECK,0,1,nil,tp,check)
end
end
function c71401002.op2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,c71401002.filter2,tp,LOCATION_DECK,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,c71401002.filter2,tp,LOCATION_DECK,0,1,1,nil,tp,check)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
local b2=check and not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401001,5))==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
......
......@@ -5,7 +5,7 @@ function c71401003.initial_effect(c)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71401003,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
......@@ -31,23 +31,26 @@ function c71401003.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Remove(g,POS_FACEUP,REASON_COST)
yume.RegButterflyCostLimit(e,tp)
end
function c71401003.filter2(c,tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsAbleToHand() or not c:IsForbidden() and c:CheckUniqueOnField(tp))
function c71401003.filter2(c,tp,check)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsAbleToHand() or check and not c:IsForbidden() and c:CheckUniqueOnField(tp))
end
function c71401003.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c71401003.filter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
if chk==0 then
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
return Duel.IsExistingMatchingCard(c71401003.filter2,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,tp,check)
end
end
function c71401003.filter2a(c)
return c:IsAbleToRemove() and c:IsFaceup()
end
function c71401003.op2(e,tp,eg,ep,ev,re,r,rp)
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c71401003.filter2),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c71401003.filter2),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,tp,check)
local tc=g:GetFirst()
if tc then
local b1=tc:IsAbleToHand()
local b2=not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
local b2=check and not tc:IsForbidden() and tc:CheckUniqueOnField(tp)
local flag=0
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401001,4))==0) then
flag=Duel.SendtoHand(tc,nil,REASON_EFFECT)
......
......@@ -40,8 +40,8 @@ end
function c71401012.filter2a(c)
return c:IsFaceup() and c:GetType() & 0x20004==0x20004
end
function c71401012.filter2b(c, tp)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4) and (c:IsAbleToHand() or not c:IsForbidden() and c:CheckUniqueOnField(tp))
function c71401012.filter2b(c,tp,check)
return c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4) and (c:IsAbleToHand() or check and not c:IsForbidden() and c:CheckUniqueOnField(tp))
end
function c71401012.op2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -59,14 +59,15 @@ function c71401012.op2(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local og=Duel.GetMatchingGroup(c71401012.filter2b,tp,LOCATION_DECK,0,nil, tp)
local og=Duel.GetMatchingGroup(c71401012.filter2b,tp,LOCATION_DECK,0,nil,tp,check)
local check=Duel.GetLocationCount(tp,LOCATION_SZONE)>0
if Duel.IsExistingMatchingCard(c71401012.filter2a,tp,LOCATION_ONFIELD,0,1,nil) and og:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(71401012,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local oc=og:Select(tp,1,1,nil):GetFirst()
if oc then
local b1=oc:IsAbleToHand()
local b2=not oc:IsForbidden() and oc:CheckUniqueOnField(tp)
local b2=check and not oc:IsForbidden() and oc:CheckUniqueOnField(tp)
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(71401001,4))==0) then
Duel.SendtoHand(oc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,oc)
......
......@@ -104,6 +104,6 @@ function c71401014.op3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,Group.FromCards(tc,c),tp,POS_FACEDOWN)
rg:AddCard(tc)
Duel.Remove(rg,POS_FACEUP,POS_FACEDOWN)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -26,7 +26,6 @@ function c72100117.initial_effect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetRange(LOCATION_REMOVED)
e4:SetCountLimit(1,72100117)
e4:SetCondition(c72100117.thcon)
e4:SetCost(c72100117.thcost)
e4:SetTarget(c72100117.thtg)
......
......@@ -7,6 +7,7 @@ function c72100118.initial_effect(c)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,72100117)
e1:SetCondition(c72100118.discon)
e1:SetCost(c72100118.discost)
e1:SetTarget(c72100118.distg)
......@@ -29,6 +30,7 @@ function c72100118.initial_effect(c)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,72100119)
e5:SetTarget(c72100118.target)
e5:SetOperation(c72100118.operation)
c:RegisterEffect(e5)
......
......@@ -39,11 +39,14 @@ end
function c72100119.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_REMOVED,0,nil,0x105)==4
Duel.GetMatchingGroupCount(c72100119.mmmfilter,c:GetControler(),LOCATION_REMOVED,0,nil)==4
end
function c72100119.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function c72100119.mmmfilter(c)
return c:IsSetCard(0x105) and c:IsType(TYPE_MONSTER)
end
function c72100119.filter(c)
return c:IsSetCard(0x105) and c:IsAbleToHand()
end
......
......@@ -935,7 +935,6 @@
!setname 0xb81 交界
#片内ふの
!setname 0x308 谬物
#饼干猫 305
!setname 0x308 辉刻
......
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