Commit 4b2c7829 authored by fallenstardust's avatar fallenstardust

修改脚本密码

parent dd9a6c38
--Dissonance de Tistina --Étreinte de Tistina
--Coded by Lee --Coded by Lee
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--remove 1 card --activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--change position
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_REMOVE) e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.condition) e1:SetCondition(s.cpcon)
e1:SetTarget(s.target) e1:SetTarget(s.cptg)
e1:SetOperation(s.activate) e1:SetOperation(s.cpop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--remove all --control
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE) e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_ACTIVATE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1,id) e2:SetRange(LOCATION_SZONE)
e2:SetCondition(s.recon) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(s.retg) e2:SetCountLimit(1,id+o)
e2:SetOperation(s.reop) e2:SetCondition(s.ctcon)
e2:SetTarget(s.cttg)
e2:SetOperation(s.ctop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id)
e3:SetCost(aux.bfgcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end end
function s.filter(c) function s.cfilter(c)
return c:IsSetCard(0x1a4) return c:IsFaceup() and c:IsSetCard(0x1a4) and c:IsDefenseAbove(3000)
end end
function s.filter1(c,tp) function s.cpcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsAbleToRemove(tp,POS_FACEDOWN) local c=e:GetHandler()
return rp==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function s.condition(e,tp,eg,ep,ev,re,r,rp) function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) local tc=re:GetHandler()
if chk==0 then return tc:IsCanChangePosition() and tc:IsRelateToEffect(re) and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
end end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) function s.cpop(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,0,LOCATION_GRAVE,1,nil,tp) end local tc=Duel.GetFirstTarget()
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE) if tc and tc:IsRelateToEffect(e) then
end Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.filter1,tp,0,LOCATION_GRAVE,1,1,nil,tp)
if #g>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end end
end end
function s.refilter(c) function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsSetCard(0x1a4) and c:IsSummonLocation(LOCATION_EXTRA) return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,0,LOCATION_GRAVE,1,nil,tp) end
local g=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE)
end
function s.reop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil,tp)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end end
function s.thfilter(c) function s.filter(c,tp)
return c:IsSetCard(0x1a4) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() return c:IsFacedown() and c:IsControler(1-tp) and c:IsControlerCanBeChanged()
end end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return s.thfilter(chkc) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp)
local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function s.thop(e,tp,eg,ep,ev,re,r,rp) function s.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.GetControl(tc,tp)
end end
end end
\ No newline at end of file
--Étreinte de Tistina --Dissonance de Tistina
--Coded by Lee --Coded by Lee
local s,id,o=GetID() local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--activate --remove 1 card
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--change position
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_POSITION) e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id) e1:SetCountLimit(1,id)
e1:SetCondition(s.cpcon) e1:SetCondition(s.condition)
e1:SetTarget(s.cptg) e1:SetTarget(s.target)
e1:SetOperation(s.cpop) e1:SetOperation(s.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--control --remove all
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1)) e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_CONTROL) e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_PHASE+PHASE_END) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE) e2:SetCountLimit(1,id)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetCondition(s.recon)
e2:SetCountLimit(1,id+o) e2:SetTarget(s.retg)
e2:SetCondition(s.ctcon) e2:SetOperation(s.reop)
e2:SetTarget(s.cttg)
e2:SetOperation(s.ctop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,id)
e3:SetCost(aux.bfgcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end end
function s.cfilter(c) function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0x1a4) and c:IsDefenseAbove(3000) return c:IsSetCard(0x1a4)
end end
function s.cpcon(e,tp,eg,ep,ev,re,r,rp) function s.filter1(c,tp)
local c=e:GetHandler() return c:IsAbleToRemove(tp,POS_FACEDOWN)
return rp==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
and Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function s.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler() return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return tc:IsCanChangePosition() and tc:IsRelateToEffect(re) and tc:IsCanBeEffectTarget(e) end
Duel.SetTargetCard(tc)
end end
function s.cpop(e,tp,eg,ep,ev,re,r,rp) function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFirstTarget() if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,0,LOCATION_GRAVE,1,nil,tp) end
if tc and tc:IsRelateToEffect(e) then Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE) end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,s.filter1,tp,0,LOCATION_GRAVE,1,1,nil,tp)
if #g>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end end
end end
function s.ctcon(e,tp,eg,ep,ev,re,r,rp) function s.refilter(c)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) return c:IsSetCard(0x1a4) and c:IsSummonLocation(LOCATION_EXTRA)
end
function s.recon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,tp,0,LOCATION_GRAVE,1,nil,tp) end
local g=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE)
end
function s.reop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.filter1,tp,0,LOCATION_GRAVE,nil,tp)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end end
function s.filter(c,tp) function s.thfilter(c)
return c:IsFacedown() and c:IsControler(1-tp) and c:IsControlerCanBeChanged() return c:IsSetCard(0x1a4) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end end
function s.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc,tp) end if chkc then return s.thfilter(chkc) and chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,0,LOCATION_MZONE,1,nil,tp) end if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_MZONE,1,1,nil,tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) local g=Duel.SelectTarget(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function s.ctop(e,tp,eg,ep,ev,re,r,rp) function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.GetControl(tc,tp) Duel.SendtoHand(tc,nil,REASON_EFFECT)
end 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