Commit a48a1152 authored by mercury233's avatar mercury233 Committed by GitHub

update ファラオの審判 (#2106)

parent c39fb098
--ファラオの審判 --ファラオの審判
function c55948544.initial_effect(c) function c55948544.initial_effect(c)
--Activate (YU-JYO) --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(55948544,0))
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c55948544.condition1)
e1:SetCost(c55948544.cost) e1:SetCost(c55948544.cost)
e1:SetOperation(c55948544.operation1) e1:SetTarget(c55948544.target)
e1:SetOperation(c55948544.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Activate (UNITY)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55948544,1))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCondition(c55948544.condition2)
e2:SetCost(c55948544.cost)
e2:SetOperation(c55948544.operation2)
c:RegisterEffect(e2)
end
function c55948544.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,81332143)
end end
function c55948544.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c55948544.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2)) Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end end
function c55948544.operation1(e,tp,eg,ep,ev,re,r,rp) function c55948544.target(e,tp,eg,ep,ev,re,r,rp,chk)
if not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,81332143) then return end local b1=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,81332143)
local b2=Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,14731897)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,
{b1,aux.Stringid(55948544,0)},
{b2,aux.Stringid(55948544,1)})
e:SetLabel(op)
end
function c55948544.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local op=e:GetLabel()
if op==1 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,81332143) then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
...@@ -71,25 +67,8 @@ function c55948544.operation1(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,25 +67,8 @@ function c55948544.operation1(e,tp,eg,ep,ev,re,r,rp)
e8:SetOperation(c55948544.disop) e8:SetOperation(c55948544.disop)
e8:SetReset(RESET_PHASE+PHASE_END) e8:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e8,tp) Duel.RegisterEffect(e8,tp)
end end
function c55948544.aclimit1(e,re,tp) if op==2 and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,14731897) then
return re:IsActiveType(TYPE_MONSTER)
end
function c55948544.distg1(e,c)
return c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0
end
function c55948544.discon1(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp
end
function c55948544.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c55948544.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,14731897)
end
function c55948544.operation2(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_GRAVE,0,1,nil,14731897) then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SSET) e1:SetCode(EFFECT_CANNOT_SSET)
...@@ -125,6 +104,16 @@ function c55948544.operation2(e,tp,eg,ep,ev,re,r,rp) ...@@ -125,6 +104,16 @@ function c55948544.operation2(e,tp,eg,ep,ev,re,r,rp)
e5:SetOperation(c55948544.disop) e5:SetOperation(c55948544.disop)
e5:SetReset(RESET_PHASE+PHASE_END) e5:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e5,tp) Duel.RegisterEffect(e5,tp)
end
end
function c55948544.aclimit1(e,re,tp)
return re:IsActiveType(TYPE_MONSTER)
end
function c55948544.distg1(e,c)
return c:IsType(TYPE_EFFECT) or c:GetOriginalType()&TYPE_EFFECT~=0
end
function c55948544.discon1(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp
end end
function c55948544.aclimit2(e,re,tp) function c55948544.aclimit2(e,re,tp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
...@@ -135,3 +124,6 @@ end ...@@ -135,3 +124,6 @@ end
function c55948544.discon2(e,tp,eg,ep,ev,re,r,rp) function c55948544.discon2(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp==1-tp return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and rp==1-tp
end end
function c55948544.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
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