Skip to content

Commit

Permalink
Fulton animation is no longer sideways and it does not sleep for 32 s…
Browse files Browse the repository at this point in the history
…econds before returning item_interaction results (tgstation#84487)

## About The Pull Request
Living being attached to fultons are now forced upright so that the
animation works properly, plus it looks like people are being attached
by their back. Adjusted the layers a bit for that, plus moved the
animation into a callback so it doesn't force item_interaction to wait
until it finishes.

## Why It's Good For The Game

Proper animation and code quality, I don't know what exactly a 32 second
delay could mess up but it doesn't seem very good.

## Changelog
:cl:
fix: Fulton animation is no longer sideways.
code: Fulton code no longer forces attack chain to wait for 32 seconds.
/:cl:
  • Loading branch information
SmArtKar authored Jul 1, 2024
1 parent 4bc04f0 commit e43f5f8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@
#define MOD_TRAIT "mod"
/// Trait applied to tram passengers
#define TRAM_PASSENGER_TRAIT "tram-passenger"
/// Trait given by a fulton extraction pack
#define FULTON_PACK_TRAIT "fulton-pack"

/// Trait granted by the berserker hood.
#define BERSERK_TRAIT "berserk_trait"
Expand Down
25 changes: 13 additions & 12 deletions code/modules/mining/fulton.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,10 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
if(uses_left <= 0)
user.transferItemToLoc(src, thing, TRUE)

var/mutable_appearance/balloon
var/mutable_appearance/balloon2
var/mutable_appearance/balloon3

if(isliving(thing))
var/mob/living/creature = thing
creature.Paralyze(32 SECONDS) // Keep them from moving during the duration of the extraction
ADD_TRAIT(creature, TRAIT_FORCED_STANDING, FULTON_PACK_TRAIT) // Prevents animation jank from happening
if(creature.buckled)
creature.buckled.unbuckle_mob(creature, TRUE) // Unbuckle them to prevent anchoring problems
else
Expand All @@ -113,14 +110,15 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
var/obj/effect/extraction_holder/holder_obj = new(get_turf(thing))
holder_obj.appearance = thing.appearance
thing.forceMove(holder_obj)
balloon2 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_expand")
var/mutable_appearance/balloon2 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_expand", layer = VEHICLE_LAYER)
balloon2.pixel_y = 10
balloon2.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
holder_obj.add_overlay(balloon2)
addtimer(CALLBACK(src, PROC_REF(create_balloon), thing, user, holder_obj, balloon2), 0.4 SECONDS)
return ITEM_INTERACT_SUCCESS

sleep(0.4 SECONDS)

balloon = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_balloon")
/obj/item/extraction_pack/proc/create_balloon(atom/movable/thing, mob/living/user, obj/effect/extraction_holder/holder_obj, mutable_appearance/balloon2)
var/mutable_appearance/balloon = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_balloon", layer = VEHICLE_LAYER)
balloon.pixel_y = 10
balloon.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
holder_obj.cut_overlay(balloon2)
Expand All @@ -132,6 +130,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
animate(pixel_z = -5, time = 1 SECONDS, flags = ANIMATION_RELATIVE)
animate(pixel_z = 5, time = 1 SECONDS, flags = ANIMATION_RELATIVE)
animate(pixel_z = -5, time = 1 SECONDS, flags = ANIMATION_RELATIVE)

sleep(6 SECONDS)

playsound(holder_obj.loc, 'sound/items/fultext_launch.ogg', vol = 50, vary = TRUE, extrarange = -3)
Expand All @@ -146,7 +145,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
sleep(3 SECONDS)

var/turf/flooring_near_beacon = list()
var/turf/beacon_turf = get_turf(beacon)
var/turf/beacon_turf = get_turf(beacon_ref.resolve())
for(var/turf/floor as anything in RANGE_TURFS(1, beacon_turf))
if(!floor.is_blocked_turf())
flooring_near_beacon += floor
Expand All @@ -159,26 +158,28 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
animate(holder_obj, pixel_z = -990, time = 5 SECONDS, flags = ANIMATION_RELATIVE)
animate(pixel_z = 5, time = 1 SECONDS, flags = ANIMATION_RELATIVE)
animate(pixel_z = -5, time = 1 SECONDS, flags = ANIMATION_RELATIVE)

sleep(7 SECONDS)

balloon3 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_retract")
var/mutable_appearance/balloon3 = mutable_appearance('icons/effects/fulton_balloon.dmi', "fulton_retract", layer = VEHICLE_LAYER)
balloon3.pixel_y = 10
balloon3.appearance_flags = RESET_COLOR | RESET_ALPHA | RESET_TRANSFORM
holder_obj.cut_overlay(balloon)
holder_obj.add_overlay(balloon3)

sleep(0.4 SECONDS)

holder_obj.cut_overlay(balloon3)
if (isliving(thing))
REMOVE_TRAIT(thing, TRAIT_FORCED_STANDING, FULTON_PACK_TRAIT)
thing.set_anchored(FALSE) // An item has to be unanchored to be extracted in the first place.
thing.set_density(initial(thing.density))
animate(holder_obj, pixel_z = -10, time = 0.5 SECONDS, flags = ANIMATION_RELATIVE)
sleep(0.5 SECONDS)

thing.forceMove(holder_obj.loc)
qdel(holder_obj)
if(uses_left <= 0)
qdel(src)
return ITEM_INTERACT_SUCCESS

/obj/item/fulton_core
name = "extraction beacon assembly kit"
Expand Down

0 comments on commit e43f5f8

Please sign in to comment.