Commit 4cd4df3a authored by Amiya's avatar Amiya

新卡以及修复

parent a05d043d
......@@ -13,10 +13,10 @@ end
function s.thfilter1(c,tp)
local no=aux.GetXyzNumber(c)
return no and no>=101 and no<=107 and c:IsSetCard(0x48) and c:IsType(TYPE_XYZ) and not c:IsPublic()
and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil,c)
and Duel.IsExistingMatchingCard(s.thfilter2,tp,LOCATION_DECK,0,1,nil,c:GetAttribute(),c:GetRace(),c:GetRank())
end
function s.thfilter2(c,mc)
return (c:IsRace(mc:GetRace()) or c:IsAttribute(mc:GetAttribute())) and c:IsLevel(mc:GetRank())
function s.thfilter2(c,att,race,rk)
return (c:IsRace(race) or c:IsAttribute(att)) and c:IsLevel(rk)
and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -25,14 +25,14 @@ function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,s.thfilter1,tp,LOCATION_EXTRA,0,1,1,nil,tp)
local tc=g:GetFirst()
Duel.ConfirmCards(1-tp,tc)
e:SetLabelObject(tc)
e:SetLabel(tc:GetAttribute(),tc:GetRace(),tc:GetRank())
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local att,race,rk=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil,tc)
local g=Duel.SelectMatchingCard(tp,s.thfilter2,tp,LOCATION_DECK,0,1,1,nil,att,race,rk)
local tc2=g:GetFirst()
if tc2 and Duel.SendtoHand(tc2,nil,REASON_EFFECT)~=0 and tc2:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,tc2)
......
--嘆きの石版
function s.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_EQUIP)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e0:SetTarget(s.target)
e0:SetOperation(s.activate)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_UNRELEASABLE_SUM)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,1))
e5:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(s.thcon)
e5:SetTarget(s.thtg)
e5:SetOperation(s.thop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,2))
e6:SetCategory(CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetCondition(s.damcon)
e6:SetTarget(s.damtg)
e6:SetOperation(s.damop)
c:RegisterEffect(e6)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.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() and tc:IsControler(1-tp) then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function s.thcon(e)
local c=e:GetHandler()
local tc=c:GetEquipTarget()
return tc and c:GetControler()==tc:GetControler()
end
function s.thfilter(c)
return not c:IsCode(id) and c:IsSetCard(0x2b8) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function s.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return ec and c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY)
end
function s.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
end
function s.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
\ No newline at end of file
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