【载具技能】增加子弹类型 lock_unit_boom 跟踪单位并且爆炸

main
刘涛 2025-03-31 14:05:28 +08:00
parent 2d735a2e9e
commit bf5767c188
12 changed files with 108 additions and 24 deletions

View File

@ -416,6 +416,7 @@ namespace Gameplay.Bullet
result = _EmitLockPosBullet(targetUnit.transData.cellIndex, sender, bulletConfig);
break;
case EBulletType.UNIT_LOCK:
case EBulletType.UNIT_LOCK_BOOM:
// 锁单位
result = _EmitLockUnitBullet(targetUnit, sender, bulletConfig);
break;
@ -478,6 +479,7 @@ namespace Gameplay.Bullet
result = _EmitLockPosBullet(cellIndex, sender, bulletConfig);
break;
case EBulletType.UNIT_LOCK:
case EBulletType.UNIT_LOCK_BOOM:
// 锁单位
result = _EmitLockUnitBullet(cellIndex, sender, bulletConfig);
break;

View File

@ -25,8 +25,9 @@ namespace Gameplay.Bullet
public const int UNIT_LOCK = 2;
/// <summary>
/// ●方向子弹:向某方向发射子弹飞行物体,对路径上的目标进行检测,对命中目标执行逻辑
/// 追踪子弹,带爆炸:发射子弹类飞行物体
/// ●弃用:方向子弹:向某方向发射子弹飞行物体,对路径上的目标进行检测,对命中目标执行逻辑
/// </summary>
public const int DIR_FLY = 4;
public const int UNIT_LOCK_BOOM = 4;
}
}

View File

@ -1,14 +1,8 @@
using LTGame;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gameplay.Unit;
namespace Gameplay.Bullet
{
using Gameplay.Common;
using UnityEngine;
public class BulletStateUnitLockFly : BaseBulletState
@ -26,8 +20,8 @@ namespace Gameplay.Bullet
protected override void _OnEnter(NBaseState exitState, object param)
{
base._OnEnter(exitState, param);
this.targetUnit = owner.lockUnit;
this._targetPos = targetUnit.transData.pos;
targetUnit = owner.lockUnit;
_targetPos = targetUnit.transData.pos;
_flySpeed = owner.configData.FlySpeed;
}
@ -50,7 +44,20 @@ namespace Gameplay.Bullet
{
owner.rootObj.transform.position = targetPos;
isFinished = true;
nextState = EBulletState.DamageUnit;
switch (owner.configData.BulletType)
{
case EBulletType.UNIT_LOCK:
nextState = EBulletState.DamageUnit;
break;
case EBulletType.UNIT_LOCK_BOOM:
nextState = EBulletState.PosBoom;
break;
default:
DebugUtil.LogError("[BulletStateUnitLockFly: _OnRunning] 未支持的子弹类型: " + owner.configData.BulletType);
nextState = EBulletState.Destroy;
break;
}
}
else
{

View File

@ -176,10 +176,6 @@ namespace Gameplay.Vehicle.Data
}
}
// TODO: 临时覆写
skillId = 30001;
DebugUtil.LogError("临时覆写技能ID:" + skillId);
_InitTerrainSpecialParam(rawConfig.MalaAdjustTerrain, rawConfig.SupperAdjustTerrain);
}
@ -302,8 +298,9 @@ namespace Gameplay.Vehicle.Data
}
}
// TODO: 强制指定技能id
// skillId = 30009;
// TODO: 临时覆写
skillId = 30003;
DebugUtil.LogError("临时覆写技能ID:" + skillId);
_InitTerrainSpecialParam(rawConfig.Cfg.MalaAdjustTerrain, rawConfig.Cfg.SupperAdjustTerrain);
}

View File

@ -78,7 +78,7 @@ public sealed partial class DataBullet : Bright.Config.BeanBase
/// </summary>
public string Name { get; private set; }
/// <summary>
/// 子弹类型
/// 子弹类型 <br/>1.直接伤害,无弹道<br/>2.pos_lock位置锁定,向地面发射子弹,走爆炸逻辑,有飞行弹道<br/>3.unit_lock,单位锁定,向单位发射子弹,命中目标后走点对点伤害逻辑,不爆炸,有飞行弹道<br/>4.unit_lock_boom,单位锁定,带爆炸,向单位发射子弹,命中后走爆炸逻辑,有飞行弹道
/// </summary>
public int BulletType { get; private set; }
/// <summary>

View File

@ -7566,6 +7566,32 @@
0.2
]
},
{
"ID": 10113,
"Name": "载具aoe子弹1",
"GroupId": 0,
"Level": 1,
"BuffEffectType": 2,
"CanTriggerOnDead": false,
"RepeatType": 0,
"BuffType": 7,
"ExistType": 0,
"ExExitType": 0,
"TriggerType": 0,
"MaxExistTime": 0,
"ExistEffectId": 0,
"BuffDisplayIcon": "",
"TiggerUnitTime": 0,
"AttackPowerLevel": 1000,
"PorpParams": [],
"FloatParams": [
100,
0.5,
0.5,
1,
1
]
},
{
"ID": 20001,
"Name": "特效buff",

View File

@ -2268,6 +2268,30 @@
10112
]
},
{
"ID": 530060,
"Name": "载具aoe子弹1",
"BulletType": 3,
"PrefabPath": "Bullet_path_s",
"HitAudioId": "",
"DestroyEffectId": 0,
"FlySpeed": 50,
"FilterType": 3,
"JobFilters": [],
"FractionFilter": [],
"MoraleFilter": [],
"ExistBuffGroupIdFilter": [],
"ActiveOnCharacter": true,
"ActiveOnVehicle": true,
"ActiveOnBuild": true,
"CanUseOnPretent": true,
"AreaId": 2,
"LightDuring": 0,
"BuffList": [
20001,
10113
]
},
{
"ID": 1001,
"Name": "指挥官技能-强制友军撤退",

View File

@ -38538,7 +38538,7 @@
"InfluenceAreaId": 1,
"ShowAreaId": 2,
"ShowEffectId": -1,
"IsEmitToFloor": false,
"IsEmitToFloor": true,
"PassiveBuffIds": [],
"IntParams": [],
"FloatParams": [],
@ -38548,7 +38548,9 @@
"ChargeParam": 20,
"LogicId": 30003,
"ShowInSkillEditor": true,
"ReferIds": [],
"ReferIds": [
530060
],
"IconPath": "Icon_skill_VehicleTest.png"
},
{

View File

@ -1 +1 @@
{"skillId":30003,"actionList":[{"id":0,"subId":0,"floatParam1":0.0,"triggerTime":1.883333444595337,"actionType":4},{"id":0,"subId":0,"floatParam1":0.0,"triggerTime":1.883333444595337,"actionType":5},{"id":0,"subId":0,"floatParam1":0.0,"triggerTime":0.0,"actionType":1}]}
{"skillId":30003,"actionList":[{"id":0,"subId":0,"floatParam1":0.0,"floatParam2":0.0,"floatParam3":0.0,"floatParam4":0.0,"intParam1":0,"intParam2":0,"intParam3":0,"intParam4":0,"stringParam1":"","triggerTime":1.0833334922790528,"actionType":4},{"id":0,"subId":0,"floatParam1":0.0,"floatParam2":0.0,"floatParam3":0.0,"floatParam4":0.0,"intParam1":0,"intParam2":0,"intParam3":0,"intParam4":0,"stringParam1":"","triggerTime":1.0833334922790528,"actionType":5},{"id":0,"subId":0,"floatParam1":0.0,"floatParam2":0.0,"floatParam3":0.0,"floatParam4":0.0,"intParam1":0,"intParam2":0,"intParam3":0,"intParam4":0,"stringParam1":"","triggerTime":0.0,"actionType":1}]}

View File

@ -60,13 +60,19 @@ namespace SkillEditor
EditorGUILayout.LabelField("无弹道子弹");
break;
case EBulletType.POS_LOCK:
EditorGUILayout.LabelField("位置锁定导弹");
EditorGUILayout.LabelField("位置锁定导弹,爆炸");
EditorGUILayout.LabelField("子弹飞行速度:" + config.FlySpeed);
_DrawBulletBoomInfo(config.AreaId);
break;
case EBulletType.UNIT_LOCK:
EditorGUILayout.LabelField("目标锁定导弹");
EditorGUILayout.LabelField("目标锁定导弹(不爆炸)");
EditorGUILayout.LabelField("子弹飞行速度:" + config.FlySpeed);
break;
case EBulletType.UNIT_LOCK_BOOM:
EditorGUILayout.LabelField("目标锁定导弹(带爆炸)");
EditorGUILayout.LabelField("子弹飞行速度:" + config.FlySpeed);
_DrawBulletBoomInfo(config.AreaId);
break;
default:
EditorGUILayout.LabelField($"子弹类型:{config.BulletType} - 暂不支持的子弹类型");
break;
@ -78,6 +84,21 @@ namespace SkillEditor
}
}
private void _DrawBulletBoomInfo(int bulletAreaId)
{
EditorGUILayout.LabelField("爆炸区域ID:" + bulletAreaId);
if (EditorTableManager.instance.tables.AreaConfig.DataMap.TryGetValue((int)bulletAreaId, out var config))
{
EditorGUILayout.LabelField("爆炸区域名字:" + config.Name);
EditorGUILayout.LabelField("爆炸区域描述:" + config.DESC);
}
else
{
EditorGUILayout.HelpBox("无效的爆炸区域id:" + bulletAreaId, MessageType.Error);
}
}
public abstract void HandleAction(SkillActionClip clip);
}
}

View File

@ -491,6 +491,10 @@ namespace SkillEditor
var selectConfig = _tables.VehicleConfig.DataList[_selectVehicleIndex];
var modelPath = PathEx.GetVehicleGameModelPath(selectConfig.ID);
objAsset = AssetDatabase.LoadAssetAtPath<GameObject>(modelPath);
if (objAsset == null)
{
throw new Exception("该载具没有对应的模型:" + modelPath);
}
// 实例化模型
obj = Instantiate(objAsset, _parent_zhujue, false);

View File

@ -292,7 +292,7 @@ namespace SkillEditor
var fireTrans = skeleon.GetBone("Fire");
if (config.BulletType == EBulletType.UNIT_LOCK
|| config.BulletType == EBulletType.DIR_FLY)
|| config.BulletType == EBulletType.UNIT_LOCK_BOOM)
{
var fireTransPosition = fireTrans.position;
_effectObj.transform.position = fireTransPosition;