[MIRROR] Devil refactor+small revamp (#887)

* Devil refactor+small revamp

* Delete mind.dm.rej

* clean up rej

* Delete admin_investigate.dm.rej

* Delete mapping.dm.rej

* compile fix
This commit is contained in:
CitadelStationBot
2017-05-18 09:06:01 -05:00
committed by Poojawa
parent 59b8cfbc93
commit c6a671a11b
30 changed files with 551 additions and 292 deletions
+124 -52
View File
@@ -78,8 +78,15 @@ GLOBAL_LIST_INIT(lawlorify, list (
BANISH_FUNERAL_GARB = "If your corpse is clad in funeral garments, you will be unable to resurrect."
)
))
/datum/devilinfo
var/datum/mind/owner = null
//These are also used in the codex gigas, so let's declare them globally.
GLOBAL_LIST_INIT(devil_pre_title, list("Dark ", "Hellish ", "Fallen ", "Fiery ", "Sinful ", "Blood ", "Fluffy "))
GLOBAL_LIST_INIT(devil_title, list("Lord ", "Prelate ", "Count ", "Viscount ", "Vizier ", "Elder ", "Adept "))
GLOBAL_LIST_INIT(devil_syllable, list("hal", "ve", "odr", "neit", "ci", "quon", "mya", "folth", "wren", "geyr", "hil", "niet", "twou", "phi", "coa"))
GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", ", the Lord of all things", ", Jr."))
/datum/antagonist/devil
//Don't delete upon mind destruction, otherwise soul re-selling will break.
delete_on_death = FALSE
var/obligation
var/ban
var/bane
@@ -89,55 +96,63 @@ GLOBAL_LIST_INIT(lawlorify, list (
var/reviveNumber = 0
var/form = BASIC_DEVIL
var/exists = 0
var/static/list/dont_remove_spells = list(
/obj/effect/proc_holder/spell/targeted/summon_contract,
/obj/effect/proc_holder/spell/targeted/conjure_item/violin,
/obj/effect/proc_holder/spell/targeted/summon_dancefloor)
var/static/list/removable_devil_spells = list(
/obj/effect/proc_holder/spell/aimed/fireball/hellish,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork,
/obj/effect/proc_holder/spell/aimed/fireball/hellish,
/obj/effect/proc_holder/spell/targeted/infernal_jaunt,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/greater,
/obj/effect/proc_holder/spell/targeted/sintouch,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/ascended,
/obj/effect/proc_holder/spell/targeted/sintouch/ascended)
var/static/list/devil_spells = list(
/obj/effect/proc_holder/spell/aimed/fireball/hellish,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork,
/obj/effect/proc_holder/spell/aimed/fireball/hellish,
/obj/effect/proc_holder/spell/targeted/infernal_jaunt,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/greater,
/obj/effect/proc_holder/spell/targeted/sintouch,
/obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/ascended,
/obj/effect/proc_holder/spell/targeted/sintouch/ascended,
/obj/effect/proc_holder/spell/targeted/summon_contract,
/obj/effect/proc_holder/spell/targeted/conjure_item/violin,
/obj/effect/proc_holder/spell/targeted/summon_dancefloor)
var/ascendable = FALSE
/datum/devilinfo/New()
/datum/antagonist/devil/New()
..()
dont_remove_spells = typecacheof(dont_remove_spells)
devil_spells = typecacheof(devil_spells)
truename = randomDevilName()
ban = randomdevilban()
bane = randomdevilbane()
obligation = randomdevilobligation()
banish = randomdevilbanish()
GLOB.allDevils[lowertext(truename)] = src
/proc/randomDevilInfo(name = randomDevilName())
var/datum/devilinfo/devil = new
devil.truename = name
devil.bane = randomdevilbane()
devil.obligation = randomdevilobligation()
devil.ban = randomdevilban()
devil.banish = randomdevilbanish()
return devil
/proc/devilInfo(name, saveDetails = 0)
/proc/devilInfo(name)
if(GLOB.allDevils[lowertext(name)])
return GLOB.allDevils[lowertext(name)]
else
var/datum/devilinfo/devil = randomDevilInfo(name)
var/datum/fakeDevil/devil = new /datum/fakeDevil(name)
GLOB.allDevils[lowertext(name)] = devil
devil.exists = saveDetails
return devil
/proc/randomDevilName()
var/preTitle = ""
var/title = ""
var/mainName = ""
var/suffix = ""
var/name = ""
if(prob(65))
if(prob(35))
preTitle = pick("Dark ", "Hellish ", "Fiery ", "Sinful ", "Blood ")
title = pick("Lord ", "Fallen Prelate ", "Count ", "Viscount ", "Vizier ", "Elder ", "Adept ")
name = pick(GLOB.devil_pre_title)
name += pick(GLOB.devil_title)
var/probability = 100
mainName = pick("Hal", "Ve", "Odr", "Neit", "Ci", "Quon", "Mya", "Folth", "Wren", "Gyer", "Geyr", "Hil", "Niet", "Twou", "Hu", "Don")
name += pick(GLOB.devil_syllable)
while(prob(probability))
mainName += pick("hal", "ve", "odr", "neit", "ca", "quon", "mya", "folth", "wren", "gyer", "geyr", "hil", "niet", "twoe", "phi", "coa")
name += pick(GLOB.devil_syllable)
probability -= 20
if(prob(40))
suffix = pick(" the Red", " the Soulless", " the Master", ", the Lord of all things", ", Jr.")
return preTitle + title + mainName + suffix
name += pick(GLOB.devil_suffix)
return name
/proc/randomdevilobligation()
return pick(OBLIGATION_FOOD, OBLIGATION_FIDDLE, OBLIGATION_DANCEOFF, OBLIGATION_GREET, OBLIGATION_PRESENCEKNOWN, OBLIGATION_SAYNAME, OBLIGATION_ANNOUNCEKILL, OBLIGATION_ANSWERTONAME)
@@ -151,7 +166,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
/proc/randomdevilbanish()
return pick(BANISH_WATER, BANISH_COFFIN, BANISH_FORMALDYHIDE, BANISH_RUNES, BANISH_CANDLES, BANISH_DESTRUCTION, BANISH_FUNERAL_GARB)
/datum/devilinfo/proc/add_soul(datum/mind/soul)
/datum/antagonist/devil/proc/add_soul(datum/mind/soul)
if(soulsOwned.Find(soul))
return
soulsOwned += soul
@@ -169,13 +184,13 @@ GLOBAL_LIST_INIT(lawlorify, list (
if(ARCH_THRESHOLD)
increase_arch_devil()
/datum/devilinfo/proc/remove_soul(datum/mind/soul)
/datum/antagonist/devil/proc/remove_soul(datum/mind/soul)
if(soulsOwned.Remove(soul))
check_regression()
to_chat(owner.current, "<span class='warning'>You feel as though a soul has slipped from your grasp.</span>")
update_hud()
/datum/devilinfo/proc/check_regression()
/datum/antagonist/devil/proc/check_regression()
if(form == ARCH_DEVIL)
return //arch devil can't regress
//Yes, fallthrough behavior is intended, so I can't use a switch statement.
@@ -187,7 +202,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
remove_spells()
to_chat(owner.current, "<span class='warning'>As punishment for your failures, all of your powers except contract creation have been revoked.")
/datum/devilinfo/proc/regress_humanoid()
/datum/antagonist/devil/proc/regress_humanoid()
to_chat(owner.current, "<span class='warning'>Your powers weaken, have more contracts be signed to regain power.")
if(ishuman(owner.current))
var/mob/living/carbon/human/H = owner.current
@@ -198,7 +213,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
owner.current.forceMove(get_turf(owner.current))//Fixes dying while jaunted leaving you permajaunted.
form = BASIC_DEVIL
/datum/devilinfo/proc/regress_blood_lizard()
/datum/antagonist/devil/proc/regress_blood_lizard()
var/mob/living/carbon/true_devil/D = owner.current
to_chat(D, "<span class='warning'>Your powers weaken, have more contracts be signed to regain power.")
D.oldform.loc = D.loc
@@ -209,7 +224,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
update_hud()
/datum/devilinfo/proc/increase_blood_lizard()
/datum/antagonist/devil/proc/increase_blood_lizard()
to_chat(owner.current, "<span class='warning'>You feel as though your humanoid form is about to shed. You will soon turn into a blood lizard.")
sleep(50)
if(ishuman(owner.current))
@@ -227,7 +242,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
/datum/devilinfo/proc/increase_true_devil()
/datum/antagonist/devil/proc/increase_true_devil()
to_chat(owner.current, "<span class='warning'>You feel as though your current form is about to shed. You will soon turn into a true devil.")
sleep(50)
var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(owner.current.loc)
@@ -241,7 +256,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
update_hud()
/datum/devilinfo/proc/increase_arch_devil()
/datum/antagonist/devil/proc/increase_arch_devil()
if(!ascendable)
return
var/mob/living/carbon/true_devil/D = owner.current
@@ -291,17 +306,17 @@ GLOBAL_LIST_INIT(lawlorify, list (
SSticker.mode.devil_ascended++
form = ARCH_DEVIL
/datum/devilinfo/proc/remove_spells()
/datum/antagonist/devil/proc/remove_spells()
for(var/X in owner.spell_list)
var/obj/effect/proc_holder/spell/S = X
if(!is_type_in_typecache(S, dont_remove_spells))
if(is_type_in_typecache(S, removable_devil_spells))
owner.RemoveSpell(S)
/datum/devilinfo/proc/give_summon_contract()
/datum/antagonist/devil/proc/give_summon_contract()
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/summon_contract(null))
/datum/devilinfo/proc/give_base_spells(give_summon_contract = 0)
/datum/antagonist/devil/proc/give_base_spells(give_summon_contract = 0)
remove_spells()
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork(null))
@@ -312,25 +327,25 @@ GLOBAL_LIST_INIT(lawlorify, list (
if(obligation == OBLIGATION_DANCEOFF)
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/summon_dancefloor(null))
/datum/devilinfo/proc/give_lizard_spells()
/datum/antagonist/devil/proc/give_lizard_spells()
remove_spells()
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/infernal_jaunt(null))
/datum/devilinfo/proc/give_true_spells()
/datum/antagonist/devil/proc/give_true_spells()
remove_spells()
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/greater(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball/hellish(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/infernal_jaunt(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/sintouch(null))
/datum/devilinfo/proc/give_arch_spells()
/datum/antagonist/devil/proc/give_arch_spells()
remove_spells()
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/conjure_item/summon_pitchfork/ascended(null))
owner.AddSpell(new /obj/effect/proc_holder/spell/targeted/sintouch/ascended(null))
/datum/devilinfo/proc/beginResurrectionCheck(mob/living/body)
/datum/antagonist/devil/proc/beginResurrectionCheck(mob/living/body)
if(SOULVALUE>0)
to_chat(owner.current, "<span class='userdanger'>Your body has been damaged to the point that you may no longer use it. At the cost of some of your power, you will return to life soon. Remain in your body.</span>")
sleep(DEVILRESURRECTTIME)
@@ -350,7 +365,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
else
to_chat(owner.current, "<span class='userdanger'>Your hellish powers are too weak to resurrect yourself.</span>")
/datum/devilinfo/proc/check_banishment(mob/living/body)
/datum/antagonist/devil/proc/check_banishment(mob/living/body)
switch(banish)
if(BANISH_WATER)
if(istype(body, /mob/living/carbon))
@@ -394,7 +409,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
return 1
return 0
/datum/devilinfo/proc/hellish_resurrection(mob/living/body)
/datum/antagonist/devil/proc/hellish_resurrection(mob/living/body)
message_admins("[owner.name] (true name is: [truename]) is resurrecting using hellish energy.</a>")
if(SOULVALUE < ARCH_THRESHOLD && ascendable) // once ascended, arch devils do not go down in power by any means.
reviveNumber += LOSS_PER_DEATH
@@ -413,7 +428,7 @@ GLOBAL_LIST_INIT(lawlorify, list (
create_new_body()
check_regression()
/datum/devilinfo/proc/create_new_body()
/datum/antagonist/devil/proc/create_new_body()
if(GLOB.blobstart.len > 0)
var/turf/targetturf = get_turf(pick(GLOB.blobstart))
var/mob/currentMob = owner.current
@@ -451,8 +466,65 @@ GLOBAL_LIST_INIT(lawlorify, list (
throw EXCEPTION("Unable to find a blobstart landmark for hellish resurrection")
/datum/devilinfo/proc/update_hud()
/datum/antagonist/devil/proc/update_hud()
if(istype(owner.current, /mob/living/carbon))
var/mob/living/C = owner.current
if(C.hud_used && C.hud_used.devilsouldisplay)
C.hud_used.devilsouldisplay.update_counter(SOULVALUE)
/datum/antagonist/devil/greet()
to_chat(owner.current, "<span class='warning'><b>You remember your link to the infernal. You are [truename], an agent of hell, a devil. And you were sent to the plane of creation for a reason. A greater purpose. Convince the crew to sin, and embroiden Hell's grasp.</b></span>")
to_chat(owner.current, "<span class='warning'><b>However, your infernal form is not without weaknesses.</b></span>")
to_chat(owner.current, "You may not use violence to coerce someone into selling their soul.")
to_chat(owner.current, "You may not directly and knowingly physically harm a devil, other than yourself.")
to_chat(owner.current, GLOB.lawlorify[LAW][bane])
to_chat(owner.current, GLOB.lawlorify[LAW][ban])
to_chat(owner.current, GLOB.lawlorify[LAW][obligation])
to_chat(owner.current, GLOB.lawlorify[LAW][banish])
to_chat(owner.current, "<span class='warning'>Remember, the crew can research your weaknesses if they find out your devil name.</span><br>")
.=..()
/datum/antagonist/devil/on_gain()
owner.store_memory("Your devilic true name is [truename]<br>[GLOB.lawlorify[LAW][ban]]<br>You may not use violence to coerce someone into selling their soul.<br>You may not directly and knowingly physically harm a devil, other than yourself.<br>[GLOB.lawlorify[LAW][bane]]<br>[GLOB.lawlorify[LAW][obligation]]<br>[GLOB.lawlorify[LAW][banish]]<br>")
if(issilicon(owner.current))
var/mob/living/silicon/robot_devil = owner.current
var/laws = list("You may not use violence to coerce someone into selling their soul.", "You may not directly and knowingly physically harm a devil, other than yourself.", GLOB.lawlorify[LAW][ban], GLOB.lawlorify[LAW][obligation], "Accomplish your objectives at all costs.")
robot_devil.set_law_sixsixsix(laws)
sleep(10)
if(owner.assigned_role == "Clown" && ishuman(owner.current))
var/mob/living/carbon/human/S = owner.current
to_chat(S, "<span class='notice'>Your infernal nature has allowed you to overcome your clownishness.</span>")
S.dna.remove_mutation(CLOWNMUT)
.=..()
/datum/antagonist/devil/on_removal()
to_chat(owner.current, "<span class='userdanger'>Your infernal link has been severed! You are no longer a devil!</span>")
.=..()
/datum/antagonist/devil/apply_innate_effects(mob/living/mob_override)
give_base_spells(1)
owner.current.grant_all_languages(TRUE)
update_hud()
.=..()
/datum/antagonist/devil/remove_innate_effects(mob/living/mob_override)
for(var/X in owner.spell_list)
var/obj/effect/proc_holder/spell/S = X
if(is_type_in_typecache(S, devil_spells))
owner.RemoveSpell(S)
.=..()
//A simple super light weight datum for the codex gigas.
/datum/fakeDevil
var/truename
var/bane
var/obligation
var/ban
var/banish
/datum/fakeDevil/New(name = randomDevilName())
truename = name
bane = randomdevilbane()
obligation = randomdevilobligation()
ban = randomdevilban()
banish = randomdevilbanish()