Lion_Heart54
2018-06-22T15:27:49Z
Hi Guys,
I'm creating a new card in YGOPro. I know about DataBase, function in file .LUA, etc... but one card gives me problems. My card should do this:

"When this card is normal or special summoned: you can target 1 "Constellar" monster you control, it gains 200 ATK per each level/rank it has. If this card is used for an xyz material for a "Constellar" xyz monster, that xyz monster gains this effect:
This card can attack twice per each battle phase in this turn."


I've done more attemps but each of them doesn't works. Can someone help me?
SotheY
2018-06-22T15:53:10Z
Hey, the first effect could be something like this (haven't tested it):

--Custom Constellar
function c42391240.initial_effect(c)
	--summon success
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(xxxxxxxxxx,0))
	e1:SetCategory(CATEGORY_ATKCHANGE)
	e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
	e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
	e1:SetCode(EVENT_SUMMON_SUCCESS)
	e1:SetTarget(cxxxxxxxxxx.atktg)
	e1:SetOperation(cxxxxxxxx.atkop)
	c:RegisterEffect(e1)
	local e2=e1:Clone()
	e2:SetCode(EVENT_SPSUMMON_SUCCESS)
	c:RegisterEffect(e2)
end
function cxxxxxxxxx.filter(c)
	return c:IsSetCard(0x53) and c:IsType(TYPE_MONSTER)
end
function cxxxxxxxxxx.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
	if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:GetControler()==tp and cxxxxxxxxxx.filter(chkc) end
	if chk==0 then return Duel.IsExistingTarget(cxxxxxxxx.filter,tp,LOCATION_MZONE,0,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
	local g=Duel.SelectTarget(tp,cxxxxxxxxx.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cxxxxxxxxxxxxx.atkop(e,tp,eg,ep,ev,re,r,rp)
	local tc=Duel.GetFirstTarget()
	if tc:IsFaceup() and tc:IsRelateToEffect(e) then
		local e1=Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_SINGLE)
		e1:SetCode(EFFECT_UPDATE_ATTACK)
		e1:SetValue(cxxxxxxxxx.val)
		e1:SetReset(RESET_EVENT+0x1fe0000)
		tc:RegisterEffect(e1)
	end
end
function cxxxxxxxx.val(e,c)
	if c:IsType(TYPE_XYZ) then return c:GetRank()*200
	else
		return c:GetLevel()*200
	end
end

For the second effect, maybe you can try merging Star Drawing with Daigusto Phoenix.
Lion_Heart54
2018-06-27T23:48:05Z
Thanks, the code works [:love:]

Now I'm trying Star Drawing with Daigusto Phoenix for the second effect [:thumbu:]

I'll let you know [:smile:]
Lion_Heart54
2018-06-28T18:02:44Z
Originally Posted by: Lion_Heart54 

Thanks, the code works [:love:]

Now I'm trying Star Drawing with Daigusto Phoenix for the second effect [:thumbu:]

I'll let you know [:smile:]




I've solved, thanks for all 🙂