https://en.touhouwiki.net/api.php?action=feedcontributions&user=Mddass&feedformat=atomTouhou Wiki - User contributions [en]2024-03-28T21:00:45ZUser contributionsMediaWiki 1.39.3https://en.touhouwiki.net/index.php?title=Perfect_Cherry_Blossom/Music&diff=455681Perfect Cherry Blossom/Music2022-11-03T23:51:50Z<p>Mddass: consistency</p>
<hr />
<div>*For additional comments about the music, see [[Perfect Cherry Blossom/Translation/Afterword|Afterword]].<br />
==Music List==<br />
{{MusicRoom<br />
| category =Title Screen theme<br />
| title =妖々夢 ~ Snow or Cherry Petal<br />
| roma =Youyoumu<br />
| titleEN =Ghostly Dream ~ Snow or Cherry Petal<br />
| comment =前作のタイトル曲のイメージを引きずりつつ、和風に和風に。<br />
この曲、「これから弾幕の嵐!」って雰囲気を完全に削ぎます。<br />
正直、あっても無くても良さそうな曲だったりするんですが、高揚する弾幕魂をここでなだめる役割を果たしています(笑)<br />
| translation =The title theme, strongly influenced from the previous one, all in a Japanese style.<br />
This song completely removes any hint of the upcoming storm of danmaku.<br />
Frankly, I think this song isn't necessary, but it's also meant to restrain the player's excitement for danmaku. (lol)<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 1 theme<br />
| title =無何有の郷 ~ Deep Mountain<br />
| roma =Mukau no kyou<ref>"Mukau no sato" also passes.</ref><br />
| titleEN =Paradise ~ Deep Mountain<br />
| comment =曲名(何か有るという事が無い)通り、手付かずの自然をイメージしてあります。<br />
でもそこはそれ、個人的に異様に癒し系だったりするのも嫌ですので、小気味良い程度の軽快さに仕上げました。<br />
でも、爽やかさは皆無です(^^;<br />
| translation =As the title implies (for nothing at all to be there), this theme was composed with an image of nature that has yet to be discovered by humans.<br />
However, I personally didn't want it to be healing music, oddly enough, so I made it somewhat rhythmical.<br />
But it doesn't feel invigorating at all. (^^;<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 1 Boss - [[Letty Whiterock]]'s theme<br />
| title =クリスタライズシルバー<br />
| roma =Kurisutaraizu shirubā<br />
| titleEN =Crystallized Silver<br />
| comment =(この曲に限らず)私の曲は露骨でない和洋折衷を目指しています。<br />
1面ボスなのですんごく短い曲ですが、この世界観の入り口として思うがままに表現してみました。<br />
ストレートな曲なのに、どのジャンルにも当てはならない不思議な曲です。<br />
| translation =A goal of my music is to subtly blend Japanese and Western elements together (applies to the other songs too).<br />
This one is short because it's the theme for the stage 1 boss, but I managed to express my image of the realm in this theme.<br />
While the song is direct, it's a strange one that doesn't fit into any music genre.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 2 theme<br />
| title =遠野幻想物語<br />
| roma =Toono gensou monogatari<br />
| titleEN =The Fantastic Tales from [[Mayohiga|Tono]]<br />
| comment =これはー、変な曲です。はい。<br />
民族色高い曲を創る予定だったのですが、落ち着きすぎて中途半端に民族風。<br />
曲名通り、遠野郷をイメージしています。 昔は日本にもこんな所が存在したんだなぁ、程度にレトロなメロディにしてみたつもりです。<br />
| translation =This song is a weird one. Yeah.<br />
My original intent with this was to make it highly folkish, but since it's too calm, it ended up half-folkish.<br />
I composed this with the image of [[Wikipedia:Tōno, Iwate|Tōno village]] in mind. The melody is a bit nostalgic and makes you imagine that there used to be old villages like this in Japan, too.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 2 Boss - [[Chen]]'s theme<br />
| title =ティアオイエツォン(withered leaf)<br />
| roma =Tiaoietson<br />
| titleEN =Diao Ye Zong (withered leaf)<br />
| comment =元気な妖怪少女のイメージで作曲しました。<br />
何の迷いも無くアドリブ的に作曲した曲です。あんまひねった事すると、狙いすぎておかしくなる事が良くわかったので(汗)、即興的に弾いたメロディで創ってみました。それはもうお酒を大量に嗜んで...<br />
これはこれで自分に素直な曲です(^^;<br />
| translation =I composed this title with the image of an energetic youkai girl in mind.<br />
This song is based purely on improvisation, because I found that if I think too much while composing the music tends to end up strange. Well, with the help of more than a little booze...<br />
All in all, this is an honest song (^^;<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 3 theme<br />
| title =ブクレシュティの人形師<br />
| roma =Bukureshuti no ningyoushi<br />
| titleEN =The Doll Maker of Bucuresti<br />
| comment =いきなりもう終盤か?と感じさせる曲ですね。実は、今回体験版を先行発表するので、中途半端な体験版にしない為にゲームの1回目の節目を3面に持って来る事にしました。<br />
なので、若干シリアス目な曲を目指してみました。とはいいつつ、実は最も昔の私っぽい曲です。<br />
その為、多分そう感じるのは私だけでしょうが、懐かしさを覚えます。<br />
| translation =This makes you wonder if you're near the end of the game. This is because the demo was released very early and I had finish it so it would be ready in time. Due to that, I put the first pivotal moment in stage 3.<br />
The mood is more serious than usual, too. However, that means it's similar to my older tunes.<br />
It might be just me, but this song gives a nostalgic feeling.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 3 Boss - [[Alice Margatroid]]'s theme<br />
| title =人形裁判 ~ 人の形弄びし少女<br />
| roma =Ningyou saiban ~ Hito no katachi moteasobishi shoujo<br />
| titleEN =Doll Judgement ~ The Girl Who Played with People's Shapes <ref>When the の in 人の形 ("human shape") is deleted, it forms 人形 ("doll").</ref><br />
|also={{CoSD}}<br />
| comment =アリスはシリーズ的にちょっと特別なキャラなので、気合入れて作曲しました(て言うと、他の曲は手を抜いてるみたいですが)<br />
戦闘の切羽詰まった感の中にも、お互い心に余裕が見える程度な曲を目指しています。<br />
この心の余裕こそが彼女達の美徳なのです。 ・・・(美徳は)ゴスロリ、じゃないですよ(笑)<br />
| translation =Alice is kind of a special character in this series, so I composed the theme with renewed vigor (not that I was lazy with the other songs).<br />
This theme's goal is to show that the characters' peace of mind despite the intensity of the fight.<br />
This peace of mind shows their virtue in my opinion... (the virtue is) not the gothic-lolita costumes, I swear (haha).<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 4 theme<br />
| title =天空の花の都<br />
| roma =Tenkuu no hana no miyako<br />
| titleEN =The Capital City of Flowers in the Sky<br />
| comment =和風より中華風。過激で素敵な雲の上です。<br />
4面から、ようやく本当の妖々夢の始まりとなっている為、4面だけ圧倒的に長いステージになっています。かつて、こんなに激しくも切ない曲で成層圏(そんなに高くありません)突入があっただろうか。<br />
西遊記をイメージして作曲しています。全然関係無いけど。<br />
| translation =The style is more Chinese than Japanese. A wonderful place above the clouds.<br />
As the true beginning of this game, stage 4 is far longer than the others. There's never been such a stratospheric (it's not that high) intrusion with violent yet sorrowful music, has there?<br />
While I composed it with "Journey to the West" in mind, it doesn't resemble that.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 4 Boss - [[Prismriver Sisters]] ([[Lunasa Prismriver|Lunasa]], [[Merlin Prismriver|Merlin]], and [[Lyrica Prismriver|Lyrica]]) theme<br />
| title =幽霊楽団 ~ Phantom Ensemble<br />
| roma =Yuurei gakudan<br />
| titleEN =Phantom Band ~ Phantom Ensemble<br />
| comment =とにかく、明るく楽しく演奏している様な曲を創ったつもりです。<br />
お祭りや騒がしい事が大好きな、能天気な三姉妹の勢いに任せた演奏のつもり。サビはヴァイオリン、トランペット、キーボードと三人が、思うが侭に演奏しています。<br />
ごった煮。<br />
| translation =I tried to make this theme sound like it was being performed brightly and joyfully.<br />
A performance by happy-go-lucky sisters who love festivals and anything noisy. At the climax, each of them play their violin, trumpet and keyboard as they please.<br />
A veritable hodgepodge.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 5 theme<br />
| title =東方妖々夢 ~ Ancient Temple<br />
| roma =Touhou youyoumu<br />
| titleEN =Eastern Ghostly Dream ~ Ancient Temple<br />
|also={{GFC}}, {{PoFV}}<br />
| comment =精一杯の日本人に根付く懐かしさと、ほんの一寸の何者かが迫り来る焦燥感を出してみました。<br />
遠くに聞こえる笙の様な音と鐘の音が、なんとなくあの世をイメージします。私だけ?<br />
| translation =This theme expresses the nostalgia that is deep within every Japanese and the frantic feeling that arises when someone is approaching.<br />
The sounds of far-off Shinto flutes and bells conjure up images of the netherworld. Or maybe it's just me?<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 5 Boss - [[Youmu Konpaku]]'s theme<br />
| title =広有射怪鳥事 ~ Till When?<br />
| roma =Hiroari kechou o iru koto<br />
| titleEN =Hiroari Shoots a Strange Bird ~ Till When?<br />
| comment =強敵+幼さを曲で表現してみたつもりです。<br />
一番ボスっぽい曲かも。ギターを使いつつも、はなから、ロックを諦めています(笑)<br />
このサビのメロディは妖怪を彷彿させます。<br />
| translation =I tried to give the impression of both "A Tough Opponent" and "Childishness" with this theme.<br />
Perhaps this is the most boss-like theme in this game. While it uses guitar, I gave up trying to make it sound like rock music almost immediately.<br />
The hook's melody resembles the youkai.<br />
| note = This theme is named after the same chapter included in the twelfth volume of [[Wikipedia:Taiheiki|Taiheiki]].<br />The title is spelt {{lang|ja|ひろありけてうをいること}} ("Hiroari keteu wo iru koto") in historic spelling system, and read as it would be {{lang|ja|ひろあり'''けちょう'''をいること}} ("Hiroari '''kechou''' wo iru koto").<br />
<br />
In this story, an ominous bird that cries {{nihongo|"Itsumade, itsumade"|いつまで、いつまで}} appears and frightens the people of Heian. They interpreted it that the bird was the embodiment of sorrow of epidemic disease widespread those days, repeating an evil spell "Till when (do we bodies remain left on the roads)?"; the phrase "itsumade" has been interpreted into {{nihongo|"till when?"|何時まで?|itsu made?}}. ZUN jokingly translates it into English.<br />
<br />
"Jokingly" is, in fact, ambivalent in this case. There are some ideas about what ZUN implies for it. For example: (1) "Till when (does the same pattern of melody repeat again and again from the first)?"; (2) "Till when (does winter remain in this story)?". And other people think that Youmu and Yuyuko are roling "Itsumade" and "the body"; Youmu made a big incident to inform protagonists that the source of it was a suffering dead body.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 6 theme<br />
| title =アルティメットトゥルース<br />
| roma =Arutimetto turūsu<br />
| titleEN =Ultimate Truth<br />
| comment =最終面はボスを中心にするために、道中はただのつなぎです。<br />
曲もえらく短い曲ですが、割と爽やかで気持ちいい曲です(多分)<br />
ステージは、桜の海の上を高速で駆け抜けるイメージを想定していましたが、曲の方もそんな感じになったでしょうか?<br />
| translation =The final stage is all about the final boss, so the mid-stage is only a token effort.<br />
Because of that, this song is rather short, but it's also refreshing and pleasant (in my opinion).<br />
The stage has visual imagery of flying over a sea of cherry blossoms; I hope this song will give you the same impression.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 6 Boss - [[Yuyuko Saigyouji]]'s theme<br />
| title =幽雅に咲かせ、墨染の桜 ~ Border of Life<br />
| roma =Yuuga ni sakase, sumizome no sakura<br />
| titleEN =Bloom Nobly, Ink-Black Cherry Blossom ~ Border of Life<br />
| comment =とにかく、東洋風でメロディアスでラストらしい曲を目指しました。<br />
とかなんとかいっちゃって、どう聴いてもいつもの曲です(笑)<br />
激しくも優雅で、力強くも儚げに、色々感じ取れる曲になったかなと。<br />
| translation =I gave this theme an oriental and melodious feeling while making it the "final" song.<br />
Having said that, the style of music is my usual fare. (lol)<br />
Vehement yet elegant, powerful but ephemeral; I thought I'd make this theme quite emotional.<br />
| note = The song title is a reference to the legend of a man named Kamutsuke no Mineo, who upon the death of his friend wrote the following poem: "Oh, cherry blossoms in the fields of Fukukusa: if you have a heart, bloom in dyed in ink just for this year." When he finished writing the poem, the cherry blossoms near his friend's grave all bloomed ink-black.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Stage 6 Boss - [[Yuyuko Saigyouji]]'s second theme<br />
| title =ボーダーオブライフ<br />
| roma =Bōdā obu raifu<br />
| titleEN =Border of Life<br />
| comment =幽々子のテーマの別バージョンです。<br />
ちょっとミステリアスな雰囲気が強調されています。<br />
曲自体は、疲れるほどにハードです(笑)<br />
| translation =An arranged version of Yuyuko's theme.<br />
I put more emphasis on the mysterious atmosphere in this one.<br />
However, the melody itself is so harsh that it's almost tiresome. (lol)<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Extra Stage theme<br />
| title =妖々跋扈<ref>A pun of the four-letter kanji idiom {{lang|ja|跳梁跋扈}} (Chouryou bakko), "people with ill intent running rampant".</ref><br />
| roma =Youyou bakko<br />
| titleEN =Spiritual Domination<br />
| comment =東方に珍しい疾走感の強い曲(か?)です。<br />
ステージを見れば分りますが、テンポとノリが重要なイメージになっています。<br />
途中で曲調が112°程変換されますが、そこからがエクストラの始まりだと思ってください(笑)<br />
| translation =A high-paced theme (?) which is unusual in the Touhou series.<br />
It's obvious from the stage that the tempo and feel are the keys to this song.<br />
The tone turns around about 112 degrees in the middle of the song which is where Extra really starts (heh).<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Extra Boss - [[Ran Yakumo]]'s theme<br />
| title =少女幻葬 ~ Necro-Fantasy<br />
| roma =Shoujo gensou<br />
| titleEN =A Maiden's Illusionary Funeral ~ Necro-Fantasy<br />
|also={{GFC}}<br />
| comment =幻想より幻惑的なイメージで作曲しました。<br />
曲自体から、活きの良い妖怪を感じてもらえればいいかなと。<br />
シューティングで長期戦になるところは、繰り返しが多くて一定の調子の方がいい感じだと思うので、そんな感じな曲に。<br />
| translation =I composed it to be more dazzling than fantastic.<br />
Hopefully you'll get the sense of the energetic youkai from the song.<br />
In my opinion, when there's a long fight in a shooting game, the music should repeat and sustain its tempo. That is, it should be like this theme.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Phantasm Stage theme<br />
| title =妖々跋扈 ~ Who done it!<br />
| roma =Youyou bakko<br />
| titleEN =Spiritual Domination ~ Who done it!<br />
| comment =妖々跋扈の裏バージョンです。<br />
曲は殆ど変化はありませんが・・・<br />
| translation =Another version of Spiritual Domination.<br />
It's not that different from the original though...<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Phantasm Boss - [[Yukari Yakumo]]'s theme<br />
| title =ネクロファンタジア<br />
| roma =Nekurofantajia<br />
| titleEN =Necrofantasia<br />
|also={{MA}}<br />
| comment =藍のテーマの編曲のつもりだったけど、割と別の曲に。<br />
こっちの方は、禍々しい感じが少し混じっています。というか、キャラ自体が禍々しさの塊みたいなもんです。<br />
今までのキャラの中でも、胡散臭い風貌、信用できない性格、非常識な弾幕。そういうキャラの曲なので、とても胡散臭い(笑)<br />
| translation =Meant to be an arranged version of Ran's theme, it ended up quite different.<br />
This one has an ominous feeling. Or rather, she's the very embodiment of ominous.<br />
Even compared with the past characters, she has a devious appearance, a dubious character and thoughtless danmaku. The theme's just like her: devious (lol).<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Ending theme<br />
| title =春風の夢<br />
| roma =Shunpuu no yume<ref>"Harukaze no yume" also passes.</ref><br />
| titleEN =Dream of a Spring Breeze<br />
| comment =エンディングのテーマです。<br />
・・・だから、暗いってばさ。<br />
<br />
いたって平和な日常ですよ<br />
| translation =The ending theme.<br />
...It's just, it feels kind of dark.<br />
<br />
It's supposed to represent a peaceful, everyday life, I swear.<br />
}}<br />
<br />
{{MusicRoom<br />
| category =Staff Roll theme<br />
| title =さくらさくら ~ Japanize Dream...<br />
| roma =Sakura sakura<br />
| titleEN =Sakura, Sakura ~ Japanize Dream...<br />
| comment =童謡「さくらさくら」をイメージした曲です。<br />
割とすっきりする曲だったりします。<br />
| translation =The imagery is based on the familiar song "[[Wikipedia:Sakura (folk song)|Sakura, Sakura]]".<br />
I think this song is kind of refreshing.<br />
}}<br />
<br />
== Also See ==<br />
*[[List_by_Song/Perfect Cherry Blossom|Perfect Cherry Blossom arrangements listed by song]]<br />
<br />
{{Project Translations Notice}}<br />
<br />
{{Navbox PCB}}<br />
[[ru:Perfect Cherry Blossom/Музыка]]<br />
[[Category:Perfect Cherry Blossom]]<br />
[[Category:Music by Game]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=435388User:Mddass/Touhou File Format Specification/ECL2021-11-04T22:47:57Z<p>Mddass: /* EoSD (th06) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts responsible for the control of the gameplay portions of stages in the Touhou games, ranging from stage enemy timings, bullet patterns, enemy movement to some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format changes constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL. Register based, and uses a separate section to control stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Notably, it is now stack based instead of register based, and all of the functions are now named to enable dynamic linking of multiple ECL files.<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|interrupt|0x006D (109)|int func, int i|Sets a function to be called when an interrupt i is raised. Only slots 0-7 are legal.}}<br />
{{User:Mddass/ECL_TABLE_ROW|interrupt_run|0x006E (110)|int i|Raises interrupt i.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Sends a terminate message to the current enemy main graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Sends a terminate message to the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_call_stack_disable|0x0082 (130)|int a|Sets a flag that disables the context call stack. When a function is called, the return address is not saved. Used by Patchouli. Probably for preventing strange call stacks and allowing her spells to be cast in any order and be self-contained.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=435387User:Mddass/Touhou File Format Specification/ECL2021-11-04T20:43:29Z<p>Mddass: /* EoSD (th06) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts responsible for the control of the gameplay portions of stages in the Touhou games, ranging from stage enemy timings, bullet patterns, enemy movement to some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format changes constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL. Register based, and uses a separate section to control stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Notably, it is now stack based instead of register based, and all of the functions are now named to enable dynamic linking of multiple ECL files.<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|interrupt|0x006D (109)|int func, int i|Sets a function to be called when an interrupt i is raised. Only slots 0-7 are legal.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Sends a terminate message to the current enemy main graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Sends a terminate message to the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=433636User:Mddass/Touhou File Format Specification/ECL2021-08-26T16:10:10Z<p>Mddass: /* EoSD (th06) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts responsible for the control of the gameplay portions of stages in the Touhou games, ranging from stage enemy timings, bullet patterns, enemy movement to some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format changes constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL. Register based, and uses a separate section to control stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Notably, it is now stack based instead of register based, and all of the functions are now named to enable dynamic linking of multiple ECL files.<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Sends a terminate message to the current enemy main graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Sends a terminate message to the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Talk:Unconnected_Marketeers/Music&diff=430329Talk:Unconnected Marketeers/Music2021-05-20T06:11:55Z<p>Mddass: /* ルナレインボー */</p>
<hr />
<div>=={{lang|ja|妖異達}}==<br />
I'm unsure if this is a typo on ZUN's part or not. 妖異 is a word roughly meaning "mysterious incident/occurance" but incidents in Touhou are usually called 異変. There's only once incident in-game so far, so 妖異'''達''' makes no sense to me IMO. Was it a typo of 妖怪達? Was it not? I don't know. Input appreciated. <br />
—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 6:06, 21 March 2021 (UTC)<br />
:My first guess is it's another term people use similarly to 妖怪 and 妖魔? Google indicates it's used in that sort of context in other media; for instance it's the JP name of a species in Final Fantasy 14, there's a historical fantasy novel called 妖異の棲む城, etc. I'm inclined to believe it's not a typo atm? [[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 06:15, 21 March 2021 (UTC)<br />
::It's probably best if it's not "Apparitions" (since that was used for 妖魔 in EoSD). I think "unexplained phenomena" covers both things ''and'' events at the same time. Also a "shower" is passing and short-lived by defintion. How about "A Shower of Rain and Unexplained Phenomena"? <br />
::—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 10:29, 21 March 2021 (UTC)<br />
:::Unlike 妖怪 and 妖魔, 妖異 can also just refer to things that are strange and bizarre, aside from youkai. So maybe something like "A Shower of the Mystical and Bizzare"? Since it does technically include youkai and the like as well.<br />
:::—[[User:(-O-)|(-O-)]] ([[User talk:(-O-)|talk]]) 10:43, 21 March 2021 (UTC)<br />
::::Yes, the word 妖異 mostly refers to strange '''occurrences''', rather than strange '''beings''', so I'm very in support of "A Shower of the Mystical and Bizzare".<br />
::::—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 13:14, 21 March 2021 (UTC)<br />
:::::Not to be a stickler but 妖異 is one word and just means "anomaly" (literally "strange occurrence"). It'd be preferable not to add extra words that aren't there. I think "[A] Shower of Strange Occurrences" or "[A] Shower of Anomalies" is best then. <br />
:::::—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 16:11, 21 March 2021 (UTC)<br />
::::::That works just as fine in my opinion, although I suppose I prefer 'Strange/Mystical Occurance' to 'Anomaly' in this case.<br />
::::::—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 16:25, 21 March 2021 (UTC)<br />
<br />
== Title translations ==<br />
The title screen theme 虹の架かる幻想郷 describes Gensokyo in the active, not passive voice, so the more accurate translation would be "A Rainbow-Spanning Gensokyo". The stage 2 boss theme 大吉キトゥン isn't stating that Mike herself is fortunate, but rather that she brings fortune to others. She's a "Kitten of Great Fortune". These are pretty straight-forward changes, but I wanted to mention it in the talk page here since song titles are pretty important. [[User:Flan27|Flan27]] ([[User talk:Flan27|talk]]) 18:42, 21 March 2021 (UTC)<br />
:I feel a little on the fence with translating "架かる" to "spanning" in this case. I feel like "over" would be a simpler translation, but either could work. I have this odd feeling that we are dealing with a rainbow bridge.... [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 19:42, 22 March 2021 (UTC)<br />
<br />
== Title translations 2 ==<br />
It seems both of the translations done here (by [[User:Ennin|Ennin]] and to a lesser extent [[User:Yamaxandu|Yamaxandu]]) and on THPatch (by me) were done independently within a couple of hours from one another (which makes sense given the timeliness of it). We were able to sort out most of them through Discord chat except a few, whose reasonings I'd like to go over below. Please comment in each sub-section to keep things clear. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
<br />
==== The Long-Awaited Omagatoki vs. The Long-Awaited Ōmagatoki ====<br />
This is clearly more about style more than anything else, and fairly minor. The quandary here is that for both here and [[Legacy_of_Lunatic_Kingdom/Spell_Cards/Extra]], the same kanji is being used: {{lang|ja|異界「'''逢魔'''ガ刻」}} for LoLK versus {{lang|ja|待ちわびた'''逢魔'''が時}}, and in both cases the same reading applies: おうまがとき. I followed the precedent in the LoLK spell card "Ōmagatoki", but it looks like this doesn't follow the romanization style as is custom on TouhouWiki, nor does the one here currently which is "Omagatoki", but rather both should be "Oumagatoki" instead. However, as this term is known in English academia most often as Omagatoki or Ōmagatoki rather than Oumagatoki. I'm not sure what would be the best choice in this case. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:Going by the Wiki's romanization precedent, it should be Oumagatoki. Really, anything that doesn't express おう as Ō would be fine. Ō is おお. <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::In that case, I say we should change both to Oumagatoki. Even if it's not as common, the term is still searchable, and it would be consistent and prevent more headache down the line. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:59, 4 May 2021 (UTC)<br />
<br />
==== Stars Falling on Tenma's Mountain versus Starry Mountain of Tenma ====<br />
"Stars Falling" is a quite literal translation of {{lang|ja|星降る}}. Idiomatically, "starry" seems to be the most commonly used equivalent. However, "of Tenma" here sounds a bit awkward as well. Would something like "Tenma's Starry Mountain" be natural enough here while preserving the proper meaning? --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:What you say is true in part but I strongly believe 星降る was chosen intentionally over other words like 星の or 星々 (both being translatable to "starry"). "Star fall" matches quite nicely with Megumu's fight, as she's literally shooting stars at you all throughout. And tengu ("heavenly dogs") were originally demonifications of comets and shooting stars. I believe the literal meaning is the best choice here. I do think that I initially mis-conjugated the verb in English though. 降る is in the terminal form, so it should be "Stars Fall on Tenma's Mountain".<br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::I don't think there's a need to assume it's terminal rather than attributive since the term is used in modern Japanese, nor is there necessarily a locative sense to derive an "on" from. I can understand a desire to differentiate it with similar terms, but I don't see anything to suggest that the term 星降る in Japanese is unusual to deserve a literal interpretation rather than its frequent rendering as "starry". Maybe "star-filled" or "star-studded" would be enough of a difference? If pressed, then I can see something like "Tenma's Star-Fallen Mountain" as a poetic choice. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:11, 4 May 2021 (UTC)<br />
:::I am very much in favor of the word choice for "starry". It is short, concise, easy to understand, and gets the meaning across. My favorite would be the "Starry Mountain of Tenma". I am personally not a fan of going too much into poetic readings of song titles, those to me can be explored in derivative works, we should keep our translations as matter-of-factly as possible, without delving too much into interpretations. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::To be frank, I don't think it's poetic or an alternate interpretation. I'm certain that 星降る is meant to be taken literally. Megumu's first card prefix 禍星 (calamitous star) refers to the word 妖星 (ominous star) which in turn refers comets as they were considered bad omens. Tsukasa's final spell in the extra stage uses 龍星 (ryuusei, dragon star), a pun on 流星 (ryuusei, meteor), and ends in の舞 (dance of) like all of Megumu's cards. Iizuna Gongen is a tengu god who rides a fox and sometimes manifests as a shooting star. Even Megumu's name is 龍 (りゅう but pronounced めぐむ). I see it as an open and shut case that the title is meant to be read as "Stars Fall on Tenma's Mountain" considering all the references to meteors/comets. I won't push for it more beyond this. Maybe someone else who thinks so will visit the talk page in the future. <br />
::::--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 22:33, 5 May 2021 (UTC)<br />
:::::I was having a think through this and think both interpretations are technically correct. I feel that the {{lang|ja|星降る}} = 'starry' comparison comes from there being so many stars in the night sky that it makes it look like they're falling. I think this actually feels like a more poetic reading since you have to mentally step away from the literal 'falling stars' meaning to get to 'starry.' (I did a quick search but only came across [https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1443058284 this link].)<br />
:::::On the other hand, there's the literal translation (which to be honest is the one that came to mind when I first saw the theme's Japanese title). I prefer it personally, but would recommend a reword to make Tenma's Mountain the subject, as it is in the Japanese - We would get "Tenma's Mountain, Where Stars Fall". Anyway, leaving this here for consideration and potentially further discussion. [[User:Biggest Dreamer|Biggest Dreamer]] ([[User talk:Biggest Dreamer|talk]]) 08:39, 7 May 2021 (UTC)<br />
::::::I still don’t think “starry” is that off, but “Tenma’s Mountain, Where Stalls Fall” is also a very good choice.—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 09:22, 7 May 2021 (UTC)<br />
::::::That is certainly the original derivation of the expression, but I can’t find anything suggesting that it’s perceived as anything besides a fixed expression meaning something like “starry” or “star-filled”, or at least it is translated as thus without fail. I don’t believe in translating an idiomatic phrase into its component parts, but then again we have that with certain kotowaza in spell cards. If any of you want to change it to “Tenma’s Mountain, Where Stars Fall” I won’t object, although I would suggest leaving out the comma. I do think “Star-Fallen” is more poetic though a bit harder to parse, but using “on” when there is no target/goal in the original is strictly wrong in my opinion.—[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 22:01, 8 May 2021 (UTC)<br />
<br />
==== Dragon-King-Slaying Princess versus The Princess who Slew the Dragon King ====<br />
On the one hand "Dragon-King-Slaying" seems a bit awkward, given the multiple hyphens in a row, but the phrasing allows for ambiguity whether it's referring to a singular Dragon King or multiple Dragon Kings, unlike the latter translation. On the other hand, I do think the second one is a bit more evocative and fantastical, which I believe captures the mood of the phrasing in {{lang|ja|殺しの}} specifically. Either way appears to be a valid translation to me. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:This is tricky. First off, 殺し is attached to 龍王. 龍殺し (ryuu-goroshi) is already a word corresponding to the direct translation of "dragon slayer". The title just replaced 龍 with 龍王. So that first phrase is definitely "Dragon King Slayer". The issue is that "Dragon King Slayer Princess" is way too clunky in English, so I took the liberty to add hyphens where needed and changed it to "slayer" to "slaying" so it could roll off the tongue better. The title literally means "A Princess [that is] a Dragon King Slayer". Changing it to "The Princess Who Slew ''the'' Dragon King" is, in my opinion, misleading because in Touhou we know of the Dragon King's Palace at the Lunar Capital. That Dragon King is Watatsumi, the father of the Watatsukis, and there's no reason to believe he's dead and there multiple Dragon Kings in Japanese mythology. Using "the" would automatically lead people to assume Watatsumi. It can't be "''a'' Dragon King" either because why would the title just be a singular random Dragon King? The only way the title makes sense is if 龍王 is plural. I think the current title is good as is. Perhaps the clunkyness problem stems from the fact that the princess isn't named in-title. Wouldn't "Princess Momoya, Slayer of Dragon Kings" be nice? <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::If it's just plurality that's the issue, how about "The Princess who Slew Dragon Kings" then or "The Princess, a Slayer of Dragon Kings" or even "The Slayer/Slaying Princess of Dragon Kings"? I don't agree with adding a name here, and the current title still feels too clunky and matter-of-fact. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:17, 4 May 2021 (UTC)<br />
:::Slayer Princess of Dragon Kings sounds very nice to me. It has a nice ring to it. Short, easy to understand and to the point. I think it is the best choice. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::I've asked for a few more opinions, and they all seemed to suggest "Princess [Name], Slayer of Dragon Kings" independently, and it would be a logical choice if not for an explicit choice on our part to add a name where there was none. One person did suggest "Princess, Slayer of Dragon Kings" as well, so similar to that but without including the name there, which would solve that problem. I think that's interesting, and I think it's not too strange as the title of a song. Perhaps a few articles could be added or we could leave it as is. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:41, 5 May 2021 (UTC)<br />
:::::Princess, a Slayer of Dragons sounds fine as well. I must admit, I don't really like the current title.--[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 11:49, 5 May 2021 (UTC)<br />
::::::I feel that "Princess, Slayer of Dragon Kings" needs a 'The' at the start of it, otherwise it sounds to me like 'Princess' is a name. If the original 'Dragon-King-Slaying Princess' has too many hyphens, how about 'Dragonking-Slaying Princess' or 'Dragonlord-Slaying Princess'? Otherwise, there's the option to treat it the same as {{lang|ja|人恋し神様}} (A God That Misses People) and go with 'The Princess Who Slays Dragon Kings'. There's even the option of coining a word and going with something like 'Dracocidal Princess', though that might be a step too far... [[User:Biggest_Dreamer|Biggest_Dreamer]] ([[User talk:Biggest_Dreamer|talk]]) 21:32, 5 May 2021 (UTC)<br />
:::::::The Princess Who Slays Dragon Kings is a very fine choice too. Not a fan of the rest, though. —[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 21:47, 5 May 2021 (UTC)<br />
::::::::I agree with The Princess Who Slays Dragon Kings. It's essentially a direct rephrasing of the current name but spacing it out to be less densely packed. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 01:47, 6 May 2021 (UTC)<br />
<br />
==== The Rainbow-Colored World versus A World of Rainbow Colors ====<br />
This is another one where it's more about the emotion evoked by the phrasing. In fact, this was also translated as "A World Colored with Rainbows" before the current version on here. Using "The World" suggests it literally referring to our world as being rainbow-colored, whereas using "A World" suggests that the world is being seen through rainbow-colored lenses. I also think the phrasing of the {{lang|ja|虹色}} part of it may also have a slight effect. Obviously I'm biased to my own translation "A World of Rainbow Colors", so I'd like to gauge more opinions. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:I am indifferent between those two choices as I originally wrote "A World Colored of Rainbow". It's solemn and poetic, like ZUN feels in the music comment. It should always be "A World" (not "The World"), though, because the comment talks as if it yet to pass. It's a fantasy, a non-existing thing. <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]])) 06:46, 4 May 2021 (UTC)<br />
::I like the poetry of "A World Colored of Rainbow" but it implies a verbal action ("coloring") having been performed on the world. Maybe a bit too nitpicky, as I'm happy with that as the choice. But there must be some justification for having edited it out, so I'd like to hear other opinions first as well. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:20, 4 May 2021 (UTC)<br />
:::So look, I am not going to defend this to death, because the longer I look at it, the more "A Rainbow-Colored World" and "A World of Rainbow Colors" start to look absolutely the same to me. I can only tell you what made me make this decision, and it is 1. My interpretation of the comment, which made me think of the pharse "seeing the world through rose tinted glasses", which is similar to "rose-colored" which in turn gave me "A Rainbow-Colored World", and 2. To me, "A World Colored with Rainbows" sounds just kind of like the type of sentence you get while using machine translations. I can't really explain it, to me, when reading it, it just sounded wonky and not like a song title? I hope it makes sense, those are all just my personal opinions, at the end of the day, the translations are meant to serve the fandom, and if people, in general, feel better about "A World of Rainbow Colors", then it is absolutely fine. What I would be against is anything other besides those two forms, because thus far every other one I've seen or thought of does carry some sort of personal interpretation throughout it which can distort the original meaning. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::As the main issue was with the article "a" versus "the", I think "A Rainbow-Colored World" is a good enough choice here that minimizes too much change here.--[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:42, 5 May 2021 (UTC)<br />
<br />
== ルナレインボー ==<br />
<br />
I had never heard of a "lunar rainbow" before and was not even aware of such concept. While working on a non-English translation of the game, I simply just decided to translate it as "lunar rainbow" as well. However, not long after I come across the English word "moonbow", which describes this phenomena and, in fact, looked like the correct word for it. One more google search for ルナレインボー and you get... a moonbow, exactly as described! Is this another "バックダンサー" situation? It seems to me that "moonbow" is simply the correct translation for ルナレインボー here. The only thing making me not be 100% certain about wanting a change for the music title specifically is Chimata's dialogue, which uses 月虹 instead. So I was wondering, do we keep the title as "Lunar Rainbow" and the dialogue unchanged? Change the music title to "Moonbow" and keep the dialogue? Change both? Change ''neither''? I think this is a discussion worth having regardless? -- [[User:Mddass|Mddass]] ([[User talk:Mddass|talk]]) 06:06, 20 May 2021 (UTC) <br />
Edit: Did some more research and I just find it odd that every time "lunar rainbow" is mentioned online it's always in the context of "it's a moonbow, but it's sometimes also called a lunar rainbow", seldom directly used? -- [[User:Mddass|Mddass]] ([[User talk:Mddass|talk]]) 06:11, 20 May 2021 (UTC)</div>Mddasshttps://en.touhouwiki.net/index.php?title=Talk:Unconnected_Marketeers/Music&diff=430328Talk:Unconnected Marketeers/Music2021-05-20T06:06:33Z<p>Mddass: /* ルナレインボー */ new section</p>
<hr />
<div>=={{lang|ja|妖異達}}==<br />
I'm unsure if this is a typo on ZUN's part or not. 妖異 is a word roughly meaning "mysterious incident/occurance" but incidents in Touhou are usually called 異変. There's only once incident in-game so far, so 妖異'''達''' makes no sense to me IMO. Was it a typo of 妖怪達? Was it not? I don't know. Input appreciated. <br />
—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 6:06, 21 March 2021 (UTC)<br />
:My first guess is it's another term people use similarly to 妖怪 and 妖魔? Google indicates it's used in that sort of context in other media; for instance it's the JP name of a species in Final Fantasy 14, there's a historical fantasy novel called 妖異の棲む城, etc. I'm inclined to believe it's not a typo atm? [[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 06:15, 21 March 2021 (UTC)<br />
::It's probably best if it's not "Apparitions" (since that was used for 妖魔 in EoSD). I think "unexplained phenomena" covers both things ''and'' events at the same time. Also a "shower" is passing and short-lived by defintion. How about "A Shower of Rain and Unexplained Phenomena"? <br />
::—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 10:29, 21 March 2021 (UTC)<br />
:::Unlike 妖怪 and 妖魔, 妖異 can also just refer to things that are strange and bizarre, aside from youkai. So maybe something like "A Shower of the Mystical and Bizzare"? Since it does technically include youkai and the like as well.<br />
:::—[[User:(-O-)|(-O-)]] ([[User talk:(-O-)|talk]]) 10:43, 21 March 2021 (UTC)<br />
::::Yes, the word 妖異 mostly refers to strange '''occurrences''', rather than strange '''beings''', so I'm very in support of "A Shower of the Mystical and Bizzare".<br />
::::—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 13:14, 21 March 2021 (UTC)<br />
:::::Not to be a stickler but 妖異 is one word and just means "anomaly" (literally "strange occurrence"). It'd be preferable not to add extra words that aren't there. I think "[A] Shower of Strange Occurrences" or "[A] Shower of Anomalies" is best then. <br />
:::::—[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 16:11, 21 March 2021 (UTC)<br />
::::::That works just as fine in my opinion, although I suppose I prefer 'Strange/Mystical Occurance' to 'Anomaly' in this case.<br />
::::::—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 16:25, 21 March 2021 (UTC)<br />
<br />
== Title translations ==<br />
The title screen theme 虹の架かる幻想郷 describes Gensokyo in the active, not passive voice, so the more accurate translation would be "A Rainbow-Spanning Gensokyo". The stage 2 boss theme 大吉キトゥン isn't stating that Mike herself is fortunate, but rather that she brings fortune to others. She's a "Kitten of Great Fortune". These are pretty straight-forward changes, but I wanted to mention it in the talk page here since song titles are pretty important. [[User:Flan27|Flan27]] ([[User talk:Flan27|talk]]) 18:42, 21 March 2021 (UTC)<br />
:I feel a little on the fence with translating "架かる" to "spanning" in this case. I feel like "over" would be a simpler translation, but either could work. I have this odd feeling that we are dealing with a rainbow bridge.... [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 19:42, 22 March 2021 (UTC)<br />
<br />
== Title translations 2 ==<br />
It seems both of the translations done here (by [[User:Ennin|Ennin]] and to a lesser extent [[User:Yamaxandu|Yamaxandu]]) and on THPatch (by me) were done independently within a couple of hours from one another (which makes sense given the timeliness of it). We were able to sort out most of them through Discord chat except a few, whose reasonings I'd like to go over below. Please comment in each sub-section to keep things clear. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
<br />
==== The Long-Awaited Omagatoki vs. The Long-Awaited Ōmagatoki ====<br />
This is clearly more about style more than anything else, and fairly minor. The quandary here is that for both here and [[Legacy_of_Lunatic_Kingdom/Spell_Cards/Extra]], the same kanji is being used: {{lang|ja|異界「'''逢魔'''ガ刻」}} for LoLK versus {{lang|ja|待ちわびた'''逢魔'''が時}}, and in both cases the same reading applies: おうまがとき. I followed the precedent in the LoLK spell card "Ōmagatoki", but it looks like this doesn't follow the romanization style as is custom on TouhouWiki, nor does the one here currently which is "Omagatoki", but rather both should be "Oumagatoki" instead. However, as this term is known in English academia most often as Omagatoki or Ōmagatoki rather than Oumagatoki. I'm not sure what would be the best choice in this case. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:Going by the Wiki's romanization precedent, it should be Oumagatoki. Really, anything that doesn't express おう as Ō would be fine. Ō is おお. <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::In that case, I say we should change both to Oumagatoki. Even if it's not as common, the term is still searchable, and it would be consistent and prevent more headache down the line. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:59, 4 May 2021 (UTC)<br />
<br />
==== Stars Falling on Tenma's Mountain versus Starry Mountain of Tenma ====<br />
"Stars Falling" is a quite literal translation of {{lang|ja|星降る}}. Idiomatically, "starry" seems to be the most commonly used equivalent. However, "of Tenma" here sounds a bit awkward as well. Would something like "Tenma's Starry Mountain" be natural enough here while preserving the proper meaning? --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:What you say is true in part but I strongly believe 星降る was chosen intentionally over other words like 星の or 星々 (both being translatable to "starry"). "Star fall" matches quite nicely with Megumu's fight, as she's literally shooting stars at you all throughout. And tengu ("heavenly dogs") were originally demonifications of comets and shooting stars. I believe the literal meaning is the best choice here. I do think that I initially mis-conjugated the verb in English though. 降る is in the terminal form, so it should be "Stars Fall on Tenma's Mountain".<br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::I don't think there's a need to assume it's terminal rather than attributive since the term is used in modern Japanese, nor is there necessarily a locative sense to derive an "on" from. I can understand a desire to differentiate it with similar terms, but I don't see anything to suggest that the term 星降る in Japanese is unusual to deserve a literal interpretation rather than its frequent rendering as "starry". Maybe "star-filled" or "star-studded" would be enough of a difference? If pressed, then I can see something like "Tenma's Star-Fallen Mountain" as a poetic choice. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:11, 4 May 2021 (UTC)<br />
:::I am very much in favor of the word choice for "starry". It is short, concise, easy to understand, and gets the meaning across. My favorite would be the "Starry Mountain of Tenma". I am personally not a fan of going too much into poetic readings of song titles, those to me can be explored in derivative works, we should keep our translations as matter-of-factly as possible, without delving too much into interpretations. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::To be frank, I don't think it's poetic or an alternate interpretation. I'm certain that 星降る is meant to be taken literally. Megumu's first card prefix 禍星 (calamitous star) refers to the word 妖星 (ominous star) which in turn refers comets as they were considered bad omens. Tsukasa's final spell in the extra stage uses 龍星 (ryuusei, dragon star), a pun on 流星 (ryuusei, meteor), and ends in の舞 (dance of) like all of Megumu's cards. Iizuna Gongen is a tengu god who rides a fox and sometimes manifests as a shooting star. Even Megumu's name is 龍 (りゅう but pronounced めぐむ). I see it as an open and shut case that the title is meant to be read as "Stars Fall on Tenma's Mountain" considering all the references to meteors/comets. I won't push for it more beyond this. Maybe someone else who thinks so will visit the talk page in the future. <br />
::::--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 22:33, 5 May 2021 (UTC)<br />
:::::I was having a think through this and think both interpretations are technically correct. I feel that the {{lang|ja|星降る}} = 'starry' comparison comes from there being so many stars in the night sky that it makes it look like they're falling. I think this actually feels like a more poetic reading since you have to mentally step away from the literal 'falling stars' meaning to get to 'starry.' (I did a quick search but only came across [https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1443058284 this link].)<br />
:::::On the other hand, there's the literal translation (which to be honest is the one that came to mind when I first saw the theme's Japanese title). I prefer it personally, but would recommend a reword to make Tenma's Mountain the subject, as it is in the Japanese - We would get "Tenma's Mountain, Where Stars Fall". Anyway, leaving this here for consideration and potentially further discussion. [[User:Biggest Dreamer|Biggest Dreamer]] ([[User talk:Biggest Dreamer|talk]]) 08:39, 7 May 2021 (UTC)<br />
::::::I still don’t think “starry” is that off, but “Tenma’s Mountain, Where Stalls Fall” is also a very good choice.—[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 09:22, 7 May 2021 (UTC)<br />
::::::That is certainly the original derivation of the expression, but I can’t find anything suggesting that it’s perceived as anything besides a fixed expression meaning something like “starry” or “star-filled”, or at least it is translated as thus without fail. I don’t believe in translating an idiomatic phrase into its component parts, but then again we have that with certain kotowaza in spell cards. If any of you want to change it to “Tenma’s Mountain, Where Stars Fall” I won’t object, although I would suggest leaving out the comma. I do think “Star-Fallen” is more poetic though a bit harder to parse, but using “on” when there is no target/goal in the original is strictly wrong in my opinion.—[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 22:01, 8 May 2021 (UTC)<br />
<br />
==== Dragon-King-Slaying Princess versus The Princess who Slew the Dragon King ====<br />
On the one hand "Dragon-King-Slaying" seems a bit awkward, given the multiple hyphens in a row, but the phrasing allows for ambiguity whether it's referring to a singular Dragon King or multiple Dragon Kings, unlike the latter translation. On the other hand, I do think the second one is a bit more evocative and fantastical, which I believe captures the mood of the phrasing in {{lang|ja|殺しの}} specifically. Either way appears to be a valid translation to me. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:This is tricky. First off, 殺し is attached to 龍王. 龍殺し (ryuu-goroshi) is already a word corresponding to the direct translation of "dragon slayer". The title just replaced 龍 with 龍王. So that first phrase is definitely "Dragon King Slayer". The issue is that "Dragon King Slayer Princess" is way too clunky in English, so I took the liberty to add hyphens where needed and changed it to "slayer" to "slaying" so it could roll off the tongue better. The title literally means "A Princess [that is] a Dragon King Slayer". Changing it to "The Princess Who Slew ''the'' Dragon King" is, in my opinion, misleading because in Touhou we know of the Dragon King's Palace at the Lunar Capital. That Dragon King is Watatsumi, the father of the Watatsukis, and there's no reason to believe he's dead and there multiple Dragon Kings in Japanese mythology. Using "the" would automatically lead people to assume Watatsumi. It can't be "''a'' Dragon King" either because why would the title just be a singular random Dragon King? The only way the title makes sense is if 龍王 is plural. I think the current title is good as is. Perhaps the clunkyness problem stems from the fact that the princess isn't named in-title. Wouldn't "Princess Momoya, Slayer of Dragon Kings" be nice? <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]]) 06:46, 4 May 2021 (UTC)<br />
::If it's just plurality that's the issue, how about "The Princess who Slew Dragon Kings" then or "The Princess, a Slayer of Dragon Kings" or even "The Slayer/Slaying Princess of Dragon Kings"? I don't agree with adding a name here, and the current title still feels too clunky and matter-of-fact. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:17, 4 May 2021 (UTC)<br />
:::Slayer Princess of Dragon Kings sounds very nice to me. It has a nice ring to it. Short, easy to understand and to the point. I think it is the best choice. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::I've asked for a few more opinions, and they all seemed to suggest "Princess [Name], Slayer of Dragon Kings" independently, and it would be a logical choice if not for an explicit choice on our part to add a name where there was none. One person did suggest "Princess, Slayer of Dragon Kings" as well, so similar to that but without including the name there, which would solve that problem. I think that's interesting, and I think it's not too strange as the title of a song. Perhaps a few articles could be added or we could leave it as is. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:41, 5 May 2021 (UTC)<br />
:::::Princess, a Slayer of Dragons sounds fine as well. I must admit, I don't really like the current title.--[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 11:49, 5 May 2021 (UTC)<br />
::::::I feel that "Princess, Slayer of Dragon Kings" needs a 'The' at the start of it, otherwise it sounds to me like 'Princess' is a name. If the original 'Dragon-King-Slaying Princess' has too many hyphens, how about 'Dragonking-Slaying Princess' or 'Dragonlord-Slaying Princess'? Otherwise, there's the option to treat it the same as {{lang|ja|人恋し神様}} (A God That Misses People) and go with 'The Princess Who Slays Dragon Kings'. There's even the option of coining a word and going with something like 'Dracocidal Princess', though that might be a step too far... [[User:Biggest_Dreamer|Biggest_Dreamer]] ([[User talk:Biggest_Dreamer|talk]]) 21:32, 5 May 2021 (UTC)<br />
:::::::The Princess Who Slays Dragon Kings is a very fine choice too. Not a fan of the rest, though. —[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 21:47, 5 May 2021 (UTC)<br />
::::::::I agree with The Princess Who Slays Dragon Kings. It's essentially a direct rephrasing of the current name but spacing it out to be less densely packed. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 01:47, 6 May 2021 (UTC)<br />
<br />
==== The Rainbow-Colored World versus A World of Rainbow Colors ====<br />
This is another one where it's more about the emotion evoked by the phrasing. In fact, this was also translated as "A World Colored with Rainbows" before the current version on here. Using "The World" suggests it literally referring to our world as being rainbow-colored, whereas using "A World" suggests that the world is being seen through rainbow-colored lenses. I also think the phrasing of the {{lang|ja|虹色}} part of it may also have a slight effect. Obviously I'm biased to my own translation "A World of Rainbow Colors", so I'd like to gauge more opinions. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 04:53, 4 May 2021 (UTC)<br />
:I am indifferent between those two choices as I originally wrote "A World Colored of Rainbow". It's solemn and poetic, like ZUN feels in the music comment. It should always be "A World" (not "The World"), though, because the comment talks as if it yet to pass. It's a fantasy, a non-existing thing. <br />
:--[[User:Ennin|Ennin]] ([[User talk:Ennin|talk]])) 06:46, 4 May 2021 (UTC)<br />
::I like the poetry of "A World Colored of Rainbow" but it implies a verbal action ("coloring") having been performed on the world. Maybe a bit too nitpicky, as I'm happy with that as the choice. But there must be some justification for having edited it out, so I'd like to hear other opinions first as well. --[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 07:20, 4 May 2021 (UTC)<br />
:::So look, I am not going to defend this to death, because the longer I look at it, the more "A Rainbow-Colored World" and "A World of Rainbow Colors" start to look absolutely the same to me. I can only tell you what made me make this decision, and it is 1. My interpretation of the comment, which made me think of the pharse "seeing the world through rose tinted glasses", which is similar to "rose-colored" which in turn gave me "A Rainbow-Colored World", and 2. To me, "A World Colored with Rainbows" sounds just kind of like the type of sentence you get while using machine translations. I can't really explain it, to me, when reading it, it just sounded wonky and not like a song title? I hope it makes sense, those are all just my personal opinions, at the end of the day, the translations are meant to serve the fandom, and if people, in general, feel better about "A World of Rainbow Colors", then it is absolutely fine. What I would be against is anything other besides those two forms, because thus far every other one I've seen or thought of does carry some sort of personal interpretation throughout it which can distort the original meaning. --[[User:Yamaxandu|Yamaxandu]] ([[User talk:Yamaxandu|talk]]) 17:39, 4 May 2021 (UTC)<br />
::::As the main issue was with the article "a" versus "the", I think "A Rainbow-Colored World" is a good enough choice here that minimizes too much change here.--[[User:Raazossaku|Raazossaku]] ([[User talk:Raazossaku|talk]]) 06:42, 5 May 2021 (UTC)<br />
<br />
== ルナレインボー ==<br />
<br />
I had never heard of a "lunar rainbow" before and was not even aware of such concept. While working on a non-English translation of the game, I simply just decided to translate it as "lunar rainbow" as well. However, not long after I come across the English word "moonbow", which describes this phenomena and, in fact, looked like the correct word for it. One more google search for ルナレインボー and you get... a moonbow, exactly as described! Is this another "バックダンサー" situation? It seems to me that "moonbow" is simply the correct translation for ルナレインボー here. The only thing making me not be 100% certain about wanting a change for the music title specifically is Chimata's dialogue, which uses 月虹 instead. So I was wondering, do we keep the title as "Lunar Rainbow" and the dialogue unchanged? Change the music title to "Moonbow" and keep the dialogue? Change both? Change ''neither''? I think this is a discussion worth having regardless? -- [[User:Mddass|Mddass]] ([[User talk:Mddass|talk]]) 06:06, 20 May 2021 (UTC)</div>Mddasshttps://en.touhouwiki.net/index.php?title=Talk:Ten_Desires/Music&diff=430319Talk:Ten Desires/Music2021-05-20T02:37:11Z<p>Mddass: Undo revision 430316 by Mddass (talk)</p>
<hr />
<div>== Is there a reason for this? ==<br />
<br />
"By the way, if you shout '''''“Bakayaro”(Idiot)''''' when you go to the sea, the fishermen would be surprised."<br />
<br />
I'm curious why we've got the romanised version of that word followed by (the translated word)? Or is it all going according to keikaku?<br />
<br />
keikaku means plan. --[[User:DarkOverord|DarkOverord]] 15:25, 21 April 2011 (UTC)<br />
<br />
And while I'm at it...<br />
<br />
"Well of course the '''Echoes (Yamabiko)''' get bored, it's understandable for "<br />
<br />
Now we've got the translated word followed by what is probably supposed to be there... In context "The echoes" makes no sense as opposed to "The Yamabiko" the species of [[Wikipedia:Gazu Hyakki Yakō|Youkai]]<br />
--[[User:DarkOverord|DarkOverord]] 15:35, 21 April 2011 (UTC)<br />
<br />
<br />
You're right, this makes no sense. Obviously 山彦 refers to the species. And obviously バカヤロー refers to idiot, so there's no point in leaving the japanese and then specifying the english translation afterwards.<br />
I'm surprised we don't have stuff like "Do hito(people) still shout “Yahou(yahoo)” when they go to the yama(mountains)."<br />
Well, I ruined the keikaku(plan), anyways. -- <small>—Preceding unsigned comment added by [[User:Sumisumi|Sumisumi]] ([[User talk:Sumisumi|talk]] • [[Special:Contributions/Sumisumi|contribs]]) 15:17, 6 May 2011 (UTC)</small><br />
<br />
<br />
(referring to stage 4 boss theme) Also, 塗り壁 in the original almost certainly refers to the youkai, so the translation should keep the name as 'Nurikabe'. -- <small>—Preceding unsigned comment added by [[User:Sumisumi|Sumisumi]] ([[User talk:Sumisumi|talk]] • [[Special:Contributions/Sumisumi|contribs]]) 08:49, 16 August 2011 (UTC)</small><br />
<br />
==Yuanxian or Yuanshen==<br />
{{lang|ja|古きユアンシェン}} - The Katakana part, rendered as Romaji is "Yuan Shen", so how it would changed to reffering Yuanxian instead of Yuanshen? I'm sure the people in Touhou Moto Neta may be wrong about this - [[User:KyoriAsh|KyoriAsh]] 13:16, 24 August 2011 (UTC)<br />
:It becomes a debate on which intended meaning we should favour. It's not much different than having a discussion on the 6+ possible renderings of [[Talk:Fairy Wars/Music#ルーズレイン|ルーズレイン]]. For the record, the alternate rendering [http://www.toho-motoneta.net/index.php?%C5%EC%CA%FD%BF%C0%CE%EE%C9%C0%2F%A2%F6%B8%C5%A4%AD%A5%E6%A5%A2%A5%F3%A5%B7%A5%A7%A5%F3 Touhou Motoneta] is proposing is "yuàn shēng". [[User:Kiefmaster99|- Kiefmaster99]] 14:04, 24 August 2011 (UTC)<br />
::However, their alternate proposal of "yuàn shēng" ({{lang|zh-cn|怨声}}) may be wrong, and I did discuss this issue with some of the chinese and they agreed that {{lang|zh-cn|元神}} (yuán shén) is the most possible kanji of this Katakana. - [[User:KyoriAsh|KyoriAsh]] 19:00, 24 August 2011 (UTC)<br />
:::At any rate, who's bright idea was it to put "Distant Hermit"? [[User:Code Slasher|Code Slasher]] 22:28, 27 August 2011 (UTC)<br />
<br />
== Stage 5 Theme ==<br />
<br />
Moved to [[Talk:Dream Palace Great Mausoleum#Proposal to Move to Dream Palace of the Great Mausoleum]]. [[User:Kiefmaster99|- Kiefmaster99]] 19:32, 29 February 2012 (UTC)<br />
<br />
==Title of Futo's theme==<br />
I think it's pretty clear that Futo's theme is meant to reference the [[wikipedia:Ōmiwa_jinja|Omiwa Shrine]]. ZUN's comment confirms that the 大神 in the title is pronounced "Omiwa", the Omiwa Shrine is said in legend to have been founded by the Mononobe clan's founder, and one of Futo's cards in HM further references the mountain the shrine worships. Just translating it as "Great Gods" is super vague, and completely removes the reference to the Omiwa Shrine in specific, so I think "Legends of Omiwa" or something like that would be better. [[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 23:32, 25 April 2015 (UTC)<br />
:That certainly complicates things. In addition, "神話" can translate to "mythology" or "myth" and "伝" can translate to "legend", "summon", "propagate", "transmit", or even "heat transfer". The current translation leaves out the "mythology" part of the title. [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 20:38, 28 April 2015 (UTC)<br />
::I agree with this. Once pointed out, the relation seems obvious. To further support this, I would also argue that the imagery of her final TD spell is meant to mimic the 三輪 imagery of Borromean rings. Code Slasher, "legend" is a perfectly good translation of both 神話 and 伝. 神話 infers the mythological meaning, while 伝 refers mostly to the communicative aspect. 伝説, for example, is ''also'' well-translated as "legend", and more specifically refers to a folkloric story. The only reason you're getting all of these terms is because you've tossed it into some online dictionary. 伝熱 means heat transfer and contains the kanji 伝, but it has absolutely nothing to do with this topic. -- <small>—Preceding unsigned comment added by [[User:Drake Irving|Drake Irving]] ([[User talk:Drake Irving|talk]] • [[Special:Contributions/Drake Irving|contribs]]) 18:02, 28 April 2015 (UTC)</small><br />
:::Fine, but I was merely trying to help the users of this wiki make an informed decision based on the entire title. Thank you for your extra input. [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 23:24, 28 April 2015 (UTC)<br />
::::I just wanted to clarify why the translation as "legend" is definitely correct, since by listing a bunch of random terms that may include 伝 as a compound you seemed to not be aware of what 伝 would mean here, and your comment seemed to suggest that "legend" could be an inappropriate translation. It was not a personal attack in the least, and I'm sorry if you got that impression. [[User:Drake Irving|Drake Irving]] ([[User talk:Drake Irving|talk]]) 23:45, 28 April 2015 (UTC)<br />
Alright, going back to the original suggestion: do you think "Omiwa Legend" might be better, as we might be dealing with a single legend and "Omiwa" might be the adjective describing the "legend", or do you think there are multiple legends being addressed here and the "legends" are depicting something about "Omiwa"? I might be more inclined to pick the former due to the absence of our good friend "の". [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 00:19, 29 April 2015 (UTC)<br />
:Oh, hi! Sorry for the late reply.<br />
:*I would think that "Omiwa Legend" and "Legend of Omiwa" mean pretty much the same thing here? Since "Omiwa" is a proper noun to begin with. They're legends regarding a place called Omiwa. If I had to pick one, it'd be the latter, but either one seems fine to me.<br />
:*As for whether it's one legend or several: Japanese doesn't specify plurals all that well, so it could be whichever. Based on some quick Google searching, there's a lot of legends regarding the mountain and its shrine, so I personally would go with 'legends,' plural. But that's just me.<br />
:[[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 19:39, 30 April 2015 (UTC)<br />
::When I try to determine the plurality of a word in a song title, I look for context clues and wiki consistency. This is a theme for a single character, and because we chose "Shoutoku Legend ~ True Administrator", my vote is for "Omiwa Legend". [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 17:20, 1 May 2015 (UTC)<br />
<br />
Alright, this is the last call before we change "大神神話伝" to "Omiwa Legend". Any objections? [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 04:34, 8 June 2015 (UTC)</div>Mddasshttps://en.touhouwiki.net/index.php?title=Talk:Ten_Desires/Music&diff=430316Talk:Ten Desires/Music2021-05-20T00:22:01Z<p>Mddass: /* "Ghost Lead" */ new section</p>
<hr />
<div>== Is there a reason for this? ==<br />
<br />
"By the way, if you shout '''''“Bakayaro”(Idiot)''''' when you go to the sea, the fishermen would be surprised."<br />
<br />
I'm curious why we've got the romanised version of that word followed by (the translated word)? Or is it all going according to keikaku?<br />
<br />
keikaku means plan. --[[User:DarkOverord|DarkOverord]] 15:25, 21 April 2011 (UTC)<br />
<br />
And while I'm at it...<br />
<br />
"Well of course the '''Echoes (Yamabiko)''' get bored, it's understandable for "<br />
<br />
Now we've got the translated word followed by what is probably supposed to be there... In context "The echoes" makes no sense as opposed to "The Yamabiko" the species of [[Wikipedia:Gazu Hyakki Yakō|Youkai]]<br />
--[[User:DarkOverord|DarkOverord]] 15:35, 21 April 2011 (UTC)<br />
<br />
<br />
You're right, this makes no sense. Obviously 山彦 refers to the species. And obviously バカヤロー refers to idiot, so there's no point in leaving the japanese and then specifying the english translation afterwards.<br />
I'm surprised we don't have stuff like "Do hito(people) still shout “Yahou(yahoo)” when they go to the yama(mountains)."<br />
Well, I ruined the keikaku(plan), anyways. -- <small>—Preceding unsigned comment added by [[User:Sumisumi|Sumisumi]] ([[User talk:Sumisumi|talk]] • [[Special:Contributions/Sumisumi|contribs]]) 15:17, 6 May 2011 (UTC)</small><br />
<br />
<br />
(referring to stage 4 boss theme) Also, 塗り壁 in the original almost certainly refers to the youkai, so the translation should keep the name as 'Nurikabe'. -- <small>—Preceding unsigned comment added by [[User:Sumisumi|Sumisumi]] ([[User talk:Sumisumi|talk]] • [[Special:Contributions/Sumisumi|contribs]]) 08:49, 16 August 2011 (UTC)</small><br />
<br />
==Yuanxian or Yuanshen==<br />
{{lang|ja|古きユアンシェン}} - The Katakana part, rendered as Romaji is "Yuan Shen", so how it would changed to reffering Yuanxian instead of Yuanshen? I'm sure the people in Touhou Moto Neta may be wrong about this - [[User:KyoriAsh|KyoriAsh]] 13:16, 24 August 2011 (UTC)<br />
:It becomes a debate on which intended meaning we should favour. It's not much different than having a discussion on the 6+ possible renderings of [[Talk:Fairy Wars/Music#ルーズレイン|ルーズレイン]]. For the record, the alternate rendering [http://www.toho-motoneta.net/index.php?%C5%EC%CA%FD%BF%C0%CE%EE%C9%C0%2F%A2%F6%B8%C5%A4%AD%A5%E6%A5%A2%A5%F3%A5%B7%A5%A7%A5%F3 Touhou Motoneta] is proposing is "yuàn shēng". [[User:Kiefmaster99|- Kiefmaster99]] 14:04, 24 August 2011 (UTC)<br />
::However, their alternate proposal of "yuàn shēng" ({{lang|zh-cn|怨声}}) may be wrong, and I did discuss this issue with some of the chinese and they agreed that {{lang|zh-cn|元神}} (yuán shén) is the most possible kanji of this Katakana. - [[User:KyoriAsh|KyoriAsh]] 19:00, 24 August 2011 (UTC)<br />
:::At any rate, who's bright idea was it to put "Distant Hermit"? [[User:Code Slasher|Code Slasher]] 22:28, 27 August 2011 (UTC)<br />
<br />
== Stage 5 Theme ==<br />
<br />
Moved to [[Talk:Dream Palace Great Mausoleum#Proposal to Move to Dream Palace of the Great Mausoleum]]. [[User:Kiefmaster99|- Kiefmaster99]] 19:32, 29 February 2012 (UTC)<br />
<br />
==Title of Futo's theme==<br />
I think it's pretty clear that Futo's theme is meant to reference the [[wikipedia:Ōmiwa_jinja|Omiwa Shrine]]. ZUN's comment confirms that the 大神 in the title is pronounced "Omiwa", the Omiwa Shrine is said in legend to have been founded by the Mononobe clan's founder, and one of Futo's cards in HM further references the mountain the shrine worships. Just translating it as "Great Gods" is super vague, and completely removes the reference to the Omiwa Shrine in specific, so I think "Legends of Omiwa" or something like that would be better. [[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 23:32, 25 April 2015 (UTC)<br />
:That certainly complicates things. In addition, "神話" can translate to "mythology" or "myth" and "伝" can translate to "legend", "summon", "propagate", "transmit", or even "heat transfer". The current translation leaves out the "mythology" part of the title. [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 20:38, 28 April 2015 (UTC)<br />
::I agree with this. Once pointed out, the relation seems obvious. To further support this, I would also argue that the imagery of her final TD spell is meant to mimic the 三輪 imagery of Borromean rings. Code Slasher, "legend" is a perfectly good translation of both 神話 and 伝. 神話 infers the mythological meaning, while 伝 refers mostly to the communicative aspect. 伝説, for example, is ''also'' well-translated as "legend", and more specifically refers to a folkloric story. The only reason you're getting all of these terms is because you've tossed it into some online dictionary. 伝熱 means heat transfer and contains the kanji 伝, but it has absolutely nothing to do with this topic. -- <small>—Preceding unsigned comment added by [[User:Drake Irving|Drake Irving]] ([[User talk:Drake Irving|talk]] • [[Special:Contributions/Drake Irving|contribs]]) 18:02, 28 April 2015 (UTC)</small><br />
:::Fine, but I was merely trying to help the users of this wiki make an informed decision based on the entire title. Thank you for your extra input. [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 23:24, 28 April 2015 (UTC)<br />
::::I just wanted to clarify why the translation as "legend" is definitely correct, since by listing a bunch of random terms that may include 伝 as a compound you seemed to not be aware of what 伝 would mean here, and your comment seemed to suggest that "legend" could be an inappropriate translation. It was not a personal attack in the least, and I'm sorry if you got that impression. [[User:Drake Irving|Drake Irving]] ([[User talk:Drake Irving|talk]]) 23:45, 28 April 2015 (UTC)<br />
Alright, going back to the original suggestion: do you think "Omiwa Legend" might be better, as we might be dealing with a single legend and "Omiwa" might be the adjective describing the "legend", or do you think there are multiple legends being addressed here and the "legends" are depicting something about "Omiwa"? I might be more inclined to pick the former due to the absence of our good friend "の". [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 00:19, 29 April 2015 (UTC)<br />
:Oh, hi! Sorry for the late reply.<br />
:*I would think that "Omiwa Legend" and "Legend of Omiwa" mean pretty much the same thing here? Since "Omiwa" is a proper noun to begin with. They're legends regarding a place called Omiwa. If I had to pick one, it'd be the latter, but either one seems fine to me.<br />
:*As for whether it's one legend or several: Japanese doesn't specify plurals all that well, so it could be whichever. Based on some quick Google searching, there's a lot of legends regarding the mountain and its shrine, so I personally would go with 'legends,' plural. But that's just me.<br />
:[[User:Gilde|Gilde]] ([[User talk:Gilde|talk]]) 19:39, 30 April 2015 (UTC)<br />
::When I try to determine the plurality of a word in a song title, I look for context clues and wiki consistency. This is a theme for a single character, and because we chose "Shoutoku Legend ~ True Administrator", my vote is for "Omiwa Legend". [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 17:20, 1 May 2015 (UTC)<br />
<br />
Alright, this is the last call before we change "大神神話伝" to "Omiwa Legend". Any objections? [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 04:34, 8 June 2015 (UTC)<br />
<br />
== "Ghost Lead" ==<br />
<br />
What is the reason behind translating the title of the track to "Ghost Lead" instead of "Ghost Reed"? Nothing at all alludes to "lead" making any sense here. The only possible reasoning behind that is if you take "lead" to mean "clue"... which still hardly makes any sense - the track is a character theme, not some cinematic score (plus the description talks about the theme in relation to the character). There would be a case if the track itself wasn't composed (almost?) entirely ''of trumpets'', ''which are reed instruments.'' -- [[User:Mddass|Mddass]] ([[User talk:Mddass|talk]]) 00:22, 20 May 2021 (UTC)</div>Mddasshttps://en.touhouwiki.net/index.php?title=Nazrin&diff=427959Nazrin2021-03-31T12:27:29Z<p>Mddass: /* Additional Information */</p>
<hr />
<div>{{Infobox Character<br />
| nameJp = {{lang|ja|ナズーリン}}<br />
| nameEn = Nazrin<br />
| nameAlt = Nasrin, Nazrin, Nesrin, Nazu-rin<br />
| nameIPA = nazɯːɽʲiɴ [[Media:Pronunciation_Nazrin.ogg|(♫)]]<br />
| image = [[File:Th12Nazrin1.png|x325px|Nazrin]]<br />
| caption = Nazrin in [[Undefined Fantastic Object]]<br />
| chartitle = {{H:title|The Little Dowser General|ダウザーの小さな大将}}<br />
| species = [[Mouse]] [[youkai]]<br />
| abilities = Finding sought-for items<br />
| age = At least 1000 years<br />
| occupation = Dowser, said to be a leader of mice<br />
| location = [[Palanquin Ship|Temple of Myouren]], [[Muenzuka]]<br />
| MusicThemes = *{{H:title|{{lang|ja|小さな小さな賢将}}|A Tiny, Tiny, Clever Commander}} ([[Undefined Fantastic Object]])<br />
| appOfficialgames = *''[[Undefined Fantastic Object]]'' (Stage 1 Midboss, Stage 1 Boss, Stage 5 Midboss)<br />
*''[[Double Spoiler]]'' (Scene 7-2, 7-4, 7-6 Boss)<br />
*''[[Hopeless Masquerade]]'' (Background Character)<br />
| appPrintworks = *''[[Oriental Sacred Place]]'' (Chapter 12 cameo)<br />
*''[[The Grimoire of Marisa]]''<br />
*''[[Wild and Horned Hermit]]'' (Chapter 2 cameo, 20 cameo, 22 cameo, 36 cameo, 43 cameo)<br />
*''[[Symposium of Post-mysticism]]''<br />
*''[[Forbidden Scrollery]]'' (Chapter 3, 16 cameo, 40 cameo)<br />
*''[[The Grimoire of Usami]]'' (Section 1-6)<br />
}}<br />
{{nihongo|'''Nazrin'''|ナズーリン|Nazūrin}} is a [[mouse]] [[youkai]] who's a skilled dowser and the leader of a great number of mice. As the leader of many mice, she often employs them to search for things for her; though if she were to ask them to find food, it would most likely be gone by the time they returned.<br />
<br />
==General Information==<br />
Nazrin first appeared as the [[stage]] 1 [[boss]] of ''[[Undefined Fantastic Object]]'' and later appeared as the stage 5 midboss. She was a target on Stage 7 in ''[[Double Spoiler]]'' and made a background appearance in ''[[Hopeless Masquerade]]''.<br />
<br />
===Personality===<br />
''[[Symposium of Post-mysticism]]'' describes Nazrin as having a large ego – due to being backed by [[Bishamonten]] himself – but that she is also timid, and would run away as soon as she became frightened. She also apparently eats quite a bit, and depending on how many mice are under her command at a given time, can put a serious dent in crop numbers.<br />
<br />
''Symposium of Post-mysticism'' also mentions that if one is firm and holds their ground while negotiating with her, they can get her to search for lost objects for them - while on the other hand, asking humbly and politely is likely only to inflate her ego.<br />
<br />
Throughout the events of ''[[Undefined Fantastic Object]]'' she is quite straightforward in speech.<br />
<br />
===Ability and Possessions===<br />
;Finding sought-for items<br />
As stated, Nazrin's ability is being able to find specific objects that are being looked for by someone. In order to effectively utilize the ability, she must have a clear, concrete image of what she is looking for. She presumably uses a pair of [[wikipedia:Dowsing rod|dowsing rods]] to aid her in this effort, which she uses to find gold and treasure, and also is able to order the mice under her command to assist her. The mouse and the [[wikipedia:Dowsing rod|dowsing rods]], freely using a pendulum, perform dowsing. It seems like the rod and the pendulum are utilised in battle, and are used as a shield and as a tool for firing [[danmaku]]. Furthermore, each end of the dowsing rods appears to have a letter. The left one has N (north) and W (west), while the right one has S (south) and E (east). Nazrin owns a pair of [[wikipedia:Dowsing rod|dowsing rods]], which she uses to find gold and treasure. She employs the rods in ''[[Undefined Fantastic Object]]'' to search for the lost pagoda of [[Bishamonten]], as well as the fragments of the Flying Storage.<br />
<br />
The origin of this is probably due to a legend where a trial was ordered for [[wikipedia:Ōkuninushi|Ookuninushi]] to marry Suserihime. There, a mouse came back with an arrow that Ookuninushi was searching for. However, for the method to be due to dowsing is not quite accurate, and the standard of searching at that time is unclear. Furthermore, as the ability itself is always ancillary, in the end, she searches at her feet. It also seems like for the sought-for food items, they are devoured by the mice before the food can come to hand.<br />
<br />
===Occupation===<br />
Nazrin acts as [[Shou Toramaru]]'s faithful helper, but is also the leader of a great deal of ordinary mice. In ''Symposium of Post-mysticism'', she is referred to as Shou's mouse familiar, but in reality she is a high-ranking youkai dispatched by Bishamonten. Because of this, she does not generally reside at the [[Myouren Temple]], and will not visit unless Shou calls upon her.<br />
<br />
She currently resides in a small self-built hut in [[Muenzuka]], because of the treasure that floats in from the outside world.<br />
<br />
==Backstory==<br />
Nazrin is a high-ranking youkai dispatched by the god [[Bishamonten]]. She was sent to god's new disciple, [[Shou Toramaru]], to be a helper and also to keep an eye on her.<br />
<br />
==Character Design==<br />
[[File:ThGKNazrin.png|thumb|right|200px|Nazrin as depicted in ''[[Symposium of Post-mysticism]]'']]<br />
===Name===<br />
Her only known name is {{nihongo|''Nazrin''|ナズーリン}}, which could be a reference to {{nihongo||鼠|nezumi}}, the Japanese word for "mouse". Her name could also be derived from [[wikipedia:Nasrin (name)|the Persian name ''Nasrin'']] ({{lang|fa|نسرین}}) with the meaning "wild rose", a widely used name in the Islamic world; various different spellings include ''Nasrin'', ''Nazrin'' and ''Nesrin''. There's also "Nasulin" ({{lang|ru|Насулин}}), a real Russian surname, and it's also the name of a nasal insulin. In the data files for ''[[Hopeless Masquerade]]'', her name was romanised as "nazu-rin".<br />
<br />
[[ZUN]] states in an interview that it made sense to have a mouse be the envoy of the Bishamonten; in the Chinese zodiac, the mouse represents north, as does Bishamonten.<ref>{{cite web|url=http://www.youtube.com/watch?v=otIrJdoaITI|title=Interview with Chara☆Mel|access-date=9 March 2011|author=Chara☆Mel|language=ja}}</ref><br />
<br />
===Design===<br />
Nazrin has gray hair and red eyes. She wears a brownish-black one-piece with pink sleeves and a gray capelet. She also wears a necklace with a crystal pendant. Carries dowsing rods with the letters for the cardinal directions on the ends. She also carries a mouse in a basket by her tail. When she appears as the Stage 5 midboss, she is carrying the jeweled pagoda of [[Bishamonten]].<br />
<br />
==Story==<br />
[[File:Th12Nazrin2.png|thumb|right|150px|Nazrin, as seen in Stage 5]]<br />
===Games===<br />
;''Undefined Fantastic Object''<br />
[[File:Th12NazrimSprite.png|frame|Nazrin's sprite in ''UFO'']]<br />
She was asked by [[Shou Toramaru]] to look for the lost pagoda of [[Bishamonten]]. On Stage 1 of ''Undefined Fantastic Object'', Nazrin descends from the flying ship after getting a treasure reading. Either by being provoked to or forced to, she attacks the player. After she loses the battle, she manages to flee the scene. Later she does find what she was looking for - the treasured pagoda, the other key to releasing [[Byakuren Hijiri]] - in a second-hand goods store (conceivably [[Kourindou]]).<br />
<br />
Later, in the middle of Stage 5, she encounters the player once more. Seeing that her allies have brought the player with the treasure, she decides to test out the pagoda against her in the meantime. She loses once more, and escapes to return the pagoda to her master, Shou.<br />
<br />
;''Double Spoiler''<br />
:{{Main|Double Spoiler#Story|l1=Double Spoiler Story}}<br />
In ''[[Double Spoiler]]'', Nazrin appeared as a [[stage]] 7 target, where she demonstrates her dowsing abilities to [[Aya Shameimaru]] and [[Hatate Himekaidou]] at their request to dig up a few old coins. Of course, she's actually using them as weapons in the [[spell card]]. She follows up on this by digging up some gold, fully demonstrating her dowsing abilities.<br />
<br />
;''Hopeless Masquerade''<br />
[[File:Th135Nazrin.png|frame|Nazrin in ''HM'']]<br />
Nazrin made a background cameo appearance in ''[[Hopeless Masquerade]]'' on the [[Palanquin Ship]]. She is seen standing on the ship waving her dowsing rods.<br />
<br />
===Literature===<br />
;''Wild and Horned Hermit'' chapter 2<br />
She appears in chapter 2 of ''[[Wild and Horned Hermit]]'' along with Shou as part of the large crowd gathered to observe [[Kanako Yasaka|Kanako]] and [[Sanae Kochiya|Sanae]]'s cold fusion experiment.<br />
<br />
==Relationships==<br />
;[[Shou Toramaru]] and [[Minamitsu Murasa]]<br />
Nazrin, while being a mouse youkai leader herself, is also Shou Toramaru's only known underling. She went to search for the lost pagoda on Shou's command, further showing her loyalty by keeping it a secret from [[Minamitsu Murasa]] - she states in [[Undefined Fantastic Object/Story/Marisa B's Scenario|Marisa B's story]] that Shou was probably too embarrassed to admit having lost it in the first place. It is stated in ''Symposium of Post-mysticism'' that she only really comes to the temple when Shou calls her, and otherwise lives in a little house she built near Muenzuka for the purposes of finding treasure there.<br />
;[[Bishamonten]]<br />
Originally, Nazrin had been placed as Shou's underling by Bishamonten in order to keep an eye on her, but as Shou exceeded all expectations, it eventually became unnecessary.<br />
<br />
==Gallery==<br />
<br />
===Covers===<br />
<gallery><br />
File:Th12demo cd.jpg|Nazrin, on the demo CD<br />
</gallery><br />
<br />
===Screenshots===<br />
<gallery><br />
File:OSPNazrin.png|Nazrin's appearance in ''[[Oriental Sacred Place]]''<br />
</gallery><br />
<br />
==Spell Cards==<br />
{{hidden begin|title = Spellcards|titlestyle = background:palegreen; text-align:center;}}<br />
{{#lsth:List_of Spell Cards/Touhou Project 2|[[Nazrin]]}}<br />
{{hidden end}}<br />
<br />
==Additional Information==<br />
*According to the game transcript (namely Reimu-A and Marisa-B), Nazrin is the only [[stage]] 1 [[boss]] in a [[Windows]] game to escape rather than actually be defeated by the heroine. She would also be one of two only stage 1 bosses to not been defeated; the other being [[Yuyuko Saigyouji]].<br />
*She is one of the few stage 1 bosses that actually have something to do with the plot, as opposed to "a pointless encounter with a pointless person", as [[Marisa Kirisame]] puts it. Another one is [[Seiran]] in ''[[Legacy of Lunatic Kingdom]]'', who is involved in the lunarian invasion of Gensokyo.<br />
*She is also the only [[Windows]]-era stage 1 boss who attacks the heroines out of necessity rather than aggression (like [[Rumia]] or [[Letty Whiterock]]), or irritation (like [[Yamame Kurodani]] or [[Minoriko Aki]]).<br />
*She was featured on the cover of ''[[Undefined Fantastic Object]]'' demo CD.<br />
*Her Hard-Lunatic mid-boss spell card looks almost exactly like [[Sara]]'s last attack pattern. (Also with Rumia, coincidence?)<br />
<br />
==Fandom==<br />
{{main|Fandom/Undefined Fantastic Object#Nazrin|l1=Fandom: Nazrin}}<br />
<br />
==Official Profiles==<br />
{{hidden begin|title = [[Undefined Fantastic Object]] - Settings and Extra Story.txt (Demo)|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = [[File:Th12Nazrin1.png|200px|Nazrin UFO]]<br />
| text = ○1面ボス ダウザーの小さな大将 <br /><br />
ナズーリン<br /><br />
Nazrin<br />
<br />
種族:妖怪ネズミ<br /><br />
能力:探し物を探し当てる程度の能力<br />
<br />
生粋のダウザー。無数の野鼠を操り、探し物を見つけるという。<br /><br />
ただし、食べ物の探し物は手元に来る前にネズミ達に食い荒らされて<br />
しまう。<br /><br />
ずる賢く、相手に敵わないと見るやいなやすぐに逃げてしまう。<br /><br />
何者かに命令されて、何かを探しに来ているようだが果たして……。 <br /><br />
<br />
| translation = '''Stage 1 boss The Little Dowser General'''<br /><br />
<br /><br />
'''Nazrin'''<br />
<br />
Race: Mouse youkai<br /><br />
Ability: Finding sought-for items<br />
<br />
A natural-born dowser. They say she controls a great number of field mice to find what she's looking for.<br /><br />
However, if it's food, the mice will eat it all up before they can get it to her.<br /><br />
She is cunning and will flee from a fight as soon as she sees an enemy stronger than herself.<br />
<br />
It seems she was ordered to look for something by somebody, but what could it be...}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Undefined Fantastic Object]] - Settings and Extra Story.txt |titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = [[File:Th12Nazrin1.png|200px|Nazrin UFO]]<br />
| text = ○1面ボス ダウザーの小さな大将<br /><br />
ナズーリン<br /><br />
Nazrin<br />
<br />
種族:妖怪ネズミ<br /><br />
能力:探し物を探し当てる程度の能力<br />
<br />
生粋のダウザー。無数の野鼠を操り、探し物を見つけるという。<br /><br />
ただし、食べ物の探し物は手元に来る前にネズミ達に食い荒らされてしまう。<br /><br />
ずる賢く、相手に敵わないと見るやいなやすぐに逃げてしまう。<br />
<br />
星から二つの探し物を依頼されて地上を探し回っていた。<br /><br />
探し物の一つは、飛宝と呼ばれる飛倉の破片。<br /><br />
もう一つは、毘沙門天の宝塔である。<br />
| translation = '''Stage 1 boss The Little Dowser General'''<br /><br />
<br /><br />
'''Nazrin'''<br />
<br />
Race: Mouse youkai<br /><br />
Ability: Finding sought-for items<br />
<br />
A natural-born dowser. They say she controls a great number of field mice to find what she's looking for.<br /><br />
However, if it's food, the mice will eat it all up before they can get it to her.<br /><br />
She is cunning and will flee from a fight as soon as she sees an enemy stronger than herself.<br />
<br />
She went to and fro looking for the two things [[Shou Toramaru|Shou]] entrusted her to find.<br /><br />
One was the fragments of Flying Storage that were being called the flying treasure.<br /><br />
The other was the [[Jeweled Pagoda of Bishamonten|jeweled pagoda of Bishamonten]].<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Undefined Fantastic Object]] - Settings and Extra Story.txt (Stage 5 Midboss)|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image =[[File:Th12Nazrin2.png|200px|Nazrin (Stage 5 MidBoss form)]]<br />
| text = ○5面中ボス ダウザーの小さな大将<br /><br />
ナズーリン<br /><br />
Nazrin<br />
<br />
やっと探し出せた宝塔。<br /><br />
実は宝塔を探していた事はムラサ達には内緒であった。<br /><br />
星も大切な宝塔を無くしていた事は、自分の手下以外には言えなかったのだろう。<br />
<br />
| translation = '''Stage 5 mid-boss The Little Dowser General'''<br /><br />
<br /><br />
'''Nazrin'''<br />
<br />
She's finally found the jeweled pagoda.<br /><br />
Actually, she kept it a secret from [[Minamitsu Murasa|Murasa]] that she was looking for it.<br /><br />
Shou probably didn't tell anyone but her own underlings she'd lost something so important.<br />
}}<br />
{{hidden end}}<br />
<br />
==Official Sources==<br />
{{hidden begin|title = Official sources|titlestyle = background:pink; text-align:center;}}<br />
*2009/03/08 '''[[Undefined Fantastic Object]] Demo''' - Stage 1 dialogue; Omake.txt (pre-official profile)<br />
*2009/08/15 '''[[Undefined Fantastic Object]]''' - Stage 1 dialogue; Stage 5 dialogue; Settings and Extra Story.txt (official profile)<br />
*2010/03/14 '''[[Double Spoiler]]''' - [[Double Spoiler/Spell Cards/Stage 7|Stage 7 spellcard comments]]<br />
*2010/09/25 '''[[Wild and Horned Hermit]]''' - Chapter 2<br />
*2010/12/25 '''[[Oriental Sacred Place]]''' - [[Oriental Sacred Place#OSD Chapter Twelve|Chapter 12]]<br />
*2012/04/27 '''[[Symposium of Post-mysticism]]'''<br />
*2013/12/10 '''[[Wild and Horned Hermit]]''' - Chapter 20<br />
{{hidden end}}<br />
<br />
==References==<br />
<references /><br />
<br />
{{Project Characters Notice}}<br />
{{Navbox Characters}}<br />
{{Navbox UFO}}<br />
{{Navbox DS}}<br />
{{Navbox HM}}<br />
<br />
[[de:Nazrin]]<br />
[[es:Nazrin]]<br />
[[fr:Nazrin]]<br />
[[pt:Nazrin]]<br />
[[ru:Назрин]]<br />
[[vi:Nazrin]]<br />
[[Category:Characters]]<br />
[[Category:Characters in Undefined Fantastic Object]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/POS&diff=424080User:Mddass/Touhou File Format Specification/POS2020-11-08T06:02:56Z<p>Mddass: /* File Format */</p>
<hr />
<div>The '''POS'''/'''.pos''' ([music] position) files specify the loop point data for the game BGM (loop start and loop length). It is one of the simplest formats used in ZUN's Windows games, comprising only two 32-bit values.<br />
<br />
===File Format===<br />
{| class="wikitable"<br />
|-<br />
! Type !! Description<br />
|-<br />
| Int32 || Loop start point, in audio samples.<br />
|-<br />
| Int32 || Loop end point, in audio samples.<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/POS&diff=424078User:Mddass/Touhou File Format Specification/POS2020-11-08T05:47:03Z<p>Mddass: </p>
<hr />
<div>The '''POS'''/'''.pos''' ([music] position) files specify the loop point data for the game BGM (loop start and loop length). It is one of the simplest formats used in ZUN's Windows games, comprising only two 32-bit values.<br />
<br />
===File Format===<br />
{| class="wikitable"<br />
|-<br />
! Type !! Description<br />
|-<br />
| Int32 || Loop start point, in <u>mono</u> audio samples.<br />
|-<br />
| Int32 || Loop length starting from the loop start point, in <u>mono</u> audio samples.<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Alice_Margatroid&diff=420437Alice Margatroid2020-06-17T15:26:54Z<p>Mddass: /* Artworks */</p>
<hr />
<div>{{Infobox Character<br />
| nameJp = アリス・マーガトロイド<br />
| nameEn = Alice Margatroid<br />
| nameIPA = [[Media:Pronunciation_AliceMargatroid.ogg|(♫)]]<br />
| image = [[File:Th105Alice.png|275px|Alice Margatroid]]<br />
| caption = Alice Margatroid in [[Scarlet Weather Rhapsody]]<br />
| chartitle = {{H:title|Seven-Colored Puppeteer|七色の人形遣い}}<br />
| species = [[Magician]], formerly [[human]]<ref name="PMiSSAlice">''[[Perfect Memento in Strict Sense]]'': [[Perfect Memento in Strict Sense/Alice Margatroid|Alice Margatroid]]</ref><br />
| abilities = Magic, Handling dolls<br />
| location = *A house in the [[Forest of Magic]] ([[Windows]] [[canon]])<br />
*[[Makai]] ([[PC-98]] canon)<br />
| MusicThemes = *{{H:title|{{lang|ja|プラスチックマインド}}|Plastic Mind}} ([[Mystic Square]])<br />
*the Grimoire of Alice ([[Mystic Square]], [[Touhou Hisoutensoku]])<br />
*{{H:title|{{lang|ja|人形裁判 ~}} {{lang|ja|人の形弄びし少女}}|Doll Judgement ~ The Girl Who Played with People's Shapes}} ([[Perfect Cherry Blossom]])<br />
*{{H:title|{{lang|ja|ブクレシュティの人形師}}|The Doll Maker of Bucuresti}} ([[Immaterial and Missing Power]], [[Scarlet Weather Rhapsody]])<br />
*{{H:title|{{lang|ja|人形裁判}}|Doll Judgement}} ([[Immaterial and Missing Power]])<br />
| appOfficialgames = *''[[Mystic Square]]'' (Cover, Stage 3 Boss, Extra Boss)<br />
*''[[Perfect Cherry Blossom]]'' (Stage 3 Midboss, Stage 3 Boss)<br />
*''[[Immaterial and Missing Power]]'' (Playable Character, Possible Opponent)<br />
*''[[Imperishable Night]]'' (Playable Character)<br />
*''[[Shoot the Bullet]]'' (Stage 3-1, 3-3, 3-5, 3-7 Boss)<br />
*''[[Scarlet Weather Rhapsody]]'' (Playable Character, Possible Opponent)<br />
*''[[Subterranean Animism]]'' (Playable Partner)<br />
*''[[Touhou Hisoutensoku]]'' (Playable Character, Possible Opponent, Final Boss of [[Cirno]]'s Scenario)<br />
*''[[Hopeless Masquerade]]'' (Background Character)<br />
| appPrintworks = *''[[Bohemian Archive in Japanese Red]]''<br />
*''[[Strange and Bright Nature Deity]]'' (Secondary Character)<br />
*''[[Perfect Memento in Strict Sense]]''<br />
*''[[Silent Sinner in Blue]]'' (Prologue cameo, Chapter 1, 9 cameo)<br />
*''[[Inaba of the Moon and Inaba of the Earth]]'' (Minor Character)<br />
*''[[The Grimoire of Marisa]]''<br />
*''[[Oriental Sacred Place]]'' (Chapter 12 cameo)<br />
*''[[Wild and Horned Hermit]]'' (Chapter 3 cameo, 11 cameo, 16 cameo, 32 cameo, 47 cameo, 48 cameo, 49 cameo)<br />
*''[[Forbidden Scrollery]]'' (Chapter 1 & 10 cameo)<br />
*''[[Strange Creators of Outer World]]'' Vol. 2 (Profile Section, Cross Review Section)<br />
*''[[Visionary Fairies in Shrine]]'' (Chapter 1 cameo, 9.5 cameo)<br />
*''[[Lotus Eaters]]'' (Chapters 4-5 cameo)<br />
}}<br />
{{nihongo|'''Alice Margatroid'''|アリス・マーガトロイド|Arisu Māgatoroido}} is a doll-controlling [[magician]] who lives in her home in the [[Forest of Magic]] near the home of [[Marisa Kirisame]]. According to ZUN's comments in the Music Room of ''[[Perfect Cherry Blossom]]'', Alice is kind of a special character in the ''[[Touhou Project]]''.<br />
<br />
==General Information==<br />
Alice made her first ever appearance of the fifth [[PC-98]] ''[[Touhou Project]]'' game ''[[Mystic Square]]'' as the third [[stage]] [[boss]] and the Extra stage boss. Afterwards, with her [[canon]] completely remodelled, she appeared again as the third stage boss and midboss in the seventh work ''[[Perfect Cherry Blossom]]'' and as a playable character in ''[[Imperishable Night]]'', along with being a playable partner in ''[[Subterranean Animism]]''. She was a playable character in ''[[Immaterial and Missing Power]]'' and ''[[Scarlet Weather Rhapsody]]'' and was the Final boss of [[Cirno]]'s scenario in ''[[Touhou Hisoutensoku]]''. Additionally, she was a target on Stage 3 of ''[[Shoot the Bullet]]'' and has made a background appearance in ''[[Hopeless Masquerade]]''.<br />
<br />
She is a pure all-purpose-type [[magician]] [[youkai]] who lives in a western-style house in the [[Forest of Magic]] without strengths and weaknesses in attributes, but she fundamentally fights in style of manipulating her self-made [[doll]]s. With a personality that is indifferent to other people, she is attached to magic, and is usually confident but is also timid in one aspect.<ref name="th075_txt">''[[Immaterial and Missing Power]]'': character profile</ref><br />
<br />
In the games on the [[PC-98]], she lived in [[Makai]] calling herself "The [[Magician]] of Makai" and had a black book that's called the "[[Grimoire of Alice]]". Makai was created by [[Shinki]], along with its residents. She was also a [[magician]] that can control [[doll]]s. She also created her own "Wonderland" in Makai. In the games on [[Windows]], Alice's book in her character portrait in ''[[Imperishable Night]]'' reveals that the writing possibly spells out "Grimoire". This is some evidence that the book is possibly the same Grimoire which Alice used in the Extra Stage. In ''[[Perfect Cherry Blossom]]'', she said, "at last, former friend, we meet again. Have you only brought me your life as a gift?" which can be considered to be something carried over from the PC-98 games, and [[ZUN]] himself said that it was the third time that they have fought. <br />
<br />
<br />
===Species===<br />
In her ''[[Imperishable Night]]'' profile, she is said to be a [[magician]] as a species, in contrast to [[Marisa]], who is a human that practices magic. In ''[[Perfect Memento in Strict Sense]]'', she is described as a magician youkai that used to be human and became a magician by using "abandon food" magic.<ref name="PMiSSAlice"/> It is unknown if she has also studied "abandon worms" magic to become a complete magician; without this magic, she would still possess a lifespan similar to humans. It is also said<ref name="PMiSSAlice"/> that she has only recently become a magician, and because of this, she apparently still continues human habits like eating and sleeping, despite them not being necessary.<br />
<br />
In ''[[Mystic Square]]'', Alice appears as a [[Makai]] resident and refers to Reimu as "human", implying that she may not be one in PC-98 canon.<br />
<br />
===Personality===<br />
According to ''Perfect Memento in Strict Sense'', maybe since she was originally a human, even as a youkai, she has high understanding and friendship level to humans and presents a low danger level, and if someone gets lost in the [[Forest of Magic]], she also gladly gives shelter upon arriving at her house. However, Alice's house is covered all over with dolls, and since she is not very eager for conversation, it seems like visitors immediately flee when there is something eerie.<ref name="PMiSSAlice"/><ref name="th075_txt"/> When she showed her hospitality was in ''[[Immaterial and Missing Power]]'', when she led [[Sakuya Izayoi]] out of the forest, who had become lost. <ref>''[[Immaterial and Missing Power]]'' - [[Immaterial_and_Missing_Power/Story/Sakuya's_Scenario|Sakuya's Scenario]]</ref><br />
<br />
She doesn't perform the usual act of attacking humans, but she unexpectedly likes fights and gladly accepts any challenge. She's an indoors type who usually works alone,<ref name="th08_txt">''[[Imperishable Night]]'': {{lang|ja|キャラ設定}}.txt</ref> but in ''Perfect Memento in Strict Sense'', the range of her place of activities is stated to be "any kind of place" in [[Gensokyo]]. She performs her share of intermingling with the village, appearing in front of people in times of festivals to exhibit her skills with dolls, which are quite well-received. In each ending of ''Imperishable Night'' and ''Immaterial and Missing Power'', she participated in banquets at the [[Hakurei Shrine]]. Just like [[Marisa Kirisame]], she has an obsession with collecting things, especially magic items. Although this is an area that could be thought of as an area of commonality between them, there has not been a single depiction that would suggest that she had anything stolen from Marisa.<br />
<br />
In chapters 5-6 of ''[[Strange and Bright Nature Deity]]'', the [[Three Fairies of Light]] accidentally arrived at her house and Alice was hospitable to them, providing tea and cake. She seemed caring with the fairies. However, [[Sunny Milk]] attempted to lie to Alice, but accidentally blurted out the truth instead. Among her ramblings, she mentions that she's looking for a magician with a grimoire that "shines wonderfully with all the seven colors of the light". Alice does not deny this to be false and became very angry. It is possible this is the in-universe explanation for her title, "Seven-Colored Puppeteer".<br />
<br />
The Japanese bullfinches (called {{nihongo||嘘|uso}}, a homophone with "lies") saw through the aforementioned lie of the fairies, and as "birds that peck at all lies said until now," a large group of them came flying to the window, and as opposed to how the fairies were severely pecked at, Alice was saying, "ufufu... so, how does it taste?" while nonchalantly providing a cracker to the bird. Thus, it could be said that ''Alice does not tell lies''.<br />
<br />
She's attached to magic, but she is indifferent to other people. She doesn't perform the usual act of attacking humans, but she unexpectedly likes fights and upon challenged to battle, she gladly accepts. As she manipulates a great number of combat dolls, the fight is compelled to be highly outnumbered, making a difficult battle inevitable, but since she has her hands full with manipulating the dolls, that is her weakness.<ref name="PMiSSAlice"/><br />
<br />
She's an indoors type who was often alone,<ref name="th08_txt">''[[Imperishable Night]]'': {{lang|ja|キャラ設定}}.txt</ref> but in ''[[Perfect Memento in Strict Sense]]'', the range of her place of activities is "any kind of place" in [[Gensokyo]], she performs her share of intermingling with the village, appearing in front of people in times of festivals to exhibit her skills with dolls. In each ending of ''Imperishable Night'' and ''Immaterial and Missing Power'', she participated in banquets at the [[Hakurei Shrine]]. In addition to things like "the frog dolls being popular," there have also been expressions that indicate that her dolls are well-received in the village. She also said things that hinted that she sometimes visits the library of the [[Scarlet Devil Mansion]].<ref>''[[Immaterial and Missing Power]]'': [[Immaterial and Missing Power/Story/Alice's Script|Match mode win quote (Alice beats Patchouli)]]</ref><br />
<br />
Just like [[Marisa Kirisame]], she has an obsession with collecting things, especially magic items. Although this is an area that could be thought of as an area of commonality between them, there has not been a single depiction that would suggest that she had anything stolen from Marisa.<br />
<br />
===Ability & Strength===<br />
[[File:GoMIllus-Alice.jpg|thumb|192px|Alice Margatroid, as illustrated in ''[[The Grimoire of Marisa]]''.]]<br />
Unlike Marisa, Alice does not find it enjoyable to win battles with overwhelming power and is more interested in strategy, so she usually fights with power that is a little above that of the opponent and always holds back even if it means losing. It is because if she were defeated using her true strength, then there would be nothing left afterwards, which resembles [[Reimu Hakurei]].<ref>''[[Perfect Cherry Blossom]]'' - Character Settings.txt</ref> It is unknown if this is fundamental to her personality, or if this is simply something she judged as an efficient strategy that her secret skills should not be shown.<br />
<br />
Related to this, in ''[[Scarlet Weather Rhapsody]]'', among the 15 characters, she did not have a cost 5 [[spell card]], which might be an example of not showing her true strength. However, in ''[[Touhou Hisoutensoku]]'', a cost 5 spell card was added. In the first place, since in ''[[Imperishable Night]]'', she had a Last Word just like other characters, which were supposed to exemplify each of the characters' full strength, it does not mean that she never displays her full strength (with an appropriate spell card) no matter what the situation. On the other hand, it could also be that her last word spell card ''The Phantom of the Grand Guignol'' was actually still going easy.<br />
<br />
In ''Immaterial and Missing Power'', she kept avoiding the really strong characters<ref>''[[Immaterial and Missing Power]]'' - [[Immaterial and Missing Power/Story/Alice's Scenario|Alice's Scenario]]</ref>, not fighting those like [[Remilia Scarlet]] and [[Yuyuko Saigyouji]], spending her efforts to get to [[Suika Ibuki]]. It is unclear what state of mind she had at that time to do such a thing. Incidentally, it was the same in ''[[Scarlet Weather Rhapsody]]''. Concerning this, she succeeded in her goal when she met [[Sakuya Izayoi]], [[Patchouli Knowledge]], and [[Youmu Konpaku]], as she judged that it would a waste of effort to meet Remilia and Yuyuko, but she did engage in a battle with the powerful [[Yukari Yakumo]]. Additionally, she felt comfortable testing her [[Goliath Doll]] on [[Cirno]] in ''[[Touhou Hisoutensoku]]''.<br />
<br />
During the [[PC-98]], she obtained the "[[Grimoire of Alice]]", a book that produced "the ultimate magic", and it seems like it would contain amazing magic that couldn't be used without reading it.<br />
<br />
;Handling dolls<br />
[[File:SBND05Dollsshoveling.jpg|thumb|192px|Alice's dolls shovelling snow in ''[[Strange and Bright Nature Deity]]''.]]<br />
[[File:SBND06Dollsrepairing.jpg|thumb|192px|Alice's dolls repairing a window in ''[[Strange and Bright Nature Deity]]''.]]<br />
As her specialty is making [[doll]]s, she is also able to manipulate a great amount of dolls at the same time. This skill is among the finest in [[Gensokyo]].<ref name="th075_txt"/> She is able to make her dolls move pretty much any way [[human]]s can, and other than that she can make multiple dolls perform different actions, sometimes making them cooperate and sometimes making them move completely asynchronously, such that to onlookers around her, it might not seem like she is manipulating them. Due to this, [[Marisa Kirisame]] commented that "she said that she controls all the dolls herself, but that sounds like a whopper". The dolls can themselves manipulate and maybe even create other dolls, but it seems that Alice insists on creating new dolls herself.<ref name="PMiSSAlice"/> In chapter 5 of ''[[Strange and Bright Nature Deity]]'', she gave a command to a doll orally, but at that time she was indoors while at the same time there were at least 12 dolls above the roof removing snow, and there were also some dolls inside the room cooking. At that time, the dolls have been portrayed as having emotion, in a cute way.<br />
<br />
Although in common perception, it would seem obvious for the dolls to be able to talk, but there has been no mention of conversational ability. In some official material however, like ''[[Imperishable Night]]''<nowiki>'</nowiki>s [[Imperishable Night/Translation/Prologue|Prologue]] and ''[[Strange and Bright Nature Deity]]'' [[Strange and Bright Nature Deity#SaBND Chapter Five|chapter 5]], Alice's [[doll]]s appear to be able to act and talk independently – someone adds in words in [[wikipedia:Hiragana|hiragana]] to Alice's words. In Marisa's B Ending in ''[[Subterranean Animism]]'', it has been confirmed that the dolls do talk in [[wikipedia:Katakana|katakana]]. Whether the dolls are talking due to manipulation by Alice or if half-automatic dolls are talking by themselves is a big mystery. However, according to her [[Perfect Memento in Strict Sense/Alice Margatroid|''Perfect Memento in Strict Sense'' article]], she hasn't yet succeeded in creating an independent doll, and a conversation between [[Marisa Kirisame]] and [[Rinnosuke Morichika]] in ''[[Curiosities of Lotus Asia]]'' [[Curiosities of Lotus Asia/Chapter 16|chapter 16]] suggests that Alice just controls the dolls and pretends they are alive for her own amusement and for showing off, but these talks were before the latter said game.<br />
<br />
According to ''[[Bohemian Archive in Japanese Red]]'', her objective is to make a completely autonomous doll that have their own thoughts and move by their own volition. Currently, when Alice gives a command to her dolls, they move as if they were autonomous, but she has to periodically give commands to them, and moreover it seems like she has not have had enough training in order to achieve it. In ''[[Touhou Hisoutensoku]]'', she unleashes a move called "Semi-[[Robot#Automaton|automaton]]". Because of that, it can be seen that the degree to which the ordinary Alice manipulates the dolls is clearly not all by herself. In order to perfect a completely autonomous doll, Alice does experiments, and the link to that with the "soul" is detailed.<br />
<br />
However, according to her conversation with [[Youmu Konpaku]], it was said that "the strings that attach the body and soul are the same as the ones that control dolls". If this is originally considered, then it could be asked, "isn't that which was put into the dolls Alice's own spirit?". It is not explained, for the dolls that she is experimenting with, if she needs to periodically give them magic power or if they are just fine without, and if they will move even if she does not give them any commands at all. However, in ''[[Touhou Hisoutensoku]]'', Alice did say "it seems that it's more convenient to control the dolls myself than have dolls that think on their own".<br />
<br />
Among Alice's famous skills, if the explanations of "Edo High-Explosive Pawn" and "Lemmings' Parade" are looked at, she also prepares her dolls for explosives. In ''[[Subterranean Animism]]'', it seems that the dolls that she lent to [[Marisa Kirisame]] have been prepared with gunpowder, and due to this she objected to Marisa since they wouldn't survive in the [[Hell of Blazing Fires]]. Certainly in the game, the dolls didn't randomly explode. Also, in ''Magic Sign "Artful Sacrifice"'' as well as the skills ''"Volatile Doll"'', ''"Doll Cremation"'' and so on, she is able to put in magic power into the dolls to make them explode. It's unclear what the relation or difference is between the dolls that use gunpowder and the dolls with magic power put into them. One Lemmings' Parade consumes an enormous number of dolls, and since all the dolls are hand-made by Alice, to ordinary people, it would seem that without reason she returns her hard work to waste in an instant. However, it could be questioned as to whether Alice really adopted such a bad technique for such efficiency, and there is also the consideration that the dolls could merely be creating a blast from their explosion without scattering and dispersing, so that they are able to be collected again.<br />
<br />
;Illusion perception<br />
It seems that Alice can see through illusions - in ''Imperishable Night'', she figured out [[Keine Kamishirasawa]]'s true form and saw invisible rays of light coming down from the full moon. She also realized that [[Fujiwara no Mokou]] was not actually alive. Whether this is an actual ability of hers or just her being highly perceptive in general is unknown.<br />
<br />
===Possessions===<br />
;Dolls<br />
[[Shanghai]] and [[Hourai]] are the two most well-known [[doll]]s (or types of doll, rather) used by Alice. The [[Goliath Doll]] is another doll created by Alice, which appears to still be in the testing stages and is thought to be her strongest doll.<br />
<br />
;Phantom-seeing power<br />
Other than manipulating dolls, it seems that Alice has high phantom-seeing power, and in ''Imperishable Night''<nowiki>'</nowiki>s extra stage, she saw through that [[Fujiwara no Mokou]] was not actually living. In ''[[Perfect Cherry Blossom]]''<nowiki>'</nowiki>s [[Perfect Cherry Blossom/Afterword|Afterword]], it has been written that "something that can't die isn't really alive". In addition to ''Imperishable Night'', she saw through [[Keine Kamishirasawa]]'s true form and also saw the invisible light from the full [[moon<br />
<br />
==Background Information==<br />
[[File:PMiSS_alice.jpg|thumb|right|150px|Alice, as illustrated in ''[[Perfect Memento in Strict Sense]]''.]]<br />
===Name and Origin===<br />
Her full name is {{nihongo|''Alice Margatroid''|アリス・マーガトロイド}}. She had no surname in ''Mystic Square''. Her surname, ''Margatroid'', is derived from a real surname, [[wikipedia:Murgatroyd|Murgatroyd]]. The inspiration is most likely Miss Murgatroyd from [[wikipedia:Agatha Christie|Agatha Christie]]'s book ''[[wikipedia:A Murder is Announced|A Murder is Announced]]''. Murgatroyd is also a nickname for the [[vampire]] in Kim Newman's ''[[wikipedia:Anno Dracula (novel)|Anno Dracula]]''. On a more interesting note, in the [[Wikipedia:BBC Radio 4|BBC Radio 4]] adaptation of the previously mentioned Agatha Christie book, ''Alice'' Arnold was responsible for the role of Miss Murgatroyd. <br />
<br />
ZUN states that he originally based her off Alice from ''[[wikipedia:Megami Tensei|Megami Tensei]]'' and Alice from ''[[wikipedia:Asura Blade: Sword of Dynasty|Asura Blade]]''.<ref name="MS omake">[[Mystic_Square/Translation/Other#OMAKE.txt|Mystic Square omake]]</ref> Of course, a major inspiration is also the titular protagonist of [[wikipedia:Lewis Carroll|Lewis Carroll]]'s famous novel ''[[wikipedia:Alice's Adventures in Wonderland|Alice's Adventures in Wonderland]]'' - the majority of enemies in ''Mystic Square''<nowiki>'</nowiki>s Extra Stage are card soldiers of the same type as those in the [[wikipedia:Alice in Wonderland (1951 film)|Walt Disney animated movie version of the novel]]. The title of the theme used in that stage also directly translates to "Alice in Wonderland".<br />
<br />
===Design===<br />
Alice was first seen in ''[[Mystic Square]]'' wearing a pink/white dress with a blue apron, a matching headband with a ribbon on the side, as well as white socks. She has blonde hair and gold eyes like in all of her later appearances (except ''Perfect Cherry Blossom''). Since the Extra Stage, she carries her signature grimoire.<br />
<br />
In ''[[Perfect Cherry Blossom]]'', she has blue eyes and has a red band in her hair. She wears a light blue dress with long white sleeves and two pink ribbons, one going round her neck and another one around her waist.<br />
<br />
In ''[[Immaterial and Missing Power]]'', Alice's sprites show her to have blue eyes, but they're gold in her portraits. Her book is wrapped up in a red ribbon, and she has strings on her fingers to control her dolls. She is also seen wearing black boots. Her sprites in ''[[Scarlet Weather Rhapsody]]'' and ''[[Touhou Hisoutensoku]]'' were unchanged.<br />
<br />
Upon first glance she is said to look like a doll.<ref name="PMiSSAlice" /> Her height is stated to be "fairly tall"<ref name="height">[[ZUN's E-mails]]</ref>.<br />
<br />
==Story==<br />
{{stub|section}}<br />
{{multiple image<br />
| direction = horizontal<br />
| align = right<br />
| image1 = Th05alice2.png<br />
| width = 128<br />
| alt1 = Alice in Mystic Square Stage 3<br />
| caption1 = Alice as she first appeared ''[[Mystic Square]]'' Stage 3<br />
| image2 = TH05aliceB3.png<br />
| alt2 = Alice in Mystic Square Extra Stage<br />
| caption2 = Alice as she appeared ''[[Mystic Square]]'' Extra Stage<br />
}}<br />
===Games===<br />
;''Mystic Square''<br />
Alice first appeared in ''[[Mystic Square]]''. She showed up in the third stage as a young-looking magician with the title "Girl of Death". She confronted the heroine invading [[Makai]] (in fact, she was the first boss the heroine met after entering Makai), but was defeated.<br />
<br />
She later appeared as "Alice of the Magic Land" in the Extra Stage and fought with five colours: red, blue, purple, green and yellow.<br />
<br />
<!--:{{Main|Mystic Square/Translation/Reimu's Scenario#Stage 3|l1=Reimu Arc}}<br />
<Insert Summary><br />
:{{Main|Mystic Square/Translation/Marisa's Scenario#Stage 3|l1=Marisa Arc}}<br />
<Insert Summary><br />
:{{Main|Mystic Square/Translation/Mima's Scenario#Stage 3|l1=Mima Arc}}<br />
<Insert Summary><br />
:{{Main|Mystic Square/Translation/Yuuka's Scenario#Stage 3|l1=Yuuka Arc}}<br />
<Insert Summary>--><br />
<br />
;''Perfect Cherry Blossom''<br />
[[File:Th07AliceSprite.png|frame|Alice's sprite in ''PCB'']]<br />
In ''[[Perfect Cherry Blossom]]'', she did not have any special reason to fight the heorine, and it was only because she was there by chance that she became an opponent.<br />
<br />
<!--:{{Main|Perfect Cherry Blossom/Story/Reimu's Scenario#Stage 3|l1=Reimu Arc}}<br />
<Insert summary><br />
:{{Main|Perfect Cherry Blossom/Story/Marisa's Scenario#Stage 3|l1=Marisa Arc}}<br />
<Insert summary><br />
:{{Main|Perfect Cherry Blossom/Story/Sakuya's Scenario#Stage 3|l1=Sakuya Arc}}<br />
<Insert summary>--><br />
<br />
;''Imperishable Night''<br />
[[File:Th08AliceBackSprite.png|frame|left|Alice's back sprite in ''IN'']]<br />
[[File:Th08AliceSprite.png|frame|Alice's sprite in ''IN'']]<br />
:{{Main|Imperishable Night/Story/Magic Team's Scenario 1|l1=Imperishable Night Story Magic Team Scenario}}<br />
<br />
;''Subterranean Animism''<br />
:{{Main|Subterranean Animism/Translation/Marisa and Alice's Scenario|l1=Subterranean Animism Marisa and Alice Scenario}}<br />
<br />
===Spin-offs===<br />
;''Immaterial and Missing Power''<br />
:{{Main|Immaterial and Missing Power/Story#Alice's Story|l1=Immaterial and Missing Power Alice's Scenario}}<br />
<br />
;''Shoot the Bullet''<br />
In ''[[Shoot the Bullet]]'', [[Aya Shameimaru]] encountered Alice on [[stage]] 2 and took photos of her [[danmaku]].<br />
<br />
;''Scarlet Weather Rhapsody''<br />
:{{Main|Scarlet Weather Rhapsody/Story#Alice's Story|l1=Scarlet Weather Rhapsody Alice's Scenario}}<br />
<br />
;''Touhou Hisoutensoku''<br />
:{{Main|Touhou Hisoutensoku/Translation/Cirno's Scenario#Stage Final|l1=Touhou Hisoutensoku Cirno Arc}}<br />
In ''[[Touhou Hisoutensoku]]'' she created a giant doll, called the [[Goliath Doll]]. [[Marisa Kirisame]] noticed a figure in the [[Forest of Magic]] and told [[Cirno]] about it. Alice then tested it in a battle against Cirno, who thought the giant doll is [[Daidarabotchi]].<br />
:{{Main|Touhou Hisoutensoku/Translation/Meiling's Scenario#Stage 2|l1=Meiling Arc}}<br />
Alice doesn't actually appear here - it's a pseudo-Alice who was sent by the [[Giant Catfish]] to assassinate [[Hong Meiling]] in her dreams, but was defeated.<br />
<br />
;''Hopeless Masquerade''<br />
[[File:Th135Alice.png|frame|Alice in ''HM'']]<br />
Alice made a background cameo appearance in ''[[Hopeless Masquerade]]'' on the [[Human Village]] stage. She is seen at the far right-hand side of the screen standing around.<br />
<br />
==Relationships==<br />
===Marisa Kirisame===<br />
[[Marisa Kirisame]] is a fellow magician of the [[Forest of Magic]]. They were partners in ''[[Imperishable Night]]'', and she was supporting Marisa in ''[[Subterranean Animism]]''. Within the [[PC-98]] canon, Alice met Marisa and that they fought during the events of ''[[Mystic Square]]'', but the dialogues leaves open that they may've known each other earlier than that. They also fought each other in ''[[Perfect Cherry Blossom]]''. It isn't official that Marisa has ever stolen anything from Alice.<br />
<br />
In ''Imperishable Night'', they've teamed up as a "bad relationship" combination. At that time the reason why Alice called out Marisa with her voice for this reason (incident resolution), is that it's only because they've become used to it. In the bad ending, while Marisa worked over the secret measures of the [[lunarian]]s, but since Alice, by her side, was tired she chose to sleep first. By the time of the events of ''[[Subterranean Animism]]'', Alice sent Marisa to the [[Underworld]] saying that it was a "onsen-enjoyment game". Compared to the time of ''Imperishable Night'' they've had softer conversations, which can be seen as that their relationship has improved.<br />
<br />
She seems to have a love hate relationship of sorts with Marisa, with the two often insulting and fighting each other, yet teaming up on several occasions. For all the bickering the two go through, they seem to be close friends, as Alice once recommended Marisa's shop to the [[Three Fairies of Light]] when they needed some [[youkai]] extermination, and is comfortable enough with Marisa that in ''Imperishable Night'''s bad ending; when tired, she has no qualms with sleeping over at Marisa's house by Marisa's side.<br />
<br />
===Dolls===<br />
<br />
[[Shanghai]] and [[Hourai]] are the two most well-known [[doll]]s (or types of doll) used by Alice. The [[Goliath Doll]] is another doll created by Alice, which appears to still be in the testing stages and is thought to be her strongest doll.<br />
<br />
===Minor Relationships===<br />
;[[Mima]] <br />
At the end of [[Mystic Square]], Mima takes Alice as her maid, releasing her some time later.<br />
;Three Fairies of Light<br />
In ''[[Strange and Bright Nature Deity]]'', she provided help as inviting the [[Three Fairies of Light]] to her home and providing tea and cake. She told them, "if you got lost, then stay here until the snow goes away," brought some hot red tea, inquired if the room was cold, and also said "well, you should have gotten pretty cold walking outside, so you should just relax and warm up." However, afterwards, when [[Sunny Milk]], in some random saying, said something which suggested of stealing the Grimoire, she became very angry.<br />
;[[Eirin Yagokoro]]<br />
Alice purchases the [[Butterfly Dream Pill]] from Eirin.<br />
<br />
==Gallery==<br />
===Covers===<br />
<gallery><br />
File:Th05cover.jpg|Cover of ''[[Mystic Square]]'', featuring Alice, her [[Minor Characters#Unnamed cat on Mystic Square cover|cat]] and [[Reimu Hakurei]]<br />
</gallery><br />
<br />
===Artworks===<br />
<gallery><br />
File:Th07AliceFull.jpg|Alice artwork from ''[[Perfect Cherry Blossom]]''<br />
File:Th07Alice.png|Alice artwork from ''[[Perfect Cherry Blossom]]''<br />
File:Th075alice01.png|Alice artwork from ''[[Immaterial and Missing Power]]''<br />
File:Th08AliceMargatroid.png|Alice artwork from ''[[Imperishable Night]]''<br />
File:Th105Alice.png|Alice artwork from ''[[Scarlet Weather Rhapsody]]'' and ''[[Touhou Hisoutensoku]]''<br />
</gallery><br />
<br />
===Sprites===<br />
<gallery><br />
File:Th123AliceColors.png|Alice's different color palettes from ''Touhou Hisoutensoku''. The middle right corresponds to her ''Immaterial and Missing Power'' second color palette, while the bottom left corresponds to her ''Scarlet Weather Rhapsody'' palette.<br />
</gallery><br />
<br />
===Illustrations===<br />
<gallery><br />
File:BAiJRAlice1.JPG|Illustration of Alice in ''[[Bohemian Archive in Japanese Red]]''<br />
</gallery><br />
<br />
===Screenshots===<br />
<gallery><br />
File:SBND06Alice.jpg|Alice in ''[[Strange and Bright Nature Deity]]''<br />
File:IMIEAlice.png|Alice in ''[[Inaba of the Moon and Inaba of the Earth]]''<br />
</gallery><br />
<br />
===Others===<br />
<gallery><br />
File:GoMSigil-Alice.jpg|Alice's sigil in ''[[The Grimoire of Marisa]]''.<br />
File:Th123AliceSigil.png|Alice's sigil from ''Touhou Hisoutensoku''<br />
</gallery><br />
<br />
==Skills==<br />
{{hidden begin|title = Skills|titlestyle = background:paleturquoise; text-align:center;}}<br />
{{#lsth:List of Skills|[[Alice Margatroid]]}}<br />
{{hidden end}}<br />
<br />
==Spell Cards==<br />
{{hidden begin|title = Spell Cards|titlestyle = background:palegreen; text-align:center;}}<br />
{{#lsth:List of Spell Cards/Touhou Project 1|[[Alice Margatroid]]}}<br />
{{hidden end}}<br />
<br />
==Additional Information==<br />
*Alice appeared on the cover of ''[[Mystic Square]]'' with a [[Minor_Characters#Unnamed_cat_on_MS_cover|cat]].<br />
*Alice appeared in the Music Room background of ''[[Perfect Cherry Blossom]]''.<br />
*Being known as the "Seven-Colored Puppeteer" or "Rainbow Puppeteer", Alice apparently believes in a correlation between color and power level. During her dialogue with [[Reimu Hakurei]] in ''Perfect Cherry Blossom'', she asserts Reimu's powers are only equal to 28.5714% (or 2/7) of her own powers, due to Reimu's outfit only consisting of two colors. This appears to be a recurring theme in ''Perfect Cherry Blossom'', as [[Yukari Yakumo]], [[Ran Yakumo]] and [[Chen]] are all named after colors and have relative power levels equivalent to their colors' place on the visual spectrum. This, however, has not been referenced in recent games.<br />
*Alice's alternate palette from ''[[Scarlet Weather Rhapsody]]'' resembles Hina-Ichigo, a doll from the manga series ''[[wikipedia:Rozen Maiden|Rozen Maiden]]''. In ''[[Touhou Hisoutensoku]]'', she has palettes resembling the other Rozen Maiden dolls: Suiseiseki, Souseiseki, Suigintou, Shinku, Kanaria, and Kirakishou. Add the fact that, in ''Rozen Maiden'', the aforementioned dolls are battling for the title of "Alice", the perfect doll.<br />
*Alice is one of the two in the whole series who appears 3 times in a single stage: Twice as a midboss and the third as the actual boss of stage 3 in ''Perfect Cherry Blossom''. The other is [[Seiran]] in ''[[Legacy of Lunatic Kingdom]]''.<br />
*Alice is one of the four characters in the whole series who appears as a boss two times in different stages of the same game: As the third and extra boss in ''Mystic Square''. The others are [[Rika]] in ''[[Story of Eastern Wonderland]]'', [[Kazami Yuuka]] in ''[[Lotus Land Story]]'' and [[Junko]] in ''[[Legacy of Lunatic Kingdom]]''.<br />
*Alice seems to have connections with ''[[Dolls in Pseudo Paradise]]''. One involves how one of the honest men died from being "nailed to a tree" despite being inside, which relates to [[Bohemian Archive in Japanese Red/Alice|Alice's article in ''Bohemian Archive in Japanese Red'']] about her nailing straw effigies to trees. Others include how the men stumble upon a "Western-style building deep within the forest" and how the culprit was a "beautiful blonde girl".<br />
*Alice has been a recurring customer of Eirin's, coming to see her to buy a medicine she developed called the [[Butterfly Dream Pill]].<ref name="BAiJREirin">''[[Bohemian Archive in Japanese Red]]'': [[Bohemian Archive in Japanese Red/Eirin|Eirin Yagokoro]]</ref> The medicine guarantees its imbiber to have pleasant dreams once they fall asleep, and was even featured in an article in Aya's newspaper. The reason for purchasing this medicine or even what kinds of dreams Alice is trying to have were never revealed, but instead are left purely to speculation. However, this might be a reference to "Alice in Wonderland", from which the concept of her character is derived.<br />
<br />
==Fandom==<br />
{{main|Fandom/Mystic Square#Alice Margatroid|l1=Fandom: Alice Margatroid}}<br />
<br />
==Official Profiles==<br />
{{hidden begin|title = [[Perfect Cherry Blossom]] - Character Settings.txt|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = [[File:Th07Alice.png|Alice Margatroid PCB]]<br />
| text = ○七色の人形使い<br /><br />
アリス・マーガトロイド<br />
<br />
3面のボス、わりと普通の魔法使い。<br /><br />
主に魔法を扱う程度の能力を持つ<br />
<br />
とりあえず万能の魔法使いであり、これといって属性に得手不得手は<br /><br />
無い。強いて言えば魔理沙に近く、言わば妖怪版魔理沙である。<br />
<br />
アリスも蒐集家であり、本等のマジックアイテムを収集する癖がある。<br /><br />
蒐集家同士、魔理沙とかち合う事も多く、割と犬猿の仲だったりする。<br /><br />
最近はいわく付きの人形集めに嵌っている。<br />
<br />
霊夢達と戦う明示的な理由は無い。そこに居たから魔法の相手になっ<br /><br />
ただけである。圧倒的な力で勝つことは、アリスにとって楽しくとも<br /><br />
なんとも無いので、常に相手の様子見て、それより少しだけ上の力で<br /><br />
戦おうとする。負けても全力は出さない。<br />
<br />
全力で戦って負けると、本当に後が無い為である。<br />
ここらへんの性格は霊夢に似ている。<br />
| translation = *'''Seven-Colored Puppeteer'''<br /><br />
'''Alice Margatroid'''<br />
<br />
The stage 3 boss, kinda ordinary [[magician]].<br /><br />
Mainly she possess the ability to handle magic.<br />
<br />
She is a versatile magician, that has no specific strong or weak point in any area. If you ask me, she is similar to [[Marisa Kirisame|Marisa]], or rather I'd say a [[youkai]] version of Marisa.<br />
<br />
Alice has an obsession with collecting things as well, and has the habit of collecting magic items, especially magic books. As they both share the same hobby, she often clashes with Marisa so their relation is like loggerheads. Most recently, she is interested in collecting dolls that have a story associated with them.<br />
<br />
She had no evident reason to attack [[Reimu Hakurei|Reimu]] and company. They were chosen for the target of her magic because they were there. Dominating the enemy with overwhelming power is not fun at all for Alice, so she always sees her opponent's reaction and tries to fight with power that exceeds the opponent by a hair. Even if she loses, she doesn't show her full power.<br />
<br />
That's because she thinks it would be the end of the rope for her if she lost with full power. In this aspect, her personality is somewhat similar to Reimu.<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Immaterial and Missing Power]] - Shanghai Alice Correspondence.txt|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = [[File:th075alice01.png|Alice Margatroid IaMP|200px]]<br />
| text = ○七色の人形遣い<br /><br />
アリス・マーガトロイド<br />
<br />
種族:魔法使い<br /><br />
住処:魔法の森にあるそれなりの家(固有名称はない)<br /><br />
能力:魔法を扱う程度の能力<br />
<br />
生粋の魔法使いさん。見た目は人間と殆ど同じだが、人間ではない。<br /><br />
所謂、人妖のたぐいである。<br />
<br />
彼女の家には所狭しと大量の人形が置かれている。その不気味さは、たまに迷い込む人間を恐怖に陥れる。不気味な森の中にある、余りにも異質な人形の家。それは、森がいくら不気味だとしても逃げ出したくなるのも当然の事だ。<br />
<br />
性格は、他人に無関心で、魔法に執着しやすい。強気を張っているが実は臆病な面もある。<br />
<br />
体術は至って普通。体を動かすのも魔法も使うのも人並みである。器用さはかなり高く、大量の人形をあたかも生きているかのように操る事が出来る。その器用さは幻想郷の中でもピカイチである。<br />
| translation = *'''Seven-Colored Puppeteer'''<br /><br />
'''Alice Margatroid'''<br />
<br />
Species: [[Magician]]<br /><br />
Location: Moderate sized house in the [[Forest of Magic]] (has no specific name)<br /><br />
Ability: Ability to handle magic<br />
<br />
A pure [[magician]]. While her appearance is almost identical to [[human]]s, she is not one.<br />
<br />
She is a kind of so called humanoid [[youkai]].<br />
<br />
Her house is crammed with a lot of dolls. The sight is so spooky that it scares rare visitors away. The house of dolls is strangest even in the forest of the bizarre. It's no wonder that they tend to run away from there.<br />
<br />
Her personality is indifferent to others, and is easily attached to magic. She puts on a confident attitude, but she actually also has a timid side.<br />
<br />
She is quite average in melee fighting. Both her body movement and magic using are average. Instead of that she has very high skillfulness, which enables her to control many dolls as if they're living beings. This skillfulness is among the finest among all of [[Gensokyo]].<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Imperishable Night]] - Manual|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote |<br />
| image = [[File:Th08AliceMargatroid.png|200px|Alice Margatroid IN]]<br />
| text = ○七色の人形遣い アリス・マーガトロイド<br />
<br />
魔法の森に住む魔法使い。<br />
<br />
魔法を操る程度の能力を持つ。人形を遣うのも魔法の一種である。<br />
<br />
基本的に自分から出かける事は少ないが、今回はしぶしぶ。<br />
<br />
魔法の森に住み、魔法使いで収集家、と魔理沙と共通点が多いが、魔理沙は人間、アリスは魔法使いという決定的な違いがある。<br />
<br />
ちなみに、魔法の森に生えるきのこを好んで使う、使わない、の違いもある。<br />
<br />
もちろんアリスは使わない方。だからという訳では無いが、二人は仲が悪い。<br />
<br />
武器は魔法。魔法使いの魔法は常に術者オリジナル。<br />
<br />
<br />
備考<br />
<br />
今回は魔理沙と組む。<br />
<br />
高速移動は単独使用時のみの性能<br /><br />
である。<br />
<br />
レーザーは貫通するのと出っ放しな<br /><br />
ので、思いのほか強い。雑魚戦ボス<br /><br />
戦共に重宝する。<br />
<br />
撃っているのは人形だが。<br />
<br />
せっかくだから速攻で、と言う人に。<br />
| translation =<br />
*'''Seven-Colored Puppeteer, Alice Margatroid'''<br />
<br />
A [[magician]] living in the [[Forest of Magic]].<br />
<br />
She possess the ability to use magic. Puppetry is a type of magic too.<br />
<br />
She rarely goes out by herself, but she had no other choice this time.<br />
<br />
She has many similarities to [[Marisa Kirisame|Marisa]], namely living in the Forest of Magic, being a magician and having an obsession with collecting things.<br />
<br />
However, they have an absolute difference in that Alice is a magician as a species while Marisa is a human magician.<br />
<br />
Other than that, they're also different in using forest's mushroom as preference or not.<br />
<br />
Of course, Alice is the one not using them. However, it is not because of such matter that makes both on bad terms.<br />
<br />
Magic is her weapon. A magician's magic is always originally developed by the magician.<br />
<br />
:''Notes''<br />
:She teams with [[Marisa Kirisame|Marisa]] this time.<br />
:Normal speed only applies when she is used as a solo character.<br />
:Her laser penetrates and lasts as long as the player wishes, so it's unexpectedly strong. Good against both bosses and weaklings.<br />
:It's her doll that is shooting the laser though.<br />
:Recommended for those who want to be done quickly.<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Imperishable Night]] - Character Settings.txt|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image =[[File:Th08AliceMargatroid.png|200px|Alice Margatroid IN]]<br />
| text = ○七色の人形遣い<br /><br />
アリス・マーガトロイド<br /><br />
Alice Margatroid<br />
<br />
種族:魔法使い<br /><br />
能力:魔法を扱う程度の能力<br />
<br />
魔法の森に住む魔法使い。<br /><br />
魔理沙の魔法使い(職業)と異なり、種族が魔法使いである。<br />
<br />
魔法使いという言葉のイメージ通り、インドア派である。基本的には一人でいる事が多い。魔法の森には人間が余り来ないので、非常に快適である。ただ、森は嫌な湿度が高く、人形の手入れをしないとすぐに痛んでしまう。その為、人形の手入れを自動で行う人形を作ろうと思っている。<br />
| translation ='''Seven-Colored Puppeteer'''<br /><br />
<br /><br />
'''Alice Margatroid'''<br />
<br />
Species: [[Magician]]<br /><br />
Ability: Ability to use magic<br />
<br />
A magician living in the [[Forest of Magic]].<br />
<br />
The greatest difference between Alice and [[Marisa Kirisame|Marisa]] is that Marisa is a [[human]] of magician occupation whereas Alice is a magician as a species.<br />
<br />
You might imagine magicians as being indoor-type people; in Alice's case, you'd be right. She spends most of her time alone, and the forest is a good place for that.<br />
The forest is quite humid, however, and her dolls will become damaged without her constant care. Because of this, she's currently planning to make a doll that will automatically take care of other dolls.<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Scarlet Weather Rhapsody]] - chara.html|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = [[file:Th105Alice.png|200px|Alice Margatroid SWR]]<br />
| text = ○''七色の人形遣い''<br /><br />
アリス・マーガトロイド<br />
<br />
種族:魔法使い<br /><br />
職業:魔法使い<br /><br />
住家:魔法の森にある<br /><br />
マーガトロイド邸<br /><br />
能力:魔法を扱う程度の能力<br /><br />
性格:他人に無関心で、魔法に執着<br /><br />
しやすい<br />
| translation = '''Seven-Colored Puppeteer'''<br /><br />
'''Alice Margatroid'''<br />
<br />
Race: Magician<br /><br />
Occupation: Magician<br /><br />
Place of residence: the Margatroid residence, in the Forest of Magic<br /><br />
<br /><br />
Ability: ability to handle magic<br /><br />
Personality: indifferent towards others, loves magic<br />
}}<br />
{{hidden end}}<br />
<br />
{{hidden begin|title = [[Subterranean Animism]] - Character Settings.txt|titlestyle = background:lightblue; text-align:center}}<br />
{{Profile Quote<br />
| image = <br />
| text = ○七色の人形遣い<br /><br />
アリス・マーガトロイド<br /><br />
Alice Margatroid<br />
<br />
種族:魔法使い<br /><br />
能力:人形を操る程度の能力<br />
<br />
森に住んでいる人形遣い。<br /><br />
<br />
間欠泉から不穏な空気を感じたが、妖怪が地底に行く事は憚れていたのでどうしようか悩んでいた。<br /><br />
そんな時、魔理沙が間欠泉に興味津々だったのを見て、魔理沙を唆して地底に調査に行かせる事にしたのである。<br /><br />
魔理沙には温泉が楽しめるゲームだと言って、間欠泉の根元に向かわせたのだ。紫に作ってもらった遠隔操作できる人形を持たせて。<br />
| translation = '''Seven-Colored Puppeteer'''<br /><br />
<br /><br />
'''Alice Margatroid'''<br />
<br />
Species: magician<br /><br />
Ability: ability to manipulate dolls<br />
<br />
A puppeteer that lives in the forest.<br />
<br />
She felt something odd about the geyser that erupted, but since youkai prefer not to go underground she worried over what to do. That's when she noticed that Marisa was especially interested in the geyser, so she convinced Marisa to investigate the underground for her. She told her that investigating the hot spring would be a fun game, and pointed her towards the source of the geyser. She also made her carry dolls that had Yukari's remote control devices in them.<br />
}}<br />
{{hidden end}}<br />
<br />
==Official Sources==<br />
{{hidden begin|title = Official sources|titlestyle = background:pink; text-align:center;}}<br />
* 1998/12/03 '''[[Mystic Square]]''' - Stage 3 dialogue; Extra Stage dialogue; Extra Stage endings<br />
* 2003/08/17 '''[[Perfect Cherry Blossom]]''' - Character Settings.txt (official profile); Stage 3 dialogue<br />
* 2004/08/15 '''[[Imperishable Night]]''' - Character Settings.txt (official profile); Marisa and Alice's scenario and Extra Stage dialogue<br />
* 2004/12/30 '''[[Immaterial and Missing Power]]''' - Shanghai Alice Correspondence.txt (official profile); Alice's scenario; Alice's Vs. mode dialogue<br />
* 2005/08/11 '''[[Bohemian Archive in Japanese Red]]''' - [[Bohemian Archive in Japanese Red/Alice|Article and Interview: Alice]]<br />
* 2005/12/30 '''[[Shoot the Bullet]]''' - [[Shoot the Bullet/Spell Cards/Level 3|Stage 3 spell card comments]]<br />
* 2006/12/27 '''[[Perfect Memento in Strict Sense]]''' - [[Perfect Memento in Strict Sense/Alice Margatroid|Seven-Colored Puppeteer: Alice Margatroid]]<br />
* 2007/01/26 ~ 2007/02/26, 2007/05/26 '''[[Strange and Bright Nature Deity]]''' - Chapters 5-6, 9<br />
* 2008/05/25 '''[[Scarlet Weather Rhapsody]]''' - chara.html (official profile); Alice's scenario; Alice's Vs. mode dialogue<br />
* 2008/08/16 '''[[Subterranean Animism]]''' - Character Settings.txt (official profile); Marisa and Alice's scenario and Extra Stage dialogue<br />
* 2008/09/22 '''[[Inaba of the Moon and Inaba of the Earth]]''' - Chapter 16<br />
* 2009/07/28 '''[[The Grimoire of Marisa]]''' - [[The Grimoire of Marisa/Alice Margatroid's Spell Cards|Alice Margatroid's Spell Cards]]<br />
* 2009/08/15 '''[[Touhou Hisoutensoku]]''' - Cirno's scenario; various stage dialogue<br />
* 2009/12/22 '''[[Inaba of the Moon and Inaba of the Earth]]''' - Chapter 30<br />
* 2010/11/25 '''[[Wild and Horned Hermit]]''' - Chapter 3<br />
* 2010/12/25 '''[[Oriental Sacred Place]]''' - Chapter 12<br />
{{hidden end}}<br />
<br />
==References==<br />
{{smallrefs|2}}<br />
<br />
{{Project Characters Notice}}<br />
<br />
{{Navtemplate|<br />
{{Navbox Characters}}<br />
{{Navbox MS|nocat}}<br />
{{Navbox PCB|nocat}}<br />
{{Navbox IaMP|nocat}}<br />
{{Navbox IN|nocat}}<br />
{{Navbox StB|nocat}}<br />
{{Navbox SWR|nocat}}<br />
{{Navbox SA|nocat}}<br />
{{Navbox HSTS|nocat}}<br />
{{Navbox HM|nocat}}<br />
}}<br />
<br />
[[de:Alice Margatroid]]<br />
[[es:Alice Margatroid]]<br />
[[fr:Alice Margatroid]]<br />
[[ko:앨리스 마가트로이드]]<br />
[[pl:Alice Margatroid]]<br />
[[pt:Alice Margatroid]]<br />
[[ru:Алиса Маргатройд]]<br />
[[sv:Alice Margatroid]]<br />
[[vi:Alice Margatroid]]<br />
[[zh:爱丽丝·玛格特罗伊德]]<br />
[[Category:Characters]]<br />
[[Category:Returning PC-98 Characters]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Legacy_of_Lunatic_Kingdom/Music&diff=409740Legacy of Lunatic Kingdom/Music2019-10-23T04:22:43Z<p>Mddass: /* Music List */ There I fixed this dumb situation. The quote is English, not Japanese.</p>
<hr />
<div>==Music List==<br />
{{MusicRoom<br />
| category =Title screen<br />
| title =宇宙巫女現る<br />
| roma =Uchuu miko arawaru<br />
| titleEN =The Space Shrine Maiden Appears<br />
| comment =タイトル画面のテーマです。<br />
<br />
ちょっとスペーシーで和風な曲になりました。<br /><br />
今回のゲームは一筋縄ではいかないというテンションです。<br />
| translation =The title screen theme.<br/><br />
This theme turned out a bit spacey and Japanese.<br/><br />
For this game, the excitement factor could be described as "unconventional."<br />
}}<br />
{{MusicRoom<br />
| category =Stage 1 theme<br />
| title =忘れがたき、よすがの緑<br />
| roma =Wasuregataki, yosuga no midori<br />
| titleEN =Unforgettable, the Nostalgic Greenery<br />
| comment =1面のテーマです。<br />
<br />
1面から若干長いです。<br><br />
今回は全体的にゲームが長いですからそれに合わせてです。<br />
<br />
暫く美しい緑の大地から離れる事を覚悟しているノリです。<br />
| translation =The first stage theme.<br/><br />
<br />
This song is a bit long for the first stage. <br/><br />
The game is pretty long as a whole, so I designed it to match.<br/><br />
<br />
It feels like they are making up their mind to leave their beautiful green earth for a while.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 1 Boss - [[Seiran]]'s theme<br />
| title =兎は舞い降りた<br />
| roma =Usagi wa maiorita<br />
| titleEN =The Rabbit Has Landed <ref>This is a reference to Neil Armstrong's quote "[[wikipedia:Apollo_11#Landing|The ''Eagle'' has landed]]" ("鷲は舞い降りた" or "イーグルは舞い降りた" in Japanese).</ref><br />
| comment =清蘭のテーマです。<br />
<br />
かるーく戦闘を楽しんでいる感じを出しました。<br><br />
兎には真剣さが足りないようです。<br />
<br />
見えないけど尻尾もあるんやで。<br />
| translation =Seiran's theme.<br/><br />
<br />
I brought out the feeling of having fun with a really light-hearted battle.<br/><br />
Rabbits don't seem to have it in their nature to be serious.<br/><br />
<br />
You can't see it, but she does have a tail.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 2 theme<br />
| title =湖は浄めの月光を映して<br />
| roma =Mizuumi wa kiyome no gekkou o utsushite<br />
| titleEN =The Lake Reflects the Cleansed Moonlight<br />
| comment =2面のテーマです。<br />
<br />
展開の早さに不穩さを覚えつつ、曲も後半でもおかしくない<br><br />
感じになりました。<br />
<br />
月から浴びせられてる波動は一部の者にしか見えていない様です。<br />
| translation =The second stage theme.<br/><br />
<br />
Making us feel uneasy with the changing situation, this song became one<br/><br />
that wouldn't feel out-of-place in the latter half of the game.<br/><br />
<br />
It seems like only a select few can see the pulse given off by the moon.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 2 Boss - [[Ringo]]'s theme<br />
| title =九月のパンプキン<br />
| roma =Kugatsu no panpukin<br />
| titleEN =September Pumpkin<br />
| comment =鈴瑚のテーマです。<br />
<br />
同じ兎でもこっちは裏方系です、<br><br />
強敵である上に、戦う事が本当に正しいのか迷っているような<br><br />
感じの曲です。<br><br />
もちろん、団子はスタッフが美味しく頂きました。<br />
| translation =Ringo's theme.<br/><br />
<br />
Unlike Seiran, she's a rabbit who works in the background rather than a soldier.<br/><br />
On top of being a powerful opponent, this song depicts her doubts as to whether or not<br/><br />
fighting is really the right thing to do.<br />
<br />
All those dango were enjoyed by the TV staff afterward, of course.<ref>"This food was enjoyed by the TV staff afterwards" is a phrase used on some shows in Japan to prevent viewer complaints when food is shown being tossed around or otherwise wasted.</ref><br />
}}<br />
{{MusicRoom<br />
| category =Stage 3 theme<br />
| title =宇宙を飛ぶ不思議な巫女<br />
| roma =Uchuu o tobu fushigina miko<br />
| titleEN =The Mysterious Shrine Maiden Flying Through Space<br />
| comment =3面のテーマです。<br />
<br />
宇宙に見えて、実は精神世界という、ある種夢オチ。<br><br />
あそこにいる妖精や幽霊は、それぞれの夢なんですね。<br />
<br />
夢のなかでも弾幕はっちゃうお茶目な輩です。<br />
| translation =The third stage theme.<br/><br />
<br />
It looks like space, but it's actually the mental world. So it ''is'' an 'all just a dream' twist, in a sense.<br/><br />
The fairies and phantoms wandering around are the dreams of said creatures in reality.<br/><br />
<br />
It's mischievous of them to spread barrages of danmaku even in dreams.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 3 Boss - [[Doremy Sweet]]'s theme<br />
| title =永遠の春夢<ref>"Eien no haruyume" is also OK.</ref><br />
| roma =Eien no shunmu<br />
| titleEN =Eternal Spring Dream<br />
| comment =ドレミー・スイートのテーマです。<br />
<br />
かなりの強敵感を出してます。<br><br />
これから先が思いやられて欲しい、悪夢にうなされて欲しい<br><br />
という思いで書きました。<br><br />
うなされても夢違えっちゃえば良いんです。ドレミーにお願いして。<br />
| translation =Doremy Sweet's theme.<br/><br />
<br />
It gives off a strong sense of foreboding.<br/><br />
I wrote this with thoughts of "I want you to be wary from here on out,"<br/><br />
"I want you to have a nightmare," and so on.<br/><br />
Even if you have a nightmare, it'll be fine if you pray to [[Changeability of Strange Dream|change it]]. Pray to Doremy.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 4 theme<br />
| title =凍り付いた永遠の都<br />
| roma =Kooritsuita eien no miyako<br />
| titleEN =The Frozen Eternal Capital<br />
| comment =4面のテーマです。<br />
<br />
月の都です。でもある理由でゴーストタウンと化しています。<br><br />
穏やかな雰囲気の曲が、逆に狂気をイメージさせます。<br />
<br />
STGよりRPG終盤の様な曲ですね。まあ終盤ですし。<br />
| translation =The fourth stage theme.<br />
<br />
It's the [[Lunar Capital|Lunar Capital]]. For a particular reason, however, it's now a ghost town.<br /><br />
It's a song with a calm atmosphere, but on the contrary, it evokes an image of madness.<br />
<br />
It's music more befitting the endgame of an RPG than a shooting game. Well, it ''is'' the endgame.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 4 Boss - [[Sagume Kishin]]'s theme<br />
| title =逆転するホイールオブフォーチュン<br />
| roma =Gyakutensuru hoīru obu fōchun<br />
| titleEN =Reversed Wheel of Fortune<br />
| comment =稀神 サグメのテーマです。<br />
<br />
敵なのか味方なのか、神なのか鬼なのか、謎の人物のテーマです。<br><br />
ミステリアスな雰囲気の曲になりました。<br />
<br />
実はこいつも天邪鬼の一種なんですけよね。まさかの天邪鬼二人目。<br />
| translation =Kishin Sagume's theme.<br />
<br />
A theme song for a mysterious person who's not quite an enemy or an ally, a god or an oni.<br /><br />
Hence, I composed it with a rather mysterious mood.<br />
<br />
Actually, she's a type of amanojaku too so that makes her the [[Seija Kijin|second one]].<br />
}}<br />
{{MusicRoom<br />
| category =Stage 5 theme<br />
| title =遥か38万キロのボヤージュ<br />
| roma =Haruka sanjuuhachiman-kiro no boyāju<br />
| titleEN =Faraway Voyage of 380,000 Kilometers<br />
| comment =5面のテーマです。<br />
<br />
ちょっと雰囲気を変えて、スピード感あふれるロマンチックな曲です。<br><br />
道中がテンポ良く進むような(しかも稼げる)気持ちいいステージ<br><br />
です。<br><br />
飛翔感と、遠くまで来た覚悟を感じてください。<br />
| translation =The fifth stage theme.<br />
<br />
Some minor variations to the mood make this a fast-paced, romantic tune.<br /><br />
It's a stage where you can move forward (and rack up a huge score) at a good pace.<br /><br />
Feels real nice.<br /><br />
I hope you feel a sense of flight, and the resolve to travel far.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 5 Boss - [[Clownpiece]]'s theme<br />
| title =星条旗のピエロ<br />
| roma =Seijouki no piero<br />
| titleEN =Pierrot of the Star-Spangled Banner<br />
| comment =クラウンピースのテーマです。<br />
<br />
過去最狂レベルの妖精です。おつむの方は並の様ですが。<br><br />
ゴシックとも和風ともスペーシーともとれる、奇妙な曲です。<br><br />
世の中にはピエロ恐怖症ってあるみたいですね。<br><br />
でもこの妖精ピエロはそんなに怖くない……よね?<br />
| translation = Clownpiece's theme.<br />
<br />
She's the most crazy-strong fairy seen yet.<ref>過去最狂 (kako saikyou): pun on the identically-pronounced phrase 過去最強 ('strongest yet'), with 強 (strong) replaced with 狂 (crazy).</ref> Although she's pretty ordinary in the head.<br /><br />
Having made it gothic, Japanese, and spacey at the same time, this is a pretty odd song.<br /><br />
The fear of clowns is pretty widespread these days.<br /><br />
But this fairy clown isn't all that scary... right?<br />
}}<br />
{{MusicRoom<br />
| category =Stage 6 theme<br />
| title =故郷の星が映る海<br />
| roma =Kokyou no hoshi ga utsuru umi<br />
| titleEN =The Sea that Reflects One's Home Planet<ref>This is a technical translation. Normally, the interpretation should be to let "故郷の" modify the very next noun, which in this case is "星". "<b>故郷の星</b>が映る海" (The Sea that Reflects the Planet, Her Old Place) is natural when playing as Reimu, Marisa, or Sanae, since the red-colored Earth is displayed in front of them when they are standing on the sea of the moon, but this translation is inconsistent for Reisen when considering that Reisen is from the moon. Therefore, in regards to Reisen having come back to her old planet, the interpretation can be altered a little to make "故郷の" modify "海", which yields "<b>故郷の</b>星が映る<b>海</b>" (The Sea of Her Old Place that Reflects the Planet).</ref><br />
| comment =6面のテーマです。<br />
<br />
海ですねぇ。夏ですねぇ。<br />
<br />
この曲はラスボスの曲のサブセットです。<br><br />
海に行ってみたいですねぇ。海の家でビールかぁ。<br />
| translation =The sixth stage theme.<br />
<br />
It's the seaaa. It's summeeerr.<br />
<br />
This song is a subset of the final boss' theme.<br /><br />
I want to go to the seaaa. I want to drink beer in a beach huuut.<br />
}}<br />
{{MusicRoom<br />
| category =Stage 6 Boss - [[Junko]]'s theme<br />
| title =ピュアヒューリーズ ~ 心の在処<br />
| roma =Pyua hyūrīzu ~ Kokoro no arika<br />
| titleEN =Pure Furies ~ Whereabouts of the Heart<br />
| comment =純狐のテーマです。<br />
<br />
これぞ、まごう事なき、ザ・ラスボスって曲だと思います。<br><br />
余り捻ったり、恰好付けたり、考えすぎたりするのを止めました。<br />
<br />
シンプルに、ピュアーに弾幕を楽しんでくださいな。<br />
| translation =Junko's theme.<br />
<br />
I think this song says, "now ''this'' is unmistakably the final boss!"<br /><br />
I didn't try to make it too complicated, or to add cool parts, or just overthink it in general.<br />
<br />
I hope you can enjoy her danmaku simply and purely.<br />
}}<br />
{{MusicRoom<br />
| category =Extra Stage theme<br />
| title =見た事も無い悪夢の世界<br />
| roma =Mita koto mo nai akumu no sekai<br />
| titleEN =A World of Nightmares Never Seen Before <br />
| comment =エキストラステージのテーマです。<br />
<br />
不気味なイントロから続いて、淡々と流れるいつもの東方っぽさ。<br><br />
いかにもエキストラって感じです。<br><br />
それにしてもドレミーは敵なんでしょうか?<br><br />
それとも味方なんでしょうか?<br />
| translation =The Extra Stage theme.<br />
<br />
First the eerie intro, then it flows into the simple and usual Touhou style.<br /><br />
It really does have that Extra feel.<br /><br />
Nonetheless, is Doremy your foe this time?<br /><br />
Or is she your friend?<br />
}}<br />
{{MusicRoom<br />
| category =Extra Stage Boss - [[Hecatia Lapislazuli]]'s theme<br />
| title =パンデモニックプラネット<br />
| roma =Pandemonikku puranetto<br />
| titleEN =Pandemonic Planet<br />
| comment =ヘカーティア・ラピスラズリのテーマです。<br />
<br />
何とも悪魔的な曲です。<br><br />
本当はメタルっぽいものを考えてましたが、自分がそっちの造詣が<br><br />
深くないし、世界感に合わなさそうなので結果こんな感じに。<br><br />
地獄->死神->デス->デスメタル、という貧困な発想です。<br />
| translation =Hecatia Lapislazuli's theme.<br />
<br />
This is quite a demonic piece of music.<br /><br />
I actually thought about making a metal song, but I'm not well-versed in that area<br><br />
and it felt like it wouldn't fit the setting, so I made it like this in the end.<br><br />
My thought process was Hell -> Shinigami -> Death -> Death Metal. Pretty poor idea.<br />
}}<br />
{{MusicRoom<br />
| category =Ending theme<br />
| title =神社から見える月<br />
| roma =Jinja kara mieru tsuki<br />
| titleEN =The Moon as Seen from the Shrine<br />
| comment =エンディングのテーマです。<br />
<br />
まあ、いつものテーマです。<br />
<br />
いつもアップテンポな曲ばっか作っているので<br><br />
ノベルゲーの曲とか大変そうに思います。<br />
| translation =The ending theme.<br />
<br />
Well, it's the usual theme.<br />
<br />
Because I usually write songs that are always upbeat,<br /><br />
I feel like novel game music and such must be a real challenge.<br />
}}<br />
{{MusicRoom<br />
| category =Staff Roll theme<br />
| title =宇宙巫女帰還する<br />
| roma =Uchuu miko kikansuru<br />
| titleEN =The Space Shrine Maiden Returns Home<br />
| comment =スタッフロールのテーマです。<br />
<br />
タイトル画面の別バージョンです。<br />
<br />
さらにスペーシーな雰囲気にしました。<br />
| translation =The staff roll theme.<br />
<br />
It's an alternate version of the title screen song.<br />
<br />
I gave it an even spacier mood than before.<br />
}}<br />
<br />
==Notes==<br />
{{smallrefs}}<br />
<br />
{{Project Translations Notice}}<br />
<br />
[[fr:Legacy of Lunatic Kingdom/Musique]]<br />
{{Navbox LoLK}}<br />
[[Category:Music by Game]]<br />
[[Category:Translations]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Talk:Sunken_Fossil_World&diff=409739Talk:Sunken Fossil World2019-10-23T04:19:00Z<p>Mddass: /* English naming */</p>
<hr />
<div>==Crude oil==<br />
Interesting trivia regarding the story summary: [https://ja.wikipedia.org/wiki/%E6%B5%85%E5%B7%9D%E6%B2%B9%E7%94%B0 One of the first occurrences of natural gas in Japan] happened during the [https://ja.wikipedia.org/wiki/%E5%96%84%E5%85%89%E5%AF%BA%E5%9C%B0%E9%9C%87 1847 Nagano Earthquake]. Said event was called "新地獄 / New Hell". (thx Draco)<br /><br />
--[[User:Splashman|Splashman (blub)]] ([[User talk:Splashman|talk]]) 23:45, 4 October 2019 (UTC)<br />
<br />
== English naming ==<br />
<br />
Name is currently "Touhou Gouyoku Ibun", using Soku as naming precedence. If you have a better idea for it please post here, thanks! [[User:Mami|Mami]] ([[User talk:Mami|talk]]) 20:49, 18 October 2019 (UTC)<br />
<br />
<br />
<br />
I think that this is definitely worth discussing. I took some time to reread the discussion concerning the "Unthinkable Natural Law" incident, but if we really wanted to avoid calling it "Touhou Gouyoku Ibun", we probably could call it "Strange Tale of Avarice", right? That would also put it in line with Fairy Wars. [[User:Code Slasher|Code Slasher]] ([[User talk:Code Slasher|talk]]) 03:11, 20 October 2019 (UTC)<br />
<br />
:Fairy Wars comes from the in-game HUD displaying the title as "touhou sangetsusei" on the topleft and "fairy wars" on the bottomright. Has nothing to do with our translation preferences. -- [[User:Mddass|Mddass]] ([[User talk:Mddass|talk]]) 04:18, 23 October 2019 (UTC)</div>Mddasshttps://en.touhouwiki.net/index.php?title=Strange_and_Bright_Nature_Deity_3_(CD)&diff=409735Strange and Bright Nature Deity 3 (CD)2019-10-23T00:21:51Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =東方三月精 ~ {{lang|en|Strange and Bright Nature Deity 3}}<br />
| titlejprom =Touhou Sangetsusei<br />
| titleen =Touhou Three Moon Fairies<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Strange and Bright Nature Deity<br />
| image =SaBND3_CD.jpg<br />
| released =2009-08-26<br />
| tracks =2<br />
| website =[http://www.comptiq.com/release/comic/175touhou3.html Link]<br />
| length =09:23<br />
| catalogno =<br />
| tracklist =<br />
* {{Track|01|{{lang|ja|フェアリー冒険譚}}|05:05}}<br />
** ''The Fairy's Adventurous Tale''<br />
<br />
* {{Track|02|{{lang|ja|二つの世界}}|04:18}}<br />
** ''Two Worlds''<br />
<br />
| notes =<br />
==Notes==<br />
* This music CD accompanied the third volume of the [[Strange and Bright Nature Deity]] comic.<br />
<gallery><br />
File:SBND3 CD Booklet.JPG|Backside of the cd <br />
File:SBND3 CD.jpg|The CD<br />
</gallery><br />
{{clear}}<br />
==ZUN's Comments==<br />
{{MusicRoom<br />
|category=Track 1<br />
|title =フェアリー冒険譚<br />
|titleEN =The Fairy's Adventurous Tale<br />
|comment =幻想郷にいる妖精達の、食う寝る遊ぶの日常をイメージしました。<br /><br />
好奇心に満ちあふれた少年少女探偵団といった感じです。<br /><br />
妖精が子供のイメージなのは、人並み外れた好奇心を持ち合わせているからでしょう。<br /><br />
この曲はちょっとおませな感じも入っています。<br /><br />
たまにはこういう感じの三妖精も良いんじゃないですかね。<br />
|translation =This song was made to invoke the image of the daily life of the fairies of Gensokyo, eating, sleeping and playing.<br /><br />
Overflowing with curiosity like a team of child detectives.<br /><br />
Fairies are like children, but they their inquisitiveness is superhuman.<br /><br />
I tried to put a bit of a precocious feeling in this song, too.<br /><br />
It's fine for these three to be like that every now and then, isn't it?<br />
}}<br />
{{MusicRoom<br />
|category=Track 2<br />
|title =二つの世界<br />
|titleEN =Two Worlds<br />
|comment =最終話「二つの世界」をイメージして曲を書きました。<br /><br />
と言っても曲とストーリーとはあまり密接な関係は無いのですが。<br /><br />
外の世界っぽさと幻想っぽさを混ぜて、紫のイメージをトッピングした感じです。<br /><br />
ビックリするほど三妖精の入る隙がないね。<br />
|translation =I wrote this song while imagining the final chapter "Two Worlds."<br /><br />
Even though I say that, it's not like they are all that related.<br /><br />
It's a mix of themes of the outside world and Gensokyo, topped with Yukari.<br /><br />
It's surprising how there isn't any room for the Three Fairies.<br />
}}<br />
{{Project Translations Notice}}<br />
| musictype =Official CDs<br />
}}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Strange_and_Bright_Nature_Deity_1_(CD)&diff=409734Strange and Bright Nature Deity 1 (CD)2019-10-23T00:21:08Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =東方三月精 ~ {{lang|en|Strange and Bright Nature Deity 1}}<br />
| titlejprom =Touhou Sangetsusei<br />
| titleen =Touhou Three Moon Fairies<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Strange and Bright Nature Deity<br />
| image =SBND1 CD Cover.jpg<br />
| released =2008-01-26<br />
| tracks =3<br />
| website =[http://www.comptiq.com/release/comic/94touhou1.html Link]<br />
| length =11:32<br />
| catalogno =<br />
| tracklist =<br />
* {{track|01|{{lang|ja|サニーミルクの紅霧異変}}|03:03}}<br />
** ''[[Sunny Milk]]'s Scarlet Mist Incident''<br />
** original title: {{lang|ja|サニールチルフレクション}}<br />
** source: {{EaLND|CD}}<br />
** original title: U.N.{{lang|ja|オーエンは彼女なのか?}}<br />
** source: {{EoSD}}<br />
<br />
* {{track|02|{{lang|ja|雪月桜花の国}}|04:17}}<br />
** ''A Land Resplendent With Nature's Beauty''<br />
<br />
* {{track|03|{{lang|ja|スターヴォヤージュ}}2008|04:10}}<br />
** ''Star Voyage 2008''<br />
<br />
==Notes==<br />
* This music CD accompanied the first volume of the [[Strange and Bright Nature Deity]] comic.<br />
<gallery><br />
File:SBND1 CD.jpg|The CD<br />
</gallery><br />
<br />
==ZUN's Comments==<br />
{{MusicRoom<br />
|category=#01<br />
|title =サニーミルクの紅霧異変<br />
|titleEN =Sunny Milk's Scarlet Mist Incident<br />
|comment =サニールチルフレクションの紅魔郷風アレンジと思いきや、完全に別の曲に乗っ取られてしまう曲です。<br />
熾烈な戦いが行われている紅魔館の脇で虫取りでもしている妖精の姿が見えます。<br />
いにしえのあの曲も妖精の手にかかれば……。<br />
|translation =I thought of making it an arrange of "Sunny's Rutile Flection" with the style of [[Embodiment of Scarlet Devil]], but when I finished, it ended up being a completely different piece.<br />
While the fierce battles go on, you can see the figure of a fairy collecting bugs or something by the side of the [[Scarlet Devil Mansion]]. <br />
If that piece from the days of yore ended up in a fairy's hands...<br />
}}<br />
<br />
{{MusicRoom<br />
|category=#02<br />
|title =雪月桜花の国<br />
|titleEN =A Land Resplendent with Nature's Beauty<br />
|comment =二曲目は妖々夢のイメージで曲を創りました。妖々夢は全体的に時間の流れがゆっくりしてた気がします。<br />
和風で雪っぽくてどこか切なくて……良い感じに仕上がったと思います。<br />
リズムに若干、酩酊感を入れて妖精らしさも混ぜました。<br />
|translation =I made this second piece with the image of [[Perfect Cherry Blossom]] in mind. Perfect Cherry Blossom had that general feel of time going on calmly.<br />
It feels traditionally Japanese, snowy, and somewhat wistful... I think it closes up with a nice feeling. <br />
For the rhythm, I mixed some drunken and fairy-like feelings. <br />
}}<br />
<br />
{{MusicRoom<br />
|category=#03<br />
|title =スターヴォヤージュ2008<br />
|titleEN =Star Voyage 2008<br />
|comment =三曲目は永夜抄のイメージで曲を創りました。永夜抄と言えば宇宙人。<br />
自分の好きな宇宙観で目一杯、暗く激しい曲を創りました。<br />
もはや三月精の曲にしては格好良すぎるかもしれないけどね。確実に。<br />
|translation =I made this third piece with the image of [[Imperishable Night]] in mind. And Imperishable night is all about aliens. <br />
Just as my favourite outlook of space is, I made this piece vast, dark, and exciting. <br />
But it might be that it turned out too cool to be a Three Fairies piece, to tell you the truth. <br />
}}<br />
{{Project Translations Notice}}<br />
| musictype =Official CDs<br />
}}<br />
[[ru:Strange and Bright Nature Deity 1 (CD)]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Akyu%27s_Untouched_Score_vol.1&diff=409733Akyu's Untouched Score vol.12019-10-22T22:30:08Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =幺樂団の歴史{{lang|en|1 Akyu's Untouched Score vol.1}}<br />
| titlejprom =Yougakudan no Rekishi ~ Akyu's Untouched Score vol.1<br />
| titleen =History of Yougakudan 1 ~ Akyu's Untouched Score vol.1<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Team Shanghai Alice<br />
| image =ZCDS-0005~6.jpeg<br />
| released =2006-05-21<br />
| tracks =30<br />
| website =[http://www16.big.or.jp/~zun/html/mcdtop.html Zun]<br />
<br />
[https://touhou-music.jp/introduce/幺樂団の歴史1-akyus-untouched-score-vol-1 Touhou Doujin Music Distribution]<br />
| digital = <br />
[https://itunes.apple.com/jp/album/1438613504 iTunes Store (JP)]<br />
<br />
[https://itunes.apple.com/us/album/1438609983 iTunes Store (US)]<br />
<br />
[https://play.google.com/store/music/album?id=Bt7aloflbaz45wkp2cu2mbvam3q Google Play]<br />
<br />
[https://booth.pm/ja/items/1331179 BOOTH]<br />
| length =57:28 + 52:52 = 1:50:20<br />
| catalogno =ZCDS-0005~6<br />
| convention =Reitaisai 3<br />
| musictype =Official CDs<br />
| description =It is the first volume of the ''[[Akyu's Untouched Score]]'' collection, presented by [[Hieda no Akyuu]]. It contains the full soundtrack from the fourth [[PC-98]] game ''[[Lotus Land Story]]'', as heard in ''[[Mystic Square]]'''s music room. This particular album has two CDs due to the huge amount of tracks, as well as two extra tracks (no. 29 and 30 on Disc B) that aren't heard in the original games.<br />
| tracklist =<br />
===Disc A===<br />
*{{Track|01|{{lang|ja|幻想郷 ~}} Lotus Land Story|03:47}}<br />
** ''Gensokyo ~ Lotus Land Story''<br />
<br />
*{{Track|02|Witching Dream|04:25}}<br />
<br />
*{{Track|03|Selene's light|02:43}}<br />
<br />
*{{Track|04|{{lang|ja|装飾戦 ~}} Decoration Battle|02:40}}<br />
** ''Decoration Battle ~ Decoration Battle''<br />
<br />
*{{Track|05|Break the Sabbath|04:28}}<br />
<br />
*{{Track|06|{{lang|ja|紅響曲 ~}} Scarlet Phoneme|02:42}}<br />
** ''Scarlet Symphony ~ Scarlet Phoneme''<br />
<br />
*{{Track|07|Bad Apple!!|03:15}}<br />
<br />
*{{Track|08|{{lang|ja|霊戦 ~}} Perdition crisis|03:50}}<br />
** ''Spirit Battle ~ Perdition crisis''<br />
<br />
*{{Track|09|{{lang|ja|アリスマエステラ}}|05:48}}<br />
** ''Alice Maestra''<br />
<br />
*{{Track|10|{{lang|ja|少女綺想曲 ~}} Capriccio|03:10}}<br />
** ''Maiden's Capriccio ~ Capriccio''<br />
<br />
*{{Track|11|{{lang|ja|星の器 ~}} Casket of Star|02:54}}<br />
** ''Vessel of Stars ~ Casket of Star''<br />
<br />
*{{Track|12|Lotus Love|04:10}}<br />
<br />
*{{Track|13|{{lang|ja|眠れる恐怖 ~}} Sleeping Terror|05:02}}<br />
** ''Sleeping Terror ~ Sleeping Terror''<br />
<br />
*{{Track|14|Dream Land|03:20}}<br />
<br />
*{{Track|15|{{lang|ja|幽夢 ~}} Inanimate Dream|05:14}}<br />
** ''Faint Dream ~ Inanimate Dream''<br />
<br />
===Disc B===<br />
*{{Track|16|{{lang|ja|禁じざるをえない遊戯}}|04:42}}<br />
** ''The Inevitably Forbidden Game''<br />
<br />
*{{Track|17|{{lang|ja|メイド幻想 ~}} Icemilk Magic|03:20}}<br />
** ''Illusion of a Maid ~ Icemilk Magic ''<br />
<br />
*{{Track|18|{{lang|ja|かわいい悪魔 ~}} Innocence|03:20}}<br />
** ''Cute Devil ~ Innocence''<br />
<br />
*{{Track|19|Days|02:37}}<br />
<br />
*{{Track|20|Peaceful|02:50}}<br />
<br />
*{{Track|21|Arcadian Dream|04:20}}<br />
<br />
*{{Track|22|{{lang|ja|幻想の住人}}|02:25}}<br />
** ''Those Who Live in Illusions ''<br />
<br />
;<Bonus Tracks><br />
*{{Track|23|Lotus Road|03:52}}<br />
<br />
*{{Track|24|Dreamy pilot|03:34}}<br />
<br />
*{{Track|25|Incomplete Plot|04:01}}<br />
<br />
*{{Track|26|Border Land|02:41}}<br />
<br />
*{{Track|27|Magic Shop of Raspberry|04:15}}<br />
<br />
*{{Track|28|Crescent Dream|02:42}}<br />
<br />
*{{Track|29|{{lang|ja|装飾戦 ~}} Decoration Battle{{lang|ja|(未使用バージョン)}}|02:20}}<br />
** ''Decoration Battle ~ Decoration Battle (Unused Version)''<br />
<br />
*{{Track|30|{{lang|ja|幽夢 ~}} Inanimate Dream{{lang|ja|(未使用バージョン)}}|04:08}}<br />
** ''Faint Dream ~ Inanimate Dream (Unused Version)''<br />
<br />
==Comments==<br />
*[[Akyu's Untouched Score#Background comment|Background]]<br />
*For comments on the original music, see [[Lotus Land Story/Music]].<br />
<br />
===Side Seal===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable<br />
| ja =<big>幺樂——それは消え入りそうな音樂、ここではFM音源を指す<br/><br />
紅茶好きな阿求の懷古コレクション第一弾!</big><br />
| en =<big>Yougaku — music that is in danger of disappearing from today's world, here it refers to FM Synthesis.<br/><br />
The first in the black tea-loving Akyuu's nostalgia colection!</big><br />
}}<br />
{{TranslateTable<br />
| ja =<big>幺樂団の歴史 「東方幻想郷 ~ Lotus Land Story」</big><br />
| en =<big>History of Yougakudan "''Touhou Gensokyo ~ Lotus Land Story''"</big><br />
}}<br />
{{TranslateTable/Footer}}<br />
<br />
===Postscript===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable|h1<br />
| ja =あとがき<br />
| en =Postscript<br />
}}<br />
{{TranslateTable<br />
| ja =稗田阿求(ひえだのあきゅう)のコレクションより、幺樂団の歴史です。<br/><br />
<br />
第一弾は東方幻想郷のサントラです。ただのサントラじゃなくて、効果音に<br/><br />
使っていたパートも開放して、フルパワーで手直ししました。<br />
| en =This is a history of Yougakudan from the collection of [[Hieda no Akyuu]].<br/><br />
<br />
This first volume is the soundtrack of ''[[Lotus Land Story]]''. It's not an ordinary soundtrack, though; the musical voices I had to use for sound effects in the game are now free to let the music flow forth at full power.<br />
}}<br />
{{TranslateTable<br />
| ja =この阿求が何者かというと、一度見た物を忘れない程度の能力を持つ、<br/><br />
ちょっと変わった人間ですが、良い奴です。いやほんと。幺樂団を知ってるしね。<br />
| en =Now, about Hieda no Akyuu - she possesses the capability of not forgetting things seen once, and she's a bit strange for a [[human]], but she's a good person. Really. Because she knows about Yougakudan.<br />
}}<br />
{{TranslateTable|colspan}}<br />
{{TranslateTable|right<br />
| ja =上海アリス幻樂団 ZUN (詳しくは夏に)<br />
| en =[[Team Shanghai Alice]] — [[ZUN]] (For more details, wait until summer)<br />
}}<br />
{{TranslateTable/Footer}}<br />
{{Project Translations Notice}}<br />
}}<br />
<br />
[[de:Akyu's Untouched Score vol.1]]<br />
[[es:Akyu's Untouched Score vol.1]]<br />
[[fr:Akyu's Untouched Score vol.1]]<br />
[[ko:요악단의 역사 vol.1]]<br />
[[nl:Akyu's Untouched Score vol.1]]<br />
[[vi:Akyu's Untouched Score vol.1]]<br />
[[pl:Akyu's Untouched Score vol.1]]<br />
[[pt:Akyu's Untouched Score vol.1]]<br />
[[ru:Akyu’s Untouched Score vol.1]]<br />
<br />
[[Category:Untranslated]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Akyu%27s_Untouched_Score_vol.5&diff=409732Akyu's Untouched Score vol.52019-10-22T22:28:54Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =幺樂団の歴史{{lang|en|5 Akyu's Untouched Score vol.5}}<br />
| titlejprom =Yougakudan no Rekishi ~ Akyu's Untouched Score vol.5<br />
| titleen =History of Yougakudan 5 ~ Akyu's Untouched Score vol.5<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Team Shanghai Alice<br />
| image =ZCDS-0011.jpg<br />
| released =2007-12-31<br />
| tracks =15<br />
| website =[https://touhou-music.jp/introduce/幺樂団の歴史5-akyus-untouched-score-vol-5 Touhou Doujin Music Distribution]<br />
| digital = <br />
[https://itunes.apple.com/jp/album/1437763647 iTunes Store (JP)]<br />
<br />
[https://itunes.apple.com/us/album/1437637703 iTunes Store (US)]<br />
<br />
[https://play.google.com/store/music/album?id=B7rdzkocy3cf7wrhumxv6fwnzam Google Play]<br />
<br />
[https://booth.pm/ja/items/1331183 BOOTH]<br />
| length =51:19<br />
| catalogno =ZCDS-0011<br />
| musictype =Official CDs<br />
| convention =Comiket 73<br />
| description =It is the fifth and final volume of the ''[[Akyu's Untouched Score]]'' collection, presented by [[Hieda no Akyuu]] alongside [[Reimu Hakurei]]. It contains (most of) the full soundtrack from the first [[PC-98]] game ''[[Highly Responsive to Prayers]]'', in its arranged FM version heard in ''[[Mystic Square]]''<nowiki>'</nowiki>s music room. The theme "Shrine of the Wind" wasn't included in this CD because it's an unused theme from the original game, and was also not included in the ''Mystic Square'' music room.<br />
<br />
There is also a bonus track on this CD that isn't heard in the original games, that being "[[Theme of Eastern Story]]", which can be described as the basic version of the ''[[Touhou Project]]'' main theme melody that's arranged in many themes across the series, especially with each title screen of the [[Windows]] games. Also, [[ZUN]] names the 13th track {{nihongo|"Angel of a Distant Star"|星幽天使|Seiyuu Tenshi}}, while he used {{nihongo|"Swordsman of a Distant Star"|星幽剣士|Seiyuu Kenshi}} in ''Highly Responsive to Prayers''.<br />
<br />
It should be noted that, although the English subtitle of the original game uses the [[wikipedia:Article (grammar)#Definite article|definite article]] "the", it was omitted in this album for unknown reasons.<br />
| tracklist =<br />
*{{Track|01|A Sacred Lot|03:20}}<br />
<br />
*{{Track|02|{{lang|ja|永遠の巫女}}|03:24}}<br />
** ''Eternal Shrine Maiden''<br />
<br />
*{{Track|03|The Positive and Negative|02:15}}<br />
<br />
*{{Track|04|Highly Responsive to Prayers|03:26}}<br />
<br />
*{{Track|05|{{lang|ja|東方怪奇談}}|03:08}}<br />
** ''Eastern Strange Discourse''<br />
<br />
*{{Track|06|{{lang|ja|天使伝説}}|03:25}}<br />
** ''Angel's Legend''<br />
<br />
*{{Track|07|Oriental Magician|03:54}}<br />
<br />
*{{Track|08|{{lang|ja|破邪の小太刀}}|02:26}}<br />
** ''Blade of Banishment''<br />
<br />
*{{Track|09|{{lang|ja|魔鏡}}|03:43}}<br />
** ''Magic Mirror''<br />
<br />
*{{Track|10|the Legend of KAGE|03:03}}<br />
<br />
*{{Track|11|{{lang|ja|いざ、倒れ逝くその時まで}}|03:04}}<br />
** ''Now, Until the Moment You Die''<br />
<br />
*{{Track|12|Civilization of Magic|04:17}}<br />
<br />
*{{Track|13|{{lang|ja|星幽天使}}|03:44}}<br />
** ''Angel of a Distant Star''<br />
<br />
*{{Track|14|{{lang|ja|アイリス}}|02:59}}<br />
** ''Iris''<br />
<br />
;Bonus Track<br />
*{{Track|15|[[Theme of Eastern Story|{{lang|ja|テーマ・オブ・イースタンストーリー}}]]|05:01}}<br />
** ''[[Theme of Eastern Story]]''<br />
<br />
==Comments==<br />
*[[Akyu's Untouched Score#Background comment|Background]]<br />
* For comments on the original music, see [[Highly Responsive to Prayers/Music]].<br />
<br />
===Side Seal===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable<br />
| ja =<big>幺樂——それは消え入りそうな音樂、ここではFM音源を指す<br/><br />
傆点中の傆点、阿求の懷古コレクション第五弾!</big><br />
| en =<big>Yougaku — music that is in danger of disappearing from today's world, here it refers to FM Synthesis.<br/><br />
The origin point of the origin point, the fith in Akyuu's nostalgia colection!</big><br />
}}<br />
{{TranslateTable<br />
| ja =<big>幺樂団の歴史 「東方靈異伝 ~ Highly Responsive to Prayers」</big><br />
| en =<big>History of Yougakudan "''Touhou Rei'iden ~ Highly Responsive to Prayers''"</big><br />
}}<br />
{{TranslateTable/Footer}}<br />
<br />
===Postscript===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable|h1<br />
| ja =あとがき<br />
| en =Postscript<br />
}}<br />
{{TranslateTable<br />
| ja =稗田阿求(ひえだのあきゅう)のコレクションより、幺樂団の歴史です。<br />
| en =This is a history of Yougakudan from the collection of [[Hieda no Akyuu]].<br />
}}<br />
{{TranslateTable<br />
| ja =最後は東方靈異伝です。私の原点中の原点です。自分で言うのも何ですが意外と良い曲が多いですね。<br />
| en =This final volume is the soundtrack of ''[[Highly Responsive to Prayers]]''. For me, this is the absolute starting point. There are a lot of really good songs in here, if I do say so myself.<br />
}}<br />
{{TranslateTable<br />
| ja =ただ、曲数が少ないのでボーナストラックに新曲を追加しときました。ほんのオマケですが……最後にして原点という曲になっています。<br />
| en =However, there aren't a lot of songs, so I decided to add something as a bonus track. It really is just an extra, but... by leaving it to the end, it becomes another sort of starting point.<br />
}}<br />
{{TranslateTable<br />
| ja =これらの曲を書いてから早13年か……。<br />
| en =It's been 13 years since I wrote these songs...<br />
}}<br />
{{TranslateTable<br />
| ja =率直な感想、13年なんてあっという間だ。<br />
| en =To be frank, those 13 years have passed just like that. You can't let your days pass by with regrets.<br />
}}<br />
{{TranslateTable<br />
| ja =無為に日を過ごしてはいけない。あっという間に気力と体力を奪われ、そこに残るは鉛の夢。三途の川も渡れぬ重金属の霊魂。<br />
| en =Before you know it, your strength of will and body are taken away from you, and all that's left over are lead dreams - a heavy-metal [[spirit]] that won't even cross over the [[Sanzu River]].<br />
}}<br />
{{TranslateTable<br />
| ja =死は誰にでも平等に訪れるだなんて誰が言ったのだろう?少なくとも人間は生き方次第で別の生き物になる気がする。<br />
| en =Somebody said that death is the great equalizer; I wonder who it was? I get the feeling that a few humans live out their lives in their own way and become something else entirely.<br />
}}<br />
{{TranslateTable|colspan}}<br />
{{TranslateTable|right<br />
| ja =上海アリス幻樂団 ZUN<br /><small>(13年物の泡盛でも捜してみるか)</small><br />
| en =[[Team Shanghai Alice]] — [[ZUN]]<br/><small>(Maybe I should go and sample a 13-year-old brandy...)</small><br />
}}<br />
{{TranslateTable/Footer}}<br />
{{Project Translations Notice}}<br />
}}<br />
<br />
[[es:Akyu's Untouched Score vol.5]]<br />
[[fr:Akyu's Untouched Score vol.5]]<br />
[[ko:요악단의 역사 vol.5]]<br />
[[nl:Akyu's Untouched Score vol.5]]<br />
[[pl:Akyu's Untouched Score vol.5]]<br />
[[pt:Akyu's Untouched Score vol.5]]<br />
[[ru:Akyu’s Untouched Score vol.5]]<br />
[[zh:幺乐团之历史5]]<br />
<br />
[[Category:Untranslated]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Akyu%27s_Untouched_Score_vol.4&diff=409731Akyu's Untouched Score vol.42019-10-22T22:28:48Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =幺樂団の歴史{{lang|en|4 Akyu's Untouched Score vol.4}}<br />
| titlejprom =Yougakudan no Rekishi 4 ~ Akyu's Untouched Score vol.4<br />
| titleen =History of Yougakudan 4 ~ Akyu's Untouched Score vol.4<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Team Shanghai Alice<br />
| image =ZSCD-0010.jpg<br />
| released =2007-12-31<br />
| tracks =24<br />
| website =[https://touhou-music.jp/introduce/幺樂団の歴史4-akyus-untouched-score-vol-4 Touhou Doujin Music Distribution]<br />
| digital = <br />
[https://itunes.apple.com/jp/album/1437763617 iTunes Store (JP)]<br />
<br />
[https://itunes.apple.com/us/album/1437637631 iTunes Store (US)]<br />
<br />
[https://play.google.com/store/music/album?id=Bf4jp3yonkhtw76upuplrcyrw5a Google Play]<br />
<br />
[https://booth.pm/ja/items/1331182 BOOTH]<br />
| length =01:04:30<br />
| catalogno =ZSCD-0010<br />
| musictype =Official CDs<br />
| convention =Comiket 73<br />
| description =It is the forth volume of the ''[[Akyu's Untouched Score]]'' collection, presented by [[Hieda no Akyuu]]. It contains the full soundtrack from the third [[PC-98]] game ''[[Phantasmagoria of Dim.Dream]]''. On the cover along with Akyuu, [[Reimu Hakurei]], [[Marisa Kirisame]] and [[Mima]] can be seen; this is making a reference to the cover of the original game.<br />
| tracklist =<br />
*{{Track|01|{{lang|ja|夢は時空を越えて}}|03:41}}<br />
** ''A Dream Transcending Space-Time''<br />
<br />
*{{Track|02|Selection|01:29}}<br />
<br />
*{{Track|03|{{lang|ja|東方妖恋談}}|03:34}}<br />
** ''Eastern Mystical Love Consultation''<br />
<br />
*{{Track|04|Reincarnation|03:28}}<br />
<br />
*{{Track|05|Dim. Dream|04:25}}<br />
<br />
*{{Track|06|Tabula rasa{{lang|ja| ~ 空白少女}}|03:42}}<br />
** ''Tabula rasa ~ The Empty Girl''<br />
<br />
*{{Track|07|Maniacal Princess|02:44}}<br />
<br />
*{{Track|08|{{lang|ja|夢消失 ~}} Lost Dream|04:35}}<br />
** ''Vanishing Dream ~ Lost Dream''<br />
<br />
*{{Track|09|{{lang|ja|夢幻遊戯 ~}} Dream War|05:18}}<br />
** ''Visionary Game ~ Dream War''<br />
<br />
*{{Track|10|{{lang|ja|勝利デモ}}|00:14}}<br />
** ''Victory Demonstration''<br />
<br />
*{{Track|11|{{lang|ja|魔法決戦! ~}} Fight it out!|02:31}}<br />
** ''Decisive Magic Battle! ~ Fight it out!''<br />
<br />
*{{Track|12|{{lang|ja|非統一魔法世界論}}|01:29}}<br />
** ''Disunified Field Theory of Magic''<br />
<br />
*{{Track|13|Sailor of Time|03:54}}<br />
<br />
*{{Track|14|{{lang|ja|魔法鐘愛}}|00:53}}<br />
** ''Adoration of Magic''<br />
<br />
*{{Track|15|Strawberry Crisis!!|06:00}}<br />
<br />
*{{Track|16|{{lang|ja|久遠の夢}}|01:08}}<br />
** ''Dream of Eternity''<br />
<br />
*{{Track|17|{{lang|ja|東方の青い空}}|00:30}}<br />
** ''Eastern Blue Sky''<br />
<br />
*{{Track|18|{{lang|ja|永遠の満月}}|01:48}}<br />
** ''Eternal Full Moon''<br />
<br />
*{{Track|19|Maple Dream...|02:45}}<br />
<br />
*{{Track|20|{{lang|ja|ゲームオーバー}}|00:07}}<br />
** ''Game Over''<br />
<br />
;Bonus Tracks<br />
*{{Track|21|{{lang|ja|霊人の休日}}|01:13}}<br />
** ''Ghostly Person's Holiday''<br />
<br />
*{{Track|22|{{lang|ja|時の風}}|02:50}}<br />
** ''Winds of Time''<br />
<br />
*{{Track|23|{{lang|ja|スターボウドリーム}}|02:03}}<br />
** ''Starbow Dream''<br />
<br />
*{{Track|24|Phantasmagoria|03:59}}<br />
<br />
==Comments==<br />
*[[Akyu's Untouched Score#Background comment|Background]]<br />
* For comments on the original music, see [[Phantasmagoria of Dim.Dream/Music]].<br />
<br />
===Side Seal===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable<br />
| ja =<big>幺樂——それは消え入りそうな音樂、ここではFM音源を指す<br/><br />
色々と懷かしくてもどかしい阿求の懷古コレクション第四弾!</big><br />
| en =<big>Yougaku — music that is in danger of disappearing from today's world, here it refers to FM Synthesis.<br/><br />
From Akyuu who's nostalgic about so much that it's anoying, the fourth in her nostalgia colection!</big><br />
}}<br />
{{TranslateTable<br />
| ja =<big>幺樂団の歴史 「東方夢時空 ~ Phantasmagoria of Dim.Dream」</big><br />
| en =<big>History of Yougakudan "''Touhou Yumejikuu ~ Phantasmagoria of Dim.Dream''"</big><br />
}}<br />
{{TranslateTable/Footer}}<br />
<br />
===Postscript===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable|h1<br />
| ja =あとがき<br />
| en =Postscript<br />
}}<br />
{{TranslateTable<br />
| ja =稗田阿求(ひえだのあきゅう)のコレクションより、<br/>幺樂団の歴史です。<br/><br />
<br />
第四弾は東方夢時空です。曲数多いですが、ゲームが<br/>ゲームなんで短い曲も多数有ります。<br />
| en =This is a history of Yougakudan from the collection of [[Hieda no Akyuu]].<br/><br />
<br />
This fourth volume is the soundtrack of ''[[Phantasmagoria of Dim.Dream]]''. There are lots of tracks, but games being games, there are a number of short tracks.<br />
}}<br />
{{TranslateTable<br />
| ja =ジャケットのイラストですが、夢時空のジャケットが<br/>各キャラのぬいぐるみが出ている物だったので、それに<br/>合わせました。<br />
| en =About the jacket illustration - the cover of ''PoDD'' featured a stuffed toy for each character, so the jacket here was designed to match that.<br />
}}<br />
{{TranslateTable<br />
| ja =夢時空は夏から冬と開発期間が短かったのでえらい目<br/>に遭った記憶があります。それ以外のゲームもえらい目<br/>に遭っています。<br />
| en =Now, ''PoDD'' was written in the span of time between summer and winter, so I remember it being kind of terrible. Some of my other games were like that, too.<br />
}}<br />
{{TranslateTable|colspan}}<br />
{{TranslateTable|right<br />
| ja =上海アリス幻樂団 ZUN<br /><small>(キャラクターが多すぎるゲームは影が薄い)</small><br />
| en =[[Team Shanghai Alice]] — [[ZUN]]<br/><small>(Games with too many [[characters]] don't stand out.)</small><br />
}}<br />
{{TranslateTable/Footer}}<br />
{{Project Translations Notice}}<br />
}}<br />
<br />
[[es:Akyu's Untouched Score vol.4]]<br />
[[fr:Akyu's Untouched Score vol.4]]<br />
[[ko:요악단의 역사 vol.4]]<br />
[[nl:Akyu's Untouched Score vol.4]]<br />
[[pl:Akyu's Untouched Score vol.4]]<br />
[[pt:Akyu's Untouched Score vol.4]]<br />
[[ru:Akyu’s Untouched Score vol.4]]<br />
[[zh:幺乐团之历史4]]<br />
<br />
[[Category:Untranslated]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Akyu%27s_Untouched_Score_vol.3&diff=409730Akyu's Untouched Score vol.32019-10-22T22:27:18Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =幺樂団の歴史{{lang|en|3 Akyu's Untouched Score vol.3}}<br />
| titlejprom =Yougakudan no Rekishi 3 ~ Akyu's Untouched Score vol.3<br />
| titleen =History of Yougakudan 3 ~ Akyu's Untouched Score vol.3<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Team Shanghai Alice<br />
| image =ZSCD-0009.jpg<br />
| released =2006-12-31<br />
| tracks =18<br />
| website =[https://touhou-music.jp/introduce/幺樂団の歴史3-akyus-untouched-score-vol-3 Touhou Doujin Music Distribution]<br />
| digital = <br />
[https://itunes.apple.com/jp/album/1438613695 iTunes Store (JP)]<br />
<br />
[https://itunes.apple.com/us/album/1438610331 iTunes Store (US)]<br />
<br />
[https://play.google.com/store/music/album?id=Blpolm4wo2ioacqqvvxuce7rx2e Google Play]<br />
<br />
[https://booth.pm/ja/items/1331181 BOOTH]<br />
| length =01:01:49<br />
| catalogno =ZSCD-0009<br />
| musictype =Official CDs<br />
| convention =Comiket 71<br />
| description =It is the third volume of the ''[[Akyu's Untouched Score]]'' collection, presented by [[Hieda no Akyuu]]. It contains the full soundtrack from the second [[PC-98]] game ''[[Story of Eastern Wonderland]]'', in its arranged FM version heard in ''[[Mystic Square]]'''s music room.<br />
| tracklist =<br />
*{{Track|01|{{lang|ja|東方封魔録 ~ 浄土曼荼羅}}|03:03}}<br />
** ''Eastern Demon-Sealing Record ~ Pure Land Mandala ''<br />
<br />
*{{Track|02|{{lang|ja|博麗 ~}} Eastern Wind|04:05}}<br />
** ''Hakurei ~ Eastern Wind''<br />
<br />
*{{Track|03|She's in a temper!!|02:32}}<br />
<br />
*{{Track|04|End of Daylight|04:14}}<br />
<br />
*{{Track|05|{{lang|ja|やみのちから}}|03:03}}<br />
** ''Power of Darkness''<br />
<br />
*{{Track|06|{{lang|ja|幻夢界}}|04:35}}<br />
** ''World of Fantasies''<br />
<br />
*{{Track|07|{{lang|ja|死を賭して}}|02:44}}<br />
** ''Bet on Death''<br />
<br />
*{{Track|08|{{lang|ja|ひもろぎ、むらさきにもえ}}|03:04}}<br />
** ''Himorogi, Burn in Violet''<br />
<br />
*{{Track|09|{{lang|ja|恋色マジック}}|02:14}}<br />
** ''Love-Colored Magic''<br />
<br />
*{{Track|10|{{lang|ja|東方封魔録 ~ 幽幻乱舞}}|03:34}}<br />
** ''Eastern Demon-Sealing Record ~ Spectral Boisterous Dance ''<br />
<br />
*{{Track|11|Complete Darkness|04:17}}<br />
<br />
*{{Track|12|{{lang|ja|エキストララブ}}|3:16}}<br />
** ''Extra Love''<br />
<br />
*{{Track|13|{{lang|ja|戦車むすめのみるゆめ}}|5:04}}<br />
** ''The Tank Girl's Dream''<br />
<br />
*{{Track|14|{{lang|ja|遠野の森}}|01:33}}<br />
** ''Forest of Tono''<br />
<br />
*{{Track|15|{{lang|ja|昔話わんだーらんど}}|03:03}}<br />
** ''Legendary Wonderland''<br />
<br />
;<Bonus Tracks><br />
*{{Track|16|{{lang|ja|博麗神社境内}}|04:33}}<br />
** ''Hakurei Shrine Grounds''<br />
<br />
*{{Track|17|{{lang|ja|陽落ちて}}|02:54}}<br />
** ''Sunfall''<br />
<br />
*{{Track|18|{{lang|ja|封魔終演}}|04:01}}<br />
** ''Demon-Sealing Finale''<br />
<br />
==Comments==<br />
*[[Akyu's Untouched Score#Background comment|Background]]<br />
*For comments on the original music, see [[Story of Eastern Wonderland/Music]].<br />
<br />
===Side Seal===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable<br />
| ja =<big>幺樂——それは消え入りそうな音樂、ここではFM音源を指す<br/><br />
古の東方音樂が蘇る阿求の懷古コレクション第三弾!</big><br />
| en =<big>Yougaku — music that is in danger of disappearing from today's world, here it refers to FM Synthesis.<br/><br />
Belonging to Akyuu, who is trying to revive ancient eastern music, the third in her nostalgia collection!</big><br />
}}<br />
{{TranslateTable<br />
| ja =<big>幺樂団の歴史 「東方封魔録 ~ The Story of Eastern Wonderland」</big><br />
| en =<big>History of Yougakudan "''Touhou Fumaroku ~ the Story of Eastern Wonderland''"</big><br />
}}<br />
{{TranslateTable/Footer}}<br />
<br />
===Postscript===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable|h1<br />
| ja =あとがき<br />
| en =Postscript<br />
}}<br />
{{TranslateTable<br />
| ja =稗田阿求(ひえだのあきゅう)のコレクションより、<br/>幺樂団の歴史です。<br/><br />
<br />
第参弾は東方封魔録のサントラです。コミケで一番最初に<br/>発表したゲームが封魔録です。初参加の頃を覚えている方は<br/>もう居ないかも。30本くらいしか持っていかなかったし。<br />
| en =This is a history of Yougakudan,<br/>from [[Hieda no Akyuu]]'s collection.<br/><br />
<br />
This third volume is the soundtrack from ''[[Story of Eastern Wonderland]]''. This is the first game I ever released at the [[Comic Market]]. I wonder if anyone even remembers me from around that time. I only had thirty copies, after all.<br />
<br />
My favorite FM songs were written about the same time I wrote these, so it's full of great feeling songs.<br />
}}<br />
{{TranslateTable<br />
| ja =曲自体はこの頃と今と大きな変化が無いのは、<br/> 「人間は、何だかんだ言って成長しない」<br/>って事かも知れません。いやまぁ。<br />
| en =There isn't a lot of difference between the original songs and this release; the saying<br/> "[[human]]s talk a lot, but don't change as much"<br/>might have something to do with it. Well, who knows.<br />
}}<br />
{{TranslateTable|colspan}}<br />
{{TranslateTable|right<br />
| ja =上海アリス幻樂団 ZUN<br /><small>(音樂はFMも有りだけど、グラフィック16色には戻れない)</small><br />
| en =[[Team Shanghai Alice]] — [[ZUN]]<br/><small>(I love FM, but I won't go back to 16 color graphics)</small><br />
}}<br />
{{TranslateTable/Footer}}<br />
{{Project Translations Notice}}<br />
}}<br />
[[es:Akyu's Untouched Score vol.3]]<br />
[[fr:Akyu's Untouched Score vol.3]]<br />
[[ko:요악단의 역사 vol.3]]<br />
[[nl:Akyu's Untouched Score vol.3]]<br />
[[pl:Akyu's Untouched Score vol.3]]<br />
[[pt:Akyu's Untouched Score vol.3]]<br />
[[ru:Akyu’s Untouched Score vol.3]]<br />
<br />
[[Category:Untranslated]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Akyu%27s_Untouched_Score_vol.2&diff=409729Akyu's Untouched Score vol.22019-10-22T22:26:02Z<p>Mddass: </p>
<hr />
<div>{{MusicArticle<br />
| titlejp =幺樂団の歴史{{lang|en|2 Akyu's Untouched Score vol.2}}<br />
| titlejprom =Yougakudan no Rekishi 2 ~ Akyu's Untouched Score vol.2<br />
| titleen =History of Yougakudan 2 ~ Akyu's Untouched Score vol.2<br />
| group =[[Team Shanghai Alice]]<br />
| groupCat =Team Shanghai Alice<br />
| image =ZSCD-0008.jpg<br />
| released =2006-12-31<br />
| tracks =23<br />
| website =[https://touhou-music.jp/introduce/幺樂団の歴史2-akyus-untouched-score-vol-2 Touhou Doujin Music Distribution]<br />
| digital = <br />
[https://itunes.apple.com/jp/album/1437763340 iTunes Store (JP)]<br />
<br />
[https://itunes.apple.com/us/album/1437637530 iTunes Store (US)]<br />
<br />
[https://play.google.com/store/music/album?id=Bi7tatugddara3362pskyscdsym Google Play]<br />
<br />
[https://booth.pm/ja/items/1331180 BOOTH]<br />
| length =01:09:58<br />
| catalogno =ZSCD-0008<br />
| musictype =Official CDs<br />
| convention =Comiket 71<br />
| description =It is the second volume of the ''[[Akyu's Untouched Score]]'' collection, presented by [[Hieda no Akyuu]]. It contains the full soundtrack from the fifth [[PC-98]] game ''[[Mystic Square]]'' (of course, excluding tracks from previous games that the game contains; they're in other volumes).<br />
| tracklist =<br />
*{{Track|01|{{lang|ja|怪綺談 ~}} Mystic Square|03:02}}<br />
** ''Bizarre Romantic Story ~ Mystic Square''<br />
<br />
*{{Track|02|Dream Express|05:10}}<br />
<br />
*{{Track|03|{{lang|ja|魔法陣 ~}} Magic Square|02:32}}<br />
** ''Magic Square ~ Magic Square''<br />
<br />
*{{Track|04|{{lang|ja|夢想時空}}|02:58}}<br />
** ''Dimension of Reverie''<br />
<br />
*{{Track|05|{{lang|ja|霊天 ~}} Spiritual Heaven|01:58}}<br />
** ''Spiritual Heaven ~ Spiritual Heaven''<br />
<br />
*{{Track|06|Romantic Children|05:13}}<br />
<br />
*{{Track|07|{{lang|ja|プラスチックマインド}}|03:33}}<br />
** ''Plastic Mind''<br />
<br />
*{{Track|08|{{lang|ja|メイプルワイズ}}|03:33}}<br />
** ''Maple Wise''<br />
<br />
*{{Track|09|{{lang|ja|禁断の魔法 ~}} Forbidden Magic|03:33}}<br />
** ''Forbidden Magic ~ Forbidden Magic''<br />
<br />
*{{Track|10|{{lang|ja|真紅の少女 ~}} Crimson Dead!!|02:34}}<br />
** ''Crimson Maiden ~ Crimson Dead!!''<br />
<br />
*{{Track|11|{{lang|ja|裏切りの少女 ~}} Judas Kiss|01:48}}<br />
** ''Treacherous Maiden ~ Judas Kiss''<br />
<br />
*{{Track|12|the Last Judgement|04:24}}<br />
<br />
*{{Track|13|{{lang|ja|悲しき人形 ~}} Doll of Misery|03:53}}<br />
** ''Doll of Misery ~ Doll of Misery''<br />
<br />
*{{Track|14|{{lang|ja|世界の果て ~}} World's End|01:44}}<br />
** ''End of the World ~ World's End''<br />
<br />
*{{Track|15|{{lang|ja|神話幻想 ~}} Infinite Being|04:53}}<br />
** ''Legendary Illusion ~ Infinite Being''<br />
<br />
*{{Track|16|{{lang|ja|不思議の国のアリス}}|03:43}}<br />
** ''Alice in Wonderland''<br />
<br />
*{{Track|17|the Grimoire of Alice|03:13}}<br />
<br />
*{{Track|18|{{lang|ja|神社}}|01:44}}<br />
** ''Shinto Shrine''<br />
<br />
*{{Track|19|Endless|01:29}}<br />
<br />
*{{Track|20|{{lang|ja|久遠の楽園}}|01:08}}<br />
** ''Eternal Paradise''<br />
<br />
*{{Track|21|Mystic Dream|02:49}}<br />
<br />
*{{Track|22|{{lang|ja|魂の休らむ所}}|01:34}}<br />
** ''Soul's Resting Place''<br />
<br />
*{{Track|23|Peaceful Romancer|03:22}}<br />
<br />
==Comments==<br />
*[[Akyu's Untouched Score#Background comment|Background]]<br />
*For comments on the original music, see [[Mystic Square/Music]].<br />
<br />
===Side Seal===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable<br />
| ja =<big>幺樂——それは消え入りそうな音樂、ここではFM音源を指す<br/><br />
激しさ最大級の阿求の懷古コレクション第二弾!</big><br />
| en =<big>Yougaku — music that is in danger of disappearing from today's world, here it refers to FM Synthesis.<br/><br />
The second in Akyuu's nostalgia colection, the most intense one!</big><br />
}}<br />
{{TranslateTable<br />
| ja =<big>幺樂団の歴史 「東方怪綺談 ~ Mystic Square」</big><br />
| en =<big>History of Yougakudan "''Touhou Kaikidan ~ Mystic Square''"</big><br />
}}<br />
{{TranslateTable/Footer}}<br />
<br />
===Postscript===<br />
{{TranslateTable/Header}}<br />
{{TranslateTable|h1<br />
| ja =あとがき<br />
| en =Postscript<br />
}}<br />
{{TranslateTable<br />
| ja =稗田阿求(ひえだのあきゅう)のコレクションより、幺樂団の歴史です。<br/><br />
<br />
第弐弾は東方怪綺談のサントラです。<br/><br />
<br />
FM曲の中では最もこなれた頃に創った曲なので、<br/><br />
気持ちの良い曲が多いです。<br />
| en =This is a history of Yougakudan from the collection of [[Hieda no Akyuu]].<br/><br />
<br />
This second volume is the soundtrack from ''[[Mystic Square]]''.<br/><br />
<br />
My favorite FM songs were written about the same time I wrote these, so it's full of great feeling songs.<br />
}}<br />
{{TranslateTable<br />
| ja =何で、ゲームの順番とサントラの順番が違うかって?<br/>どうしてでしょうねぇ……。<br />
| en =What's that, you say the soundtrack list and the in-game list are different? Now, why could that be...?<br />
}}<br />
{{TranslateTable|colspan}}<br />
{{TranslateTable|right<br />
| ja =上海アリス幻樂団 ZUN<br/>(FMの略は {{lang|en|Fantastic Modulation}} にしたい)<br />
| en =[[Team Shanghai Alice]] — [[ZUN]]<br/>(Who wants to make FM stand for "Fantastic Modulation")<br />
}}<br />
{{TranslateTable/Footer}}<br />
{{Project Translations Notice}}<br />
}}<br />
<br />
[[es:Akyu's Untouched Score vol.2]]<br />
[[fr:Akyu's Untouched Score vol.2]]<br />
[[ko:요악단의 역사 vol.2]]<br />
[[nl:Akyu's Untouched Score vol.2]]<br />
[[pl:Akyu's Untouched Score vol.2]]<br />
[[pt:Akyu's Untouched Score vol.2]]<br />
[[ru:Akyu’s Untouched Score vol.2]]<br />
[[vi:Akyu's Untouched Score vol.2]]<br />
<br />
[[Category:Untranslated]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL&diff=409633User:Mddass/ECL ET EX TABLE ROW SMALL2019-10-20T22:53:49Z<p>Mddass: </p>
<hr />
<div><includeonly>|-<br />
| {{#if: {{{bgcolor|}}} | style="background:{{{bgcolor}}};" | }} |{{ #if: {{{color|}}} | {{#tag: span |{{{1}}}|style="color:{{{color}}};"}} | {{{1}}} }}<br />
| {{#ifeq: {{{2}}} | O | style="background:palegreen;text-align:center;" | {{#ifeq: {{{2}}} | X | style="background:pink;text-align:center;" | }} }} | {{{2}}}<br />
| {{#ifeq: {{{3}}} | O | style="background:palegreen;text-align:center;" | {{#ifeq: {{{3}}} | X | style="background:pink;text-align:center;" | }} }} | {{{3}}}<br />
| {{#ifeq: {{{4}}} | O | style="background:palegreen;text-align:center;" | {{#ifeq: {{{4}}} | X | style="background:pink;text-align:center;" | }} }} | {{{4}}}<br />
| {{#ifeq: {{{5}}} | O | style="background:palegreen;text-align:center;" | {{#ifeq: {{{5}}} | X | style="background:pink;text-align:center;" | }} }} | {{{5}}}<br />
| {{#if: {{{bgcolor|}}} | style="background:{{{bgcolor}}};" | }} |{{ #if: {{{color|}}} | {{#tag: span |{{{6}}}|style="color:{{{color}}};"}} | {{{6}}} }}</includeonly></div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=409632User:Mddass/Touhou File Format Specification/ECL2019-10-20T22:52:21Z<p>Mddass: /* Extra Bullet Functions (et_ex) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts responsible for the control of the gameplay portions of stages in the Touhou games, ranging from stage enemy timings, bullet patterns, enemy movement to some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format changes constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL. Register based, and uses a separate section to control stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Notably, it is now stack based instead of register based, and all of the functions are now named to enable dynamic linking of multiple ECL files.<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Team_Shanghai_Alice&diff=409325Team Shanghai Alice2019-10-13T03:23:43Z<p>Mddass: </p>
<hr />
<div>[[File:ZUNpresentation.jpg|thumb|right|Team Shanghai Alice in fact consists only of [[ZUN]].]]<br />
[[File:ZCDSbanner.jpg]]<br/><br />
{{nihongo|'''Team Shanghai Alice'''|上海アリス幻樂団 or 上海アリス幻楽団|Shanhai Arisu Gengakudan|lit. "Shanghai Alice Fantasy Band", formerly known as ''ZUN Soft''}} is a Japanese [[doujin]] [[wikipedia:Video game developer|game developer]] group that specialises in [[Shooting game|shoot 'em up]] consisted by one man called [[ZUN]]. The circle's only releases thus far have been the ''[[Touhou Project]]'' games and related merchandises.<br />
<br />
Before its independence, ZUN was creating Touhou games for the [[PC-98]] with the help of [[Amusement Makers]], under the name '''ZUN Soft'''. After the PC-98 finished and his involvement with the ''[[Seihou Project]]'' by what is now known as "[[Shunsatsu sare do?]]", he branched apart from Amusement Makers and continued to develop games for the ''[[Touhou Project]]'' under the name of "Team Shanghai Alice", starting with ''[[Embodiment of Scarlet Devil]]''. Every game TSA has developed from its creation has been a shoot 'em up of some kind, and currently it seems only to specialize in making [[danmaku]] shooting games. The only time it ever developed any other game type was when it collaborated with [[Twilight Frontier]], which resulted in five projectile-based fighting games.<br />
<br />
==Name==<br />
The name "Team Shanghai Alice" was chosen to fit the overall theme of the ''[[Touhou Project]]''. {{nihongo|"Shanghai"|上海}}, according to ZUN, is a multicultural city where the East and the West meet. "Alice" can be a child living in the [[wikipedia:Concession (territory)|foreign concession]]s, but the name "Alice" also suggests a fairy-tale element. So together, "Shanghai Alice" encompasses the blend of oriental and western aesthetics along with fantasy. As for {{nihongo|"Fantasy Band"|幻樂団}}, ZUN originally intended his team to be a musical ensemble, so he named his team as such.<br />
<br />
[[Alice Margatroid]] owns a doll named [[Shanghai]], an allusion to Shanghai Alice. <br />
Additionally, one of [[Hong Meiling]]'s themes is titled "Shanghai Alice of Meiji 17".<br />
<br />
==Members==<br />
* '''[[ZUN]]''' (real name {{Nihongo|Jun'ya Ota|太田順也|Oota Junya}}) — General Producer/Game Designer/Character Graphics/System Graphics/Background Graphics/Sound Effects/Script/Illustrator/Music<br />
<br />
According to an [[Interview in Swedish Player1 Magazine]], '''ZUN''' is the only member of Team Shanghai Alice. In other words, ZUN does the programming, art, and music entirely all alone.<br />
<br />
==Game Productions==<br />
*{{HRtP}} (Under the name "ZUN Soft" 1996)<br />
*{{SoEW}} (ZUN Soft 1997)<br />
*{{PoDD}} (ZUN Soft 1997)<br />
*{{LLS}} (ZUN Soft 1998)<br />
*{{MS}} (ZUN Soft 1998)<br />
*{{EoSD}} (Under the current name "Team Shanghai Alice" 2002)<br />
*{{PCB}} (2003)<br />
*{{IaMP}} (collaboration with [[Twilight Frontier]] 2004)<br />
*{{IN}} (2004)<br />
*{{PoFV}} (2005)<br />
*{{StB}} (2005)<br />
*{{MoF}} (2007)<br />
*{{SWR}} (collaboration with Twilight Frontier 2008)<br />
*{{SA}} (2008)<br />
*{{UFO}} (2009)<br />
*{{HSTS}} (collaboration with Twilight Frontier 2009)<br />
*{{DS}} (2010)<br />
*{{FW}} (2010)<br />
*{{TD}} (2011)<br />
*{{HM}} (collaboration with Twilight Frontier 2013)<br />
*{{DDC}} (2013)<br />
*{{ISC}} (2014)<br />
*{{GR}} (2014)<br />
*{{ULiL}} (collaboration with Twilight Frontier 2015)<br />
*{{LoLK}} (2015)<br />
*{{AoCF}} (collaboration with Twilight Frontier 2017)<br />
*{{HSiFS}} (2017)<br />
*{{VD}} (2018)<br />
*[[Wily Beast and Weakest Creature|東方鬼形獣 〜 Wily Beast and Weakest Creature]] (2019)<br />
<br />
==Discography==<br />
Team Shanghai Alice have released a number of albums that include both music arranged from the games and music original to the album. Most CDs contain mainly original music composed by ZUN and a selection of tracks arranged or remixed from his games, but there are several works that are made by the collaboration between him and [[Twilight Frontier]]. As there are some loose references to the rest of the ''[[Touhou Project]]'' in the stories in the CD jacket, the CDs are still considered part of the ''Touhou Project''.<br />
<br />
*{{DiPP}} (2002)<br />
*{{GFC}} (2003)<br />
*{{CoSD}} (2004)<br />
*[[Immaterial and Missing Power/Music/OST|{{lang|ja|幻想曲抜萃 東方萃夢想}} ORIGINAL SOUND TRACK]] (Collaboration with Twilight Frontier 2005)<br />
*{{R53m}} (2006)<br />
*{{Akyu|1}} (2006)<br />
*{{MA}} (2006)<br />
*{{Akyu|2}} (2006)<br />
*{{Akyu|3}} (2006)<br />
*{{Akyu|4}} (2007)<br />
*{{Akyu|5}} (2007)<br />
*[[Scarlet Weather Rhapsody OST|{{lang|ja|全人類ノ天楽録 東方緋想天}} ORIGINAL SOUND TRACK]] (Collaboration with Twilight Frontier 2008)<br />
*[[Touhou Hisoutensoku OST|{{lang|ja|核熱造神ヒソウテンソク 東方非想天則}} ORIGINAL SOUND TRACK]] (Collaboration with Twilight Frontier 2009)<br />
*{{UFMJ}} (2011)<br />
*{{TGA}} (2012)<br />
*{{NtoJ}} (2012)<br />
*[[Hopeless Masquerade OST|暗黒能楽集・心綺楼 東方心綺楼 ORIGINAL SOUNDTRACK]] (Collaboration with Twilight Frontier 2013)<br />
*[[Urban Legend in Limbo OST|深秘的楽曲集 宇佐見菫子と秘密の部室]] (Collaboration with Twilight Frontier 2015)<br />
*{{DrLFR}} (2016)<br />
*{{DBOA}} (2016)<br />
*[[Urban Legend in Limbo OST 2|深秘的楽曲集・補 東方深秘録初回特典CD]] (Collaboration with Twilight Frontier 2016)<br />
*[[Antinomy of Common Flowers OST|完全憑依ディスコグラフィ 東方憑依華 ORIGINAL SOUND TRACK]] (Collaboration with Twilight Frontier 2018)<br />
<br />
==External Link==<br />
*[http://www16.big.or.jp/~zun/ Team Shanghai Alice]<br />
<br />
{{Navbox Touhou}}<br />
<br />
[[Category:Team Shanghai Alice]]<br />
[[es:Team Shanghai Alice]]<br />
[[fr:Team Shanghai Alice]]<br />
[[ko:상하이앨리스환악단]]<br />
[[nl:Team Shanghai Alice]]<br />
[[pl:Team Shanghai Alice]]<br />
[[pt:Team Shanghai Alice]]<br />
[[ru:Team Shanghai Alice]]<br />
[[uk:Team Shanghai Alice]]<br />
[[zh:上海爱丽丝幻乐团]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=409197User:Mddass/Touhou File Format Specification/ECL2019-10-11T22:55:27Z<p>Mddass: </p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts responsible for the control of the gameplay portions of stages in the Touhou games, ranging from stage enemy timings, bullet patterns, enemy movement to some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format changes constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL. Register based, and uses a separate section to control stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Notably, it is now stack based instead of register based, and all of the functions are now named to enable dynamic linking of multiple ECL files.<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Embodiment_of_Scarlet_Devil/Gameplay&diff=409116Embodiment of Scarlet Devil/Gameplay2019-10-08T04:27:05Z<p>Mddass: /* Point Items */</p>
<hr />
<div>[[File:th06titlescreen.jpg|frame|right|Touhou Koumakyou ~ the Embodiment of Scarlet Devil]]<br />
==Gameplay==<br />
===Controls===<br />
The game may be played using either a keyboard or a gamepad.<br />
<br />
Keyboard controls are as follows:<br />
*The '''Arrow Keys''' move the character around<br />
*'''Z''' causes a short barrage of shots to be fired; it may be held down for rapidfire<br />
*'''X''' releases a bomb, also known as a [[Spell Card]] (presuming that any are left)<br />
*'''Shift''' slows the character's movement and focuses their shots into a tighter area<br />
*'''Esc''' pauses the game and brings you to the in-game menu<br />
*'''Ctrl''' fast-forwards through any dialogue<br />
<br />
===Basic Gameplay===<br />
[[Embodiment of Scarlet Devil]] plays like a fairly typical vertically-scrolling [[danmaku]] [[shooting game]], in which the player's character is always facing towards the top of the screen, shooting at anything that moves, avoiding and weaving between enemy bullets, and confronting difficult bosses at the end of a stage.<br />
<br />
There are 4 levels of difficulty: Easy, Normal, Hard, and Lunatic. Each difficulty level features differences in the number of bullets fired by each enemy, rate of fire, variations in the bullets' pattern of movement, and the number and type of enemy [[Spell Card]]s used.<br />
<br />
The player will traverse 6 increasingly harrowing stages through the course of a regular game. The trial version ends prematurely at Stage 3, and Easy difficulty ends prematurely at Stage 5.<br />
<br />
Once the game has been completed without continuing on Normal or higher difficulty, an Extra Stage is unlocked, available for any character that has accomplished that feat. The Extra Stage features significantly stronger and faster enemies, an extremely difficult midboss and boss battle, and no option to continue if all lives are lost.<br />
<br />
====Shot====<br />
A character's "shot" is the player's primary method of attacking enemies. While the shot's attack area and behaviour varies depending on the character type the player has chosen, the shot can be powered up by filling up the Power Level by collecting power items. The shot gradually becomes more powerful when the player reaches the Power Levels of 8, 16, 32, 48, 64, 80, 96, and 128 (MAX), respectively. When the player reaches MAX power, all bullets on the screen cancel out and become star items which are automatically collected. While the player has maximum shot power, the player may ''auto-collect all items on screen by moving their character close to the top of the screen''. This ability is ''very'' important for achieving high scores.<br />
<br />
::'''<i>Shot Types</i>'''<br />
<br />
'''Reimu A'''<br />
:Spirit Spell Card<br />
:Excellent against swarms of weak enemies, but less effective against bosses.<br />
::Shot: Homing Amulet (「ホーミングアミュレット」)<br />
::Bomb: Fantasy Seal (「夢想封印」)<br />
'''Reimu B'''<br />
:Dream Spell Card<br />
:A good balance in damage and area covered, but the bomb is fairly weak.<br />
::Shot: Persuasion Needle (「パスウェイジョンニードル」)<br />
::Bomb: Evil-Sealing Circle (「封魔陣」)<br />
'''Marisa A'''<br />
:Magic Spell Card<br />
:Excellent against bosses, but only covers a small area of the screen.<br />
::Shot: Magic Missile (「マジックミサイル」)<br />
::Bomb: Stardust Reverie (「スターダストレヴァリエ」)<br />
'''Marisa B'''<br />
:Love Spell Card<br />
:A little lacking in both damage and coverage, but the bomb is very strong.<br />
::Shot: Illusion Laser (「イリュージョンレーザー」)<br />
::Bomb: Master Spark (「マスタースパーク」)<br />
<br />
====Bomb====<br />
A character's "bomb" is the player's limited-use method of getting out of difficult situations. A bomb's attack area, duration, and power varies depending on the character type the player has chosen, but it typically deals heavy damage to every enemy it touches, in addition to cancelling out any bullets in the bomb's way, as well as automatically collecting every item on screen. The player's character becomes invincible during and for a short time after the bomb's effect wears off. At the beginning of the game and any time your character respawns, you will start off with 3 bombs. Bomb items will increase your current stock by one. You can carry up to a maximum of 8 bombs at a time. If you receive a bomb when you already have the maximum, that bomb will be lost.<br />
<br />
====Lives====<br />
With default settings, you will start off with 3 lives. You can lose a life by getting "hit" by an enemy attack.<br />
<br />
The [[hit box]] for your character is quite small in comparison to your on-screen sprite, approximately only 5 pixels by 5 pixels in size. It is not clearly marked on the sprite, but it is possible to approximate its location well by looking at the white part of Reimu's clothes just above her red skirt, or the center of Marisa's pink ribbon on her back. If the hit box of your character's sprite comes into contact with the hit box of an enemy bullet, laser, or the enemy itself, then you have been hit.<br />
<br />
If you have bombs in stock and the Bomb key is pressed within a short time of the player's character being hit, then the hit can be negated and countered with a bomb. This deathbomb time interval only lasts for 6 frames (about 0.1 seconds), after which you will lose a life as normal. Every successful use, the interval is shortened by how many frames you took to deathbomb, down to a minimum of 1 frame (1/60th of a second); it is reset back to normal when you lose a life.<br />
<br />
The player is awarded extra lives upon reaching certain score totals or by collecting 1up items. For the regular game, extra lives are awarded at 10, 20, 40, and 60 million points. For the Extra Stage, no extra lives are awarded for points. You can carry up to a maximum of 8 extra lives at a time. If you receive an extra life when you already have the maximum, that life will be lost.<br />
<br />
Upon losing all their lives, the player is given the choice to continue right where they left off. However, if you do continue, your current score will be reset back to 0 + the number of times you have continued, you will not be able to save a replay of your game, and you will reach the "Bad Ending" if you finish the game. You may continue up to 3 times.<br />
<br />
====Rank====<br />
There exists a rank system in this game. As rank increases, enemy bullets will generally become faster and more plentiful. This effect that rank has in this game is most prominent with boss attacks, where the bullet count difference between minimum and maximum rank can differ by a factor of 4 or more, and bullet movement speeds can double. Note that the game does not display the numerical value of rank at any point - under most circumstances, it can be estimated only by observing bullet pattern behaviour.<br />
<br />
Rank ranges from 10 to 32 (from 12 to 20 on easy, and from 14 to 18 in Extra), and is set to 16 at the beginning of the game. It increases gradually with survival time (+1 every ~32 seconds), item collection (from +0 to +2 depending on the item type), grazing (+0.06) and gaining an extra life through score (+2), until it reaches the cap of thirty-two, corresponding to the highest variable difficulty. The rank value is decreased by sixteen whenever the player is hit, by two when the player uses a bomb, and by 0.03 when an item disappears through the bottom of the screen.<br />
<br />
====Difficulty====<br />
:Easy - For people who don't like STG much.<br />
:Normal - For most people.<br />
:Hard - For arcade shooting game players.<br />
:Lunatic - For weird people.<br />
:Extra - Give up already, are you crazy?<br />
<br />
===Boss Battles===<br />
The main challenge and the main attraction. Each boss has multiple lives, which are represented by multiple health bars. Bosses normally alternate between attacking normally and attacking with [[Spell Card]]s, switching once with each life bar.<br />
<br />
Normal attacks are incrementally stronger versions of the boss character's basic attack. [[Spell Card]] attacks bedazzle the player with combinations of complex patterns that often involve the use of projectiles and obstacles crafted especially for use with that Spell Card. If the player manages to defeat a Spell Card attack without getting hit or using any bombs, a substantial score bonus is rewarded for the feat.<br />
<br />
Each attack is accompanied by a timer. When time runs out, the boss will switch to their next attack pattern even if their health bar isn't empty. Waiting for a boss character's attack pattern to self-destruct may be enough to beat them, but mere survival won't earn the player any score bonuses.<br />
<br />
===Character Statistics===<br />
There are two characters to choose from, each of which have two styles of attack. The player decides which character to play and which attack type to use at the start of the game.<br />
<br />
'''Reimu'''<br />
:Basic Performance<br />
:Moving Speed: ★★★<br />
:Attack Range: ★★★★<br />
:Attack Power: ★★★<br />
<br />
'''Marisa'''<br />
:Basic Performance<br />
:Moving Speed: ★★★★<br />
:Attack Range: ★<br />
:Attack Power: ★★★★<br />
<br />
:Reimu A - Homing amulets.<br />
:Reimu B - Persuasion needles.<br />
:Marisa A - Magic missiles. <br />
:Marisa B - Lasers.<br />
<br />
===Screen Layout===<br />
[[File:th06screenLayout.jpg|frame|Screen layout|right]]<br />
<br />
#Your character<br />
#Player Score<br />
#*最高得点 (High Score): displays your highest score for the current character, type, and difficulty<br />
#*得点 (Score): Your current score<br />
#The number of remaining Players and Bombs / The approximate location of the [[Point of collection]]<br />
#Player Status<br />
#*Power: displays your shot power level, maxing out at 128<br />
#*Graze: displays how many times enemy shots have grazed your hitbox during this stage<br />
#*点 (Point): displays how many Point Items you collected during this stage<br />
#Enemy Status<br />
#*Left number: displays how many health bars the enemy has in reserve<br />
#*Right number: displays how much time is left before the enemy's attack spell self-destructs<br />
#*Middle bar: displays how much health the enemy has left in their current attack spell<br />
{{clear}}<br />
==Scoring==<br />
Scoring works similar to many other [[Touhou]] games in many aspects. Listed below are the details for how points are given in ''Embodiment of Scarlet Devil''.<br />
<br />
===Enemies===<br />
Any damage you deal to any enemy, whether it be caused by your shots or your bombs, will cause your score to increase very slightly. Actually destroying enemies will award you slightly more points, but the points earned from this are around the range of hundreds to thousands of points per enemy. This is not a significant amount at all. However, enemies shoot bullets for you to "graze" and release items for you to collect, and those are very important for scoring as covered below.<br />
<br />
===Grazing===<br />
"Grazing a bullet" means to have a bullet or laser come dangerously close to your hitbox. Each graze will add 500 to your score, and will increase your "Graze number" by 1, which is used to calculate the Clear bonus. You can only graze a bullet once, so you won't gain any additional points or graze by following a bullet. Lasers can be continually grazed throughout their duration, but once again, moving around will not gain you any additional points or graze.<br />
<br />
===Point Items===<br />
As the name implies, point items are the major source of points in the game. The higher up on the screen you collect them, the more points they are worth, up to a defined maximum. You can easily tell when you are collecting point items for their maximum value, since they show the value in ''yellow'' text. The auto-item-collect line is the ''same'' height as the height where point items reach their maximum value, so take advantage of this fact wherever you can for massive points. The maximum value for point items are based on difficulty:<br />
<br />
Easy: 100,000<br />
Normal: 100,000<br />
Hard: 150,000<br />
Lunatic: 200,000<br />
Extra: 300,000<br />
<br />
An important thing to keep in mind is that point items collected even a pixel below the maximum value threshold are worth less than 66% of their maximum value. This is a non-trivial difference, so do your best to collect items without prematurely retreating down to the lower parts of the screen. Also, point items collected at the bottom of the screen are worth around 25% of their maximum value. The number of point items collected per stage is used to calculate the Clear bonus, to be discussed later.<br />
<br />
===Power Items===<br />
While your shot is not fully powered up, power items are worth only 10 points. However, once maximum shot power has been reached, each additional power item collected will be worth more than the previous one collected, up to a maximum of 51,200 points per power item. Unlike point items, power items will award you the same number of points ''anywhere'' on the screen. However, if you lose a life and your power level to less than maximum, power items will be worth only 10 points just like the beginning, and you will have to start this process over again. The progression is as follows: 10, 20, 30... 100, 200, 300... 1000, 2000, 3000... 12000, 51200. In other words, it takes 32 power items to get from a value of 10 to 51200. The opportunity cost of dying and having to rebuild the value of the power items is 1,554,350 points.<br />
<br />
Large power items act the same as normal power items, except that when you are at maximum shot power, they increase the current value of power items as if you had collected 8 normal point items.<br />
<br />
===Star Items===<br />
These items appear any time an enemy bullet is cancelled out. This can happen when you defeat an attack pattern of a boss (by depleting their current healthbar), at the moment you gain maximum shot power, when you destroy a certain enemy, or when you erase enemy bullets with a bomb. Each star item is worth 500 points + 10 points for every 3 grazes you have that stage. So for example, if you currently have 304 graze and you collect a star item, it will be worth 500 + (10 * (304 / 3)) = 1510 points. The only exception is when star items are created by a bomb, in which case each star item generated is worth exactly 100 points. However, bullets cancelled near the end of a bomb's duration will be worth the same value as a regular star item. The maximum number of items on the screen is 512 and therefore any bullet count higher than in a cancel will only contribute to the Enemy Bullet Bonus. If an attack would drop power or point items, those items can be omitted if the total item count would exceed 512.<br />
<br />
===Enemy Bullet Bonus===<br />
When you finish off one of the boss's lives (caused by completely depleting the visible healthbar) or defeat a Spell Card of a boss, all enemy bullets on screen are tallied up to calculate the Enemy Bullet Bonus. The value of each bullet starts at 2000 and increases by 10 for each successive bullet, giving a total equal to N * (1995 + 5 * N), where N is the number of bullets. The maximum value of this bonus is 3324800 (at the bullet cap of 640). This bonus is ''independent'' of any star items collected from finishing off a boss's attack pattern. Finding the correct time in a boss's attack to finish them off can mean the difference between an Enemy Bullet bonus of 100,000 and one of 3,000,000.<br />
<br />
===Spell Card Bonus===<br />
Occasionally, a boss will attack using a [[Spell Card]]. You will know this is happening when the background changes and the Spell Card's name appears in the upper-right corner of the screen. If the boss's healthbar is depleted within the time limit and without getting hit or using a bomb, a spell card bonus will be added to your score.<br />
<br />
Unlike later games in the series, the spell card bonus is calculated directly from the number of seconds remaining; the spell card's starting timer does not affect this calculation. The bonus is calculated as follows:<br />
<br />
stage 1-2: 20,000 * (timer + 10)<br />
stage 3: 25,000 * (timer + 10)<br />
stage 4: 30,000 * (timer + 10)<br />
stage 5: 40,000 * (timer + 10)<br />
stage 6 Sakuya: 50,000 * (timer + 10)<br />
stage 6 Remilia: 60,000 * (timer + 10)<br />
Extra: 70,000 * (timer + 10)<br />
<br />
For Remilia's and Flandre's final cards, the calculation uses the actual (hidden) number of seconds remaining, even if the displayed timer is 99.<br />
<br />
The formula is unchanged for survival cards. As such, capturing [[the Embodiment_of_Scarlet_Devil/Spell_Cards/Extra#Spell_Card_63|Secret Barrage "And Then There WIll Be None?"]] will always award only 700,000 points.<br />
<br />
===Clear Bonus===<br />
At the end of each stage, the player is awarded a point bonus based on their performance throughout the stage. The bonus is calculated as follows:<br />
<br />
Stage x 1000 (stage number, Extra = 7)<br />
Power x 100 (power level)<br />
Graze x 10 (graze count)<br />
<br />
'''This combined total is then multiplied by the number of point items collected in that stage.'''<br />
<br />
In addition, if you are not playing on Easy and the stage happened to be the last stage, the following is added:<br />
<br />
Player x 3,000,000 (lives in stock, not including your current one)<br />
Bomb x 1,000,000 (bombs in stock)<br />
<br />
Finally, depending on the conditions you played under, the result is multiplied by these modifiers, rounded down to the nearest 10:<br />
<br />
4 Initial Lives: x 0.5<br />
5 Initial Lives: x 0.2<br />
Easy Difficulty: x 0.5<br />
Normal Difficulty: x 1.0<br />
Hard Difficulty: x 1.2<br />
Lunatic Difficulty: x 1.5<br />
Extra Difficulty: x 2.0<br />
<br />
The end result is then added on to your score.<br />
<br />
==Unlockables==<br />
===Endings===<br />
To view the bad endings, either finish the game on Easy or finish the game with one or more continues.<br />
* To get Bad Ending 1, use Reimu, any type.<br />
* To get Bad Ending 2, use Marisa, any type.<br />
<br />
To view the normal(good) endings, finish the game on Normal, Hard, or Lunatic difficulty without continuing once.<br />
* To get Ending 3, use Reimu-A.<br />
* To get Ending 4, use Reimu-B. <br />
* To get Ending 5, use Marisa-A.<br />
* To get Ending 6, use Marisa-B.<br />
<br />
===Practice Mode===<br />
To unlock a stage to practice in "Practice Start" at a specific difficulty level and for a specific character and type, you must complete that stage in the standard "Start" game mode at that same difficulty, using the same character and type. The stage will be unlocked even if you have used continues.<br />
<br />
===Extra Stage===<br />
To unlock the Extra stage for a specific character and type, you must reach the "Good Ending" (beat the entire game without continuing on Normal or higher difficulties) with that same character and type.<br />
<br />
==Replays==<br />
If you rename replay files to "th6_ud*.rpy", where * is any string of characters, you will be able to view them in the "Replay" menu, and they won't take up any of your precious 15 slots for saving replays. However, the first 4 characters of the * in "th6_ud*.rpy" '''must''' be unique from any other * in the replay folder, or else that replay won't be recognized by the game.<br />
<br />
==Bugs==<br />
* During the period of violent shaking caused by Marisa-B's bomb, "Master Spark" or Reimu-B's bomb, "Evil-Sealing Circle", enemies that are scheduled to appear from the right side of the screen will consistently fail to show up. Enemies that disappear in this fashion do not produce any points or items.<br />
* If Rumia's first nonspell is timed out, the health carries over to the first spell card, making it impossible to defeat if she has full health. Moreover, on Easy, it causes her spell card "Night Bird", which is normally not available on Easy, to start.<br />
* It seems that the sound of ReimuA's shooting (Z key) disappears when Power is between 16 and 31.<br />
* When facing Flandre Scarlet in the Extra stage, if you shoot at her immediately after her second-last Spell Card (Secret Shot "And Then Will There Be None?") ends, she will take a significant amount of damage to her healthbar for her last Spell Card (QED "Ripples of 495 Years"). This can also be done for Remilia's last Spell Card ("Red Magic" or "Scarlet Gensokyo"). This bug will not work if second-last Spell Card of Flandre or Remilia is beaten by bombing.<br />
* If you time out the last Spell Card of Remilia or Flandre and use a bomb right before the Spell Card finishes off (that will cause Remilia and Flandre turn into bats), the Spell Card will finish, but the bat-looking bosses will still remain on the screen. In this case you will have to wait a minute or so before the final score (for Remilia) or the final dialog (for Flandre) appears.<br />
* Pausing the game exactly when the statistics screen is about to open up causes the game to show both the statistics menu and the pause menu at once, giving you control of both simultaneously, allowing you to go back to the main screen and even start a run while the other menu is still open, causing weird effects as seen in [http://youtu.be/iyQriK8Gywo this video].<br />
* Meiling's "Wind Chime of Colorful Rainbow" does not give any items after defeating it if the bullet count is 511 or higher (a bonus of at least 2325050). It only gives 2 out of the intended 5 point or power items if the bullet count is 510 (bonus of 2317950). The difficulty must be Hard or Lunatic for the spell to have this many bullets. In Extra, this can also affect Patchouli's "Silent Selene".<br />
* Sometimes Flandre stops shooting for one wave during her 6th nonspell for currently unknown reasons as seen in [http://youtu.be/Teyy1j3ZNkQ?t=9m52s this video].<br />
* If you finish a nonspell when the timer of the boss is at the end of 00 seconds (a frame away from timing out), the Spell Card that comes afterward is skipped. You get all of the items you would normally get from finishing the Spell Card off, but you do not get any Spell Card bonus. This can be done for most nonspells that have Spell Cards after them, but not all of them. This bug works for every nonspell except for Flandre's last nonspell and Remilia's last nonspell. <br />
* There is a visual bug in the character selection screen, where if you press the Z key while changing the character both characters will be shown at the same time as seen [http://i.imgur.com/5PADGSB.png here]. <br />
* Dying at the same time as a cancel happens at certain parts of the game, for example the green books in stage 4 on Lunatic can cause your character to not drop any power items after the death as seen [https://www.youtube.com/watch?v=_XKyGgQ0wN0&feature=youtu.be&t=16s here]. <br />
<br />
<br />
{{Navbox EoSD}}<br />
<br />
[[Category:Gameplay]]<br />
[[Category:Embodiment of Scarlet Devil]]<br />
[[pl:Embodiment of Scarlet Devil/Rozgrywka]]<br />
[[ru:Embodiment of Scarlet Devil/Геймплей]]<br />
{{DISPLAYTITLE:the Embodiment of Scarlet Devil/Gameplay|noerror}}</div>Mddasshttps://en.touhouwiki.net/index.php?title=Sunken_Fossil_World/Spell_Cards/Yuugi_Hoshiguma&diff=409073Sunken Fossil World/Spell Cards/Yuugi Hoshiguma2019-10-07T04:56:19Z<p>Mddass: </p>
<hr />
<div>{{SubpageNav|Spell Cards|Kogasa Tatara|}}<br />
<br />
{{Spell Card Info<br />
| image = [[File:Th175YuugiSSC01.jpg|200px]]<br />
| number = Story Mode 1<br />
| name = 湧泉「熱鬼掘削撃」<br />
| transname = Gushing Spring "Heated Oni's Excavation Strike"<br />
| owner = Yuugi Hoshiguma<br />
| stage =<br />
| difficulty =<br />
| comment = <br />
}}<br />
{{Spell Card Info<br />
| image = [[File:Th175YuugiSSC02.jpg|200px]]<br />
| number = Story Mode 2<br />
| name = 怨泉「極楽温泉地獄」<ref>極楽 (''Gokuraku'' lit. "Full of [[wikipedia:Sukha|Sukha]]") is the Japanese name of [[wikipedia:Sukhavati|Sukhavati]], the Buddha [[wikipedia:Amitabha|Amitabha's]] paradise. 地獄 (''Jigoku'' lit. "Earth Prison") is the Japanese pronunciation of the Chinese concept of hell, [[Wikipedia:Diyu|Diyu]], which in turn was heavily influenced by the Indian Buddhist [[wikipedia:Naraka_(Buddhism)|Naraka]].</ref><ref>温泉地獄 (''onsen jigoku'') is pun combining the words 温泉地 (''onsenchi'' lit. "earthen hot spring") and 地獄 (''Jigoku'' lit. "Earth Prison/Hell").</ref><br />
| transname = Vengeful Spring "Hot Spring of Paradise and Hell"<br />
| owner = Yuugi Hoshiguma<br />
| stage =<br />
| difficulty =<br />
| comment = <br />
}}<br />
<br />
<br />
{{Navbox GYIB}}<br />
[[Category:Touhou Gouyoku Ibun]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Remains_of_Blazing_Hell&diff=408946Remains of Blazing Hell2019-10-05T00:29:42Z<p>Mddass: /* Additional Information */</p>
<hr />
<div>{{Infobox Location<br />
| nameJp = {{ruby-ja|灼熱地獄跡|しゃくねつじごくあと}}<br />
| nameEn = Remains of Blazing Hell<br />
| nameIPA = ɕʲa̠kɯᵝne̞t͡sɯᵝd͡ʑiɡ̃o̞kɯᵝa̠to̞<br />
| nameAlt = Hell of Blazing Fires, Remains of Hell<br />
| image = [[File:Th11RemainsOfBlazingHellSt6.jpg|250px]]<br />
| caption = The Blazing Fires in [[Subterranean Animism]]<br />
| location = The deepest part of the [[Underworld]], under [[Former Hell]] & [[Palace of the Earth Spirits]]<br />
| residents = *[[Utsuho Reiuji]]<br />
*[[Rin Kaenbyou]]<br />
| appOfficialgames = *''[[Subterranean Animism]]'' (Stage 5 & 6)<br />
*''[[Double Spoiler]]'' (Stage 8)<br />
| appPrintworks = *''[[Wild and Horned Hermit]]'' (Chapter 2 cameo)<br />
}}<br />
The {{nihongo|'''Remains of Blazing Hell'''|灼熱地獄跡|Shakunetsu Jigoku Ato}}, also known as the {{nihongo|'''Hell of Blazing Fires'''|灼熱地獄|Shakunetsu Jigoku}} and {{nihongo|'''Remains of Hell'''|地獄跡地|Jigoku Atochi|lit. "Abandoned Site of Hell"}}, is thought to be in the deepest part of the [[Underworld]], located below [[Former Hell]] and the [[Palace of the Earth Spirits]].<br />
<br />
==General Information==<br />
The Remains of Blazing Hell was formerly a part of [[Former Hell]] where criminals were banished, it has recently been re-ignited because of the activation of the [[Nuclear Furnace]] directly below by [[Utsuho Reiuji]]. [[Rin Kaenbyou]] can be found here, carting corpses into the Furnace to keep it running. The place is very hot because it has a lot of magma, and it is invested with [[vengeful spirit]]s. Since people stopped being condemned to the hellfires, the [[oni]] don't visit any more either, so this place has become the playground to such spirits and animals. It's said that if you die here, your corpse will be trapped here and you'll turn into a vengeful spirit, where you cannot make it to [[Heaven]] regardless of your innocence.<br />
<br />
Before the events of ''[[Subterranean Animism]]'', the Blazing Fires were apparently not as hot as it is now, because when [[Hell]] moved to a new location that in itself created [[Former Hell]], the Blazing Fires started to cool down, thus becoming dark, and [[Satori Komeiji]] sealed it off with the [[Palace of the Earth Spirits]].<ref name="SAExPrologue">[[Subterranean Animism]]: [[Subterranean Animism/Story/Extra Story|Extra story]]</ref> Thus, this became space for [[Kanako Yasaka]] and [[Suwako Moriya]] to start a Mountain Industrial Revolution project, and Utsuho burned it up again after she swallowed the [[god]] [[Yatagarasu]].<br />
<br />
==Blazing Fires's Appearances==<br />
===Games===<br />
;''Subterranean Animism''<br />
The Remains of Blazing Hell was the source to the events of ''[[Subterranean Animism]]'', causing the geysers and the [[vengeful spirit]]s to roam above ground. It was the setting [[Stage]] 5 and first half of the Final Stage. After [[Reimu Hakurei]] or [[Marisa Kirisame]] defeated [[Satori Komeiji]] at the [[Palace of the Earth Spirits]] on Stage 2, they'll travel through The Blazing Fires, where they'll be attacked by a lot of [[vengeful spirit]]s. They'll once again face [[Rin Kaenbyou]] in her [[cat]] here as a midboss, and after some roaming, Rin will re-appear and convert into [[human]] form. She will attempt to try and catch your the heroine's corpse with her [[Zombie Fairy|zombie fairies]], but fails. After she was defeated, she'll point the heroine towards the deepest part of the Blazing Fires. On Stage 6, the heroine will be flying over magma literally, where they'll be attacked by [[raven]]s and more vengeful spirits, and Rin will attack once more. The heroine will then fly upwards into the [[Nuclear Furnace]] and meet the Final Boss, [[Utsuho Reiuji]].<br />
<br />
===Spin-offs===<br />
;''Double Spoiler''<br />
The Blazing Fires appears in ''[[Double Spoiler]]'' on [[stage]] 8, where [[Aya Shameimaru]] and [[Hatate Himekaidou]] encounters [[Rin Kaenbyou]] and [[Utsuho Reiuji]] to try and take photos of their [[danmaku]]. Rin will appear in her [[cat]] form on scenes 1 and 7, and she'll also introduce [[Zombie Fairy|zombie fairies]] on scenes 3 and 8. The previous stage is in [[Makai]], whilst the next stage is at [[Palace of the Earth Spirits]]. There are 8 scenes total on this stage.<br />
<br />
==Gallery==<br />
<gallery><br />
File:Th11RemainsOfBlazingHell.jpg|The Blazing Fires on stage 5 of ''[[Subterranean Animism]]''<br />
File:Th11EvilSpiritsScreenshot.png|First occurrence of vengeful spirits (phantoms) as enemies, as seen in ''[[Subterranean Animism]]''<br />
File:WaHHUnderworldLayers.png|The Blazing Fires shown on the [[Underworld]] map in ''[[Wild and Horned Hermit]]''<br />
</gallery><br />
<br />
==Additional Information==<br />
*In the music comments of ''[[Subterranean Animism]]'', [[ZUN]] refers to [[Reimu Hakurei]] flying over "lava", however the correct term for molten rock underground would be "magma".<br />
<br />
==Reference==<br />
{{smallrefs}}<br />
<br />
{{Navbox Locations}}<br />
{{Navbox SA}}<br />
{{Navbox DS}}<br />
<br />
[[Category:Locations]]<br />
[[fr:Enfer des Flammes Ardentes]]<br />
[[ru:Ад пылающих огней]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=Remains_of_Blazing_Hell&diff=408945Remains of Blazing Hell2019-10-05T00:28:50Z<p>Mddass: /* Gallery */</p>
<hr />
<div>{{Infobox Location<br />
| nameJp = {{ruby-ja|灼熱地獄跡|しゃくねつじごくあと}}<br />
| nameEn = Remains of Blazing Hell<br />
| nameIPA = ɕʲa̠kɯᵝne̞t͡sɯᵝd͡ʑiɡ̃o̞kɯᵝa̠to̞<br />
| nameAlt = Hell of Blazing Fires, Remains of Hell<br />
| image = [[File:Th11RemainsOfBlazingHellSt6.jpg|250px]]<br />
| caption = The Blazing Fires in [[Subterranean Animism]]<br />
| location = The deepest part of the [[Underworld]], under [[Former Hell]] & [[Palace of the Earth Spirits]]<br />
| residents = *[[Utsuho Reiuji]]<br />
*[[Rin Kaenbyou]]<br />
| appOfficialgames = *''[[Subterranean Animism]]'' (Stage 5 & 6)<br />
*''[[Double Spoiler]]'' (Stage 8)<br />
| appPrintworks = *''[[Wild and Horned Hermit]]'' (Chapter 2 cameo)<br />
}}<br />
The {{nihongo|'''Remains of Blazing Hell'''|灼熱地獄跡|Shakunetsu Jigoku Ato}}, also known as the {{nihongo|'''Hell of Blazing Fires'''|灼熱地獄|Shakunetsu Jigoku}} and {{nihongo|'''Remains of Hell'''|地獄跡地|Jigoku Atochi|lit. "Abandoned Site of Hell"}}, is thought to be in the deepest part of the [[Underworld]], located below [[Former Hell]] and the [[Palace of the Earth Spirits]].<br />
<br />
==General Information==<br />
The Remains of Blazing Hell was formerly a part of [[Former Hell]] where criminals were banished, it has recently been re-ignited because of the activation of the [[Nuclear Furnace]] directly below by [[Utsuho Reiuji]]. [[Rin Kaenbyou]] can be found here, carting corpses into the Furnace to keep it running. The place is very hot because it has a lot of magma, and it is invested with [[vengeful spirit]]s. Since people stopped being condemned to the hellfires, the [[oni]] don't visit any more either, so this place has become the playground to such spirits and animals. It's said that if you die here, your corpse will be trapped here and you'll turn into a vengeful spirit, where you cannot make it to [[Heaven]] regardless of your innocence.<br />
<br />
Before the events of ''[[Subterranean Animism]]'', the Blazing Fires were apparently not as hot as it is now, because when [[Hell]] moved to a new location that in itself created [[Former Hell]], the Blazing Fires started to cool down, thus becoming dark, and [[Satori Komeiji]] sealed it off with the [[Palace of the Earth Spirits]].<ref name="SAExPrologue">[[Subterranean Animism]]: [[Subterranean Animism/Story/Extra Story|Extra story]]</ref> Thus, this became space for [[Kanako Yasaka]] and [[Suwako Moriya]] to start a Mountain Industrial Revolution project, and Utsuho burned it up again after she swallowed the [[god]] [[Yatagarasu]].<br />
<br />
==Blazing Fires's Appearances==<br />
===Games===<br />
;''Subterranean Animism''<br />
The Remains of Blazing Hell was the source to the events of ''[[Subterranean Animism]]'', causing the geysers and the [[vengeful spirit]]s to roam above ground. It was the setting [[Stage]] 5 and first half of the Final Stage. After [[Reimu Hakurei]] or [[Marisa Kirisame]] defeated [[Satori Komeiji]] at the [[Palace of the Earth Spirits]] on Stage 2, they'll travel through The Blazing Fires, where they'll be attacked by a lot of [[vengeful spirit]]s. They'll once again face [[Rin Kaenbyou]] in her [[cat]] here as a midboss, and after some roaming, Rin will re-appear and convert into [[human]] form. She will attempt to try and catch your the heroine's corpse with her [[Zombie Fairy|zombie fairies]], but fails. After she was defeated, she'll point the heroine towards the deepest part of the Blazing Fires. On Stage 6, the heroine will be flying over magma literally, where they'll be attacked by [[raven]]s and more vengeful spirits, and Rin will attack once more. The heroine will then fly upwards into the [[Nuclear Furnace]] and meet the Final Boss, [[Utsuho Reiuji]].<br />
<br />
===Spin-offs===<br />
;''Double Spoiler''<br />
The Blazing Fires appears in ''[[Double Spoiler]]'' on [[stage]] 8, where [[Aya Shameimaru]] and [[Hatate Himekaidou]] encounters [[Rin Kaenbyou]] and [[Utsuho Reiuji]] to try and take photos of their [[danmaku]]. Rin will appear in her [[cat]] form on scenes 1 and 7, and she'll also introduce [[Zombie Fairy|zombie fairies]] on scenes 3 and 8. The previous stage is in [[Makai]], whilst the next stage is at [[Palace of the Earth Spirits]]. There are 8 scenes total on this stage.<br />
<br />
==Gallery==<br />
<gallery><br />
File:Th11RemainsOfBlazingHell.jpg|The Blazing Fires on stage 5 of ''[[Subterranean Animism]]''<br />
File:Th11EvilSpiritsScreenshot.png|First occurrence of vengeful spirits (phantoms) as enemies, as seen in ''[[Subterranean Animism]]''<br />
File:WaHHUnderworldLayers.png|The Blazing Fires shown on the [[Underworld]] map in ''[[Wild and Horned Hermit]]''<br />
</gallery><br />
<br />
==Additional Information==<br />
*In the music comments of ''[[Subterranean Animism]]'', [[ZUN]] refers to [[Reimu Hakurei]] flying over "lava"; the term "lava" is incorrect, because the correct term for molten rock underground is "magma".<br />
<br />
==Reference==<br />
{{smallrefs}}<br />
<br />
{{Navbox Locations}}<br />
{{Navbox SA}}<br />
{{Navbox DS}}<br />
<br />
[[Category:Locations]]<br />
[[fr:Enfer des Flammes Ardentes]]<br />
[[ru:Ад пылающих огней]]</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408136User:Mddass/Touhou File Format Specification/ECL2019-09-17T01:58:01Z<p>Mddass: /* PCB (th07) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|float &var, float a|Sets var to a. Equiv.: var {{=}} a.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r)}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408133User:Mddass/Touhou File Format Specification/ECL2019-09-17T00:09:51Z<p>Mddass: /* ECL Instruction Tables (V1) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|void|Stop script execution on this enemy and delete it.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408132User:Mddass/Touhou File Format Specification/ECL2019-09-17T00:02:50Z<p>Mddass: /* ECL Instruction Table (V1) */ Split this section</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Tables (V1) ==<br />
<br />
=== EoSD (th06) ===<br />
<br />
This list below lists the opcode, a mnemonic/name, the format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|int a|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)|int &var, float a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. Does not read variables.}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. Does not read variables. Affected by difficulty (~0.8x delay at 32).}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
|-<br />
|}<br />
</div><br />
<br />
The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}<br />
</div><br />
<br />
=== PCB (th07) ===<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also contain some implementation details (irrelevant for most people).<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
<!--{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}--><br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
<!--{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}--><br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408131User:Mddass/Touhou File Format Specification/ECL2019-09-16T23:45:05Z<p>Mddass: /* Th07: PCB (Final) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10047.0f]<br />
* [10048.0f]<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10063.0f]<br />
* [10064.0f]<br />
* [10065.0f]<br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408123User:Mddass/Touhou File Format Specification/ECL2019-09-16T22:36:54Z<p>Mddass: /* Main Instruction Table */ redundancy</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408120User:Mddass/Touhou File Format Specification/ECL2019-09-16T19:56:58Z<p>Mddass: /* th06 (EoSD) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots every 6th frame in a star-shape and aims the bullets in a specific way, and spins every 30. I3 keeps track of the current duration (in frames) of the attack and I4 is the max duration. The hardcoded function is automatically disabled once it reaches the max duration.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408119User:Mddass/Touhou File Format Specification/ECL2019-09-16T19:21:21Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW|debug_watch|0x007F (127)|int& a|Unavailable debug operation, but probably puts a specific variable in a watchlist.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag. Used by Patchouli.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots in a star-shape and aims the bullets in a specific way.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408118User:Mddass/Touhou File Format Specification/ECL2019-09-16T19:19:13Z<p>Mddass: /* th06 (EoSD) */ this was confusing em</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Used in Meiling's Yumekazura (2nd spell). Shoots in a star-shape and aims the bullets in a specific way.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408115User:Mddass/Touhou File Format Specification/ECL2019-09-16T18:14:59Z<p>Mddass: /* Extra Bullet Functions (et_ex) */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames (negative for 99999 frames).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (negative to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408110User:Mddass/Touhou File Format Specification/ECL2019-09-16T06:22:02Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|int a|Unknown. Toggles a flag.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408109User:Mddass/Touhou File Format Specification/ECL2019-09-16T06:14:14Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life|0x006F (111)|int l|Sets the enemy life and max life.}}<br />
{{User:Mddass/ECL_TABLE_ROW|timeout|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408108User:Mddass/Touhou File Format Specification/ECL2019-09-16T06:10:42Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value into a variable the variable pool at index i. The pool is 4 integers followed by 4 floats. Anything else will over/underflow into other regions.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408105User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:50:34Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in a separate slot. Only slots 0-7 are valid. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408104User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:48:56Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right|Sets the various anm script IDs for varying stages of enemy movement. Note: Last 2 bytes go unused due to packing.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408103User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:33:07Z<p>Mddass: /* Main Instruction Table */ Add laser_test</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_test|0x005B (91)|int i|Checks if a specified laser is disabled and stores the result in the comparison register.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408102User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:31:01Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_aim|0x0059 (89)|int i, float r|Aims the specified laser towards the player and further rotates it by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408101User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:26:40Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work. Using a negative value will turn that flag off.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_acc|0x0059 (89)|int i, float s|Accelerates the specified laser by s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408100User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:24:38Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on2|0x0050 (80)|void|Unused. ''Immediately'' shoots.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_acc|0x0059 (89)|int i, float s|Accelerates the specified laser by s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408099User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:22:40Z<p>Mddass: /* Main Instruction Table */ Fuck's sake...</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables. Affected by difficulty (~0.8x delay at 32).|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0050 (80)|void|Unused. Immediately shoots a bullet at a point previously-specified by et_ofs?}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_acc|0x0059 (89)|int i, float s|Accelerates the specified laser by s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408098User:Mddass/Touhou File Format Specification/ECL2019-09-16T05:08:42Z<p>Mddass: /* Main Instruction Table */ fix et_diff_set</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0050 (80)|void|Unused. Immediately shoots a bullet at a point previously-specified by et_ofs?}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_acc|0x0059 (89)|int i, float s|Accelerates the specified laser by s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float am1_l, float am1_h, float am2_l, float am2_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddasshttps://en.touhouwiki.net/index.php?title=User:Mddass/Touhou_File_Format_Specification/ECL&diff=408097User:Mddass/Touhou File Format Specification/ECL2019-09-16T04:51:37Z<p>Mddass: /* Main Instruction Table */</p>
<hr />
<div>'''ECL'''/'''.ecl''' files ([https://github.com/pbghogehoge/ssg/blob/master/GIAN07/ECL.H 敵コントロール言語] ''teki-kontorōru gengo'', '''''enemy control language''''') are compiled scripts (stack-based in V2+) and correspond to the stage enemies in the Touhou games, basically making them the veins and arteries from which the game's <s>blood</s> engine flows. They're responsible for stage enemy timings, bullet patterns, enemy movement, some background (3D) particle effects, boss setup, etc..<br />
<br />
== Versions ==<br />
The ECL format has changed constantly over the years, specially in regards to the functions that it executes. From MoF onwards (version 2), ECL is a stack-based compiled script language.<br />
<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V1|ECL V1: Th06-Th095]] - First version of ECL, notable for not using a stack and having timeline sections for stage timing.<br />
* [[User:Mddass/Touhou_File_Format_Specification/ECL/V2|ECL V2: Th10-Th16]] - Complete revamp of the first version. Functions are named now, and '''introduces the stack system.'''<br />
<br />
== Syntax (thtk) ==<br />
TBD<br />
<br />
== Syntax (TSA) ==<br />
TBD, there are enough screenshots to know.<br />
<br />
== Variables (V1) ==<br />
'''''These lists are incomplete and are subject to change over time.'''''<br />
=== Th06: [[EoSD]] ===<br />
These are the variables that can be used in EoSD ECL. They're very few (just 25), even when compared to its immediate successor: PCB.<br />
<br />
<div style="font-size:95%;text-align:center;"><br />
{| border="0" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|ID<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Description<br />
!style="background-color:papayawhip;"|Type<br />
|-<br />
| -10001<br />
|I0<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10002<br />
|I1<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10003<br />
|I2<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10004<br />
|I3<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10005<br />
|F0<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10006<br />
|F1<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10007<br />
|F2<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10008<br />
|F3<br />
|Local variable (float)<br />
|Float (1)<br />
|-<br />
| -10009<br />
|I4<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10010<br />
|I5<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10011<br />
|I6<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10012<br />
|I7<br />
|Local variable (int)<br />
|Integer (0)<br />
|-<br />
| -10013<br />
|RANK<br />
|Rank (Easy: 0; Lunatic: 3; Extra: 4)<br />
|Read-only (2)<br />
|-<br />
| -10014<br />
|DIFFICULTY<br />
|[[Embodiment_of_Scarlet_Devil/Gameplay#Rank|Difficulty]]<br />
|Read-only (2)<br />
|-<br />
| -10015<br />
|X<br />
|X-position<br />
|Float (1)<br />
|-<br />
| -10016<br />
|Y<br />
|Y-position<br />
|Float (1)<br />
|-<br />
| -10017<br />
|Z<br />
|Z-position<br />
|Float (1)<br />
|-<br />
| -10018<br />
|PLAYER_X<br />
|Player X-position<br />
|Read-only (2)<br />
|-<br />
| -10019<br />
|PLAYER_Y<br />
|Player Y-position<br />
|Read-only (2)<br />
|-<br />
| -10020<br />
|PLAYER_Z<br />
|Player Z-position<br />
|Read-only (2)<br />
|-<br />
| -10021<br />
|AIM<br />
|Angle to player<br />
|Read-only (2)<br />
|-<br />
| -10022<br />
|TIME<br />
|Current lifetime<br />
|Integer (0)<br />
|-<br />
| -10023<br />
|DIST<br />
|Distance to player<br />
|Read-only (2)<br />
|-<br />
| -10024<br />
|LIFE<br />
|Current life<br />
|Integer (0)<br />
|-<br />
| -10025<br />
|SHOT_TYPE<br />
|Current shot type<br />Calculated as "player * 2 + type", where Reimu is player 0 and Marisa is player 1<br />
|Integer (0) (wtf?)<br />
|-<br />
|}<br />
</div><br />
<br />
=== Th07: PCB (Final) ===<br />
The variables that can be used in PCB ECL are much more than that of EoSD ECL. Improvements include more local variables, inheritable variables, randomness variables, movement-related variables, and much more.<br />
<br />
* [10000]: Local variable (32-bit integer).<br />
* [10001]: Local variable (32-bit integer).<br />
* [10002]: Local variable (32-bit integer).<br />
* [10003]: Local variable (32-bit integer).<br />
* [10004.0f]: Local variable (single-precision floating point).<br />
* [10005.0f]: Local variable (single-precision floating point).<br />
* [10006.0f]: Local variable (single-precision floating point).<br />
* [10007.0f]: Local variable (single-precision floating point).<br />
* [10008.0f]: Local variable (single-precision floating point).<br />
* [10009.0f]: Local variable (single-precision floating point).<br />
* [10010.0f]: Local variable (single-precision floating point).<br />
* [10011.0f]: Local variable (single-precision floating point).<br />
* [10012]: Local variable (32-bit integer).<br />
* [10013]: Local variable (32-bit integer).<br />
* [10014]: Local variable (32-bit integer).<br />
* [10015]: Local variable (32-bit integer).<br />
* [10016]: Rank (Easy: 0; Normal: 1; Hard: 2; Lunatic: 3; Extra: 4; Phantasm: 5)<br />
* [10017]: [[Perfect_Cherry_Blossom/Gameplay#Rank|Difficulty]].<br />
* [10018.0f]: Self X-position.<br />
* [10019.0f]: Self Y-position.<br />
* [10020.0f]: Self Z-position.<br />
* [10021.0f]: Player X-position.<br />
* [10022.0f]: Player Y-position.<br />
* [10023.0f]: Player Z-position.<br />
* [10024.0f]: Angle to player.<br />
* [10025]: Current time.<br />
* [10026.0f]: Distance from player.<br />
* [10027]: Current life.<br />
* [10028]: Shot-type. (ReimuA: 0; MarisaA: 2; SakuyaA: 4; etc.)<br />
* [10029]: Function-wide integer.<br />
* [10030]: Function-wide integer.<br />
* [10031]: Function-wide integer.<br />
* [10032]: Function-wide integer.<br />
* [10033.0f]: Function-wide float.<br />
* [10034.0f]: Function-wide float.<br />
* [10035.0f]: Function-wide float.<br />
* [10036.0f]: Function-wide float.<br />
* [10037]: Function-wide integer. When a function is called from this, copied to the function's [-10029].<br />
* [10038]: Function-wide integer. When a function is called from this, copied to the function's [-10030].<br />
* [10039]: Function-wide integer. When a function is called from this, copied to the function's [-10031].<br />
* [10040]: Function-wide integer. When a function is called from this, copied to the function's [-10032].<br />
* [10041.0f]: Function-wide float. When a function is called from this, copied to the function's [-10033.0f].<br />
* [10042.0f]: Function-wide float. When a function is called from this, copied to the function's [-10034.0f].<br />
* [10043.0f]: Function-wide float. When a function is called from this, copied to the function's [-10035.0f].<br />
* [10044.0f]: Function-wide float. When a function is called from this, copied to the function's [-10036.0f].<br />
* [10045.0f]: Angle to origin point (orbital movement).<br />
* [10046.0f]: Rotation speed (orbital movement).<br />
* [10049.0f]: Distance from origin point (orbital movement).<br />
* [10050.0f]: Origin point X-coord (orbital movement).<br />
* [10051.0f]: Origin point Y-coord (orbital movement).<br />
* [10052.0f]: Origin point Z-coord (orbital movement).<br />
* [10053.0f]: Unknown float. <span style="color:grey">Used by Yukari's last spell to store some angle. Angle to origin point + pi?</span><br />
* [10054.0f]: Current angle.<br />
* [10055.0f]: Returns a random value between <code>0.0f</code> and <code>1.0f</code>.<br />
* [10056.0f]: Returns a random value between <code>[10034.0f]</code> and <code>[10034.0f] + [10033.0f]</code>.<br />
* [10057.0f]: X-offset to target point.<br />
* [10058.0f]: Y-offset to target point.<br />
* [10059.0f]: Z-offset to target point.<br />
* [10060.0f]: Returns a random radian value.<br />
* [10061]: Unknown. <span style="color:grey">Used by the Prismrivers.</span><br />
* [10062]: Unknown byte. <span style="color:grey">Seems to be some state byte. Used by the Prismrivers.</span><br />
* [10066]: Boss life threshold.<br />
* [10067]: Boss life threshold. <span style="color:grey">What's the difference from [10066]?</span><br />
* [10068]: Minimum life. If the enemy life drops down to this, it will immediately be deleted.<br />
* [10069]: Minimum life. If the enemy life drops down to this, it will immediately be deleted. <span style="color:grey">What's the difference from [10068]?</span><br />
* [10070]: Item reward on death.<br />
* [10071]: Score reward on death.<br />
* [10072.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store X-offset to spawn bullets from.</span><br />
* [10073.0f]: Local variable? <span style="color:grey">Used by Yuyuko to store Y-offset to spawn bullets from.</span><br />
<br />
== Variables (V2) ==<br />
'''Note:''' All variables from MoF onwards carry over to the next games.<br />
<br />
Missing variables are either unknown or unused.<br />
<br />
=== Th10: [[MoF]] ===<br />
* [-10000]: Random integer value.<br />
* [-9999.0f]: Random float value from 0.0f to 1.0f.<br />
* [-9998.0f]: Random value from -pi to pi.<br />
* [-9997.0f]: Final X-coordinate.<br />
* [-9996.0f]: Final Y-coordinate.<br />
* [-9995.0f]: Absolute X-coordinate.<br />
* [-9994.0f]: Abdolute Y-coordinate.<br />
* [-9993.0f]: Relative X-coordinate.<br />
* [-9992.0f]: Relative Y-coordinate.<br />
* [-9991.0f]: Player X-pos.<br />
* [-9990.0f]: Player Y-pos.<br />
* [-9989.0f]: Angle to player (based on current position).<br />
* [-9988]: Time elapsed (in current sub?)<br />
* [-9987.0f]: Random float value from -1.0f to 1.0f.<br />
* [-9986]: Becomes non-null when a timeout occurs.<br />
* [-9985]: Local variable.<br />
* [-9984]: Local variable.<br />
* [-9983]: Local variable.<br />
* [-9982]: Local variable.<br />
* [-9981.0f]: Local variable.<br />
* [-9980.0f]: Local variable.<br />
* [-9979.0f]: Local variable.<br />
* [-9978.0f]: Local variable.<br />
* [-9977.0f]: Same as [-9997.0f].<br />
* [-9976.0f]: Same as [-9996.0f].<br />
* [-9975.0f]: Same as [-9995.0f].<br />
* [-9974.0f]: Same as [-9994.0f].<br />
* [-9973.0f]: Same as [-9993.0f].<br />
* [-9972.0f]: Same as [-9992.0f].<br />
* [-9971.0f]: Absolute current angular direction.<br />
* [-9970.0f]: Relative current angular direction.<br />
* [-9969.0f]: Absolute current movement speed.<br />
* [-9968.0f]: Relative current movement speed.<br />
* [-9967.0f]: Absolute radius from origin point.<br />
* [-9966.0f]: Relative radius from origin point.<br />
* [-9965.0f]: Same as [-9991.0f].<br />
* [-9964.0f]: Same as [-9990.0f].<br />
* [-9963.0f]: Boss 0 X-pos.<br />
* [-9962.0f]: Boss 0 Y-pos.<br />
* [-9961]: 未知 (地址1120)<br />
* [-9960]: Game difficulty.<br />
* [-9959]: Rank. E = 0; N = 1; H = 2; L = 3; X = 4; O = 5.<br />
* [-9958]: Final angular direction.<br />
* [-9957]: 1<br />
* [-9954]: Current life.<br />
* [-9953]: Easy mode flag.<br />
* [-9952]: Normal mode flag.<br />
* [-9951]: Hard mode flag.<br />
* [-9950]: Lunatic mode flag.<br />
=== Th11: [[SA]] ===<br />
* [-9949]: Miss count<br />
* [-9948]: Bomb count<br />
* [-9947]: Becomes null on timeout, miss or bomb (or any other game-specific condition i.e. trance).<br />
* [-9946]: Amount of units on-screen.<br />
* [-9945]: Shot type.<br />
* [-9944.0f]: Distance from player.<br />
* [-9943]: Boss local variable.<br />
* [-9942]: Boss local variable.<br />
* [-9941]: Boss local variable.<br />
* [-9940]: Boss local variable.<br />
* [-9939.0f]: Boss local variable.<br />
* [-9938.0f]: Boss local variable.<br />
* [-9937.0f]: Boss local variable.<br />
* [-9936.0f]: Boss local variable.<br />
* [-9935.0f]: Local variable.<br />
* [-9934.0f]: Local variable.<br />
* [-9933.0f]: Local variable.<br />
* [-9932.0f]: Local variable.<br />
<br />
=== Th12: [[UFO]] ===<br />
* [-9931]: 已经出现单位数量-1,包含main<br />
* [-9930]: Power.<br />
=== Th12.5: [[DS]] ===<br />
* [-9926]: Global variable.<br />
* [-9925]: Global variable.<br />
* [-9924]: Global variable.<br />
* [-9923]: Global variable.<br />
* [-9922.0f]: Global variable.<br />
* [-9921.0f]: Global variable.<br />
* [-9920.0f]: Global variable.<br />
* [-9919.0f]: Global variable.<br />
* [-9918.0f]: Global variable.<br />
* [-9917.0f]: Global variable.<br />
* [-9916.0f]: Global variable.<br />
* [-9915.0f]: Global variable.<br />
* [-9914]: Unit ID.<br />
* [-9913]: Photo count.<br />
* [-9911.0f]: Current movement angle.<br />
=== Th12.8: [[GFW]] ===<br />
=== Th13: [[TD]] ===<br />
* [-9908]: Killable unit count.<br />
* [-9907]: Current spell practice spellcard ID.<br />
=== Th16: [[HSiFS]] ===<br />
* [-9903]: Current subseason.<br />
=== Th17: [[WBaWC]] ===<br />
* [-9902]: Graze last second?<br />
<br />
== ECL Instruction Table (V1) ==<br />
<br />
=== Main Instruction Table ===<br />
'''''NOTE:''' Currently, only EoSD (th06) has been properly and thoroughly checked, with PCB (th07) also having been checked but not updated for this table. This table is currently most definitely not accurate for other games.''<br />
<br />
This list below lists the opcode, mnemonic/name, format and a description for each main ECL instruction used in the subroutines section of the ECL file. This section may also detail some implementation details (irrelevant for most people).<br />
<br />
Color-coding may be used for game-specific details.<br />
* {{User:Mddass/GAME_COLOR_TEXT| EoSD (th06): Dark red. Information marked like this only applies to EoSD.|6}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PCB (th07): Medium violet red. Information marked like this applies to PCB onwards.|7}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| IN (th08): Orange red. Information marked like this applies to IN onwards.|8}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| PoFV (th09): Green. Information marked like this applies to PoFV onwards.|9}}<br />
* {{User:Mddass/GAME_COLOR_TEXT| StB (th095): Saddle brown. Information marked like this applies to StB onwards.|95}}<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1" class="sortable"<br />
|-<br />
!style="background-color:papayawhip;"|Name<br />
!style="background-color:papayawhip;"|Opcode<br />
!style="background-color:papayawhip;"|Format<br />
!style="background-color:papayawhip;"|Description<br />
{{User:Mddass/ECL_TABLE_ROW|nop|0x0000 (0)|void|No operation. Technically, every invalid opcode is considered "nop", which includes 0.}}<br />
{{User:Mddass/ECL_TABLE_ROW|delete|0x0001 (1)|{{User:Mddass/GAME_COLOR_TEXT|int a|6}}<br />
void|{{User:Mddass/GAME_COLOR_TEXT|Stop script execution on this enemy and delete it if a {{=}}{{=}} 1. Implementation detail: Returns -1.|6}}<br />
Stop script execution on this enemy and delete it.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp|0x0002 (2)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0004 (4)|8}}|int t, int cp|Unconditionally sets current time to t and sets the current seek offset in this function to cp.}}<br />
{{User:Mddass/ECL_TABLE_ROW|loop|0x0003 (3)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0005 (5)|8}}|int t, int cp, int& var|If var !{{=}} 0, sets current time to t, sets the current seek offset in this function to cp and decrements var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset|0x0004 (4)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0006 (6)|8}}|int &var, int a|Sets var to a. Equiv.: var {{=}} a. Interchangeable with fset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset|0x0005 (5)<br />
{{User:Mddass/GAME_COLOR_TEXT|0x0007 (7)|8}}|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|float &var, float a|7}}|Sets var to a. Equiv.: var {{=}} a. Interchangeable with iset.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r|0x0006 (6)|int &var, uint a|Sets var to a random value in the range [0, a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a<br />
{{User:Mddass/ECL_TABLE_ROW|iset_r2|0x0007 (6)|int &var, int min, int a|Sets var to a random value in the range [min, min+a). If a is 0, sets it to 0. Equiv.: var {{=}} rand()}}<br />
% a + min<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r|0x0008 (8)|int &var, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float a|7}}|Sets var to a random value in the range [0, a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|fset_r2|0x0009 (9)|int &var, float min, float a<br />
{{User:Mddass/GAME_COLOR_TEXT|int &var, float min, float a|7}}|Sets var to a random value in the range [min, min+a).}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_x|0x000A (10)|int &var|Sets var to the enemy's x-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_y|0x000B (11)|int &var|Sets var to the enemy's y-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|get_z|0x000C (12)|int &var|Sets var to the enemy's z-position.}}<br />
{{User:Mddass/ECL_TABLE_ROW|iadd|0x000D (13)|int &var, int l, int r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with fadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|isub|0x000E (14)|int &var, int l, int r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with fsub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imul|0x000F (15)|int &var, int l, int r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with fmul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|idiv|0x0010 (16)|int &var, int l, int r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with fdiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|imod|0x0011 (17)|int &var, int l, int r|Sets var to the result of l % r. Equiv.: var {{=}} l % r. Interchangeable with fmod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inc|0x0012 (18)|int &var|Increment var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|dec|0x0013 (19)|int &var|Decrement var by 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fadd|0x0014 (20)|int &var, float l, float r|Sets var to the result of l + r. Equiv.: var {{=}} l + r. Interchangeable with iadd.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fsub|0x0015 (21)|int &var, float l, float r|Sets var to the result of l - r. Equiv.: var {{=}} l - r. Interchangeable with isub.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmul|0x0016 (22)|int &var, float l, float r|Sets var to the result of l * r. Equiv.: var {{=}} l * r. Interchangeable with imul.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fdiv|0x0017 (23)|int &var, float l, float r|Sets var to the result of l / r. Equiv.: var {{=}} l / r. Interchangeable with idiv.}}<br />
{{User:Mddass/ECL_TABLE_ROW|fmod|0x0018 (24)|int &var, float l, float r|Sets var to the result of l % r (IEEERemainder). Equiv.: var {{=}} IEEERemainder(l, r). Interchangeable with imod.}}<br />
{{User:Mddass/ECL_TABLE_ROW|atan2|0x0019 (25)|int &var, float ox, float oy, float tx, float ty|Sets var to the result of atan2(tx - ox, ty - oy). Effectively gives the angle towards tx,ty with ox,oy as the origin.}}<br />
{{User:Mddass/ECL_TABLE_ROW|norm_r|0x001A (26)|int &var|Normalizes var into a value that's within the (-pi, pi) range. var will be reduced by 2*pi until it is within that range if it is greater than pi, or incresed by 2*pi until it is within that range if it is lower than pi.}}<br />
{{User:Mddass/ECL_TABLE_ROW|itest|0x001B (27)|int a, int b|Compares a with b (integer values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|ftest|0x001C (28)|float a, float b|Compares a with b (floating-point values). The result will be stored in the enemy's comparison register. The result is -1 if a < b, 0 if a {{=}}{{=}} b or 1 if a > b.}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_l|0x001D (29)|int t, int cp|If the comparison register is -1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_le|0x001E (30)|int t, int cp|If the comparison register is -1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_e|0x001F (31)|int t, int cp|If the comparison register is 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_g|0x0020 (32)|int t, int cp|If the comparison register is 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_ge|0x0021 (33)|int t, int cp|If the comparison register is 1 or 0, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|jmp_n|0x0022 (34)|int t, int cp|If the comparison register is -1 or 1, sets current time to t and sets the current seek offset in this function to cp.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call|0x0023 (35)|int func, int iarg, float farg|Copies variables -10001 to -10012 to backup registers and calls function func. Also, -10001 is set to iarg and -10005 is set to farg.}}<br />
{{User:Mddass/ECL_TABLE_ROW|return|0x0024 (36)|void|Returns to the parent function and copies variables -10001 to -10012 from the backup registers. Crashes the game if there is no parent function.}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_l|0x0025 (37)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a < b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_le|0x0026 (38)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a <{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_e|0x0027 (39)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a {{=}}{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_g|0x0028 (40)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a > b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_ge|0x0029 (41)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a >{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|call_n|0x002A (42)|int func, int iarg, float farg, int a, int b|Runs call(func, iarg, farg) if a !{{=}} b.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|pos|0x002B (43)|float x, float y, float z|Sets the enemy position accordingly.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x002C (44)|float a, float b, float c|Unknown. Sets 3 values in the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|dir|0x002D (45)|float r, float s|Sets enemy movement direction to r and movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot|0x002E (46)|float r|Sets enemy movement direction acceleration to r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|spd|0x002F (47)|float s|Sets enemy movement speed to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|acc|0x0030 (48)|float s|Sets enemy movement speed acceleration to s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r|0x0031 (49)|float min, float max|Sets enemy movement direction to a value in the range [min, max). {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_r2|0x0032 (50)|float min, float max|Sets enemy movement direction to a value in the range [min, max), according the enemy clip. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|rot_aim|0x0033 (51)|float r, float s, float t|Sets enemy movement direction towards the player (+ r) with speed s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec|0x0034 (52)|int t, float r, float s|Moves in a decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_dec2|0x0035 (53)|int t, float r, float s|Moves in a quickly-decelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc|0x0036 (54)|int t, float r, float s|Moves in a accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_acc2|0x0037 (55)|int t, float r, float s|Moves in a quickly-accelerating fashion with direction r, speed s and for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_lin|0x0038 (56)|int t, float x, float y, float z|Moves in a linear fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec|0x0039 (57)|int t, float x, float y, float z|Moves in a decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_dec2|0x003A (58)|int t, float x, float y, float z|Moves in a quickly-decelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc|0x003B (59)|int t, float x, float y, float z|Moves in a accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_pt_acc2|0x003C (60)|int t, float x, float y, float z|Moves in a quickly-accelerating fashion towards x,y,z in t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec|0x003D (61)|int t|Moves in a decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_dec2|0x003E (62)|int t|Moves in a quickly-decelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc|0x003F (63)|int t|Moves in a accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|it_t_acc2|0x0040 (64)|int t|Moves in a quickly-accelerating fashion for t frames.}}<br />
{{User:Mddass/ECL_TABLE_ROW|clip|0x0041 (65)|float x1, float y1, float x2, float y2|Confines enemy movement to the defined rectangle. {{User:Mddass/GAME_COLOR_TEXT|Does not read variables.|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|unclip|0x0042 (66)|void|Disables enemy movement boundaries.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan_aim|0x0043 (67)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 0 (aimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_fan|0x0044 (68)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 1 (unaimed fan), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per bullet to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir_aim|0x0045 (69)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 2 (aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir|0x0046 (70)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 3 (unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2_aim|0x0047 (71)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 4 (offset aimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim offset to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_cir2|0x0048 (72)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 5 (offset unaimed circle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_r|0x0049 (73)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 6 (random angle), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, base speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random_sp|0x004A (74)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 7 (random speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, aim to r1, aim variance per layer to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on_random|0x004B (75)|short spr, short col, int amt1, int amt2, float sp1, float sp2, float r1, float r2, int flag|Sets bullet attributes. Sets type to 8 (random angle speed), bullet sprite and type (hitbox) to spr, bullet color to col, amount per layer to amt1, amount of layers to amt2, maximum speed to sp1, minimum speed to sp2, maximum direction to r1, minimum direction to r2 and bullet flags to flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto|0x004C (76)|int t|Sets the interval between automatic shooting to t. Zero disables automatic shooting.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_auto_delay|0x004D (77)|int t|Sets the interval between automatic shooting to t and delays the first shot by a random value in the range [0, t). Zero disables automatic shooting.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_delay|0x004E (78)|void|Sets it so setting bullet atributes does not automatically shoot.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_on|0x004F (79)|void|Sets shoot flag.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0050 (80)|void|Unused. Immediately shoots a bullet at a point previously-specified by et_ofs?}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ofs|0x0051 (81)|float x, float y, float z|Sets bullet shooting offset relative to self.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_ex|0x0052 (82)|int a, int b, int c, int d, float r, float s, float m, float n|Sets extra bullet attributes, used in conjuction with bullet flags.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_clear|0x0053 (83)|void|Clears all bullets and turns them into star items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_se|0x0054 (84)|int a|Sets bullet sound effect to a. Bullet flag 0x200 (512) must be set for this to work.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on|0x0055 (85)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots a laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_on_aim|0x0056 (86)|short spr, short col, float r, float sp, float start_ofs, float end_ofs, float start_len, float w, int start_t, int t, int stop_t, int graze_delay, int graze_tol, int unk|Shoots an aimed laser with the specified attributes and stores it in a specified index (see laser_id).}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_id|0x0057 (87)|int i|Sets the index where shot lasers are stored. Defaults to 0. Valid values are 0 to 31.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_rot|0x0058 (88)|int i, float r|Rotates the specified laser by r.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_acc|0x0059 (89)|int i, float s|Accelerates the specified laser by s.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_ofs|0x005A (90)|int i, float x, float y, float z|Offsets the specified laser by x,y,z.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x005B (91)|int i|Unused. Toggles some (unused?) laser property of laser <code>id</code>.}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_break|0x005C (92)|int i|Instantly cancels out the specified laser and turns it into star bullets.}}<br />
{{User:Mddass/ECL_TABLE_ROW|card|0x005D (93)|short face, short card_id, char* name|Begins a spellcard. Increases attempt count by 1, decodes name and sets it as the spellcard name, changes background, displays a portrait face, sets damage reduction to 8x, clears all bullets and calls et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0).}}<br />
{{User:Mddass/ECL_TABLE_ROW|card_end|0x005E (94)|void|Ends the spellcard. Clears all bullets, removes spellcard text, restores background, restores damage reduction and gives spellcard and cancel bonuses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_new|0x005F (95)|int func, float x, float y, float z, short life, short item, int score|Spawns an enemy func at x,y,z. Sets its life to life, item reward on kill to item and score reward on kill to score.}}<br />
{{User:Mddass/ECL_TABLE_ROW|enm_clear|0x0060 (96)|void|Kills all enemies, except for untargetable ones or bosses.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at|0x0061 (97)|int id|Runs an anm script on the enemy. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_move|0x0062 (98)|short default, short far_left, short far_right, short left, short right, short padding|Sets the various anm script IDs for varying stages of enemy movement.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at2|0x0063 (99)|int slot, int id|Runs an anm script on the enemy in slot slot. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_at_dead|0x0064 (100)|int id|Sets the anm script ID to run on death. TBD}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_set|0x0065 (101)|int id|Sets the boss ID for this enemy. Will also enable boss health bar and other things when set to a value other than -1, which disables everything again. Defaults to -1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_card|0x0066 (102)|int id, float x_rot, float y_rot, float z_rot, float dist|Creates a spinning card graphic around the enemy with the corresponding settings.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hitbox_set|0x0067 (103)|float w, float h, float d|Sets the enemy hitbox.}}<br />
{{User:Mddass/ECL_TABLE_ROW|hit_set|0x0068 (104)|int a|Toggles enemy contact with the player. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|hurt_set|0x0069 (105)|int a|Toggles enemy damage. Only the LSB is checked!}}<br />
{{User:Mddass/ECL_TABLE_ROW|se_play|0x006A (106)|int se|Plays a sound effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|flag_death_set|0x006B (107)|int flag|Sets death flags. 0-7 are valid values.}}<br />
{{User:Mddass/ECL_TABLE_ROW|death_at|0x006C (108)|int func|Sets the function to call on death.}}<br />
{{User:Mddass/ECL_TABLE_ROW|var_set|0x006D (109)|int a, int i|Writes a value a into a variable the variable pool with index i.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x006E (110)|int a|Unknown. Does various modifications to the enemy.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_set|0x006F (111)|int l|Sets the enemy life and max life to l.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_set|0x0070 (112)|int t|Sets the current timeout time to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at_amt|0x0071 (113)|int l|Sets the life to trigger life_at at.}}<br />
{{User:Mddass/ECL_TABLE_ROW|life_at|0x0072 (114)|int func|Sets the function to call when life reaches an amount determined by life_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at_amt|0x0073 (115)|int t|Sets the time at which time_at will trigger.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_at|0x0074 (116)|int func|Sets the function to call when timeout time reaches an amount determined by time_at_amt.}}<br />
{{User:Mddass/ECL_TABLE_ROW|invinc_set|0x0075 (117)|int a|Toggles enemy invincibility. Invincible enemies cannot be hurt, touched, cleared or targeted.}}<br />
{{User:Mddass/ECL_TABLE_ROW|eff_at|0x0076 (118)|int func, int amt, int col|Spawn a particle effect.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop|0x0077 (119)|int amt|Drops amt items around the enemy. Drops power items if not at max power, else drops point items.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_rot_set|0x0078 (120)|int a|Toggles whether the enemy graphic will rotate according the enemy's angle.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_call|0x0079 (121)|int func, int param|Immediately calls a function from a set of hardcoded functions with parameter param.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_set|0x007A (122)|int func|Sets a function to call every frame from a set of hardcoded functions. Function -1 will disable this.}}<br />
{{User:Mddass/ECL_TABLE_ROW|func_time_set|0x007B (123)|int t|Sets the current time variable in this function to t.}}<br />
{{User:Mddass/ECL_TABLE_ROW|item_drop2|0x007C (124)|int item|Drops a specific item at the enemy's position.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007D (125)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|boss_lives_set|0x007E (126)|int a|Sets the amount of "lives" a boss has. Not automatically decremented!}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x007F (127)|int a|Unknown debug operation.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break|0x0080 (128)|int a|Terminates the current enemy graphic if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW|anm_break2|0x0081 (129)|int slot, int a|Terminates the current enemy graphic in slot slot if a & 1.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0082 (130)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|et_diff_set|0x0083 (131)|float sp_l, float sp_h, float amt_l, float amt_h, float auto_l, float auto_h|Sets the influence of difficulty (rank) on bullets. Default is et_diff_set(-0.5f, 0.5f, 0, 0, 0, 0). Resets to default when a spellcard begins.}}<br />
{{User:Mddass/ECL_TABLE_ROW|inv_set|0x0084 (132)|int a|Toggles enemy invisibility.}}<br />
{{User:Mddass/ECL_TABLE_ROW||0x0085 (133)|void|Unknown.|color={{User:Mddass/GAME_COLOR|text|6}}|bgcolor={{User:Mddass/GAME_COLOR|bg|6}}}}<br />
{{User:Mddass/ECL_TABLE_ROW|laser_clear|0x0086 (134)|void|Clears all 32 laser pointers.}}<br />
{{User:Mddass/ECL_TABLE_ROW|time_card_set|0x0087 (135)|int a|Toggles survival spellcard.}}<br />
|-<br />
|}<br />
</div><br />
<br />
==== Extra Bullet Functions (et_ex) ====<br />
These are tables for the extra functions bullets can have, along with the variables that can be used with them and a description of them. Note that you can mix and match as many flags as you want in order to get multiple effects by ORing them together, though certain games might only allow you to set a certain number of attributes.<br />
<br />
<div style="font-family:monospace;font-size:14px;"><br />
{| border="1"<br />
|-<br />
! style="background-color:papayawhip" rowspan="2"|Flag<br />
! style="background-color:papayawhip" colspan="4"|Variables<br />
! style="background-color:papayawhip" rowspan="2"|Description<br />
|-<br />
! style="background-color:papayawhip" |a<br />
! style="background-color:papayawhip" |b<br />
! style="background-color:papayawhip" |r<br />
! style="background-color:papayawhip" |s<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0001 (1)|X|X|X|X|Deceleration effect at the beginning.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0002 (2)|X|X|X|X|Spawn effect 1 (short).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0004 (4)|X|X|X|X|Spawn effect 2 (medium).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0008 (8)|X|X|X|X|Spawn effect 3 (long).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0010 (16)|O|X|O|O|Accelerate towards direction s (-999 for current direction) with speed r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0020 (32)|O|X|O|O|Increase speed by s and direction by r for a frames.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0040 (64)|O|O|O|O|Stop in a frames, then change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0080 (128)|O|O|O|O|Stop in a frames, then aim at the player and change angle by r and set speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0100 (256)|O|O|O|O|Stop in a frames, then set direction to r and speed to s (-999 to keep previous speed). Do this b times.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0200 (512)|X|X|X|X|Play a sound when shot.}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0400 (1024)|O|X|O|X|Make bullet bounce on all 4 walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x0800 (2048)|O|X|O|X|Make bullet bounce on all non-bottom walls up to a times and set speed to r on contact (-999 to keep previous speed).}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x1000 (4096)|X|X|X|X|Unknown. Used by hardcoded function 4.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
{{User:Mddass/ECL_ET_EX_TABLE_ROW_SMALL|0x2000 (8192)|O|X|X|X|Set off-screen immunity for a frames.|color={{User:Mddass/GAME_COLOR|text|7}}|bgcolor={{User:Mddass/GAME_COLOR|bg|7}}}}<br />
|-<br />
|}<br />
</div><br />
<br />
(th06) The address of the ECL::RunInstruction function is located at Rx74A0 and return type is a byte type.<br />
<br />
==== Hardcoded Functions (func_call and func_set) ====<br />
These are tables for the hardcoded functions that can be used for each game. Note that functions that do not need "param" to be set can still be run through func_call.<br />
<br />
===== th06 (EoSD) =====<br />
<div style="font-family:monospace;font-size:12px;"><br />
{| border="1"<br />
|-<br />
!ID<br />
!Needs param?<br />
!Description<br />
|-<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|-1|No|Null pointer. Used to reset func_set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|0|Yes|If param is 0, then freeze all bullets in place and change their color to 15. If param is 1, then change every bullet's color to 15 and simulate et_ex(220, -1, -1, -1, 0.01f, -999.0f, -1.0f, -1.0f) with flag 0x10 set.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|1|Yes|Casts param to float, sets bullet offset to a random point in a param x param area around the enemy and then shoots.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|2|No|Sets variables -10002, -10003 and -10004 respectively according to the shot type:<br/>- [0, 3, 1] if ReimuA.<br/>- [2, 3, 4] if ReimuB.<br/>- [1, 4, 0] if MarisaA.<br/>- [4, 2, 3] if MarisaB.}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|3|No|}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|4||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|5||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|6||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|7||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|8||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|9||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|10||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|11||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|12||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|13||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|14||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|15||}}<br />
{{User:Mddass/ECL_FUNC_TABLE_ROW|16||}}<br />
|}</div>Mddass