Commit 08b5b1fd authored by Nemo Ma's avatar Nemo Ma

new nemocards

parent 05fee527
No preview for this file type
--向心素描
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--alternative timing
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.altcon)
c:RegisterEffect(e2)
end
--alt con
function s.altcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
--Activate
function s.rvfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:IsHasType(EFFECT_TYPE_ACTIVATE) or Duel.IsExistingMatchingCard(s.rvfilter,tp,LOCATION_DECK,0,1,nil) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tc=Duel.SelectMatchingCard(tp,s.rvfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
if not tc then return end
Duel.ConfirmCards(1-tp,Group.FromCards(tc))
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,1)
if tc:IsLocation(LOCATION_DECK) and tc:GetSequence()==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(s.spop)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
local c=e:GetLabelObject()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id+1,0,TYPE_MONSTER+TYPE_NORMAL+TYPE_TOKEN,c:GetTextAttack(),c:GetTextDefense(),c:GetOriginalLevel(),c:GetOriginalRace(),c:GetOriginalAttribute()) then
return
end
local token=Duel.CreateToken(tp,id+1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(c:GetTextAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(c:GetTextDefense())
token:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(c:GetOriginalLevel())
token:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(c:GetOriginalRace())
token:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(c:GetOriginalAttribute())
token:RegisterEffect(e5)
--
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e6=e1:Clone()
e6:SetCode(EFFECT_ADD_TYPE)
e6:SetValue(TYPE_EFFECT)
token:RegisterEffect(e6)
local e7=Effect.CreateEffect(e:GetHandler())
e7:SetDescription(aux.Stringid(id,0))
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetRange(LOCATION_MZONE)
e7:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e7:SetHintTiming(0,TIMING_MAIN_END)
e7:SetLabel(0)
e7:SetLabelObject(e6)
e7:SetCondition(s.thcon)
e7:SetCost(s.thcost)
e7:SetTarget(s.thtg)
e7:SetOperation(s.thop)
e7:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
token:RegisterEffect(e7)
Duel.SpecialSummonComplete()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.cfilter(c,tp)
return c:IsCode(id+1) and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetLevel(),c:GetRace(),c:GetAttribute(),c:GetAttack(),c:GetDefense())
end
function s.thfilter(c,lv,rc,attr,atk,def)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and c:IsLevel(lv)
and c:GetRace()&rc>0
and c:GetAttribute()&attr>0
and c:GetAttack()==atk and c:GetDefense()==def
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,s.cfilter,1,nil,tp)
end
local g=Duel.SelectReleaseGroup(tp,s.cfilter,1,1,nil,tp)
local tc=g:GetFirst()
e:GetLabelObject():SetLabel(tc:GetLevel(),tc:GetRace(),tc:GetAttribute(),tc:GetAttack(),tc:GetDefense())
Duel.Release(g,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local lv,rc,attr,atk,def=e:GetLabelObject():GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,lv,rc,attr,atk,def)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--梓璃梦 海边骑行
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--recover
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetCategory(CATEGORY_RECOVER)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetRange(LOCATION_MZONE)
e0:SetCost(s.lpcost)
e0:SetTarget(s.lptg)
e0:SetOperation(s.lpop)
c:RegisterEffect(e0)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.eqtg)
e1:SetOperation(s.eqop)
c:RegisterEffect(e1)
--alternative timing
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(s.altcon)
c:RegisterEffect(e2)
end
--recover
function s.lpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipGroup():IsExists(Card.IsAbleToGraveAsCost,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=e:GetHandler():GetEquipGroup():FilterSelect(tp,Card.IsAbleToGraveAsCost,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.lptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(800)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,800)
end
function s.lpop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
--equip
function s.eqfilter(c)
return c:IsType(TYPE_EQUIP) and c:IsType(TYPE_SPELL)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(s.eqfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.eqfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc then
tc:ReplaceEffect(33720022,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
Duel.Equip(tp,tc,c)
end
end
--alt con
function s.altcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
\ No newline at end of file
--虚拟YouTuber的再构筑
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(0)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.cfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and (c:IsSetCard(0x445) or c:IsSetCard(0x344c)) and c:IsFaceup() and c:IsAbleToGraveAsCost()
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp,c,{c:GetCode()})
end
function s.spfilter(c,e,tp,cc,clist)
return c:IsType(TYPE_MONSTER) and c:IsCode(table.unpack(clist)) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and ((c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,cc,c)>0) or (not c:IsLocation(LOCATION_EXTRA) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or (not cc or (cc:IsControler(tp) and cc:GetSequence()<5)))))
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp)
local tc=g:GetFirst()
local codes={tc:GetCode()}
e:SetLabel(table.unpack(codes))
Duel.SendtoGrave(tc,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local clist={e:GetLabel()}
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,nil,clist)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 and g:GetFirst():IsSummonLocation(LOCATION_DECK+LOCATION_EXTRA) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
Duel.RegisterEffect(e1,tp)
end
end
--动物朋友学
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
if #g<=0 then return end
Duel.ConfirmCards(1-tp,g)
if g:GetClassCount(Card.GetCode)==#g then
local sg=g:Filter(Card.IsAbleToHand,nil)
if #sg>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local tg=sg:Select(1-tp,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
end
end
Duel.ShuffleDeck(tp)
end
\ No newline at end of file
--人靠衣装
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Special 1 monster from hand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP+CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH+EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function s.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and not c:IsForbidden()
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp,c:GetLevel(),c:GetRace(),c:GetAttribute())
end
function s.spfilter(c,e,tp,lv,rc,att)
return c:IsType(TYPE_MONSTER) and not c:IsPublic() and not c:IsForbidden() and c:IsLevelAbove(lv+1) and c:IsRace(rc) and c:IsAttribute(att)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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,e,tp) end
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(tp,LOCATION_SZONE)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and not e:GetHandler():IsLocation(LOCATION_SZONE) then ft2=ft2-1 end
if chk==0 then return ft1>0 and ft2>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetFirstTarget()
if not tg or not tg:IsRelateToEffect(e) then return end
local c=e:GetHandler()
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft1<=0 or ft2<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,tg:GetLevel(),tg:GetRace(),tg:GetAttribute())
if sg then
Duel.ConfirmCards(1-tp,sg)
if Duel.Damage(1-tp,math.abs(tg:GetLevel()-sg:GetFirst():GetLevel())*500,REASON_EFFECT)>0 and Duel.SpecialSummon(sg:GetFirst(),0,tp,tp,false,false,POS_FACEUP)>0 and Duel.Equip(tp,tg,sg:GetFirst(),true) then
tg:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
e1:SetLabelObject(sg:GetFirst())
tg:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(s.tgcon)
e2:SetOperation(s.tgop)
e2:SetReset(RESET_EVENT+RESET_TOFIELD+RESET_TURN_SET)
tg:RegisterEffect(e2)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetOperation(s.eqcheck)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
sg:GetFirst():RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EVENT_DESTROYED)
e3:SetCondition(s.spcon)
e3:SetOperation(s.spop)
e3:SetLabelObject(e4)
e3:SetReset(RESET_EVENT+RESET_TOFIELD+RESET_TURN_SET)
sg:GetFirst():RegisterEffect(e3)
end
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
function s.tgcon(e)
local c=e:GetHandler()
return c:GetPreviousLocation()==LOCATION_SZONE and c:GetPreviousEquipTarget()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetPreviousEquipTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function s.eqcheck(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject() then e:GetLabelObject():DeleteGroup() end
local g=e:GetHandler():GetEquipGroup():Filter(s.spfilter1,nil)
g:KeepAlive()
e:SetLabelObject(g)
end
function s.spcon(e)
local c=e:GetHandler()
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and c:GetPreviousLocation()==LOCATION_MZONE
end
function s.spfilter1(c)
return c:GetFlagEffect(id)>0
end
function s.spfilter2(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,aux.Stringid(id,1)) then return end
local g=e:GetLabelObject():GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:FilterSelect(tp,s.spfilter2,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e1:SetTarget(function(e,c) return c==sg:GetFirst() end)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
\ No newline at end of file
--智商融毁!!
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--no damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(1,0)
e1:SetCondition(s.damcon)
e1:SetValue(0)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(s.immcon)
e3:SetValue(s.efilter)
c:RegisterEffect(e3)
--discard limit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(1,1)
e5:SetCode(EFFECT_CANNOT_DISCARD_HAND)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function s.damcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==1
end
function s.immcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end
function s.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
\ No newline at end of file
--水晶魔法小妖精 铃奈
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
Duel.EnableGlobalFlag(GLOBALFLAG_DECK_REVERSE_CHECK)
--stack decks
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(id,0))
e0:SetCategory(CATEGORY_TODECK)
e0:SetType(EFFECT_TYPE_QUICK_O)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetHintTiming(0,TIMINGS_CHECK_MONSTER_E)
e0:SetRange(LOCATION_HAND+LOCATION_MZONE)
e0:SetCondition(s.condition)
e0:SetCost(aux.bfgcost)
e0:SetTarget(s.target)
e0:SetOperation(s.operation)
c:RegisterEffect(e0)
--floodgates
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_GRAVE)
e1:SetRange(LOCATION_DECK)
e1:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e1:SetCondition(s.fcon)
c:RegisterEffect(e1)
local e1x=e1:Clone()
e1x:SetCode(EFFECT_CANNOT_REMOVE)
c:RegisterEffect(e1x)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_DISCARD_DECK)
e2:SetRange(LOCATION_DECK)
e2:SetTargetRange(1,1)
e2:SetCondition(s.fcon)
c:RegisterEffect(e2)
--count
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_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_REMOVE)
Duel.RegisterEffect(ge2,0)
end
end
--count
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:GetPreviousLocation()==LOCATION_DECK then
Duel.RegisterFlagEffect(tc:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end
tc=eg:GetNext()
end
end
--stack
function s.condition(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return false end
local ct1,ct2=Duel.GetFlagEffect(tp,id),Duel.GetFlagEffect(1-tp,id)
if not ct1 then ct1=0 end
if not ct2 then ct2=0 end
return ct1+ct2>=13
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct1,ct2=Duel.GetFlagEffect(tp,id),Duel.GetFlagEffect(1-tp,id)
if not ct1 then ct1=0 end
if not ct2 then ct2=0 end
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=ct1+ct2 end
e:GetHandler():CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_TODECK,Duel.GetFieldGroupCount(tp,0,LOCATION_DECK),ct1+ct2,0,0)
end
function s.deckseq(c,ct)
return c:GetSequence()==ct
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ct1,ct2=Duel.GetFlagEffect(tp,id),Duel.GetFlagEffect(1-tp,id)
if not ct1 then ct1=0 end
if not ct2 then ct2=0 end
local dcount=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)
if dcount<ct1+ct2 then return end
local g=Duel.GetDecktopGroup(1-tp,ct1+ct2)
local tg=Group.CreateGroup()
Duel.DisableShuffleCheck()
for i=#g,1,-1 do
local tc=g:Filter(s.deckseq,nil,dcount-i):GetFirst()
if tc then
tg:AddCard(tc)
end
end
if #tg~=#g then return end
for tc in aux.Next(tg) do
Duel.SendtoDeck(tc,tp,0,REASON_EFFECT)
end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsAbleToDeck() and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SendtoDeck(c,tp,0,REASON_EFFECT)
if c:IsLocation(LOCATION_DECK) then
c:ReverseInDeck()
end
end
end
--floodgates
function s.fcon(e)
return e:GetHandler():IsFaceup()
end
\ No newline at end of file
--被丢弃的回响
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.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(s.handcon)
c:RegisterEffect(e2)
--count
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_TO_GRAVE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TO_HAND)
ge2:SetOperation(s.limitcheck)
Duel.RegisterEffect(ge2,0)
end
end
--count
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
for p=0,1 do
if tc:GetPreviousControler()==p and tc:GetReasonPlayer()==p and tc:GetPreviousLocation()&(LOCATION_DECK+LOCATION_HAND)>0 then
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_UNCOPYABLE,1)
tc:SetFlagEffectLabel(id,p)
end
end
tc=eg:GetNext()
end
end
function s.limitcheck(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if (Duel.GetTurnPlayer()==1-tc:GetControler() or Duel.GetCurrentPhase()~=PHASE_DRAW) and tc:GetPreviousControler()==tc:GetControler() and tc:GetPreviousLocation()&LOCATION_DECK>0 then
Duel.RegisterFlagEffect(tc:GetControler(),id,RESET_PHASE+PHASE_END,0,1)
end
tc=eg:GetNext()
end
end
--activate
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END
end
function s.filter(c,tp)
return c:GetFlagEffect(id)>0 and c:GetFlagEffectLabel(id)==1-tp and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,tp) end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil,tp)
if #g>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--act in hand
function s.handcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)<=0
end
\ No newline at end of file
--失却自我
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetLabel(0)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.costfilter(c,e,tp,g,ft)
local lv=(c:GetOriginalType()&TYPE_XYZ>0) and c:GetRank() or (c:GetOriginalType()&TYPE_LINK>0) and c:GetLink() or c:GetLevel()
return lv and Duel.GetMZoneCount(tp,c)>0 and (c:IsControler(tp) or c:IsFaceup()) and g:CheckWithSumEqual(Card.GetLevel,lv,1,ft+1)
end
function s.spfilter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
return ft>-1 and Duel.CheckReleaseGroup(tp,s.costfilter,1,nil,e,tp,g,ft)
end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local sg=Duel.SelectReleaseGroup(tp,s.costfilter,1,1,nil,e,tp,g,ft)
e:SetLabel(sg:GetFirst():GetLevel())
Duel.Release(sg,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft>1 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,nil,e,tp)
if ft<=0 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,e:GetLabel(),1,ft)
if sg:GetCount()>0 then
local check=false
local tc=sg:GetFirst()
while tc do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
check=true
end
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
if not check then return end
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
\ No newline at end of file
--始源的最终通牒
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_REMOVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e)
return Duel.GetTurnCount()>=13
end
function s.filter(c,tp)
return c:IsAbleToHand() or c:IsAbleToRemove(1-tp,POS_FACEDOWN)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,5,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()<13 then return end
local ct=Duel.Damage(tp,Duel.GetLP(tp)-100,REASON_EFFECT)
if ct~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,5,5,nil,tp)
if #g>0 then
local op=Duel.SelectOption(1-tp,aux.Stringid(id,0),aux.Stringid(id,1))
if op==0 then
local fg=g:Filter(Card.IsAbleToHand,nil)
if #fg>0 then
Duel.SendtoHand(fg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,fg)
else
Duel.ConfirmCards(1-tp,g)
end
else
local fg=g:Filter(Card.IsAbleToRemove,nil,tp,POS_FACEDOWN)
if #fg>0 then
if Duel.Remove(fg,POS_FACEDOWN,REASON_EFFECT)>0 then
Duel.Damage(1-tp,ct,REASON_EFFECT)
end
else
Duel.ConfirmCards(1-tp,g)
end
end
end
end
end
\ No newline at end of file
--虚拟YouTuber 有栖与莓
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroMixProcedure(c,aux.Tuner(nil),aux.Tuner(nil),nil,aux.NonTuner(nil),2,99)
c:EnableReviveLimit()
--matcheck
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(s.valcheck)
c:RegisterEffect(e1)
--stats
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetRange(LOCATION_MZONE)
e2:SetLabel(2)
e2:SetLabelObject(e1)
e2:SetCondition(s.numcon)
e2:SetValue(1500)
c:RegisterEffect(e2)
local e2x=e2:Clone()
e2x:SetCode(EFFECT_UPDATE_ATTACK)
e2x:SetLabel(3)
e2x:SetLabelObject(e1)
c:RegisterEffect(e2x)
--battle effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,3))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_START)
e3:SetLabel(4)
e3:SetLabelObject(e1)
e3:SetCondition(s.numcon)
e3:SetTarget(s.drytg)
e3:SetOperation(s.dryop)
c:RegisterEffect(e3)
--dragoon protection
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetLabel(ATTRIBUTE_FIRE)
e4:SetLabelObject(e1)
e4:SetCondition(s.attrcon)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetLabel(ATTRIBUTE_WATER)
e5:SetLabelObject(e1)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function s.valcheck(e,c)
local g=c:GetMaterial()
local ct=0
local attr=0
local tc=g:GetFirst()
for tc in aux.Next(g) do
if attr&tc:GetAttribute()==0 then
attr=(attr|tc:GetAttribute())
end
end
local list={ATTRIBUTE_EARTH,ATTRIBUTE_WATER,ATTRIBUTE_FIRE,ATTRIBUTE_WIND,ATTRIBUTE_LIGHT,ATTRIBUTE_DARK,ATTRIBUTE_DIVINE}
for i=1,#list do
if attr&list[i]>0 then
ct=ct+1
end
end
e:SetLabel(ct,attr)
--hints
if ct>=4 then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0))
end
if attr&ATTRIBUTE_WATER>0 then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1))
end
if attr&ATTRIBUTE_FIRE>0 then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2))
end
end
function s.numcon(e)
local n=e:GetLabelObject():GetLabel()
return n and n>=e:GetLabel()
end
function s.attrcon(e)
local _,attr=e:GetLabelObject():GetLabel()
return attr and attr&e:GetLabel()>0
end
--battle effect
function s.drytg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c then tc=Duel.GetAttackTarget() end
if chk==0 then return tc end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,tc:GetDefense())
end
function s.dryop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c then tc=Duel.GetAttackTarget() end
if tc and tc:IsRelateToBattle() then
local def=tc:GetDefense()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(1-tp,def,REASON_EFFECT)
end
end
end
\ No newline at end of file
--参与第一
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--The Bamboo Standard
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(0)
c:RegisterEffect(e3)
--send
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_BATTLE_CONFIRM)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(s.ddcon)
e4:SetOperation(s.ddop)
c:RegisterEffect(e4)
--indes
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e5:SetCondition(s.prcon)
e5:SetValue(1)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e6)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
--send
function s.ddcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local bc=ec:GetBattleTarget()
return ec and ec:IsRelateToBattle() and bc and bc:IsRelateToBattle() and ec:GetAttack()>ec:GetBaseAttack()
end
function s.ddop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Hint(HINT_CARD,tp,id)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
--indes
function s.prcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec:GetAttack()<ec:GetBaseAttack()
end
\ No newline at end of file
--元素之女 阳蜂
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit()
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsum
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--negate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.discon)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
end
--tohand
function s.thcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function s.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsLevel(4) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,3,3,nil)
Duel.ShuffleDeck(tp)
if #sg<3 then return end
Duel.ConfirmCards(1-tp,sg)
local tg=sg:RandomSelect(1-tp,1)
if #tg>0 then
Duel.DisableShuffleCheck()
Duel.SendtoHand(tg,nil,REASON_EFFECT)
sg:RemoveCard(tg:GetFirst())
end
if #sg>0 then
for tc in aux.Next(sg) do
Duel.MoveSequence(tc,0)
end
Duel.SortDecktop(tp,tp,#sg)
for i=1,#sg do
local mg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(mg:GetFirst(),1)
end
end
end
end
--spsum
function s.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,0,nil)
return ct==1
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
e:SetLabelObject(g:GetFirst())
g:GetFirst():CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,#g,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local eq=e:GetLabelObject()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not eq or not eq:IsRelateToEffect(e) or not eq:IsLocation(LOCATION_MZONE) or not eq:IsControler(tp) then return end
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
local atk=eq:GetTextAttack()
if atk<0 then atk=0 end
if not Duel.Equip(tp,eq,c,false) then return end
--equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetLabelObject(c)
e2:SetValue(s.eqlimit)
eq:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
e3:SetValue(atk)
eq:RegisterEffect(e3)
end
end
function s.eqlimit(e,c)
return c==e:GetLabelObject()
end
--negate
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not tg or not tg:IsContains(c) then return false end
return Duel.IsChainDisablable(ev)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--勇敢英姿 觉醒法师
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--cannot special summon
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetRange(LOCATION_GRAVE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e0)
--spsum
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--ATK
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(s.acop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(s.discon)
e4:SetCost(s.discost)
e4:SetTarget(s.distg)
e4:SetOperation(s.disop)
c:RegisterEffect(e4)
end
--spsum
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
--ATK
function s.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if re:IsActiveType(TYPE_MONSTER) and re:GetHandler()~=c and c:GetFlagEffect(1)>0 and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE)
c:RegisterEffect(e1)
end
end
--disable
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return re:GetHandler():IsType(TYPE_MONSTER) and loc==LOCATION_MZONE and Duel.IsChainDisablable(ev)
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetAttack()>=600 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-600)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
\ No newline at end of file
--滑翔机小姐
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
--selfdes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_SELF_DESTROY)
e1:SetCondition(s.sdcon)
c:RegisterEffect(e1)
--return
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(s.spcon)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
--selfdes
function s.cfilter(c,cc)
return c~=cc
end
function s.sdcon(e)
return Duel.IsExistingMatchingCard(s.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,e:GetHandler())
end
--return
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return r&REASON_DESTROY>0 and (r&REASON_EFFECT+REASON_BATTLE)~=0 and e:GetHandler():GetPreviousLocation()==LOCATION_MZONE and e:GetHandler():GetPreviousPosition()&POS_FACEUP>0
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=(Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY) and 2 or 1
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,ct)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,ct)
e1:SetCountLimit(1)
e1:SetCondition(s.retcon)
e1:SetOperation(s.retop)
e1:SetLabel(ct-1)
e1:SetLabelObject(c)
Duel.RegisterEffect(e1,tp)
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local t=e:GetLabel()
if e:GetLabelObject():GetFlagEffect(id)>0 then
if t==1 then
e:SetLabel(0)
else
Duel.MoveToField(e:GetLabelObject(),tp,tp,LOCATION_MZONE,e:GetLabelObject():GetPreviousPosition(),true)
end
else
e:Reset()
end
end
\ No newline at end of file
--自律Protoform 帕尼
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--search
local p1=Effect.CreateEffect(c)
p1:SetDescription(aux.Stringid(id,0))
p1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
p1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
p1:SetCode(EVENT_PHASE+PHASE_DRAW)
p1:SetRange(LOCATION_PZONE)
p1:SetCountLimit(1)
p1:SetCondition(s.condition)
p1:SetTarget(s.target)
p1:SetOperation(s.operation)
c:RegisterEffect(p1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.discon)
e3:SetCost(s.discost)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
--count pendulum summons
if not s.global_check then
s.global_check=true
if not s.pendulum_summoned_names then
s.pendulum_summoned_names={{},{}}
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TURN_END)
ge2:SetCountLimit(1)
ge2:SetOperation(s.resetlist)
Duel.RegisterEffect(ge2,0)
end
end
--count pendulum summons
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local pg=eg:Filter(Card.IsSummonType,nil,SUMMON_TYPE_PENDULUM)
if #pg~=1 then return end
local tc=pg:GetFirst()
if tc then
local codes={tc:GetCode()}
for i=1,#codes do
table.insert(s.pendulum_summoned_names[tc:GetSummonPlayer()+1],codes[i])
end
end
end
function s.resetlist()
s.pendulum_summoned_names={{},{}}
end
--search
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(5) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
local codes=g:GetFirst():GetCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_PZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(codes)
e1:SetCondition(s.retcon)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
e:GetHandler():RegisterEffect(e1)
end
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
if #s.pendulum_summoned_names[tp+1]==0 then return true end
local codes={e:GetLabel()}
for i=1,#codes do
for j=1,#s.pendulum_summoned_names[tp+1] do
if codes[i]==s.pendulum_summoned_names[tp+1][j] then
return false
end
end
end
return true
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.Damage(tp,2000,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
--spsummon
function s.sumfilter(c,tp)
return c:IsSummonPlayer(1-tp) and c:IsType(TYPE_TUNER)
end
function s.cfilter(c,eg)
return not eg:IsContains(c)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.sumfilter,1,nil,tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil,eg)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--negate
function s.sumfilter2(c,tp)
return c:IsSummonType(SUMMON_TYPE_SYNCHRO) and c:IsSummonPlayer(1-tp) and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.sumfilter2,nil,tp)
return #g==1
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(s.sumfilter2,nil,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
end
function s.disfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.disfilter,nil,e)
local tc=g:GetFirst()
if not tc then return end
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
\ No newline at end of file
--自律Protoform 吉尔
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--search
local p1=Effect.CreateEffect(c)
p1:SetDescription(aux.Stringid(id,0))
p1:SetCategory(CATEGORY_TOHAND)
p1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
p1:SetCode(EVENT_PHASE+PHASE_DRAW)
p1:SetRange(LOCATION_PZONE)
p1:SetCountLimit(1)
p1:SetCondition(s.condition)
p1:SetTarget(s.target)
p1:SetOperation(s.operation)
c:RegisterEffect(p1)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.spcon)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_NEGATE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.discon)
e3:SetCost(s.discost)
e3:SetTarget(s.distg)
e3:SetOperation(s.disop)
c:RegisterEffect(e3)
--count pendulum summons
if not s.global_check then
s.global_check=true
if not s.pendulum_summoned_names then
s.pendulum_summoned_names={{},{}}
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_TURN_END)
ge2:SetCountLimit(1)
ge2:SetOperation(s.resetlist)
Duel.RegisterEffect(ge2,0)
end
end
--count pendulum summons
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local pg=eg:Filter(Card.IsSummonType,nil,SUMMON_TYPE_PENDULUM)
if #pg~=1 then return end
local tc=pg:GetFirst()
if tc then
local codes={tc:GetCode()}
for i=1,#codes do
table.insert(s.pendulum_summoned_names[tc:GetSummonPlayer()+1],codes[i])
end
end
end
function s.resetlist()
s.pendulum_summoned_names={{},{}}
end
--search
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function s.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsLevelBelow(5) and c:IsAbleToHand() and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_GRAVE+LOCATION_REMOVED)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,g)
local codes=g:GetFirst():GetCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_PZONE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(codes)
e1:SetCondition(s.retcon)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
e:GetHandler():RegisterEffect(e1)
end
end
function s.retcon(e,tp,eg,ep,ev,re,r,rp)
if #s.pendulum_summoned_names[tp+1]==0 then return true end
local codes={e:GetLabel()}
for i=1,#codes do
for j=1,#s.pendulum_summoned_names[tp+1] do
if codes[i]==s.pendulum_summoned_names[tp+1][j] then
return false
end
end
end
return true
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SelectYesNo(tp,aux.Stringid(id-1,0)) then
Duel.Damage(tp,2000,REASON_EFFECT)
else
Duel.Destroy(c,REASON_EFFECT)
end
end
--spsummon
function s.sumfilter(c,tp,eg)
return c:IsSummonPlayer(1-tp) and Duel.IsExistingMatchingCard(s.cfilter,tp,0,LOCATION_MZONE,1,nil,eg,c:GetLevel())
end
function s.cfilter(c,eg,lv)
return not eg:IsContains(c) and c:IsLevel(lv)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.sumfilter,1,nil,tp,eg)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--negate
function s.sumfilter2(c,tp)
return c:IsSummonType(SUMMON_TYPE_XYZ) and c:IsSummonPlayer(1-tp) and c:IsType(TYPE_EFFECT) and not c:IsDisabled()
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.sumfilter2,nil,tp)
return #g==1
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(s.sumfilter2,nil,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
end
function s.disfilter(c,e)
return c:IsFaceup() and c:IsRelateToEffect(e)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(s.disfilter,nil,e)
local tc=g:GetFirst()
if not tc then return end
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
\ No newline at end of file
--纸制Protoform式神
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.discon)
e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EFFECT_SEND_REPLACE)
e2:SetTarget(s.reptg)
e2:SetValue(s.repval)
e2:SetOperation(s.repop)
c:RegisterEffect(e2)
end
--negate
function s.disfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(s.disfilter,1,nil,tp) and Duel.IsChainDisablable(ev)
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--replace
function s.repfilter(c,tp)
return c:IsControler(tp) and c:IsLocation(LOCATION_ONFIELD+LOCATION_DECK+LOCATION_GRAVE) and c:GetDestination()==LOCATION_REMOVED and not c:IsReason(REASON_REPLACE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(s.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function s.repval(e,c)
return s.repfilter(c,e:GetHandlerPlayer())
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT+REASON_REPLACE)
end
\ No newline at end of file
--奇迹的埋火
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--Equip limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--cannot direct attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
c:RegisterEffect(e3)
--atk boost
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_EQUIP)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetCondition(s.adcon)
e4:SetValue(s.atkval)
c:RegisterEffect(e4)
--replace
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EFFECT_DESTROY_REPLACE)
e5:SetRange(LOCATION_SZONE)
e5:SetTarget(s.reptg)
e5:SetValue(s.repval)
c:RegisterEffect(e5)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
--atk boost
function s.adcon(e)
if Duel.GetCurrentPhase()~=PHASE_DAMAGE_CAL then return false end
local eqc=e:GetHandler():GetEquipTarget()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d and (a==eqc or d==eqc)
end
function s.atkval(e,c)
local eqc=e:GetHandler():GetEquipTarget()
local d=Duel.GetAttackTarget()
if eqc==d then d=Duel.GetAttacker() end
return d:GetAttack()/2
end
--replace
function s.desfilter(c)
return c:IsSetCard(0xb) and c:IsAbleToRemove()
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local eqc=c:GetEquipTarget()
if chk==0 then return eqc and eg:IsContains(eqc) and eqc:IsReason(REASON_EFFECT) and not eqc:IsReason(REASON_REPLACE) and eqc:GetReasonPlayer()==1-tp
and eqc:IsAbleToHand() and c:IsAbleToHand()
end
if Duel.SelectEffectYesNo(tp,c,96) then
local val=eqc:GetTextAttack()
if Duel.SendtoHand(Group.FromCards(c,eqc),nil,REASON_EFFECT)>0 and val>0 then
Duel.Damage(1-tp,val,REASON_EFFECT)
end
return true
else
return false
end
end
function s.repval(e,c)
local cc=e:GetHandler()
local eqc=cc:GetEquipTarget()
return eqc and eqc:IsReason(REASON_EFFECT) and not eqc:IsReason(REASON_REPLACE) and eqc:GetReasonPlayer()==1-tp
end
\ No newline at end of file
--小马除错方略
--Scripted by: XGlitchy30
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--count
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_BATTLE_DAMAGE)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
--count
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if ev<=0 then return end
if Duel.GetFlagEffect(ep,id)<=0 then
Duel.RegisterFlagEffect(ep,id,RESET_PHASE+PHASE_END,0,1)
end
Duel.SetFlagEffectLabel(ep,id,Duel.GetFlagEffectLabel(ep,id)+ev)
end
--Activate
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN2 and Duel.GetTurnPlayer()==tp
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(1-tp,id)>0 end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=(Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY) and 2 or 1
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(s.damcon)
e1:SetOperation(s.damop)
e1:SetLabel(ct-1,Duel.GetFlagEffectLabel(1-tp,id))
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,ct)
Duel.RegisterEffect(e1,tp)
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local t,val=e:GetLabel()
if t==1 then
e:SetLabel(0)
else
Duel.Damage(1-tp,val,REASON_EFFECT)
end
end
function GetID()
local str=string.match(debug.getinfo(2,'S')['source'],"c%d+%.lua")
str=string.sub(str,1,string.len(str)-4)
local scard=_G[str]
local s_id=tonumber(string.sub(str,2))
return scard,s_id
end
local s,id=GetID()
function s.initial_effect(c)
--equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--atk/def
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetTarget(s.tg)
e4:SetValue(800)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
--destroy replace
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_DESTROY_REPLACE)
e6:SetRange(LOCATION_SZONE)
e6:SetTarget(s.reptg)
e6:SetValue(s.repval)
c:RegisterEffect(e6)
--spsummon
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetCode(EVENT_FREE_CHAIN)
e7:SetRange(LOCATION_SZONE)
e7:SetCountLimit(1)
e7:SetTarget(s.target)
e7:SetOperation(s.activate)
c:RegisterEffect(e7)
end
function s.tg(e,c)
return c:IsCode(33720003)
end
--destroy replace
function s.repfilter(c)
return c:IsFaceup() and c:IsCode(33720003) and c:IsOnField() and not c:IsReason(REASON_REPLACE)
end
function s.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_DESTROY_CONFIRMED) and e:GetHandler():IsAbleToGrave() and eg:IsExists(s.repfilter,1,nil) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT+REASON_REPLACE)
return true
else
return false
end
end
function s.repval(e,c)
return s.repfilter(c)
end
--spsummon
function s.spcheck(c,e,tp)
local assume_table={ASSUME_TYPE,ASSUME_LEVEL,ASSUME_ATTRIBUTE,ASSUME_RACE,ASSUME_ATTACK,ASSUME_DEFENSE}
local assume_value={TYPE_NORMAL+TYPE_MONSTER,4,ATTRIBUTE_FIRE,RACE_MACHINE,1000,1000}
for i=1,#assume_table do
c:AssumeProperty(assume_table[i],assume_value[i])
end
return c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and s.spcheck(e:GetHandler(),e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and s.spcheck(c,e,tp) then
c:AddMonsterAttribute(TYPE_NORMAL)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_ADD_RACE)
e1:SetValue(RACE_MACHINE)
c:RegisterEffect(e1,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_ADD_ATTRIBUTE)
e3:SetValue(ATTRIBUTE_FIRE)
c:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(1000)
c:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(1000)
c:RegisterEffect(e5,true)
local e6=e1:Clone()
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(4)
c:RegisterEffect(e6,true)
Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
\ No newline at end of file
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