Skip to content

Commit

Permalink
Cruciform to Master (discordia-space#732)
Browse files Browse the repository at this point in the history
* Add sprites for prayers book and cruciform, add on mob cruciform overlay generation

* Fix compilation errors caused by removing redundant xeno procs

* Override attack_self for bible to avoid 'Blank book' error message

* Implement religion selection in character setup, remove broken cruciform overlay generation

* Fix syntax error

* Onmob cruciform drawing
  • Loading branch information
LethalGhost authored and SpadesSlick committed Apr 9, 2017
1 parent 7aa2b93 commit 71111ae
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 160 deletions.
21 changes: 12 additions & 9 deletions code/game/jobs/job/civilian_chaplain.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Due to how large this one is it gets its own file
/datum/job/chaplain
title = "Monochurch Preacher"
title = "Cyberchristian priest"
flag = CHAPLAIN
department = "Civilian"
department_flag = CIVILIAN
Expand All @@ -15,12 +15,15 @@
uniform = /obj/item/clothing/under/rank/chaplain
pda = /obj/item/device/pda/chaplain

equip(var/mob/living/carbon/human/H)
if(!..()) return 0
/datum/job/chaplain/equip(var/mob/living/carbon/human/H)
var/obj/item/weapon/implant/cruciform/priest/C = new /obj/item/weapon/implant/cruciform/priest(H)
C.install(H)
C.activate()

var/obj/item/weapon/implant/cruciform/priest/C = new /obj/item/weapon/implant/cruciform/priest(H)
C.install(H)
C.active = TRUE
var/obj/item/weapon/book/bible/B = new /obj/item/weapon/book/bible(H)
H.equip_to_slot_or_del(B, slot_l_hand)
return 1
H.religion = "Christianity"

if(!..()) return 0

var/obj/item/weapon/book/bible/B = new /obj/item/weapon/book/bible(H)
H.equip_to_slot_or_del(B, slot_l_hand)
return 1
5 changes: 5 additions & 0 deletions code/game/jobs/job/job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@
var/obj/item/weapon/implant/loyalty/I = new /obj/item/weapon/implant/loyalty(src)
I.install(H, "head")

if(H.religion == "Christianity" && !locate(/obj/item/weapon/implant/cruciform, H))
var/obj/item/weapon/implant/cruciform/C = new /obj/item/weapon/implant/cruciform(H)
C.install(H)
C.activate()

return 1

/datum/job/proc/setup_account(var/mob/living/carbon/human/H)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/weapons/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
src.part = affected
BITSET(H.hud_updateflag, IMPLOYAL_HUD)

/obj/item/weapon/implant/proc/get_mob_overlay(var/organ_tag, var/gender, var/body_build)

/obj/item/weapon/implant/proc/get_data()
return "No information available"

Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/weapons/implants/implanter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
M.visible_message("<span class='warning'>[M] has been implanted by [user].</span>")
admin_attack_log(user, M, "Implanted using \the [src.name] ([src.implant.name])", "Implanted with \the [src.name] ([src.implant.name])", "used an implanter, [src.name] ([src.implant.name]), on")
src.implant.install(M, user.targeted_organ)
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.update_implants()
src.implant = null
update()

Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/preference_setup/general/01_basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@ datum/preferences/proc/set_biological_gender(var/set_gender)
pref.metadata = sanitize(new_metadata)
return TOPIC_REFRESH

else if(href_list["religion"])
pref.religion = input("Religion") in list("None", "Christianity")
return TOPIC_REFRESH

return ..()
3 changes: 0 additions & 3 deletions code/modules/mob/living/carbon/alien/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
if (!muzzled)
message = "<B>The [src.name]</B> whimpers."
m_type = 2
if("tail")
message = "<B>The [src.name]</B> waves its tail."
m_type = 1
if("gasp")
message = "<B>The [src.name]</B> gasps."
m_type = 2
Expand Down
2 changes: 0 additions & 2 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
//Handle species-specific deaths.
species.handle_death(src)

animate_tail_stop()

//Handle brain slugs.
var/obj/item/organ/external/head = get_organ("head")
var/mob/living/simple_animal/borer/B
Expand Down
12 changes: 0 additions & 12 deletions code/modules/mob/living/carbon/human/emote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,18 +541,6 @@
message = "makes a very loud noise."
m_type = 2

if("swish")
src.animate_tail_once()

if("wag", "sway")
src.animate_tail_start()

if("qwag", "fastsway")
src.animate_tail_fast()

if("swag", "stopsway")
src.animate_tail_stop()

if ("help")
src << {"blink, blink_r, blush, bow-(none)/mob, burp, choke, chuckle, clap, collapse, cough,
cry, custom, deathgasp, drool, eyebrow, frown, gasp, giggle, groan, grumble, handshake, hug-(none)/mob, glare-(none)/mob,
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@
if(paralysis || sleeping)
blinded = 1
stat = UNCONSCIOUS
animate_tail_reset()
adjustHalLoss(-3)

if(paralysis)
Expand Down
184 changes: 55 additions & 129 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,33 @@ Please contact me on #coderbus IRC. ~Carn x
*/

//Human Overlays Indexes/////////
#define MUTATIONS_LAYER 1
#define DAMAGE_LAYER 2
#define SURGERY_LEVEL 3 //bs12 specific.
#define UNIFORM_LAYER 4
#define ID_LAYER 5
#define SHOES_LAYER 6
#define GLOVES_LAYER 7
#define BELT_LAYER 8
#define SUIT_LAYER 9
#define TAIL_LAYER 10 //bs12 specific. this hack is probably gonna come back to haunt me
#define GLASSES_LAYER 11
#define BELT_LAYER_ALT 12
#define SUIT_STORE_LAYER 13
#define BACK_LAYER 14
#define HAIR_LAYER 15 //TODO: make part of head layer?
#define EARS_LAYER 16
#define FACEMASK_LAYER 17
#define HEAD_LAYER 18
#define COLLAR_LAYER 19
#define HANDCUFF_LAYER 20
#define LEGCUFF_LAYER 21
#define L_HAND_LAYER 22
#define R_HAND_LAYER 23
#define FIRE_LAYER 24 //If you're on fire
#define TARGETED_LAYER 25 //BS12: Layer for the target overlay from weapon targeting system
#define TOTAL_LAYERS 25
#define MUTATIONS_LAYER 1
#define DAMAGE_LAYER 2
#define SURGERY_LAYER 3
#define IMPLANTS_LAYER 4
#define UNIFORM_LAYER 5
#define ID_LAYER 6
#define SHOES_LAYER 7
#define GLOVES_LAYER 8
#define BELT_LAYER 9
#define SUIT_LAYER 10
#define TAIL_LAYER 11 //bs12 specific. this hack is probably gonna come back to haunt me
#define GLASSES_LAYER 12
#define BELT_LAYER_ALT 13
#define SUIT_STORE_LAYER 14
#define BACK_LAYER 15
#define HAIR_LAYER 16 //TODO: make part of head layer?
#define EARS_LAYER 17
#define FACEMASK_LAYER 18
#define HEAD_LAYER 19
#define COLLAR_LAYER 20
#define HANDCUFF_LAYER 21
#define LEGCUFF_LAYER 22
#define L_HAND_LAYER 23
#define R_HAND_LAYER 24
#define FIRE_LAYER 25 //If you're on fire
#define TARGETED_LAYER 26 //BS12: Layer for the target overlay from weapon targeting system
#define TOTAL_LAYERS 27
//////////////////////////////////

/mob/living/carbon/human
Expand Down Expand Up @@ -324,9 +325,6 @@ var/global/list/damage_icon_parts = list()
if(update_icons)
update_icons()

//tail
update_tail_showing(0)

//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair(var/update_icons=1)
//Reset our hair
Expand Down Expand Up @@ -385,36 +383,44 @@ var/global/list/damage_icon_parts = list()
add_image = 1
for(var/mut in mutations)
switch(mut)
/*
if(HULK)
if(fat)
standing.underlays += "hulk_[fat]_s"
else
standing.underlays += "hulk_[g]_s"
add_image = 1
if(COLD_RESISTANCE)
standing.underlays += "fire[fat]_s"
add_image = 1
if(TK)
standing.underlays += "telekinesishead[fat]_s"
add_image = 1
*/
if(LASER)
standing.overlays += "lasereyes_s"
standing.overlays += "lasereyes_s"
add_image = 1
if(add_image)
overlays_standing[MUTATIONS_LAYER] = standing
else
overlays_standing[MUTATIONS_LAYER] = null
if(update_icons) update_icons()

/mob/living/carbon/human/proc/update_implants(var/update_icons = 1)
var/image/standing = image('icons/mob/mob.dmi', "blank")
var/have_icon = FALSE
var/fat = body_build.index
var/gender = src.gender == MALE ? "m" : "f"
for(var/Organ in organs_by_name)
var/obj/item/organ/external/O = get_organ(Organ)
if(!O)
continue
var/image/mob_icon = null
for(var/obj/item/weapon/implant/I in O.implants)
mob_icon = I.get_mob_overlay(Organ, gender, fat)
if(mob_icon)
standing.overlays += mob_icon
have_icon = TRUE
if(have_icon)
overlays_standing[IMPLANTS_LAYER] = standing
else
overlays_standing[IMPLANTS_LAYER] = null
if(update_icons) update_icons()

/* --------------------------------------- */
//For legacy support.
/mob/living/carbon/human/regenerate_icons()
..()
if(transforming)
return
update_mutations(0)
update_implants(0)
update_body(0)
update_hair(0)
update_hud()//Hud Stuff
Expand Down Expand Up @@ -787,11 +793,9 @@ var/global/list/damage_icon_parts = list()
standing.overlays |= A.get_mob_overlay()

overlays_standing[SUIT_LAYER] = standing
update_tail_showing(0)

else
overlays_standing[SUIT_LAYER] = null
update_tail_showing(0)
update_inv_shoes(0)

update_collar(0)
Expand Down Expand Up @@ -995,85 +999,6 @@ var/global/list/damage_icon_parts = list()

if(update_icons) update_icons()

/mob/living/carbon/human/proc/update_tail_showing(var/update_icons=1)
overlays_standing[TAIL_LAYER] = null

if(species.tail && !(wear_suit && wear_suit.flags_inv & HIDETAIL))
var/icon/tail_s = get_tail_icon()
overlays_standing[TAIL_LAYER] = image(tail_s, icon_state = "[species.tail]_s")
animate_tail_reset(0)

if(update_icons)
update_icons()

/mob/living/carbon/human/proc/get_tail_icon()
var/icon_key = "[species.race_key][skin_color][hair_color]"
var/icon/tail_icon = tail_icon_cache[icon_key]
if(!tail_icon)
//generate a new one
tail_icon = new/icon(icon = (species.tail_animation? species.tail_animation : 'icons/effects/species.dmi'))
tail_icon.Blend(skin_color, ICON_ADD)
tail_icon_cache[icon_key] = tail_icon

return tail_icon


/mob/living/carbon/human/proc/set_tail_state(var/t_state)
var/image/tail_overlay = overlays_standing[TAIL_LAYER]

if(tail_overlay && species.tail_animation)
tail_overlay.icon_state = t_state
return tail_overlay
return null

//Not really once, since BYOND can't do that.
//Update this if the ability to flick() images or make looping animation start at the first frame is ever added.
/mob/living/carbon/human/proc/animate_tail_once(var/update_icons=1)
var/t_state = "[species.tail]_once"

var/image/tail_overlay = overlays_standing[TAIL_LAYER]
if(tail_overlay && tail_overlay.icon_state == t_state)
return //let the existing animation finish

tail_overlay = set_tail_state(t_state)
if(tail_overlay)
spawn(20)
//check that the animation hasn't changed in the meantime
if(overlays_standing[TAIL_LAYER] == tail_overlay && tail_overlay.icon_state == t_state)
animate_tail_stop()

if(update_icons)
update_icons()

/mob/living/carbon/human/proc/animate_tail_start(var/update_icons=1)
set_tail_state("[species.tail]_slow[rand(0,9)]")

if(update_icons)
update_icons()

/mob/living/carbon/human/proc/animate_tail_fast(var/update_icons=1)
set_tail_state("[species.tail]_loop[rand(0,9)]")

if(update_icons)
update_icons()

/mob/living/carbon/human/proc/animate_tail_reset(var/update_icons=1)
if(stat != DEAD)
set_tail_state("[species.tail]_idle[rand(0,9)]")
else
set_tail_state("[species.tail]_static")


if(update_icons)
update_icons()

/mob/living/carbon/human/proc/animate_tail_stop(var/update_icons=1)
set_tail_state("[species.tail]_static")

if(update_icons)
update_icons()


//Adds a collar overlay above the helmet layer if the suit has one
// Suit needs an identically named sprite in icons/mob/collar.dmi
/mob/living/carbon/human/proc/update_collar(var/update_icons=1)
Expand All @@ -1097,19 +1022,20 @@ var/global/list/damage_icon_parts = list()
if(update_icons) update_icons()

/mob/living/carbon/human/proc/update_surgery(var/update_icons=1)
overlays_standing[SURGERY_LEVEL] = null
overlays_standing[SURGERY_LAYER] = null
var/image/total = new
for(var/obj/item/organ/external/E in organs)
if(E.open)
var/image/I = image("icon"='icons/mob/surgery.dmi', "icon_state"="[E.name][round(E.open)]", "layer"=-SURGERY_LEVEL)
var/image/I = image("icon"='icons/mob/surgery.dmi', "icon_state"="[E.name][round(E.open)]", "layer"=-SURGERY_LAYER)
total.overlays += I
overlays_standing[SURGERY_LEVEL] = total
overlays_standing[SURGERY_LAYER] = total
if(update_icons) update_icons()

//Human Overlays Indexes/////////
#undef MUTATIONS_LAYER
#undef DAMAGE_LAYER
#undef SURGERY_LEVEL
#undef SURGERY_LAYER
#undef IMPLANTS_LAYER
#undef UNIFORM_LAYER
#undef ID_LAYER
#undef SHOES_LAYER
Expand Down
7 changes: 5 additions & 2 deletions code/modules/religion/cruciform/bible.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/obj/item/weapon/book/bible
name = "Cyberchristian prayer book"
desc = "Contains holy litany and chants."
icon_state ="bible"
item_state = "bible"
icon = 'icons/obj/library.dmi'
icon_state = "bible"
var/list/rituals = list(/datum/ritual/relief, /datum/ritual/soul_hunger, /datum/ritual/entreaty)

/obj/item/weapon/book/attack_self(mob/living/carbon/human/H)
interact(H)

/obj/item/weapon/book/bible/interact(mob/living/carbon/human/H)
var/data = null
for(var/datum/ritual/R in rituals)
Expand Down
Loading

0 comments on commit 71111ae

Please sign in to comment.