Commit fd520208 authored by Tachibana's avatar Tachibana

1145141919810

parent 6d396837
No preview for this file type
--黑圆桌·穿刺公
xpcall(function() require("expansions/script/c12300000") end,
function() require("script/c12300000") end)
c12300009.mon=true
function c12300009.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(12300009,0))
e0:SetCategory(CATEGORY_LEAVE_GRAVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetOperation(c12300009.acop)
e0:SetCountLimit(1,12300019+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e0)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12300009,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCost(c12300009.spcost)
e2:SetTarget(c12300009.sptg)
e2:SetOperation(c12300009.spop)
e2:SetCountLimit(1,12300009)
c:RegisterEffect(e2)
--tofield
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(12300009,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_MZONE+LOCATION_HAND)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c12300009.rscon)
e3:SetTarget(c12300009.rstg)
e3:SetOperation(c12300009.rsop)
e3:SetCountLimit(1,12300029)
c:RegisterEffect(e3)
end
--ac
function c12300009.filac(c,e,tp)
if c:IsControler(tp) and not c:IsSetCard(0x2d3) then return false end
if c:IsType(TYPE_MONSTER) then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,nil,tp,false,false,POS_FACEDOWN_DEFENSE,tp)
else return c:IsSSetable() and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
end
end
function c12300009.seleop(e,tp)
local off=1
local ops={}
local opval={}
if Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) then
ops[off]=aux.Stringid(12300009,3)
opval[off-1]=1
off=off+1
end
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c12300009.filac),tp,LOCATION_GRAVE,0,nil,e,tp)
local tc=Duel.GetFieldCard(1-tp,LOCATION_GRAVE,Duel.GetFieldGroupCount(1-tp,LOCATION_GRAVE,0)-1)
if tc and c12300009.filac(tc,e,tp) then tg:AddCard(tc) end
if tg:GetCount()>0 then
ops[off]=aux.Stringid(12300009,4)
opval[off-1]=2
off=off+1
end
ops[off]=aux.Stringid(12300009,5)
opval[off-1]=3
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local mg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,3,nil)
if mg then return Duel.Remove(mg,POS_FACEUP,REASON_EFFECT) end
elseif sel==2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local mg=Duel.SelectMatchingCard(tp,c12300009.filset,tp,LOCATION_DECK,0,1,1,nil)
if mg then
tg=tg:Select(tp,1,1,nil)
if not tg then return end
local dc=tg:GetFirst()
if dc:IsType(TYPE_MONSTER) and Duel.SpecialSummon(dc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(0,dc)
return 1
elseif dc:IsType(TYPE_FIELD) and Duel.GetFieldCard(tp,LOCATION_FZONE,0) then
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
return Duel.SSet(tp,dc)
end
end
return false
end
function c12300009.acop(e,tp,eg,ep,ev,re,r,rp)
if c12300009.seleop(e,tp) then Duel.RegisterFlagEffect(tp,12300009,RESET_EVENT+RESET_PHASE+PHASE_END,0,1) end
end
function c12300009.splimit(e,c)
return not c:IsSetCard(0x2d3)
end
--sp
function c12300009.filspco(c)
return c:IsSetCard(0x2d3) and c:IsFaceup() and c:IsCanTurnSet()
end
function c12300009.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(c12300009.filspco,tp,LOCATION_ONFIELD,0,1,nil)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local rg=Duel.SelectMatchingCard(tp,c12300009.filspco,tp,LOCATION_ONFIELD,0,1,1,nil)
if rg then Duel.ChangePosition(rg,POS_FACEDOWN_DEFENSE) end
end
function c12300009.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Ldo.spsumble(e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,e:GetHandlerPlayer(),e:GetHandler():GetLocation())
end
function c12300009.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Ldo.spsumble(c,tp) then
Ldo.spsum(c,tp)
end
end
--tofield
function c12300009.filrs(c,tp)
return c:IsLocation(LOCATION_GRAVE) and not c:IsControler(tp)
--and c:GetReasonPlayer()==tp
end
function c12300009.rscon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c12300009.filrs,1,nil,tp) and Duel.GetFlagEffect(tp,12300009)==0 and (e:GetHandler():IsType(TYPE_EFFECT) or e:GetHandler():IsLocation(LOCATION_HAND))
end
function c12300009.rstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsLocation(LOCATION_MZONE) then
local cat=e:GetCategory()
e:SetCategory(cat+CATEGORY_REMOVE)
end
end
function c12300009.rsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chk=c:IsLocation(LOCATION_MZONE)
if not c:IsRelateToEffect(e) then return end
if not Ldo.tf(e,c,tp) or not chk then return end
Duel.BreakEffect()
c12300009.seleop(e,tp)
end
\ No newline at end of file
--黑圆桌·乌金太子
xpcall(function() require("expansions/script/c12300000") end,
function() require("script/c12300000") end)
c12300012.mon=true
function c12300012.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12300012,3))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(aux.FALSE)
e1:SetOperation(c12300012.acop)
c:RegisterEffect(e1)
--set cost
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12300012,1))
e2:SetRange(LOCATION_HAND)
e2:SetCategory(CATEGORY_LEAVE_GRAVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_MAIN_END+TIMING_END_PHASE)
e2:SetCost(c12300012.sccs)
e2:SetCountLimit(1,12300032)
e2:SetOperation(c12300012.scop)
c:RegisterEffect(e2)
--se cost (mon)
local e3=e2:Clone()
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c12300012.mecon)
c:RegisterEffect(e3)
--revive
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12300012,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_GRAVE+LOCATION_HAND)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetTarget(c12300012.sstg)
e4:SetValue(c12300012.ssval)
e4:SetCountLimit(1,12300042)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SPSUMMON_COST)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCost(c12300012.spcost)
c:RegisterEffect(e5)
end
function c12300012.filter(c,e,tp)
if not c:IsSetCard(0x2d3) then return false
elseif c:IsType(TYPE_MONSTER) then
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
elseif c:IsType(TYPE_FIELD) and c.mon then
return Ldo.spsumble(c,tp) end
return false
end
function c12300012.acop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c12300012.filter,tp,LOCATION_DECK,0,nil,e,tp)
if #mg<1 or not Duel.SelectYesNo(tp,aux.Stringid(12300012,2)) then
return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=mg:Select(tp,1,1,nil):GetFirst()
if tc then
local tr=false
if tc:IsType(TYPE_FIELD) then
tr=true
tc:AddMonsterAttribute(TYPE_EFFECT+TYPE_MONSTER)
end
Duel.SpecialSummon(tc,0,tp,tp,tr,false,POS_FACEUP)
end
--zisu
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetTargetRange(1,0)
e2:SetTarget(c12300012.splimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c12300012.splimit(e,c)
return not c:IsSetCard(0x2d3)
end
function c12300012.mecon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsType(TYPE_EFFECT)
end
function c12300012.costact(c,ec,g)
return c:IsSetCard(0x2d3) and c:IsReleasable()
and (c~=ec or g:IsExists(c12300000.filnotcode,1,nil,c:GetCode()))
end
function c12300012.sccs(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12300000.filfld,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c12300012.costact,tp,LOCATION_ONFIELD,0,1,nil,c,g) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local cg=Duel.SelectMatchingCard(tp,c12300012.costact,tp,LOCATION_ONFIELD,0,1,1,nil,c,g)
Duel.Release(cg,REASON_COST)
e:SetLabel(cg:GetFirst():GetCode())
end
function c12300012.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c12300000.filfld,tp,LOCATION_GRAVE,0,nil)
if g then g=g:Filter(c12300000.filnotcode,nil,e:GetLabel()) end
e:SetLabel(nil)
if c:IsRelateToEffect(e) then g:AddCard(c) end
if #g<1 then return end
local tc=nil
if #g==1 then tc=g:GetFirst()
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
tc=g:Select(tp,1,1,nil):GetFirst()
end
Ldo.tf(e,tc,tp)
end
--
function c12300012.filss(c,tp)
return c:IsSetCard(0x2d3) and c:IsControler(tp) and c:IsFaceup() and not c:IsReason(REASON_REPLACE)
end
function c12300012.sstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Ldo.spsumble(c,tp)
and eg:IsExists(c12300012.filss,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96) and Ldo.spsum(c,tp)>0
end
function c12300012.ssval(e,c)
return c12300012.filss(c,e:GetHandlerPlayer())
end
--
function c12300012.spfil(c)
return c:IsSetCard(0x2d3) and (c:IsType(TYPE_MONSTER) or c:IsType(TYPE_FIELD))
end
function c12300012.spcost(e,c,tp,sumtype)
local g=Duel.GetMatchingGroup(c12300012.spfil,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>4
end
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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