Commit dfef9c14 authored by wind2009's avatar wind2009

Merge remote-tracking branch 'upstream/master'

parents f7fe6fe4 d4e635f4
......@@ -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:
......
......@@ -260,11 +260,13 @@ void field::send_to(card_set* targets, effect* reason_effect, uint32 reason, uin
return;
for(auto& pcard : *targets) {
pcard->temp.reason = pcard->current.reason;
pcard->temp.reason_effect = pcard->current.reason_effect;
pcard->temp.reason_player = pcard->current.reason_player;
pcard->current.reason = reason;
pcard->current.reason_effect = reason_effect;
pcard->current.reason_player = reason_player;
if(reason_player != PLAYER_SELFDES) {
pcard->temp.reason_effect = pcard->current.reason_effect;
pcard->temp.reason_player = pcard->current.reason_player;
pcard->current.reason_effect = reason_effect;
pcard->current.reason_player = reason_player;
}
uint32 p = playerid;
// send to hand from deck and playerid not given => send to the hand of controler
if(p == PLAYER_NONE && (destination & LOCATION_HAND) && (pcard->current.location & LOCATION_DECK) && pcard->current.controler == reason_player)
......@@ -1273,7 +1275,7 @@ int32 field::self_destroy(uint16 step, card* ucard, int32 p) {
pcard->temp.reason_player = pcard->current.reason_player;
pcard->current.reason_effect = peffect;
pcard->current.reason_player = peffect->get_handler_player();
send_to(pcard, 0, REASON_EFFECT, PLAYER_NONE, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
send_to(pcard, 0, REASON_EFFECT, PLAYER_SELFDES, PLAYER_NONE, LOCATION_GRAVE, 0, POS_FACEUP);
}
core.self_tograve_set.erase(it);
core.units.begin()->step = 19;
......@@ -3155,6 +3157,7 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
return FALSE;
}
case 29: {
effect* peffect = core.units.begin()->peffect;
group* pgroup = core.units.begin()->ptarget;
pduel->write_buffer8(MSG_SPSUMMONED);
set_spsummon_counter(sumplayer);
......@@ -3163,14 +3166,14 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card* target, uin
for(auto& pcard : pgroup->container) {
if(pcard->spsummon_code)
spsummon_once_set.insert(pcard->spsummon_code);
pcard->set_special_summon_status(pcard->current.reason_effect);
pcard->set_special_summon_status(peffect);
}
for(auto& cit : spsummon_once_set)
++core.spsummon_once_map[sumplayer][cit];
for(auto& pcard : pgroup->container)
raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, pcard->current.reason_effect, 0, pcard->current.reason_player, pcard->summon_player, 0);
raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, peffect, 0, sumplayer, pcard->summon_player, 0);
process_single_event();
raise_event(&pgroup->container, EVENT_SPSUMMON_SUCCESS, core.units.begin()->peffect, 0, sumplayer, sumplayer, 0);
raise_event(&pgroup->container, EVENT_SPSUMMON_SUCCESS, peffect, 0, sumplayer, sumplayer, 0);
process_instant_event();
if(action_type == SUMMON_IN_IDLE) {
adjust_all();
......@@ -3366,9 +3369,9 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
pduel->write_buffer8(MSG_SPSUMMONED);
for(auto& pcard : targets->container) {
check_card_counter(pcard, ACTIVITY_SPSUMMON, pcard->summon_player);
pcard->set_special_summon_status(pcard->current.reason_effect);
pcard->set_special_summon_status(reason_effect);
if(!(pcard->current.position & POS_FACEDOWN))
raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, pcard->current.reason_effect, 0, pcard->current.reason_player, pcard->summon_player, 0);
raise_single_event(pcard, 0, EVENT_SPSUMMON_SUCCESS, reason_effect, 0, reason_player, pcard->summon_player, 0);
int32 summontype = pcard->summon_info & (SUMMON_VALUE_MAIN_TYPE | SUMMON_VALUE_SUB_TYPE);
int32 custom_type = pcard->summon_info & SUMMON_VALUE_CUSTOM_TYPE;
if(summontype && pcard->material_cards.size() && custom_type != SUMMON_VALUE_FUTURE_FUSION) {
......@@ -3382,7 +3385,7 @@ int32 field::special_summon(uint16 step, effect* reason_effect, uint8 reason_pla
else if(summontype == SUMMON_TYPE_LINK)
matreason = REASON_LINK;
for(auto& mcard : pcard->material_cards)
raise_single_event(mcard, &targets->container, EVENT_BE_MATERIAL, pcard->current.reason_effect, matreason, pcard->current.reason_player, pcard->summon_player, 0);
raise_single_event(mcard, &targets->container, EVENT_BE_MATERIAL, reason_effect, matreason, reason_player, pcard->summon_player, 0);
raise_event(&(pcard->material_cards), EVENT_BE_MATERIAL, reason_effect, matreason, reason_player, pcard->summon_player, 0);
}
}
......
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