1
This commit is contained in:
@@ -1964,52 +1964,26 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ⭐ 三发 + 锁定:每发子弹优先瞄准对应目标,目标不足或失效则按默认角度发射
|
||||
// ⭐ 安全取值:bullitIDs 不足3个时复用最后一个,避免越界
|
||||
string SafeBid(int i) => i < bullitIDs.Count ? bullitIDs[i] : bullitIDs[bullitIDs.Count - 1];
|
||||
|
||||
// ⭐ 正常炮台 三发 + 锁定:三合一打一个——三发子弹(-20/0/+20)全部追踪主锁目标(最老版本行为)
|
||||
// 战神+锁定在上面已提前走 FireLaser(分散打三个),能到这里的一定是正常炮台
|
||||
// 必须保证三发子弹都创建,否则金币消耗和后端对不上
|
||||
if (isSanShe && isLock)
|
||||
{
|
||||
// 三发默认角度(无目标时用):左 -20,中 0,右 +20
|
||||
// 三发出膛角度:左 -20,中 0,右 +20(锁定子弹会追踪转向主锁目标)
|
||||
float[] defaultAngles = { angle - 20, angle, angle + 20 };
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
string bulletId = i < bullitIDs.Count ? bullitIDs[i] : bullitIDs[0];
|
||||
MonsterContral targetMonster = null;
|
||||
Transform targetHitPos = null;
|
||||
|
||||
// 尝试按 GUID 查找目标
|
||||
if (fireTargetMonsterIDs != null && i < fireTargetMonsterIDs.Count)
|
||||
{
|
||||
if (CreateFishManager.Instance.fishDatas_hashCodekey.TryGetValue(fireTargetMonsterIDs[i], out var m)
|
||||
&& m != null && m.gameObject.activeInHierarchy
|
||||
// ⭐ 手动锁定的主目标(i==0 且是本地玩家主锁)不受路径进度限制
|
||||
&& ((i == 0 && sit == currSitData && m == currSitData.monCotl_Lock && currSitData.isManualLock)
|
||||
|| IsFishPathLockable(m)))
|
||||
{
|
||||
targetMonster = m;
|
||||
targetHitPos = ResolveLockTransform(m);
|
||||
}
|
||||
}
|
||||
|
||||
if (targetMonster != null && targetHitPos != null)
|
||||
{
|
||||
// 朝目标发射
|
||||
Vector3 targetWorldPos = targetHitPos.position;
|
||||
Vector2 dir = ((Vector2)targetWorldPos - startPos).normalized;
|
||||
float targetAngle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg - 90f;
|
||||
CreateBullet(sit, startPos, targetAngle, isDouble, true, bulletId, targetMonster, targetHitPos, GetBulletGold(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
// 目标不足或失效 → 按默认角度发射(不锁定)
|
||||
CreateBullet(sit, startPos, defaultAngles[i], isDouble, isLock, bulletId, null, null, GetBulletGold(i));
|
||||
}
|
||||
// lockTarget 传 null:CreateBullet 内部兜底会 Lock(sit.monCotl_Lock, sit.monCotl_Lock_Position),
|
||||
// 三发全部锁定同一条主锁目标;主锁目标为空时按普通子弹发射(不锁定)
|
||||
CreateBullet(sit, startPos, defaultAngles[i], isDouble, true, SafeBid(i), null, null, GetBulletGold(i));
|
||||
}
|
||||
}
|
||||
else if (isSanShe)
|
||||
{
|
||||
// ⭐ 安全取值:bullitIDs 不足3个时复用最后一个,避免越界
|
||||
string SafeBid(int i) => i < bullitIDs.Count ? bullitIDs[i] : bullitIDs[bullitIDs.Count - 1];
|
||||
CreateBullet(sit, startPos, angle - 20, isDouble, isLock, SafeBid(0), null, null, GetBulletGold(0));
|
||||
CreateBullet(sit, startPos, angle, isDouble, isLock, SafeBid(1), null, null, GetBulletGold(1));
|
||||
CreateBullet(sit, startPos, angle + 20, isDouble, isLock, SafeBid(2), null, null, GetBulletGold(2));
|
||||
@@ -2440,13 +2414,16 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
if (currSitData == null) return;
|
||||
|
||||
// ⭐ 散射激光模式标记(座位用它激活左右起点球父对象):三发+锁定开着+有锁定目标就算散射中,
|
||||
// ⭐ 散射激光模式标记(座位用它激活左右起点球父对象):战神+三发+锁定开着+有锁定目标就算散射中,
|
||||
// 不依赖实际凑满几个目标(目标不足时散射模式开着也要显示起点球)
|
||||
// ⭐ 正常炮台三合一打一个,不算散射激光模式(不显示左右起点球)
|
||||
currSitData.isScatterLaserOn = toggle_Three != null && toggle_Three.isOn
|
||||
&& toggle_Lock != null && toggle_Lock.isOn
|
||||
&& currSitData.isLock;
|
||||
&& currSitData.isLock
|
||||
&& currSitData.currentZhanShenData != null;
|
||||
|
||||
bool isTripleLock = toggle_Three.isOn && toggle_Lock.isOn && currSitData.isLock;
|
||||
// ⭐ 三发锁定圈(3个圈)只在战神模式显示;正常炮台三合一只有主锁圈(1个)
|
||||
bool isTripleLock = currSitData.isScatterLaserOn;
|
||||
if (!isTripleLock)
|
||||
{
|
||||
currSitData.HideTripleLockIcons();
|
||||
@@ -2961,8 +2938,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
auto = currSitData.IsAutoAttackOn
|
||||
};
|
||||
|
||||
// ⭐ 三发 + 锁定:查找 3 个优先级目标,写入 monsterIDs
|
||||
if (isSanShe && isLock)
|
||||
// ⭐ 战神 三发 + 锁定:查找 3 个优先级目标,写入 monsterIDs(FireLaser 分散打三个用)
|
||||
// 正常炮台三合一打主锁目标(monCotl_Lock 已由 SyncLock/SyncBotLock 同步),不需要 monsterIDs
|
||||
if (isSanShe && isLock && currSitData.currentZhanShenData != null)
|
||||
{
|
||||
var targets = FindFireTargets(3);
|
||||
if (targets.Count > 0)
|
||||
@@ -3961,9 +3939,9 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
int count = isSanShe ? 3 : 1;
|
||||
long gold = isDouble ? sit.consumeGoldNum * 2 : sit.consumeGoldNum;
|
||||
|
||||
// 三发+锁定 → 找 N 个目标鱼的 GUID
|
||||
// 三发+锁定+战神 → 找 N 个目标鱼的 GUID(FireLaser 分散打三个用;正常炮台三合一不需要)
|
||||
List<string> monsterIDs = null;
|
||||
if (isSanShe && isLock && target != null)
|
||||
if (isSanShe && isLock && target != null && sit.currentZhanShenData != null)
|
||||
{
|
||||
monsterIDs = new List<string> { target.guid };
|
||||
var extraTargets = FindBotLockTargets(sit, target, 2);
|
||||
|
||||
Reference in New Issue
Block a user