Skip to content

Commit f220d1c

Browse files
committed
1.12.14
1 parent 3654317 commit f220d1c

29 files changed

+675
-559
lines changed

Dam Defense/Characters/Humanundead/Humanundead.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<sound file="%ModDir%/Characters/Humanundead/undead_idle1.ogg" state="Idle" range="1000" volume="3" />
3232
<sound file="%ModDir%/Characters/Humanundead/undead_idle2.ogg" state="Idle" range="1000" volume="3" />
3333
<sound file="%ModDir%/Characters/Humanundead/undead_idle3.ogg" state="Idle" range="1000" volume="3" />
34-
<health Vitality="150" DoesBleed="False" CrushDepth="6000" UseHealthWindow="True" BleedingReduction="0" BurnReduction="0.075" ConstantHealthRegeneration="0" HealthRegenerationWhenEating="0" StunImmunity="False" PoisonImmunity="True" ApplyAfflictionColors="True">
34+
<health Vitality="100" DoesBleed="False" CrushDepth="6000" UseHealthWindow="True" BleedingReduction="0" BurnReduction="0.075" ConstantHealthRegeneration="0" HealthRegenerationWhenEating="0" StunImmunity="False" PoisonImmunity="True" ApplyAfflictionColors="True">
3535
<MedUISilhouette texture="Content/UI/Health/MedUI_Silhouette.png" columns="8" rows="2" sourcerect="0,0,1008,748" />
3636
<MedUIExtra texture="Content/UI/Health/MedUIExtra.png" columns="4" rows="4" sourcerect="0,0,1024,1024" />
3737
<Limb name="Head">

Dam Defense/Items/Items.xml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,6 +2938,9 @@
29382938
<StatusEffect type="OnUse" target="UseTarget">
29392939
<ReduceAffliction identifier="burning" amount="20.0" />
29402940
</StatusEffect>
2941+
<StatusEffect type="OnUse" target="Character">
2942+
<ReduceAffliction identifier="burning" amount="20.0" />
2943+
</StatusEffect>
29412944
</RepairTool>
29422945
<Propulsion force="-80" usablein="water" particles="bubbles" />
29432946
<aitarget sightrange="1000" soundrange="1000" fadeouttime="1" />
@@ -5020,7 +5023,7 @@
50205023
<Projectile characterusable="false" hitscan="true" removeonhit="true">
50215024
<ParticleEmitter particle="tracerfirearm" particleamount="1" velocitymin="0" velocitymax="0" colormultiplier="255,200,200,175" scalemultiplier="1,0.8" />
50225025
<Attack structuredamage="6" targetforce="7.5" itemdamage="6" severlimbsprobability="0.2" penetration="0.35">
5023-
<Affliction identifier="gunshotwound" strength="18" />
5026+
<Affliction identifier="gunshotwound" strength="16" />
50245027
<Affliction identifier="bleeding" strength="8" />
50255028
</Attack>
50265029
<StatusEffect type="OnImpact" target="UseTarget">
@@ -5960,10 +5963,10 @@
59605963
<Sprite texture="%ModDir%/Items/lifeessence.png" sourcerect="0,204,192,48" depth="0.55" origin="0.7,0.5" />
59615964
<Body width="320" height="33" density="30" />
59625965
<MeleeWeapon slots="RightHand+LeftHand" aimable="true" AimPos="25,-60" HoldPos="50,-40" AimAngle="-90" HoldAngle="0" handle1="-60,0" handle2="-20,-5" reload="1" swing="false" range="100" combatpriority="15" msg="ItemMsgPickUpSelect">
5963-
<StatusEffect type="OnActive" target="Character" SpeedMultiplier="1.15" setvalue="true" />
5966+
<StatusEffect type="OnActive" target="Character" SpeedMultiplier="1.1" setvalue="true" />
59645967
<Attack structuredamage="2" itemdamage="4" targetimpulse="10">
5965-
<Affliction identifier="lacerations" strength="15" />
5966-
<Affliction identifier="bleeding" strength="15" />
5968+
<Affliction identifier="lacerations" strength="12" />
5969+
<Affliction identifier="bleeding" strength="12" />
59675970
<Affliction identifier="stun" strength="0.3" />
59685971
<StatusEffect type="OnUse" target="UseTarget">
59695972
<Conditional entitytype="eq Character" />

Dam Defense/Localizations/english.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ return {
159159
vipEndNoReward = 'The VIP is dead! No one has been rewarded for their death.',
160160
-- events/wizard.lua
161161
wizardEnd = 'The wizard has been slain!',
162+
-- events/chimera.lua
163+
chimeraEnd = 'The chimera has been slain!',
162164
-- console commands
163165
jobbanNoticeSingular = 'You have been banned from the {jobName} job because: {reason}.',
164166
jobbanNoticePlural = 'You have been banned from {jobName} jobs because: {reason}.',
@@ -255,6 +257,8 @@ return {
255257
wikiText_wizardEvent = 'This is a side event where a player is spawned in as a wizard. His objective is to cause chaos and mayhem, although this does not mean the wizard is an antagonist, for he can act good or evil.\nThe wizard spawns with, amongst other items, a staff and some spellbooks. When the staff and a spellbook are both held at once, spells can be cast.',
256258
wikiName_mercsEvent = 'MERCS Event',
257259
wikiText_mercsEvent = 'This is a side event where a player will be spawned as a member of the Mobile Emergency Rescue and Combat Squad (abbreviated: MERCS). Their goal is to assist security and they are essentially a super cop, even counting as a member of security. They look very similar to the Death Squadders, but have an entirely different objective.',
260+
wikiName_chimeraEvent = 'Chimera Event',
261+
wikiText_chimeraEvent = 'This is a side event where a player will be spawned as a husk chimera. Their objective is to kill or infect the humans. Like all undead, if the ragdoll key is held, it will enter into a regenerative state.',
258262
wikiName_electionEvent = 'Election Event',
259263
wikiText_electionEvent = 'This is a side event where you can vote yes to replace the current captain or vote no to keep him! Head to your nearest ballot box, insert your desired amount of Nexcredits (TM) and press "Vote Yes" or "Vote No". Each player once per round can start an election event if there is no ongoing main event or election event by doing "/election".',
260264
wikiName_withdrawEvent = 'Withdraw Event',
@@ -350,11 +354,12 @@ return {
350354
wikiText_mediumsteelcabinetItem = 'Can fit an entire person inside -- useful for hiding.',
351355
wikiText_nexshop1Item = 'This page links to all items which can be bought in a Nexshop (TM).',
352356
wikiText_nukieshop1Item = 'This page links to all items which can be bought in a Nukieshop.',
357+
wikiText_secnexshopItem = 'This page links to all items which can be bought in a Security Nexshop (TM).',
353358
-- wiki creatures
354359
wikiName_spitroachCreature = 'Spitroach',
355360
wikiText_spitroachCreature = 'An annoying cowardly pest that breeds and grows fast. They run up close, spit their acid, run away and repeat, usually in a synchronized group motion. When no targets are in sight, they spit on their walls, causing leaks and trouble. Immune to acid burns.',
356361
wikiName_huskCreature = 'Husks',
357-
wikiText_huskCreature = 'A diver infected with the Velonaceps Calyx parasite. Contagious and disruptive enemies capable of ending rounds by themselves occasionally due to their infectious nature. After some time has elapsed they will grow into husk prowlers, a stronger and more savage form.',
362+
wikiText_huskCreature = 'A human or creature infected with the Velonaceps Calyx parasite. Contagious and disruptive enemies capable of ending rounds by themselves occasionally due to their infectious nature. After some time has elapsed basic husks will grow into husk prowlers, a stronger and more savage form. All undead, including husks, can hold the ragdoll key to enter a regenerative state.',
358363
wikiName_greenskinCreature = 'Greenskins',
359364
wikiText_greenskinCreature = 'Both Goblins and Trolls appear as green hairless humanoids wearing green clown masks. They are immune to all forms of stun, move swiftly in water, explode upon death, and can also put masks on both living and dead humans to instantly convert them into a greenskin. Goblins are weaker and smaller than humans, but are faster than them, making them effective hit and run fighters when they have stun capability. Trolls, however are slower, tankier and dumber, being unable to use any items, but to compensate have a very powerful melee attack.\nGreenskins spawn with midazolam, methamphetamine, a few goblin masks, and eight (8) goblin crates. Goblins and Trolls can drop goblin crates on the ground to both hide inside of and also heal themselves of regular damage. Midazolam instantly heals and stuns, for more information view its wiki page.',
360365
-- wiki afflictions

Dam Defense/Lua/DD/commands.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ local func = function (args)
155155
end
156156

157157
local event = eventClass.new(unpack(eventArgs))
158+
event.manuallyTriggered = true
158159
event.start()
159160

160161
if event.isMainEvent then

Dam Defense/Lua/DD/eventDirector.lua

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ require 'DD/events/mercs'
2020
require 'DD/events/deathSquad'
2121
require 'DD/events/election'
2222
require 'DD/events/wizard'
23+
require 'DD/events/chimera'
2324

2425
-- Event director table
2526
DD.eventDirector = {}
@@ -48,6 +49,7 @@ DD.eventDirector.eventPool = {
4849
DD.eventElection,
4950
DD.eventWizard,
5051
DD.eventGang,
52+
DD.eventChimera,
5153
}
5254
DD.eventDirector.goodness = 0
5355
DD.eventDirector.events = {}
@@ -59,9 +61,9 @@ DD.eventDirector.mainEventCap = 1 -- how many main events can be active at the s
5961
DD.eventDirector.canMainEventBeRegularEvent = false -- can a main event be called when a regular event is to be started
6062
DD.eventDirector.mainEventsDisableRespawning = true -- if there is any active main event then respawning will be disabled
6163
DD.eventDirector.goodnessBiasInitial = -3 -- offsets goodness
62-
DD.eventDirector.goodnessBiasGrowth = 1 / 60 / 10 -- per second
64+
DD.eventDirector.goodnessBiasGrowth = 1 / 60 / 5 -- per second
6365
DD.eventDirector.cooldownDecrementInitial = 1 -- per second
64-
DD.eventDirector.cooldownDecrementGrowth = 1 / 60 / 20 -- per second
66+
DD.eventDirector.cooldownDecrementGrowth = 1 / 60 / 30 -- per second
6567

6668
-- Debug function
6769
DD.eventDirector.debug = function (list)
@@ -90,10 +92,16 @@ DD.eventDirector.listEvents = function ()
9092
text = text .. eventClientKey .. ' = '
9193
if type(event[eventClientKey]) == 'table' then
9294
text = text .. '{ '
95+
local bool = true
9396
for other in event[eventClientKey] do
9497
text = text .. '"' .. other.Name .. '", '
98+
bool = false
99+
end
100+
if bool then
101+
text = text .. '}'
102+
else
103+
text = string.sub(text, 1, #text - #', ') .. ' }'
95104
end
96-
text = string.sub(text, 1, #text - #', ') .. ' }'
97105
elseif event[eventClientKey] ~= nil then
98106
text = text .. '"' .. event[eventClientKey].Name .. '"'
99107
end
@@ -300,18 +308,6 @@ Hook.Add("character.death", "DD.friendlyFireDetector", function(character)
300308
return true
301309
end)
302310

303-
304-
-- calculates the weight of an event
305-
local calculateEventWeight = function (eventClass)
306-
if ((eventClass.tbl.isMainEvent ~= isMainEvent) and not (eventClass.tbl.isMainEvent and DD.eventDirector.canMainEventBeRegularEvent)) or
307-
(eventClass.tbl.minimunAlivePercentage > alivePercentage) or (eventClass.tbl.minimunDeadPercentage > deadPercentage) then
308-
return 0
309-
end
310-
local directorGoodness = DD.eventDirector.goodness + DD.eventDirector.goodnessBiasInitial + DD.eventDirector.goodnessBiasGrowth * DD.roundTimer
311-
local weight = eventClass.tbl.weight / math.max(0.5, math.abs(eventClass.tbl.goodness + directorGoodness))
312-
return math.max(0, weight)
313-
end
314-
315311
-- Start a new event
316312
DD.eventDirector.startNewEvent = function (isMainEvent)
317313
local isMainEvent = isMainEvent
@@ -330,6 +326,17 @@ DD.eventDirector.startNewEvent = function (isMainEvent)
330326
end
331327
local alivePercentage = alive / players
332328
local deadPercentage = 1 - alivePercentage
329+
330+
-- calculates the weight of an event
331+
local calculateEventWeight = function (eventClass)
332+
if ((eventClass.tbl.isMainEvent ~= isMainEvent) and not (eventClass.tbl.isMainEvent and DD.eventDirector.canMainEventBeRegularEvent)) or
333+
(eventClass.tbl.minimunAlivePercentage > alivePercentage) or (eventClass.tbl.minimunDeadPercentage > deadPercentage) or (DD.roundTimer < eventClass.tbl.minimunTimeElapsed) then
334+
return 0
335+
end
336+
local directorGoodness = DD.eventDirector.goodness + DD.eventDirector.goodnessBiasInitial + DD.eventDirector.goodnessBiasGrowth * DD.roundTimer
337+
local weight = eventClass.tbl.weight / math.max(0.5, math.abs(eventClass.tbl.goodness + directorGoodness))
338+
return math.max(0, weight)
339+
end
333340

334341
-- Get weights
335342
local weights = {}
@@ -417,7 +424,7 @@ DD.roundStartFunctions.eventDirector = function ()
417424
DD.eventDirector.goodness = 0
418425
DD.eventDirector.mainEvent = nil
419426
DD.eventDirector.events = {}
420-
DD.eventDirector.cooldown = 60 * 4
427+
DD.eventDirector.cooldown = 60 * 2
421428
DD.eventDirector.mainEventCooldown = 60 * 8
422429
end
423430

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ DD.eventAffliction = DD.class(DD.eventBase, nil, {
55
cooldown = 0,
66
weight = 0,
77
goodness = 0,
8+
minimunTimeElapsed = 5 * 60,
89

910
identifier = '',
1011
minamount = 0,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ DD.eventAirdropArtifact = DD.class(DD.eventAirdrop, nil, {
158158
cooldown = 60 * 2,
159159
weight = 1.5,
160160
goodness = 0,
161+
minimunTimeElapsed = 5 * 60,
161162

162163
spawnPosition = 'dd_airdropartifact',
163164
crateIdentifier = 'none',

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ end, {
55
paramType = {}, -- correct type for each parameter of the constructor function of this class
66
clientKeys = {}, -- keys of properties of this event that are a client or a client list (useful for finding what clients are participanting in an event)
77
public = true, -- determines if event will be listed in "/publicevents"
8+
manuallyTriggered = false, -- if triggered manually by an admin using a command this will be true
89

910
logClients = function (self, set)
1011
local text = '{clientName} is a member of the "{eventName}" event ({seed}) under the key "{keyName}".'
@@ -52,18 +53,24 @@ end, {
5253
local deadPercentage = 1 - alivePercentage
5354

5455
-- enforce restrictions
55-
if self.isMainEvent then self.instanceCap = 1 end
56-
if (DD.eventDirector.mainEventCap >= 0) and self.isMainEvent and (#DD.eventDirector.getMainEvents() >= DD.eventDirector.mainEventCap) then
57-
self.fail('limit on main events has been reached')
58-
return
59-
end
60-
if (self.instanceCap >= 0) and (#DD.eventDirector.getEventInstances(self.name) >= self.instanceCap) then
61-
self.fail('limit on instances of this event has been reached')
62-
return
63-
end
64-
if (self.minimunAlivePercentage > alivePercentage) or (self.minimunDeadPercentage > deadPercentage) then
65-
self.fail('minimun alive percentage or minimun dead percentage were not met')
66-
return
56+
if not self.manuallyTriggered then
57+
if self.isMainEvent then self.instanceCap = 1 end
58+
if DD.roundTimer < self.minimunTimeElapsed then
59+
self.fail('not enough time has elapsed since the round started')
60+
return
61+
end
62+
if (DD.eventDirector.mainEventCap >= 0) and self.isMainEvent and (#DD.eventDirector.getMainEvents() >= DD.eventDirector.mainEventCap) then
63+
self.fail('limit on main events has been reached')
64+
return
65+
end
66+
if (self.instanceCap >= 0) and (#DD.eventDirector.getEventInstances(self.name) >= self.instanceCap) then
67+
self.fail('limit on instances of this event has been reached')
68+
return
69+
end
70+
if (self.minimunAlivePercentage > alivePercentage) or (self.minimunDeadPercentage > deadPercentage) then
71+
self.fail('minimun alive percentage or minimun dead percentage were not met')
72+
return
73+
end
6774
end
6875

6976
-- Create hooks
@@ -139,6 +146,7 @@ end, {
139146
goodness = 0, -- for eventDirector
140147
minimunAlivePercentage = 0.0, -- minimun percentage of alive players required when event starts
141148
minimunDeadPercentage = 0.0, -- minimun percentage of dead players required when event starts
149+
minimunTimeElapsed = 0, -- minimun amount of time in seconds elapsed since the round started
142150

143151
onStart = function (self) return end,
144152

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ DD.eventBlackout = DD.class(DD.eventWithStartBase, nil, {
55
cooldown = 60 * 3,
66
weight = 0.8,
77
goodness = -1,
8+
minimunTimeElapsed = 5 * 60,
89

910
onStart = function (self)
1011
self.doors = {}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ end, {
145145
local nonCultistsSet = DD.setSubtract(aliveSet, self.cultistsSet)
146146

147147
-- Event requires 2 (or more) cultists and 3 (or more) non-cultist
148-
if (DD.tableSize(self.cultists) <= 1) or (DD.tableSize(nonCultistsSet) <= 2) then
148+
if (DD.tableSize(self.cultists) <= 1) or ((DD.tableSize(nonCultistsSet) <= 2) and not self.manuallyTriggered) then
149149
self.fail('conditions to start could not be met')
150150
return
151151
else

0 commit comments

Comments
 (0)