Skip to content

Commit

Permalink
Merge branch 'pr/1'
Browse files Browse the repository at this point in the history
  • Loading branch information
The32bitguy committed Sep 25, 2024
2 parents 826a340 + 1d6758c commit ac476a4
Show file tree
Hide file tree
Showing 24 changed files with 461 additions and 107 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#define GRAB_AGGRESSIVE 1
#define GRAB_CARRY 2
#define GRAB_CHOKE 3
/// Alien-specific grab, somewhat between an aggressive and choke. Limited to AI only for the moment.
#define GRAB_XENO 4

//Ammo defines for gun/projectile related things.

Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/pain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
#define PAIN_REDUCTION_FULL 80 //oxycodone, neuraline

// Pain amount supplied by the action

/// How much pain is dealt continually to the mob being dragged by the AI as well as when initially grabbing.
#define PAIN_XENO_DRAG 10
/// How much additional pain is dealt when lunging/throat grabbing.
#define PAIN_XENO_GRAB 15
#define PAIN_BONE_BREAK 25
#define PAIN_BONE_BREAK_SPLINTED 15
#define PAIN_DELIMB 40
Expand Down
5 changes: 3 additions & 2 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,9 @@
#define XENO_CASTE_HIVELORD "Hivelord"
#define XENO_CASTE_LURKER "Lurker"
#define XENO_CASTE_WARRIOR "Warrior"
#define XENO_CASTE_SOLDIER "Soldier"
#define XENO_CASTE_SPITTER "Spitter"
#define XENO_T2_CASTES list(XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER)
#define XENO_T2_CASTES list(XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER, XENO_CASTE_SOLDIER)
//t3
#define XENO_CASTE_BOILER "Boiler"
#define XENO_CASTE_PRAETORIAN "Praetorian"
Expand All @@ -704,7 +705,7 @@
#define XENO_CASTE_HELLHOUND "Hellhound"
#define XENO_SPECIAL_CASTES list(XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND)

#define ALL_XENO_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER, XENO_CASTE_LESSER_DRONE, XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_SENTINEL, XENO_CASTE_DEFENDER, XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER, XENO_CASTE_BOILER, XENO_CASTE_PRAETORIAN, XENO_CASTE_CRUSHER, XENO_CASTE_RAVAGER, XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND, XENO_CASTE_KING)
#define ALL_XENO_CASTES list(XENO_CASTE_LARVA, XENO_CASTE_PREDALIEN_LARVA, XENO_CASTE_FACEHUGGER, XENO_CASTE_LESSER_DRONE, XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_SENTINEL, XENO_CASTE_DEFENDER, XENO_CASTE_BURROWER, XENO_CASTE_CARRIER, XENO_CASTE_HIVELORD, XENO_CASTE_LURKER, XENO_CASTE_WARRIOR, XENO_CASTE_SPITTER, XENO_CASTE_BOILER, XENO_CASTE_PRAETORIAN, XENO_CASTE_CRUSHER, XENO_CASTE_RAVAGER, XENO_CASTE_QUEEN, XENO_CASTE_PREDALIEN, XENO_CASTE_HELLHOUND, XENO_CASTE_SOLDIER, XENO_CASTE_KING)

// Checks if two hives are allied to each other.
// PARAMETERS:
Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/role_authority.dm
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ I hope it's easier to tell what the heck this proc is even doing, unlike previou
M = /mob/living/carbon/xenomorph/predalien
if(XENO_CASTE_HELLHOUND)
M = /mob/living/carbon/xenomorph/hellhound
if(XENO_CASTE_SOLDIER)
M = /mob/living/carbon/xenomorph/soldieR
if(XENO_CASTE_KING)
M = /mob/living/carbon/xenomorph/king
return M
Expand Down
28 changes: 26 additions & 2 deletions code/game/objects/effects/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,12 @@
flare_damage = 1875
icon_state = "acid_strong"

//Similar to strong acid, just not quite as strong other than barricade damage.
/obj/effect/xenomorph/acid/spatter
acid_delay = 0.6
barricade_damage = 100
flare_damage = 1000

/obj/effect/xenomorph/acid/Initialize(mapload, atom/target)
. = ..()
acid_t = target
Expand All @@ -334,6 +340,21 @@
RegisterSignal(acid_t, COMSIG_PARENT_QDELETING, PROC_REF(cleanup))
START_PROCESSING(SSoldeffects, src)

/obj/effect/xenomorph/acid/spatter/Initialize(mapload, atom/target)
. = ..()
if(!acid_t)
var/obj/structure/barricade/B = locate() in loc
if(B && !B.unacidable) acid_t = B
else
for(var/obj/O in loc) //Find the first thing.
if(O.unacidable || istype(O, /obj/effect)) continue //Not unacidable things or effects. Don't want to melt xenogibs.
acid_t = O
break
if(acid_t) layer = acid_t.layer
else
animate(src, alpha = 0, 1 SECONDS)
QDEL_IN(src, 1 SECONDS) //No point in keeping it if it's not melting anything.

/obj/effect/xenomorph/acid/Destroy()
acid_t = null
STOP_PROCESSING(SSoldeffects, src)
Expand Down Expand Up @@ -428,8 +449,11 @@
else
for(var/mob/mob in acid_t)
mob.forceMove(loc)
qdel(acid_t)
qdel(src)
animate(acid_t, alpha = 0, 1 SECONDS)
QDEL_IN(acid_t, 1 SECONDS)

animate(src, alpha = 0, 1 SECONDS)
QDEL_IN(src, 1 SECONDS)

/obj/effect/xenomorph/boiler_bombard
name = "???"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GLOBAL_VAR_INIT(radio_communication_clarity, 100)

// Spawn stuff
#define DEFAULT_SPAWN_XENO_STRING XENO_CASTE_DRONE
#define GAME_MASTER_AI_XENOS list(XENO_CASTE_DRONE, XENO_CASTE_RUNNER, XENO_CASTE_LURKER, XENO_CASTE_CRUSHER, XENO_CASTE_FACEHUGGER)
#define GAME_MASTER_AI_XENOS list(XENO_CASTE_DRONE, XENO_CASTE_SOLDIER, XENO_CASTE_RUNNER, XENO_CASTE_LURKER, XENO_CASTE_CRUSHER, XENO_CASTE_FACEHUGGER)
#define DEFAULT_SPAWN_HIVE_STRING XENO_HIVE_NORMAL

#define DEFAULT_XENO_AMOUNT_TO_SPAWN 1
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/holder2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ you will have to do something like if(client.admin_holder.rights & R_ADMIN) your
if(!other)
return FALSE
if(rights_required && other.admin_holder?.rank)
if(check_client_rights(usr.client, rights_required, show_msg))
if(check_client_rights(other, rights_required, show_msg))
return TRUE
else if(show_msg)
to_chat(usr, SPAN_WARNING("You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")]."))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
if(istype(brain))
return TRUE
return FALSE

f
/mob/living/carbon/human/has_eyes()
var/datum/internal_organ/eyes = LAZYACCESS(internal_organs_by_name, "eyes")
if(istype(eyes) && !eyes.cut_away)
Expand All @@ -210,7 +210,7 @@


/mob/living/carbon/human/is_mob_restrained(check_grab = TRUE)
if(check_grab && pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)
if(check_grab && pulledby && pulledby.grab_level > GRAB_PASSIVE && pulledby.grab_level != GRAB_XENO)
return TRUE
if (handcuffed)
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/life/handle_breath.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
return
if(istype(loc, /obj/structure/machinery/cryo_cell))
return
if(species && (species.flags & NO_BREATHE || species.flags & IS_SYNTHETIC))
if(species && (species.flags & (NO_BREATHE|IS_SYNTHETIC)))
return

var/list/air_info
Expand Down
22 changes: 13 additions & 9 deletions code/modules/mob/living/carbon/human/life/handle_grabbed.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@


// Why is this proc in its own .dm file?
/mob/living/carbon/proc/handle_grabbed()
if(!pulledby)
return
if(pulledby.grab_level >= GRAB_AGGRESSIVE)
drop_held_items()

if(pulledby.grab_level >= GRAB_CHOKE)
apply_damage(3, OXY)
apply_stamina_damage(5)
/// Rewrote this to be a little different, so that the normal effects don't apply to xeno grabs.
switch(pulledby.grab_level)
if(GRAB_AGGRESSIVE to GRAB_CARRY)
drop_held_items()
if(GRAB_CHOKE)
drop_held_items()
apply_damage(3, OXY)
apply_stamina_damage(5)
if(GRAB_XENO) /// Alien grabs inflict pain when the human is not incapacitated, but not the other effects.
/// Ignoring restrained with (TRUE). The grab does *not* restrain by itself. See /mob/living/carbon/human/is_mob_restrained(check_grab = TRUE)
/// This is too allow the human a chance to fight back, with guns or melee.
return is_mob_incapacitated(TRUE) || pain.apply_pain(PAIN_XENO_DRAG)

log_attack("[key_name(pulledby)] choked [key_name(src)] at [get_area_name(src)]")
attack_log += text("\[[time_stamp()]\] <font color='orange'>was choked by [key_name(pulledby)]</font>")
pulledby.attack_log += text("\[[time_stamp()]\] <font color='red'>choked [key_name(src)]</font>")
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/Xenomorph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@
var/evolving = FALSE // Whether the xeno is in the process of evolving
/// The damage dealt by a xeno whenever they take damage near someone
var/acid_blood_damage = 15
/// Does their blood also create an acid object to melt the environment?
var/acid_blood_spatter = FALSE
var/nocrit = FALSE
var/deselect_timer = 0 // Much like Carbon.last_special is a short tick record to prevent accidental deselects of abilities
var/got_evolution_message = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
var/home_locate_range = 15
var/turf/home_turf

/// Should the alien try climbing barricades and other structures, if able?
var/do_climb_structures = FALSE

/datum/xeno_ai_movement/New(mob/living/carbon/xenomorph/parent)
. = ..()
if(!parent)
Expand Down
41 changes: 13 additions & 28 deletions code/modules/mob/living/carbon/xenomorph/ai/xeno_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
/// Cooldown declaration for delaying finding a new path if no path was found
COOLDOWN_DECLARE(no_path_found_cooldown)

var/ai_active_intent = INTENT_HARM
var/target_unconscious = FALSE

/mob/living/carbon/xenomorph/proc/init_movement_handler()
return new /datum/xeno_ai_movement(src)

Expand Down Expand Up @@ -63,14 +66,14 @@

var/datum/component/ai_behavior_override/behavior_override = check_overrides()

if(behavior_override?.process_override_behavior(src, delta_time))
if(is_mob_incapacitated(TRUE)) ///If they are incapacitated, the rest doesn't matter.
current_path = null
return TRUE

if(is_mob_incapacitated(TRUE))
current_path = null
if(behavior_override?.process_override_behavior(src, delta_time))
return TRUE

if(QDELETED(current_target) || !current_target.ai_check_stat() || get_dist(current_target, src) > ai_range || COOLDOWN_FINISHED(src, forced_retarget_cooldown))
if(QDELETED(current_target) || !current_target.ai_check_stat(src) || get_dist(current_target, src) > ai_range || COOLDOWN_FINISHED(src, forced_retarget_cooldown))
current_target = get_target(ai_range)
COOLDOWN_START(src, forced_retarget_cooldown, forced_retarget_time)
if(QDELETED(src))
Expand All @@ -81,7 +84,7 @@
if(prob(5))
emote("hiss")

a_intent = INTENT_HARM
a_intent = ai_active_intent

if(!current_target)
ai_move_idle(delta_time)
Expand Down Expand Up @@ -133,7 +136,7 @@
return 0
return INFINITY

/atom/proc/ai_check_stat()
/atom/proc/ai_check_stat(mob/living/carbon/xenomorph/X)
return TRUE // So we aren't trying to find a new target on attack override

// Called whenever an obstacle is encountered but xeno_ai_obstacle returned something else than infinite
Expand Down Expand Up @@ -267,28 +270,6 @@

#undef EXTRA_CHECK_DISTANCE_MULTIPLIER

/mob/living/carbon/proc/ai_can_target(mob/living/carbon/xenomorph/X)
if(!ai_check_stat(X))
return FALSE

if(X.can_not_harm(src))
return FALSE

if(alpha <= 45 && get_dist(X, src) > 2)
return FALSE

if(isfacehugger(X))
if(status_flags & XENO_HOST)
return FALSE

if(istype(wear_mask, /obj/item/clothing/mask/facehugger))
return FALSE

else if(HAS_TRAIT(src, TRAIT_NESTED))
return FALSE

return TRUE

/mob/living/carbon/xenomorph/proc/make_ai()
SHOULD_CALL_PARENT(TRUE)
create_hud()
Expand Down Expand Up @@ -343,3 +324,7 @@
if(cycled_turf.x == min_x_value)
min_x_turfs += cycled_turf
return min_x_turfs

/// Override as necessary to check for more specific triggers for an ability activation.
/mob/living/carbon/xenomorph/proc/check_additional_ai_activation()
return TRUE
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Runner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@

add_temp_negative_pass_flags(PASS_FLAGS_CRAWLER)

/mob/living/carbon/xenomorph/runner/stop_pulling()
/mob/living/carbon/xenomorph/runner/stop_pulling(bumped_movement = FALSE)
. = ..()

remove_temp_negative_pass_flags(PASS_FLAGS_CRAWLER)
Expand Down
Loading

0 comments on commit ac476a4

Please sign in to comment.