Commit b90f2319 authored by POLYMER's avatar POLYMER

fix

parent 1a8fab0f
No preview for this file type
--冥魂城
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103016
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(0,1)
e2:SetCondition(cm.actcon)
e2:SetValue(cm.aclimit)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetCondition(cm.atkcon)
e3:SetTarget(cm.atktg)
e3:SetValue(cm.atkval)
c:RegisterEffect(e3)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x337) and c:IsControler(tp)
end
function cm.actcon(e)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and cm.cfilter(a,tp)) or (d and cm.cfilter(d,tp))
end
function cm.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function cm.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL
end
function cm.atktg(e,c)
local tp=e:GetHandlerPlayer()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a and cm.cfilter(a,tp) and a==c) or (d and cm.cfilter(d,tp) and d==c)
end
function cm.atkval(e,c)
local d=Duel.GetAttackTarget()
if c:GetFlagEffect(m)~=0 then return 800 end
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
return 800
end
\ No newline at end of file
...@@ -38,31 +38,41 @@ end ...@@ -38,31 +38,41 @@ end
function c11561066.atkval(e,c) function c11561066.atkval(e,c)
return Duel.GetCounter(c:GetControler(),1,1,0x1)*500 return Duel.GetCounter(c:GetControler(),1,1,0x1)*500
end end
function c11561066.mfilter(c) function c11561066.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceupEx() return (c:IsType(0x6) and c:IsAbleToRemove()) or (c:IsType(TYPE_MONSTER) and c:IsFaceupEx())
end
function c11561066.sfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end end
function c11561066.zmtg(e,tp,eg,ep,ev,re,r,rp,chk) function c11561066.zmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11561066.mfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) or Duel.IsExistingMatchingCard(c11561066.sfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c11561066.cfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
end end
function c11561066.zmop(e,tp,eg,ep,ev,re,r,rp) function c11561066.zmop(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(c11561066.mfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(c11561066.cfilter,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(aux.NecroValleyFilter(c11561066.sfilter),tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,nil)
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=g1:Select(tp,1,1,nil):GetFirst() local tc=g:Select(tp,1,1,nil):GetFirst()
Duel.HintSelection(Group.FromCards(tc)) Duel.HintSelection(Group.FromCards(tc))
local e1=Effect.CreateEffect(e:GetHandler()) if tc:IsType(TYPE_MONSTER) then
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EVENT_CHAIN_SOLVED) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCountLimit(1) e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetCountLimit(1)
e1:SetLabelObject(tc) e1:SetLabelObject(tc)
e1:SetCondition(c11561066.condition) e1:SetCondition(c11561066.condition)
e1:SetOperation(c11561066.operation) e1:SetOperation(c11561066.operation)
Duel.RegisterEffect(e1,tp) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
else
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_REMOVED)
e1:SetCountLimit(1)
e1:SetOperation(c11561066.thop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function c11561066.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end end
function c11561066.condition(e,tp,eg,ep,ev,re,r,rp) function c11561066.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():IsRelateToEffect(e) return e:GetLabelObject():IsRelateToEffect(e)
......
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