Commit f05d779e authored by 聖園ミカ's avatar 聖園ミカ 🐟

byd

parent efe25187
Pipeline #30183 passed with stages
in 25 minutes and 45 seconds
......@@ -26,8 +26,8 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCondition(s.tgcon)
e1:SetOperation(s.tgop)
e1:SetCondition(s.con)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
--quick
local e2=Effect.CreateEffect(c)
......@@ -40,7 +40,34 @@ function s.regop(e,tp,eg,ep,ev,re,r,rp)
c:RegisterEffect(e2)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,5))
end
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return bit.band(loc,LOCATION_ONFIELD)~=0 and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and (Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,1,nil))
end
function s.cfilter(c)
return c:IsOnField() or c:IsAbleToDeck()
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectEffectYesNo(tp,e:GetHandler()) then return end
Duel.Hint(HINT_CARD,0,5013355)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,s.repop)
end
function s.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectMatchingCard(1-tp,s.cfilter,1-tp,LOCATION_ONFIELD,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND,1,1,nil):GetFirst()
if not tc then return end
if not tc:IsOnField() or not Duel.SelectYesNo(1-tp,aux.Stringid(5013355,0)) then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
else
Duel.Destroy(tc,REASON_EFFECT)
end
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and ((re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE) or re:IsActiveType(EFFECT_TYPE_ACTIVATE))
end
......@@ -48,7 +75,8 @@ function s.defilter(c)
return c:IsAbleToDeck() or c:IsLocation(LOCATION_ONFIELD)
end
function s.frepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY)
--Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_DESTROY)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,s.defilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
local tc=g:GetFirst()
if tc:IsAbleToDeck() and (not tc:IsLocation(LOCATION_ONFIELD) or Duel.SelectOption(tp,aux.Stringid(id,4),1105)==1) then
......
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