Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e836e6f

Browse filesBrowse files
authored
Rewrites how species are granted abilities + rewrites some of abilities themselves (yogstation13#22366)
* guh, the work begins * done for now hopefully * lint * Update maglock.dm * Update maglock.dm * done
1 parent a9b828b commit e836e6f
Copy full SHA for e836e6f

9 files changed

+184-285Lines changed: 184 additions & 285 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/modules/mob/living/carbon/human/_species.dm‎

Copy file name to clipboardExpand all lines: code/modules/mob/living/carbon/human/_species.dm
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ GLOBAL_LIST_EMPTY(features_by_species)
223223
/// Do we try to prevent reset_perspective() from working? Useful for Dullahans to stop perspective changes when they're looking through their head.
224224
var/prevent_perspective_change = FALSE
225225

226+
/// List of the type path of every ability innate to this species
227+
var/list/species_abilities = list()
228+
/// List of the created abilities, stored for the purpose of removal later, please do not touch this if you don't need to
229+
var/list/datum/action/instantiated_abilities = list()
230+
226231
///////////
227232
// PROCS //
228233
///////////
@@ -502,6 +507,11 @@ GLOBAL_LIST_EMPTY(features_by_species)
502507
fly = new
503508
fly.Grant(C)
504509

510+
for(var/ability_path in species_abilities)
511+
var/datum/action/ability = new ability_path(C)
512+
ability.Grant(C)
513+
instantiated_abilities += ability
514+
505515
C.add_movespeed_modifier(MOVESPEED_ID_SPECIES, TRUE, 100, override=TRUE, multiplicative_slowdown=speedmod, movetypes=(~FLYING))
506516
C.regenerate_icons()
507517
SEND_SIGNAL(C, COMSIG_SPECIES_GAIN, src, old_species)
@@ -547,6 +557,11 @@ GLOBAL_LIST_EMPTY(features_by_species)
547557
C.dna.features["wingsdetail"] = "None"
548558
C.update_body()
549559

560+
for(var/datum/action/ability as anything in instantiated_abilities)
561+
ability.Remove(C)
562+
instantiated_abilities -= ability
563+
qdel(ability)
564+
550565
C.remove_movespeed_modifier(MOVESPEED_ID_SPECIES)
551566

552567
SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src)
Collapse file

‎code/modules/mob/living/carbon/human/species_types/IPC.dm‎

Copy file name to clipboardExpand all lines: code/modules/mob/living/carbon/human/species_types/IPC.dm
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
// Hats need to be 1 up
5252
offset_features = list(OFFSET_HEAD = list(0,1))
5353

54-
var/datum/action/innate/change_screen/change_screen
54+
species_abilities = list(/datum/action/innate/change_screen)
5555

5656
smells_like = "industrial lubricant"
5757

@@ -66,9 +66,6 @@
6666
if(A)
6767
A.Remove(C)
6868
QDEL_NULL(A)
69-
if(ishuman(C) && !change_screen)
70-
change_screen = new
71-
change_screen.Grant(C)
7269
for(var/obj/item/bodypart/O in C.bodyparts)
7370
O.render_like_organic = TRUE // Makes limbs render like organic limbs instead of augmented limbs, check bodyparts.dm
7471
var/chassis = C.dna.features["ipc_chassis"]
@@ -82,8 +79,6 @@
8279
/datum/species/ipc/on_species_loss(mob/living/carbon/C)
8380
. = ..()
8481
QDEL_NULL(C.particles)
85-
if(change_screen)
86-
change_screen.Remove(C)
8782

8883
/datum/species/ipc/proc/handle_speech(datum/source, list/speech_args)
8984
speech_args[SPEECH_SPANS] |= SPAN_ROBOT

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.