Skip to content

Commit b717ab9

Browse files
committed
1.2.19
1 parent 519b2f3 commit b717ab9

File tree

6 files changed

+72
-5
lines changed

6 files changed

+72
-5
lines changed

Dam Defense/Localizations/english.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ return {
151151
serialKillerEndVictory = 'Serial killer has won this round! Round ending in 10 seconds.',
152152
serialKillerEndArrested = 'The serial killer has been eliminated.',
153153
serialKillerEnd = 'The serial killer has been arrested.',
154+
serialKillerNearestTarget = 'The nearest prey is {dx} meters {signx} and {dy} meters {signy}.',
154155
-- events/vip.lua
155156
vipMessageBoss = 'You are now a VIP. A body guard, {guardName}, has been assigned to keep you safe from hostiles. Your pay grade has been raised.',
156157
vipMessageBodyguard = 'You have been tasked with keeping VIP {vipName} alive at all costs. Failure will result in immediate termination. Your pay grade has been raised.',
@@ -165,6 +166,10 @@ return {
165166
jobbanNoticeSingular = 'You have been banned from the {jobName} job because: {reason}.',
166167
jobbanNoticePlural = 'You have been banned from {jobName} jobs because: {reason}.',
167168
-- misc
169+
above = 'above',
170+
below = 'below',
171+
toTheRight = 'to the right',
172+
toTheLeft = 'to the left',
168173
bodyguardDead = 'You have died and are not a body guard anymore!',
169174
antagDead = 'You have died and are not an antagonist anymore!',
170175
antagArrested = 'You have died and are not an antagonist anymore!',

Dam Defense/Lua/DD/events/serialKiller.lua

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,50 @@ end, {
1313
goodness = -2,
1414
minimunAlivePercentage = 1.0,
1515

16+
timeToExplode = 5 * 60, -- in seconds
17+
18+
-- messages killer directions towards nearest valid target
19+
informKillerTargetLocation = function (self)
20+
if self.killer.Character == nil then return end
21+
22+
-- get nearest valid target
23+
local pos = self.killer.Character.WorldPosition
24+
local winner
25+
local winnerDistance
26+
for client in Client.ClientList do
27+
if (client ~= self.killer) and not DD.isClientAntagNonTarget(client) then
28+
local distance = Vector2.Distance(pos, client.Character.WorldPosition)
29+
if (winnerDistance == nil) or (distance < winnerDistance) then
30+
winner = client.Character
31+
winnerDistance = distance
32+
end
33+
end
34+
end
35+
if winner == nil then return end
36+
37+
-- one unit in Barotrauma is 1cm, so 100 units is 1 meter
38+
local dy = (winner.WorldPosition.y - pos.y) / 100
39+
local dx = (winner.WorldPosition.x - pos.x) / 100
40+
41+
-- not actually quite the sign of x nor y
42+
local signx
43+
if dx > 0 then
44+
signx = 'to the right'
45+
else
46+
signx = 'to the left'
47+
end
48+
local signy
49+
if dy > 0 then
50+
signy = 'above'
51+
else
52+
signy = 'below'
53+
end
54+
dx = math.round(math.abs(dx), 2)
55+
dy = math.round(math.abs(dy), 2)
56+
57+
DD.messageClient(self.killer, DD.stringLocalize('serialKillerNearestTarget', {dx = dx, dy = dy, signx = signx, signy = signy}), {type = 'Dead', sender = '???'})
58+
end,
59+
1660
getShouldFinish = function (self)
1761
-- guard clause
1862
if self.killer == nil then
@@ -128,8 +172,16 @@ end, {
128172
return
129173
end
130174

131-
local timeToExplode = 10 * 60 -- in seconds
132-
DD.giveAfflictionCharacter(self.parent.killer.Character, 'timepressure', 60/timeToExplode/timesPerSecond)
175+
DD.giveAfflictionCharacter(self.parent.killer.Character, 'timepressure', 60/self.parent.timeToExplode/timesPerSecond)
176+
177+
-- inform killer about nearest target location every minute
178+
if self.parent.informKillerTargetLocationCooldown == nil then self.parent.informKillerTargetLocationCooldown = 30 * timesPerSecond end
179+
if self.parent.informKillerTargetLocationCooldown > 0 then
180+
self.parent.informKillerTargetLocationCooldown = self.parent.informKillerTargetLocationCooldown - 1
181+
else
182+
self.parent.informKillerTargetLocation()
183+
self.parent.informKillerTargetLocationCooldown = 60 * timesPerSecond
184+
end
133185

134186
-- bloodlust when creepy mask is being worn
135187
if DD.isClientCharacterAlive(self.parent.killer) and (self.parent.killer.Character.Inventory.GetItemAt(2) ~= nil) and (self.parent.mask.ID == self.parent.killer.Character.Inventory.GetItemAt(2).ID) then
@@ -160,6 +212,16 @@ end, {
160212
end
161213
if (character.LastAttacker == self.killer.Character) and (character.SpeciesName == 'human') then
162214
self.killsLeftToWin = self.killsLeftToWin - 1
215+
if DD.isClientCharacterAlive(self.killer) then
216+
-- heal damage after kill
217+
self.killer.Character.SetAllDamage(0, 0, 0)
218+
self.killer.Character.Oxygen = 100
219+
self.killer.Character.Bloodloss = 0
220+
self.killer.Character.SetStun(0, true)
221+
-- decrement time pressure after kill
222+
local afflictionPerSecond = 60/self.timeToExplode
223+
self.killer.Character.CharacterHealth.ReduceAfflictionOnAllLimbs('timepressure', (2 * 60) * afflictionPerSecond, nil, self.killer.Character)
224+
end
163225
-- Halloween SFX
164226
for character in Character.CharacterList do
165227
DD.giveAfflictionCharacter(character, 'killerfx', 999)

Dam Defense/Misc/Afflictions.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@
648648
<ReduceAffliction identifier="bleeding" strength="2"/>
649649
<ReduceAffliction identifier="oxygenlow" strength="15.0"/>
650650
</StatusEffect>
651-
<StatValue stattype="MeleeAttackMultiplier" value="2.0" />
651+
<StatValue stattype="MeleeAttackMultiplier" value="3.0" />
652652
</Effect>
653653
<Icon texture="Content/UI/CommandUIAtlas.png" sheetindex="0,2" sheetelementsize="128,128"/>
654654
</Affliction>

Dam Defense/filelist.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<contentpackage name="Dam Defense" modversion="1.2.32" corepackage="False" steamworkshopid="3146664815" gameversion="1.9.7.0">
2+
<contentpackage name="Dam Defense" modversion="1.2.19" corepackage="False" steamworkshopid="3146664815" gameversion="1.9.8.0">
33
<Other file="%ModDir%/CSharp/Client/DamDefense.cs" />
44
<Text file="%ModDir%/Localizations/english.xml" />
55
<Item file="%ModDir%/Items/Jerry.xml" />

Dam Defense/laserlight.png

-8.36 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dam Defense v1.3.0 (EXPERIMENTAL #1)
1+
# Dam Defense v1.2.19
22

33
Read me? How about I read you instead?
44

0 commit comments

Comments
 (0)