Commit f86014c5 authored by fallenstardust's avatar fallenstardust

sync ocgcore

parent 9cc69832
......@@ -28,6 +28,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setglobal(lua_state, "os");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "package");
lua_pushnil(lua_state);
lua_setglobal(lua_state, "debug");
luaL_getsubtable(lua_state, LUA_REGISTRYINDEX, "_LOADED");
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "io");
......@@ -35,6 +37,8 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_setfield(lua_state, -2, "os");
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "package");
lua_pushnil(lua_state);
lua_setfield(lua_state, -2, "debug");
lua_pop(lua_state, 1);
//open all libs
scriptlib::open_cardlib(lua_state);
......
......@@ -377,6 +377,8 @@ int32 field::draw(uint16 step, effect* reason_effect, uint32 reason, uint8 reaso
}
core.hint_timing[playerid] |= TIMING_DRAW + TIMING_TOHAND;
adjust_instant();
if(core.overdraw[playerid] && (reason & REASON_RULE))
adjust_all();
core.units.begin()->arg2 = (core.units.begin()->arg2 & 0xff000000) + drawed;
card_set* drawed_set = new card_set;
core.units.begin()->ptarget = (group*)drawed_set;
......
......@@ -3153,11 +3153,11 @@ int32 field::process_battle_command(uint16 step) {
if(core.attack_target)
raise_single_event(core.attack_target, 0, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 1);
raise_event((card*)0, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 0);
process_single_event();
process_instant_event();
core.attacker->set_status(STATUS_BATTLE_DESTROYED, FALSE);
if(core.attack_target)
core.attack_target->set_status(STATUS_BATTLE_DESTROYED, FALSE);
process_single_event();
process_instant_event();
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
pduel->write_buffer8(0);
......@@ -5019,10 +5019,8 @@ int32 field::adjust_step(uint16 step) {
return FALSE;
}
case 15: {
if(!check_event(EVENT_ADJUST)) {
raise_event((card*)0, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
process_instant_event();
}
raise_event((card*)0, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
process_instant_event();
return FALSE;
}
case 16: {
......
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