Commit bcc83094 authored by Momobako's avatar Momobako

Merge branch 'master' of https://github.com/purerosefallen/ygopro-222DIY into beta

parents 949b93a2 eec081d9
......@@ -30,8 +30,10 @@ premake5.exe
/irrklang
/irrlicht-1.8.4
/irrlicht
/lua-5.2.4
/lua-5.3.4
/expansions/pics
/pics
/premake5
/lua
/data
\ No newline at end of file
/data
No preview for this file type
......@@ -65,7 +65,7 @@ function c10970005.spfilter(c,e,tp)
end
function c10970005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,10970005)==0 and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c10970005.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
and Duel.IsExistingMatchingCard(c10970005.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
Duel.RegisterFlagEffect(tp,10970005,RESET_PHASE+PHASE_END,0,1)
end
......
--天逆毎·稀神探女
function c1103000.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_FAIRY),4,2)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103000,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c1103000.cost)
e1:SetTarget(c1103000.target)
e1:SetOperation(c1103000.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103000,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c1103000.spcon)
e2:SetTarget(c1103000.sptg)
e2:SetOperation(c1103000.spop)
c:RegisterEffect(e2)
--atk
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103000,2))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c1103000.cost1)
e1:SetOperation(c1103000.operation1)
c:RegisterEffect(e1)
end
function c1103000.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttackAnnouncedCount()==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1,true)
end
function c1103000.operation1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
function c1103000.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c1103000.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsAbleToHand()
end
function c1103000.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1103000.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function c1103000.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c1103000.filter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c1103000.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetOverlayCount()>0
end
function c1103000.cfilter(c)
return c:IsSetCard(0xa240) and c:GetCode()~=1103000
end
function c1103000.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)
and Duel.IsExistingMatchingCard(c1103000.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c1103000.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c1103000.cfilter,tp,LOCATION_GRAVE,0,1,nil) then return end
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--逆轉的命運之輪·稀神探女
function c1103002.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xa240),4,2)
c:EnableReviveLimit()
--Attach
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103002,3))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetCondition(c1103002.xyzcon)
e2:SetTarget(c1103002.xyztg)
e2:SetOperation(c1103002.xyzop)
c:RegisterEffect(e2)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c1103002.reptg)
c:RegisterEffect(e2)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103002,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetCode(EVENT_DETACH_MATERIAL)
e2:SetCondition(c1103002.damcon)
e2:SetTarget(c1103002.damtg)
e2:SetOperation(c1103002.damop)
c:RegisterEffect(e2)
--disable
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(c1103002.cost)
e3:SetTarget(c1103002.target)
e3:SetOperation(c1103002.operation)
c:RegisterEffect(e3)
end
function c1103002.xyzcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
e:SetLabelObject(tc)
return tc:IsLocation(LOCATION_GRAVE) and tc:IsType(TYPE_MONSTER) and tc:IsReason(REASON_BATTLE)
end
function c1103002.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetLabelObject()
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,tc,1,0,0)
end
function c1103002.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Overlay(c,tc)
end
end
function c1103002.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) end
if Duel.SelectYesNo(tp,aux.Stringid(1103002,0)) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
return true
else return false end
end
function c1103002.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()==0
end
function c1103002.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and e:GetHandler():IsFaceup() end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,1000)
end
function c1103002.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
function c1103002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c1103002.filter(c)
return c:IsFaceup() and c:GetAttack()>0
end
function c1103002.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c1103002.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1103002.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c1103002.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c1103002.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 and tc:IsControler(1-tp) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
end
--天探女·稀神探女
function c1103003.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsSetCard,0xa240),1)
c:EnableReviveLimit()
--act limit
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103003,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c1103003.limcon)
e2:SetTarget(c1103003.limtg)
e2:SetOperation(c1103003.limop)
c:RegisterEffect(e2)
--swap
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103003,2))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetCondition(c1103003.condition)
e1:SetTarget(c1103003.target)
e1:SetOperation(c1103003.operation)
c:RegisterEffect(e1)
--Negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103003,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c1103003.negcon)
e2:SetCost(c1103003.negcost)
e2:SetTarget(c1103003.negtg)
e2:SetOperation(c1103003.negop)
c:RegisterEffect(e2)
end
function c1103003.limcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function c1103003.limtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetChainLimit(c1103003.chainlm)
end
function c1103003.chainlm(e,rp,tp)
return tp==rp
end
function c1103003.limop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(c1103003.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c1103003.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function c1103003.filter(c)
return c:IsFaceup()
end
function c1103003.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c1103003.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1103003.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c1103003.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
function c1103003.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SWAP_AD)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c1103003.aclimit(e,re,tp)
return re:GetHandler():IsOnField() or re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c1103003.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp and Duel.IsChainNegatable(ev)
end
function c1103003.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c1103003.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c1103003.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_POSITION)
e1:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(POS_FACEUP_DEFENSE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
--cannot change position
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e2)
end
\ No newline at end of file
--稀神探女·烏合之咒
function c1103004.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103004,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c1103004.target)
e1:SetOperation(c1103004.operation)
c:RegisterEffect(e1)
--disable&destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e2:SetTarget(c1103004.distg)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SELF_DESTROY)
c:RegisterEffect(e3)
--disable effect
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAIN_SOLVING)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(c1103004.disop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(1103004,1))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CVAL_CHECK)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetCondition(c1103004.spcon)
e5:SetCost(c1103004.spcost)
e5:SetTarget(c1103004.sptg)
e5:SetOperation(c1103004.spop)
e5:SetValue(c1103004.valcheck)
c:RegisterEffect(e5)
end
function c1103004.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_DARK) and c:GetAttack()==1000 and c:IsSummonable(true,nil) and c:GetCode()~=1103004
end
function c1103004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1103004.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c1103004.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c1103004.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c1103004.distg(e,c)
if not c:IsType(TYPE_TRAP) or c:GetCardTargetCount()==0 then return false end
return c:GetCardTarget():IsContains(e:GetHandler())
end
function c1103004.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if not rc:IsType(TYPE_TRAP) then return end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g and g:IsContains(e:GetHandler()) then
Duel.NegateEffect(ev)
if rc:IsRelateToEffect(re) then
Duel.Destroy(rc,REASON_EFFECT)
end
end
end
function c1103004.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c1103004.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c1103004.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetFlagEffect(tp,1103004)==0 then
Duel.RegisterFlagEffect(tp,1103004,RESET_CHAIN,0,1)
c1103004[0]=Duel.GetMatchingGroupCount(c1103004.cfilter,tp,LOCATION_ONFIELD,0,nil)
c1103004[1]=0
end
return c1103004[0]-c1103004[1]>=3
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1103004.cfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c1103004.spfilter(c,e,tp)
return c:IsSetCard(0xa240) and c:GetLevel()==4 and c:GetCode()~=1103004 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103004.afilter1(c,g)
return g:IsExists(c1103004.afilter2,1,c,c:GetAttack())
end
function c1103004.afilter2(c,atk)
return c:GetAttack()==atk
end
function c1103004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c1103004.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 and g:IsExists(c1103004.afilter1,1,nil,g)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c1103004.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c1103004.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
local dg=g:Filter(c1103004.afilter1,nil,g)
if dg:GetCount()>=1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc1=dg:Select(tp,1,1,nil):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc2=dg:FilterSelect(tp,c1103004.afilter2,1,1,tc1,tc1:GetAttack()):GetFirst()
Duel.SpecialSummonStep(tc1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonStep(tc2,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
Duel.SpecialSummonComplete()
end
end
function c1103004.valcheck(e)
c1103004[1]=c1103004[1]+3
end
--稀神探女·烏合之逆咒
function c1103005.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103005,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c1103005.target)
e1:SetOperation(c1103005.operation)
c:RegisterEffect(e1)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa240))
e3:SetValue(c1103005.atkval)
c:RegisterEffect(e3)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103005,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCondition(c1103005.spcon)
e1:SetCost(c1103005.spcost)
e1:SetTarget(c1103005.sptg)
e1:SetOperation(c1103005.spop)
c:RegisterEffect(e1)
end
function c1103005.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_DARK) and c:GetAttack()==1000
and c:GetCode()~=1103005 and c:IsSummonable(true,nil)
end
function c1103005.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1103005.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c1103005.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c1103005.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c1103005.atkfilter(c)
return c:IsFaceup() and (c:IsRace(RACE_FAIRY) or c:IsSetCard(0xa240))
end
function c1103005.atkval(e,c)
return Duel.GetMatchingGroupCount(c1103005.atkfilter,c:GetControler(),LOCATION_MZONE,0,nil)*100
end
function c1103005.spcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c1103005.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c1103005.spfilter(c,e,tp)
return c:IsSetCard(0xa240) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(1103005)
end
function c1103005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c1103005.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function c1103005.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1103005.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
--稀神探女·烏合之二重咒
function c1103006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103006,0))
e1:SetCategory(CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,1103006)
e1:SetCost(c1103006.cost)
e1:SetTarget(c1103006.target)
e1:SetOperation(c1103006.operation)
c:RegisterEffect(e1)
--double attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103006,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCountLimit(1,10963005)
e2:SetCondition(c1103006.spcon)
e2:SetTarget(c1103006.sptg)
e2:SetOperation(c1103006.spop)
c:RegisterEffect(e2)
end
function c1103006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c1103006.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsLevelBelow(4) and c:GetAttack()==1000 and c:IsAbleToHand()
end
function c1103006.filter1(c,g)
return g:IsExists(Card.IsCode,1,c,c:GetCode())
end
function c1103006.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c1103006.filter,tp,LOCATION_DECK,0,nil)
return g:IsExists(c1103006.filter1,1,nil,g)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c1103006.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c1103006.filter,tp,LOCATION_DECK,0,nil)
local sg=g:Filter(c1103006.filter1,nil,g)
if sg:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local hg=sg:Select(tp,1,1,nil)
local hc=sg:Filter(Card.IsCode,hg:GetFirst(),hg:GetFirst():GetCode()):GetFirst()
hg:AddCard(hc)
Duel.SendtoHand(hg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,hg)
--
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c1103006.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c1103006.splimit(e,c)
return not c:IsSetCard(0xa240)
end
function c1103006.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c1103006.spfilter(c,e,tp)
return (c:IsRace(RACE_FAIRY) or c:IsSetCard(0xa240)) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103006.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c1103006.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1103006.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1103006.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1103006.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_DEFENSE)
end
end
--稀神探女·眾神的彈冠
function c1103007.initial_effect(c)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c1103007.sptg)
e1:SetOperation(c1103007.spop)
c:RegisterEffect(e1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103007,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c1103007.spcon)
e1:SetTarget(c1103007.sptg2)
e1:SetOperation(c1103007.spop2)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103007,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c1103007.descost)
e2:SetTarget(c1103007.destg)
e2:SetOperation(c1103007.desop)
c:RegisterEffect(e2)
end
function c1103007.filter(c,e,tp)
local lv=c:GetLevel()
return lv>0 and lv<=4 and c:IsSetCard(0xa240) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c1103007.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1103007.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1103007.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1103007.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetOperation(c1103007.desop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
tc:RegisterEffect(e1)
end
end
function c1103007.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c1103007.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsReason(REASON_BATTLE+REASON_EFFECT)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
function c1103007.spfilter(c,e,tp)
return c:IsSetCard(0xa240) and c:GetLevel()==4 and c:GetCode()~=1103007 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103007.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1103007.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c1103007.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1103007.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c1103007.cfilter(c,tp)
return (c:IsRace(RACE_FAIRY) or c:IsSetCard(0xa240)) and (c:IsControler(tp) or c:IsFaceup())
end
function c1103007.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c1103007.cfilter,1,nil,tp) end
local sg=Duel.SelectReleaseGroup(tp,c1103007.cfilter,1,1,nil,tp)
Duel.Release(sg,REASON_COST)
end
function c1103007.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c1103007.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--绀珠传·地狱之蚀
function c1103008.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103008,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c1103008.target)
e1:SetOperation(c1103008.operation)
c:RegisterEffect(e1)
--syn
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(c1103008.target1)
e2:SetCode(EFFECT_SYNCHRO_LEVEL)
e2:SetValue(c1103008.slevel)
c:RegisterEffect(e2)
--xyz
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c1103008.target1)
e3:SetCode(EFFECT_XYZ_LEVEL)
e3:SetValue(c1103008.xyzlv)
c:RegisterEffect(e3)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103008,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,90432164)
e2:SetCost(c1103008.thcost)
e2:SetTarget(c1103008.thtg)
e2:SetOperation(c1103008.thop)
c:RegisterEffect(e2)
end
function c1103008.target1(e,c)
return c:IsSetCard(0xa240)
end
function c1103008.slevel(e,c)
local lv=e:GetHandler():GetLevel()
return 5*65536+lv
end
function c1103008.xyzlv(e,c,rc)
return 0x50000+e:GetHandler():GetLevel()
end
function c1103008.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttribute(ATTRIBUTE_DARK) and c:GetAttack()==1000
and c:GetCode()~=1103008 and c:IsSummonable(true,nil)
end
function c1103008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1103008.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c1103008.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c1103008.filter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function c1103008.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c1103008.thfilter(c)
return c:IsSetCard(0xa240) and not c:IsCode(1103008) and c:IsAbleToHand()
end
function c1103008.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1103008.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c1103008.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c1103008.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
--绀珠传·幽冥仙女
function c1103009.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xa240),5,2)
c:EnableReviveLimit()
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c1103009.immval)
c:RegisterEffect(e3)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCost(c1103009.adcost)
e2:SetTarget(c1103009.adtg)
e2:SetOperation(c1103009.adop)
c:RegisterEffect(e2)
--revive
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103009,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c1103009.cost)
e1:SetTarget(c1103009.target)
e1:SetOperation(c1103009.operation)
c:RegisterEffect(e1)
end
function c1103009.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated()
and te:GetOwner():GetBaseDefense()<=3000 and te:GetOwner():GetBaseAttack()>=0
end
function c1103009.adcost(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 c1103009.mtfilter(c)
return c:IsFaceup()
end
function c1103009.adtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1103009.mtfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1103009.mtfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c1103009.mtfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c1103009.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
--e4:SetCategory(CATEGORY_DESTROY)
e4:SetDescription(aux.Stringid(79861914,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetOperation(c1103009.desop)
tc:RegisterEffect(e4)
end
end
function c1103009.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c1103009.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c1103009.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xa240) and c:IsType(TYPE_XYZ) and not c:IsCode(1103009) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103009.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and c1103009.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1103009.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1103009.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,e:GetHandler(),e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1103009.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsRace(RACE_ZOMBIE) and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--绀珠传·月狂之枪
function c1103010.initial_effect(c)
--act limit
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103010,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BECOME_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,1103010)
e1:SetCondition(c1103010.descon)
e1:SetCost(c1103010.descost)
e1:SetTarget(c1103010.destg)
e1:SetOperation(c1103010.desop)
c:RegisterEffect(e1)
--battle indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--pierce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e3)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(1103010,1))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_GRAVE)
e4:SetCountLimit(1,1103010)
e4:SetCondition(c1103010.negcon)
e4:SetCost(c1103010.negcost)
e4:SetTarget(c1103010.negtg)
e4:SetOperation(c1103010.negop)
c:RegisterEffect(e4)
end
function c1103010.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE) and tc:IsFaceup() and tc:IsSetCard(0xa240) and tc:IsType(TYPE_MONSTER)
end
function c1103010.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c1103010.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c1103010.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c1103010.tfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsFaceup() and c:IsSetCard(0xa240)
end
function c1103010.negcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(c1103010.tfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function c1103010.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c1103010.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c1103010.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--绀珠传·九月的南瓜
function c1103011.initial_effect(c)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103011,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,1103011)
e2:SetCost(c1103011.indcost)
e2:SetTarget(c1103011.indtg)
e2:SetOperation(c1103011.indop)
c:RegisterEffect(e2)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
c:RegisterEffect(e1)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function c1103011.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c1103011.filter(c)
return c:IsFaceup() and c:IsSetCard(0xa240)
end
function c1103011.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c1103011.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1103011.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c1103011.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c1103011.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--绀珠传·地狱的女神
function c1103012.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsSetCard,0xa240),2)
c:EnableReviveLimit()
--Immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(c1103012.tgvalue)
c:RegisterEffect(e2)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(1103012,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(c1103012.descost)
e4:SetTarget(c1103012.destg)
e4:SetOperation(c1103012.desop)
c:RegisterEffect(e4)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c1103012.aclimit)
e2:SetCondition(c1103012.actcon)
c:RegisterEffect(e2)
end
function c1103012.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function c1103012.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function c1103012.tgvalue(e,re,rp)
return rp~=e:GetHandlerPlayer()
end
function c1103012.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
function c1103012.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c1103012.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sg=Duel.GetMatchingGroup(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local ct=Duel.Destroy(sg,REASON_EFFECT,LOCATION_REMOVED)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetValue(ct*300)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--绀珠传·永远的春梦
function c1103013.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),aux.NonTuner(Card.IsSetCard,0xa240),1)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c1103013.atkcon)
e1:SetValue(2000)
c:RegisterEffect(e1)
--cannot attack
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e2)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103013,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(c1103013.con)
e1:SetTarget(c1103013.tg)
e1:SetOperation(c1103013.op)
c:RegisterEffect(e1)
end
function c1103013.atkcon(e)
local c=e:GetHandler()
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_SZONE+LOCATION_HAND,0)==0
end
function c1103013.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c1103013.filter(c)
return c:IsSetCard(0xa240) and c:IsAbleToHand() and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c1103013.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1103013.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,0,1,0,LOCATION_DECK+LOCATION_GRAVE)
end
function c1103013.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c1103013.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--异界「黄昏薄暮」
function c1103014.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,1103014+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c1103014.activate)
c:RegisterEffect(e1)
--Effect Draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DRAW_COUNT)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetValue(2)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_SELF_TOGRAVE)
e3:SetCondition(c1103014.sdcon)
c:RegisterEffect(e3)
end
function c1103014.filter(c)
return c:IsSetCard(0xa240) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c1103014.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c1103014.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(1103014,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c1103014.sdfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa240) and not c:IsCode(1103014)
end
function c1103014.sdcon(e)
return not Duel.IsExistingMatchingCard(c1103014.sdfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
\ No newline at end of file
--纯符「纯粹弹幕地狱」
function c1103015.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c1103015.target1)
e1:SetOperation(c1103015.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103015,0))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1)
e2:SetHintTiming(0,0x1e0)
e2:SetCost(c1103015.cost)
e2:SetTarget(c1103015.target2)
e2:SetOperation(c1103015.operation)
e2:SetLabel(1)
c:RegisterEffect(e2)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa240))
e2:SetValue(c1103015.val)
c:RegisterEffect(e2)
end
function c1103015.tgfilter(c)
return c:IsSetCard(0xa240) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c1103015.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToHand() end
if chk==0 then return true end
if Duel.GetFlagEffect(tp,1103015)==0 and Duel.IsExistingMatchingCard(c1103015.tgfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.SelectYesNo(tp,94) then
e:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.RegisterFlagEffect(tp,1103015,RESET_PHASE+PHASE_END,0,1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
e:SetLabel(1)
else
e:SetCategory(0)
e:SetProperty(0)
e:SetLabel(0)
end
end
function c1103015.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,1103015)==0 end
Duel.RegisterFlagEffect(tp,1103015,RESET_PHASE+PHASE_END,0,1)
end
function c1103015.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToHand() end
if chk==0 then return Duel.IsExistingMatchingCard(c1103015.tgfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c1103015.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1103015.tgfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) then
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
function c1103015.val(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0xa240)*100
end
--玉符「众神的光辉弹冠」
function c1103016.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk/def down
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTarget(c1103016.atktg)
e3:SetValue(c1103016.atkval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(1103016,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,1103016)
e3:SetCost(c1103016.cost)
e3:SetTarget(c1103016.target)
e3:SetOperation(c1103016.operation)
c:RegisterEffect(e3)
end
function c1103016.atktg(e,c)
return not c:IsSetCard(0xa240)
end
function c1103016.vfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa240)
end
function c1103016.atkval(e,c)
return Duel.GetMatchingGroupCount(c1103016.vfilter,0,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)*-200
end
function c1103016.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xa240) and c:IsAbleToGraveAsCost()
end
function c1103016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(c1103016.cfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c1103016.cfilter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c1103016.filter(c,e,tp)
return c:IsLocation(LOCATION_DECK) and c:IsSetCard(0xa240) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103016.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c1103016.filter,tp,LOCATION_DECK,0,2,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c1103016.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(c1103016.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>=2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,2,2,nil)
local tc=sg:GetFirst()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=sg:GetNext()
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e2=e1:Clone()
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
--狱符「星光线条」
function c1103017.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c1103017.target)
e1:SetOperation(c1103017.activate)
c:RegisterEffect(e1)
end
function c1103017.filter(c,des)
return c:IsFaceup() and c:IsSetCard(0xa240) and (des or c:IsDestructable())
end
function c1103017.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c1103017.filter(chkc,false) end
if chk==0 then return Duel.IsExistingTarget(c1103017.filter,tp,LOCATION_MZONE,0,1,nil,false)
and Duel.IsExistingMatchingCard(c1103017.filter,tp,LOCATION_MZONE,0,2,nil,true) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c1103017.filter,tp,LOCATION_MZONE,0,1,1,nil,false)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c1103017.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
local g=Duel.GetMatchingGroup(c1103017.filter,tp,LOCATION_MZONE,0,nil,true)
local ac=g:GetFirst()
while ac do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0x1fe0000)
ac:RegisterEffect(e1)
ac=g:GetNext()
end
end
end
\ No newline at end of file
--赫卡提亚·拉碧斯拉祖利
function c1103022.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103022,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c1103022.spcon)
c:RegisterEffect(e1)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103022,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,1103022)
e1:SetCost(c1103022.spcost)
e1:SetTarget(c1103022.sptg)
e1:SetOperation(c1103022.spop)
c:RegisterEffect(e1)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1103022,1))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetHintTiming(0,0x1e0)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c1103022.eqtg)
e3:SetOperation(c1103022.eqop)
c:RegisterEffect(e3)
end
function c1103022.spfilter(c)
return c:IsSetCard(0xa240) and c:IsType(TYPE_MONSTER)
end
function c1103022.spcon(e,c)
if c==nil then return true end
if Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)<=0 then return false end
local g=Duel.GetMatchingGroup(c1103022.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>3
end
function c1103022.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c1103022.filter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0xa240)
and Duel.IsExistingMatchingCard(c1103022.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetCode())
end
function c1103022.filter2(c,e,tp,mc,code)
return c:IsRankBelow(4) and c:IsSetCard(0xa240) and not c:IsCode(code) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c1103022.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c1103022.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingTarget(c1103022.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c1103022.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c1103022.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<0 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1103022.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetCode())
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
function c1103022.eqfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAbleToChangeControler()
end
function c1103022.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c1103022.eqfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c1103022.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c1103022.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function c1103022.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsType(TYPE_EFFECT)) then return end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if Duel.Equip(tp,tc,c)==0 then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetValue(c1103016.eqlimit)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
else Duel.SendtoGrave(tc,REASON_EFFECT) end
end
function c1103022.eqlimit(e,c)
return e:GetOwner()==c
end
\ No newline at end of file
--绀珠传·原始的神灵界
function c1103023.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xa240),aux.NonTuner(Card.IsRace,RACE_FAIRY),1)
c:EnableReviveLimit()
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1103023,0))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetTarget(c1103023.target)
e2:SetOperation(c1103023.operation)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c1103023.immval)
c:RegisterEffect(e3)
--summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1103023,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetTarget(c1103023.sptg)
e3:SetOperation(c1103023.spop)
c:RegisterEffect(e3)
end
function c1103023.immval(e,te)
return te:GetOwner()~=e:GetHandler() and te:IsActiveType(TYPE_MONSTER) and te:IsActivated()
and te:GetOwner():GetBaseAttack()<=te:GetHandler():GetAttack()
end
function c1103023.filter(c)
return c:IsAbleToRemove()
end
function c1103023.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c1103023.filter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c1103023.filter,tp,0,LOCATION_GRAVE,1,120,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function c1103023.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local c=e:GetHandler()
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(ct*150)
c:RegisterEffect(e1)
end
end
function c1103023.spfilter(c,e,tp)
return c:GetCode(1103023) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c1103023.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE+LOCATION_DECK) and c1103023.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c1103023.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c1103023.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c1103023.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 c1103024.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1103024,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,1103024)
e1:SetCondition(c1103024.con)
e1:SetCost(c1103024.cost)
e1:SetTarget(c1103024.target)
e1:SetOperation(c1103024.operation)
c:RegisterEffect(e1)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,1103024)
e1:SetCondition(c1103024.condition)
e1:SetCost(c1103024.cost)
e1:SetTarget(c1103024.target)
e1:SetOperation(c1103024.operation)
c:RegisterEffect(e1)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c1103024.value1)
c:RegisterEffect(e3)
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c1103024.value2)
c:RegisterEffect(e3)
end
function c1103024.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c1103024.condition(e,tp,eg,ep,ev,re,r,rp)
local at=eg:GetFirst()
return at:IsFaceup() and at:IsControler(tp) and at:IsSetCard(0xa240)
end
function c1103024.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c1103024.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=Duel.GetAttacker()
local atk=tg:GetTextAttack()
if chk==0 then return tg:IsOnField() and tg:IsDestructable() end
Duel.SetTargetCard(tg)
if atk<0 then atk=0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function c1103024.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsAttackable() and not tc:IsStatus(STATUS_ATTACK_CANCELED) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
end
end
function c1103024.atkfilter0(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xa240)
end
function c1103024.value1(e,c)
return Duel.GetMatchingGroupCount(c1103024.atkfilter0,c:GetControler(),LOCATION_GRAVE,0,nil)*400
end
function c1103024.atkfilter1(c)
return not c:IsType(TYPE_MONSTER) and c:IsSetCard(0xa240)
end
function c1103024.value2(e,c)
return Duel.GetMatchingGroupCount(c1103024.atkfilter1,c:GetControler(),LOCATION_GRAVE,0,nil)*-400
end
\ No newline at end of file
--未确认幻想飞行少女
function c1156011.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156011.lkcheck,3,3,c1156011.lcheck)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1156011,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,1156011)
e1:SetCost(c1156011.cost1)
e1:SetTarget(c1156011.tg1)
e1:SetOperation(c1156011.op1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_REMOVED)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c1156011.con2)
e2:SetOperation(c1156011.op2)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(1156011,1))
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,1156011)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(c1156011.tg3)
e3:SetOperation(c1156011.op3)
c:RegisterEffect(e3)
--
end
--
function c1156011.lkcheck(c)
return c:IsType(TYPE_MONSTER) and (c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_XYZ) or c:IsType(TYPE_FUSION) or (c:IsType(TYPE_LINK) and c:GetLink()>1))
end
function c1156011.lcheck(g)
return g:GetClassCount(Card.GetCode)==g:GetCount()
end
--
function c1156011.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
e:GetHandler():RegisterFlagEffect(1156011,0x1fe1000+RESET_CHAIN,0,1)
end
--
function c1156011.tfilter1(c,e,tp)
return c:IsFacedown() and c:IsCanBeSpecialSummoned(e,0,tp,false,true) and Duel.GetLocationCountFromEx(tp,tp,e:GetHandler(),c)>0 and (((c:IsType(TYPE_SYNCHRO) or c:IsType(TYPE_FUSION)) and c:GetLevel()<7) or (c:IsType(TYPE_XYZ) and c:GetRank()<7) or (c:IsType(TYPE_LINK) and c:GetLink()<4)) and not c:IsCode(1156011)
end
function c1156011.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1156011.tfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
--
function c1156011.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1156011.tfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.SpecialSummonStep(tc,0,tp,tp,false,true,POS_FACEUP) then
local e1_1=Effect.CreateEffect(e:GetHandler())
e1_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1_1:SetValue(1)
tc:RegisterEffect(e1_1,true)
if e:GetHandler():GetFlagEffect(1156011)>0 then
e:GetHandler():SetCardTarget(tc)
e:SetLabelObject(tc)
end
Duel.SpecialSummonComplete()
end
end
end
--
function c1156011.con2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function c1156011.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--
function c1156011.tfilter3(c)
return c:IsType(TYPE_MONSTER)
end
function c1156011.tg3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and c1156011.tfilter3(chkc) end
if chk==0 then return Duel.IsExistingTarget(c1156011.tfilter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c1156011.tfilter3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
end
--
function c1156011.op3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local code=tc:GetOriginalCode()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e3_1=Effect.CreateEffect(c)
e3_1:SetType(EFFECT_TYPE_SINGLE)
e3_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3_1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e3_1:SetCode(EFFECT_CHANGE_CODE)
e3_1:SetValue(code)
c:RegisterEffect(e3_1)
c:CopyEffect(code,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
end
end
--
--水难事故的念缚灵
function c1156012.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156012.lkcheck,2,2)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c1156012.con1)
e1:SetTarget(c1156012.tg1)
e1:SetOperation(c1156012.op1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(c1156012.con2)
e2:SetValue(c1156012.limit2)
c:RegisterEffect(e2)
--
end
--
function c1156012.lkcheck(c)
return c:IsType(TYPE_MONSTER) and c:IsAttribute(ATTRIBUTE_WATER) and c:GetSummonLocation()==LOCATION_GRAVE
end
--
function c1156012.con1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
--
function c1156012.tfilter1(c)
return c:IsAbleToGrave() and c:IsType(TYPE_MONSTER) and not (c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_ZOMBIE))
end
function c1156012.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(c1156012.tfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
--
function c1156012.ofilter1(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:GetOwner()==1-tp
end
function c1156012.op1(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c1156012.tfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if Duel.SendtoGrave(sg,REASON_EFFECT)~=0 then
local mg=sg:Filter(c1156012.ofilter1,nil,tp)
if mg:GetCount()>0 then
local num=mg:GetCount()
Duel.Damage(1-tp,num*500,REASON_EFFECT)
end
end
end
--
function c1156012.con2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSequence()>=5 and c:IsFaceup()
end
--
function c1156012.limit2(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and not (re:GetHandler():IsAttribute(ATTRIBUTE_WATER) and re:GetHandler():IsImmuneToEffect(e))
end
--
--小小的甜蜜毒药
function c1156013.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156013.lkcheck,2,2)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c1156013.splimit0)
c:RegisterEffect(e0)
--
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetDescription(aux.Stringid(1156013,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetOperation(c1156013.op2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(c1156013.tg1)
e1:SetLabelObject(e2)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(aux.imval1)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(c1156013.val4)
c:RegisterEffect(e4)
--
end
--
function c1156013.lkcheck(c)
return c:IsType(TYPE_MONSTER) and c:IsType(TYPE_EFFECT) and c:IsRace(RACE_PLANT)
end
--
function c1156013.splimit0(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
--
function c1156013.tg1(e,c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and not c:IsCode(1156013)
end
--
function c1156013.op2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(1156014,RESET_EVENT+0x1fe0000,0,1)
local num=c:GetFlagEffect(1156014)
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(-num*300)
e2_1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2_1)
Duel.BreakEffect()
if c:GetAttack()==0 then
Duel.NegateRelatedChain(c,RESET_TURN_SET)
local e2_2=Effect.CreateEffect(c)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetCode(EFFECT_DISABLE)
e2_2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2_2)
local e2_3=Effect.CreateEffect(c)
e2_3:SetType(EFFECT_TYPE_SINGLE)
e2_3:SetCode(EFFECT_DISABLE_EFFECT)
e2_3:SetValue(RESET_TURN_SET)
e2_3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2_3)
if Duel.Destroy(c,REASON_EFFECT)~=0 then
Duel.Recover(c:GetOwner(),c:GetBaseAttack(),REASON_EFFECT)
end
end
end
--
function c1156013.val4(e,te)
return te:IsActiveType(TYPE_MONSTER) and (c:GetFlagEffect(1156014)~=0 or c:IsStatus(STATUS_SPSUMMON_TURN))
end
--
--雾雨的魔法使
function c1156015.initial_effect(c)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c1156015.lkcon)
e0:SetOperation(c1156015.lkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1156015,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c1156015.con2)
e2:SetTarget(c1156015.tg2)
e2:SetOperation(c1156015.op2)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c1156015.value3)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(c1156015.tg4)
c:RegisterEffect(e4)
--
end
--
function c1156015.lkfilter(c,lc,tp)
local flag=c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
if c:IsType(TYPE_MONSTER) then
return flag and c:IsRace(RACE_SPELLCASTER)
else
return flag and c:IsType(TYPE_SPELL)
end
end
function c1156015.lvfilter(c)
if c:IsType(TYPE_LINK) and c:GetLink()>1 then
return 1+0x10000*c:GetLink()
else
return 1
end
end
--
function c1156015.lcheck(tp,sg,lc,minc,ct)
return ct>=minc and sg:CheckWithSumEqual(c1156015.lvfilter,lc:GetLink(),ct,ct) and Duel.GetLocationCountFromEx(tp,tp,sg,lc)>0
end
function c1156015.lkchenk(c,tp,sg,mg,lc,ct,minc,maxc)
sg:AddCard(c)
ct=ct+1
local res=c1156015.lcheck(tp,sg,lc,minc,ct) or (ct<maxc and mg:IsExists(c1156015.lkchenk,1,sg,tp,sg,mg,lc,ct,minc,maxc))
sg:RemoveCard(c)
ct=ct-1
return res
end
--
function c1156015.lkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c1156015.lkfilter,tp,LOCATION_ONFIELD,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
local pc=pe:GetHandler()
if not mg:IsContains(pc) then return false end
sg:AddCard(pc)
end
local ct=sg:GetCount()
local minc=3
local maxc=3
if ct>maxc then return false end
return c1156015.lcheck(tp,sg,c,minc,ct) or mg:IsExists(c1156015.lkchenk,1,nil,tp,sg,mg,c,ct,minc,maxc)
end
--
function c1156015.lkop(e,tp,eg,ep,ev,re,r,rp,c)
local mg=Duel.GetMatchingGroup(c1156015.lkfilter,tp,LOCATION_ONFIELD,0,nil,c,tp)
local sg=Group.CreateGroup()
for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_LMATERIAL)}) do
sg:AddCard(pe:GetHandler())
end
local ct=sg:GetCount()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
sg:Select(tp,ct,ct,nil)
local minc=3
local maxc=3
for i=ct,maxc-1 do
local cg=mg:Filter(c1156015.lkchenk,sg,tp,sg,mg,c,i,minc,maxc)
if cg:GetCount()==0 then break end
local minct=1
if c1156015.lcheck(tp,sg,c,minc,i) then
if not Duel.SelectYesNo(tp,210) then break end
minct=0
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g=cg:Select(tp,minct,1,nil)
if g:GetCount()==0 then break end
sg:Merge(g)
end
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
end
--
function c1156015.con2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
--
function c1156015.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
--
function c1156015.op2(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
if Duel.MoveToField(re:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEDOWN,true) then
Duel.ConfirmCards(1-tp,re:GetHandler())
Duel.RaiseEvent(re:GetHandler(),EVENT_SSET,e,REASON_EFFECT,tp,tp,0)
re:GetHandler():CancelToGrave()
end
end
end
--
function c1156015.vfilter3(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL)
end
function c1156015.value3(e,c)
local g=Duel.GetMatchingGroup(c1156015.vfilter3,c:GetControler(),LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local ct=g:GetCount()
return ct*200
end
--
function c1156015.tfilter4_1(c,e)
return c:GetEquipTarget(e:GetHandler()) and c:IsAbleToGrave()
end
function c1156015.tfilter4_2(c)
return c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL) and c:IsAbleToRemove()
end
function c1156015.tg4(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c1156015.tfilter4_1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e) or Duel.IsExistingMatchingCard(c1156015.tfilter4_2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
if Duel.SelectYesNo(tp,aux.Stringid(1156015,3)) then
if Duel.IsExistingMatchingCard(c1156015.tfilter4_1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e) and Duel.IsExistingMatchingCard(c1156015.tfilter4_2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) then
local sel=Duel.SelectOption(tp,aux.Stringid(1156015,1),aux.Stringid(1156015,2))
if sel==0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(1156015,1))
local g=Duel.SelectMatchingCard(tp,c1156015.tfilter4_1,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
return true
else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(1156015,2))
local g=Duel.SelectMatchingCard(tp,c1156015.tfilter4_2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
return true
end
else
if Duel.IsExistingMatchingCard(c1156015.tfilter4_1,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,e) and not Duel.IsExistingMatchingCard(c1156015.tfilter4_2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(1156015,1))
local g=Duel.SelectMatchingCard(tp,c1156015.tfilter4_1,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,e)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
return true
else
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(1156015,2))
local g=Duel.SelectMatchingCard(tp,c1156015.tfilter4_2,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
return true
end
end
else
return false
end
end
--
--永远与须臾的罪人
function c1156016.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156016.lcheck,3,4)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c1156016.splimit0)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c1156016.tg1)
e1:SetOperation(c1156016.op1)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1156016,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCost(c1156016.cost2)
e2:SetCondition(c1156016.con2)
e2:SetTarget(c1156016.tg2)
e2:SetOperation(c1156016.op2)
c:RegisterEffect(e2)
--
end
--
function c1156016.lcheck(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsRace(RACE_SPELLCASTER) and c:IsType(TYPE_EFFECT)
end
--
function c1156016.splimit0(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
--
function c1156016.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
--
function c1156016.op1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,1156016)
local c=e:GetHandler()
if c:IsFaceup() then
local res=Duel.TossCoin(tp,1)
c1156016.arcanareg(c,res)
end
end
function c1156016.arcanareg(c,coin)
--
local e1_1=Effect.CreateEffect(c)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_UPDATE_ATTACK)
e1_1:SetValue(1000)
e1_1:SetCondition(c1156016.con1_1)
e1_1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1_1)
--
local e1_2=Effect.CreateEffect(c)
e1_2:SetType(EFFECT_TYPE_SINGLE)
e1_2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1_2:SetValue(1)
e1_2:SetCondition(c1156016.con1_1)
c:RegisterEffect(e1_2)
--
local e1_3=Effect.CreateEffect(c)
e1_3:SetType(EFFECT_TYPE_SINGLE)
e1_3:SetCode(EFFECT_IMMUNE_EFFECT)
e1_3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1_3:SetRange(LOCATION_MZONE)
e1_3:SetCondition(c1156016.con1_1)
e1_3:SetValue(c1156016.efilter1_3)
c:RegisterEffect(e1_3)
--
local e1_4=Effect.CreateEffect(c)
e1_4:SetDescription(aux.Stringid(1156016,0))
e1_4:SetCategory(CATEGORY_REMOVE)
e1_4:SetType(EFFECT_TYPE_QUICK_O)
e1_4:SetCode(EVENT_CHAINING)
e1_4:SetRange(LOCATION_MZONE)
e1_4:SetReset(RESET_EVENT+0x1fe0000)
e1_4:SetCondition(c1156016.con1_4)
e1_4:SetTarget(c1156016.tg1_4)
e1_4:SetOperation(c1156016.op1_4)
c:RegisterEffect(e1_4)
--
c:RegisterFlagEffect(1156016,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,coin,63-coin)
end
--
function c1156016.con1_1(e)
return e:GetHandler():GetFlagEffectLabel(1156016)==1
end
function c1156016.efilter1_3(e,te)
return te:IsActiveType(TYPE_SPELL)
end
--
function c1156016.con1_4(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffectLabel(1156016)==0 and rp~=tp and Duel.IsChainNegatable(ev) and bit.band(re:GetActivateLocation(),LOCATION_ONFIELD)==0
end
function c1156016.tg1_4(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA+LOCATION_DECK)>0 end
end
function c1156016.op1_4(e,tp,eg,ep,ev,re,r,rp)
local code=re:GetHandler():GetCode()
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA+LOCATION_DECK)
Duel.ConfirmCards(tp,g)
local tg=g:Filter(Card.IsCode,nil,code)
if tg:GetCount()>0 then
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT)
end
end
--
function c1156016.cfilter2_1(c)
return c:IsFaceup() and c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end
function c1156016.cfilter2_2(c)
return c:IsType(TYPE_SPELL) and c:IsType(TYPE_EQUIP) and c:IsAbleToGraveAsCost()
end
function c1156016.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c1156016.cfilter2_1,tp,LOCATION_ONFIELD,0,1,nil) or Duel.IsExistingMatchingCard(c1156016.cfilter2_2,tp,LOCATION_HAND,0,1,nil) end
local g1=Duel.GetMatchingGroup(c1156016.cfilter2_1,tp,LOCATION_ONFIELD,0,nil)
local g2=Duel.GetMatchingGroup(c1156016.cfilter2_2,tp,LOCATION_HAND,0,nil)
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=g1:Select(tp,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
--
function c1156016.con2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==e:GetHandler():GetControler() or
Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
--
function c1156016.tg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(1156016)~=0 and c:GetFlagEffect(1156015)==0 end
end
--
function c1156016.op2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(1156015,RESET_CHAIN,0,1)
local c=e:GetHandler()
if c:IsFaceup() and c:GetFlagEffect(1156016)~=0 then
local val=c:GetFlagEffectLabel(1156016)
c:SetFlagEffectLabel(1156016,1-val)
end
end
--
--蓬莱人的外形
function c1156017.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156017.lcheck,2,4)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1156017,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,1156017)
e2:SetCondition(c1156017.con2)
e2:SetOperation(c1156017.op2)
c:RegisterEffect(e2)
--
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c1156017.tg1)
e1:SetOperation(c1156017.op1)
c:RegisterEffect(e1)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetOperation(c1156017.op3)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetOperation(c1156017.op4)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
--
end
--
function c1156017.lcheck(c)
return c:IsType(TYPE_EFFECT) and c:IsAttribute(ATTRIBUTE_FIRE)
end
--
function c1156017.cfilter2(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsReleasable() and c:IsType(TYPE_MONSTER)
end
function c1156017.con2(e,c)
if c==nil then return true end
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>-1 and Duel.IsExistingMatchingCard(c1156017.cfilter2,c:GetControler(),LOCATION_ONFIELD,0,1,nil)
end
--
function c1156017.op2(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,c1156017.cfilter2,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Release(g,nil,REASON_COST)
local e2_1=Effect.CreateEffect(e:GetHandler())
e2_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2_1:SetValue(1)
e2_1:SetReset(RESET_EVENT+0x1fe0000)
e:GetHandler():RegisterEffect(e2_1,true)
end
--
function c1156017.tfilter1(c)
return c:IsFaceup()
end
function c1156017.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(c1156017.tfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c1156017.tfilter1,tp,0,LOCATION_ONFIELD,1,1,nil)
end
--
function c1156017.op1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
end
end
--
function c1156017.op3(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then
e:SetLabel(1)
else e:SetLabel(0) end
end
--
function c1156017.op4(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local g=e:GetHandler():GetCardTarget()
local tc=g:GetFirst()
local gn=Group.CreateGroup()
while tc do
if tc:IsLocation(LOCATION_MZONE) then
gn:AddCard(tc)
end
tc=g:GetNext()
end
if gn:GetCount()>0 then
Duel.Destroy(gn,REASON_EFFECT)
end
end
--
--三途河畔的摆渡人
function c1156018.initial_effect(c)
--
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c1156018.lcheck,1)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPIRIT_MAYNOT_RETURN)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(1156018,0))
e2:SetType(EVENT_FREE_CHAIN+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,1156018)
e2:SetTarget(c1156018.tg2)
e2:SetOperation(c1156018.op2)
c:RegisterEffect(e2)
--
end
--
function c1156018.lcheck(c)
return c:IsType(TYPE_SPIRIT)
end
--
function c1156018.tfilter2(c,e,tp,zone)
return c:IsType(TYPE_SPIRIT) and c:IsCanBeSpecialSummoned(e,0,tp,true,true,zone)
end
function c1156018.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
local zone=e:GetHandler():GetLinkedZone()
if chk==0 then return Duel.IsExistingMatchingCard(c1156018.tfilter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,zone) and zone~=0 and Duel.GetTurnPlayer()==e:GetHandler():GetControler() end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
--
function c1156018.op2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,1156018)
local c=e:GetHandler()
local zone=c:GetLinkedZone()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1156018.tfilter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,zone)
if g:GetCount()>0 then
local tc=g:GetFirst()
local code=tc:GetCode()
if Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP,zone)~=0 then
local e2_1=Effect.CreateEffect(c)
e2_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2_1:SetValue(1)
e2_1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2_1,true)
local e2_2=Effect.CreateEffect(c)
e2_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetCode(EFFECT_CANNOT_TRIGGER)
e2_2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2_2,true)
end
end
end
......@@ -56,7 +56,7 @@ end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and bit.band(bc:GetBattlePosition(),POS_DEFENSE)~=0
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and (bc:GetBattlePosition() & POS_DEFENSE)~=0
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -50,7 +50,7 @@ function c14140011.descon2(e,tp,eg,ep,ev,re,r,rp)
return tc and eg:IsContains(tc)
end
function c14140011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -81,7 +81,7 @@ function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
local al=0xff
for i=0,4 do
local tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-i)
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-bit.band(al,2^i) end
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-(al & 2^i) end
end
Duel.Hint(HINT_SELECTMSG,0,m*16+3)
local op=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,al)
......@@ -117,12 +117,12 @@ function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if seq>0 then
local i=seq-1
local tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-i)
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-bit.band(al,2^i) end
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-(al & 2^i) end
end
if seq<4 then
local i=seq+1
local tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-i)
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-bit.band(al,2^i) end
if Duel.CheckLocation(tp,LOCATION_MZONE,i) and tc and tc:IsAbleToHand() then al=al-(al & 2^i) end
end
Duel.Hint(HINT_SELECTMSG,0,m*16+3)
local op=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,al)
......
......@@ -98,7 +98,7 @@ end
function cm.fscon(e,g,gc,chkfnf)
if g==nil then return true end
local sg=Group.CreateGroup()
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local mg=g:Filter(cm.fsfilter,nil,c)
......@@ -109,7 +109,7 @@ function cm.fscon(e,g,gc,chkfnf)
end
function cm.fsop(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local mg=eg:Filter(cm.fsfilter,nil,c)
local exg=Duel.GetMatchingGroup(cm.exfilter,tp,LOCATION_EXTRA,0,mg,c)
mg:Merge(exg)
......
......@@ -130,10 +130,10 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
Duel.Overlay(c,sg)
end
function cm.filter(c,e,tp)
return c:IsAbleToRemoveAsCost() and Duel.IsExistingTarget(cm.filter1,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,e:GetHandler(),bit.band(c:GetType(),0x7))
return c:IsAbleToRemoveAsCost() and Duel.IsExistingTarget(cm.filter1,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,e:GetHandler(),(c:GetType() & 0x7))
end
function cm.filter1(c,t)
return c:IsAbleToChangeControler() and not c:IsType(TYPE_TOKEN) and c:IsType(bit.band(t,0x7))
return c:IsAbleToChangeControler() and not c:IsType(TYPE_TOKEN) and c:IsType((t & 0x7)) and (c:IsType(TYPE_MONSTER) or c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.target0(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD+LOCATION_GRAVE) and cm.filter1(chkc,e:GetLabelObject():GetType()) and chkc~=e:GetHandler() and chkc:IsControler(1-tp) end
......@@ -172,7 +172,7 @@ function cm.cfilter(c,rtype)
return c:IsType(rtype) and c:IsAbleToRemoveAsCost()
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local rtype=bit.band(re:GetActiveType(),0x7)
local rtype=(re:GetActiveType() & 0x7)
local og=e:GetHandler():GetOverlayGroup():Filter(cm.cfilter,nil,rtype)
if chk==0 then return og:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
......
......@@ -53,7 +53,8 @@ function cm.xyzcheck(g)
return g:GetClassCount(Card.GetOriginalLevel)==g:GetCount()
end
function cm.filter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(1-tp)
--return c:IsLocation(LOCATION_GRAVE) and c:IsControler(1-tp)
return c:IsLocation(LOCATION_GRAVE)
end
function cm.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and eg:IsExists(cm.filter,1,e:GetHandler(),tp) end
......
......@@ -43,8 +43,8 @@ end
function cm.replace_register_effect(f)
return function(tc,e,forced)
local t=e:GetType()
if bit.band(t,EFFECT_TYPE_IGNITION)~=0 then
e:SetType(bit.bor(t-EFFECT_TYPE_IGNITION,EFFECT_TYPE_QUICK_O))
if (t & EFFECT_TYPE_IGNITION)~=0 then
e:SetType((t-EFFECT_TYPE_IGNITION | EFFECT_TYPE_QUICK_O))
e:SetCode(EVENT_FREE_CHAIN)
e:SetHintTiming(0,0x1e0)
end
......
......@@ -156,7 +156,7 @@ function scorp.hana_effect_register(c,e,m,tg,op)
e:SetCost(scorp.sethcost)
e:SetTarget(scorp.hana_target(tg,m))
e:SetOperation(scorp.hana_operation(op,m))
e:SetCategory(bit.band(e:GetCategory(),CATEGORY_SPECIAL_SUMMON))
e:SetCategory((e:GetCategory() & CATEGORY_SPECIAL_SUMMON))
c:RegisterEffect(e)
end
function scorp.hana_target(tg,m)
......
--逆行贝琳
function c17060907.initial_effect(c)
local m=17060907
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c17060907.matfilter,1)
aux.AddLinkProcedure(c,cm.matfilter,1)
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(c17060907.sumtg)
e1:SetTarget(cm.sumtg)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
......@@ -16,21 +18,24 @@ function c17060907.initial_effect(c)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c17060907.atkval)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
end
function c17060907.matfilter(c)
function cm.matfilter(c)
return c:GetLevel()==1 and c:IsType(TYPE_PENDULUM)
end
function c17060907.sumtg(e,c)
function cm.sumtg(e,c)
return c:IsType(TYPE_PENDULUM)
end
function c17060907.atkval(e,c)
function cm.atkval(e,c)
local g=e:GetHandler():GetLinkedGroup()
if g:GetCount()==0 then
return 0
else
local tg,val=g:GetMaxGroup(Card.GetBaseAttack)
return val/2
local tc=g:GetFirst()
local val=0
while tc do
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
val=val+atk
tc=g:GetNext()
end
return val/2
end
\ No newline at end of file
--沉寂的暗影
function c22200001.initial_effect(c)
--damage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22200001,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SSET)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCondition(c22200001.con)
e2:SetCost(c22200001.cost)
e2:SetTarget(c22200001.tg)
e2:SetOperation(c22200001.op)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22200001,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,22200001+EFFECT_COUNT_CODE_DUEL)
e3:SetTarget(c22200001.target)
e3:SetOperation(c22200001.operation)
c:RegisterEffect(e3)
if c22200001.counter==nil then
c22200001.counter=true
c22200001[0]=0
c22200001[1]=0
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e4:SetOperation(c22200001.resetcount)
Duel.RegisterEffect(e4,0)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_SSET)
e5:SetOperation(c22200001.addcount)
Duel.RegisterEffect(e5,0)
end
end
function c22200001.con(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and eg:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_DECK+LOCATION_GRAVE)
end
function c22200001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c22200001.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,eg,0,0,0)
end
function c22200001.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.SendtoHand(eg,nil,REASON_EFFECT)<1 then return end
Duel.BreakEffect()
--cannot set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SSET)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
--cannot trigger
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetTarget(c22200001.distg)
Duel.RegisterEffect(e3,tp)
end
function c22200001.distg(e,c)
return c:IsFacedown()
end
function c22200001.resetcount(e,tp,eg,ep,ev,re,r,rp)
c22200001[0]=0
c22200001[1]=0
end
function c22200001.adfilter(c)
return c:IsLocation(LOCATION_SZONE)
end
function c22200001.addcount(e,tp,eg,ep,ev,re,r,rp)
if rp==tp then return end
c22200001[rp]=c22200001[rp]+eg:FilterCount(c22200001.adfilter,nil)
end
function c22200001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return c22200001[1-tp]>2 and e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c22200001.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
\ No newline at end of file
--幽灵欺诈
function c22200002.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon proc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c22200002.hspcon)
e1:SetOperation(c22200002.hspop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c22200002.disable)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--move
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22200002,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c22200002.tg)
e2:SetOperation(c22200002.op)
c:RegisterEffect(e2)
end
function c22200002.spfilter(c)
local g=c:GetOverlayGroup()
return c:IsType(TYPE_XYZ) and g:GetCount()>0 and g:IsExists(Card.IsAbleToGraveAsCost,1,nil)
end
function c22200002.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22200002.spfilter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
function c22200002.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(22200002,0))
local g=Duel.SelectMatchingCard(tp,c22200002.spfilter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SendtoGrave(g:GetFirst():GetOverlayGroup(),REASON_COST) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(g:GetFirst():GetRank())
e1:SetReset(RESET_EVENT+0xfe0000)
c:RegisterEffect(e1)
end
function c22200002.disable(e,c)
return (c:IsType(TYPE_XYZ) or bit.band(c:GetOriginalType(),TYPE_XYZ)==TYPE_XYZ) and c:GetRank()==e:GetHandler():GetLevel()
end
function c22200002.filter(c)
return c:IsFaceup() and not c:IsType(TYPE_LINK)
end
function c22200002.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c22200002.filter(chkc) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c22200002.filter,tp,LOCATION_MZONE,0,1,e:GetHandler()) and Duel.GetMZoneCount(tp)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c22200002.filter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
end
function c22200002.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local c=e:GetHandler()
if not tc:IsRelateToEffect(e) or tc:IsControler(1-tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,nil)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4 end
Duel.MoveSequence(tc,nseq)
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(tc:GetRank()+tc:GetLevel())
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
end
\ No newline at end of file
--无尽连击
function c22201001.initial_effect(c)
--move
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_EQUIP)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c22201001.cost)
--e2:SetCondition(c22201001.con)
e2:SetTarget(c22201001.tg)
e2:SetOperation(c22201001.op)
c:RegisterEffect(e2)
end
--function c22201001.con(e,tp,eg,ep,ev,re,r,rp)
--local tp=e:GetHandler():GetControler()
--return Duel.GetLP(1-tp)-Duel.GetLP(tp)>=4000
--end
function c22201001.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetReset(RESET_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_DISABLED)
e2:SetOperation(c22201001.tgop)
e2:SetLabel(cid)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
end
function c22201001.tgop(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return end
e:GetOwner():CancelToGrave(false)
end
function c22201001.filter(c)
return c:IsFaceup() and c:IsAttackBelow(1500) and c:IsType(TYPE_NORMAL)
end
function c22201001.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c22201001.filter(chkc) end
if chk==0 then return e:IsHasType(EFFECT_TYPE_ACTIVATE)
and Duel.IsExistingTarget(c22201001.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c22201001.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c22201001.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c22201001.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if not tc:IsRelateToEffect(e) or tc:IsFacedown() then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
if not Duel.Equip(tp,c,tc,false) then return end
--eqlimit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EQUIP_LIMIT)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetValue(c22201001.eqlimit)
e4:SetReset(RESET_EVENT+0x1fe0000)
e4:SetLabelObject(tc)
c:RegisterEffect(e4)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
tc:RegisterEffect(e2)
--reduce
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetCondition(c22201001.rdcon)
e3:SetOperation(c22201001.rdop)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22201001,0))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_EQUIP+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetCondition(c22201001.eqcon)
e2:SetTarget(c22201001.eqtg)
e2:SetOperation(c22201001.eqop)
tc:RegisterEffect(e2)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22201001,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e2:SetCondition(aux.bdocon)
e2:SetTarget(c22201001.thtg)
e2:SetOperation(c22201001.thop)
tc:RegisterEffect(e2)
end
function c22201001.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttacker()==c
end
function c22201001.rdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==nil
end
function c22201001.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
end
function c22201001.eqfilter(c,ec)
return c:IsType(TYPE_EQUIP) and c:CheckEquipTarget(ec)
end
function c22201001.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local eqg=e:GetHandler():GetEquipGroup()
if chk==0 then return eqg:FilterCount(Card.IsDestructable,nil)>0 and Duel.IsExistingMatchingCard(c22201001.eqfilter,tp,LOCATION_HAND,0,1,nil,e:GetHandler()) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eqg,eqg:GetCount(),0,0)
end
function c22201001.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Destroy(c:GetEquipGroup(),REASON_EFFECT)<1 then return end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,c22201001.eqfilter,tp,LOCATION_HAND,0,1,1,nil,c)
local tc=g:GetFirst()
if tc then
if Duel.Equip(tp,tc,c) then
Duel.BreakEffect()
--Atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1000)
c:RegisterEffect(e1)
if not c:IsRelateToBattle() then return end
Duel.ChainAttack()
end
end
end
function c22201001.thfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function c22201001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c22201001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c22201001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c22201001.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
\ No newline at end of file
--盗骸者
function c22201101.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c22201101.cost)
e1:SetTarget(c22201101.target)
e1:SetOperation(c22201101.activate)
c:RegisterEffect(e1)
end
function c22201101.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.Remove(rg,POS_FACEUP,REASON_COST)
local rc=rg:GetFirst()
if rc:IsType(TYPE_MONSTER) then e:SetLabel(1)
elseif rc:IsType(TYPE_SPELL) then e:SetLabel(2)
elseif rc:IsType(TYPE_TRAP) then e:SetLabel(3)
else e:SetLabel(0)
end
end
function c22201101.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c22201101.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c22201101.tgfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c22201101.tgfilter,tp,0,LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectTarget(tp,c22201101.tgfilter,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,sg,sg:GetCount(),0,0)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
if e:GetLabel()==1 then Duel.SetChainLimit(c22201101.chainlimit1)
elseif e:GetLabel()==2 then Duel.SetChainLimit(c22201101.chainlimit2)
elseif e:GetLabel()==3 then Duel.SetChainLimit(c22201101.chainlimit3)
end
end
end
function c22201101.chainlimit1(e,rp,tp)
return not e:GetHandler():IsType(TYPE_MONSTER)
end
function c22201101.chainlimit2(e,rp,tp)
return not e:GetHandler():IsType(TYPE_SPELL)
end
function c22201101.chainlimit3(e,rp,tp)
return not e:GetHandler():IsType(TYPE_TRAP)
end
function c22201101.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
--if tc:IsLocation(LOCATION_HAND) then
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetLabelObject(tc)
e2:SetCountLimit(1)
e2:SetCondition(c22201101.drcon)
e2:SetTarget(c22201101.drtg)
e2:SetOperation(c22201101.drop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(e3,tp)
--end
end
function c22201101.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetLabelObject()) and ep==tp
end
function c22201101.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c22201101.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--子虚之罠
function c22202001.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c22202001.target)
e1:SetOperation(c22202001.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c22202001.handcon)
c:RegisterEffect(e2)
end
function c22202001.filter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function c22202001.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local a=Duel.GetMatchingGroupCount(c22202001.filter,tp,0,LOCATION_SZONE,nil)
if chk==0 then return a+b>0 end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(c22202001.chainlimit)
end
end
function c22202001.chainlimit(e,rp,tp)
return not (e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():IsType(TYPE_TRAP))
end
function c22202001.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_SZONE,nil)
Duel.ConfirmCards(tp,g1)
local g=g1:Filter(Card.IsType,nil,TYPE_TRAP)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
local code=tc:GetCode()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c22202001.aclimit)
e1:SetLabel(code)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
tc=g:GetNext()
end
if Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(22202001,0)) then
local dg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.Destroy(dg,REASON_EFFECT)
end
else
Duel.Draw(1-tp,1,REASON_EFFECT)
end
end
function c22202001.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsCode(e:GetLabel())
end
function c22202001.handcon(e)
local tp=e:GetHandlerPlayer()
for i=0,4 do
if Duel.GetFieldCard(tp,LOCATION_SZONE,i) then return false end
end
return Duel.GetTurnPlayer()==tp
end
\ No newline at end of file
--强制突破
function c22202101.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,22202101+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c22202101.con)
e1:SetOperation(c22202101.op)
c:RegisterEffect(e1)
--search
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_HAND)
e3:SetOperation(c22202101.handop)
c:RegisterEffect(e3)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c22202101.handcon)
c:RegisterEffect(e2)
end
function c22202101.con(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasCategory(CATEGORY_NEGATE) or re:IsHasCategory(CATEGORY_DISABLE) or re:IsHasCategory(CATEGORY_DISABLE_SUMMON)
end
function c22202101.filter(c,rtype)
return c:IsType(rtype) and c:IsAbleToGrave()
end
function c22202101.op(e,tp,eg,ep,ev,re,r,rp)
local rtype=bit.band(re:GetActiveType(),0x7)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c22202101.repop)
if Duel.IsExistingMatchingCard(c22202101.filter,tp,LOCATION_DECK,0,1,nil,rtype) and Duel.SelectYesNo(tp,aux.Stringid(22202101,0)) then
Duel.BreakEffect()
local sg=Duel.SelectMatchingCard(tp,c22202101.filter,tp,LOCATION_DECK,0,1,1,nil,rtype)
if sg:GetCount()>0 then Duel.SendtoGrave(sg,REASON_EFFECT) end
end
end
function c22202101.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsType(TYPE_SPELL+TYPE_TRAP) then
c:CancelToGrave(false)
end
Duel.SendtoGrave(c,REASON_EFFECT)
end
function c22202101.handop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(22202101,RESET_PHASE+PHASE_END,0,1)
end
function c22202101.handcon(e)
return e:GetHandler():GetFlagEffect(22202101)>0
end
\ No newline at end of file
......@@ -21,7 +21,7 @@ function cm.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e)
return bit.band(e:GetHandler():GetSummonType(),0x24)~=0x24
return not e:GetHandler():IsSummonType(0x24)
end)
e1:SetCost(Senya.SelfReleaseCost)
e1:SetTarget(cm.target)
......
......@@ -78,7 +78,7 @@ function cm.xmfilter(c)
return Senya.check_set_elem(c) and c:IsType(TYPE_XYZ) and c:GetRank()==4
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetOverlayGroup():IsExists(cm.xmfilter,1,nil)
return (r & REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ) and Senya.check_set_elem(re:GetHandler()) and e:GetHandler():GetOverlayGroup():IsExists(cm.xmfilter,1,nil)
and re:GetHandler()~=e:GetHandler()
end
......
......@@ -56,7 +56,7 @@ end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and bit.band(bc:GetBattlePosition(),POS_DEFENSE)~=0
return c:IsRelateToBattle() and bc:IsType(TYPE_MONSTER) and (bc:GetBattlePosition() & POS_DEFENSE)~=0
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -34,7 +34,7 @@ function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local ar=cm.list[dt]
local g=Group.CreateGroup()
if not (ar and cm.dtchk(tp) and c:IsRelateToEffect(e)) then return end
if bit.band(ar,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA)~=0 then
if (ar & LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA)~=0 then
local g1=Duel.GetMatchingGroup(cm.filter,tp,0,ar,nil)
if g1:GetCount()>0 then
if ar==LOCATION_HAND then
......
......@@ -95,7 +95,7 @@ function cm.valcheck(e,c)
local ct=0
local tc=g:GetFirst()
while tc do
ct=bit.bor(tc:GetAttribute(),ct)
ct=(tc:GetAttribute() | ct)
tc=g:GetNext()
end
e:GetLabelObject():SetLabel(ct)
......@@ -111,7 +111,7 @@ end
function cm.mcon(at)
return function(e)
local mt=e:GetHandler():GetFlagEffectLabel(m)
return mt and bit.band(at,mt)==at
return mt and (at & mt)==at
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
......@@ -201,10 +201,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,cm.dfilter,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
local cat=e:GetCategory()
if bit.band(g:GetFirst():GetOriginalType(),TYPE_MONSTER)~=0 then
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
if (g:GetFirst():GetOriginalType() & TYPE_MONSTER)~=0 then
e:SetCategory((cat | CATEGORY_SPECIAL_SUMMON))
else
e:SetCategory(bit.band(cat,bit.bnot(CATEGORY_SPECIAL_SUMMON)))
e:SetCategory((cat & ~CATEGORY_SPECIAL_SUMMON)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -84,7 +84,7 @@ function cm.replace_register_effect(f,p)
end)
end
local pr=e:GetProperty()
e:SetProperty(bit.bor(pr,EFFECT_FLAG_BOTH_SIDE))
e:SetProperty((pr | EFFECT_FLAG_BOTH_SIDE))
local con=e:GetCondition()
e:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return (not con or con(e,tp,eg,ep,ev,re,r,rp)) and tp==p
......
......@@ -49,7 +49,7 @@ function cm.seqop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=bit.bxor(flag,0xff)
flag=(flag ^ 0xff)
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
......
......@@ -51,7 +51,7 @@ function cm.cfilter(c,tp)
local ty=c:GetSummonType()
if c:GetSummonPlayer()==tp or c:GetMaterialCount()<=0 then return false end
for i,tty in pairs({SUMMON_TYPE_FUSION+SUMMON_TYPE_SYNCHRO+SUMMON_TYPE_XYZ+SUMMON_TYPE_LINK}) do
if bit.band(ty,tty)==tty then return true end
if (ty & tty)==tty then return true end
end
return false
end
......
......@@ -50,7 +50,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e7)
end
function cm.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION
return (st & SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION
end
function cm.ffilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA and c:IsOnField()
......@@ -141,7 +141,7 @@ function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=c:GetMaterial()
local sumtype=c:GetSummonType()
if chk==0 then
return not (bit.band(sumtype,SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION or mg:GetCount()==0
return not ((sumtype & SUMMON_TYPE_FUSION)~=SUMMON_TYPE_FUSION or mg:GetCount()==0
or mg:GetCount()>Duel.GetMZoneCount(tp)
or mg:IsExists(cm.mgfilter,1,nil,e,tp,c))
end
......@@ -152,7 +152,7 @@ function cm.spptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function cm.mgfilter(c,e,tp,fusc)
return not c:IsControler(tp) or not c:IsLocation(LOCATION_GRAVE)
or bit.band(c:GetReason(),0x40008)~=0x40008 or c:GetReasonCard()~=fusc
or (c:GetReason() & 0x40008)~=0x40008 or c:GetReasonCard()~=fusc
or not c:IsCanBeSpecialSummoned(e,0,tp,true,true) or c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function cm.mgfilterx(c,e,tp,fusc)
......
......@@ -42,7 +42,7 @@ function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local s1=Duel.SelectMatchingCard(tp,cm.f1,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
sg:AddCard(s1)
local tpe=bit.band(s1:GetType(),0x7)
local tpe=(s1:GetType() & 0x7)
if Duel.IsExistingMatchingCard(cm.f2,tp,LOCATION_HAND,0,1,s1,tpe) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,cm.f2,tp,LOCATION_HAND,0,1,99,s1,tpe)
......@@ -129,5 +129,5 @@ end
function cm.dfilter(c,tc)
local lv1=c:GetLevel()
local lv2=tc:GetLevel()
return bit.band(c:GetAttribute(),tc:GetAttribute())~=0 and bit.band(c:GetRace(),tc:GetRace())~=0 and c:GetLevel()>0 and lv1==lv2 and lv1~=0 and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER)
return (c:GetAttribute() & tc:GetAttribute())~=0 and (c:GetRace() & tc:GetRace())~=0 and c:GetLevel()>0 and lv1==lv2 and lv1~=0 and c:IsAbleToGrave() and c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
......@@ -34,7 +34,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(tp,4)
local att=0
g:ForEach(function(tc)
att=bit.bor(att,bit.band(tc:GetType(),0x7))
att=(att | (tc:GetType() & 0x7))
end)
if att~=0x7 then return end
Duel.Hint(HINT_CARD,0,e:GetHandler():GetOriginalCode())
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
local g=Senya.get_all_cards:Clone()
local rg=Group.CreateGroup()
g:ForEach(function(c)
if bit.band(c:GetOriginalType(),0x81)==0x81 and not cm.gg:IsExists(cm.ctfilter,1,nil,c:GetOriginalCode()) then
if (c:GetOriginalType() & 0x81)==0x81 and not cm.gg:IsExists(cm.ctfilter,1,nil,c:GetOriginalCode()) then
rg:AddCard(c)
cm.gg:AddCard(c)
end
......@@ -39,7 +39,7 @@ function cm.ctfilter(c,code)
return c:GetOriginalCode()==code
end
function cm.filter(c,e,tp,m,ft)
if bit.band(c:GetType(),0x81)~=0x81
if (c:GetType() & 0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if c.ritual_custom_condition then return c:ritual_custom_condition(mg,ft) end
......
......@@ -85,10 +85,10 @@ function cm.FConditionCode2(e,g,gc,chkfnf)
if g==nil then return true end
if not cm.material then return false end
local funs=cm.GenerateList(cm.material)
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0
local notfusion=(chkfnf >> 8)~=0
local sub=sub or notfusion
local mg=g:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
if gc then
......@@ -101,10 +101,10 @@ function cm.FConditionCode2(e,g,gc,chkfnf)
end
function cm.FOperationCode2(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local funs=cm.GenerateList(cm.material)
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local c=e:GetHandler()
local tp=c:GetControler()
local notfusion=bit.rshift(chkfnf,8)~=0
local notfusion=(chkfnf >> 8)~=0
local sub=sub or notfusion
local mg=eg:Filter(Auxiliary.FConditionFilterMix,c,c,sub,table.unpack(funs))
local sg=Group.CreateGroup()
......
......@@ -82,7 +82,7 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.afilter(c)
return bit.band(c:GetOriginalType(),TYPE_MONSTER)~=0 and c:GetFlagEffect(m)>0
return (c:GetOriginalType() & TYPE_MONSTER)~=0 and c:GetFlagEffect(m)>0
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject():GetLabelObject()
......
......@@ -47,7 +47,7 @@ function cm.initial_effect(c)
end
function cm.rcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)==0
and bit.band(r,REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ)
and (r & REASON_COST)~=0 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_XYZ)
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,e:GetHandler():GetOriginalCode())
......
......@@ -48,22 +48,22 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local t=re:GetType()
local cd=re:GetCode()
local pr1,pr2=re:GetProperty()
pr1=bit.bor(pr1,EFFECT_FLAG_NO_TURN_RESET)
if bit.band(t,EFFECT_TYPE_ACTIVATE)~=0 then
t=bit.bor(t-EFFECT_TYPE_ACTIVATE,EFFECT_TYPE_QUICK_O)
pr1=(pr1 | EFFECT_FLAG_NO_TURN_RESET)
if (t & EFFECT_TYPE_ACTIVATE)~=0 then
t=(t-EFFECT_TYPE_ACTIVATE | EFFECT_TYPE_QUICK_O)
end
if bit.band(t,EFFECT_TYPE_XMATERIAL)~=0 then
if (t & EFFECT_TYPE_XMATERIAL)~=0 then
t=t-EFFECT_TYPE_XMATERIAL
end
if bit.band(t,EFFECT_TYPE_QUICK_F)~=0 then
t=bit.bor(t-EFFECT_TYPE_QUICK_F,EFFECT_TYPE_QUICK_O)
if (t & EFFECT_TYPE_QUICK_F)~=0 then
t=(t-EFFECT_TYPE_QUICK_F | EFFECT_TYPE_QUICK_O)
end
if bit.band(t,EFFECT_TYPE_TRIGGER_F)~=0 then
t=bit.bor(t-EFFECT_TYPE_TRIGGER_F,EFFECT_TYPE_TRIGGER_O)
pr1=bit.bor(pr1,EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
if (t & EFFECT_TYPE_TRIGGER_F)~=0 then
t=(t-EFFECT_TYPE_TRIGGER_F | EFFECT_TYPE_TRIGGER_O)
pr1=(pr1 | EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
end
if bit.band(t,EFFECT_TYPE_IGNITION)~=0 then
t=bit.bor(t-EFFECT_TYPE_IGNITION,EFFECT_TYPE_QUICK_O)
if (t & EFFECT_TYPE_IGNITION)~=0 then
t=(t-EFFECT_TYPE_IGNITION | EFFECT_TYPE_QUICK_O)
cd=EVENT_FREE_CHAIN
end
e1:SetType(t)
......
......@@ -71,7 +71,7 @@ function cm.cop(te)
if not te then return end
local c=e:GetHandler()
local tg=te:GetTarget()
if bit.band(c:GetType(),TYPE_FIELD+TYPE_CONTINUOUS+TYPE_PENDULUM)==0 then
if (c:GetType() & TYPE_FIELD+TYPE_CONTINUOUS+TYPE_PENDULUM)==0 then
c:CancelToGrave(false)
end
local code=te:GetCode()
......
......@@ -129,7 +129,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
return false
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
return (r & REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function cm.ffilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
......
......@@ -36,7 +36,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local flag=0
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=bit.replace(flag,0x1,seq-1) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=bit.replace(flag,0x1,seq+1) end
flag=bit.bxor(flag,0xff)
flag=(flag ^ 0xff)
Duel.Hint(HINT_SELECTMSG,tp,571)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
......
......@@ -29,7 +29,7 @@ function cm.cfilter(c,ori)
if c:IsFacedown() then return false end
if ori then return c:GetOriginalCode()==37564765 and c:IsLocation(LOCATION_MZONE) end
if c:IsCode(37564765) then return true end
return (Senya.check_set_sawawa(c) or (Senya.check_set_3L(c) and c:IsType(TYPE_FUSION)) or (Senya.check_set_sayuri(c) and bit.band(c:GetType(),0x81)==0x81)) and c:IsLocation(LOCATION_MZONE)
return (Senya.check_set_sawawa(c) or (Senya.check_set_3L(c) and c:IsType(TYPE_FUSION)) or (Senya.check_set_sayuri(c) and (c:GetType() & 0x81)==0x81)) and c:IsLocation(LOCATION_MZONE)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil,false)
......
......@@ -17,7 +17,7 @@ function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) and Senya.NanahiraExistingCondition(false)(e,tp,eg,ep,ev,re,r,rp) end
local pr1,pr2=e:GetProperty()
e:SetProperty(bit.bor(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
e:SetProperty((pr1 | EFFECT_FLAG_CARD_TARGET),pr2)
e:SetCategory(CATEGORY_DESTROY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
......@@ -26,7 +26,7 @@ end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) and Senya.NanahiraExistingCondition(true)(e,tp,eg,ep,ev,re,r,rp) and Duel.IsPlayerCanDraw(tp,1) end
local pr1,pr2=e:GetProperty()
e:SetProperty(pr1-bit.band(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
e:SetProperty(pr1-(pr1 & EFFECT_FLAG_CARD_TARGET),pr2)
e:SetCategory(CATEGORY_REMOVE+CATEGORY_DRAW)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
......
......@@ -24,7 +24,7 @@ function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
local pr1,pr2=e:GetProperty()
e:SetProperty(bit.bor(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
e:SetProperty((pr1 | EFFECT_FLAG_CARD_TARGET),pr2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......@@ -32,7 +32,7 @@ end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
local pr1,pr2=e:GetProperty()
e:SetProperty(pr1-bit.band(pr1,EFFECT_FLAG_CARD_TARGET),pr2)
e:SetProperty(pr1-(pr1 & EFFECT_FLAG_CARD_TARGET),pr2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -38,7 +38,7 @@ function cm.hcon(e,c)
return Duel.GetMZoneCount(c:GetControler())>0 and Duel.IsExistingMatchingCard(cm.ssfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) and c:IsFaceup() and not c:IsDisabled()
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
return (r & REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.spfilter(c,e,tp)
return c:IsCode(37564765) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -18,7 +18,7 @@ function cm.initial_effect(c)
end
function cm.filter(c,e,tp)
return c:IsFaceup() and c:IsCode(37564765) and c:IsAbleToGrave()
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetOriginalCode()) and bit.band(c:GetType(),0x8020d0+TYPE_LINK)~=0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp,c:GetOriginalCode()) and (c:GetType() & 0x8020d0+TYPE_LINK)~=0
end
function cm.spfilter(c,e,tp,code)
return c.Senya_desc_with_nanahira and c:GetOriginalCode()~=code and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Senya.CheckSummonLocation(c,tp)
......
......@@ -23,7 +23,7 @@ end
function cm.cf(c,rc)
if not c:IsAbleToGraveAsCost() then return false end
if c:IsCode(37564517) then return true end
return bit.band(c:GetAttribute(),rc:GetAttribute())~=0 or bit.band(c:GetRace(),rc:GetRace())~=0
return (c:GetAttribute() & rc:GetAttribute())~=0 or (c:GetRace() & rc:GetRace())~=0
end
function cm.DiscardHandCost(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -43,8 +43,8 @@ function cm.add(rg)
local te=tc:GetActivateEffect()
if not te then return end
local pr1,pr2=te:GetProperty()
if bit.band(pr2,EFFECT_FLAG2_COF)~=0 then return end
pr2=bit.bor(pr2,EFFECT_FLAG2_COF)
if (pr2 & EFFECT_FLAG2_COF)~=0 then return end
pr2=(pr2 | EFFECT_FLAG2_COF)
te:SetHintTiming(0,0x1e0)
te:SetProperty(pr1,pr2)
rg:AddCard(tc)
......@@ -55,7 +55,7 @@ function cm.rmv(rg)
local te=tc:GetActivateEffect()
if not te then return end
local pr1,pr2=te:GetProperty()
pr2=pr2-bit.band(pr2,EFFECT_FLAG2_COF)
pr2=pr2-(pr2 & EFFECT_FLAG2_COF)
te:SetProperty(pr1,pr2)
te:SetHintTiming(0,0)
rg:RemoveCard(tc)
......
......@@ -38,7 +38,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
end
function cm.rgcon(e)
return bit.band(e:GetHandler():GetSummonType(),0x534)==0x534
return e:GetHandler():IsSummonType(0x534)
end
function cm.spcon(e,c)
if c==nil then return true end
......@@ -51,7 +51,7 @@ end
function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==nil
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and bit.band(e:GetHandler():GetSummonType(),0x534)==0x534
and c:GetEffectCount(EFFECT_DIRECT_ATTACK)<2 and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 and e:GetHandler():IsSummonType(0x534)
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev/2)
......@@ -66,7 +66,7 @@ function cm.f3(c,e,tp)
return c:IsCode(37564765) and c:IsAbleToGrave() and not c:IsImmuneToEffect(e) and c:IsFaceup() and Duel.IsExistingMatchingCard(cm.f2,tp,LOCATION_EXTRA,0,1,nil,e,tp,Group.FromCards(e:GetHandler(),nc))
end
function cm.filter(c)
return c.Senya_desc_with_nanahira and bit.band(c:GetType(),TYPE_TRAP+TYPE_COUNTER)==TYPE_TRAP+TYPE_COUNTER and c:IsAbleToHand()
return c.Senya_desc_with_nanahira and (c:GetType() & TYPE_TRAP+TYPE_COUNTER)==TYPE_TRAP+TYPE_COUNTER and c:IsAbleToHand()
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() and Duel.IsExistingMatchingCard(cm.f1,tp,LOCATION_MZONE,0,1,e:GetHandler(),e,tp) end
......
......@@ -50,7 +50,7 @@ function cm.initial_effect(c)
end
function cm.bmrlfilter(c,ft)
if ft==0 and c:GetSequence()>4 then return false end
return c:IsCode(37564765) and bit.band(c:GetType(),0x8020d0+TYPE_LINK)~=0
return c:IsCode(37564765) and (c:GetType() & 0x8020d0+TYPE_LINK)~=0
end
function cm.bmrlcon(e,c)
if c==nil then return true end
......
......@@ -64,7 +64,7 @@ function cm.f(c)
end
function cm.add(tc)
local p2=0
if bit.band(tc:GetOriginalType(),TYPE_QUICKPLAY+TYPE_TRAP)==0 then p2=EFFECT_TYPE_QUICK_O end
if (tc:GetOriginalType() & TYPE_QUICKPLAY+TYPE_TRAP)==0 then p2=EFFECT_TYPE_QUICK_O end
local e2=Effect.CreateEffect(tc)
e2:SetDescription(m*16)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
......@@ -112,10 +112,10 @@ function cm.reg(e,tp,eg,ep,ev,re,r,rp)
end
function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end
if e:GetHandler():GetTurnID()==Duel.GetTurnCount() and bit.band(e:GetHandler():GetOriginalType(),TYPE_QUICKPLAY+TYPE_TRAP)==0 then return false end
local t1=bit.band(e:GetHandler():GetOriginalType(),0x7)
local t2=bit.band(re:GetHandler():GetOriginalType(),0x7)
return bit.band(t1,t2)~=0
if e:GetHandler():GetTurnID()==Duel.GetTurnCount() and (e:GetHandler():GetOriginalType() & TYPE_QUICKPLAY+TYPE_TRAP)==0 then return false end
local t1=(e:GetHandler():GetOriginalType() & 0x7)
local t2=(re:GetHandler():GetOriginalType() & 0x7)
return (t1 & t2)~=0
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -60,7 +60,7 @@ function cm.disop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetActiveType()
if (bit.band(t,TYPE_CONTINUOUS+TYPE_FIELD)~=0 or bit.band(t,TYPE_SPELL+TYPE_PENDULUM)==TYPE_SPELL+TYPE_PENDULUM) and not e:GetHandler():IsRelateToEffect(e) then return end
if ((t & TYPE_CONTINUOUS+TYPE_FIELD)~=0 or (t & TYPE_SPELL+TYPE_PENDULUM)==TYPE_SPELL+TYPE_PENDULUM) and not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD+LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
......
......@@ -65,7 +65,7 @@ function cm.matfilter3(c,syncard)
return c:IsFaceup() and c:IsSynchroType(TYPE_TUNER) and c:IsCode(37564765) and c:IsCanBeSynchroMaterial(syncard)
end
function cm.matfilter4(c,syncard)
return c:IsFaceup() and bit.band(c:GetOriginalType(),TYPE_TUNER)==0 and bit.band(c:GetOriginalRace(),RACE_FAIRY)~=0 and c:IsCode(37564765) and c:IsCanBeSynchroMaterial(syncard)
return c:IsFaceup() and (c:GetOriginalType() & TYPE_TUNER)==0 and (c:GetOriginalRace() & RACE_FAIRY)~=0 and c:IsCode(37564765) and c:IsCanBeSynchroMaterial(syncard)
end
function cm.val(c,syncard)
if c:IsLocation(LOCATION_SZONE) then
......
......@@ -37,7 +37,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
end
function cm.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
return (st & SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function cm.desfilter(c,g)
return g:IsContains(c)
......
......@@ -50,20 +50,20 @@ end
function cm.location_check(p,tp,z)
local tz=0
if p~=tp then
tz=bit.rshift(bit.band(z,0x1f0000),16)
tz=((z & 0x1f0000) >> 16)
else
tz=bit.band(z,0x1f)
tz=(z & 0x1f)
end
local ct=0
local res=0
for i=0,4 do
local cz=bit.lshift(1,i)
if bit.band(tz,cz)==cz and Duel.CheckLocation(p,LOCATION_MZONE,i) then
local cz=(1 << i)
if (tz & cz)==cz and Duel.CheckLocation(p,LOCATION_MZONE,i) then
ct=ct+1
res=bit.bor(cz,res)
res=(cz | res)
end
end
if p~=tp then res=bit.lshift(res,16) end
if p~=tp then res=(res << 16) end
return ct,res
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -87,6 +87,6 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct,res=cm.location_check(p,tp,z)
Duel.Hint(HINT_SELECTMSG,tp,571)
local sz=Duel.SelectDisableField(tp,1,LOCATION_MZONE,LOCATION_MZONE,0x1f001f-res)
if bit.band(sz,0x1f0000)~=0 then sz=bit.rshift(sz,16) end
if (sz & 0x1f0000)~=0 then sz=(sz >> 16) end
Duel.MoveSequence(rc,math.log(sz,2))
end
\ No newline at end of file
......@@ -16,5 +16,5 @@ function cm.initial_effect(c)
Senya.NegateEffectModule(c,1)
end
function cm.splimit(e,se,sp,st)
return bit.band(st,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
return (st & SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
\ No newline at end of file
......@@ -63,7 +63,7 @@ function cm.spop1(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0
return (r & REASON_EFFECT)~=0
and Senya.check_set_prim(re:GetHandler()) and not e:GetHandler():IsReason(REASON_RETURN)
end
function cm.thfilter(c)
......
......@@ -31,7 +31,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT)~=0
return (r & REASON_EFFECT)~=0
and Senya.check_set_prim(re:GetHandler())
end
function cm.thfilter(c)
......
......@@ -498,7 +498,7 @@ end
function cm.MokouRebornCondition(eff,con)
if eff then
return function(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetReason(),0x41)==0x41 and (not con or con(e,tp,eg,ep,ev,re,r,rp))
return (e:GetHandler():GetReason() & 0x41)==0x41 and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
else
return function(e,tp,eg,ep,ev,re,r,rp)
......@@ -972,7 +972,7 @@ function cm.PrismXyzCheck(min,max)
end
function cm.PrismXyzValue(c)
local v=1
if c:IsHasEffect(37564499) then v=bit.bor(v,0x20000) end
if c:IsHasEffect(37564499) then v=(v | 0x20000) end
return v
end
--xyz monster atk drain effect
......@@ -1074,8 +1074,8 @@ function cm.NanahiraExtraPendulum(c,scon)
e2:SetValue(function(e,se,sp,st)
if scon and not scon(e,se,sp,st) then return false end
local c=e:GetHandler()
if c:IsFaceup() and c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_FUSION) and bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION then return false end
return c:IsHasEffect(EFFECT_REVIVE_LIMIT) or c:IsStatus(STATUS_PROC_COMPLETE) or bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
if c:IsFaceup() and c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_FUSION) and (st & SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION then return false end
return c:IsHasEffect(EFFECT_REVIVE_LIMIT) or c:IsStatus(STATUS_PROC_COMPLETE) or (st & SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end)
c:RegisterEffect(e2)
end
......@@ -1315,7 +1315,7 @@ function cm.NanahiraTrap(c,...)
e1:SetCost(cm.SelfReleaseCost)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return bit.band(e:GetHandler():GetSummonType(),0x553)==0x553
return e:GetHandler():IsSummonType(0x553)
end)
local op=te:GetOperation()
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
......@@ -1409,7 +1409,7 @@ end
--counter summon effect universals
--n=normal f=flip s=special o=opponent only
function cm.NegateSummonModule(c,tpcode,ctlm,ctlmid,con,cost)
if not tpcode or bit.band(tpcode,7)==0 then return end
if not tpcode or (tpcode & 7)==0 then return end
ctlmid=ctlmid or 1
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37564765,4))
......@@ -1418,7 +1418,7 @@ function cm.NegateSummonModule(c,tpcode,ctlm,ctlmid,con,cost)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_SPSUMMON)
if ctlm then e3:SetCountLimit(ctlm,ctlmid) end
if bit.band(tpcode,8)==8 then
if (tpcode & 8)==8 then
e3:SetLabel(2)
else
e3:SetLabel(1)
......@@ -1432,15 +1432,15 @@ function cm.NegateSummonModule(c,tpcode,ctlm,ctlmid,con,cost)
local e1=e3:Clone()
e1:SetCode(EVENT_SUMMON)
local t={}
if bit.band(tpcode,1)==1 then
if (tpcode & 1)==1 then
c:RegisterEffect(e1)
table.insert(t,e1)
end
if bit.band(tpcode,2)==2 then
if (tpcode & 2)==2 then
c:RegisterEffect(e2)
table.insert(t,e2)
end
if bit.band(tpcode,4)==4 then
if (tpcode & 4)==4 then
c:RegisterEffect(e3)
table.insert(t,e3)
end
......@@ -1763,7 +1763,7 @@ function cm.FusionCondition_3L(mf,f,min,max,myon,sub)
return function(e,g,gc,chkfnf)
if g==nil then return true end
local c=e:GetHandler()
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local mg=g:Filter(cm.FusionFilter_3L,nil,e:GetHandler(),mf,sub)
local tp=e:GetHandlerPlayer()
local exg=Duel.GetMatchingGroup(cm.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c,myon)
......@@ -1785,7 +1785,7 @@ end
function cm.FusionOperation_3L(mf,f,min,max,myon,sub)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local chkf=bit.band(chkfnf,0xff)
local chkf=(chkfnf & 0xff)
local mg=eg:Filter(cm.FusionFilter_3L,nil,e:GetHandler(),mf,sub)
local exg=Duel.GetMatchingGroup(cm.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c,myon)
mg:Merge(exg)
......@@ -2235,7 +2235,7 @@ function cm.multi_choice_target(m,...)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local pr=e:GetProperty()
return bit.band(pr,EFFECT_FLAG_CARD_TARGET)~=0 and function_list[e:GetLabel()](e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return (pr & EFFECT_FLAG_CARD_TARGET)~=0 and function_list[e:GetLabel()](e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
local avaliable_list={}
for i,tg in pairs(function_list) do
......@@ -2307,7 +2307,7 @@ end
function cm.GetFusionMaterial(tp,loc,oloc,f,gc,e,...)
local g1=Duel.GetFusionMaterial(tp)
if loc then
local floc=bit.band(loc,LOCATION_ONFIELD+LOCATION_HAND)
local floc=(loc & LOCATION_ONFIELD+LOCATION_HAND)
if floc~=0 then
g1=g1:Filter(Card.IsLocation,nil,floc)
else
......@@ -2574,8 +2574,8 @@ function cm.DivideValueMax(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=bit.band(v,0xffff)
local v2=bit.rshift(v,16)
local v1=(v & 0xffff)
local v2=(v >> 16)
return math.max(v1,v2)
end
end
......@@ -2583,8 +2583,8 @@ function cm.DivideValueMin(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=bit.band(v,0xffff)
local v2=bit.rshift(v,16)
local v1=(v & 0xffff)
local v2=(v >> 16)
if v1<=0 then
return v2
elseif v2<=0 then
......
......@@ -136,23 +136,23 @@ return function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabelObject(tc)
local ctg=0
if tc:IsSetCard(0x777) then
ctg=bit.bor(ctg,CATEGORY_REMOVE+CATEGORY_DRAW)
ctg=(ctg | CATEGORY_REMOVE+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
if tc:IsAttribute(at) then
if at==ATTRIBUTE_WIND then
ctg=bit.bor(ctg,CATEGORY_TOHAND+CATEGORY_SEARCH)
ctg=(ctg | CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
elseif at==ATTRIBUTE_FIRE then
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
ctg=bit.bor(ctg,CATEGORY_DESTROY)
ctg=(ctg | CATEGORY_DESTROY)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
elseif at==ATTRIBUTE_EARTH then
ctg=bit.bor(ctg,CATEGORY_SPECIAL_SUMMON)
ctg=(ctg | CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
elseif at==ATTRIBUTE_WATER then
ctg=bit.bor(ctg,CATEGORY_TOGRAVE+CATEGORY_DECKDES)
ctg=(ctg | CATEGORY_TOGRAVE+CATEGORY_DECKDES)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
end
......@@ -277,7 +277,7 @@ function prim.ses(c,at)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local l=e:GetLabel()
local b=false
if bit.band(l,1)~=0 and Duel.GetMZoneCount(tp)>0 then
if (l & 1)~=0 and Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,prim.sesspfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,m)
local tc=g:GetFirst()
......@@ -292,7 +292,7 @@ function prim.ses(c,at)
tc:RegisterEffect(e1,true)
end
end
if bit.band(l,2)~=0 and Duel.IsPlayerCanDraw(tp,1) then
if (l & 2)~=0 and Duel.IsPlayerCanDraw(tp,1) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,prim.sessrfilter,tp,LOCATION_DECK,0,1,1,nil,at)
local tc=g:GetFirst()
......
......@@ -54,8 +54,8 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.chkf(c)
local t=bit.bor(c:GetType(),c:GetOriginalType())
return bit.band(t,TYPE_FUSION)==TYPE_FUSION
local t=(c:GetType() | c:GetOriginalType())
return (t & TYPE_FUSION)==TYPE_FUSION
end
function cm.dfilter(c)
return true
......@@ -67,10 +67,10 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,cm.dfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
local cat=e:GetCategory()
if bit.band(g:GetFirst():GetOriginalType(),TYPE_MONSTER)~=0 then
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
if (g:GetFirst():GetOriginalType() & TYPE_MONSTER)~=0 then
e:SetCategory((cat | CATEGORY_SPECIAL_SUMMON))
else
e:SetCategory(bit.band(cat,bit.bnot(CATEGORY_SPECIAL_SUMMON)))
e:SetCategory((cat & ~CATEGORY_SPECIAL_SUMMON))
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,7 +33,7 @@ function cm.effect_operation_3L(c)
ex2:SetTargetRange(0,LOCATION_DECK+LOCATION_EXTRA)
ex2:SetTarget(function(e,c)
return c:GetOwner()~=e:GetHandlerPlayer() and (c:IsLocation(LOCATION_DECK)
or (c:IsLocation(LOCATION_EXTRA) and bit.band(c:GetOriginalType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)~=0))
or (c:IsLocation(LOCATION_EXTRA) and (c:GetOriginalType() & TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)~=0))
end)
ex2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(ex2,true)
......
......@@ -72,7 +72,7 @@ function cm.eqlimit(e,c)
return e:GetOwner()==c
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsOnField() and bit.band(re:GetHandler():GetOriginalType(),TYPE_PENDULUM)==0 and re:GetHandler():GetFlagEffect(m)==0
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:GetHandler():IsOnField() and (re:GetHandler():GetOriginalType() & TYPE_PENDULUM)==0 and re:GetHandler():GetFlagEffect(m)==0
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
......
......@@ -24,8 +24,7 @@ function cm.initial_effect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(c:GetSummonType(),0x829)==0x829
return e:GetHandler():IsSummonType(0x829)
end)
e0:SetOperation(cm.skipop)
c:RegisterEffect(e0)
......
......@@ -35,7 +35,7 @@ function cm.chkfilter_mokou(c)
end
function cm.NegateEffectWithoutChainingCondition(e,tp,eg,ep,ev,re,r,rp)
local loc,np=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_CONTROLER)
return e:GetHandler():GetFlagEffect(m)==0 and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsImmuneToEffect(e) and bit.band(loc,0x0c)~=0 and np~=tp and re:GetHandler():IsAbleToGrave()
return e:GetHandler():GetFlagEffect(m)==0 and re:GetHandler():IsRelateToEffect(re) and not re:GetHandler():IsImmuneToEffect(e) and (loc & 0x0c)~=0 and np~=tp and re:GetHandler():IsAbleToGrave()
end
function cm.NegateEffectWithoutChainingOperation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,m*16+2) then return end
......
......@@ -179,7 +179,7 @@ function cm.cop(te)
if not te then return end
local c=e:GetHandler()
local tg=te:GetTarget()
if bit.band(c:GetType(),TYPE_FIELD+TYPE_CONTINUOUS+TYPE_PENDULUM)==0 then
if (c:GetType() & TYPE_FIELD+TYPE_CONTINUOUS+TYPE_PENDULUM)==0 then
c:CancelToGrave(false)
end
local code=te:GetCode()
......
......@@ -138,7 +138,7 @@ end
function cm.sfilter(c,tp,fc,e)
if not fc then return false end
if e and not c:IsCanBeEffectTarget(e) then return false end
return c:IsControler(tp) and c:IsLocation(LOCATION_REMOVED) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER) and Senya.check_set_3L(c) and Senya.EffectSourceFilter_3L(c,fc) and bit.band(c:GetReason(),0x40008)==0x40008 and c:GetReasonCard()==fc
return c:IsControler(tp) and c:IsLocation(LOCATION_REMOVED) and c:IsAbleToDeck() and c:IsType(TYPE_MONSTER) and Senya.check_set_3L(c) and Senya.EffectSourceFilter_3L(c,fc) and (c:GetReason() & 0x40008)==0x40008 and c:GetReasonCard()==fc
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local fc=e:GetHandler():GetFirstCardTarget()
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
Senya.sayuri_activate_effect[c]=e1
end
function cm.filter(c,e,tp,m1,m2,ft)
if not Senya.check_set_sayuri(c) or bit.band(c:GetType(),0x81)~=0x81
if not Senya.check_set_sayuri(c) or (c:GetType() & 0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
mg:Merge(m2)
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
Senya.sayuri_activate_effect[c]=e1
end
function cm.filter(c,e,tp,mg,ft)
if not Senya.check_set_sayuri(c) or bit.band(c:GetType(),0x81)~=0x81
if not Senya.check_set_sayuri(c) or (c:GetType() & 0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=mg:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end
......
......@@ -13,7 +13,7 @@ function cm.initial_effect(c)
Senya.sayuri_activate_effect[c]=e1
end
function cm.filter(c,e,tp,mg,ft)
if not Senya.check_set_sayuri(c) or bit.band(c:GetType(),0x81)~=0x81
if not Senya.check_set_sayuri(c) or (c:GetType() & 0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=mg:Filter(Card.IsCanBeRitualMaterial,c,c)
if c:IsCode(21105106) then return c:ritual_custom_condition(mg,ft) end
......
......@@ -109,7 +109,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e:SetCondition(cm.rcon(e:GetCondition(),tc,copyt))
e:SetCost(cm.rcost(e:GetCost()))
if e:IsHasType(EFFECT_TYPE_IGNITION) then
e:SetType(bit.bor(e:GetType()-EFFECT_TYPE_IGNITION,EFFECT_TYPE_QUICK_O))
e:SetType((e:GetType()-EFFECT_TYPE_IGNITION | EFFECT_TYPE_QUICK_O))
e:SetCode(EVENT_FREE_CHAIN)
e:SetHintTiming(0,0x1c0)
end
......
......@@ -2,6 +2,7 @@
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
local m,cm=Senya.SayuriRitualPreload(37564905)
function cm.initial_effect(c)
Senya.AddSummonMusic(c,m*16,SUMMON_TYPE_RITUAL)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -36,10 +37,10 @@ function cm.initial_effect(c)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
local cat=e:GetCategory()
if bit.band(re:GetHandler():GetOriginalType(),TYPE_MONSTER)~=0 then
e:SetCategory(bit.bor(cat,CATEGORY_SPECIAL_SUMMON))
if (re:GetHandler():GetOriginalType() & TYPE_MONSTER)~=0 then
e:SetCategory((cat | CATEGORY_SPECIAL_SUMMON))
else
e:SetCategory(bit.band(cat,bit.bnot(CATEGORY_SPECIAL_SUMMON)))
e:SetCategory((cat & ~CATEGORY_SPECIAL_SUMMON))
end
end
end)
......
......@@ -71,7 +71,7 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thcfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.thcfilter,tp,LOCATION_REMOVED,0,1,1,nil)
local s=bit.band(g:GetFirst():GetOriginalType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)==0 and 2 or 0
local s=(g:GetFirst():GetOriginalType() & TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)==0 and 2 or 0
Duel.SendtoDeck(g,nil,s,REASON_COST)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -120,8 +120,8 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local f=Card.RegisterEffect
Card.RegisterEffect=function(tc,e,forced)
local t=e:GetType()
if bit.band(t,EFFECT_TYPE_IGNITION)~=0 then
e:SetType(bit.bor(t-EFFECT_TYPE_IGNITION,EFFECT_TYPE_QUICK_O))
if (t & EFFECT_TYPE_IGNITION)~=0 then
e:SetType((t-EFFECT_TYPE_IGNITION | EFFECT_TYPE_QUICK_O))
e:SetCode(EVENT_FREE_CHAIN)
e:SetHintTiming(0,0x1e0)
end
......
......@@ -2,6 +2,7 @@
xpcall(function() require("expansions/script/c37564765") end,function() require("script/c37564765") end)
local m,cm=Senya.SayuriRitualPreload(37564912)
function cm.initial_effect(c)
Senya.AddSummonMusic(c,m*16+3,SUMMON_TYPE_RITUAL)
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
......@@ -50,7 +51,7 @@ function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c,tc)
return Senya.check_set_sayuri(c) and c:IsType(bit.band(tc:GetType(),0x7)) and c:IsAbleToHand()
return Senya.check_set_sayuri(c) and c:IsType((tc:GetType() & 0x7)) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_HAND,1,nil) end
......
......@@ -112,7 +112,7 @@ function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
return (r & REASON_BATTLE+REASON_EFFECT)~=0
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetLabelObject():GetLabelObject()
......@@ -121,7 +121,7 @@ end
function cm.atkval(e,c)
local ec=e:GetLabelObject():GetLabelObject()
local atk=ec:GetTextAttack()
if ec:IsFacedown() or bit.band(ec:GetOriginalType(),TYPE_MONSTER)==0 or atk<0 then
if ec:IsFacedown() or (ec:GetOriginalType() & TYPE_MONSTER)==0 or atk<0 then
return 0
else
return atk
......@@ -130,7 +130,7 @@ end
function cm.defval(e,c)
local ec=e:GetLabelObject():GetLabelObject()
local def=ec:GetTextDefense()
if ec:IsFacedown() or bit.band(ec:GetOriginalType(),TYPE_MONSTER)==0 or def<0 then
if ec:IsFacedown() or (ec:GetOriginalType() & TYPE_MONSTER)==0 or def<0 then
return 0
else
return def
......
......@@ -70,7 +70,7 @@ function cm.sfilter(c,e,tp)
return c:IsCode(m) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and c:IsType(TYPE_MONSTER)
end
function cm.sfilter1(c,e,tp)
return c:IsLevelBelow(8) and Senya.check_set_sayuri(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and bit.band(c:GetType(),0x81)==0x81
return c:IsLevelBelow(8) and Senya.check_set_sayuri(c) and c:IsCanBeSpecialSummoned(e,0,tp,true,true) and (c:GetType() & 0x81)==0x81
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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