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 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
1 change: 0 additions & 1 deletion code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
#define NOTABLEMERGE (1<<13)
/// Has heat source but isn't 'on fire' and thus can be stored
#define IGNITING_ITEM (1<<14)

//==========================================================================================


Expand Down
86 changes: 62 additions & 24 deletions code/game/objects/items/explosives/plastic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,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 @@ -312,13 +295,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 @@ -342,3 +318,65 @@
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 [name] on [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 [src]."))
return FALSE

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

if(istype(target, /turf/closed/wall))
var/turf/closed/wall/targeted_wall = target
if(targeted_wall.hull)
to_chat(user, SPAN_WARNING("You are unable to stick [src] to [targeted_wall]!"))
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)
addtimer(CALLBACK(src, PROC_REF(trigger_explosion), target_turf, dir, cause_data), 1)

/obj/item/explosive/plastic/breaching_charge/proc/trigger_explosion(turf/target_turf, dir, cause_data)
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
. = ..()

/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)
addtimer(CALLBACK(src, PROC_REF(trigger_explosion), target_turf, dir, cause_data), 1)

/obj/item/explosive/plastic/breaching_charge/plasma/trigger_explosion(turf/target_turf, dir, cause_data)
cell_explosion(target_turf, 90, 90, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL, dir, cause_data)
qdel(src)
17 changes: 10 additions & 7 deletions code/modules/cm_preds/yaut_bracers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,17 @@
var/gear_on_almayer = 0
var/gear_low_orbit = 0
var/closest = 10000
/// The item itself, to be referenced so Yautja know what to look for.
var/obj/closest_item
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 @@ -441,6 +443,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 @@ -472,9 +475,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
5 changes: 2 additions & 3 deletions code/modules/cm_preds/yaut_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,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,9 +339,6 @@
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/elder //primarily for use in another MR
name = "\improper Elder Communicator"
volume_settings = list(RADIO_VOLUME_QUIET_STR, RADIO_VOLUME_RAISED_STR, RADIO_VOLUME_IMPORTANT_STR, RADIO_VOLUME_CRITICAL_STR)
Expand Down Expand Up @@ -697,6 +695,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
2 changes: 1 addition & 1 deletion code/modules/cm_preds/yaut_machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
icon_state = "globe"
breakable = FALSE

minimap_type = MINIMAP_FLAG_XENO|MINIMAP_FLAG_USCM
minimap_type = MINIMAP_FLAG_ALL

/obj/structure/machinery/autolathe/yautja
name = "yautja autolathe"
Expand Down
6 changes: 3 additions & 3 deletions code/modules/cm_preds/yaut_shield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
M.apply_effect(3, DAZE)
M.apply_effect(5, SLOW)

/obj/item/weapon/shield/riot/yautja/attackby(obj/item/I, mob/user)
/obj/item/weapon/shield/riot/yautja/attackby(obj/item/attacking_item, mob/user)
if(cooldown < world.time - 25)
if(istype(I, /obj/item/weapon) && (I.flags_item & ITEM_PREDATOR))
user.visible_message(SPAN_WARNING("[user] bashes \the [src] with \the [I]!"))
if(istype(attacking_item, /obj/item/weapon) && (attacking_item.flags_item & ITEM_PREDATOR))
user.visible_message(SPAN_WARNING("[user] bashes [src] with [attacking_item]!"))
playsound(user.loc, 'sound/effects/shieldbash.ogg', 25, 1)
cooldown = world.time
else
Expand Down
41 changes: 37 additions & 4 deletions code/modules/cm_preds/yaut_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
/obj/item/weapon/gun/energy/yautja/plasmarifle/load_into_chamber()
if(charge_time >= 80)
ammo = GLOB.ammo_list[/datum/ammo/energy/yautja/rifle/blast]
charge_time = 0
charge_time -= 80
else
ammo = GLOB.ammo_list[/datum/ammo/energy/yautja/rifle/bolt]
charge_time -= 10
Expand All @@ -912,6 +912,8 @@
if(refund) charge_time *= 2
return TRUE

#define FIRE_MODE_STANDARD "Standard"
#define FIRE_MODE_INCENDIARY "Incendiary"
/obj/item/weapon/gun/energy/yautja/plasmapistol
name = "plasma pistol"
desc = "A plasma pistol capable of rapid fire. It has an integrated battery. Can be used to set fires, either to braziers or on people."
Expand All @@ -924,7 +926,12 @@
ammo = /datum/ammo/energy/yautja/pistol
muzzle_flash = null // TO DO, add a decent one.
w_class = SIZE_MEDIUM
/// Max amount of shots
var/charge_time = 40
/// Amount of charge_time drained per shot
var/shot_cost = 1
realforest2001 marked this conversation as resolved.
Show resolved Hide resolved
/// standard (sc = 1) or incendiary (sc = 5)
var/mode = FIRE_MODE_STANDARD
flags_gun_features = GUN_UNUSUAL_DESIGN
flags_item = ITEM_PREDATOR|IGNITING_ITEM|TWOHANDED

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

if(mode == FIRE_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 All @@ -983,7 +995,7 @@
var/obj/item/projectile/projectile = create_bullet(ammo, initial(name))
projectile.SetLuminosity(1)
in_chamber = projectile
charge_time--
charge_time -= shot_cost
return in_chamber

/obj/item/weapon/gun/energy/yautja/plasmapistol/has_ammunition()
Expand All @@ -995,9 +1007,30 @@

/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 += shot_cost
log_debug("Plasma Pistol refunded shot.")
return TRUE

/obj/item/weapon/gun/energy/yautja/plasmapistol/use_unique_action()
switch(mode)
if(FIRE_MODE_STANDARD)
mode = FIRE_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(FIRE_MODE_INCENDIARY)
mode = FIRE_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]

#undef FIRE_MODE_STANDARD
#undef FIRE_MODE_INCENDIARY

/obj/item/weapon/gun/energy/yautja/plasma_caster
name = "plasma caster"
desc = "A powerful, shoulder-mounted energy weapon."
Expand Down
17 changes: 16 additions & 1 deletion code/modules/projectiles/ammo_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2217,12 +2217,27 @@
damage = 40
shell_speed = AMMO_SPEED_TIER_2

/datum/ammo/energy/yautja/pistol/set_bullet_traits()
/datum/ammo/energy/yautja/pistol/incendiary
damage = 10

/datum/ammo/energy/yautja/pistol/incendiary/set_bullet_traits()
. = ..()
LAZYADD(traits_to_give, list(
BULLET_TRAIT_ENTRY(/datum/element/bullet_trait_incendiary)
))

/datum/ammo/bullet/shrapnel/plasma
name = "plasma wave"
shrapnel_chance = 0
penetration = ARMOR_PENETRATION_TIER_10
accuracy = HIT_ACCURACY_TIER_MAX
damage = 15
icon_state = "shrapnel_plasma"
damage_type = BURN

/datum/ammo/bullet/shrapnel/plasma/on_hit_mob(mob/hit_mob, obj/item/projectile/hit_projectile)
hit_mob.apply_effect(2, WEAKEN)

/datum/ammo/energy/yautja/caster
name = "root caster bolt"
icon_state = "ion"
Expand Down
Binary file modified icons/obj/items/assemblies.dmi
Binary file not shown.