Files
WulaFallenEmpireRW/Documentation/ExplosiveBeamWeapons/配置说明.md

116 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 爆炸射线武器配置说明
## 概述
新的 `Verb_ShootBeamExplosive` 类扩展了原版的 `Verb_ShootBeam`,添加了可配置的爆炸效果。
## 配置属性
### 基础爆炸控制
- `enableExplosion` (bool): 是否启用爆炸效果,默认 false
- `explosionShotInterval` (int): 每x发射击触发一次爆炸默认 1
### 爆炸伤害属性
- `explosionRadius` (float): 爆炸半径,默认 2.9
- `explosionDamageDef` (DamageDef): 爆炸伤害类型null时使用 Bomb
- `explosionDamage` (int): 爆炸伤害值,-1时使用武器默认伤害
- `explosionArmorPenetration` (float): 爆炸护甲穿透,-1时使用武器默认值
### 音效和特效
- `explosionSound` (SoundDef): 爆炸音效
- `explosionEffecter` (EffecterDef): 爆炸特效
### 爆炸后效果
- `postExplosionSpawnThingDef` (ThingDef): 爆炸后生成的物品
- `postExplosionSpawnChance` (float): 生成概率 (0-1)
- `postExplosionSpawnThingCount` (int): 生成数量
### 爆炸前效果
- `preExplosionSpawnThingDef` (ThingDef): 爆炸前生成的物品
- `preExplosionSpawnChance` (float): 生成概率 (0-1)
- `preExplosionSpawnThingCount` (int): 生成数量
### 其他属性
- `postExplosionGasType` (GasType?): 爆炸后的气体类型
- `applyDamageToExplosionCellsNeighbors` (bool): 是否对邻近格子造成伤害
- `chanceToStartFire` (float): 点燃概率 (0-1)
- `damageFalloff` (bool): 是否有伤害衰减
## 使用示例
```xml
<verbs>
<li Class="WulaFallenEmpire.VerbPropertiesExplosiveBeam">
<verbClass>WulaFallenEmpire.Verb_ShootBeamExplosive</verbClass>
<!-- 基础射线属性 -->
<hasStandardCommand>true</hasStandardCommand>
<warmupTime>0.5</warmupTime>
<range>30</range>
<burstShotCount>6</burstShotCount>
<beamWidth>3</beamWidth>
<beamDamageDef>Stun</beamDamageDef>
<!-- 爆炸配置 -->
<enableExplosion>true</enableExplosion>
<explosionShotInterval>3</explosionShotInterval> <!-- 每3发触发一次爆炸 -->
<explosionRadius>2.5</explosionRadius>
<explosionDamageDef>Bomb</explosionDamageDef>
<explosionDamage>25</explosionDamage>
<explosionSound>Explosion_Bomb</explosionSound>
<chanceToStartFire>0.3</chanceToStartFire>
<postExplosionSpawnThingDef>Filth_Fuel</postExplosionSpawnThingDef>
<postExplosionSpawnChance>0.15</postExplosionSpawnChance>
</li>
</verbs>
```
## 工作原理
1. 武器正常进行射线攻击
2. 每次成功射击后,计数器递增
3. 当计数器达到 `explosionShotInterval` 时:
- 在当前射线位置触发爆炸
- 播放爆炸音效和特效
- 重置计数器
4. 爆炸使用配置的参数进行伤害计算
## 注意事项
- 爆炸位置基于射线的插值位置
- 如果爆炸位置超出地图边界,爆炸不会触发
- 音效和特效是可选的,可以设置为 null
- 伤害值为 -1 时会尝试使用武器的默认伤害
- 这个功能完全向后兼容,不启用爆炸时行为与原版相同
## 配置模板
### 轻型爆炸武器
```xml
<enableExplosion>true</enableExplosion>
<explosionShotInterval>1</explosionShotInterval>
<explosionRadius>1.8</explosionRadius>
<explosionDamageDef>Flame</explosionDamageDef>
<explosionDamage>15</explosionDamage>
<chanceToStartFire>0.6</chanceToStartFire>
```
### 重型爆炸武器
```xml
<enableExplosion>true</enableExplosion>
<explosionShotInterval>3</explosionShotInterval>
<explosionRadius>3.2</explosionRadius>
<explosionDamageDef>Bomb</explosionDamageDef>
<explosionDamage>35</explosionDamage>
<explosionArmorPenetration>0.4</explosionArmorPenetration>
<postExplosionSpawnThingDef>Filth_Fuel</postExplosionSpawnThingDef>
<postExplosionSpawnChance>0.25</postExplosionSpawnChance>
```
### 毒气武器
```xml
<enableExplosion>true</enableExplosion>
<explosionShotInterval>2</explosionShotInterval>
<explosionRadius>2.8</explosionRadius>
<explosionDamageDef>ToxGas</explosionDamageDef>
<postExplosionGasType>ToxGas</postExplosionGasType>
```