Commit 6077b005 authored by Argon's avatar Argon

fix

parent 97fd88a8
......@@ -496,7 +496,7 @@ int32 card::get_defence(uint8 swap) {
return def;
}
uint32 card::get_level() {
if(data.type & TYPE_XYZ || single_effect.count(0x14d72c34)>0 || (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP)))
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
if(assume_type == ASSUME_LEVEL)
return assume_value;
......@@ -529,7 +529,7 @@ uint32 card::get_level() {
return level;
}
uint32 card::get_rank() {
if(!(data.type & TYPE_XYZ))
if(!(data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
if(assume_type == ASSUME_RANK)
return assume_value;
......@@ -562,7 +562,7 @@ uint32 card::get_rank() {
return rank;
}
uint32 card::get_synchro_level(card* pcard) {
if(data.type & TYPE_XYZ || single_effect.count(0x14d72c34)>0 || (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP)))
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
uint32 lev;
effect_set eset;
......@@ -574,7 +574,7 @@ uint32 card::get_synchro_level(card* pcard) {
return lev;
}
uint32 card::get_ritual_level(card* pcard) {
if(data.type & TYPE_XYZ || single_effect.count(0x14d72c34)>0 || (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP)))
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
uint32 lev;
effect_set eset;
......@@ -586,7 +586,7 @@ uint32 card::get_ritual_level(card* pcard) {
return lev;
}
uint32 card::is_xyz_level(card* pcard, uint32 lv) {
if(data.type & TYPE_XYZ || single_effect.count(0x14d72c34)>0 || (current.location != LOCATION_MZONE && data.type & (TYPE_SPELL + TYPE_TRAP)))
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return FALSE;
uint32 lev;
effect_set eset;
......@@ -1826,8 +1826,6 @@ int32 card::is_special_summonable(uint8 playerid) {
return FALSE;
if(is_affected_by_effect(EFFECT_FORBIDDEN))
return FALSE;
if(current.location & (LOCATION_GRAVE + LOCATION_REMOVED) && is_status(STATUS_REVIVE_LIMIT) && !is_status(STATUS_PROC_COMPLETE))
return FALSE;
pduel->game_field->save_lp_cost();
effect_set eset;
filter_effect(EFFECT_SPSUMMON_COST, &eset);
......
......@@ -95,7 +95,7 @@ int32 scriptlib::card_get_origin_level(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->data.type & TYPE_XYZ || pcard->single_effect.count(0x14d72c34)>0 || (pcard->current.location != LOCATION_MZONE && pcard->data.type & (TYPE_SPELL + TYPE_TRAP)))
if((pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL))
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.level);
......@@ -146,7 +146,7 @@ int32 scriptlib::card_get_origin_attribute(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->single_effect.count(0x14d72c34)>0 || (pcard->current.location != LOCATION_MZONE && pcard->data.type & (TYPE_SPELL + TYPE_TRAP)))
if(pcard->status & STATUS_NO_LEVEL)
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.attribute);
......@@ -163,7 +163,7 @@ int32 scriptlib::card_get_origin_race(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->single_effect.count(0x14d72c34)>0 || (pcard->current.location != LOCATION_MZONE && pcard->data.type & (TYPE_SPELL + TYPE_TRAP)))
if(pcard->status & STATUS_NO_LEVEL)
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.race);
......@@ -187,7 +187,7 @@ int32 scriptlib::card_get_text_attack(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->single_effect.count(0x14d72c34)>0 || (pcard->current.location != LOCATION_MZONE && pcard->data.type & (TYPE_SPELL + TYPE_TRAP)))
if(pcard->status & STATUS_NO_LEVEL)
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.attack);
......@@ -211,7 +211,7 @@ int32 scriptlib::card_get_text_defence(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
if(pcard->single_effect.count(0x14d72c34)>0 || (pcard->current.location != LOCATION_MZONE && pcard->data.type & (TYPE_SPELL + TYPE_TRAP)))
if(pcard->status & STATUS_NO_LEVEL)
lua_pushinteger(L, 0);
else
lua_pushinteger(L, pcard->data.defence);
......@@ -1521,7 +1521,7 @@ int32 scriptlib::card_is_level_below(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lvl = lua_tointeger(L, 2);
if((pcard->data.type & TYPE_XYZ) || (!(pcard->data.type & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)) || pcard->single_effect.count(0x14d72c34)>0)
if((pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_level() <= lvl);
......@@ -1532,7 +1532,7 @@ int32 scriptlib::card_is_level_above(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 lvl = lua_tointeger(L, 2);
if((pcard->data.type & TYPE_XYZ) || (!(pcard->data.type & TYPE_MONSTER) && !(pcard->current.location & LOCATION_MZONE)) || pcard->single_effect.count(0x14d72c34)>0)
if((pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_level() >= lvl);
......@@ -1543,7 +1543,7 @@ int32 scriptlib::card_is_rank_below(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 rnk = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_XYZ))
if(!(pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_rank() <= rnk);
......@@ -1554,7 +1554,7 @@ int32 scriptlib::card_is_rank_above(lua_State *L) {
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 rnk = lua_tointeger(L, 2);
if(!(pcard->data.type & TYPE_XYZ))
if(!(pcard->data.type & TYPE_XYZ) || (pcard->status & STATUS_NO_LEVEL))
lua_pushboolean(L, 0);
else
lua_pushboolean(L, pcard->get_rank() >= rnk);
......
......@@ -4536,9 +4536,8 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
return FALSE;
}
}
if(cait->opinfos.count(0x200))
core.spsummon_state_count[cait->triggering_player]--;
core.units.begin()->peffect = (effect*)(size_t)cait->triggering_effect->operation;
core.units.begin()->arg2 = core.spsummon_state_count[cait->triggering_player];
if(cait->replace_op)
cait->triggering_effect->operation = cait->replace_op;
if(cait->triggering_effect->operation) {
......@@ -4550,6 +4549,8 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
case 3: {
effect* peffect = cait->triggering_effect;
peffect->operation = (ptr)core.units.begin()->peffect;
if(cait->opinfos.count(0x200) && (core.units.begin()->arg2 != core.spsummon_state_count[cait->triggering_player]))
core.spsummon_state_count[cait->triggering_player]--;
if(core.special_summoning.size())
core.special_summoning.clear();
if(core.equiping_cards.size())
......
......@@ -68,7 +68,7 @@ function c81210420.activate(e,tp,eg,ep,ev,re,r,rp)
e5:SetCode(EFFECT_SET_BASE_DEFENCE)
e5:SetValue(0)
tg:RegisterEffect(e5,true)
tg:RegisterFlagEffect(81210420,RESET_EVENT+0x47c0000+RESET_PHASE+PHASE_BATTLE,0,1)
tg:SetStatus(STATUS_NO_LEVEL)
tg=sg:GetNext()
end
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEDOWN_DEFENCE)
......
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