Skip to content

Commit

Permalink
Special behaviors of hive and capture, more unslashable structures (#35)
Browse files Browse the repository at this point in the history
Co-authored-by: Morrow <[email protected]>
  • Loading branch information
xDanilcusx and morrowwolf authored Nov 1, 2023
1 parent d180060 commit cf1604a
Show file tree
Hide file tree
Showing 56 changed files with 391 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@

/datum/component/ai_behavior_override/attack
behavior_icon_state = "attack_order"

/datum/component/ai_behavior_override/attack/check_behavior_validity(mob/living/carbon/xenomorph/checked_xeno, distance)
. = ..()
if(!.)
return

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(!.)
return

if(processing_xeno.current_target == parent)
return FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ 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'
var/behavior_icon = 'icons/effects/game_master_xeno_behaviors.dmi'

/// Specific icon state for the behavior attached to parent as game masters will see it
var/behavior_icon_state = "x2"
var/behavior_icon_state = "should_not_see_this"

/// The actual image holder that sits on parent for game masters
var/image/behavior_image

/// The xenos currently handling this task
var/currently_assigned

/// How many xenos we want assigned to this task at max
var/max_assigned = 3

/datum/component/ai_behavior_override/Initialize(...)
. = ..()

Expand All @@ -19,7 +25,9 @@ GLOBAL_LIST_EMPTY(all_ai_behavior_overrides)
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
game_master.images |= behavior_image

currently_assigned = list()

/datum/component/ai_behavior_override/Destroy(force, silent, ...)
GLOB.all_ai_behavior_overrides -= src
Expand All @@ -28,15 +36,21 @@ GLOBAL_LIST_EMPTY(all_ai_behavior_overrides)
game_master.images -= behavior_image

QDEL_NULL(behavior_image)
currently_assigned = null

. = ..()

/// 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
if(length(currently_assigned) >= max_assigned && !(checked_xeno in currently_assigned))
return FALSE

return TRUE

/// 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
currently_assigned |= processing_xeno

return TRUE
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
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
2 changes: 1 addition & 1 deletion code/game/area/areas_event.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ structure:
icon_state = "event"

//no bioscan and no tunnels allowed
flags_area = AREA_AVOID_BIOSCAN|AREA_NOTUNNEL
flags_area = AREA_AVOID_BIOSCAN

//events are not part of regular gameplay, therefore, no statistics
statistic_exempt = TRUE
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/computer/HolodeckControl.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
icon = 'icons/obj/objects.dmi'
icon_state = "stool"
anchored = TRUE
unslashable = TRUE
flags_atom = FPRINT


Expand All @@ -111,6 +112,7 @@
density = TRUE
layer = WINDOW_LAYER
anchored = TRUE
unslashable = TRUE
flags_atom = ON_BORDER

/obj/structure/holowindow/initialize_pass_flags(datum/pass_flags_container/PF)
Expand All @@ -134,6 +136,7 @@
icon_state = "hoop"
anchored = TRUE
density = TRUE
unslashable = TRUE
throwpass = 1
var/side = ""
var/id = ""
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/computer/buildandrepair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/obj/structure/computerframe
density = FALSE
anchored = FALSE
unslashable = TRUE
name = "Computer-frame"
icon = 'icons/obj/structures/machinery/stock_parts.dmi'
icon_state = "0"
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ GLOBAL_LIST_INIT(frozen_items, list(SQUAD_MARINE_1 = list(), SQUAD_MARINE_2 = li
icon_state = "cryo_rear"
anchored = TRUE
density = TRUE
unslashable = TRUE

var/orient_right = null //Flips the sprite.

Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/doors/poddoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
return XENO_ATTACK_ACTION

/obj/structure/machinery/door/poddoor/proc/pry_open(mob/living/carbon/xenomorph/X, time = 4 SECONDS)
if(X.action_busy)
return

X.visible_message(SPAN_DANGER("[X] begins prying [src] open."),\
SPAN_XENONOTICE("You start prying [src] open."), max_distance = 3)

Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/effects/acid_hole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@
qdel(src) //no wall?! then cease existence...
return

if(!use_wall_hole(user))
if(user.mob_size >= MOB_SIZE_BIG)
expand_hole(user)
return XENO_NO_DELAY_ACTION
expand_hole(user)
return XENO_NO_DELAY_ACTION

/obj/effect/acid_hole/proc/expand_hole(mob/living/carbon/xenomorph/user)
if(user.action_busy || user.lying)
return

playsound(src, "pry", 25, 1)
xeno_attack_delay(user)
user.freeze()
if(do_after(user, 60, INTERRUPT_ALL, BUSY_ICON_GENERIC) && !QDELETED(src) && holed_wall && !user.lying && istype(holed_wall))
holed_wall.take_damage(rand(2000,3500))
user.emote("roar")
user.unfreeze()

/obj/effect/acid_hole/proc/use_wall_hole(mob/user)

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/props/rocks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
icon_state = "rock"//go figure
desc = "A solidified collection of local minerals. When melted, becomes a substance best known as lava."

unslashable = TRUE
opacity = FALSE
density = TRUE
var/dir_list_full = list(1,2,4,8,5,6,9,10)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/bedsheet_bin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ LINEN BINS
desc = "A linen bin. It looks rather cosy."
icon = 'icons/obj/structures/structures.dmi'
icon_state = "linenbin-full"
unslashable = TRUE
anchored = TRUE
var/amount = 20
var/list/sheets = list()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/bookcase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
anchored = TRUE
density = TRUE
opacity = TRUE
unslashable = TRUE

/obj/structure/bookcase/Initialize()
. = ..()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/cargo_container.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
health = 200
opacity = TRUE
anchored = TRUE
unslashable = TRUE
//Note, for Watatsumi, Grant, and Arious, "left" and "leftmid" are both the left end of the container, but "left" is generic and "leftmid" has the Sat Mover mark on it
/obj/structure/cargo_container/watatsumi
name = "Watatsumi Cargo Container"
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/catwalk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var/covered = 1 //1 for theres the cover, 0 if there isn't.
unslashable = TRUE
unacidable = TRUE
unslashable = TRUE
layer = CATWALK_LAYER

/obj/structure/catwalk/Initialize()
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/coathanger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
desc = "Rack that holds coats."
icon = 'icons/obj/structures/props/misc.dmi'
icon_state = "coatrack0"
unslashable = TRUE
var/obj/item/clothing/suit/coat
var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/det_suit, /obj/item/clothing/suit/storage/bomber, /obj/item/clothing/suit/storage/bomber/alt)

Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/displaycase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
density = TRUE
anchored = TRUE
unacidable = FALSE
unslashable = TRUE
health = 30
var/occupied = 1
var/destroyed = 0
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/extinguisher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "extinguisher"
anchored = TRUE
density = FALSE
unslashable = TRUE
var/obj/item/tool/extinguisher/has_extinguisher = new/obj/item/tool/extinguisher
var/opened = 0
var/base_icon
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/flora.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PLANT_CUT_MACHETE = 3 = Needs at least a machete to be cut down
name = "plant"
anchored = TRUE
density = TRUE
unslashable = TRUE
var/icon_tag = null
var/variations = 1
var/cut_level = PLANT_NO_CUT
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/kitchen_spike.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
desc = "A spike for collecting meat from animals"
density = TRUE
anchored = TRUE
unslashable = TRUE
var/meat = 0
var/occupied = 0
var/meattype = 0 // 0 - Nothing, 1 - Monkey, 2 - Xeno
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/lamarr_cage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
density = TRUE
anchored = TRUE
unacidable = FALSE
unslashable = TRUE
health = 30
var/occupied = 1
var/destroyed = 0
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/landing_signs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
bound_width = 64
bound_height = 64
density = TRUE
unslashable = TRUE

/obj/structure/lz_sign/lazarus_sign
name = "Lazarus Landing Sign"
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/lattice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "latticefull"
density = FALSE
anchored = TRUE
unslashable = TRUE
layer = LATTICE_LAYER
plane = FLOOR_PLANE
// flags = CONDUCT
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/lawnmower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
dir = WEST
anchored = FALSE
density = TRUE
unslashable = TRUE
layer = ABOVE_LYING_MOB_LAYER

/obj/structure/lawnmower/Move(atom/NewLoc, dir)
Expand Down
Loading

0 comments on commit cf1604a

Please sign in to comment.