Commit e06381f5 authored by Chen Bill's avatar Chen Bill Committed by GitHub

fix: change type in field::equip() (#553)

* edit comment

* fix: change type in field::equip()
parent 7e19d953
...@@ -759,17 +759,17 @@ public: ...@@ -759,17 +759,17 @@ public:
#define PROCESSOR_DESTROY_REPLACE 56 #define PROCESSOR_DESTROY_REPLACE 56
#define PROCESSOR_RELEASE_REPLACE 57 #define PROCESSOR_RELEASE_REPLACE 57
#define PROCESSOR_SENDTO_REPLACE 58 #define PROCESSOR_SENDTO_REPLACE 58
#define PROCESSOR_SUMMON_RULE 60 //arg1, arg2 #define PROCESSOR_SUMMON_RULE 60
#define PROCESSOR_SPSUMMON_RULE 61 //arg1, arg2, arg3 #define PROCESSOR_SPSUMMON_RULE 61
#define PROCESSOR_SPSUMMON 62 #define PROCESSOR_SPSUMMON 62
#define PROCESSOR_FLIP_SUMMON 63 //arg1, arg2 #define PROCESSOR_FLIP_SUMMON 63
#define PROCESSOR_MSET 64 //arg1, arg2 #define PROCESSOR_MSET 64
#define PROCESSOR_SSET 65 #define PROCESSOR_SSET 65
#define PROCESSOR_SPSUMMON_STEP 66 #define PROCESSOR_SPSUMMON_STEP 66
#define PROCESSOR_SSET_G 67 #define PROCESSOR_SSET_G 67
#define PROCESSOR_DRAW 70 #define PROCESSOR_DRAW 70
#define PROCESSOR_DAMAGE 71 //arg1, arg2, arg3 #define PROCESSOR_DAMAGE 71
#define PROCESSOR_RECOVER 72 //arg1, arg2, arg3 #define PROCESSOR_RECOVER 72
#define PROCESSOR_EQUIP 73 #define PROCESSOR_EQUIP 73
#define PROCESSOR_GET_CONTROL 74 #define PROCESSOR_GET_CONTROL 74
#define PROCESSOR_SWAP_CONTROL 75 #define PROCESSOR_SWAP_CONTROL 75
......
...@@ -1386,6 +1386,8 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta ...@@ -1386,6 +1386,8 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
core.units.begin()->step = 2; core.units.begin()->step = 2;
return FALSE; return FALSE;
} }
if (!(equip_card->data.type & TYPE_EQUIP))
core.units.begin()->value1 = equip_card->get_type();
if(equip_card->equiping_target) { if(equip_card->equiping_target) {
equip_card->effect_target_cards.erase(equip_card->equiping_target); equip_card->effect_target_cards.erase(equip_card->equiping_target);
equip_card->equiping_target->effect_target_owner.erase(equip_card); equip_card->equiping_target->effect_target_owner.erase(equip_card);
...@@ -1405,11 +1407,15 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta ...@@ -1405,11 +1407,15 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
case 1: { case 1: {
equip_card->equip(target); equip_card->equip(target);
if(!(equip_card->data.type & TYPE_EQUIP)) { if(!(equip_card->data.type & TYPE_EQUIP)) {
uint32 equip_card_type = core.units.begin()->value1;
effect* peffect = pduel->new_effect(); effect* peffect = pduel->new_effect();
peffect->owner = equip_card; peffect->owner = equip_card;
peffect->handler = equip_card; peffect->handler = equip_card;
peffect->type = EFFECT_TYPE_SINGLE; peffect->type = EFFECT_TYPE_SINGLE;
if(equip_card->get_type() & TYPE_TRAP) { if (equip_card_type & TYPE_TOKEN) {
peffect->code = EFFECT_CHANGE_TYPE;
peffect->value = TYPE_EQUIP + TYPE_SPELL + TYPE_TOKEN;
} else if (equip_card_type & TYPE_TRAP) {
peffect->code = EFFECT_ADD_TYPE; peffect->code = EFFECT_ADD_TYPE;
peffect->value = TYPE_EQUIP; peffect->value = TYPE_EQUIP;
} else { } else {
......
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