a place for all your custom card needs you can post scripts pics and request for card to be made also please donate to the funding for a new server made for custom card duels
 
HomePortalLatest imagesSearchRegisterLog in

Share
 

 banishing cards for an activation

View previous topic View next topic Go down 
AuthorMessage
HurahItsHerald




Member Title : HeraldIsHereHoney
Posts : 15
Join date : 2015-08-25

cards - banishing cards for an activation Empty
PostSubject: banishing cards for an activation   cards - banishing cards for an activation Icon_minitimeSat Sep 12, 2015 9:17 am

any experts help here, plesae? this one is a challenge , but it is possible, trust me !

another awesome user has fixed my summoning condition for me
effect : Cannot be Normal Summoned/Set.
Must first be Special Summoned (from your hand) in Attack Position by banishing cards from your Graveyard equal to this card's Level, including at least 1 "Laval" card.



script :
--special summon
    local e3=Effect.CreateEffect(c)
    e3:SetDescription(aux.Stringid(74542,0))
    e3:SetType(EFFECT_TYPE_FIELD)
    e3:SetCode(EFFECT_SPSUMMON_PROC)
    e3:SetProperty(EFFECT_FLAG_SPSUM_PARAM+EFFECT_FLAG_UNCOPYABLE)
    e3:SetRange(LOCATION_HAND)
    e3:SetTargetRange(POS_FACEUP_ATTACK,0)
    e3:SetCondition(c74542.spcon)
    e3:SetOperation(c74542.spop)

function c74542.spfilter(c)
    return c:IsAbleToRemoveAsCost()
end
function c74542.spcon(e,c)
    if c==nil then return true end
    local g=Duel.GetMatchingGroup(c74542.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
    local d=g:FilterCount(Card.IsSetCard,nil,0x904)
    local ct=g:GetCount()
    local lv=e:GetHandler():GetLevel()
    return Duel.GetLocationCount(c:GetControler(),LOCATION_GRAVE)>-lv-1 and d>0 and ct>lv-1
end

function c74542.spop(e,tp,eg,ep,ev,re,r,rp,c)
    local lv=e:GetHandler():GetLevel()
    local g=Duel.GetMatchingGroup(c74542.spfilter,c:GetControler(),LOCATION_GRAVE,0,nil)
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
    local sg1=g:FilterSelect(tp,Card.IsSetCard,1,1,nil,0x904)
    g:RemoveCard(sg1:GetFirst())
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
    local sg2=g:Select(tp,lv-1,lv-1,nil)
    sg2:Merge(sg1)
    Duel.Remove(sg2,POS_FACEUP,REASON_COST)
end

_________________________________________________________

but now i want to do the same for spell card activations :
Lavalval Inferno
[Monster|Spell] ???/???
[Level 5] 0/0

You can activate this card in your hand by banishing cards from your Graveyard equal to this card's Level, including at least 1 “Laval” card, then target 1 monster your opponent controls with 4000 ATK or less; destroy it, also after that, banish this card from your hand instead of sending it to the Graveyard.

the card's a little weird -- monster-spell whats that ?
Mana Cost translated to ygo from RPGs, equels the card's level , and i have other support cards that decrease the mana cost of any card (monster or spell),
and making spells monsters with only levels was the only way to make this possible, along with disabling their monster play abilities, with this code i made which works:   
--cannot mset   
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e6)   
--cannot summon   
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_CANNOT_SUMMON)   
c:RegisterEffect(e7)

_________________________________________________________

Here's my script for the above spell so far, btw (all i need is the cost fixed as far as i can tell ):

function c74171.initial_effect(c)
    --destroy
    local e1=Effect.CreateEffect(c)
    e1:SetDescription(aux.Stringid(74171,0))
    e1:SetCategory(CATEGORY_DESTROY)
    e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
    e1:SetType(EFFECT_TYPE_IGNITION)
    e1:SetRange(LOCATION_HAND)
    e1:SetCost(c74171.cost)
    e1:SetTarget(c74171.target)
    e1:SetOperation(c74171.operation)
    c:RegisterEffect(e1)

the targeting part is done since its the easiest :
then target 1 monster your opponent controls with 4000 ATK or less; destroy it

function c74171.dfilter(c)
    return c:IsAttackBelow(4000) and c:IsFaceup() and c:IsDestructable()
end
function c74171.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
    if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c74171.dfilter(chkc) end
    if chk==0 then return Duel.IsExistingTarget(c74171.dfilter,tp,0,LOCATION_MZONE,1,nil) end
    Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
    local g=Duel.SelectTarget(tp,c74171.dfilter,tp,0,LOCATION_MZONE,1,1,nil)
    Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end

the operating part is all so done since its just as easy as targeting :
target 1 monster your opponent controls with 4000 ATK or less; destroy it, also after that banish this card from your hand, instead of sending it to the Graveyard.

local tc=Duel.GetFirstTarget()
    if tc and c74171.dfilter(tc) and tc:IsRelateToEffect(e) then
        Duel.Destroy(tc,REASON_EFFECT)
    end
    local c=e:GetHandler()
    if c:IsRelateToEffect(e) then
        Duel.Remove(c,nil,1,REASON_EFFECT)
    end
end

but the cost i have no idea how to construct ( the only parts thats left !!! ):
You can activate this card in your hand by banishing cards from your Graveyard equal to this card's Level, including at least 1 “Laval” card


function c74171.cost(e,tp,eg,ep,ev,re,r,rp,chk)
what goes here , is converted from function c77542.spcon(e,c)
into spell form

what I'm basically asking , is to convert the function c77542.spcon(e,c) above into a cost for a spell card to activate

its the only part thats left , then all my custom monsters AND spells will be done since they all share this one cost and condition!!!

thank you in advance and good luck
Back to top Go down
 

banishing cards for an activation

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Banishing Cards Need Help
» banishing cards for a special summon
» I need these cards plz :D
» Other Cards
» Sebek first 3 cards

Permissions in this forum:You cannot reply to topics in this forum
Mackpro :: MackPro :: Requests-