Skip to content

Commit

Permalink
Merge pull request #10 from Helg2/space
Browse files Browse the repository at this point in the history
Space transit tiles now send atoms flying to the ground.
  • Loading branch information
Tatarla authored Jul 14, 2024
2 parents c0bd4fa + d351551 commit 89c49c9
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 155 deletions.
48 changes: 26 additions & 22 deletions code/game/objects/items/explosives/bombvest.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,31 @@
TIMER_COOLDOWN_START(src, COOLDOWN_BOMBVEST_SHIELD_DROP, 5 SECONDS)

///Overwrites the parent function for activating a light. Instead it now detonates the bomb.
/obj/item/clothing/suit/storage/marine/boomvest/attack_self(mob/user)
var/mob/living/carbon/human/activator = user
/obj/item/clothing/suit/storage/marine/boomvest/attack_self(mob/living/carbon/human/activator)
if(issynth(activator) && !CONFIG_GET(flag/allow_synthetic_gun_use))
balloon_alert(user, "Can't wear this")
balloon_alert(activator, "Can't wear this")
return TRUE
if(user.alpha != 255)
balloon_alert(user, "Can't, your cloak prevents you")
if(activator.alpha != 255)
balloon_alert(activator, "Can't, your cloak prevents you")
return TRUE
if(activator.wear_suit != src)
balloon_alert(user, "Can only be detonated while worn")
balloon_alert(activator, "Can only be detonated while worn")
return FALSE
if(istype(activator.l_hand, /obj/item/weapon/shield/riot) || istype(activator.r_hand, /obj/item/weapon/shield/riot) || istype(activator.back, /obj/item/weapon/shield/riot))
balloon_alert(user, "Can't, your shield prevents you")
balloon_alert(activator, "Can't, your shield prevents you")
return FALSE
if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_BOMBVEST_SHIELD_DROP))
balloon_alert(user, "Can't, dropped shield too recently")
balloon_alert(activator, "Can't, dropped shield too recently")
return FALSE
if(LAZYACCESS(user.do_actions, src))
if(LAZYACCESS(activator.do_actions, src))
return
if(bomb_message)
activator.say("[bomb_message]!!")
if(!do_after(user, 0.5 SECONDS, IGNORE_USER_LOC_CHANGE, src, BUSY_ICON_DANGER))
if(!do_after(activator, 0.5 SECONDS, IGNORE_USER_LOC_CHANGE, src, BUSY_ICON_DANGER))
return FALSE
boom(activator)

/obj/item/clothing/suit/storage/marine/boomvest/proc/boom(mob/living/carbon/human/activator)
var/turf/target = get_turf(loc)
if(bomb_message) //Checks for a non null bomb message.
message_admins("[activator] has detonated an explosive vest with the warcry \"[bomb_message]\" at [ADMIN_VERBOSEJMP(target)]") //Incase disputes show up about marines killing themselves and others.
Expand All @@ -57,9 +59,11 @@
message_admins("[activator] has detonated an explosive vest with no warcry at [ADMIN_VERBOSEJMP(target)]")
log_game("[activator] has detonated an explosive vest with no warcry at [AREACOORD(target)]")

activator.record_tactical_unalive()
explosion(target, 2, 2, 6, 7, 5, 5)
cell_explosion(target, 275, 65)
flame_radius(5, target)

activator.ex_act(500)
activator.record_tactical_unalive()
qdel(src)

/obj/item/clothing/suit/storage/marine/boomvest/attack_hand_alternate(mob/living/user)
Expand Down Expand Up @@ -89,23 +93,23 @@
name = "orbital bombardment vest"
desc = "This is your lieutenant speaking, I know exactly what those coordinates are for."

/obj/item/clothing/suit/storage/marine/boomvest/ob_vest/attack_self(mob/user)
var/mob/living/carbon/human/activator = user
/obj/item/clothing/suit/storage/marine/boomvest/ob_vest/attack_self(mob/living/carbon/human/activator)
if(activator.wear_suit != src)
balloon_alert(user, "Can only be detonated while worn")
balloon_alert(activator, "Can only be detonated while worn")
return FALSE
if(LAZYACCESS(user.do_actions, src))
if(LAZYACCESS(activator.do_actions, src))
return
if(!do_after(user, 1 SECONDS, IGNORE_USER_LOC_CHANGE, src, BUSY_ICON_DANGER))
if(!do_after(activator, 1 SECONDS, IGNORE_USER_LOC_CHANGE, src, BUSY_ICON_DANGER))
return FALSE
boom(activator)

/obj/item/clothing/suit/storage/marine/boomvest/ob_vest/boom(mob/living/carbon/human/activator)
var/turf/target = get_turf(loc)
activator.say("I'M FIRING IT AS AN OB!!")
message_admins("[activator] has detonated an Orbital Bombardment vest at [ADMIN_VERBOSEJMP(target)]")
log_game("[activator] has detonated an Orbital Bombardment vest at [AREACOORD(target)]")

for(var/datum/limb/appendage AS in activator.limbs) //Oops we blew all our limbs off
if(istype(appendage, /datum/limb/chest) || istype(appendage, /datum/limb/groin) || istype(appendage, /datum/limb/head))
continue
appendage.droplimb()
explosion(target, 15, 0, 0, 0, 15, 15)
activator.ex_act(1500)
cell_explosion(target, 750, 50)
flame_radius(15, target)
qdel(src)
6 changes: 2 additions & 4 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ A good representation is: 'byond applies a volume reduction to the sound every X
S = pick('sound/effects/rustle1.ogg','sound/effects/rustle2.ogg','sound/effects/rustle3.ogg','sound/effects/rustle4.ogg','sound/effects/rustle5.ogg')
if("punch")
S = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
if("bone_break")
S = pick('sound/effects/bone_break1.ogg','sound/effects/bone_break2.ogg','sound/effects/bone_break3.ogg','sound/effects/bone_break4.ogg','sound/effects/bone_break5.ogg','sound/effects/bone_break6.ogg','sound/effects/bone_break7.ogg')
if("clownstep")
S = pick('sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')
if("swing_hit")
Expand Down Expand Up @@ -279,12 +281,10 @@ A good representation is: 'byond applies a volume reduction to the sound every X
S = pick('sound/effects/alien_resin_move1.ogg','sound/effects/alien_resin_move2.ogg')
if("alien_talk")
S = pick('sound/voice/alien_talk.ogg','sound/voice/alien_talk2.ogg','sound/voice/alien_talk3.ogg')
//RUTGMC edit start - custom talk sounds
if("larva_talk")
S = pick('sound/voice/larva_talk1.ogg','sound/voice/larva_talk2.ogg','sound/voice/larva_talk3.ogg', 'sound/voice/larva_talk4.ogg')
if("predalien_talk")
S = pick('sound/voice/predalien_click1.ogg','sound/voice/predalien_click2.ogg','sound/voice/predalien_click3.ogg')
//RUTGMC edit end
if("alien_growl")
S = pick('sound/voice/alien_growl1.ogg','sound/voice/alien_growl2.ogg','sound/voice/alien_growl3.ogg','sound/voice/alien_growl4.ogg')
if("alien_hiss")
Expand Down Expand Up @@ -358,7 +358,6 @@ A good representation is: 'byond applies a volume reduction to the sound every X
if("robot_warcry")
S = pick('sound/voice/robot/robot_warcry1.ogg', 'sound/voice/robot/robot_warcry2.ogg', 'sound/voice/robot/robot_warcry3.ogg')

//RUTGMC EDIT
//yautja race
if("pred_scream")
S = pick('sound/voice/pred_roar1.ogg','sound/voice/pred_roar2.ogg','sound/voice/pred_roar3.ogg','sound/voice/pred_roar4.ogg','sound/voice/pred_roar5.ogg')
Expand All @@ -376,5 +375,4 @@ A good representation is: 'byond applies a volume reduction to the sound every X
S = pick('sound/weapons/clan_sword_hit_1.ogg', 'sound/weapons/clan_sword_hit_2.ogg')
if("chain_swing")
S = pick('sound/items/chain_swing1.ogg', 'sound/items/chain_swing2.ogg', 'sound/items/chain_swing3.ogg')
//RUTGMC EDIT
return S
6 changes: 5 additions & 1 deletion code/game/turfs/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,15 @@
S.build(src)
S.use(1)


/turf/open/space/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
. = ..()
if(isliving(arrived))
var/mob/living/spaceman = arrived
if(isxenohivemind(spaceman))
var/mob/living/carbon/xenomorph/hivemind/hivemind = spaceman
to_chat(hivemind, span_xenonotice("We returned to our core to avoid damaging ourselves."))
hivemind.return_to_core()
return
if(!spaceman.has_status_effect(debuff_type))
spaceman.apply_status_effect(debuff_type)

Expand Down
146 changes: 101 additions & 45 deletions code/game/turfs/space/transit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
/turf/open/space/transit/attackby(obj/item/I, mob/user, params)
return

///turf/open/space/transit/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
// . = ..()
// underlay_appearance.icon_state = "speedspace_ns_[get_transit_state(asking_turf)]"
// underlay_appearance.transform = turn(matrix(), get_transit_angle(asking_turf))

/turf/open/space/transit/south
dir = SOUTH

Expand All @@ -34,55 +29,116 @@
/turf/open/space/transit/east
dir = EAST

/turf/open/space/transit/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs)
..()
if(!locate(/obj/structure/lattice) in src) //todo wtf is this even
throw_atom(arrived)
/turf/open/space/transit/Entered(atom/movable/crosser, atom/old_loc, list/atom/old_locs)
. = ..()

/turf/open/space/transit/proc/throw_atom(atom/movable/AM)
set waitfor = FALSE
if(QDELETED(AM) || istype(AM, /obj/docking_port))
if(isobserver(crosser) || crosser.anchored || isxenohivemind(crosser))
return
if(AM.loc != src) // Multi-tile objects are "in" multiple locs but its loc is it's true placement.
return // Don't move multi tile objects if their origin isnt in transit
var/max = world.maxx-TRANSITIONEDGE
var/min = 1+TRANSITIONEDGE

var/list/possible_transtitons = list()
for(var/A in SSmapping.z_list)
var/datum/space_level/D = A
if (D.linkage == CROSSLINKED)
possible_transtitons += D.z_value
if(!length(possible_transtitons))

if(!isobj(crosser) && !isliving(crosser))
return

if(!isspaceturf(old_loc))
var/turf/projected = get_ranged_target_turf(crosser.loc, dir, 10)
INVOKE_ASYNC(crosser, TYPE_PROC_REF(/atom/movable, throw_at), projected, 50, 2, null, TRUE, targetted_throw = TRUE)
addtimer(CALLBACK(src, PROC_REF(handle_crosser), crosser), 0.5 SECONDS)

/turf/open/space/transit/proc/handle_crosser(atom/movable/crosser)
if(QDELETED(crosser))
return
var/_z = pick(possible_transtitons)

//now select coordinates for a border turf
var/_x
var/_y
switch(dir)
if(SOUTH)
_x = rand(min,max)
_y = max
if(WEST)
_x = max
_y = rand(min,max)
if(EAST)
_x = min
_y = rand(min,max)
else
_x = rand(min,max)
_y = min

var/turf/T = locate(_x, _y, _z)
AM.forceMove(T)
// you just jumped out of a dropship, have fun living on the way down!
var/list/ground_z_levels = SSmapping.levels_by_trait(ZTRAIT_GROUND)
if(!length(ground_z_levels))
return qdel(crosser)

//find a random spot to drop them
var/list/area/potential_areas = shuffle(SSmapping.areas_in_z["[ground_z_levels[1]]"])
for(var/area/potential_area in potential_areas)
if(potential_area.flags_area & NO_DROPPOD || !potential_area.outside) // no dropping inside the caves and etc.
continue
if(isspacearea(potential_area)) // make sure its not space, just in case
continue

var/turf/open/possible_turf
var/list/area_turfs = get_area_turfs(potential_area)
for(var/i in 1 to 10)
possible_turf = pick_n_take(area_turfs)
// we're looking for an open, non-dense, and non-space turf.
if(!istype(possible_turf) || is_blocked_turf(possible_turf) || isspaceturf(possible_turf))
continue

if(!istype(possible_turf) || is_blocked_turf(possible_turf) || isspaceturf(possible_turf))
continue // couldnt find one in 10 loops, check another area

// we found a good turf, lets drop em
crosser.handle_airdrop(possible_turf)
return
return qdel(crosser)

/atom/movable/proc/handle_airdrop(turf/target_turf)
pixel_z = 360
forceMove(target_turf)
if(isliving(src))
var/mob/living/mob = src
mob.Knockdown(0.6 SECONDS) // so the falling mobs are horizontal for the animation
animation_spin(0.5 SECONDS, 1, dir == WEST ? FALSE : TRUE)
animate(src, 0.6 SECONDS, pixel_z = 0, flags = ANIMATION_PARALLEL)
target_turf.ceiling_debris(2 SECONDS)
sleep(0.6 SECONDS) // so we do stuff like dealing damage and deconstructing only after the animation end

/obj/handle_airdrop(turf/target)
. = ..()
if(!CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE) && prob(30)) // throwing objects from the air is not always a good idea
visible_message(span_danger("[src] falls out of the sky and mangles into the uselessness by the impact!"))
playsound(src, 'sound/effects/metal_crash.ogg', 35, 1)
deconstruct(FALSE)

/obj/structure/closet/handle_airdrop(turf/target_turf) // good idea but no
if(!opened)
break_open()
for(var/atom/movable/content in src)
content.handle_airdrop(target_turf)
..()

/obj/item/handle_airdrop(turf/target_turf)
. = ..()
if(QDELETED(src))
return
if(!CHECK_BITFIELD(resistance_flags, INDESTRUCTIBLE) && w_class < WEIGHT_CLASS_NORMAL) //tiny and small items will be lost, good riddance
visible_message(span_danger("[src] falls out of the sky and mangles into the uselessness by the impact!"))
playsound(src, 'sound/effects/metal_crash.ogg', 35, 1)
deconstruct(FALSE)
return
if(locate(/mob/living) in target_turf)
var/mob/living/victim = locate(/mob/living) in target_turf
throw_impact(victim, 20)
return
explosion_throw(200) // give it a bit of a kick
playsound(loc, 'sound/weapons/smash.ogg', 35, 1)

/mob/living/handle_airdrop(turf/target_turf)
. = ..()
remove_status_effect(/datum/status_effect/spacefreeze)
playsound(target_turf, pick('sound/effects/bang.ogg', 'sound/effects/meteorimpact.ogg'), 75, TRUE)
playsound(target_turf, "bone_break", 75, TRUE)

Knockdown(10 SECONDS)
Stun(3 SECONDS)
take_overall_damage(300, BRUTE, BOMB, updating_health = TRUE)
take_overall_damage(300, BRUTE, MELEE, updating_health = TRUE)
spawn_gibs()
visible_message(span_warning("[src] falls out of the sky."), span_highdanger("As you fall out of the sky, you plummet towards the ground."))

/mob/living/carbon/human/handle_airdrop(turf/target_turf)
. = ..()
if(istype(wear_suit, /obj/item/clothing/suit/storage/marine/boomvest))
var/obj/item/clothing/suit/storage/marine/boomvest/vest = wear_suit
vest.boom(usr)

/turf/open/space/transit/Initialize(mapload)
. = ..()
update_icon()
for(var/atom/movable/AM in src)
throw_atom(AM)

/turf/open/space/transit/update_icon()
. = ..()
Expand Down
Loading

0 comments on commit 89c49c9

Please sign in to comment.