mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
[MIRROR] Grep for space indentation (#1969)
* Grep for space indentation * aa * Update species.dm * Update species.dm * Update maps.dm * Update examine.dm Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com> Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
@@ -30,14 +30,14 @@
|
||||
next_move = world.time + ((num + adj)*mod)
|
||||
|
||||
/**
|
||||
* Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
||||
* remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
|
||||
*
|
||||
* Alternately, you could hardcode every mob's variation in a flat [/mob/proc/ClickOn] proc; however,
|
||||
* that's a lot of code duplication and is hard to maintain.
|
||||
*
|
||||
* Note that this proc can be overridden, and is in the case of screen objects.
|
||||
*/
|
||||
* Before anything else, defer these calls to a per-mobtype handler. This allows us to
|
||||
* remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
|
||||
*
|
||||
* Alternately, you could hardcode every mob's variation in a flat [/mob/proc/ClickOn] proc; however,
|
||||
* that's a lot of code duplication and is hard to maintain.
|
||||
*
|
||||
* Note that this proc can be overridden, and is in the case of screen objects.
|
||||
*/
|
||||
/atom/Click(location,control,params)
|
||||
if(flags_1 & INITIALIZED_1)
|
||||
SEND_SIGNAL(src, COMSIG_CLICK, location, control, params, usr)
|
||||
@@ -52,18 +52,18 @@
|
||||
usr.MouseWheelOn(src, delta_x, delta_y, params)
|
||||
|
||||
/**
|
||||
* Standard mob ClickOn()
|
||||
* Handles exceptions: Buildmode, middle click, modified clicks, mech actions
|
||||
*
|
||||
* After that, mostly just check your state, check whether you're holding an item,
|
||||
* check whether you're adjacent to the target, then pass off the click to whoever
|
||||
* is receiving it.
|
||||
* The most common are:
|
||||
* * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
|
||||
* * [atom/proc/attackby] (item,user) - used only when adjacent
|
||||
* * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
|
||||
* * [mob/proc/RangedAttack] (atom,params) - used only ranged, only used for tk and laser eyes but could be changed
|
||||
*/
|
||||
* Standard mob ClickOn()
|
||||
* Handles exceptions: Buildmode, middle click, modified clicks, mech actions
|
||||
*
|
||||
* After that, mostly just check your state, check whether you're holding an item,
|
||||
* check whether you're adjacent to the target, then pass off the click to whoever
|
||||
* is receiving it.
|
||||
* The most common are:
|
||||
* * [mob/proc/UnarmedAttack] (atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
|
||||
* * [atom/proc/attackby] (item,user) - used only when adjacent
|
||||
* * [obj/item/proc/afterattack] (atom,user,adjacent,params) - used both ranged and adjacent
|
||||
* * [mob/proc/RangedAttack] (atom,params) - used only ranged, only used for tk and laser eyes but could be changed
|
||||
*/
|
||||
/mob/proc/ClickOn( atom/A, params )
|
||||
if(world.time <= next_click)
|
||||
return
|
||||
@@ -180,9 +180,9 @@
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* A backwards depth-limited breadth-first-search to see if the target is
|
||||
* logically "in" anything adjacent to us.
|
||||
*/
|
||||
* A backwards depth-limited breadth-first-search to see if the target is
|
||||
* logically "in" anything adjacent to us.
|
||||
*/
|
||||
/atom/movable/proc/CanReach(atom/ultimate_target, obj/item/tool, view_only = FALSE)
|
||||
var/list/direct_access = DirectAccess()
|
||||
var/depth = 1 + (view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH)
|
||||
@@ -254,37 +254,37 @@
|
||||
|
||||
|
||||
/**
|
||||
* Translates into [atom/proc/attack_hand], etc.
|
||||
*
|
||||
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
|
||||
* and usage when clicking on things telekinetically (flag=0). This proc will
|
||||
* not be called at ranged except with telekinesis.
|
||||
*
|
||||
* proximity_flag is not currently passed to attack_hand, and is instead used
|
||||
* in human click code to allow glove touches only at melee range.
|
||||
*/
|
||||
* Translates into [atom/proc/attack_hand], etc.
|
||||
*
|
||||
* Note: proximity_flag here is used to distinguish between normal usage (flag=1),
|
||||
* and usage when clicking on things telekinetically (flag=0). This proc will
|
||||
* not be called at ranged except with telekinesis.
|
||||
*
|
||||
* proximity_flag is not currently passed to attack_hand, and is instead used
|
||||
* in human click code to allow glove touches only at melee range.
|
||||
*/
|
||||
/mob/proc/UnarmedAttack(atom/A, proximity_flag)
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
return
|
||||
|
||||
/**
|
||||
* Ranged unarmed attack:
|
||||
*
|
||||
* This currently is just a default for all mobs, involving
|
||||
* laser eyes and telekinesis. You could easily add exceptions
|
||||
* for things like ranged glove touches, spitting alien acid/neurotoxin,
|
||||
* animals lunging, etc.
|
||||
*/
|
||||
* Ranged unarmed attack:
|
||||
*
|
||||
* This currently is just a default for all mobs, involving
|
||||
* laser eyes and telekinesis. You could easily add exceptions
|
||||
* for things like ranged glove touches, spitting alien acid/neurotoxin,
|
||||
* animals lunging, etc.
|
||||
*/
|
||||
/mob/proc/RangedAttack(atom/A, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_MOB_ATTACK_RANGED, A, params) & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
return TRUE
|
||||
|
||||
|
||||
/**
|
||||
* Middle click
|
||||
* Mainly used for swapping hands
|
||||
*/
|
||||
* Middle click
|
||||
* Mainly used for swapping hands
|
||||
*/
|
||||
/mob/proc/MiddleClickOn(atom/A)
|
||||
. = SEND_SIGNAL(src, COMSIG_MOB_MIDDLECLICKON, A)
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON)
|
||||
@@ -292,10 +292,10 @@
|
||||
swap_hand()
|
||||
|
||||
/**
|
||||
* Shift click
|
||||
* For most mobs, examine.
|
||||
* This is overridden in ai.dm
|
||||
*/
|
||||
* Shift click
|
||||
* For most mobs, examine.
|
||||
* This is overridden in ai.dm
|
||||
*/
|
||||
/mob/proc/ShiftClickOn(atom/A)
|
||||
A.ShiftClick(src)
|
||||
return
|
||||
@@ -307,9 +307,9 @@
|
||||
return
|
||||
|
||||
/**
|
||||
* Ctrl click
|
||||
* For most objects, pull
|
||||
*/
|
||||
* Ctrl click
|
||||
* For most objects, pull
|
||||
*/
|
||||
/mob/proc/CtrlClickOn(atom/A)
|
||||
A.CtrlClick(src)
|
||||
return
|
||||
@@ -330,9 +330,9 @@
|
||||
else
|
||||
..()
|
||||
/**
|
||||
* Alt click
|
||||
* Unused except for AI
|
||||
*/
|
||||
* Alt click
|
||||
* Unused except for AI
|
||||
*/
|
||||
/mob/proc/AltClickOn(atom/A)
|
||||
. = SEND_SIGNAL(src, COMSIG_MOB_ALTCLICKON, A)
|
||||
if(. & COMSIG_MOB_CANCEL_CLICKON)
|
||||
@@ -357,9 +357,9 @@
|
||||
return T.Adjacent(src)
|
||||
|
||||
/**
|
||||
* Control+Shift click
|
||||
* Unused except for AI
|
||||
*/
|
||||
* Control+Shift click
|
||||
* Unused except for AI
|
||||
*/
|
||||
/mob/proc/CtrlShiftClickOn(atom/A)
|
||||
A.CtrlShiftClick(src)
|
||||
return
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
|
||||
//PUBLIC - call these wherever you want
|
||||
|
||||
|
||||
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
|
||||
|
||||
/* Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already
|
||||
category is a text string. Each mob may only have one alert per category; the previous one will be replaced
|
||||
path is a type path of the actual alert type to throw
|
||||
severity is an optional number that will be placed at the end of the icon_state for this alert
|
||||
For example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2"
|
||||
new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay.
|
||||
Clicks are forwarded to master
|
||||
Override makes it so the alert is not replaced until cleared by a clear_alert with clear_override, and it's used for hallucinations.
|
||||
/**
|
||||
*Proc to create or update an alert. Returns the alert if the alert is new or updated, 0 if it was thrown already
|
||||
*category is a text string. Each mob may only have one alert per category; the previous one will be replaced
|
||||
*path is a type path of the actual alert type to throw
|
||||
*severity is an optional number that will be placed at the end of the icon_state for this alert
|
||||
*for example, high pressure's icon_state is "highpressure" and can be serverity 1 or 2 to get "highpressure1" or "highpressure2"
|
||||
*new_master is optional and sets the alert's icon state to "template" in the ui_style icons with the master as an overlay.
|
||||
*flicks are forwarded to master
|
||||
*override makes it so the alert is not replaced until cleared by a clear_alert with clear_override, and it's used for hallucinations.
|
||||
*/
|
||||
/mob/proc/throw_alert(category, type, severity, obj/new_master, override = FALSE)
|
||||
|
||||
if(!category || QDELETED(src))
|
||||
return
|
||||
@@ -284,15 +283,15 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
var/obj/item/receiving
|
||||
|
||||
/**
|
||||
* Handles assigning most of the variables for the alert that pops up when an item is offered
|
||||
*
|
||||
* Handles setting the name, description and icon of the alert and tracking the person giving
|
||||
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the giver
|
||||
* Arguments:
|
||||
* * taker - The person receiving the alert
|
||||
* * giver - The person giving the alert and item
|
||||
* * receiving - The item being given by the giver
|
||||
*/
|
||||
* Handles assigning most of the variables for the alert that pops up when an item is offered
|
||||
*
|
||||
* Handles setting the name, description and icon of the alert and tracking the person giving
|
||||
* and the item being offered, also registers a signal that removes the alert from anyone who moves away from the giver
|
||||
* Arguments:
|
||||
* * taker - The person receiving the alert
|
||||
* * giver - The person giving the alert and item
|
||||
* * receiving - The item being given by the giver
|
||||
*/
|
||||
/atom/movable/screen/alert/give/proc/setup(mob/living/carbon/taker, mob/living/carbon/giver, obj/item/receiving)
|
||||
name = "[giver] is offering [receiving]"
|
||||
desc = "[giver] is offering [receiving]. Click this alert to take it."
|
||||
|
||||
@@ -84,11 +84,11 @@
|
||||
filters += filter(type="alpha", render_source = O_LIGHTING_VISUAL_RENDER_TARGET, flags = MASK_INVERSE)
|
||||
|
||||
/**
|
||||
* Things placed on this mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Gets masked by blocking plane. Use for things that you want blocked by
|
||||
* mobs, items, etc.
|
||||
*/
|
||||
* Things placed on this mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Gets masked by blocking plane. Use for things that you want blocked by
|
||||
* mobs, items, etc.
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive
|
||||
name = "emissive plane master"
|
||||
plane = EMISSIVE_PLANE
|
||||
@@ -100,11 +100,11 @@
|
||||
filters += filter(type="alpha", render_source=EMISSIVE_BLOCKER_RENDER_TARGET, flags=MASK_INVERSE)
|
||||
|
||||
/**
|
||||
* Things placed on this always mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Always masks the light plane, isn't blocked by anything. Use for on mob glows,
|
||||
* magic stuff, etc.
|
||||
*/
|
||||
* Things placed on this always mask the lighting plane. Doesn't render directly.
|
||||
*
|
||||
* Always masks the light plane, isn't blocked by anything. Use for on mob glows,
|
||||
* magic stuff, etc.
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive_unblockable
|
||||
name = "unblockable emissive plane master"
|
||||
plane = EMISSIVE_UNBLOCKABLE_PLANE
|
||||
@@ -112,10 +112,10 @@
|
||||
render_target = EMISSIVE_UNBLOCKABLE_RENDER_TARGET
|
||||
|
||||
/**
|
||||
* Things placed on this layer mask the emissive layer. Doesn't render directly
|
||||
*
|
||||
* You really shouldn't be directly using this, use atom helpers instead
|
||||
*/
|
||||
* Things placed on this layer mask the emissive layer. Doesn't render directly
|
||||
*
|
||||
* You really shouldn't be directly using this, use atom helpers instead
|
||||
*/
|
||||
/atom/movable/screen/plane_master/emissive_blocker
|
||||
name = "emissive blocker plane master"
|
||||
plane = EMISSIVE_BLOCKER_PLANE
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
var/slot_id
|
||||
/// Icon when empty. For now used only by humans.
|
||||
var/icon_empty
|
||||
/// Icon when contains an item. For now used only by humans.
|
||||
/// Icon when contains an item. For now used only by humans.
|
||||
var/icon_full
|
||||
/// The overlay when hovering over with an item in your hand
|
||||
var/image/object_overlay
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* 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 TRUE, 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.
|
||||
*/
|
||||
* 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 TRUE, 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)
|
||||
if(tool_behaviour && target.tool_act(user, src, tool_behaviour))
|
||||
return TRUE
|
||||
@@ -26,30 +26,30 @@
|
||||
interact(user)
|
||||
|
||||
/**
|
||||
* Called on the item before it hits something
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/A - The atom about to be hit
|
||||
* * mob/living/user - The mob doing the htting
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
* Called on the item before it hits something
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/A - The atom about to be hit
|
||||
* * mob/living/user - The mob doing the htting
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
/obj/item/proc/pre_attack(atom/A, mob/living/user, params) //do stuff before attackby!
|
||||
if(SEND_SIGNAL(src, COMSIG_ITEM_PRE_ATTACK, A, user, params) & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
return TRUE
|
||||
return FALSE //return TRUE to avoid calling attackby after this proc does stuff
|
||||
|
||||
/**
|
||||
* Called on an object being hit by an item
|
||||
*
|
||||
* Arguments:
|
||||
* * obj/item/W - The item hitting this atom
|
||||
* * mob/user - The wielder of this item
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
* Called on an object being hit by an item
|
||||
*
|
||||
* Arguments:
|
||||
* * obj/item/W - The item hitting this atom
|
||||
* * mob/user - The wielder of this item
|
||||
* * params - click params such as alt/shift etc
|
||||
*
|
||||
* See: [/obj/item/proc/melee_attack_chain]
|
||||
*/
|
||||
/atom/proc/attackby(obj/item/W, mob/user, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_PARENT_ATTACKBY, W, user, params) & COMPONENT_NO_AFTERATTACK)
|
||||
return TRUE
|
||||
@@ -65,12 +65,12 @@
|
||||
return I.attack(src, user)
|
||||
|
||||
/**
|
||||
* Called from [/mob/living/proc/attackby]
|
||||
*
|
||||
* Arguments:
|
||||
* * mob/living/M - The mob being hit by this item
|
||||
* * mob/living/user - The mob hitting with this item
|
||||
*/
|
||||
* Called from [/mob/living/proc/attackby]
|
||||
*
|
||||
* Arguments:
|
||||
* * mob/living/M - The mob being hit by this item
|
||||
* * mob/living/user - The mob hitting with this item
|
||||
*/
|
||||
/obj/item/proc/attack(mob/living/M, mob/living/user)
|
||||
var/signal_return = SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, M, user)
|
||||
if(signal_return & COMPONENT_CANCEL_ATTACK_CHAIN)
|
||||
@@ -152,14 +152,14 @@
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Last proc in the [/obj/item/proc/melee_attack_chain]
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/target - The thing that was hit
|
||||
* * mob/user - The mob doing the hitting
|
||||
* * proximity_flag - is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
* * click_parameters - is the params string from byond [/atom/proc/Click] code, see that documentation.
|
||||
*/
|
||||
* Last proc in the [/obj/item/proc/melee_attack_chain]
|
||||
*
|
||||
* Arguments:
|
||||
* * atom/target - The thing that was hit
|
||||
* * mob/user - The mob doing the hitting
|
||||
* * proximity_flag - is 1 if this afterattack was called on something adjacent, in your square, or on your person.
|
||||
* * click_parameters - is the params string from byond [/atom/proc/Click] code, see that documentation.
|
||||
*/
|
||||
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
|
||||
SEND_SIGNAL(src, COMSIG_ITEM_AFTERATTACK, target, user, proximity_flag, click_parameters)
|
||||
SEND_SIGNAL(user, COMSIG_MOB_ITEM_AFTERATTACK, target, user, proximity_flag, click_parameters)
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis attack act, happens when the TK user clicks on a non-adjacent target in range.
|
||||
*
|
||||
* * By default, emulates the user's unarmed attack.
|
||||
* * Called indirectly by the `COMSIG_MOB_ATTACK_RANGED` signal.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis attack act, happens when the TK user clicks on a non-adjacent target in range.
|
||||
*
|
||||
* * By default, emulates the user's unarmed attack.
|
||||
* * Called indirectly by the `COMSIG_MOB_ATTACK_RANGED` signal.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/atom/proc/attack_tk(mob/user)
|
||||
if(user.stat || !tkMaxRangeCheck(user, src))
|
||||
return
|
||||
@@ -38,11 +38,11 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis object grab act.
|
||||
*
|
||||
* * Called by `/obj/attack_tk()`.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis object grab act.
|
||||
*
|
||||
* * Called by `/obj/attack_tk()`.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/obj/proc/attack_tk_grab(mob/user)
|
||||
var/obj/item/tk_grab/O = new(src)
|
||||
O.tk_user = user
|
||||
@@ -58,13 +58,13 @@
|
||||
|
||||
|
||||
/**
|
||||
* Telekinesis item attack_self act.
|
||||
*
|
||||
* * This is similar to item attack_self, but applies to anything that you can grab with a telekinetic grab.
|
||||
* * It is used for manipulating things at range, for example, opening and closing closets..
|
||||
* * Defined at the `/atom` level but only used at the `/obj/item` one.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
* Telekinesis item attack_self act.
|
||||
*
|
||||
* * This is similar to item attack_self, but applies to anything that you can grab with a telekinetic grab.
|
||||
* * It is used for manipulating things at range, for example, opening and closing closets..
|
||||
* * Defined at the `/atom` level but only used at the `/obj/item` one.
|
||||
* * Returns `COMPONENT_CANCEL_ATTACK_CHAIN` when it performs any action, to further acts on the attack chain.
|
||||
*/
|
||||
/atom/proc/attack_self_tk(mob/user)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user