Commit 15322377 authored by salix5's avatar salix5

EFFECT_CANNOT_SELECT_EFFECT_TARGET

parent 9163afd2
......@@ -2376,13 +2376,19 @@ int32 card::is_capable_be_battle_target(card* pcard) {
int32 card::is_capable_be_effect_target(effect* peffect, uint8 playerid) {
if(is_status(STATUS_SUMMONING) || is_status(STATUS_BATTLE_DESTROYED))
return FALSE;
effect_set eset;
effect_set eset,eset2;
filter_effect(EFFECT_CANNOT_BE_EFFECT_TARGET, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(eset[i]->get_value(peffect, 1))
return FALSE;
}
peffect->handler->filter_effect(EFFECT_CANNOT_SELECT_EFFECT_TARGET, &eset2);
for(int32 i = 0; i < eset2.size(); ++i) {
pduel->lua->add_param(this, PARAM_TYPE_CARD);
if(eset2[i]->get_value(peffect, 1))
return FALSE;
}
return TRUE;
}
int32 card::is_can_be_fusion_material(uint8 ignore_mon) {
......
......@@ -375,6 +375,7 @@ public:
#define EFFECT_SPSUMMON_COUNT_LIMIT 330
#define EFFECT_LEFT_SPSUMMON_COUNT 331
#define EFFECT_CANNOT_SELECT_BATTLE_TARGET 332
#define EFFECT_CANNOT_SELECT_EFFECT_TARGET 333
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
......
......@@ -6,12 +6,10 @@ function c13756293.initial_effect(c)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(c13756293.etarget)
e1:SetValue(aux.tgoval)
e1:SetTargetRange(0,0xff)
e1:SetValue(c13756293.etarget)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
......@@ -24,8 +22,8 @@ function c13756293.initial_effect(c)
e2:SetOperation(c13756293.spop)
c:RegisterEffect(e2)
end
function c13756293.etarget(e,c)
return c:IsRace(RACE_DRAGON)
function c13756293.etarget(e,re,c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsRace(RACE_DRAGON)
end
function c13756293.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -4,20 +4,20 @@ function c33655493.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(c33655493.tg)
e1:SetValue(aux.imval1)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(c33655493.tg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e2:SetTargetRange(0,0xff)
e2:SetValue(c33655493.tglimit)
c:RegisterEffect(e2)
end
function c33655493.tg(e,c)
return c:IsFaceup() and c:GetCode()~=33655493
end
function c33655493.tglimit(e,re,rp)
return aux.tgoval(e,re,rp) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
function c33655493.tglimit(e,re,c)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE)
and c:IsFaceup() and c:GetCode()~=33655493
end
......@@ -27,16 +27,15 @@ function c34822850.initial_effect(c)
--cannot be target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e4:SetRange(LOCATION_FZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetTarget(c34822850.tgtg)
e4:SetValue(aux.imval1)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetValue(c34822850.atlimit)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetValue(aux.tgoval)
e5:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e5:SetTargetRange(0,0xff)
e5:SetValue(c34822850.tglimit)
c:RegisterEffect(e5)
end
function c34822850.spcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -61,6 +60,10 @@ end
function c34822850.filter(c,lv)
return c:IsFaceup() and c:IsSetCard(0xbb) and c:GetLevel()>lv
end
function c34822850.tgtg(e,c)
return c:IsSetCard(0xbb) and Duel.IsExistingMatchingCard(c34822850.filter,c:GetControler(),LOCATION_MZONE,0,1,nil,c:GetLevel())
function c34822850.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0xbb) and Duel.IsExistingMatchingCard(c34822850.filter,c:GetControler(),LOCATION_MZONE,0,1,nil,c:GetLevel())
end
function c34822850.tglimit(e,re,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0xbb)
and Duel.IsExistingMatchingCard(c34822850.filter,c:GetControler(),LOCATION_MZONE,0,1,nil,c:GetLevel())
end
......@@ -36,17 +36,12 @@ end
function c40583194.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetTarget(c40583194.etarget)
e1:SetValue(c40583194.evalue)
e1:SetLabel(tp)
e1:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e1:SetTargetRange(0,0xff)
e1:SetValue(c40583194.etarget)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c40583194.etarget(e,c)
function c40583194.etarget(e,re,c)
return c:IsType(TYPE_MONSTER)
end
function c40583194.evalue(e,re,rp)
return rp~=e:GetLabel() and aux.tgval(e,re,rp)
end
......@@ -4,23 +4,19 @@ function c53550467.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetCondition(c53550467.con)
e1:SetTarget(c53550467.tg)
e1:SetValue(aux.imval1)
e1:SetValue(c53550467.atlimit)
c:RegisterEffect(e1)
--cannot be effect target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(0,0xff)
e2:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e2:SetCondition(c53550467.con)
e2:SetTarget(c53550467.tg)
e2:SetValue(aux.tgoval)
e2:SetValue(c53550467.tglimit)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
......@@ -41,8 +37,11 @@ end
function c53550467.con(e)
return Duel.IsExistingMatchingCard(c53550467.cfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,e:GetHandler())
end
function c53550467.tg(e,c)
return c~=e:GetHandler() and c:GetAttack()<1800
function c53550467.atlimit(e,c)
return c~=e:GetHandler() and c:IsFaceup() and c:GetAttack()<1800
end
function c53550467.tglimit(e,re,c)
return c~=e:GetHandler() and c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:GetAttack()<1800
end
function c53550467.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSetCard,1,nil,0x207a)
......
......@@ -3,18 +3,20 @@ function c61380658.initial_effect(c)
--untargetable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(c61380658.target)
e1:SetValue(aux.imval1)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetValue(c61380658.atlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
e2:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e2:SetTargetRange(0,0xff)
e2:SetValue(c61380658.tglimit)
c:RegisterEffect(e2)
end
function c61380658.target(e,c)
return c:IsSetCard(0xe) and c~=e:GetHandler()
function c61380658.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0xe) and c~=e:GetHandler()
end
function c61380658.tglimit(e,re,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0xe) and c~=e:GetHandler()
end
......@@ -28,12 +28,10 @@ function c65025250.initial_effect(c)
--cannot be target
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetTarget(c65025250.tgtg)
e4:SetValue(aux.tgoval)
e4:SetTargetRange(0,0xff)
e4:SetValue(c65025250.tgtg)
c:RegisterEffect(e4)
end
function c65025250.filter(c,tp)
......@@ -60,6 +58,6 @@ function c65025250.posop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
function c65025250.tgtg(e,c)
return c:IsSetCard(0xb3) and c~=e:GetHandler()
function c65025250.tgtg(e,re,c)
return c~=e:GetHandler() and c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0xb3)
end
......@@ -5,15 +5,14 @@ function c80208158.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetTarget(c80208158.tglimit)
e1:SetValue(aux.imval1)
e1:SetTargetRange(0,LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e1:SetValue(c80208158.atlimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetValue(aux.tgoval)
e2:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e2:SetTargetRange(0,0xff)
e2:SetValue(c80208158.tglimit)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
......@@ -27,9 +26,12 @@ function c80208158.initial_effect(c)
e3:SetOperation(c80208158.spop)
c:RegisterEffect(e3)
end
function c80208158.tglimit(e,c)
function c80208158.atlimit(e,c)
return c~=e:GetHandler()
end
function c80208158.tglimit(e,re,c)
return c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE) and c~=e:GetHandler()
end
function c80208158.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker():IsControler(1-tp) and Duel.GetAttackTarget()==nil
end
......
......@@ -27,11 +27,9 @@ function c8102334.initial_effect(c)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetTarget(c8102334.tglimit)
e4:SetValue(aux.tgoval)
e4:SetTargetRange(0,0xff)
e4:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e4:SetValue(c8102334.tglimit)
c:RegisterEffect(e4)
end
function c8102334.distg(e,c)
......@@ -43,6 +41,6 @@ function c8102334.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
end
function c8102334.tglimit(e,c)
return c~=e:GetHandler()
function c8102334.tglimit(e,re,c)
return c~=e:GetHandler() and c:IsControler(e:GetHandlerPlayer()) and c:IsLocation(LOCATION_MZONE)
end
......@@ -14,10 +14,12 @@ function c81471108.initial_effect(c)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetValue(aux.tgoval)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,0xff)
e2:SetCondition(c81471108.tgcon)
e2:SetValue(c81471108.tglimit)
c:RegisterEffect(e2)
--destroy sub
local e3=Effect.CreateEffect(c)
......@@ -68,6 +70,12 @@ end
function c81471108.eqlimit(e,c)
return c==e:GetLabelObject()
end
function c81471108.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetEquipTarget()~=nil
end
function c81471108.tglimit(e,re,c)
return c==e:GetHandler():GetEquipTarget()
end
function c81471108.repval(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0
end
......@@ -12,18 +12,16 @@ function c85909450.initial_effect(c)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(c85909450.effcon)
e2:SetTarget(c85909450.target)
e2:SetValue(aux.imval1)
e2:SetValue(c85909450.atlimit)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetValue(aux.tgoval)
e3:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e3:SetTargetRange(0,0xff)
e3:SetValue(c85909450.tglimit)
c:RegisterEffect(e3)
--remove material
local e4=Effect.CreateEffect(c)
......@@ -39,8 +37,11 @@ end
function c85909450.effcon(e)
return e:GetHandler():GetOverlayCount()>0
end
function c85909450.target(e,c)
return c:IsSetCard(0x64) and c:IsType(TYPE_MONSTER)
function c85909450.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0x64)
end
function c85909450.tglimit(e,re,c)
return c:IsFaceup() and c:IsSetCard(0x64) and c:IsType(TYPE_MONSTER)
end
function c85909450.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
......
......@@ -3,15 +3,13 @@ function c9264485.initial_effect(c)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(c9264485.etarget)
e1:SetValue(aux.tgoval)
e1:SetTargetRange(0,0xff)
e1:SetValue(c9264485.etarget)
c:RegisterEffect(e1)
end
function c9264485.etarget(e,c)
function c9264485.etarget(e,re,c)
local code=c:GetCode()
return code==75830094 or code==11224103 or code==48229808
return c:IsLocation(LOCATION_MZONE) and (code==75830094 or code==11224103 or code==48229808)
end
......@@ -470,6 +470,7 @@ EFFECT_SPSUMMON_PROC_G =320 --P召唤规则
EFFECT_SPSUMMON_COUNT_LIMIT =330 --特殊召唤次数限制
EFFECT_LEFT_SPSUMMON_COUNT =331 --
EFFECT_CANNOT_SELECT_BATTLE_TARGET =332
EFFECT_CANNOT_SELECT_EFFECT_TARGET =333
--下面是诱发效果的诱发事件、时点 (如果是TYPE_SINGLE则自己发生以下事件后触发,如果TYPE_FIELD则场上任何卡发生以下事件都触发)
EVENT_STARTUP =1000 --游戏开始时
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment