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

Adds the abnormality core system #2065

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
3 changes: 2 additions & 1 deletion code/modules/flufftext/Hallucination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,8 @@ GLOBAL_LIST_INIT(hallucination_list, list(
if("abnormality")
var/A_path = pick(subtypesof(/mob/living/simple_animal/hostile/abnormality))
var/mob/living/simple_animal/hostile/abnormality/A = new A_path(target)
new /obj/effect/hallucination/danger/abnormality(danger_point, target, A.icon, (A.icon_living == "" ? A.icon_state : A.icon_living), A.attack_sound, A.attack_verb_continuous, A.name, A.threat_level, A.pixel_x, A.pixel_y)
A.core_enabled = FALSE
new /obj/effect/hallucination/danger/abnormality(danger_point, target, A.icon, (A.icon_living == "" ? A.icon_state : A.icon_living), A.attack_sound, A.attack_verb_continuous, A.name, A.threat_level, A.pixel_x, A.pixel_y, A.core_enabled)
qdel(A)
if("misc")
new /obj/effect/hallucination/danger/misc(danger_point, target)
Expand Down
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,8 @@
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 if(core_enabled)//Abnormality Cores are spawned if there is no console tied to the abnormality
CreateAbnoCore(name, core_icon)//If cores are manually disabled for any reason, they won't generate.
..()
if(loc)
if(isarea(loc))
Expand Down Expand Up @@ -494,3 +498,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 = ""//blank icon states exist for each risk level.
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)
LanceSmites328 marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -785,6 +785,7 @@
oberon_mode = TRUE
name = "Oberon"
var/mob/living/simple_animal/hostile/abnormality/titania/T = new(get_turf(src))
T.core_enabled = FALSE
T.BreachEffect()
T.fused = TRUE
T.ChangeResistances(list(BRUIT = 0, RED_DAMAGE = 0, WHITE_DAMAGE = 0, BLACK_DAMAGE = 0, PALE_DAMAGE = 0))//fuck you no damaging while they erp
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 @@ -69,6 +69,7 @@
else
SpawnMinion(get_turf(src)) // Spawns 2 minions on Rcorp.
breaching_minion = SpawnMinion(get_turf(src))
core_enabled = FALSE // Normally in RCA it would drop a core the moment it spawns. Since the minions are not the abnormality, this may require a proper implementation later. -Mr. H
QDEL_IN(src, 1 SECONDS) //Destroys the core, as it is unecessary in Rcorp.

if(client)
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
19 changes: 19 additions & 0 deletions code/modules/mob/living/simple_animal/abnormality/he/pinocchio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
QDEL_IN(realboy, 15) //In theory we could do an egg transformation at this point but I have no sprite.
death()

/mob/living/simple_animal/hostile/abnormality/pinocchio/CreateAbnoCore()//The simple mob created will leave a core behind when regular conditions are fulfilled ie. when this proc is called
realboy.core_enabled = TRUE
return

//Special item
/obj/item/ego_weapon/marionette/abnormality
name = "liar's lyre"
Expand Down Expand Up @@ -288,6 +292,7 @@
/mob/living/carbon/human/species/pinocchio //a real boy. Compatiable with being spawned by admins to boot! Can't panic outside of fear, though.
race = /datum/species/puppet
faction = list("hostile")
var/core_enabled = FALSE

/mob/living/carbon/human/species/pinocchio/Initialize(mapload, cubespawned=FALSE, mob/spawner) //There is basically no documentation for bodyparts and hair, so this was the next best thing.
..()
Expand All @@ -312,6 +317,20 @@
return
. = ..()

/mob/living/carbon/human/species/pinocchio/Destroy()
if(core_enabled)
CreateAbnoCore()
..()

/mob/living/carbon/human/species/pinocchio/proc/CreateAbnoCore()//this is at the carbon level
var/obj/structure/abno_core/C = new(get_turf(src))
C.name = "Pinocchio Core"
C.desc = "The core of Pinocchio"
C.icon_state = ""//core icon goes here
C.contained_abno = /mob/living/simple_animal/hostile/abnormality/pinocchio//release()ing or extract()ing this core will spawn the abnormality, making it a valid core.
C.threat_level = 3
C.icon = 'ModularTegustation/Teguicons/abno_cores/he.dmi'

/datum/species/puppet
name = "Puppet"
id = "puppet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
var/mob/living/simple_animal/spawnedmob = new newspawn(get_turf(src))
if(isabnormalitymob(spawnedmob))
var/mob/living/simple_animal/hostile/abnormality/abno = spawnedmob
abno.core_enabled = FALSE
abno.BreachEffect()
if(spawnedmob.butcher_results)
spawnedmob.butcher_results = list(/obj/item/paper = 1)
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 @@ -137,6 +137,7 @@
spawned.name = "???"
spawned.desc = "What is that thing?"
spawned.faction = list("hostile")
spawned.core_enabled = FALSE
datum_reference.qliphoth_change(2)

/* Work effects */
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 @@ -9,6 +9,7 @@
var/icon_crazy = "hatred_psycho"
icon_dead = "hatred_dead"
var/icon_inverted
core_icon = "hatred_egg"
portrait = "hatred_queen"
faction = list("neutral")
is_flying_animal = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
else
var/mob/living/simple_animal/hostile/luna/spawningmonster = new(get_turf(src))
breached_monster = spawningmonster
core_enabled = FALSE//Subject to be changed later on, as the core may need to be dropped by the monster even if not lore accurate. -Mr. H
QDEL_IN(src, 1 SECONDS) //Destroys the piano, as it is unecessary in Rcorp.

breached = TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@

/mob/living/simple_animal/hostile/naked_nested/proc/Nest()
var/mob/living/simple_animal/hostile/abnormality/naked_nest/N = new(get_turf(src))
N.core_enabled = FALSE
for(var/atom/movable/AM in src) //morph code
AM.forceMove(N)
N.ChangeResistances(damage_coeff)
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 @@ -2769,6 +2769,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
Loading