-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'PvE-CMSS13:master' into crusher-amalgamation
- Loading branch information
Showing
32 changed files
with
452 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#define NARRATION_METHOD_SAY "Say" | ||
#define NARRATION_METHOD_ME "Me" | ||
#define NARRATION_METHOD_DIRECT "Direct" | ||
|
||
/datum/component/atom_narrate | ||
var/message | ||
var/narration_type | ||
var/narrator | ||
|
||
/datum/component/atom_narrate/Initialize(message, narration_type, delayed, narrator) | ||
. = ..() | ||
|
||
src.message = message | ||
src.narration_type = narration_type | ||
src.narrator = narrator | ||
|
||
if(!delayed) | ||
send_narration() | ||
return | ||
|
||
var/turf/parent_turf = get_turf(parent) | ||
|
||
if(!parent_turf) | ||
return COMPONENT_INCOMPATIBLE | ||
|
||
var/list/message_turfs = block(locate(max(parent_turf.x - 4, 1), max(parent_turf.y - 4, 1), parent_turf.z), locate(parent_turf.x + 4, parent_turf.y + 4, parent_turf.z)) | ||
|
||
for(var/turf/cycled_turf as anything in message_turfs) | ||
RegisterSignal(cycled_turf, COMSIG_TURF_ENTERED, PROC_REF(send_message_on_movement)) | ||
|
||
/datum/component/atom_narrate/proc/send_message_on_movement(turf/source, atom/movable/entered) | ||
SIGNAL_HANDLER | ||
|
||
if(!istype(entered, /mob/living/carbon/human)) | ||
return | ||
|
||
send_narration() | ||
qdel(src) | ||
|
||
/datum/component/atom_narrate/proc/send_narration() | ||
var/atom/atom_parent = parent | ||
|
||
if(!atom_parent) | ||
qdel(src) | ||
return | ||
|
||
var/list/heard = get_mobs_in_view(world_view_size, atom_parent) | ||
|
||
switch(narration_type) | ||
if(NARRATION_METHOD_SAY) | ||
atom_parent.langchat_speech(message, heard, GLOB.all_languages, skip_language_check = TRUE) | ||
atom_parent.visible_message("<b>[atom_parent]</b> says, \"[message]\"") | ||
if(NARRATION_METHOD_ME) | ||
atom_parent.langchat_speech(message, heard, GLOB.all_languages, skip_language_check = TRUE, animation_style = 2, additional_styles = list("langchat_small", "emote")) | ||
atom_parent.visible_message("<b>[atom_parent]</b> [message]") | ||
if(NARRATION_METHOD_DIRECT) | ||
atom_parent.visible_message("[message]") | ||
|
||
log_admin("[narrator] sent an Atom Narrate with message \"[message]\" from [atom_parent].") | ||
message_admins("[narrator] sent an Atom Narrate with message \"[message]\" from [atom_parent].") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/// Generic deployable beacon for objectives | ||
/obj/item/deployable_beacon | ||
name = "deployable beacon" | ||
desc = "A standard deployable beacon. Generally used by teams who may be out of regular communications range but must signal for various reasons. This one is branded with a Weyland Yutani symbol and sold en masse." | ||
icon = 'icons/obj/items/deployable_beacon.dmi' | ||
icon_state = "beacon_inactive" | ||
w_class = SIZE_SMALL | ||
|
||
/// The type of beacon it turns into | ||
var/beacon_type = /obj/structure/deployable_beacon | ||
|
||
/// Color of the beacon's light | ||
var/beacon_light_color = COLOR_WHITE | ||
|
||
/obj/item/deployable_beacon/Initialize(mapload, ...) | ||
. = ..() | ||
|
||
var/image/overlay_image = new('icons/obj/items/deployable_beacon.dmi', icon_state = "beacon_inactive_overlay") | ||
overlay_image.color = beacon_light_color | ||
|
||
overlays += overlay_image | ||
|
||
/obj/item/deployable_beacon/attack_self(mob/user) | ||
. = ..() | ||
|
||
var/turf/deploying_turf = get_turf(user) | ||
|
||
var/blocked = FALSE | ||
for(var/obj/potential_blocking_object in deploying_turf) | ||
if(potential_blocking_object.density || potential_blocking_object.can_block_movement) | ||
blocked = potential_blocking_object | ||
break | ||
|
||
if(!istype(deploying_turf, /turf/open)) | ||
blocked = deploying_turf | ||
|
||
var/turf/open/floor = deploying_turf | ||
if(!floor.allow_construction) | ||
to_chat(user, SPAN_WARNING("You cannot deploy \a [src] here, find a more secure surface!")) | ||
return FALSE | ||
|
||
if(blocked) | ||
to_chat(usr, SPAN_WARNING("You need a clear, open area to deploy [src], [blocked] is blocking the way!")) | ||
return | ||
|
||
if(user.action_busy) | ||
return | ||
|
||
if(!do_after(user, (1 SECONDS), INTERRUPT_ALL, BUSY_ICON_BUILD, src)) | ||
return | ||
|
||
playsound(deploying_turf, 'sound/mecha/mechmove01.ogg', 30, 1) | ||
|
||
var/obj/structure/deployable_beacon/deployed_beacon = new beacon_type(get_turf(src), user) | ||
transfer_label_component(deployed_beacon) | ||
|
||
qdel(src) | ||
|
||
/obj/item/deployable_beacon/red | ||
beacon_type = /obj/structure/deployable_beacon/red | ||
beacon_light_color = COLOR_RED | ||
|
||
/obj/item/deployable_beacon/green | ||
beacon_type = /obj/structure/deployable_beacon/green | ||
beacon_light_color = COLOR_GREEN | ||
|
||
/obj/item/deployable_beacon/blue | ||
beacon_type = /obj/structure/deployable_beacon/blue | ||
beacon_light_color = COLOR_BLUE | ||
|
||
/obj/item/deployable_beacon/purple | ||
beacon_type = /obj/structure/deployable_beacon/purple | ||
beacon_light_color = COLOR_PURPLE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// Generic beacon for objectives | ||
/obj/item/handheld_beacon | ||
name = "handheld beacon" | ||
desc = "A standard handheld beacon. Generally used by teams who may be out of regular communications range but must signal for various reasons. This one is branded with a Weyland Yutani symbol and sold en masse." | ||
icon = 'icons/obj/items/handheld_beacon.dmi' | ||
icon_state = "beacon_inactive" | ||
w_class = SIZE_SMALL | ||
|
||
/// Whether the beacon is active or not | ||
var/active = FALSE | ||
|
||
/obj/item/handheld_beacon/get_examine_text(mob/user) | ||
. = ..() | ||
|
||
if(active) | ||
. += "The beacon has been activated!" | ||
|
||
/obj/item/handheld_beacon/update_icon() | ||
. = ..() | ||
|
||
if(active) | ||
icon_state = "beacon_active" | ||
return | ||
icon_state = initial(icon_state) | ||
|
||
/obj/item/handheld_beacon/attack_self(mob/user) | ||
. = ..() | ||
|
||
if(.) | ||
return | ||
|
||
active = !active | ||
update_icon() | ||
|
||
to_chat(user, SPAN_NOTICE("The beacon pings quietly and turns [active ? "on" : "off"].")) | ||
|
||
if(!active) | ||
return | ||
|
||
for(var/client/admin_client in GLOB.admins) | ||
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights) | ||
playsound_client(admin_client,'sound/effects/sos-morse-code.ogg',10) | ||
|
||
message_admins("[key_name(user)] has activated [src]! [ADMIN_JMP_USER(user)]") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
code/game/objects/structures/beacons/deployable_beacons.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/obj/structure/deployable_beacon | ||
name = "deployable beacon" | ||
desc = "A standard deployable beacon. Generally used by teams who may be out of regular communications range but must signal for various reasons. This one is branded with a Weyland Yutani symbol and sold en masse." | ||
icon = 'icons/obj/items/deployable_beacon.dmi' | ||
icon_state = "beacon_active" | ||
|
||
/// The type of beacon it turns into | ||
var/beacon_type = /obj/item/deployable_beacon | ||
|
||
/// Color of the beacon's light | ||
var/beacon_light_color = COLOR_WHITE | ||
|
||
/obj/structure/deployable_beacon/Initialize(mapload, mob/user) | ||
. = ..() | ||
|
||
var/image/overlay_image = new('icons/obj/items/deployable_beacon.dmi', icon_state = "beacon_active_overlay") | ||
overlay_image.color = beacon_light_color | ||
|
||
overlays += overlay_image | ||
|
||
visible_message(SPAN_NOTICE("[src] beeps quietly as it begins broadcasting preprogrammed signals.")) | ||
|
||
for(var/client/admin_client in GLOB.admins) | ||
if((R_ADMIN|R_MOD) & admin_client.admin_holder.rights) | ||
playsound_client(admin_client,'sound/effects/sos-morse-code.ogg',10) | ||
|
||
message_admins("[key_name(user)] has deployed [src]! [ADMIN_JMP_USER(user)]") | ||
|
||
/obj/structure/deployable_beacon/attackby(obj/item/attacking_item, mob/user) | ||
if(!HAS_TRAIT(attacking_item, TRAIT_TOOL_MULTITOOL)) | ||
return ..() | ||
|
||
if(user.action_busy) | ||
return | ||
|
||
if(!do_after(user, (1 SECONDS), INTERRUPT_ALL, BUSY_ICON_BUILD, src)) | ||
return | ||
|
||
visible_message(SPAN_NOTICE("[src] gives a drone as it powers down and collapses into itself for easier carrying.")) | ||
|
||
var/obj/item/deployable_beacon/undeployed_beacon = new beacon_type() | ||
transfer_label_component(undeployed_beacon) | ||
|
||
user.put_in_hands(undeployed_beacon) | ||
|
||
qdel(src) | ||
|
||
/obj/structure/deployable_beacon/red | ||
beacon_type = /obj/item/deployable_beacon/red | ||
beacon_light_color = COLOR_RED | ||
|
||
/obj/structure/deployable_beacon/green | ||
beacon_type = /obj/item/deployable_beacon/green | ||
beacon_light_color = COLOR_GREEN | ||
|
||
/obj/structure/deployable_beacon/blue | ||
beacon_type = /obj/item/deployable_beacon/blue | ||
beacon_light_color = COLOR_BLUE | ||
|
||
/obj/structure/deployable_beacon/purple | ||
beacon_type = /obj/item/deployable_beacon/purple | ||
beacon_light_color = COLOR_PURPLE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.