Files
Bubberstation/code/datums/datacore.dm
lordpidey 24f47b0223 Devil Antag Round 2. (#15794)
* Re-making the branch and PR of demon.  See #15118 for the old PR

* Adds toy demonologist to arcade machine reward list.

* Implemented two suggestions: Pitchfork now has a demonic subtype, to potentially give botanists a normal pitchfork.

Suiciding with signed contract now uses forcesay instead of say.

* Fixes compile errors.
Re factors contracts to be subtypes rather than datums.  <--- incomplete, still need to summon them appropriately.

* buffed infernal power contract to give passive healing
Nerfed magic power contract to not give robeless MM

* Fixes compile errors

* Corrects orientation of true demon sprite

* Begins work on the sNPC for the true demon/ arch-demon

* Added funeral garment sprites.  These will be used in banishment rituals (hopefully)

* Stashing my work so I can move to another computer.

Re-working the true-demon, it will be a carbon rather than a simple mob.

* Revert "Stashing my work so I can move to another computer."

This reverts commit e8b1e032997b7e17af4ad8630bf21d3620195c4e.

* Git exploded for me, so I have to make a new branch with EVERYTHING.  sorry.

* Fixes compile error

* Ghosts can now click on an arch demon to become a slaughter demon

* Begins to convert demons into a carbon rather than simple mob.

* Demons now resurrect if not banished.

* Beepsky now properly tells security chat about the level 666 threat.

* Contracts now work again.

* old spells now get removed properly.

* adding pitchfork sprites

* Adds hud for the true-demon.  Not functional.

* Fixes another error in the demon hud.  Still broken.

* Demons are no longer immortal, demon huds work properly now.  (it's barebones, but it works.)

* Fixes the "Have mortals sign at least # contracts of TYPE" objective

* Fixed typo in banishlore() and updated wrath/envy sintouch objectives.

* Adds huds for demons/sintouched/soulless, however they are currently unused.

* Updates the demon's hud to work with the recent hud changes.

* Cleaned up infernal jaunt, it works a lot better now and is less buggy.

* Revival contracts now actually take your soul.

* Fixes #16513

* Replaces the infinite slaughter demons with infinite imps.  Sprites for imps are still needed.

* Adds sprite for imps.  It's a redder, smaller slaughter demon.

* Fixes lack of icon for pitchforks

* Gives summon wealth a more appropriate icon.

* Fixes small part I forgot to merge.

* Fixes a few bugs with demonic resurrection.  It's still very buggy.

* Derp, my bad, I didn't mean to admin myself on the main server.

* Fixes edge case of demonic resurrection failing.  Debraining the demon is NOT supposed to be an alternative for the banishment ritual.

* Also did not mean to change this config file.

* Fixes another error in type 1 demonic resurrection.  It works properly now.

* Updates employment contract text.

* Fixes type 2 resurrections.
Demonic contracts are once again permanently on fire.

* Replaces toy demonologist with toy demonomicon.  It still works the same, just different icon/name.

* Adds demonomicon and employment cabinet to box/meta/dream/efficiency.

I could not add it to mini/bird due to conflicts.

* Edits ministation and BirdStation to have demonomicons and employment cabinets.

* Fixes spelling error

* Adds burial garments to maps.

* Update photocopier.dm

Fixes the span when inserting items into photocopier

* Fixes disrupt_spells proc

* Makes a lot of changes as reccomended by Remie.

* Fixes a compile error.

* Updates the lawify/loreify to be lists.  Does not compile.

* Fixes compile errors.

* Arch demons no longer regress upon death.
Speaking a demon's truename gives the demon the opportunity to teleport to you.
Makes demonomicon not care about capitalization.

* Fixes startup error.  Demonic summoning now works.  It's very simple, just say their true name.

* Demons now have a tongue.  True demon bodies are deleted upon regression.

* Demons can now be punched.
Demons can no longer resist a fire out, since it does nothing to them.

* true demons show up in player panel.  Hellfire works again.

* Prepares for commit 16940

* Demons are now known as devils.

Still needs testing.

* Oops, didn't commit everything last commit.

* Finishes converting demons to devils.

* Fixes speech for lizards/flymen when they speak a demon's name.

* Update tips.txt

* Changes variable from static to global as per Remie's suggestion.

I disagree with Remie's assessment, as a list that will never change, even between games, seems like it should be static.

* Removes devil summoning.  Hopefully, I'll be able to eventually find a way to implement it satisfactorily, but for now, I'll leave it out.

* Removes carriage returns

* Combined modified icon files

* Fixes #17184

* Imps no longer show up in the end round report.  This is because there can EASILY be 100+ imps if the crew is well armed.

Non-employment filing cabinets no longer take 30 sec to wrench/unwrench.

* The lawyer can actually buy souls back now.  Oops.

* Fixes true/arch devil spritesheet to have correct sprite names.

* Relocates Box's employment cabinet to Law office.

* De-devil-ing someone now removes the devilinfo.
De-devil-ing now returns an error when used on true and arch devils

* Re-factors whiteness code for jumpsuits.

* Merges icons, reverts failed merge of map

* Merges map with CAS decks

* Fixes copying employment contracts

* Derp, fixes compile error.

* Replaces antaghud with customizable vision range for knowledge boon.

* Prevents a runtime if devil is gibbed while ascending.

* Neatens contract code, and removes excess variable from humans.

* Fixes compile errors

* Organizes weakness code slightly.  Adds ability for a species override on weakness.  (Make flypeople take 2x damage from flyswatters for example)

* Removes sixteen erroneous characters from the codebase.

* Removes trailing return

* Makes typeless for loops, removes a runtime, and removes unhelpful comments.
2016-05-08 18:44:27 +01:00

273 lines
8.7 KiB
Plaintext

/datum/datacore
var/medical[] = list()
var/medicalPrintCount = 0
var/general[] = list()
var/security[] = list()
var/securityPrintCount = 0
var/securityCrimeCounter = 0
//This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character().
var/locked[] = list()
/datum/data
var/name = "data"
/datum/data/record
name = "record"
var/list/fields = list()
/datum/data/crime
name = "crime"
var/crimeName = ""
var/crimeDetails = ""
var/author = ""
var/time = ""
var/dataId = 0
/datum/datacore/proc/createCrimeEntry(cname = "", cdetails = "", author = "", time = "")
var/datum/data/crime/c = new /datum/data/crime
c.crimeName = cname
c.crimeDetails = cdetails
c.author = author
c.time = time
c.dataId = ++securityCrimeCounter
return c
/datum/datacore/proc/addMinorCrime(id = "", datum/data/crime/crime)
for(var/datum/data/record/R in security)
if(R.fields["id"] == id)
var/list/crimes = R.fields["mi_crim"]
crimes |= crime
return
/datum/datacore/proc/removeMinorCrime(id, cDataId)
for(var/datum/data/record/R in security)
if(R.fields["id"] == id)
var/list/crimes = R.fields["mi_crim"]
for(var/datum/data/crime/crime in crimes)
if(crime.dataId == text2num(cDataId))
crimes -= crime
return
/datum/datacore/proc/removeMajorCrime(id, cDataId)
for(var/datum/data/record/R in security)
if(R.fields["id"] == id)
var/list/crimes = R.fields["ma_crim"]
for(var/datum/data/crime/crime in crimes)
if(crime.dataId == text2num(cDataId))
crimes -= crime
return
/datum/datacore/proc/addMajorCrime(id = "", datum/data/crime/crime)
for(var/datum/data/record/R in security)
if(R.fields["id"] == id)
var/list/crimes = R.fields["ma_crim"]
crimes |= crime
return
/datum/datacore/proc/manifest(nosleep = 0)
spawn()
if(!nosleep)
sleep(40)
for(var/mob/living/carbon/human/H in player_list)
manifest_inject(H)
return
/datum/datacore/proc/manifest_modify(name, assignment)
var/datum/data/record/foundrecord = find_record("name", name, data_core.general)
if(foundrecord)
foundrecord.fields["rank"] = assignment
/datum/datacore/proc/get_manifest(monochrome, OOC)
var/list/heads = list()
var/list/sec = list()
var/list/eng = list()
var/list/med = list()
var/list/sci = list()
var/list/sup = list()
var/list/civ = list()
var/list/bot = list()
var/list/misc = list()
var/dat = {"
<head><style>
.manifest {border-collapse:collapse;}
.manifest td, th {border:1px solid [monochrome?"black":"#DEF; background-color:white; color:black"]; padding:.25em}
.manifest th {height: 2em; [monochrome?"border-top-width: 3px":"background-color: #48C; color:white"]}
.manifest tr.head th { [monochrome?"border-top-width: 1px":"background-color: #488;"] }
.manifest td:first-child {text-align:right}
.manifest tr.alt td {[monochrome?"border-top-width: 2px":"background-color: #DEF"]}
</style></head>
<table class="manifest" width='350px'>
<tr class='head'><th>Name</th><th>Rank</th></tr>
"}
var/even = 0
// sort mobs
for(var/datum/data/record/t in data_core.general)
var/name = t.fields["name"]
var/rank = t.fields["rank"]
var/department = 0
if(rank in command_positions)
heads[name] = rank
department = 1
if(rank in security_positions)
sec[name] = rank
department = 1
if(rank in engineering_positions)
eng[name] = rank
department = 1
if(rank in medical_positions)
med[name] = rank
department = 1
if(rank in science_positions)
sci[name] = rank
department = 1
if(rank in supply_positions)
sup[name] = rank
department = 1
if(rank in civilian_positions)
civ[name] = rank
department = 1
if(rank in nonhuman_positions)
bot[name] = rank
department = 1
if(!department && !(name in heads))
misc[name] = rank
if(heads.len > 0)
dat += "<tr><th colspan=3>Heads</th></tr>"
for(var/name in heads)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[heads[name]]</td></tr>"
even = !even
if(sec.len > 0)
dat += "<tr><th colspan=3>Security</th></tr>"
for(var/name in sec)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sec[name]]</td></tr>"
even = !even
if(eng.len > 0)
dat += "<tr><th colspan=3>Engineering</th></tr>"
for(var/name in eng)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[eng[name]]</td></tr>"
even = !even
if(med.len > 0)
dat += "<tr><th colspan=3>Medical</th></tr>"
for(var/name in med)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[med[name]]</td></tr>"
even = !even
if(sci.len > 0)
dat += "<tr><th colspan=3>Science</th></tr>"
for(var/name in sci)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sci[name]]</td></tr>"
even = !even
if(sup.len > 0)
dat += "<tr><th colspan=3>Supply</th></tr>"
for(var/name in sup)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[sup[name]]</td></tr>"
even = !even
if(civ.len > 0)
dat += "<tr><th colspan=3>Civilian</th></tr>"
for(var/name in civ)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[civ[name]]</td></tr>"
even = !even
// in case somebody is insane and added them to the manifest, why not
if(bot.len > 0)
dat += "<tr><th colspan=3>Silicon</th></tr>"
for(var/name in bot)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[bot[name]]</td></tr>"
even = !even
// misc guys
if(misc.len > 0)
dat += "<tr><th colspan=3>Miscellaneous</th></tr>"
for(var/name in misc)
dat += "<tr[even ? " class='alt'" : ""]><td>[name]</td><td>[misc[name]]</td></tr>"
even = !even
dat += "</table>"
dat = replacetext(dat, "\n", "")
dat = replacetext(dat, "\t", "")
return dat
var/record_id_num = 1001
/datum/datacore/proc/manifest_inject(mob/living/carbon/human/H)
if(H.mind && (H.mind.assigned_role != H.mind.special_role))
var/assignment
if(H.mind.assigned_role)
assignment = H.mind.assigned_role
else if(H.job)
assignment = H.job
else
assignment = "Unassigned"
var/id = num2hex(record_id_num++,6)
var/image = get_id_photo(H)
var/obj/item/weapon/photo/photo_front = new()
var/obj/item/weapon/photo/photo_side = new()
photo_front.photocreate(null, icon(image, dir = SOUTH))
photo_side.photocreate(null, icon(image, dir = WEST))
//These records should ~really~ be merged or something
//General Record
var/datum/data/record/G = new()
G.fields["id"] = id
G.fields["name"] = H.real_name
G.fields["rank"] = assignment
G.fields["age"] = H.age
if(config.mutant_races)
G.fields["species"] = H.dna.species.name
G.fields["fingerprint"] = md5(H.dna.uni_identity)
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
G.fields["sex"] = H.gender
G.fields["photo_front"] = photo_front
G.fields["photo_side"] = photo_side
general += G
//Medical Record
var/datum/data/record/M = new()
M.fields["id"] = id
M.fields["name"] = H.real_name
M.fields["blood_type"] = H.dna.blood_type
M.fields["b_dna"] = H.dna.unique_enzymes
M.fields["mi_dis"] = "None"
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
M.fields["ma_dis"] = "None"
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
M.fields["alg"] = "None"
M.fields["alg_d"] = "No allergies have been detected in this patient."
M.fields["cdi"] = "None"
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
M.fields["notes"] = "No notes."
medical += M
//Security Record
var/datum/data/record/S = new()
S.fields["id"] = id
S.fields["name"] = H.real_name
S.fields["criminal"] = "None"
S.fields["mi_crim"] = list()
S.fields["ma_crim"] = list()
S.fields["notes"] = "No notes."
security += S
//Locked Record
var/datum/data/record/L = new()
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") //surely this should just be id, like the others?
L.fields["name"] = H.real_name
L.fields["rank"] = H.mind.assigned_role
L.fields["age"] = H.age
L.fields["sex"] = H.gender
L.fields["blood_type"] = H.dna.blood_type
L.fields["b_dna"] = H.dna.unique_enzymes
L.fields["enzymes"] = H.dna.struc_enzymes
L.fields["identity"] = H.dna.uni_identity
L.fields["species"] = H.dna.species.type
L.fields["features"] = H.dna.features
L.fields["image"] = image
L.fields["reference"] = H
locked += L
return
/datum/datacore/proc/get_id_photo(mob/living/carbon/human/H)
var/datum/job/J = SSjob.GetJob(H.mind.assigned_role)
var/datum/preferences/P = H.client.prefs
return get_flat_human_icon(null,J.outfit,P)