mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Added a few config options regarding health thresholds and the availability of various ways of revival.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2363 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
+111
-80
@@ -41,6 +41,15 @@
|
||||
var/server
|
||||
var/banappeals
|
||||
|
||||
//game_options.txt configs
|
||||
|
||||
var/health_threshold_crit = 0
|
||||
var/health_threshold_dead = 0
|
||||
|
||||
var/revival_pod_plants = 1
|
||||
var/revival_cloning = 1
|
||||
var/revival_brain_life = -1
|
||||
|
||||
/datum/configuration/New()
|
||||
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
|
||||
for (var/T in L)
|
||||
@@ -59,11 +68,11 @@
|
||||
del(M)
|
||||
src.votable_modes += "secret"
|
||||
|
||||
/datum/configuration/proc/load(filename)
|
||||
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
|
||||
var/text = file2text(filename)
|
||||
|
||||
if (!text)
|
||||
diary << "No config.txt file found, setting defaults"
|
||||
diary << "No [filename] file found, setting defaults"
|
||||
src = new /datum/configuration()
|
||||
return
|
||||
|
||||
@@ -94,118 +103,140 @@
|
||||
if (!name)
|
||||
continue
|
||||
|
||||
switch (name)
|
||||
if ("log_ooc")
|
||||
config.log_ooc = 1
|
||||
if(type == "config")
|
||||
switch (name)
|
||||
if ("log_ooc")
|
||||
config.log_ooc = 1
|
||||
|
||||
if ("log_access")
|
||||
config.log_access = 1
|
||||
if ("log_access")
|
||||
config.log_access = 1
|
||||
|
||||
if ("sql_enabled")
|
||||
config.sql_enabled = text2num(value)
|
||||
if ("sql_enabled")
|
||||
config.sql_enabled = text2num(value)
|
||||
|
||||
if ("log_say")
|
||||
config.log_say = 1
|
||||
if ("log_say")
|
||||
config.log_say = 1
|
||||
|
||||
if ("log_admin")
|
||||
config.log_admin = 1
|
||||
if ("log_admin")
|
||||
config.log_admin = 1
|
||||
|
||||
if ("log_game")
|
||||
config.log_game = 1
|
||||
if ("log_game")
|
||||
config.log_game = 1
|
||||
|
||||
if ("log_vote")
|
||||
config.log_vote = 1
|
||||
if ("log_vote")
|
||||
config.log_vote = 1
|
||||
|
||||
if ("log_whisper")
|
||||
config.log_whisper = 1
|
||||
if ("log_whisper")
|
||||
config.log_whisper = 1
|
||||
|
||||
if ("allow_vote_restart")
|
||||
config.allow_vote_restart = 1
|
||||
if ("allow_vote_restart")
|
||||
config.allow_vote_restart = 1
|
||||
|
||||
if ("allow_vote_mode")
|
||||
config.allow_vote_mode = 1
|
||||
if ("allow_vote_mode")
|
||||
config.allow_vote_mode = 1
|
||||
|
||||
if ("allow_admin_jump")
|
||||
config.allow_admin_jump = 1
|
||||
if ("allow_admin_jump")
|
||||
config.allow_admin_jump = 1
|
||||
|
||||
if("allow_admin_rev")
|
||||
config.allow_admin_rev = 1
|
||||
if("allow_admin_rev")
|
||||
config.allow_admin_rev = 1
|
||||
|
||||
if ("allow_admin_spawning")
|
||||
config.allow_admin_spawning = 1
|
||||
if ("allow_admin_spawning")
|
||||
config.allow_admin_spawning = 1
|
||||
|
||||
if ("no_dead_vote")
|
||||
config.vote_no_dead = 1
|
||||
if ("no_dead_vote")
|
||||
config.vote_no_dead = 1
|
||||
|
||||
if ("default_no_vote")
|
||||
config.vote_no_default = 1
|
||||
if ("default_no_vote")
|
||||
config.vote_no_default = 1
|
||||
|
||||
if ("vote_delay")
|
||||
config.vote_delay = text2num(value)
|
||||
if ("vote_delay")
|
||||
config.vote_delay = text2num(value)
|
||||
|
||||
if ("vote_period")
|
||||
config.vote_period = text2num(value)
|
||||
if ("vote_period")
|
||||
config.vote_period = text2num(value)
|
||||
|
||||
if ("allow_ai")
|
||||
config.allow_ai = 1
|
||||
if ("allow_ai")
|
||||
config.allow_ai = 1
|
||||
|
||||
if ("authentication")
|
||||
config.enable_authentication = 1
|
||||
if ("authentication")
|
||||
config.enable_authentication = 1
|
||||
|
||||
if ("norespawn")
|
||||
config.respawn = 0
|
||||
if ("norespawn")
|
||||
config.respawn = 0
|
||||
|
||||
if ("servername")
|
||||
config.server_name = value
|
||||
if ("servername")
|
||||
config.server_name = value
|
||||
|
||||
if ("serversuffix")
|
||||
config.server_suffix = 1
|
||||
if ("serversuffix")
|
||||
config.server_suffix = 1
|
||||
|
||||
if ("medalhub")
|
||||
config.medal_hub = value
|
||||
if ("medalhub")
|
||||
config.medal_hub = value
|
||||
|
||||
if ("medalpass")
|
||||
config.medal_password = value
|
||||
if ("medalpass")
|
||||
config.medal_password = value
|
||||
|
||||
if ("hostedby")
|
||||
config.hostedby = value
|
||||
if ("hostedby")
|
||||
config.hostedby = value
|
||||
|
||||
if ("server")
|
||||
config.server = value
|
||||
if ("server")
|
||||
config.server = value
|
||||
|
||||
if ("banappeals")
|
||||
config.banappeals = value
|
||||
if ("banappeals")
|
||||
config.banappeals = value
|
||||
|
||||
if ("guest_jobban")
|
||||
config.guest_jobban = text2num(value)
|
||||
if ("guest_jobban")
|
||||
config.guest_jobban = text2num(value)
|
||||
|
||||
if ("usewhitelist")
|
||||
config.usewhitelist = 1
|
||||
if ("usewhitelist")
|
||||
config.usewhitelist = 1
|
||||
|
||||
if ("feature_object_spell_system")
|
||||
config.feature_object_spell_system = 1
|
||||
if ("feature_object_spell_system")
|
||||
config.feature_object_spell_system = 1
|
||||
|
||||
if ("traitor_scaling")
|
||||
config.traitor_scaling = 1
|
||||
if ("traitor_scaling")
|
||||
config.traitor_scaling = 1
|
||||
|
||||
if ("probability")
|
||||
var/prob_pos = findtext(value, " ")
|
||||
var/prob_name = null
|
||||
var/prob_value = null
|
||||
if ("probability")
|
||||
var/prob_pos = findtext(value, " ")
|
||||
var/prob_name = null
|
||||
var/prob_value = null
|
||||
|
||||
if (prob_pos)
|
||||
prob_name = lowertext(copytext(value, 1, prob_pos))
|
||||
prob_value = copytext(value, prob_pos + 1)
|
||||
if (prob_name in config.modes)
|
||||
config.probabilities[prob_name] = text2num(prob_value)
|
||||
if (prob_pos)
|
||||
prob_name = lowertext(copytext(value, 1, prob_pos))
|
||||
prob_value = copytext(value, prob_pos + 1)
|
||||
if (prob_name in config.modes)
|
||||
config.probabilities[prob_name] = text2num(prob_value)
|
||||
else
|
||||
diary << "Unknown game mode probability configuration definition: [prob_name]."
|
||||
else
|
||||
diary << "Unknown game mode probability configuration definition: [prob_name]."
|
||||
diary << "Incorrect probability configuration definition: [prob_name] [prob_value]."
|
||||
|
||||
if ("kick_inactive")
|
||||
config.kick_inactive = text2num(value)
|
||||
|
||||
else
|
||||
diary << "Incorrect probability configuration definition: [prob_name] [prob_value]."
|
||||
if ("kick_inactive")
|
||||
config.kick_inactive = text2num(value)
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
else if(type == "game_options")
|
||||
if(!value)
|
||||
diary << "Unknown value for setting [name] in [filename]."
|
||||
value = text2num(value)
|
||||
|
||||
switch(name)
|
||||
if("health_threshold_crit")
|
||||
config.health_threshold_crit = value
|
||||
if("health_threshold_dead")
|
||||
config.health_threshold_dead = value
|
||||
if("revival_pod_plants")
|
||||
config.revival_pod_plants = value
|
||||
if("revival_cloning")
|
||||
config.revival_cloning = value
|
||||
if("revival_brain_life")
|
||||
config.revival_brain_life = value
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
/datum/configuration/proc/loadsql(filename) // -- TLE
|
||||
var/text = file2text(filename)
|
||||
|
||||
+2
-1
@@ -844,7 +844,7 @@
|
||||
//Shifting the brain "mob" over to the brain object so it's easier to keep track of. --NEO
|
||||
//WASSSSSUUUPPPP /N
|
||||
spawn(5)
|
||||
if(brainmob&&brainmob.client)
|
||||
if(brainmob && brainmob.client)
|
||||
brainmob.client.screen.len = null //clear the hud
|
||||
|
||||
proc
|
||||
@@ -854,6 +854,7 @@
|
||||
brainmob.name = H.real_name
|
||||
brainmob.real_name = H.real_name
|
||||
brainmob.dna = H.dna
|
||||
brainmob.timeofhostdeath = H.timeofdeath
|
||||
if(H.mind)
|
||||
H.mind.transfer_to(brainmob)
|
||||
brainmob << "\blue You might feel slightly disoriented. That's normal when your brain gets cut out."
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
/world/proc/load_configuration()
|
||||
config = new /datum/configuration()
|
||||
config.load("config/config.txt")
|
||||
config.load("config/game_options.txt","game_options")
|
||||
config.loadsql("config/dbconfig.txt")
|
||||
config.loadforumsql("config/forumdbconfig.txt")
|
||||
// apply some settings from config..
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
var/mob/selected = find_dead_player("[C.fields["ckey"]]")
|
||||
|
||||
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
|
||||
if ((!selected) || (!src.pod1) || (src.pod1.occupant) || (src.pod1.mess))
|
||||
if ((!selected) || (!src.pod1) || (src.pod1.occupant) || (src.pod1.mess) || !config.revival_cloning)
|
||||
src.temp = "Unable to initiate cloning cycle." // most helpful error message in THE HISTORY OF THE WORLD
|
||||
else if (src.pod1.growclone(selected, C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"],C.fields["changeling"]))
|
||||
src.temp = "Cloning cycle activated."
|
||||
|
||||
@@ -835,7 +835,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
/obj/item/seeds/replicapod/harvest(mob/user = usr) //now that one is fun -- Urist
|
||||
var/obj/machinery/hydroponics/parent = loc
|
||||
|
||||
if(ckey) //if there's human data stored in it, make a human
|
||||
if(ckey && config.revival_pod_plants) //if there's human data stored in it, make a human
|
||||
var/mob/ghost = find_dead_player("[ckey]")
|
||||
|
||||
var/mob/living/carbon/human/podman = new /mob/living/carbon/human(parent.loc)
|
||||
|
||||
@@ -88,9 +88,9 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -89,9 +89,9 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -408,9 +408,9 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -90,9 +90,9 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100 || src.brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || src.brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -335,9 +335,9 @@
|
||||
if(resting)
|
||||
weakened = max(weakened, 5)
|
||||
|
||||
if(health < -100 || brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(health < 0)
|
||||
else if(health < config.health_threshold_crit)
|
||||
if(health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!rejuv) oxyloss++
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/mob/living/carbon/brain
|
||||
var
|
||||
obj/item/device/mmi/container = null
|
||||
timeofhostdeath = 0
|
||||
|
||||
New()
|
||||
var/datum/reagents/R = new/datum/reagents(1000)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/mob/living/carbon/brain/death(gibbed)
|
||||
if(!gibbed&&container)//If not gibbed but in a container.
|
||||
if(!gibbed && container)//If not gibbed but in a container.
|
||||
for(var/mob/O in viewers(container, null))
|
||||
O.show_message(text("\red <B>[]'s MMI flatlines!</B>", src), 1, "\red You hear something flatline.", 2)
|
||||
container.icon_state = "mmi_dead"
|
||||
|
||||
@@ -155,9 +155,9 @@
|
||||
if(resting)
|
||||
weakened = max(weakened, 5)
|
||||
|
||||
if(health < -100 && stat != 2)
|
||||
if(stat != 2 && (!container && (health < config.health_threshold_dead || (config.revival_brain_life >= 0 && ((world.time - timeofhostdeath) > config.revival_brain_life )))))
|
||||
death()
|
||||
else if(health < 0)
|
||||
else if(health < config.health_threshold_crit)
|
||||
if(health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!rejuv) oxyloss++
|
||||
|
||||
@@ -663,9 +663,9 @@
|
||||
if(resting)
|
||||
weakened = max(weakened, 3)
|
||||
|
||||
if(health < -100 || brain_op_stage == 4.0)
|
||||
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
|
||||
death()
|
||||
else if(health < 0)
|
||||
else if(health < config.health_threshold_crit)
|
||||
if(health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!rejuv) oxyloss++
|
||||
|
||||
@@ -403,11 +403,11 @@
|
||||
|
||||
|
||||
|
||||
if(health < -100)
|
||||
if(health < config.health_threshold_dead && stat != 2)
|
||||
death()
|
||||
return
|
||||
|
||||
else if(src.health < -50)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
// if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -408,9 +408,9 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < -100)
|
||||
if(health < config.health_threshold_dead && stat != 2)
|
||||
death()
|
||||
else if(src.health < 0)
|
||||
else if(src.health < config.health_threshold_crit)
|
||||
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
|
||||
|
||||
//if(!src.rejuv) src.oxyloss++
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
|
||||
|
||||
|
||||
if (src.health <= -100.0)
|
||||
if (src.health <= config.health_threshold_dead)
|
||||
death()
|
||||
return
|
||||
// else if (src.health < 0 && !istype(src.loc, /obj/machinery/computer/aifixer)) //Removing this for now, as it's bloody annoying. We'll see how it works -- Urist
|
||||
// else if (src.health < config.health_threshold_crit && !istype(src.loc, /obj/machinery/computer/aifixer)) //Removing this for now, as it's bloody annoying. We'll see how it works -- Urist
|
||||
// src.oxyloss++
|
||||
|
||||
if (src.machine)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
if (src.stat == 2)
|
||||
return
|
||||
else
|
||||
if (src.health <= -100.0 && src.stat != 2)
|
||||
if (src.health <= config.health_threshold_dead && src.stat != 2)
|
||||
death()
|
||||
return
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
if(src.stat)
|
||||
src.camera.status = 0
|
||||
|
||||
health = 300 - (oxyloss + fireloss + bruteloss)
|
||||
health = 200 - (oxyloss + fireloss + bruteloss)
|
||||
|
||||
if(oxyloss > 50) paralysis = max(paralysis, 3)
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
if(src.resting)
|
||||
src.weakened = max(src.weakened, 5)
|
||||
|
||||
if(health < 0 && src.stat != 2) //die only once
|
||||
if(health < config.health_threshold_dead && src.stat != 2) //die only once
|
||||
death()
|
||||
|
||||
if (src.stat != 2) //Alive.
|
||||
|
||||
Reference in New Issue
Block a user