Commit 3930afd1 authored by VanillaSalt's avatar VanillaSalt

fix

parent c57933cb
...@@ -152,12 +152,6 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -152,12 +152,6 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return FALSE; return FALSE;
} }
if(handler->current.location == LOCATION_HAND) { if(handler->current.location == LOCATION_HAND) {
if((handler->data.type & TYPE_TRAP) && !handler->is_affected_by_effect(EFFECT_TRAP_ACT_IN_HAND))
return FALSE;
if((handler->data.type & TYPE_SPELL) && (pduel->game_field->infos.turn_player != playerid)) {
if(!(handler->data.type & TYPE_QUICKPLAY) || !handler->is_affected_by_effect(EFFECT_QP_ACT_IN_NTPHAND))
return FALSE;
}
if(handler->data.type & TYPE_MONSTER) { if(handler->data.type & TYPE_MONSTER) {
if(!(handler->data.type & TYPE_PENDULUM)) if(!(handler->data.type & TYPE_PENDULUM))
return FALSE; return FALSE;
...@@ -171,10 +165,31 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con ...@@ -171,10 +165,31 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
if(handler->get_status(STATUS_SET_TURN)) { if(handler->get_status(STATUS_SET_TURN)) {
if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY)) if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY))
return FALSE; return FALSE;
if((handler->data.type & TYPE_TRAP) && !handler->is_affected_by_effect(EFFECT_TRAP_ACT_IN_SET_TURN))
return FALSE;
} }
} }
int32 ecode = 0;
if(handler->current.location == LOCATION_HAND) {
if(handler->data.type & TYPE_TRAP)
ecode = EFFECT_TRAP_ACT_IN_HAND;
else if((handler->data.type & TYPE_SPELL) && (handler->data.type & TYPE_QUICKPLAY) && pduel->game_field->infos.turn_player != playerid)
ecode = EFFECT_QP_ACT_IN_NTPHAND;
} else if(handler->current.location == LOCATION_SZONE) {
if((handler->data.type & TYPE_TRAP) && handler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
}
if(ecode) {
int32 available = false;
effect_set eset;
handler->filter_effect(ecode, &eset);
for(int32 i = 0; i < eset.count; ++i) {
if(eset[i]->check_count_limit(playerid)) {
available = true;
break;
}
}
if(!available)
return FALSE;
}
if(handler->is_affected_by_effect(EFFECT_FORBIDDEN)) if(handler->is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE; return FALSE;
if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER)) if(handler->is_affected_by_effect(EFFECT_CANNOT_TRIGGER))
......
...@@ -4298,9 +4298,39 @@ int32 field::add_chain(uint16 step) { ...@@ -4298,9 +4298,39 @@ int32 field::add_chain(uint16 step) {
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, clit->triggering_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, clit->triggering_player, 0);
} }
} }
if (peffect->type & EFFECT_TYPE_ACTIVATE) { if(peffect->type & EFFECT_TYPE_ACTIVATE) {
break_effect(); break_effect();
if (peffect->handler->current.location == LOCATION_HAND) { int32 ecode = 0;
if(peffect->handler->current.location == LOCATION_HAND) {
if(peffect->handler->data.type & TYPE_TRAP)
ecode = EFFECT_TRAP_ACT_IN_HAND;
else if((peffect->handler->data.type & TYPE_SPELL) && (peffect->handler->data.type & TYPE_QUICKPLAY)
&& infos.turn_player != peffect->handler->current.controler)
ecode = EFFECT_QP_ACT_IN_NTPHAND;
} else if(peffect->handler->current.location == LOCATION_SZONE) {
if((peffect->handler->data.type & TYPE_TRAP) && peffect->handler->get_status(STATUS_SET_TURN))
ecode = EFFECT_TRAP_ACT_IN_SET_TURN;
}
if(ecode) {
eset.clear();
peffect->handler->filter_effect(ecode, &eset);
effect* pactin = 0;
for(int32 i = 0; i < eset.count; ++i) {
if(!(eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT)) {
pactin = eset[i];
break;
}
}
if(!pactin) {
for(int32 i = 0; i < eset.count; ++i) {
if(eset[i]->check_count_limit(peffect->handler->current.controler)) {
eset[i]->dec_count(peffect->handler->current.controler);
break;
}
}
}
}
if(peffect->handler->current.location == LOCATION_HAND) {
peffect->handler->enable_field_effect(FALSE); peffect->handler->enable_field_effect(FALSE);
peffect->handler->set_status(STATUS_ACT_FROM_HAND, TRUE); peffect->handler->set_status(STATUS_ACT_FROM_HAND, TRUE);
move_to_field(peffect->handler, peffect->handler->current.controler, peffect->handler->current.controler, LOCATION_SZONE, POS_FACEUP); move_to_field(peffect->handler, peffect->handler->current.controler, peffect->handler->current.controler, LOCATION_SZONE, POS_FACEUP);
......
...@@ -6,23 +6,6 @@ function c68018709.initial_effect(c) ...@@ -6,23 +6,6 @@ function c68018709.initial_effect(c)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND) e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_HAND,0) e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCondition(c68018709.actcon) e1:SetCountLimit(1,68018709+EFFECT_COUNT_CODE_DUEL)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c68018709.checkop)
c:RegisterEffect(e2)
end
function c68018709.actcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(tp,68018709)==0
end
function c68018709.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then return end
if re:GetActiveType()==TYPE_QUICKPLAY+TYPE_SPELL and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.RegisterFlagEffect(tp,68018709,0,0,0)
end
end end
...@@ -15,25 +15,11 @@ function c80075749.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -15,25 +15,11 @@ function c80075749.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c80075749.filter,tp,LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(c80075749.filter,tp,LOCATION_MZONE,0,1,nil)
end end
function c80075749.activate(e,tp,eg,ep,ev,re,r,rp) function c80075749.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local e1=Effect.CreateEffect(e:GetHandler())
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND) e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetTargetRange(LOCATION_HAND,0) e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCountLimit(1,80075749)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetOperation(c80075749.resetop)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabelObject(e1)
Duel.RegisterEffect(e2,tp)
end
function c80075749.resetop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:GetHandler():GetTurnID()==Duel.GetTurnCount() then
e:GetLabelObject():Reset()
e:Reset()
end
end end
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