Commit ea319047 authored by POLYMER's avatar POLYMER

fix

parent 19fcb5e9
--尚武之王 帝亚曼德
function c75000014.initial_effect(c)
aux.AddCodeList(c,75000001)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75000014,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
--e1:SetCountLimit(1,75000014)
e1:SetTarget(c75000014.eqtg)
e1:SetOperation(c75000014.eqop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e2:SetOperation(c75000014.indop)
c:RegisterEffect(e2)
end
function c75000014.cfilter(c)
return c:IsCode(75000001) and c:IsFaceup()
end
function c75000014.eqfilter(c,tp)
return c:IsSetCard(0x3751) and c:CheckUniqueOnField(tp,LOCATION_SZONE) and c:IsControler(tp) and not c:IsForbidden() or Duel.IsExistingMatchingCard(c75000014.cfilter,tp,LOCATION_ONFIELD,0,1,nil) and c:IsAbleToChangeControler() and c:CheckUniqueOnField(tp,LOCATION_SZONE) and c:IsControler(1-tp)
end
function c75000014.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(c75000014.eqfilter,tp,LOCATION_DECK+LOCATION_EXTRA,LOCATION_MZONE,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,0,0)
end
function c75000014.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or c:IsFacedown() or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,c75000014.eqfilter,tp,LOCATION_DECK+LOCATION_EXTRA,LOCATION_MZONE,1,1,nil,tp):GetFirst()
if tc then
if not Duel.Equip(tp,tc,c) then return end
--Add Equip limit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
--e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(c75000014.eqlimit)
tc:RegisterEffect(e1)
local code=tc:GetCode()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(code)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function c75000014.eqlimit(e,c)
return e:GetOwner()==c
end
function c75000014.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
if not ((r&REASON_FUSION+REASON_LINK)~=0 and c:IsSetCard(0x3751)) then return end
if not rc:IsType(TYPE_EFFECT) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
e0:SetValue(TYPE_EFFECT)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e0,true)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(400)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e3,true)
rc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(75000014,1))
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