Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[s] Spacebeast Revived #233

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 3 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@
// Hellhound strain flags
#define HELLHOUND_NORMAL "Normal"

// Soldier strain flags
#define SOLDIER_NORMAL "Normal"

var/list/default_onmob_icons = list(
WEAR_L_HAND = 'icons/mob/humans/onmob/items_lefthand_0.dmi',
WEAR_R_HAND = 'icons/mob/humans/onmob/items_righthand_0.dmi',
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 @@ -634,8 +634,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 @@ -648,7 +649,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)
#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)

// 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 @@ -773,6 +773,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
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 @@ -316,6 +316,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 @@ -328,6 +334,21 @@
RegisterSignal(acid_t, COMSIG_PARENT_QDELETING, PROC_REF(cleanup))
START_PROCESSING(SSeffects, 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(SSeffects, src)
Expand Down Expand Up @@ -422,8 +443,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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 @@ -105,7 +105,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))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Runtime error fix.

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
14 changes: 7 additions & 7 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,26 +198,26 @@
if(istype(brain))
return TRUE
return FALSE

f
FslashN marked this conversation as resolved.
Show resolved Hide resolved
/mob/living/carbon/human/has_eyes()
var/datum/internal_organ/eyes = LAZYACCESS(internal_organs_by_name, "eyes")
if(istype(eyes) && !eyes.cut_away)
return TRUE
return FALSE


/mob/living/carbon/human/is_mob_restrained(check_grab = 1)
if(check_grab && pulledby && pulledby.grab_level >= GRAB_AGGRESSIVE)
return 1
/mob/living/carbon/human/is_mob_restrained(check_grab = TRUE)
if(check_grab && pulledby && pulledby.grab_level > GRAB_PASSIVE && pulledby.grab_level != GRAB_XENO)
return TRUE
if (handcuffed)
return 1
return TRUE
if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return TRUE

if (HAS_TRAIT(src, TRAIT_NESTED))
return TRUE

return 0
return FALSE

/mob/living/carbon/human/proc/disable_special_flags()
status_flags |= CANPUSH
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)))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for two checks. Not really related to the rest of the PR.

return

var/list/air_info
Expand Down
20 changes: 14 additions & 6 deletions code/modules/mob/living/carbon/human/life/handle_grabbed.dm
Original file line number Diff line number Diff line change
@@ -1,11 +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)

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 @@ -247,6 +247,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 @@ -34,6 +34,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
xDanilcusx marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down Expand Up @@ -67,14 +70,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 @@ -85,7 +88,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 @@ -137,7 +140,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 @@ -338,28 +341,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 @@ -414,3 +395,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 @@ -94,7 +94,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
Loading