Skip to content
Open
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: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2179,6 +2179,7 @@
#include "code\modules\mob\living\carbon\human\human_defense.dm"
#include "code\modules\mob\living\carbon\human\human_defines.dm"
#include "code\modules\mob\living\carbon\human\human_helpers.dm"
#include "code\modules\mob\living\carbon\human\human_jump.dm"
#include "code\modules\mob\living\carbon\human\human_movement.dm"
#include "code\modules\mob\living\carbon\human\human_organs.dm"
#include "code\modules\mob\living\carbon\human\human_powers.dm"
Expand Down
1 change: 1 addition & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
// Movement flags. For fuck's sake, we were using "run"s and "walk"s till 2021
#define M_RUN "run"
#define M_WALK "walk"
#define HUMAN_POWER_JUMP "jump"

//These are used Bump() code for living mobs, in the mob_bump_flag, mob_swap_flags, and mob_push_flags vars to determine whom can bump/swap with whom.
#define HUMAN 1
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#define SFX_FEMALE_LAUGH "female_laugh"
#define SFX_FEMALE_YAWN "female_yawn"
#define SFX_FEMALE_SIGH "female_sigh"
#define SFX_FEMALE_JUMP "female_jump"

// MALE EMOTES
#define SFX_MALE_INTERNAL_BREATH "male_internal_breath"
Expand All @@ -106,6 +107,7 @@
#define SFX_MALE_LAUGH "male_laugh"
#define SFX_MALE_YAWN "male_yawn"
#define SFX_MALE_SIGH "male_sigh"
#define SFX_MALE_JUMP "male_jump"

// AMBIENT
#define SFX_AMBIENT_POWERED_GLOBAL "ambient_powered_global"
Expand Down
8 changes: 7 additions & 1 deletion code/_global_vars/sfx.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1856,5 +1856,11 @@ GLOBAL_LIST_INIT(sfx_list, list(
),
SFX_MINESWEEPER_WIN = list(
'sound/machines/arcade/minesweeper_win.ogg'
)
),
SFX_FEMALE_JUMP = list(
'sound/effects/emotes/f_jump.ogg'
),
SFX_MALE_JUMP = list(
'sound/effects/emotes/m_jump.ogg'
),
))
3 changes: 2 additions & 1 deletion code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@
#define ui_spell_master "EAST-1:16,NORTH-1:16"
#define ui_genetic_master "EAST-1:16,NORTH-3:16"

//Blocking and dashing
//Blocking, dashing and jumping
#define ui_block "EAST-4:24,SOUTH:5"
#define ui_blockswitch "EAST-4:24,SOUTH:5"
#define ui_jump "EAST-4:24,SOUTH+1:5"

// AI
#define ui_ai_core "SOUTH:6,WEST"
Expand Down
10 changes: 10 additions & 0 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@
mymob.block_icon.alpha = ui_alpha
static_inventory += mymob.block_icon

if(hud_data.has_jump)
mymob.jump_icon = new /atom/movable/screen()
mymob.jump_icon.icon = ui_style
mymob.jump_icon.icon_state = "act_jump0"
mymob.jump_icon.SetName("jump")
mymob.jump_icon.screen_loc = ui_jump
mymob.jump_icon.color = ui_color
mymob.jump_icon.alpha = ui_alpha
static_inventory += mymob.jump_icon

if(hud_data.has_blockswitch)
mymob.blockswitch_icon = new /atom/movable/screen()
mymob.blockswitch_icon.icon = ui_style
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@
var/mob/living/carbon/human/H = usr
H.blockswitch()

if("jump")
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.toggle_jump(HUMAN_POWER_JUMP)


if("module")
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
Expand Down
20 changes: 20 additions & 0 deletions code/modules/emotes/generic/audible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,23 @@
set name = "Whistle"
set category = "Emotes"
emote("whistle")

/datum/emote/jump
key = "jump"

message_1p = "You jump."
message_3p = "jumps."

message_type = AUDIBLE_MESSAGE

sound_human_female = SFX_FEMALE_JUMP
sound_human_male = SFX_MALE_JUMP

state_checks = EMOTE_CHECK_CONSCIOUS

statpanel_proc = /mob/proc/jump_emote

/mob/proc/jump_emote()
set name = "Jump"
set category = "Emotes"
emote("jump", intentional = TRUE)
19 changes: 0 additions & 19 deletions code/modules/emotes/generic/visual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,25 +337,6 @@
set category = "Emotes"
emote("roll", intentional = TRUE)


/datum/emote/jump
key = "jump"

message_1p = "You jump."
message_3p = "jumps!"

message_type = VISIBLE_MESSAGE

state_checks = EMOTE_CHECK_CONSCIOUS

statpanel_proc = /mob/proc/jump_emote

/mob/proc/jump_emote()
set name = "Jump"
set category = "Emotes"
emote("jump", intentional = TRUE)


/datum/emote/bow
key = "bow"

Expand Down
134 changes: 134 additions & 0 deletions code/modules/mob/living/carbon/human/human_jump.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#define NO_HURT_JUMP_PROB 15
#define LITE_HURT_PROB 60
#define KNOCK_DOWN_PROB 40
#define HURT_LEGS_PROB 1

#define LONG_JUMP_PROB 25
#define MAX_JUMP_LENGTH 3
#define DEFAULT_JUMP_LENGTH 2

#define SALTO_PROB 10


/mob/living/carbon/human/throw_impact(atom/hit_atom, speed, target_zone)
. = ..()
var/jump_in_spaceman = FALSE

if (hit_atom.density)
if (ishuman(hit_atom))
jump_in_spaceman = TRUE
var/mob/living/carbon/human/jump_target_human = hit_atom

playsound(src, SFX_FIGHTING_PUNCH, 25, 0, 1)
do_attack_animation(jump_target_human)

if (prob(KNOCK_DOWN_PROB))
jump_target_human.apply_damage(10, BRUTE)
jump_target_human.Weaken(2)
visible_message(SPAN_NOTICE("[src] was knokout [hit_atom.name] in jump!."))

else
jump_target_human.apply_damage(5, BRUTE)
jump_target_human.Stun(1)

if (prob(NO_HURT_JUMP_PROB) && jump_in_spaceman == FALSE)
to_chat(src, SPAN_WARNING("You jumped into [hit_atom.name]. It's lucky you weren't hurt."))
return

if (prob(LITE_HURT_PROB))
Stun(3)
adjustBruteLoss(10)
to_chat(src, SPAN_WARNING("You jumped into [hit_atom.name]. It must have hurt."))

else
Weaken(5)
adjustBruteLoss(20)
to_chat(src, SPAN_WARNING("Jumping into the [hit_atom.name] knocked the wind out of you"))

/mob/living/carbon/human/proc/toggle_jump()
if (!src || src.stat)
return

if (jump_icon?.icon_state == "act_jump0")
jump_icon?.icon_state = "act_jump1"
src.active_ability = HUMAN_POWER_JUMP
else
jump_icon?.icon_state = "act_jump0"
src.active_ability = HUMAN_POWER_NONE

/mob/living/carbon/human/proc/process_jump(atom/A)
if (QDELETED(A) || QDELETED(src) || A.z != z)
return

if (A == src || A == loc || lying || pulledby || LAZYLEN(grabbed_by))
to_chat(src, SPAN_WARNING("You can't jump right now"))
toggle_jump(HUMAN_POWER_JUMP)
return

if (buckled)
to_chat(src, SPAN_WARNING("You need to unbuckle first"))
toggle_jump(HUMAN_POWER_JUMP)
return

if (poise < (poise_pool / 2))
to_chat(src, SPAN_WARNING("Not enough balance!"))
toggle_jump(HUMAN_POWER_JUMP)
return

setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
face_atom(A)
var/jump_distance = MAX_JUMP_LENGTH
var/jump_turf = src.loc

for (var/i = 0, i < jump_distance, i++)
jump_turf = get_step(jump_turf, dir)

if (!jump_turf || jump_turf == loc)
return

playsound(src, src.gender == MALE ? SFX_MALE_JUMP : SFX_FEMALE_JUMP, 25, 0, 1)
visible_message(SPAN_NOTICE("[src] jumps to [A]."))
damage_poise(body_build.poise_pool / 2)
throw_spin = FALSE

if (prob(SALTO_PROB))
throw_spin = TRUE
visible_message(SPAN_NOTICE("[src] did a somersault!."))
else
throw_spin = FALSE

var/orig_flags = src.pass_flags
src.pass_flags |= PASS_FLAG_TABLE

src.pixel_y = 5

if (prob(LONG_JUMP_PROB))
throw_at(jump_turf, MAX_JUMP_LENGTH, 1.25, src)
Stun(1)
else
throw_at(jump_turf, DEFAULT_JUMP_LENGTH, 1.25, src)
Stun(1)

if (QDELETED(src))
return

if (prob(HURT_LEGS_PROB))
var/legs_to_hurt = pick(BP_L_FOOT, BP_R_FOOT)
src.apply_damage(45, PAIN, legs_to_hurt, 0)
src.apply_damage(10, BRUTE, legs_to_hurt, 0)
visible_message(SPAN_NOTICE("[src] jumped unsuccessfully and hurt foot!"))

spawn(2)
src.pass_flags = orig_flags
src.pixel_y = 0
throw_spin = TRUE
toggle_jump(HUMAN_POWER_JUMP)

#undef NO_HURT_JUMP_PROB
#undef LITE_HURT_PROB
#undef KNOCK_DOWN_PROB
#undef HURT_LEGS_PROB
#undef LONG_JUMP_PROB
#undef MAX_JUMP_LENGTH
#undef DEFAULT_JUMP_LENGTH
#undef SALTO_PROB
15 changes: 9 additions & 6 deletions code/modules/mob/living/carbon/human/human_powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
// species.dm's inherent_verbs ~ Z

/mob/living/carbon/human/proc/use_human_ability(atom/A)
if(!isliving(A))
if (!isliving(A) && active_ability != HUMAN_POWER_JUMP)
return FALSE
switch(active_ability)
if(HUMAN_POWER_NONE)

switch (active_ability)
if (HUMAN_POWER_NONE)
return FALSE
if(HUMAN_POWER_SPIT)
if (HUMAN_POWER_SPIT)
var/mob/living/M = A
process_spit(M)
if(HUMAN_POWER_LEAP)
if (HUMAN_POWER_LEAP)
var/mob/living/M = A
process_leap(M)
if(HUMAN_POWER_TACKLE)
if (HUMAN_POWER_TACKLE)
var/mob/living/M = A
process_tackle(M)
if (HUMAN_POWER_JUMP)
process_jump(A)
return TRUE

/mob/living/carbon/human/MiddleClickOn(atom/A)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var/has_internals = TRUE // Set to draw the internals toggle button.
var/has_rest = TRUE // Set to draw the rest button.
var/has_poise = TRUE // Set to draw the poise meter.
var/has_jump = TRUE
var/list/equip_slots = list() // Checked by mob_can_equip().

// Contains information on the position and tag for all inventory slots
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
var/atom/movable/screen/block_icon = null
var/atom/movable/screen/blockswitch_icon = null
var/atom/movable/screen/nutrition_icon = null
var/atom/movable/screen/jump_icon = null
var/atom/movable/screen/hydration_icon = null
var/atom/movable/screen/bladder_icon = null
var/atom/movable/screen/bowels_icon = null
Expand Down
Binary file modified icons/hud/style/goon.dmi
Binary file not shown.
Binary file modified icons/hud/style/midnight.dmi
Binary file not shown.
Binary file modified icons/hud/style/minimalist.dmi
Binary file not shown.
Binary file modified icons/hud/style/old-noborder.dmi
Binary file not shown.
Binary file modified icons/hud/style/old.dmi
Binary file not shown.
Binary file modified icons/hud/style/orange.dmi
Binary file not shown.
Binary file modified icons/hud/style/white.dmi
Binary file not shown.
Binary file added sound/effects/emotes/f_jump.ogg
Binary file not shown.
Binary file added sound/effects/emotes/m_jump.ogg
Binary file not shown.
Binary file added sound/effects/f_jump.ogg
Binary file not shown.
Binary file added sound/effects/m_jump.ogg
Binary file not shown.
Loading