Skip to content

Commit

Permalink
Facehugger refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDonkified authored and fira committed Feb 16, 2021
1 parent 791ffd0 commit 46fa125
Show file tree
Hide file tree
Showing 17 changed files with 321 additions and 292 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
#define COMSIG_HUMAN_CLEAR_BLOODY_FEET "human_clear_bloody_feet"
/// from /mob/living/carbon/human/attack_alien()
#define COMSIG_HUMAN_ALIEN_ATTACK "human_alien_attack"
/// From /obj/item/clothing/mask/facehugger/proc/impregnate(): (obj/item/clothing/mask/facehugger/hugger)
#define COMSIG_HUMAN_IMPREGNATE "human_impregnate"
#define COMPONENT_NO_IMPREGNATE (1<<0)

/// from /mob/living/carbon/Xenomorph/attack_alien()
#define COMSIG_XENO_ALIEN_ATTACK "xeno_alien_attack"
Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
#define SS_PRIORITY_HIVE_STATUS 111
#define SS_PRIORITY_VOTE 110
#define SS_PRIORITY_FAST_OBJECTS 105
#define SS_PRIORITY_OBJECTS 100
#define SS_PRIORITY_OBJECTS 104
#define SS_PRIORITY_FACEHUGGERS 100
#define SS_PRIORITY_DECORATOR 99
#define SS_PRIORITY_POWER 95
#define SS_PRIORITY_MACHINERY 90
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/processing/hive_status.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROCESSING_SUBSYSTEM_DEF(hive_status)
name = "Hive Status"
priority = SS_PRIORITY_OBJECTS
priority = SS_PRIORITY_HIVE_STATUS
flags = SS_NO_INIT|SS_POST_FIRE_TIMING
wait = 2 SECONDS
3 changes: 2 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ cases. Override_icon_state should be a list.*/
to_chat(user, desc)

/obj/item/attack_hand(mob/user)
if (!user) return
if (!user)
return

if(anchored)
to_chat(user, "[src] is anchored to the ground.")
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/structures/lamarr_cage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
sterile = 1
gender = FEMALE

/obj/item/clothing/mask/facehugger/lamarr/Die()
if(stat == DEAD) return
/obj/item/clothing/mask/facehugger/lamarr/die()
if(stat == DEAD)
return

icon_state = "[initial(icon_state)]_dead"
stat = DEAD
Expand All @@ -98,4 +99,3 @@

layer = BELOW_MOB_LAYER //so dead hugger appears below live hugger if stacked on same tile.
//override function prevents Lamarr from decaying like other huggers so you can keep it in your helmet, otherwise the code is identical.
return
4 changes: 2 additions & 2 deletions code/modules/cm_aliens/structures/egg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
if(instant_trigger)
child.leap_at_nearest_target()
else
child.GoIdle()
child.go_idle()

/obj/effect/alien/egg/proc/replace_triggers()
if(isnull(loc) || status == EGG_DESTROYED)
Expand Down Expand Up @@ -225,7 +225,7 @@

/obj/effect/alien/egg/HasProximity(atom/movable/AM as mob|obj)
if(status == EGG_GROWN)
if(!CanHug(AM, hivenumber) || isYautja(AM) || isSynth(AM)) //Predators are too stealthy to trigger eggs to burst. Maybe the huggers are afraid of them.
if(!can_hug(AM, hivenumber) || isYautja(AM) || isSynth(AM)) //Predators are too stealthy to trigger eggs to burst. Maybe the huggers are afraid of them.
return
Burst(FALSE, TRUE, null)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_aliens/structures/special/egg_morpher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
if (!linked_hive)
return

if(!CanHug(AM, linked_hive.hivenumber))
if(!can_hug(AM, linked_hive.hivenumber))
return

stored_huggers = max(0, stored_huggers - 1)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_aliens/structures/trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/obj/effect/alien/resin/trap/proc/facehugger_die()
var/obj/item/clothing/mask/facehugger/FH = new (loc)
FH.Die()
FH.die()
trap_type = RESIN_TRAP_EMPTY
icon_state = "trap0"

Expand Down Expand Up @@ -77,7 +77,7 @@
/obj/effect/alien/resin/trap/HasProximity(atom/movable/AM)
switch(trap_type)
if(RESIN_TRAP_HUGGER)
if(CanHug(AM, hivenumber) && !isYautja(AM) && !isSynth(AM))
if(can_hug(AM, hivenumber) && !isYautja(AM) && !isSynth(AM))
var/mob/living/L = AM
L.visible_message(SPAN_WARNING("[L] trips on [src]!"),\
SPAN_DANGER("You trip on [src]!"))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
var/pulse = PULSE_NORM //current pulse level
var/butchery_progress = 0
var/list/internal_organs = list()
var/huggable = TRUE //can apply Facehuggers (still checks proc/CanHug())
var/huggable = TRUE //can apply Facehuggers (still checks proc/can_hug())

//blood.dm
blood_volume = BLOOD_VOLUME_NORMAL

var/hivenumber
var/hivenumber
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/human/species/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,17 @@

/datum/species/proc/handle_post_spawn(var/mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment.
add_inherent_verbs(H)
apply_signals(H)

if(icobase_source)
icobase = get_icon_from_source(icobase_source)
if(deform_source)
deform = get_icon_from_source(deform_source)

/// Apply signals to the human
/datum/species/proc/apply_signals(var/mob/living/carbon/human/H)
return

/datum/species/proc/handle_death(var/mob/living/carbon/human/H) //Handles any species-specific death events.
/*
if(flags & IS_SYNTHETIC)
Expand Down
9 changes: 8 additions & 1 deletion code/modules/mob/living/carbon/human/species/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
GLOB.alive_human_list -= H
return ..()

/datum/species/synthetic/apply_signals(var/mob/living/carbon/human/H)
RegisterSignal(H, COMSIG_HUMAN_IMPREGNATE, .proc/cancel_impregnate)

/datum/species/synthetic/proc/cancel_impregnate(datum/source)
SIGNAL_HANDLER
return COMPONENT_NO_IMPREGNATE

/datum/species/synthetic/second_gen_synthetic
name = "Second Generation Synthetic"
uses_ethnicity = FALSE //2nd gen uses generic human look
Expand All @@ -67,6 +74,6 @@
hair_color = "#000000"

knock_down_reduction = 3.5
stun_reduction = 3.5
stun_reduction = 3.5

inherent_verbs = null
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/Abilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@
if(istype(X.r_hand, /obj/item/clothing/mask/facehugger))
var/obj/item/clothing/mask/facehugger/FH = X.r_hand
if(FH.stat != DEAD)
FH.Die()
FH.die()

if(istype(X.l_hand, /obj/item/clothing/mask/facehugger))
var/obj/item/clothing/mask/facehugger/FH = X.l_hand
if(FH.stat != DEAD)
FH.Die()
FH.die()

playsound(X.loc, X.screech_sound_effect, 75, 0, status = 0)
X.visible_message(SPAN_XENOHIGHDANGER("[X] emits an ear-splitting guttural roar!"))
Expand Down
Loading

0 comments on commit 46fa125

Please sign in to comment.