--Chimeraghoul Poltress Dragon --Scripted by: XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --synchro summon aux.AddSynchroProcedure(c,nil,aux.FilterBoolFunction(Card.IsCode,CARD_CYBER_DRAGON),1,1) c:EnableReviveLimit() --special summon alt proc local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetType(EFFECT_TYPE_FIELD) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetRange(LOCATION_EXTRA) e1:SetCountLimit(1,id) e1:SetCondition(cid.sprcon) e1:SetOperation(cid.sprop) c:RegisterEffect(e1) --cannot be synchro material local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) e2:SetValue(1) c:RegisterEffect(e2) --atk up local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,1)) e3:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetTarget(cid.target) e3:SetOperation(cid.operation) c:RegisterEffect(e3) --damage local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,2)) e2:SetCategory(CATEGORY_DAMAGE) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_LEAVE_FIELD) e2:SetCondition(cid.damcon) e2:SetTarget(cid.damtg) e2:SetOperation(cid.damop) c:RegisterEffect(e2) end --SPECIAL SUMMON ALT PROC function cid.sprfilter(c) return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() end function cid.sprfilter1(c,tp,g,sc) return c:IsCode(CARD_CYBER_DRAGON) and g:IsExists(cid.sprfilter2,1,c,tp,c,sc) end function cid.sprfilter2(c,tp,mc,sc) local sg=Group.FromCards(c,mc) return c:IsRace(RACE_ZOMBIE) and Duel.GetLocationCountFromEx(tp,tp,sg,sc)>0 end function cid.sprcon(e,c) if c==nil then return true end local tp=c:GetControler() local g=Duel.GetMatchingGroup(cid.sprfilter,tp,LOCATION_MZONE,0,nil) return g:IsExists(cid.sprfilter1,1,nil,tp,g,c) end function cid.sprop(e,tp,eg,ep,ev,re,r,rp,c) local g=Duel.GetMatchingGroup(cid.sprfilter,tp,LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g1=g:FilterSelect(tp,cid.sprfilter1,1,1,nil,tp,g,c) local mc=g1:GetFirst() Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g2=g:FilterSelect(tp,cid.sprfilter2,1,1,mc,tp,mc,c) g1:Merge(g2) Duel.SendtoGrave(g1,REASON_COST) end --ATK UP function cid.tgfilter(c) return c:IsRace(RACE_ZOMBIE) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove() end function cid.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.tgfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,PLAYER_ALL,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,tp,0) end function cid.operation(e,tp,eg,ep,ev,re,r,rp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) local g=Duel.SelectMatchingCard(tp,cid.tgfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil) local c=e:GetHandler() local tc=g:GetFirst() if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_REMOVED) and c:IsRelateToEffect(e) and c:IsFaceup() then local val=tc:GetBaseAttack() if val<=0 then return end local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetValue(val) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) c:RegisterEffect(e1) end end --DAMAGE function cid.damcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) end function cid.damtg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(1-tp) Duel.SetTargetParam(e:GetHandler():GetPreviousAttackOnField()) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetHandler():GetPreviousAttackOnField()) end function cid.damop(e,tp,eg,ep,ev,re,r,rp) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Damage(p,d,REASON_EFFECT) end