Commit fdb6e77c authored by VanillaSalt's avatar VanillaSalt

fix

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