Commit 9f3d490d authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent d54e6d6c
...@@ -3574,7 +3574,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) { ...@@ -3574,7 +3574,7 @@ int32 card::is_capable_send_to_hand(uint8 playerid) {
return FALSE; return FALSE;
if(is_affected_by_effect(EFFECT_CANNOT_TO_HAND)) if(is_affected_by_effect(EFFECT_CANNOT_TO_HAND))
return FALSE; return FALSE;
if(is_extra_deck_monster() && !is_capable_send_to_extra(playerid)) if(is_extra_deck_monster() && !is_capable_send_to_deck(playerid))
return FALSE; return FALSE;
if(!pduel->game_field->is_player_can_send_to_hand(playerid, this)) if(!pduel->game_field->is_player_can_send_to_hand(playerid, this))
return FALSE; return FALSE;
...@@ -3594,7 +3594,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) { ...@@ -3594,7 +3594,7 @@ int32 card::is_capable_send_to_deck(uint8 playerid) {
int32 card::is_capable_send_to_extra(uint8 playerid) { int32 card::is_capable_send_to_extra(uint8 playerid) {
if(!is_extra_deck_monster() && !(data.type & TYPE_PENDULUM)) if(!is_extra_deck_monster() && !(data.type & TYPE_PENDULUM))
return FALSE; return FALSE;
if(is_extra_deck_monster() && is_affected_by_effect(EFFECT_CANNOT_TO_DECK)) if(is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE; return FALSE;
if(!pduel->game_field->is_player_can_send_to_deck(playerid, this)) if(!pduel->game_field->is_player_can_send_to_deck(playerid, this))
return FALSE; return FALSE;
...@@ -3605,7 +3605,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) { ...@@ -3605,7 +3605,7 @@ int32 card::is_capable_cost_to_grave(uint8 playerid) {
uint32 dest = LOCATION_GRAVE; uint32 dest = LOCATION_GRAVE;
if(data.type & TYPE_TOKEN) if(data.type & TYPE_TOKEN)
return FALSE; return FALSE;
if((data.type & TYPE_PENDULUM) && (current.location & LOCATION_ONFIELD)) if((data.type & TYPE_PENDULUM) && (current.location & LOCATION_ONFIELD) && !is_affected_by_effect(EFFECT_CANNOT_TO_DECK))
return FALSE; return FALSE;
if(current.location == LOCATION_GRAVE) if(current.location == LOCATION_GRAVE)
return FALSE; return FALSE;
......
...@@ -1132,29 +1132,6 @@ int32 scriptlib::duel_check_timing(lua_State *L) { ...@@ -1132,29 +1132,6 @@ int32 scriptlib::duel_check_timing(lua_State *L) {
lua_pushboolean(L, (pduel->game_field->core.hint_timing[0]&tm) || (pduel->game_field->core.hint_timing[1]&tm)); lua_pushboolean(L, (pduel->game_field->core.hint_timing[0]&tm) || (pduel->game_field->core.hint_timing[1]&tm));
return 1; return 1;
} }
int32 scriptlib::duel_get_environment(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L);
effect_set eset;
card* pcard = pduel->game_field->player[0].list_szone[5];
int32 code = 0;
int32 p = 2;
if(pcard == 0 || pcard->is_position(POS_FACEDOWN) || !pcard->get_status(STATUS_EFFECT_ENABLED))
pcard = pduel->game_field->player[1].list_szone[5];
if(pcard == 0 || pcard->is_position(POS_FACEDOWN) || !pcard->get_status(STATUS_EFFECT_ENABLED)) {
pduel->game_field->filter_field_effect(EFFECT_CHANGE_ENVIRONMENT, &eset);
if(eset.size()) {
effect* peffect = eset.get_last();
code = peffect->get_value();
p = peffect->get_handler_player();
}
} else {
code = pcard->get_code();
p = pcard->current.controler;
}
lua_pushinteger(L, code);
lua_pushinteger(L, p);
return 2;
}
int32 scriptlib::duel_is_environment(lua_State *L) { int32 scriptlib::duel_is_environment(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
uint32 code = (uint32)lua_tointeger(L, 1); uint32 code = (uint32)lua_tointeger(L, 1);
...@@ -4648,7 +4625,6 @@ static const struct luaL_Reg duellib[] = { ...@@ -4648,7 +4625,6 @@ static const struct luaL_Reg duellib[] = {
{ "RaiseEvent", scriptlib::duel_raise_event }, { "RaiseEvent", scriptlib::duel_raise_event },
{ "RaiseSingleEvent", scriptlib::duel_raise_single_event }, { "RaiseSingleEvent", scriptlib::duel_raise_single_event },
{ "CheckTiming", scriptlib::duel_check_timing }, { "CheckTiming", scriptlib::duel_check_timing },
{ "GetEnvironment", scriptlib::duel_get_environment },
{ "IsEnvironment", scriptlib::duel_is_environment }, { "IsEnvironment", scriptlib::duel_is_environment },
{ "Win", scriptlib::duel_win }, { "Win", scriptlib::duel_win },
{ "Draw", scriptlib::duel_draw }, { "Draw", scriptlib::duel_draw },
......
...@@ -428,7 +428,6 @@ public: ...@@ -428,7 +428,6 @@ public:
static int32 duel_raise_event(lua_State *L); static int32 duel_raise_event(lua_State *L);
static int32 duel_raise_single_event(lua_State *L); static int32 duel_raise_single_event(lua_State *L);
static int32 duel_check_timing(lua_State *L); static int32 duel_check_timing(lua_State *L);
static int32 duel_get_environment(lua_State *L);
static int32 duel_is_environment(lua_State *L); static int32 duel_is_environment(lua_State *L);
static int32 duel_win(lua_State *L); static int32 duel_win(lua_State *L);
......
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