Commit 392ec59b authored by argon.sun's avatar argon.sun

fix

parent 16c1daf3
...@@ -707,7 +707,7 @@ void card::enable_field_effect(int32 enabled) { ...@@ -707,7 +707,7 @@ void card::enable_field_effect(int32 enabled) {
int32 card::add_effect(effect* peffect) { int32 card::add_effect(effect* peffect) {
effect_container::iterator it, rm; effect_container::iterator it, rm;
if (get_status(STATUS_COPYING_EFFECT) && (peffect->flag & EFFECT_FLAG_UNCOPYABLE)) { if (get_status(STATUS_COPYING_EFFECT) && (peffect->flag & EFFECT_FLAG_UNCOPYABLE)) {
pduel->delete_effect(peffect); pduel->uncopy.insert(peffect);
return 0; return 0;
} }
if (indexer.find(peffect) != indexer.end()) if (indexer.find(peffect) != indexer.end())
...@@ -863,6 +863,9 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) { ...@@ -863,6 +863,9 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) {
set_status(STATUS_COPYING_EFFECT, FALSE); set_status(STATUS_COPYING_EFFECT, FALSE);
pduel->game_field->core.copy_reset = cr; pduel->game_field->core.copy_reset = cr;
pduel->game_field->core.copy_reset_count = crc; pduel->game_field->core.copy_reset_count = crc;
for(auto eit = pduel->uncopy.begin(); eit != pduel->uncopy.end(); ++eit)
pduel->delete_effect(*eit);
pduel->uncopy.clear();
return pduel->game_field->infos.copy_id - 1; return pduel->game_field->infos.copy_id - 1;
} }
void card::reset(uint32 id, uint32 reset_type) { void card::reset(uint32 id, uint32 reset_type) {
......
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
std::set<group*> groups; std::set<group*> groups;
std::set<group*> sgroups; std::set<group*> sgroups;
std::set<effect*> effects; std::set<effect*> effects;
std::set<effect*> uncopy;
duel(); duel();
~duel(); ~duel();
......
...@@ -943,11 +943,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui ...@@ -943,11 +943,6 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SUMMON_COST, &eset); target->filter_effect(EFFECT_SUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
...@@ -1240,11 +1235,6 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) { ...@@ -1240,11 +1235,6 @@ int32 field::flip_summon(uint16 step, uint8 sumplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_FLIPSUMMON_COST, &eset); target->filter_effect(EFFECT_FLIPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
...@@ -1321,11 +1311,6 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1321,11 +1311,6 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_MSET_COST, &eset); target->filter_effect(EFFECT_MSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(setplayer, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0);
...@@ -1504,11 +1489,6 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) { ...@@ -1504,11 +1489,6 @@ int32 field::sset(uint16 step, uint8 setplayer, uint8 toplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SSET_COST, &eset); target->filter_effect(EFFECT_SSET_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(setplayer, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, setplayer, 0);
...@@ -1554,11 +1534,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -1554,11 +1534,6 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_SPSUMMON_COST, &eset); target->filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(sumplayer, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, sumplayer, 0);
...@@ -1761,11 +1736,6 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) { ...@@ -1761,11 +1736,6 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
eset.clear(); eset.clear();
target->filter_effect(EFFECT_SPSUMMON_COST, &eset); target->filter_effect(EFFECT_SPSUMMON_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(target, PARAM_TYPE_CARD);
pduel->lua->add_param(target->summon_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, target->summon_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, target->summon_player, 0);
......
...@@ -2488,11 +2488,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2488,11 +2488,6 @@ int32 field::process_battle_command(uint16 step) {
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE); filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset); core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.attack_cancelable = FALSE; core.attack_cancelable = FALSE;
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
...@@ -3349,11 +3344,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -3349,11 +3344,6 @@ int32 field::process_battle_command(uint16 step) {
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE); filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset); core.attacker->filter_effect(EFFECT_ATTACK_COST, &eset);
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(core.attacker, PARAM_TYPE_CARD);
pduel->lua->add_param(infos.turn_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(nil_event); core.sub_solving_event.push_back(nil_event);
add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0); add_process(PROCESSOR_EXECUTE_OPERATION, 0, eset[i], 0, infos.turn_player, 0);
...@@ -3637,11 +3627,6 @@ int32 field::add_chain(uint16 step) { ...@@ -3637,11 +3627,6 @@ int32 field::add_chain(uint16 step) {
pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT); pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->target, 3)) if(!pduel->lua->check_condition(eset[i]->target, 3))
continue; continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue;
if(eset[i]->operation) { if(eset[i]->operation) {
core.sub_solving_event.push_back(clit->evt); core.sub_solving_event.push_back(clit->evt);
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);
......
...@@ -13,6 +13,7 @@ function c38318146.initial_effect(c) ...@@ -13,6 +13,7 @@ function c38318146.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetCondition(c38318146.accon)
e2:SetTarget(c38318146.actarget) e2:SetTarget(c38318146.actarget)
e2:SetCost(c38318146.accost) e2:SetCost(c38318146.accost)
e2:SetOperation(c38318146.acop) e2:SetOperation(c38318146.acop)
...@@ -23,6 +24,10 @@ function c38318146.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,6 +24,10 @@ function c38318146.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.SelectReleaseGroup(tp,nil,2,2,nil) local rg=Duel.SelectReleaseGroup(tp,nil,2,2,nil)
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
end end
function c38318146.accon(e)
c38318146[0]=false
return true
end
function c38318146.acfilter(c) function c38318146.acfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end end
...@@ -30,7 +35,6 @@ function c38318146.actarget(e,te,tp) ...@@ -30,7 +35,6 @@ function c38318146.actarget(e,te,tp)
return te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE) return te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end end
function c38318146.accost(e,te,tp) function c38318146.accost(e,te,tp)
c38318146[0]=false
return Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil) return Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil)
end end
function c38318146.acop(e,tp,eg,ep,ev,re,r,rp) function c38318146.acop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -11,7 +11,6 @@ function c45500495.initial_effect(c) ...@@ -11,7 +11,6 @@ function c45500495.initial_effect(c)
e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e1:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e1:SetTarget(c45500495.sumtg) e1:SetTarget(c45500495.sumtg)
e1:SetCost(c45500495.ccost) e1:SetCost(c45500495.ccost)
e1:SetValue(1)
e1:SetOperation(c45500495.acop) e1:SetOperation(c45500495.acop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
......
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
function c75732622.spcon(e,c) function c75732622.spcon(e,c)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
return not Duel.CheckNormalSummonActivity(tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=2 return Duel.GetLocationCount(tp,LOCATION_MZONE)>=2
and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) and Duel.IsPlayerCanSpecialSummonMonster(tp,75732623,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK)
end end
function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c) function c75732622.spop(e,tp,eg,ep,ev,re,r,rp,c)
......
...@@ -22,6 +22,7 @@ function c79323590.initial_effect(c) ...@@ -22,6 +22,7 @@ function c79323590.initial_effect(c)
e3:SetCode(EFFECT_SUMMON_COST) e3:SetCode(EFFECT_SUMMON_COST)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e3:SetCondition(c79323590.costcon)
e3:SetCost(c79323590.costchk) e3:SetCost(c79323590.costchk)
e3:SetOperation(c79323590.costop) e3:SetOperation(c79323590.costop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
...@@ -47,8 +48,11 @@ end ...@@ -47,8 +48,11 @@ end
function c79323590.actarget(e,te,tp) function c79323590.actarget(e,te,tp)
return te:GetHandler():IsLocation(LOCATION_HAND) return te:GetHandler():IsLocation(LOCATION_HAND)
end end
function c79323590.costchk(e,te_or_c,tp) function c79323590.costcon(e)
c79323590[0]=false c79323590[0]=false
return true
end
function c79323590.costchk(e,te_or_c,tp)
return Duel.CheckLPCost(tp,500) return Duel.CheckLPCost(tp,500)
end end
function c79323590.costop(e,tp,eg,ep,ev,re,r,rp) function c79323590.costop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -12,13 +12,28 @@ function c82003859.initial_effect(c) ...@@ -12,13 +12,28 @@ function c82003859.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetCondition(c82003859.atcon)
e2:SetCost(c82003859.atcost) e2:SetCost(c82003859.atcost)
e2:SetOperation(c82003859.atop) e2:SetOperation(c82003859.atop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--accumulate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(0x10000000+82003859)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
c:RegisterEffect(e3)
end
function c82003859.stcon(e)
c82003859[0]=false
return true
end end
function c82003859.atcost(e,c,tp) function c82003859.atcost(e,c,tp)
return Duel.CheckLPCost(tp,500) return Duel.CheckLPCost(tp,500)
end end
function c82003859.atop(e,tp,eg,ep,ev,re,r,rp) function c82003859.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500) if c82003859[0] then return end
Duel.PayLPCost(tp,Duel.GetFlagEffect(tp,82003859)*500)
c82003859[0]=true
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