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