Commit ea11b3c6 authored by Tachibana's avatar Tachibana

ybb

parent 4c5cbcdb
No preview for this file type
......@@ -2,10 +2,11 @@
function c33200449.initial_effect(c)
--send to grave
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,33200449)
e1:SetTarget(c33200449.sptg)
e1:SetOperation(c33200449.spop)
......
--传说之魂 缜密
if not pcall(function() require("expansions/script/c33301000") end) then require("script/c33301000") end
local m=33350022
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit()
local e1=rsef.I(c,{m,0},1,"se,th",nil,LOCATION_MZONE,nil,rscost.rmxyz(1),rstg.target2(cm.fun,rsop.list(cm.thfilter,"th",LOCATION_DECK)),cm.thop)
local e2=rsef.SC(c,EVENT_SPSUMMON_SUCCESS,nil,nil,"cd",rscon.sumtype("xyz",cm.cfilter),cm.op)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(EFFECT_UPDATE_ATTACK)
e0:SetValue(function(e,c)
local og=c:GetOverlayGroup()
if og:GetCount()>0 then
return og:GetSum(Card.GetLevel)*300
else
return 0
end
end
)
c:RegisterEffect(e0)
local e0_1=e0:Clone()
e0_1:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e0_1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(2)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
cm.setname="TaleSouls"
function cm.cfilter(c,e,tp,re,rp,mat)
return #mat>0 and mat:IsExists(Card.IsCode,1,nil,33350016)
end
function cm.op(e,tp)
local e3=rsef.I({e:GetHandler()},{m,1},1,"rm","tg",LOCATION_MZONE,nil,nil,rstg.target(Card.IsFaceup,nil,LOCATION_ONFIELD,LOCATION_ONFIELD),cm.tgop)
e3:SetReset(rsreset.est)
end
function cm.tgop(e,tp)
local tc=rscf.GetTargetCard()
if not tc then return end
if Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)<=0 then
Duel.Remove(tc,POS_FACEUP,REASON_RULE)
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local a=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil)
if chk==0 then return c:IsAttackAbove(500) and (a or b) end
local op=2
if a and b then
op=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b then
op=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else
op=Duel.SelectOption(tp,aux.Stringid(m,1))
end
Duel.SetTargetParam(op+1)
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
else
e:SetCategory(CATEGORY_TOHAND)
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,0)
end
end
function cm.fun(g,e,tp)
rshint.Select(tp,"tg")
local tg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SendtoGrave(tg,REASON_COST)
end
function cm.thfilter(c,e,tp)
return c:IsAbleToHand() and c.setname=="TaleSouls" and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,c,e,tp)
end
function cm.tgfilter(c,e,tp)
return c.setname=="TaleSouls" and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(cm.thfilter2,tp,LOCATION_DECK,0,1,c)
function cm.check(c,e,tp)
if not c:IsAttack(500) then return false end
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and (c:IsAbleToHand() or c:IsCanBeSpecialSummoned(e,0,tp,false,false))
end
function cm.thfilter2(c,e,tp)
return c:IsAbleToHand() and c.setname=="TaleSouls"
function cm.thcheck(c)
return c:IsAbleToHand()
end
function cm.thop(e,tp)
rshint.Select(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
function cm.op(e,tp)
local rm=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local c=e:GetHandler()
if rm==1 then
if not c:IsRelateToEffect(e) or c:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
if c:IsAttackAbove(500) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-500)
c:RegisterEffect(e1)
if c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
return
end
local g=Duel.GetMatchingGroup(cm.check,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e,tp)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,5)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local tg=g:Select(tp,1,1,nil)
local rc=tg:GetFirst()
local a=rc:IsAbleToHand()
local b=rc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local op=0
if a and b then
op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
elseif b then
op=Duel.SelectOption(tp,aux.Stringid(m,4))+1
else
op=Duel.SelectOption(tp,aux.Stringid(m,3))
end
if op==0 then
Duel.SendtoHand(rc,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,rc)
else
Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEUP)
end
end
end
elseif rm==2 then
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if c:IsAttackAbove(500) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-500)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local rg=Duel.SelectMatchingCard(tp,cm.thcheck,tp,0,LOCATION_ONFIELD,1,1,nil)
if rg:GetCount()>0 then
Duel.HintSelection(rg)
Duel.SendtoHand(rg,nil,REASON_EFFECT)
end
end
end
end
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