Commit 4a196f28 authored by nanahira's avatar nanahira

Merge branch 'develop' of github.com:moecube/ygopro-core into develop

parents aa7ff15a bf728087
......@@ -5,10 +5,10 @@ The core logic and lua script processor of YGOPro. This library can be made exte
## Compiling
### 1.) Download Fluorohydride/ygopro
Start by downloading the most parent of the source code. The team developing this project are the defacto edge and experts in our community. The most upto date `ocgcore` is a compiled dll version of the `Fluorohydride/ygopro/ocgcore` folders project.
Start by downloading the most parent of the source code. The team developing this project are the de facto edge and experts in our community. The most up-to-date `ocgcore` is a compiled dll version of the `Fluorohydride/ygopro/ocgcore` folders project.
### 2.) Install Premake4 and Visual Studio 2010 (or later).
Download premake4.exe, put it in `c:\windows` or a similar folder that is globally accessible via `cmd` or PowerShell. Install Visual Studio 2010, it is the system used for the guide because other parts of the project use C# and most the development team are Windows users.
### 2.) Install Premake5 and Visual Studio 2022 (or later).
Download premake5.exe, put it in `c:\windows` or a similar folder that is globally accessible via `cmd` or PowerShell. Install Visual Studio 2022, it is the system used for the guide because other parts of the project use C# and most the development team are Windows users.
### 3.) Download dependencies
Dependencies are absent from the main project. There is information on how to build them but the easiest thing to do is to download the following folders from a [soarqin/ygopro](https://github.com/soarqin/ygopro) fork and simply copy them into the `Fluorohydride/ygopro` folder.
......@@ -22,10 +22,9 @@ Dependencies are absent from the main project. There is information on how to bu
### 4.) Create the project files
Run the following commands from the command line in the `Fluorohydride/ygopro` folder.
` premake4 /help `
` premake4 vs2010 `
` premake5 vs2022 `
If you are not using Visual Studio 2010 or higher, make the needed adjustments. In the file system open `Fluorohydride/ygopro/build` folder open the `ygo` project.
If you are not using Visual Studio 2022 or higher, make necessary adjustments. In the file system open `Fluorohydride/ygopro/build` folder open the `ygo` project.
### 5.) Build the system
Make sure the code actually compiles. Compile them in the following order one by one:
......
......@@ -2694,7 +2694,7 @@ void card::set_special_summon_status(effect* peffect) {
}
card* pcard = peffect->get_handler();
auto cait = pduel->game_field->core.current_chain.rbegin();
if(!(peffect->type & 0x7f0) || pcard->is_has_relation(*cait)) {
if(!(peffect->type & 0x7f0) || (pcard->is_has_relation(*cait) && !(pcard->get_type() & TYPE_TRAPMONSTER))) {
spsummon.code = pcard->get_code();
spsummon.code2 = pcard->get_another_code();
spsummon.type = pcard->get_type();
......
......@@ -218,7 +218,7 @@ enum effect_flag : uint32 {
EFFECT_FLAG_CLIENT_HINT = 0x4000000,
EFFECT_FLAG_CONTINUOUS_TARGET = 0x8000000,
EFFECT_FLAG_LIMIT_ZONE = 0x10000000,
// EFFECT_FLAG_COF = 0x20000000,
EFFECT_FLAG_ACTIVATE_CONDITION = 0x20000000,
// EFFECT_FLAG_CVAL_CHECK = 0x40000000,
EFFECT_FLAG_IMMEDIATELY_APPLY = 0x80000000,
};
......
......@@ -3415,9 +3415,20 @@ int32 scriptlib::duel_get_synchro_material(lua_State *L) {
int32 playerid = (int32)lua_tointeger(L, 1);
if(playerid != 0 && playerid != 1)
return 0;
uint32 facedown = FALSE;
if (lua_gettop(L) >= 2)
facedown = lua_toboolean(L, 2);
duel* pduel = interpreter::get_duel_info(L);
group::card_set mats;
pduel->game_field->get_synchro_material(playerid, &mats);
group* pgroup = pduel->new_group();
pduel->game_field->get_synchro_material(playerid, &pgroup->container);
for (auto cit = mats.begin(); cit != mats.end(); ++cit) {
card* pcard = *cit;
if (pcard->get_status(STATUS_SUMMONING | STATUS_SUMMON_DISABLED | STATUS_SPSUMMON_STEP)
|| pcard->current.location == LOCATION_MZONE && !pcard->is_position(POS_FACEUP) && !facedown)
continue;
pgroup->container.insert(*cit);
}
interpreter::group2value(L, pgroup);
return 1;
}
......
......@@ -1317,7 +1317,8 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit->set_triggering_state(phandler);
}
uint8 tp = clit->triggering_player;
if(check_trigger_effect(*clit) && peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)) {
if(check_trigger_effect(*clit) && peffect->is_chainable(tp)
&& peffect->is_activateable(tp, clit->evt, !peffect->is_flag(EFFECT_FLAG_ACTIVATE_CONDITION))) {
if(tp == core.current_player)
core.select_chains.push_back(*clit);
} else {
......@@ -1378,8 +1379,8 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit->set_triggering_state(phandler);
}
uint8 tp = clit->triggering_player;
if(check_nonpublic_trigger(*clit) && check_trigger_effect(*clit)
&& peffect->is_chainable(tp) && peffect->is_activateable(tp, clit->evt, TRUE)
if(check_nonpublic_trigger(*clit) && check_trigger_effect(*clit) && peffect->is_chainable(tp)
&& peffect->is_activateable(tp, clit->evt, !peffect->is_flag(EFFECT_FLAG_ACTIVATE_CONDITION))
&& check_spself_from_hand_trigger(*clit)) {
if(tp == core.current_player)
core.select_chains.push_back(*clit);
......@@ -1723,7 +1724,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
const tevent& evt = eit->second;
++eit;
peffect->set_activate_location();
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, evt, TRUE, FALSE, FALSE)) {
if(peffect->is_chainable(priority) && peffect->is_activateable(priority, evt, TRUE)) {
card* phandler = peffect->get_handler();
newchain.flag = 0;
newchain.chain_id = infos.field_id++;
......@@ -1855,7 +1856,9 @@ int32 field::process_instant_event() {
effect* peffect = eit->second;
++eit;
card* phandler = peffect->get_handler();
if(!phandler->is_status(STATUS_EFFECT_ENABLED) || !peffect->is_condition_check(phandler->current.controler, ev))
if(!phandler->is_status(STATUS_EFFECT_ENABLED))
continue;
if(!peffect->is_flag(EFFECT_FLAG_ACTIVATE_CONDITION) && !peffect->is_condition_check(phandler->current.controler, ev))
continue;
peffect->set_activate_location();
newchain.flag = 0;
......@@ -1875,7 +1878,8 @@ int32 field::process_instant_event() {
effect* peffect = eit->second;
++eit;
card* phandler = peffect->get_handler();
bool act = phandler->is_status(STATUS_EFFECT_ENABLED) && peffect->is_condition_check(phandler->current.controler, ev);
bool act = phandler->is_status(STATUS_EFFECT_ENABLED)
&& (peffect->is_flag(EFFECT_FLAG_ACTIVATE_CONDITION) || peffect->is_condition_check(phandler->current.controler, ev));
if(!act && !(peffect->range & LOCATION_HAND))
continue;
peffect->set_activate_location();
......@@ -2009,7 +2013,7 @@ int32 field::process_single_event(effect* peffect, const tevent& e, chain_list&
}
} else {
card* phandler = peffect->get_handler();
if(!peffect->is_condition_check(phandler->current.controler, e))
if(!peffect->is_flag(EFFECT_FLAG_ACTIVATE_CONDITION) && !peffect->is_condition_check(phandler->current.controler, e))
return FALSE;
peffect->set_activate_location();
chain newchain;
......
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