-
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.
First pass on xeno special behaviors
- Loading branch information
1 parent
f2c048f
commit 071ebd3
Showing
8 changed files
with
394 additions
and
177 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
|
||
/datum/component/ai_behavior_override/attack | ||
|
||
/datum/component/ai_behavior_override/attack/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) | ||
. = ..() | ||
|
||
if(distance > 10) | ||
return FALSE | ||
|
||
return TRUE | ||
|
||
|
||
/datum/component/ai_behavior_override/attack/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) | ||
. = ..() | ||
|
||
if(processing_xeno.current_target == parent) | ||
return FALSE | ||
|
||
processing_xeno.current_target = parent | ||
processing_xeno.resting = FALSE | ||
if(prob(5)) | ||
processing_xeno.emote("hiss") | ||
|
||
return FALSE |
42 changes: 42 additions & 0 deletions
42
code/datums/components/xeno/ai_behavior_overrides/base_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,42 @@ | ||
GLOBAL_LIST_EMPTY(all_ai_behavior_overrides) | ||
|
||
/datum/component/ai_behavior_override | ||
|
||
/// Icon file for the behavior attached to parent as game masters will see it | ||
var/behavior_icon = 'icons/landmarks.dmi' | ||
|
||
/// Specific icon state for the behavior attached to parent as game masters will see it | ||
var/behavior_icon_state = "x2" | ||
|
||
/// The actual image holder that sits on parent for game masters | ||
var/image/behavior_image | ||
|
||
/datum/component/ai_behavior_override/Initialize(...) | ||
. = ..() | ||
|
||
GLOB.all_ai_behavior_overrides += src | ||
|
||
behavior_image = new(behavior_icon, parent, behavior_icon_state, layer = ABOVE_FLY_LAYER) | ||
|
||
for(var/client/game_master in GLOB.game_masters) | ||
game_master.images += behavior_image | ||
|
||
/datum/component/ai_behavior_override/Destroy(force, silent, ...) | ||
GLOB.all_ai_behavior_overrides -= src | ||
|
||
for(var/client/game_master in GLOB.game_masters) | ||
game_master.images -= behavior_image | ||
|
||
QDEL_NULL(behavior_image) | ||
|
||
. = ..() | ||
|
||
/// Override this to check if we want our behavior to be valid for the checked_xeno, passes the common factor of "distance" which is the distance between the checked_xeno and src parent | ||
/datum/component/ai_behavior_override/proc/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance) | ||
return FALSE | ||
|
||
/// Processes what we want this behavior to do, return FALSE if we want to continue in the process_ai() proc or TRUE if we want to handle everything and have process_ai() return | ||
/datum/component/ai_behavior_override/proc/process_override_behavior(mob/living/carbon/xenomorph/processing_xeno, delta_time) | ||
SHOULD_NOT_SLEEP(TRUE) | ||
|
||
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
Oops, something went wrong.