Skip to content

Commit

Permalink
Merge pull request cmss13-devs#32 from chaos-creations/campaign
Browse files Browse the repository at this point in the history
Throw & Grab animation and sound
  • Loading branch information
VoiceInYourHead committed Aug 17, 2024
2 parents cefbf17 + 682e0b3 commit a5046ba
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@
S = pick('sound/items/cane_step_1.ogg', 'sound/items/cane_step_2.ogg', 'sound/items/cane_step_3.ogg', 'sound/items/cane_step_4.ogg', 'sound/items/cane_step_5.ogg', )
if("match")
S = pick('sound/effects/match.ogg')
if("throwing")
S = pick('sound/effects/throwing/swoosh1.ogg', 'sound/effects/throwing/swoosh2.ogg', 'sound/effects/throwing/swoosh3.ogg', 'sound/effects/throwing/swoosh4.ogg')
if("punch")
S = pick('sound/weapons/punch1.ogg','sound/weapons/punch2.ogg','sound/weapons/punch3.ogg','sound/weapons/punch4.ogg')
if("swing_hit")
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,17 @@
if(!do_after(src, 1 SECONDS, INTERRUPT_ALL, BUSY_ICON_HOSTILE))
to_chat(src, SPAN_WARNING("You need to set up the high toss!"))
return
animation_attack_on(target, 6)
//The volume of the sound takes the minimum between the distance thrown or the max range an item, but no more than 15. Short throws are quieter. Invisible mobs do no sound.
if(alpha >= 50)
playsound(src, "throwing", min(5*min(get_dist(loc,target),thrown_thing.throw_range), 15), vary = TRUE, sound_range = 6)
drop_inv_item_on_ground(I, TRUE)
thrown_thing.throw_atom(target, thrown_thing.throw_range, SPEED_SLOW, src, spin_throw, HIGH_LAUNCH)
else
animation_attack_on(target, 6)
//The volume of the sound takes the minimum between the distance thrown or the max range an item, but no more than 15. Short throws are quieter. Invisible mobs do no sound.
if(alpha >= 50)
playsound(src, "throwing", min(5*min(get_dist(loc,target),thrown_thing.throw_range), 15), vary = TRUE, sound_range = 6)
drop_inv_item_on_ground(I, TRUE)
thrown_thing.throw_atom(target, thrown_thing.throw_range, thrown_thing.throw_speed, src, spin_throw)

Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,13 @@
if(!M.can_be_pulled_by(src))
return
else if(istype(AM, /obj))
if(recently_grabbed > world.time)
return FALSE
recently_grabbed = world.time + 6
AM.add_fingerprint(src)
animation_attack_on(AM)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 25, 1, 7)
flick_attack_overlay(AM, "grab")

if(!QDELETED(AM.pulledby) && !QDELETED(M))
visible_message(SPAN_WARNING("[src] has broken [AM.pulledby]'s grip on [M]!"), null, null, 5)
Expand Down Expand Up @@ -595,6 +601,7 @@
msg_admin_attack("[key_name(src)] grabbed [key_name(M)] in [get_area(src)] ([src.loc.x],[src.loc.y],[src.loc.z]).", src.loc.x, src.loc.y, src.loc.z)

if(!no_msg)
animation_attack_on(M)
visible_message(SPAN_WARNING("[src] has grabbed [M] passively!"), null, null, 5)

if(M.mob_size > MOB_SIZE_HUMAN || !(M.status_flags & CANPUSH))
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@

var/recently_pointed_to = 0 //used as cooldown for the pointing verb.

var/recently_grabbed = 0 //used as a cooldown for item grabs

///Color matrices to be applied to the client window. Assoc. list.
var/list/client_color_matrices

Expand Down
Binary file added sound/effects/throwing/swoosh1.ogg
Binary file not shown.
Binary file added sound/effects/throwing/swoosh2.ogg
Binary file not shown.
Binary file added sound/effects/throwing/swoosh3.ogg
Binary file not shown.
Binary file added sound/effects/throwing/swoosh4.ogg
Binary file not shown.
4 changes: 4 additions & 0 deletions void-marines/code/admin_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

// Changing appear \\
var/new_skin_color = tgui_input_list(src, "Choose your character's skin color:", "Character Preferences", GLOB.skin_color_list)
if(new_skin_color)
M.skin_color = new_skin_color

var/new_facial = input(M, "Please select facial hair color.", "Character Generation") as color
if(new_facial)
M.r_facial = hex2num(copytext(new_facial, 2, 4))
Expand Down

0 comments on commit a5046ba

Please sign in to comment.