Skip to content

Commit

Permalink
Merge branch 'ARF-SS13:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Colfer1 authored Apr 29, 2024
2 parents ecdc4fe + 05a21b5 commit 242aa80
Show file tree
Hide file tree
Showing 55 changed files with 145 additions and 136 deletions.
3 changes: 3 additions & 0 deletions code/controllers/subsystem/input.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ SUBSYSTEM_DEF(input)
macroset_classic_input["\"Ctrl+[key]+UP\""] = "\"KeyUp [istext(classic_ctrl_override_keys[key])? classic_ctrl_override_keys[key] : key]\""
// Misc
macroset_classic_input["Ctrl+Tab"] = "\".winset \\\"mainwindow.macro=[SKIN_MACROSET_CLASSIC_HOTKEYS] map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\""
macroset_classic_input["Ctrl"] = null
macroset_classic_input["Escape"] = "\".winset \\\"input.text=\\\"\\\"\\\"\""

// FINALLY, WE CAN DO SOMETHING MORE NORMAL FOR THE SNOWFLAKE-BUT-LESS KEYSET.
Expand All @@ -73,6 +74,7 @@ SUBSYSTEM_DEF(input)
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
"Ctrl+Tab" = "\".winset \\\"mainwindow.macro=[SKIN_MACROSET_CLASSIC_INPUT] input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Ctrl" = null,
"Escape" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
)
Expand All @@ -82,6 +84,7 @@ SUBSYSTEM_DEF(input)
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
"Ctrl+Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Ctrl" = null,
"Escape" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"",
)
Expand Down
15 changes: 8 additions & 7 deletions code/controllers/subsystem/monster_wave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SUBSYSTEM_DEF(monster_wave)
/// How long it takes from when the spawnermob thing spawns to when it turns into a nest
var/spawn_delay = 15 MINUTES
/// how long after being blocked will we hold off on trying to spawn stuff there?
var/spawn_block_delay = 5 MINUTES
var/spawn_block_delay = 1 MINUTES
/// coords of spawn blocker devices per Z level
var/list/spawn_blockers = list() // list(/obj/structure/respawner_blocker)
var/num_spawned = 0
Expand Down Expand Up @@ -209,11 +209,10 @@ SUBSYSTEM_DEF(monster_wave)
/mob/living/simple_animal/nest_spawn_hole_guy/proc/deploy_if_ready(do_it_now)
if(!nest_seed)
return
if(SSmonster_wave.is_spawn_blocked(src))
death()
return
if(!COOLDOWN_FINISHED(src, spawn_after) && !do_it_now)
return
if(SSmonster_wave.is_spawn_blocked(src))
return
if(locate(/obj/structure/nest) in get_turf(src))
death()
return TRUE
Expand All @@ -235,10 +234,11 @@ SUBSYSTEM_DEF(monster_wave)
if(shhh_im_dead)
return
for(var/obj/structure/respawner_blocker/RB in SSmonster_wave.spawn_blockers)
if(RB.z != z)
continue
if(get_dist(src, RB) <= RB.protection_radius)
if(RB.killing_something)
if(!RB.killmeplease(src)) // kill me, daddy
continue
RB.killmeplease(src) // kill me, daddy
return

/mob/living/simple_animal/nest_spawn_hole_guy/proc/unbirth()
Expand Down Expand Up @@ -306,9 +306,10 @@ SUBSYSTEM_DEF(monster_wave)
my_bean.Start()
playsound(src, 'sound/machines/shoot_respawn_killer.ogg', 100, FALSE)
playsound(NSHG, 'sound/machines/shoot_respawn_killer.ogg', 100, FALSE)
return TRUE

/obj/structure/respawner_blocker/proc/kill_it()
if(!killing_something || killing_something.shhh_im_dead != src)
if(!killing_something)
return
my_bean.End()
my_bean = null
Expand Down
63 changes: 33 additions & 30 deletions code/controllers/subsystem/recoil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ SUBSYSTEM_DEF(recoil)
// var/recoil_equation_subtract = 0
// var/recoil_equation_multiply = 0.98
// var/recoil_equation_exponent = 0.98
// var/recoil_equation_fuck_it_just_gauss_it = 1
// var/recoil_equation_frick_it_just_gauss_it = 1
// var/list/recoil_equation = list()
// var/recoil_index = 1
/// forewarning: statistics are hard
Expand Down Expand Up @@ -86,9 +86,9 @@ SUBSYSTEM_DEF(recoil)
var/recoil_offset_premult = 80
var/recoil_offset_postmult = 0.01

var/recoil_wielded_reward = 0.5
var/recoil_wielded_reward = 0.85

var/turbofuck_threshold = 10
var/turbofrick_threshold = 5

/// GLobal multiplier to converting recoil into spread
var/recoil_to_spread_mult = 1
Expand All @@ -109,7 +109,7 @@ SUBSYSTEM_DEF(recoil)

/datum/controller/subsystem/recoil/Initialize(start_timeofday)
if(!generate_recoil_datum()) // generate a recoil datum we can rely on always being there for us
message_admins("Recoil system failed to initialize! Shit's broken!")
message_admins("Recoil system failed to initialize! shoot's broken!")
for(var/i in 1 to (1 << RECOIL_DTIME_SHIFT))
delta_time_list += wait
//generate_recoil_equation()
Expand Down Expand Up @@ -159,24 +159,27 @@ SUBSYSTEM_DEF(recoil)
/datum/controller/subsystem/recoil/proc/get_output_offset(spread, mob/living/shotter, obj/item/gun/shoot)
spread += get_offset(shotter, FALSE, TRUE)
spread = clamp(spread, 0, recoil_max_spread)
if(spread <= recoil_offset_low_spread_threshold) // low spread is tightened up a bit
return (rand(-spread * recoil_offset_premult, spread * recoil_offset_premult) * recoil_offset_postmult)
var/mean = spread * recoil_equation_gauss_mean_mult
var/std = spread * recoil_equation_gauss_std_mult
var/turbofuck_unwielded_spread = FALSE
var/turbofrick_unwielded_spread = FALSE
var/turboreward_wielded_spread = FALSE
var/pro_shooter = isatom(shotter) && HAS_TRAIT(shotter,TRAIT_NICE_SHOT)
if(istype(shoot))
var/datum/gun_recoil/gunshoot = get_gun_recoil_datum(shoot.recoil_tag)
if(spread > turbofuck_threshold && istype(shoot))
if(!shoot.wielded && gunshoot.unwielded_recoil_mod > 1 && gunshoot.scoot > 0)
turbofuck_unwielded_spread = TRUE // hodl it right
mean = spread
std = spread //fuck you wield it
else if(shoot.wielded) // yay you wielded it!
turboreward_wielded_spread = TRUE
/// turns out this proc is cheap as fuck
if(!pro_shooter && !shoot.wielded && gunshoot.unwielded_recoil_mod > 1 && gunshoot.scoot > 0)
turbofrick_unwielded_spread = TRUE // hodl it right
mean = spread
std = spread //frick you wield it
else if(shoot.wielded) // yay you wielded it!
turboreward_wielded_spread = TRUE
if(!recoil_max_spread && spread <= recoil_offset_low_spread_threshold) // low spread is tightened up a bit
return (rand(-spread * recoil_offset_premult, spread * recoil_offset_premult) * recoil_offset_postmult)
if(pro_shooter && !turbofrick_unwielded_spread)
std /= 4 // lucky number 7
mean *= 0.5
/// turns out this proc is cheap as frick
var/my_angle = gaussian(mean, std) * pick(1, -1)
if(turbofuck_unwielded_spread) // and tack on some extra spread, just for good measure
if(!pro_shooter && turbofrick_unwielded_spread) // and tack on some extra spread, just for good measure
my_angle += (rand(1,15) * SIGN(my_angle))
if(turboreward_wielded_spread) // give em a boost for wielding it
my_angle *= recoil_wielded_reward
Expand All @@ -189,11 +192,11 @@ SUBSYSTEM_DEF(recoil)
if(HAS_TRAIT(shotter,TRAIT_LIGHT_SENSITIVITY)) // Light hurts!
my_angle *= 4 // Pack tactics wont save your aim here.
if(HAS_TRAIT(shotter,TRAIT_FEV)) //You really shouldn't try this at home.
my_angle *= 5 //YOU AINT HITTING SHIT BROTHA. REALLY.
my_angle *= 5 //YOU AINT HITTING shoot BROTHA. REALLY.
if(HAS_TRAIT(shotter,TRAIT_PHOBIC)) // Panicking!
my_angle *= 6 // RUN OR SHOOT?!?1

return round(clamp(my_angle, 0, recoil_max_spread), 0.1)
return round(clamp(my_angle, -recoil_max_spread, recoil_max_spread), 0.1)

////////////// MOB RECOIL STUFF //////////////
/datum/controller/subsystem/recoil/proc/kickback(mob/living/user, atom/my_weapon, recoil_tag = RECOIL_TAG_DEFAULT, recoil_in = 1)
Expand Down Expand Up @@ -831,34 +834,34 @@ SUBSYSTEM_DEF(recoil)

// /datum/controller/subsystem/recoil/proc/generate_recoil_equation()
// recoil_equation = list()
// if(recoil_equation_fuck_it_just_gauss_it)
// if(recoil_equation_frick_it_just_gauss_it)
// possibly_the_worst_implementation_of_gaussian_distribution_known_to_furries()
// return
// for(var/offset in 1 to MAX_ACCURACY_OFFSET)
// var/list/fucksmall_list_of_numbers = list()
// var/list/fricksmall_list_of_numbers = list()
// for(var/i in 1 to offset)
// var/random_ass_angle = (offset + 1) - i
// random_ass_angle -= recoil_equation_subtract
// random_ass_angle *= recoil_equation_multiply
// random_ass_angle = random_ass_angle ** recoil_equation_exponent
// fucksmall_list_of_numbers += random_ass_angle
// fucksmall_list_of_numbers += -random_ass_angle
// recoil_equation += fucksmall_list_of_numbers
// fricksmall_list_of_numbers += random_ass_angle
// fricksmall_list_of_numbers += -random_ass_angle
// recoil_equation += fricksmall_list_of_numbers

// /// Generates a fuckton of numbers through gaussian distribution, truncates the result to, oh, a decimal, and arranges them in a list
// /// Then, stuffs them into a list to be used as a weighted probability bullshit. Numbers above the list will be clamped to the list of the list
// /// Generates a frickton of numbers through gaussian distribution, truncates the result to, oh, a decimal, and arranges them in a list
// /// Then, stuffs them into a list to be used as a weighted probability bullshoot. Numbers above the list will be clamped to the list of the list
// /datum/controller/subsystem/recoil/proc/possibly_the_worst_implementation_of_gaussian_distribution_known_to_furries()
// var/time_now = world.time
// message_admins("Running an expensive gaussian distribution proc, like, a million times.")
// recoil_equation = list()
// recoil_equation.len = MAX_ACCURACY_OFFSET
// for(var/offset in 1 to MAX_ACCURACY_OFFSET)
// var/list/fuckhuge_list_of_numbers = list()
// var/list/frickhuge_list_of_numbers = list()
// for(var/i in 1 to (2000)) // lol
// var/randum_number = gaussian(offset * recoil_equation_gauss_mean_mult, offset * recoil_equation_gauss_std_mult)
// fuckhuge_list_of_numbers += randum_number
// fuckhuge_list_of_numbers += -randum_number
// recoil_equation[offset] = fuckhuge_list_of_numbers
// message_admins("That fucking proc took [(world.time - time_now)*0.1] seconds.") // wow it only took 0.3 seconds, I am legit impresed byond
// frickhuge_list_of_numbers += randum_number
// frickhuge_list_of_numbers += -randum_number
// recoil_equation[offset] = frickhuge_list_of_numbers
// message_admins("That fricking proc took [(world.time - time_now)*0.1] seconds.") // wow it only took 0.3 seconds, I am legit impresed byond


2 changes: 1 addition & 1 deletion code/datums/components/crafting/recipes/recipes_forge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
result = /obj/item/sharpener
reqs = list(
/obj/item/ingot/titanium = 1,
/obj/item/stack/sheet/plasteel = 10,
/obj/item/stack/sheet/plasteel = 1,
/obj/item/stack/sheet/mineral/diamond = 1,
)
tools = list(TOOL_WORKBENCH)
Expand Down
16 changes: 13 additions & 3 deletions code/datums/components/pellet_cloud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,29 @@
* Honestly this is mostly just a rehash of [/obj/item/ammo_casing/proc/fire_casing()] for pellet counts > 1, except this lets us tamper with the pellets and hook onto them for tracking purposes.
* The arguments really don't matter, this proc is triggered by COMSIG_PELLET_CLOUD_INIT which is only for this really, it's just a big mess of the state vars we need for doing the stuff over here.
*/
/datum/component/pellet_cloud/proc/create_casing_pellets(obj/item/ammo_casing/shell, atom/target, mob/living/user, fired_from, randomspread, spread, zone_override, params, distro)
/datum/component/pellet_cloud/proc/create_casing_pellets(
obj/item/ammo_casing/shell,
atom/target,
mob/living/user,
fired_from,
randomspread,
spread,
zone_override,
params,
distro
)
shooter = user
var/targloc = get_turf(target)
if(!zone_override)
zone_override = shooter.zone_selected

for(var/i in 1 to num_pellets)
shell.ready_proj(target, user, SUPPRESSED_VERY, zone_override, fired_from)
var/angle_out = clamp(distro, -MAX_ACCURACY_OFFSET, MAX_ACCURACY_OFFSET)
var/angle_out = clamp(spread, -MAX_ACCURACY_OFFSET, MAX_ACCURACY_OFFSET)
/// Distro is the angle offset the whole thing will be centered on
/// spread is the max deviation from that center the pellets can be
if(randomspread)
angle_out += rand(-spread, spread) * 0.5
angle_out += rand(-distro, distro) * 0.5
else //Smart spread
angle_out = round((i / num_pellets - 0.5) * max(distro, 1))

Expand Down
2 changes: 1 addition & 1 deletion code/datums/traits/good.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ GLOBAL_LIST_INIT(security_expert, list(
desc = "You're a better than average shot."
value = 44
category = "Ranged Quirks"
mechanics = "Your accuracy degrades much slower from movement, firing, or anything else."
mechanics = "Adjusts various accuracy equations to be more in your favor. In general, you're about twice as accurate with guns, and suffer less penalties from one-handing two-hand guns."
conflicts = list(
/datum/quirk/clumsy,
/datum/quirk/deadeye,
Expand Down
84 changes: 0 additions & 84 deletions code/modules/cargo/packs/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,6 @@
///////////////////////////// Materials //////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

/datum/supply_pack/materials/cardboard50
goody = PACK_GOODY_PUBLIC
name = "50 Cardboard Sheets"
desc = "Create a bunch of boxes."
cost = 400 //thrice their export value
contains = list(/obj/item/stack/sheet/cardboard/fifty)

/datum/supply_pack/materials/glass50
goody = PACK_GOODY_PUBLIC
name = "50 Glass Sheets"
desc = "Let some nice light in with fifty glass sheets!"
cost = 400 //double their export value
contains = list(/obj/item/stack/sheet/glass/fifty)

/datum/supply_pack/materials/metal50
goody = PACK_GOODY_PUBLIC
name = "50 Metal Sheets"
desc = "Any construction project begins with a good stack of fifty metal sheets!"
cost = 400 //double their export value
contains = list(/obj/item/stack/sheet/metal/fifty)

/datum/supply_pack/materials/brick50
goody = PACK_GOODY_PUBLIC
name = "50 Bricks"
desc = "Set a nice foundation with brick and mortar!"
cost = 400 //double their export value
contains = list(/obj/item/stack/sheet/mineral/brick/fifty)

/datum/supply_pack/materials/plasteel20
goody = PACK_GOODY_PUBLIC
name = "20 Plasteel Sheets"
desc = "Reinforce the station's integrity with twenty plasteel sheets!"
cost = 4000
contains = list(/obj/item/stack/sheet/plasteel/twenty)

/datum/supply_pack/materials/plastic50
goody = PACK_GOODY_PUBLIC
name = "50 Plastic Sheets"
desc = "Build a limitless amount of toys with fifty plastic sheets!"
cost = 400 // double their export
contains = list(/obj/item/stack/sheet/plastic/twenty)

/datum/supply_pack/materials/sandstone30
goody = PACK_GOODY_PUBLIC
name = "30 Sandstone Blocks"
desc = "Neither sandy nor stoney, these thirty blocks will still get the job done."
cost = 400 // five times their export
contains = list(/obj/item/stack/sheet/mineral/sandstone/thirty)

/datum/supply_pack/materials/wood50
goody = PACK_GOODY_PUBLIC
name = "50 Wood Planks"
desc = "Turn cargo's boring metal groundwork into beautiful panelled flooring and much more with fifty wooden planks!"
cost = 400 // 6-7 planks shy from having equal import/export prices
contains = list(/obj/item/stack/sheet/mineral/wood/twenty)

/datum/supply_pack/materials/prewaralloyingot
goody = PACK_GOODY_PUBLIC
name = "1 Ultrasteel Ingot"
desc = "Ingots salvaged from a Pre-War factory, valuable in the right hands."
cost = 2000
contains = list(/obj/item/ingot/adamantine
)

/datum/supply_pack/materials/rosesteelingot
goody = PACK_GOODY_PUBLIC
name = "1 Rose Steel Ingot"
desc = "Ingots salvaged from a Pre-War factory, valuable in the right hands."
cost = 1000
contains = list(/obj/item/ingot/mythril
)

/datum/supply_pack/materials/deathclawhide
goody = PACK_GOODY_PUBLIC
name = "Five Deathclaw Hides"
desc = "Intimidate your enemies by modifying your kit with some deathclaw skin!"
cost = 6000
contains = list(/obj/item/stack/sheet/animalhide/deathclaw,
/obj/item/stack/sheet/animalhide/deathclaw,
/obj/item/stack/sheet/animalhide/deathclaw,
/obj/item/stack/sheet/animalhide/deathclaw,
/obj/item/stack/sheet/animalhide/deathclaw
)

/* disabled pending rework of advcrafting lootdrop
/datum/supply_pack/materials/weaponparts
goody = PACK_GOODY_PUBLIC
Expand Down
11 changes: 11 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
/// How fast the mob wobbles side to side.
var/side_waddle_time = 2

/// Button to switch from input bar to hotkey mode.
var/input_mode_hotkey = "Ctrl+Tab"

/datum/preferences/New(client/C)
parent = C

Expand Down Expand Up @@ -1344,6 +1347,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(GAME_PREFERENCES_TAB) // Game Preferences
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>General Settings</h2>"
dat += "<b>Input Mode Hotkey:</b> <a href='?_src_=prefs;task=input;preference=input_mode_hotkey'>[input_mode_hotkey]</a><br>"
dat += "<b>UI Style:</b> <a href='?_src_=prefs;task=input;preference=ui'>[UI_style]</a><br>"
dat += "<b>tgui Monitors:</b> <a href='?_src_=prefs;preference=tgui_lock'>[(tgui_lock) ? "Primary" : "All"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(tgui_fancy) ? "Fancy" : "No Frills"]</a><br>"
Expand Down Expand Up @@ -3614,6 +3618,13 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if (!isnull(desiredfps))
clientfps = desiredfps
parent.fps = desiredfps
if("input_mode_hotkey")
if(input_mode_hotkey == "Tab")
input_mode_hotkey = "Ctrl+Tab"
else
input_mode_hotkey = "Tab"
parent.change_input_toggle_key(input_mode_hotkey)

if("ui")
var/pickedui = input(user, "Choose your UI style.", "Character Preference", UI_style) as null|anything in GLOB.available_ui_styles
if(pickedui)
Expand Down
Loading

0 comments on commit 242aa80

Please sign in to comment.