游戏王残局简化版

Annotation For script/一点点点基础.html
Login

Annotation For script/一点点点基础.html

Origin for each line in script/一点点点基础.html from check-in a0c2de510d:

a0c2de510d 2023-10-04    1: <!DOCTYPE html>
a0c2de510d 2023-10-04    2: <html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
a0c2de510d 2023-10-04    3: <head>
a0c2de510d 2023-10-04    4:   <meta charset="utf-8" />
a0c2de510d 2023-10-04    5:   <meta name="generator" content="pandoc" />
a0c2de510d 2023-10-04    6:   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
a0c2de510d 2023-10-04    7:   <title>一点点点基础</title>
a0c2de510d 2023-10-04    8:   <style>
a0c2de510d 2023-10-04    9: code{white-space: pre-wrap;}
a0c2de510d 2023-10-04   10: span.smallcaps{font-variant: small-caps;}
a0c2de510d 2023-10-04   11: div.columns{display: flex; gap: min(4vw, 1.5em);}
a0c2de510d 2023-10-04   12: div.column{flex: auto; overflow-x: auto;}
a0c2de510d 2023-10-04   13: div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
a0c2de510d 2023-10-04   14: 
a0c2de510d 2023-10-04   15: ul.task-list[class]{list-style: none;}
a0c2de510d 2023-10-04   16: ul.task-list li input[type="checkbox"] {
a0c2de510d 2023-10-04   17: font-size: inherit;
a0c2de510d 2023-10-04   18: width: 0.8em;
a0c2de510d 2023-10-04   19: margin: 0 0.8em 0.2em -1.6em;
a0c2de510d 2023-10-04   20: vertical-align: middle;
a0c2de510d 2023-10-04   21: }
a0c2de510d 2023-10-04   22: .display.math{display: block; text-align: center; margin: 0.5rem auto;}
a0c2de510d 2023-10-04   23: </style>
a0c2de510d 2023-10-04   24:   <style type="text/css">@media screen and (min-aspect-ratio:1/1) {html {background-color: f8f8f8;background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%), linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%);background-size: 8px 8px;background-position: 0 0, 16px 8px;}body {border: solid #a0a0a0 1px ;border-radius: 20px ;padding: 26px ;margin: 16px ;color: #101010 ;background: linear-gradient(to right, #efefefff, #efefeffc);padding: 2em 11%;line-height: 2.1em;box-shadow: 0px 0px 1px rgba(160, 160, 160, 1), 0px 0px 1px rgba(160, 160, 160, 1);}}h1,h2,h3,h4,h5,h6 {font-size: 1.5em;color: #3F5770;border-bottom: 1px solid #dddddd;margin: 1.2em 0em;}a {list-style: none;border-right: 0.3em solid #5183C466;border-left: 0.3em solid #5183C466;padding: 0.2em 0.4em;margin-bottom: 0.2em;margin-top: 0.3em;background-color: white;text-decoration-color: blue;border-radius: 0.2em;}a:visited {color: blue;text-decoration-color: white;}a:active {color: red;}nav ul li {margin: 1.2em 0em;}p::before {}p {margin: 1.2em 0;}.title {background-color: white;font-size: 2em;text-align: center;}b {background-color: white;list-style: none;border-right: 0.3em solid #5183C466;border-left: 0.3em solid #5183C466;padding: 0.2em 0.4em;margin-bottom: 0.2em;margin-top: 0.3em;border-radius: 0.2em;}details {border-bottom: 1px solid #dddddd;}details > summary {list-style: none;border-right: 0.3em solid #5183C466;border-left: 0.3em solid #5183C466;padding: 0.2em 0.4em;margin-bottom: 0.2em;margin-top: 0.3em;outline: none;border-radius: 0.2em;}pre {background: #f6f6f6;border-left: 0.5em solid #ccc;padding: 0.4em;border-radius: 0.2em;overflow-wrap:break-word;}pre:active {color: red;}code {font-family: "Verdana";}button {background: #ffffff;color: #20894d;}button:active {color: red;}</style>
a0c2de510d 2023-10-04   25:   <!--[if lt IE 9]>
a0c2de510d 2023-10-04   26:     <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
a0c2de510d 2023-10-04   27:   <![endif]-->
a0c2de510d 2023-10-04   28: </head>
a0c2de510d 2023-10-04   29: <body>
a0c2de510d 2023-10-04   30: <nav id="TOC" role="doc-toc">
a0c2de510d 2023-10-04   31: <ul>
a0c2de510d 2023-10-04   32: <li><a href="#一点点点基础" id="toc-一点点点基础"><span class="toc-section-number">1</span> 一点点点基础</a>
a0c2de510d 2023-10-04   33: <ul>
a0c2de510d 2023-10-04   34: <li><a href="#添加卡片" id="toc-添加卡片"><span class="toc-section-number">1.1</span> 添加卡片</a></li>
a0c2de510d 2023-10-04   35: <li><a href="#注册效果" id="toc-注册效果"><span class="toc-section-number">1.2</span> 注册效果</a></li>
a0c2de510d 2023-10-04   36: <li><a href="#效果描述" id="toc-效果描述"><span class="toc-section-number">1.3</span> 效果描述</a></li>
a0c2de510d 2023-10-04   37: <li><a href="#效果参数" id="toc-效果参数"><span class="toc-section-number">1.4</span> 效果参数</a></li>
a0c2de510d 2023-10-04   38: <li><a href="#效果检查" id="toc-效果检查"><span class="toc-section-number">1.5</span> 效果检查</a></li>
a0c2de510d 2023-10-04   39: <li><a href="#火球" id="toc-火球"><span class="toc-section-number">1.6</span> 火球</a></li>
a0c2de510d 2023-10-04   40: <li><a href="#叛逆之罪宝-蛇眼" id="toc-叛逆之罪宝-蛇眼"><span class="toc-section-number">1.7</span> 叛逆之罪宝-蛇眼</a></li>
a0c2de510d 2023-10-04   41: <li><a href="#废铁死亡恶魔" id="toc-废铁死亡恶魔"><span class="toc-section-number">1.8</span> 废铁死亡恶魔</a></li>
a0c2de510d 2023-10-04   42: <li><a href="#虫饵" id="toc-虫饵"><span class="toc-section-number">1.9</span> 虫饵</a></li>
a0c2de510d 2023-10-04   43: <li><a href="#天底的使徒" id="toc-天底的使徒"><span class="toc-section-number">1.10</span> 天底的使徒</a></li>
a0c2de510d 2023-10-04   44: </ul></li>
a0c2de510d 2023-10-04   45: </ul>
a0c2de510d 2023-10-04   46: </nav>
a0c2de510d 2023-10-04   47: <h1 data-number="1" id="一点点点基础"><span class="header-section-number">1</span> 一点点点基础</h1>
a0c2de510d 2023-10-04   48: <h2 data-number="1.1" id="添加卡片"><span class="header-section-number">1.1</span> 添加卡片</h2>
a0c2de510d 2023-10-04   49: <p>青眼白龙的卡密是 89631139 ,但查不到 c89631139.lua 。</p>
a0c2de510d 2023-10-04   50: <p>估计<b>只需要</b>更改 cards.cdb ,就可以添加卡片了。</p>
a0c2de510d 2023-10-04   51: <hr />
a0c2de510d 2023-10-04   52: <p>c89631139 的 c 是指 card ,就是「卡片」。</p>
a0c2de510d 2023-10-04   53: <h2 data-number="1.2" id="注册效果"><span class="header-section-number">1.2</span> 注册效果</h2>
a0c2de510d 2023-10-04   54: <p>火球的效果足够简单,就以火球为例。</p>
a0c2de510d 2023-10-04   55: <p>火球里有很多函数,但并没有启用这些函数的语句,这表明它们自己单独是不能运行的,而是<b>被</b>其他的东西给调用。</p>
a0c2de510d 2023-10-04   56: <p>在 c46130346.lua ,有以下效果:</p>
a0c2de510d 2023-10-04   57: <pre><code>function c46130346.initial_effect(c)
a0c2de510d 2023-10-04   58: end</code></pre>
a0c2de510d 2023-10-04   59: <p>它被 interpreter.cpp 所调用:</p>
a0c2de510d 2023-10-04   60: <pre><code>call_card_function(pcard, &quot;initial_effect&quot;, 1, 0);</code></pre>
a0c2de510d 2023-10-04   61: <hr />
a0c2de510d 2023-10-04   62: <p>c46130346.initial_effect 不利于复制粘贴。</p>
a0c2de510d 2023-10-04   63: <p>在 utility.lua 有:</p>
a0c2de510d 2023-10-04   64: <pre><code>function GetID()
a0c2de510d 2023-10-04   65: end</code></pre>
a0c2de510d 2023-10-04   66: <p>所以可以这样注册效果:</p>
a0c2de510d 2023-10-04   67: <pre><code>local s,id,o=GetID()
a0c2de510d 2023-10-04   68: function s.initial_effect(c)
a0c2de510d 2023-10-04   69: end</code></pre>
a0c2de510d 2023-10-04   70: <h2 data-number="1.3" id="效果描述"><span class="header-section-number">1.3</span> 效果描述</h2>
a0c2de510d 2023-10-04   71: <p>诸如 SetProperty ,其参数可以在 <b>constant.lua</b> 查。</p>
a0c2de510d 2023-10-04   72: <hr />
a0c2de510d 2023-10-04   73: <p>简单的描述就写简单一点,复杂的描述就写复杂一点。</p>
a0c2de510d 2023-10-04   74: <h2 data-number="1.4" id="效果参数"><span class="header-section-number">1.4</span> 效果参数</h2>
a0c2de510d 2023-10-04   75: <p>在 processor.cpp
a0c2de510d 2023-10-04   76: 可以看到,有时给函数传参数的时候传的是匿名参数,所以很多时候,这些参数其实是<b>空</b>的。</p>
a0c2de510d 2023-10-04   77: <pre><code>e effect
a0c2de510d 2023-10-04   78: tp this player
a0c2de510d 2023-10-04   79: eg event group
a0c2de510d 2023-10-04   80: ep event player
a0c2de510d 2023-10-04   81: ev event value
a0c2de510d 2023-10-04   82: re reason effect
a0c2de510d 2023-10-04   83: r reason
a0c2de510d 2023-10-04   84: rp reason player
a0c2de510d 2023-10-04   85: chk check
a0c2de510d 2023-10-04   86: chkc check card</code></pre>
a0c2de510d 2023-10-04   87: <hr />
a0c2de510d 2023-10-04   88: <p>0 指先攻玩家, 1 指后攻玩家,这是绝对的。</p>
a0c2de510d 2023-10-04   89: <p>tp 指我方玩家, 1 - tp 指对方玩家,这是相对的。</p>
a0c2de510d 2023-10-04   90: <hr />
a0c2de510d 2023-10-04   91: <p>这套效果参数,可以看作是一个规范,目的是为了便于看懂与复制代码。</p>
a0c2de510d 2023-10-04   92: <h2 data-number="1.5" id="效果检查"><span class="header-section-number">1.5</span> 效果检查</h2>
a0c2de510d 2023-10-04   93: <pre><code>function c46130346.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
a0c2de510d 2023-10-04   94:   if chk==0 then return 233333333 end
a0c2de510d 2023-10-04   95:   233333333
a0c2de510d 2023-10-04   96: end</code></pre>
a0c2de510d 2023-10-04   97: <p>这个函数,我觉得应该看作<b>两个</b>函数。</p>
a0c2de510d 2023-10-04   98: <p>它在 chk 的值不同时,执行不同的分支。</p>
a0c2de510d 2023-10-04   99: <p>而 chk 取决于效果执行的阶段:检查阶段与执行阶段。</p>
a0c2de510d 2023-10-04  100: <h2 data-number="1.6" id="火球"><span class="header-section-number">1.6</span> 火球</h2>
a0c2de510d 2023-10-04  101: <pre><code>function c46130346.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
a0c2de510d 2023-10-04  102:     if chk==0 then return true end
a0c2de510d 2023-10-04  103:     Duel.SetTargetPlayer(1-tp)
a0c2de510d 2023-10-04  104:     Duel.SetTargetParam(500)
a0c2de510d 2023-10-04  105:     Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)
a0c2de510d 2023-10-04  106: end</code></pre>
a0c2de510d 2023-10-04  107: <hr />
a0c2de510d 2023-10-04  108: <p>把:</p>
a0c2de510d 2023-10-04  109: <pre><code>if chk==0 then return true end</code></pre>
a0c2de510d 2023-10-04  110: <p>改成:</p>
a0c2de510d 2023-10-04  111: <pre><code>if chk==0 then return false end</code></pre>
a0c2de510d 2023-10-04  112: <p>则无法发动火球。</p>
a0c2de510d 2023-10-04  113: <hr />
a0c2de510d 2023-10-04  114: <p>去掉:</p>
a0c2de510d 2023-10-04  115: <pre><code>Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,500)</code></pre>
a0c2de510d 2023-10-04  116: <p>则无法<b>对应火球</b>而发动痛魂之咒术。</p>
a0c2de510d 2023-10-04  117: <hr />
a0c2de510d 2023-10-04  118: <p>去掉</p>
a0c2de510d 2023-10-04  119: <pre><code>e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)</code></pre>
a0c2de510d 2023-10-04  120: <p>则无法对应火球而发动精灵之镜。</p>
a0c2de510d 2023-10-04  121: <h2 data-number="1.7" id="叛逆之罪宝-蛇眼"><span class="header-section-number">1.7</span> 叛逆之罪宝-蛇眼</h2>
a0c2de510d 2023-10-04  122: <p>去掉:</p>
a0c2de510d 2023-10-04  123: <pre><code>e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)</code></pre>
a0c2de510d 2023-10-04  124: <p>则可以发动多次。</p>
a0c2de510d 2023-10-04  125: <hr />
a0c2de510d 2023-10-04  126: <p>去掉:</p>
a0c2de510d 2023-10-04  127: <pre><code>e1:SetDescription(aux.Stringid(id,0))</code></pre>
a0c2de510d 2023-10-04  128: <p>则没有变化。</p>
a0c2de510d 2023-10-04  129: <hr />
a0c2de510d 2023-10-04  130: <p>去掉:</p>
a0c2de510d 2023-10-04  131: <pre><code>Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)</code></pre>
a0c2de510d 2023-10-04  132: <p>则提示文本发生改变。</p>
a0c2de510d 2023-10-04  133: <p>这些提示文本可以在 constant.lua 中<b>找到</b>。</p>
a0c2de510d 2023-10-04  134: <hr />
a0c2de510d 2023-10-04  135: <p>去掉:</p>
a0c2de510d 2023-10-04  136: <pre><code>e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)</code></pre>
a0c2de510d 2023-10-04  137: <p>则旋风无法破坏那些怪兽。</p>
a0c2de510d 2023-10-04  138: <hr />
a0c2de510d 2023-10-04  139: <p>去掉:</p>
a0c2de510d 2023-10-04  140: <pre><code>e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)</code></pre>
a0c2de510d 2023-10-04  141: <p>则那些怪兽离开场上后仍然被当作永续魔法卡。</p>
a0c2de510d 2023-10-04  142: <h2 data-number="1.8" id="废铁死亡恶魔"><span class="header-section-number">1.8</span> 废铁死亡恶魔</h2>
a0c2de510d 2023-10-04  143: <p>去掉:</p>
a0c2de510d 2023-10-04  144: <pre><code>c:EnableReviveLimit()</code></pre>
a0c2de510d 2023-10-04  145: <p>则<b>没有</b>苏生限制。</p>
a0c2de510d 2023-10-04  146: <h2 data-number="1.9" id="虫饵"><span class="header-section-number">1.9</span> 虫饵</h2>
a0c2de510d 2023-10-04  147: <p>去掉:</p>
a0c2de510d 2023-10-04  148: <pre><code>e2:SetCode(EFFECT_CANNOT_SUMMON)</code></pre>
a0c2de510d 2023-10-04  149: <p>则<b>不会</b>封锁召唤。</p>
a0c2de510d 2023-10-04  150: <h2 data-number="1.10" id="天底的使徒"><span class="header-section-number">1.10</span> 天底的使徒</h2>
a0c2de510d 2023-10-04  151: <p>去掉:</p>
a0c2de510d 2023-10-04  152: <pre><code>e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)</code></pre>
a0c2de510d 2023-10-04  153: <p>则我方<b>仍然</b>可从额外卡组特殊召唤怪兽。</p>
a0c2de510d 2023-10-04  154: <hr />
a0c2de510d 2023-10-04  155: <p>去掉:</p>
a0c2de510d 2023-10-04  156: <pre><code>e1:SetReset(RESET_PHASE+PHASE_END)</code></pre>
a0c2de510d 2023-10-04  157: <p>则我方一直被限制特召。</p>
a0c2de510d 2023-10-04  158: <script>
a0c2de510d 2023-10-04  159: 
a0c2de510d 2023-10-04  160: document.onclick = function(event) {
a0c2de510d 2023-10-04  161: 
a0c2de510d 2023-10-04  162:   var target = event.target
a0c2de510d 2023-10-04  163: 
a0c2de510d 2023-10-04  164:   if (target.tagName == "PRE"
a0c2de510d 2023-10-04  165:   || target.tagName == "CODE") {
a0c2de510d 2023-10-04  166:     if (window.getSelection().toString() !== "") {
a0c2de510d 2023-10-04  167:       return
a0c2de510d 2023-10-04  168:       }
a0c2de510d 2023-10-04  169:     var range = document.createRange();
a0c2de510d 2023-10-04  170:     range.selectNodeContents(target);
a0c2de510d 2023-10-04  171:     window.getSelection().removeAllRanges();
a0c2de510d 2023-10-04  172:     window.getSelection().addRange(range);
a0c2de510d 2023-10-04  173:     var successful = document.execCommand("copy");
a0c2de510d 2023-10-04  174:     target.removeAttribute("contenteditable");
a0c2de510d 2023-10-04  175:     window.getSelection().removeAllRanges();
a0c2de510d 2023-10-04  176:     }
a0c2de510d 2023-10-04  177: 
a0c2de510d 2023-10-04  178:   }
a0c2de510d 2023-10-04  179: 
a0c2de510d 2023-10-04  180: </script>
a0c2de510d 2023-10-04  181: </body>
a0c2de510d 2023-10-04  182: </html>