<style>
.markdown-body {
max-width: 1280px;
}
.blue {
color: blue ;
}
</style>
---
title: '海盜魚王架構調整'
---[TOC]
# 口述規格
- [x] 陣型魚 BOSS 或藏寶圖要出時, 做個Count延遲3秒才送出, 讓Client端可以消化完原本要表演的東西
- [x] 一般魚轉陣型魚時 會先waitting 3秒,
- [ ] 一般魚轉陣型魚時 rand 全新不重複的BG, 要出陣型魚瞬間 clean產魚資料, 在開始生魚
# 海盜魚王 預計拆出的項目
1
2
3
4
## 封包格式
封包=FISH_APPEAR
| 欄位名稱 | 資料型態 | 內容 |
| -------- | -------- | -------- |
| fish_id | int | 魚的流水ID |
| data_id | int | 魚的腳本 data_id |
| fish_kind | string | 魚種 |
| clear_time | int | 銷毀時間 |
| speed | int | 速度 |
| sub_id | int | 魚群用ID |
| path_id | int | 游動路徑Id |
``` json
scriptFishData= {
fish_id: 59,
data_id: 5,
fish_kind: 'F',
time: 23,
clear_time: 0,
speed: 111,
sub_id: 0,
path_id: 1042
}
```
## 產魚邏輯
### 讀取產魚腳本
### 產生魚
每秒呼叫 bill 得產魚物件
他會生產出產魚data
fishId
fishDataId
clean_time
收到後存起來
廣播給client
### 收集藏寶圖
### 銷毀魚
clean_time 到了後, 銷毀魚
### 取得魚的賠倍相關資訊
## 水池
## 子彈管理和道具管理
## 關卡Stage管理器?
## TableGameLogic 邏輯物件
把所有關卡流程控制 存放於此
TableGameLogic(遊戲實際流程和邏輯的物件) 說明
| 欄位名稱 | 資料型態 | 細節 | 內容 |
| -------- | -------- | -------- |-------- |
| theme | Obj | this.theme = theme | 關卡描述物件 |
| gameStatus | int | this.gameStatus = STATUS_WAIT_PLAY | 遊戲狀態 1:遊戲中 2:押注時間 3:新局 4:等待展演轉場表演 |
| betTime | int | this.betTime = 300 | 押注時間 |
| showTime | int | this.showTime = 3 | 展演時間, 目前三秒 |
| maxLaserGun | Obj | this.maxLaserGun = this.theme.Controll_Value.Laser_max_execute_rate | 雷射砲啟動倍數上限 |
| laserGunRate | Obj | this.laserGunRate = this.theme.Controll_Value.Laser_pool_ratio | 雷射砲抽取%數 |
| poolProb | Obj | this.poolProb = this.theme.Controll_Value.All_pool_rate | 進水量 |
| normalPoolRate | Obj | this.normalPoolRate = this.theme.Controll_Value.Normal_pool_rate | 一般水池%數 |
| armsPoolRate | Obj | this.armsPoolRate = this.theme.Controll_Value.Weapon_pool_rate | 特殊武器水池%數 |
| maxWin | Obj | this.maxWin = this.theme.Controll_Value.Max_win | 最大贏分限制 |
| betRange | Obj | this.betRange = this.theme.Bet_Ratio[lobbyId.toString()] | 注碼範圍 |
| betHitValue | Obj | this.betHitValue = this.theme.Bet_Hit_Value[lobbyId.toString()] | 注碼對應魚量 |
| lockState | bool | this.lockState = false | Table上鎖狀態(若上鎖中,不分配玩家進入此桌)(BOSS出場,海盜船出場都會上鎖)(放在gameTable那一層?) |
| leaveLockState | bool | this.leaveLockState = false | 最後一個玩家離開時的上鎖狀態(放在gameTable那一層?) |
| fishIdCount | int | this.fishIdCount = 0 | 魚ID Count計數器 |
| gameMode | int | this.gameMode = NORMAL_MODE | 遊戲模式 1:普通 2:陣型 3:海盜船 |
| gameNextMode | int | this.gameNextMode = 0 | 下一局遊戲模式 |
| gameMap | Obj | this.gameMap = parseInt(Math.random() * this.theme.BG_Control.formation.BG_count + 1) | 遊戲地圖 |
| gameNextMap | Obj | this.gameNextMap = 0 | 下一局遊戲地圖 |
| gmaeSong | Obj | this.gmaeSong = parseInt(Math.random() * this.theme.BG_Control.formation.BGM_count + 1) | 遊戲音樂 |
| gameNextSong | int | this.gameNextSong = 0 | 下一局遊戲音樂 |
| gameModeCount | int | this.gameModeCount = 0 | 局數計數 |
| bossEndTime |int | this.bossEndTime = 0 | BOSS結束時間 |
| bossCome | bool | this.bossCome = false | BOSS出現 |
| onRunTimer | Obj | this.onRunTimer = null | 遊戲計時器 |
| | | | |
| runCount | int | this.runCount = 1 | timer count |
| fishScriptTime | int | this.fishScriptTime = 0 | 出魚腳本timer count的最大值 |
| fishScript | Obj | this.fishScript = {} | 出魚腳本 |
| fishScriptWithTime | Obj | this.fishScriptWithTime = {} |出魚腳本ID對應上的時間 |
| allDeadFish | Obj | this.allDeadFish = {} | 全部死魚物件 |
| bossScript | Obj | this.bossScript = {} | boss腳本物件 |
| | | | |
# theme.json 異動
```
Doll_Data 是 用來 描述三個保底物件
滿足保底條件就送錢
doll_count = 30 收集滿30個
doll_personal_pay_rate
"//_comment5": "掉落收集物類型",
"DROP_MONKEY": 1, // 猴子
"DROP_PEGUIN": 2, // 企鵝
"DROP_SHARK": 3, // 鯊魚
```
# 待辦事項
## 寫賽果從延遲改成及時寫入 (2020/2/4)
## 離開遊戲延遲機制待討論 (2020/2/4)