Commit efd59f65 authored by 未闻皂名's avatar 未闻皂名

2021/10/10 新增:学人新卡,修复bug

parent 8ababfdb
Pipeline #6198 passed with stages
in 4 minutes and 21 seconds
No preview for this file type
local m=120199015
local cm=_G["c"..m]
cm.name="鬼将 醒"
function cm.initial_effect(c)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
--To Hand
function cm.confilter(c)
return c:IsFaceup() and c:IsAttackAbove(2500)
end
function cm.thfilter(c)
return c:IsLevelAbove(7) and c:IsRace(RACE_WARRIOR) and c:IsAbleToHand()
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_SUMMON) and c:IsStatus(STATUS_SUMMON_TURN)
and Duel.IsExistingMatchingCard(cm.confilter,tp,0,LOCATION_MZONE,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Duel.GetFlagEffect(tp,m)~=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
--Hint
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
function cm.atktg(e,c)
return RushDuel.IsHasDefense(c) and c:IsDefenseBelow(1900)
end
\ No newline at end of file
local m=120199043
local cm=_G["c"..m]
cm.name="五家的加护"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
--Activate
function cm.confilter(c)
return c:IsFaceup() and c:IsRace(RACE_WARRIOR+RACE_FAIRY+RACE_BEAST+RACE_WINDBEAST+RACE_REPTILE)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,1))
local g=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,2,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,2))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(cm.indval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
function cm.indval(e,re,rp)
return rp==1-e:GetHandlerPlayer() and re:IsActiveType(TYPE_TRAP)
end
\ No newline at end of file
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 if Duel.Draw(p,d,REASON_EFFECT)~=0
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_FZONE,LOCATION_FZONE,1,nil)
and Duel.IsPlayerCanDraw(tp,1) and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
......
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