Commit edf5d916 authored by POLYMER's avatar POLYMER

fix

parent 1a36f529
chuoying=chuoying or {} chuoying=chuoying or {}
shushu=shushu or {}
function chuoying.gaixiaoguo1(e,tp,res) function chuoying.gaixiaoguo1(e,tp,res)
local c=e:GetHandler() local c=e:GetHandler()
local chk=c:IsSetCard(0xd70a) local chk=c:IsSetCard(0xd70a)
...@@ -107,3 +108,57 @@ function chuoying.gaixiaoguo6(e,tp,res) ...@@ -107,3 +108,57 @@ function chuoying.gaixiaoguo6(e,tp,res)
Duel.Draw(tp,1,REASON_EFFECT) Duel.Draw(tp,1,REASON_EFFECT)
end end
end end
function shushu.EnableUnionAttribute(c)
--destroy sub
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_DESTROY_SUBSTITUTE)
e1:SetValue(Auxiliary.UnionReplaceFilter)
c:RegisterEffect(e1)
--limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNION_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--equip
local equip_filter=shushu.UnionEquipFilter()
local e3=Effect.CreateEffect(c)
e3:SetDescription(1068)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(shushu.UnionEquipTarget(equip_filter))
e3:SetOperation(Auxiliary.UnionEquipOperation(equip_filter))
c:RegisterEffect(e3)
--unequip
local e4=Effect.CreateEffect(c)
e4:SetDescription(1152)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetTarget(Auxiliary.UnionUnequipTarget)
e4:SetOperation(Auxiliary.UnionUnequipOperation)
c:RegisterEffect(e4)
end
function shushu.UnionEquipFilter()
return function(c,tp)
local ct1,ct2=c:GetUnionCount()
return c:IsFaceup() and ct2==0
end
end
function shushu.UnionEquipTarget(equip_filter)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and equip_filter(chkc,tp) end
if chk==0 then return c:GetFlagEffect(FLAG_ID_UNION)==0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(equip_filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,equip_filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c,tp)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
c:RegisterFlagEffect(FLAG_ID_UNION,RESET_EVENT+0x7e0000+RESET_PHASE+PHASE_END,0,1)
end
end
\ No newline at end of file
...@@ -44,9 +44,7 @@ function s.initial_effect(c) ...@@ -44,9 +44,7 @@ function s.initial_effect(c)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function s.ffilter(c,fc,sub,mg,sg) function s.ffilter(c,fc,sub,mg,sg)
if not sg then return true end return (not sg or sg:FilterCount(aux.TRUE,c)==0 or sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())) and c:IsRace(RACE_DINOSAUR)
return sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
and c:IsRace(RACE_DINOSAUR)
end end
function s.splimit(e,se,sp,st) function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA) return not e:GetHandler():IsLocation(LOCATION_EXTRA)
......
...@@ -58,9 +58,14 @@ function cm.mfilter(c) ...@@ -58,9 +58,14 @@ function cm.mfilter(c)
return not cm[tp][rc] and cm[tp+2][rc] and c:IsAbleToRemoveAsCost() return not cm[tp][rc] and cm[tp+2][rc] and c:IsAbleToRemoveAsCost()
end end
function cm.regop(e,tp,eg,ep,ev,re,r,rp) function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local tc=e:GetHandler()
if not c:GetMaterial() then return end local g=tc:GetMaterial()
c:GetMaterial():ForEach(cm.regmf,c) if not g then return end
local c=g:GetFirst()
while c do
cm.regmf(c,tc)
c=g:GetNext()
end
end end
function cm.regmf(c,tc) function cm.regmf(c,tc)
if c:IsRace(RACE_PSYCHO+RACE_MACHINE) then if c:IsRace(RACE_PSYCHO+RACE_MACHINE) then
......
...@@ -3,7 +3,7 @@ function c9910898.initial_effect(c) ...@@ -3,7 +3,7 @@ function c9910898.initial_effect(c)
aux.AddCodeList(c,9910871) aux.AddCodeList(c,9910871)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND) e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,9910898) e1:SetCountLimit(1,9910898)
......
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