Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/dcs/signals/atom/mob/living/signals_human.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
///from /mob/living/carbon/human/proc/force_say(): ()
#define COMSIG_HUMAN_FORCESAY "human_forcesay"

#define COMSIG_HUMAN_SAY "human_say"

#define COMSIG_HUMAN_TAKE_DAMAGE "human_take_damage"
#define COMPONENT_BLOCK_DAMAGE (1<<0)

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/human_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define ACTION_USING_HANDS (1<<0)
#define ACTION_USING_LEGS (1<<1)
#define ACTION_USING_MOUTH (1<<2)
#define ACTION_UNIQUE (1<<4)

/// Action is completed, delete this and move onto the next ongoing action
#define ONGOING_ACTION_COMPLETED "completed"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ GLOBAL_LIST_INIT(default_xeno_onmob_icons, list(
#define SPECIES_SYNTHETIC "Synthetic"
#define SPECIES_MONKEY "Monkey"
#define SPECIES_ZOMBIE "Zombie"
#define SPECIES_ANOMALY "Anomaly"

#define ALL_LIMBS list("head","chest","groin","l_leg","l_foot","r_leg","r_foot","l_arm","l_hand","r_arm","r_hand")
#define MOVEMENT_LIMBS list("l_leg", "l_foot", "r_leg", "r_foot")
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ DEFINE_BITFIELD(whitelist_status, list(
#define FACTION_COLONIST "Colonist"
#define FACTION_YAUTJA "Yautja"
#define FACTION_ZOMBIE "Zombie"
#define FACTION_ANOMALY "Anomaly"
#define FACTION_MONKEY "Monkey" // Nanu
#define FACTION_MALF_SYNTH "Malfunctioning Synthetic"

Expand Down
5 changes: 4 additions & 1 deletion code/datums/components/human_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
SSticker.mode.toggleable_flags ^= MODE_HUMAN_AI_TWEAKS
message_admins("Human AI tweaks have been enabled by spawning an AI. This can be disabled with the \"Toggle Human AI Tweaks\" verb.")

ai_brain = new(ai_human)
if(ai_human.species.default_ai_brain_type)
ai_brain = new ai_human.species.default_ai_brain_type(ai_human)
else
ai_brain = new(ai_human)
GLOB.ai_humans += ai_human
ai_human.mob_flags |= AI_CONTROLLED

Expand Down
15 changes: 15 additions & 0 deletions code/datums/pain/pain_anomaly.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/datum/pain/anomaly
current_pain = null
max_pain = 1000

threshold_mild = null
threshold_discomforting = null
threshold_moderate = null
threshold_distressing = null
threshold_severe = null
threshold_horrible = null

feels_pain = FALSE

/datum/pain/anomaly/apply_pain(amount = 0, type = BRUTE)
return FALSE
1 change: 1 addition & 0 deletions code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
// var/list/lights // list of all lights on this area
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area
var/air_doors_activated = 0
var/list/all_lights = list()
var/statistic_exempt = FALSE

var/global/global_uid = 0
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/effects/temporary_visuals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@
splatter_type = "csplatter"
color = BLOOD_COLOR_SYNTHETIC

/obj/effect/temp_visual/dir_setting/bloodsplatter/anomaly
splatter_type = "csplatter"
color = BLOOD_COLOR_ZOMBIE

//------------------------------------------
//Shockwaves
//------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ GLOBAL_LIST_INIT(admin_verbs_default, list(
/client/proc/toggle_human_ai_tweaks,
/client/proc/open_human_squad_spawner_panel,
/client/proc/open_human_ai_spawner_panel,
/client/proc/open_anomaly_ai_spawner_panel,
/client/proc/toggle_barricade_creation, // Stops cades from being built
))

Expand Down
10 changes: 10 additions & 0 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@

return ..()

/datum/asset/spritesheet/anomaly_menu
name = "anomaly_menu"

/datum/asset/spritesheet/anomaly_menu/register()
for(var/icon_state in icon_states('icons/misc/anomaly_menu.dmi'))
var/icon/icon_sprite = icon('icons/misc/anomaly_menu.dmi', icon_state)
icon_sprite.Scale(128, 128)
Insert(icon_state, icon_sprite)

return ..()

/datum/asset/spritesheet/gun_lineart
name = "gunlineart"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,9 @@

/// Holds the human squad spawner panel for this client
var/datum/human_ai_spawner_menu/human_spawn_menu

/// Holds the anomaly spawner panel for this client
var/datum/anomaly_ai_spawner_menu/anomaly_spawn_menu

/// Sets LOOC messaging cooldown
COOLDOWN_DECLARE(looc_cooldown)
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
light_source.recalc_corner(src)

// God that was a mess, now to do the rest of the corner code! Hooray!
/datum/static_lighting_corner/proc/update_lumcount(delta_r, delta_g, delta_b)
/datum/static_lighting_corner/proc/update_lumcount(delta_r, delta_g, delta_b) // optimize me!!

if(!(delta_r || delta_g || delta_b)) // 0 is falsey ok
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
affected_turf = null
return ..()

/datum/static_lighting_object/proc/update()
/datum/static_lighting_object/proc/update() // optimize me!

// To the future coder who sees this and thinks
// "Why didn't he just use a loop?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ GLOBAL_LIST_INIT_TYPED(AI_actions, /datum/ai_action, setup_ai_actions())

/proc/setup_ai_actions()
var/list/action_list = list()
for(var/action in subtypesof(/datum/ai_action))
var/datum/ai_action/A = new action
action_list[A.type] = A
for(var/datum/ai_action/action as anything in subtypesof(/datum/ai_action))
//if(action.action_flags & ACTION_UNIQUE) // AI action is applied in unique_actions on human_ai_brain
// continue
var/datum/ai_action/new_action = new action
action_list[new_action.type] = new_action
return action_list


Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/ai/brain/ai_brain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ GLOBAL_LIST_EMPTY(human_ai_brains)
/// List of whitelisted/blacklisted action datums
var/list/action_whitelist = null
var/list/action_blacklist = null
var/list/unique_actions = list()

/// List of current action datums
var/list/ongoing_actions = list()
Expand Down Expand Up @@ -362,3 +363,8 @@ GLOBAL_LIST_EMPTY(human_ai_brains)
try_cover(bullet.angle, bullet.firer)
else if(in_cover)
on_shot_inside_cover(bullet.angle, bullet.firer)

/// used when conditional AI spawns are required
/datum/human_ai_brain/proc/configure_custom_spawn(mob/living/carbon/human/parent)
return

Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
SIGNAL_HANDLER

if(dropped == primary_weapon)
if(!(gun_data.disposable && !primary_weapon.ai_can_use(tied_human, src)))
if(!(gun_data?.disposable && !primary_weapon.ai_can_use(tied_human, src)))
to_pickup |= dropped
set_primary_weapon(null)

Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@

..(message, speaking, verb, alt_name, italics, message_range, speech_sound, sound_vol, 0, message_mode) //ohgod we should really be passing a datum here.

SEND_SIGNAL(src, COMSIG_HUMAN_SAY, message)

INVOKE_ASYNC(src, TYPE_PROC_REF(/mob/living/carbon/human, say_to_radios), used_radios, message, message_mode, verb, speaking)

/mob/living/carbon/human/proc/say_to_radios(used_radios, message, message_mode, verb, speaking)
Expand Down
130 changes: 130 additions & 0 deletions code/modules/mob/living/carbon/human/species/anomaly/_species.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*
Datum-based species. Should make for much cleaner and easier to maintain mutantrace code.
*/

/datum/species/anomaly
///Used for isx(y) checking of species groups
group = SPECIES_ANOMALY
name = SPECIES_ANOMALY
name_plural = "Anomalies"

/datum/species/anomaly/larva_impregnated(obj/item/alien_embryo/embryo)
return

/// Override to add an emote panel to a species
/datum/species/anomaly/open_emote_panel()
return

/datum/emote/living/carbon/human/anomaly
species_type_allowed_typecache = list(/datum/species/anomaly)
emote_type = EMOTE_AUDIBLE

/datum/species/anomaly/handle_npc(mob/living/carbon/human/H)
return

/datum/species/anomaly/attempt_rock_paper_scissors()
return

/datum/species/anomaly/attempt_high_five()
return

/datum/species/anomaly/attempt_fist_bump()
return

/datum/species/anomaly/apply_signals(mob/living/carbon/human/H)
return

//Only used by horrors at the moment. Only triggers if the mob is alive and not dead.
/datum/species/anomaly/handle_unique_behavior(mob/living/carbon/human/H)
return

// Used for checking on how each species would scream when they are burning
/datum/species/anomaly/handle_on_fire(humanoidmob)
// call this for each species so each has their own unique scream options when burning alive
// heebie-jebies made me do all this effort, I HATE YOU
return

/datum/species/anomaly/handle_head_loss(mob/living/carbon/human/human)
return

/datum/species/anomaly/handle_paygrades()
return

/datum/ai_action/anomaly
action_flags = ACTION_UNIQUE

/datum/ai_action/anomaly/short_lighting
name = "Short Nearby Lighting"
var/ability_range = 9
var/static/list/action_sound_effect_list = list(
'sound/ambience/ambimalf.ogg',
'sound/ambience/ambigen10.ogg',
'sound/ambience/ambigen9.ogg',
'sound/ambience/ambigen5.ogg',
'sound/ambience/ambigen2.ogg',
'sound/ambience/ambimo2.ogg',
'sound/ambience/ambisin2.ogg'
)

var/static/list/sound_effect_list = list(
'sound/machines/resource_node/node_marine_die.ogg',
'sound/machines/resource_node/node_marine_die_2.ogg',
'sound/machines/resource_node/node_marine_harvest.ogg',
'sound/machines/resource_node/node_turn_off.ogg'
)

COOLDOWN_DECLARE(action_cooldown)
COOLDOWN_DECLARE(action_sound_effect_cooldown)

/datum/ai_action/anomaly/short_lighting/Added()
. = ..()
COOLDOWN_START(src, action_cooldown, 5 SECONDS)
COOLDOWN_START(src, action_sound_effect_cooldown, 5 SECONDS)

/datum/ai_action/anomaly/short_lighting/get_weight(datum/human_ai_brain/brain)
if(!is_type_in_list(src, brain.unique_actions))
return 0
return 20

/datum/ai_action/anomaly/short_lighting/trigger_action()
. = ..()
if(!COOLDOWN_FINISHED(src, action_cooldown))
return
if(brain.in_combat)
COOLDOWN_START(src, action_cooldown, 2 SECONDS)
else
COOLDOWN_START(src, action_cooldown, 5 SECONDS)
var/mob/tied_mob = brain.tied_human
var/area/mob_area = get_area(tied_mob)
if(!mob_area)
return
var/list/nearby_lights = list()
var/list/areas_to_check = list(mob_area)
if(brain.current_target && get_area(brain.current_target) != mob_area)
areas_to_check |= get_area(brain.current_target)
for(var/area/lighting_area as anything in areas_to_check)
for(var/obj/structure/machinery/light/light as anything in lighting_area.all_lights)
if(!light.on || get_dist(light, tied_mob) > ability_range)
continue
nearby_lights |= light
// breaks more lights if used in combat, but always at least 1
for(var/i in 1 to rand(1, (brain.in_combat * 4 + 1)))
if(!length(nearby_lights))
break
var/obj/structure/machinery/light/target_light = pick(nearby_lights)
if(prob(60) && brain.in_combat)
target_light.flicker(rand(2, 10), 1, 3)
playsound(target_light, pick(sound_effect_list), 20)
addtimer(CALLBACK(target_light, TYPE_PROC_REF(/obj/structure/machinery/light, broken), FALSE, FALSE), rand(2, 4) SECONDS)
else
addtimer(CALLBACK(target_light, TYPE_PROC_REF(/obj/structure/machinery/light, flicker)), rand(1, 3) SECONDS)
nearby_lights -= target_light
if(brain.current_target && ishuman_strict(brain.current_target) && brain.in_combat)
var/mob/living/carbon/human/target = brain.current_target
if(COOLDOWN_FINISHED(src, action_sound_effect_cooldown))
playsound_client(target.client, pick(action_sound_effect_list), target, 40, TRUE)
COOLDOWN_START(src, action_sound_effect_cooldown, 10 SECONDS)
if(prob(20)) // 20% chance to turn off their targets armor light every 2 seconds
var/obj/item/clothing/suit/storage/marine/target_armor = target.get_item_by_slot(WEAR_JACKET)
target_armor?.turn_light(target, FALSE)

Loading
Loading