Commit 2afb097e authored by Nemo Ma's avatar Nemo Ma

maint

parent 617057f1
No preview for this file type
...@@ -34,16 +34,15 @@ function c33700028.spfilter(c,e,tp) ...@@ -34,16 +34,15 @@ function c33700028.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700028.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700028.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c53389254.spfilter(chkc,e,tp) end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and c33700028.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return true end
and Duel.IsExistingTarget(c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c33700028.spfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function c33700028.spop(e,tp,eg,ep,ev,re,r,rp) function c33700028.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
...@@ -57,9 +56,12 @@ function c33700028.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -57,9 +56,12 @@ function c33700028.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1,true) c:RegisterEffect(e1,true)
end end
function c33700028.tdfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c33700028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and chkc:IsAbleToDeck() end if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c33700028.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c33700028.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
......
--降阶魔法 心之牺牲 --降阶魔法 心之牺牲
function c33700167.initial_effect(c) function c33700167.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c33700167.cost) e1:SetCost(c33700167.cost)
e1:SetTarget(c33700167.target) e1:SetTarget(c33700167.target)
e1:SetOperation(c33700167.activate) e1:SetOperation(c33700167.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(33700167,ACTIVITY_SPSUMMON,c33700167.counterfilter) Duel.AddCustomActivityCounter(33700167,ACTIVITY_SPSUMMON,c33700167.counterfilter)
end end
function c33700167.counterfilter(c) function c33700167.counterfilter(c)
return c:IsType(TYPE_XYZ) return c:IsType(TYPE_XYZ)
end end
function c33700167.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c33700167.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(33700167,tp,ACTIVITY_SPSUMMON)==0 end if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 and Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON) e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c33700167.splimit) e1:SetTarget(c33700167.splimit)
e1:SetLabelObject(e) e1:SetLabelObject(e)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c33700167.splimit(e,c,sump,sumtype,sumpos,targetp,se) function c33700167.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject() or not se:IsType(TYPE_XYZ) return se~=e:GetLabelObject()
end end
function c33700167.filter(c,e,tp) function c33700167.filter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0 and Duel.IsExistingMatchingCard(c33700167.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank(),c:GetOverlayCount()) return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
and Duel.IsExistingMatchingCard(c33700167.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank(),c:GetOverlayCount(),c:GetRace(),c:GetAttribute())
end end
function c33700167.filter2(c,e,tp,g,rk,og)
return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and g:IsCanBeXyzMaterial(c) and c:GetRank()<rk and function c33700167.filter2(c,e,tp,tc,rk,og,race,attr)
c:GetRank()>=og return c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:GetRace()==race or c:GetAttribute()==attr)
and c:GetRank()<rk and c:GetRank()>=og
end end
function c33700167.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700167.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33700167.filter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33700167.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c33700167.filter,tp,LOCATION_MZONE,0,1,nil,tp) and Duel.GetMZoneCount(tp)>0 end if chk==0 then return Duel.IsExistingTarget(c33700167.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33700167.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c33700167.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetOverlayCount()*1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetOverlayCount()*1000)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_EXTRA)
end end
function c33700167.activate(e,tp,eg,ep,ev,re,r,rp) function c33700167.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local c=e:GetHandler()
if not tc:IsRelateToEffect(e) then return end local tc=Duel.GetFirstTarget()
local mg=tc:GetOverlayGroup() if not tc or not tc:IsRelateToEffect(e) then return end
Duel.SendtoGrave(mg,REASON_EFFECT) local mg=tc:GetOverlayGroup()
if mg:GetCount()>0 and Duel.Recover(tp,mg:GetCount()*1000,REASON_EFFECT)>0 then local ogc=mg:GetCount()
if Duel.GetMZoneCount(tp)<=0 then return end Duel.SendtoGrave(mg,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) if ogc>0 and Duel.Recover(tp,ogc*1000,REASON_EFFECT)>0 then
local g=Duel.SelectMatchingCard(tp,c33700167.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) if Duel.GetMZoneCount(tp)<=0 then return end
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.Overlay(g,Group.FromCards(tc,e:GetHandler())) local g=Duel.SelectMatchingCard(tp,c33700167.filter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank(),ogc,tc:GetRace(),tc:GetAttribute())
end local sc=g:GetFirst()
end if sc and Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
Duel.Overlay(sc,Group.FromCards(tc))
end
if c:IsRelateToEffect(e) then
c:CancelToGrave()
Duel.Overlay(sc,Group.FromCards(c))
end
end
end end
...@@ -6,11 +6,10 @@ function cm.initial_effect(c) ...@@ -6,11 +6,10 @@ function cm.initial_effect(c)
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsAttackAbove,2100),2,true) aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsAttackAbove,2100),2,true)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(CATEGORY_POSITION) e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE+CATEGORY_POSITION)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
local function pfilter(c) local function pfilter(c)
return not c:IsPosition(POS_FACEUP_ATTACK) and c:IsLocation(LOCATION_MZONE) return not c:IsPosition(POS_FACEUP_ATTACK) and c:IsLocation(LOCATION_MZONE)
end end
......
...@@ -8,6 +8,7 @@ function s.initial_effect(c) ...@@ -8,6 +8,7 @@ function s.initial_effect(c)
--Special Summon --Special Summon
local e1 = Effect.CreateEffect(c) local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetCondition(aux.IsDualState) e1:SetCondition(aux.IsDualState)
......
...@@ -83,7 +83,7 @@ function c33700931.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -83,7 +83,7 @@ function c33700931.activate(e,tp,eg,ep,ev,re,r,rp)
for i=1,2 do for i=1,2 do
local p2=player[i] local p2=player[i]
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsCanBeSpecialSummoned),p2,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,0,p2,false,false) local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(Card.IsCanBeSpecialSummoned),p2,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,0,p2,false,false)
if Duel.GetLocationCount(p2,LOCATION_MZONE)>0 and #g>0 and Duel.SelectYesNo(tp,aux.Stringid(33700931,3)) then if Duel.GetLocationCount(p2,LOCATION_MZONE)>0 and #g>0 and Duel.SelectYesNo(p2,aux.Stringid(33700931,3)) then
Duel.Hint(HINT_SELECTMSG,p2,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,p2,HINTMSG_SPSUMMON)
local sg=g:Select(p2,1,1,nil) local sg=g:Select(p2,1,1,nil)
Duel.SpecialSummon(sg,0,p2,p2,false,false,POS_FACEUP) Duel.SpecialSummon(sg,0,p2,p2,false,false,POS_FACEUP)
......
--月球意识 篝 --月球意识 篝
function c33701060.initial_effect(c) local s,id,o=GetID()
function s.initial_effect(c)
--synchro summon --synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit() c:EnableReviveLimit()
--special summon --special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--disable field
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33701060,1)) e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCode(EVENT_PHASE+PHASE_END,2)
e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1)
e2:SetCost(c33701060.spcost) e2:SetCondition(s.thcon)
e2:SetTarget(c33701060.sptg) e2:SetTarget(s.thtg)
e2:SetOperation(c33701060.spop) e2:SetOperation(s.thop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c33701060.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end end
function c33701060.sumsuc(e,tp,eg,ep,ev,re,r,rp) function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(33701060,0))
end
function c33701060.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c33701060.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) end and Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end end
function c33701060.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end local c=e:GetHandler()
if Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,33701058,0,0x4011,0,3000,10,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,33701058) local token=Duel.CreateToken(tp,33701058)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP_ATTACK)
local e1=Effect.CreateEffect(e:GetHandler()) -- 不会被战斗破坏
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1) e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1) token:RegisterEffect(e1)
local e3=Effect.CreateEffect(e:GetHandler()) -- 不能改变表示形式
e3:SetType(EFFECT_TYPE_EQUIP) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e3:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
token:RegisterEffect(e3) token:RegisterEffect(e3)
local de=Effect.CreateEffect(e:GetHandler()) -- 给衍生物加Flag
de:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) token:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
de:SetCode(EVENT_PHASE+PHASE_END,2) -- 注册结束阶段效果
de:SetCategory(CATEGORY_TOHAND) local e2=Effect.CreateEffect(c)
de:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
de:SetCountLimit(1) e2:SetCode(EVENT_PHASE+PHASE_END)
de:SetValue(c33701060.aclimit) e2:SetCountLimit(1)
de:SetTarget(c33701060.destg) e2:SetLabelObject(token)
de:SetOperation(c33701060.desop) e2:SetCondition(s.thcon)
Duel.RegisterEffect(de,tp) e2:SetOperation(s.thop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end end
end end
function c33701060.aclimit(e,re,tp) function s.cfilter(c)
return not re:GetHandler():IsCode(33701058) return c:IsFaceup() and c:IsCode(33701058)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local token=e:GetLabelObject()
return token and token:GetFlagEffect(id)>0 and token:IsLocation(LOCATION_MZONE)
end end
function c33701060.destg(e,tp,eg,ep,ev,re,r,rp,chk) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and c:GetFlagEffect(id)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD) and Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(1-tp,1) end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,1)
end end
function c33701060.desop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e)) local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT) if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
Duel.BreakEffect() Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT) Duel.Draw(1-tp,1,REASON_EFFECT)
end end
\ No newline at end of file
...@@ -34,7 +34,7 @@ end ...@@ -34,7 +34,7 @@ end
function cm.damop(e,tp,eg,ep,ev,re,r,rp) function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT) Duel.Damage(p,d,REASON_EFFECT)
if Duel.GetActivityCount(m,tp,ACTIVITY_CHAIN)==0 then if Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)<=1 then
Duel.BreakEffect() Duel.BreakEffect()
Duel.Damage(p,1000,REASON_EFFECT) Duel.Damage(p,1000,REASON_EFFECT)
end end
......
...@@ -33,7 +33,7 @@ function cm.initial_effect(c) ...@@ -33,7 +33,7 @@ function cm.initial_effect(c)
e5:SetRange(LOCATION_SZONE) e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,0) e5:SetTargetRange(1,0)
e4:SetCondition(cm.actconb) e5:SetCondition(cm.actconb)
e5:SetValue(cm.actlimit) e5:SetValue(cm.actlimit)
c:RegisterEffect(e5) c:RegisterEffect(e5)
...@@ -87,7 +87,7 @@ function cm.actlimit(e,re,tp) ...@@ -87,7 +87,7 @@ function cm.actlimit(e,re,tp)
rclv=rc:GetLevel() rclv=rc:GetLevel()
while tc do while tc do
local lv=tc:GetLevel() local lv=tc:GetLevel()
if lv>0 and min>tc:GetLevel() then min=tc:GetLevel() end if lv>0 and tc:GetLevel()<min then min=tc:GetLevel() end
tc=g:GetNext() tc=g:GetNext()
end end
end end
...@@ -97,7 +97,7 @@ function cm.actlimit(e,re,tp) ...@@ -97,7 +97,7 @@ function cm.actlimit(e,re,tp)
rclv=rc:GetRank() rclv=rc:GetRank()
while tc do while tc do
local lv=tc:GetRank() local lv=tc:GetRank()
if lv>0 and min>tc:GetRank() then min=tc:GetRank() end if lv>0 and tc:GetRank()<min then min=tc:GetRank() end
tc=g:GetNext() tc=g:GetNext()
end end
end end
...@@ -107,7 +107,7 @@ function cm.actlimit(e,re,tp) ...@@ -107,7 +107,7 @@ function cm.actlimit(e,re,tp)
rclv=rc:GetLink() rclv=rc:GetLink()
while tc do while tc do
local lv=tc:GetLink() local lv=tc:GetLink()
if lv>0 and min>tc:GetLink() then min=tc:GetLink() end if lv>0 and tc:GetLink()<min then min=tc:GetLink() end
tc=g:GetNext() tc=g:GetNext()
end end
end end
......
...@@ -35,7 +35,7 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,7 +35,7 @@ function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local m={} local m={}
local n={} local n={}
local ct=1 local ct=1
m[ct]=aux.Stringid(m,1) n[ct]=1 ct=ct+1 end m[ct]=aux.Stringid(m,1) n[ct]=1 ct=ct+1
if t2 then m[ct]=aux.Stringid(m,2) n[ct]=2 ct=ct+1 end if t2 then m[ct]=aux.Stringid(m,2) n[ct]=2 ct=ct+1 end
if t3 then m[ct]=aux.Stringid(m,3) n[ct]=3 ct=ct+1 end if t3 then m[ct]=aux.Stringid(m,3) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(sp,table.unpack(m)) local sp=Duel.SelectOption(sp,table.unpack(m))
......
...@@ -199,7 +199,7 @@ function cm.rlcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -199,7 +199,7 @@ function cm.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000) Duel.PayLPCost(tp,1000)
end end
function cm.rtg(c,tp) function cm.rtg(c,tp)
return Duel.IsPlayerCanSendtoGrave(1-tp,c) return true --Duel.IsPlayerCanSendtoGrave(1-tp,c)
end end
function cm.rltg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.rltg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetLabel() local ct=e:GetLabel()
......
--THE FIRST TAKE
local s,id,o=GetID()
function s.initial_effect(c)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetValue(s.efilter)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(s.chaincon)
e2:SetOperation(s.chainop)
e2:SetRange(LOCATION_SZONE)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(s.skcon)
e3:SetOperation(s.skop)
e3:SetRange(LOCATION_SZONE)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(1191)
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCountLimit(1)
e4:SetCondition(s.tgcon)
e4:SetTarget(s.tgtg)
e4:SetOperation(s.tgop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
if not s.global_check then
s.global_check=true
s.Records1={}
s.Records2={}
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(s.chaincheck)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(s.resetop)
Duel.RegisterEffect(ge2,0)
end
end
function s.chaincheck(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if not s.Records1[rc:GetCode()] then
s.Records1[rc:GetCode()]=true
elseif s.Records1[rc:GetCode()] then
s.Records2[rc:GetCode()]=true
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
s.Records1={}
s.Records2={}
end
function s.efilter(e,te)
return e:GetOwnerPlayer()==te:GetOwnerPlayer() and te:GetOwner()~=e:GetOwner()
end
function s.chainfilter(re,tp,cid)
return not re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
end
function s.chaincon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==1
end
function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then
Duel.SetChainLimit(s.chainlm)
end
end
function s.chainlm(e,rp,tp)
return tp==rp
end
function s.skcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return re and s.Records2[rc:GetCode()] and Duel.GetTurnPlayer()==tp
end
function s.skop(e,tp,eg,ep,ev,re,r,rp)
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)>0 then
local og=Duel.GetOperatedGroup()
local ct=og:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_DECK,nil)
if ct>0 and (#g1>0 or #g2>0 or #g3>0) then
Duel.BreakEffect()
local sg1=g1:Select(tp,ct,ct,nil)
if #sg1>0 and Duel.SendtoGrave(sg1,REASON_EFFECT)>0 then
local ct2=sg1:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct>ct2 then
ct3=ct-ct2
Duel.ConfirmCards(1-tp,g2)
local sg2=g2:Select(tp,ct3,ct3,nil)
if #sg2>0 and Duel.SendtoGrave(sg2,REASON_EFFECT)>0 then
local ct4=sg2:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct3>ct4 then
ct5=ct3-ct4
local sg3=Duel.GetDecktopGroup(1-tp,ct5)
Duel.SendtoGrave(sg3,REASON_EFFECT)
end
end
end
end
end
end
end
\ No newline at end of file
--天地颠倒的谐谑曲
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.con)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_SEND_REPLACE)
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetOperation(s.op3)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_LEAVE_GRAVE)
c:RegisterEffect(e4)
--
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_REFLECT_DAMAGE)
e4:SetTargetRange(1,1)
e4:SetValue(s.val)
e4:SetRange(LOCATION_SZONE)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetDescription(1191)
e5:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e5:SetCountLimit(1)
e5:SetTarget(s.tgtg)
e5:SetOperation(s.tgop)
c:RegisterEffect(e5)
--
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetOperation(s.lpop)
c:RegisterEffect(e6)
end
function s.val(e,re,ev,r,rp,rc)
return bit.band(r,REASON_EFFECT)~=0
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0
end
function s.repfilter(c,tp)
return c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_HAND and c:IsAbleToRemove(tp,POS_FACEDOWN) and bit.band(c:GetReason(),REASON_DRAW)==0
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.repfilter,1,nil,tp) end
local g=eg:Filter(s.repfilter,nil,tp)
if #g>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
return true
else return false end
end
function s.repval(e,c)
return false
end
function s.filter(c,tp)
return c:GetFlagEffect(id)==0 and c:IsControler(tp)
end
function s.op3(e,tp,eg,ep,ev,re,r,rp)
if #eg==0 then return end
local g1=eg:Filter(s.filter,nil,tp)
if #g1>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,#g1,#g1,nil)
if #sg>0 then
Duel.HintSelection(sg)
for tc in aux.Next(sg) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TODECK,0,1)
end
if Duel.SendtoDeck(sg,nil,1,REASON_RULE)>0 and sg:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
local tg=Duel.GetDecktopGroup(tp,1)
if #tg>0 then
tg:GetFirst():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOGRAVE,0,1)
Duel.DiscardDeck(tp,1,REASON_EFFECT)
end
end
end
end
local g2=eg:Filter(s.filter,nil,1-tp)
if #g2>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
local sg2=Duel.SelectMatchingCard(1-tp,Card.IsAbleToDeck,1-tp,LOCATION_GRAVE,0,#g2,#g2,nil)
if #sg2>0 then
Duel.HintSelection(sg2)
for tc2 in aux.Next(sg2) do
tc2:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TODECK,0,1)
end
if Duel.SendtoDeck(sg2,nil,1,REASON_RULE)>0 and sg2:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then
local tg2=Duel.GetDecktopGroup(1-tp,1)
if #tg2>0 then
tg2:GetFirst():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOGRAVE,0,1)
Duel.DiscardDeck(1-tp,1,REASON_EFFECT)
end
end
end
end
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(Duel.GetTurnPlayer(),2) end
Duel.SetTargetPlayer(1-Duel.GetTurnPlayer())
Duel.SetTargetParam(2000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-Duel.GetTurnPlayer(),2000)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDecktopGroup(Duel.GetTurnPlayer(),2)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.BreakEffect()
Duel.Recover(p,d,REASON_EFFECT)
end
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
Duel.SetLP(tp,lp2)
Duel.SetLP(1-tp,lp1)
end
\ No newline at end of file
--向空挥拳! --向空挥拳!
function c33703032.initial_effect(c) function c33703032.initial_effect(c)
--这张卡在自己场上有且仅有1只怪兽存在的场合可以从手卡发动。 --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetCondition(c33703032.handcon)
c:RegisterEffect(e1)
--自己场上只有这张卡和1只怪兽的场合才能发动。自己场上的怪兽的攻击力·守备力变成5000。自己没有手卡的场合,自己场上的怪兽直到下个对方的结束阶段时不受效果影响。是自己回合的场合,这个回合结束。
local e2=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c33703032.condition)
e1:SetTarget(c33703032.target) e1:SetTarget(c33703032.target)
e1:SetOperation(c33703032.activate) e1:SetOperation(c33703032.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(c33703032.handcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end
--这张卡在自己场上有且仅有1只怪兽存在的场合可以从手卡发动。
function c33703032.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==1
end end
function c33703032.condition(e,tp,eg,ep,ev,re,r,rp) function c33703032.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==2 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1 and Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_SZONE,0)==1 if not (Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
and not Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,2,e:GetHandler())) then return false end
for i=1,ev do
if Duel.IsChainDisablable(i) then return true end
end
return false
end end
--自己场上只有这张卡和1只怪兽的场合才能发动。自己场上的怪兽的攻击力·守备力变成5000。
function c33703032.target(e,tp,eg,ep,ev,re,r,rp,chk) function c33703032.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dg=Group.CreateGroup()
for i=1,ev do for i=1,ev do
Duel.NegateActivation(i) local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if Duel.IsChainNegatable(i) then dg:AddCard(te:GetHandler()) end
end end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup(),tp,LOCATION_MZONE,0,1,nil) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,dg,dg:GetCount(),0,0)
end end
function c33703032.activate(e,tp,eg,ep,ev,re,r,rp) function c33703032.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup(),tp,LOCATION_MZONE,0,nil) for i=1,ev do Duel.NegateEffect(i) end
local tc=g:GetFirst() local sg=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
while tc do for sc in aux.Next(sg) do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(5000) e1:SetValue(5000)
tc:RegisterEffect(e1) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
local e2=Effect.CreateEffect(c) sc:RegisterEffect(e1)
e2:SetType(EFFECT_TYPE_SINGLE) local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE) e2:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) sc:RegisterEffect(e2)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) end
e2:SetValue(5000) if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then
tc:RegisterEffect(e2) local tg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
--自己没有手卡的场合,自己场上的怪兽直到下个对方的结束阶段时不受效果影响。 for tc in aux.Next(tg) do
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_IMMUNE_EFFECT) e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e3:SetValue(c33703032.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e3:SetValue(c33703032.value)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
end end
tc=g:GetNext()
end end
--是自己回合的场合,这个回合结束。 if Duel.GetTurnPlayer()==tp then
if Duel.GetTurnPlayer()==1-tp then Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler()) Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
e1:SetType(EFFECT_TYPE_FIELD) Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
e1:SetTargetRange(1,0) Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
e1:SetCode(EFFECT_SKIP_TURN) local e4=Effect.CreateEffect(c)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2) e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
Duel.RegisterEffect(e1,tp) e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_BP)
e4:SetTargetRange(1,0)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
end end
end end
function c33703032.value(e,te) function c33703032.efilter(e,re)
return te:GetOwner()~=e:GetOwner() return e:GetHandler()~=re:GetOwner()
end end
\ No newline at end of file function c33703032.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_MZONE,0)==1
and not Duel.IsExistingMatchingCard(aux.TRUE,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,2,nil)
end
--虚拟占卜师 狼-半-仙 --虚拟占卜师 狼-半-仙
local m=33703042 local s,id,o=GetID()
local cm=_G["c"..m] function s.initial_effect(c)
function cm.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedure(c,nil,9,3,cm.ovfilter,aux.Stringid(m,0)) aux.AddXyzProcedure(c,nil,9,3,s.ovfilter,aux.Stringid(id,0),3,nil)
c:EnableReviveLimit() c:EnableReviveLimit()
-- 新增效果
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.thcost) e1:SetCountLimit(1)
e1:SetTarget(cm.thtg) e1:SetCost(s.rmcost)
e1:SetOperation(cm.thop) e1:SetTarget(s.rmtg)
e1:SetLabel(1) e1:SetOperation(s.rmop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,2))
e2:SetLabel(2)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,3))
e3:SetLabel(3)
c:RegisterEffect(e3)
end end
function cm.ovfilter(c) function s.ovfilter(c)
return (c:IsType(TYPE_XYZ) and c:IsRankAbove(7)) or (c:IsType(TYPE_SYNCHRO) and c:IsLevelAbove(7)) return c:IsFaceup() and (c:IsRankAbove(7)or c:IsLevelAbove(7))and c:IsType(TYPE_SYNCHRO+TYPE_XYZ)
end end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) -- 新效果相关函数
local ct=e:GetLabel() function s.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription()) local oc=e:GetHandler():GetOverlayCount()
e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST) e:SetLabel(oc) -- 记录去除的素材数量
e:GetHandler():RemoveOverlayCard(tp,oc,oc,REASON_COST)
end end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED) if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) end
end end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local temp =e:GetLabel()
if temp == 1 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) then
local g=Duel.GetDecktopGroup(tp,Duel.GetFieldGroupCount(tp,LOCATION_HAND,0))
if g:FilterCount(Card.IsAbleToRemove,nil,POS_FACEDOWN)==Duel.GetFieldGroupCount(tp,LOCATION_HAND,0) then
Duel.DisableShuffleCheck()
Duel.ConfirmDecktop(tp,Duel.GetFieldGroupCount(tp,LOCATION_HAND,0))
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local sc =Group.Select(g,tp,1,1,nil)
Duel.SendtoHand(sc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
end
elseif temp ==2 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>5 then
local g=Duel.GetDecktopGroup(tp,5)
if g:FilterCount(Card.IsAbleToRemove,nil,POS_FACEDOWN)==5 then
Duel.DisableShuffleCheck()
Duel.ConfirmDecktop(tp,5)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local sc =Group.Select(g,tp,1,1,nil)
Duel.SendtoHand(sc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
end
elseif temp ==3 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,1,1,nil)
Duel.DisableShuffleCheck()
Duel.ConfirmCards(1-tp,g)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local sc =Group.Select(g,tp,1,1,nil)
Duel.SendtoHand(sc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sc)
Duel.ShuffleHand(tp)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local oc=e:GetLabel()
if ct>0 then
local res=false
if oc>=3 then
res=Duel.SelectYesNo(tp,aux.Stringid(id,2))
end
if res then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,ct,ct,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local xc=sg:GetFirst()
while xc do
xc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
xc=sg:GetNext()
end
else
-- 查看并里侧除外
local g=Duel.GetDecktopGroup(tp,ct)
Duel.ConfirmDecktop(tp,ct)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
local xc=g:GetFirst()
while xc do
xc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
xc=g:GetNext()
end
end
-- 追加效果处理
if oc>=2 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
if not res then
local exg=Duel.GetDecktopGroup(tp,5)
Duel.Remove(exg,POS_FACEDOWN,REASON_EFFECT)
local xc=exg:GetFirst()
while xc do
xc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
xc=exg:GetNext()
end
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_DECK,0,5,5,nil)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local xc=sg:GetFirst()
while xc do
xc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,3))
xc=sg:GetNext()
end
end
end
-- 修改后的持续效果
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PREDRAW)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
e1:SetCondition(s.drcon)
e1:SetOperation(s.drop)
Duel.RegisterEffect(e1,tp)
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_REMOVED,0,1,nil) then
e:Reset()
end
return Duel.IsTurnPlayer(tp)
and Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_REMOVED,0,1,nil)
end
function s.ffilter(c)
return c:GetFlagEffect(id)>0 -- 新增过滤函数
end end
-- 新增操作处理函数
function s.drop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.ffilter,tp,LOCATION_REMOVED,0,nil)
if #g>0 then
local sg=g:RandomSelect(tp,1)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
-- 持续效果
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_DRAW,1)
Duel.RegisterEffect(e1,tp)
end
end
\ No newline at end of file
...@@ -12,10 +12,10 @@ function cm.initial_effect(c) ...@@ -12,10 +12,10 @@ function cm.initial_effect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_DESTROYED) e0:SetCode(EVENT_DESTROYED)
e0:SetRange(LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED) e0:SetRange(LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED)
e0:SetCondition(cm.calcon) --e0:SetCondition(cm.calcon)
e0:SetOperation(cm.calop) e0:SetOperation(cm.calop)
e0:SetLabel(0) e0:SetLabel(0)
e0:SetReset(EVENT_PHASE+PHASE_END) --e0:SetReset(EVENT_PHASE+PHASE_END)
c:RegisterEffect(e0) c:RegisterEffect(e0)
--spsummon condition --spsummon condition
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -49,8 +49,7 @@ function cm.calop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,8 +49,7 @@ function cm.calop(e,tp,eg,ep,ev,re,r,rp)
tc=eg:GetNext() tc=eg:GetNext()
end end
if g:GetCount()~=0 then if g:GetCount()~=0 then
local temp=e:GetLabel() Duel.RegisterFlagEffect(1-rp,m,RESET_PHASE+PHASE_END,0,1)
e:SetLabel(temp+1)
end end
end end
...@@ -63,7 +62,7 @@ function cm.splimit(e) ...@@ -63,7 +62,7 @@ function cm.splimit(e)
end end
function cm.sprcon(e,tp,eg,ep,ev,re,r,rp) function cm.sprcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()~=0 and Duel.GetTurnPlayer()==tp return Duel.GetFlagEffect(tp,m)>0
end end
function cm.rem(g) function cm.rem(g)
return g:GetClassCount(Card.GetCode)==1 and g:GetCount()==3 return g:GetClassCount(Card.GetCode)==1 and g:GetCount()==3
...@@ -85,12 +84,12 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,12 +84,12 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(e:GetLabelObject():GetLabel()*2000) e1:SetValue(Duel.GetFlagEffect(tp,m)*2000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1) e:GetHandler():RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE) e2:SetCode(EFFECT_SET_DEFENSE)
e2:SetValue(e:GetLabelObject():GetLabel()*2000) e2:SetValue(Duel.GetFlagEffect(tp,m)*2000)
e:GetHandler():RegisterEffect(e2) e:GetHandler():RegisterEffect(e2)
end end
end end
...@@ -102,4 +101,4 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp) ...@@ -102,4 +101,4 @@ function cm.sprop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.spfilter(c) function cm.spfilter(c)
return c:IsType(TYPE_MONSTER) return c:IsType(TYPE_MONSTER)
end end
--除虫射日
local s,id,o=GetID()
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.con)
e2:SetOperation(s.op)
c:RegisterEffect(e2)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEDOWN) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
s.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(s.regcon)
e1:SetOperation(s.regop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e3:SetTargetRange(1,0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
end
function s.cfilter(c,tp)
return c:IsPreviousControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and c:IsPreviousLocation(LOCATION_ONFIELD)
and c:GetReasonPlayer()==1-tp
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.cfilter,nil,tp)
if #g==0 then return end
Duel.Hint(HINT_CARD,0,id)
local tg=Group.CreateGroup()
for tc in aux.Next(g) do
local code=tc:GetOriginalCode()
local sg1=Duel.GetMatchingGroup(s.namefilter,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK+LOCATION_EXTRA,0,nil,code)
if #sg1>0 then
tg:Merge(sg1)
end
local sg2=Duel.GetMatchingGroup(s.namefilter,1-tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_DECK+LOCATION_EXTRA,0,nil,code)
if #sg2>0 then
tg:Merge(sg2)
end
end
local tg2=Group.CreateGroup()
local dg1=tg:Filter(Card.IsControler,nil,tp)
if tg and Duel.Destroy(dg1,REASON_EFFECT)~=0 then
local og1=Duel.GetOperatedGroup()
tg2:Merge(og1)
cg=Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA)
Duel.ConfirmCards(tp,cg)
Duel.BreakEffect()
local dg2=tg:Filter(Card.IsControler,nil,1-tp)
Duel.Destroy(dg2,REASON_EFFECT)
local og2=Duel.GetOperatedGroup()
tg2:Merge(og2)
end
if #tg2>0 then
Duel.Recover(tp,#tg2*500,REASON_EFFECT)
end
end
function s.namefilter(c,code)
return c:IsCode(code)
end
\ No newline at end of file
--智商跃升!
local s,id=GetID()
function s.initial_effect(c)
c:EnableCounterPermit(0x4)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
local e1x=Effect.CreateEffect(c)
e1x:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1x:SetCode(EVENT_CHAINING)
e1x:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1x:SetRange(LOCATION_SZONE)
e1x:SetCondition(s.ctcon)
e1x:SetOperation(aux.chainreg)
c:RegisterEffect(e1x)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.ctcon)
e1:SetOperation(s.ctop)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) and Duel.GetTurnPlayer()~=tp and s.cardadvantage(tp)
end)
e4:SetOperation(s.ctop2)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.tdcon)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,1))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_FREE_CHAIN)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(s.spcon)
e6:SetOperation(s.spop)
c:RegisterEffect(e6)
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(id,2))
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetRange(LOCATION_SZONE)
e8:SetCondition(s.descon)
e8:SetOperation(s.desop)
c:RegisterEffect(e8)
local e9=Effect.CreateEffect(c)
e9:SetDescription(aux.Stringid(id,3))
e9:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e9:SetCode(EVENT_FREE_CHAIN)
e9:SetRange(LOCATION_SZONE)
e9:SetCondition(s.drcon)
e9:SetOperation(s.drop)
c:RegisterEffect(e9)
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(id,4))
e10:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e10:SetCode(EVENT_FREE_CHAIN)
e10:SetRange(LOCATION_SZONE)
e10:SetCondition(s.descon2)
e10:SetOperation(s.desop2)
c:RegisterEffect(e10)
local e11=Effect.CreateEffect(c)
e11:SetDescription(aux.Stringid(id,5))
e11:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetRange(LOCATION_SZONE)
e11:SetCondition(s.skcon)
e11:SetOperation(s.skop)
c:RegisterEffect(e11)
local e3=Effect.CreateEffect(c)
e3:SetDescription(1122)
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.damcon)
e3:SetTarget(s.damtg)
e3:SetOperation(s.damop)
c:RegisterEffect(e3)
--damage
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_LEAVE_FIELD_P)
e7:SetOperation(s.dap)
c:RegisterEffect(e7)
e3:SetLabelObject(e7)
end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and s.cardadvantage(tp)
end
function s.cardadvantage(tp)
local ct1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local ct2=Duel.GetFieldGroupCount(1-tp,LOCATION_ONFIELD,0)
return ct2>ct1
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(1)>0 and re:GetHandlerPlayer()~=tp then
e:GetHandler():AddCounter(0x4,1)
end
end
function s.ctop2(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x4,1)
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,nil) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x4)>=2 and Duel.GetFlagEffect(tp,id)==0
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,2,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(function(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x3)>=3 and Duel.GetFlagEffect(tp,id+10000)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,3,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(function(c,e,tp) return c:IsCanBeSpecialSummoned(e,0,tp,false,false) end,tp,LOCATION_GRAVE,0,1,nil,e,tp),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
Duel.RegisterFlagEffect(tp,id+10000,RESET_PHASE+PHASE_END,0,1)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x4)>=5 and Duel.GetFlagEffect(tp,id+20000)==0
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,5,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,id+20000,RESET_PHASE+PHASE_END,0,1)
end
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerCanDraw(tp,1) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x4)>=7 and Duel.GetFlagEffect(tp,id+30000)==0
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,7,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.desfilter(c)
if c:IsLocation(LOCATION_FZONE) then return false end
return true
end
function s.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x4)>=11 and Duel.GetFlagEffect(tp,id+40000)==0
end
function s.seqcheck(c,tp,i)
if c:IsLocation(LOCATION_FZONE) then return false end
if c:IsControler(tp) then
if c:GetSequence()==5 then
return i==1
elseif c:GetSequence()==6 then
return i==3
else
return c:GetSequence()==i
end
else
if c:GetSequence()==5 then
return i==3
elseif c:GetSequence()==6 then
return i==1
else
return c:GetSequence()==4-i
end
end
end
function s.desop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,11,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
local c=e:GetHandler()
local tab={}
for i=0,4 do
if Duel.IsExistingMatchingCard(s.seqcheck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,tp,i) then
table.insert(tab,i+1)
end
end
local num=Duel.AnnounceNumber(tp,table.unpack(tab))
local g=Duel.GetMatchingGroup(s.seqcheck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp,num-1)
Duel.Destroy(g,REASON_EFFECT)
Duel.RegisterFlagEffect(tp,id+40000,RESET_PHASE+PHASE_END,0,1)
end
end
function s.skcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) and Duel.GetTurnPlayer()==tp
and Duel.GetCurrentChain()<=0 and Duel.IsMainPhase() and e:GetHandler():GetCounter(0x4)>=13 and Duel.GetFlagEffect(tp,id+50000)==0
end
function s.skop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():RemoveCounter(tp,0x4,13,REASON_COST)~=0 then
Duel.Hint(HINT_CARD,0,id)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,id+50000,RESET_PHASE+PHASE_END,0,1)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_SZONE) and c:IsReason(REASON_DESTROY) and rp==1-tp
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
local ct=e:GetLabelObject():GetLabel()
Duel.SetTargetParam(ct*200)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ct*200)
end
function s.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 s.dap(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x4)
e:SetLabel(ct)
end
\ No newline at end of file
--可爱的电子朋友
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--code
aux.EnableChangeCode(c,70095154,LOCATION_MZONE+LOCATION_GRAVE)
--spsummon condition
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)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(s.sprcon)
e2:SetTarget(s.sprtg)
e2:SetOperation(s.sprop)
c:RegisterEffect(e2)
-- e3
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return g>=1
end)
e3:SetValue(s.atkval)
c:RegisterEffect(e3)
-- e4
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return g>=4
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local e10=Effect.CreateEffect(e:GetHandler())
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_CANNOT_ACTIVATE)
e10:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e10:SetTargetRange(0,1)
e10:SetReset(RESET_PHASE+PHASE_BATTLE)
e10:SetValue(s.actlimit)
Duel.RegisterEffect(e10,tp)
end)
c:RegisterEffect(e4)
-- e5
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_ATTACK_ALL)
e5:SetCondition(function(e)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return g>=7
end)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLE_DESTROYING)
e6:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return c:IsRelateToBattle() and c:GetBattleTarget():IsType(TYPE_MONSTER) and g>=7
end)
e6:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2100)
end)
e6:SetOperation(s.damop)
c:RegisterEffect(e6)
-- e6
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_DIRECT_ATTACK)
e7:SetCondition(function(e)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return g>=10
end)
c:RegisterEffect(e7)
end
function s.sprfilter(c)
return c:IsFaceup() and c:IsAbleToGraveAsCost()
end
function s.fselect(g,tp,sc)
return Duel.GetLocationCountFromEx(tp,tp,g,sc)>0 and aux.gffcheck(g,Card.IsType,TYPE_TUNER,Card.IsCode,70095154)
end
function s.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil)
return g:CheckSubGroup(s.fselect,2,2,tp,c)
end
function s.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(s.sprfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:SelectSubGroup(tp,s.fselect,true,2,2,tp,c)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.SendtoGrave(g,REASON_SPSUMMON)
g:DeleteGroup()
end
function s.atkval(e,c)
local g=Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,70095154)
return g*300
end
function s.actlimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,2100,REASON_EFFECT)
end
\ No newline at end of file
...@@ -98,6 +98,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,6 +98,7 @@ function cm.op(e,tp,eg,ep,ev,re,r,rp)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_MZONE) e0:SetRange(LOCATION_MZONE)
e0:SetValue(0x442) e0:SetValue(0x442)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0,true) tc:RegisterEffect(e0,true)
end end
end end
......
...@@ -47,6 +47,42 @@ function s.initial_effect(c) ...@@ -47,6 +47,42 @@ function s.initial_effect(c)
e2:SetValue(s.repval) e2:SetValue(s.repval)
e2:SetOperation(s.repop) e2:SetOperation(s.repop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(id)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(1,0)
c:RegisterEffect(e3)
if not s.global_check then
s.global_check=true
local _DiscardDeck = Duel.DiscardDeck
function Duel.DiscardDeck(p,v,r)
local g=Duel.GetDecktopGroup(p,v)
local eset={Duel.IsPlayerAffectedByEffect(p,id)}
for _,e in ipairs(eset) do
if s.reptg(e,p,g,p,0,self_reference_effect,r,p,0) then
local eg=g:Filter(s.repfilter,nil)
if #eg>0 then
Duel.ConfirmCards(p,eg)
end
local rg=s.reptg(e,p,g,p,0,self_reference_effect,r,p,id)
if aux.GetValueType(rg)=="Group" then
g:Sub(rg)
if #g>0 then
s.donotapply=true
local ct=Duel.SendtoGrave(g,r,self_reference_tp)
s.donotapply=false
Duel.Draw(p,1,REASON_EFFECT)
return ct
end
end
end
end
return _DiscardDeck(p,v,r)
end
end
if not s.MergedDelayedEventInfotable then if not s.MergedDelayedEventInfotable then
s.MergedDelayedEventInfotable={} s.MergedDelayedEventInfotable={}
local ge1=Effect.GlobalEffect() local ge1=Effect.GlobalEffect()
...@@ -57,6 +93,8 @@ function s.initial_effect(c) ...@@ -57,6 +93,8 @@ function s.initial_effect(c)
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
s.donotapply=false
function s.resetop() function s.resetop()
aux.ClearTableRecursive(s.MergedDelayedEventInfotable) aux.ClearTableRecursive(s.MergedDelayedEventInfotable)
end end
...@@ -100,28 +138,42 @@ end ...@@ -100,28 +138,42 @@ end
--E2 --E2
function s.repfilter(c) function s.repfilter(c)
return not c:IsLocation(LOCATION_SZONE|LOCATION_DECK) and c:GetDestination()==LOCATION_GRAVE and (c:IsMonster() or c:IsLocation(LOCATION_MZONE)) local deckchk=c:IsLocation(LOCATION_DECK)
and c:IsSetCard(ARCHE_BRAND_810) and c:IsAbleToDeck() local dest=c:GetDestination()
and (not c:IsOnField() or c:IsFaceup()) return not c:IsLocation(LOCATION_SZONE) and (dest==LOCATION_GRAVE or (deckchk and c:DestinationRedirect(LOCATION_GRAVE)==0)) and c:IsFaceupEx() and (c:IsMonster() or c:IsLocation(LOCATION_MZONE))
and c:IsSetCard(ARCHE_BRAND_810)
and (c:IsAbleToDeck() or deckchk)
end end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return r&(REASON_BATTLE|REASON_EFFECT)>0 and eg:IsExists(s.repfilter,1,nil) and Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return not s.donotapply and r&(REASON_BATTLE|REASON_EFFECT)>0 and eg:IsExists(s.repfilter,1,nil) and Duel.IsPlayerCanDraw(tp,1) end
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.Hint(HINT_CARD,tp,id)
local c=e:GetHandler() local c=e:GetHandler()
local g=eg:Filter(s.repfilter,nil) local g=eg:Filter(s.repfilter,nil)
local ct=#g local ct=#g
local fid=e:GetFieldID() local fid=e:GetFieldID()
e:SetLabel(fid) e:SetLabel(fid)
if ct>1 then if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,ct,nil) g=g:Select(tp,1,ct,nil)
end end
for tc in aux.Next(g) do if chk~=id then
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid) for tc in aux.Next(g) do
tc:RegisterFlagEffect(FLAG_REDIRECTED,0,0,1,fid)
end
end end
local seq=#g==1 and SEQ_DECKBOTTOM or SEQ_DECKTOP local seq=#g==1 and SEQ_DECKBOTTOM or SEQ_DECKTOP
if Duel.SendtoDeck(g,nil,seq,REASON_EFFECT)>0 then local dg=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
if #dg>0 then
Duel.ConfirmCards(1-tp,dg)
end
local tg=g:Filter(aux.TRUE,dg)
Duel.HintSelection(tg)
local ct=Duel.SendtoDeck(tg,nil,seq,REASON_EFFECT)
if ct>0 or #dg>0 then
local rg=Duel.GetGroupOperatedByThisEffect(e):Filter(Card.IsLocation,nil,LOCATION_DECK) local rg=Duel.GetGroupOperatedByThisEffect(e):Filter(Card.IsLocation,nil,LOCATION_DECK)
local check=#rg==0
rg:Merge(dg)
if #rg>1 then if #rg>1 then
local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK) local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,tp) local ct1=og:FilterCount(Card.IsControler,nil,tp)
...@@ -144,11 +196,20 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -144,11 +196,20 @@ function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.MoveSequence(tc,SEQ_DECKBOTTOM) Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end end
end end
elseif check then
local tc=rg:GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
if chk==id then
return rg
else
Duel.Draw(tp,1,REASON_EFFECT)
end end
Duel.Draw(tp,1,REASON_EFFECT)
end end
return true return true
else return false end else
return false
end
end end
function s.repval(e,c) function s.repval(e,c)
return c:HasFlagEffectLabel(FLAG_REDIRECTED,e:GetLabel()) return c:HasFlagEffectLabel(FLAG_REDIRECTED,e:GetLabel())
......
--[[
晦空士 ~沉醉之默视~
Sepialife - Attention From Incognito
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--You cannot Pendulum Summon monsters. This effect cannot be negated.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetTargetRange(1,0)
e1:SetTarget(s.psplimit)
c:RegisterEffect(e1)
--[[At the start of your Main Phase 1, if there is another "Sepialife" card in your other Pendulum Zone: You can Special Summon, from your Deck, up to 3 "Sepialife" monsters with different names, each with a Level between (exclusive) the Pendulum Scales of the cards in your Pendulum Zones, then it becomes the End Phase of this turn.]]
local e2=Effect.CreateEffect(c)
e2:Desc(0,id)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetFunctions(
s.spcon,
nil,
s.sptg,
s.spop
)
c:RegisterEffect(e2)
--[[During your Battle Phase, if you have not activated the effect of a non-"Sepialife" card this turn (Quick Effect): You can place this card from your hand to your Spell/Trap Zone as a Continuous Spell, and if you do, it becomes the End Phase.]]
local e3=Effect.CreateEffect(c)
e3:Desc(1,id)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetRelevantBattleTimings()
e3:SetFunctions(
s.cscon,
nil,
s.cstg,
s.csop
)
c:RegisterEffect(e3)
--[[While this card is a Continuous Spell, it gains this effect.
● Each time your opponent activates a card effect or declares an attack, they must reveal 1 card in their hand and keep it revealed until the end of your next turn. If they do not, that effect or attack is negated.]]
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_SZONE)
e4:SetFunctions(
s.negcon,
nil,
nil,
s.negop
)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_ATTACK_ANNOUNCE)
e5:SetRange(LOCATION_SZONE)
e5:SetFunctions(
s.negcon,
nil,
nil,
s.negop
)
c:RegisterEffect(e5)
aux.RegisterTriggeringArchetypeCheck(c,ARCHE_SEPIALIFE)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
if not aux.CheckArchetypeReasonEffect(s,re,ARCHE_SEPIALIFE) then
Duel.RegisterFlagEffect(ep,id,RESET_PHASE|PHASE_END,0,1)
end
end
--P1
function s.psplimit(e,c,tp,sumtp,sumpos)
return sumtp&SUMMON_TYPE_PENDULUM==SUMMON_TYPE_PENDULUM
end
--P2
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase(tp,1) and not Duel.CheckPhaseActivity() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,ARCHE_SEPIALIFE),tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function s.spfilter(c,e,tp,min,max)
if not (c:IsSetCard(ARCHE_SEPIALIFE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:HasLevel()) then return false end
local lv=c:GetLevel()
return lv>min and lv<max
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local lz,rz=Duel.GetFieldCard(tp,LOCATION_PZONE,0),Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not lz or not rz then return false end
local lsc,rsc=lz:GetLeftScale(),rz:GetRightScale()
return math.abs(lsc-rsc)>1 and Duel.GetMZoneCount(tp)>0 and Duel.IsExists(false,s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,math.min(lsc,rsc),math.max(lsc,rsc))
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local lz,rz=Duel.GetFieldCard(tp,LOCATION_PZONE,0),Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not lz or not rz then return end
local ft=Duel.GetMZoneCountForMultipleSpSummon(tp)
if ft<=0 then return end
local lsc,rsc=lz:GetLeftScale(),rz:GetRightScale()
local g=Duel.Group(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp,math.min(lsc,rsc),math.max(lsc,rsc))
if #g==0 then return end
local tg=xgl.SelectUnselectGroup(g,e,tp,1,math.min(3,ft),xgl.dncheck,1,tp,HINTMSG_SPSUMMON)
if #tg>0 and Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
--E3
function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsBattlePhase(tp) and not Duel.PlayerHasFlagEffect(tp,id)
end
function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return not c:HasFlagEffect(id) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.csop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and Duel.PlaceAsContinuousCard(c,tp,tp,c,TYPE_SPELL)>0 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
--E5
function s.negcon(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsSpell(TYPE_CONTINUOUS) then return false end
local event=e:GetCode()
if event==EVENT_CHAINING then
return rp==1-tp
else
return Duel.GetAttacker():IsControler(1-tp)
end
end
function s.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.PlayerHasFlagEffect(tp,id+100) then return end
Duel.Hint(HINT_CARD,tp,id)
local g=Duel.Group(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,nil)
if #g==0 or not Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.RegisterFlagEffect(tp,id+100,RESET_CHAIN,0,1)
local event=e:GetCode()
if event==EVENT_CHAINING then
if Duel.IsChainDisablable(ev) then Duel.NegateEffect(ev) end
else
Duel.NegateAttack()
end
else
local tc=g:Select(1-tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESETS_STANDARD_PHASE_END,Duel.GetNextPhaseCount(nil,tp))
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--[[
晦空士 ~无知之见证~
Sepialife - Witness From Ignorance
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
aux.EnablePendulumAttribute(c)
--You cannot Pendulum Summon monsters. This effect cannot be negated.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_CAN_FORBIDDEN)
e1:SetTargetRange(1,0)
e1:SetTarget(s.psplimit)
c:RegisterEffect(e1)
--[[At the start of your Main Phase 1, if there is another "Sepialife" card in your other Pendulum Zone: You can Special Summon, from your GY, up to 5 "Sepialife" monsters with different names, each with a Level between (exclusive) the Pendulum Scales of the cards in your Pendulum Zones, then it becomes the End Phase of this turn.]]
local e2=Effect.CreateEffect(c)
e2:Desc(0,id)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_PZONE)
e2:SetFunctions(
s.spcon,
nil,
s.sptg,
s.spop
)
c:RegisterEffect(e2)
--[[During your Battle Phase, if you have not activated the effect of a non-"Sepialife" card this turn (Quick Effect): You can place this card from your hand to your Spell/Trap Zone as a Continuous Spell, and if you do, it becomes the End Phase.]]
local e3=Effect.CreateEffect(c)
e3:Desc(1,id)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetRelevantBattleTimings()
e3:SetFunctions(
s.cscon,
nil,
s.cstg,
s.csop
)
c:RegisterEffect(e3)
--[[While this card is a Continuous Spell, it gains this effect.
● Each time your opponent adds a card(s) from their Deck to their hand, they can choose to reveal 1 other card in their hand and keep it revealed until the end of your next turn. If they do not, place that added card(s) to the bottom of your Deck.]]
aux.RegisterMaxxCEffect(c,id+100,nil,LOCATION_SZONE,EVENT_TO_HAND,s.reccon,s.recopOUT,s.recopIN,s.flaglabel,false,false,nil,aux.AddThisCardInSZoneAlreadyCheck(c))
aux.RegisterTriggeringArchetypeCheck(c,ARCHE_SEPIALIFE)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_CHAIN_SOLVED)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
if not aux.CheckArchetypeReasonEffect(s,re,ARCHE_SEPIALIFE) then
Duel.RegisterFlagEffect(ep,id,RESET_PHASE|PHASE_END,0,1)
end
end
--P1
function s.psplimit(e,c,tp,sumtp,sumpos)
return sumtp&SUMMON_TYPE_PENDULUM==SUMMON_TYPE_PENDULUM
end
--P2
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsMainPhase(tp,1) and not Duel.CheckPhaseActivity() and Duel.IsExistingMatchingCard(aux.FaceupFilter(Card.IsSetCard,ARCHE_SEPIALIFE),tp,LOCATION_PZONE,0,1,e:GetHandler())
end
function s.spfilter(c,e,tp,min,max)
if not (c:IsSetCard(ARCHE_SEPIALIFE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:HasLevel()) then return false end
local lv=c:GetLevel()
return lv>min and lv<max
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local lz,rz=Duel.GetFieldCard(tp,LOCATION_PZONE,0),Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not lz or not rz then return false end
local lsc,rsc=lz:GetLeftScale(),rz:GetRightScale()
return math.abs(lsc-rsc)>1 and Duel.GetMZoneCount(tp)>0 and Duel.IsExists(false,s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,math.min(lsc,rsc),math.max(lsc,rsc))
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local lz,rz=Duel.GetFieldCard(tp,LOCATION_PZONE,0),Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not lz or not rz then return end
local ft=Duel.GetMZoneCountForMultipleSpSummon(tp)
if ft<=0 then return end
local lsc,rsc=lz:GetLeftScale(),rz:GetRightScale()
local g=Duel.Group(aux.Necro(s.spfilter),tp,LOCATION_GRAVE,0,nil,e,tp,math.min(lsc,rsc),math.max(lsc,rsc))
if #g==0 then return end
local tg=xgl.SelectUnselectGroup(g,e,tp,1,math.min(5,ft),xgl.dncheck,1,tp,HINTMSG_SPSUMMON)
if #tg>0 and Duel.SpecialSummon(tg,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
--E3
function s.cscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsBattlePhase(tp) and not Duel.PlayerHasFlagEffect(tp,id)
end
function s.cstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return not c:HasFlagEffect(id) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsForbidden() and c:CheckUniqueOnField(tp,LOCATION_SZONE)
end
c:RegisterFlagEffect(id,RESET_CHAIN,0,1)
end
function s.csop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() and Duel.PlaceAsContinuousCard(c,tp,tp,c,TYPE_SPELL)>0 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
--E5
function s.cfilter(c,p)
return c:IsPreviousLocation(LOCATION_DECK) and c:IsPreviousControler(p) and c:IsControler(p)
end
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsType(TYPE_CONTINUOUS) and not eg:IsContains(c) and eg:IsExists(aux.AlreadyInRangeFilter(e,s.cfilter),1,nil,1-tp)
end
function s.flaglabel(e,tp,eg,ep,ev,re,r,rp)
local fid=e:GetHandler():GetFieldID()
local g=eg:Filter(aux.AlreadyInRangeFilter(e,s.cfilter),nil,1-tp)
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id+100,RESET_EVENT|RESETS_STANDARD|RESET_CHAIN,0,1,fid)
end
return 0
end
function s.recopOUT(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
local sg=eg:Filter(Card.IsLocation,nil,LOCATION_HAND):Filter(s.cfilter,nil,1-tp)
local g=Duel.Group(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,sg)
if #g==0 or not Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.SendtoDeck(sg,tp,SEQ_DECKTOP,REASON_EFFECT)
local rg=Duel.GetOperatedGroup()
local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,tp)
local ct2=og:FilterCount(Card.IsControler,nil,1-tp)
if ct1>0 then
if ct1>1 then
Duel.SortDecktop(tp,tp,ct1)
end
for i=1,ct1 do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
if ct2>0 then
if ct2>1 then
Duel.SortDecktop(tp,1-tp,ct2)
end
for i=1,ct2 do
local tc=Duel.GetDecktopGroup(1-tp,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
else
local tc=g:Select(1-tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESETS_STANDARD_PHASE_END,Duel.GetNextPhaseCount(nil,tp))
tc:RegisterEffect(e1)
end
end
function s.recopIN(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
local fid=e:GetHandler():GetFieldID()
local sg=Duel.Group(Card.HasFlagEffectLabel,tp,0,LOCATION_HAND,nil,id+100,fid)
local g=Duel.Group(aux.NOT(Card.IsPublic),tp,0,LOCATION_HAND,sg)
if #g==0 or not Duel.SelectYesNo(1-tp,aux.Stringid(id,2)) then
Duel.SendtoDeck(sg,tp,SEQ_DECKTOP,REASON_EFFECT)
local rg=Duel.GetOperatedGroup()
local og=rg:Filter(Card.IsLocation,nil,LOCATION_DECK)
local ct1=og:FilterCount(Card.IsControler,nil,tp)
local ct2=og:FilterCount(Card.IsControler,nil,1-tp)
if ct1>0 then
if ct1>1 then
Duel.SortDecktop(tp,tp,ct1)
end
for i=1,ct1 do
local tc=Duel.GetDecktopGroup(tp,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
if ct2>0 then
if ct2>1 then
Duel.SortDecktop(tp,1-tp,ct2)
end
for i=1,ct2 do
local tc=Duel.GetDecktopGroup(1-tp,1):GetFirst()
Duel.MoveSequence(tc,SEQ_DECKBOTTOM)
end
end
else
local tc=g:Select(1-tp,1,1,nil):GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESETS_STANDARD_PHASE_END,Duel.GetNextPhaseCount(nil,tp))
tc:RegisterEffect(e1)
end
end
\ No newline at end of file
--[[
【背景音台】晦空士景 ~三时三十三分~
Sepialife in 3:33
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
Duel.LoadScript("glitchylib_soundstage.lua")
function s.initial_effect(c)
--When this card is activated from your hand: It becomes the End Phase.
local e0=c:Activation(nil,nil,nil,nil,s.epop)
aux.AddSoundStageProc(c,e0,id,3,0)
--[[During the End Phase: Apply the following effects in sequence.
● If the turn player has not Normal Summoned this turn, that player can draw 1 card, and if they do, they discard 1 card.
● If the turn player has not Special Summoned this turn, that player can draw 1 card, and if they do, they send the top card of their Deck to the GY.
● If the turn player has not declared an attack this turn, that player can Special Summon 1 monster from their hand or GY.
● If the turn player has not activated other card effects this turn, all damage they would take until the start of their next turn becomes 0.]]
local e1=Effect.CreateEffect(c)
e1:Desc(1,id)
e1:SetCategory(CATEGORY_DRAW|CATEGORY_HANDES|CATEGORY_DECKDES|CATEGORY_SPECIAL_SUMMON|CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE|PHASE_END)
e1:SetRange(LOCATION_FZONE)
e1:OPT()
e1:SetFunctions(nil,nil,s.target,s.operation)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.counterfilter(c))
end
function s.counterfilter(c)
return function(e,p,cid)
return e:GetHandler():GetOriginalCode()==id
end
end
--E0
function s.epop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_ACT_FROM_HAND) then
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local p=Duel.GetTurnPlayer()
Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,p,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_HANDES,nil,0,p,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_DECKDES,nil,0,p,1)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,p,LOCATION_HAND|LOCATION_GRAVE)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetTurnPlayer()
local brk=false
if Duel.GetActivityCount(p,ACTIVITY_SUMMON)==0 and Duel.IsPlayerCanDraw(p,1) and Duel.SelectYesNo(p,aux.Stringid(id,2)) then
if Duel.Draw(p,1,REASON_EFFECT)>0 then
brk=true
Duel.ShuffleHand(p)
Duel.DiscardHand(p,aux.TRUE,1,1,REASON_EFFECT|REASON_DISCARD)
end
end
if Duel.GetActivityCount(p,ACTIVITY_SPSUMMON)==0 and Duel.IsPlayerCanDraw(p,1) and Duel.IsPlayerCanDiscardDeck(p,1) and Duel.GetDeckCount(p)>=2 and Duel.SelectYesNo(p,aux.Stringid(id,3)) then
if brk then
Duel.BreakEffect()
brk=false
end
if Duel.Draw(p,1,REASON_EFFECT)>0 then
brk=true
Duel.DiscardDeck(p,1,REASON_EFFECT)
end
end
if Duel.GetActivityCount(p,ACTIVITY_ATTACK)==0 and Duel.GetMZoneCount(p,nil,p)>0
and Duel.IsExists(false,aux.Necro(Card.IsCanBeSpecialSummoned),p,LOCATION_HAND|LOCATION_GRAVE,0,1,nil,e,0,p,false,false) and Duel.SelectYesNo(p,aux.Stringid(id,4)) then
if brk then
Duel.BreakEffect()
brk=false
end
local tc=Duel.Select(HINTMSG_SPSUMMON,false,p,aux.Necro(Card.IsCanBeSpecialSummoned),p,LOCATION_HAND|LOCATION_GRAVE,0,1,1,nil,e,0,p,false,false):GetFirst()
if tc and Duel.SpecialSummon(tc,0,p,p,false,false,POS_FACEUP)>0 then
brk=true
end
end
if Duel.GetCustomActivityCount(id,p,ACTIVITY_CHAIN)==0 then
if brk then
Duel.BreakEffect()
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:Desc(5,id)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET|EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(0)
Duel.RegisterEffect(e1,p)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,p)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE_START|PHASE_DRAW)
e3:OPT()
e3:SetLabelObject(e2)
e3:SetCondition(aux.TurnPlayerCond(0))
e3:SetOperation(s.reset)
Duel.RegisterEffect(e3,p)
end
end
function s.reset(e,tp,eg,ep,ev,re,r,rp)
local e2=e:GetLabelObject()
local e1=e2 and e2:GetLabelObject() or nil
if e1 then e1:Reset() end
if e2 then e2:Reset() end
e:Reset()
end
\ No newline at end of file
--[[动物朋友 夏之赤龙
Anifriends Red Dragon of Summer
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
Duel.LoadScript("glitchylib_helper.lua")
Duel.LoadScript("glitchylib_player_counters.lua")
function s.initial_effect(c)
PLAYER_COUNTERS_TABLE[PLAYER_COUNTER_HEAT] = {id,8}
aux.SpawnGlitchyHelper(GLITCHY_HELPER_PLAYER_COUNTER_FLAG)
c:EnableReviveLimit()
--2+ monsters with ATK different from their original ATK
aux.AddFusionProcFunRep2(c,s.ffilter,2,127,true)
--[[If you have less LP than your opponent does, you can Special Summon this card (from your Extra Deck) by returning the above cards you control to your hand. (This is treated as a Fusion Summon).]]
aux.AddContactFusionProcedureGlitchy(c,aux.Stringid(id,0),false,nil,Card.IsAbleToHandAsCost,LOCATION_MZONE,0,{s.cfcon,0},aux.ContactFusionMaterialsToHand)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_MATERIAL_CHECK)
e0:SetLabel(0)
e0:SetValue(s.matcheck)
c:RegisterEffect(e0)
--Gains 200 ATK for each Heat Counter on each player.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.atkval)
c:RegisterEffect(e1)
--[[If this card is Fusion Summoned: Place, on each player, a number of Heat Counters equal to the total difference between the ATK and the original ATK each Fusion Material had on field, divided by 100.]]
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCustomCategory(CATEGORY_PLAYER_COUNTER)
e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetLabelObject(e0)
e2:SetFunctions(
aux.FusionSummonedCond,
nil,
s.cttg,
s.ctop
)
c:RegisterEffect(e2)
--[[Before damage calculation, if this card attacks: Place, on 1 player, a number of Heat Counters equal to the total number of Heat Counters on each player, instead of doing damage calculation.]]
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCustomCategory(CATEGORY_PLAYER_COUNTER)
e3:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetFunctions(
s.dmcon,
nil,
s.dmtg,
s.dmop
)
c:RegisterEffect(e3)
--The following effects apply to the current Duel once this card enters the field, and even after this card leaves the field (but if another "Anifriends Red Dragon of Summer" enters the field later on during this Duel, these effects will not be applied again).
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetOperation(s.effop)
c:RegisterEffect(e4)
end
function s.ffilter(c,fc)
return c:GetAttack()~=c:GetBaseAttack()
end
function s.cfcon(e,fc,tp,mg)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
--E0
function s.matcheck(e,c)
local val=0
local g=c:GetMaterial()
for tc in aux.Next(g) do
val=val+math.floor(math.abs(tc:GetAttack()-tc:GetBaseAttack())/100)
end
e:SetLabel(val)
end
--E1
function s.atkval(e,c)
return (Duel.GetPlayerCounterCount(0,PLAYER_COUNTER_HEAT) + Duel.GetPlayerCounterCount(1,PLAYER_COUNTER_HEAT)) * 200
end
--E2
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local val=e:GetLabelObject():GetLabel()
Duel.SetTargetParam(val)
Duel.SetCustomOperationInfo(0,CATEGORY_PLAYER_COUNTER,nil,val,PLAYER_ALL,PLAYER_COUNTER_HEAT)
end
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local val=Duel.GetTargetParam()
for p in aux.TurnPlayers() do
Duel.AddPlayerCounter(p,PLAYER_COUNTER_HEAT,val,e,tp,REASON_EFFECT)
end
end
--E3
function s.dmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler()
end
function s.dmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local val=Duel.GetPlayerCounterCount(0,PLAYER_COUNTER_HEAT)+Duel.GetPlayerCounterCount(1,PLAYER_COUNTER_HEAT)
Duel.SetCustomOperationInfo(0,CATEGORY_PLAYER_COUNTER,nil,val,PLAYER_NONE,PLAYER_COUNTER_HEAT)
end
function s.dmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToBattle() and not c:IsStatus(STATUS_ATTACK_CANCELED) then
c:SetStatus(STATUS_ATTACK_CANCELED,true)
local val=Duel.GetPlayerCounterCount(0,PLAYER_COUNTER_HEAT)+Duel.GetPlayerCounterCount(1,PLAYER_COUNTER_HEAT)
local b1=Duel.IsCanAddPlayerCounter(tp,PLAYER_COUNTER_HEAT,val,e,tp,REASON_EFFECT)
local b2=Duel.IsCanAddPlayerCounter(1-tp,PLAYER_COUNTER_HEAT,val,e,tp,REASON_EFFECT)
if not b1 and not b2 then return end
local opt=aux.Option(tp,id,3,b1,b2)
local p = opt==0 and tp or 1-tp
Duel.AddPlayerCounter(p,PLAYER_COUNTER_HEAT,val,e,tp,REASON_EFFECT)
end
end
--E4
function s.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.PlayerHasFlagEffect(tp,id) then
Duel.RegisterFlagEffect(tp,id,0,0,1)
--Other monsters you control gain 100 ATK for each Heat Counter on yourself, also monsters your opponent controls lose 100 ATK for each Heat Counter on them.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(function(_e,_c) return not _c:IsOriginalCodeRule(id) end)
e1:SetValue(s.atkval2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetValue(s.atkval3)
Duel.RegisterEffect(e2,tp)
--During your opponent's Standby Phase: They can take damage in multiples of 100, and if they do, they can remove 1 Heat Counter from a player (of their choice) for each 100 damage they took this way.
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,5))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:OPT()
e3:SetFunctions(
s.rmcon,
nil,
s.rmtg,
s.rmop
)
Duel.RegisterEffect(e3,1-tp)
end
end
function s.atkval2(e,c)
return Duel.GetPlayerCounterCount(e:GetOwnerPlayer(),PLAYER_COUNTER_HEAT)*100
end
function s.atkval3(e,c)
return Duel.GetPlayerCounterCount(1-e:GetOwnerPlayer(),PLAYER_COUNTER_HEAT)*-100
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,100)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.AnnounceNumberMinMax(tp,100,math.ceil(Duel.GetLP(tp)/100)*100,nil,100)
local dam=math.floor(Duel.Damage(tp,n,REASON_EFFECT)/100)
if dam>0 then
for p=tp,1-tp,1-2*tp do
if dam>0 and Duel.IsCanRemovePlayerCounter(tp,PLAYER_COUNTER_HEAT,1,e,tp,REASON_EFFECT) and Duel.SelectYesNo(tp,aux.Stringid(id,p==tp and 6 or 7)) then
local rct=Duel.AnnounceNumberMinMax(tp,1,math.min(dam,Duel.GetPlayerCounterCount(p,PLAYER_COUNTER_HEAT)))
dam=dam-rct
Duel.RemovePlayerCounter(p,PLAYER_COUNTER_HEAT,rct,e,tp,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--[[
花花变身·动物朋友 赤龙
H-Anifriends Red Dragon
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
c:EnableReviveLimit()
--2+ monsters with different names
aux.AddLinkProcedure(c,nil,2,nil,s.lcheck)
--Can only be Special Summoned while your LP is 2000+ lower than your opponent.
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_COST)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e0:SetCost(s.spcost)
c:RegisterEffect(e0)
--This card's name becomes "Anifriends Red Dragon of Summer" while on the field or in the GY.
aux.EnableChangeCode(c,id-1,LOCATION_MZONE|LOCATION_GRAVE)
--This card's ATK becomes equal to the difference between the players' LP.
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.adval)
c:RegisterEffect(e1)
--If a card(s) you control would be destroyed, you can make your LP become equal to your opponent's LP, instead. (This effect cannot be used if both players have the same LP).
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(s.destg)
e2:SetValue(s.repval)
c:RegisterEffect(e2)
end
function s.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkCode)==g:GetCount()
end
--E0
function s.spcost(e,c,tp,st)
return Duel.GetLP(1-tp)-Duel.GetLP(tp)>=2000
end
--E1
function s.adval(e,c)
return math.abs(Duel.GetLP(0)-Duel.GetLP(1))
end
--E2
function s.desfilter(c,tp)
return c:IsOnField() and c:IsControler(tp) and not c:IsReason(REASON_REPLACE)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.desfilter,1,nil,tp) and Duel.GetLP(0)-Duel.GetLP(1)~=0 end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_CARD,tp,id)
Duel.SetLP(tp,Duel.GetLP(1-tp))
return true
else return false end
end
function s.repval(e,c)
return s.desfilter(c,e:GetHandlerPlayer())
end
\ No newline at end of file
--[[
动物朋友 白龙马
Anifriends Gyokuryu
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddCodeList(c,CARD_RESURGENCE_OF_THE_SANDSTAR)
--3+ monsters with different names
aux.AddXyzProcedureLevelFree(c,s.matfilter,s.xyzcheck,3,99)
--If this card is Special Summoned: Send 1 "Resurgence of the Sandstar" from your hand or Deck to the GY, OR send all cards you control to the GY, then gain 1000 LP for each card sent to the GY this way.
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_TOGRAVE|CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetFunctions(nil,nil,s.tgtg,s.tgop)
c:RegisterEffect(e1)
--(Quick Effect): You can target 1 other monster on the field; attach that target to this card as material.
local e2=Effect.CreateEffect(c)
e2:Desc(3,id)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetRelevantTimings()
e2:SetFunctions(nil,aux.DummyCost,s.target,s.operation)
c:RegisterEffect(e2)
end
function s.mfilter(c,xyzc)
return c:IsXyzType(TYPE_MONSTER)
end
function s.xyzcheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
--E1
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.Group(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,#g*1000)
end
function s.tgfilter(c)
return c:IsCode(CARD_RESURGENCE_OF_THE_SANDSTAR) and c:IsAbleToGrave()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.Group(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,nil)
local b1=Duel.IsExists(false,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil)
local b2=#g>0
if not b1 and not b2 then return end
local opt=aux.Option(tp,id,1,b1,b2)
if opt==0 then
local tg=Duel.Select(HINTMSG_TOGRAVE,false,tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
elseif opt==1 then
if Duel.SendtoGrave(g,REASON_EFFECT)>0 then
local ct=Duel.GetGroupOperatedByThisEffect(e):FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)
if ct>0 then
Duel.BreakEffect()
Duel.Recover(tp,ct*1000,REASON_EFFECT)
end
end
end
end
--E2
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local exc=chk==0 and c or aux.ExceptThis(c,e)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc~=aux.ExceptThis(c,e) and chkc:IsCanBeAttachedTo(c,e) end
local ct=c:GetOverlayCount()
local b1=Duel.IsExists(true,Card.IsCanBeAttachedTo,tp,LOCATION_MZONE,LOCATION_MZONE,1,exc,c,e) and not Duel.PlayerHasFlagEffectLabel(tp,id,0)
local b2=e:IsCostChecked() and c:CheckRemoveOverlayCard(tp,ct,REASON_COST) and c:GetOverlayGroup():IsExists(Card.IsDefenseAbove,1,nil,1) and not Duel.PlayerHasFlagEffectLabel(tp,id,1)
if chk==0 then
return b1 or b2
end
local opt=aux.Option(tp,id,4,b1,b2)
local flag,lab
if opt==0 then
flag,lab=id,0
e:SetCategory(0)
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Select(HINTMSG_TARGET,true,tp,Card.IsCanBeAttachedTo,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,exc,c,e)
elseif opt==1 then
flag,lab=id+100,1
e:SetCategory(CATEGORY_RECOVER)
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
c:RemoveOverlayCard(tp,ct,ct,REASON_COST)
local g=Duel.GetGroupOperatedByThisCost(e):Filter(Card.IsDefenseAbove,nil,1)
local val=g:GetSum(Card.GetDefense)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(val)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,val)
end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE|PHASE_END,0,1,lab)
c:RegisterFlagEffect(flag,RESET_CHAIN,0,1,Duel.GetCurrentChain())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ch=Duel.GetCurrentChain()
if c:HasFlagEffectLabel(id,ch) then
local tc=Duel.GetFirstTarget()
if c:IsRelateToChain() and tc:IsRelateToChain() and tc~=c then
Duel.Attach(tc,c,fale,e,REASON_EFFECT,tp)
end
elseif c:HasFlagEffectLabel(id+100,ch) then
local val=Duel.GetTargetParam()
Duel.Recover(tp,val,REASON_EFFECT)
end
end
\ No newline at end of file
--[[动物朋友 孙薮猫
Anifriends SonServal
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_SELF_TOGRAVE)
c:EnableReviveLimit()
aux.AddCodeList(c,CARD_MEMORIES_OF_THE_SANDSTAR)
--"Anifriends Serval" + 1 monster Special Summoned from the Extra Deck
aux.AddFusionProcCodeFun(c,CARD_ANIFRIENDS_SERVAL,s.mfilter,1,true,true)
--This card's name becomes "Anifriends Serval" while in the GY.
aux.EnableChangeCode(c,CARD_ANIFRIENDS_SERVAL,LOCATION_GRAVE)
--You can send the above cards from either player's field to the GY; Special Summon this card from your Extra Deck.
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_EXTRA)
e1:SetFunctions(nil,s.spcost,s.sptg,s.spop)
c:RegisterEffect(e1)
--If this card is Summoned: Send 1 "Memories of the Sandstar" from your hand or Deck to the GY, OR send this card to the GY.
local e2=Effect.CreateEffect(c)
e2:Desc(1,id)
e2:SetCategory(CATEGORY_TOGRAVE|CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetFunctions(nil,nil,s.tgtg,s.tgop)
c:RegisterEffect(e2)
e2:SpecialSummonEventClone(c)
e2:FlipSummonEventClone(c)
--At the start of the Battle Phase: You can take 1 Spell/Trap from your Deck or GY and Special Summon it as a Normal Monster. That monster always has the same Attribute, Type, Level, ATK and DEF as this card, also shuffle it into the Deck at the end of that Battle Phase.
local e3=Effect.CreateEffect(c)
e3:Desc(2,id)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE|PHASE_BATTLE_START)
e3:SetRange(LOCATION_MZONE)
e3:OPT()
e3:SetFunctions(nil,nil,s.sptg2,s.spop2)
c:RegisterEffect(e3)
end
function s.mfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SPECIAL) and c:IsSummonLocation(LOCATION_EXTRA)
end
--E1
function s.fmatfilter(c,tp)
return (c:IsControler(tp) or c:IsFaceup()) and c:IsAbleToGraveAsCost()
end
function s.spchk(g,tp,fus)
return fus:CheckFusionMaterial(g,nil,tp|0x200,true)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.Group(s.fmatfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tp)
if chk==0 then
return g:CheckSubGroup(s.spchk,2,2,tp,c)
end
local tg=Duel.SelectFusionMaterial(tp,c,g,nil,tp|0x200,true)
if #tg>0 then
Duel.SendtoGrave(tg,REASON_COST)
end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
return e:IsCostChecked() or (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
Duel.SetCardOperationInfo(c,CATEGORY_SPECIAL_SUMMON)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToChain() then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--E2
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND|LOCATION_DECK)
if c:IsRelateToChain() then
Duel.SetPossibleOperationInfo(0,CATEGORY_TOGRAVE,c,1,0,0)
end
end
function s.tgfilter(c)
return c:IsCode(CARD_MEMORIES_OF_THE_SANDSTAR) and c:IsAbleToGrave()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.IsExists(false,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil)
local b2=c:IsRelateToChain() and c:IsAbleToGrave()
if not b1 and not b2 then return end
local opt=aux.Option(tp,id,1,b1,b2)
if opt==0 then
local g=Duel.Select(HINTMSG_TOGRAVE,false,tp,s.tgfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
elseif opt==1 then
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
--E3
function s.spfilter(c,e,tp,atk,def,lv,race,attr)
if not (c:IsType(TYPE_SPELL|TYPE_TRAP) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)) then return false end
local setcode=Duel.ReadCard(c,CARDDATA_SETCODE)
for _,code in ipairs({c:GetCode()}) do
if not Duel.IsPlayerCanSpecialSummonMonster(tp,code,setcode,TYPE_MONSTER|TYPE_NORMAL,atk,def,lv,race,attr) then
return false
end
end
return true
end
function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local atk,def,lv,race,attr=c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()
return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK|LOCATION_GRAVE,0,1,nil,e,tp,atk,def,lv,race,attr)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0)
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
local c=e:GetHandler()
if not c:IsRelateToChain() or not c:IsFaceup() then return end
local fid=c:GetFieldID()
c:RegisterFlagEffect(id+100,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_BATTLE,0,1,fid)
local atk,def,lv,race,attr=c:GetAttack(),c:GetDefense(),c:GetLevel(),c:GetRace(),c:GetAttribute()
local tc=Duel.Select(HINTMSG_SPSUMMON,false,tp,aux.Necro(s.spfilter),tp,LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil,e,tp,atk,def,lv,race,attr):GetFirst()
if tc then
local resets=RESET_TOGRAVE|RESET_REMOVE|RESET_TEMP_REMOVE|RESET_TOHAND|RESET_TODECK|RESET_OVERLAY
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(TYPE_NORMAL|TYPE_MONSTER)
e1:SetReset(RESET_EVENT|resets)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetCondition(s.adcon)
e2:SetLabel(fid)
e2:SetValue(s.raceval)
tc:RegisterEffect(e2,true)
local e3=e2:Clone()
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetLabelObject(e2)
e3:SetValue(s.attrval)
tc:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EFFECT_CHANGE_LEVEL)
e4:SetLabelObject(e3)
e4:SetValue(s.lvval)
tc:RegisterEffect(e4,true)
local e5=e2:Clone()
e5:SetCode(EFFECT_SET_ATTACK_FINAL)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE|EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE,EFFECT_FLAG2_OPTION)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(s.atkval)
tc:RegisterEffect(e5,true)
local e6=e5:Clone()
e6:SetCode(EFFECT_SET_DEFENSE_FINAL)
e6:SetValue(s.defval)
tc:RegisterEffect(e6,true)
local e7=Effect.CreateEffect(tc)
e7:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_ADJUST)
e7:SetProperty(EFFECT_FLAG_CANNOT_DISABLE|EFFECT_FLAG_UNCOPYABLE)
e7:SetRange(LOCATION_MZONE)
e7:SetLabel(fid)
e7:SetLabelObject(e4)
e7:SetOperation(s.efilter)
e7:SetReset(RESET_EVENT|resets)
tc:RegisterEffect(e7,true)
local e8=Effect.CreateEffect(tc)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetCode(EFFECT_SELF_TOGRAVE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(s.sdcon)
e8:SetReset(RESET_EVENT|resets)
tc:RegisterEffect(e8,true)
tc:RegisterFlagEffect(id,RESET_EVENT|resets|RESET_PHASE|PHASE_BATTLE,0,1,fid)
end
if Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
tc:SetCardTarget(c)
local de=Effect.CreateEffect(c)
de:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
de:SetCode(EVENT_PHASE|PHASE_BATTLE)
de:SetReset(RESET_PHASE|PHASE_BATTLE)
de:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
de:SetCountLimit(1)
de:SetLabel(fid)
de:SetLabelObject(tc)
de:SetCondition(s.tdcon)
de:SetOperation(s.tdop)
Duel.RegisterEffect(de,tp)
end
Duel.SpecialSummonComplete()
end
function s.adcon(e)
local c=e:GetHandler():GetFirstCardTarget()
return c~=nil and c:HasFlagEffectLabel(id+100,e:GetLabel())
end
function s.attrval(e,c)
return e:GetHandler():GetFirstCardTarget():GetAttribute()
end
function s.raceval(e,c)
return e:GetHandler():GetFirstCardTarget():GetRace()
end
function s.lvval(e,c)
return e:GetHandler():GetFirstCardTarget():GetLevel()
end
function s.atkval(e,c)
return e:GetHandler():GetFirstCardTarget():GetAttack()
end
function s.defval(e,c)
return e:GetHandler():GetFirstCardTarget():GetDefense()
end
function s.efilter(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler()
local c=tc:GetFirstCardTarget()
if c and c:HasFlagEffectLabel(id+100,e:GetLabel()) then
local le=e:GetLabelObject()
local ae=le:GetLabelObject()
local re=ae:GetLabelObject()
local le_new,ae_new,re_new
if tc:GetRace()~=c:GetRace() then
re_new=re:Clone()
tc:RegisterEffect(re_new,true)
re:Reset()
end
if tc:GetAttribute()~=c:GetAttribute() then
ae_new=ae:Clone()
tc:RegisterEffect(ae_new,true)
ae:Reset()
end
if tc:GetLevel()~=c:GetLevel() then
le_new=le:Clone()
tc:RegisterEffect(le_new,true)
le:Reset()
end
if le_new then e:SetLabelObject(le_new) end
if ae_new then
if le_new then
le_new:SetLabelObject(ae_new)
else
le:SetLabelObject(ae_new)
end
end
if re_new then
if ae_new then
ae_new:SetLabelObject(re_new)
else
ae:SetLabelObject(re_new)
end
end
else
tc:SetStatus(STATUS_NO_LEVEL,true)
e:Reset()
end
end
function s.sdcon(e)
local tc=e:GetHandler()
if not tc:HasFlagEffectLabel(id) then return false end
local c=tc:GetFirstCardTarget()
return not c or not c:IsLocation(LOCATION_MZONE) or not c:IsFaceup()
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local fid=e:GetLabel()
if not tc or not tc:HasFlagEffectLabel(id,fid) then
e:Reset()
return false
end
return true
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.ShuffleIntoDeck(tc)
end
\ No newline at end of file
--[[
脆弱的坚强
Resilient Fragility
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
c:Activation()
--[[If this card is sent from the field to the GY: Send all monsters you control to the GY.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetFunctions(s.tgcon,nil,s.tgtg,s.tgop)
c:RegisterEffect(e1)
--[[During your opponent's turn, if a monster(s) you control would be destroyed, you can apply 1 of the following effects for each, instead.
● Take damage equal to its ATK.
● Shuffle it into your Deck.]]
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_SZONE)
e2:SetTarget(s.destg)
e2:SetValue(s.repval)
c:RegisterEffect(e2)
--During your Standby Phase, if a monster(s) was shuffled into your Deck by this card's effect during the previous turn: You can gain LP equal to the total DEF those shuffled monsters had on field, and if you do, Special Summon those monsters (or monsters with the same name) from your Deck, then it becomes the End Phase of this turn.
local e3=Effect.CreateEffect(c)
e3:Desc(3,id)
e3:SetCategory(CATEGORY_RECOVER|CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE|PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:OPT()
e3:SetFunctions(
aux.TurnPlayerCond(0),
nil,
s.sptg,
s.spop
)
c:RegisterEffect(e3)
end
local FLAG_STILL_IN_DECK = id
local FLAG_WAS_SHUFFLED = id+100
--E1
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.Group(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,tp,LOCATION_MZONE)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.Group(Card.IsAbleToGrave,tp,LOCATION_MZONE,0,nil)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--E2
function s.desfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and not c:IsReason(REASON_REPLACE)
end
function s.repfilter(c,nodam)
return (nodam or not c:IsAttackAbove(1)) and not c:IsAbleToDeck()
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsTurnPlayer(1-tp) and eg:IsExists(s.desfilter,1,nil,tp) and not eg:IsExists(s.repfilter,1,nil,Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE)) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.Hint(HINT_CARD,tp,id)
local ct=0
local damchk=true
local tg=Group.CreateGroup()
local g=eg:Filter(s.desfilter,nil,tp)
local ctmax=#g
while ct<ctmax do
ct=ct+1
Duel.HintMessage(tp,HINTMSG_OPERATECARD)
local tc=g:Select(tp,1,1,nil):GetFirst()
local b1=tc:IsAttackAbove(1)
local b2=tc:IsAbleToDeck()
local opt=aux.Option(tp,id,1,b1,b2)
if opt==0 then
if not damchk then damchk=true end
Duel.Damage(tp,tc:GetAttack(),REASON_EFFECT,true)
elseif opt==1 then
tg:AddCard(tc)
end
g:RemoveCard(tc)
end
if damchk then Duel.RDComplete() end
if #tg>0 then
if Duel.SendtoDeck(tg,tp,SEQ_DECKSHUFFLE,REASON_EFFECT|REASON_REPLACE)>0 then
local og=Duel.GetGroupOperatedByThisEffect(e):Filter(aux.PLChk,nil,tp,LOCATION_DECK)
if #og>0 then
local fid=e:GetHandler():GetFieldID()
for oc in aux.Next(og) do
oc:RegisterFlagEffect(FLAG_STILL_IN_DECK,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,0,2,fid)
oc:RegisterFlagEffect(FLAG_WAS_SHUFFLED,RESET_PHASE|PHASE_END,0,2,fid)
end
end
end
end
return true
else return false end
end
function s.repval(e,c)
return s.desfilter(c,e:GetHandlerPlayer())
end
--E3
function s.spfilter(c,e,tp,og)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and og:IsExists(Card.IsOriginalCode,1,nil,c:GetOriginalCode())
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local fid=e:GetHandler():GetFieldID()
local og=Duel.Group(Card.HasFlagEffectLabel,tp,LOCATION_DECK,0,nil,FLAG_WAS_SHUFFLED,fid)
local val=og:GetSum(Card.GetPreviousDefenseOnField)
local codes={}
for oc in aux.Next(og) do
table.insert(codes,oc:GetOriginalCode())
end
local check=aux.CreateChecks(Card.IsOriginalCode,codes)
local sg=Duel.Group(Card.HasFlagEffectLabel,tp,LOCATION_DECK,0,nil,FLAG_STILL_IN_DECK,fid)
local g=Duel.Group(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp,sg)
if chk==0 then
return val>0 and Duel.GetMZoneCount(tp)>=#og and (#og<2 or not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT))
and g:CheckSubGroupEach(check)
end
e:SetLabel(fid)
Duel.SetTargetParam(val)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,val)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,#og,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local val=Duel.GetTargetParam()
if val>0 and Duel.Recover(tp,val,REASON_EFFECT)>0 then
local fid=e:GetLabel()
local og=Duel.Group(Card.HasFlagEffectLabel,tp,LOCATION_DECK,0,nil,FLAG_WAS_SHUFFLED,fid)
if Duel.GetMZoneCount(tp)>=#og and (#og<2 or not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT)) then
local codes={}
for oc in aux.Next(og) do
table.insert(codes,oc:GetOriginalCode())
end
local check=aux.CreateChecks(Card.IsOriginalCode,codes)
local sg=Duel.Group(Card.HasFlagEffectLabel,tp,LOCATION_DECK,0,nil,FLAG_STILL_IN_DECK,fid)
local g=Duel.Group(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp,sg)
if g:CheckSubGroupEach(check) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spg=g:SelectSubGroupEach(tp,check)
if Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,1)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,1,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,p)
end
end
end
end
end
\ No newline at end of file
--[[
临终幻象 -暴雪冬风-
Healing Vision - Blizzard -
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--If you control no cards, you can activate this card from your hand.
c:TrapCanBeActivatedFromHand(s.handactcon,aux.Stringid(id,0))
--At the start of your opponent's Battle Phase, if the total ATK of all face-up monsters they control is higher than your LP: Excavate cards from the top of your Deck until you excavate a number of monsters whose total ATK is higher than the difference between the players' LP, then, if the number of monsters excaveted this way is higher than the number of cards your opponent controls, you can Special Summon any number of them, and banish the remaining monsters, and if you do, you gain LP equal of the total ATK of those banished monsters. Also, banish all other excavated cards, face-down.
local e1=Effect.CreateEffect(c)
e1:Desc(1,id)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON|CATEGORY_REMOVE|CATEGORY_RECOVER|CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_BATTLE_START)
e1:SetFunctions(
s.condition,
nil,
s.target,
s.operation
)
c:RegisterEffect(e1)
end
function s.handactcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
--E1
function s.condition(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetCurrentPhase()==PHASE_BATTLE_START and Duel.IsTurnPlayer(1-tp)) then return false end
local g=Duel.Group(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if #g==0 then return false end
return g:GetSum(Card.GetAttack)>Duel.GetLP(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if not (Duel.IsPlayerCanRemove(tp) and Duel.IsPlayerCanDiscardDeck(tp,1)) then return false end
local g=Duel.Group(Card.IsMonster,tp,LOCATION_DECK,0,nil)
return g:GetSum(Card.GetAttack)>math.abs(Duel.GetLP(0)-Duel.GetLP(1))
end
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local g=Duel.GetMatchingGroup(Card.IsMonster,tp,LOCATION_DECK,0,nil)
local dcount=Duel.GetDeckCount(tp)
local seq=-1
local tc=g:GetFirst()
local spcard=nil
local seqs={}
for tc in aux.Next(g) do
table.insert(seqs,tc:GetSequence())
end
table.sort(seqs, function(a,b) return a > b end)
local atk,lpdiff=0,math.abs(Duel.GetLP(0)-Duel.GetLP(1))
for _,tempseq in ipairs(seqs) do
local sc=g:Filter(Card.IsSequence,nil,tempseq):GetFirst()
atk=atk+sc:GetAttack()
if atk>lpdiff then
seq=tempseq
break
end
end
if seq==-1 then
Duel.ConfirmDecktop(tp,dcount)
Duel.ShuffleDeck(tp)
return
end
Duel.ConfirmDecktop(tp,dcount-seq)
local mg=g:Filter(Card.IsSequenceAbove,nil,seq)
local sg=mg:Filter(Card.IsCanBeSpecialSummoned,nil,e,0,tp,false,false)
local ft=Duel.GetMZoneCountForMultipleSpSummon(tp)
local max=math.min(#sg,ft)
Duel.DisableShuffleCheck()
if #mg>Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD) and ft>0 and xgl.SelectUnselectGroup(sg,e,tp,1,max,s.rescon(mg),0)
and Duel.SelectYesNo(tp,STRING_ASK_SPSUMMON) then
local spg=sg:GetFirst()
if #sg>1 then
spg=xgl.SelectUnselectGroup(sg,e,tp,1,max,s.rescon(mg),1,tp,HINTMSG_SPSUMMON,s.rescon(mg))
end
Duel.BreakEffect()
if Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP)>0 then
mg:Sub(spg)
local rg=mg:Filter(Card.IsAbleToRemove,nil)
if #rg>0 and Duel.Remove(rg,POS_FACEUP,REASON_EFFECT|REASON_REVEAL)>0 then
local rg1=rg:Filter(s.rmfilter,nil)
if #rg1>0 then
local lp=rg1:GetSum(Card.GetAttack)
Duel.Recover(tp,math.max(atk,0),REASON_EFFECT)
end
end
end
end
local fg=Duel.GetDeck(tp):Filter(Card.IsSequenceAbove,nil,seq):Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
if #fg>0 then
Duel.Remove(fg,POS_FACEDOWN,REASON_EFFECT|REASON_REVEAL)
end
end
function s.spfilter(c,e,tp,seq)
return c:IsSequenceAbove(seq) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.rescon(mg)
return function(g,e,tp,_,c)
local valid = #mg==#g or mg:IsExists(Card.IsAbleToRemove,1,g)
local razor = #mg>#g and {s.razorfilter,tp,mg,g} or nil
return valid,false,razor
end
end
function s.razorfilter(c,tp,mg,g)
return mg:IsExists(Card.IsAbleToRemove,1,g:Clone()+c)
end
function s.rmfilter(c)
return c:IsMonster() and c:IsLocation(LOCATION_REMOVED)
end
\ No newline at end of file
--[[
炼魔改
Fegefeuer-Alter
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
c:Activation()
--[[At the start of the Battle Phase: You can target 1 Fusion, Synchro, Xyz or Link Monster you control; at the end of that Battle Phase, take damage equal to that target's original ATK, also apply 1 of the following effects.
● Banish 1 monster with the same Type and Attribute as that target from your Extra Deck, face-down, and if you do, that target gains ATK/DEF equal to the ATK/DEF of the banished monster until the end of the turn.
● Banish that target face-down, then Special Summon, from your Extra Deck, a monster with the same card type and Level/Rank/Link Rating as that target. Its effects cannot be activated this turn, also its original ATK/DEF become equal to the banished monster's original ATK/DEF.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_DAMAGE|CATEGORY_REMOVE|CATEGORIES_ATKDEF|CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:OPT()
e1:SetHintTiming(TIMING_BATTLE_START)
e1:SetFunctions(s.condition,nil,s.target,s.operation)
c:RegisterEffect(e1)
end
--E1
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE_START
end
function s.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and s.filter(chkc) end
if chk==0 then return Duel.IsExists(true,s.filter,tp,LOCATION_MZONE,0,1,nil) end
local tc=Duel.Select(HINTMSG_TARGET,true,tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,tc:GetBaseAttack())
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetPossibleOperationInfo(0,CATEGORIES_ATKDEF,tc,1,0,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() then
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD_FACEDOWN|RESET_PHASE|PHASE_BATTLE,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
local e1=Effect.CreateEffect(e:GetHandler())
e1:Desc(2,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_BATTLE)
e1:OPT()
e1:SetFunctions(s.damcon,nil,nil,s.damop)
e1:SetReset(RESET_PHASE|PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
end
function s.damfilter(c)
return s.filter(c) and c:HasFlagEffect(id)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExists(false,s.damfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.Group(s.damfilter,tp,LOCATION_MZONE,0,nil)
local tc
if #g>1 then
Duel.HintMessage(tp,HINTMSG_OPERATECARD)
tc=g:Select(tp,1,1,nil)
else
tc=g:GetFirst()
end
local typ=tc:GetType()&(TYPE_FUSION|TYPE_SYNCHRO|TYPE_XYZ|TYPE_LINK)
local rating,race,attr,atk=tc:GetRatingAuto(),tc:GetRace(),tc:GetAttribute(),math.max(0,tc:GetBaseAttack())
Duel.Damage(tp,atk,REASON_EFFECT)
local c=e:GetHandler()
local b1=Duel.IsExists(false,s.rmedfilter,tp,LOCATION_EXTRA,0,1,nil,tp,race,attr)
local b2=tc:IsAbleToRemove(tp,POS_FACEDOWN) and Duel.IsExists(false,s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,typ,rating,tc)
local opt=aux.Option(tp,id,3,b1,b2)
if opt==0 then
local rc=Duel.Select(HINTMSG_REMOVE,false,tp,s.rmedfilter,tp,LOCATION_EXTRA,0,1,1,nil,tp,race,attr):GetFirst()
if Duel.Remove(rc,POS_FACEDOWN,REASON_EFFECT)>0 and rc:IsLocation(LOCATION_REMOVED) and tc:HasFlagEffect(id) and tc:IsFaceup() then
local ratk,rdef=rc:GetStats()
tc:UpdateATKDEF(ratk,rdef,RESET_PHASE|PHASE_END,{c,true})
end
elseif opt==1 then
if Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)>0 then
local sc=Duel.Select(HINTMSG_SPSUMMON,false,tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,typ,rating,nil):GetFirst()
if sc and Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetDescription(STRING_CANNOT_TRIGGER)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESETS_STANDARD_PHASE_END)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(tc:GetTextAttack())
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
sc:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_BASE_DEFENSE)
e3:SetValue(tc:GetTextDefense())
sc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
end
local eset={tc:IsHasEffect(EFFECT_FLAG_EFFECT|id)}
if #eset>0 then
local fe=eset[1]
fe:Reset()
end
end
function s.rmedfilter(c,tp,race,attr)
return c:IsAttributeRace(attr,race) and c:IsAbleToRemove(tp,POS_FACEDOWN)
end
function s.spfilter(c,e,tp,typ,rating,rc)
return c:IsType(typ) and c:GetRatingAuto()==rating and Duel.GetLocationCountFromEx(tp,tp,rc,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
\ No newline at end of file
--[[
科技对狠活
TECH Versus POWER
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[When this card is activated: Your opponent chooses either "Tech" or "Power", or both, and this card gains the following effect(s) based on what they chose.
● Tech: Neither player can activate card effects in response to their opponent's card effects during their opponent's turn.
● Power: During the Battle Phase, the turn player's opponent cannot activate card effects.
Also, if your opponent chooses both "Tech" and "Power", both players draw 2 cards.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRelevantTimings()
e1:SetFunctions(nil,nil,s.target,s.operation)
c:RegisterEffect(e1)
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,PLAYER_ALL,2)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b3=Duel.IsPlayerCanDraw(tp,2) and Duel.IsPlayerCanDraw(1-tp,2)
local opt=aux.Option(1-tp,id,1,true,true,b3)+1
if opt&1==1 then
c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetOperation(s.chainop)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e1)
end
if opt&2==2 then
c:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(s.limcon0)
e2:SetValue(1)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetTargetRange(0,1)
e3:SetCondition(s.limcon1)
c:RegisterEffect(e3)
end
if opt==3 then
for p in aux.TurnPlayers() do
Duel.Draw(p,2,REASON_EFFECT)
end
end
end
function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsTurnPlayer(ep) then
Duel.SetChainLimit(s.chainlm)
end
end
function s.chainlm(e,rp,tp)
return tp==Duel.GetTurnPlayer()
end
function s.limcon0(e)
return Duel.IsBattlePhase(1-e:GetHandlerPlayer())
end
function s.limcon1(e)
return Duel.IsBattlePhase(e:GetHandlerPlayer())
end
\ No newline at end of file
--[[
汽水,毛豆与刨冰
By Ramune, Zunda & Shaved Ice
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[If all monsters you control are either 3 monsters with same Attribute but different Types, OR 3 monsters with same Type but different Attributes: Return all monsters you control to the hand, and if you returned at least 2, apply 1 of these effects, based on the Attribute/Type those monsters had on field.
● Same Attribute but different Types: You gain 18000 LP.
● Same Type but different Attributes: Draw 3 cards.
Also, after that, unless this card was activated while Set on the field and was not Set this turn, skip to your opponent's next Draw Phase.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_RECOVER|CATEGORY_DRAW|CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetFunctions(
s.condition,
nil,
s.target,
s.activate
)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SSET)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
end
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END,0,1)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMonsters(tp)
if not (#g==3 and not g:IsExists(Card.IsFacedown,1,nil)) then return false end
local atct,rcct=g:GetClassCount(Card.GetAttribute),g:GetClassCount(Card.GetRace)
return (atct==1 and rcct==3) or (atct==3 and rcct==1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMonsters(tp)
local tg=g:Filter(Card.IsAbleToHand,nil)
local atct,rcct=g:GetClassCount(Card.GetAttribute),g:GetClassCount(Card.GetRace)
if chk==0 then
return #tg>0 and ((atct==1 and rcct==#g) or Duel.IsPlayerCanDraw(tp,3))
end
local c=e:GetHandler()
local param=(e:IsHasType(EFFECT_TYPE_ACTIVATE) and not c:IsStatus(STATUS_ACT_FROM_HAND) and c:IsPreviousPosition(POS_FACEDOWN) and not c:HasFlagEffect(id)) and 1 or 0
Duel.SetTargetParam(param)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,tg,#tg,0,0)
Duel.SetConditionalOperationInfo(atct==1 and rcct==#g,0,CATEGORY_RECOVER,nil,0,tp,18000)
Duel.SetConditionalOperationInfo(atct==#g and rcct==1,0,CATEGORY_DRAW,nil,0,tp,3)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMonsters(tp)
local tg=g:Filter(Card.IsAbleToHand,nil)
if #tg>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)>1 then
local og=Duel.GetOperatedGroup():Filter(Card.IsLocation,nil,LOCATION_HAND)
if #og>1 then
local atct,rcct=og:GetClassCount(Card.GetPreviousAttributeOnField),og:GetClassCount(Card.GetPreviousRaceOnField)
if atct==1 and rcct==#og then
Duel.Recover(tp,18000,REASON_EFFECT)
elseif atct==#og and rcct==1 then
Duel.Draw(tp,3,REASON_EFFECT)
end
end
end
if Duel.GetTargetParam()~=1 then
Duel.BreakEffect()
local p=Duel.GetTurnPlayer()
local max=p==1-tp and 2 or 1
for i=1,max do
Duel.SkipPhase(p,PHASE_DRAW,RESET_PHASE|PHASE_END,i)
Duel.SkipPhase(p,PHASE_STANDBY,RESET_PHASE|PHASE_END,i)
Duel.SkipPhase(p,PHASE_MAIN1,RESET_PHASE|PHASE_END,i)
Duel.SkipPhase(p,PHASE_BATTLE,RESET_PHASE|PHASE_END,i,1)
Duel.SkipPhase(p,PHASE_MAIN2,RESET_PHASE|PHASE_END,i)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END,i)
Duel.RegisterEffect(e1,p)
p=1-p
end
end
end
\ No newline at end of file
--[[
为幸福而战
Fighting for Happiness
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id,o=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
aux.AddEquipSpellEffect(c,true,true,Card.IsFaceup,nil)
--[[Destroy this card if you have more LP than your opponent does.]]
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(s.sdcon)
c:RegisterEffect(e1)
--[[If the equipped monster inflicts battle damage to your opponent: At the end of this Battle Phase, draw 1 card for every 800 points of difference between your LP and your opponent's.]]
local e2=Effect.CreateEffect(c)
e2:Desc(0,id)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetFunctions(s.regcon,nil,s.regtg,s.regop)
c:RegisterEffect(e2)
end
--E1
function s.sdcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetLP(tp)>Duel.GetLP(1-tp)
end
--E2
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
local cet=e:GetHandler():GetEquipTarget()
return cet and ep==1-tp and eg:GetFirst()==cet
end
function s.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:Desc(1,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_BATTLE)
e1:OPT()
e1:SetOperation(s.drawop)
e1:SetReset(RESET_PHASE|PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
function s.drawop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
local val=math.floor(math.abs(Duel.GetLP(0)-Duel.GetLP(1))/800)
if val>0 then
Duel.Draw(tp,val,REASON_EFFECT)
end
end
\ No newline at end of file
--[[
已为幸福战
Fought For Happiness
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[At the start of your next Battle Phase after this card was activated, or after this Set card was destroyed by your opponent: Your opponent gains LP equal to your current LP, and if they do, at the end of that Battle Phase, they must choose 1 of the following effects for you to apply.
● They take damage equal to the LP gained this way.
● You draw 1 card for each 1000 LP they gained this way.
If this effect was activated because this Set card was destroyed by your opponent, you choose which effect to apply instead.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORY_RECOVER|CATEGORY_DAMAGE|CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetFunctions(
nil,
nil,
s.target,
s.operation
)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:Desc(0,id)
e2:SetCategory(CATEGORY_RECOVER|CATEGORY_DAMAGE|CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE|EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DESTROYED)
e2:SetFunctions(
s.condition,
nil,
s.target,
s.operation
)
c:RegisterEffect(e2)
end
--E1
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsLocation(LOCATION_DECK) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) and rp==1-tp
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return true
end
Duel.SetPossibleOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
Duel.SetPossibleOperationInfo(0,CATEGORY_DRAW,nil,0,tp,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:Desc(1,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_BATTLE_START)
e1:OPT()
e1:SetLabel(e:GetCode()==EVENT_DESTROYED and 1 or 0)
e1:SetCondition(aux.TurnPlayerCond(0))
e1:SetOperation(s.applyop)
e1:SetReset(RESET_PHASE|PHASE_BATTLE_START,Duel.GetNextBattlePhaseCount(tp))
Duel.RegisterEffect(e1,tp)
end
function s.applyop(e,tp,eg,ep,ev,re,r,rp)
local lp=Duel.Recover(1-tp,math.max(Duel.GetLP(tp),0),REASON_EFFECT)
if lp>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:Desc(2,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_BATTLE)
e1:OPT()
e1:SetLabel(lp,e:GetLabel())
e1:SetOperation(s.applyop2)
e1:SetReset(RESET_PHASE|PHASE_BATTLE)
Duel.RegisterEffect(e1,tp)
end
end
function s.applyop2(e,tp,eg,ep,ev,re,r,rp)
local lp,chk=e:GetLabel()
local op=chk and tp or 1-tp
local desc=chk and 5 or 3
local b2=lp>=1000 and Duel.IsPlayerCanDraw(tp,math.floor(lp/1000))
local opt=aux.Option(op,id,desc,true,b2)
if opt==0 then
Duel.Damage(1-tp,lp,REASON_EFFECT)
elseif opt==1 then
Duel.Draw(tp,math.floor(lp/1000),REASON_EFFECT)
end
end
\ No newline at end of file
--[[
化心为甲
Heart As Armor
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[At the start of the Battle Phase: You can send this card from your hand to the GY, then target up to 5 face-up cards equipped to 1 monster you control; for each of those cards, replace its effects with 1 of the following, until the end of your next turn (for this effect's resolution, you can only choose each of the following effects once).]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PHASE|PHASE_BATTLE_START)
e1:SetRange(LOCATION_HAND)
e1:OPT()
e1:SetFunctions(nil,aux.ToGraveSelfCost,s.target,s.activate)
c:RegisterEffect(e1)
--If the equipped monster attacks, your opponent cannot activate cards or effects until the end of the Damage Step.
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(aux.AND(s.condition(1),aux.IsEquippedCond))
e2:SetOperation(s.lmop)
c:RegisterEffect(e2)
--If the equipped monster destroys a monster by battle, inflict damage to your opponent equal to the ATK the destroyed monster had on field
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(aux.AND(s.condition(2),aux.IsEquippedCond,s.bdcon))
e3:SetOperation(s.bdop)
c:RegisterEffect(e3)
--The equipped monster gains 500 ATK/DEF for each Spell/Trap you control.
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetCondition(s.condition(3))
e4:SetValue(s.value)
c:RegisterEffect(e4)
e4:UpdateDefenseClone(c)
--The equipped monster gains ATK equal to the difference between the players' LP.
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetCondition(s.condition(4))
e5:SetValue(s.lpval)
c:RegisterEffect(e5)
--If the equipped monster battles your opponent's monster, during damage calculation: The equipped monster's original ATK/DEF become equal to the ATK or DEF (whichever is higher) of the opponent's battling monster +100, during damage calculation only
local e6=Effect.CreateEffect(c)
e6:Desc(5,id)
e6:SetCategory(CATEGORY_ATKCHANGE|CATEGORY_DEFCHANGE)
e6:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e6:SetRange(LOCATION_SZONE)
e6:SetCondition(aux.AND(s.condition(5),s.atkcon))
e6:SetOperation(s.atkop)
c:RegisterEffect(e6)
end
function s.condition(label)
return function(e)
return e:GetHandler():HasFlagEffectLabel(id,label)
end
end
--E1
function s.filter(c,e,tp)
return c:IsFaceup() and c:GetEquipTarget() and c:GetEquipTarget():IsControler(tp)
end
function s.rescon(g,e,tp,mg,c)
local ec=c:GetEquipTarget()
local razor = {function(_c) return _c:GetEquipTarget()==ec end}
return true,false,razor
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsFaceup() and chkc:GetEquipTarget() and chkc:GetEquipTarget():IsControler(tp) end
if chk==0 then
return Duel.IsExists(true,s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,tp)
end
local g=Duel.Group(s.filter,tp,LOCATION_SZONE,LOCATION_SZONE,nil,tp):Filter(Card.IsCanBeEffectTarget,nil,e)
local tg=xgl.SelectUnselectGroup(0,g,e,tp,1,5,s.rescon,1,tp,HINTMSG_TARGET)
Duel.SetTargetCard(tg)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards()
if #g==0 then return end
local resets=RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_END|RESET_SELF_TURN
local rct=Duel.GetNextPhaseCount(false,tp)
local options={true,true,true,true,true}
while #g>0 do
Duel.HintMessage(tp,aux.Stringid(id,6))
local tg=g:Select(tp,1,1,nil)
Duel.HintSelection(tg)
local tc=tg:GetFirst()
local op=aux.Option(tp,id,1,table.unpack(options))+1
options[op]=false
tc:RegisterFlagEffect(id,resets,EFFECT_FLAG_CLIENT_HINT,rct,op,aux.Stringid(id,op))
local eset={tc:IsHasEffect(EFFECT_EQUIP_LIMIT)}
tc:ReplaceEffect(id,resets,rct)
for _,ce in ipairs(eset) do
if ce:IsHasProperty(EFFECT_FLAG_INITIAL) then
local clone=ce:Clone()
clone:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(clone)
end
end
g:RemoveCard(tc)
end
end
--E2
function s.lmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetAttacker()~=c:GetEquipTarget() then return end
Duel.Hint(HINT_CARD,tp,c:GetOriginalCode())
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(1)
e1:SetReset(RESET_PHASE|PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
--E3
function s.bdcon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst()
return rc:IsRelateToBattle() and rc==e:GetHandler():GetEquipTarget()
end
function s.bdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,e:GetHandler():GetOriginalCode())
Duel.Damage(1-tp,eg:GetFirst():GetBattleTarget():GetPreviousAttackOnField(),REASON_EFFECT)
end
--E4
function s.value(e,c)
return Duel.GetMatchingGroupCount(Card.IsSpellTrapOnField,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)*500
end
--E5
function s.lpval(e,c)
return math.abs(Duel.GetLP(0)-Duel.GetLP(1))
end
--E6
function s.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
return ec and tc and tc:IsFaceup() and tc:IsControler(1-tp)
end
function s.atkop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
if ec and tc and ec:IsFaceup() and tc:IsFaceup() then
local val=math.max(tc:GetAttack(),tc:GetDefense())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e1:SetValue(val+100)
e1:SetReset(RESET_EVENT|RESETS_STANDARD|RESET_PHASE|PHASE_DAMAGE_CAL)
ec:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
ec:RegisterEffect(e2)
end
end
\ No newline at end of file
--[[
快乐空降!
Happily Raided!
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id,o=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
Duel.LoadScript("glitchylib_counters.lua")
function s.initial_effect(c)
aux.AddEquipSpellEffect(c,true,true,Card.IsFaceup,nil)
--[[Each time a monster(s) you control with higher ATK/DEF on the field than its original ATK/DEF is destroyed by your opponent and sent to the GY, note that ATK/DEF difference, and the equipped monster immediately gains ATK/DEF equal to the respective ATK/DEF difference, also if that monster(s) had any counters on it, transfer them onto the equipped monster.]]
aux.RegisterMaxxCEffect(c,id,nil,LOCATION_SZONE,EVENT_TO_GRAVE,s.reccon,s.recopOUT,s.recopIN,s.flaglabel,false,false,nil,aux.AddThisCardInSZoneAlreadyCheck(c))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(s.regcounter)
c:RegisterEffect(e2)
--If the equipped monster would be destroyed by your opponent, destroy this card instead.
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e3:SetValue(s.repfilter)
c:RegisterEffect(e3)
end
--E1
function s.atkval(c)
return c:GetPreviousAttackOnField()-c:GetBaseAttack()
end
function s.defval(c)
return c:GetPreviousDefenseOnField()-c:GetBaseDefense()
end
function s.cfilter(c,p)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousControler(p) and c:IsPreviousPosition(POS_FACEUP) and c:GetReasonPlayer()==1-p and c:IsReason(REASON_DESTROY)
and (c:GetPreviousAttackOnField()>c:GetBaseAttack() or c:GetPreviousDefenseOnField()>c:GetBaseDefense())
end
function s.reccon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not eg:IsContains(c) and c:GetEquipTarget() and eg:IsExists(aux.AlreadyInRangeFilter(e,s.cfilter),1,nil,tp)
end
function s.flaglabel(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(aux.AlreadyInRangeFilter(e,s.cfilter),nil,tp)
local atk,def=g:GetSum(s.atkval),g:GetSum(s.defval)
return atk|(def<<16)
end
function s.recopOUT(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if not ec or not ec:IsFaceup() then return end
Duel.Hint(HINT_CARD,tp,id)
local g=eg:Filter(aux.AlreadyInRangeFilter(e,s.cfilter),nil,tp)
local atk,def=g:GetSum(s.atkval),g:GetSum(s.defval)
if atk>0 or def>0 then
ec:UpdateATKDEF(atk,def,true,{c,true})
end
end
function s.recopIN(e,tp,eg,ep,ev,re,r,rp,n)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if not ec or not ec:IsFaceup() then return end
Duel.Hint(HINT_CARD,tp,id)
local labels={Duel.GetFlagEffectLabel(tp,id)}
local atk,def=0,0
for i=1,#labels do
local val=labels[i]
local tatk,tdef=val&0xffff,val>>16
atk,def=atk+tatk,def+tdef
end
if atk>0 or def>0 then
ec:UpdateATKDEF(atk,def,true,{c,true})
end
end
--E2
function s.cfilter2(c,p)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(p) and c:IsPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:GetReasonPlayer()==1-p
and (c:GetAttack()>c:GetBaseAttack() or c:GetDefense()>c:GetBaseDefense()) and c:HasFlagEffect(FLAG_HAD_COUNTER_GLITCHY)
end
function s.regcounter(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if not ec or not ec:IsFaceup() then return end
local g=eg:Filter(s.cfilter2,nil,tp)
if #g==0 then return end
for tc in aux.Next(g) do
for _,ctype in ipairs({tc:GetFlagEffectLabel(FLAG_HAD_COUNTER_GLITCHY)}) do
local ct=tc:GetCounter(ctype)
if ct>0 and ec:IsCanAddCounter(ctype,ct,true) then
ec:AddCounter(ctype,ct,true)
end
end
end
end
--E3
function s.repfilter(e,re,r,rp)
return rp==1-e:GetHandlerPlayer()
end
\ No newline at end of file
--[[
快乐呼唤!
Happily Called!
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[During the End Phase of the turn this card is activated, if you have Summoned monsters with the same name 3 or more times this turn, take 1 monster from your Deck with the same Attribute/Type OR ATK/DEF as those monsters, and either add that monster to your hand, or Special Summon it. (If you have Summoned multiple monsters with the same name 3 or more times this turn, choose one of them for this effect's resolution.)]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetCategory(CATEGORIES_SEARCH|CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetFunctions(
nil,
nil,
s.target,
s.activate
)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
s.StatsTable={{},{}}
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.regop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.GlobalEffect()
ge4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_TURN_END)
ge4:OPT()
ge4:SetOperation(s.resetop)
Duel.RegisterEffect(ge4,0)
end
end
local FLAG_WAS_IN_SAME_SUMMON = id
local FLAG_VALID_CODE = id+100
function s.regfilter(c,p)
return c:IsFaceup() and c:IsSummonPlayer(p)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
for p=0,1 do
local tp=p+1
local g=eg:Filter(s.regfilter,nil,p)
for tc in aux.Next(g) do
local codes={tc:GetCode()}
for _,code in ipairs(codes) do
if not s.StatsTable[tp][code] then s.StatsTable[tp][code]={0,0,{},{},0,0} end
local attr,race,atk,def=tc:GetAttribute(),tc:GetRace(),tc:GetAttack(),tc:GetDefense()
s.StatsTable[tp][code][1] = s.StatsTable[tp][code][1]|attr
s.StatsTable[tp][code][2] = s.StatsTable[tp][code][2]|race
table.insert(s.StatsTable[tp][code][3],atk)
table.insert(s.StatsTable[tp][code][4],def)
if not Duel.PlayerHasFlagEffectLabel(p,FLAG_WAS_IN_SAME_SUMMON,code) then
s.StatsTable[tp][code][5] = s.StatsTable[tp][code][5]+1
if s.StatsTable[tp][code][5]>=3 then
Duel.RegisterFlagEffect(p,FLAG_VALID_CODE,RESET_PHASE|PHASE_END,0,1,code)
end
Duel.RegisterFlagEffect(p,FLAG_WAS_IN_SAME_SUMMON,RESET_PHASE|PHASE_END,0,1,code)
end
end
end
Duel.ResetFlagEffect(p,FLAG_WAS_IN_SAME_SUMMON)
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
aux.ClearTableRecursive(s.StatsTable)
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:Desc(1,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_END)
e1:OPT()
e1:SetCondition(s.efcon)
e1:SetOperation(s.efop)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.efcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.PlayerHasFlagEffect(tp,FLAG_VALID_CODE)
end
function s.filter(c,e,tp,ft,codes)
if not (c:IsMonster() and (c:IsAbleToHand() or (ft>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)))) then return false end
for _,code in ipairs(codes) do
local tab=s.StatsTable[tp+1][code]
if tab then
local attr,race,atk,def=c:GetAttribute(),c:GetRace(),c:GetAttack(),c:GetDefense()
if (tab[1]&attr>0 and tab[2]&race>0) or (aux.FindInTable(tab[3],atk) and aux.FindInTable(tab[4],def)) then
return true
end
end
end
return false
end
function s.efop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
local ft=Duel.GetMZoneCount(tp)
local tc=Duel.Select(HINTMSG_OPERATECARD,false,tp,s.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp,ft,{Duel.GetFlagEffectLabel(tp,FLAG_VALID_CODE)}):GetFirst()
if tc then
Duel.ToHandOrSpecialSummon(tc,e,tp)
else
Duel.SelectOption(tp,aux.Stringid(id,2))
end
end
\ No newline at end of file
--[[
宏大之殇
Wound of Greatness
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[Apply the following effects for the rest of the Duel.
● Monsters you control gain ATK/DEF equal to their original ATK/DEF, also they cannot be destroyed by card effects during your turn.
● If a card(s) you control leaves the field: Send all cards you control to the GY. ]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetFunctions(
nil,
nil,
s.target,
s.activate
)
c:RegisterEffect(e1)
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(s.atkval)
Duel.RegisterEffect(e1,tp)
local e2=e1:UpdateDefenseClone(c,true)
e2:SetValue(s.defval)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(aux.TurnPlayerCond(0))
e3:SetValue(1)
Duel.RegisterEffect(e3,tp)
local e4=Effect.CreateEffect(c)
e4:Desc(2,id)
e4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetFunctions(s.tgcon,nil,s.tgtg,s.tgop)
Duel.RegisterEffect(e4,tp)
end
function s.atkval(e,c)
return math.max(0,c:GetBaseAttack())
end
function s.defval(e,c)
return math.max(0,c:GetBaseDefense())
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsPreviousControler,1,nil,tp)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,tp,0)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0)
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
\ No newline at end of file
--[[
宏大之殇
Wound of Sincerity
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
function s.initial_effect(c)
--[[Apply the following effects for the rest of the Duel.
● Each time you draw a card(s): Add the top card and bottom card of your Deck to your hand.
● Each time you would add a card(s) from your Deck to your hand (except by drawing), banish the top half of your Deck, face-down, (rounded-up) before that.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetFunctions(
nil,
nil,
s.target,
s.activate
)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge4=Effect.GlobalEffect()
ge4:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_TURN_END)
ge4:OPT()
ge4:SetOperation(s.resetop)
Duel.RegisterEffect(ge4,0)
s.IsAbleToHandMod=false
s.IsAbleToHandChecked=false
s.IsAbleToHandGroupTab={}
local _IsAbleToHand, _SelectMatchingCard, _GetFirstMatchingCard, _Group, _GroupFilter, _GroupSelect, _GroupFilterSelect, _GetFirst, _GroupRemove =
Card.IsAbleToHand, Duel.SelectMatchingCard, Duel.GetFirstMatchingCard, Duel.GetMatchingGroup, Group.Filter, Group.Select, Group.FilterSelect, Group.GetFirst, Group.RemoveCard
function Card.IsAbleToHand(c,...)
local x={...}
local p = #x>0 and x[1] or self_reference_tp
--Debug.Message(s.IsAbleToHandMod==true)
--Debug.Message(Duel.PlayerHasFlagEffect(p,id))
if s.IsAbleToHandMod==true and Duel.PlayerHasFlagEffect(p,id) then
s.IsAbleToHandChecked=true
--Debug.Message(s.IsAbleToHandChecked)
local rg=Duel.GetDecktopGroup(p,math.ceil(Duel.GetDeckCount(p)/2)):Filter(Card.IsAbleToRemove,nil,p,POS_FACEDOWN)
if rg:IsContains(c) then
--Debug.Message(c:GetOriginalCode())
return false
end
end
return _IsAbleToHand(c,...)
end
function Duel.SelectMatchingCard(selp,f,tp,loc1,loc2,min,max,exc,...)
--Debug.Message(1)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
if s.IsAbleToHandMod==true then
local prev=s.IsAbleToHandChecked
local g=_Group(f,tp,loc1,loc2,exc,...)
local thchk=s.IsAbleToHandChecked
s.IsAbleToHandChecked=prev
--Debug.Message(thchk)
if thchk and #g<min then
s.IsAbleToHandMod=false
local ng=_Group(f,tp,loc1,loc2,exc,...)
s.IsAbleToHandMod=handmod
return ng
end
end
local g=_SelectMatchingCard(selp,f,tp,loc1,loc2,min,max,exc,...)
s.IsAbleToHandMod=handmod
return g
end
function Duel.GetFirstMatchingCard(f,tp,loc1,loc2,exc,...)
--Debug.Message(2)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
if s.IsAbleToHandMod==true then
local prev=s.IsAbleToHandChecked
local g=_Group(f,tp,loc1,loc2,exc,...)
local thchk=s.IsAbleToHandChecked
s.IsAbleToHandChecked=prev
if thchk and #g<min then
s.IsAbleToHandMod=false
local ng=_Group(f,tp,loc1,loc2,exc,...)
s.IsAbleToHandMod=handmod
return ng:GetFirst()
end
end
local g= _GetFirstMatchingCard(f,tp,loc1,loc2,exc,...)
s.IsAbleToHandMod=handmod
return g
end
function Duel.GetMatchingGroup(f,tp,loc1,loc2,exc,...)
--Debug.Message(3)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
local prev=s.IsAbleToHandChecked
local g=_Group(f,tp,loc1,loc2,exc,...)
local thchk=s.IsAbleToHandChecked
s.IsAbleToHandChecked=prev
if thchk and s.IsAbleToHandMod==true then
s.IsAbleToHandMod=false
local ng=_Group(f,tp,loc1,loc2,exc,...)
s.IsAbleToHandMod=handmod
ng:KeepAlive()
s.IsAbleToHandGroupTab[g]=ng
end
s.IsAbleToHandMod=handmod
return g
end
function Group.Filter(g,f,exc,...)
--Debug.Message(4)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
local prev=s.IsAbleToHandChecked
local g=_GroupFilter(g,f,exc,...)
local thchk=s.IsAbleToHandChecked
s.IsAbleToHandChecked=prev
if thchk and s.IsAbleToHandMod==true then
s.IsAbleToHandMod=false
local ng=_GroupFilter(g,f,exc,...)
s.IsAbleToHandMod=handmod
ng:KeepAlive()
s.IsAbleToHandGroupTab[g]=ng
end
s.IsAbleToHandMod=handmod
return g
end
function Group.Select(g,tp,min,max,exc)
--Debug.Message(5)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
local thchk=s.IsAbleToHandGroupTab[g]~=nil
if thchk then
local ng=s.IsAbleToHandGroupTab[g]:Clone()
s.IsAbleToHandGroupTab[g]:DeleteGroup()
s.IsAbleToHandGroupTab[g]=nil
if s.IsAbleToHandMod==true and #g<min then
s.IsAbleToHandMod=handmod
return ng
end
end
s.IsAbleToHandMod=handmod
return _GroupSelect(g,tp,min,max,exc)
end
function Group.FilterSelect(g,f,tp,min,max,exc,...)
--Debug.Message(6)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
local thchk1=s.IsAbleToHandGroupTab[g]~=nil
local thchk3=s.IsAbleToHandMod==true and #g<min
if thchk1 then
local ng=s.IsAbleToHandGroupTab[g]:Clone()
s.IsAbleToHandGroupTab[g]:DeleteGroup()
s.IsAbleToHandGroupTab[g]=nil
if thchk3 then
s.IsAbleToHandMod=handmod
return ng
end
elseif thchk3 then
s.IsAbleToHandMod=false
local prev=s.IsAbleToHandChecked
local ng=_GroupFilter(g,f,exc,...)
s.IsAbleToHandMod=handmod
local thchk2=s.IsAbleToHandChecked
s.IsAbleToHandChecked=prev
if thchk2 then
return ng
end
end
s.IsAbleToHandMod=handmod
return _GroupFilterSelect(g,f,tp,min,max,exc,...)
end
function Group.GetFirst(g)
local handmod=s.IsAbleToHandMod
local thchk=s.IsAbleToHandGroupTab[g]~=nil
if thchk then
if handmod~=0 then s.IsAbleToHandMod=true end
local ng=s.IsAbleToHandGroupTab[g]:Clone()
s.IsAbleToHandGroupTab[g]:DeleteGroup()
s.IsAbleToHandGroupTab[g]=nil
if s.IsAbleToHandMod==true and #g==0 then
s.IsAbleToHandMod=handmod
return _GetFirst(ng)
end
end
s.IsAbleToHandMod=handmod
return _GetFirst(g)
end
function Group.RemoveCard(g,c)
local handmod=s.IsAbleToHandMod
if handmod~=0 then s.IsAbleToHandMod=true end
local thchk=s.IsAbleToHandGroupTab[g]~=nil
if thchk and s.IsAbleToHandMod==true and not g:IsContains(c) then
s.IsAbleToHandMod=handmod
local ng=s.IsAbleToHandGroupTab[g]
if ng:IsContains(c) then
return _GroupRemove(ng,c)
end
end
s.IsAbleToHandMod=handmod
return _GroupRemove(g,c)
end
end
end
function s.resetop(e,tp,eg,ep,ev,re,r,rp)
aux.ClearTableRecursive(s.IsAbleToHandGroupTab)
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:Desc(2,id)
e1:SetCategory(CATEGORIES_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_DRAW)
e1:SetFunctions(s.tgcon,nil,s.tgtg,s.tgop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:Desc(3,id)
e2:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_SEND_REPLACE)
e2:SetLabelObject(e1)
e2:SetTarget(s.reptg)
e2:SetValue(aux.FALSE)
Duel.RegisterEffect(e2,tp)
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetDeck(tp)
if #g>=2 then
Duel.DisableShuffleCheck()
local rg=Duel.GetDecktopGroup(tp,math.ceil(Duel.GetDeckCount(tp)/2)):Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
if #rg>0 then
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
g=Duel.GetDeck(tp)
local tg=g:GetMinGroup(Card.GetSequence)+g:GetMaxGroup(Card.GetSequence)
s.IsAbleToHandMod=0
tg=tg:Filter(Card.IsAbleToHand,nil)
s.IsAbleToHandMod=false
if #tg==2 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
end
end
function s.repfilter(c,p,e)
return c:IsControler(p) and c:IsLocation(LOCATION_DECK) and c:GetDestination()==LOCATION_HAND and c:IsAbleToHand() and c:GetReasonEffect()~=e
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
s.IsAbleToHandMod=0
local g=eg:Filter(s.repfilter,nil,tp,e:GetLabelObject())
s.IsAbleToHandMod=false
local rg=Duel.GetDecktopGroup(tp,math.ceil(Duel.GetDeckCount(tp)/2)):Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
--Debug.Message(#g)
--Debug.Message(#rg)
if chk==0 then return #g>0 and #rg>0 end
Duel.DisableShuffleCheck()
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
return false
end
\ No newline at end of file
--[[
圆满之殇
Wound of Perfection
Card Author: nemoma
Scripted by: XGlitchy30
]]
local s,id=GetID()
Duel.LoadScript("glitchylib_vsnemo.lua")
Duel.LoadScript("glitchylib_lprecover.lua")
function s.initial_effect(c)
--[[Apply the following effects for the rest of the Duel.
● During each Standby Phase, if your LP is lower than your opponent, gain 6000 LP.
● If your LP decreases (either from taking damage, paying LP or losing LP from a card effect) while your LP was higher than your opponent's, your LP becomes 0.]]
local e1=Effect.CreateEffect(c)
e1:Desc(0,id)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetFunctions(
nil,
nil,
s.target,
s.activate
)
c:RegisterEffect(e1)
end
--E1
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,0,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:Desc(2,id)
e1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE|PHASE_STANDBY)
e1:OPT()
e1:SetFunctions(s.rccon,nil,nil,s.rcop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetCondition(s.regcon)
e2:SetOperation(s.regop)
Duel.RegisterEffect(e2,tp)
local e2b=e2:Clone()
e2b:SetCode(EVENT_PAY_LPCOST)
e2b:SetOperation(s.regop)
Duel.RegisterEffect(e2b,tp)
local e2c=e2:Clone()
e2c:SetCode(EVENT_LP_CHANGE)
e2c:SetCondition(s.regcon)
e2c:SetOperation(s.regop)
Duel.RegisterEffect(e2c,tp)
end
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<Duel.GetLP(1-tp)
end
function s.rcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
Duel.Recover(tp,6000,REASON_EFFECT)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and (e:GetCode()~=EVENT_LP_CHANGE or ev<0) and Duel.GetLP(tp)+ev>Duel.GetLP(1-tp)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,tp,id)
Duel.SetLP(tp,0,LP_REASON_BECOME,tp)
end
\ No newline at end of file
...@@ -105,6 +105,7 @@ STRING_SET = 1153 ...@@ -105,6 +105,7 @@ STRING_SET = 1153
STRING_SPECIAL_SUMMON = 1152 STRING_SPECIAL_SUMMON = 1152
STRING_CANNOT_BE_DESTROYED_BY_BATTLE = aux.Stringid(33720351,1) STRING_CANNOT_BE_DESTROYED_BY_BATTLE = aux.Stringid(33720351,1)
STRING_CANNOT_TRIGGER = aux.Stringid(33720389,5)
STRING_UNAFFECTED_OTHER = aux.Stringid(33720370,2) STRING_UNAFFECTED_OTHER = aux.Stringid(33720370,2)
STRING_DECKTOP = aux.Stringid(38082437,4) STRING_DECKTOP = aux.Stringid(38082437,4)
...@@ -114,6 +115,7 @@ STRING_ASK_TO_DECK = aux.Stringid(33720340,1) ...@@ -114,6 +115,7 @@ STRING_ASK_TO_DECK = aux.Stringid(33720340,1)
STRING_ASK_TO_EXTRA = aux.Stringid(33720342,1) STRING_ASK_TO_EXTRA = aux.Stringid(33720342,1)
STRING_ASK_TO_HAND = aux.Stringid(33720337,1) STRING_ASK_TO_HAND = aux.Stringid(33720337,1)
STRING_ASK_REMOVE = aux.Stringid(33720338,1) STRING_ASK_REMOVE = aux.Stringid(33720338,1)
STRING_ASK_SPSUMMON = aux.Stringid(33720388,2)
--Nemo's archetypes and constants --Nemo's archetypes and constants
ARCHE_ANIFRIENDS = 0x442 ARCHE_ANIFRIENDS = 0x442
...@@ -144,6 +146,7 @@ CARD_KEY_FRAGMENTS_RIN = 33730133 ...@@ -144,6 +146,7 @@ CARD_KEY_FRAGMENTS_RIN = 33730133
CARD_KEY_MEMORIA_HANABI = 33730159 CARD_KEY_MEMORIA_HANABI = 33730159
CARD_KEY_MEMORIA_JUST_ONE_MAGIC_WORD = 33730161 CARD_KEY_MEMORIA_JUST_ONE_MAGIC_WORD = 33730161
CARD_MEMORIES_OF_THE_SANDSTAR = 33720361 CARD_MEMORIES_OF_THE_SANDSTAR = 33720361
CARD_RESURGENCE_OF_THE_SANDSTAR = 33731004
CARD_ZEORYMER_OF_THE_SKY = 33701376 CARD_ZEORYMER_OF_THE_SKY = 33701376
COUNTER_CARD_SPECIFIC = 0x471 COUNTER_CARD_SPECIFIC = 0x471
......
--Library for Counter mods
if GLITCHYLIB_COUNTERS then return end
GLITCHYLIB_COUNTERS = true
FLAG_HAD_COUNTER_GLITCHY = 33720395
local _AddCounter = Card.AddCounter
function Card.AddCounter(c,ctype,ct,...)
if not c:HasFlagEffectLabel(FLAG_HAD_COUNTER_GLITCHY,ctype) then
c:RegisterFlagEffect(FLAG_HAD_COUNTER_GLITCHY,RESET_EVENT|RESETS_STANDARD,0,1,ctype)
end
return _AddCounter(c,ctype,ct,...)
end
\ No newline at end of file
--Glitchy Helper --Glitchy Helper
TOKEN_GLITCHY_HELPER = 33730999 if TOKEN_GLITCHY_HELPER then return end
TOKEN_GLITCHY_HELPER = 1232
GLITCHY_HELPER_TURN_COUNT_FLAG = 0x1 GLITCHY_HELPER_TURN_COUNT_FLAG = 0x1
GLITCHY_HELPER_STICKER_FLAG = 0x2 GLITCHY_HELPER_STICKER_FLAG = 0x2
GLITCHY_HELPER_PLAYER_COUNTER_FLAG = 0x4
local STRING_EXCLUDE_AI = STRING_EXCLUDE_AI or aux.Stringid(33730999,0) local STRING_EXCLUDE_AI = STRING_EXCLUDE_AI or aux.Stringid(33730999,0)
...@@ -190,6 +193,30 @@ function Auxiliary.SpawnGlitchyHelper(flags) ...@@ -190,6 +193,30 @@ function Auxiliary.SpawnGlitchyHelper(flags)
end end
end end
end end
if flags&GLITCHY_HELPER_PLAYER_COUNTER_FLAG>0 and aux.GlitchyHelperFlags&GLITCHY_HELPER_PLAYER_COUNTER_FLAG==0 then
aux.GlitchyHelperFlags = aux.GlitchyHelperFlags|GLITCHY_HELPER_PLAYER_COUNTER_FLAG
for p=0,1 do
if aux.GlitchyHelperIgnorePlayerTable[p+1]==false then
-- local h1=Effect.CreateEffect(aux.GlitchyHelper)
-- h1:SetDescription(aux.Stringid(33730999,3))
-- h1:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
-- h1:SetCode(EVENT_FREE_CHAIN)
-- h1:SetCountLimit(10)
-- h1:SetCondition(aux.GlitchyHelperShowPlayerCountersCondition)
-- h1:SetOperation(aux.GlitchyHelperShowPlayerCounters)
-- Duel.RegisterEffect(h1,p)
local h2=Effect.CreateEffect(aux.GlitchyHelper)
h2:SetDescription(aux.Stringid(33730999,3))
h2:SetType(EFFECT_TYPE_CONTINUOUS|EFFECT_TYPE_FIELD)
h2:SetCode(EVENT_FREE_CHAIN)
h2:SetCountLimit(10)
h2:SetCondition(aux.GlitchyHelperShowPlayerCountersCountCondition)
h2:SetOperation(aux.GlitchyHelperShowPlayerCountersCount)
Duel.RegisterEffect(h2,p)
end
end
end
end end
end end
...@@ -233,4 +260,21 @@ function Auxiliary.GlitchyHelperShowStickersCount(e,tp,eg,ep,ev,re,r,rp) ...@@ -233,4 +260,21 @@ function Auxiliary.GlitchyHelperShowStickersCount(e,tp,eg,ep,ev,re,r,rp)
Duel.AnnounceNumber(tp,ct) Duel.AnnounceNumber(tp,ct)
Duel.SetChainLimit(aux.FALSE) Duel.SetChainLimit(aux.FALSE)
Duel.SetChainLimitTillChainEnd(aux.FALSE) Duel.SetChainLimitTillChainEnd(aux.FALSE)
end
--
function Auxiliary.GlitchyHelperShowPlayerCountersCountCondition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetPlayerCounterCount(0)>0 or Duel.GetPlayerCounterCount(1)>0
end
function Auxiliary.GlitchyHelperShowPlayerCountersCount(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetPlayerCounterCount(tp)>0
local b2=Duel.GetPlayerCounterCount(1-tp)>0
local opt=aux.Option(tp,id,4,b1,b2)
local p = opt==0 and tp or 1-tp
local counter=Duel.GetPlayerCounter(p)
local ct=Duel.GetPlayerCounterCount(p,counter)
--Duel.Hint(HINT_CARD,tp,TOKEN_GLITCHY_HELPER)
Duel.AnnounceNumber(tp,ct)
Duel.SetChainLimit(aux.FALSE)
Duel.SetChainLimitTillChainEnd(aux.FALSE)
end end
\ No newline at end of file
...@@ -33,8 +33,9 @@ forced = Raises the custom event even if the final group is empty (require ...@@ -33,8 +33,9 @@ forced = Raises the custom event even if the final group is empty (require
customevgop = Allows to call a custom function when the cards involved in the local Event Groups are receiving the flag customevgop = Allows to call a custom function when the cards involved in the local Event Groups are receiving the flag
(useful for effects that must keep track of certain properties the cards had in a previous location) (useful for effects that must keep track of certain properties the cards had in a previous location)
raiseOnlyOneEvent = If true, only 1 custom event will be raised, independently from how many times the input event was detected raiseOnlyOneEvent = If true, only 1 custom event will be raised, independently from how many times the input event was detected
checkcond = If this condition is not met, the event check does not occur
]] ]]
function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,evgcheck,check_if_already_in_location,operation,simult_check,forced,customevgop,raiseOnlyOneEvent) function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,evgcheck,check_if_already_in_location,operation,simult_check,forced,customevgop,raiseOnlyOneEvent,checkcond)
if type(event)~="table" then event={event} end if type(event)~="table" then event={event} end
if not f then f=aux.TRUE end if not f then f=aux.TRUE end
if not flag then flag=c:GetOriginalCode() end if not flag then flag=c:GetOriginalCode() end
...@@ -77,7 +78,7 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e ...@@ -77,7 +78,7 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e
ge1:SetCode(ev) ge1:SetCode(ev)
ge1:SetLabel(code) ge1:SetLabel(code)
ge1:SetLabelObject(g) ge1:SetLabelObject(g)
ge1:SetOperation(Auxiliary.MergedDelayEventCheckGlitchy1(ev,flag,f,nil,evgcheck,nil,operation,simult_check,forced,customevgop,EVENT_COUNTER_ID,raiseOnlyOneEvent)) ge1:SetOperation(Auxiliary.MergedDelayEventCheckGlitchy1(ev,flag,f,nil,evgcheck,nil,operation,simult_check,forced,customevgop,EVENT_COUNTER_ID,raiseOnlyOneEvent,checkcond))
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
end end
...@@ -114,7 +115,7 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e ...@@ -114,7 +115,7 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e
--ge1:SetRange(range) --ge1:SetRange(range)
ge1:SetLabel(code) ge1:SetLabel(code)
ge1:SetLabelObject(g) ge1:SetLabelObject(g)
ge1:SetOperation(Auxiliary.MergedDelayEventCheckGlitchy1(ev,flag,f,public_range,evgcheck,se,operation,simult_check,forced,customevgop,EVENT_COUNTER_ID,raiseOnlyOneEvent)) ge1:SetOperation(Auxiliary.MergedDelayEventCheckGlitchy1(ev,flag,f,public_range,evgcheck,se,operation,simult_check,forced,customevgop,EVENT_COUNTER_ID,raiseOnlyOneEvent,checkcond))
Duel.RegisterEffect(ge1,0) Duel.RegisterEffect(ge1,0)
end end
local ge2=ge1:Clone() local ge2=ge1:Clone()
...@@ -139,6 +140,11 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e ...@@ -139,6 +140,11 @@ function Auxiliary.RegisterMergedDelayedEventGlitchy(c,code,event,f,flag,range,e
end end
end end
function Auxiliary.ContTrapMergedEventCheckCond(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not (c:IsFaceup() and c:IsLocation(LOCATION_SZONE) and c:IsHasEffect(EFFECT_CARD_HAS_RESOLVED))
end
function Auxiliary.SignalEventIDUpdate(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.SignalEventIDUpdate(e,tp,eg,ep,ev,re,r,rp)
aux.MustUpdateEventID[e:GetOwner()] = true aux.MustUpdateEventID[e:GetOwner()] = true
end end
...@@ -147,8 +153,10 @@ function Auxiliary.MergedDelayEventCheckGlitchy1(event,id,f,range,evgcheck,se,op ...@@ -147,8 +153,10 @@ function Auxiliary.MergedDelayEventCheckGlitchy1(event,id,f,range,evgcheck,se,op
local c=e:GetOwner() local c=e:GetOwner()
local tp=c:GetControler() local tp=c:GetControler()
if checkcond and not checkcond(e,tp,eg,ep,ev,re,r,rp) then return end
if range then if range then
if not c:IsLocation(range) or eg:IsContains(c) then if not c:IsLocation(range) or (eg and eg:IsContains(c)) then
return return
end end
if c:IsLocation(LOCATION_SZONE) and not c:IsHasEffect(EFFECT_CARD_HAS_RESOLVED) then if c:IsLocation(LOCATION_SZONE) and not c:IsHasEffect(EFFECT_CARD_HAS_RESOLVED) then
...@@ -349,6 +357,16 @@ end ...@@ -349,6 +357,16 @@ end
--Location Check --Location Check
EFFECT_CARD_HAS_RESOLVED = 47987298 EFFECT_CARD_HAS_RESOLVED = 47987298
function Card.AddCardActivationResolutionCheck(c)
local loc=c:IsOriginalType(TYPE_FIELD) and LOCATION_FZONE or LOCATION_SZONE
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE|EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(loc)
e0:SetCode(EFFECT_CARD_HAS_RESOLVED)
c:RegisterEffect(e0)
end
function Auxiliary.AlreadyInRangeCondition(e,re,se) function Auxiliary.AlreadyInRangeCondition(e,re,se)
local se=e and e:GetLabelObject():GetLabelObject() or se local se=e and e:GetLabelObject():GetLabelObject() or se
return function(c,...) return function(c,...)
...@@ -478,7 +496,7 @@ function Auxiliary.ThisCardInLocationAlreadyCheckReg(setf,getf,ignore_reason) ...@@ -478,7 +496,7 @@ function Auxiliary.ThisCardInLocationAlreadyCheckReg(setf,getf,ignore_reason)
--condition of continous effect will be checked before other effects --condition of continous effect will be checked before other effects
--Debug.Message("RE: "..tostring(re)) --Debug.Message("RE: "..tostring(re))
--Debug.Message("GETF: "..tostring(getf(e))) --Debug.Message("GETF: "..tostring(getf(e)))
if re==nil then return false end if re==nil or aux.GetValueType(re)~="Effect" then return false end
if getf(e)~=nil then return false end if getf(e)~=nil then return false end
--Debug.Message("r: "..tostring(r)) --Debug.Message("r: "..tostring(r))
if (r&REASON_EFFECT)>0 or ignore_reason then if (r&REASON_EFFECT)>0 or ignore_reason then
......
--Library for Player Couners
--Scripted by: XGlitchy30
if PLAYER_COUNTER_LIB_LOADED then return end
PLAYER_COUNTER_LIB_LOADED = true
PLAYER_COUNTER_FLAG = 33720383
PLAYER_COUNTER_COUNT_FLAG = 33720384
--Custom Categories
CATEGORY_PLAYER_COUNTER = 0x1
--Player Counters
PLAYER_COUNTER_HEAT = 0x1
PLAYER_COUNTERS_TABLE = {}
function Auxiliary.GetPlayerCounterDescription(counter)
return aux.Stringid(table.unpack(PLAYER_COUNTERS_TABLE[counter]))
end
function Auxiliary.GetPlayerCounterOwner(counter)
return PLAYER_COUNTERS_TABLE[counter][1]
end
--Functions
function Duel.GetPlayerCounter(p)
if not Duel.PlayerHasFlagEffect(p,PLAYER_COUNTER_FLAG) then return end
local counters,descs={},{}
for _,label in ipairs({Duel.GetFlagEffectLabel(p,PLAYER_COUNTER_FLAG)}) do
local desc=aux.GetPlayerCounterDescription(label)
if not aux.FindInTable(descs,desc) then
table.insert(counters,label)
table.insert(descs,desc)
end
end
local opt=Duel.SelectOption(p,table.unpack(descs))+1
local counter=counters[opt]
return counter, PLAYER_COUNTERS_TABLE[counter][1]
end
function Duel.GetPlayerCounterCount(p,counter)
if not Duel.PlayerHasFlagEffect(p,PLAYER_COUNTER_FLAG) then return 0 end
if not counter then
return Duel.GetFlagEffect(p,PLAYER_COUNTER_FLAG)
else
local ct=0
for _,label in ipairs({Duel.GetFlagEffectLabel(p,PLAYER_COUNTER_FLAG)}) do
if label==counter then
ct=ct+1
end
end
return ct
end
end
function Duel.IsCanAddPlayerCounter(p,counter,ct,e,tp,r)
return true --placeholder
end
function Duel.IsCanRemovePlayerCounter(p,counter,ct,e,tp,r)
return Duel.GetPlayerCounterCount(p,counter)>=ct --placeholder
end
aux.TempAddedPlayerCounterCount = 0
function Duel.AddPlayerCounter(p,counter,ct,e,tp,r)
if not Duel.IsCanAddPlayerCounter(p,counter,ct,e,tp,r) then return 0 end
local ct0=Duel.GetPlayerCounterCount(p,counter)
if Duel.PlayerHasFlagEffectLabel(p,PLAYER_COUNTER_COUNT_FLAG,counter) then
for _,fe in ipairs({Duel.IsPlayerAffectedByEffect(p,PLAYER_COUNTER_COUNT_FLAG|EFFECT_FLAG_EFFECT)}) do
if fe:GetLabel()==counter then
fe:Reset()
end
end
end
for i=1,ct do
Duel.RegisterFlagEffect(p,PLAYER_COUNTER_FLAG,0,0,1,counter)
end
local ct1=Duel.GetPlayerCounterCount(p,counter)
if ct1>0 then
local fe=Duel.RegisterFlagEffect(p,PLAYER_COUNTER_COUNT_FLAG,0,EFFECT_FLAG_CLIENT_HINT,1,counter)
local fe2=fe:Clone()
fe2:SetDescription(aux.GetPlayerCounterDescription(counter)+math.min(5,ct1-1))
Duel.RegisterEffect(fe2,p)
fe:Reset()
end
return math.max(0,ct1-ct0)
end
function Duel.RemovePlayerCounter(p,counter,ct,e,tp,r)
if not Duel.IsCanRemovePlayerCounter(p,counter,ct,e,tp,r) then return 0 end
local ct0=Duel.GetPlayerCounterCount(p,counter)
if Duel.PlayerHasFlagEffectLabel(p,PLAYER_COUNTER_COUNT_FLAG,counter) then
for _,fe in ipairs({Duel.IsPlayerAffectedByEffect(p,PLAYER_COUNTER_COUNT_FLAG|EFFECT_FLAG_EFFECT)}) do
if fe:GetLabel()==counter then
fe:Reset()
end
end
end
Duel.GetFlagEffectWithSpecificLabel(p,PLAYER_COUNTER_FLAG,counter,true)
local x=ct0-ct
if x>0 then
for i=1,x do
Duel.RegisterFlagEffect(p,PLAYER_COUNTER_FLAG,0,0,1,counter)
end
end
local ct1=Duel.GetPlayerCounterCount(p,counter)
if ct1>0 then
local fe=Duel.RegisterFlagEffect(p,PLAYER_COUNTER_COUNT_FLAG,0,EFFECT_FLAG_CLIENT_HINT,1,counter)
local fe2=fe:Clone()
fe2:SetDescription(aux.GetPlayerCounterDescription(counter)+math.min(5,ct1-1))
Duel.RegisterEffect(fe2,p)
fe:Reset()
end
return math.max(0,ct1-ct0)
end
\ No newline at end of file
...@@ -108,6 +108,25 @@ function Effect.GLGetTargetRange(e) ...@@ -108,6 +108,25 @@ function Effect.GLGetTargetRange(e)
return s,o return s,o
end end
--Reset
if not Effect.GetReset then
local _SetReset = Effect.SetReset
global_reset_effect_table={}
Effect.SetReset=function(e,reset,rct)
rct=rct or 1
global_reset_effect_table[e]={reset,rct}
return _SetReset(e,reset,rct)
end
function Effect.GetReset(e)
if not global_reset_effect_table[e] then return 0,1 end
local reset=global_reset_effect_table[e][1]
local rct=global_reset_effect_table[e][2]
return reset,rct
end
end
--Global Card Effect Table --Global Card Effect Table
function Card.GetEffects(c) function Card.GetEffects(c)
local eset=global_card_effect_table[c] local eset=global_card_effect_table[c]
...@@ -305,7 +324,7 @@ if not global_duel_effect_table_global_check then ...@@ -305,7 +324,7 @@ if not global_duel_effect_table_global_check then
global_duel_effect_table={} global_duel_effect_table={}
Duel.register_global_duel_effect_table = Duel.RegisterEffect Duel.register_global_duel_effect_table = Duel.RegisterEffect
Duel.RegisterEffect = function(e,tp) Duel.RegisterEffect = function(e,tp)
if tp~=0 and tp~=1 then return end if not tp then tp=0 end
if not global_duel_effect_table[tp] then global_duel_effect_table[tp]={} end if not global_duel_effect_table[tp] then global_duel_effect_table[tp]={} end
table.insert(global_duel_effect_table[tp],e) table.insert(global_duel_effect_table[tp],e)
......
...@@ -401,8 +401,11 @@ function Auxiliary.ClearTable(tab) ...@@ -401,8 +401,11 @@ function Auxiliary.ClearTable(tab)
end end
function Auxiliary.ClearTableRecursive(tab) function Auxiliary.ClearTableRecursive(tab)
for k,v in pairs(tab) do for k,v in pairs(tab) do
if type(v)=="table" then local typ=aux.GetValueType(v)
if typ=="table" then
aux.ClearTableRecursive(v) aux.ClearTableRecursive(v)
elseif typ=="Group" then
v:DeleteGroup()
end end
tab[k]=nil tab[k]=nil
end end
...@@ -441,6 +444,8 @@ function Card.IsDirectlyActivatable(c,tp,ignore_loc) ...@@ -441,6 +444,8 @@ function Card.IsDirectlyActivatable(c,tp,ignore_loc)
end end
function Card.IsCanBeAttachedTo(c,xyzc,e,p,r) function Card.IsCanBeAttachedTo(c,xyzc,e,p,r)
p = p or (e and e:GetHandlerPlayer()) or xyzc:GetControler()
r = r or REASON_EFFECT
return xyzc:IsType(TYPE_XYZ) and c:IsCanOverlay(xyzc:GetControler()) and not c:IsForbidden() --futureproofing return xyzc:IsType(TYPE_XYZ) and c:IsCanOverlay(xyzc:GetControler()) and not c:IsForbidden() --futureproofing
end end
function Duel.Attach(c,xyz,transfer,e,r,rp) function Duel.Attach(c,xyz,transfer,e,r,rp)
...@@ -1021,6 +1026,22 @@ end ...@@ -1021,6 +1026,22 @@ end
function Duel.GetGroupOperatedByThisEffect(e,exc) function Duel.GetGroupOperatedByThisEffect(e,exc)
return Duel.GetOperatedGroup():Filter(aux.BecauseOfThisEffect(e),exc) return Duel.GetOperatedGroup():Filter(aux.BecauseOfThisEffect(e),exc)
end end
function Glitchy.BecauseOfThisCost(e)
return function(c)
return c:IsReason(REASON_COST) and not c:IsReason(REASON_REDIRECT) and c:GetReasonEffect()==e
end
end
function Duel.GetGroupOperatedByThisCost(e,exc)
return Duel.GetOperatedGroup():Filter(xgl.BecauseOfThisCost(e),exc)
end
function Glitchy.BecauseOfThisRule(e)
return function(c)
return c:IsReason(REASON_RULE) and not c:IsReason(REASON_REDIRECT) and c:GetReasonEffect()==e
end
end
function Duel.GetGroupOperatedByThisRule(e,exc)
return Duel.GetOperatedGroup():Filter(xgl.BecauseOfThisRule(e),exc)
end
function Auxiliary.AfterShuffle(g) function Auxiliary.AfterShuffle(g)
for p=0,1 do for p=0,1 do
if aux.PLChk(g,p,LOCATION_DECK) then if aux.PLChk(g,p,LOCATION_DECK) then
...@@ -1428,6 +1449,17 @@ end ...@@ -1428,6 +1449,17 @@ end
function Duel.GetTargetParam() function Duel.GetTargetParam()
return Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM) return Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
end end
function Effect.GetChainLink(e)
local max=Duel.GetCurrentChain()
if max==0 then return 0 end
for i=1,max do
local ce=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if ce==e then
return i
end
end
return 0
end
--Cloned Effects --Cloned Effects
function Effect.SpecialSummonEventClone(e,c,notreg) function Effect.SpecialSummonEventClone(e,c,notreg)
...@@ -1831,9 +1863,10 @@ function Auxiliary.ActivateException(e,chk) ...@@ -1831,9 +1863,10 @@ function Auxiliary.ActivateException(e,chk)
return return
end end
end end
function Auxiliary.ExceptThis(c) function Auxiliary.ExceptThis(c,e)
if aux.GetValueType(c)=="Effect" then c=c:GetHandler() end if aux.GetValueType(c)=="Effect" then c=c:GetHandler() end
if c:IsRelateToChain() then return c else return nil end local ch=aux.GetValueType(e)=="Effect" and e:GetChainLink() or nil
if c:IsRelateToChain(ch) then return c else return nil end
end end
--Descriptions --Descriptions
...@@ -2600,6 +2633,7 @@ end ...@@ -2600,6 +2633,7 @@ end
--Zones --Zones
function Duel.GetMZoneCountForMultipleSpSummon(p,exc) function Duel.GetMZoneCountForMultipleSpSummon(p,exc)
local ft=Duel.GetMZoneCount(p,exc) local ft=Duel.GetMZoneCount(p,exc)
if ft<=0 then return ft end
if Duel.IsPlayerAffectedByEffect(p,CARD_BLUEEYES_SPIRIT) then ft=1 end if Duel.IsPlayerAffectedByEffect(p,CARD_BLUEEYES_SPIRIT) then ft=1 end
return ft return ft
end end
...@@ -2749,6 +2783,20 @@ function Duel.GetHandCount(p) ...@@ -2749,6 +2783,20 @@ function Duel.GetHandCount(p)
return Duel.GetFieldGroupCount(p,LOCATION_HAND,0) return Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
end end
end end
function Duel.GetMonsters(p)
if not p then
return Duel.GetFieldGroup(0,LOCATION_MZONE,LOCATION_MZONE)
else
return Duel.GetFieldGroup(p,LOCATION_MZONE,0)
end
end
function Duel.GetMonsterCount(p)
if not p then
return Duel.GetFieldGroupCount(0,LOCATION_MZONE,LOCATION_MZONE)
else
return Duel.GetFieldGroupCount(p,LOCATION_MZONE,0)
end
end
function Duel.GetDeck(p) function Duel.GetDeck(p)
return Duel.GetFieldGroup(p,LOCATION_DECK,0) return Duel.GetFieldGroup(p,LOCATION_DECK,0)
end end
...@@ -3802,6 +3850,13 @@ function Auxiliary.ContactFusionMaterialsToDeck(g,_,tp) ...@@ -3802,6 +3850,13 @@ function Auxiliary.ContactFusionMaterialsToDeck(g,_,tp)
end end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST) Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end end
function Auxiliary.ContactFusionMaterialsToHand(g,_,tp)
local cg=g:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoHand(g,nil,REASON_COST)
end
--EFFECTS THAT CAN BE ACTIVATED BY AFFECTING THE CARD USED AS COST, EVEN WHEN THERE ARE NO OTHER VALID TARGETS --EFFECTS THAT CAN BE ACTIVATED BY AFFECTING THE CARD USED AS COST, EVEN WHEN THERE ARE NO OTHER VALID TARGETS
aux.LocationAfterCostEffects = {} aux.LocationAfterCostEffects = {}
......
...@@ -89,9 +89,9 @@ function Card.GetStickerCount(c,sticker) ...@@ -89,9 +89,9 @@ function Card.GetStickerCount(c,sticker)
end end
end end
function Duel.GetStickerCountOnPlayer(p,sticker) function Duel.GetStickerCountOnPlayer(p,sticker)
if not Duel.GetFlagEffect(STICKER_FLAG) then return 0 end if not Duel.PlayerHasFlagEffect(p,STICKER_FLAG) then return 0 end
if not sticker then if not sticker then
return Duel.GetFlagEffect(STICKER_FLAG) return Duel.GetFlagEffect(p,STICKER_FLAG)
else else
local ct=0 local ct=0
for _,label in ipairs({Duel.GetFlagEffectLabel(p,STICKER_FLAG)}) do for _,label in ipairs({Duel.GetFlagEffectLabel(p,STICKER_FLAG)}) do
......
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