C .
ODE
G
AMELET
# TwilightWarsLib A Top-down view shooting game framework. ## Getting Started These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. To start a .event ```typescript CG.TwilightWarsLib.initialize() .then(() => { CG.TwilightWarsLib.events.startEvents('test/test.events', 'arena'); }) ``` To manually setup the game: ```typescript CG.TwilightWarsLib.initialize() .then(() => let mapSource = 'test/test.twmap'; CG.Base.resourceManager.addAppSource(mapSource); CG.Base.resourceManager.load(() => { let mapResource = new CG.TWMap.resources.MapResource(); mapResource.importBase64(CG.Base.resourceManager.getText(mapSource)); mapResource.loadTextures(() => { CG.Base.pixi.initialize(600, 500); let game = new CG.TwilightWarsLib.games.Game(); CG.Base.pixi.root.addChild(game); game.initResources(mapResource); game.start(); console.log('tw game created'); let me = new CG.TwilightWarsLib.games.actors.Actor(game, 'me'); game.addActor(me, new MyActorController(me), 32, 100, 0, null); game.gameCamera.setFocus(me); game.interface.setMe(me); let ai = new CG.TwilightWarsLib.games.actors.Actor(game, 'ai'); ai.camp = CG.TwilightWarsLib.games.datas.Camp.CAMP2; ai.actorClip.headClip.clip.gotoAndStop(5); game.addActor(ai, new CG.TwilightWarsLib.games.actors.controllers.AIController(ai), 160, 300, 0, null); game.createStuff(null, 64 + 16, 128 + 16, CG.TwilightWarsLib.games.items.StuffInfo.getByCode('sword'), game.stuffManager.useNextStuffId(), true); }); }); }) ``` ## Versioning We use [SemVer](http://semver.org/) for versioning. ## Authors * **[Haskasu](/profile/Haskasu)** ## Acknowledgments * Hat tip to anyone who's code was used * Inspiration * etc
# Base2 重新架構的Base2,相比Base少了很多功能,包括Pixi/Sound/ResourceManager/Physics/geoms都被拿掉,只留最主要的CG功能。 ## 基本功能 1. 取得專案的資料 ```typescript // 取得專案代碼 CG.Base2.projectCode; // 取得資源 CG.Base2.getAppResource(resourceAlias: string) // 取得資源網址 CG.Base2.getAppResourceFileUrl(resourceAlias: string, filename?: string) ``` ## 更新循環 Base2內建了一個更新循環系統。 ```typescript // 先定義一個每幀都要更新的函式 function updateFunc(dt: number) { } // 將函式加入更新循環系統 CG.Base2.addUpdateFunction(updateFunc); // 將函式移出更新循環系統 CG.Base2.removeUpdateFunction(updateFunc); ``` 另外也提供子更新循環系統可使用。 ```typescript import Updater = CG.Base2.utils.Updater; // 先定義一個每幀都要更新的函式 function updateFunc(dt: number) { } // 建立子更新循環系統 let updater = new Updater(); // 將函式加入更新循環系統 updater.addDelayFunction(updateFunc); // 可暫停 updater.pause(); // 可繼續 updater.resume(); ``` ## 鍵盤管理員 Base2提供了一個基本的鍵盤管理員,可以在按鍵被按下去(DOWN)、提起來(UP)、先按再提(PRESSED)的時候觸發事件。 ```typescript // 取得鍵盤管理員 import Keyboard = CG.Base.keyboards.Keyboard; import keyboard = CG.Base2.keyboard; import Key = CG.Base2.keyboards.Key; // 鍵盤事件 keyboard.on(Keyboard.EVENT.DOWN, (event: KeyboardEvent) => { if (Key.SPACE.matchEvent(event)) { // 當空白鍵被按下去的時候... } }) // 檢查目前按鍵狀態 if (keyboard.isDown(Key.SPACE)) { // 目前空白鍵是正在按下去的狀態 } ``` ## 補間變化 Base2內建了[tweenjs](https://github.com/tweenjs/tween.js)用來將某個物件的屬性,在一段時間內作動態的變化。 ```typescript async function makeAnimation() { // 建立一隻有x,y資料的動物 let animal = { x: 100, y: 100, }; // 建立補間變化,在1秒內讓動物的x和y變化到指定的值 let tween = new TWEEN.Tween(animal); tween.to( { x: 300, y: 200, }, 1000 // 毫秒 ); tween.start(); // 等待變化完畢 await CG.Base2.waitTween(tween); console.log(animal.x); // 這時會印出 300 } ``` ## JSZip Base2內建[JSZip](https://stuk.github.io/jszip/)。 ```typescript async function loadZip() { let zip = new JSZip(); await zip.loadAsync(buffer); for(let filename in zip.files) { ... } } ```
# GLT One Paragraph of the game description goes here ## Getting Started ### Auth (Login) ```typescript // All action must wait until auth system is ready. CG.GLT.auth.onReady(user => { if(user.isLocalGuest()) { // not login yet } else { // logged in user } }); // auth event listener, triggered when auth user changed let authListener = CG.GLT.auth.onAuth(user => { if(user.isLocalGuest()) { // logged out } else { // logged in user } }); // auth event listener, triggered when validating a new auth action // a following onAuth event is expected. this.validatingListener = onAuthValidating(() => { // show loading animation }); ``` ### API The CG.GLT.api is responsible to communicate with glt.gamelet.online. CG.GLT.commands includes all comments to query/submit data from glt.gamelet.online. The commands has a function submit() that uses CG.GLT.api.submitCommand(), so most of the time, you don't need to call the api to submit. ```typescript CG.GLT.commands.scoreService.submitScore( 'challenge', // the name of the score to submit 10, // the score SubmitType.KEEP_HIGHEST, // submit only when the new score is greater than the one on server TimeRange.ALL // submit to all time-ranges (history and weekly) ) .submit(); // to receive the weekly high score list CG.GLT.commands.scoreService.listScores( 'challenge', // the name of the scores to get TimeRange.WEEKLY, // in which time range OrderType.HIGH_TO_LOW, // how to order the scores CG.GLT.api.lastUpdatedServerTimestamp, // tell the server which week to see 0, // start index 10, // how many to get (list: UserScoreList) => { // do something with the scorelist }, (error) => { // deal with error } ) ``` ## Authors **[Haskasu](/profile/113321052805704333314@google)**
# EnhServer 為了解決一些CG功能上的缺失,故實作此Lib。 包含變數無法跨專案使用,以及無法跨專案實作大聊天室。 (可能只是不知道方法) 未來將會逐步補上缺失的功能,範例後端請參照[此Github repo](https://github.com/setsuk1/EnhServer-monorepo),歡迎發起PR。 以及可以加入[Discord群組](https://discord.gg/seJwuzCbWq)一起討論,並共同討論功能方向。 初期可能不穩定,建議自建Server。 **且安全性並非此Lib的第一考量,此Lib主要是作為補充功能使用。** ## 如何使用 主要是透過下列方法進行初始化: ```typescript server.initialize(options) ``` options部分為可選選項,若參數為空則預設連線至Enh之後端伺服器。 預設狀態本模組會export一個server物件提供操作,若是希望使用多個instance,僅須透過下列方法: ```typescript const customServer = new EnhServer(); customServer.initialize(options); ``` 之後透過下列方式取得一對一傳訊的資料: ```typescript let context = { handler(data: any, senderCode: string) { console.log(data); } } server.msgManager.on(UserEventList.MSG.UNICAST, context.handler, context); ``` --- ## 呼叫功能 作為範例,下面舉出廣播至全體的功能如何使用: ```typescript let cmd = new Command(SocketEventList.USER, new BroadcastToAllEvent({ data: "Hi there." })); server.sendCommand(cmd); ``` 由此便可送出"Hi there."訊息到Server上的所有使用者。 至於其餘功能目前尚未確定如何說明,待補。 ## Authors **[EnhProject](/profile/EnhProject)** - **[不會取名字](/profile/buhuechuminzu)** - **[雪姬](/profile/setsuki)**
# 花靈宮模組 - 作者 **[妮娜](/profile/LoliPrincessNina)** - 使用此模組為你的專案增加新的陣營和技能 - 注意電腦AI使用技能時有機會比較蠢 - 過快使用技能將會有概率出BUG - 此為測試版本,有BUG很正常 - 查詢及回報請到<b><a href="https://gamelet.online/user/nina/board">我的留言板</a></b> # 說明 - 為了方便各位照搬/測試花靈宮的任務,此處將填上花靈宮裡所有用到的觸發/檢查/動作 - 有相當一部分代碼是來自TwilightWarsEventsExp和CgEventsExp(下方不列出;部分存在變更,與原版有差異) - 若希望使用以上觸發/檢查/動作,請用原版,此處不會有更新 ## 目前提供支援的有: ## 陣營 - 花靈宮 - 盜賊幫 - 無魂軍 - 智械兵團(缺失: 小刀LV2、大刀LV2) <!-- --> ## 觸發 #### 角色 - 角色說話 - 人物受傷(內建排除傷害類型/傷害數值比對) #### 武器道具 - 使用消耗型道具(可儲存道具變數) <!-- --> ## 檢查 #### 技能 - 角色技能狀態 - 手持武器技能 #### 角色 - 角色狀態附加 - 角色面向某物 - 角色燃燒狀態 - 角色B是否角色A的敵人 - 角色是否可直視某點/物 #### 地圖 - 可行走座標 - 兩點之間的距離 #### 存讀 - 儲存變數 - 在陣列中找到字串 - 以符號分離字串 #### 地圖機關 - 燭火機關狀態 - 找出所有地圖機關(迴圈) <!-- --> ## 動作 - 筆記 #### 角色 - 新增角色 - 角色漂浮能力 - 設定角色演員 - 移動角色位置 - 設定角色大小 - 角色可否攻擊 - 角色死亡訊息 - 人物停止說話 - 角色特殊屬性 - 取得玩家陣營演員角色 - 角色醉酒管理 - 角色反彈子彈 - 放下旗幟 - 鎖定面向方向 - 傳送角色加血訊息 - 傳送角色傷害訊息 - 傳送角色閃現至定點訊息 #### 技能 - 角色結束技能 - 限制使用技能 - 設定武器技能 - 傳送技能訊息 - 白鳥拳 - 正/反旋風劈掌 - 千手如來 - 百裂拳 - 元氣玉 #### 任務流程 - 跳出系統訊息 - 更多遊戲規則 - 角色對己說話 - 改變任務代碼 #### 存讀 - 工作階段儲存空間數據庫存取 - 以符號分離字串 - 定義Json變數 - 轉換Json為字串 - 轉換Json為物件 #### 特效 - 聖靈治療特效 - 角色燃燒狀態 - 應用攻擊特效 - 震地特效 - 吸血血刃特效 - 劍氣光彈 - 新增地圖痕跡 - 散發冰氣特效 - 發射火箭 - 快跳文字 - 散發光環特效 - 衝擊波 - 新增地圖動畫 - 擊退人物 - 光印 - 冷卻特效 - 防護罩特效 - 防護罩泡泡特效 - 冰魂護盾特效 - 血滴特效 - 設置自動移除動畫 - 反衝箭 #### 武器道具 - 背包道具設定 - 攜帶式道具設定 - 切換預設武器 - 切換至另一手 - 裝填武器彈藥 - 新增任務道具 - 新增武器道具 - 人物裝備道具 - 人物裝備武器 - 移除武器道具 - 玩家背包道具擁有的數量 #### 地圖 - 隨機可行走座標 #### 隨機 - 隨機設定陣營 - 隨機角色演員 - 隨機使用技能 - 隨機物件代碼 - 隨機字串 - 隨機角色 #### 陣營 - 設定陣營暱稱 - 新增陣營 - 改變陣營色彩風格(4個子項被拆分成2個新動作) #### 地圖機關 - 控制燭火機關 - 新增可推石塊 - 新增告示牌(NPC角色包括同人陣營選項)
# JEventsEXP <table width="100%"> <tr> <th rowspan="2"> <a href="https://discord.gg/UNde4eaGuc" target="_blank"> <img src="https://imgur.com/HDw592N.png" width="110px"> <br> 珍・EventsEXP <br> <a href="https://discord.gg/UNde4eaGuc" class="mat-raised-button mat-primary "> 加入Discord </a> </a> </th> <th> 隨便寫的模組。 </th> <th> A casually written module. </th> </tr> <tr> <td> <pre> # 觸發 珍妮-擴充包/ └── 輸入/ └── 鍵盤序列 # 動作 珍妮-擴充包/ └── 變數/ └── 生成隨機整數陣列 └── 地圖/ └── 迷宮生成 </pre> </td> <td> <pre> # Trigger Jennie-Expansions/ └── Input/ └── Keyboard Sequence # Actions Jennie-Expansions/ └── Variable/ └── Generate Random Integer Array └── Map/ └── Maze Generation </pre> </td> </tr> </table> ## 作者 **[SinB.JN](/profile/108665576516229624668@google)** <details open> <summary> <a class="mat-raised-button mat-primary"> 更新日誌(Changlog) </a> </summary> ## [v0.0.8](/view/JEventsEXP/0.0.8) (2025-05-24) #### 新增 - [觸發]輸入/鍵盤序列 - 當一系列鍵盤按鍵和滑鼠按鍵依序被按下時觸發 #### Added - [Trigger]Input/KeyboardSequence - Trigger when a sequence of keyboard keys and mouse buttons is pressed ## [v0.0.7](/view/JEventsEXP/0.0.7) (2025-05-09) #### 新增 - [動作]地圖/迷宮生成 - 在選定的地圖區域(矩形或圓形)內以1x1物件生成迷宮 #### Added - [Actions]Map/Maze Generation - Generates a maze within a selected map region (rectangle or circle) with 1x1 object ## [v0.0.6](/view/JEventsEXP/0.0.6) (2024-08-31) #### 更改 - [動作]變數/生成隨機整數陣列 - 新增了對數量、最大重複次數和種子參數的變數輸入支持。 - 優化了錯誤處理和無效輸入的提示信息。 #### Changed - [Actions]Variable/Generate Random Integer Array - Added support for variable input for count, max repeats, and seed parameters. - Improved error handling and messaging for invalid inputs. ## [v0.0.5](/view/JEventsEXP/0.0.5) (2024-08-30) #### 更改 - [動作]變數/生成隨機整數陣列 - 新增了使用種子生成隨機數的選項。用戶現在可以選擇是否使用種子,並輸入一個特定的種子值來生成可重現的隨機數序列。 - 優化了用戶界面。 #### Changed - [Actions]Variable/Generate Random Integer Array - Added an option to use a seed for random number generation. Users can now choose whether to use a seed and input a specific seed value to generate reproducible random number sequences. - Improved the user interface. ## [v0.0.4](/view/JEventsEXP/0.0.4) (2024-08-29) #### 錯誤修復 - [動作]變數/生成隨機整數陣列 - 修復了當可用數字少於陣列長度時導致遊戲崩潰的問題。 #### Bug fixed - [Actions]Variable/Generate Random Integer Array - Fixed an issue where the game would crash when the number of usable integers was smaller than the array length. ## [v0.0.1](/view/JEventsEXP/0.0.1) (2024-08-29) #### 新增 - [動作]變數/生成隨機整數陣列 #### Added - [Actions]Variable/Generate Random Integer Array </details>
# EnhBase 此模組的目標為提供一個框架,使得各模組可以透過Socket傳訊、執行特定功能等;同時希望降低各模組的依賴項,將單一模組內容以更細的粒度拆分,需要特定功能時才載入對應之模組。 此模組之更新時間與更新之功能不定,如果有任何新想法,歡迎加入[Discord群組](https://discord.gg/seJwuzCbWq)一起討論。 此模組初期可能會經過大量修改,以確定設計方向,故本模組並不穩定,如想使用請謹慎考慮。 ***建議可以先查看模組測試的部分,其中的unit_test資料夾可以參考,內含檔案同時是範例實作。*** ## 如何使用 可以透過下列程式碼以完成註冊: ```typescript let lib_name: string // 函式庫之名稱 let user: BasicUser<any> = CG.EnhBase.core.libManager.registerLib(lib_name); ``` 欲接受傳入資料,請使用下列程式碼: ```typescript let socket_unique_name: string // 可辨識之Socket名稱 let socket: Socket = user.createSocket(); socket.addHandler("data", function(data, senderCode) { // 處理資料如何使用 }) socket.listen(socket_unique_name); ``` 而欲傳輸資料給目標Socket,請使用下列程式碼: ```typescript let target_socket_name // 目標Socket名稱 socket.send("YOUR_DATA", target_socket_name); ``` --- ## 變數表功能 接續前面,假設已經取得了BasicUser物件,預設該物件會帶有一個變數表,透過下列程式碼存取: ```typescript const varTable = lib.varTable; ``` 預設該變數表會啟用保護功能,禁止外部存取,於v0.0.2引入了保護用的Key,設定為true或false可控制外部是否可存取,未來可能會更動,請謹慎使用。 ```typescript // enable protection varTable.setValue(BaseVariableTable.ABILITYS.PROTECT, true, true); // or varTable.removeValue(BaseVariableTable.ABILITYS.PROTECT) varTable.setValue(BaseVariableTable.ABILITYS.PROTECT, true); // disable protection varTable.removeValue(BaseVariableTable.ABILITYS.PROTECT) // or varTable.setValue(BaseVariableTable.ABILITYS.PROTECT, false, true); ``` 同時,就算沒有LibUser物件,也可以直接利用 ```typescript let varTable = new SimpleVariableTable(); // or (syncable) let varTable = new GenericVariableTable(); ``` 以取得變數表,並透過下列方法將變數表註冊於manager上: ```typescript core.getInstance<VariableTableManager>("VariableTableManager").addVariableTable(varTable); // or core.variableTableManager.addVariableTable(varTable); ``` ## Authors **[EnhProject](/profile/EnhProject)** - [不會取名字](/profile/buhuechuminzu) - [雪姬](/profile/setsuki)
# TwilightWarsEventsExp 本專案為光暈戰記的擴充模組,主要是建立在 **[TwilightWarsLib](/edit/TwilightWarsLib)** 的基礎之上,添加一些小東西。本專案並不包含 **[TwilightWarsEvents](/edit/TwilightWarsEvents)** 模組。 本模組並不會覆蓋原有的動作、檢查,所有本模組新增的檢查、動作等,都會被整合在**光暈戰記 / 擴充包**內,且不會新增任何跟光暈無關的檢查或動作,希望是一個純淨的光暈模組,跟光暈無關的相關事件,有需要的話會在 **[CgEventsExp](/edit/CgEventsExp)** 做更新。 本專案開放查詢原始碼,所有的檢查、動作,皆有在本專案的 **Test** 資料夾內做實際範例,歡迎自行查看使用方法,也歡迎自行進入程式區內,看各個檢查、動作是如何完成。 本人希望弄一個可以讓大家互相交流、維護,甚至更新的這麼一個光暈同人模組,我覺得這樣共同成長,才會讓嘎母變得更成熟,所以如果你有什麼好想法,也都歡迎提供給我。 另外個人創了一個第三方的 **[嘎母討論區(Discord)](https://discord.gg/hZKQzRfPJM)** ,主要是希望大家有一個好的交流平台,可以一起討論一些設計,除了光暈,還有其他非光暈的專案等等,甚至是能夠一起合作,讓作者們有機會推出更多優質的作品。 有任何 BUG 的話都歡迎回報,會盡量在最短的時間內處裡掉。 **[Google 試算表 - 光暈戰記](https://docs.google.com/spreadsheets/d/1kRPdI6caisjZuHJGmCjB3kHBveR2RVAeTJoyCmqOZVs/edit?usp=sharing)** 本專案有些需要查詢的地方,例如武器道具的索引值等等,可以由此試算表查詢。 ## 其他工具 - [ImageIndex 查詢器](https://paint.gamelet.online/?version=0.0.27) ## 作者 **[cook1470](/profile/cook1470)**
ⒸCode.Gamelet.com | Privacy Policy | Terms of Service