- 檔案位置 Barotrauma\Content\Items\Weapons\weapons.xm
- Ctrl + F 搜尋 revolver,跳到左輪手槍的代碼。
<Item
name=""
identifier="revolver"
category="Weapon"
cargocontaineridentifier="metalcrate"
tags="smallitem,weapon,gun,pistolitem,provocativetohumanai,gunsmith,mountableweapon"
Scale="0.5"
impactsoundtag="impact_metal_light">
<Item>標籤的屬性有name、identifier、category、cargocontaineridentifier、tags、Scale、impactsoundtag,說明如下:
<Item>
name,畫面顯示的名字,""留空用於多語言翻譯,<entityname.revolver></entityname.revolver>,描述用<entitydescription.revolver></entitydescription.revolver>。

按下Alt顯示可互動物件名稱(name)。
identifier,遊戲識別的物品ID,唯一。
category,類別,影響商人、編輯器歸類,Weapon類別。
cargocontaineridentifier,購買後用甚麼箱子送到潛艇上,metalcrate是金屬箱子。
tags,標籤可自訂,provocativetohumanai會挑釁AI,mountableweapon可掛上武器架。
Scale,Sprite圖片縮放。
impactsoundtag,掉落或撞擊聲。
<PreferredContainer
secondary="outpostsecarmcab"
amount="1"
spawnprobability="0.5" />
<PreferredContainer
secondary="wrecksecarmcab,abandonedsecarmcab,piratesecarmcab"
amount="1"
spawnprobability="0.25" />
<PreferredContainer
primary="secarmcab"
secondary="armcab,weaponholder" />
<PreferredContainer>標籤的屬性有secondary、amount、spawnprobability、primary,說明如下:
<PreferredContainer>
secondary,次要生成、自動放置位置。
- outpostsecarmcab前哨站保全室的保險鋼櫃。
- wrecksecarmcab沈船保全室的保險鋼櫃。
- abandonedsecarmcab廢棄站點保全室的保險鋼櫃。
- piratesecarmcab海盜保全室的保險鋼櫃。
- armcab自己船上保全室的鋼櫃。
- weaponholder自己船上的武器架。
amount,生成數量,預設是1。
spawnprobability,生成機率,每個櫃子分開算,預設是1。
primary,主要生成、自動放置位置。
- secarmcab自己船上保全室的保險鋼櫃。
<Price baseprice="150">
<Price storeidentifier="merchantoutpost" sold="false"
multiplier="1.5" />
<Price storeidentifier="merchantcity" multiplier="1.25"
sold="false" minavailable="1" />
<Price storeidentifier="merchantresearch" sold="false"
multiplier="1.25" />
<Price storeidentifier="merchantmilitary" multiplier="0.9"
minavailable="3" />
<Price storeidentifier="merchantmine" sold="false"
multiplier="1.25" />
<Price storeidentifier="merchantarmory" multiplier="0.9"
minavailable="3" />
</Price>
<Price>標籤的屬性有baseprice,子標籤<Price>的屬性有storeidentifier、sold、minavailable,說明如下:
<Price>
baseprice,基礎價格。
<Price>
storeidentifier,商人ID。
merchantoutpost,一般的前哨站的商人。
merchantcity,城市群落的商人。
merchantresearch,研究所的商人。
merchantmilitary,軍事衛所的商人。
merchantmine,礦業的前哨站的商人。
merchantarmory,軍械庫的商人。
sold,有沒有賣。
minavailable,最低庫存,0是無庫存不能買。
<Deconstruct time="10">
<Item identifier="steel" />
<Item identifier="plastic" />
</Deconstruct>
<Deconstruct>標籤的屬性有baseprice,子標籤<Item>的屬性有identifier,說明如下:
<Deconstruct>
time,分解所需的時間(秒)。
<Item>
identifier,分解後得到的材料,steel鐵,plastic塑膠,數量預設是1。
<Fabricate
suitablefabricators="fabricator"
requiredtime="35"
requiresrecipe="true">
<RequiredSkill identifier="weapons" level="35" />
<RequiredItem identifier="steel" amount="2" />
<RequiredItem identifier="plastic" />
</Fabricate>
<Fabricate>標籤的屬性有baseprice,子標籤<RequiredSkill>的屬性有identifier、level,子標籤<RequiredItem>的屬性有identifier、amount,說明如下:
<Fabricate>
suitablefabricators,可以製作的設備,總共有四個:加工台、醫療加工台、解構儀、自動售貨機。
requiredtime,製作時間(秒)。
requiresrecipe,是否需要先學會配方,否則不會出現在製作列表中。
<RequiredSkill>
identifier,需要技能武器操作,其他技能駕駛水準、電器工程、機械工程、醫療水準。
level,需要武器操作技能等級35。
<RequiredItem>
amount,材料數量。
<InventoryIcon
texture="Content/Items/InventoryIconAtlas.png"
sourcerect="128,64,64,64"
origin="0.5,0.5" />
<Sprite
texture="Content/Items/Weapons/weapons_new.png"
sourcerect="0,418,76,41"
depth="0.55"
origin="0.5,0.5" />
<Body
width="72"
height="40"
density="25" />
<InventoryIcon>標籤的屬性有texture、sourcerect、origin,<Sprite>標籤的屬性有texture、sourcerect、depth、origin,<Body>標籤的屬性有width、height、density,說明如下:
<InventoryIcon>
texture,欄位圖示路徑。
sourcerect(x,y,w,h),擷取框,左上角為原點,右下方為第一象限。
origin(x,y),按圖片比例設置錨點(0~1)。
<Sprite>
texture,場景上顯示的圖示路徑。
sourcerect,擷取框。
depth,深度,0~1數字越大疊越下面。
origin,設置錨點。
<Body>
width,設置碰撞框的矩形寬。
height,設置碰撞框的矩形高。
density,密度,影響動量、漂浮等物理系統。
<Holdable
slots="Any,RightHand,LeftHand"
controlpose="true"
aimpos="70,5"
handle1="-25,-7"
msg="ItemMsgPickUpSelect" />
<Holdable>標籤的屬性有slots、controlpose、aimpos、handle1、msg,說明如下:
<Holdable>
slots,持有欄位,any為下方10格物品欄,只有any會無法裝備在手上,RightHand,LeftHand是左右手都可,雙持一個物品是RightHand+LeftHand。
controlpose,是否影響姿勢。
aimpos,瞄準時手掌的位置,相對於肩膀。
handle1,瞄準時手掌1的位置,handle2是手掌2的位置。
msg,物品在地上互動時顯示的文字,ItemMsgPickUpSelect是撿起。

<RangedWeapon
barrelpos="29,11"
spread="0.1"
unskilledspread="6"
combatPriority="70"
drawhudwhenequipped="true"
crosshairscale="0.2"
reload="0.5"
DualWieldReloadTimePenaltyMultiplier="1.75"
DualWieldAccuracyPenalty="8">
<RangedWeapon>標籤的屬性有barrelpos、spread、unskilledspread、combatPriority、drawhudwhenequipped、crosshairscale、reload、DualWieldReloadTimePenaltyMultiplier、DualWieldAccuracyPenalty,說明如下:
<RangedWeapon>
barrelpos,槍管位置,子彈射出原點。
spread,擃散度或準確度,0.1是準。
unskilledspread,技能未達需求的擃散度。
combatPriority,戰鬥優先度,AI拿取順序。
drawhudwhenequipped,是否裝備時顯示HUD。
crosshairscale,準心大小。
reload,重新裝填時間(秒)。
DualWieldReloadTimePenaltyMultiplier,雙持左輪重新裝填逞罰倍率。
DualWieldAccuracyPenalty,雙持左輪擃散度逞罰。
<Crosshair
texture="Content/Items/Weapons/Crosshairs.png"
sourcerect="0,256,256,256" />
<CrosshairPointer
texture="Content/Items/Weapons/Crosshairs.png"
sourcerect="256,256,256,256" />
<Crosshair>標籤的屬性有texture、sourcerect,<CrosshairPointer>標籤的屬性有texture、sourcerect,說明如下:
<Crosshair>
texture,準心圖示路徑。
sourcerect,擷取框。
<CrosshairPointer>
texture,游標圖示路徑。
sourcerect,擷取框。

<Sound
file="Content/Items/Weapons/Revolver1.ogg"
type="OnUse"
range="3000"
selectionmode="Random" />
<Sound
file="Content/Items/Weapons/Revolver2.ogg"
type="OnUse"
range="3000" />
<Sound
file="Content/Items/Weapons/Revolver3.ogg"
type="OnUse"
range="3000" />
<Sound>標籤的屬性有file、type、range、selectionmode,說明如下:
<Sound>
file,音效路徑。
type,觸發條件,OnUse開槍時。
range,聲音距離。
selectionmode,播放模式,Random隨機播放3選1。
<ParticleEmitter
particle="muzzleflash"
particleamount="1"
velocitymin="0"
velocitymax="0" />
<ParticleEmitter>標籤的屬性有particle、particleamount、velocitymin,velocitymax,說明如下:
<ParticleEmitter>
particle,粒子類型,muzzleflash槍口閃光。
particleamount,數量粒子。
velocitymin,粒子最低速度。
velocitymax,粒子最高速度。

<StatusEffect type="OnUse" target="This">
<Explosion
range="150.0"
force="1.5"
shockwave="false"
smoke="false"
flames="false"
sparks="false"
underwaterbubble="false"
camerashake="6.0" />
<ParticleEmitter
particle="casingfirearm"
particleamount="1"
anglemin="90"
anglemax="150"
velocitymin="50"
velocitymax="250"
CopyEntityAngle="true" />
</StatusEffect>
<StatusEffect>標籤的屬性有type、target,<Explosion>標籤的屬性有range、force、shockwave、smoke、flames、sparks、underwaterbubble、camerashake,<ParticleEmitter>標籤的屬性有particle、particleamount、anglemin、anglemax、velocitymin、velocitymax、CopyEntityAngle,說明如下:
<StatusEffect>
type,觸發時機,OnUse開槍時。
target,作用目標對象,This左輪。
<Explosion>
range,範圍。
force,力道。
shockwave,是否衝擊波。
smoke,是否煙。
flames,是否火焰。
sparks,是否火花。
underwaterbubble,是否水中泡泡。
camerashake,鏡頭晃動。
<ParticleEmitter>
particle,類型,casingfirearm武器射線。
particleamount,數量。
anglemin,最小角度,0度方向未知。
anglemax,最大角度。
velocitymin,最低速度。
velocitymax,最大速度。
CopyEntityAngle,表示粒子發射的角度會參考目標物件左輪(entity)的旋轉角度,也就是說,發射方向會根據物件的方向來調整。

<RequiredItems
items="revolverammo"
type="Contained"
msg="ItemMsgAmmoRequired" />
<RequiredSkill identifier="weapons" level="40" />
<RequiredItems>標籤的屬性有items、type、msg,<RequiredSkill>標籤的屬性有identifier、level,說明如下:
<RequiredItems>
items,需要revolverammo子彈。
type,狀態,Contained子彈要放在左輪裡。
msg,沒有放入需求物品的訊息。ItemMsgAmmoRequired彈藥耗盡。


<RequiredSkill>
identifier,需求技能。
level,需求技能等級。
<ItemContainer
capacity="1"
maxstacksize="6"
hideitems="true"
containedstateindicatorstyle="bullet">
<SlotIcon
slotindex="0"
texture="Content/UI/StatusMonitorUI.png"
sourcerect="256,448,64,64"
origin="0.5,0.5" />
<Containable items="revolverammo" />
</ItemContainer>
<ItemContainer>標籤的屬性有capacity、maxstacksize、hideitems、containedstateindicatorstyle,<SlotIcon>標籤的屬性有slotindex、texture、sourcerect、origin,<Containable>標籤的屬性有items,說明如下:
<ItemContainer>
capacity,欄位/格子數量。
maxstacksize,子彈最多堆疊數量。
hideitems,在場景中隱藏子彈圖示(Sprite)。
containedstateindicatorstyle,內容物標示,手槍底下子彈形狀的圖示,潛水服是氧氣罐圖示。

<SlotIcon>
slotindex,第n格欄位。
texture,第n格欄位背景底圖圖示,bullet紅色子彈圖示,原圖是白色的圖示(開黑暗模式才看得到)。


sourcerect,圖示擷取框。
origin,設置圖示錨點。
<Containable>
items,只能放入某物品ID,revolverammo左輪子彈。
<aitarget sightrange="2000" soundrange="5000" fadeouttime="5" />
<aitarget>標籤的屬性有sightrange、soundrange、fadeouttime,說明如下:
<aitarget>
sightrange,左輪被AI警戒的視覺距離。
soundrange,左輪被AI警戒的聽覺距離。
fadeouttime,左輪被AI忘掉的時間,例如收槍後不會一直警戒。
<Quality>
<QualityStat stattype="FirepowerMultiplier" value="0.1" />
</Quality>
<Quality>標籤的屬性有,<QualityStat>標籤的屬性有stattype、value,說明如下:
<Quality>
<QualityStat>
stattype,品質狀態類型,火力倍率。
value,倍率,0.1是提升10%。
<Upgrade gameversion="0.10.0.0" scale="0.5" />
<SkillRequirementHint identifier="weapons" level="40" />
<Upgrade>標籤的屬性有gameversion、scale,<SkillRequirementHint>標籤的屬性有identifier、level,說明如下:
<Upgrade>
gameversion,遊戲版本。
scale,每次升級提升數值,0.5是50%。(待確認)
<SkillRequirementHint>
identifier,技能需求提示。
level,技能需求等級。

編輯器設定


