Commit 11251bcf authored by DailyShana's avatar DailyShana

fix

parent d26721b3
...@@ -1228,7 +1228,7 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -1228,7 +1228,7 @@ void card::reset(uint32 id, uint32 reset_type) {
} }
} }
if(id & RESET_TURN_SET) { if(id & RESET_TURN_SET) {
effect* peffect = check_equip_control_effect(); effect* peffect = check_control_effect();
if(peffect) { if(peffect) {
effect* new_effect = pduel->new_effect(); effect* new_effect = pduel->new_effect();
new_effect->id = peffect->id; new_effect->id = peffect->id;
...@@ -1715,7 +1715,7 @@ effect* card::is_affected_by_effect(int32 code, card* target) { ...@@ -1715,7 +1715,7 @@ effect* card::is_affected_by_effect(int32 code, card* target) {
} }
return 0; return 0;
} }
effect* card::check_equip_control_effect() { effect* card::check_control_effect() {
effect* ret_effect = 0; effect* ret_effect = 0;
for (auto cit = equiping_cards.begin(); cit != equiping_cards.end(); ++cit) { for (auto cit = equiping_cards.begin(); cit != equiping_cards.end(); ++cit) {
auto rg = (*cit)->equip_effect.equal_range(EFFECT_SET_CONTROL); auto rg = (*cit)->equip_effect.equal_range(EFFECT_SET_CONTROL);
...@@ -1725,6 +1725,14 @@ effect* card::check_equip_control_effect() { ...@@ -1725,6 +1725,14 @@ effect* card::check_equip_control_effect() {
ret_effect = peffect; ret_effect = peffect;
} }
} }
auto rg = single_effect.equal_range(EFFECT_SET_CONTROL);
for (; rg.first != rg.second; ++rg.first) {
effect* peffect = rg.first->second;
if(!(peffect->flag & EFFECT_FLAG_SINGLE_RANGE))
continue;
if(!ret_effect || peffect->id > ret_effect->id)
ret_effect = peffect;
}
return ret_effect; return ret_effect;
} }
int32 card::fusion_check(group* fusion_m, card* cg, int32 chkf) { int32 card::fusion_check(group* fusion_m, card* cg, int32 chkf) {
......
...@@ -209,7 +209,7 @@ public: ...@@ -209,7 +209,7 @@ public:
void filter_spsummon_procedure_g(uint8 playerid, effect_set* eset); void filter_spsummon_procedure_g(uint8 playerid, effect_set* eset);
effect* is_affected_by_effect(int32 code); effect* is_affected_by_effect(int32 code);
effect* is_affected_by_effect(int32 code, card* target); effect* is_affected_by_effect(int32 code, card* target);
effect* check_equip_control_effect(); effect* check_control_effect();
int32 fusion_check(group* fusion_m, card* cg, int32 chkf); int32 fusion_check(group* fusion_m, card* cg, int32 chkf);
void fusion_select(uint8 playerid, group* fusion_m, card* cg, int32 chkf); void fusion_select(uint8 playerid, group* fusion_m, card* cg, int32 chkf);
......
...@@ -5236,8 +5236,8 @@ int32 field::adjust_step(uint16 step) { ...@@ -5236,8 +5236,8 @@ int32 field::adjust_step(uint16 step) {
if(pcard && pcard->is_affected_by_effect(EFFECT_REMOVE_BRAINWASHING)) { if(pcard && pcard->is_affected_by_effect(EFFECT_REMOVE_BRAINWASHING)) {
ctrleff.clear(); ctrleff.clear();
pcard->filter_single_effect(EFFECT_SET_CONTROL, &ctrleff, FALSE); pcard->filter_single_effect(EFFECT_SET_CONTROL, &ctrleff, FALSE);
for(int32 i = 0; i < ctrleff.size(); ++i) { if(ctrleff.size()) {
pcard->remove_effect(ctrleff[i]); pcard->reset(EFFECT_SET_CONTROL, RESET_CODE);
core.re_adjust = TRUE; core.re_adjust = TRUE;
} }
} }
......
...@@ -26,42 +26,21 @@ function c19327348.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c19327348.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c19327348.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c19327348.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c19327348.ctcon) e1:SetCondition(c19327348.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c19327348.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c19327348.ctcon(e) function c19327348.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_DARK) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_DARK) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c19327348.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end end
...@@ -26,42 +26,21 @@ function c37744402.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c37744402.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37744402.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37744402.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c37744402.ctcon) e1:SetCondition(c37744402.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c37744402.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c37744402.ctcon(e) function c37744402.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WIND) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_FIRE) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c37744402.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end end
...@@ -26,42 +26,21 @@ function c37970940.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c37970940.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37970940.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c37970940.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c37970940.ctcon) e1:SetCondition(c37970940.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c37970940.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c37970940.ctcon(e) function c37970940.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_EARTH) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_FIRE) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c37970940.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end end
...@@ -26,42 +26,21 @@ function c73318863.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c73318863.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c73318863.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c73318863.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c73318863.ctcon) e1:SetCondition(c73318863.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c73318863.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c73318863.ctcon(e) function c73318863.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_LIGHT) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_FIRE) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c73318863.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end end
...@@ -26,42 +26,21 @@ function c74364659.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c74364659.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c74364659.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c74364659.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c74364659.ctcon) e1:SetCondition(c74364659.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c74364659.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c74364659.ctcon(e) function c74364659.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_WATER) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_FIRE) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c74364659.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
end
end end
...@@ -26,42 +26,21 @@ function c759393.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -26,42 +26,21 @@ function c759393.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c759393.filter(tc) then if c:IsRelateToEffect(e) and c:IsFaceup() and tc and tc:IsRelateToEffect(e) and c759393.filter(tc) then
c:CreateRelation(tc,RESET_EVENT+0x5fe0000) c:SetCardTarget(tc)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_CONTROL) e1:SetCode(EFFECT_SET_CONTROL)
e1:SetProperty(EFFECT_FLAG_OWNER_RELATE+EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(tp) e1:SetValue(tp)
e1:SetLabel(0) e1:SetLabel(0)
e1:SetReset(RESET_EVENT+0x1fc0000) e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetCondition(c759393.ctcon) e1:SetCondition(c759393.ctcon)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetReset(RESET_EVENT+0x1fc0000)
e2:SetOperation(c759393.posop)
e2:SetLabelObject(e1)
tc:RegisterEffect(e2)
end end
end end
function c759393.ctcon(e) function c759393.ctcon(e)
if e:GetLabel()==1 then return true end
if e:GetLabel()==2 then return false end
local c=e:GetOwner() local c=e:GetOwner()
local h=e:GetHandler() local h=e:GetHandler()
if h:IsAttribute(ATTRIBUTE_FIRE) and not c:IsDisabled() and c:IsRelateToCard(h) then return h:IsAttribute(ATTRIBUTE_FIRE) and c:IsHasCardTarget(h)
return true
else
e:SetLabel(2)
return false
end
end
function c759393.posop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=0 then return end
local h=e:GetHandler()
if h:IsPreviousPosition(POS_FACEUP) and h:IsFacedown() then
e:GetLabelObject():SetLabel(1)
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