Commit fdb6e77c authored by VanillaSalt's avatar VanillaSalt

fix

parent b73f686d
...@@ -884,8 +884,6 @@ void card::apply_field_effect() { ...@@ -884,8 +884,6 @@ void card::apply_field_effect() {
if (it->second->in_range(current.location, current.sequence) || ((it->second->range & LOCATION_HAND) if (it->second->in_range(current.location, current.sequence) || ((it->second->range & LOCATION_HAND)
&& (it->second->type & EFFECT_TYPE_TRIGGER_O) && !(it->second->code & EVENT_PHASE))) { && (it->second->type & EFFECT_TYPE_TRIGGER_O) && !(it->second->code & EVENT_PHASE))) {
pduel->game_field->add_effect(it->second); pduel->game_field->add_effect(it->second);
if(it->second->code == EFFECT_SPSUMMON_COUNT_LIMIT)
pduel->game_field->effects.spsummon_count_eff.insert(it->second);
} }
} }
if(unique_code && (current.location & LOCATION_ONFIELD)) if(unique_code && (current.location & LOCATION_ONFIELD))
...@@ -900,8 +898,6 @@ void card::cancel_field_effect() { ...@@ -900,8 +898,6 @@ void card::cancel_field_effect() {
if (it->second->in_range(current.location, current.sequence) || ((it->second->range & LOCATION_HAND) if (it->second->in_range(current.location, current.sequence) || ((it->second->range & LOCATION_HAND)
&& (it->second->type & EFFECT_TYPE_TRIGGER_O) && !(it->second->code & EVENT_PHASE))) { && (it->second->type & EFFECT_TYPE_TRIGGER_O) && !(it->second->code & EVENT_PHASE))) {
pduel->game_field->remove_effect(it->second); pduel->game_field->remove_effect(it->second);
if(it->second->code == EFFECT_SPSUMMON_COUNT_LIMIT)
pduel->game_field->effects.spsummon_count_eff.erase(it->second);
} }
} }
if(unique_code && (current.location & LOCATION_ONFIELD)) if(unique_code && (current.location & LOCATION_ONFIELD))
...@@ -1104,7 +1100,6 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) { ...@@ -1104,7 +1100,6 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) {
read_card(code, &cdata); read_card(code, &cdata);
if(cdata.type & TYPE_NORMAL) if(cdata.type & TYPE_NORMAL)
return -1; return -1;
cancel_field_effect();
set_status(STATUS_COPYING_EFFECT, TRUE); set_status(STATUS_COPYING_EFFECT, TRUE);
uint32 cr = pduel->game_field->core.copy_reset; uint32 cr = pduel->game_field->core.copy_reset;
uint8 crc = pduel->game_field->core.copy_reset_count; uint8 crc = pduel->game_field->core.copy_reset_count;
...@@ -1119,7 +1114,6 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) { ...@@ -1119,7 +1114,6 @@ int32 card::copy_effect(uint32 code, uint32 reset, uint32 count) {
for(auto eit = pduel->uncopy.begin(); eit != pduel->uncopy.end(); ++eit) for(auto eit = pduel->uncopy.begin(); eit != pduel->uncopy.end(); ++eit)
pduel->delete_effect(*eit); pduel->delete_effect(*eit);
pduel->uncopy.clear(); pduel->uncopy.clear();
apply_field_effect();
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) {
......
...@@ -687,9 +687,11 @@ void field::add_effect(effect* peffect, uint8 owner_player) { ...@@ -687,9 +687,11 @@ void field::add_effect(effect* peffect, uint8 owner_player) {
} }
peffect->card_type = peffect->owner->data.type; peffect->card_type = peffect->owner->data.type;
effect_container::iterator it; effect_container::iterator it;
if (!(peffect->type & EFFECT_TYPE_ACTIONS)) if (!(peffect->type & EFFECT_TYPE_ACTIONS)) {
it = effects.aura_effect.insert(make_pair(peffect->code, peffect)); it = effects.aura_effect.insert(make_pair(peffect->code, peffect));
else { if(peffect->code == EFFECT_SPSUMMON_COUNT_LIMIT)
effects.spsummon_count_eff.insert(peffect);
} else {
if (peffect->type & EFFECT_TYPE_IGNITION) if (peffect->type & EFFECT_TYPE_IGNITION)
it = effects.ignition_effect.insert(make_pair(peffect->code, peffect)); it = effects.ignition_effect.insert(make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_ACTIVATE) else if (peffect->type & EFFECT_TYPE_ACTIVATE)
...@@ -722,9 +724,11 @@ void field::remove_effect(effect* peffect) { ...@@ -722,9 +724,11 @@ void field::remove_effect(effect* peffect) {
if (eit == effects.indexer.end()) if (eit == effects.indexer.end())
return; return;
auto it = eit->second; auto it = eit->second;
if (!(peffect->type & EFFECT_TYPE_ACTIONS)) if (!(peffect->type & EFFECT_TYPE_ACTIONS)) {
effects.aura_effect.erase(it); effects.aura_effect.erase(it);
else { if(peffect->code == EFFECT_SPSUMMON_COUNT_LIMIT)
effects.spsummon_count_eff.erase(peffect);
} else {
if (peffect->type & EFFECT_TYPE_IGNITION) if (peffect->type & EFFECT_TYPE_IGNITION)
effects.ignition_effect.erase(it); effects.ignition_effect.erase(it);
else if (peffect->type & EFFECT_TYPE_ACTIVATE) else if (peffect->type & EFFECT_TYPE_ACTIVATE)
......
...@@ -12,8 +12,7 @@ function c42664989.initial_effect(c) ...@@ -12,8 +12,7 @@ function c42664989.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c42664989.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c42664989.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND,0,1,e:GetHandler()) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,e:GetHandler()) end
or Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_ONFIELD,0,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler()) local g=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
end end
......
...@@ -29,7 +29,7 @@ function c78610936.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,7 +29,7 @@ function c78610936.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end if not tc:IsRelateToEffect(e) then return end
local mg=tc:GetOverlayGroup() local mg=tc:GetOverlayGroup()
tc:RemoveOverlayCard(tp,mg:GetCount(),mg:GetCount(),REASON_EFFECT) Duel.SendtoGrave(mg,REASON_EFFECT)
if Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)>0 then if Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)>0 then
local g=mg:Filter(c78610936.spfilter,nil,e,tp) local g=mg:Filter(c78610936.spfilter,nil,e,tp)
local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
......
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