Commit fb787c27 authored by nanahira's avatar nanahira

Merge branch 'master' of github.com:Fluorohydride/ygopro-core

parents 02547161 94e515c9
...@@ -2240,7 +2240,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) { ...@@ -2240,7 +2240,7 @@ int32 card::destination_redirect(uint8 destination, uint32 reason) {
int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 singly) { int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 singly) {
if(!is_can_add_counter(playerid, countertype, count, singly, 0)) if(!is_can_add_counter(playerid, countertype, count, singly, 0))
return FALSE; return FALSE;
uint16 cttype = countertype & ~COUNTER_NEED_ENABLE; uint16 cttype = countertype;
auto pr = counters.emplace(cttype, counter_map::mapped_type()); auto pr = counters.emplace(cttype, counter_map::mapped_type());
auto cmit = pr.first; auto cmit = pr.first;
if(pr.second) { if(pr.second) {
...@@ -2260,7 +2260,7 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8 ...@@ -2260,7 +2260,7 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count, uint8
pcount = mcount; pcount = mcount;
} }
} }
if((countertype & COUNTER_WITHOUT_PERMIT) && !(countertype & COUNTER_NEED_ENABLE)) if(countertype & COUNTER_WITHOUT_PERMIT)
cmit->second[0] += pcount; cmit->second[0] += pcount;
else else
cmit->second[1] += pcount; cmit->second[1] += pcount;
...@@ -2303,8 +2303,6 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count, ...@@ -2303,8 +2303,6 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
return FALSE; return FALSE;
if(!loc && (!(current.location & LOCATION_ONFIELD) || !is_position(POS_FACEUP))) if(!loc && (!(current.location & LOCATION_ONFIELD) || !is_position(POS_FACEUP)))
return FALSE; return FALSE;
if((countertype & COUNTER_NEED_ENABLE) && is_status(STATUS_DISABLED))
return FALSE;
} }
uint32 check = countertype & COUNTER_WITHOUT_PERMIT; uint32 check = countertype & COUNTER_WITHOUT_PERMIT;
if(!check) { if(!check) {
...@@ -2330,7 +2328,7 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count, ...@@ -2330,7 +2328,7 @@ int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count,
} }
if(!check) if(!check)
return FALSE; return FALSE;
uint16 cttype = countertype & ~COUNTER_NEED_ENABLE; uint16 cttype = countertype;
int32 limit = -1; int32 limit = -1;
int32 cur = 0; int32 cur = 0;
auto cmit = counters.find(cttype); auto cmit = counters.find(cttype);
......
...@@ -376,7 +376,7 @@ public: ...@@ -376,7 +376,7 @@ public:
#define SUMMON_TYPE_LINK 0x4c000000 #define SUMMON_TYPE_LINK 0x4c000000
//Counter //Counter
#define COUNTER_WITHOUT_PERMIT 0x1000 #define COUNTER_WITHOUT_PERMIT 0x1000
#define COUNTER_NEED_ENABLE 0x2000 //#define COUNTER_NEED_ENABLE 0x2000
#define ASSUME_CODE 1 #define ASSUME_CODE 1
#define ASSUME_TYPE 2 #define ASSUME_TYPE 2
......
...@@ -133,14 +133,14 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) { ...@@ -133,14 +133,14 @@ int32 scriptlib::debug_pre_add_counter(lua_State *L) {
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
uint32 countertype = (uint32)lua_tointeger(L, 2); uint32 countertype = (uint32)lua_tointeger(L, 2);
uint32 count = (uint32)lua_tointeger(L, 3); uint32 count = (uint32)lua_tointeger(L, 3);
uint16 cttype = countertype & ~COUNTER_NEED_ENABLE; uint16 cttype = countertype;
auto pr = pcard->counters.emplace(cttype, card::counter_map::mapped_type()); auto pr = pcard->counters.emplace(cttype, card::counter_map::mapped_type());
auto cmit = pr.first; auto cmit = pr.first;
if(pr.second) { if(pr.second) {
cmit->second[0] = 0; cmit->second[0] = 0;
cmit->second[1] = 0; cmit->second[1] = 0;
} }
if((countertype & COUNTER_WITHOUT_PERMIT) && !(countertype & COUNTER_NEED_ENABLE)) if(countertype & COUNTER_WITHOUT_PERMIT)
cmit->second[0] += count; cmit->second[0] += count;
else else
cmit->second[1] += count; cmit->second[1] += count;
......
...@@ -4024,6 +4024,7 @@ int32 field::add_chain(uint16 step) { ...@@ -4024,6 +4024,7 @@ int32 field::add_chain(uint16 step) {
auto& clit = core.new_chains.front(); auto& clit = core.new_chains.front();
effect* peffect = clit.triggering_effect; effect* peffect = clit.triggering_effect;
card* phandler = peffect->get_handler(); card* phandler = peffect->get_handler();
phandler->refresh_disable_status();
if(peffect->type & EFFECT_TYPE_ACTIVATE) { if(peffect->type & EFFECT_TYPE_ACTIVATE) {
clit.set_triggering_state(phandler); clit.set_triggering_state(phandler);
} }
......
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