4坐发射子弹 抽奖界面打开关闭
This commit is contained in:
@@ -4036,7 +4036,10 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
sitPos = SeatMirror.ToServer(currSitData.posID),
|
||||
frameType = FrameDataType.rotateTurrect,
|
||||
time = BeijingTimeManager.Instance.CurrentTimestampMs,
|
||||
frameData = new FrameData_Rotate { angle = angle }
|
||||
// ⭐ 座位镜像:网络角度统一用"源角度"(下方座位系,0=朝桌面中心)。
|
||||
// 本地玩家永远显示在下方座位(IsFlipped=false),这里实际是原值;
|
||||
// 保留转换以兼容未来本地座位可能在上方的情况
|
||||
frameData = new FrameData_Rotate { angle = SeatMirror.WorldAngleToSource(angle, currSitData.IsFlipped) }
|
||||
};
|
||||
WebSocketSendList.SyncGameData(sgd);
|
||||
}
|
||||
@@ -4045,7 +4048,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
var fireData = new FrameData_FireBullet
|
||||
{
|
||||
angle = angle,
|
||||
// ⭐ 座位镜像:网络角度统一用"源角度"(下方座位系),接收端按显示座位还原
|
||||
angle = SeatMirror.WorldAngleToSource(angle, currSitData.IsFlipped),
|
||||
gold = currSitData.goldNum,
|
||||
isSanShe = isSanShe,
|
||||
twoRTruuect = isDouble,
|
||||
@@ -4191,7 +4195,10 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (sit != null && sit.isBot && currSitData == SitPosData.roomOwnerSit) return;
|
||||
|
||||
var data = FrameDataParser.Parse<FrameData_Rotate>(sync.frameData);
|
||||
SmoothRotate(sit, data.angle);
|
||||
// ⭐ 座位镜像:网络角度是"源角度"(发送方下方座位系,0=朝桌面中心),
|
||||
// 按该座位在本端场景的显示位置还原成世界角度:
|
||||
// 显示座位在下方 → 原样;在上方 → 180−源角度(上下翻转,左右不反)
|
||||
SmoothRotate(sit, SeatMirror.SourceAngleToWorld(data.angle, sit.IsFlipped));
|
||||
}
|
||||
|
||||
public void SyncGameData_FireBullit(FireCannonSendData sync)
|
||||
@@ -4225,7 +4232,10 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
SitPosData sit = list_Sits.Find(s => s.user == sync.userId);
|
||||
if (sit == null) return;
|
||||
|
||||
float angle = botLastAngle.TryGetValue(sync.userId, out float a) ? a : sit.currentAngle;
|
||||
// ⭐ 座位镜像:botLastAngle/botLastFireData 缓存的是"源角度"(下方座位系);
|
||||
// 真人兜底用 sit.currentAngle(本端世界角度,无需转换)
|
||||
bool angleFromBotMemory = botLastAngle.TryGetValue(sync.userId, out float a);
|
||||
float angle = angleFromBotMemory ? a : sit.currentAngle;
|
||||
if (sync.bulletIds == null || sync.bulletIds.Count == 0) return;
|
||||
|
||||
// ⭐ 优先用服务器广播的 sync.isBot 标记判断是否机器人
|
||||
@@ -4233,9 +4243,17 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
bool isBot = sync.isBot || sit.isBot;
|
||||
if (isBot && botLastFireData.TryGetValue(sync.userId, out var fireData))
|
||||
{
|
||||
FireBullet(sit, angle, fireData.isSanShe, fireData.twoRTruuect,
|
||||
// ⭐ 座位镜像:源角度按该 bot 显示座位还原成世界角度再创建子弹
|
||||
FireBullet(sit, SeatMirror.SourceAngleToWorld(fireData.angle, sit.IsFlipped),
|
||||
fireData.isSanShe, fireData.twoRTruuect,
|
||||
fireData.isSuoDing, sync.bulletIds, fireData.monsterIDs, bulletGolds);
|
||||
}
|
||||
else if (angleFromBotMemory)
|
||||
{
|
||||
// bot 有角度缓存但无完整开火数据 → 同样按源角度转换
|
||||
FireBullet(sit, SeatMirror.SourceAngleToWorld(angle, sit.IsFlipped),
|
||||
false, false, false, sync.bulletIds, null, bulletGolds);
|
||||
}
|
||||
else
|
||||
{
|
||||
FireBullet(sit, angle, false, false, false, sync.bulletIds, null, bulletGolds);
|
||||
@@ -4253,7 +4271,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
return;
|
||||
}
|
||||
var targetSit = list_Sits[dispPos];
|
||||
FireBullet(targetSit, data.angle, data.isSanShe, data.twoRTruuect, data.isSuoDing, sync.bulletIds, data.monsterIDs, bulletGolds);
|
||||
// ⭐ 座位镜像:网络角度是"源角度"(发送方下方座位系),按该座位显示位置还原成世界角度
|
||||
FireBullet(targetSit, SeatMirror.SourceAngleToWorld(data.angle, targetSit.IsFlipped),
|
||||
data.isSanShe, data.twoRTruuect, data.isSuoDing, sync.bulletIds, data.monsterIDs, bulletGolds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -5076,7 +5096,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
botIdleTimer[sit.posID] = 0f;
|
||||
|
||||
float angle = sit.currentAngle;
|
||||
botLastAngle[sit.user] = angle;
|
||||
// ⭐ 座位镜像:bot 角度缓存统一存"源角度"(下方座位系),与网络帧格式一致
|
||||
botLastAngle[sit.user] = SeatMirror.WorldAngleToSource(angle, sit.IsFlipped);
|
||||
|
||||
bool isSanShe = (skill != null && skill.tripleActive) || mode == BotBehaviorMode.ScatterMode || mode == BotBehaviorMode.ScatterRandom;
|
||||
bool isDouble = skill != null && skill.doubleActive;
|
||||
@@ -5098,7 +5119,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
|
||||
botLastFireData[sit.user] = new FrameData_FireBullet
|
||||
{
|
||||
angle = angle,
|
||||
// ⭐ 座位镜像:存"源角度"(下方座位系),房主自己收到广播回放时同样按源角度转换
|
||||
angle = SeatMirror.WorldAngleToSource(angle, sit.IsFlipped),
|
||||
gold = gold,
|
||||
isSanShe = isSanShe,
|
||||
twoRTruuect = isDouble,
|
||||
@@ -5378,7 +5400,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
sitPos = SeatMirror.ToServer(botSit.posID),
|
||||
frameType = FrameDataType.rotateTurrect,
|
||||
time = BeijingTimeManager.Instance.CurrentTimestampMs,
|
||||
frameData = new FrameData_Rotate { angle = angle }
|
||||
// ⭐ 座位镜像:房主代算的 bot 角度是世界角度(按 bot 显示座位算的),
|
||||
// 先转成统一的"源角度"(下方座位系)再广播,接收端按各自显示座位还原
|
||||
frameData = new FrameData_Rotate { angle = SeatMirror.WorldAngleToSource(angle, botSit.IsFlipped) }
|
||||
};
|
||||
WebSocketSendList.SyncGameData(sgd);
|
||||
}
|
||||
@@ -5447,7 +5471,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
var fireData = new FrameData_FireBullet
|
||||
{
|
||||
angle = angle,
|
||||
// ⭐ 座位镜像:网络角度统一用"源角度"(下方座位系),接收端按显示座位还原
|
||||
angle = SeatMirror.WorldAngleToSource(angle, botSit.IsFlipped),
|
||||
gold = gold,
|
||||
isSanShe = isSanShe,
|
||||
twoRTruuect = isDouble,
|
||||
|
||||
Reference in New Issue
Block a user