Commit 1c55b3de authored by wind2009's avatar wind2009

Update fixed scripts

To f26ed12724dac7198b3a4764e24622e86a1a7f4d
parent 1503a2e1
--月鏡の盾
function c19508728.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(c19508728.target)
e1:SetOperation(c19508728.activate)
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(1)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c19508728.atkcon)
e3:SetOperation(c19508728.atkop)
c:RegisterEffect(e3)
--to deck
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c19508728.tdcon)
e4:SetCost(c19508728.tdcost)
e4:SetTarget(c19508728.tdtg)
e4:SetOperation(c19508728.tdop)
c:RegisterEffect(e4)
end
function c19508728.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c19508728.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c19508728.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
return ec and tc and tc:IsFaceup() and tc:IsControler(1-tp)
end
function c19508728.atkop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
if ec and tc and ec:IsFaceup() and tc:IsFaceup() then
local val=math.max(tc:GetAttack(),tc:GetDefense())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(val+100)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
ec:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
ec:RegisterEffect(e2)
end
end
function c19508728.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c19508728.tdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c19508728.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c19508728.tdop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local opt=Duel.SelectOption(tp,aux.Stringid(19508728,0),aux.Stringid(19508728,1))
Duel.SendtoDeck(e:GetHandler(),nil,opt,REASON_EFFECT)
end
end
--閃術兵器-H.A.M.P.
function c33331231.initial_effect(c)
--special summon rule(on self field)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33331231,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCountLimit(1,33331231+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c33331231.spcon)
e1:SetTarget(c33331231.sptg)
e1:SetOperation(c33331231.spop)
c:RegisterEffect(e1)
--special summon rule(on oppent field)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33331231,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP,1)
e2:SetCountLimit(1,33331231+EFFECT_COUNT_CODE_OATH)
e2:SetCondition(c33331231.spcon2)
e2:SetTarget(c33331231.sptg2)
e2:SetOperation(c33331231.spop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33331231,2))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_BATTLE_DESTROYED)
e3:SetTarget(c33331231.dstg)
e3:SetOperation(c33331231.dsop)
c:RegisterEffect(e3)
end
function c33331231.checkfilter(c)
return c:IsSetCard(0x1115) and c:IsFaceup()
end
function c33331231.sprfilter(c,tp,sp)
return c:IsReleasable(REASON_SPSUMMON) and Duel.GetMZoneCount(tp,c,sp)>0
end
function c33331231.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c33331231.checkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c33331231.sprfilter,tp,LOCATION_MZONE,0,1,nil,tp,tp)
end
function c33331231.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c33331231.sprfilter,tp,LOCATION_MZONE,0,nil,tp,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c33331231.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_SPSUMMON)
end
function c33331231.spcon2(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.IsExistingMatchingCard(c33331231.checkfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c33331231.sprfilter,tp,0,LOCATION_MZONE,1,nil,1-tp,tp)
end
function c33331231.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,c)
local g=Duel.GetMatchingGroup(c33331231.sprfilter,tp,0,LOCATION_MZONE,nil,1-tp,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local tc=g:SelectUnselect(nil,tp,false,true,1,1)
if tc then
e:SetLabelObject(tc)
return true
else return false end
end
function c33331231.dstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c33331231.dsop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--初買い
function c43618262.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c43618262.cftg)
e1:SetOperation(c43618262.cfop)
c:RegisterEffect(e1)
end
function c43618262.cftg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(1-tp,5)
if chk==0 then return g:FilterCount(Card.IsAbleToHand,nil,tp)>0 end
Duel.SetTargetPlayer(tp)
end
function c43618262.cfop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetDecktopGroup(1-p,5)
if g:FilterCount(Card.IsAbleToHand,nil,tp)==0 then return end
Duel.ConfirmDecktop(1-p,5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=g:FilterSelect(tp,Card.IsAbleToHand,1,1,nil,tp):GetFirst()
local num=math.floor(3000/100)
local t={}
for i=1,num do
t[i]=i*100
end
local val=Duel.AnnounceNumber(tp,table.unpack(t))
if Duel.SelectYesNo(1-p,aux.Stringid(43618262,0)) then
if Duel.Recover(1-p,val,REASON_EFFECT)>0 then
Duel.SetLP(tp,Duel.GetLP(tp)-val)
Duel.DisableShuffleCheck(true)
Duel.SendtoHand(tc,p,REASON_EFFECT)
Duel.ConfirmCards(1-p,tc)
Duel.ShuffleHand(p)
end
end
end
--蛇眼の炎龍
local s,id,o=GetID()
function s.initial_effect(c)
--move
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(s.mvtg)
e1:SetOperation(s.mvop)
c:RegisterEffect(e1)
--spsummon spell
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id+o)
e2:SetCondition(s.spscon)
e2:SetTarget(s.spstg)
e2:SetOperation(s.spsop)
c:RegisterEffect(e2)
--spsummon from GY
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,id+o*2)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.filter(c,tp)
local r=LOCATION_REASON_TOFIELD
if not c:IsControler(c:GetOwner()) then r=LOCATION_REASON_CONTROL end
return (c:IsType(TYPE_MONSTER) or c:IsLocation(LOCATION_MZONE)) and c:IsFaceupEx()
and Duel.GetLocationCount(c:GetOwner(),LOCATION_SZONE,tp,r)>0
end
function s.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE+LOCATION_MZONE,LOCATION_GRAVE+LOCATION_MZONE,1,1,nil,tp)
if g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
end
function s.mvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.MoveToField(tc,tp,tc:GetOwner(),LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
function s.spscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==1-tp
end
function s.sfilter(c,e,tp)
return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_SPELL==TYPE_CONTINUOUS+TYPE_SPELL
and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spstg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.sfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(s.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.sfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spsop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND+LOCATION_ONFIELD)
end
function s.ffilter(c,e,tp)
return c:IsLevel(1) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.IsExistingMatchingCard(s.ffilter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133)
or Duel.GetMatchingGroupCount(s.ffilter,tp,LOCATION_GRAVE,0,nil,e,tp)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.ffilter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--オルフェゴール・クリマクス
function c703897.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,703897)
e1:SetCondition(c703897.condition)
e1:SetTarget(aux.nbtg)
e1:SetOperation(c703897.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,703897)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCost(c703897.thcost)
e2:SetTarget(c703897.thtg)
e2:SetOperation(c703897.thop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(703897,ACTIVITY_SPSUMMON,c703897.counterfilter)
end
function c703897.counterfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c703897.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x11b) and c:IsType(TYPE_LINK)
end
function c703897.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c703897.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsChainNegatable(ev) and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function c703897.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c703897.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(703897,tp,ACTIVITY_SPSUMMON)==0
and aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,0) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c703897.splimit)
Duel.RegisterEffect(e1,tp)
aux.bfgcost(e,tp,eg,ep,ev,re,r,rp,1)
end
function c703897.splimit(e,c)
return not (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK))
end
function c703897.thfilter(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function c703897.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c703897.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_REMOVED)
end
function c703897.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c703897.thfilter,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--カードスキャナー
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.tdcon)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_DECK,1,nil,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
Duel.SetTargetParam(Duel.AnnounceType(tp))
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 or Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end
local sc=Duel.GetFieldCard(tp,LOCATION_DECK,0)
local oc=Duel.GetFieldCard(1-tp,LOCATION_DECK,0)
Duel.ConfirmCards(tp,sc)
Duel.ConfirmCards(1-tp,sc)
Duel.ConfirmCards(tp,oc)
Duel.ConfirmCards(1-tp,oc)
local op=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if sc:IsType(1<<op) then
Duel.DisableShuffleCheck()
Duel.SendtoHand(sc,nil,REASON_EFFECT)
else Duel.MoveSequence(sc,SEQ_DECKTOP) end
if oc:IsType(1<<op) then
Duel.DisableShuffleCheck()
Duel.SendtoHand(oc,nil,REASON_EFFECT,1-tp)
else Duel.MoveSequence(oc,SEQ_DECKTOP) end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE)
and rp==1-tp and c:IsReason(REASON_EFFECT)
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,1-tp,LOCATION_HAND)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):Select(1-tp,1,1,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKBOTTOM,REASON_RULE)
end
No preview for this file type
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