Commit cd442171 authored by wyykak's avatar wyykak

fix c74561002.lua

parent 09ea2177
Pipeline #7896 passed with stage
in 1 minute and 21 seconds
--关 灯 杀 ✿ 黑 F --关 灯 杀 ✿ 黑 F
require "expansions/script/nef/darksyn" require "expansions/script/nef/darksyn"
local Heif=74561002 local Heif=74561002
local cHeif=c74561002 local cHeif=c74561002
function cHeif.initial_effect(c) function cHeif.initial_effect(c)
DS.DarkTunerLimit(c) DS.DarkTunerLimit(c)
--Reversion of fight --Reversion of fight
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(Heif,0)) e2:SetDescription(aux.Stringid(Heif,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN) e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,Heif) e2:SetCountLimit(1,Heif)
e2:SetCondition(cHeif.condition) e2:SetCondition(cHeif.condition)
e2:SetCost(cHeif.cost) e2:SetCost(cHeif.cost)
e2:SetOperation(cHeif.operation) e2:SetOperation(cHeif.operation)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--recover --recover
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(Heif,1)) e3:SetDescription(aux.Stringid(Heif,1))
e3:SetCategory(CATEGORY_TOHAND) e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DAMAGE) e3:SetCode(EVENT_DAMAGE)
e3:SetRange(LOCATION_GRAVE) e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,Heif+500) e3:SetCountLimit(1,Heif+500)
e3:SetCondition(cHeif.recon) e3:SetCondition(cHeif.recon)
e3:SetTarget(cHeif.retg) e3:SetTarget(cHeif.retg)
e3:SetOperation(cHeif.reop) e3:SetOperation(cHeif.reop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function cHeif.synlimit(e,c) function cHeif.synlimit(e,c)
if not c:IsSetCard(0x5208) then return true end if not c:IsSetCard(0x5208) then return true end
end end
--Reversion of fight --Reversion of fight
function cHeif.condition(e,tp,eg,ep,ev,re,r,rp) function cHeif.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2 return Duel.GetCurrentPhase() == PHASE_MAIN1 or Duel.GetCurrentPhase() == PHASE_MAIN2
end end
function cHeif.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cHeif.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
if chk==0 then return not c:IsPublic() end if chk==0 then return not c:IsPublic() end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC) e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function cHeif.operation(e,tp,eg,ep,ev,re,r,rp) function cHeif.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
--THROW --THROW
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_PHASE+PHASE_END) e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetOperation(cHeif.tgop) e1:SetOperation(cHeif.tgop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--BECOME_TARGET --BECOME_TARGET
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_DISABLE+CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_DISABLE+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O|EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_QUICK_O|EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_BECOME_TARGET) e2:SetCode(EVENT_BECOME_TARGET)
e2:SetRange(LOCATION_HAND) e2:SetRange(LOCATION_HAND)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCondition(cHeif.descon) e2:SetCondition(cHeif.descon)
e2:SetTarget(cHeif.destg) e2:SetTarget(cHeif.destg)
e2:SetOperation(cHeif.desop) e2:SetOperation(cHeif.desop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--BE_BATTLE_TARGET --BE_BATTLE_TARGET
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_BE_BATTLE_TARGET) e3:SetCode(EVENT_BE_BATTLE_TARGET)
e3:SetTarget(cHeif.destg2) e3:SetTarget(cHeif.destg2)
e3:SetOperation(cHeif.desop2) e3:SetOperation(cHeif.desop2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--THROW --THROW
function cHeif.tgop(e,tp,eg,ep,ev,re,r,rp) function cHeif.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_CARD,0,Heif) Duel.Hint(HINT_CARD,0,Heif)
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
end end
--BECOME_TARGET --BECOME_TARGET
function cHeif.tgfilter(c,tp) function cHeif.tgfilter(c,tp)
return c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp) return c:IsLocation(LOCATION_ONFIELD) and c:IsControler(tp)
end end
function cHeif.descon(e,tp,eg,ep,ev,re,r,rp) function cHeif.descon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and eg:IsExists(cHeif.tgfilter,1,nil,tp) if re then
end return re:GetHandler():IsControler(1-tp) and eg:IsExists(cHeif.tgfilter,1,nil,tp)
function cHeif.destg(e,tp,eg,ep,ev,re,r,rp,chk) else
if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and not e:GetHandler():IsStatus(STATUS_CHAINING) end return Duel.GetAttacker():IsControler(1-tp) and eg:IsExists(cHeif.tgfilter,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) function cHeif.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
function cHeif.desop(e,tp,eg,ep,ev,re,r,rp) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
if Duel.IsExistingMatchingCard(cHeif.rofilter,tp,LOCATION_MZONE,0,1,nil) then Duel.Damage(1-tp,1500,REASON_EFFECT) else Duel.Damage(1-tp,500,REASON_EFFECT) end Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if Duel.NegateActivation(ev) and Duel.GetMZoneCount(tp)>0 then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end
end function cHeif.desop(e,tp,eg,ep,ev,re,r,rp)
end if Duel.IsExistingMatchingCard(cHeif.rofilter,tp,LOCATION_MZONE,0,1,nil) then Duel.Damage(1-tp,1500,REASON_EFFECT) else Duel.Damage(1-tp,500,REASON_EFFECT) end
--BE_BATTLE_TARGET if Duel.NegateActivation(ev) and Duel.GetMZoneCount(tp)>0 then
function cHeif.destg2(e,tp,eg,ep,ev,re,r,rp,chk) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and not e:GetHandler():IsStatus(STATUS_CHAINING) end end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) --BE_BATTLE_TARGET
end function cHeif.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
function cHeif.desop2(e,tp,eg,ep,ev,re,r,rp) if chk==0 then return Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if Duel.IsExistingMatchingCard(cHeif.rofilter,tp,LOCATION_MZONE,0,1,nil) then Duel.Damage(1-tp,1500,REASON_EFFECT) else Duel.Damage(1-tp,500,REASON_EFFECT) end Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
if Duel.NegateAttack() and Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsRelateToEffect(e) then Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) end
end function cHeif.desop2(e,tp,eg,ep,ev,re,r,rp)
end if Duel.IsExistingMatchingCard(cHeif.rofilter,tp,LOCATION_MZONE,0,1,nil) then Duel.Damage(1-tp,1500,REASON_EFFECT) else Duel.Damage(1-tp,500,REASON_EFFECT) end
function cHeif.rofilter(c) if Duel.NegateAttack() and Duel.GetMZoneCount(tp)>0 and e:GetHandler():IsRelateToEffect(e) then
return c:IsCode(30003) Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end end
--recover end
function cHeif.refilter(c) function cHeif.rofilter(c)
return c:IsSetCard(0x5208) return c:IsCode(30003)
end end
function cHeif.recon(e,tp,eg,ep,ev,re,r,rp) --recover
return Duel.IsExistingMatchingCard(cHeif.refilter,tp,LOCATION_MZONE,0,1,nil) and ev>=1000 and bit.band(r,REASON_EFFECT)~=0 function cHeif.refilter(c)
end return c:IsSetCard(0x5208)
function cHeif.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
if chk==0 then return e:GetHandler():IsAbleToHand() end function cHeif.recon(e,tp,eg,ep,ev,re,r,rp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0) return Duel.IsExistingMatchingCard(cHeif.refilter,tp,LOCATION_MZONE,0,1,nil) and ev>=1000 and bit.band(r,REASON_EFFECT)~=0
end end
function cHeif.reop(e,tp,eg,ep,ev,re,r,rp) function cHeif.retg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if e:GetHandler():IsRelateToEffect(e) then if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT) Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.ConfirmCards(1-tp,e:GetHandler()) end
end function cHeif.reop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end 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