Commit 24b2e755 authored by DailyShana's avatar DailyShana

add EFFECT_FLAG_SPSUM_PARAM for unusual usage of target_range

in EFFECT_TUNER_MATERIAL_LIMIT and EFFECT_HAND_SYNCHRO
parent 9f6248b2
...@@ -2457,10 +2457,12 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32 ...@@ -2457,10 +2457,12 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
if(ptuner) { if(ptuner) {
if(ptuner->value) if(ptuner->value)
location = ptuner->value; location = ptuner->value;
if(ptuner->s_range && ptuner->s_range > min) if(ptuner->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
min = ptuner->s_range; if(ptuner->s_range && ptuner->s_range > min)
if(ptuner->o_range && ptuner->o_range < max) min = ptuner->s_range;
max = ptuner->o_range; if(ptuner->o_range && ptuner->o_range < max)
max = ptuner->o_range;
}
if(min > max) { if(min > max) {
pduel->restore_assumes(); pduel->restore_assumes();
return FALSE; return FALSE;
......
...@@ -1569,10 +1569,12 @@ int32 scriptlib::card_get_tuner_limit(lua_State *L) { ...@@ -1569,10 +1569,12 @@ int32 scriptlib::card_get_tuner_limit(lua_State *L) {
lua_pushnil(L); lua_pushnil(L);
uint16 min = 0; uint16 min = 0;
uint16 max = 99; uint16 max = 99;
if(peffect->s_range && peffect->s_range > min) if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
min = peffect->s_range; if(peffect->s_range && peffect->s_range > min)
if(peffect->o_range && peffect->o_range < max) min = peffect->s_range;
max = peffect->o_range; if(peffect->o_range && peffect->o_range < max)
max = peffect->o_range;
}
lua_pushinteger(L, min); lua_pushinteger(L, min);
lua_pushinteger(L, max); lua_pushinteger(L, max);
return 5; return 5;
...@@ -1594,10 +1596,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) { ...@@ -1594,10 +1596,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) {
lua_pushnil(L); lua_pushnil(L);
uint16 min = 0; uint16 min = 0;
uint16 max = 99; uint16 max = 99;
if(peffect->s_range && peffect->s_range > min) if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
min = peffect->s_range; if(peffect->s_range && peffect->s_range > min)
if(peffect->o_range && peffect->o_range < max) min = peffect->s_range;
max = peffect->o_range; if(peffect->o_range && peffect->o_range < max)
max = peffect->o_range;
}
lua_pushinteger(L, min); lua_pushinteger(L, min);
lua_pushinteger(L, max); lua_pushinteger(L, max);
return 4; return 4;
...@@ -1611,10 +1615,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) { ...@@ -1611,10 +1615,12 @@ int32 scriptlib::card_get_hand_synchro(lua_State *L) {
lua_pushnil(L); lua_pushnil(L);
uint16 min = 0; uint16 min = 0;
uint16 max = 99; uint16 max = 99;
if(peffect->s_range && peffect->s_range > min) if(peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
min = peffect->s_range; if(peffect->s_range && peffect->s_range > min)
if(peffect->o_range && peffect->o_range < max) min = peffect->s_range;
max = peffect->o_range; if(peffect->o_range && peffect->o_range < max)
max = peffect->o_range;
}
lua_pushinteger(L, min); lua_pushinteger(L, min);
lua_pushinteger(L, max); lua_pushinteger(L, max);
return 4; return 4;
......
...@@ -5213,7 +5213,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in ...@@ -5213,7 +5213,7 @@ int32 field::select_synchro_material(int16 step, uint8 playerid, card* pcard, in
case 3: { case 3: {
card* tuner = core.limit_tuner; card* tuner = core.limit_tuner;
effect* ptuner = tuner->is_affected_by_effect(EFFECT_TUNER_MATERIAL_LIMIT); effect* ptuner = tuner->is_affected_by_effect(EFFECT_TUNER_MATERIAL_LIMIT);
if(ptuner) { if(ptuner && ptuner->is_flag(EFFECT_FLAG_SPSUM_PARAM)) {
if(ptuner->s_range && ptuner->s_range > min) if(ptuner->s_range && ptuner->s_range > min)
min = ptuner->s_range; min = ptuner->s_range;
if(ptuner->o_range && ptuner->o_range < max) if(ptuner->o_range && ptuner->o_range < max)
......
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