Commit b4bb4dfb authored by mercury233's avatar mercury233

new cards JF19

parent 817a25a8
--星導竜アーミライル
function c36768783.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2)
c:EnableReviveLimit()
--cannot link material
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36768783,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,36768783)
e2:SetTarget(c36768783.sptg)
e2:SetOperation(c36768783.spop)
c:RegisterEffect(e2)
end
function c36768783.spfilter1(c,e,tp,zone,lg)
local lv=c:GetOriginalLevel()
return lv>0 and c:IsFaceup() and lg:IsContains(c) and Duel.IsExistingMatchingCard(c36768783.spfilter2,tp,LOCATION_HAND,0,1,nil,e,tp,lv,zone)
end
function c36768783.spfilter2(c,e,tp,lv,zone)
return c:GetOriginalLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,tp,zone)
end
function c36768783.spfilter_chkc(c,e,tp,lv,lg)
return c:IsFaceup() and lg:IsContains(c) and c:GetOriginalLevel()==lv
end
function c36768783.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local zone=c:GetLinkedZone(tp)
local lg=c:GetLinkedGroup()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c36768783.spfilter_chkc(chkc,e,tp,e:GetLabel(),lg) end
if chk==0 then return Duel.IsExistingTarget(c36768783.spfilter1,tp,LOCATION_MZONE,0,1,nil,e,tp,zone,lg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c36768783.spfilter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp,zone,lg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
e:SetLabel(g:GetFirst():GetOriginalLevel())
end
function c36768783.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
local zone=c:GetLinkedZone(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c36768783.spfilter2,tp,LOCATION_HAND,0,1,1,nil,e,tp,tc:GetOriginalLevel(),zone)
local sc=g:GetFirst()
if sc then
if Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEUP_DEFENSE,zone) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
end
--讃美火
function c373085.initial_effect(c)
--discard oppo deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(373085,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c373085.distg1)
e1:SetOperation(c373085.disop1)
c:RegisterEffect(e1)
--discard self deck
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(373085,1))
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,373085)
e2:SetTarget(c373085.distg2)
e2:SetOperation(c373085.disop2)
c:RegisterEffect(e2)
end
function c373085.distg1(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if chk==0 then return ct>0 and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>=ct and Duel.IsPlayerCanDiscardDeck(1-tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,ct)
end
function c373085.disop1(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ct>0 then
Duel.DiscardDeck(1-tp,ct,REASON_EFFECT)
end
end
function c373085.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if chk==0 then return ct>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=ct and Duel.IsPlayerCanDiscardDeck(tp,ct) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,ct)
end
function c373085.disop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
if ct>0 then
Duel.DiscardDeck(tp,ct,REASON_EFFECT)
end
end
--憑依覚醒
function c62256492.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetValue(c62256492.atkval)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c62256492.target)
e3:SetValue(1)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,62256492)
e4:SetCondition(c62256492.drcon)
e4:SetTarget(c62256492.drtg)
e4:SetOperation(c62256492.drop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function c62256492.atkfilter(c)
return c:IsFaceup() and c:GetAttribute()~=0
end
function c62256492.atkval(e,c)
local g=Duel.GetMatchingGroup(c62256492.atkfilter,c:GetControler(),LOCATION_MZONE,0,nil)
local att=0
local tc=g:GetFirst()
while tc do
att=bit.bor(att,tc:GetAttribute())
tc=g:GetNext()
end
local ct=0
while att~=0 do
if bit.band(att,0x1)~=0 then ct=ct+1 end
att=bit.rshift(att,1)
end
return ct*300
end
function c62256492.target(e,c)
return c:IsSetCard(0xbf) or c:IsSetCard(0xc0)
end
function c62256492.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:GetBaseAttack()==1850
end
function c62256492.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c62256492.cfilter,1,nil,tp)
end
function c62256492.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c62256492.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--相愛のアンブレカム
function c73979030.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(73979030,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c73979030.spcost)
e1:SetTarget(c73979030.sptg)
e1:SetOperation(c73979030.spop)
c:RegisterEffect(e1)
end
function c73979030.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c73979030.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) and c:IsType(TYPE_MONSTER)
end
function c73979030.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c73979030.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c73979030.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c73979030.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c73979030.spop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
Duel.SpecialSummonComplete()
end
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c73979030.splimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function c73979030.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
--金魚救い
function c9251497.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand & todeck or to GY & selfdestroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_SEARCH+CATEGORY_DECKDES+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,9251497)
e2:SetTarget(c9251497.target)
e2:SetOperation(c9251497.operation)
c:RegisterEffect(e2)
end
function c9251497.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and chkc:IsType(TYPE_MONSTER) end
if chk==0 then return Duel.IsExistingTarget(Card.IsType,tp,0,LOCATION_GRAVE,1,nil,TYPE_MONSTER)
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsType,tp,0,LOCATION_GRAVE,1,1,nil,TYPE_MONSTER)
end
function c9251497.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<=0 then return end
Duel.ConfirmDecktop(tp,1)
local tc=Duel.GetFirstTarget()
local g=Duel.GetDecktopGroup(tp,1)
if tc:IsRelateToEffect(e) then
if g:GetFirst():GetAttribute()&tc:GetAttribute()~=0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
else
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
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