Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Fluffy-Frontier/FluffySTG
Browse files Browse the repository at this point in the history
…into upstream-mirror-25526
  • Loading branch information
Iajret committed Dec 10, 2023
2 parents 9916aa2 + 4732787 commit caee666
Show file tree
Hide file tree
Showing 349 changed files with 1,274 additions and 1,021 deletions.
4 changes: 2 additions & 2 deletions _maps/RandomZLevels/SnowCabin.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -4459,8 +4459,8 @@
/obj/structure/signpost/salvation{
density = 0;
desc = "An intercomm. Someone seems to be on the other end. I should use it.";
icon = 'icons/obj/device.dmi';
icon_state = "intercom";
icon = 'icons/obj/machines/wallmounts.dmi';
icon_state = "intercom_prison";
max_integrity = 99999;
name = "\proper Fun Jail intercom";
pixel_y = 32;
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomZLevels/moonoutpost19.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1941,7 +1941,7 @@
"mJ" = (
/obj/structure/sign/warning/vacuum{
desc = "A beacon used by a teleporter.";
icon = 'icons/obj/device.dmi';
icon = 'icons/obj/devices/tracker.dmi';
icon_state = "beacon";
name = "tracking beacon"
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomZLevels/undergroundoutpost45.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"az" = (
/obj/structure/sign/warning/vacuum{
desc = "A beacon used by a teleporter.";
icon = 'icons/obj/device.dmi';
icon = 'icons/obj/devices/tracker.dmi';
icon_state = "beacon";
name = "tracking beacon"
},
Expand Down
30 changes: 25 additions & 5 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_x_act.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,30 @@
///from obj/machinery/bsa/full/proc/fire(): ()
#define COMSIG_ATOM_BSA_BEAM "atom_bsa_beam_pass"
#define COMSIG_ATOM_BLOCKS_BSA_BEAM (1<<0)
///for any tool behaviors: (mob/living/user, obj/item/I, list/recipes)

/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with an item
/// Sent from the very beginning of the click chain, intended for generic atom-item interactions
/// Args: (mob/living/user, obj/item/tool, list/modifiers)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ATOM_ITEM_INTERACTION "atom_item_interaction"
/// Sent from [atom/proc/item_interaction], when this atom is right-clicked on by a mob with an item
/// Sent from the very beginning of the click chain, intended for generic atom-item interactions
/// Args: (mob/living/user, obj/item/tool, list/modifiers)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ATOM_ITEM_INTERACTION_SECONDARY "atom_item_interaction_secondary"
/// Sent from [atom/proc/item_interaction], to an item clicking on an atom
/// Args: (mob/living/user, atom/interacting_with, list/modifiers)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ITEM_INTERACTING_WITH_ATOM "item_interacting_with_atom"
/// Sent from [atom/proc/item_interaction], to an item right-clicking on an atom
/// Args: (mob/living/user, atom/interacting_with, list/modifiers)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ITEM_INTERACTING_WITH_ATOM_SECONDARY "item_interacting_with_atom_secondary"
/// Sent from [atom/proc/item_interaction], when this atom is left-clicked on by a mob with a tool of a specific tool type
/// Args: (mob/living/user, obj/item/tool, list/recipes)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ATOM_TOOL_ACT(tooltype) "tool_act_[tooltype]"
#define COMPONENT_BLOCK_TOOL_ATTACK (1<<0)
///for any rightclick tool behaviors: (mob/living/user, obj/item/I)
/// Sent from [atom/proc/item_interaction], when this atom is right-clicked on by a mob with a tool of a specific tool type
/// Args: (mob/living/user, obj/item/tool)
/// Return any ITEM_INTERACT_ flags as relevant (see tools.dm)
#define COMSIG_ATOM_SECONDARY_TOOL_ACT(tooltype) "tool_secondary_act_[tooltype]"
// We have the same returns here as COMSIG_ATOM_TOOL_ACT
// #define COMPONENT_BLOCK_TOOL_ATTACK (1<<0)
55 changes: 55 additions & 0 deletions code/__DEFINES/diseases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,58 @@ DEFINE_BITFIELD(spread_flags, list(
#define DISEASE_SEVERITY_BIOHAZARD "BIOHAZARD"
/// Diseases that are uncurable (hms)
#define DISEASE_SEVERITY_UNCURABLE "Uncurable"

//Severity Guaranteed Cycles or how long before a disease can potentially self-cure
/// Positive diseases should not self-cure by themselves, but if they do, they cure fast
#define DISEASE_CYCLES_POSITIVE 15
/// Roughly 6 minutes for a harmless virus
#define DISEASE_CYCLES_NONTHREAT 180
/// Roughly 5 minutes for a disruptive nuisance virus
#define DISEASE_CYCLES_MINOR 150
/// Roughly 4 minutes for a medium virus
#define DISEASE_CYCLES_MEDIUM 120
/// Roughly 3 minutes for a dangerous virus
#define DISEASE_CYCLES_DANGEROUS 90
/// Roughly 2 minutes for a harmful virus
#define DISEASE_CYCLES_HARMFUL 60
/// Roughly 1 minute for a biohazard kill-death-evil-bad virus
#define DISEASE_CYCLES_BIOHAZARD 30

//Natural Immunity/Recovery Balance Levers
/// Recovery Constant - starting point, 'base' recovery when you get initially infected.
//// Minimum stage_prob is 1 for most advanced diseases. Don't raise it above that if you don't want those diseases to start naturally curing themselves.
#define DISEASE_RECOVERY_CONSTANT 0
/// Recovery Scaling - the divisor of the number of adjusted cycles at max_stages divided by Severity Guaranteed Cycles.
//// Raise to make over-time scaling more aggressive as you get further away from Severity Guaranteed Cycles.
//// Basically, once you hit Severity Guaranteed Cycles or equivalent, this will be your flat recovery chance, increasing by 1% for every Severity Guaranteed Cycles/this value cycles. So, if SGC = 30 and this = 3, every 10 cycles should give you another 1% per-cycle chance to recover.
#define DISEASE_RECOVERY_SCALING 2
/// Peaked Recovery Multiplier - Once we hit max_stages, multiplicative bonus to recovery scaling.
//// Adjust to make it faster or slower to cure once the virus has reached its peak.
#define DISEASE_PEAKED_RECOVERY_MULTIPLIER 1.2
/// Slowdown Recovery Bonus - set this to the maximum extra chance per tick you want people to get to recover from spaceacillin or other slowdown/virus resistance effects
#define DISEASE_SLOWDOWN_RECOVERY_BONUS 1
/// Slowdown Recovery Bonus Duration - set this to the maximum # of cycles you want things that cause slowdown/virus resistance to be able to add a bonus up to DISEASE_SLOWDOWN_RECOVERY_BONUS.______qdel_list_wrapper(list/L)
//// Scales down linearly over time.
#define DISEASE_SLOWDOWN_RECOVERY_BONUS_DURATION 100
/// Negative Malnutrition Recovery Penalty
//// Flat penalty to recovery chance if malnourished or starving
#define DISEASE_MALNUTRITION_RECOVERY_PENALTY 1.5
/// Satiety Recovery Multiplier - added chance to recover based on positive satiety
//// Multiplier of satiety/max_satiety if satiety is positive or zero. Increase to make satiety more valuable, decrease for less.
#define DISEASE_SATIETY_RECOVERY_MULTIPLIER 1
/// Good Sleeping Recovery Bonus - additive benefits for various types of good sleep (blanket, bed, darkness, pillows.)
//// Raise to make each factor add this much chance to recover.
#define DISEASE_GOOD_SLEEPING_RECOVERY_BONUS 0.2
/// Sleeping Recovery Multiplier - multiplies ALL recovery chance effects by this amount.
//// Set to 1 for no effect on recovery chances from sleeping.
#define DISEASE_SLEEPING_RECOVERY_MULTIPLIER 2
/// Final Cure Chance Multiplier - multiplies the disease's cure chance to get the probability of moving from stage 1 to a final cure.
//// Must be greater than zero for diseases to self cure.
#define DISEASE_FINAL_CURE_CHANCE_MULTIPLIER 3
/// Symptom Offset Duration - number of cycles over which sleeping/having spaceacillin or a slowdown effect can prevent symptoms appearing
//// Set to maximum # of cycles you want to be able to offset symptoms. Scales down linearly over time.
#define DISEASE_SYMPTOM_OFFSET_DURATION 100

///Symptom Frequency Modifier
//// Raise to make symptoms fire less frequently, lower to make them fire more frequently. Keep at 0 or above.
#define DISEASE_SYMPTOM_FREQUENCY_MODIFIER 1
18 changes: 10 additions & 8 deletions code/__DEFINES/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
// tool sound is only played when op is started. If not, it's played twice.
#define MIN_TOOL_SOUND_DELAY 20

// tool_act chain flags
/// Return when an item interaction is successful.
/// This cancels the rest of the chain entirely and indicates success.
#define ITEM_INTERACT_SUCCESS (1<<0) // Same as TRUE, as most tool (legacy) tool acts return TRUE on success
/// Return to prevent the rest of the attacck chain from being executed / preventing the item user from thwacking the target.
/// Similar to [ITEM_INTERACT_SUCCESS], but does not necessarily indicate success.
#define ITEM_INTERACT_BLOCKING (1<<1)
/// Return to skip the rest of the interaction chain, going straight to attack.
#define ITEM_INTERACT_SKIP_TO_ATTACK (1<<2)

/// When a tooltype_act proc is successful
#define TOOL_ACT_TOOLTYPE_SUCCESS (1<<0)
/// When [COMSIG_ATOM_TOOL_ACT] blocks the act
#define TOOL_ACT_SIGNAL_BLOCKING (1<<1)

/// When [TOOL_ACT_TOOLTYPE_SUCCESS] or [TOOL_ACT_SIGNAL_BLOCKING] are set
#define TOOL_ACT_MELEE_CHAIN_BLOCKING (TOOL_ACT_TOOLTYPE_SUCCESS | TOOL_ACT_SIGNAL_BLOCKING)
/// Combination flag for any item interaction that blocks the rest of the attack chain
#define ITEM_INTERACT_ANY_BLOCKER (ITEM_INTERACT_SUCCESS | ITEM_INTERACT_BLOCKING)
30 changes: 23 additions & 7 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
* This is the proc that handles the order of an item_attack.
*
* The order of procs called is:
* * [/atom/proc/tool_act] on the target. If it returns TOOL_ACT_TOOLTYPE_SUCCESS or TOOL_ACT_SIGNAL_BLOCKING, the chain will be stopped.
* * [/atom/proc/tool_act] on the target. If it returns ITEM_INTERACT_SUCCESS or ITEM_INTERACT_BLOCKING, the chain will be stopped.
* * [/obj/item/proc/pre_attack] on src. If this returns TRUE, the chain will be stopped.
* * [/atom/proc/attackby] on the target. If it returns TRUE, the chain will be stopped.
* * [/obj/item/proc/afterattack]. The return value does not matter.
*/
/obj/item/proc/melee_attack_chain(mob/user, atom/target, params)
var/is_right_clicking = LAZYACCESS(params2list(params), RIGHT_CLICK)
var/list/modifiers = params2list(params)
var/is_right_clicking = LAZYACCESS(modifiers, RIGHT_CLICK)

if(tool_behaviour && (target.tool_act(user, src, tool_behaviour, is_right_clicking) & TOOL_ACT_MELEE_CHAIN_BLOCKING))
var/item_interact_result = target.item_interaction(user, src, modifiers, is_right_clicking)
if(item_interact_result & ITEM_INTERACT_SUCCESS)
return TRUE
if(item_interact_result & ITEM_INTERACT_BLOCKING)
return FALSE

var/pre_attack_result
if (is_right_clicking)
Expand Down Expand Up @@ -153,12 +157,24 @@
return SECONDARY_ATTACK_CALL_NORMAL

/obj/attackby(obj/item/attacking_item, mob/user, params)
return ..() || ((obj_flags & CAN_BE_HIT) && attacking_item.attack_atom(src, user, params))

/mob/living/attackby(obj/item/attacking_item, mob/living/user, params)
if(can_perform_surgery(user, params))
if(..())
return TRUE
if(!(obj_flags & CAN_BE_HIT))
return FALSE
return attacking_item.attack_atom(src, user, params)

/mob/living/item_interaction(mob/living/user, obj/item/tool, list/modifiers, is_right_clicking)
for(var/datum/surgery/operation as anything in surgeries)
if(IS_IN_INVALID_SURGICAL_POSITION(src, operation))
continue
if(!(operation.surgery_flags & SURGERY_SELF_OPERABLE) && (user == src))
continue
if(operation.next_step(user, modifiers))
return ITEM_INTERACT_SUCCESS

return ..()

/mob/living/attackby(obj/item/attacking_item, mob/living/user, params)
if(..())
return TRUE
user.changeNext_move(attacking_item.attack_speed)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/eigenstate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ SUBSYSTEM_DEF(eigenstates)
/datum/controller/subsystem/eigenstates/proc/tool_interact(atom/source, mob/user, obj/item/item)
SIGNAL_HANDLER
to_chat(user, span_notice("The unstable nature of [source] makes it impossible to use [item] on [source.p_them()]!"))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
2 changes: 1 addition & 1 deletion code/datums/components/combustible_flooder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@

if(tool.get_temperature() >= FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
flood(user, tool.get_temperature())
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
2 changes: 1 addition & 1 deletion code/datums/components/explodable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
SIGNAL_HANDLER

if(check_if_detonate(tool))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/// Shot by something
/datum/component/explodable/proc/projectile_react(datum/source, obj/projectile/shot)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/interaction_booby_trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
SIGNAL_HANDLER
on_defused_callback?.Invoke(source, user, tool)
qdel(src)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/// Give people a little hint
/datum/component/interaction_booby_trap/proc/on_examine(atom/source, mob/examiner, list/examine_list)
Expand Down
10 changes: 5 additions & 5 deletions code/datums/components/lockable_storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@
/datum/component/lockable_storage/proc/on_screwdriver_act(atom/source, mob/user, obj/item/tool)
SIGNAL_HANDLER
if(!can_hack_open || !source.atom_storage.locked)
return COMPONENT_BLOCK_TOOL_ATTACK
return NONE

panel_open = !panel_open
source.balloon_alert(user, "panel [panel_open ? "opened" : "closed"]")
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_SUCCESS

/**
* Called when a multitool is used on the parent, if it's hackable.
Expand All @@ -125,13 +125,13 @@
/datum/component/lockable_storage/proc/on_multitool_act(atom/source, mob/user, obj/item/tool)
SIGNAL_HANDLER
if(!can_hack_open || !source.atom_storage.locked)
return COMPONENT_BLOCK_TOOL_ATTACK
return NONE
if(!panel_open)
source.balloon_alert(user, "panel closed!")
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
source.balloon_alert(user, "hacking...")
INVOKE_ASYNC(src, PROC_REF(hack_open), source, user, tool)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_SUCCESS

///Does a do_after to hack the storage open, takes a long time cause idk.
/datum/component/lockable_storage/proc/hack_open(atom/source, mob/user, obj/item/tool)
Expand Down
8 changes: 4 additions & 4 deletions code/datums/components/material/remote_materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ handles linking back and forth.
SIGNAL_HANDLER

if(!I.multitool_check_buffer(user, I))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
var/obj/item/multitool/M = I
if (!QDELETED(M.buffer) && istype(M.buffer, /obj/machinery/ore_silo))
if (silo == M.buffer)
to_chat(user, span_warning("[parent] is already connected to [silo]!"))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
if(!check_z_level(M.buffer))
to_chat(user, span_warning("[parent] is too far away to get a connection signal!"))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

var/obj/machinery/ore_silo/new_silo = M.buffer
var/datum/component/material_container/new_container = new_silo.GetComponent(/datum/component/material_container)
Expand All @@ -168,7 +168,7 @@ handles linking back and forth.
mat_container = new_container
RegisterSignal(parent, COMSIG_ATOM_ATTACKBY, TYPE_PROC_REF(/datum/component/remote_materials, SiloAttackBy))
to_chat(user, span_notice("You connect [parent] to [silo] from the multitool's buffer."))
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/**
* Checks if the param silo is in the same level as this components parent i.e. connected machine, rcd, etc
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/seclight_attachable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
return

INVOKE_ASYNC(src, PROC_REF(unscrew_light), source, user, tool)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/// Invoked asyncronously from [proc/on_screwdriver]. Handles removing the light from our parent.
/datum/component/seclite_attachable/proc/unscrew_light(obj/item/source, mob/user, obj/item/tool)
Expand Down
8 changes: 4 additions & 4 deletions code/datums/components/shell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@
if(shell_flags & SHELL_FLAG_ALLOW_FAILURE_ACTION)
return
source.balloon_alert(user, "it's locked!")
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

attached_circuit.interact(user)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/**
* Called when a screwdriver is used on the parent. Removes the circuitboard from the component.
Expand All @@ -245,12 +245,12 @@
if(shell_flags & SHELL_FLAG_ALLOW_FAILURE_ACTION)
return
source.balloon_alert(user, "it's locked!")
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

tool.play_tool_sound(parent)
source.balloon_alert(user, "you unscrew [attached_circuit] from [parent].")
remove_circuit()
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/**
* Checks for when the circuitboard moves. If it moves, removes it from the component.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/supermatter_crystal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
SIGNAL_HANDLER
if(tool_act_callback)
tool_act_callback.Invoke(user, tool)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING
attackby_hit(source, tool, user)

/datum/component/supermatter_crystal/proc/bumped_hit(datum/source, atom/movable/hit_object)
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/torn_wall.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/datum/component/torn_wall/proc/on_welded(atom/source, mob/user, obj/item/tool)
SIGNAL_HANDLER
INVOKE_ASYNC(src, PROC_REF(try_repair), source, user, tool)
return COMPONENT_BLOCK_TOOL_ATTACK
return ITEM_INTERACT_BLOCKING

/// Fix us up
/datum/component/torn_wall/proc/try_repair(atom/source, mob/user, obj/item/tool)
Expand All @@ -78,7 +78,7 @@
qdel(src)
return
source.update_appearance(UPDATE_ICON)
source.tool_act(user, tool, TOOL_WELDER, is_right_clicking = FALSE) // Keep going
try_repair(source, user, tool) // Keep going

/// Give them a hint
/datum/component/torn_wall/proc/on_examined(atom/source, mob/user, list/examine_list)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/trapdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
/obj/item/trapdoor_remote
name = "trapdoor remote"
desc = "A small machine that interfaces with a trapdoor controller for easy use."
icon = 'icons/obj/device.dmi'
icon = 'icons/obj/devices/remote.dmi'
icon_state = "trapdoor_remote"
COOLDOWN_DECLARE(trapdoor_cooldown)
var/trapdoor_cooldown_time = 2 SECONDS
Expand Down
2 changes: 1 addition & 1 deletion code/datums/diseases/_MobProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if(prob(15/disease.spreading_modifier))
return

if(satiety>0 && prob(satiety/10)) // positive satiety makes it harder to contract the disease.
if(satiety>0 && prob(satiety/2)) // positive satiety makes it harder to contract the disease.
return

if(!target_zone)
Expand Down
Loading

0 comments on commit caee666

Please sign in to comment.