Commit 38dba895 authored by Amiya's avatar Amiya

修复

parent 886c1631
No preview for this file type
...@@ -75,6 +75,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -75,6 +75,7 @@ function s.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function s.spop2(e,tp,eg,ep,ev,re,r,rp) function s.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc) if tc:IsRelateToChain() and aux.NecroValleyFilter()(tc)
and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
......
...@@ -4,7 +4,7 @@ function s.initial_effect(c) ...@@ -4,7 +4,7 @@ function s.initial_effect(c)
--special summon --special summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_HAND) e1:SetCode(EVENT_TO_HAND)
......
...@@ -25,17 +25,17 @@ function s.initial_effect(c) ...@@ -25,17 +25,17 @@ function s.initial_effect(c)
e2:SetValue(1) e2:SetValue(1)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--control --control
local e2=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e3:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_CONTROL) e3:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED) e3:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,id+o) e3:SetCountLimit(1,id+o)
e2:SetCondition(s.ctcon) e3:SetCondition(s.ctcon)
e2:SetTarget(s.cttg) e3:SetTarget(s.cttg)
e2:SetOperation(s.ctop) e3:SetOperation(s.ctop)
c:RegisterEffect(e2) c:RegisterEffect(e3)
end end
function s.ffilter(c) function s.ffilter(c)
return c:IsFusionSetCard(0x2d4) return c:IsFusionSetCard(0x2d4)
...@@ -45,13 +45,13 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,13 +45,13 @@ function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>2 end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFacedown,tp,0,LOCATION_EXTRA,1,nil) end
end end
function s.spfilter(c,e,tp) function s.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function s.spop(e,tp,eg,ep,ev,re,r,rp) function s.spop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA) local hg=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA):Filter(Card.IsFacedown,nil)
local g=hg:RandomSelect(tp,2) local g=hg:RandomSelect(tp,2)
if g:GetCount()<1 then return end if g:GetCount()<1 then return end
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
...@@ -85,6 +85,6 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -85,6 +85,6 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,ct,nil) local g=Duel.SelectMatchingCard(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,ct,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.GetControl(tg,tp,PHASE_END) Duel.GetControl(g,tp)
end end
end end
\ No newline at end of file
...@@ -13,7 +13,7 @@ function s.initial_effect(c) ...@@ -13,7 +13,7 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.cfilter(c) function s.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end end
function s.filter0(c) function s.filter0(c)
return c:IsOnField() and c:IsAbleToRemove() return c:IsOnField() and c:IsAbleToRemove()
...@@ -72,7 +72,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -72,7 +72,7 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
e:SetLabel(op) e:SetLabel(op)
if op==1 then if op==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,s.cfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
if e:IsCostChecked() then if e:IsCostChecked() then
e:SetCategory(CATEGORY_TOHAND) e:SetCategory(CATEGORY_TOHAND)
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
......
--あないみじや玉の緒ふたつ
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
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(s.eqlimit)
c:RegisterEffect(e2)
--destroy
local custom_code=aux.RegisterMergedDelayedEvent_ToSingleCard(c,id,EVENT_SPSUMMON_SUCCESS)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(custom_code)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCondition(s.descon)
e3:SetTarget(s.destg)
e3:SetOperation(s.desop)
c:RegisterEffect(e3)
end
function s.eqlimit(e,c)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsControler(e:GetHandlerPlayer())
end
function s.eqfilter(c,tp)
return c:IsFaceup() and c:IsSummonLocation(LOCATION_EXTRA)
and c:IsControler(tp)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.eqfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToChain() and tc:IsRelateToChain() and tc:IsControler(tp) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function s.desfilter(c,tp,e,ec)
return c:IsSummonLocation(LOCATION_EXTRA) and c:IsLocation(LOCATION_MZONE) and c:IsSummonPlayer(1-tp)(1-tp) and c:IsCanBeEffectTarget(e) and c:IsFaceup()
and c:IsAttackAbove(ec:GetAttack()+1)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and eg:IsExists(s.desfilter,1,nil,tp,e,ec)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
local g=eg:Filter(s.desfilter,nil,tp,e,ec)
if chkc then return g:IsContains(chkc) end
if chk==0 then return #g>0 end
local sg
if g:GetCount()==1 then
sg=g:Clone()
Duel.SetTargetCard(sg)
else
Duel.Hint(HINTMSG_DESTROY,tp,HINTMSG_DESTROY)
sg=Duel.SelectTarget(tp,aux.IsInGroup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,g)
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,1,0,0)
if sg:GetFirst():IsFaceup() and math.max(0,sg:GetFirst():GetTextAttack())>0 then
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
local tc=Duel.GetFirstTarget()
local g=Group.FromCards(ec,tc)
if tc:IsRelateToChain() and tc:IsType(TYPE_MONSTER) and Duel.Destroy(g,REASON_EFFECT)~=0 then
local sg=Duel.GetOperatedGroup()
local atk=0
for dc in aux.Next(sg) do
atk=atk+math.max(0,dc:GetTextAttack())
end
if atk>0 then
Duel.Damage(tp,atk,REASON_EFFECT)
Duel.BreakEffect()
Duel.Damage(1-tp,atk,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