Skip to content

Commit

Permalink
Merge pull request #537 from dwasint/minecraft-nether-update-REAL
Browse files Browse the repository at this point in the history
Minecraft nether update real
  • Loading branch information
dwasint authored Nov 24, 2023
2 parents 81cb095 + 5820004 commit cea1863
Show file tree
Hide file tree
Showing 60 changed files with 1,180 additions and 45 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define CHANNEL_MOB_SOUNDS 1009
#define CHANNEL_Z 1008
#define CHANNEL_WALKMAN 1007 //monkestation edit
#define CHANNEL_MASTER_VOLUME 1006

///Default range of a sound.
#define SOUND_RANGE 17
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/status_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#define IGNORE_STASIS (1<<1)
/// If the incapacitated status effect will ignore a mob being agressively grabbed
#define IGNORE_GRAB (1<<2)
/// If the incapacited status effect will ignore a mob in cirt
#define IGNORE_CRIT (1<<3)

// Grouped effect sources, see also code/__DEFINES/traits.dm

Expand Down
25 changes: 21 additions & 4 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,32 @@
// DOES NOT EFFECT THE BASE 1 DECISECOND DELAY OF NEXT_CLICK

/mob/proc/changeNext_move(num)
next_move = world.time + ((num+next_move_adjust)*next_move_modifier)
var/stat_multi = 1
switch(stat)
if(SOFT_CRIT)
stat_multi = 8
if(HARD_CRIT)
stat_multi = 16
else
stat_multi = 1
next_move = world.time + ((num+next_move_adjust) * next_move_modifier * stat_multi)

/mob/living/changeNext_move(num)
var/mod = next_move_modifier
var/adj = next_move_adjust
var/stat_multi = 1
switch(stat)
if(SOFT_CRIT)
stat_multi = 4
if(HARD_CRIT)
stat_multi = 8
else
stat_multi = 1

for(var/datum/status_effect/effect as anything in status_effects)
mod *= effect.nextmove_modifier()
adj += effect.nextmove_adjust()
next_move = world.time + ((num + adj)*mod)
next_move = world.time + ((num + adj)*mod * stat_multi)

/**
* Before anything else, defer these calls to a per-mobtype handler. This allows us to
Expand Down Expand Up @@ -106,7 +123,7 @@
CtrlClickOn(A)
return

if(incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS))
if(incapacitated(IGNORE_RESTRAINTS|IGNORE_STASIS|IGNORE_CRIT))
return

face_atom(A)
Expand All @@ -117,7 +134,7 @@
if(!LAZYACCESS(modifiers, "catcher") && A.IsObscured())
return

if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) && !((stat >= SOFT_CRIT && (stat != DEAD && stat != UNCONSCIOUS))))
changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow
UnarmedAttack(A, FALSE)
return
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(atom/A, proximity_flag)
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED))
if(HAS_TRAIT(src, TRAIT_HANDS_BLOCKED) && stat < SOFT_CRIT)
if(src == A)
check_self_for_injuries()
return
Expand Down
4 changes: 4 additions & 0 deletions code/controllers/subsystem/ambience.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ SUBSYSTEM_DEF(ambience)
///Attempts to play an ambient sound to a mob, returning the cooldown in deciseconds
/area/proc/play_ambience(mob/M, sound/override_sound, volume = 27)
var/sound/new_sound = override_sound || pick(ambientsounds)
if(M.client?.prefs.channel_volume)
volume *= M.client.prefs.channel_volume["[CHANNEL_MASTER_VOLUME]"] * 0.01
volume *= M.client.prefs.channel_volume["[CHANNEL_AMBIENCE]"] * 0.01

new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_AMBIENCE)
SEND_SOUND(M, new_sound)

Expand Down
6 changes: 6 additions & 0 deletions code/controllers/subsystem/processing/fastprocess.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess)
name = "Fast Processing"
wait = 0.2 SECONDS
stat_tag = "FP"

PROCESSING_SUBSYSTEM_DEF(actualfastprocess)
name = "Actual Fast Processing"
wait = 0.1 SECONDS
priority = FIRE_PRIORITY_TICKER
stat_tag = "AFP"
7 changes: 6 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ SUBSYSTEM_DEF(ticker)
INVOKE_ASYNC(SSdbcore, TYPE_PROC_REF(/datum/controller/subsystem/dbcore,SetRoundStart))

to_chat(world, span_notice("<B>Welcome to [station_name()], enjoy your stay!</B>"))
SEND_SOUND(world, sound(SSstation.announcer.get_rand_welcome_sound()))

for(var/mob/M as anything in GLOB.player_list)
if(!M.client)
SEND_SOUND(M, sound(SSstation.announcer.get_rand_welcome_sound(), volume = 100))
else if("[CHANNEL_VOX]" in M.client.prefs.channel_volume)
SEND_SOUND(M, sound(SSstation.announcer.get_rand_welcome_sound(), volume = M.client.prefs.channel_volume["[CHANNEL_VOX]"] * (M.client.prefs.channel_volume["[CHANNEL_MASTER_VOLUME]"] * 0.01)))

current_state = GAME_STATE_PLAYING
Master.SetRunLevel(RUNLEVEL_GAME)
Expand Down
4 changes: 3 additions & 1 deletion code/datums/announcers/default_announcer.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/datum/centcom_announcer/default
welcome_sounds = list('sound/ai/default/welcome.ogg')
welcome_sounds = list('monkestation/sound/ai/duke/welcome/bonus1.ogg',
'monkestation/sound/ai/duke/welcome/welcome1.ogg',
'monkestation/sound/ai/duke/welcome/welcome2.ogg')
alert_sounds = list('sound/ai/default/attention.ogg')
command_report_sounds = list('sound/ai/default/commandreport.ogg')
event_sounds = list(ANNOUNCER_AIMALF = 'sound/ai/default/aimalf.ogg',
Expand Down
2 changes: 1 addition & 1 deletion code/datums/emotes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
var/tmp_sound = get_sound(user)
if(tmp_sound && should_play_sound(user, intentional) && !TIMER_COOLDOWN_CHECK(user, type))
TIMER_COOLDOWN_START(user, type, audio_cooldown)
playsound(user, tmp_sound, 50, vary)
playsound(user, tmp_sound, 50, vary, mixer_channel = CHANNEL_MOB_SOUNDS)

var/user_turf = get_turf(user)
if (user.client)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches)
resolve_parent.balloon_alert(to_show, "can't reach!")
return FALSE

if(!isliving(to_show) || to_show.incapacitated())
if(!isliving(to_show) || to_show.incapacitated(IGNORE_CRIT))
return FALSE

if(locked)
Expand Down
5 changes: 5 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,11 @@
pulling.remove_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), CHOKEHOLD_TRAIT)
if(. >= GRAB_NECK) // Previous state was a a neck-grab or higher.
REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT)
if(ismob(src))
var/mob/grabbed = src
if(grabbed.stat == SOFT_CRIT || grabbed.stat == HARD_CRIT)
pulling.add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), CHOKEHOLD_TRAIT)

if(GRAB_AGGRESSIVE)
if(. >= GRAB_NECK) // Grab got downgraded.
REMOVE_TRAIT(pulling, TRAIT_FLOORED, CHOKEHOLD_TRAIT)
Expand Down
4 changes: 4 additions & 0 deletions code/game/sound.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
GLOBAL_LIST_INIT(used_sound_channels, list(
CHANNEL_MASTER_VOLUME,
CHANNEL_LOBBYMUSIC,
CHANNEL_ADMIN,
CHANNEL_VOX,
Expand Down Expand Up @@ -145,6 +146,8 @@ GLOBAL_LIST_INIT(proxy_sound_channels, list(
sound_to_use.wait = 0 //No queue
sound_to_use.channel = channel || SSsounds.random_available_channel()
sound_to_use.volume = vol
if("[CHANNEL_MASTER_VOLUME]" in client?.prefs?.channel_volume)
sound_to_use.volume *= client.prefs.channel_volume["[CHANNEL_MASTER_VOLUME]"] * 0.01

if(vary)
if(frequency)
Expand Down Expand Up @@ -246,6 +249,7 @@ GLOBAL_LIST_INIT(proxy_sound_channels, list(
if("[CHANNEL_LOBBYMUSIC]" in prefs.channel_volume)
if(prefs.channel_volume["[CHANNEL_LOBBYMUSIC]"] != 0)
vol *= prefs.channel_volume["[CHANNEL_LOBBYMUSIC]"] * 0.01
vol *= prefs.channel_volume["[CHANNEL_MASTER_VOLUME]"] * 0.01

if((prefs && (!prefs.read_preference(/datum/preference/toggle/sound_lobby))) || CONFIG_GET(flag/disallow_title_music))
return
Expand Down
5 changes: 5 additions & 0 deletions code/modules/admin/holder2.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ GLOBAL_PROTECT(href_token)
owner.init_verbs() //re-initialize the verb list
owner.update_special_keybinds()
GLOB.admins |= client
if(!owner.mentor_datum)
owner.mentor_datum_set()

try_give_profiling()

Expand All @@ -170,6 +172,9 @@ GLOBAL_PROTECT(href_token)
GLOB.admins -= owner
owner.remove_admin_verbs()
owner.holder = null
GLOB.mentors -= owner
owner.mentor_datum.owner = null
owner.mentor_datum = null
owner = null

/// Returns the feedback forum thread for the admin holder's owner, as according to DB.
Expand Down
18 changes: 15 additions & 3 deletions code/modules/escape_menu/home_page.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@
CALLBACK(src, PROC_REF(start_redeem)),
)
)
page_holder.give_screen_object(
new /atom/movable/screen/escape_menu/home_button(
null,
src,
"Open Lootbox",
/* offset = */ 3,
CALLBACK(src, PROC_REF(try_open_lootbox)),
)
)

page_holder.give_screen_object(
new /atom/movable/screen/escape_menu/home_button(
null,
src,
"Open Map",
/* offset = */ 3,
/* offset = */ 4,
CALLBACK(src, PROC_REF(open_map)),
)
)
Expand All @@ -43,7 +52,7 @@
null,
src,
"Admin Help",
/* offset = */ 4,
/* offset = */ 5,
)
)

Expand All @@ -52,7 +61,7 @@
null,
src,
"Leave Body",
/* offset = */ 5,
/* offset = */ 6,
CALLBACK(src, PROC_REF(open_leave_body)),
)
)
Expand All @@ -63,6 +72,9 @@
/datum/escape_menu/proc/start_redeem()
client?.redeem_code()

/datum/escape_menu/proc/try_open_lootbox()
client?.try_open_or_buy_lootbox()

/datum/escape_menu/proc/open_map()
var/redirect = ""
switch(SSmapping.config.map_name)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/brain_trauma.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/datum/round_event_control/brain_trauma
name = "Spontaneous Brain Trauma"
typepath = /datum/round_event/brain_trauma
weight = 10
weight = 0
category = EVENT_CATEGORY_HEALTH
description = "A crewmember gains a random trauma."
min_wizard_trigger_potency = 2
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/captain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
supervisors = "Nanotrasen officials and Space Law"
req_admin_notify = 1
minimal_player_age = 14
exp_requirements = 180
exp_requirements = 1500
exp_required_type = EXP_TYPE_CREW
exp_required_type_department = EXP_TYPE_COMMAND
exp_granted_type = EXP_TYPE_CREW
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/chief_engineer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
supervisors = SUPERVISOR_CAPTAIN
req_admin_notify = 1
minimal_player_age = 7
exp_requirements = 180
exp_requirements = 600
exp_required_type = EXP_TYPE_CREW
exp_required_type_department = EXP_TYPE_ENGINEERING
exp_granted_type = EXP_TYPE_CREW
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/chief_medical_officer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
supervisors = SUPERVISOR_CAPTAIN
req_admin_notify = 1
minimal_player_age = 7
exp_requirements = 180
exp_requirements = 300
exp_required_type = EXP_TYPE_CREW
exp_required_type_department = EXP_TYPE_MEDICAL
exp_granted_type = EXP_TYPE_CREW
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/head_of_personnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
supervisors = SUPERVISOR_HOP
req_admin_notify = 1
minimal_player_age = 10
exp_requirements = 180
exp_requirements = 1500
exp_required_type = EXP_TYPE_CREW
exp_required_type_department = EXP_TYPE_SERVICE
exp_granted_type = EXP_TYPE_CREW
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/head_of_security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
supervisors = SUPERVISOR_CAPTAIN
req_admin_notify = 1
minimal_player_age = 14
exp_requirements = 300
exp_requirements = 600
exp_required_type = EXP_TYPE_CREW
exp_required_type_department = EXP_TYPE_SECURITY
exp_granted_type = EXP_TYPE_CREW
Expand Down
1 change: 1 addition & 0 deletions code/modules/jobs/job_types/quartermaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
supervisors = "the head of personnel"
minimal_player_age = 7
supervisors = SUPERVISOR_CAPTAIN
exp_requirements = 120
exp_required_type_department = EXP_TYPE_SUPPLY
exp_granted_type = EXP_TYPE_CREW
config_tag = "QUARTERMASTER"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/research_director.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
req_admin_notify = 1
minimal_player_age = 7
exp_required_type_department = EXP_TYPE_SCIENCE
exp_requirements = 180
exp_requirements = 900
exp_required_type = EXP_TYPE_CREW
exp_granted_type = EXP_TYPE_CREW
config_tag = "RESEARCH_DIRECTOR"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
return FALSE //nonliving mobs don't have hands

/mob/living/put_in_hand_check(obj/item/I)
if(istype(I) && ((mobility_flags & MOBILITY_PICKUP) || (I.item_flags & ABSTRACT)) \
if(istype(I) && (((mobility_flags & MOBILITY_PICKUP) || ((stat >= SOFT_CRIT && (stat != DEAD && stat != UNCONSCIOUS)))) || (I.item_flags & ABSTRACT)) \
&& !(SEND_SIGNAL(src, COMSIG_LIVING_TRY_PUT_IN_HAND, I) & COMPONENT_LIVING_CANT_PUT_IN_HAND))
return TRUE
return FALSE
Expand Down
15 changes: 9 additions & 6 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,9 @@
* * IGNORE_GRAB - mob that is agressively grabbed is not considered incapacitated
**/
/mob/living/incapacitated(flags)
if((flags & IGNORE_CRIT) && ((stat >= SOFT_CRIT && (stat != DEAD && stat != UNCONSCIOUS)) && !src.pulledby))
return FALSE

if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return TRUE

Expand Down Expand Up @@ -2124,26 +2127,26 @@ GLOBAL_LIST_EMPTY(fire_appearances)
if(CONSCIOUS)
if(. >= UNCONSCIOUS)
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT)
remove_traits(list(TRAIT_HANDS_BLOCKED, TRAIT_INCAPACITATED, TRAIT_FLOORED, TRAIT_CRITICAL_CONDITION), STAT_TRAIT)
remove_traits(list(TRAIT_HANDS_BLOCKED, TRAIT_INCAPACITATED, TRAIT_FLOORED, TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
if(SOFT_CRIT)
if(pulledby)
ADD_TRAIT(src, TRAIT_IMMOBILIZED, PULLED_WHILE_SOFTCRIT_TRAIT) //adding trait sources should come before removing to avoid unnecessary updates
if(. >= UNCONSCIOUS)
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, TRAIT_KNOCKEDOUT)
ADD_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
add_traits(list(TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
if(UNCONSCIOUS)
if(. != HARD_CRIT)
become_blind(UNCONSCIOUS_TRAIT)
if(health <= crit_threshold && !HAS_TRAIT(src, TRAIT_NOSOFTCRIT))
ADD_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
add_traits( list(TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
else
REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
remove_traits(list(TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
if(HARD_CRIT)
if(. != UNCONSCIOUS)
become_blind(UNCONSCIOUS_TRAIT)
ADD_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
add_traits(list(TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
if(DEAD)
REMOVE_TRAIT(src, TRAIT_CRITICAL_CONDITION, STAT_TRAIT)
remove_traits(list(TRAIT_CRITICAL_CONDITION, TRAIT_POOR_AIM), STAT_TRAIT)
remove_from_alive_mob_list()
add_to_dead_mob_list()

Expand Down
Binary file added goon/icons/effects/320x320.dmi
Binary file not shown.
Binary file added goon/icons/effects/particles.dmi
Binary file not shown.
Binary file added goon/icons/obj/large_storage.dmi
Binary file not shown.
Binary file added goon/sounds/misc/openlootcrate.ogg
Binary file not shown.
Binary file added goon/sounds/misc/openlootcrate2.ogg
Binary file not shown.
Loading

0 comments on commit cea1863

Please sign in to comment.