--Genex Ally Triunity local s,id=GetID() function s.initial_effect(c) aux.AddOrigTimeleapType(c,false) aux.AddTimeleapProc(c,5,s.sumcon,s.tlfilter) c:EnableReviveLimit() local e1=Effect.CreateEffect(c) --This card's effect depends on the Attribute of the monster used as Material for its Time Leap Summon. e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCondition(s.regcon) e1:SetOperation(s.regop) c:RegisterEffect(e1) end function s.sumcon(e,c) local tp=c:GetControler() local g=Duel.GetMatchingGroup(IsFaceup,tp,LOCATION_MZONE,0,nil) return g:GetClassCount(Card.GetAttribute)>2 end function s.tlfilter(c,e,mg) local tp=c:GetControler() local ef=e:GetHandler():GetFuture() return c:IsLevelBelow(ef-1) and c:IsType(TYPE_EFFECT) end function s.regcon(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsSummonType(SUMMON_TYPE_TIMELEAP) and e:GetHandler():GetMaterial():GetFirst():IsAttribute(ATTRIBUTE_DARK|ATTRIBUTE_WIND|ATTRIBUTE_FIRE) end function s.regop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:GetMaterial():GetFirst():IsAttribute(ATTRIBUTE_DARK) then --● DARK: Once per turn, at the start of the Damage Step, if this card battles an opponent's monster: You can banish that opponent's monster. local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_REMOVE) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetCode(EVENT_BATTLE_START) e1:SetCountLimit(1) e1:SetTarget(s.rmtg) e1:SetOperation(s.rmop) e1:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e1) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,0)) end if c:GetMaterial():GetFirst():IsAttribute(ATTRIBUTE_WIND) then --● WIND: Once per turn, if your opponent activates a monster effect: You can return that opponent's monster to the hand. local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_TOHAND) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_CHAINING) e2:SetProperty(EFFECT_FLAG_DELAY) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1) e2:SetCondition(s.thcond) e2:SetTarget(s.thtg) e2:SetOperation(s.thop) e2:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e2) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,1)) end if c:GetMaterial():GetFirst():IsAttribute(ATTRIBUTE_FIRE) then --● FIRE: Once per turn: You can tribute 1 monster you control, then target 1 card on the field; destroy it, and if you do, inflict 600 damage to your opponent. local e3=Effect.CreateEffect(c) e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCost(s.descost) e3:SetTarget(s.destg) e3:SetOperation(s.desop) e3:SetReset(RESET_EVENT+RESETS_STANDARD) c:RegisterEffect(e3) c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(id,2)) end end function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk) local tc=e:GetHandler():GetBattleTarget() if chk==0 then return tc and tc:IsControler(1-tp) and tc:IsAbleToRemove(tp,POS_FACEDOWN) end Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0) end function s.rmop(e,tp,eg,ep,ev,re,r,rp) local tc=e:GetHandler():GetBattleTarget() if tc and tc:IsRelateToBattle() then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end end function s.thcond(e,tp,eg,ep,ev,re,r,rp) return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE end function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chk==0 then return re:GetHandler():IsAbleToHand() end Duel.SetOperationInfo(0,CATEGORY_TOHAND,re:GetHandler(),1,0,0) end function s.thop(e,tp,eg,ep,ev,re,r,rp) Duel.SendtoHand(re:GetHandler(),nil,REASON_EFFECT) end function s.descost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckReleaseGroupCost(tp,nil,1,false,nil,nil) end local sg=Duel.SelectReleaseGroupCost(tp,nil,1,1,false,nil,nil) Duel.Release(sg,REASON_COST) end function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsOnField() end if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,600) end function s.desop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then Duel.Damage(1-tp,600,REASON_EFFECT) end end