Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into lowpop_alien
Browse files Browse the repository at this point in the history
  • Loading branch information
Tap0r committed Sep 28, 2024
2 parents 97ae54d + fb36112 commit 4032879
Show file tree
Hide file tree
Showing 132 changed files with 2,964 additions and 1,886 deletions.
6 changes: 6 additions & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,9 @@
0, 0, 0, 1, \
0, 0, 0, 0)


#define PAINKILLERS_FILTER list(1.25, 0, 0, 0, \
0, 1.25, 0, 0, \
0, 0, 1.25, 0, \
0, 0, 0, 1, \
-0.05,-0.05,-0.05, 0)
21 changes: 21 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,24 @@
#define MOVESET_TYPE "moveset_type"
#define MOVESET_ROLES "moveset_role"
#define MOVESET_QUALITY "moveset_quality"


//Autofire component
/// Compatible firemode is in the gun. Wait until it's held in the user hands.
#define AUTOFIRE_STAT_IDLE (1<<0)
/// Gun is active and in the user hands. Wait until user does a valid click.
#define AUTOFIRE_STAT_ALERT (1<<1)
/// Gun is shooting.
#define AUTOFIRE_STAT_FIRING (1<<2)

#define COMSIG_AUTOFIRE_ONMOUSEDOWN "autofire_onmousedown"
#define COMPONENT_AUTOFIRE_ONMOUSEDOWN_BYPASS (1<<0)
#define COMSIG_AUTOFIRE_SHOT "autofire_shot"
#define COMPONENT_AUTOFIRE_SHOT_SUCCESS (1<<0)

//Painkiller effectiveness (for get_painkiller_effect() comparison)
#define PAINKILLERS_EFFECT_SLIGHT 0.95 //all painkillers.
#define PAINKILLERS_EFFECT_MEDIUM 0.75 //weak painkillers, allow you to ignore minor pain and not see pain() messages.
#define PAINKILLERS_EFFECT_HEAVY 0.6 //powerful painkillers, allow you to not see custom_pain() messages.
#define PAINKILLERS_EFFECT_VERY_HEAVY 0.5 //very powerful painkillers that does not allow the user to determine the location of the injury.

8 changes: 8 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -424,3 +424,11 @@
#define COMSIG_REMOVE_GENE_DISABILITY "remove_gene_disability"
// send this signal to handle disabilities in life for mob/living/carbon/human
#define COMSIG_HANDLE_DISABILITIES "handle_disabilities"

//from base of client/MouseDown(): (/client, object, location, control, params)
#define COMSIG_CLIENT_MOUSEDOWN "client_mousedown"
//from base of client/MouseUp(): (/client, object, location, control, params)
#define COMSIG_CLIENT_MOUSEUP "client_mouseup"
#define COMPONENT_CLIENT_MOUSEUP_INTERCEPT (1<<0)
//from base of client/MouseUp(): (/client, object, location, control, params)
#define COMSIG_CLIENT_MOUSEDRAG "client_mousedrag"
1 change: 1 addition & 0 deletions code/__DEFINES/gamemodes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
#define REPLICATOR "Replicator"
#define PIRATE "Pirate"
#define PRISONER "Prisoner"
#define THIEF "Thief"

////////////////////// GREETS /////////////////////////
#define GREET_DEFAULT "default"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/messages.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define MAX_BOOK_MESSAGE_LEN 27648
#define MAX_NAME_LEN 26
#define MAX_LNAME_LEN 64
#define MAX_REV_REASON_LEN 255
#define MAX_MEDAL_REASON_LEN 128

//#define SHOWMSG_SELF
#define SHOWMSG_VISUAL (1<<0)
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,11 @@
#define LOGOUT_GHOST 2
#define LOGOUT_REENTER 3
#define LOGOUT_SWAP 4 // not so safe, check other things if available

// traumatic shock levels
#define TRAUMATIC_SHOCK_MINOR 10
#define TRAUMATIC_SHOCK_SERIOUS 30
#define TRAUMATIC_SHOCK_INTENSE 50
#define TRAUMATIC_SHOCK_MIND_SHATTERING 80
#define TRAUMATIC_SHOCK_CRITICAL 100

1 change: 1 addition & 0 deletions code/__DEFINES/religion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

// Religion Techs
#define RTECH_MEMORIZE_RUNE "Memorize Rune"
#define RTECH_COOLDOWN_REDUCTION "Cooldown Reduction"
#define RTECH_REUSABLE_RUNE "Reusable Rune"
#define RTECH_BUILD_EVERYWHERE "Build Everywhere"
#define RTECH_MORE_RUNES "More Runes"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
#define SS_PRIORITY_LOW 1


#define SS_WAIT_FULLAUTO 1
#define SS_WAIT_EXPLOSION 1
#define SS_WAIT_INPUT 1
#define SS_WAIT_DEMO 1
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
#define TRAIT_MIMING "miming"
#define TRAIT_WILLPOWER_IMPLANT "willpower_implant"
#define TRAIT_CAN_LEAP "can_leap"
#define TRAIT_AUTOFIRE_SHOOTS "autofire_shoots"

/*
* Used for movables that need to be updated, via COMSIG_ENTER_AREA and COMSIG_EXIT_AREA, when transitioning areas.
Expand Down
126 changes: 126 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,132 @@
if(gender==FEMALE) return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
else return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))

/proc/random_eye_color()
var/red
var/green
var/blue

var/col = pick ("black", "grey", "brown", "chestnut", "blue", "lightblue", "green", "albino")
switch(col)
if("black")
red = 0
green = 0
blue = 0
if("grey")
red = rand (100, 200)
green = red
blue = red
if("brown")
red = 102
green = 51
blue = 0
if("chestnut")
red = 153
green = 102
blue = 0
if("blue")
red = 51
green = 102
blue = 204
if("lightblue")
red = 102
green = 204
blue = 255
if("green")
red = 0
green = 102
blue = 0
if("albino")
red = rand (200, 255)
green = rand (0, 150)
blue = rand (0, 150)

return list(red, green, blue)

/proc/random_hair_color()
var/red
var/green
var/blue

var/col = pick ("blonde", "black", "chestnut", "copper", "brown", "wheat", "old", "punk")
switch(col)
if("blonde")
red = 255
green = 255
blue = 0
if("black")
red = 0
green = 0
blue = 0
if("chestnut")
red = 153
green = 102
blue = 51
if("copper")
red = 255
green = 153
blue = 0
if("brown")
red = 102
green = 51
blue = 0
if("wheat")
red = 255
green = 255
blue = 153
if("old")
red = rand (100, 255)
green = red
blue = red
if("punk")
red = rand (0, 255)
green = rand (0, 255)
blue = rand (0, 255)

return list(red, green, blue)

/proc/random_skin_color() // for species who has skin_color flag
var/red
var/green
var/blue

var/col = pick ("black", "grey", "brown", "chestnut", "blue", "lightblue", "green", "albino")
switch(col)
if("black")
red = 0
green = 0
blue = 0
if("grey")
red = rand (100, 200)
green = red
blue = red
if("brown")
red = 102
green = 51
blue = 0
if("chestnut")
red = 153
green = 102
blue = 0
if("blue")
red = 51
green = 102
blue = 204
if("lightblue")
red = 102
green = 204
blue = 255
if("green")
red = 0
green = 102
blue = 0
if("albino")
red = rand (200, 255)
green = rand (0, 150)
blue = rand (0, 150)

return list(red, green, blue)

/proc/random_skin_tone()
switch(pick(60;"caucasian", 15;"afroamerican", 10;"african", 10;"latino", 5;"albino"))
if("caucasian") . = -10
Expand Down
20 changes: 20 additions & 0 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1662,3 +1662,23 @@ var/global/list/WALLITEMS = typecacheof(list(
location = location.loc
if(location && include_turf) //At this point, only the turf is left, provided it exists.
. += location

/proc/parse_caught_click_modifiers(list/modifiers, turf/origin, client/viewing_client)
if(!modifiers)
return null

var/screen_loc = splittext(LAZYACCESS(modifiers, SCREEN_LOC), ",")
var/list/actual_view = getviewsize(viewing_client ? viewing_client.view : world.view)
var/click_turf_x = splittext(screen_loc[1], ":")
var/click_turf_y = splittext(screen_loc[2], ":")
var/click_turf_z = origin.z

var/click_turf_px = text2num(click_turf_x[2])
var/click_turf_py = text2num(click_turf_y[2])
click_turf_x = origin.x + text2num(click_turf_x[1]) - round(actual_view[1] / 2) - 1
click_turf_y = origin.y + text2num(click_turf_y[1]) - round(actual_view[2] / 2) - 1

var/turf/click_turf = locate(clamp(click_turf_x, 1, world.maxx), clamp(click_turf_y, 1, world.maxy), click_turf_z)
LAZYSET(modifiers, ICON_X, "[(click_turf_px - click_turf.pixel_x) + ((click_turf_x - click_turf.x) * world.icon_size)]")
LAZYSET(modifiers, ICON_Y, "[(click_turf_py - click_turf.pixel_y) + ((click_turf_y - click_turf.y) * world.icon_size)]")
return click_turf
2 changes: 1 addition & 1 deletion code/_globalvars/lists/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ var/global/list/gods_list = list()

//feel free to add shit to lists below
var/global/list/tachycardics = list("coffee", "inaprovaline", "hyperzine", "nitroglycerin", "thirteenloko", "nicotine", "ambrosium", "jenkem") //increase heart rate
var/global/list/bradycardics = list("neurotoxin", "cryoxadone", "clonexadone", "space_drugs", "stoxin") //decrease heart rate
var/global/list/bradycardics = list("neurotoxin", "cryoxadone", "clonexadone", "space_drugs", "stoxin", "tramadol", "oxycodone") //decrease heart rate
var/global/list/heartstopper = list("potassium_phorochloride", "zombie_powder") //this stops the heart
var/global/list/cheartstopper = list("potassium_chloride") //this stops the heart when overdose is met -- c = conditional
17 changes: 17 additions & 0 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( atom/A, params )
if(client.click_intercept_time)
if(client.click_intercept_time >= world.time)
client.click_intercept_time = 0 //Reset and return. Next click should work, but not this one.
return
client.click_intercept_time = 0 //Just reset. Let's not keep re-checking forever.
if(world.time <= next_click)
return
next_click = world.time + 1
Expand Down Expand Up @@ -160,6 +165,18 @@
else
RangedAttack(A, params)

/client/MouseDown(datum/object, location, control, params)
SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDOWN, object, location, control, params)
..()

/client/MouseUp(object, location, control, params)
if(SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEUP, object, location, control, params) & COMPONENT_CLIENT_MOUSEUP_INTERCEPT)
click_intercept_time = world.time

/client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDRAG, src_object, over_object, src_location, over_location, src_control, over_control, params)
..()

// Default behavior: ignore double clicks (don't add normal clicks, as it will do three clicks instead of two with double).
/mob/proc/DblClickOn(atom/A, params)
return
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/configuration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ var/global/bridge_secret = null
//game_options.txt configs

var/health_threshold_softcrit = 0
var/health_threshold_crit = 0
var/health_threshold_crit = -50
var/health_threshold_dead = -100

var/organ_health_multiplier = 1
var/organ_regeneration_multiplier = 1
var/organ_regeneration_multiplier = 0.75

var/revival_pod_plants = 1
var/revival_cloning = 1
Expand Down Expand Up @@ -199,7 +199,7 @@ var/global/bridge_secret = null
// The object used for the clickable stat() button.
var/obj/effect/statclick/statclick

var/craft_recipes_visibility = FALSE // If false, then users won't see crafting recipes in personal crafting menu until they have all required components and then it will show up.
var/craft_recipes_visibility = TRUE // Show all recipes (TRUE) or only these that have all required components around (FALSE) in craft menu.
var/nightshift = FALSE

var/list/maplist = list()
Expand Down
5 changes: 5 additions & 0 deletions code/controllers/subsystem/fullauto.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PROCESSING_SUBSYSTEM_DEF(fullauto)
name = "Fullauto"
flags = SS_NO_INIT | SS_BACKGROUND
priority = SS_PRIORITY_LOW
wait = SS_WAIT_FULLAUTO
9 changes: 8 additions & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SUBSYSTEM_DEF(ticker)

var/atom/movable/screen/cinematic = null
var/datum/station_state/start_state = null

var/list/medal_list = list()
var/station_was_nuked = FALSE //see nuclearbomb.dm and malfunction.dm
var/explosion_in_progress = FALSE //sit back and relax
var/nar_sie_has_risen = FALSE //check, if there is already one god in the world who was summoned (only for tomes)
Expand Down Expand Up @@ -639,6 +639,13 @@ SUBSYSTEM_DEF(ticker)

return text

/datum/controller/subsystem/ticker/proc/show_medals()
var/text = "<br><FONT size = 5><b>Были выданы следующие медали:</b></FONT>"
for(var/datum/medal/medal as anything in medal_list)
var/award_text = "<b>[medal.key]</b> as <b>[medal.target_name]</b> was awarded \"<b>[medal.medal_name]</b>\" for \"<b>[medal.reason]</b>\" by <b>[medal.parent_name]</b>!"
text += "<br>[bicon(medal.image)] [award_text]"
return text

/datum/controller/subsystem/ticker/proc/start_now()
if(SSticker.current_state != GAME_STATE_PREGAME)
return FALSE
Expand Down
4 changes: 4 additions & 0 deletions code/datums/components/_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@
if(!length(signal_procs[target]))
signal_procs -= target

/datum/proc/RegisterSignals(datum/target, list/signal_types, proctype, override = FALSE)
for (var/signal_type in signal_types)
RegisterSignal(target, signal_type, proctype, override)

/datum/component/proc/InheritComponent(datum/component/C, i_am_original)
return

Expand Down
Loading

0 comments on commit 4032879

Please sign in to comment.