-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Special behaviors of hive and capture, more unslashable structures (#35)
Co-authored-by: Morrow <[email protected]>
- Loading branch information
1 parent
d180060
commit cf1604a
Showing
56 changed files
with
391 additions
and
50 deletions.
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6
code/datums/components/xeno/ai_behavior_overrides/attack_override_behavior.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
code/datums/components/xeno/ai_behavior_overrides/capture_override_behavior.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
|
||
/datum/component/ai_behavior_override/capture | ||
behavior_icon_state = "capture_order" | ||
|
||
max_assigned = 1 | ||
|
||
/datum/component/ai_behavior_override/capture/Initialize(...) | ||
. = ..() | ||
|
||
if(!istype(parent, /mob)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
if(isxeno(parent)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
/datum/component/ai_behavior_override/capture/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
var/mob/parent_mob = parent | ||
|
||
var/stat = parent_mob.stat | ||
var/mob/pulledby = parent_mob.pulledby | ||
|
||
if(stat == DEAD) | ||
qdel(src) | ||
return FALSE | ||
|
||
if(HAS_TRAIT(parent, TRAIT_NESTED)) | ||
qdel(src) | ||
return FALSE | ||
|
||
if(!length(GLOB.ai_hives)) | ||
for(var/client/game_master in GLOB.game_masters) | ||
to_chat(game_master, SPAN_XENOBOLDNOTICE("Capture behavior requires a valid hive placed")) | ||
|
||
qdel(src) | ||
return FALSE | ||
|
||
if(distance > 10) | ||
return FALSE | ||
|
||
if(stat == CONSCIOUS) | ||
return FALSE | ||
|
||
if(isxeno(pulledby) && pulledby != checked_xeno) | ||
return FALSE | ||
|
||
return TRUE | ||
|
||
/datum/component/ai_behavior_override/capture/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
processing_xeno.current_target = parent | ||
processing_xeno.resting = FALSE | ||
|
||
if(processing_xeno.get_active_hand()) | ||
processing_xeno.swap_hand() | ||
|
||
var/datum/xeno_ai_movement/processing_xeno_movement = processing_xeno.ai_movement_handler | ||
if(processing_xeno.pulling == parent) | ||
processing_xeno_movement.ai_move_hive(delta_time) | ||
return TRUE | ||
|
||
var/atom/movable/target = processing_xeno.current_target | ||
if(get_dist(processing_xeno, target) <= 1) | ||
INVOKE_ASYNC(processing_xeno, TYPE_PROC_REF(/mob, start_pulling), target) | ||
processing_xeno.face_atom(target) | ||
processing_xeno.swap_hand() | ||
|
||
processing_xeno.ai_move_target(delta_time) | ||
return TRUE |
34 changes: 34 additions & 0 deletions
34
code/datums/components/xeno/ai_behavior_overrides/hive_override_behavior.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
// Just try not to think about this too much. | ||
|
||
|
||
GLOBAL_LIST_EMPTY(ai_hives) | ||
|
||
/datum/component/ai_behavior_override/hive | ||
behavior_icon_state = "core" | ||
|
||
max_assigned = 0 | ||
|
||
var/hive_radius = 7 | ||
|
||
/datum/component/ai_behavior_override/hive/Initialize(...) | ||
. = ..() | ||
|
||
if(!istype(parent, /turf/open) && !istype(parent, /obj/effect/alien)) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
GLOB.ai_hives += src | ||
|
||
if(!istype(parent, /obj/effect/alien)) | ||
new /obj/effect/alien/weeds/node(get_turf(parent)) | ||
|
||
/datum/component/ai_behavior_override/hive/Destroy(force, silent, ...) | ||
GLOB.ai_hives -= src | ||
|
||
. = ..() | ||
|
||
/datum/component/ai_behavior_override/hive/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) | ||
return FALSE | ||
|
||
/datum/component/ai_behavior_override/hive/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) | ||
return FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.