Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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 MMB_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-5:24,SOUTH: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.mmb_switch(MMB_JUMP)


if("module")
if(isrobot(usr))
var/mob/living/silicon/robot/R = usr
Expand Down
13 changes: 13 additions & 0 deletions code/modules/emotes/generic/audible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,16 @@
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
127 changes: 127 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,127 @@
#define NO_HURT_JUMP_PROB 15
#define LITE_HURT_PROB 70
#define KNOCK_DOWN_PROB 35

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

#define SALTO_PROB 10

/mob/living/carbon/human/MiddleClickOn(atom/A)
. = ..()
switch (mmb_intents)
if (MMB_JUMP)
INVOKE_ASYNC(src, nameof(.proc/jump), A)
swap_hand() //A crutch solution so that hands don't change during a jump

/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(JUMP_KNOCKOUT_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))
Weaken(5)
adjustBruteLoss(20)
to_chat(src, SPAN_WARNING("Jumping into the [hit_atom.name] knocked the wind out of you"))

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

/mob/living/carbon/human/proc/mmb_switch(intent)
if (mmb_intents == intent)
mmb_intents = null
else
mmb_intents = intent

switch(intent)
if (MMB_JUMP)
if (jump_icon?.icon_state == "act_jump0")
jump_icon?.icon_state = "act_jump1"
else
jump_icon?.icon_state = "act_jump0"

/mob/living/carbon/human/proc/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'jump right now"))
mmb_switch(MMB_JUMP)
return

if (buckled)
to_chat(src, SPAN_WARNING("You need unbucked first"))
mmb_switch(MMB_JUMP)
return

if (poise < (poise_pool / 2))
to_chat(src, SPAN_WARNING("Not enough balance!"))
mmb_switch(MMB_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 ? 'sound/effects/m_jump.ogg' : 'sound/effects/f_jump.ogg', 25, 0, 1)
visible_message(SPAN_NOTICE("[src] jump 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

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

else
throw_at(jump_turf, DEFAULT_JUMP_LENGTH, 1, src)
Stun(1)

throw_spin = TRUE
mmb_switch(MMB_JUMP)

#undef NO_HURT_JUMP_PROB
#undef LITE_HURT_PROB
#undef KNOCK_DOWN_PROB
#undef LONG_JUMP_PROB
#undef MAX_JUMP_LENGTH
#undef DEFAULT_JUMP_LENGTH
#undef JUMP_KNOCKOUT_PROB
#undef SALTO_PROB
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
2 changes: 2 additions & 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 Expand Up @@ -132,6 +133,7 @@
var/a_intent = I_HELP//Living
var/m_intent = M_RUN//Living
var/obj/buckled = null//Living
var/mmb_intents = null
var/obj/item/l_hand = null//Living
var/obj/item/r_hand = null//Living
var/obj/item/back = null//Human/Monkey
Expand Down
2 changes: 1 addition & 1 deletion config/default/admin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ debug_paranoid = false
delist_when_no_admins = false

# Give all the rights for the localhost player.
promote_localhost = false
promote_localhost = true
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