fluorohydride / ygopro-core Goto Github PK
View Code? Open in Web Editor NEWygopro script engine.
License: MIT License
ygopro script engine.
License: MIT License
I'm following the steps on Wiki, but I can't compile Ocgcore.
Build log: https://pastebin.com/QJL3sipM
I don't know what to do now, can you help me?
I'm running a VM with Windows 7 & Visual Studio 2010.
yugioh.wikia.com/wiki/Fullmetalfoes_Alkahest
is there any core update to make this card fully functional?
Tnx in advance
When I merged the latest commit of ocgcore into my fork, the ygopro started to crash after the 1st draw phase.
It made my server down, plz be quick to fix this.
ygopro-core
currently only implements OCG rulings, it was even called ocgcore
at one point. There is a very loud and constant call from the user base of YGOPro to have TCG rulings implemented and there is now a body of volunteers to help sort out ruling differences.
I am curious what TCG mechanics are currently implemented, how to trigger them, and how we can move forward with the highly requested feature.
If it is not possible to implement TCG rulings; why, and how can we remove this roadblock? If its a matter of switching between TCG and OCG and doubling the work, why not have the TCG ruled cards in a seperate folder and if the c00000000.lua
file exist use it else use the one in the other file, if TCG mode is enabled.
I am not concerned about server side implementations at this time.
Thank you ahead of time.
Hello, what kind of tools should i used to compile this into native linux software?
for example
Line 270 in 256d78b
While scripting "Pendulum Fusion", some issues came out that might require some alterations to the core for a full functionality. The first is the fact that all fusion procedures, when checking the Fusion Materials, by default use Card.IsCanBeFusionMaterial() with false as the third parameter, guaranteeing that Pendulum cards aren't treated as valid materials regardless of what was written in the Fusion card. This one could be fixed simply via scripting, overwriting Card.IsCanBeFusionMaterial() so that it always considers cards in the Pendulum Zone as valid Fusion Materials, but I think this change should be put in the core as well.
The more pressing issue, however, is a bug some users reported, that prevents Pendulum cards from being used as Materials for "First of the Dragons" (as a reminder, it requires 2 Normal Monsters). I believe this issue stems from the fact that Pendulum cards aren't treated as monsters, but, I think, as cards with type TYPE_PENDULUM+TYPE_SPELL: as such, details like TYPE_NORMAL or TYPE_EFFECT are lost. It should be possible to override Card.IsType() through the script so that it maintains the original type of the card, but I think this would cause all kinds of issues with other cards. Instead, I propose adding a Card.IsFusionType() function to the core (plus related functions, of course), similar to what was done recently with "Predaplant Sundew Kingii" and Card.IsFusionAttribute(): this function would have a clause that lets us use Pendulum cards as their original type for a Fusion Summon alone, while still keeping them as regular Spells for all other cards. Do you think this is a good idea, or can you think of a better solution that doesn't require changing the core?
Incidentally, while not as essential as the above point, a discussion on how to solve these bugs led to an interesting idea for the future: it's not exactly needed at the moment, but do you think it would be possible to eventually add other specific functions like the one above to the core? The ideas proposed ranged from something like Card.IsFusionRace(), to complete the Fusion set, to even counterparts for other Summon methods such as Card.IsXyzAttribute(). Such functions would allow more possibilities for card scripting, and at the same time prevent issues like these that might arise in the future. What do you think?
Options:
See also: edo9300/ygopro-core#43
There is a problem with cards like "Vampire Sorcerer" being Xyz Materials and "Space Cyclone".
Example scenario: I have an Xyz Monster with "Vampire Sorcerer" attached to it as Xyz Material. My opponent uses "Space Cyclone" to detach it and send it to the Graveyard.
Currently in this scenario, you cannot activate the effect of "Vampire Sorcerer" to add 1 DARK "Vampire" monster or 1 "Vampire" Spell/Trap from your Deck to your hand, because Xyz Materials are treated as being controlled by "PLAYER_NONE" so the "GetPreviousControler()==tp" check returns false. Also, I believe that control switching isn't considering a card having Xyz Materials, so that part might need a rework overall.
Ruling below asked by sending an email to the OCG office.
Q.
自分フィールドの「ヴァンパイア・ソーサラー」2体をエクシーズ素材として、「ジェムナイト・パール」をエクシーズ召喚します。その後、相手は「スペース・サイクロン」を発動し、その二つのうちの一つ「ヴァンパイア・ソーサラー」を墓地え送る。
この状況で、「ヴァンパイア・ソーサラー」の『①』の効果を発動することができますか?
A.
ご質問の場合、「ヴァンパイア・ソーサラー」の『①』の効果を発動することができます。
Rough Translation
Q. I Xyz Summon "Gem-Knight Pearl" using 2 "Vampire Sorcerer" I control. After that, the opponent activates "Space Cyclone" and sends one of the two "Vampire Sorcerer" to the Graveyard.
In this situation, can I activate the ① effect of "Vampire Sorcerer"?
A.
In this situation, you can activate the ① effect of "Vampire Sorcerer".
How to use this, and make opponent do automatic moves??
The following reasons make it very complicate when checking if there are available zones for placing cards on field:
since New Master Rule, monster in extra deck must be special summoned to extra monster zones or linked zones
since Master Rule 2020, Fusion/Synchro/Xyz monster in extra deck need not be special summoned to extra monster zones or linked zones
when changing controller of a monster, it must be placed in main monster zone
when activating/setting Field Spell, it must be placed in field zone, ignoring whether there is a field card there already
when activating Pendulum card, it must be placed in pendulum zone, which also used for Spell/Trap cards
--[[
tp: location of whom to count
location: LOCATION_MZONE or LOCATION_SZONE
sg: card or group that going to field
mat: card or group that going to leave field
zone: get count only in specific zone
[sg2: card or group that going to field after sg moved to field
mat2: card or group that going to leave field for sg2
if it contains some cards in sg, assume them on field
zone2: get count only in specific zone for sg2
...]
uplayer: the player who use location
reason: LOCATION_REASON_TOFIELD or LOCATION_REASON_CONTROL
]]--
Duel.GetLocationCount(tp,location,sg,mat,zone,[sg2,mat2,zone2,...]uplayer,reason)
if the type 3rd parameter is not card or group, fall back to the old signicature
I run premake gmake and get /home/ygo/ygopro-core/premake4.lua:1: no active solution
I was "studying" cards with attack cost, and i found a weird interaction with them, and unfortunately followed by almost unexisting rulings. The situation i took in example was mist valley falcon, and toll. The problem is this, when resolving the attack cost of falcon, if you return toll, then you shouldn't pay the 500 lp as cost, since the card is no longer on the field. I tried this on legacy of the duelist too, and apparently that game confirms this interaction, even if idk how reliable is that. So i think that attack costs need some other rulings and an update, because theoretically, if the order really matters, then you should be able to select the order for paying the costs, like for the segoc.
@VanillaSalt @DailyShana @mercury233
Under some circumstrances, when forced effects triggers, the core will simply remain stuck, in the archive there's a video that shows this happening. The field is set in this way: Both players control 1 King Tiger Wanghu each, and they have 2 dandylion each in their hands, p1 use hand destruction, and after it resolves, the 4 dandylions trigger summoning 8 tokens, then the King Tigers try to resolve, the p1's correctly triggers 4 times, while the p2's make teh game get stuck after triggering 1 time.
2018-11-13 19-50-52.zip
When calling Duel.GetControl() with reset_count>1, monsters won't return to its previous controller.
Double Magical Arm Bind(72621670), Heartfelt Appeal(32065885) and so on have such problem.
there a problem with power wall and chaos max interaction
power wall states:
During damage calculation, when you would take battle damage from an opponent's attacking monster: Send 1 card from the top of your Deck to the Graveyard for every 500 damage (round up) you are about to take, also you take no battle damage from that battle.
let suppose a player have a 0 def monster they get attacked by chaos max, acording ruling he should send 2x4000/500=16 card from deck to grave (cause chaos max double piercing damage), but current im game power wall activates and get the damage before chaos max double it, with gives 4000/500=8 wich is half of what it should send, so i guess GetBattleDamage need some update
We would like to implement Goat Format with ygopro, but one of the essential rules was that replays behaved differently. During 2005, if an attack was cancelled during a replay, the player was able to choose to attack with the same monster later in the same Battle Phase. This was later changed in 2006 to the rules enforced today. In my mind for how this would work, it would be a checkbox like how "Enable Obsolete TCG Rulings" works.
This function, needs a rewrite in the core, atm, you can only use 1 opponent's monster as extra tribute regardless of his many EFFECT_EXTRA_RELEASE_SUM effects are applied and what their count limit is. This problem never shown up because the only card using this effect was "The Monarchs Stormforth" that only allows you to use 1 monster and its an hard once per turn. But with "Vampire Sucker" it's different, because you can use any number of zombie monsters with no "use limit", so as long as you can summon and your opponent controls a zombie, and with the actual handling, it works in the same way as stormforth, so it only allows you to use 1 monster, and in the case of both the effects of sucker and stormforth applying the result is the same.
im sure it will be usefull EVENT, can you add it?
there a implemented mode on ygopro percy that actually need this effect, actually can't hardcode it cause not simply like "when this card effect shuffle a deck" but at "when the deck is shuffled" indepedent of what card shuffled it.
There was a EFFECT_FLAG_CHAIN_UNIQUE
, which make effect of the same card name can be activated only once in a chain.
EFFECT_COUNT_CODE_CHAIN
is designed to recover and extend this usage.
e:SetCountLimit(1,EFFECT_COUNT_CODE_CHAIN)
--the effect e itself can be only activated once in a chain
e1:SetCountLimit(1,code+EFFECT_COUNT_CODE_CHAIN)
e2:SetCountLimit(1,code+EFFECT_COUNT_CODE_CHAIN)
--e1, e2 and e1, e2 of other cards with the same name can be only activated once in a chain
e1:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE+EFFECT_COUNT_CODE_CHAIN)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE+EFFECT_COUNT_CODE_CHAIN)
--e1, e2 of the same card can be only activated once in a chain
As it's written in the title, the funciton ChangeAttacker() doesn't work anymore, i think this is caused by the removing of sub_attacker in this commit: 8804e8c#diff-4d3e75d312bd06042b71854fa0c82846
Because after this change, the game doesn't check properly the new attacker, so the attack is canceled
It seems that EFFECT_SCRAP_CHIMERA
can been replaced by EFFECT_TUNER_MATERIAL_LIMIT
, so why don't we remove it? @VanillaSalt
As the title said, there's an issue with EVENT_LEAVE_FIELD, after this effect is called, all the relations with other effects with its handler are resetted, but including also that triggered effect itself, this causes issues with cards that negates an effet and then do something with its handler, like Invoked Mechaba, and since the re:GetHandler():IsRelateToEffect(re)
returns false, in the case of mechaba, the mosnter is not banished.
here
Lines 3910 to 3916 in 7da0970
Line 3952 in 7da0970
The Tag Duel rules on YGOPro are based on the OCG's rules for how to play it, which are listed here: http://www.yugioh-card.com/japan/howto/
However, this is one of the rules listed that contradicts with how Tag Dueling works on YGOPro
If an effect returns a card from the field, Graveyard, etc. to the hand or Deck, the card is returned to its original owner's hand/Deck.
Currently, a card returned to the hand/Deck will return to the current player rather than the original owner.
There's also a rule where a player cannot use his/her partner's face-up Pendulum Monsters from the Extra Deck
Each player uses his/her own Extra Deck, and cannot refer to or use cards that are in his/her partner's Extra Deck. Therefore, the Pendulum Monsters that have been placed on your partner's Extra Deck cannot be used.
Add a new byte to indicate whether it's a new selection or part of some selection process, so that the client can use this information to make the selection more smoothly. For example, the card list panel do not need flash, to avoid Fluorohydride/ygopro#2249.
Maybe there are other improvement.
简单的说就是脚本里面加一个EFFECT_TYPE_TRIGGER_F/EFFECT_TYPE_TRIGGER_O来辨认这张卡要不要自动排序连锁。TCG/OCG主要这一个区别。而且实现起来很方便。
我觉得如果OCGcore需要实现TCG的话,最快最方便的解决方案就是这个。
如果允许合并到ocgcore的话,这个方案是改动最小的。
AntiMetaman的原文如下:
The major difference between tcg and ocg is SEGOC. This is the "Auto Chain Order" function in ygopro. When a duel uses the ocg banlist, Auto Chain Order should always be OFF.
When the duel uses the tcg banlist, Auto Chain Order should be ON for mandatory trigger effects but it should be OFF for optional trigger effects.
The way to distinguish between mandatory and optional is EFFECT_TYPE_TRIGGER_F is forced (non-optional)
EFFECT_TYPE_TRIGGER_O is optional
This will be in the script.
Hence, you can write an if statement to chain when Auto Chain Order should be off and on for tcg. Then it is very accurate.
i think that cards like No.41 may need this chain info, since it need to get the position when a monster's effect is activated. https://github.com/Fluorohydride/ygopro-scripts/pull/890 is also a solution which checks the effect relation of the monster activating an effect. but i think it may be better to use Duel.GetChainInfo with CHAININFO_TRIGGERING_POSITION. the pull above may be ok because ocg doesn't have an effect with a cost which move a card twice. but it may still have issues when a cost which moves a card more than once comes out in the future.
This effect is a it bugged, as long as you have synchro monsters in you extra deck that could be summoned by using the tuner with that effect, but the materials doesn't satisfy the limit, it does what it should do and prevent the summon, but this doesn't happen when there's another synchro monsters in you extra deck, that cannot be summoned by using the monster with the limit as material, but that monsters make the procedure bypass the filter and allows you to use that monster with the wrong materials to summon a synchro monste. @VanillaSalt @mercury233
I got this error on gcc 4.8.5 and gcc 4.9.1 after updating 9e7c8ca .
In file included from ../ocgcore/duel.cpp:9:0:
../ocgcore/interpreter.h: In static member function ‘static char* interpreter::strcpy(char (&)[N], const char*)’:
../ocgcore/interpreter.h:79:55: error: there are no arguments to ‘strncpy’ that depend on a template parameter, so a declaration of ‘strncpy’ must be available [-fpermissive]
return strncpy(reinterpret_cast<char*>(&dst), src, N);
^
../ocgcore/interpreter.h:79:55: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
make[1]: *** [../obj/Release/ocgcore/duel.o] Error 1
add -fpermissive
to premake4.lua
will ignore this, but is there a better way to fix it?
According to a mail from Konami, the mutual linked group of extra linked cards should also pass this.
I'm a little busy preparing for the coming exam now. Anyone can update that?
ハルトマンの妖怪少女 2018/1/11 21:13:14
==== Building ocgcore (release) ====
card.cpp
duel.cpp
effect.cpp
field.cpp
group.cpp
interpreter.cpp
../ocgcore/interpreter.cpp:331:27: error: ‘effect_get_activate_sequence’ is not a member of ‘scriptlib’
{ "GetActivateSequence", scriptlib::effect_get_activate_sequence },
^
make[1]: *** [../obj/Release/ocgcore/interpreter.o] Error 1
make: *** [ocgcore] Error 2
If you summon a gemini monster treated as normal already on the field via a card effect, the summon won't be completed properly. Basically in this part https://github.com/Fluorohydride/ygopro-core/blob/master/operations.cpp#L1858-L1865, if the card that is summoning is the first activated in the chain, it will make the processor return true and will prevent the summon procedure from continuing. This leads to some bugs: Gemini monsters that have single effects activated when summoned again, like Google Golem or Skelesaurus, won't have their effects applied so in these 2 cases, Google Golem's ATK will remain 1700 and Skelesaurus' stats won't change, also this prevent the game raising EVENT_SUMMON_SUCCES, so cards that triggers on monsters summon won't. I tried to remove this last else and make this https://github.com/Fluorohydride/ygopro-core/blob/master/operations.cpp#L1855 checks for greater than 0 rather than 1, and it seems to work, but honestly i don't fully understand why this has been made. Also if, instead of returning true, false is returned it will trigger a recursive event.
Good evening,
I am SuperAndroid17, owner of YGOPro DevPro, I would like to inquire about a recent update to OCGCore. The core has been causing frequent crashes to our server for the past month. With plenty of out of memory exceptions, we are to believe that these errors happened from this commit and on. As a result, our server has become very unstable and it’s frustrating to our users. If needed, I have numerous screenshots of the errors that occur should you like to see them.
Thank you for your time.
As title says, when a card is overlayed, the previous informations aren't updated to the values the card had on the field, a side efect of this is effects like add_setcode or add_code not being considered when calling previoussetcard/previouscode on the card as xyz material (they're being updated only on move card).
he's called soarqin not soarquin
When the player is resolving multiple costs at the same time, for example returning a card to attack with mist valley falcon and paying 500 LP to attack with toll, when the opponent has a card that deals damage when a card is returned to the hand, atm if falcon's cost is paid first, the opponent's card will immediately deal damage, before paying the cost for toll, and that is incorrect, because effects should trigger after all the costs are paid. Still in the same field situation as above, if you have only 600 LP, and the opponent's card deals you 500 damage, then you won't be able to pay toll, and this is incorrect, the right way of resolving the effects should be this: return to the hand, pay 500 LP, so you only have 100 LP left, then the card deals you 500 damage, making you lose
Specifically this function is kinda necessary for Desperate Tag. I hope it could be made.
how about different 'ot' like 1 for ocg, 2 for tcg, 3 for tcg/ocg, 4 for anime, 8 for illegal, 16 for video game exclusive, and 32 for custom?
The function Card.IsSetCard(card c, uint32 set_code) exists but doesn't exists the function Card.GetSetCard(card c) to get the archetypes of a card. This function would be useful to me
After the last fix that fixes one error, the code compilation has been successful, but the linker has some problems.
Make EFFECT_TYPE_CONTINUOUS
of EVENT_CHAINING
or EVENT_BECOME_TARGET
with EFFECT_FLAG_DELAY
excuted at EVENT_CHAIN_SOLVED
.
Similar to Fluorohydride/ygopro-scripts#1294, this will simplify many continuous effects that triggered by activation of effects, like placing Spell Counters.
EFFECT_REFLECT_BATTLE_DAMAGE
EFFECT_CHANGE_BATTLE_DAMAGE
I and my friends are happy to make original scripts or play with anime cards, but we found some cards don't act properly because client code returns false although it don't need to be. (Such as ANIME Xianke Magician)
I found some examples, but actually I don't understand codes well. So, I will be glad if you accept these changes, but you'll need to check bugs or latency first.
Thank you for reading.
line 364
uint32 card::get_type() {
if(assume_type == ASSUME_TYPE)
return assume_value;
if(!(current.location & 0x1e))
return data.type;
if((current.location == LOCATION_SZONE) && (current.sequence >= 6))
return TYPE_PENDULUM + TYPE_SPELL;
if (temp.type != 0xffffffff)
return temp.type;
effect_set effects;
int32 type = data.type;
temp.type = data.type;
->
uint32 card::get_type() {
if(assume_type == ASSUME_TYPE)
return assume_value;
if(!(current.location & 0x1e))
return data.type;
if (temp.type != 0xffffffff)
return temp.type;
effect_set effects;
int32 type = data.type;
if((current.location == LOCATION_SZONE) && (current.sequence >= 6))
type = TYPE_PENDULUM + TYPE_SPELL;
temp.type = data.type;
line 776
uint32 card::get_level() {
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL)
|| (!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)))
return 0;
if(assume_type == ASSUME_LEVEL)
return assume_value;
->
uint32 card::get_level() {
if(assume_type == ASSUME_LEVEL)
return assume_value;
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL)
|| (!(data.type & TYPE_MONSTER) && !(get_type() & TYPE_MONSTER) && !is_affected_by_effect(EFFECT_PRE_MONSTER)))
return 0;
line 817
uint32 card::get_rank() {
if(!(data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
if(assume_type == ASSUME_RANK)
return assume_value;
->
uint32 card::get_rank() {
if(assume_type == ASSUME_RANK)
return assume_value;
if(!(data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
line 859
uint32 card::get_synchro_level(card* pcard) {
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
->
uint32 card::get_synchro_level(card* pcard) {
if(((data.type & TYPE_XYZ) && !is_affected_by_effect(EFFECT_SYNCHRO_LEVEL)) || (status & STATUS_NO_LEVEL))
return 0;
line 871
uint32 card::get_ritual_level(card* pcard) {
if((data.type & TYPE_XYZ) || (status & STATUS_NO_LEVEL))
return 0;
->
uint32 card::get_ritual_level(card* pcard) {
if(((data.type & TYPE_XYZ) && !is_affected_by_effect(EFFECT_RITUAL_LEVEL)) || (status & STATUS_NO_LEVEL))
return 0;
line 2875
int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
if(data.type & TYPE_XYZ)
return FALSE;
->
int32 card::is_can_be_synchro_material(card* scard, card* tuner) {
if((data.type & TYPE_XYZ) && !is_affected_by_effect(EFFECT_SYNCHRO_LEVEL))
return FALSE;
I am using Super Polymerization as example, but this demonstrates that continuous effects might be applying at incorrect times and/or causing actions to become illegal moves in the middle of their resolution/execution:
I control Yuki-Musume, the Ice Mayakashi and have 1 Starving Venom Fusion Dragon in my Extra Deck. My opponent controls any 1 DARK monster and 1 Destiny Hero - Plasma and its effect that negates my monster's effects is applying, negating Yuki-Musume, the Ice Mayakashi's effect.
If i activate Super Polymerization what happens at the moment:
When Bait Doll targets Treacherous Trap Hole, cards immune to Spell effects are not destroyed, and cards immune to Trap effects are, which is the reverse of the correct interaction. This is because the "Reason Effect" applying Duel.Destroy
is that of Bait Doll, a Spell Card.
Would be be possible to have a function that makes clear that the effect applying the operation is that of Bait Doll's target, not Bait Doll itself?
This requires someone with admin access to setup.
In the MoeCube project there are automatic build steps triggered on commit. Please add those same steps to the ygopro-core
project so that the libary is built for win32
, win64
, linux
, and darwin
systems. This will allow external projects to carry on development easily. The ygopro
gframe was developed as a "test" UI, its time for it to be refactored, or rewritten. Other people are doing so. Please do not hinder and antagonize them.
Builds should always produce results that a separate team can download and test against. They should be archived onto Github. When the developers here feel the code base is stable, they should "cut a release", and release the compiled versions for download.
The things I am describing are standard practices for software development. I recommend TravisCI
Hello. I tried to recompile ygopro, but compiler found this error
http://meshnet-users.tk/paste/p/hosb/y.txt
If you can fix ... ;)
Fluorohydride it would be possible to add to the game in the constant "ShuffleSetCard" cards in the Spell / trap zone?, for example the Darkness card (100000590) has this effect, however it is not included in your script:
http://yugioh.wikia.com/wiki/Darkness
Thank you for your attention.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.