Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devil fixes #18520

Merged
merged 10 commits into from Jun 14, 2016
8 changes: 7 additions & 1 deletion _maps/map_files/MetaStation/MetaStation.dmm
Expand Up @@ -84613,12 +84613,18 @@
/obj/item/device/radio/intercom{
pixel_y = 25
},
/obj/effect/decal/cleanable/cobweb,
/obj/machinery/firealarm{
dir = 8;
pixel_x = -26;
pixel_y = 0
},
/obj/structure/table/wood,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/turf/open/floor/plasteel/grimy,
/area/chapel/office)
"cOi" = (
Expand Down
12 changes: 11 additions & 1 deletion _maps/map_files/TgStation/tgstation.2.1.3.dmm
Expand Up @@ -60456,6 +60456,16 @@
},
/turf/open/space,
/area/space)
"cBZ" = (
/obj/structure/table/wood,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial,
/turf/open/floor/plasteel/grimy,
/area/chapel/office)

(1,1,1) = {"
aaa
Expand Down Expand Up @@ -105803,7 +105813,7 @@ aHf
aIz
aJM
aLa
aMX
cBZ
aFw
aPh
aQs
Expand Down
File renamed without changes.
Expand Up @@ -41,7 +41,7 @@
devil_mind.objectives += obj_2
devil_mind.objectives += soulquant
devil_mind.devilinfo = devilInfo(trueName, 1)
devil_mind.store_memory("Your devilic true name is [devil_mind.devilinfo.truename]<br>[lawlorify[LAW][devil_mind.devilinfo.ban]]<br>[lawlorify[LAW][devil_mind.devilinfo.bane]]<br>[lawlorify[LAW][devil_mind.devilinfo.obligation]]<br>[lawlorify[LAW][devil_mind.devilinfo.banish]]<br>")
devil_mind.store_memory("Your devilic true name is [devil_mind.devilinfo.truename]<br>[lawlorify[LAW][devil_mind.devilinfo.ban]]<br><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.[lawlorify[LAW][devil_mind.devilinfo.bane]]<br>[lawlorify[LAW][devil_mind.devilinfo.obligation]]<br>[lawlorify[LAW][devil_mind.devilinfo.banish]]<br>")
devil_mind.devilinfo.owner = devil_mind
devil_mind.devilinfo.give_base_spells(1)
spawn(10)
Expand All @@ -54,11 +54,13 @@
return
current << "<span class='warning'><b>You remember your link to the infernal. You are [src.devilinfo.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>"
current << "<span class='warning'><b>However, your infernal form is not without weaknesses.</b></span>"
current << "You may not use violence to coerce someone into selling their soul."
current << "You may not directly and knowingly physically harm a devil, other than yourself."
current << lawlorify[LAW][src.devilinfo.bane]
current << lawlorify[LAW][src.devilinfo.ban]
current << lawlorify[LAW][src.devilinfo.obligation]
current << lawlorify[LAW][src.devilinfo.banish]
current << "<br/><br/> <span class='warning'>Remember, the crew can research your weaknesses if they find out your devil name.</span><br>"
current << "<br/><br/><span class='warning'>Remember, the crew can research your weaknesses if they find out your devil name.</span><br>"
var/obj_count = 1
current << "<span class='notice'>Your current objectives:</span>"
for(var/O in objectives)
Expand Down
@@ -1,4 +1,6 @@
#define POWERUPTHRESHOLD 3 //How many souls are needed per stage.
#define BLOOD_THRESHOLD 3 //How many souls are needed per stage.
#define TRUE_THRESHOLD 7
#define ARCH_THRESHOLD 12

#define BASIC_DEVIL 0
#define BLOOD_LIZARD 1
Expand Down Expand Up @@ -37,9 +39,9 @@ var/global/list/lawlorify = list (
BANISH_COFFIN = "This devil will return to life if it's remains are not placed within a coffin.",
BANISH_FORMALDYHIDE = "To banish the devil, you must inject it's lifeless body with embalming fluid.",
BANISH_RUNES = "This devil will resurrect after death, unless it's remains are within a rune.",
BANISH_CANDLES = "A large number of candles will prevent it from resurrecting.",
BANISH_CANDLES = "A large number of nearby lit candles will prevent it from resurrecting.",
BANISH_DESTRUCTION = "It's corpse must be utterly destroyed to prevent resurrection.",
BANISH_FUNERAL_GARB = "Funeral garments will prevent the devil from resurrecting."
BANISH_FUNERAL_GARB = "If clad in funeral garments, this devil will be unable to resurrect. Should the clothes not fit, lay them gently on top of the devil's corpse."
),
LAW = list(
OBLIGATION_FOOD = "When not acting in self defense, you must always offer your victim food before harming them.",
Expand Down Expand Up @@ -143,11 +145,11 @@ var/global/list/lawlorify = list (
if(0)
owner.current << "<span class='warning'>Your hellish powers have been restored."
give_base_spells()
if(POWERUPTHRESHOLD)
if(BLOOD_THRESHOLD)
increase_blood_lizard()
if(POWERUPTHRESHOLD*2)
if(TRUE_THRESHOLD)
increase_true_devil()
if(POWERUPTHRESHOLD*3)
if(ARCH_THRESHOLD)
increase_arch_devil()

/datum/devilinfo/proc/remove_soul(datum/mind/soul)
Expand All @@ -161,9 +163,9 @@ var/global/list/lawlorify = list (
if(-1)
remove_spells()
owner.current << "<span class='warning'>As punishment for your failures, all of your powers except contract creation have been revoked."
if(POWERUPTHRESHOLD-1)
if(BLOOD_THRESHOLD-1)
regress_humanoid()
if(POWERUPTHRESHOLD*2-1)
if(TRUE_THRESHOLD-1)
regress_blood_lizard()

/datum/devilinfo/proc/increase_form()
Expand Down Expand Up @@ -367,11 +369,16 @@ var/global/list/lawlorify = list (
var/mob/living/carbon/human/H = body
if(H.w_uniform && istype(H.w_uniform, /obj/item/clothing/under/burial))
return 1
return 0
return 0
else
for(var/obj/item/clothing/under/burial/B in range(0,body))
if(B.loc == get_turf(B)) //Make sure it's not in someone's inventory or something.
return 1
return 0

/datum/devilinfo/proc/hellish_resurrection(mob/living/body)
message_admins("[owner.name] (true name is: [truename]) is resurrecting using hellish energy.</a>")
if(SOULVALUE < POWERUPTHRESHOLD * 3) // once ascended, arch devils do not go down in power by any means.
if(SOULVALUE <= ARCH_THRESHOLD) // once ascended, arch devils do not go down in power by any means.
reviveNumber++
if(body)
body.revive(1,0)
Expand All @@ -396,23 +403,22 @@ var/global/list/lawlorify = list (
currentMob.change_mob_type( /mob/living/carbon/human , targetturf, null, 1)
var/mob/living/carbon/human/H = owner.current
give_summon_contract()
if(SOULVALUE >= POWERUPTHRESHOLD)
if(SOULVALUE >= BLOOD_THRESHOLD)
H.set_species(/datum/species/lizard, 1)
H.underwear = "Nude"
H.undershirt = "Nude"
H.socks = "Nude"
H.dna.features["mcolor"] = "511"
H.regenerate_icons()
if(SOULVALUE >= POWERUPTHRESHOLD * 2) //Yes, BOTH this and the above if statement are to run if soulpower is high enough.
var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(targetturf)
A.faction |= "hell"
H.forceMove(A)
A.oldform = H
A.set_name()
owner.transfer_to(A)
if(SOULVALUE >= POWERUPTHRESHOLD * 3)
A.convert_to_archdevil()

if(SOULVALUE >= TRUE_THRESHOLD) //Yes, BOTH this and the above if statement are to run if soulpower is high enough.
var/mob/living/carbon/true_devil/A = new /mob/living/carbon/true_devil(targetturf)
A.faction |= "hell"
H.forceMove(A)
A.oldform = H
A.set_name()
owner.transfer_to(A)
if(SOULVALUE >= ARCH_THRESHOLD)
A.convert_to_archdevil()
else
throw EXCEPTION("Unable to find a blobstart landmark for hellish resurrection")
check_regression()
6 changes: 3 additions & 3 deletions code/game/objects/items/weapons/twohanded.dm
Expand Up @@ -464,7 +464,7 @@
force_unwielded = 100
force_wielded = 500000 // Kills you DEAD.

/obj/item/weapon/twohanded/pitchfork/update_icon() //Currently only here to fuck with the on-mob icons.
/obj/item/weapon/twohanded/pitchfork/update_icon()
icon_state = "pitchfork[wielded]"

/obj/item/weapon/twohanded/pitchfork/suicide_act(mob/user)
Expand All @@ -474,7 +474,7 @@
/obj/item/weapon/twohanded/pitchfork/demonic/pickup(mob/user)
if(istype(user, /mob/living))
var/mob/living/U = user
if(!U.mind.devilinfo)
if(U.mind && (!U.mind.devilinfo || (U.mind.soulOwner == U.mind))) //Burn hands unless they are a devil or have sold their soul
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean !U.mind.soulowner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, by default, you own your own soul.

U.visible_message("<span class='warning'>As [U] picks [src] up, [U]'s arms briefly catch fire.</span>", \
"<span class='warning'>\"As you pick up the [src] your arms ignite, reminding you of all your past sins.\"</span>")
if(ishuman(U))
Expand All @@ -484,7 +484,7 @@
U.adjustFireLoss(rand(force/2,force))

/obj/item/weapon/twohanded/pitchfork/demonic/attack(mob/target, mob/living/carbon/human/user)
if(!user.mind.devilinfo)
if(user.mind && (!user.mind.devilinfo || (user.mind.soulOwner == user.mind)))
user << "<span class ='warning'>The [src] burns in your hands.</span>"
user.apply_damage(rand(force/2, force), BURN, pick("l_arm", "r_arm"))
..()
Expand Down
13 changes: 12 additions & 1 deletion code/modules/cargo/packs.dm
Expand Up @@ -1188,9 +1188,20 @@
/obj/item/weapon/storage/book/bible/booze,
/obj/item/weapon/storage/book/bible/booze,
/obj/item/clothing/suit/hooded/chaplain_hoodie,
/obj/item/clothing/suit/hooded/chaplain_hoodie)
/obj/item/clothing/suit/hooded/chaplain_hoodie,
/obj/item/clothing/under/burial,
/obj/item/clothing/under/burial)
crate_name = "religious supplies crate"

/datum/supply_pack/misc/book_crate
name = "Book Crate"
cost = 1500
contains = list(/obj/item/weapon/book/codex_gigas,
/obj/item/weapon/book/manual/random/,
/obj/item/weapon/book/manual/random/,
/obj/item/weapon/book/manual/random/,
/obj/item/weapon/book/random/triple)

/datum/supply_pack/misc/posters
name = "Corporate Posters Crate"
cost = 800
Expand Down
42 changes: 29 additions & 13 deletions code/modules/library/random_books.dm
Expand Up @@ -4,6 +4,17 @@
new newtype(loc)
qdel(src)

/obj/item/weapon/book/random
var/amount = 1
var/category = null

/obj/item/weapon/book/random/New()
create_random_books(amount, src.loc, TRUE, category)
qdel(src)

/obj/item/weapon/book/random/triple
amount = 3

/obj/structure/bookcase/random
var/category = null
var/book_count = 2
Expand All @@ -18,31 +29,36 @@
if(!book_count || !isnum(book_count))
update_icon()
return
book_count += pick(-1,-1,0,1,1)
create_random_books(book_count, src, FALSE, category)
update_icon()

/proc/create_random_books(amount = 2, location, fail_loud = FALSE, category = null)
. = list()
if(!isnum(amount) || amount<1)
return
if(!establish_db_connection())
if(prob(5))
var/obj/item/weapon/paper/P = new(get_turf(loc))
if(fail_loud || prob(5))
var/obj/item/weapon/paper/P = new(location)
P.info = "There once was a book from Nantucket<br>But the database failed us, so f*$! it.<br>I tried to be good to you<br>Now this is an I.O.U<br>If you're feeling entitled, well, stuff it!<br><br><font color='gray'>~</font>"
update_icon()
return
if(category && prob(25)) category = null
book_count += pick(-1,-1,0,1,1)
if(book_count <= 0)
update_icon()
P.update_icon()
return

if(prob(25))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

@lordpidey lordpidey Jun 14, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was there before. I assume it's so that occasionally bookshelves aren't stocked with the right books, to further enhance the "Nanotrasen doesn't care" look.

Take a look at removed line 27.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I missed the previous in the diff

category = null
var/c = category? " AND category='[sanitizeSQL(category)]'" :""
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [book_count];") // isdeleted copyright (c) not me
var/DBQuery/query = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you touching the library sql?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed a variable. This code was originally in /obj/structure/bookcase/random/initialize(), but is now in a completely separate proc.

if(query.Execute())
while(query.NextRow())
var/obj/item/weapon/book/B = new(src)
var/obj/item/weapon/book/B = new(location)
. += B
B.author = query.item[2]
B.title = query.item[3]
B.dat = query.item[4]
B.name = "Book: [B.title]"
B.icon_state= "book[rand(1,8)]"
else
log_game("SQL ERROR populating library bookshelf. Category: \[[category]\], Count: [book_count], Error: \[[query.ErrorMsg()]\]\n")
update_icon()
log_game("SQL ERROR populating library bookshelf. Category: \[[category]\], Count: [amount], Error: \[[query.ErrorMsg()]\]\n")


/obj/structure/bookcase/random/fiction
name = "bookcase (Fiction)"
Expand Down
Expand Up @@ -14,8 +14,6 @@
action_icon_state = "pitchfork"
action_background_icon_state = "bg_demon"



/obj/effect/proc_holder/spell/targeted/summon_pitchfork/cast(list/targets, mob/user = usr)
if (pitchfork)
qdel(pitchfork)
Expand Down Expand Up @@ -82,7 +80,7 @@
desc = "This spell launches hellfire at the target."

school = "evocation"
charge_max = 30
charge_max = 80
clothes_req = 0
invocation = "Your very soul will catch fire!"
invocation_type = "shout"
Expand Down
22 changes: 11 additions & 11 deletions tgstation.dme
Expand Up @@ -109,7 +109,7 @@
#include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\blob_overmind.dm"
#include "code\_onclick\hud\blobbernauthud.dm"
#include "code\_onclick\hud\demon.dm"
#include "code\_onclick\hud\devil.dm"
#include "code\_onclick\hud\drones.dm"
#include "code\_onclick\hud\fullscreen.dm"
#include "code\_onclick\hud\ghost.dm"
Expand Down Expand Up @@ -326,13 +326,13 @@
#include "code\game\gamemodes\cult\ritual.dm"
#include "code\game\gamemodes\cult\runes.dm"
#include "code\game\gamemodes\cult\talisman.dm"
#include "code\game\gamemodes\demon\demon.dm"
#include "code\game\gamemodes\demon\demon_game_mode.dm"
#include "code\game\gamemodes\demon\demoninfo.dm"
#include "code\game\gamemodes\demon\objectives.dm"
#include "code\game\gamemodes\demon\imp\imp.dm"
#include "code\game\gamemodes\demon\true_demon\_true_demon.dm"
#include "code\game\gamemodes\demon\true_demon\inventory.dm"
#include "code\game\gamemodes\devil\devil.dm"
#include "code\game\gamemodes\devil\devil_game_mode.dm"
#include "code\game\gamemodes\devil\devilinfo.dm"
#include "code\game\gamemodes\devil\objectives.dm"
#include "code\game\gamemodes\devil\imp\imp.dm"
#include "code\game\gamemodes\devil\true_devil\_true_devil.dm"
#include "code\game\gamemodes\devil\true_devil\inventory.dm"
#include "code\game\gamemodes\extended\extended.dm"
#include "code\game\gamemodes\gang\dominator.dm"
#include "code\game\gamemodes\gang\gang.dm"
Expand Down Expand Up @@ -1212,7 +1212,7 @@
#include "code\modules\jobs\job_types\science.dm"
#include "code\modules\jobs\job_types\security.dm"
#include "code\modules\jobs\job_types\silicon.dm"
#include "code\modules\library\lib_demonomicon.dm"
#include "code\modules\library\lib_codex_gigas.dm"
#include "code\modules\library\lib_items.dm"
#include "code\modules\library\lib_machines.dm"
#include "code\modules\library\lib_readme.dm"
Expand Down Expand Up @@ -1698,8 +1698,8 @@
#include "code\modules\spells\spell_types\charge.dm"
#include "code\modules\spells\spell_types\conjure.dm"
#include "code\modules\spells\spell_types\construct_spells.dm"
#include "code\modules\spells\spell_types\demon.dm"
#include "code\modules\spells\spell_types\demon_boons.dm"
#include "code\modules\spells\spell_types\devil.dm"
#include "code\modules\spells\spell_types\devil_boons.dm"
#include "code\modules\spells\spell_types\dumbfire.dm"
#include "code\modules\spells\spell_types\emplosion.dm"
#include "code\modules\spells\spell_types\ethereal_jaunt.dm"
Expand Down