mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-25 09:41:29 +00:00
Wave 2 of tweaks, probably needs a little more
Ripped out the preferences_savefile.dm because it's obsolete and we don't use it
This commit is contained in:
@@ -66,7 +66,7 @@ CREATE TABLE `characters` (
|
||||
`med_record` mediumtext NOT NULL,
|
||||
`sec_record` mediumtext NOT NULL,
|
||||
`gen_record` mediumtext NOT NULL,
|
||||
`be_special` mediumint(8) NOT NULL,
|
||||
`be_role` mediumtext NOT NULL,
|
||||
`disabilities` mediumint(8) NOT NULL,
|
||||
`player_alt_titles` mediumtext NOT NULL,
|
||||
`organ_data` mediumtext NOT NULL,
|
||||
@@ -233,7 +233,7 @@ CREATE TABLE `player` (
|
||||
`UI_style` varchar(10) DEFAULT 'Midnight',
|
||||
`UI_style_color` varchar(7) DEFAULT '#ffffff',
|
||||
`UI_style_alpha` smallint(4) DEFAULT '255',
|
||||
`be_special` mediumint(8) DEFAULT '0',
|
||||
`be_role` mediumtext NOT NULL,
|
||||
`default_slot` smallint(4) DEFAULT '1',
|
||||
`toggles` mediumint(8) DEFAULT '383',
|
||||
`sound` mediumint(8) DEFAULT '31',
|
||||
|
||||
@@ -66,7 +66,7 @@ CREATE TABLE `SS13_characters` (
|
||||
`med_record` mediumtext NOT NULL,
|
||||
`sec_record` mediumtext NOT NULL,
|
||||
`gen_record` mediumtext NOT NULL,
|
||||
`be_special` mediumint(8) NOT NULL,
|
||||
`be_role` mediumtext NOT NULL,
|
||||
`disabilities` mediumint(8) NOT NULL,
|
||||
`player_alt_titles` mediumtext NOT NULL,
|
||||
`organ_data` mediumtext NOT NULL,
|
||||
@@ -233,7 +233,7 @@ CREATE TABLE `SS13_player` (
|
||||
`UI_style` varchar(10) DEFAULT 'Midnight',
|
||||
`UI_style_color` varchar(7) DEFAULT '#ffffff',
|
||||
`UI_style_alpha` smallint(4) DEFAULT '255',
|
||||
`be_special` mediumint(8) DEFAULT '0',
|
||||
`be_role` mediumtext NOT NULL,
|
||||
`default_slot` smallint(4) DEFAULT '1',
|
||||
`toggles` mediumint(8) DEFAULT '383',
|
||||
`sound` mediumint(8) DEFAULT '31',
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define ROLE_HOG_CULTIST "hand of god: cultist"
|
||||
#define ROLE_RAIDER "vox raider"
|
||||
#define ROLE_VAMPIRE "vampire"
|
||||
#define ROLE_MUTINEER "mutineer"
|
||||
|
||||
|
||||
//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
|
||||
@@ -47,8 +48,9 @@ var/global/list/special_roles = list(
|
||||
ROLE_GANG = /datum/game_mode/gang,
|
||||
ROLE_SHADOWLING = /datum/game_mode/shadowling,
|
||||
ROLE_ABDUCTOR = /datum/game_mode/abduction,
|
||||
ROLE_HOG_GOD = /datum/game_mode/hand_of_god,
|
||||
ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god,
|
||||
// ROLE_HOG_GOD = /datum/game_mode/hand_of_god,
|
||||
// ROLE_HOG_CULTIST = /datum/game_mode/hand_of_god,
|
||||
ROLE_RAIDER = /datum/game_mode/heist,
|
||||
ROLE_VAMPIRE = /datum/game_mode/vampire,
|
||||
ROLE_MUTINEER = /datum/game_mode/mutiny,
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
return
|
||||
checking = 1
|
||||
user << "<span class='notice'>The device is now checking for possible borgs.</span>"
|
||||
var/list/mob/dead/observer/borg_candidates = pollCandidates("Do you want to play as a Syndicate [borg_to_spawn] borg?", "operative", 1, BE_OPERATIVE, 300)
|
||||
var/list/mob/dead/observer/borg_candidates = pollCandidates("Do you want to play as a Syndicate [borg_to_spawn] borg?", "operative", 1, ROLE_OPERATIVE, 300)
|
||||
if(borg_candidates.len > 0 && !used)
|
||||
checking = 0
|
||||
used = 1
|
||||
@@ -74,7 +74,7 @@
|
||||
icon_state = "vial"
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user as mob)
|
||||
var/list/demon_candidates = get_candidates(BE_ALIEN)
|
||||
var/list/demon_candidates = get_candidates(ROLE_ALIEN)
|
||||
if(user.z == ZLEVEL_CENTCOMM)//this is to make sure the wizard does NOT summon a demon from the Den..
|
||||
user << "<span class='notice'>You should probably wait until you reach the station.</span>"
|
||||
return
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
possible_traitors = get_players_for_role(BE_TRAITOR)
|
||||
possible_traitors = get_players_for_role(ROLE_TRAITOR)
|
||||
|
||||
for(var/mob/new_player/P in world)
|
||||
if(P.client && P.ready)
|
||||
@@ -160,15 +160,15 @@
|
||||
if(shuttle_master.emergency.mode >= SHUTTLE_ESCAPE)
|
||||
return
|
||||
//message_admins("Late Join Check")
|
||||
if((character.client && character.client.prefs.be_special & BE_TRAITOR) && !jobban_isbanned(character, "traitor") && !jobban_isbanned(character, "Syndicate"))
|
||||
if((character.client && (ROLE_TRAITOR in character.client.prefs.be_special) && !jobban_isbanned(character, "traitor") && !jobban_isbanned(character, "Syndicate"))
|
||||
//message_admins("Late Joiner has Be Syndicate")
|
||||
//message_admins("Checking number of players")
|
||||
var/playercount = 0
|
||||
var/traitorcount = 0
|
||||
for(var/mob/living/player in mob_list)
|
||||
if (player.client && player.stat != 2)
|
||||
if (player.client && player.stat != DEAD)
|
||||
playercount += 1
|
||||
if (player.client && player.mind && player.mind.special_role && player.stat != 2)
|
||||
if (player.client && player.mind && player.mind.special_role && player.stat != DEAD)
|
||||
traitorcount += 1
|
||||
//message_admins("Live Players: [playercount]")
|
||||
//message_admins("Live Traitors: [traitorcount]")
|
||||
|
||||
@@ -29,7 +29,7 @@ var/list/blob_nodes = list()
|
||||
|
||||
/datum/game_mode/blob/pre_setup()
|
||||
|
||||
var/list/possible_blobs = get_players_for_role(BE_BLOB)
|
||||
var/list/possible_blobs = get_players_for_role(ROLE_BLOB)
|
||||
|
||||
// stop setup if no possible traitors
|
||||
if(!possible_blobs.len)
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
var/list/candidates = list()
|
||||
|
||||
if(!new_overmind)
|
||||
candidates = get_candidates(BE_BLOB)
|
||||
candidates = get_candidates(ROLE_BLOB)
|
||||
if(candidates.len)
|
||||
C = pick(candidates)
|
||||
else
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
// also make sure that there's at least one borer and one host
|
||||
recommended_enemies = max(src.num_players() / 20 * 2, 2)
|
||||
|
||||
var/list/datum/mind/possible_borers = get_players_for_role(BE_ALIEN)
|
||||
var/list/datum/mind/possible_borers = get_players_for_role(ROLE_ALIEN)
|
||||
|
||||
if(possible_borers.len < 2)
|
||||
log_admin("MODE FAILURE: BORER. NOT ENOUGH BORER CANDIDATES.")
|
||||
|
||||
@@ -46,7 +46,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING)
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING)
|
||||
|
||||
changeling_amount = 1 + round(num_players() / 10)
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(BE_CHANGELING)
|
||||
var/list/datum/mind/possible_changelings = get_players_for_role(ROLE_CHANGELING)
|
||||
|
||||
for(var/mob/new_player/player in player_list)
|
||||
if((player.mind in possible_changelings) && (player.client.prefs.species in protected_species_changeling))
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/cultists_possible = get_players_for_role(BE_CULTIST)
|
||||
var/list/cultists_possible = get_players_for_role(ROLE_CULTIST)
|
||||
|
||||
for(var/cultists_number = 1 to max_cultists_to_start)
|
||||
if(!cultists_possible.len)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
if(temp_vent.parent.other_atmosmch.len > 50) // Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
|
||||
var/list/candidates = get_candidates(ROLE_ALIEN,ALIEN_AFK_BRACKET)
|
||||
|
||||
if(prob(40)) spawncount++ //sometimes, have two larvae spawn instead of one
|
||||
while((spawncount >= 1) && vents.len && candidates.len)
|
||||
@@ -25,7 +25,7 @@
|
||||
command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
for(var/mob/M in player_list)
|
||||
M << sound('sound/AI/aliens.ogg')
|
||||
|
||||
|
||||
/proc/lightsout(isEvent = 0, lightsoutAmount = 1,lightsoutRange = 25) //leave lightsoutAmount as 0 to break ALL lights
|
||||
if(isEvent)
|
||||
command_announcement.Announce("An Electrical storm has been detected in your area, please repair potential electronic overloads.","Electrical Storm Alert")
|
||||
|
||||
@@ -438,22 +438,7 @@ proc/get_nt_opposed()
|
||||
obj_count++
|
||||
|
||||
/proc/get_roletext(var/role)
|
||||
var/roletext
|
||||
switch(role)
|
||||
if(BE_CHANGELING) roletext="changeling"
|
||||
if(BE_TRAITOR) roletext="traitor"
|
||||
if(BE_OPERATIVE) roletext="operative"
|
||||
if(BE_WIZARD) roletext="wizard"
|
||||
if(BE_MALF) roletext="malf AI"
|
||||
if(BE_REV) roletext="revolutionary"
|
||||
if(BE_CULTIST) roletext="cultist"
|
||||
if(BE_NINJA) roletext="ninja"
|
||||
if(BE_RAIDER) roletext="raider"
|
||||
if(BE_VAMPIRE) roletext="vampire"
|
||||
if(BE_ALIEN) roletext="alien"
|
||||
if(BE_MUTINEER) roletext="mutineer"
|
||||
if(BE_BLOB) roletext="blob"
|
||||
return roletext
|
||||
return role
|
||||
|
||||
/proc/get_nuke_code()
|
||||
var/nukecode = "ERROR"
|
||||
|
||||
@@ -33,7 +33,7 @@ var/global/list/obj/cortical_stacks = list() //Stacks for 'leave nobody behind'
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
var/list/candidates = get_players_for_role(BE_RAIDER)
|
||||
var/list/candidates = get_players_for_role(ROLE_RAIDER)
|
||||
var/raider_num = 0
|
||||
|
||||
//Check that we have enough vox.
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<B>The AI on the satellite has malfunctioned and must be destroyed.</B><br />
|
||||
The AI satellite is deep in space and can only be accessed with the use of a teleporter! You have [AI_win_timeleft/60] minutes to disable it."}
|
||||
|
||||
/datum/game_mode/malfunction/get_players_for_role(var/role = BE_MALF)
|
||||
/datum/game_mode/malfunction/get_players_for_role(var/role = ROLE_MALF)
|
||||
var/roletext = get_roletext(role)
|
||||
|
||||
var/datum/job/ai/DummyAIjob = new
|
||||
@@ -39,7 +39,7 @@
|
||||
return antag_candidates
|
||||
|
||||
/datum/game_mode/malfunction/pre_setup()
|
||||
get_players_for_role(BE_MALF)
|
||||
get_players_for_role(ROLE_MALF)
|
||||
|
||||
var/datum/mind/chosen_ai
|
||||
if(!antag_candidates.len)
|
||||
|
||||
@@ -80,7 +80,7 @@ datum/game_mode/mutiny
|
||||
proc/get_head_mutineer_candidates()
|
||||
var/list/candidates[0]
|
||||
for(var/mob/mutineer in player_list)
|
||||
if(mutineer.client.prefs.be_special & BE_MUTINEER)
|
||||
if(ROLE_MUTINEER in mutineer.client.prefs.be_special)
|
||||
if(!jobban_isbanned(mutineer, "mutineer") && !jobban_isbanned(mutineer,"Syndicate"))
|
||||
for(var/job in command_positions - "Captain")
|
||||
if(mutineer.mind && mutineer.mind.assigned_role == job)
|
||||
|
||||
@@ -31,7 +31,7 @@ proc/issyndicate(mob/living/M as mob)
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
var/list/possible_syndicates = get_players_for_role(BE_OPERATIVE)
|
||||
var/list/possible_syndicates = get_players_for_role(ROLE_OPERATIVE)
|
||||
var/agent_number = 0
|
||||
|
||||
if(possible_syndicates.len < 1)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(BE_REV)
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(ROLE_REV)
|
||||
|
||||
for (var/i=1 to max_headrevs)
|
||||
if(possible_headrevs.len==0)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// BS12's less violent revolution mode
|
||||
// Isn't this basically mutiny but without any real reason
|
||||
|
||||
/datum/game_mode/revolution/rp_revolution
|
||||
name = "rp-revolution"
|
||||
@@ -29,7 +30,7 @@
|
||||
max_headrevs = max(num_players / 4, 3)
|
||||
recommended_enemies = max_headrevs
|
||||
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(BE_REV)
|
||||
var/list/datum/mind/possible_headrevs = get_players_for_role(ROLE_REV)
|
||||
|
||||
var/head_check = 0
|
||||
for(var/mob/new_player/player in player_list)
|
||||
|
||||
@@ -78,7 +78,7 @@ Made by Xhuis
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_shadowlings = get_players_for_role(BE_SHADOWLING)
|
||||
var/list/datum/mind/possible_shadowlings = get_players_for_role(ROLE_SHADOWLING)
|
||||
|
||||
if(!possible_shadowlings.len)
|
||||
return 0
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/possible_traitors = get_players_for_role(BE_TRAITOR)
|
||||
var/list/possible_traitors = get_players_for_role(ROLE_TRAITOR)
|
||||
|
||||
// stop setup if no possible traitors
|
||||
if(!possible_traitors.len)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
|
||||
var/list/datum/mind/possible_vampires = get_players_for_role(BE_VAMPIRE)
|
||||
var/list/datum/mind/possible_vampires = get_players_for_role(ROLE_VAMPIRE)
|
||||
|
||||
vampire_amount = 1 + round(num_players() / 10)
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
if (used)
|
||||
H << "You already used this contract!"
|
||||
return
|
||||
var/list/candidates = get_candidates(BE_WIZARD)
|
||||
var/list/candidates = get_candidates(ROLE_WIZARD)
|
||||
if(candidates.len)
|
||||
src.used = 1
|
||||
var/client/C = pick(candidates)
|
||||
@@ -294,7 +294,7 @@ var/global/list/multiverse = list()
|
||||
usr.mind.special_role = "[usr.real_name] Prime"
|
||||
evil = FALSE
|
||||
else
|
||||
var/list/candidates = get_candidates(BE_WIZARD)
|
||||
var/list/candidates = get_candidates(ROLE_WIZARD)
|
||||
if(candidates.len)
|
||||
var/client/C = pick(candidates)
|
||||
spawn_copy(C, get_turf(user.loc), user)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
..()
|
||||
if(!max_mages)
|
||||
for(var/mob/living/player in mob_list)
|
||||
if (player.client && player.stat != 2)
|
||||
if (player.client && player.stat != DEAD)
|
||||
playercount += 1
|
||||
max_mages = round(playercount / 5)
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
continue
|
||||
if(istype(wizard.current,/mob/living/carbon/brain))
|
||||
continue
|
||||
if(wizard.current.stat==2)
|
||||
if(wizard.current.stat==DEAD)
|
||||
continue
|
||||
if(wizard.current.stat==1)
|
||||
if(wizard.current.stat==UNCONSCIOUS)
|
||||
if(wizard.current.health < 0)
|
||||
wizard.current << "\red <font size='4'>The Space Wizard Federation is upset with your performance and have terminated your employment.</font>"
|
||||
wizard.current.stat = 2
|
||||
wizard.current.death()
|
||||
continue
|
||||
wizards_alive++
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
var/mob/dead/observer/theghost = null
|
||||
spawn(rand(200, 600))
|
||||
message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.")
|
||||
candidates = get_candidates(BE_WIZARD)
|
||||
candidates = get_candidates(ROLE_WIZARD)
|
||||
if(!candidates.len)
|
||||
message_admins("No applicable ghosts for the next ragin' mage, asking ghosts instead.")
|
||||
var/time_passed = world.time
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
/datum/game_mode/wizard/can_start()//This could be better, will likely have to recode it later
|
||||
if(!..())
|
||||
return 0
|
||||
var/list/datum/mind/possible_wizards = get_players_for_role(BE_WIZARD)
|
||||
var/list/datum/mind/possible_wizards = get_players_for_role(ROLE_WIZARD)
|
||||
if(possible_wizards.len==0)
|
||||
return 0
|
||||
var/datum/mind/wizard = pick(possible_wizards)
|
||||
@@ -211,7 +211,7 @@
|
||||
for(var/datum/mind/wizard in wizards)
|
||||
if(!istype(wizard.current,/mob/living/carbon))
|
||||
continue
|
||||
if(wizard.current.stat==2)
|
||||
if(wizard.current.stat==DEAD)
|
||||
continue
|
||||
wizards_alive++
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
for(var/datum/mind/traitor in traitors)
|
||||
if(!istype(traitor.current,/mob/living/carbon))
|
||||
continue
|
||||
if(traitor.current.stat==2)
|
||||
if(traitor.current.stat==DEAD)
|
||||
continue
|
||||
traitors_alive++
|
||||
|
||||
@@ -269,7 +269,7 @@
|
||||
wizardwin = 0
|
||||
count++
|
||||
|
||||
if(wizard.current && wizard.current.stat!=2 && wizardwin)
|
||||
if(wizard.current && wizard.current.stat!=DEAD && wizardwin)
|
||||
text += "<br><font color='green'><B>The wizard was successful!</B></font>"
|
||||
feedback_add_details("wizard_success","SUCCESS")
|
||||
else
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
var/list/candidates = get_players_for_role(BE_ALIEN)
|
||||
var/list/candidates = get_players_for_role(ROLE_ALIEN)
|
||||
var/playersready = 0
|
||||
var/xenos_num
|
||||
for(var/mob/new_player/player in player_list)
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
S.faction = faction
|
||||
S.master_commander = master_commander
|
||||
if(player_spiders)
|
||||
var/list/candidates = get_candidates(BE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
var/list/candidates = get_candidates(ROLE_ALIEN, ALIEN_AFK_BRACKET)
|
||||
var/client/C = null
|
||||
|
||||
if(candidates.len)
|
||||
|
||||
@@ -2,42 +2,23 @@
|
||||
|
||||
var/list/preferences_datums = list()
|
||||
|
||||
var/global/list/special_roles = list( //keep synced with the defines BE_* in setup.dm. THE ORDER MATTERS
|
||||
//some autodetection here.
|
||||
"traitor" = IS_MODE_COMPILED("traitor"), // 1 / 1
|
||||
"operative" = IS_MODE_COMPILED("nuclear"), // 2 / 2
|
||||
"changeling" = IS_MODE_COMPILED("changeling"), // 4 / 3
|
||||
"wizard" = IS_MODE_COMPILED("wizard"), // 8 / 4
|
||||
"malf AI" = IS_MODE_COMPILED("malfunction"), // 16 / 5
|
||||
"revolutionary" = IS_MODE_COMPILED("revolution"), // 32 / 6
|
||||
"alien" = 1, // 62 / 7
|
||||
"pAI" = 1, // 128 / 8
|
||||
"cultist" = IS_MODE_COMPILED("cult"), // 256 / 9
|
||||
"ninja" = 1, // 512 / 10
|
||||
"raider" = IS_MODE_COMPILED("heist"), // 1024 / 11
|
||||
"vampire" = IS_MODE_COMPILED("vampire"), // 2048 / 12
|
||||
"mutineer" = IS_MODE_COMPILED("mutiny"), // 4096 / 13
|
||||
"blob" = IS_MODE_COMPILED("blob"), // 8192 / 14
|
||||
"shadowling" = IS_MODE_COMPILED("shadowling"), //16384 / 15
|
||||
"revenant" = 1 //32768 / 16
|
||||
)
|
||||
var/global/list/special_role_times = list( //minimum age (in days) for accounts to play these roles
|
||||
num2text(BE_PAI) = 0,
|
||||
num2text(BE_TRAITOR) = 7,
|
||||
num2text(BE_CHANGELING) = 14,
|
||||
num2text(BE_SHADOWLING) = 14,
|
||||
num2text(BE_WIZARD) = 14,
|
||||
num2text(BE_REV) = 14,
|
||||
num2text(BE_VAMPIRE) = 14,
|
||||
num2text(BE_BLOB) = 14,
|
||||
num2text(BE_REVENANT) = 14,
|
||||
num2text(BE_OPERATIVE) = 21,
|
||||
num2text(BE_CULTIST) = 21,
|
||||
num2text(BE_RAIDER) = 21,
|
||||
num2text(BE_ALIEN) = 21,
|
||||
num2text(BE_NINJA) = 21,
|
||||
num2text(BE_MUTINEER) = 21,
|
||||
num2text(BE_MALF) = 30,
|
||||
num2text(ROLE_PAI) = 0,
|
||||
num2text(ROLE_TRAITOR) = 7,
|
||||
num2text(ROLE_CHANGELING) = 14,
|
||||
num2text(ROLE_SHADOWLING) = 14,
|
||||
num2text(ROLE_WIZARD) = 14,
|
||||
num2text(ROLE_REV) = 14,
|
||||
num2text(ROLE_VAMPIRE) = 14,
|
||||
num2text(ROLE_BLOB) = 14,
|
||||
num2text(ROLE_REVENANT) = 14,
|
||||
num2text(ROLE_OPERATIVE) = 21,
|
||||
num2text(ROLE_CULTIST) = 21,
|
||||
num2text(ROLE_RAIDER) = 21,
|
||||
num2text(ROLE_ALIEN) = 21,
|
||||
num2text(ROLE_NINJA) = 21,
|
||||
num2text(ROLE_MUTINEER) = 21,
|
||||
num2text(ROLE_MALF) = 30,
|
||||
)
|
||||
|
||||
/proc/player_old_enough_antag(client/C, role)
|
||||
@@ -91,7 +72,8 @@ datum/preferences
|
||||
//game-preferences
|
||||
// var/lastchangelog = "" //Saved changlog filesize to detect if there was a change
|
||||
var/ooccolor = "#b82e00"
|
||||
var/be_special = 0 //Special role selection
|
||||
var/be_special = list() //Special role selection
|
||||
var/old_be_special = 0 //For converting from the old format
|
||||
var/UI_style = "Midnight"
|
||||
var/toggles = TOGGLES_DEFAULT
|
||||
var/sound = SOUND_DEFAULT
|
||||
@@ -209,8 +191,9 @@ datum/preferences
|
||||
save_preferences(C)
|
||||
save_character(C) //let's save this new random character so it doesn't keep generating new ones.
|
||||
|
||||
/datum/preferences
|
||||
proc/ShowChoices(mob/user)
|
||||
|
||||
// Hello I am a proc full of snowflake species checks how are you
|
||||
/datum/preferences/proc/ShowChoices(mob/user)
|
||||
if(!user || !user.client) return
|
||||
update_preview_icon()
|
||||
user << browse_rsc(preview_icon_front, "previewicon.png")
|
||||
@@ -409,20 +392,16 @@ datum/preferences
|
||||
// dat += "<br><br>"
|
||||
if(jobban_isbanned(user, "Syndicate"))
|
||||
dat += "<b>You are banned from special roles.</b>"
|
||||
src.be_special = 0
|
||||
src.be_special = list()
|
||||
else
|
||||
var/n = 0
|
||||
for (var/i in special_roles)
|
||||
if(special_roles[i]) //if mode is available on the server
|
||||
var/special_role_flag = be_special_flags[i]
|
||||
if(jobban_isbanned(user, i))
|
||||
dat += "<b>Be [i]:</b> <font color=red><b> \[BANNED]</b></font><br>"
|
||||
else if(!player_old_enough_antag(user.client,special_role_flag))
|
||||
var/available_in_days_antag = available_in_days_antag(user.client,special_role_flag)
|
||||
dat += "<b>Be [i]:</b> <font color=red><b> \[IN [(available_in_days_antag)] DAYS]</b></font><br>"
|
||||
else
|
||||
dat += "<b>Be [i]:</b> <a href='?_src_=prefs;preference=be_special;num=[n]'><b>[src.be_special&(1<<n) ? "Yes" : "No"]</b></a><br>"
|
||||
n++
|
||||
if(jobban_isbanned(user, i))
|
||||
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[BANNED]</b></font><br>"
|
||||
else if(!player_old_enough_antag(user.client,i))
|
||||
var/available_in_days_antag = available_in_days_antag(user.client,i)
|
||||
dat += "<b>Be [capitalize(i)]:</b> <font color=red><b> \[IN [(available_in_days_antag)] DAYS]</b></font><br>"
|
||||
else
|
||||
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;preference=be_special;role=[i]'><b>[(i in src.be_special) ? "Yes" : "No"]</b></a><br>"
|
||||
dat += "</td></tr></table><hr><center>"
|
||||
|
||||
if(!IsGuestKey(user.key))
|
||||
@@ -1446,8 +1425,12 @@ datum/preferences
|
||||
UI_style_alpha = UI_style_alpha_new
|
||||
|
||||
if("be_special")
|
||||
var/num = text2num(href_list["num"])
|
||||
be_special ^= (1<<num)
|
||||
var/r = href_list["role"]
|
||||
if(!(r in special_roles))
|
||||
message_admins("[user] attempted an href exploit! (This could have possibly lead to a \"Bobby Tables\" exploit, so they're probably up to no good). String: [r] ID: [last_id] IP: [last_ip]")
|
||||
user << "<span class='userdanger'>Nice try.</span>"
|
||||
else
|
||||
be_special ^= r
|
||||
|
||||
if("name")
|
||||
be_random_name = !be_random_name
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
UI_style,
|
||||
UI_style_color,
|
||||
UI_style_alpha,
|
||||
be_special,
|
||||
be_role,
|
||||
default_slot,
|
||||
toggles,
|
||||
sound,
|
||||
@@ -28,7 +28,7 @@
|
||||
UI_style = query.item[2]
|
||||
UI_style_color = query.item[3]
|
||||
UI_style_alpha = text2num(query.item[4])
|
||||
be_special = text2num(query.item[5])
|
||||
be_special = params2list(query.item[5])
|
||||
default_slot = text2num(query.item[6])
|
||||
toggles = text2num(query.item[7])
|
||||
sound = text2num(query.item[8])
|
||||
@@ -39,7 +39,6 @@
|
||||
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
|
||||
// lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
|
||||
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
|
||||
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
|
||||
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
|
||||
sound = sanitize_integer(sound, 0, 65535, initial(sound))
|
||||
@@ -57,7 +56,7 @@
|
||||
UI_style='[UI_style]',
|
||||
UI_style_color='[UI_style_color]',
|
||||
UI_style_alpha='[UI_style_alpha]',
|
||||
be_special='[be_special]',
|
||||
be_role='[sql_sanitize_text(list2params(be_special))]',
|
||||
default_slot='[default_slot]',
|
||||
toggles='[toggles]',
|
||||
sound='[sound]',
|
||||
@@ -152,7 +151,7 @@
|
||||
//socks
|
||||
socks = query.item[54]
|
||||
body_accessory = query.item[55]
|
||||
|
||||
|
||||
//Sanitize
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
|
||||
@@ -1,443 +0,0 @@
|
||||
#define SAVEFILE_VERSION_MIN 8
|
||||
#define SAVEFILE_VERSION_MAX 12
|
||||
|
||||
//handles converting savefiles to new formats
|
||||
//MAKE SURE YOU KEEP THIS UP TO DATE!
|
||||
//If the sanity checks are capable of handling any issues. Only increase SAVEFILE_VERSION_MAX,
|
||||
//this will mean that savefile_version will still be over SAVEFILE_VERSION_MIN, meaning
|
||||
//this savefile update doesn't run everytime we load from the savefile.
|
||||
//This is mainly for format changes, such as the bitflags in toggles changing order or something.
|
||||
//if a file can't be updated, return 0 to delete it and start again
|
||||
//if a file was updated, return 1
|
||||
/datum/preferences/proc/savefile_update()
|
||||
if(savefile_version < 8) //lazily delete everything + additional files so they can be saved in the new format
|
||||
for(var/ckey in preferences_datums)
|
||||
var/datum/preferences/D = preferences_datums[ckey]
|
||||
if(D == src)
|
||||
var/delpath = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/"
|
||||
if(delpath && fexists(delpath))
|
||||
fdel(delpath)
|
||||
break
|
||||
return 0
|
||||
|
||||
if(savefile_version == SAVEFILE_VERSION_MAX) //update successful.
|
||||
save_preferences()
|
||||
save_character()
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/preferences/proc/load_path(ckey,filename="preferences.sav")
|
||||
if(!ckey) return
|
||||
path = "data/player_saves/[copytext(ckey,1,2)]/[ckey]/[filename]"
|
||||
savefile_version = SAVEFILE_VERSION_MAX
|
||||
|
||||
/*
|
||||
/datum/preferences/proc/load_preferences()
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] >> savefile_version
|
||||
//Conversion
|
||||
if(!savefile_version || !isnum(savefile_version) || savefile_version < SAVEFILE_VERSION_MIN || savefile_version > SAVEFILE_VERSION_MAX)
|
||||
if(!savefile_update()) //handles updates
|
||||
savefile_version = SAVEFILE_VERSION_MAX
|
||||
save_preferences()
|
||||
save_character()
|
||||
return 0
|
||||
|
||||
//general preferences
|
||||
S["ooccolor"] >> ooccolor
|
||||
S["lastchangelog"] >> lastchangelog
|
||||
S["UI_style"] >> UI_style
|
||||
S["be_special"] >> be_special
|
||||
S["default_slot"] >> default_slot
|
||||
S["toggles"] >> toggles
|
||||
S["sound"] >> sound
|
||||
S["UI_style_color"] >> UI_style_color
|
||||
S["UI_style_alpha"] >> UI_style_alpha
|
||||
S["randomslot"] >> randomslot
|
||||
S["volume"] >> volume
|
||||
//Sanitize
|
||||
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
|
||||
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
|
||||
UI_style = sanitize_inlist(UI_style, list("White", "Midnight"), initial(UI_style))
|
||||
be_special = sanitize_integer(be_special, 0, 65535, initial(be_special))
|
||||
default_slot = sanitize_integer(default_slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
|
||||
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
|
||||
sound = sanitize_integer(sound, 0, 65535, initial(toggles))
|
||||
UI_style_color = sanitize_hexcolor(UI_style_color, initial(UI_style_color))
|
||||
UI_style_alpha = sanitize_integer(UI_style_alpha, 0, 255, initial(UI_style_alpha))
|
||||
randomslot = sanitize_integer(randomslot, 0, 1, initial(randomslot))
|
||||
volume = sanitize_integer(volume, 0, 100, initial(volume))
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences()
|
||||
if(!path) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] << savefile_version
|
||||
|
||||
//general preferences
|
||||
S["ooccolor"] << ooccolor
|
||||
S["lastchangelog"] << lastchangelog
|
||||
S["UI_style"] << UI_style
|
||||
S["be_special"] << be_special
|
||||
S["default_slot"] << default_slot
|
||||
S["toggles"] << toggles
|
||||
S["sound"] << sound
|
||||
S["UI_style_color"] << UI_style_color
|
||||
S["UI_style_alpha"] << UI_style_alpha
|
||||
S["randomslot"] << randomslot
|
||||
S["volume"] << volume
|
||||
return 1
|
||||
|
||||
|
||||
//saving volume changes
|
||||
/datum/preferences/proc/save_volume()
|
||||
if(!path) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["volume"] << volume
|
||||
return 1
|
||||
*/
|
||||
|
||||
/datum/preferences/proc/load_save(dir)
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = dir
|
||||
|
||||
//Character
|
||||
S["OOC_Notes"] >> metadata
|
||||
S["real_name"] >> real_name
|
||||
S["name_is_always_random"] >> be_random_name
|
||||
S["gender"] >> gender
|
||||
S["age"] >> age
|
||||
S["species"] >> species
|
||||
S["language"] >> language
|
||||
S["spawnpoint"] >> spawnpoint
|
||||
|
||||
//colors to be consolidated into hex strings (requires some work with dna code)
|
||||
S["hair_red"] >> r_hair
|
||||
S["hair_green"] >> g_hair
|
||||
S["hair_blue"] >> b_hair
|
||||
S["facial_red"] >> r_facial
|
||||
S["facial_green"] >> g_facial
|
||||
S["facial_blue"] >> b_facial
|
||||
S["skin_tone"] >> s_tone
|
||||
S["skin_red"] >> r_skin
|
||||
S["skin_green"] >> g_skin
|
||||
S["skin_blue"] >> b_skin
|
||||
S["hair_style_name"] >> h_style
|
||||
S["facial_style_name"] >> f_style
|
||||
S["eyes_red"] >> r_eyes
|
||||
S["eyes_green"] >> g_eyes
|
||||
S["eyes_blue"] >> b_eyes
|
||||
S["underwear"] >> underwear
|
||||
S["undershirt"] >> undershirt
|
||||
S["socks"] >> socks
|
||||
S["backbag"] >> backbag
|
||||
S["b_type"] >> b_type
|
||||
S["accent"] >> accent
|
||||
S["voice"] >> voice
|
||||
S["pitch"] >> pitch
|
||||
S["talkspeed"] >> talkspeed
|
||||
|
||||
//Jobs
|
||||
S["alternate_option"] >> alternate_option
|
||||
S["job_civilian_high"] >> job_civilian_high
|
||||
S["job_civilian_med"] >> job_civilian_med
|
||||
S["job_civilian_low"] >> job_civilian_low
|
||||
S["job_medsci_high"] >> job_medsci_high
|
||||
S["job_medsci_med"] >> job_medsci_med
|
||||
S["job_medsci_low"] >> job_medsci_low
|
||||
S["job_engsec_high"] >> job_engsec_high
|
||||
S["job_engsec_med"] >> job_engsec_med
|
||||
S["job_engsec_low"] >> job_engsec_low
|
||||
S["job_karma_high"] >> job_karma_high
|
||||
S["job_karma_med"] >> job_karma_med
|
||||
S["job_karma_low"] >> job_karma_low
|
||||
|
||||
//Miscellaneous
|
||||
S["flavor_text"] >> flavor_text
|
||||
S["med_record"] >> med_record
|
||||
S["sec_record"] >> sec_record
|
||||
S["gen_record"] >> gen_record
|
||||
S["be_special"] >> be_special
|
||||
S["disabilities"] >> disabilities
|
||||
S["player_alt_titles"] >> player_alt_titles
|
||||
S["organ_data"] >> organ_data
|
||||
|
||||
S["nanotrasen_relation"] >> nanotrasen_relation
|
||||
//S["skin_style"] >> skin_style
|
||||
|
||||
//Sanitize
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
if(isnull(species)) species = "Human"
|
||||
if(isnull(language)) language = "None"
|
||||
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name) real_name = random_name(gender,species)
|
||||
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
|
||||
gender = sanitize_gender(gender)
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
r_hair = sanitize_integer(r_hair, 0, 255, initial(r_hair))
|
||||
g_hair = sanitize_integer(g_hair, 0, 255, initial(g_hair))
|
||||
b_hair = sanitize_integer(b_hair, 0, 255, initial(b_hair))
|
||||
r_facial = sanitize_integer(r_facial, 0, 255, initial(r_facial))
|
||||
g_facial = sanitize_integer(g_facial, 0, 255, initial(g_facial))
|
||||
b_facial = sanitize_integer(b_facial, 0, 255, initial(b_facial))
|
||||
s_tone = sanitize_integer(s_tone, -185, 34, initial(s_tone))
|
||||
r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin))
|
||||
g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin))
|
||||
b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin))
|
||||
h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style))
|
||||
f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style))
|
||||
r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes))
|
||||
g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes))
|
||||
b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes))
|
||||
underwear = sanitize_integer(underwear, 1, underwear_m.len, initial(underwear))
|
||||
undershirt = sanitize_integer(undershirt, 1, undershirt_t.len, initial(undershirt))
|
||||
socks = sanitize_integer(socks,1 socks_t.len, initial(socks))
|
||||
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
|
||||
b_type = sanitize_text(b_type, initial(b_type))
|
||||
accent = sanitize_text(accent, initial(accent))
|
||||
voice = sanitize_text(voice, initial(voice))
|
||||
pitch = sanitize_text(pitch, initial(pitch))
|
||||
talkspeed = sanitize_text(talkspeed, initial(talkspeed))
|
||||
|
||||
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
|
||||
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
|
||||
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
|
||||
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
|
||||
job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high))
|
||||
job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med))
|
||||
job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low))
|
||||
job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high))
|
||||
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
|
||||
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
|
||||
job_karma_high = sanitize_integer(job_karma_high, 0, 65535, initial(job_karma_high))
|
||||
job_karma_med = sanitize_integer(job_karma_med, 0, 65535, initial(job_karma_med))
|
||||
job_karma_low = sanitize_integer(job_karma_low, 0, 65535, initial(job_karma_low))
|
||||
|
||||
if(isnull(disabilities)) disabilities = 0
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
//if(!skin_style) skin_style = "Default"
|
||||
|
||||
/datum/preferences/proc/random_character()
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
var/list/saves = list()
|
||||
var/name
|
||||
for(var/i=1, i<=MAX_SAVE_SLOTS, i++)
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name) continue
|
||||
saves.Add(S.cd)
|
||||
|
||||
if(!saves.len)
|
||||
load_character()
|
||||
return 0
|
||||
S.cd = pick(saves)
|
||||
load_save(S.cd)
|
||||
return 1
|
||||
/*
|
||||
/datum/preferences/proc/load_character(slot)
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
if(!slot) slot = default_slot
|
||||
slot = sanitize_integer(slot, 1, MAX_SAVE_SLOTS, initial(default_slot))
|
||||
if(slot != default_slot)
|
||||
default_slot = slot
|
||||
S["default_slot"] << slot
|
||||
S.cd = "/character[slot]"
|
||||
load_save(S.cd)
|
||||
Now loaded by proc load_save(S.cd)
|
||||
//Character
|
||||
S["OOC_Notes"] >> metadata
|
||||
S["real_name"] >> real_name
|
||||
S["name_is_always_random"] >> be_random_name
|
||||
S["gender"] >> gender
|
||||
S["age"] >> age
|
||||
S["species"] >> species
|
||||
S["language"] >> language
|
||||
|
||||
//colors to be consolidated into hex strings (requires some work with dna code)
|
||||
S["hair_red"] >> r_hair
|
||||
S["hair_green"] >> g_hair
|
||||
S["hair_blue"] >> b_hair
|
||||
S["facial_red"] >> r_facial
|
||||
S["facial_green"] >> g_facial
|
||||
S["facial_blue"] >> b_facial
|
||||
S["skin_tone"] >> s_tone
|
||||
S["skin_red"] >> r_skin
|
||||
S["skin_green"] >> g_skin
|
||||
S["skin_blue"] >> b_skin
|
||||
S["hair_style_name"] >> h_style
|
||||
S["facial_style_name"] >> f_style
|
||||
S["eyes_red"] >> r_eyes
|
||||
S["eyes_green"] >> g_eyes
|
||||
S["eyes_blue"] >> b_eyes
|
||||
S["underwear"] >> underwear
|
||||
S["undershirt"] >> undershirt
|
||||
S["backbag"] >> backbag
|
||||
S["b_type"] >> b_type
|
||||
|
||||
//Jobs
|
||||
S["alternate_option"] >> alternate_option
|
||||
S["job_civilian_high"] >> job_civilian_high
|
||||
S["job_civilian_med"] >> job_civilian_med
|
||||
S["job_civilian_low"] >> job_civilian_low
|
||||
S["job_medsci_high"] >> job_medsci_high
|
||||
S["job_medsci_med"] >> job_medsci_med
|
||||
S["job_medsci_low"] >> job_medsci_low
|
||||
S["job_engsec_high"] >> job_engsec_high
|
||||
S["job_engsec_med"] >> job_engsec_med
|
||||
S["job_engsec_low"] >> job_engsec_low
|
||||
|
||||
//Miscellaneous
|
||||
S["flavor_text"] >> flavor_text
|
||||
S["med_record"] >> med_record
|
||||
S["sec_record"] >> sec_record
|
||||
S["gen_record"] >> gen_record
|
||||
S["be_special"] >> be_special
|
||||
S["disabilities"] >> disabilities
|
||||
S["player_alt_titles"] >> player_alt_titles
|
||||
S["organ_data"] >> organ_data
|
||||
|
||||
S["nanotrasen_relation"] >> nanotrasen_relation
|
||||
//S["skin_style"] >> skin_style
|
||||
|
||||
|
||||
//Sanitize
|
||||
metadata = sanitize_text(metadata, initial(metadata))
|
||||
real_name = reject_bad_name(real_name)
|
||||
if(isnull(species)) species = "Human"
|
||||
if(isnull(language)) language = "None"
|
||||
if(isnull(spawnpoint)) spawnpoint = "Arrivals Shuttle"
|
||||
if(isnull(nanotrasen_relation)) nanotrasen_relation = initial(nanotrasen_relation)
|
||||
if(!real_name) real_name = random_name(gender)
|
||||
be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name))
|
||||
gender = sanitize_gender(gender)
|
||||
age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age))
|
||||
r_hair = sanitize_integer(r_hair, 0, 255, initial(r_hair))
|
||||
g_hair = sanitize_integer(g_hair, 0, 255, initial(g_hair))
|
||||
b_hair = sanitize_integer(b_hair, 0, 255, initial(b_hair))
|
||||
r_facial = sanitize_integer(r_facial, 0, 255, initial(r_facial))
|
||||
g_facial = sanitize_integer(g_facial, 0, 255, initial(g_facial))
|
||||
b_facial = sanitize_integer(b_facial, 0, 255, initial(b_facial))
|
||||
s_tone = sanitize_integer(s_tone, -185, 34, initial(s_tone))
|
||||
r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin))
|
||||
g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin))
|
||||
b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin))
|
||||
h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style))
|
||||
f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style))
|
||||
r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes))
|
||||
g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes))
|
||||
b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes))
|
||||
underwear = sanitize_integer(underwear, 1, underwear_m.len, initial(underwear))
|
||||
undershirt = sanitize_integer(undershirt, 1, undershirt_t.len, initial(undershirt))
|
||||
backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag))
|
||||
b_type = sanitize_text(b_type, initial(b_type))
|
||||
|
||||
alternate_option = sanitize_integer(alternate_option, 0, 2, initial(alternate_option))
|
||||
job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high))
|
||||
job_civilian_med = sanitize_integer(job_civilian_med, 0, 65535, initial(job_civilian_med))
|
||||
job_civilian_low = sanitize_integer(job_civilian_low, 0, 65535, initial(job_civilian_low))
|
||||
job_medsci_high = sanitize_integer(job_medsci_high, 0, 65535, initial(job_medsci_high))
|
||||
job_medsci_med = sanitize_integer(job_medsci_med, 0, 65535, initial(job_medsci_med))
|
||||
job_medsci_low = sanitize_integer(job_medsci_low, 0, 65535, initial(job_medsci_low))
|
||||
job_engsec_high = sanitize_integer(job_engsec_high, 0, 65535, initial(job_engsec_high))
|
||||
job_engsec_med = sanitize_integer(job_engsec_med, 0, 65535, initial(job_engsec_med))
|
||||
job_engsec_low = sanitize_integer(job_engsec_low, 0, 65535, initial(job_engsec_low))
|
||||
|
||||
if(isnull(disabilities)) disabilities = 0
|
||||
if(!player_alt_titles) player_alt_titles = new()
|
||||
if(!organ_data) src.organ_data = list()
|
||||
//if(!skin_style) skin_style = "Default"
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_character()
|
||||
if(!path) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/character[default_slot]"
|
||||
|
||||
//Character
|
||||
S["OOC_Notes"] << metadata
|
||||
S["real_name"] << real_name
|
||||
S["name_is_always_random"] << be_random_name
|
||||
S["gender"] << gender
|
||||
S["age"] << age
|
||||
S["species"] << species
|
||||
S["language"] << language
|
||||
S["hair_red"] << r_hair
|
||||
S["hair_green"] << g_hair
|
||||
S["hair_blue"] << b_hair
|
||||
S["facial_red"] << r_facial
|
||||
S["facial_green"] << g_facial
|
||||
S["facial_blue"] << b_facial
|
||||
S["skin_tone"] << s_tone
|
||||
S["skin_red"] << r_skin
|
||||
S["skin_green"] << g_skin
|
||||
S["skin_blue"] << b_skin
|
||||
S["hair_style_name"] << h_style
|
||||
S["facial_style_name"] << f_style
|
||||
S["eyes_red"] << r_eyes
|
||||
S["eyes_green"] << g_eyes
|
||||
S["eyes_blue"] << b_eyes
|
||||
S["underwear"] << underwear
|
||||
S["undershirt"] << undershirt
|
||||
S["backbag"] << backbag
|
||||
S["b_type"] << b_type
|
||||
S["accent"] << accent
|
||||
S["voice"] << voice
|
||||
S["pitch"] << pitch
|
||||
S["talkspeed"] << talkspeed
|
||||
|
||||
//Jobs
|
||||
S["alternate_option"] << alternate_option
|
||||
S["job_civilian_high"] << job_civilian_high
|
||||
S["job_civilian_med"] << job_civilian_med
|
||||
S["job_civilian_low"] << job_civilian_low
|
||||
S["job_medsci_high"] << job_medsci_high
|
||||
S["job_medsci_med"] << job_medsci_med
|
||||
S["job_medsci_low"] << job_medsci_low
|
||||
S["job_engsec_high"] << job_engsec_high
|
||||
S["job_engsec_med"] << job_engsec_med
|
||||
S["job_engsec_low"] << job_engsec_low
|
||||
S["job_karma_high"] << job_karma_high
|
||||
S["job_karma_med"] << job_karma_med
|
||||
S["job_karma_low"] << job_karma_low
|
||||
|
||||
//Miscellaneous
|
||||
S["flavor_text"] << flavor_text
|
||||
S["med_record"] << med_record
|
||||
S["sec_record"] << sec_record
|
||||
S["gen_record"] << gen_record
|
||||
S["player_alt_titles"] << player_alt_titles
|
||||
S["be_special"] << be_special
|
||||
S["disabilities"] << disabilities
|
||||
S["organ_data"] << organ_data
|
||||
|
||||
S["nanotrasen_relation"] << nanotrasen_relation
|
||||
//S["skin_style"] << skin_style
|
||||
|
||||
return 1
|
||||
*/
|
||||
|
||||
#undef SAVEFILE_VERSION_MAX
|
||||
#undef SAVEFILE_VERSION_MIN
|
||||
Reference in New Issue
Block a user