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

Yautja Gear Recovery Changes #3455

Merged
merged 21 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 2 additions & 1 deletion code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
#define NOTABLEMERGE (1<<13)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<14)

/// Is in the process of falling apart.
#define ITEM_DISSOLVING (1<<15)
//==========================================================================================


Expand Down
48 changes: 48 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ cases. Override_icon_state should be a list.*/
. += desc
if(desc_lore)
. += SPAN_NOTICE("This has an <a href='byond://?src=\ref[src];desc_lore=1'>extended lore description</a>.")
if(flags_item & ITEM_DISSOLVING)
. += SPAN_WARNING("It is currently dissolving into bits!")

/obj/item/attack_hand(mob/user)
if (!user)
Expand Down Expand Up @@ -310,6 +312,10 @@ cases. Override_icon_state should be a list.*/
if(SEND_SIGNAL(src, COMSIG_ITEM_ATTACKED, W, user) & COMPONENT_CANCEL_ITEM_ATTACK)
return

if((flags_item & ITEM_PREDATOR) && (istype(W, /obj/item/tool/yautja_cleaner)))
if(handle_dissolve())
return

if(istype(W,/obj/item/storage))
var/obj/item/storage/S = W
if(S.storage_flags & STORAGE_CLICK_GATHER && isturf(loc))
Expand Down Expand Up @@ -1064,3 +1070,45 @@ cases. Override_icon_state should be a list.*/
animate(attack_image, alpha = 175, transform = copy_transform.Scale(0.75), pixel_x = 0, pixel_y = 0, pixel_z = 0, time = 3)
animate(time = 1)
animate(alpha = 0, time = 3, easing = CIRCULAR_EASING|EASE_OUT)

/obj/item/proc/handle_dissolve()
if(!(flags_item & ITEM_PREDATOR))
return FALSE
if(!HAS_TRAIT(usr, TRAIT_YAUTJA_TECH))
to_chat(usr, SPAN_WARNING("You have no idea what this even does..."))
return FALSE
if(istype(src, /obj/item/tool/yautja_cleaner))
to_chat(usr, SPAN_WARNING("You cannot dissolve more dissolving fluid..."))
return FALSE
if(usr.alpha < 255)
to_chat(usr, SPAN_BOLDWARNING("It would not be safe to attempt this while cloaked!"))
return FALSE
if(anchored)
to_chat(usr, SPAN_WARNING("\The [src] cannot be moved by any means, why dissolve it?"))
return FALSE

var/mob/living/location = loc
var/mob/living/loc_loc = loc.loc
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(location) || istype(loc_loc))
to_chat(usr, SPAN_WARNING("You cannot dissolve this while it is being held!"))
return FALSE

dissolve()
return TRUE

/obj/item/proc/dissolve()
usr.visible_message(SPAN_DANGER("[usr] uncaps a vial and begins to pour out a vibrant blue liquid over \the [src]!"), \
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
SPAN_NOTICE("You begin to spread dissolving gel onto \the [src]!"))
if(do_after(usr, 5 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
usr.visible_message(SPAN_DANGER("[usr] pours blue liquid all over \the [src]!"), \
SPAN_NOTICE("You cover \the [src] with dissolving gel!"))
add_filter("dissolve_gel", 1, list("type" = "outline", "color" = "#3333FFff", "size" = 1))
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), src), 15 SECONDS)
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, visible_message), SPAN_WARNING("[src] crumbles into pieces!")), 15 SECONDS)
flags_item |= ITEM_DISSOLVING
log_attack("[key_name(usr)] dissolved [src] with Yautja Cleaner!")
return TRUE
else
usr.visible_message(SPAN_WARNING("[usr] stops pouring liquid on to \the [src]!"), \
SPAN_WARNING("You decide not to cover \the [src] with dissolving gel."))
return FALSE
91 changes: 67 additions & 24 deletions code/game/objects/items/explosives/plastic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,6 @@

return TRUE

/obj/item/explosive/plastic/breaching_charge/can_place(mob/user, atom/target)
if(!is_type_in_list(target, breachable))//only items on the list are allowed
to_chat(user, SPAN_WARNING("You cannot plant \the [name] on \the [target]!"))
return FALSE

if(SSinterior.in_interior(target))// vehicle checks again JUST IN CASE
to_chat(user, SPAN_WARNING("It's too cramped in here to deploy \the [src]."))
return FALSE

if(istype(target, /obj/structure/window))//no breaching charges on the briefing windows / brig / CIC e.e
var/obj/structure/window/W = target
if(W.not_damageable)
to_chat(user, SPAN_WARNING("[W] is much too tough for you to do anything to it with [src].")) //On purpose to mimic wall message
return FALSE

return TRUE

/obj/item/explosive/plastic/proc/calculate_pixel_offset(mob/user, atom/target)
switch(get_dir(user, target))
if(NORTH)
Expand Down Expand Up @@ -311,13 +294,6 @@
cell_explosion(target_turf, 120, 30, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data)
qdel(src)

/obj/item/explosive/plastic/breaching_charge/handle_explosion(turf/target_turf, dir, cause_data)
var/explosion_target = get_step(target_turf, dir)
create_shrapnel(explosion_target, 40, dir, angle,/datum/ammo/bullet/shrapnel/metal, cause_data)
sleep(1)// prevents explosion from eating shrapnel
cell_explosion(target_turf, 60, 60, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data)
qdel(src)

/obj/item/explosive/plastic/proc/delayed_prime(turf/target_turf)
prime(TRUE)

Expand All @@ -341,3 +317,70 @@
min_timer = 3
penetration = 0.60
deploying_time = 10
var/shrapnel_volume = 40

/obj/item/explosive/plastic/breaching_charge/can_place(mob/user, atom/target)
if(!is_type_in_list(target, breachable))//only items on the list are allowed
to_chat(user, SPAN_WARNING("You cannot plant \the [name] on \the [target]!"))
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
return FALSE

if(SSinterior.in_interior(target))// vehicle checks again JUST IN CASE
to_chat(user, SPAN_WARNING("It's too cramped in here to deploy \the [src]."))
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
return FALSE

if(istype(target, /obj/structure/window))//no breaching charges on the briefing windows / brig / CIC e.e
var/obj/structure/window/W = target
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(W.not_damageable)
to_chat(user, SPAN_WARNING("[W] is much too tough for you to do anything to it with [src].")) //On purpose to mimic wall message
return FALSE

return TRUE

/obj/item/explosive/plastic/breaching_charge/handle_explosion(turf/target_turf, dir, cause_data)
var/explosion_target = get_step(target_turf, dir)
create_shrapnel(explosion_target, shrapnel_volume, dir, angle,/datum/ammo/bullet/shrapnel/metal, cause_data)
sleep(1)// prevents explosion from eating shrapnel
cell_explosion(target_turf, 60, 60, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data)
qdel(src)

/obj/item/explosive/plastic/breaching_charge/plasma
name = "plasma charge"
desc = "An alien explosive device. Who knows what it might do."
icon_state = "plasma-charge"
overlay_image = "plasma-active"
w_class = SIZE_SMALL
angle = 55
timer = 5
min_timer = 5
penetration = 0.60
deploying_time = 10
flags_item = NOBLUDGEON|ITEM_PREDATOR
shrapnel_volume = 10

/obj/item/explosive/plastic/breaching_charge/plasma/can_place(mob/user, atom/target)
if(!HAS_TRAIT(user, TRAIT_YAUTJA_TECH))
to_chat(user, SPAN_WARNING("You don't quite understand how the device works..."))
return FALSE

if(!is_type_in_list(target, breachable))//only items on the list are allowed
to_chat(user, SPAN_WARNING("You cannot plant \the [name] on \the [target]!"))
return FALSE

if(SSinterior.in_interior(target))// vehicle checks again JUST IN CASE
to_chat(user, SPAN_WARNING("It's too cramped in here to deploy \the [src]."))
return FALSE

if(istype(target, /obj/structure/window))//no breaching charges on the briefing windows / brig / CIC e.e
var/obj/structure/window/W = target
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(W.not_damageable)
to_chat(user, SPAN_WARNING("[W] is much too tough for you to do anything to it with [src].")) //On purpose to mimic wall message
return FALSE

return TRUE

/obj/item/explosive/plastic/breaching_charge/plasma/handle_explosion(turf/target_turf, dir, cause_data)
var/explosion_target = get_step(target_turf, dir)
create_shrapnel(explosion_target, shrapnel_volume, dir, angle,/datum/ammo/bullet/shrapnel/plasma, cause_data)
sleep(1)// prevents explosion from eating shrapnel
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
cell_explosion(target_turf, 90, 90, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data)
qdel(src)
6 changes: 6 additions & 0 deletions code/modules/cm_preds/smartdisc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
var/list/L = hearers(src, dist)
return L

/obj/item/explosive/grenade/spawnergrenade/smartdisc/attackby(obj/item/I, mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(I, /obj/item/tool/yautja_cleaner))
if(handle_dissolve())
return
..()

/obj/item/explosive/grenade/spawnergrenade/smartdisc/attack_self(mob/user)
..()

Expand Down
16 changes: 9 additions & 7 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,16 @@
var/gear_on_almayer = 0
var/gear_low_orbit = 0
var/closest = 10000
var/obj/closest_item //The item itself, to be referenced so Yautja know what to look for.
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
var/direction = -1
var/atom/areaLoc = null
for(var/obj/item/I as anything in GLOB.loose_yautja_gear)
var/atom/loc = get_true_location(I)
if(I.anchored)
for(var/obj/item/tracked_item as anything in GLOB.loose_yautja_gear)
var/atom/loc = get_true_location(tracked_item)
if(tracked_item.anchored)
continue
if(is_honorable_carrier(recursive_holder_check(I)))
if(is_honorable_carrier(recursive_holder_check(tracked_item)))
continue
if(istype(get_area(I), /area/yautja))
if(istype(get_area(tracked_item), /area/yautja))
continue
if(is_reserved_level(loc.z))
gear_low_orbit++
Expand All @@ -445,6 +446,7 @@
var/dist = get_dist(M,loc)
if(dist < closest)
closest = dist
closest_item = tracked_item
direction = get_dir(M,loc)
areaLoc = loc
for(var/mob/living/carbon/human/Y as anything in GLOB.yautja_mob_list)
Expand Down Expand Up @@ -476,9 +478,9 @@
output = TRUE
var/areaName = get_area_name(areaLoc)
if(closest == 0)
to_chat(M, SPAN_NOTICE("You are directly on top of the closest signature."))
to_chat(M, SPAN_NOTICE("You are directly on top of the[closest_item ? " <b>[closest_item.name]</b>'s" : ""] signature."))
else
to_chat(M, SPAN_NOTICE("The closest signature is [closest > 10 ? "approximately <b>[round(closest, 10)]</b>" : "<b>[closest]</b>"] paces <b>[dir2text(direction)]</b> in <b>[areaName]</b>."))
to_chat(M, SPAN_NOTICE("The closest signature[closest_item ? ", a <b>[closest_item.name]</b>" : ""], is [closest > 10 ? "approximately <b>[round(closest, 10)]</b>" : "<b>[closest]</b>"] paces <b>[dir2text(direction)]</b> in <b>[areaName]</b>."))
if(!output)
to_chat(M, SPAN_NOTICE("There are no signatures that require your attention."))
return TRUE
Expand Down
26 changes: 24 additions & 2 deletions code/modules/cm_preds/yaut_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@
flags_cold_protection = flags_armor_protection
flags_heat_protection = flags_armor_protection

/obj/item/clothing/shoes/yautja/attackby(obj/item/I, mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(I, /obj/item/tool/yautja_cleaner))
if(handle_dissolve())
return
..()

/obj/item/clothing/shoes/yautja/hunter
name = "clan greaves"
desc = "A pair of armored, perfectly balanced boots. Perfect for running through the jungle."
Expand Down Expand Up @@ -327,6 +333,7 @@
unacidable = TRUE
ignore_z = TRUE
black_market_value = 100
flags_item = ITEM_PREDATOR

/obj/item/device/radio/headset/yautja/talk_into(mob/living/M as mob, message, channel, verb = "commands", datum/language/speaking)
if(!isyautja(M)) //Nope.
Expand All @@ -338,8 +345,11 @@
to_chat(hellhound, "\[Radio\]: [M.real_name] [verb], '<B>[message]</b>'.")
..()

/obj/item/device/radio/headset/yautja/attackby()
return
/obj/item/device/radio/headset/yautja/attackby(obj/item/I, mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(I, /obj/item/tool/yautja_cleaner))
if(handle_dissolve())
return
..()

/obj/item/device/radio/headset/yautja/elder //primarily for use in another MR
name = "\improper Elder Communicator"
Expand Down Expand Up @@ -697,6 +707,7 @@
var/tether_range = 5
var/mob/trapped_mob
layer = LOWER_ITEM_LAYER
flags_item = ITEM_PREDATOR

/obj/item/hunting_trap/Destroy()
cleanup_tether()
Expand Down Expand Up @@ -894,6 +905,17 @@
flags_item = ITEM_PREDATOR|DELONDROP|NODROP
paygrade = null

/obj/item/tool/yautja_cleaner
name = "cleanser gel vial"
desc = "Used for dissolving the gear of the fallen whilst in the field."
icon = 'icons/obj/items/hunter/pred_gear.dmi'
icon_state = "blue_gel"
force = 0
throwforce = 1
w_class = SIZE_SMALL
flags_item = ITEM_PREDATOR
black_market_value = 150

/obj/item/storage/medicomp
name = "medicomp"
desc = "A complex kit of alien tools and medicines."
Expand Down
41 changes: 39 additions & 2 deletions code/modules/cm_preds/yaut_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,12 @@
. = list()
. += SPAN_NOTICE("Looks like some kind of...mechanical donut.")

/obj/item/weapon/gun/launcher/spike/attackby(obj/item/I, mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(I, /obj/item/tool/yautja_cleaner))
if(handle_dissolve())
return
..()

/obj/item/weapon/gun/launcher/spike/update_icon()
..()
var/new_icon_state = spikes <=1 ? null : icon_state + "[round(spikes/4, 1)]"
Expand Down Expand Up @@ -821,6 +827,12 @@
WEAR_R_HAND = 'icons/mob/humans/onmob/hunter/items_righthand.dmi'
)

/obj/item/weapon/gun/energy/yautja/attackby(obj/item/I, mob/user)
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
if(istype(I, /obj/item/tool/yautja_cleaner))
if(handle_dissolve())
return
..()

/obj/item/weapon/gun/energy/yautja/plasmarifle
name = "plasma rifle"
desc = "A long-barreled heavy plasma weapon capable of taking down large game. It has a mounted scope for distant shots and an integrated battery."
Expand Down Expand Up @@ -925,6 +937,8 @@
muzzle_flash = null // TO DO, add a decent one.
w_class = SIZE_MEDIUM
var/charge_time = 40
var/shot_cost = 1
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
var/mode = "standard"
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
flags_gun_features = GUN_UNUSUAL_DESIGN
flags_item = ITEM_PREDATOR|IGNITING_ITEM|TWOHANDED

Expand Down Expand Up @@ -965,9 +979,14 @@
if(isyautja(user))
. = ..()
. += SPAN_NOTICE("It currently has <b>[charge_time]/40</b> charge.")

if(mode == "incendiary")
. += SPAN_RED("It is set to fire incendiary plasma bolts.")
else
. += SPAN_ORANGE("It is set to fire plasma bolts.")
else
. = list()
. += SPAN_NOTICE("This thing looks like an alien rifle of some kind. Strange.")
. += SPAN_NOTICE("This thing looks like an alien gun of some kind. Strange.")


/obj/item/weapon/gun/energy/yautja/plasmapistol/able_to_fire(mob/user)
Expand Down Expand Up @@ -995,9 +1014,27 @@

/obj/item/weapon/gun/energy/yautja/plasmapistol/delete_bullet(obj/item/projectile/projectile_to_fire, refund = 0)
qdel(projectile_to_fire)
if(refund) charge_time *= 2
if(refund)
charge_time *= 2
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
log_debug("Plasma Pistol refunded shot.")
return TRUE

/obj/item/weapon/gun/energy/yautja/plasmapistol/use_unique_action()
switch(mode)
if("standard")
mode = "incendiary"
shot_cost = 5
fire_delay = FIRE_DELAY_TIER_5
to_chat(usr, SPAN_NOTICE("[src] will now fire incendiary plasma bolts."))
ammo = GLOB.ammo_list[/datum/ammo/energy/yautja/pistol/incendiary]

if("incendiary")
mode = "standard"
shot_cost = 1
fire_delay = FIRE_DELAY_TIER_7
to_chat(usr, SPAN_NOTICE("[src] will now fire plasma bolts."))
ammo = GLOB.ammo_list[/datum/ammo/energy/yautja/pistol]

/obj/item/weapon/gun/energy/yautja/plasma_caster
name = "plasma caster"
desc = "A powerful, shoulder-mounted energy weapon."
Expand Down
Loading