Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete card target on RESET_COPY & remove EFFECT_FLAG_COPY_INHERIT #644

Merged
merged 10 commits into from
Oct 25, 2024

Conversation

salix5
Copy link
Collaborator

@salix5 salix5 commented Oct 16, 2024

delete card target on RESET_COPY

https://ocg-rule.readthedocs.io/zh-cn/latest/c06/2020.html#id178

得到了「No.45 灭亡之预言者」卡名·效果的「混沌超量 冀望皇 异晶人」以1张表侧表示的卡为对象发动了得到的「No.45 灭亡之预言者」的①效果后,因「技能抽取」的效果而被无效的场合,仍然和作为对象的卡持续取对象。

https://ocg-rule.readthedocs.io/zh-cn/latest/c06/2022.html#id221

「混沌超量 冀望皇 异晶人」发动②效果,得到了「No.45 灭亡之预言者」的卡名·效果后,发动得到的「No.45 灭亡之预言者」的①效果并适用的状况,对方回合结束后,虽然「混沌超量 冀望皇 异晶人」失去了「No.45 灭亡之预言者」的卡名·效果,但是只要「混沌超量 冀望皇 异晶人」表侧表示在场上,『这只怪兽表侧表示存在期间,作为对象的表侧表示的卡的效果无效化』效果仍然适用。此外,「No.45 灭亡之预言者」的②效果是永续效果,失去「No.45 灭亡之预言者」的卡名·效果后不再适用。

https://ocg-rule.readthedocs.io/zh-cn/latest/c06/2024.html#id97

裁定变更:
混沌超量 冀望皇 异晶人」发动②效果,得到了「No.45 灭亡之预言者」「No.106 巨岩掌 巨手」的卡名·效果后,发动得到的「No.45 灭亡之预言者」「No.106 巨岩掌 巨手」的①效果并适用的状况,对方回合结束后,「混沌超量 冀望皇 异晶人」失去了「No.45 灭亡之预言者」「No.106 巨岩掌 巨手」的卡名·效果,即使这只「混沌超量 冀望皇 异晶人」表侧表示在场上,得到的「No.45 灭亡之预言者」「No.106 巨岩掌 巨手」的①效果不再适用。

2020: The card target is lost when the copied effects reset.
2022: The card target is not lost.
2024: The card target is lost.

Now it will delete card target on RESET_COPY.

remove EFFECT_FLAG_COPY_INHERIT

Now RESET_COPY will clear effect_target_cards.
It it not used anymore.

effect_indexer::iterator remove_effect(effect* peffect)

Now remove_effect will return the next iterator, just like erase.
We can use the standard way to remove from effect_indexer.

fix field::add_effect

avoid duplicate entries like card::add_effect

reload script after removing all effects

If X gets 5 effects by replace_effect.
Before:
It will reload the original effect when removing the first effect.

After:
It will reload the original effect after removing 5 effects.

fix field::adjust_grant_effect()

c1
e1: EFFECT_TYPE_GRANT
e2: EFFECT_TYPE_FIELD, gained from e1

e1 table
c1,e2

Call c1->remove_effect(e1)
Call pduel->game_field->remove_effect(e1)
e1 is EFFECT_TYPE_GRANT, call erase_grant_effect(e1)
Call c1->remove_effect(e2)
Call pduel->game_field->remove_effect(e2)

It will erase 2 entries in card::remove_effect(), which breaks erasing while iteration.
As a workaround, we do not allow c1 gains an effect from itself.

avoid nested EFFECT_TYPE_GRANT

...for the same reason

Reference

https://en.cppreference.com/w/cpp/container/set/erase_if

@mercury233
@purerosefallen

@salix5 salix5 mentioned this pull request Oct 16, 2024
@salix5 salix5 merged commit 7a9fd22 into master Oct 25, 2024
1 check passed
@salix5 salix5 deleted the patch-inherit branch October 25, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant