I am tempted to add Double-Rank-Up-Magic Hope Force in my ygopro and will let its effect below:
Target 1 "Number 39: Utopia" you control that has 2 or more Xyz Materials; Xyz Summon from your Extra Deck, 2 Xyz Monsters that are 1 or 2 Ranks higher than that monster you control. (to this part of the effect is already perfect)
Then, detach 2 Xyz Materials from that target, and if you do, attach 1 of them to each monster Special Summoned by this effect as an Xyz Material. is already part'm not getting perfectly xyz materials are always being attached in only one of the two is right and attach one in someone can help me solve this problem?? Here is the script:
--Double-Rank-Up-Magic Hope Force
function c11.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c11.target)
e1:SetOperation(c11.activate)
c:RegisterEffect(e1)
end
function c11.filter1(c,e,tp)
local rk=c:GetRank()
return rk>0 and c:IsFaceup() and
c:IsCode(84013237) and c:GetOverlayCount()>=2 and Duel.IsExistingMatchingCard(c11.filter2,tp,LOCATION_EXTRA,0,2,nil,rk+1,e,tp,c:GetCode())
end
function c11.filter2(c,rk,e,tp,code)
if c:IsCode(6165656) and code~=48995978 then return false end
return (c:GetRank()==rk or c:GetRank()==rk+1)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c11.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c11.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c11.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c11.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA)
end
function c11.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11.filter2,tp,LOCATION_EXTRA,0,2,2,nil,tc:GetRank()+1,e,tp,tc:GetCode())
local sc=g:GetFirst()
if g:GetCount()>1 then
Duel.SpecialSummon(g,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
if Duel.GetOverlayCount(tp,2,0)~=0 then
Duel.BreakEffect()
local g1=Duel.GetOverlayGroup(tp,2,0)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(11,0))
local mg2=g1:Select(tp,2,2,nil)
local oc=mg2:GetFirst():GetOverlayTarget()
Duel.Overlay(sc,mg2)
Duel.RaiseSingleEvent(oc,EVENT_DETACH_MATERIAL,e,0,0,0,0)
end
end
end
Edited by user
2014-06-08T03:49:46Z
|
Reason: Not specified