Commit 0113e0ce authored by salix5's avatar salix5

MSG_ADD_COUNTER, MSG_REMOVE_COUNTER

number of counter should be uint16
parent 254984eb
...@@ -1192,7 +1192,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) { ...@@ -1192,7 +1192,7 @@ void card::remove_effect(effect* peffect, effect_container::iterator it) {
pduel->write_buffer8(current.controler); pduel->write_buffer8(current.controler);
pduel->write_buffer8(current.location); pduel->write_buffer8(current.location);
pduel->write_buffer8(current.sequence); pduel->write_buffer8(current.sequence);
pduel->write_buffer8(cmit->second[0] + cmit->second[1]); pduel->write_buffer16(cmit->second[0] + cmit->second[1]);
counters.erase(cmit); counters.erase(cmit);
} }
} }
...@@ -1351,7 +1351,7 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -1351,7 +1351,7 @@ void card::reset(uint32 id, uint32 reset_type) {
pduel->write_buffer8(current.controler); pduel->write_buffer8(current.controler);
pduel->write_buffer8(current.location); pduel->write_buffer8(current.location);
pduel->write_buffer8(current.sequence); pduel->write_buffer8(current.sequence);
pduel->write_buffer8(rm->second[1]); pduel->write_buffer16(rm->second[1]);
rm->second[1] = 0; rm->second[1] = 0;
if(rm->second[0] == 0) if(rm->second[0] == 0)
counters.erase(rm); counters.erase(rm);
...@@ -1535,7 +1535,7 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count) { ...@@ -1535,7 +1535,7 @@ int32 card::add_counter(uint8 playerid, uint16 countertype, uint16 count) {
pduel->write_buffer8(current.controler); pduel->write_buffer8(current.controler);
pduel->write_buffer8(current.location); pduel->write_buffer8(current.location);
pduel->write_buffer8(current.sequence); pduel->write_buffer8(current.sequence);
pduel->write_buffer8(count); pduel->write_buffer16(count);
return TRUE; return TRUE;
} }
int32 card::remove_counter(uint16 countertype, uint16 count) { int32 card::remove_counter(uint16 countertype, uint16 count) {
...@@ -1557,7 +1557,7 @@ int32 card::remove_counter(uint16 countertype, uint16 count) { ...@@ -1557,7 +1557,7 @@ int32 card::remove_counter(uint16 countertype, uint16 count) {
pduel->write_buffer8(current.controler); pduel->write_buffer8(current.controler);
pduel->write_buffer8(current.location); pduel->write_buffer8(current.location);
pduel->write_buffer8(current.sequence); pduel->write_buffer8(current.sequence);
pduel->write_buffer8(count); pduel->write_buffer16(count);
return TRUE; return TRUE;
} }
int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count) { int32 card::is_can_add_counter(uint8 playerid, uint16 countertype, uint16 count) {
...@@ -1799,7 +1799,7 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s ...@@ -1799,7 +1799,7 @@ void card::filter_spsummon_procedure(uint8 playerid, effect_set* peset, uint32 s
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) { if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
topos = peffect->s_range; topos = (uint8)peffect->s_range;
if(peffect->o_range == 0) if(peffect->o_range == 0)
toplayer = playerid; toplayer = playerid;
else else
......
...@@ -1699,7 +1699,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack) ...@@ -1699,7 +1699,7 @@ int32 field::get_attack_target(card* pcard, card_vector* v, uint8 chain_attack)
continue; continue;
auto it = pcard->announced_cards.find(atarget->fieldid_r); auto it = pcard->announced_cards.find(atarget->fieldid_r);
if(it != pcard->announced_cards.end()) { if(it != pcard->announced_cards.end()) {
if(it->second.second >= peffect->get_value(atarget)) if(it->second.second >= (uint32)peffect->get_value(atarget))
continue; continue;
} }
if(atarget->is_affected_by_effect(EFFECT_IGNORE_BATTLE_TARGET)) if(atarget->is_affected_by_effect(EFFECT_IGNORE_BATTLE_TARGET))
......
...@@ -812,7 +812,7 @@ public: ...@@ -812,7 +812,7 @@ public:
#define MSG_ANNOUNCE_NUMBER 143 #define MSG_ANNOUNCE_NUMBER 143
#define MSG_CARD_HINT 160 #define MSG_CARD_HINT 160
#define MSG_TAG_SWAP 161 #define MSG_TAG_SWAP 161
#define MSG_RELOAD_FIELD 162 #define MSG_RELOAD_FIELD 162 // Debug.ReloadFieldEnd()
#define MSG_AI_NAME 163 #define MSG_AI_NAME 163
#define MSG_SHOW_HINT 164 #define MSG_SHOW_HINT 164
#define MSG_MATCH_KILL 170 #define MSG_MATCH_KILL 170
......
...@@ -1858,7 +1858,7 @@ int32 scriptlib::card_remove_counter(lua_State *L) { ...@@ -1858,7 +1858,7 @@ int32 scriptlib::card_remove_counter(lua_State *L) {
pcard->pduel->write_buffer8(pcard->current.controler); pcard->pduel->write_buffer8(pcard->current.controler);
pcard->pduel->write_buffer8(pcard->current.location); pcard->pduel->write_buffer8(pcard->current.location);
pcard->pduel->write_buffer8(pcard->current.sequence); pcard->pduel->write_buffer8(pcard->current.sequence);
pcard->pduel->write_buffer8(cmit->second[0] + cmit->second[1]); pcard->pduel->write_buffer16(cmit->second[0] + cmit->second[1]);
} }
pcard->counters.clear(); pcard->counters.clear();
return 0; return 0;
......
...@@ -950,7 +950,7 @@ int32 field::control_adjust(uint16 step) { ...@@ -950,7 +950,7 @@ int32 field::control_adjust(uint16 step) {
return FALSE; return FALSE;
} }
case 1: { case 1: {
uint8 adjp = core.temp_var[0]; uint8 adjp = (uint8)core.temp_var[0];
for(int32 i = 0; i < returns.bvalue[0]; ++i) { for(int32 i = 0; i < returns.bvalue[0]; ++i) {
card* pcard = core.select_cards[returns.bvalue[i + 1]]; card* pcard = core.select_cards[returns.bvalue[i + 1]];
core.destroy_set.insert(pcard); core.destroy_set.insert(pcard);
...@@ -1433,7 +1433,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1433,7 +1433,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
if(is_player_affected_by_effect(sumplayer, EFFECT_DEVINE_LIGHT)) if(is_player_affected_by_effect(sumplayer, EFFECT_DEVINE_LIGHT))
positions = POS_FACEUP; positions = POS_FACEUP;
if(proc && (proc->is_flag(EFFECT_FLAG_SPSUM_PARAM))) { if(proc && (proc->is_flag(EFFECT_FLAG_SPSUM_PARAM))) {
positions = proc->s_range; positions = (uint8)proc->s_range;
if(proc->o_range) if(proc->o_range)
targetplayer = 1 - sumplayer; targetplayer = 1 - sumplayer;
} }
...@@ -1875,7 +1875,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1875,7 +1875,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
uint8 targetplayer = setplayer; uint8 targetplayer = setplayer;
uint8 positions = POS_FACEDOWN_DEFENCE; uint8 positions = POS_FACEDOWN_DEFENCE;
if(proc && (proc->is_flag(EFFECT_FLAG_SPSUM_PARAM))) { if(proc && (proc->is_flag(EFFECT_FLAG_SPSUM_PARAM))) {
positions = proc->s_range; positions = (uint8)proc->s_range;
if(proc->o_range) if(proc->o_range)
targetplayer = 1 - setplayer; targetplayer = 1 - setplayer;
} }
...@@ -2138,7 +2138,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui ...@@ -2138,7 +2138,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target, ui
uint8 targetplayer = sumplayer; uint8 targetplayer = sumplayer;
uint8 positions = POS_FACEUP; uint8 positions = POS_FACEUP;
if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) { if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
positions = peffect->s_range; positions = (uint8)peffect->s_range;
if(peffect->o_range == 0) if(peffect->o_range == 0)
targetplayer = sumplayer; targetplayer = sumplayer;
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