--Anbionic Companion Serow local s,id,o=GetID() function s.initial_effect(c) --Equip only to an "Anbionic" monster, or a Bigbang Monster. local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) --Equip limit local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetValue(s.eqlimit) c:RegisterEffect(e2) --The equipped monster gains 500 DEF, also it cannot be destroyed by card effects. local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_UPDATE_DEFENSE) e3:SetValue(500) c:RegisterEffect(e3) local e4=Effect.CreateEffect(c) e4:SetType(EFFECT_TYPE_EQUIP) e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT) e4:SetValue(1) c:RegisterEffect(e4) --During your Main Phase: You can Special Summon 1 "Spinup Token" (Thunder/LIGHT/Level 1/1000 ATK/0 DEF). local e5=Effect.CreateEffect(c) e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e5:SetType(EFFECT_TYPE_IGNITION) e5:SetRange(LOCATION_SZONE) e5:SetCountLimit(1,id) e5:SetTarget(s.tktg) e5:SetOperation(s.tkop) c:RegisterEffect(e5) --If this card is sent to the GY because the equipped monster was destroyed: You can target 1 Bigbang Monster you control; equip this card to it, but that target cannot be used as Bigbang Material this turn. local e6=Effect.CreateEffect(c) e6:SetCategory(CATEGORY_EQUIP) e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e6:SetCode(EVENT_TO_GRAVE) e6:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET) e6:SetCondition(s.eqcon) e6:SetTarget(s.eqtg) e6:SetOperation(s.eqop) c:RegisterEffect(e6) end function s.eqlimit(e,c) return c:IsSetCard(0xe57) or c:IsType(TYPE_BIGBANG) end function s.filter(c) return c:IsFaceup() and (c:IsSetCard(0xe57) or c:IsType(TYPE_BIGBANG)) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,e:GetHandler(),tc) end end function s.tktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,177222703,0,TYPES_TOKEN_MONSTER,1000,0,1,RACE_THUNDER,ATTRIBUTE_LIGHT) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,tp,0) end function s.tkop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,177222703,0,TYPES_TOKEN_MONSTER,1000,0,1,RACE_THUNDER,ATTRIBUTE_LIGHT) then local tk=Duel.CreateToken(tp,177222703) if(Duel.SpecialSummonStep(tk,0,tp,tp,false,false,POS_FACEUP)) then local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_DESTROYED) e1:SetCondition(s.drawcon) e1:SetOperation(s.drawop) Duel.RegisterEffect(e1,tp) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e2:SetCode(EVENT_DESTROY) e2:SetLabelObject(e1) e2:SetOperation(s.checkop) e2:SetReset(RESET_EVENT+RESETS_STANDARD) tk:RegisterEffect(e2) tk:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end Duel.SpecialSummonComplete() end end function s.checkop(e,tp,eg,ep,ev,re,r,rp) local e1=e:GetLabelObject() e1:SetLabel(1) end function s.drawcon(e,tp,eg,ep,ev,re,r,rp) return e:GetLabel()==1 end function s.drawop(e,tp,eg,ep,ev,re,r,rp) Duel.Draw(tp,1,REASON_EFFECT) e:SetLabel(0) e:Reset() end function s.eqcon(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ec=c:GetPreviousEquipTarget() return c:IsReason(REASON_LOST_TARGET) and ec:IsReason(REASON_DESTROY) end function s.filter2(c) return c:IsFaceup() and c:IsType(TYPE_BIGBANG) end function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.filter2(chkc) end if chk==0 then return Duel.IsExistingTarget(s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,s.filter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,e:GetHandler(),tc) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) e1:SetCode(EFFECT_CANNOT_BE_BIGBANG_MATERIAL) e1:SetValue(1) tc:RegisterEffect(e1) tc:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) end end