-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged infection/poison features into one
-Removed poison condition -Changed infection to work differently. Whenever a hive zombie bites with infection skills, a human will be infected, causing the condition to be dormant for a period of time and then once active deal continous damage
- Loading branch information
1 parent
561ed0b
commit a18c73b
Showing
9 changed files
with
66 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
local class = require('code.libs.middleclass') | ||
local dice = require('code.libs.dice') | ||
|
||
local infection = class('infection') | ||
|
||
local MAX_TIME = 1023 | ||
local MAX_TIME = 511 | ||
local INCUBATION_DEFAULT = '1d1' --'1d80+20' | ||
local INFECTION_DAMAGE_PER_TICK = -1 | ||
|
||
function infection:initialize() | ||
self.time = 0 | ||
self.incubation_timer = 0 | ||
self.is_infected = false | ||
end | ||
|
||
function infection:add(amount, player) | ||
self.time = math.max(self.time + amount, 0) | ||
if self.time >= MAX_TIME then | ||
player:killed('infection') | ||
end | ||
function infection:add() | ||
print('Player has just been infected!') | ||
self.incubation_timer = dice.roll(INCUBATION_DEFAULT) | ||
self.is_infected = true | ||
end | ||
|
||
function infection:elapse(player, time) | ||
self:add(time, player) | ||
function infection:remove(player) | ||
print('Player has been cured of infection!') | ||
self.incubation_timer = 0 | ||
self.is_infected = false | ||
end | ||
|
||
function infection:getTime() return self.time end | ||
function infection:addImmunity(time) self.incubation_timer = math.min(MAX_TIME, self.incubation_timer + time) end | ||
|
||
function infection:isActive() return self.is_infected end | ||
|
||
return infection | ||
function infection:isImmune() return (self.is_infected and self.incubation_timer > 0) end | ||
|
||
--[[ | ||
you have 0 infection = aka 21 days to live | ||
you get attacked lose about 30 hp from bites | ||
ie... make infection 1d2, 1d3, 1d4 from bites? | ||
function infection:elapse(player, time) | ||
if not self.is_infected then return end | ||
|
||
if self.incubation_timer > 0 then | ||
self.incubation_timer = math.max(self.incubation_timer - time, 0) | ||
else -- infection is no longer dormant | ||
player:updateStat('hp', INFECTION_DAMAGE_PER_TICK) | ||
print('Player takes damage for infection!') | ||
end | ||
end | ||
|
||
21 days | ||
knockoff @ 60 hp (ie. 59 damage) should remove 5/7 days? | ||
7x50 = 350 | ||
5x50 = 250 | ||
3x50 = 150 | ||
--]] | ||
return infection |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.