TICKET-388. contract/lua-reference/generate.py is a Python port of yugioh-legacy-server's duel-engine/ocgcore/lua-reference.sh (bash + awk): one api-<class>.md per luaL_Reg table in core/lib*.cpp (Card, Duel, Effect, Group, Debug; 670 functions) and api-globals.md for the 37 globals interpreter.cpp sets. Row counts match the server repo's committed reference exactly. Regenerate and commit after any core change to those files. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
8.3 KiB
8.3 KiB
Duel
Generated from
core/bycontract/lua-reference/generate.py; never edited by hand. Every function the core registers onDuelis listed, and nothing else: a name that isn't here isn't in the core (the card scripts'library/defines the rest). A method is called on an object too (c:IsCode(id)isCard.IsCode(c, id)). Arguments is the fewest the core accepts, counting the object.
| Function | Arguments |
|---|---|
Duel.Activate |
1 |
Duel.AddCustomActivityCounter |
3 |
Duel.AdjustAll |
any |
Duel.AdjustInstantly |
any |
Duel.AnnounceAttribute |
3 |
Duel.AnnounceCard |
1 |
Duel.AnnounceCardFilter |
1 |
Duel.AnnounceCardSilent |
any |
Duel.AnnounceCoin |
1 |
Duel.AnnounceLevel |
1 |
Duel.AnnounceNumber |
2 |
Duel.AnnounceRace |
3 |
Duel.AnnounceType |
1 |
Duel.BreakEffect |
any |
Duel.CalculateDamage |
2 |
Duel.ChainAttack |
any |
Duel.ChangeAttackTarget |
1 |
Duel.ChangeAttacker |
1 |
Duel.ChangeBattleDamage |
2 |
Duel.ChangeChainOperation |
2 |
Duel.ChangePosition |
2 |
Duel.ChangeTargetCard |
2 |
Duel.ChangeTargetParam |
2 |
Duel.ChangeTargetPlayer |
2 |
Duel.CheckChainTarget |
2 |
Duel.CheckChainUniqueness |
any |
Duel.CheckEvent |
1 |
Duel.CheckLPCost |
2 |
Duel.CheckLocation |
3 |
Duel.CheckMustMaterial |
3 |
Duel.CheckPhaseActivity |
any |
Duel.CheckReleaseGroup |
any |
Duel.CheckReleaseGroupEx |
any |
Duel.CheckRemoveOverlayCard |
5 |
Duel.CheckSummonedCount |
any |
Duel.CheckSynchroMaterial |
5 |
Duel.CheckTiming |
1 |
Duel.CheckTribute |
2 |
Duel.CheckTunerMaterial |
6 |
Duel.CheckXyzMaterial |
6 |
Duel.ClearChainMeta |
1 |
Duel.ClearMeta |
any |
Duel.ClearOperationInfo |
1 |
Duel.ClearRegistry |
any |
Duel.ClearTargetCard |
any |
Duel.ConfirmCards |
2 |
Duel.ConfirmDecktop |
2 |
Duel.ConfirmExtratop |
2 |
Duel.CreateToken |
2 |
Duel.Damage |
3 |
Duel.Destroy |
2 |
Duel.DisableActionCheck |
1 |
Duel.DisableSelfDestroyCheck |
any |
Duel.DisableShuffleCheck |
any |
Duel.DiscardDeck |
3 |
Duel.DiscardHand |
5 |
Duel.Draw |
3 |
Duel.EnableGlobalFlag |
1 |
Duel.Equip |
3 |
Duel.EquipComplete |
any |
Duel.Exile |
2 |
Duel.GetActivityCount |
2 |
Duel.GetAttackTarget |
any |
Duel.GetAttacker |
any |
Duel.GetBattleDamage |
1 |
Duel.GetBattleMonster |
1 |
Duel.GetBattledCount |
1 |
Duel.GetCardsInZone |
2 |
Duel.GetChainEvent |
1 |
Duel.GetChainInfo |
1 |
Duel.GetChainMaterial |
1 |
Duel.GetChainMetaKeys |
1 |
Duel.GetChainMetaValue |
2 |
Duel.GetCoinResult |
any |
Duel.GetControl |
2 |
Duel.GetCounter |
4 |
Duel.GetCurrentChain |
any |
Duel.GetCurrentPhase |
any |
Duel.GetCustomActivityCount |
3 |
Duel.GetDecktopGroup |
2 |
Duel.GetDiceResult |
any |
Duel.GetDrawCount |
1 |
Duel.GetExtraTopGroup |
2 |
Duel.GetFieldCard |
3 |
Duel.GetFieldGroup |
3 |
Duel.GetFieldGroupCount |
3 |
Duel.GetFirstMatchingCard |
5 |
Duel.GetFirstTarget |
any |
Duel.GetFlagEffect |
2 |
Duel.GetFlagEffectLabel |
2 |
Duel.GetFusionMaterial |
1 |
Duel.GetLP |
1 |
Duel.GetLastSelectHint |
any |
Duel.GetLinkedGroup |
3 |
Duel.GetLinkedGroupCount |
3 |
Duel.GetLinkedZone |
1 |
Duel.GetLocationCount |
2 |
Duel.GetLocationCountFromEx |
1 |
Duel.GetMZoneCount |
1 |
Duel.GetMasterRule |
any |
Duel.GetMatchingGroup |
5 |
Duel.GetMatchingGroupCount |
5 |
Duel.GetMetaKeys |
any |
Duel.GetMetaValue |
any |
Duel.GetMustMaterial |
2 |
Duel.GetOperatedGroup |
any |
Duel.GetOperationCount |
1 |
Duel.GetOperationInfo |
2 |
Duel.GetOverlayCount |
3 |
Duel.GetOverlayGroup |
3 |
Duel.GetRandomNumber |
any |
Duel.GetReadyChain |
any |
Duel.GetRegistry |
any |
Duel.GetRegistryKeys |
any |
Duel.GetRegistryValue |
1 |
Duel.GetReleaseGroup |
1 |
Duel.GetReleaseGroupCount |
1 |
Duel.GetRitualMaterial |
1 |
Duel.GetRitualMaterialEx |
1 |
Duel.GetSZoneCount |
1 |
Duel.GetSynchroMaterial |
1 |
Duel.GetTargetCount |
5 |
Duel.GetTargetsRelateToChain |
any |
Duel.GetTributeCount |
1 |
Duel.GetTributeGroup |
1 |
Duel.GetTurnCount |
any |
Duel.GetTurnPlayer |
any |
Duel.GetUsableMZoneCount |
1 |
Duel.GrabSelectedCard |
any |
Duel.HasChainMetaValue |
2 |
Duel.HasMetaValue |
any |
Duel.Hint |
3 |
Duel.HintSelection |
1 |
Duel.IncreaseSummonedCount |
any |
Duel.IsAbleToEnterBP |
any |
Duel.IsBattlePhase |
any |
Duel.IsCanAddCounter |
1 |
Duel.IsCanRemoveCounter |
6 |
Duel.IsChainDisablable |
1 |
Duel.IsChainDisabled |
1 |
Duel.IsChainNegatable |
1 |
Duel.IsChainSolving |
any |
Duel.IsDamageCalculated |
any |
Duel.IsEnvironment |
1 |
Duel.IsExistingMatchingCard |
6 |
Duel.IsExistingTarget |
6 |
Duel.IsGlobalFlag |
1 |
Duel.IsMainPhase |
any |
Duel.IsPhase |
1 |
Duel.IsPlayerAffectedByEffect |
2 |
Duel.IsPlayerCanAdditionalSummon |
1 |
Duel.IsPlayerCanDiscardDeck |
2 |
Duel.IsPlayerCanDiscardDeckAsCost |
2 |
Duel.IsPlayerCanDraw |
1 |
Duel.IsPlayerCanFlipSummon |
1 |
Duel.IsPlayerCanMSet |
1 |
Duel.IsPlayerCanRelease |
1 |
Duel.IsPlayerCanRemove |
1 |
Duel.IsPlayerCanSSet |
1 |
Duel.IsPlayerCanSendtoDeck |
1 |
Duel.IsPlayerCanSendtoGrave |
1 |
Duel.IsPlayerCanSendtoHand |
1 |
Duel.IsPlayerCanSpecialSummon |
1 |
Duel.IsPlayerCanSpecialSummonCount |
2 |
Duel.IsPlayerCanSpecialSummonMonster |
2 |
Duel.IsPlayerCanSummon |
1 |
Duel.IsSummonCancelable |
any |
Duel.IsTurnPlayer |
1 |
Duel.LinkSummon |
3 |
Duel.LoadScript |
1 |
Duel.MSet |
4 |
Duel.MajesticCopy |
2 |
Duel.MoveSequence |
2 |
Duel.MoveToField |
6 |
Duel.MoveTurnCount |
any |
Duel.NegateActivation |
1 |
Duel.NegateAttack |
any |
Duel.NegateEffect |
1 |
Duel.NegateRelatedChain |
2 |
Duel.NegateSummon |
1 |
Duel.Overlay |
2 |
Duel.PayLPCost |
2 |
Duel.RDComplete |
any |
Duel.RaiseEvent |
7 |
Duel.RaiseSingleEvent |
7 |
Duel.ReadCard |
2 |
Duel.Readjust |
any |
Duel.Recover |
3 |
Duel.RegisterEffect |
2 |
Duel.RegisterFlagEffect |
5 |
Duel.Release |
2 |
Duel.ReleaseRitualMaterial |
1 |
Duel.Remove |
3 |
Duel.RemoveCounter |
6 |
Duel.RemoveOverlayCard |
6 |
Duel.ResetFlagEffect |
2 |
Duel.ResetTimeLimit |
1 |
Duel.ReturnToField |
1 |
Duel.RevealSelectDeckSequence |
any |
Duel.RockPaperScissors |
any |
Duel.SSet |
2 |
Duel.SelectDisableField |
5 |
Duel.SelectEffectYesNo |
2 |
Duel.SelectField |
5 |
Duel.SelectFusionMaterial |
3 |
Duel.SelectMatchingCard |
8 |
Duel.SelectOption |
1 |
Duel.SelectPosition |
3 |
Duel.SelectReleaseGroup |
any |
Duel.SelectReleaseGroupEx |
any |
Duel.SelectSequence |
any |
Duel.SelectSynchroMaterial |
6 |
Duel.SelectTarget |
8 |
Duel.SelectTribute |
4 |
Duel.SelectTunerMaterial |
7 |
Duel.SelectXyzMaterial |
6 |
Duel.SelectYesNo |
2 |
Duel.SendtoDeck |
4 |
Duel.SendtoExtraP |
3 |
Duel.SendtoGrave |
2 |
Duel.SendtoHand |
3 |
Duel.SetChainLimit |
1 |
Duel.SetChainLimitTillChainEnd |
1 |
Duel.SetChainMetaValue |
3 |
Duel.SetCoinResult |
any |
Duel.SetDiceResult |
any |
Duel.SetFlagEffectLabel |
3 |
Duel.SetFusionMaterial |
1 |
Duel.SetLP |
2 |
Duel.SetMetaValue |
any |
Duel.SetMetatable |
2 |
Duel.SetOperationInfo |
6 |
Duel.SetRegistry |
1 |
Duel.SetRegistryValue |
2 |
Duel.SetSelectedCard |
1 |
Duel.SetSummonCancelable |
1 |
Duel.SetSynchroMaterial |
1 |
Duel.SetTargetCard |
1 |
Duel.SetTargetParam |
1 |
Duel.SetTargetPlayer |
1 |
Duel.ShuffleDeck |
1 |
Duel.ShuffleExtra |
1 |
Duel.ShuffleHand |
1 |
Duel.ShuffleSetCard |
1 |
Duel.SkipPhase |
4 |
Duel.SortDecktop |
3 |
Duel.SpecialSummon |
7 |
Duel.SpecialSummonComplete |
any |
Duel.SpecialSummonRule |
2 |
Duel.SpecialSummonStep |
7 |
Duel.Summon |
4 |
Duel.SwapControl |
2 |
Duel.SwapDeckAndGrave |
1 |
Duel.SwapSequence |
2 |
Duel.SynchroSummon |
3 |
Duel.TossCoin |
2 |
Duel.TossDice |
2 |
Duel.Win |
2 |
Duel.XyzSummon |
3 |
Duel.XyzSummonByRose |
4 |