InfernoDeity
2018-01-04T03:55:58Z
I am attempting to write some additional cards, but need to know the Layout Templates of Card Objects and other items.

If there is documentation on this, I would appreciate a link to it, otherwise, if people know the functions and fields of Card Objects in the Lua Scripts, I would like to know. Thank you.

The Specific Card I am trying to write is a Level 10 Synchro Monster with the Following Effect:
1 "Black Peral" Tuner+ 1 or more non-tuner LIGHT monsters.
When this monster attacks a face-up attack position monster with ATK greater than this monsters ATK. This monster gains ATK equal to the difference and that monster loses that much ATK.

The Part I am in need of the Fields for is the code for comparing ATK Values and checking battle position. I have used the card "8-Claws Scorpion" (#14261867 stored in c14261867.lua) as a Reference, but its not super helpful.
Dr. Sexy M.D.
2018-01-05T10:13:40Z
There used to be documentation including the function names and fields, but idk what happened to it. If one exists still I'd be very interested in seeing it. Here's a list of all the functions  (details of the fields not included). Most of the time you can find the functions you need just by looking at similar existing effects. Most of the time the parameters aren't that hard to figure out either. Anything with "tp" in it almost always delineates either the player who activates the effect or the player who is affected by it. When there's two LOCATION_X fields, the first one is that of the activator, the second is his opponent. When functions have "nil" as their last argument, that usually indicates that parameter is exclusions (e.g. "destroy a monster on the field, except this card"). The places that have filter functions put restrictions on the type of cards you can select.

Anyway, the anime card Battlewasp - Halberd the Charge (511001941) has almost the exact effect you need. It was so close I did it for you. I didn't test it, but I think it'll work. Here you go:



I commented it for you since the comment documentation for this game is god-awful. I don't really blame them, though. I tried commenting my stuff for a little bit but it just becomes tedious after a while.
InfernoDeity
2018-01-06T16:27:43Z
Thank you for this. I am going to use it, but also look at it to figure out each part in detail.
I also thank you for the function list.
[YOL]Edo9300
2018-01-06T16:35:23Z
The list posted by Dr sexy MD isn't the complete one, since ygopro Percy has some custom functions, the accurate one is this [url=https://github.com/edo9300/ygopro-core/blob/master/interpreter.cpp][/url], if a function isn't working means it'll be added in the next update
InfernoDeity
2018-01-08T13:54:11Z
I noticed something in the provided script. I don't know if its intentional or you just weren't aware, or not but the condition only filters faceup monsters, while the intent is to filter faceup Attack Position monsters. The effect should not apply to defense position monsters.
Dr. Sexy M.D.
2018-01-08T18:26:19Z
Originally Posted by: InfernoDeity 

I noticed something in the provided script. I don't know if its intentional or you just weren't aware, or not but the condition only filters faceup monsters, while the intent is to filter faceup Attack Position monsters. The effect should not apply to defense position monsters.



You're right. I don't think position matters for the Battlewasp card, and I didn't notice to change it. In the condition, just add "and d:IsPosition(POS_FACEUP_ATTACK)" to the end of the return statement and you should be good. Alternatively, you could use "and d:IsAttackPos()"