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

Parrot rework run through #36

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9f7eb9d
i'm dying jessser
san7890 Sep 5, 2023
e6bdf6e
RURURUGHHGH
san7890 Sep 5, 2023
2c2258b
gwak gwak
san7890 Sep 5, 2023
fe13aaf
GLORGUISIFSA
san7890 Sep 5, 2023
83a8eec
might be having a skill issue rn
san7890 Sep 5, 2023
1fc158f
i barely feel my head
san7890 Sep 5, 2023
ffc459b
JESUS CHRIST
san7890 Sep 5, 2023
2e2e237
alright that should be a good chunk of memory
san7890 Sep 5, 2023
8930097
alright that should be a good chunk of memory
san7890 Sep 5, 2023
1c89c26
Update parrot_subtypes.dm
san7890 Sep 5, 2023
0d65e7d
code kleenup
san7890 Sep 5, 2023
d507aaa
glorgisisiss
san7890 Sep 5, 2023
0c02c23
fucking uuuhhhhhh
san7890 Sep 5, 2023
bd217c6
almost time to make sure the speech works
san7890 Sep 5, 2023
d7bf1dc
makes it compile
san7890 Sep 5, 2023
cda854b
more tinkering
san7890 Sep 5, 2023
f65f225
MOAR
san7890 Sep 5, 2023
c5d04b8
WOOOO SPEECH WORKS
san7890 Sep 5, 2023
493f308
roundend callback to save memory
san7890 Sep 5, 2023
ea2858d
MORE BULLSHIT
san7890 Sep 5, 2023
296f9f9
MUUUUUUURGGGG
san7890 Sep 5, 2023
b8e44de
probably a good stopping point
san7890 Sep 5, 2023
b4630af
reworks strippable items mayb
san7890 Sep 5, 2023
3554f75
it sitll won't compile but that's later issue
san7890 Sep 5, 2023
c362a02
probably more stuff
san7890 Sep 5, 2023
88502de
does the snaggy stuff
san7890 Sep 5, 2023
2b97cc5
some perching dogshit
san7890 Sep 5, 2023
d122cdf
more cleanup
san7890 Sep 5, 2023
0018c77
okay flarp this
san7890 Sep 5, 2023
cf9796a
makes it compile
san7890 Sep 5, 2023
53eb1b6
less linter crap
san7890 Sep 5, 2023
40e6d87
Merge remote-tracking branch 'upstream/master' into dafasdfewar
san7890 Oct 12, 2023
6e981ff
fixes a subtype issue
san7890 Oct 12, 2023
388beeb
alphabetizes a list
san7890 Oct 12, 2023
8e26f01
deletes useless default speech prob
san7890 Oct 12, 2023
0441336
early continue to `steal_from_mob()`
san7890 Oct 12, 2023
9c7efc6
that should be inverted
san7890 Oct 12, 2023
a10c378
misc. code cleanup
san7890 Oct 12, 2023
b9dbf3e
adds the default poly phrases to the static list
san7890 Oct 12, 2023
a8c4fdb
misc. code cleanup
san7890 Oct 12, 2023
66544eb
whoops
san7890 Oct 12, 2023
f3f919f
TYPE_PROC_REF for say
san7890 Oct 12, 2023
42204ef
Merge remote-tracking branch 'upstream/master' into parrot-rework
san7890 Nov 13, 2023
c4e0af9
Parrottai (#34)
Ben10Omintrix Nov 13, 2023
bed8a0e
Merge remote-tracking branch 'upstream/master' into parrot-rework
san7890 Nov 13, 2023
3bbe177
Merge branch 'parrot-rework' of https://github.com/san7890/bruhstatio…
san7890 Nov 13, 2023
480bb6a
fixes alphabetizations
san7890 Nov 13, 2023
51f8075
multilines that addcomponent
san7890 Nov 13, 2023
3951d39
removes the movemanager thing
san7890 Nov 13, 2023
f68dd72
qdels on login
san7890 Nov 13, 2023
8803ea5
Emagged PDAs won't log to wirecarp. (#79707)
JohnFulpWillard Nov 14, 2023
ce8057e
Automatic changelog for PR #79707 [ci skip]
comfyorange Nov 14, 2023
5175ae0
TGUI Destructive Analyzer (#79572)
JohnFulpWillard Nov 14, 2023
00bd89f
Automatic changelog for PR #79572 [ci skip]
comfyorange Nov 14, 2023
fa6be5f
Makes the spelling of 'mjollnir' consistant and renames singularityha…
D4C-420 Nov 14, 2023
c762eff
Automatic changelog for PR #79700 [ci skip]
comfyorange Nov 14, 2023
4566c29
Hallucinations don't print to newscasters (#79711)
MrMelbert Nov 14, 2023
3e16564
[NO GBP] Fixes handle_bodyparts running needlessly when stat == DEAD …
vinylspiders Nov 14, 2023
0979cee
Automatic changelog for PR #79711 [ci skip]
comfyorange Nov 14, 2023
573895a
Traits from blessing of insanity are now applied correctly (#79704)
Ghommie Nov 14, 2023
7805c5b
loopable looms (#79680)
jjpark-kb Nov 14, 2023
d4688f9
Automatic changelog for PR #79704 [ci skip]
comfyorange Nov 14, 2023
3ef6094
Automatic changelog for PR #79680 [ci skip]
comfyorange Nov 14, 2023
22ffded
Orbit Poll respects Preferences + Asks for Permission to Unghost (#79…
san7890 Nov 14, 2023
bed92e1
Further Prevention of Disposals Qdeletion (#79714)
san7890 Nov 14, 2023
1496019
Fixes tram plate electrocution [NO GBP] (#79717)
lessthnthree Nov 14, 2023
35662aa
Automatic changelog for PR #79712 [ci skip]
comfyorange Nov 14, 2023
dae7640
Automatic changelog for PR #79714 [ci skip]
comfyorange Nov 14, 2023
78aaa38
Automatic changelog for PR #79717 [ci skip]
comfyorange Nov 14, 2023
f907470
Fixes a small issue with disposal outlets. (#79706)
Ghommie Nov 14, 2023
c15a73e
Heart code cleanup (#79602)
MrMelbert Nov 14, 2023
17192bb
Automatic changelog for PR #79706 [ci skip]
comfyorange Nov 14, 2023
349de8d
Automatic changelog for PR #79602 [ci skip]
comfyorange Nov 14, 2023
81214b2
General code maintenance for smart fridge (#79623)
SyncIt21 Nov 15, 2023
67ab21a
[NO GBP] Emote Panel TGUI, now should be fixed (#79481)
larentoun Nov 15, 2023
8c850ad
Automatic changelog for PR #79623 [ci skip]
comfyorange Nov 15, 2023
5396ec6
Automatic changelog for PR #79481 [ci skip]
comfyorange Nov 15, 2023
bdd7443
Automatic changelog compile [ci skip]
actions-user Nov 15, 2023
a10d198
Merge remote-tracking branch 'upstream/master' into parrot-rework
san7890 Nov 15, 2023
2396609
Oojo (#35)
Ben10Omintrix Nov 15, 2023
271f91a
deletes the autochangelogs
san7890 Nov 15, 2023
ae6d54e
caches code + code opt
san7890 Nov 15, 2023
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
18 changes: 18 additions & 0 deletions code/__DEFINES/ai/pets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,21 @@
#define BB_FIND_MOM_TYPES "BB_find_mom_types"
///list of types of mobs we must ignore
#define BB_IGNORE_MOM_TYPES "BB_ignore_mom_types"

/// The current string that this parrot will repeat back to someone
#define BB_PARROT_REPEAT_STRING "BB_parrot_repeat_string"
/// The odds that this parrot will repeat back a string
#define BB_PARROT_REPEAT_PROBABILITY "BB_parrot_repeat_probability"
/// The odds that this parrot will choose another string to repeat
#define BB_PARROT_PHRASE_CHANGE_PROBABILITY "BB_parrot_phrase_change_probability"
/// A copy of the string buffer that we end the shift with. DO NOT ACCESS THIS DIRECTLY - YOU SHOULD USE THE COMPONENT IN MOST CASES
#define BB_EXPORTABLE_STRING_BUFFER_LIST "BB_parrot_repeat_string_buffer"
/// The types of perches we desire to use
#define BB_PARROT_PERCH_TYPES "BB_parrot_perch_types"
#define BB_PERCH_TARGET "perch_target"
#define BB_HOARD_ITEM_TARGET "hoard_item_target"
#define BB_THEFT_VICTIM "theft_victim"
#define BB_HOARD_LOCATION "hoard_location"
#define BB_HOARD_LOCATION_RANGE "hoard_location_range"
#define BB_IGNORE_ITEMS "ignore_items"

9 changes: 9 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,15 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define BODY_ZONE_L_LEG "l_leg"
#define BODY_ZONE_R_LEG "r_leg"

#define CARBON_GENERIC_BODY_ZONES list(\
BODY_ZONE_HEAD,\
BODY_ZONE_CHEST,\
BODY_ZONE_L_ARM,\
BODY_ZONE_R_ARM,\
BODY_ZONE_L_LEG,\
BODY_ZONE_R_LEG,\
)

GLOBAL_LIST_INIT(arm_zones, list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))

#define BODY_ZONE_PRECISE_EYES "eyes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@
#define COMSIG_MOVABLE_THROW_LANDED "movable_throw_landed"
///from base of atom/movable/on_changed_z_level(): (turf/old_turf, turf/new_turf, same_z_layer)
#define COMSIG_MOVABLE_Z_CHANGED "movable_ztransit"
///called before hearing a message froma tom/movable/Hear():
#define COMSIG_MOVABLE_PRE_HEAR "movable_pre_hear"
///do not proceed to hear the message
#define COMSIG_MOVABLE_CANCEL_HEARING (1<<0)
///from base of atom/movable/Hear(): (proc args list(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, list/message_mods = list(), message_range))
#define COMSIG_MOVABLE_HEAR "movable_hear"
//#define HEARING_MESSAGE 1 - (I'm pretty sure this is never really used and can be gutted)
#define HEARING_MESSAGE 1
#define HEARING_SPEAKER 2
#define HEARING_LANGUAGE 3
#define HEARING_RAW_MESSAGE 4
//#define HEARING_RADIO_FREQ 5
#define HEARING_RADIO_FREQ 5
#define HEARING_SPANS 6
#define HEARING_MESSAGE_MODE 7
#define HEARING_RANGE 8
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

/// Signal sent when a blackboard key is cleared
#define COMSIG_AI_BLACKBOARD_KEY_CLEARED(blackboard_key) "ai_blackboard_key_clear_[blackboard_key]"

4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@

///from the ranged_attacks component for basic mobs: (mob/living/basic/firer, atom/target, modifiers)
#define COMSIG_BASICMOB_POST_ATTACK_RANGED "basicmob_post_attack_ranged"

/// Sent from /datum/ai_planning_subtree/parrot_as_in_repeat() : ()
#define COMSIG_NEEDS_NEW_PHRASE "parrot_needs_new_phrase"
#define NO_NEW_PHRASE_AVAILABLE (1<<0) //! Cancel to try again later for when we actually get a new phrase
4 changes: 0 additions & 4 deletions code/__DEFINES/research.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#define RDSCREEN_NOBREAK "<NO_HTML_BREAK>"

/// For instances where we don't want a design showing up due to it being for debug/sanity purposes
#define DESIGN_ID_IGNORE "IGNORE_THIS_DESIGN"

#define RESEARCH_MATERIAL_DESTROY_ID "__destroy"

//! Techweb names for new point types. Can be used to define specific point values for specific types of research (science, security, engineering, etc.)
#define TECHWEB_POINT_TYPE_GENERIC "General Research"

Expand Down
9 changes: 3 additions & 6 deletions code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* * encode_title - if TRUE, the title will be HTML encoded
* * encode_text - if TRUE, the text will be HTML encoded
*/
/proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players, encode_title = TRUE, encode_text = TRUE, color_override)
/proc/priority_announce(text, title = "", sound, type, sender_override, has_important_message = FALSE, list/mob/players = GLOB.player_list, encode_title = TRUE, encode_text = TRUE, color_override)
if(!text)
return

Expand Down Expand Up @@ -85,7 +85,7 @@

dispatch_announcement_to_players(finalized_announcement, players, sound)

if(isnull(sender_override))
if(isnull(sender_override) && players == GLOB.player_list)
if(length(title) > 0)
GLOB.news_network.submit_article(title + "<br><br>" + text, "[command_name()]", "Station Announcements", null)
else
Expand Down Expand Up @@ -185,10 +185,7 @@
return jointext(returnable_strings, "")

/// Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
/proc/dispatch_announcement_to_players(announcement, list/players, sound_override = null, should_play_sound = TRUE)
if(!players)
players = GLOB.player_list

/proc/dispatch_announcement_to_players(announcement, list/players = GLOB.player_list, sound_override = null, should_play_sound = TRUE)
var/sound_to_play = !isnull(sound_override) ? sound_override : 'sound/misc/notice2.ogg'

for(var/mob/target in players)
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/phobias.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ GLOBAL_LIST_INIT(phobia_mobs, list(
"birds" = typecacheof(list(
/mob/living/basic/chick,
/mob/living/basic/chicken,
/mob/living/basic/parrot,
/mob/living/basic/pet/penguin,
/mob/living/simple_animal/parrot,
)),
"conspiracies" = typecacheof(list(
/mob/living/basic/drone,
Expand Down
5 changes: 3 additions & 2 deletions code/controllers/subsystem/persistence/_persistence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ SUBSYSTEM_DEF(persistence)

///Loads up Poly's speech buffer.
/datum/controller/subsystem/persistence/proc/load_poly()
for(var/mob/living/simple_animal/parrot/poly/P in GLOB.alive_mob_list)
twitterize(P.speech_buffer, "polytalk")
for(var/mob/living/basic/parrot/poly/bird in GLOB.alive_mob_list)
var/list/list_to_read = bird.get_static_list_of_phrases()
twitterize(list_to_read, "polytalk")
break //Who's been duping the bird?!

/// Loads up the amount of times maps appeared to alter their appearance in voting and rotation.
Expand Down
42 changes: 15 additions & 27 deletions code/controllers/subsystem/research.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ SUBSYSTEM_DEF(research)
var/list/techweb_nodes_starting = list()
///category name = list(node.id = TRUE)
var/list/techweb_categories = list()
///associative double-layer path = list(id = list(point_type = point_discount))
var/list/techweb_boost_items = list()
///List of all items that can unlock a node. (node.id = list(items))
var/list/techweb_unlock_items = list()
///Node ids that should be hidden by default.
var/list/techweb_nodes_hidden = list()
///Node ids that are exclusive to the BEPIS.
var/list/techweb_nodes_experimental = list()
///path = list(point type = value)
var/list/techweb_point_items = list(
/obj/item/assembly/signaler/anomaly = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
/obj/item/assembly/signaler/anomaly = list(TECHWEB_POINT_TYPE_GENERIC = 10000)
)
var/list/errored_datums = list()
var/list/point_types = list() //typecache style type = TRUE list
Expand Down Expand Up @@ -64,7 +64,7 @@ SUBSYSTEM_DEF(research)
/// Lookup list for ordnance briefers.
var/list/ordnance_experiments = list()
/// Lookup list for scipaper partners.
var/list/scientific_partners = list()
var/list/datum/scientific_partner/scientific_partners = list()

/datum/controller/subsystem/research/Initialize()
point_types = TECHWEB_POINT_TYPE_LIST_ASSOCIATIVE_NAMES
Expand Down Expand Up @@ -153,7 +153,7 @@ SUBSYSTEM_DEF(research)
if (!verify_techweb_nodes()) //Verify all nodes have ids and such.
stack_trace("Invalid techweb nodes detected")
calculate_techweb_nodes()
calculate_techweb_boost_list()
calculate_techweb_item_unlocking_requirements()
if (!verify_techweb_nodes()) //Verify nodes and designs have been crosslinked properly.
CRASH("Invalid techweb nodes detected")

Expand Down Expand Up @@ -209,25 +209,15 @@ SUBSYSTEM_DEF(research)
N.unlock_ids -= u
research_node_id_error(u)
. = FALSE
for(var/p in N.boost_item_paths)
for(var/p in N.required_items_to_unlock)
if(!ispath(p))
N.boost_item_paths -= p
N.required_items_to_unlock -= p
WARNING("[p] is not a valid path.")
node_boost_error(N.id, "[p] is not a valid path.")
. = FALSE
var/list/points = N.boost_item_paths[p]
if(islist(points))
for(var/i in points)
if(!isnum(points[i]))
WARNING("[points[i]] is not a valid number.")
node_boost_error(N.id, "[points[i]] is not a valid number.")
. = FALSE
else if(!point_types[i])
WARNING("[i] is not a valid point type.")
node_boost_error(N.id, "[i] is not a valid point type.")
. = FALSE
else if(!isnull(points))
N.boost_item_paths -= p
var/list/points = N.required_items_to_unlock[p]
if(!isnull(points))
N.required_items_to_unlock -= p
node_boost_error(N.id, "No valid list.")
WARNING("No valid list.")
. = FALSE
Expand Down Expand Up @@ -281,18 +271,16 @@ SUBSYSTEM_DEF(research)
var/datum/techweb_node/prereq_node = techweb_node_by_id(prereq_id)
prereq_node.unlock_ids[node.id] = node

/datum/controller/subsystem/research/proc/calculate_techweb_boost_list(clearall = FALSE)
if(clearall)
techweb_boost_items = list()
/datum/controller/subsystem/research/proc/calculate_techweb_item_unlocking_requirements()
for(var/node_id in techweb_nodes)
var/datum/techweb_node/node = techweb_nodes[node_id]
for(var/path in node.boost_item_paths)
for(var/path in node.required_items_to_unlock)
if(!ispath(path))
continue
if(length(techweb_boost_items[path]))
techweb_boost_items[path][node.id] = node.boost_item_paths[path]
if(length(techweb_unlock_items[path]))
techweb_unlock_items[path][node.id] = node.required_items_to_unlock[path]
else
techweb_boost_items[path] = list(node.id = node.boost_item_paths[path])
techweb_unlock_items[path] = list(node.id = node.required_items_to_unlock[path])
CHECK_TICK

/datum/controller/subsystem/research/proc/populate_ordnance_experiments()
Expand Down
11 changes: 11 additions & 0 deletions code/datums/ai/basic_mobs/basic_ai_behaviors/basic_attacking.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/datum/ai_behavior/basic_melee_attack
action_cooldown = 0.2 SECONDS // We gotta check unfortunately often because we're in a race condition with nextmove
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_REQUIRE_REACH | AI_BEHAVIOR_CAN_PLAN_DURING_EXECUTION
///do we finish this action after hitting once?
var/terminate_after_action = FALSE

/datum/ai_behavior/basic_melee_attack/setup(datum/ai_controller/controller, target_key, targeting_strategy_key, hiding_location_key)
. = ..()
Expand Down Expand Up @@ -39,12 +41,21 @@
else
basic_mob.melee_attack(target)

if(terminate_after_action)
finish_action(controller, TRUE, target_key)

/datum/ai_behavior/basic_melee_attack/finish_action(datum/ai_controller/controller, succeeded, target_key, targeting_strategy_key, hiding_location_key)
. = ..()
if(!succeeded)
controller.clear_blackboard_key(target_key)

/datum/ai_behavior/basic_melee_attack/interact_once
terminate_after_action = TRUE

/datum/ai_behavior/basic_melee_attack/interact_once/finish_action(datum/ai_controller/controller, succeeded, target_key, targeting_strategy_key, hiding_location_key)
. = ..()
controller.clear_blackboard_key(target_key)

/datum/ai_behavior/basic_ranged_attack
action_cooldown = 0.6 SECONDS
behavior_flags = AI_BEHAVIOR_REQUIRE_MOVEMENT | AI_BEHAVIOR_MOVE_AND_PERFORM
Expand Down
23 changes: 23 additions & 0 deletions code/datums/ai/generic/find_and_set.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
if(length(found))
return pick(found)

/// Like find_and_set/in_list, but we return the turf location of the item instead of the item itself.
/datum/ai_behavior/find_and_set/in_list/turf_location

/datum/ai_behavior/find_and_set/in_list/turf_location/search_tactic(datum/ai_controller/controller, locate_paths, search_range)
. = ..()
if(isnull(.))
return null

return get_turf(.)

/**
* Variant of find and set which returns an object which can be animated with a staff of change
*/
Expand Down Expand Up @@ -148,3 +158,16 @@
return pick(customers)

return null

/datum/ai_behavior/find_and_set/nearby_friends
action_cooldown = 2 SECONDS

/datum/ai_behavior/find_and_set/nearby_friends/search_tactic(datum/ai_controller/controller, locate_path, search_range)
var/atom/friend = locate(/mob/living/carbon/human) in oview(search_range, controller.pawn)

if(isnull(friend))
return null

var/mob/living/living_pawn = controller.pawn
var/potential_friend = living_pawn.faction.Find(REF(friend)) ? friend : null
return potential_friend
2 changes: 2 additions & 0 deletions code/datums/ai/generic/generic_behaviors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@
/datum/ai_behavior/perform_speech

/datum/ai_behavior/perform_speech/perform(seconds_per_tick, datum/ai_controller/controller, speech, speech_sound)
. = ..()

var/mob/living/living_pawn = controller.pawn
if(!istype(living_pawn))
return
Expand Down
32 changes: 20 additions & 12 deletions code/datums/components/energized.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define NORMAL_TOAST_PROB 3
#define BROKEN_TOAST_PROB 33

/datum/component/energized
can_transfer = FALSE
///what we give to connect_loc by default, makes slippable mobs moving over us slip
Expand Down Expand Up @@ -48,24 +51,14 @@
/datum/component/energized/proc/toast(turf/open/floor/source, atom/movable/arrived, atom/old_loc, list/atom/old_locs)
SIGNAL_HANDLER

if(!source.broken && !source.burnt)
return

if(!isliving(arrived))
return

if(prob(85))
if(prob(25))
do_sparks(1, FALSE, source)
playsound(src, SFX_SPARKS, 40, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
source.audible_message(span_danger("[parent] makes an electric crackle..."))
return

var/mob/living/future_tram_victim = arrived
var/datum/transport_controller/linear/tram/tram = transport_ref?.resolve()

// Check for stopped states.
if(isnull(tram) || !tram.controller_operational || !inbound || !outbound)
if(isnull(tram) || !tram.controller_operational || !tram.controller_active || !inbound || !outbound)
return FALSE

var/obj/structure/transport/linear/tram/tram_part = tram.return_closest_platform_to(parent)
Expand All @@ -76,6 +69,17 @@
if(isnull(source))
return FALSE

var/toast_prob = NORMAL_TOAST_PROB
if(source.broken || source.burnt || HAS_TRAIT(future_tram_victim, TRAIT_CURSED))
toast_prob = BROKEN_TOAST_PROB

if(prob(100 - toast_prob))
if(prob(25))
do_sparks(1, FALSE, source)
playsound(src, SFX_SPARKS, 40, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
source.audible_message(span_danger("[parent] makes an electric crackle..."))
return FALSE

// Everything will be based on position and travel direction
var/plate_pos
var/tram_pos
Expand All @@ -102,7 +106,7 @@
return FALSE
if((tram.travel_direction & EAST) && outbound > tram.destination_platform.platform_code)
return FALSE
if(approach_distance >= AMBER_THRESHOLD_NORMAL)
if(approach_distance >= AMBER_THRESHOLD_DEGRADED)
return FALSE

// Finally the interesting part where they ACTUALLY get hit!
Expand All @@ -112,8 +116,12 @@
action = NOTIFY_ORBIT,
header = "Electrifying!",
)
do_sparks(4, FALSE, source)
playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
source.audible_message(span_danger("[parent] makes a loud electric crackle!"))
to_chat(future_tram_victim, span_userdanger("You hear a loud electric crackle!"))
future_tram_victim.electrocute_act(15, src, 1)
return TRUE

#undef NORMAL_TOAST_PROB
#undef BROKEN_TOAST_PROB
Loading
Loading