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

include REASON_FUSION/RITUAL/... in msg_move of special summon #283

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions card.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ class card {
#define SUMMON_TYPE_XYZ 0x49000000
#define SUMMON_TYPE_PENDULUM 0x4a000000
#define SUMMON_TYPE_LINK 0x4c000000

static uint32 get_summon_reason(uint32 summon_info) {
uint32 summontype = summon_info & 0xff000000;
if(summontype == SUMMON_TYPE_FUSION) return REASON_FUSION;
if(summontype == SUMMON_TYPE_RITUAL) return REASON_RITUAL;
if(summontype == SUMMON_TYPE_SYNCHRO) return REASON_SYNCHRO;
if(summontype == SUMMON_TYPE_XYZ) return REASON_XYZ;
if(summontype == SUMMON_TYPE_PENDULUM) return REASON_PENDULUM;
if(summontype == SUMMON_TYPE_LINK) return REASON_LINK;
return 0;
}

//Counter
#define COUNTER_WITHOUT_PERMIT 0x1000
//#define COUNTER_NEED_ENABLE 0x2000
Expand Down
1 change: 1 addition & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct card_sort {
#define REASON_REVEAL 0x8000000 //
#define REASON_LINK 0x10000000 //
#define REASON_LOST_OVERLAY 0x20000000 //
#define REASON_PENDULUM 0x40000000 //

//Status
#define STATUS_DISABLED 0x0001 //
Expand Down
12 changes: 6 additions & 6 deletions operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ void field::special_summon(card_set* target, uint32 sumtype, uint32 sumplayer, u
pcard->temp.reason_player = pcard->current.reason_player;
pcard->summon_info = (sumtype & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)pcard->current.location << 16);
pcard->summon_player = sumplayer;
pcard->current.reason = REASON_SPSUMMON;
pcard->current.reason = REASON_SPSUMMON | get_summon_reason(pcard->summon_info);
pcard->current.reason_effect = core.reason_effect;
pcard->current.reason_player = core.reason_player;
pcard->spsummon_param = (playerid << 24) + (nocheck << 16) + (nolimit << 8) + positions;
Expand All @@ -187,7 +187,7 @@ void field::special_summon_step(card* target, uint32 sumtype, uint32 sumplayer,
target->temp.reason_player = target->current.reason_player;
target->summon_info = (sumtype & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)target->current.location << 16);
target->summon_player = sumplayer;
target->current.reason = REASON_SPSUMMON;
target->current.reason = REASON_SPSUMMON | get_summon_reason(target->summon_info);
target->current.reason_effect = core.reason_effect;
target->current.reason_player = core.reason_player;
target->spsummon_param = (playerid << 24) + (nocheck << 16) + (nolimit << 8) + positions;
Expand Down Expand Up @@ -2794,7 +2794,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
target->summon_info = (summon_info & 0xf00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)target->current.location << 16);
target->enable_field_effect(false);
move_to_field(target, sumplayer, targetplayer, LOCATION_MZONE, positions, FALSE, 0, FALSE, zone);
target->current.reason = REASON_SPSUMMON;
target->current.reason = REASON_SPSUMMON | get_summon_reason(target->summon_info);
target->current.reason_effect = peffect;
target->current.reason_player = sumplayer;
target->summon_player = sumplayer;
Expand Down Expand Up @@ -2974,11 +2974,11 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
group* pgroup = core.units.begin()->ptarget;
card* pcard = *pgroup->it;
pcard->enable_field_effect(false);
pcard->current.reason = REASON_SPSUMMON;
pcard->current.reason_effect = peffect;
pcard->current.reason_player = sumplayer;
pcard->summon_player = sumplayer;
pcard->summon_info = (peffect->get_value(pcard) & 0xff00ffff) | SUMMON_TYPE_SPECIAL | ((uint32)pcard->current.location << 16);
pcard->current.reason = REASON_SPSUMMON | get_summon_reason(pcard->summon_info);
pcard->current.reason_effect = peffect;
pcard->current.reason_player = sumplayer;
uint32 zone = 0xff;
uint32 flag1, flag2;
int32 ct1 = get_tofield_count(pcard, sumplayer, LOCATION_MZONE, sumplayer, LOCATION_REASON_TOFIELD, zone, &flag1);
Expand Down