Skip to content

Commit

Permalink
Adds abnormality cores
Browse files Browse the repository at this point in the history
adds abno core icons

abno core extractor

final changes

Apply suggestions from code review

Co-authored-by: [̸R̵e̵d̴a̴c̶t̸e̸d̴]̵ <[email protected]>

requested changes

removes an unneeded comment

Adds skin prophet

Minor bug
  • Loading branch information
vampirebat74 committed Apr 30, 2024
1 parent 7b738e4 commit 2f63770
Show file tree
Hide file tree
Showing 26 changed files with 116 additions and 1 deletion.
Binary file added ModularTegustation/Teguicons/abno_cores/aleph.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/he.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/template.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/teth.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/tool.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/waw.dmi
Binary file not shown.
Binary file added ModularTegustation/Teguicons/abno_cores/zayin.dmi
Binary file not shown.
Binary file added ModularTegustation/Tegusounds/abno_extract.ogg
Binary file not shown.
24 changes: 24 additions & 0 deletions code/modules/mob/living/simple_animal/abnormality/_abnormality.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
var/list/grouped_abnos = list()
//Abnormaltiy portrait, updated on spawn if they have one.
var/portrait = "UNKNOWN"
var/core_icon = ""
var/core_enabled = TRUE

/mob/living/simple_animal/hostile/abnormality/Initialize(mapload)
SHOULD_CALL_PARENT(TRUE)
Expand Down Expand Up @@ -130,6 +132,9 @@
if(istype(datum_reference)) // Respawn the mob on death
datum_reference.current = null
addtimer(CALLBACK (datum_reference, TYPE_PROC_REF(/datum/abnormality, RespawnAbno)), 30 SECONDS)
else//Abnormality Cores are spawned if there is no console tied to the abnormality
if(core_enabled)//If cores are manually disabled for any reason, they won't generate.
CreateAbnoCore(name, core_icon)
..()
if(loc)
if(isarea(loc))
Expand Down Expand Up @@ -495,3 +500,22 @@
button_icon_state = button_icon_toggle_deactivated
UpdateButtonIcon()
active = FALSE

/mob/living/simple_animal/hostile/abnormality/proc/CreateAbnoCore()//this is called by abnormalities on Destroy()
var/obj/structure/abno_core/C = new(get_turf(src))
C.name = initial(name) + " Core"
C.desc = "The core of [initial(name)]"
C.icon_state = core_icon
C.contained_abno = src.type
C.threat_level = threat_level
switch(GetRiskLevel())
if(1)
return
if(2)
C.icon = 'ModularTegustation/Teguicons/abno_cores/teth.dmi'
if(3)
C.icon = 'ModularTegustation/Teguicons/abno_cores/he.dmi'
if(4)
C.icon = 'ModularTegustation/Teguicons/abno_cores/waw.dmi'
if(5)
C.icon = 'ModularTegustation/Teguicons/abno_cores/aleph.dmi'
75 changes: 75 additions & 0 deletions code/modules/mob/living/simple_animal/abnormality/abno_cores.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/obj/structure/abno_core
name = "blank abnormality core"
desc = "You shouldn't be seeing this. Please let someone know!"
icon = 'ModularTegustation/Teguicons/abno_cores/zayin.dmi'
icon_state = ""
anchored = FALSE
density = FALSE
resistance_flags = INDESTRUCTIBLE
pixel_x = -16
base_pixel_x = -16
var/mob/living/simple_animal/hostile/abnormality/contained_abno
var/release_time = 420 SECONDS//this is going to be reduced by a minute for every risk level
var/threat_level

/obj/structure/abno_core/proc/Release()
if(!contained_abno)//Is this core properly generated?
return
new contained_abno(get_turf(src))
qdel(src)
return TRUE

/obj/structure/abno_core/MouseDrop(over_object)
if(!Adjacent(over_object) || !Adjacent(usr))
return
var/obj/machinery/abno_core_extractor/O = over_object//abno core extractor
if(istype(O))
var/response = alert(usr,"Will you extract [src]?","This cannot be reversed.","Yes","No")
if(response == "Yes" && do_after(usr, 10, O))
Extract()
return
var/obj/structure/itemselling/I = over_object//item selling machine
if(istype(I))
var/response = alert(usr,"Will you sell [src]?","This cannot be reversed.","Yes","No")
if(response == "Yes" && do_after(usr, 10, I))
if(!contained_abno || !threat_level)//is there no risk level or abnormality inside?
qdel(src)
return
var/payment_amt = threat_level * threat_level * 100
var/obj/item/holochip/holochip = new (get_turf(src), payment_amt)
usr.put_in_hands(holochip)
qdel(src)
return

/obj/structure/abno_core/proc/Extract()
if(!LAZYLEN(GLOB.abnormality_room_spawners) || !contained_abno)
return
var/mob/living/simple_animal/hostile/abnormality/A = contained_abno
var/datum/abnormality/abno_ref = A
for(abno_ref in SSlobotomy_corp.all_abnormality_datums) //Check if they're already in the facility
if(abno_ref.abno_path == A)
for(var/mob/living/carbon/human/H in livinginview(1, src))
to_chat(H, span_boldwarning("This abnormality is already contained!"))
return FALSE//If the abnormality already exists in a cell, the proc returns early here.
icon_state = ""
animate(src, alpha = 1,pixel_x = -16, pixel_z = 32, time = 3 SECONDS)
playsound(src,'ModularTegustation/Tegusounds/abno_extract.ogg', 50, 5)
sleep(3 SECONDS)
//FIXME: Causes a runtime for abnormalities with spawn disabled
SSabnormality_queue.queued_abnormality = contained_abno
SSabnormality_queue.SpawnAbno()

log_admin("[key_name(usr)] has spawned [contained_abno].")
message_admins("[key_name(usr)] has spawned [contained_abno].")

SSblackbox.record_feedback("nested tally", "core_spawn_abnormality", 1, list("Initiated Spawn Abnormality", "[SSabnormality_queue.queued_abnormality]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!


qdel(src)

/obj/machinery/abno_core_extractor
name = "abnormality core containment unit"
desc = "A device used to transfer abnormalities into containment cells."
icon = 'icons/obj/machines/sleeper.dmi'
icon_state = "sleeper"
density = FALSE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
icon_state = "distortedform"
icon_living = "distortedform"
icon_dead = "distortedform_dead"
core_icon = "distortedform_dead"
portrait = "distortedform"
melee_damage_type = RED_DAMAGE
damage_coeff = list(RED_DAMAGE = 0.4, WHITE_DAMAGE = 0.4, BLACK_DAMAGE = 0.4, PALE_DAMAGE = 0.8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
icon_state = "kqe"
icon_living = "kqe"
icon_dead = "kqe_egg"
core_icon = "kqe_egg"
portrait = "KQE"
del_on_death = FALSE
melee_damage_type = BLACK_DAMAGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
icon_state = "doomsday_inert"
icon_living = "doomsday_inert"
icon_dead = "doomsday_egg"
core_icon = "doomsday_egg"
portrait = "doomsday"
light_color = COLOR_LIGHT_ORANGE
light_range = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
icon_state = "drifting_fox"
icon_living = "drifting_fox"
icon_dead = "fox_egg"
core_icon = "fox_egg"
portrait = "drifting_fox"
death_message = "Collapses into a glass egg"
death_sound = 'sound/abnormalities/drifting_fox/fox_death_sound.ogg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
icon_state = "gold_inert"
icon_living = "gold_inert"
icon_dead = "gold_cracked"
core_icon = "false_egg"
portrait = "golden_apple"
var/list/golden_apple_lines = list(
"I didn't want to die.",
Expand Down Expand Up @@ -263,7 +264,7 @@
icon = 'ModularTegustation/Teguicons/96x48.dmi'
icon_state = "false_apple"
icon_living = "false_apple"
icon_dead = "false_egg"
icon_dead = "false_dead"
death_message = "is reduced to a primordial egg."
name = "False Apple"
desc = "The apple ruptured and a swarm of maggots crawled inside, metamorphosing into a hideous face."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "headless_ichthys"
icon_living = "headless_ichthys"
icon_dead = "headless_ichthys"
core_icon = "headless_ichthys"
portrait = "headless_icthys"
pixel_x = -16
base_pixel_x = -16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
icon_state = "faelantern"
icon_living = "faelantern_fairy"
icon_dead = "faelantern_egg"
core_icon = "faelantern_egg"
portrait = "faelantern"
maxHealth = 1200
health = 1200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "fairy_longlegs"
icon_living = "fairy_longlegs"
icon_dead = "fairy_longlegs_dead"
core_icon = "fairy_longlegs_dead"
portrait = "fairy_long_legs"
del_on_death = FALSE
pixel_x = -16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon = 'ModularTegustation/Teguicons/tegumobs.dmi'
icon_state = "scorched"
icon_living = "scorched"
core_icon = "scorch_egg"
portrait = "scorched_girl"
maxHealth = 400
health = 400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
desc = "A little fleshy being reading a tiny book."
icon = 'ModularTegustation/Teguicons/32x48.dmi'
icon_state = "skin_prophet"
core_icon = "prophet_egg"
portrait = "skin_prophet"
maxHealth = 600
health = 600
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
icon_state = "ebonyqueen"
icon_living = "ebonyqueen"
icon_dead = "ebonyqueen_dead"
core_icon = "ebonyqueen_dead"
portrait = "ebony_queen"
maxHealth = 2000
health = 2000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
icon_state = "rose_sign"
icon_living = "rose_sign"
icon_dead = "rosesign_egg"
core_icon = "rosesign_egg"
portrait = "rose_sign"
del_on_death = FALSE
gender = NEUTER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
icon_state = "siltcurrent"
icon_living = "siltcurrent"
icon_dead = "siltcurrent_egg"
core_icon = "siltcurrent_egg"
portrait = "siltcurrent"
death_message = "coalesces into a primordial egg."
del_on_death = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "thunderbird"
icon_living = "thunderbird"
icon_dead = "thunderbird_dead"
core_icon = "thunderbird_dead"
del_on_death = FALSE
speak_emote = list("intones")
gender = NEUTER
Expand Down
1 change: 1 addition & 0 deletions code/modules/paperwork/records/info/_info.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ For escape damage you will have to get creative and figure out how dangerous it
var/mob/living/simple_animal/hostile/abnormality/abno
if(!(abno_type in GLOB.cached_abno_work_rates) || !(abno_type in GLOB.cached_abno_resistances))
abno = new abno_type(src)
abno.core_enabled = FALSE
QDEL_NULL(abno)

if(isnull(abno_can_breach))
Expand Down
1 change: 1 addition & 0 deletions lobotomy-corp13.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2762,6 +2762,7 @@
#include "code\modules\mob\living\simple_animal\simple_animal.dm"
#include "code\modules\mob\living\simple_animal\status_procs.dm"
#include "code\modules\mob\living\simple_animal\abnormality\_abnormality.dm"
#include "code\modules\mob\living\simple_animal\abnormality\abno_cores.dm"
#include "code\modules\mob\living\simple_animal\abnormality\!tutorial\bill.dm"
#include "code\modules\mob\living\simple_animal\abnormality\!tutorial\cube.dm"
#include "code\modules\mob\living\simple_animal\abnormality\!tutorial\fairies.dm"
Expand Down

0 comments on commit 2f63770

Please sign in to comment.