Bending
If the only face-up monsters you control are "Fortune Lady" monsters, you can activate this card. Negate the activation of a Spell or Trap Card, or the Normal Summon of a monster, and remove that card from play. The card removed from play by this effect is returned to its owner's hand during the End Phase.
local SETCARD_ID_0 = 0x31 --Fortune

local SETCARD_ID_0 = 0x31 --Fortune
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate(summon)
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_DISABLE_SUMMON + CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_SUMMON)
	e1:SetCondition(s.condition1)
	e1:SetTarget(s.target1)
	e1:SetOperation(s.activate1)
	c:RegisterEffect(e1)
	--Activate(effect)
	local e2 = Effect.CreateEffect(c)
	e2:SetCategory(CATEGORY_NEGATE + CATEGORY_REMOVE)
	e2:SetType(EFFECT_TYPE_ACTIVATE)
	e2:SetCode(EVENT_CHAINING)
	e2:SetCondition(s.condition2)
	e2:SetTarget(aux.nbtg)
	e2:SetOperation(s.activate2)
	c:RegisterEffect(e2)
end
function s.cfilter(c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
end
function s.check(tp)
	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, 0, nil)
	return g:IsExists(s.cfilter, 1, nil) and not g:IsExists(aux.NOT(s.cfilter), 1, nil)
end
function s.condition1(e, tp, eg, ep, ev, re, r, rp)
	return aux.NegateSummonCondition() and s.check(tp)
end
function s.target1(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return eg:GetFirst():IsAbleToRemove()
	end
	Duel.SetOperationInfo(0, CATEGORY_DISABLE_SUMMON, eg, 1, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, eg, 1, 0, 0)
end
function s.activate1(e, tp, eg, ep, ev, re, r, rp)
	Duel.NegateSummon(eg:GetFirst())
	local ec = eg:GetFirst()
	if Duel.Remove(ec, POS_FACEUP, REASON_EFFECT) ~= 0 then
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e1:SetCode(EVENT_PHASE + PHASE_END)
		e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
		e1:SetCountLimit(1)
		e1:SetLabelObject(ec)
		e1:SetCondition(s.retcon)
		e1:SetOperation(s.retop)
		Duel.RegisterEffect(e1, tp)
		ec:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
	end
end
function s.condition2(e, tp, eg, ep, ev, re, r, rp)
	return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and s.check(tp)
end
function s.activate2(e, tp, eg, ep, ev, re, r, rp)
	local ec = eg:GetFirst()
	if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
		if Duel.Remove(ec, POS_FACEUP, REASON_EFFECT) ~= 0 then
			local e1 = Effect.CreateEffect(e:GetHandler())
			e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
			e1:SetCode(EVENT_PHASE + PHASE_END)
			e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
			e1:SetCountLimit(1)
			e1:SetLabelObject(ec)
			e1:SetCondition(s.retcon)
			e1:SetOperation(s.retop)
			Duel.RegisterEffect(e1, tp)
			ec:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
		end
	end
end
function s.retcon(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	return tc:GetFlagEffect(id) ~= 0
end
function s.retop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	Duel.SendtoHand(tc, nil, REASON_EFFECT)
end


Bending
If the only face-up monsters you control are "Fortune Lady" monsters, you can activate this card. Negate the activation of a Spell or Trap Card, or the Normal Summon of a monster, and remove that card from play. The card removed from play by this effect is returned to its owner's hand during the End Phase.
-- Bending
local SETCARD_ID_0 = 0x31 --Fortune
local s, id, o = GetID()
function s.initial_effect(c)
	--Activate(summon)
	local e1 = Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_DISABLE_SUMMON + CATEGORY_REMOVE)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_SUMMON)
	e1:SetCondition(s.condition1)
	e1:SetTarget(s.target1)
	e1:SetOperation(s.activate1)
	c:RegisterEffect(e1)
	--Activate(effect)
	local e2 = Effect.CreateEffect(c)
	e2:SetCategory(CATEGORY_NEGATE + CATEGORY_REMOVE)
	e2:SetType(EFFECT_TYPE_ACTIVATE)
	e2:SetCode(EVENT_CHAINING)
	e2:SetCondition(s.condition2)
	e2:SetTarget(aux.nbtg)
	e2:SetOperation(s.activate2)
	c:RegisterEffect(e2)
end
function s.cfilter(c)
	return c:IsFaceup() and c:IsSetCard(SETCARD_ID_0)
end
function s.check(tp)
	local g = Duel.GetMatchingGroup(Card.IsFaceup, tp, LOCATION_MZONE, 0, nil)
	return g:IsExists(s.cfilter, 1, nil) and not g:IsExists(aux.NOT(s.cfilter), 1, nil)
end
function s.condition1(e, tp, eg, ep, ev, re, r, rp)
	return aux.NegateSummonCondition() and s.check(tp)
end
function s.target1(e, tp, eg, ep, ev, re, r, rp, chk)
	if chk == 0 then
		return eg:GetFirst():IsAbleToRemove()
	end
	Duel.SetOperationInfo(0, CATEGORY_DISABLE_SUMMON, eg, 1, 0, 0)
	Duel.SetOperationInfo(0, CATEGORY_REMOVE, eg, 1, 0, 0)
end
function s.activate1(e, tp, eg, ep, ev, re, r, rp)
	Duel.NegateSummon(eg:GetFirst())
	local ec = eg:GetFirst()
	if Duel.Remove(ec, POS_FACEUP, REASON_EFFECT) ~= 0 then
		local e1 = Effect.CreateEffect(e:GetHandler())
		e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
		e1:SetCode(EVENT_PHASE + PHASE_END)
		e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
		e1:SetCountLimit(1)
		e1:SetLabelObject(ec)
		e1:SetCondition(s.retcon)
		e1:SetOperation(s.retop)
		Duel.RegisterEffect(e1, tp)
		ec:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
	end
end
function s.condition2(e, tp, eg, ep, ev, re, r, rp)
	return re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev) and s.check(tp)
end
function s.activate2(e, tp, eg, ep, ev, re, r, rp)
	local ec = eg:GetFirst()
	if Duel.NegateActivation(ev) and ec:IsRelateToEffect(re) then
		if Duel.Remove(ec, POS_FACEUP, REASON_EFFECT) ~= 0 then
			local e1 = Effect.CreateEffect(e:GetHandler())
			e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
			e1:SetCode(EVENT_PHASE + PHASE_END)
			e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
			e1:SetCountLimit(1)
			e1:SetLabelObject(ec)
			e1:SetCondition(s.retcon)
			e1:SetOperation(s.retop)
			Duel.RegisterEffect(e1, tp)
			ec:RegisterFlagEffect(id, RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END, 0, 1)
		end
	end
end
function s.retcon(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	return tc:GetFlagEffect(id) ~= 0
end
function s.retop(e, tp, eg, ep, ev, re, r, rp)
	local tc = e:GetLabelObject()
	Duel.SendtoHand(tc, nil, REASON_EFFECT)
end

