-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
521 additions
and
3 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,43 @@ | ||
// This trait makes the projectile only hit targets directly clicked | ||
|
||
/datum/element/bullet_trait_direct_only | ||
// General bullet trait vars | ||
element_flags = ELEMENT_DETACH|ELEMENT_BESPOKE | ||
id_arg_index = 2 | ||
|
||
/datum/element/bullet_trait_direct_only/Attach(datum/target) | ||
. = ..() | ||
if(!istype(target, /obj/projectile)) | ||
return ELEMENT_INCOMPATIBLE | ||
|
||
RegisterSignal(target, COMSIG_BULLET_CHECK_MOB_SKIPPING, PROC_REF(check_distance)) | ||
|
||
/datum/element/bullet_trait_direct_only/Detach(datum/target) | ||
UnregisterSignal(target, COMSIG_BULLET_CHECK_MOB_SKIPPING) | ||
|
||
return ..() | ||
|
||
/datum/element/bullet_trait_direct_only/proc/check_distance(obj/projectile/projectile, mob/living/carbon/human/projectile_target) | ||
SIGNAL_HANDLER | ||
|
||
if(projectile.original != projectile_target) | ||
return COMPONENT_SKIP_MOB | ||
|
||
/datum/element/bullet_trait_direct_only/watchtower/check_distance(obj/projectile/projectile, mob/living/carbon/human/projectile_target) | ||
if(!HAS_TRAIT(projectile.firer, TRAIT_ON_WATCHTOWER)) | ||
if(!istype(projectile.firer, /mob)) | ||
return | ||
var/mob/firer = projectile.firer | ||
var/obj/item/weapon/gun/gun = firer.get_inactive_hand() | ||
if(istype(gun)) | ||
gun.remove_bullet_traits(list("watchtower_arc")) | ||
|
||
gun = firer.get_active_hand() | ||
if(istype(gun)) | ||
gun.remove_bullet_traits(list("watchtower_arc")) | ||
return | ||
|
||
if(HAS_TRAIT(projectile_target, TRAIT_ON_WATCHTOWER)) | ||
return | ||
|
||
return ..() |
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,45 @@ | ||
/// Invisible Blocker Walls, they link up with the watchtower and collapse with it | ||
/obj/structure/blocker/watchtower | ||
name = "Watchtower Blocker" | ||
icon = 'icons/obj/structures/barricades.dmi' | ||
icon_state = "folding_0" // for map editing only | ||
flags_atom = ON_BORDER | ||
invisibility = INVISIBILITY_MAXIMUM | ||
density = TRUE | ||
opacity = FALSE // Unfortunately this doesn't behave as we'd want with ON_BORDER so we can't make tent opaque | ||
throwpass = TRUE // Needs this so xenos can attack through the blocker and hit the tents or people inside | ||
/// The watchtower this blocker relates to, will be destroyed along with it | ||
var/obj/structure/watchtower/linked_watchtower | ||
|
||
/obj/structure/blocker/watchtower/Initialize(mapload, ...) | ||
. = ..() | ||
icon_state = null | ||
linked_watchtower = locate(/obj/structure/watchtower) in loc | ||
if(!linked_watchtower) | ||
return INITIALIZE_HINT_QDEL | ||
RegisterSignal(linked_watchtower, COMSIG_PARENT_QDELETING, PROC_REF(collapse)) | ||
|
||
/obj/structure/blocker/watchtower/Destroy(force) | ||
. = ..() | ||
linked_watchtower = null | ||
|
||
/obj/structure/blocker/watchtower/proc/collapse() | ||
SIGNAL_HANDLER | ||
qdel(src) | ||
|
||
/obj/structure/blocker/watchtower/initialize_pass_flags(datum/pass_flags_container/PF) | ||
..() | ||
if (PF) | ||
PF.flags_can_pass_all = NONE | ||
PF.flags_can_pass_front = NONE | ||
PF.flags_can_pass_behind = NONE | ||
|
||
/obj/structure/blocker/watchtower/get_projectile_hit_boolean(obj/projectile/P) | ||
. = ..() | ||
return FALSE // Always fly through the watchtower | ||
|
||
//Blocks all direction, basically an invisible wall | ||
/obj/structure/blocker/watchtower/full_tile | ||
flags_atom = NO_FLAGS | ||
icon = 'icons/landmarks.dmi' | ||
icon_state = "invisible_wall" |
Oops, something went wrong.