Skip to content

Commit 844607c

Browse files
committed
1.2.9 (EXPERIMENTAL #1)
1 parent 3c692f7 commit 844607c

18 files changed

Lines changed: 379 additions & 62 deletions

Dam Defense/Items/Items.xml

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@
511511
</Holdable>
512512
</Item>
513513
<!-- flamer now uses afterburn instead of starting fires -->
514-
<Item name="" identifier="flamer" category="Equipment,Weapon" Tags="mediumitem,weapon,gun,mountableweapon" cargocontaineridentifier="metalcrate" Scale="0.5" impactsoundtag="impact_metal_light">
514+
<Item name="" identifier="flamer" category="Equipment,Weapon" Tags="mediumitem,weapon,gun,mountableweapon,flamer" cargocontaineridentifier="metalcrate" Scale="0.5" impactsoundtag="impact_metal_light">
515515
<Upgrade gameversion="0.10.0.0" scale="0.5" />
516516
<PreferredContainer primary="secarmcab" amount="1" spawnprobability="0.2" notcampaign="true"/>
517517
<PreferredContainer secondary="wrecksecarmcab,abandonedsecarmcab" amount="1" spawnprobability="0.1"/>
@@ -3885,7 +3885,7 @@
38853885
<Sprite texture="%ModDir%/Items/wizard.png" sourcerect="532,0,52,215" origin="0.5,0.5" depth="0.55" />
38863886
<Body width="52" height="215" density="30" />
38873887
<Holdable slots="RightHand" controlpose="true" aimable="true" AimPos="50,0" HoldPos="40,-50" AimAngle="10" HoldAngle="0" handle1="4,30" />
3888-
<RangedWeapon barrelpos="0,88" reload="1" combatpriority="100" drawhudwhenequipped="true" crosshairscale="0.2" msg="ItemMsgPickUpSelect" maxchargetime="1" ChargeSoundWindupPitchSlide="0.5,2.0" >
3888+
<RangedWeapon barrelpos="0,88" reload="1.2" combatpriority="100" drawhudwhenequipped="true" crosshairscale="0.2" msg="ItemMsgPickUpSelect" maxchargetime="0.8" ChargeSoundWindupPitchSlide="0.5,2.0" >
38893889
<Crosshair texture="Content/Items/Weapons/Crosshairs.png" sourcerect="0,256,256,256" />
38903890
<CrosshairPointer texture="Content/Items/Weapons/Crosshairs.png" sourcerect="256,256,256,256" />
38913891
<ParticleEmitter particle="muzzleflashmerasmusstaff" scalemin="4.0" scalemax="4.0" particleamount="20" anglemin="0" anglemax="360" velocitymin="0" velocitymax="0" colormultiplier="200,200,200,255" />
@@ -3930,6 +3930,16 @@
39303930
<Body width="28" height="36" density="20" />
39313931
<Holdable slots="Any,LeftHand" aimable="false" aimpos="40,-20" handle1="5,0" aimangle="260" swingamount="0,3" swingspeed="0.5" swingwhenaiming="true" msg="ItemMsgPickUpSelect" />
39323932
</Item>
3933+
<!-- blast jump spell book -->
3934+
<Item name="Fling Spellbook" identifier="merasmusblastjumpbook" spritecolor="200,200,255,255" inventoryiconcolor="200,200,255,255" category="Misc" cargocontaineridentifier="metalcrate" allowasextracargo="true" Tags="merasmusitem,merasmusspellbook,smallitem" maxstacksize="1" scale="0.5" impactsoundtag="impact_soft">
3935+
<Deconstruct time="10">
3936+
<Item identifier="carbon" />
3937+
</Deconstruct>
3938+
<InventoryIcon texture="book.png" sourcerect="33,112,39,56" origin="0.5,0.5" />
3939+
<Sprite texture="book.png" sourcerect="0,112,32,39" depth="0.6" origin="0.5,0.5" />
3940+
<Body width="28" height="36" density="20" />
3941+
<Holdable slots="Any,LeftHand" aimable="false" aimpos="40,-20" handle1="5,0" aimangle="260" swingamount="0,3" swingspeed="0.5" swingwhenaiming="true" msg="ItemMsgPickUpSelect" />
3942+
</Item>
39333943
<!-- fireball spell -->
39343944
<Item name="Scrungly" identifier="merasmusfireball" tags="merasmusitem,merasmusspell" category="Misc" scale="0.5" hideinmenus="true" >
39353945
<InventoryIcon texture="Content/Items/InventoryIconAtlas.png" sourcerect="640,768,64,64" origin="0.5,0.5" />
@@ -3969,7 +3979,7 @@
39693979
<!-- telefrag -->
39703980
<StatusEffect type="OnImpact" target="UseTarget">
39713981
<sound file="%ModDir%/Sounds/displacerteleport.ogg" volume="3.0" range="3000" />
3972-
<ParticleEmitter particle="weldspark" particleamount="5" anglemin="0" anglemax="360" velocitymin="300" velocitymax="350" scalemin="1.5" scalemax="1.9" drawontop="true" colormultiplier="150,255,195,180" />
3982+
<ParticleEmitter particle="merasmusstaffspark" particleamount="5" anglemin="0" anglemax="360" velocitymin="300" velocitymax="350" scalemin="1.5" scalemax="1.9" drawontop="true" colormultiplier="100,255,255,180" />
39733983
</StatusEffect>
39743984
<!-- teleport -->
39753985
<StatusEffect type="OnImpact" target="This">
@@ -3981,6 +3991,27 @@
39813991
</StatusEffect>
39823992
</Projectile>
39833993
</Item>
3994+
<Item name="Flick" identifier="merasmusblastjump" tags="merasmusitem,merasmusspell" category="Misc" scale="0.5" hideinmenus="true" >
3995+
<Sprite texture="Content/Items/Weapons/weapons_new.png" sourcerect="143,414,113,9" depth="0.55" origin="0.5,0.5" />
3996+
<Body width="170" height="10" density="20" />
3997+
<Projectile characterusable="false" hitscan="true" removeonhit="true">
3998+
<!-- telefrag -->
3999+
<ParticleEmitter particle="tracermerasmusstaff" particleamount="1" velocitymin="0" velocitymax="0" scalemultiplier="1,0.75" colormultiplier="195,195,255,180" />
4000+
<StatusEffect type="OnImpact" target="UseTarget">
4001+
<sound file="%ModDir%/Sounds/displacerteleport.ogg" volume="3.0" range="3000" />
4002+
<ParticleEmitter particle="merasmusstaffspark" particleamount="5" anglemin="0" anglemax="360" velocitymin="300" velocitymax="350" scalemin="1.5" scalemax="1.9" drawontop="true" colormultiplier="195,195,255,180" />
4003+
</StatusEffect>
4004+
<!-- teleport -->
4005+
<StatusEffect type="OnImpact" target="UseTarget">
4006+
<Conditional entitytype="eq Character" />
4007+
<LuaHook name="DD.merasmusblastjump.blastjump" />
4008+
</StatusEffect>
4009+
<!-- remove -->
4010+
<StatusEffect type="OnNotContained" target="This">
4011+
<Remove />
4012+
</StatusEffect>
4013+
</Projectile>
4014+
</Item>
39844015

39854016
<!-- JET mask from Facility Gamemode for Nukie -->
39864017
<Item name="Nukie Mask" identifier="jetmask" scale="0.5" category="Diving,Equipment" Tags="smallitem,diving,lightdiving" cargocontaineridentifier="metalcrate" description="" impactsoundtag="impact_metal_heavy">
@@ -4635,7 +4666,7 @@
46354666
</Item>
46364667

46374668
<!-- makeshift flamer -->
4638-
<Item name="Makeshift Flamer" identifier="makeshiftflamer" category="Equipment,Weapon" Tags="mediumitem,fireextinguisher,provocative,weapon,gun,mountableweapon" cargocontaineridentifier="metalcrate" description="" Scale="0.5" impactsoundtag="impact_metal_light" donttransferbetweensubs="true">
4669+
<Item name="Makeshift Flamer" identifier="makeshiftflamer" category="Equipment,Weapon" Tags="mediumitem,fireextinguisher,provocative,weapon,gun,mountableweapon,flamer" cargocontaineridentifier="metalcrate" description="" Scale="0.5" impactsoundtag="impact_metal_light" donttransferbetweensubs="true">
46394670
<Upgrade gameversion="0.9.600.0" Tags="mediumitem,fireextinguisher,provocative" />
46404671
<PreferredContainer primary="extinguisherholder" spawnprobability="1.0"/>
46414672
<PreferredContainer secondary="engcab,reactorcab"/>
@@ -5931,7 +5962,7 @@
59315962
<Body height="120" width="15" density="30" />
59325963
<Holdable slots="LeftHand" aimpos="60,-15" holdpos="45,-15" handle1="-20,0" handle2="-20,0" controlpose="false" blocksplayers="true" msg="ItemMsgPickUpSelect">
59335964
<StatusEffect type="OnActive" target="Character" SpeedMultiplier="0.8" setvalue="true" />
5934-
<StatusEffect type="OnActive" target="This" Condition="1" />
5965+
<StatusEffect type="OnActive" target="This" Condition="2" />
59355966
<StatusEffect type="OnBroken" target="This">
59365967
<particleemitter particle="shrapnel" drawontop="true" particleamount="15" velocitymin="100" velocitymax="500" anglemin="0" anglemax="360" distancemin="0" distancemax="30" scalemin="0.35" scalemax="0.5" />
59375968
<Sound file="Content/Sounds/Damage/ArmorBreak4.ogg" range="800" />
@@ -6296,14 +6327,30 @@
62966327
</Item>
62976328

62986329
<!-- corpse -->
6299-
<Item name="Corpse" identifier="corpse" sonarsize="2" tags="mediumitem" category="Misc" canbepicked="true" scale="0.5" impactsoundtag="impact_soft">
6330+
<Item name="Corpse" identifier="corpse" sonarsize="2" tags="mediumitem,corpse" category="Misc" canbepicked="true" scale="0.5" impactsoundtag="impact_soft">
63006331
<Deconstruct time="10" chooserandom="true" amount="2">
63016332
<Item identifier="carbon" commonness="0.8"/>
63026333
<Item identifier="yeastshroom" commonness="0.1"/>
63036334
<Item identifier="slimebacteria" commonness="0.1"/>
63046335
</Deconstruct>
63056336
<AiTarget sightrange="1000" static="true" />
6306-
<Sprite texture="%ModDir%/Items/corpse.png" depth="0.18" sourcerect="0,0,190,92" origin="0.5,0.5" />
6337+
<ItemComponent>
6338+
<StatusEffect type="Always" target="This" Interval="8">
6339+
<LuaHook name="DD.afflictions.spread" />
6340+
<Sound file="%ModDir%/Sounds/flybuzz1.ogg" volume="4.0" range="800" selectionmode="random" />
6341+
<Sound file="%ModDir%/Sounds/flybuzz2.ogg" volume="4.0" range="800" />
6342+
<Sound file="%ModDir%/Sounds/flybuzz3.ogg" volume="4.0" range="800" />
6343+
<Conditional InWater="eq False" />
6344+
</StatusEffect>
6345+
<StatusEffect type="InWater" target="This" condition="-2" />
6346+
<StatusEffect type="OnSpawn" target="This">
6347+
<LuaHook name="DD.corpse.register" />
6348+
</StatusEffect>
6349+
<StatusEffect type="OnBroken" target="This">
6350+
<Remove />
6351+
</StatusEffect>
6352+
</ItemComponent>
6353+
<Sprite texture="%ModDir%/Items/corpse.png" depth="0.57" sourcerect="0,0,190,92" origin="0.5,0.5" />
63076354
<Body width="180" height="86" density="20" friction="1.0" restitution="0.01" angulardamping="1.0" />
63086355
<Holdable slots="RightHand+LeftHand" holdpos="0,-80" handle1="-30,14" handle2="30,14" aimable="false" msg="ItemMsgPickUpSelect" />
63096356
</Item>

Dam Defense/Items/corpse.png

19 Bytes
Loading

Dam Defense/Localizations/english.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,10 @@ return {
179179
gui_hostile = 'Hostile',
180180
gui_friendly = 'Friendly',
181181
gui_comrade = 'Comrade',
182-
gui_cultist = 'Brethren',
182+
gui_comradecultist = 'Brethren',
183183
gui_target = 'Target',
184+
gui_cultist = 'Cultist',
185+
gui_rebel = 'Rebel Leader',
184186
gui_serialkiller = 'Serial Killer',
185187
gui_wizard = 'Wizard',
186188
gui_wanted = 'Wanted',

Dam Defense/Localizations/english.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@
213213
<entitydescription.merasmusfireballbook>A spellbook that when equipped with a staff can be used to shoot scrungly nitroglycerin fireballs.</entitydescription.merasmusfireballbook>
214214
<entityname.merasmusteleportbook>Blink Spellbook</entityname.merasmusteleportbook>
215215
<entitydescription.merasmusteleportbook>A spellbook that when equipped with a staff can be used to teleport. Does not telefrag or deal damage.</entitydescription.merasmusteleportbook>
216+
<entityname.merasmusblastjumpbook>Fling Spellbook</entityname.merasmusblastjumpbook>
217+
<entitydescription.merasmusblastjumpbook>A spellbook that when equipped with a staff can be used to fling people into the air. Harmless but annoying.</entitydescription.merasmusblastjumpbook>
216218
<!-- Boomboxes -->
217219
<entityname.boombox1>Country Boombox</entityname.boombox1>
218220
<entitydescription.boombox1>"Sweet Home Alabama" by Lynyrd Skynyrd.</entitydescription.boombox1>
@@ -335,9 +337,9 @@
335337
<entitydescription.brassknuckle>Don't bring a gun to a fist fight or you may have the dishonor of being killed with your own firearm. Truly a fistful of frags.</entitydescription.brassknuckle>
336338
<!-- Barricade -->
337339
<entityname.barricade>Barricade</entityname.barricade>
338-
<entitydescription.barricade>Steel beam that can be attached to a wall to provide cover in a gunfight.</entitydescription.barricade>
340+
<entitydescription.barricade>Steel beam that can be attached to a wall to provide cover in a gunfight. Repaired using a welding tool.</entitydescription.barricade>
339341
<entityname.barricadestatic>Barricade Static</entityname.barricadestatic>
340-
<entitydescription.barricadestatic>Steel beam that has been attached to a wall to provide cover in a gunfight.</entitydescription.barricadestatic>
342+
<entitydescription.barricadestatic>Steel beam that has been attached to a wall to provide cover in a gunfight. Repaired using a welding tool.</entitydescription.barricadestatic>
341343
<!-- Blood Cultist Robes -->
342344
<entityname.bloodcultistrobes>Blood Cultist Robes</entityname.bloodcultistrobes>
343345
<entitydescription.bloodcultistrobes>Only craftable by cultists. A simple hooded garment that blood cultists regeneration, immunity to disease and revives them if they die. The robe also serves to conceal their identity whilst letting other fellows cultists recognize them as their own.</entitydescription.bloodcultistrobes>
@@ -380,4 +382,7 @@
380382
<!-- Nexsuit -->
381383
<entityname.nexsuit>Nexsuit</entityname.nexsuit>
382384
<entitydescription.nexsuit>Nexpharma proprietary suit exclusive to their elite paramilitary group, the Mobile Emergency Rescue and Combat Squad, or MERCS. In actuality, it's just a PUCS adapted for combat.</entitydescription.nexsuit>
385+
<!-- Corpse -->
386+
<entityname.corpse>Corpse</entityname.corpse>
387+
<entitydescription.corpse>A rotting source of illness. Dispose of it by throwing it into the sewer or by using a flamer.</entitydescription.corpse>
383388
</infotexts>

Dam Defense/Lua/DD/afflictions.lua

Lines changed: 75 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DD.diseaseData = {
1414
flu = {displayName = 'Flu', immune = 2, immuneVisibility = 1, immuneVisibleStrength = 50, spreadChance = 0.5},
1515
bacterial = {displayName = 'Bacterial', immune = 2, immuneVisibility = 1, immuneVisibleStrength = 50, spreadChance = 0.1, necrotic = true},
1616
tb = {displayName = 'Tuberculosis', immune = 1, immuneVisibility = 1, immuneVisibleStrength = 50, spreadChance = 0.2, necrotic = true},
17-
anthrax = {displayName = 'Anthrax', immune = 0, immuneVisibility = 2, immuneVisibleStrength = 50, spreadChance = 0.1, necrotic = true, spreadToCorpses = true},
17+
anthrax = {displayName = 'Anthrax', immune = 0, immuneVisibility = 2, immuneVisibleStrength = 50, spreadChance = 0.1, necrotic = true},
1818
husk = {displayName = 'Velonaceps Calyx', immune = 0, immuneVisibility = 4, immuneVisibleStrength = 25, spreadChance = 0.1, necrotic = true, item = 'huskeggs'},
1919
}
2020
local getDiseaseStat = function (diseaseName, statName)
@@ -39,30 +39,19 @@ local airborneSpread = function (entity, targets, range, callback)
3939

4040
for target in targets do
4141
local usingHullOxygen = true
42-
local inDistance = true
43-
if (LuaUserData.TypeOf(entity) == 'Barotrauma.Character') or (LuaUserData.TypeOf(entity) == 'Barotrauma.AICharacter') then
42+
if (LuaUserData.TypeOf(target) == 'Barotrauma.Character') or (LuaUserData.TypeOf(target) == 'Barotrauma.AICharacter') then
4443
usingHullOxygen = target.CharacterHealth.GetAfflictionStrengthByIdentifier('airborneprotection', true) <= 0
45-
inDistance = affectedHulls[target.CurrentHull] and (Vector2.Distance(entity.WorldPosition, target.WorldPosition) < range)
4644
end
45+
local inDistance = affectedHulls[target.CurrentHull] and (Vector2.Distance(entity.WorldPosition, target.WorldPosition) < range)
4746
if (target ~= entity) and usingHullOxygen and inDistance then
4847
callback(target)
4948
end
5049
end
5150
end
5251

53-
-- Although this is a luahook (<LuaHook name="..." />) I'm keeping it in this file instead of luahooks.lua
54-
Hook.Add("DD.afflictions.spread", "DD.afflictions.spread", function(effect, deltaTime, item, targets, worldPosition)
55-
if CLIENT and Game.IsMultiplayer then return end
56-
if targets[1] == nil then return end
57-
local character = targets[1]
52+
local characterSpreadAfflictions = function (character)
5853
if character.CharacterHealth.GetAfflictionStrengthByIdentifier('airborneprotection', true) >= 1 then return end
5954

60-
local hull = character.CurrentHull
61-
if hull == nil then return end
62-
63-
local affectedHulls = {[hull] = true}
64-
for otherHull in character.CurrentHull.GetConnectedHulls(false, 3, true) do affectedHulls[otherHull] = true end
65-
6655
local callback = function (other)
6756
if other.IsDead then return end
6857
for diseaseName, data in pairs(DD.diseaseData) do
@@ -77,8 +66,59 @@ Hook.Add("DD.afflictions.spread", "DD.afflictions.spread", function(effect, delt
7766
end
7867
end
7968
end
80-
8169
airborneSpread(character, Character.CharacterList, 750, callback)
70+
end
71+
72+
local corpseItems = {}
73+
for item in Item.ItemList do
74+
if item.HasTag('corpse') then
75+
table.insert(corpseItems, item)
76+
end
77+
end
78+
Hook.Add("DD.corpse.register", "DD.corpse.register", function(effect, deltaTime, item, targets, worldPosition, element)
79+
table.insert(corpseItems, item)
80+
end)
81+
local itemSpreadAfflictions = function (item)
82+
local callback = function (other)
83+
if other.IsDead then return end
84+
for diseaseName, data in pairs(DD.diseaseData) do
85+
local characterInfection = other.CharacterHealth.GetAfflictionStrengthByIdentifier(diseaseName .. 'infection', true)
86+
if (characterInfection <= 0) and (math.random() <= getDiseaseStat(diseaseName, 'spreadChance') / 2) and item.HasTag(diseaseName) then
87+
DD.giveAfflictionCharacter(other, diseaseName .. 'infection', 1)
88+
end
89+
end
90+
end
91+
airborneSpread(item, Character.CharacterList, 750, callback)
92+
93+
local callback = function (other)
94+
local tags = ''
95+
for diseaseName, data in pairs(DD.diseaseData) do
96+
if (not other.HasTag(diseaseName)) and (math.random() <= getDiseaseStat(diseaseName, 'spreadChance') / 2) and item.HasTag(diseaseName) then
97+
tags = tags .. ',' .. diseaseName
98+
end
99+
end
100+
if tags ~= '' then
101+
other.Tags = other.Tags .. tags
102+
if SERVER then
103+
local prop = other.SerializableProperties[Identifier("Tags")]
104+
Networking.CreateEntityEvent(other, Item.ChangePropertyEventData(prop, other))
105+
end
106+
end
107+
end
108+
airborneSpread(item, corpseItems, 750, callback)
109+
end
110+
111+
-- Although this is a luahook (<LuaHook name="..." />) I'm keeping it in this file instead of luahooks.lua
112+
Hook.Add("DD.afflictions.spread", "DD.afflictions.spread", function(effect, deltaTime, item, targets, worldPosition, element)
113+
if CLIENT and Game.IsMultiplayer then return end
114+
if targets[1] == nil then return end
115+
local entity = targets[1]
116+
117+
if LuaUserData.TypeOf(entity) == 'Barotrauma.Item' then
118+
itemSpreadAfflictions(entity)
119+
else
120+
characterSpreadAfflictions(entity)
121+
end
82122
end)
83123

84124
Hook.Add("afflictionUpdate", "DD.bacterialgangrene", function (affliction, characterHealth, limb)
@@ -227,9 +267,25 @@ DD.thinkFunctions.afflictions = function ()
227267
-- max strength has been reached
228268
if (affliction ~= nil) and (affliction.Strength >= 1) then
229269
affliction.SetStrength(0)
230-
-- despawnburn
231-
if affliction.Identifier == 'despawnburn' then
232-
Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab('smokefx'), character.WorldPosition, nil, nil, function (spawnedItem) end)
270+
-- corpse
271+
local diseaseSet = {}
272+
local tags = ''
273+
for diseaseName, data in pairs(DD.diseaseData) do
274+
if getDiseaseStat(diseaseName, 'necrotic') and ((character.CharacterHealth.GetAfflictionStrengthByIdentifier(diseaseName .. 'infection') > 0) or
275+
(DD.isCharacterHusk(character) and diseaseName == 'husk') or
276+
((not DD.isCharacterHusk(character)) and (not DD.isCharacterHumanoid(character)) and diseaseName == 'anthrax')) then
277+
diseaseSet[diseaseName] = true
278+
tags = tags .. ',' .. diseaseName
279+
end
280+
end
281+
if character.Mass > 9 then
282+
Entity.Spawner.AddItemToSpawnQueue(ItemPrefab.GetItemPrefab('corpse'), character.WorldPosition, nil, nil, function (spawnedItem)
283+
spawnedItem.Tags = spawnedItem.Tags .. tags
284+
if SERVER then
285+
local prop = spawnedItem.SerializableProperties[Identifier("Tags")]
286+
Networking.CreateEntityEvent(spawnedItem, Item.ChangePropertyEventData(prop, spawnedItem))
287+
end
288+
end)
233289
end
234290
-- drop items
235291
if character.Inventory ~= nil then

0 commit comments

Comments
 (0)