Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander3359 committed Dec 15, 2023
2 parents b5407e3 + e3391ce commit 279fd9c
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 26 deletions.
58 changes: 35 additions & 23 deletions code/game/objects/structures/droppod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi
#define DROPPOD_TRANSIT_TIME 10 SECONDS
///radius of dispersion for leader pods
#define LEADER_POD_DISPERSION 5
///radius of dispersion for pods for randomisation or obstacle avoidance
#define DROPPOD_BASE_DISPERSION 1

///base marine drop pod. can be controlled by an attached [/obj/structure/droppod/leader] or [/obj/machinery/computer/droppod_control]
/obj/structure/droppod
Expand Down Expand Up @@ -210,13 +212,18 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi
if(drop_state != DROPPOD_READY)
return

var/turf/target = locate(target_x, target_y, target_z)
if(!commanded_drop) //we randomise the landing slightly, its already randomised for mass launch
target = find_new_target()
target_x = target.x
target_y = target.y

if(!checklanding(user))
return

for(var/mob/podder AS in buckled_mobs)
podder.forceMove(src)

var/turf/target = locate(target_x, target_y, target_z)
if(user)
log_game("[key_name(user)] launched pod [src] at [AREACOORD(target)]")
deadchat_broadcast(" has been launched", src, turf_target = target)
Expand All @@ -230,6 +237,22 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi
flick("[icon_state]_closing", src)
addtimer(CALLBACK(src, PROC_REF(launch_pod), user), 2.5 SECONDS)

///Find a new suitable target turf around the pods initial target
/obj/structure/droppod/proc/find_new_target(mob/user)
var/scatter_radius = DROPPOD_BASE_DISPERSION + GLOB.current_orbit
var/turf/T0 = locate(target_x + scatter_radius, target_y + scatter_radius, target_z)
var/turf/T1 = locate(target_x - scatter_radius, target_y - scatter_radius, target_z)
var/list/block = block(T0,T1)
shuffle_inplace(block)
for(var/turf/attemptdrop AS in block)
if(!checklanding(optional_turf = attemptdrop))
continue
return attemptdrop

if(user)
to_chat(user, span_warning("[icon2html(src, user)] RECALCULATION FAILED!"))
return locate(target_x, target_y, target_z) //no other alt spots found, we return our original target

///actually launches the pod
/obj/structure/droppod/proc/launch_pod(mob/user)
if(!launch_allowed)
Expand All @@ -244,33 +267,21 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi

playsound(src, 'sound/effects/escape_pod_launch.ogg', 70)
playsound(src, 'sound/effects/droppod_launch.ogg', 70)
addtimer(CALLBACK(src, PROC_REF(finish_drop), user), DROPPOD_TRANSIT_TIME)
addtimer(CALLBACK(src, PROC_REF(finish_drop), user), ROUND_UP(DROPPOD_TRANSIT_TIME * ((GLOB.current_orbit + 3) / 6)))
forceMove(pick(reserved_area.reserved_turfs))
new /area/arrival(loc) //adds a safezone so we dont suffocate on the way down, cleaned up with reserved turfs

/// Moves the droppod into its target turf, which it updates if needed
/obj/structure/droppod/proc/finish_drop(mob/user)
var/turf/targetturf = locate(target_x, target_y, target_z)
for(var/a in targetturf.contents)
var/atom/target = a
if(target.density) //if theres something dense in the turf try to recalculate a new turf
if(user)
to_chat(user, span_warning("[icon2html(src, user)] WARNING! TARGET ZONE OCCUPIED! EVADING!"))
balloon_alert(user, "EVADING")
var/turf/T0 = locate(target_x + 2,target_y + 2, target_z)
var/turf/T1 = locate(target_x - 2,target_y - 2, target_z)
var/list/block = block(T0,T1) - targetturf
for(var/t in block)//Randomly selects a free turf in a 5x5 block around the target
var/turf/attemptdrop = t
if(!attemptdrop.density && !is_type_in_typecache(attemptdrop, GLOB.blocked_droppod_tiles))
targetturf = attemptdrop
break
if(targetturf.density)//We tried and failed, revert to the old one, which has a new dense obj but is at least not dense
if(user)
to_chat(user, span_warning("[icon2html(src, user)] RECALCULATION FAILED!"))
targetturf = locate(target_x, target_y, target_z)
break

for(var/atom/target AS in targetturf.contents)
if(!target.density)
continue
if(user)
to_chat(user, span_warning("[icon2html(src, user)] WARNING! TARGET ZONE OCCUPIED! EVADING!"))
balloon_alert(user, "EVADING")
targetturf = find_new_target(user)
break
forceMove(targetturf)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_DROPPOD_LANDED, targetturf)
pixel_y = 500
Expand Down Expand Up @@ -320,7 +331,8 @@ GLOBAL_LIST_INIT(blocked_droppod_tiles, typecacheof(list(/turf/open/space/transi
for(var/obj/structure/droppod/pod AS in GLOB.droppod_list)
if(LAZYLEN(pod.buckled_mobs) || LAZYLEN(pod.contents))
occupied_pods++
var/dispersion = max(LEADER_POD_DISPERSION, LEADER_POD_DISPERSION + ((occupied_pods - 10) / 5))
var/dispersion = LEADER_POD_DISPERSION + GLOB.current_orbit
dispersion = max(dispersion, dispersion + ((occupied_pods - 10) / 5))
var/turf/topright = locate(new_x + dispersion, new_y + dispersion, target_z)
var/turf/bottomleft = locate(new_x - dispersion, new_y - dispersion, target_z)
var/list/block = block(bottomleft, topright) - locate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,10 @@ GLOBAL_LIST_INIT(wraith_banish_very_short_duration_list, typecacheof(list(
var/target_initial_brute_damage = 0
/// Initial sunder of the target
var/target_initial_sunder = 0
/// Initial fire stacks of the target
var/target_initial_fire_stacks = 0
/// Initial on_fire value
var/target_initial_on_fire = FALSE
/// How far can you rewind someone
var/range = 5

Expand Down Expand Up @@ -700,6 +704,8 @@ GLOBAL_LIST_INIT(wraith_banish_very_short_duration_list, typecacheof(list(
last_target_locs_list = list(get_turf(A))
target_initial_brute_damage = targeted.getBruteLoss()
target_initial_burn_damage = targeted.getFireLoss()
target_initial_fire_stacks = targeted.fire_stacks
target_initial_on_fire = targeted.on_fire
if(isxeno(A))
var/mob/living/carbon/xenomorph/xeno_target = targeted
target_initial_sunder = xeno_target.sunder
Expand Down Expand Up @@ -742,7 +748,12 @@ GLOBAL_LIST_INIT(wraith_banish_very_short_duration_list, typecacheof(list(
targeted.status_flags &= ~(INCORPOREAL|GODMODE)
REMOVE_TRAIT(owner, TRAIT_IMMOBILE, TIMESHIFT_TRAIT)
targeted.heal_overall_damage(targeted.getBruteLoss() - target_initial_brute_damage, targeted.getFireLoss() - target_initial_burn_damage, updating_health = TRUE)
if(isxeno(target))
if(target_initial_on_fire && target_initial_fire_stacks >= 0)
targeted.fire_stacks = target_initial_fire_stacks
targeted.IgniteMob()
else
targeted.ExtinguishMob()
if(isxeno(targeted))
var/mob/living/carbon/xenomorph/xeno_target = targeted
xeno_target.sunder = target_initial_sunder
targeted.remove_filter("rewind_blur")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@
unload_sound = 'sound/weapons/guns/interact/t21_unload.ogg'
reload_sound = 'sound/weapons/guns/interact/t21_reload.ogg'
caliber = CALIBER_10X25_CASELESS //codex
max_shells = 30 //codex
max_shells = 40 //codex
force = 20
default_ammo_type = /obj/item/ammo_magazine/rifle/standard_skirmishrifle
allowed_ammo_types = list(/obj/item/ammo_magazine/rifle/standard_skirmishrifle)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/magazines/rifles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
icon_state = "t21"
icon_state_mini = "mag_rifle"
default_ammo = /datum/ammo/bullet/rifle/heavy
max_rounds = 30
max_rounds = 40

//ALF-51B

Expand Down
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-pr-14630.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: "Pariah919"
delete-after: True
changes:
- balance: "Skirmish Rifle has been buffed to 40 magazine capacity instead of 30."
10 changes: 10 additions & 0 deletions html/changelogs/archive/2023-12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,13 @@
- rscadd: Sectoids have been reported displaying powerful new psionic abilities
in this sector
- balance: Sectoid base hp reduced to 80
2023-12-14:
Lumipharon:
- balance: Drop pod drop time varies with orbit level
- balance: Drop pod landing location now scatters slightly, based on orbit level
- balance: Mass launch for drop pods has a slightly wider radius, based on orbit
level
2023-12-15:
Helg2:
- rscadd: Time Shift now rewinds fire stacks.
- bugfix: Wraith's Time Shift now properly rewinds sander.

0 comments on commit 279fd9c

Please sign in to comment.