diff --git a/code/__DEFINES/_click.dm b/code/__DEFINES/_click.dm new file mode 100644 index 0000000000..4118fb873d --- /dev/null +++ b/code/__DEFINES/_click.dm @@ -0,0 +1,2 @@ +//The button used for dragging (only sent for unrelated mouse up/down messages during a drag) +#define DRAG "drag" diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 4477c8aee8..6b9fc0d6ba 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -196,18 +196,6 @@ #define COMSIG_ENTER_AREA "enter_area" //from base of area/Entered(): (/area) #define COMSIG_EXIT_AREA "exit_area" //from base of area/Exited(): (/area) -#define COMSIG_CLICK "atom_click" //from base of atom/Click(): (location, control, params, mob/user) -#define COMSIG_CLICK_SHIFT "shift_click" //from base of atom/ShiftClick(): (/mob), return flags also used by other signals. - #define COMPONENT_ALLOW_EXAMINATE 1 - #define COMPONENT_DENY_EXAMINATE 2 //Higher priority compared to the above one - -#define COMSIG_CLICK_CTRL "ctrl_click" //from base of atom/CtrlClickOn(): (/mob) -#define COMSIG_CLICK_ALT "alt_click" //from base of atom/AltClick(): (/mob) -#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" //from base of atom/CtrlShiftClick(/mob) -#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto" //from base of atom/MouseDrop(): (/atom/over, /mob/user) - #define COMPONENT_NO_MOUSEDROP 1 -#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto" //from base of atom/MouseDrop_T: (/atom/from, /mob/user) - // /area signals #define COMSIG_AREA_ENTERED "area_entered" //from base of area/Entered(): (atom/movable/M) #define COMSIG_AREA_EXITED "area_exited" //from base of area/Exited(): (atom/movable/M) diff --git a/code/__DEFINES/dcs/signals/signals_action.dm b/code/__DEFINES/dcs/signals/signals_action.dm new file mode 100644 index 0000000000..62eccf2823 --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_action.dm @@ -0,0 +1,6 @@ +/// From base of /datum/action/cooldown/proc/PreActivate(), sent to the action owner: (datum/action/cooldown/activated) +#define COMSIG_MOB_ABILITY_STARTED "mob_ability_base_started" + /// Return to block the ability from starting / activating + #define COMPONENT_BLOCK_ABILITY_START (1<<0) +/// From base of /datum/action/cooldown/proc/PreActivate(), sent to the action owner: (datum/action/cooldown/finished) +#define COMSIG_MOB_ABILITY_FINISHED "mob_ability_base_finished" diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm new file mode 100644 index 0000000000..2b0c9c297e --- /dev/null +++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_mouse.dm @@ -0,0 +1,25 @@ +// mouse signals. Format: +// When the signal is called: (signal arguments) +// All signals send the source datum of the signal as the first argument + +///from base of client/Click(): (atom/target, atom/location, control, params, mob/user) +#define COMSIG_CLIENT_CLICK "atom_client_click" +///from base of atom/Click(): (atom/location, control, params, mob/user) +#define COMSIG_CLICK "atom_click" +///from base of atom/ShiftClick(): (/mob) +#define COMSIG_CLICK_SHIFT "shift_click" + /// Allows the user to examinate regardless of client.eye. + #define COMPONENT_ALLOW_EXAMINATE (1<<0) + /// Higher priority compared to the above one + #define COMPONENT_DENY_EXAMINATE (1<<1) +///from base of atom/CtrlClickOn(): (/mob) +#define COMSIG_CLICK_CTRL "ctrl_click" +///from base of atom/AltClick(): (/mob) +#define COMSIG_CLICK_ALT "alt_click" +///from base of atom/CtrlShiftClick(/mob) +#define COMSIG_CLICK_CTRL_SHIFT "ctrl_shift_click" +///from base of atom/MouseDrop(): (/atom/over, /mob/user) +#define COMSIG_MOUSEDROP_ONTO "mousedrop_onto" + #define COMPONENT_NO_MOUSEDROP (1<<0) +///from base of atom/MouseDrop_T: (/atom/from, /mob/user) +#define COMSIG_MOUSEDROPPED_ONTO "mousedropped_onto" //from base of atom/MouseDrop_T: (/atom/from, /mob/user) diff --git a/code/__DEFINES/hud.dm b/code/__DEFINES/hud.dm index 9c161c0a5f..13882afb77 100644 --- a/code/__DEFINES/hud.dm +++ b/code/__DEFINES/hud.dm @@ -1,12 +1,235 @@ //HUD styles. Index order defines how they are cycled in F12. -#define HUD_STYLE_STANDARD 1 //Standard hud -#define HUD_STYLE_REDUCED 2 //Reduced hud (just hands and intent switcher) -#define HUD_STYLE_NOHUD 3 //No hud (for screenshots) +/// Standard hud +#define HUD_STYLE_STANDARD 1 +/// Reduced hud (just hands and intent switcher) +#define HUD_STYLE_REDUCED 2 +/// No hud (for screenshots) +#define HUD_STYLE_NOHUD 3 -#define HUD_VERSIONS 3 //Used in show_hud(); Please ensure this is the same as the maximum index. +/// Used in show_hud(); Please ensure this is the same as the maximum index. +#define HUD_VERSIONS 3 +// Consider these images/atoms as part of the UI/HUD (apart of the appearance_flags) +/// Used for progress bars and chat messages +#define APPEARANCE_UI_IGNORE_ALPHA (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE) +/// Used for HUD objects +#define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE) + +/* + These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var. + + The short version: + + Everything is encoded as strings because apparently that's how Byond rolls. + + "1,1" is the bottom left square of the user's screen. This aligns perfectly with the turf grid. + "1:2,3:4" is the square (1,3) with pixel offsets (+2, +4); slightly right and slightly above the turf grid. + Pixel offsets are used so you don't perfectly hide the turf under them, that would be crappy. + + In addition, the keywords NORTH, SOUTH, EAST, WEST and CENTER can be used to represent their respective + screen borders. NORTH-1, for example, is the row just below the upper edge. Useful if you want your + UI to scale with screen size. + + The size of the user's screen is defined by client.view (indirectly by world.view), in our case "15x15". + Therefore, the top right corner (except during admin shenanigans) is at "15,15" +*/ + +/proc/ui_hand_position(i) //values based on old hand ui positions (CENTER:-/+16,SOUTH:5) + var/x_off = -(!(i % 2)) + var/y_off = round((i-1) / 2) + return"CENTER+[x_off]:16,SOUTH+[y_off]:5" + +/proc/ui_equip_position(mob/M) + var/y_off = round((M.held_items.len-1) / 2) //values based on old equip ui position (CENTER: +/-16,SOUTH+1:5) + return "CENTER:-16,SOUTH+[y_off+1]:5" + +/proc/ui_swaphand_position(mob/M, which = 1) //values based on old swaphand ui positions (CENTER: +/-16,SOUTH+1:5) + var/x_off = which == 1 ? -1 : 0 + var/y_off = round((M.held_items.len-1) / 2) + return "CENTER+[x_off]:16,SOUTH+[y_off+1]:5" + +//Lower left, persistent menu +#define ui_inventory "WEST:6,SOUTH:5" + +//Middle left indicators +#define ui_lingchemdisplay "WEST,CENTER-1:15" +#define ui_lingstingdisplay "WEST:6,CENTER-3:11" + +#define ui_devilsouldisplay "WEST:6,CENTER-1:15" + +//Lower center, persistent menu +#define ui_sstore1 "CENTER-5:10,SOUTH:5" +#define ui_id "CENTER-4:12,SOUTH:5" +#define ui_belt "CENTER-3:14,SOUTH:5" +#define ui_back "CENTER-2:14,SOUTH:5" +#define ui_storage1 "CENTER+1:18,SOUTH:5" +#define ui_storage2 "CENTER+2:20,SOUTH:5" +#define ui_combo "CENTER+4:24,SOUTH+1:7" // combo meter for martial arts + +//Lower right, persistent menu +#define ui_drop_throw "EAST-1:28,SOUTH+1:7" +#define ui_pull_resist "EAST-2:26,SOUTH+1:7" +#define ui_movi "EAST-2:26,SOUTH:5" +#define ui_sprintbufferloc "EAST-2:26,SOUTH:18" +#define ui_acti "EAST-3:24,SOUTH:5" +#define ui_zonesel "EAST-1:28,SOUTH:5" +#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12) +#define ui_crafting "EAST-5:20,SOUTH:5"//CIT CHANGE - moves this over one tile to accommodate for combat mode toggle +#define ui_building "EAST-5:20,SOUTH:21"//CIT CHANGE - ditto +#define ui_language_menu "EAST-5:4,SOUTH:21"//CIT CHANGE - ditto +#define ui_voremode "EAST-5:20,SOUTH:5" + +//Upper-middle right (alerts) +#define ui_alert1 "EAST-1:28,CENTER+5:27" +#define ui_alert2 "EAST-1:28,CENTER+4:25" +#define ui_alert3 "EAST-1:28,CENTER+3:23" +#define ui_alert4 "EAST-1:28,CENTER+2:21" +#define ui_alert5 "EAST-1:28,CENTER+1:19" + +//Upper left (action buttons) +#define ui_action_palette "WEST+0:23,NORTH-1:5" +#define ui_action_palette_offset(north_offset) ("WEST+0:23,NORTH-[1+north_offset]:5") + +#define ui_palette_scroll "WEST+1:8,NORTH-6:28" +#define ui_palette_scroll_offset(north_offset) ("WEST+1:8,NORTH-[6+north_offset]:28") + +//Middle right (status indicators) +#define ui_healthdoll "EAST-1:28,CENTER-2:13" +#define ui_health "EAST-1:28,CENTER-1:15" +#define ui_internal "EAST-1:28,CENTER+1:19"//CIT CHANGE - moves internal icon up a little bit to accommodate for the stamina meter +#define ui_mood "EAST-1:28,CENTER-3:10" +// #define ui_spacesuit "EAST-1:28,CENTER-4:10" + +//Pop-up inventory +#define ui_shoes "WEST+1:8,SOUTH:5" +#define ui_iclothing "WEST:6,SOUTH+1:7" +#define ui_oclothing "WEST+1:8,SOUTH+1:7" +#define ui_gloves "WEST+2:10,SOUTH+1:7" +#define ui_glasses "WEST:6,SOUTH+3:11" +#define ui_mask "WEST+1:8,SOUTH+2:9" +#define ui_ears "WEST+2:10,SOUTH+2:9" +#define ui_neck "WEST:6,SOUTH+2:9" +#define ui_head "WEST+1:8,SOUTH+3:11" + +//Generic living +#define ui_living_pull "EAST-1:28,CENTER-2:15" +#define ui_living_health "EAST-1:28,CENTER:15" +#define ui_living_healthdoll "EAST-1:28,CENTER-1:15" + +//Monkeys +#define ui_monkey_head "CENTER-5:13,SOUTH:5" +#define ui_monkey_mask "CENTER-4:14,SOUTH:5" +#define ui_monkey_neck "CENTER-3:15,SOUTH:5" +#define ui_monkey_back "CENTER-2:16,SOUTH:5" + +//Drones +#define ui_drone_drop "CENTER+1:18,SOUTH:5" +#define ui_drone_pull "CENTER+2:2,SOUTH:5" +#define ui_drone_storage "CENTER-2:14,SOUTH:5" +#define ui_drone_head "CENTER-3:14,SOUTH:5" + +//Cyborgs +#define ui_borg_health "EAST-1:28,CENTER-1:15" +#define ui_borg_pull "EAST-2:26,SOUTH+1:7" +#define ui_borg_radio "EAST-1:28,SOUTH+1:7" +#define ui_borg_intents "EAST-2:26,SOUTH:5" +#define ui_borg_lamp "CENTER-3:16, SOUTH:5" +#define ui_borg_tablet "CENTER-4:16, SOUTH:5" +#define ui_inv1 "CENTER-2:16,SOUTH:5" +#define ui_inv2 "CENTER-1 :16,SOUTH:5" +#define ui_inv3 "CENTER :16,SOUTH:5" +#define ui_borg_module "CENTER+1:16,SOUTH:5" +#define ui_borg_store "CENTER+2:16,SOUTH:5" +#define ui_borg_camera "CENTER+3:21,SOUTH:5" +#define ui_borg_alerts "CENTER+4:21,SOUTH:5" +#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" #define ui_borg_pda_send "CENTER+5:21,SOUTH:5" // To the right of the alert panel #define ui_borg_pda_log "CENTER+6:21,SOUTH:5" +#define ui_borg_sensor "CENTER-6:16, SOUTH:5" //LEGACY +#define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //LEGACY + +//Aliens +#define ui_alien_health "EAST,CENTER-1:15" +#define ui_alienplasmadisplay "EAST,CENTER-2:15" +#define ui_alien_queen_finder "EAST,CENTER-3:15" +#define ui_alien_storage_r "CENTER+1:18,SOUTH:5" +#define ui_alien_language_menu "EAST-3:26,SOUTH:5" + +//Constructs +#define ui_construct_pull "EAST,CENTER-2:15" +#define ui_construct_health "EAST,CENTER:15" + +//AI +#define ui_ai_core "BOTTOM:6,RIGHT-4" +#define ui_ai_shuttle "BOTTOM:6,RIGHT-3" +#define ui_ai_announcement "BOTTOM:6,RIGHT-2" +#define ui_ai_state_laws "BOTTOM:6,RIGHT-1" +#define ui_ai_pda_log "BOTTOM:6,RIGHT" +#define ui_ai_pda_send "BOTTOM+1:6,RIGHT" +#define ui_ai_language_menu "BOTTOM+1:8,RIGHT-2:30" + +#define ui_ai_crew_monitor "BOTTOM:6,CENTER-1" +#define ui_ai_crew_manifest "BOTTOM:6,CENTER" +#define ui_ai_alerts "BOTTOM:6,CENTER+1" + +#define ui_ai_view_images "BOTTOM:6,LEFT+4" +#define ui_ai_camera_list "BOTTOM:6,LEFT+3" +#define ui_ai_track_with_camera "BOTTOM:6,LEFT+2" +#define ui_ai_camera_light "BOTTOM:6,LEFT+1" +#define ui_ai_sensor "BOTTOM:6,LEFT" +#define ui_ai_multicam "BOTTOM+1:6,LEFT+1" +#define ui_ai_add_multicam "BOTTOM+1:6,LEFT" +#define ui_ai_take_picture "BOTTOM+2:6,LEFT" + + +// pAI +// #define ui_pai_software "SOUTH:6,WEST" +// #define ui_pai_shell "SOUTH:6,WEST+1" +// #define ui_pai_chassis "SOUTH:6,WEST+2" +// #define ui_pai_rest "SOUTH:6,WEST+3" +// #define ui_pai_light "SOUTH:6,WEST+4" +// #define ui_pai_newscaster "SOUTH:6,WEST+5" +// #define ui_pai_host_monitor "SOUTH:6,WEST+6" +// #define ui_pai_crew_manifest "SOUTH:6,WEST+7" +// #define ui_pai_state_laws "SOUTH:6,WEST+8" +// #define ui_pai_pda_send "SOUTH:6,WEST+9" +// #define ui_pai_pda_log "SOUTH:6,WEST+10" +// #define ui_pai_take_picture "SOUTH:6,WEST+12" +// #define ui_pai_view_images "SOUTH:6,WEST+13" + +//Ghosts +#define ui_ghost_jumptomob "SOUTH:6,CENTER-3:24" +#define ui_ghost_orbit "SOUTH:6,CENTER-2:24" +#define ui_ghost_reenter_corpse "SOUTH:6,CENTER-1:24" +#define ui_ghost_teleport "SOUTH:6,CENTER:24" +#define ui_ghost_pai "SOUTH: 6, CENTER+1:24" +#define ui_ghost_mafia "SOUTH: 6, CENTER+2:24" +#define ui_ghost_spawners "SOUTH: 6, CENTER+1:24" // LEGACY. SAME LOC AS PAI + +//UI position overrides for 1:1 screen layout. (default is 7:5) +#define ui_stamina "EAST-1:28,CENTER:17" // replacing internals button +#define ui_overridden_resist "EAST-3:24,SOUTH+1:7" +#define ui_clickdelay "CENTER,SOUTH+1:-31" +#define ui_resistdelay "EAST-3:24,SOUTH+1:4" +#define ui_combat_toggle "EAST-4:22,SOUTH:5" + +#define ui_boxcraft "EAST-4:22,SOUTH+1:6" +#define ui_boxarea "EAST-4:6,SOUTH+1:6" +#define ui_boxlang "EAST-5:22,SOUTH+1:6" +#define ui_boxvore "EAST-5:22,SOUTH+1:6" + +#define ui_wanted_lvl "NORTH,11" + +// Defines relating to action button positions + +/// Whatever the base action datum thinks is best +#define SCRN_OBJ_DEFAULT "default" +/// Floating somewhere on the hud, not in any predefined place +#define SCRN_OBJ_FLOATING "floating" +/// In the list of buttons stored at the top of the screen +#define SCRN_OBJ_IN_LIST "list" +/// In the collapseable palette +#define SCRN_OBJ_IN_PALETTE "palette" /// The filter name for the hover outline #define HOVER_OUTLINE_FILTER "hover_outline" diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm index 60d02c1e49..01a295634f 100644 --- a/code/__DEFINES/maths.dm +++ b/code/__DEFINES/maths.dm @@ -30,6 +30,8 @@ #define CEILING(x, y) ( -round(-(x) / (y)) * (y) ) +#define ROUND_UP(x) ( -round(-(x))) + // round() acts like floor(x, 1) by default but can't handle other values #define FLOOR(x, y) ( round((x) / (y)) * (y) ) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 4165b1cec3..edd9149fa3 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -304,10 +304,6 @@ GLOBAL_LIST_INIT(pda_reskins, list( */ -// Consider these images/atoms as part of the UI/HUD -#define APPEARANCE_UI_IGNORE_ALPHA (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|RESET_ALPHA|PIXEL_SCALE) -#define APPEARANCE_UI (RESET_COLOR|RESET_TRANSFORM|NO_CLIENT_COLOR|PIXEL_SCALE) - //Just space #define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" @@ -525,7 +521,8 @@ GLOBAL_LIST_INIT(pda_reskins, list( #define VARSET_TO_LIST(L, V) if(L) L[#V] = V #define VARSET_TO_LIST_IF(L, V, C...) if(L && (C)) L[#V] = V -#define PREF_SAVELOAD_COOLDOWN 5 +#define PREF_LOAD_COOLDOWN 5 +#define PREF_SAVE_COOLDOWN 2 SECONDS #define VOMIT_TOXIC 1 #define VOMIT_PURPLE 2 diff --git a/code/__HELPERS/angles.dm b/code/__HELPERS/angles.dm index a3fc2404bd..0835135788 100644 --- a/code/__HELPERS/angles.dm +++ b/code/__HELPERS/angles.dm @@ -16,7 +16,7 @@ /proc/Get_Angle(atom/movable/start,atom/movable/end)//For beams. if(!start || !end) - return 0 + return FALSE var/dy var/dx dy=(32*end.y+end.pixel_y)-(32*start.y+start.pixel_y) diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index aad5b4cab1..a97d1280ea 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -45,12 +45,12 @@ var/time_to_wait = GLOB.fileaccess_timer - world.time if(time_to_wait > 0) to_chat(src, "Error: file_spam_check(): Spam. Please wait [DisplayTimeText(time_to_wait)].") - return 1 + return TRUE var/delay = FTPDELAY if(holder) delay *= ADMIN_FTPDELAY_MODIFIER GLOB.fileaccess_timer = world.time + delay - return 0 + return FALSE #undef FTPDELAY #undef ADMIN_FTPDELAY_MODIFIER diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 0182f2b6f8..0540d57f73 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -97,8 +97,8 @@ if(C == must_be_alone) continue if(our_area == get_area(C)) - return 0 - return 1 + return FALSE + return TRUE //We used to use linear regression to approximate the answer, but Mloc realized this was actually faster. //And lo and behold, it is, and it's more accurate to boot. @@ -310,14 +310,14 @@ var/turf/T if(X1==X2) if(Y1==Y2) - return 1 //Light cannot be blocked on same tile + return TRUE //Light cannot be blocked on same tile else var/s = SIGN(Y2-Y1) Y1+=s while(Y1!=Y2) T=locate(X1,Y1,Z) if(T.opacity) - return 0 + return FALSE Y1+=s else var/m=(32*(Y2-Y1)+(PY2-PY1))/(32*(X2-X1)+(PX2-PX1)) @@ -333,8 +333,8 @@ X1+=signX //Line exits tile horizontally T=locate(X1,Y1,Z) if(T.opacity) - return 0 - return 1 + return FALSE + return TRUE #undef SIGNV @@ -343,13 +343,13 @@ var/turf/Bturf = get_turf(B) if(!Aturf || !Bturf) - return 0 + return FALSE if(inLineOfSight(Aturf.x,Aturf.y, Bturf.x,Bturf.y,Aturf.z)) - return 1 + return TRUE else - return 0 + return FALSE /proc/get_cardinal_step_away(atom/start, atom/finish) //returns the position of a step from start away from finish, in one of the cardinal directions diff --git a/code/__HELPERS/heap.dm b/code/__HELPERS/heap.dm index eabcb0e0dc..b8b24c2360 100644 --- a/code/__HELPERS/heap.dm +++ b/code/__HELPERS/heap.dm @@ -29,7 +29,7 @@ //(i.e the max or the min dependant on the comparison function) /datum/heap/proc/pop() if(!length(L)) - return 0 + return FALSE . = L[1] L[1] = L[length(L)] @@ -60,7 +60,7 @@ //or 0 if there's no child /datum/heap/proc/get_greater_child(index) if(index * 2 > length(L)) - return 0 + return FALSE if(index * 2 + 1 > length(L)) return index * 2 diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 801a2cd431..0e4010aff0 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -56,7 +56,7 @@ /proc/calculate_adjacencies(atom/A) if(!A.loc) - return 0 + return FALSE var/adjacencies = 0 @@ -64,7 +64,7 @@ if(ismovable(A)) AM = A if(AM.can_be_unanchored && !AM.anchored) - return 0 + return FALSE for(var/direction in GLOB.cardinals) AM = find_type_in_direction(A, direction) @@ -374,7 +374,7 @@ if(N_SOUTH|N_EAST|N_SOUTHEAST) return SOUTHEAST else - return 0 + return FALSE //SSicon_smooth /proc/queue_smooth_neighbors(atom/A) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 2ccd9deaf2..4924b1c0e0 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -1027,15 +1027,15 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) //Returns the same icon specifed in the argument, but with the pixel drawn /proc/DrawPixel(icon/I,colour,drawX,drawY) if(!I) - return 0 + return FALSE var/Iwidth = I.Width() var/Iheight = I.Height() if(drawX > Iwidth || drawX <= 0) - return 0 + return FALSE if(drawY > Iheight || drawY <= 0) - return 0 + return FALSE I.DrawBox(colour,drawX, drawY) return I @@ -1048,7 +1048,7 @@ GLOBAL_LIST_EMPTY(friendly_animal_types) if(J) //Only set the icon if it succeeded, the icon without the pixel is 1000x better than a black square. icon = J return J - return 0 + return FALSE //For creating consistent icons for human looking simple animals /proc/get_flat_human_icon(icon_id, datum/job/J, datum/preferences/prefs, dummy_key, showDirs = GLOB.cardinals, outfit_override = null, no_anim = FALSE) diff --git a/code/__HELPERS/roundend.dm b/code/__HELPERS/roundend.dm index 469f27926a..0b28f4fb2b 100644 --- a/code/__HELPERS/roundend.dm +++ b/code/__HELPERS/roundend.dm @@ -668,7 +668,7 @@ SSticker.show_roundend_report(owner.client) /datum/action/report/IsAvailable() - return 1 + return TRUE /datum/action/report/Topic(href,href_list) if(usr != owner) diff --git a/code/__HELPERS/screen_objs.dm b/code/__HELPERS/screen_objs.dm new file mode 100644 index 0000000000..aa86b6d579 --- /dev/null +++ b/code/__HELPERS/screen_objs.dm @@ -0,0 +1,91 @@ +/// Takes a screen loc string in the format +/// "+-left-offset:+-pixel,+-bottom-offset:+-pixel" +/// Where the :pixel is optional, and returns +/// A list in the format (x_offset, y_offset) +/// We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc +/proc/screen_loc_to_offset(screen_loc, view) + if(!screen_loc) + return list(64, 64) + var/list/view_size = view_to_pixels(view) + var/x = 0 + var/y = 0 + // Time to parse for directional relative offsets + if(findtext(screen_loc, "EAST")) // If you're starting from the east, we start from the east too + x += view_size[1] + if(findtext(screen_loc, "WEST")) // HHHHHHHHHHHHHHHHHHHHHH WEST is technically a 1 tile offset from the start. Shoot me please + x += world.icon_size + if(findtext(screen_loc, "NORTH")) + y += view_size[2] + if(findtext(screen_loc, "SOUTH")) + y += world.icon_size + // Cut out everything we just parsed + screen_loc = cut_relative_direction(screen_loc) + + var/list/x_and_y = splittext(screen_loc, ",") + var/list/x_pack = splittext(x_and_y[1], ":") + var/list/y_pack = splittext(x_and_y[2], ":") + x += text2num(x_pack[1]) * world.icon_size + y += text2num(y_pack[1]) * world.icon_size + + if(length(x_pack) > 1) + x += text2num(x_pack[2]) + if(length(y_pack) > 1) + y += text2num(y_pack[2]) + return list(x, y) + +/// Takes a list in the form (x_offset, y_offset) +/// And converts it to a screen loc string +/// Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope +/proc/offset_to_screen_loc(x_offset, y_offset, view = null) + if(view) + var/list/view_bounds = view_to_pixels(view) + x_offset = clamp(x_offset, world.icon_size, view_bounds[1]) + y_offset = clamp(y_offset, world.icon_size, view_bounds[2]) + + // Round with no argument is floor, so we get the non pixel offset here + var/x = round(x_offset / world.icon_size) + var/pixel_x = x_offset % world.icon_size + var/y = round(y_offset / world.icon_size) + var/pixel_y = y_offset % world.icon_size + + var/list/generated_loc = list() + generated_loc += "[x]" + if(pixel_x) + generated_loc += ":[pixel_x]" + generated_loc += ",[y]" + if(pixel_y) + generated_loc += ":[pixel_y]" + return jointext(generated_loc, "") + +/** + * Returns a valid location to place a screen object without overflowing the viewport + * + * * target: The target location as a purely number based screen_loc string "+-left-offset:+-pixel,+-bottom-offset:+-pixel" + * * target_offset: The amount we want to offset the target location by. We explictly don't care about direction here, we will try all 4 + * * view: The view variable of the client we're doing this for. We use this to get the size of the screen + * + * Returns a screen loc representing the valid location +**/ +/proc/get_valid_screen_location(target_loc, target_offset, view) + var/list/offsets = screen_loc_to_offset(target_loc) + var/base_x = offsets[1] + var/base_y = offsets[2] + + var/list/view_size = view_to_pixels(view) + + // Bias to the right, down, left, and then finally up + if(base_x + target_offset < view_size[1]) + return offset_to_screen_loc(base_x + target_offset, base_y, view) + if(base_y - target_offset > world.icon_size) + return offset_to_screen_loc(base_x, base_y - target_offset, view) + if(base_x - target_offset > world.icon_size) + return offset_to_screen_loc(base_x - target_offset, base_y, view) + if(base_y + target_offset < view_size[2]) + return offset_to_screen_loc(base_x, base_y + target_offset, view) + stack_trace("You passed in a scren location {[target_loc]} and offset {[target_offset]} that can't be fit in the viewport Width {[view_size[1]]}, Height {[view_size[2]]}. what did you do lad") + return null // The fuck did you do lad + +/// Takes a screen_loc string and cut out any directions like NORTH or SOUTH +/proc/cut_relative_direction(fragment) + var/static/regex/regex = regex(@"([A-Z])\w+", "g") + return regex.Replace(fragment, "") diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index 493f7b2096..2fb7715069 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -138,7 +138,7 @@ GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) var/runHi = lo + 1 if(runHi >= hi) - return 1 + return TRUE var/last = fetchElement(L,lo) var/current = fetchElement(L,runHi++) diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 77e39ccf0f..204eb8e60b 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -228,15 +228,15 @@ /proc/text_in_list(haystack, list/needle_list, start=1, end=0) for(var/needle in needle_list) if(findtext(haystack, needle, start, end)) - return 1 - return 0 + return TRUE + return FALSE //Like above, but case sensitive /proc/text_in_list_case(haystack, list/needle_list, start=1, end=0) for(var/needle in needle_list) if(findtextEx(haystack, needle, start, end)) - return 1 - return 0 + return TRUE + return FALSE //Adds 'char' ahead of 'text' until there are 'count' characters total /proc/add_leading(text, count, char = " ") @@ -301,7 +301,7 @@ else if(b == replace) //if B is the replacement char newtext = copytext(newtext, 1, newtext_it) + a + copytext(newtext, newtext_it + length(newtext[newtext_it])) else //The lists disagree, Uh-oh! - return 0 + return FALSE text_it += length(a) comp_it += length(b) newtext_it += length(newtext[newtext_it]) @@ -311,7 +311,7 @@ //This proc returns the number of chars of the string that is the character //This is used for detective work to determine fingerprint completion. if(!text || !character) - return 0 + return FALSE var/count = 0 var/lentext = length(text) var/a = "" @@ -403,7 +403,7 @@ GLOBAL_LIST_INIT(binary, list("0","1")) . = findtextEx(haystack, char, start, end) if(.) return - return 0 + return FALSE /proc/parsemarkdown_basic_step1(t, limited=FALSE) if(length(t) <= 0) diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 519a54b38d..0af855cbf6 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -14,7 +14,7 @@ var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day if(month == MM && day == DD) - return 1 + return TRUE //returns timestamp in a sql and a not-quite-compliant ISO 8601 friendly format /proc/SQLtime(timevar) @@ -41,7 +41,7 @@ GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) if(28 to INFINITY) return 5 else - return 1 + return TRUE //Takes a value of time in deciseconds. //Returns a text value of that number in hours, minutes, or seconds. diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 434cc05551..130243db79 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -158,7 +158,7 @@ /proc/dir2angle(D) switch(D) if(NORTH) - return 0 + return FALSE if(SOUTH) return 180 if(EAST) @@ -301,7 +301,7 @@ /proc/unix2date(timestamp, seperator = "-") if(timestamp < 0) - return 0 //Do not accept negative values + return FALSE //Do not accept negative values var/year = 1970 //Unix Epoc begins 1970-01-01 var/dayInSeconds = 86400 //60secs*60mins*24hours @@ -363,7 +363,7 @@ var/list/covered_parts = list() if(!bpc) - return 0 + return FALSE if(bpc & FULL_BODY) covered_parts |= list(BODY_ZONE_L_ARM,BODY_ZONE_R_ARM,BODY_ZONE_HEAD,BODY_ZONE_CHEST,BODY_ZONE_L_LEG,BODY_ZONE_R_LEG) @@ -557,7 +557,7 @@ //assumes format #RRGGBB #rrggbb /proc/color_hex2num(A) if(!A || length(A) != length_char(A)) - return 0 + return FALSE var/R = hex2num(copytext(A, 2, 4)) var/G = hex2num(copytext(A, 4, 6)) var/B = hex2num(copytext(A, 6, 0)) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index e84085b86b..8fda6b1b0f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -394,7 +394,7 @@ Turf and target are separate in case you want to teleport some distance from a t /proc/get_edge_target_turf(atom/A, direction) var/turf/target = locate(A.x, A.y, A.z) if(!A || !target) - return 0 + return FALSE //since NORTHEAST == NORTH|EAST, etc, doing it this way allows for diagonal mass drivers in the future //and isn't really any more complicated @@ -512,35 +512,35 @@ Turf and target are separate in case you want to teleport some distance from a t current = get_step_towards(current, target_turf) while(current != target_turf) if(steps > length) - return 0 + return FALSE if(current.opacity) - return 0 + return FALSE for(var/thing in current) var/atom/A = thing if(A.opacity) - return 0 + return FALSE current = get_step_towards(current, target_turf) steps++ - return 1 + return TRUE /proc/is_blocked_turf(turf/T, exclude_mobs) if(T.density) - return 1 + return TRUE for(var/i in T) var/atom/A = i if(A.density && (!exclude_mobs || !ismob(A))) - return 1 - return 0 + return TRUE + return FALSE /proc/is_anchored_dense_turf(turf/T) //like the older version of the above, fails only if also anchored if(T.density) - return 1 + return TRUE for(var/i in T) var/atom/movable/A = i if(A.density && A.anchored) - return 1 - return 0 + return TRUE + return FALSE /proc/get_step_towards2(atom/ref , atom/trg) var/base_dir = get_dir(ref, get_step_towards(ref,trg)) @@ -577,9 +577,9 @@ Turf and target are separate in case you want to teleport some distance from a t //Returns: 1 if found, 0 if not. /proc/hasvar(datum/A, varname) if(A.vars.Find(lowertext(varname))) - return 1 + return TRUE else - return 0 + return FALSE /proc/get_cardinal_dir(atom/A, atom/B) var/dx = abs(B.x - A.x) @@ -700,7 +700,7 @@ Turf and target are separate in case you want to teleport some distance from a t //of course mathematically this is just adding world.icon_size on again /proc/getPixelDistance(atom/A, atom/B, centered = TRUE) if(!istype(A)||!istype(B)) - return 0 + return FALSE . = bounds_dist(A, B) + sqrt((((A.pixel_x+B.pixel_x)**2) + ((A.pixel_y+B.pixel_y)**2))) if(centered) . += world.icon_size @@ -741,28 +741,28 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list( //Direction works sometimes if(is_type_in_typecache(O, GLOB.WALLITEMS_INVERSE)) if(O.dir == turn(dir, 180)) - return 1 + return TRUE else if(O.dir == dir) - return 1 + return TRUE //Some stuff doesn't use dir properly, so we need to check pixel instead //That's exactly what get_turf_pixel() does if(get_turf_pixel(O) == locdir) - return 1 + return TRUE if(is_type_in_typecache(O, GLOB.WALLITEMS_EXTERNAL) && check_external) if(is_type_in_typecache(O, GLOB.WALLITEMS_INVERSE)) if(O.dir == turn(dir, 180)) - return 1 + return TRUE else if(O.dir == dir) - return 1 + return TRUE //Some stuff is placed directly on the wallturf (signs) for(var/obj/O in locdir) if(is_type_in_typecache(O, GLOB.WALLITEMS) && check_external != 2) if(O.pixel_x == 0 && O.pixel_y == 0) - return 1 - return 0 + return TRUE + return FALSE /proc/check_target_facings(mob/living/initator, mob/living/target) /*This can be used to add additional effects on interactions between mobs depending on how the mobs are facing each other, such as adding a crit damage to blows to the back of a guy's head. @@ -835,25 +835,25 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list( /proc/IsValidSrc(datum/D) if(istype(D)) return !QDELETED(D) - return 0 + return FALSE //Compare A's dir, the clockwise dir of A and the anticlockwise dir of A //To the opposite dir of the dir returned by get_dir(B,A) //If one of them is a match, then A is facing B /proc/is_A_facing_B(atom/A,atom/B) if(!istype(A) || !istype(B)) - return 0 + return FALSE if(isliving(A)) var/mob/living/LA = A if(LA.lying) - return 0 + return FALSE var/goal_dir = get_dir(A,B) var/clockwise_A_dir = turn(A.dir, -45) var/anticlockwise_A_dir = turn(A.dir, 45) if(A.dir == goal_dir || clockwise_A_dir == goal_dir || anticlockwise_A_dir == goal_dir) - return 1 - return 0 + return TRUE + return FALSE /* @@ -1046,10 +1046,10 @@ B --><-- A /atom/proc/contains(var/atom/A) if(!A) - return 0 + return FALSE for(var/atom/location = A.loc, location, location = location.loc) if(location == src) - return 1 + return TRUE /proc/flick_overlay_static(O, atom/A, duration) set waitfor = 0 @@ -1149,7 +1149,7 @@ GLOBAL_REAL_VAR(list/stack_trace_storage) /proc/stoplag(initial_delay) if (!Master || !(Master.current_runlevel & RUNLEVELS_DEFAULT)) sleep(world.tick_lag) - return 1 + return TRUE if (!initial_delay) initial_delay = world.tick_lag . = 0 @@ -1568,11 +1568,11 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) /proc/num2sign(numeric) if(numeric > 0) - return 1 + return TRUE else if(numeric < 0) return -1 else - return 0 + return FALSE // Converts browser keycodes to BYOND keycodes. /proc/browser_keycode_to_byond(keycode) diff --git a/code/__HELPERS/view.dm b/code/__HELPERS/view.dm index 1c92971802..6a4210bc53 100644 --- a/code/__HELPERS/view.dm +++ b/code/__HELPERS/view.dm @@ -1,15 +1,19 @@ /proc/getviewsize(view) - var/viewX - var/viewY if(isnum(view)) var/totalviewrange = (view < 0 ? -1 : 1) + 2 * view - viewX = totalviewrange - viewY = totalviewrange + return list(totalviewrange, totalviewrange) else var/list/viewrangelist = splittext(view,"x") - viewX = text2num(viewrangelist[1]) - viewY = text2num(viewrangelist[2]) - return list(viewX, viewY) + return list(text2num(viewrangelist[1]), text2num(viewrangelist[2])) + +/// Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height) +/proc/view_to_pixels(view) + if(!view) + return list(0, 0) + var/list/view_info = getviewsize(view) + view_info[1] *= world.icon_size + view_info[2] *= world.icon_size + return view_info /proc/in_view_range(mob/user, atom/A) var/list/view_range = getviewsize(user.client.view) diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index e629a6eb57..06499b3a64 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -11,7 +11,7 @@ to check that the mob is not inside of something */ /atom/proc/Adjacent(atom/neighbor) // basic inheritance, unused - return 0 + return FALSE // Not a sane use of the function and (for now) indicative of an error elsewhere /area/Adjacent(var/atom/neighbor) @@ -57,9 +57,9 @@ if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target, mover = mover)) continue // could not enter src - return 1 // we don't care about our own density + return TRUE // we don't care about our own density - return 0 + return FALSE /* Adjacency (to anything else): @@ -78,11 +78,11 @@ // This is necessary for storage items not on your person. /obj/item/Adjacent(var/atom/neighbor, var/recurse = 1) if(neighbor == loc) - return 1 + return TRUE if(isitem(loc)) if(recurse > 0) return loc.Adjacent(neighbor,recurse - 1) - return 0 + return FALSE return ..() /* @@ -99,7 +99,7 @@ if( O.flags_1&ON_BORDER_1) // windows are on border, check them first if( O.dir & target_dir || O.dir & (O.dir-1) ) // full tile windows are just diagonals mechanically - return 0 //O.dir&(O.dir-1) is false for any cardinal direction, but true for diagonal ones + return FALSE //O.dir&(O.dir-1) is false for any cardinal direction, but true for diagonal ones else if( !border_only ) // dense, not on border, cannot pass over - return 0 - return 1 + return FALSE + return TRUE diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index a698706f1a..bd1509d88b 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -92,11 +92,11 @@ . = 1 //Please don't roast me too hard -/client/MouseMove(object,location,control,params) +/client/MouseMove(object, location, control, params) mouseParams = params - mouseLocation = location - mouseObject = object - mouseControlObject = control + mouse_location_ref = WEAKREF(location) + mouse_object_ref = WEAKREF(object) + mouse_control_object = control if(mob) SEND_SIGNAL(mob, COMSIG_MOB_CLIENT_MOUSEMOVE, object, location, control, params) // god forgive me for i have sinned - used for autoparry. currently at 5 objects. @@ -107,15 +107,16 @@ /client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params) mouseParams = params - mouseLocation = over_location - mouseObject = over_object - mouseControlObject = over_control - if(selected_target[1] && over_object && over_object.IsAutoclickable()) + mouse_location_ref = WEAKREF(over_location) + mouse_object_ref = WEAKREF(over_object) + mouse_control_object = over_control + if(selected_target[1] && over_object?.IsAutoclickable()) selected_target[1] = over_object selected_target[2] = params if(active_mousedown_item) active_mousedown_item.onMouseDrag(src_object, over_object, src_location, over_location, params, mob) SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDRAG, src_object, over_object, src_location, over_location, src_control, over_control, params) + return ..() /obj/item/proc/onMouseDrag(src_object, over_object, src_location, over_location, params, mob) return diff --git a/code/_onclick/hud/_defines.dm b/code/_onclick/hud/_defines.dm deleted file mode 100644 index 233ae17a4d..0000000000 --- a/code/_onclick/hud/_defines.dm +++ /dev/null @@ -1,195 +0,0 @@ -/* - These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var. - - The short version: - - Everything is encoded as strings because apparently that's how Byond rolls. - - "1,1" is the bottom left square of the user's screen. This aligns perfectly with the turf grid. - "1:2,3:4" is the square (1,3) with pixel offsets (+2, +4); slightly right and slightly above the turf grid. - Pixel offsets are used so you don't perfectly hide the turf under them, that would be crappy. - - In addition, the keywords NORTH, SOUTH, EAST, WEST and CENTER can be used to represent their respective - screen borders. NORTH-1, for example, is the row just below the upper edge. Useful if you want your - UI to scale with screen size. - - The size of the user's screen is defined by client.view (indirectly by world.view), in our case "15x15". - Therefore, the top right corner (except during admin shenanigans) is at "15,15" -*/ - -/proc/ui_hand_position(i) //values based on old hand ui positions (CENTER:-/+16,SOUTH:5) - var/x_off = -(!(i % 2)) - var/y_off = round((i-1) / 2) - return"CENTER+[x_off]:16,SOUTH+[y_off]:5" - -/proc/ui_equip_position(mob/M) - var/y_off = round((M.held_items.len-1) / 2) //values based on old equip ui position (CENTER: +/-16,SOUTH+1:5) - return "CENTER:-16,SOUTH+[y_off+1]:5" - -/proc/ui_swaphand_position(mob/M, which = 1) //values based on old swaphand ui positions (CENTER: +/-16,SOUTH+1:5) - var/x_off = which == 1 ? -1 : 0 - var/y_off = round((M.held_items.len-1) / 2) - return "CENTER+[x_off]:16,SOUTH+[y_off+1]:5" - -//Lower left, persistent menu -#define ui_inventory "WEST:6,SOUTH:5" - -//Middle left indicators -#define ui_lingchemdisplay "WEST,CENTER-1:15" -#define ui_lingstingdisplay "WEST:6,CENTER-3:11" - -#define ui_devilsouldisplay "WEST:6,CENTER-1:15" - -//Lower center, persistent menu -#define ui_sstore1 "CENTER-5:10,SOUTH:5" -#define ui_id "CENTER-4:12,SOUTH:5" -#define ui_belt "CENTER-3:14,SOUTH:5" -#define ui_back "CENTER-2:14,SOUTH:5" -#define ui_storage1 "CENTER+1:18,SOUTH:5" -#define ui_storage2 "CENTER+2:20,SOUTH:5" -#define ui_combo "CENTER+4:24,SOUTH+1:7" // combo meter for martial arts - -//Lower right, persistent menu -#define ui_drop_throw "EAST-1:28,SOUTH+1:7" -#define ui_pull_resist "EAST-2:26,SOUTH+1:7" -#define ui_movi "EAST-2:26,SOUTH:5" -#define ui_sprintbufferloc "EAST-2:26,SOUTH:18" -#define ui_acti "EAST-3:24,SOUTH:5" -#define ui_zonesel "EAST-1:28,SOUTH:5" -#define ui_acti_alt "EAST-1:28,SOUTH:5" //alternative intent switcher for when the interface is hidden (F12) -#define ui_crafting "EAST-5:20,SOUTH:5"//CIT CHANGE - moves this over one tile to accommodate for combat mode toggle -#define ui_building "EAST-5:20,SOUTH:21"//CIT CHANGE - ditto -#define ui_language_menu "EAST-5:4,SOUTH:21"//CIT CHANGE - ditto -#define ui_voremode "EAST-5:20,SOUTH:5" - -//Upper-middle right (alerts) -#define ui_alert1 "EAST-1:28,CENTER+5:27" -#define ui_alert2 "EAST-1:28,CENTER+4:25" -#define ui_alert3 "EAST-1:28,CENTER+3:23" -#define ui_alert4 "EAST-1:28,CENTER+2:21" -#define ui_alert5 "EAST-1:28,CENTER+1:19" - -//Middle right (status indicators) -#define ui_healthdoll "EAST-1:28,CENTER-2:13" -#define ui_health "EAST-1:28,CENTER-1:15" -#define ui_internal "EAST-1:28,CENTER+1:19"//CIT CHANGE - moves internal icon up a little bit to accommodate for the stamina meter -#define ui_mood "EAST-1:28,CENTER-3:10" -// #define ui_spacesuit "EAST-1:28,CENTER-4:10" - -//Pop-up inventory -#define ui_shoes "WEST+1:8,SOUTH:5" -#define ui_iclothing "WEST:6,SOUTH+1:7" -#define ui_oclothing "WEST+1:8,SOUTH+1:7" -#define ui_gloves "WEST+2:10,SOUTH+1:7" -#define ui_glasses "WEST:6,SOUTH+3:11" -#define ui_mask "WEST+1:8,SOUTH+2:9" -#define ui_ears "WEST+2:10,SOUTH+2:9" -#define ui_neck "WEST:6,SOUTH+2:9" -#define ui_head "WEST+1:8,SOUTH+3:11" - -//Generic living -#define ui_living_pull "EAST-1:28,CENTER-2:15" -#define ui_living_health "EAST-1:28,CENTER:15" -#define ui_living_healthdoll "EAST-1:28,CENTER-1:15" - -//Monkeys -#define ui_monkey_head "CENTER-5:13,SOUTH:5" -#define ui_monkey_mask "CENTER-4:14,SOUTH:5" -#define ui_monkey_neck "CENTER-3:15,SOUTH:5" -#define ui_monkey_back "CENTER-2:16,SOUTH:5" - -//Drones -#define ui_drone_drop "CENTER+1:18,SOUTH:5" -#define ui_drone_pull "CENTER+2:2,SOUTH:5" -#define ui_drone_storage "CENTER-2:14,SOUTH:5" -#define ui_drone_head "CENTER-3:14,SOUTH:5" - -//Cyborgs -#define ui_borg_health "EAST-1:28,CENTER-1:15" -#define ui_borg_pull "EAST-2:26,SOUTH+1:7" -#define ui_borg_radio "EAST-1:28,SOUTH+1:7" -#define ui_borg_intents "EAST-2:26,SOUTH:5" -#define ui_borg_lamp "CENTER-3:16, SOUTH:5" -#define ui_borg_tablet "CENTER-4:16, SOUTH:5" -#define ui_inv1 "CENTER-2:16,SOUTH:5" -#define ui_inv2 "CENTER-1 :16,SOUTH:5" -#define ui_inv3 "CENTER :16,SOUTH:5" -#define ui_borg_module "CENTER+1:16,SOUTH:5" -#define ui_borg_store "CENTER+2:16,SOUTH:5" -#define ui_borg_camera "CENTER+3:21,SOUTH:5" -#define ui_borg_alerts "CENTER+4:21,SOUTH:5" -#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" -#define ui_borg_sensor "CENTER-6:16, SOUTH:5" //LEGACY -#define ui_borg_thrusters "CENTER-5:16, SOUTH:5" //LEGACY - -//Aliens -#define ui_alien_health "EAST,CENTER-1:15" -#define ui_alienplasmadisplay "EAST,CENTER-2:15" -#define ui_alien_queen_finder "EAST,CENTER-3:15" -#define ui_alien_storage_r "CENTER+1:18,SOUTH:5" -#define ui_alien_language_menu "EAST-3:26,SOUTH:5" - -//Constructs -#define ui_construct_pull "EAST,CENTER-2:15" -#define ui_construct_health "EAST,CENTER:15" - -//AI -#define ui_ai_core "BOTTOM:6,RIGHT-4" -#define ui_ai_shuttle "BOTTOM:6,RIGHT-3" -#define ui_ai_announcement "BOTTOM:6,RIGHT-2" -#define ui_ai_state_laws "BOTTOM:6,RIGHT-1" -#define ui_ai_pda_log "BOTTOM:6,RIGHT" -#define ui_ai_pda_send "BOTTOM+1:6,RIGHT" -#define ui_ai_language_menu "BOTTOM+1:8,RIGHT-2:30" - -#define ui_ai_crew_monitor "BOTTOM:6,CENTER-1" -#define ui_ai_crew_manifest "BOTTOM:6,CENTER" -#define ui_ai_alerts "BOTTOM:6,CENTER+1" - -#define ui_ai_view_images "BOTTOM:6,LEFT+4" -#define ui_ai_camera_list "BOTTOM:6,LEFT+3" -#define ui_ai_track_with_camera "BOTTOM:6,LEFT+2" -#define ui_ai_camera_light "BOTTOM:6,LEFT+1" -#define ui_ai_sensor "BOTTOM:6,LEFT" -#define ui_ai_multicam "BOTTOM+1:6,LEFT+1" -#define ui_ai_add_multicam "BOTTOM+1:6,LEFT" -#define ui_ai_take_picture "BOTTOM+2:6,LEFT" - - -// pAI -// #define ui_pai_software "SOUTH:6,WEST" -// #define ui_pai_shell "SOUTH:6,WEST+1" -// #define ui_pai_chassis "SOUTH:6,WEST+2" -// #define ui_pai_rest "SOUTH:6,WEST+3" -// #define ui_pai_light "SOUTH:6,WEST+4" -// #define ui_pai_newscaster "SOUTH:6,WEST+5" -// #define ui_pai_host_monitor "SOUTH:6,WEST+6" -// #define ui_pai_crew_manifest "SOUTH:6,WEST+7" -// #define ui_pai_state_laws "SOUTH:6,WEST+8" -// #define ui_pai_pda_send "SOUTH:6,WEST+9" -// #define ui_pai_pda_log "SOUTH:6,WEST+10" -// #define ui_pai_take_picture "SOUTH:6,WEST+12" -// #define ui_pai_view_images "SOUTH:6,WEST+13" - -//Ghosts -#define ui_ghost_jumptomob "SOUTH:6,CENTER-3:24" -#define ui_ghost_orbit "SOUTH:6,CENTER-2:24" -#define ui_ghost_reenter_corpse "SOUTH:6,CENTER-1:24" -#define ui_ghost_teleport "SOUTH:6,CENTER:24" -#define ui_ghost_pai "SOUTH: 6, CENTER+1:24" -#define ui_ghost_mafia "SOUTH: 6, CENTER+2:24" -#define ui_ghost_spawners "SOUTH: 6, CENTER+1:24" // LEGACY. SAME LOC AS PAI - -//UI position overrides for 1:1 screen layout. (default is 7:5) -#define ui_stamina "EAST-1:28,CENTER:17" // replacing internals button -#define ui_overridden_resist "EAST-3:24,SOUTH+1:7" -#define ui_clickdelay "CENTER,SOUTH+1:-31" -#define ui_resistdelay "EAST-3:24,SOUTH+1:4" -#define ui_combat_toggle "EAST-4:22,SOUTH:5" - -#define ui_boxcraft "EAST-4:22,SOUTH+1:6" -#define ui_boxarea "EAST-4:6,SOUTH+1:6" -#define ui_boxlang "EAST-5:22,SOUTH+1:6" -#define ui_boxvore "EAST-5:22,SOUTH+1:6" - -#define ui_wanted_lvl "NORTH,11" diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index d97e1f5d04..af49128d25 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -2,186 +2,156 @@ /atom/movable/screen/movable/action_button var/datum/action/linked_action + var/datum/hud/our_hud var/actiontooltipstyle = "" screen_loc = null var/button_icon_state var/appearance_cache + /// Where we are currently placed on the hud. SCRN_OBJ_DEFAULT asks the linked action what it thinks + var/location = SCRN_OBJ_DEFAULT + /// A unique bitflag, combined with the name of our linked action this lets us persistently remember any user changes to our position var/id - var/ordered = TRUE //If the button gets placed into the default bar + /// A weakref of the last thing we hovered over + /// God I hate how dragging works + var/datum/weakref/last_hovored_ref + +/atom/movable/screen/movable/action_button/Destroy() + if(our_hud) + var/mob/viewer = our_hud.mymob + our_hud.hide_action(src) + viewer?.client?.screen -= src + linked_action.viewers -= our_hud + viewer.update_action_buttons() + our_hud = null + linked_action = null + return ..() /atom/movable/screen/movable/action_button/proc/can_use(mob/user) if (linked_action) - return linked_action.owner == user + if(linked_action.viewers[user.hud_used]) + return TRUE + return FALSE else if (isobserver(user)) var/mob/dead/observer/O = user return !O.observetarget else return TRUE -/atom/movable/screen/movable/action_button/MouseDrop(over_object) - if(!can_use(usr)) - return - if((istype(over_object, /atom/movable/screen/movable/action_button) && !istype(over_object, /atom/movable/screen/movable/action_button/hide_toggle))) - if(locked) - to_chat(usr, "Action button \"[name]\" is locked, unlock it first.") - return - var/atom/movable/screen/movable/action_button/B = over_object - var/list/actions = usr.actions - actions.Swap(actions.Find(src.linked_action), actions.Find(B.linked_action)) - moved = FALSE - ordered = TRUE - B.moved = FALSE - B.ordered = TRUE - usr.update_action_buttons() - else - return ..() - /atom/movable/screen/movable/action_button/Click(location,control,params) if (!can_use(usr)) return var/list/modifiers = params2list(params) if(modifiers["shift"]) - if(locked) - to_chat(usr, "Action button \"[name]\" is locked, unlock it first.") - return TRUE - moved = 0 - usr.update_action_buttons() //redraw buttons that are no longer considered "moved" - return TRUE - if(modifiers["ctrl"]) - locked = !locked - to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") - if(id && usr.client) //try to (un)remember position - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null + var/datum/hud/our_hud = usr.hud_used + our_hud.position_action(src, SCRN_OBJ_DEFAULT) return TRUE linked_action.Trigger() return TRUE -//Hide/Show Action Buttons ... Button -/atom/movable/screen/movable/action_button/hide_toggle - name = "Hide Buttons" - desc = "Shift-click any button to reset its position, and Control-click it to lock it in place. Alt-click this button to reset all buttons to their default positions." - icon = 'icons/mob/actions.dmi' - icon_state = "bg_default" - var/hidden = 0 - var/hide_icon = 'icons/mob/actions.dmi' - var/hide_state = "hide" - var/show_state = "show" - var/mutable_appearance/hide_appearance - var/mutable_appearance/show_appearance - -/atom/movable/screen/movable/action_button/hide_toggle/Initialize(mapload) +// Entered and Exited won't fire while you're dragging something, because you're still "holding" it +// Very much byond logic, but I want nice behavior, so we fake it with drag +/atom/movable/screen/movable/action_button/MouseDrag(atom/over_object, src_location, over_location, src_control, over_control, params) . = ..() - var/static/list/icon_cache = list() + if(!can_use(usr)) + return + if(IS_WEAKREF_OF(over_object, last_hovored_ref)) + return + var/atom/old_object + if(last_hovored_ref) + old_object = last_hovored_ref?.resolve() + else // If there's no current ref, we assume it was us. We also treat this as our "first go" location + old_object = src + var/datum/hud/our_hud = usr.hud_used + our_hud?.generate_landings(src) - var/cache_key = "[hide_icon][hide_state]" - hide_appearance = icon_cache[cache_key] - if(!hide_appearance) - hide_appearance = icon_cache[cache_key] = mutable_appearance(hide_icon, hide_state) + if(old_object) + old_object.MouseExited(over_location, over_control, params) - cache_key = "[hide_icon][show_state]" - show_appearance = icon_cache[cache_key] - if(!show_appearance) - show_appearance = icon_cache[cache_key] = mutable_appearance(hide_icon, show_state) + last_hovored_ref = WEAKREF(over_object) + over_object.MouseEntered(over_location, over_control, params) -/atom/movable/screen/movable/action_button/hide_toggle/Click(location,control,params) - if (!can_use(usr)) +/atom/movable/screen/movable/action_button/MouseEntered(location, control, params) + . = ..() + if(!QDELETED(src)) + openToolTip(usr, src, params, title = name, content = desc, theme = actiontooltipstyle) + +/atom/movable/screen/movable/action_button/MouseExited(location, control, params) + closeToolTip(usr) + return ..() + +/atom/movable/screen/movable/action_button/MouseDrop(over_object) + last_hovored_ref = null + if(!can_use(usr)) + return + var/datum/hud/our_hud = usr.hud_used + if(over_object == src) + our_hud.hide_landings() + return + if(istype(over_object, /atom/movable/screen/action_landing)) + var/atom/movable/screen/action_landing/reserve = over_object + reserve.hit_by(src) + our_hud.hide_landings() + save_position() return - var/list/modifiers = params2list(params) - if(modifiers["shift"]) - if(locked) - to_chat(usr, "Action button \"[name]\" is locked, unlock it first.") - return TRUE - moved = FALSE - usr.update_action_buttons(TRUE) - return TRUE - if(modifiers["ctrl"]) - locked = !locked - to_chat(usr, "Action button \"[name]\" [locked ? "" : "un"]locked.") - if(id && usr.client) //try to (un)remember position - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null - return TRUE - if(modifiers["alt"]) - for(var/V in usr.actions) - var/datum/action/A = V - var/atom/movable/screen/movable/action_button/B = A.button - B.moved = FALSE - if(B.id && usr.client) - usr.client.prefs.action_buttons_screen_locs["[B.name]_[B.id]"] = null - B.locked = usr.client.prefs.buttons_locked - locked = usr.client.prefs.buttons_locked - moved = FALSE - if(id && usr.client) - usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = null - usr.update_action_buttons(TRUE) - to_chat(usr, "Action button positions have been reset.") - return TRUE - usr.hud_used.action_buttons_hidden = !usr.hud_used.action_buttons_hidden - - hidden = usr.hud_used.action_buttons_hidden - if(hidden) - name = "Show Buttons" - else - name = "Hide Buttons" - update_icon() - usr.update_action_buttons() - -/atom/movable/screen/movable/action_button/hide_toggle/AltClick(mob/user) - for(var/V in user.actions) - var/datum/action/A = V - var/atom/movable/screen/movable/action_button/B = A.button - B.moved = FALSE - if(moved) - moved = FALSE - user.update_action_buttons(TRUE) - to_chat(user, "Action button positions have been reset.") - return TRUE - - -/atom/movable/screen/movable/action_button/hide_toggle/proc/InitialiseIcon(datum/hud/owner_hud) - var/settings = owner_hud.get_action_buttons_icons() - icon = settings["bg_icon"] - icon_state = settings["bg_state"] - hide_icon = settings["toggle_icon"] - hide_state = settings["toggle_hide"] - show_state = settings["toggle_show"] - update_icon() - -/atom/movable/screen/movable/action_button/hide_toggle/update_overlays() + our_hud.hide_landings() + if(istype(over_object, /atom/movable/screen/button_palette) || istype(over_object, /atom/movable/screen/palette_scroll)) + our_hud.position_action(src, SCRN_OBJ_IN_PALETTE) + save_position() + return + if(istype(over_object, /atom/movable/screen/movable/action_button)) + var/atom/movable/screen/movable/action_button/button = over_object + our_hud.position_action_relative(src, button) + save_position() + return . = ..() - if(hidden) - . += show_appearance - else - . += hide_appearance + our_hud.position_action(src, screen_loc) + save_position() +/atom/movable/screen/movable/action_button/proc/save_position() + var/mob/user = our_hud.mymob + if(!user?.client) + return + var/position_info = "" + switch(location) + if(SCRN_OBJ_FLOATING) + position_info = screen_loc + if(SCRN_OBJ_IN_LIST) + position_info = SCRN_OBJ_IN_LIST + if(SCRN_OBJ_IN_PALETTE) + position_info = SCRN_OBJ_IN_PALETTE -/atom/movable/screen/movable/action_button/MouseEntered(location,control,params) - if(!QDELETED(src)) - openToolTip(usr,src,params,title = name,content = desc,theme = actiontooltipstyle) + user.client.prefs.action_buttons_screen_locs["[name]_[id]"] = position_info + user.client.prefs.queue_save_pref(1 SECONDS, TRUE) +/atom/movable/screen/movable/action_button/proc/load_position() + var/mob/user = our_hud.mymob + if(!user) + return + var/position_info = user.client?.prefs?.action_buttons_screen_locs["[name]_[id]"] || SCRN_OBJ_DEFAULT + user.hud_used.position_action(src, position_info) -/atom/movable/screen/movable/action_button/MouseExited() - closeToolTip(usr) +/atom/movable/screen/movable/action_button/proc/dump_save() + var/mob/user = our_hud.mymob + if(!user?.client) + return + user.client.prefs.action_buttons_screen_locs -= "[name]_[id]" + user.client.prefs.queue_save_pref(1 SECONDS, TRUE) /datum/hud/proc/get_action_buttons_icons() . = list() .["bg_icon"] = ui_style .["bg_state"] = "template" - //TODO : Make these fit theme - .["toggle_icon"] = 'icons/mob/actions.dmi' - .["toggle_hide"] = "hide" - .["toggle_show"] = "show" - //see human and alien hud for specific implementations. /mob/proc/update_action_buttons_icon(status_only = FALSE) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon(status_only) + A.UpdateButtons(status_only) //This is the proc used to update all the action buttons. /mob/proc/update_action_buttons(reload_screen) @@ -191,56 +161,243 @@ if(hud_used.hud_shown != HUD_STYLE_STANDARD) return - var/button_number = 0 - var/list/cview = getviewsize(client.view) - var/supportedcolumns = cview[1]-2 + for(var/datum/action/action as anything in actions) + var/atom/movable/screen/movable/action_button/button = action.viewers[hud_used] + action.UpdateButtons() + if(reload_screen) + client.screen += button - if(hud_used.action_buttons_hidden) - for(var/datum/action/A in actions) - A.button.screen_loc = null - if(reload_screen) - client.screen += A.button - else - for(var/datum/action/A in actions) - A.UpdateButtonIcon() - var/atom/movable/screen/movable/action_button/B = A.button - if(B.ordered) - button_number++ - if(B.moved) - B.screen_loc = B.moved - else - B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number, supportedcolumns) - if(reload_screen) - client.screen += B - - if(!button_number) - hud_used.hide_actions_toggle.screen_loc = null - return - - if(!hud_used.hide_actions_toggle.moved) - hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1, supportedcolumns) - else - hud_used.hide_actions_toggle.screen_loc = hud_used.hide_actions_toggle.moved if(reload_screen) - client.screen += hud_used.hide_actions_toggle + hud_used.update_our_owner() + // This holds the logic for the palette buttons + hud_used.palette_actions.refresh_actions() -/datum/hud/proc/ButtonNumberToScreenCoords(number, supportedcolumns) // TODO : Make this zero-indexed for readabilty - var/row = round((number - 1)/supportedcolumns) - var/col = ((number - 1)%(supportedcolumns)) + 1 +/atom/movable/screen/button_palette + desc = "Drag buttons to move them
Shift-click any button to reset it
Alt-click this to reset all buttons" + icon = 'icons/hud/64x16_actions.dmi' + icon_state = "screen_gen_palette" + screen_loc = ui_action_palette + var/datum/hud/our_hud + var/expanded = FALSE + /// Id of any currently running timers that set our color matrix + var/color_timer_id - var/coord_col = "+[col-1]" - var/coord_col_offset = 2 + 2 * col +/atom/movable/screen/button_palette/Destroy() + if(our_hud) + our_hud.mymob?.client?.screen -= src + our_hud.toggle_palette = null + our_hud = null + return ..() - var/coord_row = "[row ? -row : "+0"]" +/atom/movable/screen/button_palette/Initialize(mapload) + . = ..() + update_appearance() - return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:-6" +/atom/movable/screen/button_palette/proc/set_hud(datum/hud/our_hud) + src.our_hud = our_hud + refresh_owner() -/datum/hud/proc/SetButtonCoords(atom/movable/screen/button,number, supportedcolumns) - var/row = round((number-1)/supportedcolumns) - var/col = ((number - 1)%(supportedcolumns)) + 1 - var/x_offset = 32*(col-1) + 4 + 2*col - var/y_offset = -32*(row+1) + 26 +/atom/movable/screen/button_palette/update_name(updates) + . = ..() + if(expanded) + name = "Hide Buttons" + else + name = "Show Buttons" - var/matrix/M = matrix() - M.Translate(x_offset,y_offset) - button.transform = M +/atom/movable/screen/button_palette/proc/refresh_owner() + var/mob/viewer = our_hud.mymob + if(viewer.client) + viewer.client.screen |= src + + var/list/settings = our_hud.get_action_buttons_icons() + var/ui_icon = "[settings["bg_icon"]]" + var/list/ui_segments = splittext(ui_icon, ".") + var/list/ui_paths = splittext(ui_segments[1], "/") + var/ui_name = ui_paths[length(ui_paths)] + + icon_state = "[ui_name]_palette" + +/atom/movable/screen/button_palette/MouseEntered(location, control, params) + . = ..() + if(QDELETED(src)) + return + show_tooltip(params) + +/atom/movable/screen/button_palette/MouseExited() + closeToolTip(usr) + return ..() + +/atom/movable/screen/button_palette/proc/show_tooltip(params) + openToolTip(usr, src, params, title = name, content = desc) + +GLOBAL_LIST_INIT(palette_added_matrix, list(0.4,0.5,0.2,0, 0,1.4,0,0, 0,0.4,0.6,0, 0,0,0,1, 0,0,0,0)) +GLOBAL_LIST_INIT(palette_removed_matrix, list(1.4,0,0,0, 0.7,0.4,0,0, 0.4,0,0.6,0, 0,0,0,1, 0,0,0,0)) + +/atom/movable/screen/button_palette/proc/play_item_added() + color_for_now(GLOB.palette_added_matrix) + +/atom/movable/screen/button_palette/proc/play_item_removed() + color_for_now(GLOB.palette_removed_matrix) + +/atom/movable/screen/button_palette/proc/color_for_now(list/color) + if(color_timer_id) + return + add_atom_colour(color, TEMPORARY_COLOUR_PRIORITY) //We unfortunately cannot animate matrix colors. Curse you lummy it would be ~~non~~trivial to interpolate between the two valuessssssssss + color_timer_id = addtimer(CALLBACK(src, .proc/remove_color, color), 2 SECONDS) + +/atom/movable/screen/button_palette/proc/remove_color(list/to_remove) + color_timer_id = null + remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, to_remove) + +/atom/movable/screen/button_palette/proc/can_use(mob/user) + if (isobserver(user)) + var/mob/dead/observer/O = user + return !O.observetarget + return TRUE + +/atom/movable/screen/button_palette/Click(location, control, params) + if(!can_use(usr)) + return + + var/list/modifiers = params2list(params) + + if(LAZYACCESS(modifiers, ALT_CLICK)) + for(var/datum/action/action as anything in usr.actions) // Reset action positions to default + for(var/datum/hud/hud as anything in action.viewers) + var/atom/movable/screen/movable/action_button/button = action.viewers[hud] + hud.position_action(button, SCRN_OBJ_DEFAULT) + to_chat(usr, span_notice("Action button positions have been reset.")) + return TRUE + + set_expanded(!expanded) + +/atom/movable/screen/button_palette/proc/clicked_while_open(datum/source, atom/target, atom/location, control, params, mob/user) + if(istype(target, /atom/movable/screen/movable/action_button) || istype(target, /atom/movable/screen/palette_scroll) || target == src) // If you're clicking on an action button, or us, you can live + return + set_expanded(FALSE) + if(source) + UnregisterSignal(source, COMSIG_CLIENT_CLICK) + +/atom/movable/screen/button_palette/proc/set_expanded(new_expanded) + var/datum/action_group/our_group = our_hud.palette_actions + if(!length(our_group.actions)) //Looks dumb, trust me lad + new_expanded = FALSE + if(expanded == new_expanded) + return + + expanded = new_expanded + our_group.refresh_actions() + update_appearance() + + if(!usr.client) + return + + if(expanded) + RegisterSignal(usr.client, COMSIG_CLIENT_CLICK, .proc/clicked_while_open) + else + UnregisterSignal(usr.client, COMSIG_CLIENT_CLICK) + + closeToolTip(usr) //Our tooltips are now invalid, can't seem to update them in one frame, so here, just close them + +/atom/movable/screen/palette_scroll + icon = 'icons/mob/screen_gen.dmi' + screen_loc = ui_palette_scroll + /// How should we move the palette's actions? + /// Positive scrolls down the list, negative scrolls back + var/scroll_direction = 0 + var/datum/hud/our_hud + +/atom/movable/screen/palette_scroll/proc/can_use(mob/user) + if (isobserver(user)) + var/mob/dead/observer/O = user + return !O.observetarget + return TRUE + +/atom/movable/screen/palette_scroll/proc/set_hud(datum/hud/our_hud) + src.our_hud = our_hud + refresh_owner() + +/atom/movable/screen/palette_scroll/proc/refresh_owner() + var/mob/viewer = our_hud.mymob + if(viewer.client) + viewer.client.screen |= src + + var/list/settings = our_hud.get_action_buttons_icons() + icon = settings["bg_icon"] + +/atom/movable/screen/palette_scroll/Click(location, control, params) + if(!can_use(usr)) + return + our_hud.palette_actions.scroll(scroll_direction) + +/atom/movable/screen/palette_scroll/MouseEntered(location, control, params) + . = ..() + if(QDELETED(src)) + return + openToolTip(usr, src, params, title = name, content = desc) + +/atom/movable/screen/palette_scroll/MouseExited() + closeToolTip(usr) + return ..() + +/atom/movable/screen/palette_scroll/down + name = "Scroll Down" + desc = "Click on this to scroll the actions above down" + icon_state = "scroll_down" + scroll_direction = 1 + +/atom/movable/screen/palette_scroll/down/Destroy() + if(our_hud) + our_hud.mymob?.client?.screen -= src + our_hud.palette_down = null + our_hud = null + return ..() + +/atom/movable/screen/palette_scroll/up + name = "Scroll Up" + desc = "Click on this to scroll the actions above up" + icon_state = "scroll_up" + scroll_direction = -1 + +/atom/movable/screen/palette_scroll/up/Destroy() + if(our_hud) + our_hud.mymob?.client?.screen -= src + our_hud.palette_up = null + our_hud = null + return ..() + +/// Exists so you have a place to put your buttons when you move them around +/atom/movable/screen/action_landing + name = "Button Space" + desc = "Drag and drop a button into this spot
to add it to the group" + icon = 'icons/mob/screen_gen.dmi' + icon_state = "reserved" + // We want our whole 32x32 space to be clickable, so dropping's forgiving + mouse_opacity = MOUSE_OPACITY_OPAQUE + var/datum/action_group/owner + +/atom/movable/screen/action_landing/Destroy() + if(owner) + owner.landing = null + owner?.owner?.mymob?.client?.screen -= src + owner.refresh_actions() + owner = null + return ..() + +/atom/movable/screen/action_landing/proc/set_owner(datum/action_group/owner) + src.owner = owner + refresh_owner() + +/atom/movable/screen/action_landing/proc/refresh_owner() + var/datum/hud/our_hud = owner.owner + var/mob/viewer = our_hud.mymob + if(viewer.client) + viewer.client.screen |= src + + var/list/settings = our_hud.get_action_buttons_icons() + icon = settings["bg_icon"] + +/// Reacts to having a button dropped on it +/atom/movable/screen/action_landing/proc/hit_by(atom/movable/screen/movable/action_button/button) + var/datum/hud/our_hud = owner.owner + our_hud.position_action(button, owner.location) diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 5029d51452..592a647e5d 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -75,9 +75,9 @@ /mob/proc/clear_alert(category, clear_override = FALSE) var/atom/movable/screen/alert/alert = alerts[category] if(!alert) - return 0 + return FALSE if(alert.override_alerts && !clear_override) - return 0 + return FALSE alerts -= category if(client && hud_used) @@ -784,7 +784,7 @@ so as to remain in compliance with the most up-to-date laws." if(!hud_shown) for(var/i = 1, i <= alerts.len, i++) screenmob.client.screen -= alerts[alerts[i]] - return 1 + return TRUE for(var/i = 1, i <= alerts.len, i++) var/atom/movable/screen/alert/alert = alerts[alerts[i]] if(alert.icon_state == "template") @@ -807,7 +807,7 @@ so as to remain in compliance with the most up-to-date laws." if(!viewmob) for(var/M in mymob.observers) reorganize_alerts(M) - return 1 + return TRUE /atom/movable/screen/alert/Click(location, control, params) if(!usr || !usr.client) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index d9f192e1c9..53d69fe01e 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -76,8 +76,13 @@ GLOBAL_LIST_INIT(available_ui_styles, list( // We don't actually do proccalls really yet, so let's grab at prefs - var/atom/movable/screen/movable/action_button/hide_toggle/hide_actions_toggle - var/action_buttons_hidden = FALSE + var/atom/movable/screen/button_palette/toggle_palette + var/atom/movable/screen/palette_scroll/down/palette_down + var/atom/movable/screen/palette_scroll/up/palette_up + + var/datum/action_group/palette/palette_actions + var/datum/action_group/listed/listed_actions + var/list/floating_actions var/atom/movable/screen/healths var/atom/movable/screen/healthdoll @@ -94,10 +99,12 @@ GLOBAL_LIST_INIT(available_ui_styles, list( // will fall back to the default if any of these are null ui_style = ui_style2icon(owner.client && owner.client.prefs && owner.client.prefs.UI_style) - hide_actions_toggle = new - hide_actions_toggle.InitialiseIcon(src) - if(mymob.client) - hide_actions_toggle.locked = mymob.client.prefs.buttons_locked + toggle_palette = new() + toggle_palette.set_hud(src) + palette_down = new() + palette_down.set_hud(src) + palette_up = new() + palette_up.set_hud(src) hand_slots = list() @@ -113,7 +120,13 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if(mymob.hud_used == src) mymob.hud_used = null - QDEL_NULL(hide_actions_toggle) + QDEL_NULL(toggle_palette) + QDEL_NULL(palette_down) + QDEL_NULL(palette_up) + QDEL_NULL(palette_actions) + QDEL_NULL(listed_actions) + QDEL_LIST(floating_actions) + QDEL_NULL(module_store_icon) QDEL_LIST(static_inventory) @@ -151,10 +164,14 @@ GLOBAL_LIST_INIT(available_ui_styles, list( /mob/proc/create_mob_hud() if(!client || hud_used) return - hud_used = new hud_type(src) + set_hud_used(new hud_type(src)) update_sight() SEND_SIGNAL(src, COMSIG_MOB_HUD_CREATED) +/mob/proc/set_hud_used(datum/hud/new_hud) + hud_used = new_hud + new_hud.build_action_groups() + //Version denotes which style should be displayed. blank or 0 means "next version" /datum/hud/proc/show_hud(version = 0, mob/viewmob) if(!ismob(mymob)) @@ -163,6 +180,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if(!screenmob.client) return FALSE + // This code is the absolute fucking worst, I want it to go die in a fire + // Seriously, why screenmob.client.screen = list() screenmob.client.update_clickcatcher() @@ -184,7 +203,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list( if(infodisplay.len) screenmob.client.screen += infodisplay - screenmob.client.screen += hide_actions_toggle + screenmob.client.screen += toggle_palette if(action_intent) action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position @@ -275,7 +294,6 @@ GLOBAL_LIST_INIT(available_ui_styles, list( ui_style = new_ui_style build_hand_slots() - hide_actions_toggle.InitialiseIcon(src) //Triggered when F12 is pressed (Unless someone changed something in the DMF) /mob/verb/button_pressed_F12() @@ -323,3 +341,312 @@ GLOBAL_LIST_INIT(available_ui_styles, list( /datum/hud/proc/update_locked_slots() return + +/datum/hud/proc/position_action(atom/movable/screen/movable/action_button/button, position) + // This is kinda a hack, I'm sorry. + // Basically, FLOATING is never a valid position to pass into this proc. It exists as a generic marker for manually positioned buttons + // Not as a position to target + if(position == SCRN_OBJ_FLOATING) + return + if(button.location != SCRN_OBJ_DEFAULT) + hide_action(button) + switch(position) + if(SCRN_OBJ_DEFAULT) // Reset to the default + button.dump_save() // Nuke any existing saves + position_action(button, button.linked_action.default_button_position) + return + if(SCRN_OBJ_IN_LIST) + listed_actions.insert_action(button) + if(SCRN_OBJ_IN_PALETTE) + palette_actions.insert_action(button) + else // If we don't have it as a define, this is a screen_loc, and we should be floating + floating_actions += button + button.screen_loc = position + position = SCRN_OBJ_FLOATING + + button.location = position + +/datum/hud/proc/position_action_relative(atom/movable/screen/movable/action_button/button, atom/movable/screen/movable/action_button/relative_to) + if(button.location != SCRN_OBJ_DEFAULT) + hide_action(button) + switch(relative_to.location) + if(SCRN_OBJ_IN_LIST) + listed_actions.insert_action(button, listed_actions.index_of(relative_to)) + if(SCRN_OBJ_IN_PALETTE) + palette_actions.insert_action(button, palette_actions.index_of(relative_to)) + if(SCRN_OBJ_FLOATING) // If we don't have it as a define, this is a screen_loc, and we should be floating + floating_actions += button + var/client/our_client = mymob.client + if(!our_client) + position_action(button, button.linked_action.default_button_position) + return + button.screen_loc = get_valid_screen_location(relative_to.screen_loc, world.icon_size, our_client.view_size.getView()) // Asks for a location adjacent to our button that won't overflow the map + + button.location = relative_to.location + +/// Removes the passed in action from its current position on the screen +/datum/hud/proc/hide_action(atom/movable/screen/movable/action_button/button) + switch(button.location) + if(SCRN_OBJ_DEFAULT) // Invalid + CRASH("We just tried to hide an action buttion that somehow has the default position as its location, you done fucked up") + if(SCRN_OBJ_FLOATING) + floating_actions -= button + if(SCRN_OBJ_IN_LIST) + listed_actions.remove_action(button) + if(SCRN_OBJ_IN_PALETTE) + palette_actions.remove_action(button) + button.screen_loc = null + +/// Generates visual landings for all groups that the button is not a memeber of +/datum/hud/proc/generate_landings(atom/movable/screen/movable/action_button/button) + listed_actions.generate_landing() + palette_actions.generate_landing() + +/// Clears all currently visible landings +/datum/hud/proc/hide_landings() + listed_actions.clear_landing() + palette_actions.clear_landing() + +// Updates any existing "owned" visuals, ensures they continue to be visible +/datum/hud/proc/update_our_owner() + toggle_palette.refresh_owner() + palette_down.refresh_owner() + palette_up.refresh_owner() + listed_actions.update_landing() + palette_actions.update_landing() + +/// Ensures all of our buttons are properly within the bounds of our client's view, moves them if they're not +/datum/hud/proc/view_audit_buttons() + var/our_view = mymob?.client?.view + if(!our_view) + return + listed_actions.check_against_view() + palette_actions.check_against_view() + for(var/atom/movable/screen/movable/action_button/floating_button as anything in floating_actions) + var/list/current_offsets = screen_loc_to_offset(floating_button.screen_loc) + // We set the view arg here, so the output will be properly hemm'd in by our new view + floating_button.screen_loc = offset_to_screen_loc(current_offsets[1], current_offsets[2], view = our_view) + +/// Generates and fills new action groups with our mob's current actions +/datum/hud/proc/build_action_groups() + listed_actions = new(src) + palette_actions = new(src) + floating_actions = list() + for(var/datum/action/action as anything in mymob.actions) + var/atom/movable/screen/movable/action_button/button = action.viewers[src] + if(!button) + action.ShowTo(mymob) + button = action.viewers[src] + else + position_action(button, button.location) + +/datum/action_group + /// The hud we're owned by + var/datum/hud/owner + /// The actions we're managing + var/list/atom/movable/screen/movable/action_button/actions + /// The initial vertical offset of our action buttons + var/north_offset = 0 + /// The pixel vertical offset of our action buttons + var/pixel_north_offset = 0 + /// Max amount of buttons we can have per row + /// Indexes at 1 + var/column_max = 0 + /// How far "ahead" of the first row we start. Lets us "scroll" our rows + /// Indexes at 1 + var/row_offset = 0 + /// How many rows of actions we can have at max before we just stop hiding + /// Indexes at 1 + var/max_rows = INFINITY + /// The screen location we go by + var/location + /// Our landing screen object + var/atom/movable/screen/action_landing/landing + +/datum/action_group/New(datum/hud/owner) + ..() + actions = list() + src.owner = owner + +/datum/action_group/Destroy() + owner = null + QDEL_NULL(landing) + QDEL_LIST(actions) + return ..() + +/datum/action_group/proc/insert_action(atom/movable/screen/action, index) + if(action in actions) + if(actions[index] == action) + return + actions -= action // Don't dupe, come on + if(!index) + index = length(actions) + 1 + index = min(length(actions) + 1, index) + actions.Insert(index, action) + refresh_actions() + +/datum/action_group/proc/remove_action(atom/movable/screen/action) + actions -= action + refresh_actions() + +/datum/action_group/proc/refresh_actions() + + // We don't use size() here because landings are not canon + var/total_rows = ROUND_UP(length(actions) / column_max) + total_rows -= max_rows // Lets get the amount of rows we're off from our max + row_offset = clamp(row_offset, 0, total_rows) // You're not allowed to offset so far that we have a row of blank space + + var/button_number = 0 + for(var/atom/movable/screen/button as anything in actions) + var/postion = ButtonNumberToScreenCoords(button_number ) + button.screen_loc = postion + button_number++ + + if(landing) + var/postion = ButtonNumberToScreenCoords(button_number, landing = TRUE) // Need a good way to count buttons off screen, but allow this to display in the right place if it's being placed with no concern for dropdown + landing.screen_loc = postion + button_number++ + +/// Accepts a number represeting our position in the group, indexes at 0 to make the math nicer +/datum/action_group/proc/ButtonNumberToScreenCoords(number, landing = FALSE) + var/row = round(number / column_max) + row -= row_offset // If you're less then 0, you don't get to render, this lets us "scroll" rows ya feel? + if(row < 0) + return null + + // Could use >= here, but I think it's worth noting that the two start at different places, since row is based on number here + if(row > max_rows - 1) + if(!landing) // If you're not a landing, go away please. thx + return null + // We always want to render landings, even if their action button can't be displayed. + // So we set a row equal to the max amount of rows + 1. Willing to overrun that max slightly to properly display the landing spot + row = max_rows // Remembering that max_rows indexes at 1, and row indexes at 0 + + // We're going to need to set our column to match the first item in the last row, so let's set number properly now + number = row * column_max + + var/visual_row = row + north_offset + var/coord_row = visual_row ? "-[visual_row]" : "+0" + + var/visual_column = number % column_max + var/coord_col = "+[visual_column]" + var/coord_col_offset = 4 + 2 * (visual_column + 1) + return "WEST[coord_col]:[coord_col_offset],NORTH[coord_row]:-[pixel_north_offset]" + +/datum/action_group/proc/check_against_view() + var/owner_view = owner?.mymob?.client?.view + if(!owner_view) + return + // Unlikey as it is, we may have been changed. Want to start from our target position and fail down + column_max = initial(column_max) + // Convert our viewer's view var into a workable offset + var/list/view_size = view_to_pixels(owner_view) + + // We're primarially concerned about width here, if someone makes us 1x2000 I wish them a swift and watery death + var/furthest_screen_loc = ButtonNumberToScreenCoords(column_max - 1) + var/list/offsets = screen_loc_to_offset(furthest_screen_loc, owner_view) + if(offsets[1] > world.icon_size && offsets[1] < view_size[1] && offsets[2] > world.icon_size && offsets[2] < view_size[2]) // We're all good + return + + for(column_max in column_max - 1 to 1 step -1) // Yes I could do this by unwrapping ButtonNumberToScreenCoords, but I don't feel like it + var/tested_screen_loc = ButtonNumberToScreenCoords(column_max) + offsets = screen_loc_to_offset(tested_screen_loc, owner_view) + // We've found a valid max length, pack it in + if(offsets[1] > world.icon_size && offsets[1] < view_size[1] && offsets[2] > world.icon_size && offsets[2] < view_size[2]) + break + // Use our newly resized column max + refresh_actions() + +/// Returns the amount of objects we're storing at the moment +/datum/action_group/proc/size() + var/amount = length(actions) + if(landing) + amount += 1 + return amount + +/datum/action_group/proc/index_of(atom/movable/screen/get_location) + return actions.Find(get_location) + +/// Generates a landing object that can be dropped on to join this group +/datum/action_group/proc/generate_landing() + if(landing) + return + landing = new() + landing.set_owner(src) + refresh_actions() + +/// Clears any landing objects we may currently have +/datum/action_group/proc/clear_landing() + QDEL_NULL(landing) + +/datum/action_group/proc/update_landing() + if(!landing) + return + landing.refresh_owner() + +/datum/action_group/proc/scroll(amount) + row_offset += amount + refresh_actions() + +/datum/action_group/palette + north_offset = 2 + column_max = 3 + max_rows = 3 + location = SCRN_OBJ_IN_PALETTE + +/datum/action_group/palette/insert_action(atom/movable/screen/action, index) + . = ..() + var/atom/movable/screen/button_palette/palette = owner.toggle_palette + palette.play_item_added() + +/datum/action_group/palette/remove_action(atom/movable/screen/action) + . = ..() + var/atom/movable/screen/button_palette/palette = owner.toggle_palette + palette.play_item_removed() + if(!length(actions)) + palette.set_expanded(FALSE) + +/datum/action_group/palette/refresh_actions() + var/atom/movable/screen/button_palette/palette = owner.toggle_palette + var/atom/movable/screen/palette_scroll/scroll_down = owner.palette_down + var/atom/movable/screen/palette_scroll/scroll_up = owner.palette_up + + var/actions_above = round((owner.listed_actions.size() - 1) / owner.listed_actions.column_max) + north_offset = initial(north_offset) + actions_above + + palette.screen_loc = ui_action_palette_offset(actions_above) + var/action_count = length(owner?.mymob?.actions) + var/our_row_count = round((length(actions) - 1) / column_max) + if(!action_count) + palette.screen_loc = null + + if(palette.expanded && action_count && our_row_count >= max_rows) + scroll_down.screen_loc = ui_palette_scroll_offset(actions_above) + scroll_up.screen_loc = ui_palette_scroll_offset(actions_above) + else + scroll_down.screen_loc = null + scroll_up.screen_loc = null + + return ..() + +/datum/action_group/palette/ButtonNumberToScreenCoords(number, landing) + var/atom/movable/screen/button_palette/palette = owner.toggle_palette + if(palette.expanded) + return ..() + + if(!landing) + return null + + // We only render the landing in this case, so we force it to be the second item displayed (Second rather then first since it looks nicer) + // Remember the number var indexes at 0 + return ..(1 + (row_offset * column_max), landing) + + +/datum/action_group/listed + pixel_north_offset = 6 + column_max = 10 + location = SCRN_OBJ_IN_LIST + +/datum/action_group/listed/refresh_actions() + . = ..() + owner?.palette_actions.refresh_actions() // We effect them, so we gotta refresh em diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 1a17d2fb74..8e7953bdd5 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -29,7 +29,7 @@ /atom/movable/screen/human/equip/Click() if(ismecha(usr.loc)) // stops inventory actions in a mech - return 1 + return TRUE var/mob/living/carbon/human/H = usr H.quick_equip() diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index a00687e263..6c9f852ef5 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -9,9 +9,8 @@ //Not tied to the grid, places it's center where the cursor is /atom/movable/screen/movable + mouse_drag_pointer = 'icons/effects/mouse_pointers/screen_drag.dmi' var/snap2grid = FALSE - var/moved = FALSE - var/locked = FALSE var/x_off = -16 var/y_off = -16 @@ -21,35 +20,29 @@ /atom/movable/screen/movable/snap snap2grid = TRUE - /atom/movable/screen/movable/MouseDrop(over_object, src_location, over_location, src_control, over_control, params) - if(locked) //no! I am locked! begone! + var/position = mouse_params_to_position(params) + if(!position) return - var/list/PM = params2list(params) + + screen_loc = position + +/// Takes mouse parmas as input, returns a string representing the appropriate mouse position +/atom/movable/screen/movable/proc/mouse_params_to_position(params) + var/list/modifiers = params2list(params) //No screen-loc information? abort. - if(!PM || !PM["screen-loc"]) + if(!LAZYACCESS(modifiers, SCREEN_LOC)) return - - //Split screen-loc up into X+Pixel_X and Y+Pixel_Y - var/list/screen_loc_params = splittext(PM["screen-loc"], ",") - - //Split X+Pixel_X up into list(X, Pixel_X) - var/list/screen_loc_X = splittext(screen_loc_params[1],":") - - //Split Y+Pixel_Y up into list(Y, Pixel_Y) - var/list/screen_loc_Y = splittext(screen_loc_params[2],":") - + var/client/our_client = usr.client + var/list/offset = screen_loc_to_offset(LAZYACCESS(modifiers, SCREEN_LOC)) if(snap2grid) //Discard Pixel Values - screen_loc = "[screen_loc_X[1]],[screen_loc_Y[1]]" - + offset[1] = FLOOR(offset[1], world.icon_size) // drops any pixel offset + offset[2] = FLOOR(offset[2], world.icon_size) // drops any pixel offset else //Normalise Pixel Values (So the object drops at the center of the mouse, not 16 pixels off) - var/pix_X = text2num(screen_loc_X[2]) + x_off - var/pix_Y = text2num(screen_loc_Y[2]) + y_off - screen_loc = "[screen_loc_X[1]]:[pix_X],[screen_loc_Y[1]]:[pix_Y]" - - moved = screen_loc - + offset[1] += x_off + offset[2] += y_off + return offset_to_screen_loc(offset[1], offset[2], our_client?.view) //Debug procs /client/proc/test_movable_UI() diff --git a/code/_onclick/hud/new_player.dm b/code/_onclick/hud/new_player.dm index b01199c6c2..c5d3cbca89 100644 --- a/code/_onclick/hud/new_player.dm +++ b/code/_onclick/hud/new_player.dm @@ -5,6 +5,12 @@ ///Whether the menu is currently on the client's screen or not var/menu_hud_status = TRUE +/datum/hud/new_player/New(mob/dead/new_player/owner) + . = ..() + if(!owner.age_verify()) + return + populate_buttons(owner) + /datum/hud/new_player/proc/populate_buttons(mob/dead/new_player/owner) var/list/buttons = subtypesof(/atom/movable/screen/lobby) for(var/button_type in buttons) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index e20bae87d7..175d6e2a53 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -7,7 +7,7 @@ /atom/movable/screen/robot/Click() if(isobserver(usr)) - return 1 + return TRUE /atom/movable/screen/robot/module/Click() if(..()) @@ -15,7 +15,7 @@ var/mob/living/silicon/robot/R = usr if(R.module.type != /obj/item/robot_module) R.hud_used.toggle_show_robot_modules() - return 1 + return TRUE R.pick_module() /atom/movable/screen/robot/module1 diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index e5cd4c71cc..72756c9abf 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -62,12 +62,12 @@ // At this point in client Click() code we have passed the 1/10 sec check and little else // We don't even know if it's a middle click if(usr.incapacitated()) - return 1 + return TRUE if(ismob(usr)) var/mob/M = usr M.swap_hand() - return 1 + return TRUE // /atom/movable/screen/skills // name = "skills" @@ -452,7 +452,7 @@ var/icon_y = text2num(LAZYACCESS(modifiers, "icon-y")) var/choice = get_zone_at(icon_x, icon_y) if (!choice) - return 1 + return TRUE return set_selected_zone(choice, usr) diff --git a/code/_onclick/hud/screentip.dm b/code/_onclick/hud/screentip.dm index 5128448561..b9b27072b3 100644 --- a/code/_onclick/hud/screentip.dm +++ b/code/_onclick/hud/screentip.dm @@ -17,4 +17,4 @@ SIGNAL_HANDLER if(!hud || !hud.mymob.client.view_size) //Might not have been initialized by now return - maptext_width = getviewsize(hud.mymob.client.view_size.getView())[1] * world.icon_size + maptext_width = view_to_pixels(hud.mymob.client.view_size.getView())[1] diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 23486cac29..488a50193c 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -236,7 +236,7 @@ attack_message_local = "You [message_verb] yourself[message_hit_area] with [I]" visible_message("[attack_message]",\ "[attack_message_local]", null, COMBAT_MESSAGE_RANGE) - return 1 + return TRUE /// How much stamina this takes to swing this is not for realism purposes hecc off. /obj/item/proc/getweight(mob/living/user, multiplier = 1, trait = SKILL_STAMINA_COST) diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 073f50d8c5..fc9a4207ae 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -18,7 +18,7 @@ . = attackchain_flags // Special glove functions: - // If the gloves do anything, have them return 1 to stop + // If the gloves do anything, have them return TRUE to stop // normal attack_hand() here. var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines if(proximity && istype(G)) @@ -99,7 +99,7 @@ */ /mob/living/carbon/RestrainedClickOn(atom/A) - return 0 + return FALSE /mob/living/carbon/human/RangedAttack(atom/A, mouseparams) . = ..() diff --git a/code/_rendering/atom_huds/data_huds.dm b/code/_rendering/atom_huds/data_huds.dm index 291923ee4e..f120a0b824 100644 --- a/code/_rendering/atom_huds/data_huds.dm +++ b/code/_rendering/atom_huds/data_huds.dm @@ -24,13 +24,13 @@ /datum/atom_hud/data/human/medical/basic/proc/check_sensors(mob/living/carbon/human/H) if(!istype(H)) - return 0 + return FALSE var/obj/item/clothing/under/U = H.w_uniform if(!istype(U)) - return 0 + return FALSE if(U.sensor_mode <= SENSOR_VITALS) - return 0 - return 1 + return FALSE + return TRUE /datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H) if(check_sensors(H)) diff --git a/code/controllers/hooks.dm b/code/controllers/hooks.dm index fe6a49c854..9eb6631c3b 100644 --- a/code/controllers/hooks.dm +++ b/code/controllers/hooks.dm @@ -11,9 +11,9 @@ * @code /hook/foo/proc/bar() if(1) - return 1 //Sucessful + return TRUE //Sucessful else - return 0 //Error, or runtime. + return FALSE //Error, or runtime. * @endcode * All hooks must return nonzero on success, as runtimes will force return null. */ diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 055271fd86..1ec8e1d2bb 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -129,7 +129,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new /proc/Recreate_MC() . = -1 //so if we runtime, things know we failed if (world.time < Master.restart_timeout) - return 0 + return FALSE if (world.time < Master.restart_clear) Master.restart_count *= 0.5 @@ -142,7 +142,7 @@ GLOBAL_REAL(Master, /datum/controller/master) = new new/datum/controller/master() catch return -1 - return 1 + return TRUE /datum/controller/master/Recover() diff --git a/code/controllers/subsystem/activity.dm b/code/controllers/subsystem/activity.dm index d10e67f210..91f31fc2e8 100644 --- a/code/controllers/subsystem/activity.dm +++ b/code/controllers/subsystem/activity.dm @@ -48,7 +48,7 @@ SUBSYSTEM_DEF(activity) /datum/controller/subsystem/activity/proc/get_average_threat() if(!length(threat_history)) - return 0 + return FALSE var/total_weight = 0 var/total_amt = 0 for(var/i in 1 to threat_history.len-1) diff --git a/code/controllers/subsystem/augury.dm b/code/controllers/subsystem/augury.dm index 53c86004a6..f7a7c66718 100644 --- a/code/controllers/subsystem/augury.dm +++ b/code/controllers/subsystem/augury.dm @@ -69,15 +69,15 @@ SUBSYSTEM_DEF(augury) SSaugury.watchers += owner to_chat(owner, "You are now auto-following debris.") active = TRUE - UpdateButtonIcon() + UpdateButtons() /datum/action/innate/augury/Deactivate() SSaugury.watchers -= owner to_chat(owner, "You are no longer auto-following debris.") active = FALSE - UpdateButtonIcon() + UpdateButtons() -/datum/action/innate/augury/UpdateButtonIcon(status_only = FALSE, force) +/datum/action/innate/augury/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force) ..() if(active) button.icon_state = "template_active" diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 4daff91575..9ff65d83c0 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -47,7 +47,7 @@ SUBSYSTEM_DEF(job) var/list/all_jobs = subtypesof(/datum/job) if(!all_jobs.len) to_chat(world, "Error setting up jobs, no job datums found") - return 0 + return FALSE for(var/J in all_jobs) var/datum/job/job = new J() @@ -65,7 +65,7 @@ SUBSYSTEM_DEF(job) name_occupations[job.title] = job type_occupations[J] = job - return 1 + return TRUE /datum/controller/subsystem/job/proc/GetJob(rank) @@ -199,8 +199,8 @@ SUBSYSTEM_DEF(job) continue var/mob/dead/new_player/candidate = pick(candidates) if(AssignRole(candidate, command_position)) - return 1 - return 0 + return TRUE + return FALSE //This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level @@ -222,7 +222,7 @@ SUBSYSTEM_DEF(job) var/ai_selected = 0 var/datum/job/job = GetJob("AI") if(!job) - return 0 + return FALSE for(var/i = job.total_positions, i > 0, i--) for(var/level in level_order) var/list/candidates = list() @@ -233,8 +233,8 @@ SUBSYSTEM_DEF(job) ai_selected++ break if(ai_selected) - return 1 - return 0 + return TRUE + return FALSE /** Proc DivideOccupations @@ -599,8 +599,8 @@ SUBSYSTEM_DEF(job) if(hpc || epc) var/relevent_cap = max(hpc, epc) if((initial_players_to_assign - unassigned.len) >= relevent_cap) - return 1 - return 0 + return TRUE + return FALSE /datum/controller/subsystem/job/proc/RejectPlayer(mob/dead/new_player/player) if(player.mind && player.mind.special_role) diff --git a/code/controllers/subsystem/pathfinder.dm b/code/controllers/subsystem/pathfinder.dm index ccbea79306..cee625b3f1 100644 --- a/code/controllers/subsystem/pathfinder.dm +++ b/code/controllers/subsystem/pathfinder.dm @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(pathfinder) flow[t] = M return free else - return 0 + return FALSE /datum/flowcache/proc/toolong(l) log_game("Pathfinder route took longer than 150 ticks, src bot [flow[flow[l]]]") diff --git a/code/controllers/subsystem/radio.dm b/code/controllers/subsystem/radio.dm index 8299709392..22f7b49207 100644 --- a/code/controllers/subsystem/radio.dm +++ b/code/controllers/subsystem/radio.dm @@ -25,7 +25,7 @@ SUBSYSTEM_DEF(radio) if(frequency) frequency.remove_listener(device) // let's don't delete frequencies in case a non-listener keeps a reference - return 1 + return TRUE /datum/controller/subsystem/radio/proc/return_frequency(new_frequency as num) var/f_text = num2text(new_frequency) diff --git a/code/controllers/subsystem/research.dm b/code/controllers/subsystem/research.dm index be722ed4f1..fb863690ce 100644 --- a/code/controllers/subsystem/research.dm +++ b/code/controllers/subsystem/research.dm @@ -358,7 +358,7 @@ SUBSYSTEM_DEF(research) /datum/controller/subsystem/research/proc/calculate_server_coefficient() //Diminishing returns. var/amt = servers.len if(!amt) - return 0 + return FALSE var/coeff = 100 coeff = sqrt(coeff / amt) return coeff diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 20d3ffd971..7b004c7ce6 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -294,7 +294,7 @@ SUBSYSTEM_DEF(shuttle) log_shuttle("[key_name(user)] has recalled the shuttle.") message_admins("[ADMIN_LOOKUPFLW(user)] has recalled the shuttle.") deadchat_broadcast(" has recalled the shuttle from [span_name("[get_area_name(user, TRUE)]")].", span_name("[user.real_name]"), user, message_type=DEADCHAT_ANNOUNCEMENT) - return 1 + return TRUE /datum/controller/subsystem/shuttle/proc/canRecall() if(!emergency || emergency.mode != SHUTTLE_CALL || emergencyNoRecall || SSticker.mode.name == "meteor") @@ -400,7 +400,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/toggleShuttle(shuttleId, dockHome, dockAway, timed) var/obj/docking_port/mobile/M = getShuttle(shuttleId) if(!M) - return 1 + return TRUE var/obj/docking_port/stationary/dockedAt = M.get_docked() var/destination = dockHome if(dockedAt && dockedAt.id == dockHome) @@ -411,7 +411,7 @@ SUBSYSTEM_DEF(shuttle) else if(M.initiate_docking(getDock(destination)) != DOCKING_SUCCESS) return 2 - return 0 //dock successful + return FALSE //dock successful /datum/controller/subsystem/shuttle/proc/moveShuttle(shuttleId, dockId, timed) @@ -419,14 +419,14 @@ SUBSYSTEM_DEF(shuttle) var/obj/docking_port/stationary/D = getDock(dockId) if(!M) - return 1 + return TRUE if(timed) if(M.request(D)) return 2 else if(M.initiate_docking(D) != DOCKING_SUCCESS) return 2 - return 0 //dock successful + return FALSE //dock successful /datum/controller/subsystem/shuttle/proc/request_transit_dock(obj/docking_port/mobile/M) if(!istype(M)) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 6f856f3edb..0818f41a69 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -245,7 +245,7 @@ SUBSYSTEM_DEF(ticker) mode = null SSjob.ResetOccupations() emergency_swap++ - return 0 + return FALSE CHECK_TICK //Configure mode and assign player to special mode stuff @@ -264,7 +264,7 @@ SUBSYSTEM_DEF(ticker) to_chat(world, "Error setting up [GLOB.master_mode]. Reverting to pre-game lobby.") SSjob.ResetOccupations() emergency_swap++ - return 0 + return FALSE else message_admins("DEBUG: Bypassing prestart checks...") diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 407a8f927c..d860cca1b2 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -373,7 +373,7 @@ SUBSYSTEM_DEF(vote) /datum/controller/subsystem/vote/proc/submit_vote(vote, score = 0) if(mode) if(CONFIG_GET(flag/no_dead_vote) && usr.stat == DEAD && !usr.client.holder) - return 0 + return FALSE if(vote && ISINRANGE(vote, 1, choices.len)) switch(vote_system) if(PLURALITY_VOTING) @@ -415,7 +415,7 @@ SUBSYSTEM_DEF(vote) voted[usr.ckey] = list() voted[usr.ckey][choices[vote]] = score saved -= usr.ckey - return 0 + return FALSE /datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, display = display_votes, votesystem = PLURALITY_VOTING, forced = FALSE,vote_time = -1)//CIT CHANGE - adds display argument to votes to allow for obfuscated votes vote_system = votesystem @@ -424,7 +424,7 @@ SUBSYSTEM_DEF(vote) var/next_allowed_time = (started_time + CONFIG_GET(number/vote_delay)) if(mode) to_chat(usr, "There is already a vote in progress! please wait for it to finish.") - return 0 + return FALSE var/admin = FALSE var/ckey = ckey(initiator_key) @@ -433,7 +433,7 @@ SUBSYSTEM_DEF(vote) if(next_allowed_time > world.time && !admin) to_chat(usr, "A vote was initiated recently, you must wait [DisplayTimeText(next_allowed_time-world.time)] before a new vote can be started!") - return 0 + return FALSE SEND_SOUND(world, sound('sound/misc/notice2.ogg')) reset() @@ -464,7 +464,7 @@ SUBSYSTEM_DEF(vote) if("custom") question = stripped_input(usr,"What is the vote for?") if(!question) - return 0 + return FALSE var/system_string = input(usr,"Which voting type?",GLOB.vote_type_names[1]) in GLOB.vote_type_names vote_system = GLOB.vote_type_names[system_string] for(var/i=1,i<=10,i++) @@ -488,7 +488,7 @@ SUBSYSTEM_DEF(vote) toggles ^= choices[chosen] display_votes = toggles else - return 0 + return FALSE mode = vote_type initiator = initiator_key ? initiator_key : "the Server" // austation -- Crew autotransfer vote started_time = world.time @@ -521,8 +521,8 @@ SUBSYSTEM_DEF(vote) popup.set_window_options("can_close=0") popup.set_content(SSvote.interface(C)) popup.open(0) - return 1 - return 0 + return TRUE + return FALSE /datum/controller/subsystem/vote/proc/interface(client/C) if(!C) @@ -736,7 +736,7 @@ SUBSYSTEM_DEF(vote) Remove(owner) /datum/action/vote/IsAvailable(silent = FALSE) - return 1 + return TRUE /datum/action/vote/proc/remove_from_client() if(!owner) diff --git a/code/datums/achievements/_awards.dm b/code/datums/achievements/_awards.dm index 22296b90f5..ce94829637 100644 --- a/code/datums/achievements/_awards.dm +++ b/code/datums/achievements/_awards.dm @@ -50,7 +50,7 @@ ) if(!Q.Execute(async = TRUE)) qdel(Q) - return 0 + return FALSE var/result = 0 if(Q.NextRow()) result = text2num(Q.item[1]) diff --git a/code/datums/action.dm b/code/datums/action.dm index 2d6af6c2de..6a1bbe5e63 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -11,11 +11,10 @@ var/check_flags = 0 var/required_mobility_flags = MOBILITY_USE var/processing = FALSE - var/atom/movable/screen/movable/action_button/button = null var/buttontooltipstyle = "" var/transparent_when_unavailable = TRUE - var/use_target_appearance = FALSE - var/list/target_appearance_matrix //if set, will be used to transform the target button appearance as an arglist. + /// Where any buttons we create should be by default. Accepts screen_loc and location defines + var/default_button_position = SCRN_OBJ_IN_LIST var/button_icon = 'icons/mob/actions/backgrounds.dmi' //This is the file for the BACKGROUND icon var/background_icon_state = ACTION_BUTTON_DEFAULT_BACKGROUND //And this is the state for the background icon @@ -28,12 +27,6 @@ /datum/action/New(Target) link_to(Target) - button = new - button.linked_action = src - button.name = name - button.actiontooltipstyle = buttontooltipstyle - if(desc) - button.desc = desc /datum/action/proc/link_to(Target) target = Target @@ -43,51 +36,42 @@ if(owner) Remove(owner) target = null - QDEL_NULL(button) + QDEL_LIST_ASSOC_VAL(viewers) // Qdel the buttons in the viewers list **NOT THE HUDS** return ..() /datum/action/proc/Grant(mob/M) - if(M) - if(owner) - if(owner == M) - return - Remove(owner) - owner = M - - //button id generation - var/counter = 0 - var/bitfield = 0 - for(var/datum/action/A in M.actions) - if(A.name == name && A.button.id) - counter += 1 - bitfield |= A.button.id - bitfield = ~bitfield - var/bitflag = 1 - for(var/i in 1 to (counter + 1)) - if(bitfield & bitflag) - button.id = bitflag - break - bitflag *= 2 - - M.actions += src - if(M.client) - M.client.screen += button - button.locked = M.client.prefs.buttons_locked || button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE //even if it's not defaultly locked we should remember we locked it before - button.moved = button.id ? M.client.prefs.action_buttons_screen_locs["[name]_[button.id]"] : FALSE - M.update_action_buttons() - else + if(!M) Remove(owner) + return + if(owner) + if(owner == M) + return + Remove(owner) + owner = M + RegisterSignal(owner, COMSIG_PARENT_QDELETING, .proc/clear_ref, override = TRUE) + + GiveAction(M) + +/datum/action/proc/clear_ref(datum/ref) + SIGNAL_HANDLER + if(ref == owner) + Remove(owner) + if(ref == target) + qdel(src) /datum/action/proc/Remove(mob/M) - if(M) - if(M.client) - M.client.screen -= button - M.actions -= src - M.update_action_buttons() - owner = null - button.moved = FALSE //so the button appears in its normal position when given to another owner. - button.locked = FALSE - button.id = null + for(var/datum/hud/hud in viewers) + if(!hud.mymob) + continue + HideFrom(hud.mymob) + LAZYREMOVE(M.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared + viewers = list() + + if(owner) + UnregisterSignal(owner, COMSIG_PARENT_QDELETING) + if(target == owner) + RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/clear_ref) + owner = null /datum/action/proc/Trigger() if(!IsAvailable()) @@ -125,15 +109,15 @@ /datum/action/proc/UpdateButtons(status_only, force) for(var/datum/hud/hud in viewers) var/atom/movable/screen/movable/button = viewers[hud] - UpdateButtonIcon(button, status_only, force) + UpdateButton(button, status_only, force) -/datum/action/proc/UpdateButtonIcon(status_only = FALSE, force = FALSE) +/datum/action/proc/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE) if(!button) return if(!status_only) button.name = name button.desc = desc - if(owner && owner.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND) + if(owner?.hud_used && background_icon_state == ACTION_BUTTON_DEFAULT_BACKGROUND) var/list/settings = owner.hud_used.get_action_buttons_icons() if(button.icon != settings["bg_icon"]) button.icon = settings["bg_icon"] @@ -145,25 +129,13 @@ if(button.icon_state != background_icon_state) button.icon_state = background_icon_state - if(!use_target_appearance) - ApplyIcon(button, force) - - else if(target && button.appearance_cache != target.appearance) //replace with /ref comparison if this is not valid. - var/mutable_appearance/M = new(target) - M.layer = FLOAT_LAYER - M.plane = FLOAT_PLANE - if(target_appearance_matrix) - var/list/L = target_appearance_matrix - M.transform = matrix(L[1], L[2], L[3], L[4], L[5], L[6]) - button.cut_overlays() - button.add_overlay(M) - button.appearance_cache = target.appearance + ApplyIcon(button, force) if(!IsAvailable(TRUE)) button.color = transparent_when_unavailable ? rgb(128,0,0,128) : rgb(128,0,0) else button.color = rgb(255,255,255,255) - return 1 + return TRUE /datum/action/proc/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force = FALSE) if(icon_icon && button_icon_state && ((current_button.button_icon_state != button_icon_state) || force)) @@ -179,25 +151,82 @@ /datum/action/ghost/Trigger() if(!..()) - return 0 + return FALSE var/mob/M = target M.ghostize(can_reenter_corpse = TRUE, voluntary = TRUE) /datum/action/proc/OnUpdatedIcon() - addtimer(CALLBACK(src, .proc/UpdateButtonIcon), 1) //Hopefully runs after new icon overlays have been compiled. + SIGNAL_HANDLER + UpdateButtons(force = TRUE) + +//Give our action button to the player +/datum/action/proc/GiveAction(mob/viewer) + var/datum/hud/our_hud = viewer.hud_used + if(viewers[our_hud]) // Already have a copy of us? go away + return + + LAZYOR(viewer.actions, src) // Move this in + ShowTo(viewer) + +//Adds our action button to the screen of a player +/datum/action/proc/ShowTo(mob/viewer) + var/datum/hud/our_hud = viewer.hud_used + if(!our_hud || viewers[our_hud]) // There's no point in this if you have no hud in the first place + return + + var/atom/movable/screen/movable/action_button/button = CreateButton() + SetId(button, viewer) + + button.our_hud = our_hud + viewers[our_hud] = button + if(viewer.client) + viewer.client.screen += button + + button.load_position(viewer) + viewer.update_action_buttons() + +//Removes our action button from the screen of a player +/datum/action/proc/HideFrom(mob/viewer) + var/datum/hud/our_hud = viewer.hud_used + var/atom/movable/screen/movable/action_button/button = viewers[our_hud] + LAZYREMOVE(viewer.actions, src) + if(button) + qdel(button) + +/datum/action/proc/CreateButton() + var/atom/movable/screen/movable/action_button/button = new() + button.linked_action = src + button.actiontooltipstyle = buttontooltipstyle + if(desc) + button.desc = desc + return button + +/datum/action/proc/SetId(atom/movable/screen/movable/action_button/our_button, mob/owner) + //button id generation + var/bitfield = 0 + for(var/datum/action/action in owner.actions) + if(action == src) // This could be us, which is dumb + continue + var/atom/movable/screen/movable/action_button/button = action.viewers[owner.hud_used] + if(action.name == name && button.id) + bitfield |= button.id + + bitfield = ~bitfield // Flip our possible ids, so we can check if we've found a unique one + for(var/i in 0 to 23) // We get 24 possible bitflags in dm + var/bitflag = 1 << i // Shift us over one + if(bitfield & bitflag) + our_button.id = bitflag + return //Presets for item actions /datum/action/item_action check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUN|AB_CHECK_LYING|AB_CHECK_CONSCIOUS button_icon_state = null - use_target_appearance = TRUE // If you want to override the normal icon being the item // then change this to an icon state /datum/action/item_action/New(Target) ..() - if(button_icon_state) - use_target_appearance = FALSE var/obj/item/I = target LAZYINITLIST(I.actions) I.actions += src @@ -208,17 +237,41 @@ UNSETEMPTY(I.actions) return ..() -/datum/action/item_action/Trigger() - if(!..()) - return 0 +/datum/action/item_action/Trigger(trigger_flags) + . = ..() + if(!.) + return FALSE if(target) var/obj/item/I = target I.ui_action_click(owner, src) - return 1 + return TRUE + +/datum/action/item_action/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force) + var/obj/item/item_target = target + if(button_icon && button_icon_state) + // If set, use the custom icon that we set instead + // of the item appearence + ..() + else if((target && current_button.appearance_cache != item_target.appearance) || force) //replace with /ref comparison if this is not valid. + var/old_layer = item_target.layer + var/old_plane = item_target.plane + item_target.layer = FLOAT_LAYER //AAAH + item_target.plane = FLOAT_PLANE //^ what that guy said + current_button.filters = null + current_button.cut_overlays() + current_button.add_overlay(item_target) + item_target.layer = old_layer + item_target.plane = old_plane + current_button.appearance_cache = item_target.appearance /datum/action/item_action/toggle_light name = "Toggle Light" +/datum/action/item_action/toggle_light/pda/Trigger(trigger_flags) + if(istype(target, /obj/item/pda)) + var/obj/item/pda/P = target + return P.toggle_light(owner) + /datum/action/item_action/toggle_hood name = "Toggle Hood" @@ -258,12 +311,14 @@ /datum/action/item_action/set_internals name = "Set Internals" -/datum/action/item_action/set_internals/UpdateButtonIcon(status_only = FALSE, force) - if(..()) //button available - if(iscarbon(owner)) - var/mob/living/carbon/C = owner - if(target == C.internal) - button.icon_state = "template_active" +/datum/action/item_action/set_internals/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force) + if(!..()) // no button available + return + if(!iscarbon(owner)) + return + var/mob/living/carbon/C = owner + if(target == C.internal) + button.icon_state = "template_active" /datum/action/item_action/pick_color name = "Choose A Color" @@ -309,9 +364,9 @@ /datum/action/item_action/toggle_unfriendly_fire/Trigger() if(..()) - UpdateButtonIcon() + UpdateButtons() -/datum/action/item_action/toggle_unfriendly_fire/UpdateButtonIcon(status_only = FALSE, force) +/datum/action/item_action/toggle_unfriendly_fire/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force) if(istype(target, /obj/item/hierophant_club)) var/obj/item/hierophant_club/H = target if(H.friendly_fire_check) @@ -332,7 +387,7 @@ if(istype(target, /obj/item/hierophant_club)) var/obj/item/hierophant_club/H = target if(H.teleporting) - return 0 + return FALSE return ..() /datum/action/item_action/clock @@ -342,7 +397,7 @@ /datum/action/item_action/clock/IsAvailable(silent = FALSE) if(!is_servant_of_ratvar(owner)) - return 0 + return FALSE return ..() /datum/action/item_action/clock/toggle_visor @@ -351,11 +406,11 @@ /datum/action/item_action/clock/toggle_visor/IsAvailable(silent = FALSE) if(!is_servant_of_ratvar(owner)) - return 0 + return FALSE if(istype(target, /obj/item/clothing/glasses/judicial_visor)) var/obj/item/clothing/glasses/judicial_visor/V = target if(V.recharging) - return 0 + return FALSE return ..() /datum/action/item_action/clock/hierophant @@ -366,7 +421,6 @@ /datum/action/item_action/clock/quickbind name = "Quickbind" desc = "If you're seeing this, file a bug report." - use_target_appearance = FALSE var/scripture_index = 0 //the index of the scripture we're associated with /datum/action/item_action/toggle_helmet_flashlight @@ -380,7 +434,6 @@ /datum/action/item_action/toggle/New(Target) ..() name = "Toggle [target.name]" - button.name = name /datum/action/item_action/halt name = "HALT!" @@ -409,7 +462,6 @@ /datum/action/item_action/adjust/New(Target) ..() name = "Adjust [target.name]" - button.name = name /datum/action/item_action/switch_hud name = "Switch HUD" @@ -432,7 +484,7 @@ /datum/action/item_action/jetpack_stabilization/IsAvailable(silent = FALSE) var/obj/item/tank/jetpack/J = target if(!istype(J) || !J.on) - return 0 + return FALSE return ..() /datum/action/item_action/hands_free @@ -464,7 +516,7 @@ else owner.research_scanner-- to_chat(owner, "[target] research scanner has been [active ? "activated" : "deactivated"].") - return 1 + return TRUE /datum/action/item_action/toggle_research_scanner/Remove(mob/M) if(owner && active) @@ -489,18 +541,16 @@ /datum/action/item_action/organ_action/IsAvailable(silent = FALSE) var/obj/item/organ/I = target if(!I.owner) - return 0 + return FALSE return ..() /datum/action/item_action/organ_action/toggle/New(Target) ..() name = "Toggle [target.name]" - button.name = name /datum/action/item_action/organ_action/use/New(Target) ..() name = "Use [target.name]" - button.name = name /datum/action/item_action/cult_dagger name = "Draw Blood Rune" @@ -509,14 +559,13 @@ button_icon_state = "draw" buttontooltipstyle = "cult" background_icon_state = "bg_demon" + default_button_position = "6:157,4:-2" /datum/action/item_action/cult_dagger/Grant(mob/M) - if(iscultist(M)) - ..() - button.screen_loc = "6:157,4:-2" - button.moved = "6:157,4:-2" - else + if(!iscultist(M)) Remove(owner) + return + return ..() /datum/action/item_action/cult_dagger/Trigger() for(var/obj/item/H in owner.held_items) //In case we were already holding another dagger @@ -643,7 +692,6 @@ icon_icon = S.action_icon button_icon_state = S.action_icon_state background_icon_state = S.action_background_icon_state - button.name = name /datum/action/spell_action/Destroy() var/obj/effect/proc_holder/S = target @@ -693,12 +741,12 @@ /datum/action/innate/Trigger() if(!..()) - return 0 + return FALSE if(!active) Activate() else Deactivate() - return 1 + return TRUE /datum/action/innate/proc/Activate() return @@ -711,44 +759,114 @@ /datum/action/cooldown check_flags = 0 transparent_when_unavailable = FALSE + // The default cooldown applied when StartCooldown() is called var/cooldown_time = 0 + // The actual next time this ability can be used var/next_use_time = 0 + // Whether or not you want the cooldown for the ability to display in text form + var/text_cooldown = TRUE + // Setting for intercepting clicks before activating the ability + var/click_to_activate = FALSE + // Shares cooldowns with other cooldown abilities of the same value, not active if null + var/shared_cooldown -/datum/action/cooldown/New() - ..() +/datum/action/cooldown/CreateButton() + var/atom/movable/screen/movable/action_button/button = ..() button.maptext = "" button.maptext_x = 8 button.maptext_y = 0 button.maptext_width = 24 button.maptext_height = 12 + return button -/datum/action/cooldown/IsAvailable(silent = FALSE) - return next_use_time <= world.time +/datum/action/cooldown/IsAvailable() + return ..() && (next_use_time <= world.time) -/datum/action/cooldown/proc/StartCooldown() - next_use_time = world.time + cooldown_time - button.maptext = MAPTEXT_TINY_UNICODE("[round(cooldown_time/10, 0.1)]") - UpdateButtonIcon() +/// Starts a cooldown time to be shared with similar abilities, will use default cooldown time if an override is not specified +/datum/action/cooldown/proc/StartCooldown(override_cooldown_time) + if(shared_cooldown) + for(var/datum/action/cooldown/shared_ability in owner.actions - src) + if(shared_cooldown == shared_ability.shared_cooldown) + if(isnum(override_cooldown_time)) + shared_ability.StartCooldownSelf(override_cooldown_time) + else + shared_ability.StartCooldownSelf(cooldown_time) + StartCooldownSelf(override_cooldown_time) + +/// Starts a cooldown time for this ability only, will use default cooldown time if an override is not specified +/datum/action/cooldown/proc/StartCooldownSelf(override_cooldown_time) + if(isnum(override_cooldown_time)) + next_use_time = world.time + override_cooldown_time + else + next_use_time = world.time + cooldown_time + UpdateButtons() START_PROCESSING(SSfastprocess, src) -/datum/action/cooldown/process() +/datum/action/cooldown/Trigger(trigger_flags, atom/target) + . = ..() + if(!.) + return if(!owner) + return FALSE + if(click_to_activate) + if(target) + // For automatic / mob handling + return InterceptClickOn(owner, null, target) + if(owner.click_intercept == src) + owner.click_intercept = null + else + owner.click_intercept = src + for(var/datum/action/cooldown/ability in owner.actions) + ability.UpdateButtons() + return TRUE + return PreActivate(owner) + +/// Intercepts client owner clicks to activate the ability +/datum/action/cooldown/proc/InterceptClickOn(mob/living/caller, params, atom/target) + if(!IsAvailable()) + return FALSE + if(!target) + return FALSE + PreActivate(target) + caller.click_intercept = null + return TRUE + +/// For signal calling +/datum/action/cooldown/proc/PreActivate(atom/target) + if(SEND_SIGNAL(owner, COMSIG_MOB_ABILITY_STARTED, src) & COMPONENT_BLOCK_ABILITY_START) + return + . = Activate(target) + SEND_SIGNAL(owner, COMSIG_MOB_ABILITY_FINISHED, src) + +/// To be implemented by subtypes +/datum/action/cooldown/proc/Activate(atom/target) + return + +/datum/action/cooldown/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE) + . = ..() + if(!button) + return + var/time_left = max(next_use_time - world.time, 0) + if(text_cooldown) + button.maptext = MAPTEXT("[round(time_left/10, 0.1)]") + if(!owner || time_left == 0) button.maptext = "" + if(IsAvailable() && owner.click_intercept == src) + button.color = COLOR_GREEN + +/datum/action/cooldown/process() + var/time_left = max(next_use_time - world.time, 0) + if(!owner || time_left == 0) STOP_PROCESSING(SSfastprocess, src) - var/timeleft = max(next_use_time - world.time, 0) - if(timeleft == 0) - button.maptext = "" - UpdateButtonIcon() - STOP_PROCESSING(SSfastprocess, src) - else - button.maptext = MAPTEXT_TINY_UNICODE("[round(cooldown_time/10, 0.1)]") + UpdateButtons() /datum/action/cooldown/Grant(mob/M) ..() - if(owner) - UpdateButtonIcon() - if(next_use_time > world.time) - START_PROCESSING(SSfastprocess, src) + if(!owner) + return + UpdateButtons() + if(next_use_time > world.time) + START_PROCESSING(SSfastprocess, src) //surf_ss13 /datum/action/item_action/bhop @@ -841,7 +959,7 @@ target.plane = old_plane current_button.appearance_cache = target.appearance -/proc/get_action_of_type(mob/M, var/action_type) +/proc/get_action_of_type(mob/M, action_type) if(!M.actions || !ispath(action_type, /datum/action)) return for(var/datum/action/A in M.actions) diff --git a/code/datums/brain_damage/imaginary_friend.dm b/code/datums/brain_damage/imaginary_friend.dm index f35389f171..c7e0522128 100644 --- a/code/datums/brain_damage/imaginary_friend.dm +++ b/code/datums/brain_damage/imaginary_friend.dm @@ -225,7 +225,7 @@ name = "Hide" desc = "Hide yourself from your owner's sight." button_icon_state = "hide" - UpdateButtonIcon() + UpdateButtons() /datum/action/innate/imaginary_hide/Activate() var/mob/camera/imaginary_friend/I = owner diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index cc988544b8..d42c39fc1e 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -328,9 +328,9 @@ /// For spawning mineral sheets at a specific location. Used by machines to output sheets. /datum/component/material_container/proc/retrieve_sheets(sheet_amt, var/datum/material/M, target = null) if(!M.sheet_type) - return 0 //Add greyscale sheet handling here later + return FALSE //Add greyscale sheet handling here later if(sheet_amt <= 0) - return 0 + return FALSE if(!target) target = get_turf(parent) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 6a1d8a3d75..4e46a2f48c 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -268,7 +268,7 @@ else if(the_event.timeout) addtimer(CALLBACK(src, .proc/clear_event, null, category), the_event.timeout, TIMER_UNIQUE|TIMER_OVERRIDE) - return 0 //Don't have to update the event. + return FALSE //Don't have to update the event. the_event = new type(src, param)//This causes a runtime for some reason, was this me? No - there's an event floating around missing a definition. mood_events[category] = the_event @@ -280,7 +280,7 @@ /datum/component/mood/proc/clear_event(datum/source, category) var/datum/mood_event/event = mood_events[category] if(!event) - return 0 + return FALSE mood_events -= category qdel(event) diff --git a/code/datums/components/spawner.dm b/code/datums/components/spawner.dm index 44fbf313cf..33fd7ba375 100644 --- a/code/datums/components/spawner.dm +++ b/code/datums/components/spawner.dm @@ -43,9 +43,9 @@ /datum/component/spawner/proc/try_spawn_mob() var/atom/P = parent if(spawned_mobs.len >= max_mobs) - return 0 + return FALSE if(spawn_delay > world.time) - return 0 + return FALSE spawn_delay = world.time + spawn_time var/chosen_mob_type = pick(mob_types) var/mob/living/simple_animal/L = new chosen_mob_type(P.loc) diff --git a/code/datums/components/storage/storage.dm b/code/datums/components/storage/storage.dm index 76c5830765..1aba2ac085 100644 --- a/code/datums/components/storage/storage.dm +++ b/code/datums/components/storage/storage.dm @@ -486,7 +486,7 @@ var/atom/A = parent A.do_squish() -//This proc return 1 if the item can be picked up and 0 if it can't. +//This proc return TRUE if the item can be picked up and 0 if it can't. //Set the stop_messages to stop it from printing messages /datum/component/storage/proc/can_be_inserted(obj/item/I, stop_messages = FALSE, mob/M) if(!istype(I) || (I.item_flags & ABSTRACT)) diff --git a/code/datums/components/summoning.dm b/code/datums/components/summoning.dm index ffb4309c1c..68cc8ba509 100644 --- a/code/datums/components/summoning.dm +++ b/code/datums/components/summoning.dm @@ -49,11 +49,11 @@ /datum/component/summoning/proc/do_spawn_mob(atom/spawn_location, summoner) if(spawned_mobs.len >= max_mobs) - return 0 + return FALSE if(last_spawned_time > world.time) - return 0 + return FALSE if(!prob(spawn_chance)) - return 0 + return FALSE last_spawned_time = world.time + spawn_delay var/chosen_mob_type = pick(mob_types) var/mob/living/simple_animal/L = new chosen_mob_type(spawn_location) diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index 1ca07bf502..8108b8b6fe 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -135,11 +135,11 @@ /datum/disease/advance/IsSame(datum/disease/advance/D) if(!(istype(D, /datum/disease/advance))) - return 0 + return FALSE if(GetDiseaseID() != D.GetDiseaseID()) - return 0 - return 1 + return FALSE + return TRUE // Returns the advance disease with a different reference memory. /datum/disease/advance/Copy() @@ -178,8 +178,8 @@ /datum/disease/advance/proc/HasSymptom(datum/symptom/S) for(var/datum/symptom/symp in symptoms) if(symp.type == S.type) - return 1 - return 0 + return TRUE + return FALSE // Will generate new unique symptoms, use this if there are none. Returns a list of symptoms that were generated. /datum/disease/advance/proc/GenerateSymptoms(level_min, level_max, amount_get = 0) diff --git a/code/datums/diseases/advance/symptoms/choking.dm b/code/datums/diseases/advance/symptoms/choking.dm index c34ab566cf..a46e874698 100644 --- a/code/datums/diseases/advance/symptoms/choking.dm +++ b/code/datums/diseases/advance/symptoms/choking.dm @@ -64,11 +64,11 @@ Bonus /datum/symptom/choking/proc/Choke_stage_3_4(mob/living/M, datum/disease/advance/A) M.adjustOxyLoss(rand(6,13)) - return 1 + return TRUE /datum/symptom/choking/proc/Choke(mob/living/M, datum/disease/advance/A) M.adjustOxyLoss(rand(10,18)) - return 1 + return TRUE /* ////////////////////////////////////// @@ -136,17 +136,17 @@ Bonus /datum/symptom/asphyxiation/proc/Asphyxiate_stage_3_4(mob/living/M, datum/disease/advance/A) var/get_damage = rand(10,15) * power M.adjustOxyLoss(get_damage) - return 1 + return TRUE /datum/symptom/asphyxiation/proc/Asphyxiate(mob/living/M, datum/disease/advance/A) var/get_damage = rand(15,21) * power M.adjustOxyLoss(get_damage) if(paralysis) M.reagents.add_reagent_list(list(/datum/reagent/toxin/pancuronium = 3, /datum/reagent/toxin/sodium_thiopental = 3)) - return 1 + return TRUE /datum/symptom/asphyxiation/proc/Asphyxiate_death(mob/living/M, datum/disease/advance/A) var/get_damage = rand(25,35) * power M.adjustOxyLoss(get_damage) M.adjustOrganLoss(ORGAN_SLOT_BRAIN, get_damage/2) - return 1 + return TRUE diff --git a/code/datums/diseases/advance/symptoms/fever.dm b/code/datums/diseases/advance/symptoms/fever.dm index 0348e39818..be551addbf 100644 --- a/code/datums/diseases/advance/symptoms/fever.dm +++ b/code/datums/diseases/advance/symptoms/fever.dm @@ -58,4 +58,4 @@ Bonus M.adjust_bodytemperature(get_heat * A.stage, 0, BODYTEMP_HEAT_DAMAGE_LIMIT - 1) else M.adjust_bodytemperature(get_heat * A.stage) - return 1 + return TRUE diff --git a/code/datums/diseases/advance/symptoms/fire.dm b/code/datums/diseases/advance/symptoms/fire.dm index c30da0614a..57c6ff8203 100644 --- a/code/datums/diseases/advance/symptoms/fire.dm +++ b/code/datums/diseases/advance/symptoms/fire.dm @@ -71,14 +71,14 @@ Bonus M.adjustFireLoss(3 * power) if(infective) A.spread(2) - return 1 + return TRUE /datum/symptom/fire/proc/Firestacks_stage_5(mob/living/M, datum/disease/advance/A) M.adjust_fire_stacks(3 * power) M.adjustFireLoss(5 * power) if(infective) A.spread(4) - return 1 + return TRUE /* ////////////////////////////////////// @@ -157,7 +157,7 @@ Bonus M.adjustFireLoss(get_stacks/2) if(chems) M.reagents.add_reagent(/datum/reagent/clf3, 2 * power) - return 1 + return TRUE /datum/symptom/alkali/proc/Alkali_fire_stage_5(mob/living/M, datum/disease/advance/A) var/get_stacks = 8 * power @@ -165,4 +165,4 @@ Bonus M.adjustFireLoss(get_stacks) if(chems) M.reagents.add_reagent_list(list(/datum/reagent/napalm = 4 * power, /datum/reagent/clf3 = 4 * power)) - return 1 + return TRUE diff --git a/code/datums/diseases/advance/symptoms/flesh_eating.dm b/code/datums/diseases/advance/symptoms/flesh_eating.dm index b5b55c1e14..0fb97cdc41 100644 --- a/code/datums/diseases/advance/symptoms/flesh_eating.dm +++ b/code/datums/diseases/advance/symptoms/flesh_eating.dm @@ -65,7 +65,7 @@ Bonus var/mob/living/carbon/human/H = M var/obj/item/bodypart/random_part = pick(H.bodyparts) random_part.generic_bleedstacks += 5 * power - return 1 + return TRUE /* ////////////////////////////////////// @@ -133,4 +133,4 @@ Bonus M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2)) if(zombie) M.reagents.add_reagent(/datum/reagent/romerol, 1) - return 1 + return TRUE diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index 0b4b3ef2dd..8f48b9c44f 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -92,7 +92,7 @@ for(var/obj/item/bodypart/L in parts) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) M.update_damage_overlays() - return 1 + return TRUE /datum/symptom/heal/starlight/passive_message_condition(mob/living/M) if(M.getBruteLoss() || M.getFireLoss() || M.getToxLoss()) @@ -129,7 +129,7 @@ M.adjust_nutrition(0.3) if(prob(2)) to_chat(M, "You feel a mild warmth as your blood purifies itself.") - return 1 + return TRUE @@ -167,7 +167,7 @@ C.adjust_nutrition(-lost_nutrition * HUNGER_FACTOR) //Hunger depletes at 10x the normal speed if(prob(2)) to_chat(C, "You feel an odd gurgle in your stomach, as if it was working much faster than normal.") - return 1 + return TRUE /datum/symptom/heal/darkness name = "Nocturnal Regeneration" @@ -210,7 +210,7 @@ for(var/obj/item/bodypart/L in parts) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len * 0.5)) //more effective on brute M.update_damage_overlays() - return 1 + return TRUE /datum/symptom/heal/darkness/passive_message_condition(mob/living/M) if(M.getBruteLoss() || M.getFireLoss()) @@ -307,7 +307,7 @@ if(active_coma && M.getBruteLoss() + M.getFireLoss() == 0) uncoma(M) - return 1 + return TRUE /datum/symptom/heal/coma/passive_message_condition(mob/living/M) if((M.getBruteLoss() + M.getFireLoss()) > 30) @@ -365,7 +365,7 @@ if(L.heal_damage(heal_amt/parts.len * 0.5, heal_amt/parts.len)) M.update_damage_overlays() - return 1 + return TRUE /datum/symptom/heal/water/passive_message_condition(mob/living/M) if(M.getBruteLoss() || M.getFireLoss()) @@ -435,7 +435,7 @@ for(var/obj/item/bodypart/L in parts) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) M.update_damage_overlays() - return 1 + return TRUE /datum/symptom/heal/radiation @@ -475,7 +475,7 @@ if(RAD_BURN_THRESHOLD to RAD_MOB_MUTATE) return 0.75 if(RAD_MOB_MUTATE to RAD_MOB_KNOCKDOWN) - return 1 + return TRUE else return 1.5 @@ -498,4 +498,4 @@ for(var/obj/item/bodypart/L in parts) if(L.heal_damage(heal_amt/parts.len, heal_amt/parts.len)) M.update_damage_overlays() - return 1 + return TRUE diff --git a/code/datums/diseases/advance/symptoms/shivering.dm b/code/datums/diseases/advance/symptoms/shivering.dm index 7674d80495..4bce1ac65e 100644 --- a/code/datums/diseases/advance/symptoms/shivering.dm +++ b/code/datums/diseases/advance/symptoms/shivering.dm @@ -58,4 +58,4 @@ Bonus if(unsafe) limit = 0 M.adjust_bodytemperature(-get_cold * A.stage, limit) - return 1 + return TRUE diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 7d1ddc5648..83e2de80b9 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -538,7 +538,7 @@ /datum/dna/proc/check_block_string(mutation) if((LAZYLEN(mutation_index) > DNA_MUTATION_BLOCKS) || !(mutation in mutation_index)) - return 0 + return FALSE return is_gene_active(mutation) /datum/dna/proc/is_gene_active(mutation) @@ -585,7 +585,7 @@ /proc/setblock(istring, blocknumber, replacement, blocksize=DNA_BLOCK_SIZE) if(!istring || !blocknumber || !replacement || !blocksize) - return 0 + return FALSE return getleftblocks(istring, blocknumber, blocksize) + replacement + getrightblocks(istring, blocknumber, blocksize) /datum/dna/proc/mutation_in_sequence(mutation) @@ -649,7 +649,7 @@ /proc/scramble_dna(mob/living/carbon/M, ui=FALSE, se=FALSE, probability) if(!M.has_dna()) - return 0 + return FALSE if(se) for(var/i=1, i<=DNA_MUTATION_BLOCKS, i++) if(prob(probability)) @@ -660,7 +660,7 @@ if(prob(probability)) M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters)) M.updateappearance(mutations_overlay_update=1) - return 1 + return TRUE //value in range 1 to values. values must be greater than 0 //all arguments assumed to be positive integers diff --git a/code/datums/elements/polychromic.dm b/code/datums/elements/polychromic.dm index 2649a8ee6f..5b60bed6fe 100644 --- a/code/datums/elements/polychromic.dm +++ b/code/datums/elements/polychromic.dm @@ -63,7 +63,7 @@ if(suits_with_helmet_typecache[A.type]) RegisterSignal(A, COMSIG_SUIT_MADE_HELMET, .proc/register_helmet) //you better work now you slut else if(_flags & POLYCHROMIC_ACTION && ismob(A)) //in the event mob update icon procs are ever standarized. - var/datum/action/polychromic/P = new(A) + var/datum/action/item_action/polychromic/P = new(A) RegisterSignal(P, COMSIG_ACTION_TRIGGER, .proc/activate_action) actions_by_atom[A] = P P.Grant(A) @@ -73,7 +73,7 @@ /datum/element/polychromic/Detach(atom/A) . = ..() colors_by_atom -= A - var/datum/action/polychromic/P = actions_by_atom[A] + var/datum/action/item_action/polychromic/P = actions_by_atom[A] if(P) actions_by_atom -= A qdel(P) @@ -146,7 +146,7 @@ /datum/element/polychromic/proc/grant_user_action(atom/source, mob/user, slot) if(slot == ITEM_SLOT_BACKPACK || slot == ITEM_SLOT_LEGCUFFED || slot == ITEM_SLOT_HANDCUFFED || slot == ITEM_SLOT_DEX_STORAGE) return - var/datum/action/polychromic/P = actions_by_atom[source] + var/datum/action/item_action/polychromic/P = actions_by_atom[source] if(!P) P = new (source) P.name = "Modify [source]'\s Colors" @@ -156,7 +156,7 @@ P.Grant(user) /datum/element/polychromic/proc/remove_user_action(atom/source, mob/user) - var/datum/action/polychromic/P = actions_by_atom[source] + var/datum/action/item_action/polychromic/P = actions_by_atom[source] P?.Remove(user) /datum/element/polychromic/proc/activate_action(datum/action/source, atom/target) @@ -197,9 +197,14 @@ helmet_by_suit -= S colors_by_atom -= source -/datum/action/polychromic +/datum/action/item_action/polychromic name = "Modify Polychromic Colors" background_icon_state = "bg_polychromic" - use_target_appearance = TRUE button_icon_state = null - target_appearance_matrix = list(0.8,0,0,0,0.8,0) + check_flags = NONE + +/datum/action/item_action/polychromic/ApplyIcon(atom/movable/screen/movable/action_button/current_button, force) + var/matrix/save_matrix = target.transform + target.transform = matrix(0.8, 0, 0, 0, 0.8, 0) + . = ..() + target.transform = save_matrix diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index dabfcea52c..b64862c93b 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -397,7 +397,7 @@ GLOBAL_LIST_EMPTY(explosions) var/choice = input("Bomb Size?") in choices switch(choice) if(null) - return 0 + return FALSE if("Small Bomb") dev = 1 heavy = 2 diff --git a/code/datums/martial/boxing.dm b/code/datums/martial/boxing.dm index 32b916d724..8fb2c9a141 100644 --- a/code/datums/martial/boxing.dm +++ b/code/datums/martial/boxing.dm @@ -6,11 +6,11 @@ /datum/martial_art/boxing/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) to_chat(A, "Can't disarm while boxing!") - return 1 + return TRUE /datum/martial_art/boxing/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D) to_chat(A, "Can't grab while boxing!") - return 1 + return TRUE /datum/martial_art/boxing/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) @@ -46,7 +46,7 @@ log_combat(A, D, "knocked out (boxing) ") else if(D.lying) D.forcesay(GLOB.hit_appends) - return 1 + return TRUE /datum/martial_art/boxing/teach(mob/living/carbon/human/H, make_temporary = TRUE) . = ..() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 00fbfc4f24..9b144e74bf 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1661,7 +1661,7 @@ GLOBAL_LIST(objective_choices) if(istype(S, type)) continue S.charge_counter = delay - S.updateButtonIcon() + S.UpdateButton() INVOKE_ASYNC(S, /obj/effect/proc_holder/spell.proc/start_recharge) /datum/mind/proc/get_ghost(even_if_they_cant_reenter) diff --git a/code/datums/mutations/_mutations.dm b/code/datums/mutations/_mutations.dm index 33a082372e..e3a4181d1b 100644 --- a/code/datums/mutations/_mutations.dm +++ b/code/datums/mutations/_mutations.dm @@ -119,8 +119,8 @@ owner.RemoveSpell(power) qdel(power) SEND_SIGNAL(owner, COMSIG_HUMAN_MUTATION_LOSS, src) - return 0 - return 1 + return FALSE + return TRUE /datum/mutation/human/proc/say_mod(message) if(message) diff --git a/code/datums/recipe.dm b/code/datums/recipe.dm index c4d0d6f9c6..9a484c9e4d 100644 --- a/code/datums/recipe.dm +++ b/code/datums/recipe.dm @@ -48,7 +48,7 @@ if (aval_r_amnt>reagents_list[r_r]) . = -1 else - return 0 + return FALSE if ((reagents_list?(reagents_list.len):(0)) < avail_reagents.reagent_list.len) return -1 return . @@ -58,7 +58,7 @@ if (locate(/obj/) in container) return -1 else - return 1 + return TRUE . = 1 var/list/checklist = items.Copy() for (var/obj/O in container) @@ -71,7 +71,7 @@ if (!found) . = -1 if (checklist.len) - return 0 + return FALSE return . //general version diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index f3171f6197..d55289c32d 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -95,7 +95,7 @@ * Multiplied to clickdelays */ /datum/status_effect/proc/action_cooldown_mod() - return 1 + return TRUE //////////////// // ALERT HOOK // diff --git a/code/datums/view.dm b/code/datums/view.dm index 5610fb040e..7313cc4c18 100644 --- a/code/datums/view.dm +++ b/code/datums/view.dm @@ -1,108 +1,110 @@ //This is intended to be a full wrapper. DO NOT directly modify its values ///Container for client viewsize -/datum/viewData +/datum/view_data var/width = 0 var/height = 0 var/default = "" var/is_suppressed = FALSE var/client/chief = null -/datum/viewData/New(client/owner, view_string) +/datum/view_data/New(client/owner, view_string) default = view_string chief = owner apply() -/datum/viewData/proc/setDefault(string) +/datum/view_data/proc/setDefault(string) default = string apply() -/datum/viewData/proc/safeApplyFormat() +/datum/view_data/proc/afterViewChange() if(isZooming()) assertFormat() - return - resetFormat() + else + resetFormat() + var/datum/hud/our_hud = chief?.mob?.hud_used + our_hud.view_audit_buttons() // Make sure our hud's buttons are in our new size -/datum/viewData/proc/assertFormat()//T-Pose +/datum/view_data/proc/assertFormat()//T-Pose // winset(chief, "mapwindow.map", "zoom=0") // Citadel Edit - We're using icon dropdown instead -/datum/viewData/proc/resetFormat()//Cuck +/datum/view_data/proc/resetFormat()//Cuck // winset(chief, "mapwindow.map", "zoom=[chief.prefs.pixel_size]") // Citadel Edit - We're using icon dropdown instead -/datum/viewData/proc/setZoomMode() +/datum/view_data/proc/setZoomMode() // winset(chief, "mapwindow.map", "zoom-mode=[chief.prefs.scaling_method]") // Citadel Edit - We're using icon dropdown instead -/datum/viewData/proc/isZooming() +/datum/view_data/proc/isZooming() return (width || height) -/datum/viewData/proc/resetToDefault() +/datum/view_data/proc/resetToDefault() width = 0 height = 0 apply() -/datum/viewData/proc/add(toAdd) +/datum/view_data/proc/add(toAdd) width += toAdd height += toAdd apply() -/datum/viewData/proc/addTo(toAdd) +/datum/view_data/proc/addTo(toAdd) var/list/shitcode = getviewsize(toAdd) width += shitcode[1] height += shitcode[2] apply() -/datum/viewData/proc/setTo(toAdd) +/datum/view_data/proc/setTo(toAdd) var/list/shitcode = getviewsize(toAdd) //Backward compatability to account width = shitcode[1] //for a change in how sizes get calculated. we used to include world.view in height = shitcode[2] //this, but it was jank, so I had to move it apply() -/datum/viewData/proc/setBoth(wid, hei) +/datum/view_data/proc/setBoth(wid, hei) width = wid height = hei apply() -/datum/viewData/proc/setWidth(wid) +/datum/view_data/proc/setWidth(wid) width = wid apply() -/datum/viewData/proc/setHeight(hei) +/datum/view_data/proc/setHeight(hei) width = hei apply() -/datum/viewData/proc/addToWidth(toAdd) +/datum/view_data/proc/addToWidth(toAdd) width += toAdd apply() -/datum/viewData/proc/addToHeight(screen, toAdd) +/datum/view_data/proc/addToHeight(screen, toAdd) height += toAdd apply() -/datum/viewData/proc/apply() +/datum/view_data/proc/apply() chief.change_view(getView()) - safeApplyFormat() + afterViewChange() -/datum/viewData/proc/supress() +/datum/view_data/proc/supress() is_suppressed = TRUE apply() -/datum/viewData/proc/unsupress() +/datum/view_data/proc/unsupress() is_suppressed = FALSE apply() -/datum/viewData/proc/getView() +/datum/view_data/proc/getView() var/list/temp = getviewsize(default) if(is_suppressed) return "[temp[1]]x[temp[2]]" return "[width + temp[1]]x[height + temp[2]]" -/datum/viewData/proc/zoomIn() +/datum/view_data/proc/zoomIn() resetToDefault() animate(chief, pixel_x = 0, pixel_y = 0, 0, FALSE, LINEAR_EASING, ANIMATION_END_NOW) -/datum/viewData/proc/zoomOut(radius = 0, offset = 0, direction = FALSE) +/datum/view_data/proc/zoomOut(radius = 0, offset = 0, direction = FALSE) if(direction) var/_x = 0 var/_y = 0 diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm index 797b26b51d..7462997687 100644 --- a/code/datums/weather/weather.dm +++ b/code/datums/weather/weather.dm @@ -178,7 +178,7 @@ */ /datum/weather/proc/end() if(stage == END_STAGE) - return 1 + return TRUE stage = END_STAGE STOP_PROCESSING(SSweather, src) update_areas() diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 54f1db323a..6e40728a67 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -560,9 +560,9 @@ GLOBAL_LIST_EMPTY(teleportlocs) /area/proc/powered(chan) // return true if the area has power to given channel if(!requires_power) - return 1 + return TRUE if(always_unpowered) - return 0 + return FALSE switch(chan) if(EQUIP) return power_equip @@ -571,10 +571,10 @@ GLOBAL_LIST_EMPTY(teleportlocs) if(ENVIRON) return power_environ - return 0 + return FALSE /area/space/powered(chan) //Nope.avi - return 0 + return FALSE // called when power status changes diff --git a/code/game/area/areas/holodeck.dm b/code/game/area/areas/holodeck.dm index 35d6f1d202..ff73bf5434 100644 --- a/code/game/area/areas/holodeck.dm +++ b/code/game/area/areas/holodeck.dm @@ -26,18 +26,18 @@ /area/holodeck/powered(var/chan) if(!requires_power) - return 1 + return TRUE if(always_unpowered) - return 0 + return FALSE if(!linked) - return 0 + return FALSE var/area/A = get_area(linked) ASSERT(!istype(A, /area/holodeck)) return A.powered(chan) /area/holodeck/usage(var/chan) if(!linked) - return 0 + return FALSE var/area/A = get_area(linked) ASSERT(!istype(A, /area/holodeck)) return A.usage(chan) @@ -51,7 +51,7 @@ /area/holodeck/use_power(var/amount, var/chan) if(!linked) - return 0 + return FALSE var/area/A = get_area(linked) ASSERT(!istype(A, /area/holodeck)) return A.use_power(amount,chan) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index eac9f75a94..1554ac9964 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -613,7 +613,10 @@ cut_overlay(managed_overlays) managed_overlays = null if(length(new_overlays)) - managed_overlays = new_overlays + if (length(new_overlays) == 1) + managed_overlays = new_overlays[1] + else + managed_overlays = new_overlays add_overlay(new_overlays) . |= UPDATE_OVERLAYS @@ -667,7 +670,7 @@ if((explosion_flags & EXPLOSION_FLAG_DENSITY_DEPENDENT) && !density) return power // no block else if((explosion_flags & EXPLOSION_FLAG_HARD_OBSTACLE) && !QDELETED(src)) - return 0 // fully blocked + return FALSE // fully blocked /** * Called when a wave explosion hits this atom. @@ -1416,7 +1419,7 @@ T = get_turf(src) if(!T) - return 0 + return FALSE var/list/forced_gravity = list() SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, T, forced_gravity) @@ -1429,7 +1432,7 @@ return max_grav if(isspaceturf(T)) // Turf never has gravity - return 0 + return FALSE var/area/A = get_area(T) if(A.has_gravity) // Areas which always has gravity diff --git a/code/game/atoms_movement.dm b/code/game/atoms_movement.dm index 7e0a1e6899..7cf86be7cf 100644 --- a/code/game/atoms_movement.dm +++ b/code/game/atoms_movement.dm @@ -291,9 +291,9 @@ * Called whenever an object moves and by mobs when they attempt to move themselves through space * And when an object or action applies a force on src, see [newtonian_move][/atom/movable/proc/newtonian_move] * - * Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting + * return FALSE to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting * - * Mobs should return 1 if they should be able to move of their own volition, see [/client/proc/Move] + * Mobs should return TRUE if they should be able to move of their own volition, see [/client/proc/Move] * * Arguments: * * movement_dir - 0 when stopping or any dir when trying to move diff --git a/code/game/communications.dm b/code/game/communications.dm index 2b45fc9469..d3b4d69dad 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -150,7 +150,7 @@ GLOBAL_LIST_INIT(reverseradiochannels, list( if(range) start_point = get_turf(source) if(!start_point) - return 0 + return FALSE //Send the data for(var/current_filter in filter_list) diff --git a/code/game/gamemodes/bloodsucker/bloodsucker.dm b/code/game/gamemodes/bloodsucker/bloodsucker.dm index aa8edeaa72..73f24948d0 100644 --- a/code/game/gamemodes/bloodsucker/bloodsucker.dm +++ b/code/game/gamemodes/bloodsucker/bloodsucker.dm @@ -199,7 +199,7 @@ // Check Overdose: Am I even addicted to blood? Do I even have any in me? //if (!target.reagents.addiction_list || !target.reagents.reagent_list) //message_admins("DEBUG2: can_make_vassal() Abort: No reagents") - // return 0 + // return FALSE // Check Overdose: Did my current volume go over the Overdose threshold? //var/am_addicted = 0 //for (var/datum/reagent/blood/vampblood/blood in target.reagents.addiction_list) // overdosed is tracked in reagent_list, not addiction_list. @@ -210,7 +210,7 @@ //if (!am_addicted) //message_admins("DEBUG4: can_make_vassal() Abort: No Blood") - // return 0 + // return FALSE // No Mind! if(!target.mind || !target.mind.key) if(display_warning) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 77c953567c..05979867e2 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -51,10 +51,10 @@ GLOBAL_VAR(changeling_team_objective_type) //If this is not null, we hand our th changelings += changeling changeling.special_role = ROLE_CHANGELING changeling.restricted_roles = restricted_jobs - return 1 + return TRUE else setup_error = "Not enough changeling candidates" - return 0 + return FALSE /datum/game_mode/changeling/post_setup() for(var/datum/mind/changeling in changelings) diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index 691111031d..a21d6c676d 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -20,11 +20,11 @@ /datum/game_mode/traitor/changeling/can_start() if(!..()) - return 0 + return FALSE possible_changelings = get_players_for_role(ROLE_CHANGELING) if(possible_changelings.len < required_enemies) - return 0 - return 1 + return FALSE + return TRUE /datum/game_mode/traitor/changeling/pre_setup() if(CONFIG_GET(flag/protect_roles_from_antagonist)) @@ -55,7 +55,7 @@ changeling.restricted_roles = restricted_jobs return ..() else - return 0 + return FALSE /datum/game_mode/traitor/changeling/post_setup() for(var/datum/mind/changeling in changelings) diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 77371ad7bc..d852ce9850 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -188,16 +188,16 @@ Credit where due: equip_servant(L) add_servant_of_ratvar(L, TRUE) ..() - return 1 + return TRUE /datum/game_mode/proc/greet_servant(mob/M) //Description of their role if(!M) - return 0 + return FALSE to_chat(M, "You are a servant of Ratvar, the Clockwork Justiciar!") to_chat(M, "Unlock Script scripture by converting a new servant or when 35kw of power is reached.") to_chat(M, "Application scripture will be unlocked when 50kw of power is reached.") M.playsound_local(get_turf(M), 'sound/ambience/antag/clockcultalr.ogg', 100, FALSE, pressure_affected = FALSE) - return 1 + return TRUE /datum/game_mode/proc/equip_servant(mob/living/M) //Grants a clockwork slab to the mob if(!M || !ishuman(M)) diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index 9a49c05739..72b3b53989 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -154,9 +154,9 @@ if(cult_mind.current.onCentCom() || cult_mind.current.onSyndieBase()) acolytes_survived++ if(acolytes_survived>=acolytes_needed) - return 0 + return FALSE else - return 1 + return TRUE /datum/game_mode/cult/generate_report() diff --git a/code/game/gamemodes/devil/devil agent/devil_agent.dm b/code/game/gamemodes/devil/devil agent/devil_agent.dm index ccfd6f1dd5..d491594d40 100644 --- a/code/game/gamemodes/devil/devil agent/devil_agent.dm +++ b/code/game/gamemodes/devil/devil agent/devil_agent.dm @@ -41,8 +41,8 @@ outsellobjective.target = target_mind outsellobjective.update_explanation_text() D.objectives += outsellobjective - return 1 - return 0 + return TRUE + return FALSE /datum/game_mode/devil/devil_agents/generate_report() return "Multiple soul merchants have been spotted in the quadrant, and appear to be competing over who can purchase the most souls. Be advised that they are likely to manufacture \ diff --git a/code/game/gamemodes/devil/devil_game_mode.dm b/code/game/gamemodes/devil/devil_game_mode.dm index 7fe2f91714..64de9f2097 100644 --- a/code/game/gamemodes/devil/devil_game_mode.dm +++ b/code/game/gamemodes/devil/devil_game_mode.dm @@ -47,15 +47,15 @@ if(devils.len < required_enemies) setup_error = "Not enough devil candidates" - return 0 - return 1 + return FALSE + return TRUE /datum/game_mode/devil/post_setup() for(var/datum/mind/devil in devils) post_setup_finalize(devil) ..() - return 1 + return TRUE /datum/game_mode/devil/generate_report() return "Infernal creatures have been seen nearby offering great boons in exchange for souls. This is considered theft against Nanotrasen, as all employment contracts contain a lien on the \ diff --git a/code/game/gamemodes/dynamic/dynamic.dm b/code/game/gamemodes/dynamic/dynamic.dm index c31cbbdcfc..8d7a48385b 100644 --- a/code/game/gamemodes/dynamic/dynamic.dm +++ b/code/game/gamemodes/dynamic/dynamic.dm @@ -546,7 +546,7 @@ GLOBAL_VAR_INIT(dynamic_forced_threat_level, -1) return ruleset.cost + added_threat else stack_trace("The starting rule \"[ruleset.name]\" failed to pre_execute.") - return 0 + return FALSE /// Mainly here to facilitate delayed rulesets. All roundstart rulesets are executed with a timered callback to this proc. /datum/game_mode/dynamic/proc/execute_roundstart_rule(sent_rule) diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets.dm b/code/game/gamemodes/dynamic/dynamic_rulesets.dm index b742f6f36c..88c1dfc747 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets.dm @@ -115,7 +115,7 @@ /// Returns how much threat to actually spend in the end. /datum/dynamic_ruleset/proc/scale_up(population, max_scale) if (!scaling_cost) - return 0 + return FALSE var/antag_fraction = 0 for(var/_ruleset in (mode.executed_rules + list(src))) // we care about the antags we *will* assign, too diff --git a/code/game/gamemodes/extended/extended.dm b/code/game/gamemodes/extended/extended.dm index bfc75a9dc1..1692e9fef6 100644 --- a/code/game/gamemodes/extended/extended.dm +++ b/code/game/gamemodes/extended/extended.dm @@ -9,7 +9,7 @@ announce_text = "Just have fun and enjoy the game!" /datum/game_mode/extended/pre_setup() - return 1 + return TRUE /datum/game_mode/extended/generate_report() return "The transmission mostly failed to mention your sector. It is possible that there is nothing in the Syndicate that could threaten your station during this shift." diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 2bc497e62a..b0b1a1a4b1 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -68,22 +68,22 @@ playerC++ if(!GLOB.Debug2) if(playerC < required_players || (maximum_players >= 0 && playerC > maximum_players)) - return 0 + return FALSE antag_candidates = get_players_for_role(antag_flag) if(!GLOB.Debug2) if(antag_candidates.len < required_enemies) - return 0 - return 1 + return FALSE + return TRUE else message_admins("DEBUG: GAME STARTING WITHOUT PLAYER NUMBER CHECKS, THIS WILL PROBABLY BREAK SHIT.") - return 1 + return TRUE ///Attempts to select players for special roles the mode might have. /datum/game_mode/proc/pre_setup() - return 1 + return TRUE ///Everyone should now be on the station and have their normal gear. This is the place to give the special roles extra things /datum/game_mode/proc/post_setup(report) //Gamemodes can override the intercept report. Passing TRUE as the argument will force a report. @@ -162,10 +162,10 @@ switch(SSshuttle.emergency.mode) //Rounds on the verge of ending don't get new antags, they just run out if(SHUTTLE_STRANDED, SHUTTLE_ESCAPE) - return 1 + return TRUE if(SHUTTLE_CALL) if(SSshuttle.emergency.timeLeft(1) < initial(SSshuttle.emergencyCallTime)*0.5) - return 1 + return TRUE var/matc = CONFIG_GET(number/midround_antag_time_check) if(world.time >= (matc * 600)) @@ -202,7 +202,7 @@ //somewhere between 1 and 3 minutes from now if(!CONFIG_GET(keyed_list/midround_antag)[SSticker.mode.config_tag]) round_converted = 0 - return 1 + return TRUE for(var/mob/living/carbon/human/H in antag_candidates) if(H.client) replacementmode.make_antag_chance(H) @@ -213,7 +213,7 @@ ///Called by the gameSSticker /datum/game_mode/process() - return 0 + return FALSE //For things that do not die easily /datum/game_mode/proc/are_special_antags_dead() @@ -237,44 +237,44 @@ if(Player.mind) if(Player.mind.special_role || LAZYLEN(Player.mind.antag_datums)) continuous_sanity_checked = 1 - return 0 + return FALSE if(!continuous_sanity_checked) message_admins("The roundtype ([config_tag]) has no antagonists, continuous round has been defaulted to on and midround_antag has been defaulted to off.") continuous[config_tag] = TRUE midround_antag[config_tag] = FALSE SSshuttle.clearHostileEnvironment(src) - return 0 + return FALSE if(living_antag_player && living_antag_player.mind && isliving(living_antag_player) && living_antag_player.stat != DEAD && !isnewplayer(living_antag_player) &&!isbrain(living_antag_player) && (living_antag_player.mind.special_role || LAZYLEN(living_antag_player.mind.antag_datums))) - return 0 //A resource saver: once we find someone who has to die for all antags to be dead, we can just keep checking them, cycling over everyone only when we lose our mark. + return FALSE //A resource saver: once we find someone who has to die for all antags to be dead, we can just keep checking them, cycling over everyone only when we lose our mark. for(var/mob/Player in GLOB.alive_mob_list) if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) &&!isbrain(Player) && Player.client) if(Player.mind.special_role || LAZYLEN(Player.mind.antag_datums)) //Someone's still antaging! living_antag_player = Player - return 0 + return FALSE if(!are_special_antags_dead()) return FALSE if(!continuous[config_tag] || force_ending) - return 1 + return TRUE else round_converted = convert_roundtype() if(!round_converted) if(round_ends_with_antag_death) - return 1 + return TRUE else midround_antag[config_tag] = 0 - return 0 + return FALSE - return 0 + return FALSE /datum/game_mode/proc/check_win() //universal trigger to be called at mob death, nuke explosion, etc. To be called from everywhere. - return 0 + return FALSE /datum/game_mode/proc/send_intercept() if(flipseclevel && !(config_tag == "extended"))//CIT CHANGE - lets the security level be flipped roundstart @@ -533,21 +533,21 @@ //If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1 /datum/game_mode/proc/age_check(client/C) if(get_remaining_days(C) == 0) - return 1 //Available in 0 days = available right now = player is old enough to play. - return 0 + return TRUE //Available in 0 days = available right now = player is old enough to play. + return FALSE /datum/game_mode/proc/get_remaining_days(client/C) if(!C) - return 0 + return FALSE if(C.prefs?.db_flags & DB_FLAG_EXEMPT) - return 0 + return FALSE if(!CONFIG_GET(flag/use_age_restriction_for_jobs)) - return 0 + return FALSE if(!isnum(C.player_age)) - return 0 //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced + return FALSE //This is only a number if the db connection is established, otherwise it is text: "Requires database", meaning these restrictions cannot be enforced if(!isnum(enemy_minimum_age)) - return 0 + return FALSE return max(0, enemy_minimum_age - C.player_age) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index bf45fe7efe..f0dadc8350 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -639,11 +639,11 @@ GLOBAL_LIST_EMPTY(possible_items) if(istype(I, steal_target)) if(!targetinfo) //If there's no targetinfo, then that means it was a custom objective. At this point, we know you have the item, so return 1. return TRUE - else if(targetinfo.check_special_completion(I))//Returns 1 by default. Items with special checks will return 1 if the conditions are fulfilled. + else if(targetinfo.check_special_completion(I))//Returns 1 by default. Items with special checks will return TRUE if the conditions are fulfilled. return TRUE if(targetinfo && (I.type in targetinfo.altitems)) //Ok, so you don't have the item. Do you have an alternative, at least? - if(targetinfo.check_special_completion(I))//Yeah, we do! Don't return 0 if we don't though - then you could fail if you had 1 item that didn't pass and got checked first! + if(targetinfo.check_special_completion(I))//Yeah, we do! Don't return FALSE if we don't though - then you could fail if you had 1 item that didn't pass and got checked first! return TRUE return FALSE diff --git a/code/game/gamemodes/objective_items.dm b/code/game/gamemodes/objective_items.dm index 78644281b8..2a64f69038 100644 --- a/code/game/gamemodes/objective_items.dm +++ b/code/game/gamemodes/objective_items.dm @@ -9,7 +9,7 @@ var/list/special_equipment = list() /datum/objective_item/proc/check_special_completion() //for objectives with special checks (is that slime extract unused? does that intellicard have an ai in it? etcetc) - return 1 + return TRUE /datum/objective_item/proc/TargetExists() return TRUE @@ -142,8 +142,8 @@ /datum/objective_item/steal/functionalai/check_special_completion(obj/item/aicard/C) for(var/mob/living/silicon/ai/A in C) if(isAI(A) && A.stat != DEAD) //See if any AI's are alive inside that card. - return 1 - return 0 + return TRUE + return FALSE /datum/objective_item/steal/blueprints name = "the station blueprints." @@ -169,8 +169,8 @@ /datum/objective_item/steal/slime/check_special_completion(obj/item/slime_extract/E) if(E.Uses > 0) - return 1 - return 0 + return TRUE + return FALSE //Unique Objectives /datum/objective_item/unique/docs_red diff --git a/code/game/gamemodes/objective_sabotage.dm b/code/game/gamemodes/objective_sabotage.dm index 75a4ba3a10..74cc485d78 100644 --- a/code/game/gamemodes/objective_sabotage.dm +++ b/code/game/gamemodes/objective_sabotage.dm @@ -23,7 +23,7 @@ START_PROCESSING(SSprocessing, src) /datum/sabotage_objective/processing/proc/check_condition_processing() - return 1 + return TRUE /datum/sabotage_objective/processing/process() check_condition_processing() diff --git a/code/game/gamemodes/overthrow/objective.dm b/code/game/gamemodes/overthrow/objective.dm index 75b7f9f3b8..098fcce31a 100644 --- a/code/game/gamemodes/overthrow/objective.dm +++ b/code/game/gamemodes/overthrow/objective.dm @@ -34,7 +34,7 @@ return get_points() ? TRUE : FALSE /datum/objective/overthrow/proc/get_points() - return 0 // int, not bool + return FALSE // int, not bool /datum/objective/overthrow/proc/result_points(datum/mind/the_dude, base_points) // App var/initial_points = base_points diff --git a/code/game/gamemodes/sandbox/sandbox.dm b/code/game/gamemodes/sandbox/sandbox.dm index 9c38bd83e8..667bf3808a 100644 --- a/code/game/gamemodes/sandbox/sandbox.dm +++ b/code/game/gamemodes/sandbox/sandbox.dm @@ -11,7 +11,7 @@ /datum/game_mode/sandbox/pre_setup() for(var/mob/M in GLOB.player_list) M.CanBuild() - return 1 + return TRUE /datum/game_mode/sandbox/post_setup() ..() diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index e1d7737f5c..dcea781081 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -509,8 +509,8 @@ Class Procs: I.play_tool_sound(src, 50) setDir(turn(dir,-90)) to_chat(user, "You rotate [src].") - return 1 - return 0 + return TRUE + return FALSE /obj/proc/can_be_unfasten_wrench(mob/user, silent) //if we can unwrench this object; returns SUCCESSFUL_UNFASTEN and FAILED_UNFASTEN, which are both TRUE, or CANT_UNFASTEN, which isn't. if(!(isfloorturf(loc) || istype(loc, /turf/open/indestructible)) && !anchored) diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 6e794b8072..aca26ee4bc 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -274,7 +274,7 @@ /obj/machinery/camera/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 12 && !(stat & BROKEN)) - return 0 + return FALSE . = ..() /obj/machinery/camera/obj_break(damage_flag) @@ -417,4 +417,4 @@ else user.sight = 0 user.see_in_dark = 2 - return 1 + return TRUE diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 30463f4f01..95c4a089f3 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -179,7 +179,7 @@ user.see_invisible = SEE_INVISIBLE_LIVING //can't see ghosts through cameras user.sight = SEE_TURFS | SEE_BLACKNESS user.see_in_dark = 2 - return 1 + return TRUE /mob/camera/aiEye/remote/Destroy() if(origin && eye_user) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index a16e70155f..659bbd651b 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -505,10 +505,10 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) updateUsrDialog() - return 0 + return FALSE if(can_open_job(j) != 1) updateUsrDialog() - return 0 + return FALSE if(opened_positions[edit_job_target] >= 0) GLOB.time_last_changed_position = world.time / 10 j.total_positions++ @@ -522,10 +522,10 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) updateUsrDialog() - return 0 + return FALSE if(can_close_job(j) != 1) updateUsrDialog() - return 0 + return FALSE //Allow instant closing without cooldown if a position has been opened before if(opened_positions[edit_job_target] <= 0) GLOB.time_last_changed_position = world.time / 10 @@ -540,7 +540,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0) var/datum/job/j = SSjob.GetJob(priority_target) if(!j) updateUsrDialog() - return 0 + return FALSE var/priority = TRUE if(j in SSjob.prioritized_jobs) SSjob.prioritized_jobs -= j diff --git a/code/game/machinery/computer/law.dm b/code/game/machinery/computer/law.dm index 6fee35766a..397446b0a7 100644 --- a/code/game/machinery/computer/law.dm +++ b/code/game/machinery/computer/law.dm @@ -27,8 +27,8 @@ /obj/machinery/computer/upload/proc/can_upload_to(mob/living/silicon/S) if(S.stat == DEAD) - return 0 - return 1 + return FALSE + return TRUE /obj/machinery/computer/upload/ai name = "\improper AI upload console" @@ -45,9 +45,9 @@ /obj/machinery/computer/upload/ai/can_upload_to(mob/living/silicon/ai/A) if(!A || !isAI(A)) - return 0 + return FALSE if(A.control_disabled) - return 0 + return FALSE return ..() @@ -66,7 +66,7 @@ /obj/machinery/computer/upload/borg/can_upload_to(mob/living/silicon/robot/B) if(!B || !iscyborg(B)) - return 0 + return FALSE if(B.scrambledcodes || B.emagged) - return 0 + return FALSE return ..() diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 7f5fafcd80..e2bc508e55 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -571,8 +571,8 @@ if(user.canUseTopic(src, !hasSiliconAccessInArea(user))) if(!record1 || record1 == active1) if(!record2 || record2 == active2) - return 1 - return 0 + return TRUE + return FALSE /obj/machinery/computer/med_data/laptop name = "medical laptop" diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 45bb9bd327..4d1bea7b1a 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -805,9 +805,9 @@ What a mess.*/ if(authenticated) if(user.canUseTopic(src, !hasSiliconAccessInArea(user))) if(!trim(message1)) - return 0 + return FALSE if(!record1 || record1 == active1) if(!record2 || record2 == active2) - return 1 - return 0 + return TRUE + return FALSE diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 9575c45c57..a35e8b1232 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -255,7 +255,7 @@ qdel(src) /obj/machinery/door/airlock/plasma/BlockThermalConductivity() //we don't stop the heat~ - return 0 + return FALSE /obj/machinery/door/airlock/plasma/attackby(obj/item/C, mob/user, params) if(C.get_temperature() > 300)//If the temperature of the object is over 300, then ignite @@ -507,11 +507,11 @@ /obj/machinery/door/airlock/cult/allowed(mob/living/L) if(!density) - return 1 + return TRUE if(friendly || iscultist(L) || isshade(L) || isconstruct(L)) if(!stealthy) new openingoverlaytype(loc) - return 1 + return TRUE else if(!stealthy) new /obj/effect/temp_visual/cult/sac(loc) @@ -521,7 +521,7 @@ flash_color(L, flash_color="#960000", flash_time=20) L.DefaultCombatKnockdown(40) L.throw_at(throwtarget, 5, 1) - return 0 + return FALSE /obj/machinery/door/airlock/cult/proc/conceal() icon = 'icons/obj/doors/airlocks/station/maintenance.dmi' @@ -619,7 +619,7 @@ return (is_servant_of_ratvar(user) && !isAllPowerCut()) /obj/machinery/door/airlock/clockwork/ratvar_act() - return 0 + return FALSE /obj/machinery/door/airlock/clockwork/narsie_act() ..() @@ -635,8 +635,8 @@ /obj/machinery/door/airlock/clockwork/allowed(mob/M) if(is_servant_of_ratvar(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/machinery/door/airlock/clockwork/hasPower() return TRUE //yes we do have power @@ -657,36 +657,36 @@ /obj/machinery/door/airlock/clockwork/proc/attempt_construction(obj/item/I, mob/living/user) if(!I || !user || !user.canUseTopic(src)) - return 0 + return FALSE else if(I.tool_behaviour == TOOL_WRENCH) if(construction_state == GEAR_SECURE) user.visible_message("[user] begins loosening [src]'s cogwheel...", "You begin loosening [src]'s cogwheel...") if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_SECURE) - return 1 + return TRUE user.visible_message("[user] loosens [src]'s cogwheel!", "[src]'s cogwheel pops off and dangles loosely.") playsound(src, 'sound/items/deconstruct.ogg', 50, 1) construction_state = GEAR_LOOSE else if(construction_state == GEAR_LOOSE) user.visible_message("[user] begins tightening [src]'s cogwheel...", "You begin tightening [src]'s cogwheel into place...") if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_LOOSE) - return 1 + return TRUE user.visible_message("[user] tightens [src]'s cogwheel!", "You firmly tighten [src]'s cogwheel into place.") playsound(src, 'sound/items/deconstruct.ogg', 50, 1) construction_state = GEAR_SECURE - return 1 + return TRUE else if(I.tool_behaviour == TOOL_CROWBAR) if(construction_state == GEAR_SECURE) to_chat(user, "[src]'s cogwheel is too tightly secured! Your [I.name] can't reach under it!") - return 1 + return TRUE else if(construction_state == GEAR_LOOSE) user.visible_message("[user] begins slowly lifting off [src]'s cogwheel...", "You slowly begin lifting off [src]'s cogwheel...") if(!I.use_tool(src, user, 75, volume=50) || construction_state != GEAR_LOOSE) - return 1 + return TRUE user.visible_message("[user] lifts off [src]'s cogwheel, causing it to fall apart!", \ "You lift off [src]'s cogwheel, causing it to fall apart!") deconstruct(TRUE) - return 1 - return 0 + return TRUE + return FALSE /obj/machinery/door/airlock/clockwork/brass glass = TRUE diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index c209118537..45babec037 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -81,7 +81,7 @@ // linked door is open/closed (by density) then opens it/closes it. /obj/machinery/door_timer/proc/timer_start() if(stat & (NOPOWER|BROKEN)) - return 0 + return FALSE activation_time = REALTIMEOFDAY timing = TRUE @@ -98,12 +98,12 @@ continue C.locked = TRUE C.update_icon() - return 1 + return TRUE /obj/machinery/door_timer/proc/timer_end(forced = FALSE) if(stat & (NOPOWER|BROKEN)) - return 0 + return FALSE if(!forced) Radio.set_frequency(FREQ_SECURITY) @@ -127,7 +127,7 @@ C.locked = FALSE C.update_icon() - return 1 + return TRUE /obj/machinery/door_timer/proc/time_left(seconds = FALSE) @@ -137,7 +137,7 @@ /obj/machinery/door_timer/proc/set_timer(value) var/new_time = clamp(value,0,MAX_TIMER) - . = new_time == timer_duration //return 1 on no change + . = new_time == timer_duration //return TRUE on no change timer_duration = new_time /obj/machinery/door_timer/ui_interact(mob/user, datum/tgui/ui) diff --git a/code/game/machinery/doors/checkForMultipleDoors.dm b/code/game/machinery/doors/checkForMultipleDoors.dm index 73a9edde6f..0d985714f9 100644 --- a/code/game/machinery/doors/checkForMultipleDoors.dm +++ b/code/game/machinery/doors/checkForMultipleDoors.dm @@ -1,16 +1,16 @@ /obj/machinery/door/proc/checkForMultipleDoors() if(!src.loc) - return 0 + return FALSE for(var/obj/machinery/door/D in src.loc) if(!istype(D, /obj/machinery/door/window) && D.density && D != src) - return 0 - return 1 + return FALSE + return TRUE /turf/closed/wall/proc/checkForMultipleDoors() if(!src.loc) - return 0 + return FALSE for(var/obj/machinery/door/D in locate(src.x,src.y,src.z)) if(!istype(D, /obj/machinery/door/window) && D.density) - return 0 + return FALSE //There are no false wall checks because that would be fucking - return 1 + return TRUE diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index a3483e5702..248de83ef7 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -222,13 +222,13 @@ /obj/machinery/door/attackby(obj/item/I, mob/user, params) if(user.a_intent != INTENT_HARM && (I.tool_behaviour == TOOL_CROWBAR || istype(I, /obj/item/fireaxe))) try_to_crowbar(I, user) - return 1 + return TRUE else if(I.tool_behaviour == TOOL_WELDER) try_to_weld(I, user) - return 1 + return TRUE else if(!(I.item_flags & NOBLUDGEON) && user.a_intent != INTENT_HARM) try_to_activate_door(user) - return 1 + return TRUE return ..() /obj/machinery/door/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) @@ -284,7 +284,7 @@ /obj/machinery/door/proc/open() if(!density) - return 1 + return TRUE if(operating) return operating = TRUE @@ -302,7 +302,7 @@ if(autoclose) spawn(autoclose) close() - return 1 + return TRUE /obj/machinery/door/proc/close() if(density) @@ -335,7 +335,7 @@ CheckForMobs() else if(!(flags_1 & ON_BORDER_1)) crush() - return 1 + return TRUE /obj/machinery/door/proc/CheckForMobs() if(locate(/mob/living) in get_turf(src)) @@ -380,7 +380,7 @@ addtimer(CALLBACK(src, .proc/autoclose), wait, TIMER_UNIQUE | TIMER_NO_HASH_WAIT | TIMER_OVERRIDE) /obj/machinery/door/proc/requiresID() - return 1 + return TRUE /obj/machinery/door/proc/hasPower() return !(stat & NOPOWER) @@ -391,8 +391,8 @@ /obj/machinery/door/BlockThermalConductivity() // All non-glass airlocks block heat, this is intended. if(opacity || heat_proof) - return 1 - return 0 + return TRUE + return FALSE /obj/machinery/door/morgue icon = 'icons/obj/doors/doormorgue.dmi' diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d040b98a38..948878c9d0 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -393,7 +393,7 @@ for(var/T2 in T.atmos_adjacent_turfs) turfs[T2] = 1 if(turfs.len <= 10) - return 0 // not big enough to matter + return FALSE // not big enough to matter return start_point.air.return_pressure() < 20 ? -1 : 1 /obj/machinery/door/firedoor/border_only/CanAllowThrough(atom/movable/mover, turf/target) diff --git a/code/game/machinery/doors/passworddoor.dm b/code/game/machinery/doors/passworddoor.dm index 64afc07ae3..a58d84b164 100644 --- a/code/game/machinery/doors/passworddoor.dm +++ b/code/game/machinery/doors/passworddoor.dm @@ -73,4 +73,4 @@ return /obj/machinery/door/password/wave_ex_act(power, datum/wave_explosion/explosion, dir) - return 0 //no. + return FALSE //no. diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index ba96cb5bf6..b606c8e259 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -64,7 +64,7 @@ /obj/machinery/door/poddoor/Bumped(atom/movable/AM) if(density) - return 0 + return FALSE else return ..() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 7d9ec6a9a1..4ec093c8ff 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -129,7 +129,7 @@ if(get_dir(loc, T) == dir) return !density else - return 1 + return TRUE //used in the AStar algorithm to determinate if the turf the door is on is passable /obj/machinery/door/window/CanAStarPass(obj/item/card/id/ID, to_dir) @@ -144,13 +144,13 @@ /obj/machinery/door/window/open(forced=0) if (src.operating == 1) //doors can still open when emag-disabled - return 0 + return FALSE if(!forced) if(!hasPower()) - return 0 + return FALSE if(forced < 2) if(obj_flags & EMAGGED) - return 0 + return FALSE if(!src.operating) //in case of emag operating = TRUE do_animate("opening") @@ -171,13 +171,13 @@ /obj/machinery/door/window/close(forced=0) if (src.operating) - return 0 + return FALSE if(!forced) if(!hasPower()) - return 0 + return FALSE if(forced < 2) if(obj_flags & EMAGGED) - return 0 + return FALSE operating = TRUE do_animate("closing") playsound(src.loc, 'sound/machines/windowdoor.ogg', 100, 1) @@ -423,8 +423,8 @@ /obj/machinery/door/window/clockwork/allowed(mob/M) if(is_servant_of_ratvar(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/machinery/door/window/northleft dir = NORTH diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index 3beb481e00..badec7ef38 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -164,7 +164,7 @@ set waitfor = FALSE if(A.density) goIdle() - return 0 + return FALSE update_icon() A.unbolt() . = 1 diff --git a/code/game/machinery/embedded_controller/airlock_controller.dm b/code/game/machinery/embedded_controller/airlock_controller.dm index 125c6692f3..bb601ccac4 100644 --- a/code/game/machinery/embedded_controller/airlock_controller.dm +++ b/code/game/machinery/embedded_controller/airlock_controller.dm @@ -190,7 +190,7 @@ memory["processing"] = state != target_state //sensor_pressure = null //not sure if we can comment this out. Uncomment in case of problems -rastaf0 - return 1 + return TRUE /obj/machinery/embedded_controller/radio/airlock_controller diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index 0a0a4e08f3..60bd454e73 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -19,7 +19,7 @@ return null /datum/computer/file/embedded_program/process() - return 0 + return FALSE /obj/machinery/embedded_controller var/datum/computer/file/embedded_program/program @@ -44,7 +44,7 @@ /obj/machinery/embedded_controller/proc/return_text() /obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line) - return 0 + return FALSE /obj/machinery/embedded_controller/receive_signal(datum/signal/signal) if(istype(signal) && program) @@ -52,7 +52,7 @@ /obj/machinery/embedded_controller/Topic(href, href_list) if(..()) - return 0 + return FALSE if(program) program.receive_user_command(href_list["command"]) diff --git a/code/game/machinery/embedded_controller/simple_vent_controller.dm b/code/game/machinery/embedded_controller/simple_vent_controller.dm index 6416de70f1..76e802f787 100644 --- a/code/game/machinery/embedded_controller/simple_vent_controller.dm +++ b/code/game/machinery/embedded_controller/simple_vent_controller.dm @@ -28,7 +28,7 @@ ))) /datum/computer/file/embedded_program/simple_vent_controller/process() - return 0 + return FALSE /obj/machinery/embedded_controller/radio/simple_vent_controller diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 9b16f4ad0c..b67a9817aa 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -94,7 +94,7 @@ /obj/machinery/flasher/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 10) //any melee attack below 10 dmg does nothing - return 0 + return FALSE . = ..() /obj/machinery/flasher/proc/flash() @@ -126,7 +126,7 @@ if(flashed) bulb.times_used++ - return 1 + return TRUE /obj/machinery/flasher/emp_act(severity) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 2f70bfcecb..b7e5f49620 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -38,7 +38,7 @@ var/turf/location = src.loc if (isturf(location)) location.hotspot_expose(700,10,1) - return 1 + return TRUE /obj/machinery/igniter/Initialize(mapload) . = ..() @@ -127,7 +127,7 @@ var/turf/location = src.loc if (isturf(location)) location.hotspot_expose(1000,100,1) - return 1 + return TRUE /obj/machinery/sparker/emp_act(severity) . = ..() diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index c144616c05..fe242c4559 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -33,11 +33,11 @@ /obj/machinery/pipedispenser/Topic(href, href_list) if(..()) - return 1 + return TRUE var/mob/living/L = usr if(!anchored || !istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE)) usr << browse(null, "window=pipedispenser") - return 1 + return TRUE usr.set_machine(src) add_fingerprint(usr) if(href_list["makepipe"]) @@ -130,7 +130,7 @@ /obj/machinery/pipedispenser/disposal/Topic(href, href_list) if(..()) - return 1 + return TRUE usr.set_machine(src) add_fingerprint(usr) if(href_list["dmake"]) @@ -181,7 +181,7 @@ /obj/machinery/pipedispenser/disposal/transit_tube/Topic(href, href_list) if(..()) - return 1 + return TRUE usr.set_machine(src) add_fingerprint(usr) if(wait < world.time) diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index b94e51b813..5d216c1194 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -513,7 +513,7 @@ DEFINE_BITFIELD(turret_flags, list( var/atom/movable/M = pick(targets) targets -= M if(target(M)) - return 1 + return TRUE /obj/machinery/porta_turret/proc/popUp() //pops the turret up set waitfor = FALSE @@ -566,8 +566,8 @@ DEFINE_BITFIELD(turret_flags, list( if(turret_flags & TURRET_FLAG_AUTH_WEAPONS) //check for weapon authorization if(isnull(perp.wear_id) || istype(perp.wear_id.GetID(), /obj/item/card/id/syndicate)) - if(allowed(perp)) //if the perp has security access, return 0 - return 0 + if(allowed(perp)) //if the perp has security access, return FALSE + return FALSE if(perp.is_holding_item_of_type(/obj/item/gun) || perp.is_holding_item_of_type(/obj/item/melee/baton)) threatcount += 4 @@ -585,7 +585,7 @@ DEFINE_BITFIELD(turret_flags, list( // If we aren't shooting heads then return a threatcount of 0 if (!(turret_flags & TURRET_FLAG_SHOOT_HEADS) && (perp.get_assignment() in GLOB.command_positions)) - return 0 + return FALSE return threatcount @@ -600,7 +600,7 @@ DEFINE_BITFIELD(turret_flags, list( popUp() //pop the turret up if it's not already up. setDir(get_dir(base, target))//even if you can't shoot, follow the target INVOKE_ASYNC(src, .proc/shootAt, target) - return 1 + return TRUE return /obj/machinery/porta_turret/proc/shootAt(atom/movable/target, stagger_enabled = FALSE) @@ -840,7 +840,7 @@ DEFINE_BITFIELD(turret_flags, list( faction = list("neutral","silicon","turret") //Minebots, medibots, etc that should not be shot. /obj/machinery/porta_turret/aux_base/assess_perp(mob/living/carbon/human/perp) - return 0 //Never shoot humanoids. You are on your own if Ashwalkers or the like attack! + return FALSE //Never shoot humanoids. You are on your own if Ashwalkers or the like attack! /obj/machinery/porta_turret/aux_base/setup() return @@ -874,7 +874,7 @@ DEFINE_BITFIELD(turret_flags, list( AddElement(/datum/element/empprotection, EMP_PROTECT_SELF | EMP_PROTECT_WIRES) /obj/machinery/porta_turret/centcom_shuttle/assess_perp(mob/living/carbon/human/perp) - return 0 + return FALSE /obj/machinery/porta_turret/centcom_shuttle/setup() return diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index d58edbd025..dc506ee9b2 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -80,27 +80,27 @@ if(allowed) if(anchored) if(charging || panel_open) - return 1 + return TRUE //Checks to make sure he's not in space doing it, and that the area got proper power. var/area/a = get_area(src) if(!a || !a.powered(EQUIP)) to_chat(user, "[src] blinks red as you try to insert [G].") - return 1 + return TRUE if (istype(G, /obj/item/gun/energy)) var/obj/item/gun/energy/E = G if(!E.can_charge) to_chat(user, "Your gun has no external power connector.") - return 1 + return TRUE if(!user.transferItemToLoc(G, src)) - return 1 + return TRUE setCharging(G) else to_chat(user, "[src] isn't connected to anything!") - return 1 + return TRUE if(anchored && !charging) if(default_deconstruction_screwdriver(user, "recharger", "recharger", G)) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 1bd795e4f1..41d00f23e6 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -63,7 +63,7 @@ if(occupant) process_occupant() - return 1 + return TRUE /obj/machinery/recharge_station/relaymove(mob/user) if(user.stat) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index ca57e8457a..6ea3f3b9dd 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -372,7 +372,7 @@ s.set_up(5, 1, src) s.start() if(electrocute_mob(user, src, src, 1, TRUE)) - return 1 + return TRUE /obj/machinery/suit_storage_unit/relaymove(mob/user) if(locked) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index aae6cbaa5c..e4be50e19c 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -20,10 +20,10 @@ if(buckled_mobs.len > 1) var/unbuckled = input(user, "Who do you wish to unbuckle?","Unbuckle Who?") as null|mob in buckled_mobs if(user_unbuckle_mob(unbuckled,user)) - return 1 + return TRUE else if(user_unbuckle_mob(buckled_mobs[1],user)) - return 1 + return TRUE /atom/movable/attackby(obj/item/attacking_item, mob/user, params) if(!can_buckle || !istype(attacking_item, /obj/item/riding_offhand) || !user.Adjacent(src)) diff --git a/code/game/objects/effects/alien_acid.dm b/code/game/objects/effects/alien_acid.dm index 40d950332c..1e49602766 100644 --- a/code/game/objects/effects/alien_acid.dm +++ b/code/game/objects/effects/alien_acid.dm @@ -36,7 +36,7 @@ . = 1 if(!target) qdel(src) - return 0 + return FALSE if(prob(5)) playsound(loc, 'sound/items/welder.ogg', 100, 1) @@ -51,7 +51,7 @@ acid_level = max(acid_level - (5 + 2*round(sqrt(acid_level))), 0) if(acid_level <= 0) qdel(src) - return 0 + return FALSE /obj/effect/acid/Crossed(AM as mob|obj) . = ..() diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm index d9cfc09220..89e1678c6f 100644 --- a/code/game/objects/effects/effect_system/effects_foam.dm +++ b/code/game/objects/effects/effect_system/effects_foam.dm @@ -169,14 +169,14 @@ /obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L) if(lifetime<1) - return 0 + return FALSE if(!istype(L)) - return 0 + return FALSE var/fraction = 1/initial(reagent_divisor) if(lifetime % reagent_divisor) reagents.reaction(L, VAPOR, fraction) lifetime-- - return 1 + return TRUE /obj/effect/particle_effect/foam/proc/spread_foam() var/turf/t_loc = get_turf(src) diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index 9e6cde9336..453009fdaf 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -49,23 +49,23 @@ lifetime-- if(lifetime < 1) kill_smoke() - return 0 + return FALSE for(var/mob/living/L in range(0,src)) smoke_mob(L) - return 1 + return TRUE /obj/effect/particle_effect/smoke/proc/smoke_mob(mob/living/carbon/C) if(!istype(C)) - return 0 + return FALSE if(lifetime<1) - return 0 + return FALSE if(C.internal != null || C.has_smoke_protection()) - return 0 + return FALSE if(C.smoke_delay) - return 0 + return FALSE C.smoke_delay++ addtimer(CALLBACK(src, .proc/remove_smoke_delay, C), 10) - return 1 + return TRUE /obj/effect/particle_effect/smoke/proc/remove_smoke_delay(mob/living/carbon/C) if(C) @@ -131,7 +131,7 @@ M.drop_all_held_items() M.adjustOxyLoss(1) M.emote("cough") - return 1 + return TRUE /obj/effect/particle_effect/smoke/bad/Crossed(atom/movable/AM, oldloc) . = ..() @@ -210,7 +210,7 @@ if(..()) M.Sleeping(200) M.emote("cough") - return 1 + return TRUE /datum/effect_system/smoke_spread/sleeping effect_type = /obj/effect/particle_effect/smoke/sleeping @@ -235,20 +235,20 @@ reagents.reaction(AM, TOUCH, fraction) reagents.reaction(T, TOUCH, fraction) - return 1 + return TRUE /obj/effect/particle_effect/smoke/chem/smoke_mob(mob/living/carbon/M) if(lifetime<1) - return 0 + return FALSE if(!istype(M)) - return 0 + return FALSE var/mob/living/carbon/C = M if(C.internal != null || C.has_smoke_protection()) - return 0 + return FALSE var/fraction = 1/initial(lifetime) reagents.copy_to(C, fraction*reagents.total_volume) reagents.reaction(M, INGEST, fraction) - return 1 + return TRUE diff --git a/code/game/objects/effects/effect_system/effects_water.dm b/code/game/objects/effects/effect_system/effects_water.dm index 8fafda8b51..7b2878e11e 100644 --- a/code/game/objects/effects/effect_system/effects_water.dm +++ b/code/game/objects/effects/effect_system/effects_water.dm @@ -14,9 +14,9 @@ /obj/effect/particle_effect/water/Move(turf/newloc) if (--src.life < 1) qdel(src) - return 0 + return FALSE if(newloc.density) - return 0 + return FALSE .=..() /obj/effect/particle_effect/water/Bump(atom/A) diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm index 5d573c5a43..ba4fce80bb 100644 --- a/code/game/objects/effects/effects.dm +++ b/code/game/objects/effects/effects.dm @@ -22,7 +22,7 @@ return /obj/effect/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) - return 0 + return FALSE /obj/effect/experience_pressure_difference() return @@ -43,7 +43,7 @@ /obj/effect/singularity_act() qdel(src) - return 0 + return FALSE /obj/effect/ConveyorMove() return diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 22dd772ebe..78c33ac83a 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -183,7 +183,7 @@ return newDir floor = 1 - return 1 + return TRUE /** * Causes the glowshroom to decay by decreasing its endurance. diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 80178c95c4..914c70bec7 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -8,7 +8,7 @@ anchored = TRUE /obj/effect/step_trigger/proc/Trigger(atom/movable/A) - return 0 + return FALSE /obj/effect/step_trigger/Crossed(H as mob|obj) ..() diff --git a/code/game/objects/empulse.dm b/code/game/objects/empulse.dm index c467cbd4e8..c9c000d124 100644 --- a/code/game/objects/empulse.dm +++ b/code/game/objects/empulse.dm @@ -22,7 +22,7 @@ if(distance != 0) //please dont divide by 0 severity = min(max((max_distance / distance^0.3) * (100/max_distance), 1),100) //if it goes below 1 or above 100 stuff gets bad T.emp_act(severity) - return 1 + return TRUE /proc/empulse_using_range(turf/epicenter, range, log=0) //make an emp using range instead of power var/power_from_range = (7*(range^(1/0.7))) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 464017474f..ae94681f56 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -242,9 +242,9 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb /obj/item/proc/check_allowed_items(atom/target, not_inside, target_self) if(((src in target) && !target_self) || (!isturf(target.loc) && !isturf(target) && not_inside)) - return 0 + return FALSE else - return 1 + return TRUE /obj/item/blob_act(obj/structure/blob/B) if(B && B.loc == loc) @@ -576,7 +576,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb return FALSE return TRUE -//the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. +//the mob M is attempting to equip this item into the slot passed through as 'slot'. return TRUE if it can do this and 0 if it can't. //if this is being done by a mob other than M, it will include the mob equipper, who is trying to equip the item to mob M. equipper will be null otherwise. //If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. //Set disable_warning to TRUE if you wish it to not give you outputs. @@ -838,12 +838,12 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb return SEND_SIGNAL(src, COMSIG_ATOM_HITBY, AM, skipcatch, hitpush, blocked, throwingdatum) /obj/item/attack_hulk(mob/living/carbon/human/user) - return 0 + return FALSE /obj/item/attack_animal(mob/living/simple_animal/M) if (obj_flags & CAN_BE_HIT) return ..() - return 0 + return FALSE /obj/item/burn() if(!QDELETED(src)) @@ -1043,7 +1043,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb // Returns a numeric value for sorting items used as parts in machines, so they can be replaced by the rped /obj/item/proc/get_part_rating() - return 0 + return FALSE //Can this item be given to people? /obj/item/proc/can_give() @@ -1287,7 +1287,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb */ /obj/item/proc/update_action_buttons(status_only = FALSE, force = FALSE) for(var/datum/action/current_action as anything in actions) - current_action.UpdateButtonIcon(status_only, force) + current_action.UpdateButtons(status_only, force) /// Special stuff you want to do when an outfit equips this item. /obj/item/proc/on_outfit_equip(mob/living/carbon/human/outfit_wearer, visuals_only, item_slot) diff --git a/code/game/objects/items/AI_modules.dm b/code/game/objects/items/AI_modules.dm index bd674d0615..7492f5779f 100644 --- a/code/game/objects/items/AI_modules.dm +++ b/code/game/objects/items/AI_modules.dm @@ -115,7 +115,7 @@ AI MODULES to_chat(law_datum.owner, "It would be in your best interest to play along with [sender.real_name] that:") for(var/failedlaw in laws) to_chat(law_datum.owner, "[failedlaw]") - return 1 + return TRUE for(var/templaw in laws) if(law_datum.owner) @@ -162,7 +162,7 @@ AI MODULES /obj/item/ai_module/supplied/safeguard/install(datum/ai_laws/law_datum, mob/user) if(!targetName) to_chat(user, "No name detected on module, please enter one.") - return 0 + return FALSE ..() /obj/item/ai_module/supplied/safeguard/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) @@ -188,7 +188,7 @@ AI MODULES /obj/item/ai_module/zeroth/oneHuman/install(datum/ai_laws/law_datum, mob/user) if(!targetName) to_chat(user, "No name detected on module, please enter one.") - return 0 + return FALSE ..() /obj/item/ai_module/zeroth/oneHuman/transmitInstructions(datum/ai_laws/law_datum, mob/sender, overflow) @@ -251,7 +251,7 @@ AI MODULES /obj/item/ai_module/supplied/freeform/install(datum/ai_laws/law_datum, mob/user) if(laws[1] == "") to_chat(user, "No law detected on module, please create one.") - return 0 + return FALSE ..() diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 8896170bd3..e4f03d4efd 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -106,9 +106,9 @@ RLD matter += value*amount_to_use playsound(src.loc, 'sound/machines/click.ogg', 50, 1) to_chat(user, "You insert [amount_to_use] [S.name] sheets into [src]. ") - return 1 + return TRUE to_chat(user, "You can't insert any more [S.name] sheets into [src]!") - return 0 + return FALSE /obj/item/construction/proc/activate() playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1) @@ -575,12 +575,12 @@ RLD /obj/item/construction/rcd/borg/useResource(amount, mob/user) if(!iscyborg(user)) - return 0 + return FALSE var/mob/living/silicon/robot/borgy = user if(!borgy.cell) if(user) to_chat(user, no_ammo_message) - return 0 + return FALSE . = borgy.cell.use(amount * energyfactor) //borgs get 1.3x the use of their RCDs if(!. && user) to_chat(user, no_ammo_message) @@ -588,12 +588,12 @@ RLD /obj/item/construction/rcd/borg/checkResource(amount, mob/user) if(!iscyborg(user)) - return 0 + return FALSE var/mob/living/silicon/robot/borgy = user if(!borgy.cell) if(user) to_chat(user, no_ammo_message) - return 0 + return FALSE . = borgy.cell.charge >= (amount * energyfactor) if(!. && user) to_chat(user, no_ammo_message) @@ -750,7 +750,7 @@ RLD playsound(src.loc, 'sound/machines/click.ogg', 50, 1) if(do_after(user, decondelay, target = A)) if(!useResource(deconcost, user)) - return 0 + return FALSE activate() qdel(A) return TRUE @@ -811,9 +811,9 @@ RLD playsound(src.loc, 'sound/effects/light_flicker.ogg', 50, 1) if(do_after(user, floordelay, target = A)) if(!istype(F)) - return 0 + return FALSE if(!useResource(floorcost, user)) - return 0 + return FALSE activate() var/destination = get_turf(A) var/obj/machinery/light/floor/FL = new /obj/machinery/light/floor(destination) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 1a6d78b694..e891b2f7d5 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -202,7 +202,7 @@ log_game("[key_name(usr)] has renamed [prevname] to [str]") A.update_areasize() interact() - return 1 + return TRUE /obj/item/areaeditor/proc/set_area_machinery_title(area/A,title,oldtitle) diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm index 8c510bb489..6670af9bea 100644 --- a/code/game/objects/items/chrono_eraser.dm +++ b/code/game/objects/items/chrono_eraser.dm @@ -35,7 +35,7 @@ /obj/item/chrono_eraser/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_BACK) - return 1 + return TRUE /obj/item/gun/energy/chrono_gun name = "T.E.D. Projection Apparatus" @@ -108,9 +108,9 @@ var/turf/currentpos = get_turf(src) var/mob/living/user = src.loc if((currentpos == startpos) && (field in view(CHRONO_BEAM_RANGE, currentpos)) && !user.lying && (user.stat == CONSCIOUS)) - return 1 + return TRUE field_disconnect(F) - return 0 + return FALSE /obj/item/gun/energy/chrono_gun/proc/pass_mind(datum/mind/M) if(TED) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 0b733d6192..b4bf42b93d 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -127,7 +127,7 @@ refill() else if(check_empty(user, amount, requires_full)) - return 0 + return FALSE else . = min(charges_left, amount) charges_left -= . diff --git a/code/game/objects/items/credit_holochip.dm b/code/game/objects/items/credit_holochip.dm index b7f7f5f2d1..d5ccd4d960 100644 --- a/code/game/objects/items/credit_holochip.dm +++ b/code/game/objects/items/credit_holochip.dm @@ -70,7 +70,7 @@ qdel(src) return credits else - return 0 + return FALSE /obj/item/holochip/attackby(obj/item/I, mob/user, params) ..() diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 880358a2c1..bae573fad5 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -173,7 +173,7 @@ update_power() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/defibrillator/proc/make_paddles() if(!combat) @@ -188,7 +188,7 @@ /obj/item/defibrillator/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == user.getBackSlot()) - return 1 + return TRUE /obj/item/defibrillator/proc/remove_paddles(mob/user) //this fox the bug with the paddles when other player stole you the defib when you have the paddles equiped if(ismob(paddles.loc)) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index bd8a57c850..32876fc36a 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -29,6 +29,7 @@ GLOBAL_LIST_EMPTY(PDAs) item_flags = NOBLUDGEON w_class = WEIGHT_CLASS_TINY slot_flags = ITEM_SLOT_ID | ITEM_SLOT_BELT + actions_types = list(/datum/action/item_action/toggle_light/pda) armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 100) resistance_flags = FIRE_PROOF | ACID_PROOF @@ -962,7 +963,7 @@ GLOBAL_LIST_EMPTY(PDAs) /obj/item/pda/proc/toggle_light() if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE)) - return + return FALSE if(fon) fon = FALSE set_light(0) @@ -970,6 +971,7 @@ GLOBAL_LIST_EMPTY(PDAs) fon = TRUE set_light(f_lum, f_pow, f_col) update_icon() + return TRUE /obj/item/pda/proc/remove_pen() diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index cbe795ca76..2804582e89 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -62,15 +62,15 @@ /obj/item/camera_bug/check_eye(mob/user) if ( loc != user || user.incapacitated() || user.eye_blind || !current ) user.unset_machine() - return 0 + return FALSE var/turf/T_user = get_turf(user.loc) var/turf/T_current = get_turf(current) if(T_user.z != T_current.z || !current.can_use()) to_chat(user, "[src] has lost the signal.") current = null user.unset_machine() - return 0 - return 1 + return FALSE + return TRUE /obj/item/camera_bug/on_unset_machine(mob/user) user.reset_perspective(null) diff --git a/code/game/objects/items/devices/dogborg_sleeper.dm b/code/game/objects/items/devices/dogborg_sleeper.dm index 9524598956..bcdff3d6ac 100644 --- a/code/game/objects/items/devices/dogborg_sleeper.dm +++ b/code/game/objects/items/devices/dogborg_sleeper.dm @@ -59,7 +59,7 @@ return ..() /obj/item/dogborg/sleeper/Exit(atom/movable/O) - return 0 + return FALSE /obj/item/dogborg/sleeper/proc/get_host() if(!loc) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 79489c3c51..3f64be4729 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -40,7 +40,7 @@ playsound(src, on ? 'sound/weapons/magin.ogg' : 'sound/weapons/magout.ogg', 40, TRUE) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() return TRUE /obj/item/flashlight/DoRevenantThrowEffects(atom/target) diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index c5e92349c7..9c206d2003 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -170,7 +170,7 @@ /obj/item/lightreplacer/proc/Use(mob/user) playsound(src.loc, 'sound/machines/click.ogg', 50, 1) AddUses(-1) - return 1 + return TRUE // Negative numbers will subtract /obj/item/lightreplacer/proc/AddUses(amount = 1) @@ -239,9 +239,9 @@ /obj/item/lightreplacer/proc/CanUse(mob/living/user) src.add_fingerprint(user) if(uses > 0) - return 1 + return TRUE else - return 0 + return FALSE /obj/item/lightreplacer/afterattack(atom/T, mob/U, proximity) . = ..() diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index fbc241c5de..a8fe41bb7b 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -236,11 +236,11 @@ /datum/action/item_action/toggle_multitool/Trigger() if(!..()) - return 0 + return FALSE if(target) var/obj/item/multitool/ai_detect/M = target M.toggle_hud(owner) - return 1 + return TRUE /obj/item/multitool/cyborg name = "multitool" diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index dea3bda144..63de809b32 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -217,7 +217,7 @@ effective or pretty fucking useless. /obj/item/shadowcloak/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_BELT) - return 1 + return TRUE /obj/item/shadowcloak/proc/Activate(mob/living/carbon/human/user) if(!user) diff --git a/code/game/objects/items/dualsaber.dm b/code/game/objects/items/dualsaber.dm index dc1a9fbd49..0f7e7d0876 100644 --- a/code/game/objects/items/dualsaber.dm +++ b/code/game/objects/items/dualsaber.dm @@ -209,7 +209,7 @@ /obj/item/dualsaber/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) //In case thats just so happens that it is still activated on the groud, prevents hulk from picking it up if(wielded) to_chat(user, "You can't pick up such dangerous item with your meaty hands without losing fingers, better not to!") - return 1 + return TRUE /obj/item/dualsaber/process() if(wielded) diff --git a/code/game/objects/items/extinguisher.dm b/code/game/objects/items/extinguisher.dm index 372d1a1733..57c91bfd40 100644 --- a/code/game/objects/items/extinguisher.dm +++ b/code/game/objects/items/extinguisher.dm @@ -119,7 +119,7 @@ if(reagents.total_volume == reagents.maximum_volume) to_chat(user, "\The [src] is already full!") safety = safety_save - return 1 + return TRUE var/obj/structure/reagent_dispensers/W = target //will it work? var/transferred = W.reagents.trans_to(src, max_water) if(transferred > 0) @@ -130,9 +130,9 @@ else to_chat(user, "\The [W] is empty!") safety = safety_save - return 1 + return TRUE else - return 0 + return FALSE /obj/item/extinguisher/afterattack(atom/target, mob/user , flag) . = ..() diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm index f83d01f4ef..801befc9c6 100644 --- a/code/game/objects/items/granters.dm +++ b/code/game/objects/items/granters.dm @@ -129,12 +129,12 @@ /datum/action/innate/drink_fling/Activate() button_icon_state = "drinkfling_on" active = TRUE - UpdateButtonIcon() + UpdateButtons() /datum/action/innate/drink_fling/Deactivate() button_icon_state = "drinkfling_off" active = FALSE - UpdateButtonIcon() + UpdateButtons() /obj/item/book/granter/action/origami granted_action = /datum/action/innate/origami @@ -155,13 +155,13 @@ to_chat(owner, "You will now fold origami planes.") button_icon_state = "origami_on" active = TRUE - UpdateButtonIcon() + UpdateButtons() /datum/action/innate/origami/Deactivate() to_chat(owner, "You will no longer fold origami planes.") button_icon_state = "origami_off" active = FALSE - UpdateButtonIcon() + UpdateButtons() ///SPELLS/// diff --git a/code/game/objects/items/implants/implant.dm b/code/game/objects/items/implants/implant.dm index f8e02eaf03..0df8c35196 100644 --- a/code/game/objects/items/implants/implant.dm +++ b/code/game/objects/items/implants/implant.dm @@ -38,8 +38,8 @@ //What does the implant do upon injection? -//return 1 if the implant injects -//return 0 if there is no room for implant / it fails +//return TRUE if the implant injects +//return FALSE if there is no room for implant / it fails /obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE) if(SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTING, args) & COMPONENT_STOP_IMPLANTING) return @@ -99,7 +99,7 @@ var/mob/living/carbon/human/H = source H.sec_hud_set_implants() - return 1 + return TRUE /obj/item/implant/Destroy() if(imp_in) diff --git a/code/game/objects/items/implants/implant_chem.dm b/code/game/objects/items/implants/implant_chem.dm index 5f0b4f3fc3..07de277a76 100644 --- a/code/game/objects/items/implants/implant_chem.dm +++ b/code/game/objects/items/implants/implant_chem.dm @@ -59,7 +59,7 @@ /obj/item/implant/chem/activate(cause) . = ..() if(!cause || !imp_in) - return 0 + return FALSE var/mob/living/carbon/R = imp_in var/injectamount = null if (cause == "action_button") diff --git a/code/game/objects/items/implants/implant_explosive.dm b/code/game/objects/items/implants/implant_explosive.dm index 370924063d..7faffeef30 100644 --- a/code/game/objects/items/implants/implant_explosive.dm +++ b/code/game/objects/items/implants/implant_explosive.dm @@ -48,7 +48,7 @@ imp_e.weak += weak imp_e.delay += delay qdel(src) - return 1 + return TRUE return ..() diff --git a/code/game/objects/items/implants/implant_mindshield.dm b/code/game/objects/items/implants/implant_mindshield.dm index 395c0c4ce0..14a49c1a00 100644 --- a/code/game/objects/items/implants/implant_mindshield.dm +++ b/code/game/objects/items/implants/implant_mindshield.dm @@ -64,8 +64,8 @@ L.sec_hud_set_implants() if(target.stat != DEAD && !silent) to_chat(target, "Your mind suddenly feels terribly vulnerable. You are no longer safe from brainwashing.") - return 1 - return 0 + return TRUE + return FALSE /obj/item/implanter/mindshield name = "implanter (mindshield)" diff --git a/code/game/objects/items/implants/implantchair.dm b/code/game/objects/items/implants/implantchair.dm index 8777a9f5e0..263aab4039 100644 --- a/code/game/objects/items/implants/implantchair.dm +++ b/code/game/objects/items/implants/implantchair.dm @@ -158,11 +158,11 @@ /obj/machinery/implantchair/genepurge/implant_action(mob/living/carbon/human/H,mob/user) if(!istype(H)) - return 0 + return FALSE H.set_species(/datum/species/human, 1)//lizards go home purrbation_remove(H)//remove cats H.dna.remove_all_mutations()//hulks out - return 1 + return TRUE /obj/machinery/implantchair/brainwash diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 1667e023f5..d473e1c7e1 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -59,8 +59,8 @@ if(src.l_leg && src.r_leg) if(src.chest && src.head) SSblackbox.record_feedback("amount", "cyborg_frames_built", 1) - return 1 - return 0 + return TRUE + return FALSE /obj/item/robot_suit/wrench_act(mob/living/user, obj/item/I) //Deconstucts empty borg shell. Flashes remain unbroken because they haven't been used yet var/turf/T = get_turf(src) diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index 173b420710..d8730cc95b 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -719,6 +719,6 @@ user.vtec = initial(user.vtec) - maxReduction * 1 action.button_icon_state = "Chevron_State_[currentState]" - action.UpdateButtonIcon() + action.UpdateButtons() return TRUE diff --git a/code/game/objects/items/scrolls.dm b/code/game/objects/items/scrolls.dm index d58f670dc4..f1f9bd0f0b 100644 --- a/code/game/objects/items/scrolls.dm +++ b/code/game/objects/items/scrolls.dm @@ -33,7 +33,7 @@ if (usr.stat || usr.restrained() || src.loc != usr) return if (!ishuman(usr)) - return 1 + return TRUE var/mob/living/carbon/human/H = usr if(H.is_holding(src)) H.set_machine(src) diff --git a/code/game/objects/items/stacks/bscrystal.dm b/code/game/objects/items/stacks/bscrystal.dm index 125065c83e..bcc194154d 100644 --- a/code/game/objects/items/stacks/bscrystal.dm +++ b/code/game/objects/items/stacks/bscrystal.dm @@ -24,7 +24,7 @@ pixel_y = rand(-5, 5) /obj/item/stack/ore/bluespace_crystal/get_part_rating() - return 1 + return TRUE /obj/item/stack/ore/bluespace_crystal/attack_self(mob/user) user.visible_message("[user] crushes [src]!", "You crush [src]!") diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 982ad5f34a..7eca36247f 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -385,7 +385,7 @@ return FALSE return TRUE -/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return 0 = borked; return 1 = had enough +/obj/item/stack/use(used, transfer = FALSE, check = TRUE) // return FALSE = borked; return TRUE = had enough if(check && zero_amount()) return FALSE if (is_cyborg) diff --git a/code/game/objects/items/stacks/wrap.dm b/code/game/objects/items/stacks/wrap.dm index 953d69dcf7..5fa4537794 100644 --- a/code/game/objects/items/stacks/wrap.dm +++ b/code/game/objects/items/stacks/wrap.dm @@ -59,16 +59,16 @@ return SHAME /obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package - return 1 + return TRUE /obj/item/storage/can_be_package_wrapped() - return 0 + return FALSE /obj/item/storage/box/can_be_package_wrapped() - return 1 + return TRUE /obj/item/smallDelivery/can_be_package_wrapped() - return 0 + return FALSE /obj/item/stack/packageWrap/afterattack(obj/target, mob/user, proximity) . = ..() diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index 3a8f5a5cc8..99fec03c8d 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -25,7 +25,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", var/obj/item/storage/book/bible/B = locate() in src if(is_holding(B)) return B - return 0 + return FALSE /obj/item/storage/book/bible name = "bible" @@ -105,7 +105,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", var/obj/item/bodypart/BP = X if(BP.is_robotic_limb()) to_chat(user, "[src.deity_name] refuses to heal this metallic taint!") - return 0 + return FALSE var/heal_amt = 5 var/list/hurt_limbs = H.get_damaged_bodyparts(1, 1) @@ -119,7 +119,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", to_chat(H, "May the power of [deity_name] compel you to be healed!") playsound(src.loc, "punch", 25, 1, -1) SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing) - return 1 + return TRUE /obj/item/storage/book/bible/attack(mob/living/M, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1, heal_mode = TRUE) diff --git a/code/game/objects/items/storage/boxes.dm b/code/game/objects/items/storage/boxes.dm index 4465a4eb8b..781111f631 100644 --- a/code/game/objects/items/storage/boxes.dm +++ b/code/game/objects/items/storage/boxes.dm @@ -73,7 +73,7 @@ /obj/item/storage/box/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/stack/packageWrap)) - return 0 + return FALSE return ..() //Disk boxes diff --git a/code/game/objects/items/summon.dm b/code/game/objects/items/summon.dm index ca678e2cbb..f9d5875603 100644 --- a/code/game/objects/items/summon.dm +++ b/code/game/objects/items/summon.dm @@ -431,7 +431,7 @@ src.rotation = rotation // end animations animate(atom, time = 0, flags = ANIMATION_END_NOW) - return 0 + return FALSE // grab source var/rel_x = (destination.x - relative_to.x) * world.icon_size + src.dist * sin(src.angle) @@ -458,7 +458,7 @@ /datum/summon_weapon/proc/Rotate(degrees, time, rotation) . = time if(!dist) - return 0 + return FALSE var/matrix/M = ConstructMatrix(angle + degrees, dist, rotation || src.rotation) if(rotation) src.rotation = rotation diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm index 25e2f1a292..92e46836b0 100644 --- a/code/game/objects/items/tanks/jetpack.dm +++ b/code/game/objects/items/tanks/jetpack.dm @@ -50,7 +50,7 @@ to_chat(user, "You turn the jetpack off.") for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/tank/jetpack/proc/turn_on(mob/user) on = TRUE diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index 7804abdc91..ad18d1049e 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -247,19 +247,19 @@ air_contents.merge(giver) check_status() - return 1 + return TRUE /obj/item/tank/assume_air_moles(datum/gas_mixture/giver, moles) giver.transfer_to(air_contents, moles) check_status() - return 1 + return TRUE /obj/item/tank/assume_air_ratio(datum/gas_mixture/giver, ratio) giver.transfer_ratio_to(air_contents, ratio) check_status() - return 1 + return TRUE /obj/item/tank/proc/remove_air_volume(volume_to_return) if(!air_contents) @@ -281,7 +281,7 @@ //Handle exploding, leaking, and rupturing of the tank if(!air_contents) - return 0 + return FALSE var/pressure = air_contents.return_pressure() var/temperature = air_contents.return_temperature() diff --git a/code/game/objects/items/tanks/watertank.dm b/code/game/objects/items/tanks/watertank.dm index 188a8763cd..db895bbcd7 100644 --- a/code/game/objects/items/tanks/watertank.dm +++ b/code/game/objects/items/tanks/watertank.dm @@ -26,7 +26,7 @@ /obj/item/watertank/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == user.getBackSlot()) - return 1 + return TRUE /obj/item/watertank/proc/toggle_mister(mob/living/user) if(!istype(user)) @@ -88,7 +88,7 @@ /obj/item/watertank/attackby(obj/item/W, mob/user, params) if(W == noz) remove_noz() - return 1 + return TRUE else return ..() @@ -349,7 +349,7 @@ /obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_BACK) - return 1 + return TRUE /obj/item/reagent_containers/chemtank/proc/toggle_injection() var/mob/living/carbon/human/user = usr diff --git a/code/game/objects/items/tools/weldingtool.dm b/code/game/objects/items/tools/weldingtool.dm index 5bd7217484..0c8e0db987 100644 --- a/code/game/objects/items/tools/weldingtool.dm +++ b/code/game/objects/items/tools/weldingtool.dm @@ -212,8 +212,8 @@ if(get_fuel() <= 0 && welding) switched_on(user) update_icon() - return 0 - return 1 + return FALSE + return TRUE //Switches the welder on /obj/item/weldingtool/proc/switched_on(mob/user) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index e6600d323e..dafd4afc2c 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -160,10 +160,10 @@ if(istype(A, /obj/item/toy/ammo/gun)) if (src.bullets >= 7) to_chat(user, "It's already fully loaded!") - return 1 + return TRUE if (A.amount_left <= 0) to_chat(user, "There are no more caps!") - return 1 + return TRUE if (A.amount_left < (7 - src.bullets)) src.bullets += A.amount_left to_chat(user, text("You reload [] cap\s.", A.amount_left)) @@ -173,7 +173,7 @@ A.amount_left -= 7 - src.bullets src.bullets = 7 A.update_icon() - return 1 + return TRUE else return ..() diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index e7ab7214b7..67739db991 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -23,12 +23,12 @@ //returns the damage value of the attack after processing the obj's various armor protections /obj/proc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir, armour_penetration = 0) if(damage_flag == MELEE && damage_amount < damage_deflection) // TODO: Refactor armor datums and types entirely jfc - return 0 + return FALSE switch(damage_type) if(BRUTE) if(BURN) else - return 0 + return FALSE var/armor_protection = 0 if(damage_flag) armor_protection = armor.getRating(damage_flag) @@ -107,8 +107,8 @@ else playsound(src, 'sound/effects/bang.ogg', 50, 1) take_damage(hulk_damage(), BRUTE, MELEE, 0, get_dir(src, user)) - return 1 - return 0 + return TRUE + return FALSE /obj/blob_act(obj/structure/blob/B) if(isturf(loc)) @@ -135,7 +135,7 @@ return if(!M.melee_damage_upper && !M.obj_damage) M.emote("custom", message = "[M.friendly_verb_continuous] [src].") - return 0 + return FALSE else var/play_soundeffect = 1 if(M.environment_smash) @@ -187,7 +187,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e /obj/acid_act(acidpwr, acid_volume) if(!(resistance_flags & UNACIDABLE) && acid_volume) AddComponent(/datum/component/acid, acidpwr, acid_volume) - return 1 + return TRUE //called when the obj is destroyed by acid. /obj/proc/acid_melt() @@ -201,7 +201,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e if(acid) return acid.level else - return 0 + return FALSE //// FIRE @@ -216,7 +216,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e resistance_flags |= ON_FIRE SSfire_burning.processing[src] = src update_icon() - return 1 + return TRUE //called when the obj is destroyed by fire /obj/proc/burn() @@ -232,7 +232,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e /obj/zap_act(power, zap_flags, shocked_targets) if(QDELETED(src)) - return 0 + return FALSE obj_flags |= BEING_SHOCKED addtimer(CALLBACK(src, .proc/reset_shocked), 10) return power / 2 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index cfe1afad5a..10b8c04367 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -271,7 +271,7 @@ . = !density /obj/proc/check_uplink_validity() - return 1 + return TRUE /obj/vv_get_dropdown() . = ..() diff --git a/code/game/objects/structures/ai_core.dm b/code/game/objects/structures/ai_core.dm index 30cacb7802..9d34e5e659 100644 --- a/code/game/objects/structures/ai_core.dm +++ b/code/game/objects/structures/ai_core.dm @@ -414,8 +414,8 @@ That prevents a few funky behaviors. if(istype(card)) if(card.flush) to_chat(user, "ERROR: AI flush is in progress, cannot execute transfer protocol.") - return 0 - return 1 + return FALSE + return TRUE /obj/structure/ai_core/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card) if(state != AI_READY_CORE || !..()) diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm index 8f5e1c5079..5ed8c8ee02 100644 --- a/code/game/objects/structures/beds_chairs/bed.dm +++ b/code/game/objects/structures/beds_chairs/bed.dm @@ -87,7 +87,7 @@ R.loaded = src forceMove(R) user.visible_message("[user] collects [src].", "You collect [src].") - return 1 + return TRUE else return ..() @@ -95,9 +95,9 @@ . = ..() if(over_object == usr && Adjacent(usr)) if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE)) - return 0 + return FALSE if(has_buckled_mobs()) - return 0 + return FALSE usr.visible_message("[usr] collapses \the [src.name].", "You collapse \the [src.name].") var/obj/structure/bed/roller/B = new foldabletype(get_turf(src)) usr.put_in_hands(B) diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index d90d44ddfd..10cf74d44a 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -269,7 +269,7 @@ if(user in src) return if(src.tool_interact(W,user)) - return 1 // No afterattack + return TRUE // No afterattack else return ..() @@ -396,7 +396,7 @@ close() else O.forceMove(T) - return 1 + return TRUE /obj/structure/closet/relaymove(mob/living/user, direction) if(user.stat || !isturf(loc)) diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm index 09441a577e..8cf85d7f1e 100644 --- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm +++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm @@ -46,8 +46,8 @@ /obj/structure/closet/body_bag/close() if(..()) density = FALSE - return 1 - return 0 + return TRUE + return FALSE /obj/structure/closet/body_bag/handle_lock_addition() return @@ -59,11 +59,11 @@ . = ..() if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src))) if(!ishuman(usr)) - return 0 + return FALSE if(opened) - return 0 + return FALSE if(contents.len) - return 0 + return FALSE visible_message("[usr] folds up [src].") var/obj/item/bodybag/B = new foldedbag_path(get_turf(src)) usr.put_in_hands(B) @@ -83,15 +83,15 @@ . = ..() if(over_object == usr && Adjacent(usr) && (in_range(src, usr) || usr.contents.Find(src))) if(!ishuman(usr)) - return 0 + return FALSE if(opened) - return 0 + return FALSE if(contents.len >= mob_storage_capacity / 2) to_chat(usr, "There are too many things inside of [src] to fold it up!") - return 0 + return FALSE for(var/obj/item/bodybag/bluespace/B in src) to_chat(usr, "You can't recursively fold bluespace body bags!" ) - return 0 + return FALSE visible_message("[usr] folds up [src].") var/obj/item/bodybag/B = new foldedbag_path(get_turf(src)) usr.put_in_hands(B) diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm index 1d6826b548..3167d2cc22 100644 --- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm +++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm @@ -35,7 +35,7 @@ /obj/structure/closet/cardboard/open() if(opened || !can_open()) - return 0 + return FALSE var/list/alerted = null if(egged < world.time) var/mob/living/Snake = null diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm index 22996339ef..ef0dd5f2d5 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm @@ -10,7 +10,7 @@ /obj/structure/closet/secure_closet/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < melee_min_damage) - return 0 + return FALSE . = ..() // Exists to work around the minimum 700 cr price for goodies / small items / materials diff --git a/code/game/objects/structures/crates_lockers/crates/large.dm b/code/game/objects/structures/crates_lockers/crates/large.dm index c376e63880..bc024202a9 100644 --- a/code/game/objects/structures/crates_lockers/crates/large.dm +++ b/code/game/objects/structures/crates_lockers/crates/large.dm @@ -34,7 +34,7 @@ qdel(src) else - if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return 0 or just end it. + if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return FALSE or just end it. return ..() //Stops it from opening and turning invisible when items are used on it. else diff --git a/code/game/objects/structures/crates_lockers/crates/secure.dm b/code/game/objects/structures/crates_lockers/crates/secure.dm index e60454a7ce..887ca6d09b 100644 --- a/code/game/objects/structures/crates_lockers/crates/secure.dm +++ b/code/game/objects/structures/crates_lockers/crates/secure.dm @@ -10,7 +10,7 @@ /obj/structure/closet/crate/secure/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 25) - return 0 + return FALSE . = ..() /obj/structure/closet/crate/secure/update_overlays() diff --git a/code/game/objects/structures/destructible_structures.dm b/code/game/objects/structures/destructible_structures.dm index cfed4561d4..de55ab8cb4 100644 --- a/code/game/objects/structures/destructible_structures.dm +++ b/code/game/objects/structures/destructible_structures.dm @@ -16,4 +16,4 @@ if(break_sound) playsound(src, break_sound, 50, 1) qdel(src) - return 1 + return TRUE diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm index 90224af8cc..d5efe63bb9 100644 --- a/code/game/objects/structures/ghost_role_spawners.dm +++ b/code/game/objects/structures/ghost_role_spawners.dm @@ -753,7 +753,7 @@ /datum/action/toggle_dead_chat_mob/Trigger() if(!..()) - return 0 + return FALSE var/mob/M = target if(HAS_TRAIT_FROM(M,TRAIT_SIXTHSENSE,GHOSTROLE_TRAIT)) REMOVE_TRAIT(M,TRAIT_SIXTHSENSE,GHOSTROLE_TRAIT) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 5b4b3a229f..925184b7c7 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -378,7 +378,7 @@ var/obj/item/stack/sheet/runed_metal/R = W if(R.get_amount() < 1) to_chat(user, "You need at least one sheet of runed metal to construct a runed wall!") - return 0 + return FALSE user.visible_message("[user] begins laying runed metal on [src]...", "You begin constructing a runed wall...") if(do_after(user, 50, target = src)) if(R.get_amount() < 1) @@ -452,7 +452,7 @@ var/obj/item/stack/sheet/bronze/B = W if(B.get_amount() < 2) to_chat(user, "You need at least two bronze sheets to build a bronze wall!") - return 0 + return FALSE user.visible_message("[user] begins plating [src] with bronze...", "You begin constructing a bronze wall...") if(do_after(user, 50, target = src)) if(B.get_amount() < 2) diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index 5075ecd074..c0b936a76f 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -22,12 +22,12 @@ /obj/structure/janitorialcart/proc/wet_mop(obj/item/mop, mob/user) if(reagents.total_volume < 1) to_chat(user, "[src] is out of water!") - return 0 + return FALSE else reagents.trans_to(mop, 5) to_chat(user, "You wet [mop] in [src].") playsound(loc, 'sound/effects/slosh.ogg', 25, 1) - return 1 + return TRUE /obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user) if(!user.transferItemToLoc(I, src)) diff --git a/code/game/objects/structures/manned_turret.dm b/code/game/objects/structures/manned_turret.dm index 3f1cb5f4c1..5fce5a9175 100644 --- a/code/game/objects/structures/manned_turret.dm +++ b/code/game/objects/structures/manned_turret.dm @@ -80,7 +80,7 @@ return FALSE var/client/C = controller.client if(C) - var/atom/A = C.mouseObject + var/atom/A = C.mouse_object_ref?.resolve() var/turf/T = get_turf(A) if(istype(T)) //They're hovering over something in the map. direction_track(controller, T) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index c39b3f64b1..42a5a0d8cb 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -380,9 +380,9 @@ GLOBAL_LIST_EMPTY(crematoriums) if(.) return if(locate(/obj/structure/table) in get_turf(mover)) - return 1 + return TRUE else - return 0 + return FALSE /obj/structure/tray/m_tray/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) . = !density diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm index 97eadff5f6..13bd885413 100644 --- a/code/game/objects/structures/petrified_statue.dm +++ b/code/game/objects/structures/petrified_statue.dm @@ -78,28 +78,28 @@ /mob/living/carbon/human/petrify(statue_timer) if(!isturf(loc)) - return 0 + return FALSE var/obj/structure/statue/petrified/S = new(loc, src, statue_timer) S.name = "statue of [name]" bleedsuppress = 1 S.copy_overlays(src) var/newcolor = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) S.add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY) - return 1 + return TRUE /mob/living/carbon/monkey/petrify(statue_timer) if(!isturf(loc)) - return 0 + return FALSE var/obj/structure/statue/petrified/S = new(loc, src, statue_timer) S.name = "statue of a monkey" S.icon_state = "monkey" - return 1 + return TRUE /mob/living/simple_animal/pet/dog/corgi/petrify(statue_timer) if(!isturf(loc)) - return 0 + return FALSE var/obj/structure/statue/petrified/S = new (loc, src, statue_timer) S.name = "statue of a corgi" S.icon_state = "corgi" S.desc = "If it takes forever, I will wait for you..." - return 1 + return TRUE diff --git a/code/game/objects/structures/plasticflaps.dm b/code/game/objects/structures/plasticflaps.dm index ff85f5b2eb..dad0091389 100644 --- a/code/game/objects/structures/plasticflaps.dm +++ b/code/game/objects/structures/plasticflaps.dm @@ -77,24 +77,24 @@ var/obj/structure/bed/B = A if(istype(A, /obj/structure/bed) && (B.has_buckled_mobs() || B.density))//if it's a bed/chair and is dense or someone is buckled, it will not pass - return 0 + return FALSE if(istype(A, /obj/structure/closet/cardboard)) var/obj/structure/closet/cardboard/C = A if(C.move_delay) - return 0 + return FALSE if(ismecha(A)) - return 0 + return FALSE else if(isliving(A)) // You Shall Not Pass! var/mob/living/M = A if(isbot(A)) //Bots understand the secrets - return 1 + return TRUE if(M.buckled && istype(M.buckled, /mob/living/simple_animal/bot/mulebot)) // mulebot passenger gets a free pass. - return 1 + return TRUE if(!M.lying && !(SEND_SIGNAL(M, COMSIG_CHECK_VENTCRAWL)) && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass. - return 0 + return FALSE /obj/structure/plasticflaps/deconstruct(disassembled = TRUE) if(!(flags_1 & NODECONSTRUCT_1)) diff --git a/code/game/objects/structures/reflector.dm b/code/game/objects/structures/reflector.dm index acf7e19f75..bdb30aff2b 100644 --- a/code/game/objects/structures/reflector.dm +++ b/code/game/objects/structures/reflector.dm @@ -56,7 +56,7 @@ return ..(NORTH) /obj/structure/reflector/proc/dir_map_to_angle(dir) - return 0 + return FALSE /obj/structure/reflector/bullet_act(obj/item/projectile/P) var/pdir = P.dir diff --git a/code/game/objects/structures/spirit_board.dm b/code/game/objects/structures/spirit_board.dm index 1b3093e4e7..514128a8b5 100644 --- a/code/game/objects/structures/spirit_board.dm +++ b/code/game/objects/structures/spirit_board.dm @@ -25,7 +25,7 @@ /obj/structure/spirit_board/proc/spirit_board_pick_letter(mob/M) if(!spirit_board_checks(M)) - return 0 + return FALSE if(virgin) virgin = 0 @@ -48,7 +48,7 @@ bonus = 10 //Give some other people a chance, hog. if(next_use - bonus > world.time ) - return 0 //No feedback here, hiding the cooldown a little makes it harder to tell who's really picking letters. + return FALSE //No feedback here, hiding the cooldown a little makes it harder to tell who's really picking letters. //lighting check var/light_amount = 0 @@ -58,7 +58,7 @@ if(light_amount > 0.2) to_chat(M, "It's too bright here to use [src.name]!") - return 0 + return FALSE //mobs in range check var/users_in_range = 0 @@ -71,6 +71,6 @@ if(users_in_range < 2) to_chat(M, "There aren't enough people to use the [src.name]!") - return 0 + return FALSE - return 1 + return TRUE diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 12799b4370..1f80077447 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -741,11 +741,11 @@ /obj/structure/rack/CanPass(atom/movable/mover, turf/target) if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!| - return 1 + return TRUE if(istype(mover) && (mover.pass_flags & PASSTABLE)) - return 1 + return TRUE else - return 0 + return FALSE /obj/structure/rack/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller) . = !density @@ -769,7 +769,7 @@ if(user.a_intent == INTENT_HARM) return ..() if(user.transferItemToLoc(W, drop_location())) - return 1 + return TRUE /obj/structure/rack/attack_paw(mob/living/user) attack_hand(user) diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm index 376725b262..0819020d92 100644 --- a/code/game/objects/structures/transit_tubes/station.dm +++ b/code/game/objects/structures/transit_tubes/station.dm @@ -31,7 +31,7 @@ return ..() /obj/structure/transit_tube/station/should_stop_pod(pod, from_dir) - return 1 + return TRUE /obj/structure/transit_tube/station/Bumped(atom/movable/AM) if(!pod_moving && open_status == STATION_TUBE_OPEN && ismob(AM) && AM.dir == boarding_dir) @@ -132,8 +132,8 @@ if(open_status == STATION_TUBE_CLOSED && pod && pod.loc == loc) pod.follow_tube() pod_moving = 0 - return 1 - return 0 + return TRUE + return FALSE /obj/structure/transit_tube/station/process() if(!pod_moving) diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm index c8341c8834..be87c97759 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube.dm @@ -54,7 +54,7 @@ // Called to check if a pod should stop upon entering this tube. /obj/structure/transit_tube/proc/should_stop_pod(pod, from_dir) - return 0 + return FALSE // Called when a pod stops in this tube section. /obj/structure/transit_tube/proc/pod_stopped(pod, from_dir) @@ -66,18 +66,18 @@ for(var/direction in tube_dirs) if(direction == from_dir) - return 1 + return TRUE - return 0 + return FALSE /obj/structure/transit_tube/proc/has_exit(in_dir) for(var/direction in tube_dirs) if(direction == in_dir) - return 1 + return TRUE - return 0 + return FALSE diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm index 0ae1aff68a..bb0682f078 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -83,7 +83,7 @@ /obj/structure/transit_tube_pod/Process_Spacemove() if(moving) //No drifting while moving in the tubes - return 1 + return TRUE else return ..() diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 40424d831d..d1207c9620 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -597,7 +597,7 @@ busy = TRUE if(!do_after(user, 4 SECONDS, src)) busy = FALSE - return 1 + return TRUE busy = FALSE SEND_SIGNAL(O, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_WEAK) O.clean_blood() @@ -609,7 +609,7 @@ reagents.reaction(O, TOUCH) user.visible_message("[user] washes [O] using [src].", \ "You wash [O] using [src].") - return 1 + return TRUE else return ..() diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index 4f1de6432a..89ec6d12ed 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -69,7 +69,7 @@ if(get_dir(loc, T) == dir) return !density else - return 1 + return TRUE /obj/structure/windoor_assembly/CheckExit(atom/movable/mover, turf/target) if(mover.pass_flags & pass_flags_self) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index cf5e34fd8b..b1b02212d5 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -165,7 +165,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup) if(.) return if(dir == FULLTILE_WINDOW_DIR) - return 0 //full tile window, you can't move into it! + return FALSE //full tile window, you can't move into it! var/attempted_dir = get_dir(loc, target) if(attempted_dir == dir) return @@ -184,10 +184,10 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup) /obj/structure/window/CheckExit(atom/movable/O, turf/target) if(istype(O) && (O.pass_flags & PASSGLASS)) - return 1 + return TRUE if(get_dir(O.loc, target) == dir) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/window/attack_tk(mob/user) user.DelayNextAction(CLICK_CD_MELEE) @@ -197,7 +197,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup) /obj/structure/window/attack_hulk(mob/living/carbon/human/user, does_attack_animation = 0) if(!can_be_reached(user)) - return 1 + return TRUE . = ..() /obj/structure/window/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) @@ -218,7 +218,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup) /obj/structure/window/attackby(obj/item/I, mob/living/user, params) if(!can_be_reached(user)) - return 1 //skip the afterattack + return TRUE //skip the afterattack add_fingerprint(user) @@ -454,8 +454,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup) if(get_dir(user,src) & dir) for(var/obj/O in loc) if(!O.CanPass(user, user.loc, 1)) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/window/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1) . = ..() diff --git a/code/game/say.dm b/code/game/say.dm index 44f020e7c4..a80171c865 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(freqtospan, list( M.playsound_local(T, vol = volume, vary = TRUE, frequency = pitch, max_distance = distance, falloff_distance = 0, falloff_exponent = BARK_SOUND_FALLOFF_EXPONENT(distance), S = vocal_bark, distance_multiplier = 1) /atom/movable/proc/can_speak() - return 1 + return TRUE /atom/movable/proc/send_speech(message, range = 7, atom/movable/source = src, bubble_type, list/spans, datum/language/message_language = null, message_mode) var/rendered = compose_message(src, message_language, message, , spans, message_mode, source) @@ -202,7 +202,7 @@ GLOBAL_LIST_INIT(freqtospan, list( return "[src]" //Returns the atom's name, prepended with 'The' if it's not a proper noun /atom/movable/proc/IsVocal() - return 1 + return TRUE /atom/movable/proc/get_alt_name() diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm index ef3c6a91d9..5bae49aa91 100644 --- a/code/game/turfs/closed.dm +++ b/code/game/turfs/closed.dm @@ -37,7 +37,7 @@ return /turf/closed/indestructible/acid_act(acidpwr, acid_volume, acid_id) - return 0 + return FALSE /turf/closed/indestructible/Melt() to_be_destroyed = FALSE diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index 0e32c170d7..02f86ead1f 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -245,7 +245,7 @@ if(L.bodytemperature <= 50) L.apply_status_effect(/datum/status_effect/freon) MakeSlippery(TURF_WET_PERMAFROST, 50) - return 1 + return TRUE /turf/open/proc/water_vapor_gas_act() MakeSlippery(TURF_WET_WATER, min_wet_time = 100, wet_time_to_add = 50) diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index da1cf68d40..e728d1ee60 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -157,7 +157,7 @@ /turf/open/floor/is_shielded() for(var/obj/structure/A in contents) if(A.level == 3) - return 1 + return TRUE /turf/open/floor/blob_act(obj/structure/blob/B) return @@ -212,12 +212,12 @@ /turf/open/floor/attackby(obj/item/C, mob/user, params) if(!C || !user) - return 1 + return TRUE if(..()) - return 1 + return TRUE if(intact && istype(C, /obj/item/stack/tile)) try_replace_tile(C, user, params) - return 0 + return FALSE /turf/open/floor/crowbar_act(mob/living/user, obj/item/I) return intact ? FORCE_BOOLEAN(pry_tile(I, user)) : FALSE diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm index a7d3cda389..fd3ba4bcce 100644 --- a/code/game/turfs/simulated/floor/fancy_floor.dm +++ b/code/game/turfs/simulated/floor/fancy_floor.dm @@ -258,7 +258,7 @@ /turf/open/floor/carpet/update_icon() if(!..()) - return 0 + return FALSE if(!broken && !burnt) if(smooth) queue_smooth(src) diff --git a/code/game/turfs/simulated/floor/mineral_floor.dm b/code/game/turfs/simulated/floor/mineral_floor.dm index b7266bfb16..498417e3f8 100644 --- a/code/game/turfs/simulated/floor/mineral_floor.dm +++ b/code/game/turfs/simulated/floor/mineral_floor.dm @@ -25,7 +25,7 @@ /turf/open/floor/mineral/update_icon() if(!..()) - return 0 + return FALSE if(!broken && !burnt) if( !(icon_state in icons) ) icon_state = initial(icon_state) diff --git a/code/game/turfs/simulated/floor/plasteel_floor.dm b/code/game/turfs/simulated/floor/plasteel_floor.dm index 614c63a14c..11c0ba4f4d 100644 --- a/code/game/turfs/simulated/floor/plasteel_floor.dm +++ b/code/game/turfs/simulated/floor/plasteel_floor.dm @@ -15,7 +15,7 @@ /turf/open/floor/plasteel/update_icon() if(!..()) - return 0 + return FALSE if(!broken && !burnt) icon_state = icon_regular_floor diff --git a/code/game/turfs/simulated/wall/reinf_walls.dm b/code/game/turfs/simulated/wall/reinf_walls.dm index 620c9adfc8..944934df75 100644 --- a/code/game/turfs/simulated/wall/reinf_walls.dm +++ b/code/game/turfs/simulated/wall/reinf_walls.dm @@ -75,25 +75,25 @@ d_state = SUPPORT_LINES update_icon() to_chat(user, "You cut the outer grille.") - return 1 + return TRUE if(SUPPORT_LINES) if(W.tool_behaviour == TOOL_SCREWDRIVER) to_chat(user, "You begin unsecuring the support lines...") if(W.use_tool(src, user, 40, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_LINES) - return 1 + return TRUE d_state = COVER update_icon() to_chat(user, "You unsecure the support lines.") - return 1 + return TRUE else if(W.tool_behaviour == TOOL_WIRECUTTER) W.play_tool_sound(src, 100) d_state = INTACT update_icon() to_chat(user, "You repair the outer grille.") - return 1 + return TRUE if(COVER) if(W.tool_behaviour == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter)) @@ -102,32 +102,32 @@ to_chat(user, "You begin slicing through the metal cover...") if(W.use_tool(src, user, 60, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER) - return 1 + return TRUE d_state = CUT_COVER update_icon() to_chat(user, "You press firmly on the cover, dislodging it.") - return 1 + return TRUE if(W.tool_behaviour == TOOL_SCREWDRIVER) to_chat(user, "You begin securing the support lines...") if(W.use_tool(src, user, 40, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != COVER) - return 1 + return TRUE d_state = SUPPORT_LINES update_icon() to_chat(user, "The support lines have been secured.") - return 1 + return TRUE if(CUT_COVER) if(W.tool_behaviour == TOOL_CROWBAR) to_chat(user, "You struggle to pry off the cover...") if(W.use_tool(src, user, 100, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != CUT_COVER) - return 1 + return TRUE d_state = ANCHOR_BOLTS update_icon() to_chat(user, "You pry off the cover.") - return 1 + return TRUE if(W.tool_behaviour == TOOL_WELDER) if(!W.tool_start_check(user, amount=0)) @@ -139,28 +139,28 @@ d_state = COVER update_icon() to_chat(user, "The metal cover has been welded securely to the frame.") - return 1 + return TRUE if(ANCHOR_BOLTS) if(W.tool_behaviour == TOOL_WRENCH) to_chat(user, "You start loosening the anchoring bolts which secure the support rods to their frame...") if(W.use_tool(src, user, 40, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS) - return 1 + return TRUE d_state = SUPPORT_RODS update_icon() to_chat(user, "You remove the bolts anchoring the support rods.") - return 1 + return TRUE if(W.tool_behaviour == TOOL_CROWBAR) to_chat(user, "You start to pry the cover back into place...") if(W.use_tool(src, user, 20, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != ANCHOR_BOLTS) - return 1 + return TRUE d_state = CUT_COVER update_icon() to_chat(user, "The metal cover has been pried back into place.") - return 1 + return TRUE if(SUPPORT_RODS) if(W.tool_behaviour == TOOL_WELDER || istype(W, /obj/item/gun/energy/plasmacutter)) @@ -169,32 +169,32 @@ to_chat(user, "You begin slicing through the support rods...") if(W.use_tool(src, user, 100, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS) - return 1 + return TRUE d_state = SHEATH update_icon() to_chat(user, "You slice through the support rods.") - return 1 + return TRUE if(W.tool_behaviour == TOOL_WRENCH) to_chat(user, "You start tightening the bolts which secure the support rods to their frame...") W.play_tool_sound(src, 100) if(W.use_tool(src, user, 40)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != SUPPORT_RODS) - return 1 + return TRUE d_state = ANCHOR_BOLTS update_icon() to_chat(user, "You tighten the bolts anchoring the support rods.") - return 1 + return TRUE if(SHEATH) if(W.tool_behaviour == TOOL_CROWBAR) to_chat(user, "You struggle to pry off the outer sheath...") if(W.use_tool(src, user, 100, volume=100)) if(!istype(src, /turf/closed/wall/r_wall) || d_state != SHEATH) - return 1 + return TRUE to_chat(user, "You pry off the outer sheath.") dismantle_wall() - return 1 + return TRUE if(W.tool_behaviour == TOOL_WELDER) if(!W.tool_start_check(user, amount=0)) @@ -206,8 +206,8 @@ d_state = SUPPORT_RODS update_icon() to_chat(user, "You weld the support rods back together.") - return 1 - return 0 + return TRUE + return FALSE /turf/closed/wall/r_wall/update_icon() . = ..() diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 2df1606cb9..e9911fb02e 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -228,16 +228,16 @@ /turf/open/space/can_have_cabling() if(locate(/obj/structure/lattice/catwalk, src)) - return 1 - return 0 + return TRUE + return FALSE /turf/open/space/is_transition_turf() if(destination_x || destination_y || destination_z) - return 1 + return TRUE /turf/open/space/acid_act(acidpwr, acid_volume) - return 0 + return FALSE /turf/open/space/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) underlay_appearance.icon = 'icons/turf/space.dmi' diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 85fbbc5c77..b9be8d2386 100755 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -476,7 +476,7 @@ GLOBAL_LIST_EMPTY(station_turfs) var/atom/A for(var/i in contents) if(. <= 0) - return 0 + return FALSE A = i if(!QDELETED(A) && A.level >= affecting_level) . = A.wave_explode(., explosion, dir) diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index b8d2452874..429d1fef5d 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -173,7 +173,7 @@ AH.Resolve() //with prejudice if(banned_client && banned_client.ckey == ckey) qdel(banned_client) - return 1 + return TRUE /datum/admins/proc/DB_ban_unban(ckey, bantype, job = "") diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index 1a6f17efdf..ca307fbbbd 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -7,7 +7,7 @@ GLOBAL_PROTECT(Banlist) if(!GLOB.Banlist) // if Banlist cannot be located for some reason LoadBans() // try to load the bans if(!GLOB.Banlist) // uh oh, can't find bans! - return 0 // ABORT ABORT ABORT + return FALSE // ABORT ABORT ABORT . = list() var/appeal @@ -20,7 +20,7 @@ GLOBAL_PROTECT(Banlist) if (GLOB.Banlist["temp"]) if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() - return 0 + return FALSE else .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]] during round ID [GLOB.Banlist["roundid"]][appeal]" else @@ -47,18 +47,18 @@ GLOBAL_PROTECT(Banlist) if(GLOB.Banlist["temp"]) if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() - return 0 + return FALSE else .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]] during round ID [GLOB.Banlist["roundid"]][appeal]" else .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: PERMENANT\nBy: [GLOB.Banlist["bannedby"]] during round ID [GLOB.Banlist["roundid"]][appeal]" .["reason"] = matches return . - return 0 + return FALSE /proc/UpdateTime() //No idea why i made this a proc. GLOB.CMinutes = (world.realtime / 10) / 60 - return 1 + return TRUE /proc/LoadBans() if(!CONFIG_GET(flag/ban_legacy_system)) @@ -78,7 +78,7 @@ GLOBAL_PROTECT(Banlist) GLOB.Banlist.cd = "/base" ClearTempbans() - return 1 + return TRUE /proc/ClearTempbans() UpdateTime() @@ -97,7 +97,7 @@ GLOBAL_PROTECT(Banlist) if (GLOB.CMinutes >= GLOB.Banlist["minutes"]) RemoveBan(A) - return 1 + return TRUE /proc/AddBan(key, computerid, reason, bannedby, temp, minutes, address) @@ -111,7 +111,7 @@ GLOBAL_PROTECT(Banlist) GLOB.Banlist.cd = "/base" if ( GLOB.Banlist.dir.Find("[ban_ckey][computerid]") ) to_chat(usr, text("Ban already exists.")) - return 0 + return FALSE else GLOB.Banlist.dir.Add("[ban_ckey][computerid]") GLOB.Banlist.cd = "/base/[ban_ckey][computerid]" @@ -128,7 +128,7 @@ GLOBAL_PROTECT(Banlist) create_message("note", key, bannedby, "Permanently banned - [reason]", null, null, 0, 0, null, 0, 0) else create_message("note", key, bannedby, "Banned for [minutes] minutes - [reason]", null, null, 0, 0, null, 0, 0) - return 1 + return TRUE /proc/RemoveBan(foldername) var/key @@ -140,7 +140,7 @@ GLOBAL_PROTECT(Banlist) GLOB.Banlist.cd = "/base" if (!GLOB.Banlist.dir.Remove(foldername)) - return 0 + return FALSE if(!usr) log_admin_private("Ban Expired: [key]") @@ -157,13 +157,13 @@ GLOBAL_PROTECT(Banlist) GLOB.Banlist.dir.Remove(A) continue - return 1 + return TRUE /proc/GetExp(minutes as num) UpdateTime() var/exp = minutes - GLOB.CMinutes if (exp <= 0) - return 0 + return FALSE else var/timeleftstring if (exp >= 1440) //1440 = 1 day in minutes diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index e5391f0f43..6bd4fd040e 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -29,7 +29,7 @@ if ("Instant Runoff Voting") polltype = POLLTYPE_IRV else - return 0 + return FALSE var/starttime = SQLtime() var/endtime = input("Set end time for poll as format YYYY-MM-DD HH:MM:SS. All times in server time. HH:MM:SS is optional and 24-hour. Must be later than starting time for obvious reasons.", "Set end time", SQLtime()) as text if(!endtime) @@ -117,7 +117,7 @@ if("Finish") add_option = 0 else - return 0 + return FALSE var/m1 = "[key_name(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"] - Question: [question]" var/m2 = "[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]
Question: [question]" var/datum/db_query/query_polladd_question = SSdbcore.NewQuery({" diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 4e97c6fd59..ea16283070 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -140,21 +140,21 @@ GLOBAL_PROTECT(href_token) /datum/admins/proc/check_for_rights(rights_required) if(rights_required && !(rights_required & rank.rights)) - return 0 - return 1 + return FALSE + return TRUE /datum/admins/proc/check_if_greater_rights_than_holder(datum/admins/other) if(!other) - return 1 //they have no rights + return TRUE //they have no rights if(rank.rights == R_EVERYTHING) - return 1 //we have all the rights + return TRUE //we have all the rights if(src == other) - return 1 //you always have more rights than yourself + return TRUE //you always have more rights than yourself if(rank.rights != other.rank.rights) if( (rank.rights & other.rank.rights) == other.rank.rights ) - return 1 //we have all the rights they have and more - return 0 + return TRUE //we have all the rights they have and more + return FALSE /datum/admins/vv_edit_var(var_name, var_value) if(var_name == NAMEOF(src, fakekey)) @@ -164,7 +164,7 @@ GLOBAL_PROTECT(href_token) /* checks if usr is an admin with at least ONE of the flags in rights_required. (Note, they don't need all the flags) if rights_required == 0, then it simply checks if they are an admin. -if it doesn't return 1 and show_msg=1 it will prints a message explaining why the check has failed +if it doesn't return TRUE and show_msg=1 it will prints a message explaining why the check has failed generally it would be used like so: /proc/admin_proc() @@ -178,26 +178,26 @@ you will have to do something like if(client.rights & R_ADMIN) yourself. /proc/check_rights(rights_required, show_msg=1) if(usr && usr.client) if (check_rights_for(usr.client, rights_required)) - return 1 + return TRUE else if(show_msg) to_chat(usr, "Error: You do not have sufficient rights to do that. You require one of the following flags:[rights2text(rights_required," ")].") - return 0 + return FALSE //probably a bit iffy - will hopefully figure out a better solution /proc/check_if_greater_rights_than(client/other) if(usr && usr.client) if(usr.client.holder) if(!other || !other.holder) - return 1 + return TRUE return usr.client.holder.check_if_greater_rights_than_holder(other.holder) - return 0 + return FALSE //This proc checks whether subject has at least ONE of the rights specified in rights_required. /proc/check_rights_for(client/subject, rights_required) if(subject && subject.holder) return subject.holder.check_for_rights(rights_required) - return 0 + return FALSE /proc/GenerateToken() . = "" diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 34afce6aa2..c1bf537dd8 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1026,7 +1026,7 @@ to_chat(M, "The reason is: [reason]") to_chat(M, "This jobban will be lifted in [mins] minutes.") href_list["jobban2"] = 1 // lets it fall through and refresh - return 1 + return TRUE if("No") var/reason = input(usr,"Please State Reason For Banning [M.key].","Reason") as message|null severity = input("Set the severity of the note/ban.", "Severity", null, null) as null|anything in list("High", "Medium", "Minor", "None") @@ -1052,7 +1052,7 @@ to_chat(M, "The reason is: [reason]") to_chat(M, "Jobban can be lifted only upon request.") href_list["jobban2"] = 1 // lets it fall through and refresh - return 1 + return TRUE if("Cancel") return @@ -1081,8 +1081,8 @@ message_admins("[key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg].") to_chat(M, "You have been un-jobbanned by [usr.client.key] from [msg].") href_list["jobban2"] = 1 // lets it fall through and refresh - return 1 - return 0 //we didn't do anything! + return TRUE + return FALSE //we didn't do anything! else if(href_list["boot2"]) if(!check_rights(R_ADMIN)) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 199ac646d9..e49847764d 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -89,11 +89,11 @@ available.Add(C) var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available if(!choice) - return 0 + return FALSE if(!isobserver(choice)) var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No") if(confirm != "Yes") - return 0 + return FALSE var/obj/item/paicard/card = new(T) var/mob/living/silicon/pai/pai = new(card) pai.name = input(choice, "Enter your pAI name:", "pAI Name", "Personal AI") as text diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 532a361ba0..89c0e0210e 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -65,7 +65,7 @@ GLOBAL_PROTECT(admin_verbs_debug_mapping) icon_state = "yellow" /obj/effect/debugging/marker/Move() - return 0 + return FALSE /client/proc/camera_view() set category = "Mapping" @@ -111,7 +111,7 @@ GLOBAL_LIST_EMPTY(dirty_vars) if(!Master) alert(usr,"Master_controller not found.","Sec Camera Report") - return 0 + return FALSE var/list/obj/machinery/camera/CL = list() diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 6c43d61cce..ff9183f834 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -70,10 +70,10 @@ H.mind.make_Traitor() candidates.Remove(H) - return 1 + return TRUE - return 0 + return FALSE /datum/admins/proc/makeChangelings() @@ -102,9 +102,9 @@ H.mind.make_Changeling() candidates.Remove(H) - return 1 + return TRUE - return 0 + return FALSE /datum/admins/proc/makeRevs() @@ -131,9 +131,9 @@ H = pick(candidates) H.mind.make_Rev() candidates.Remove(H) - return 1 + return TRUE - return 0 + return FALSE /datum/admins/proc/makeWizard() @@ -171,9 +171,9 @@ H.mind.make_Cultist() candidates.Remove(H) - return 1 + return TRUE - return 0 + return FALSE /datum/admins/proc/makeClockCult() @@ -206,9 +206,9 @@ SSticker.mode.equip_servant(H) candidates.Remove(H) - return 1 + return TRUE - return 0 + return FALSE @@ -236,7 +236,7 @@ break //Making sure we have atleast 3 Nuke agents, because less than that is kinda bad if(agentcount < 3) - return 0 + return FALSE //Let's find the spawn locations var/leader_chosen = FALSE @@ -249,9 +249,9 @@ nuke_team = N.nuke_team else new_character.mind.add_antag_datum(/datum/antagonist/nukeop,nuke_team) - return 1 + return TRUE else - return 0 + return FALSE @@ -451,8 +451,8 @@ //Abductors /datum/admins/proc/makeAbductorTeam() new /datum/round_event/ghost_role/abductor - return 1 + return TRUE /datum/admins/proc/makeRevenant() new /datum/round_event/ghost_role/revenant(TRUE, TRUE) - return 1 + return TRUE diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 2d7f1e8e9f..17ecab9b08 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -300,7 +300,7 @@ else to_chat(usr, "Error: create_xeno(): no suitable candidates.") if(!istext(ckey)) - return 0 + return FALSE var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva") var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : null @@ -319,7 +319,7 @@ if("Larva") new_xeno = new /mob/living/carbon/alien/larva(spawn_here) else - return 0 + return FALSE if(!spawn_here) SSjob.SendToLateJoin(new_xeno, FALSE) @@ -327,7 +327,7 @@ var/msg = "[key_name_admin(usr)] has spawned [ckey] as a filthy xeno [alien_caste]." message_admins(msg) admin_ticket_log(new_xeno, msg) - return 1 + return TRUE /* If a guy was gibbed and you want to revive him, this is a good way to do so. diff --git a/code/modules/antagonists/_common/antag_datum.dm b/code/modules/antagonists/_common/antag_datum.dm index ca392a0441..6648c6f944 100644 --- a/code/modules/antagonists/_common/antag_datum.dm +++ b/code/modules/antagonists/_common/antag_datum.dm @@ -449,7 +449,7 @@ GLOBAL_LIST_EMPTY(antagonists) antag_memory = new_memo /** - * Gets how fast we can hijack the shuttle, return 0 for can not hijack. + * Gets how fast we can hijack the shuttle, return FALSE for can not hijack. * Defaults to hijack_speed var, override for custom stuff like buffing hijack speed for hijack objectives or something. */ /datum/antagonist/proc/hijack_speed() diff --git a/code/modules/antagonists/_common/antag_spawner.dm b/code/modules/antagonists/_common/antag_spawner.dm index bcba1e1e1e..a12f050596 100644 --- a/code/modules/antagonists/_common/antag_spawner.dm +++ b/code/modules/antagonists/_common/antag_spawner.dm @@ -50,7 +50,7 @@ if(H.stat || H.restrained()) return if(!ishuman(H)) - return 1 + return TRUE if(loc == H || (in_range(src, H) && isturf(loc))) H.set_machine(src) diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm index 343faccad6..293b5bac4b 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm @@ -59,7 +59,7 @@ H.update_inv_wear_suit() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/suit/armor/abductor/vest/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_OCLOTHING) //we only give the mob the ability to activate the vest if he's actually wearing it. diff --git a/code/modules/antagonists/blob/blob/blob_report.dm b/code/modules/antagonists/blob/blob/blob_report.dm index d532121e12..c417fa6574 100644 --- a/code/modules/antagonists/blob/blob/blob_report.dm +++ b/code/modules/antagonists/blob/blob/blob_report.dm @@ -61,7 +61,7 @@ /datum/station_state/proc/score(datum/station_state/result) if(!result) - return 0 + return FALSE var/output = 0 output += (result.floor / max(floor,1)) output += (result.r_wall/ max(r_wall,1)) diff --git a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm index 55a44b70de..833a8ee95e 100644 --- a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm +++ b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm @@ -53,7 +53,7 @@ /mob/living/simple_animal/hostile/blob/Process_Spacemove(movement_dir = 0) for(var/obj/structure/blob/B in range(1, src)) - return 1 + return TRUE return ..() /mob/living/simple_animal/hostile/blob/proc/blob_chat(msg) diff --git a/code/modules/antagonists/blob/blob/blobstrains/_blobstrain.dm b/code/modules/antagonists/blob/blob/blobstrains/_blobstrain.dm index 8b6f4bd687..2c55cc6915 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/_blobstrain.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/_blobstrain.dm @@ -65,7 +65,7 @@ GLOBAL_LIST_INIT(valid_blobstrains, subtypesof(/datum/blobstrain) - list(/datum/ return /datum/blobstrain/proc/tesla_reaction(obj/structure/blob/B, power, coefficient = 1) //when the blob is hit by a tesla bolt, do this - return 1 //return 0 to ignore damage + return TRUE //return FALSE to ignore damage /datum/blobstrain/proc/extinguish_reaction(obj/structure/blob/B, coefficient = 1) //when the blob is hit with water, do this return diff --git a/code/modules/antagonists/blob/blob/blobstrains/_reagent.dm b/code/modules/antagonists/blob/blob/blobstrains/_reagent.dm index f47c3b3378..385fa1f7ae 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/_reagent.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/_reagent.dm @@ -29,5 +29,5 @@ /datum/reagent/blob/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O) if(M.stat == DEAD || istype(M, /mob/living/simple_animal/hostile/blob)) - return 0 //the dead, and blob mobs, don't cause reactions + return FALSE //the dead, and blob mobs, don't cause reactions return round(reac_volume * min(1.5 - touch_protection, 1), 0.1) //full touch protection means 50% volume, any prot below 0.5 means 100% volume. diff --git a/code/modules/antagonists/blob/blob/blobstrains/blazing_oil.dm b/code/modules/antagonists/blob/blob/blobstrains/blazing_oil.dm index be08266687..471d2d607d 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/blazing_oil.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/blazing_oil.dm @@ -23,7 +23,7 @@ if(!(C && C.overmind && C.overmind.blobstrain.type == B.overmind.blobstrain.type) && prob(80)) new /obj/effect/hotspot(T) if(damage_flag == FIRE) - return 0 + return FALSE return ..() /datum/reagent/blob/blazing_oil diff --git a/code/modules/antagonists/blob/blob/blobstrains/energized_jelly.dm b/code/modules/antagonists/blob/blob/blobstrains/energized_jelly.dm index c22b429e1b..a25a4d1974 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/energized_jelly.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/energized_jelly.dm @@ -15,7 +15,7 @@ return ..() /datum/blobstrain/reagent/energized_jelly/tesla_reaction(obj/structure/blob/B, power) - return 0 + return FALSE /datum/blobstrain/reagent/energized_jelly/emp_reaction(obj/structure/blob/B, severity) var/damage = rand(30, 50) - severity * rand(10, 15) diff --git a/code/modules/antagonists/blob/blob/blobstrains/explosive_lattice.dm b/code/modules/antagonists/blob/blob/blobstrains/explosive_lattice.dm index c805069a9c..afc83f5a62 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/explosive_lattice.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/explosive_lattice.dm @@ -13,7 +13,7 @@ /datum/blobstrain/reagent/explosive_lattice/damage_reaction(obj/structure/blob/B, damage, damage_type, damage_flag) if(damage_flag == BOMB) - return 0 + return FALSE else if(damage_flag != MELEE && damage_flag != BULLET && damage_flag != LASER) return damage * 1.5 return ..() diff --git a/code/modules/antagonists/blob/blob/blobstrains/multiplex.dm b/code/modules/antagonists/blob/blob/blobstrains/multiplex.dm index 191da6c51f..953608aa5c 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/multiplex.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/multiplex.dm @@ -29,7 +29,7 @@ for (var/datum/blobstrain/bt in blobstrains) . += bt.tesla_reaction(B, power, coefficient*typeshare) if (prob(. / length(blobstrains) * 100)) - return 1 + return TRUE /datum/blobstrain/multiplex/extinguish_reaction(obj/structure/blob/B, coefficient = 1) //when the blob is hit with water, do this for (var/datum/blobstrain/bt in blobstrains) diff --git a/code/modules/antagonists/blob/blob/blobstrains/reactive_spines.dm b/code/modules/antagonists/blob/blob/blobstrains/reactive_spines.dm index 84ff383dd1..104637aecc 100644 --- a/code/modules/antagonists/blob/blob/blobstrains/reactive_spines.dm +++ b/code/modules/antagonists/blob/blob/blobstrains/reactive_spines.dm @@ -26,5 +26,5 @@ /datum/reagent/blob/reactive_spines/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O) if(M.stat == DEAD || istype(M, /mob/living/simple_animal/hostile/blob)) - return 0 //the dead, and blob mobs, don't cause reactions + return FALSE //the dead, and blob mobs, don't cause reactions M.adjustBruteLoss(0.8*reac_volume) diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm index ec95d32fd4..7a3c2a3012 100644 --- a/code/modules/antagonists/blob/blob/overmind.dm +++ b/code/modules/antagonists/blob/blob/overmind.dm @@ -264,13 +264,13 @@ GLOBAL_LIST_EMPTY(blob_nodes) if(B) forceMove(NewLoc) else - return 0 + return FALSE else var/area/A = get_area(NewLoc) if(isspaceturf(NewLoc) || istype(A, /area/shuttle)) //if unplaced, can't go on shuttles or space tiles - return 0 + return FALSE forceMove(NewLoc) - return 1 + return TRUE /mob/camera/blob/mind_initialize() . = ..() diff --git a/code/modules/antagonists/blob/blob/powers.dm b/code/modules/antagonists/blob/blob/powers.dm index 9256d0d16b..18886765de 100644 --- a/code/modules/antagonists/blob/blob/powers.dm +++ b/code/modules/antagonists/blob/blob/powers.dm @@ -1,15 +1,15 @@ /mob/camera/blob/proc/can_buy(cost = 15) if(blob_points < cost) to_chat(src, "You cannot afford this, you need at least [cost] resources!") - return 0 + return FALSE add_points(-cost) - return 1 + return TRUE // Power verbs /mob/camera/blob/proc/place_blob_core(placement_override, pop_override = FALSE) if(placed && placement_override != -1) - return 1 + return TRUE if(!placement_override) if(!pop_override) for(var/mob/living/M in range(7, src)) @@ -17,30 +17,30 @@ continue if(M.client) to_chat(src, "There is someone too close to place your blob core!") - return 0 + return FALSE for(var/mob/living/M in view(13, src)) if(ROLE_BLOB in M.faction) continue if(M.client) to_chat(src, "Someone could see your blob core from here!") - return 0 + return FALSE var/turf/T = get_turf(src) if(T.density) to_chat(src, "This spot is too dense to place a blob core on!") - return 0 + return FALSE for(var/obj/O in T) if(istype(O, /obj/structure/blob)) if(istype(O, /obj/structure/blob/normal)) qdel(O) else to_chat(src, "There is already a blob here!") - return 0 + return FALSE else if(O.density) to_chat(src, "This spot is too dense to place a blob core on!") - return 0 + return FALSE if(!pop_override && world.time <= manualplace_min_time && world.time <= autoplace_max_time) to_chat(src, "It is too early to place your blob core!") - return 0 + return FALSE else if(placement_override == 1) var/turf/T = pick(GLOB.blobstart) forceMove(T) //got overrided? you're somewhere random, motherfucker @@ -54,7 +54,7 @@ core.update_icon() update_health_hud() placed = 1 - return 1 + return TRUE /mob/camera/blob/verb/transport_core() set category = "Blob" diff --git a/code/modules/antagonists/blob/blob/theblob.dm b/code/modules/antagonists/blob/blob/theblob.dm index ff6eab264b..7945cf9687 100644 --- a/code/modules/antagonists/blob/blob/theblob.dm +++ b/code/modules/antagonists/blob/blob/theblob.dm @@ -123,8 +123,8 @@ heal_timestamp = world.time + 20 update_icon() pulse_timestamp = world.time + 10 - return 1 //we did it, we were pulsed! - return 0 //oh no we failed + return TRUE //we did it, we were pulsed! + return FALSE //oh no we failed /obj/structure/blob/proc/ConsumeTile() for(var/atom/A in loc) @@ -157,7 +157,7 @@ else T = null if(!T) - return 0 + return FALSE var/make_blob = TRUE //can we make a blob? if(isspaceturf(T) && !(locate(/obj/structure/lattice) in T) && prob(80)) @@ -271,7 +271,7 @@ damage_amount *= fire_resist if(CLONE) else - return 0 + return FALSE var/armor_protection = 0 if(damage_flag) armor_protection = armor.getRating(damage_flag) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm index c5f1cfbb40..a3b7fd4c0f 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_life.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_life.dm @@ -216,7 +216,7 @@ return // Disable Powers: Masquerade * NOTE * This should happen as a FLAW! //if (stat >= UNCONSCIOUS) - // for (var/datum/action/bloodsucker/masquerade/P in powers) + // for (var/datum/action/cooldown/bloodsucker/masquerade/P in powers) // P.Deactivate() // TEMP DEATH var/total_brute = owner.current.getBruteLoss_nonProsthetic() @@ -252,7 +252,7 @@ owner.current.update_sight() owner.current.reload_fullscreen() // Disable ALL Powers - for(var/datum/action/bloodsucker/power in powers) + for(var/datum/action/cooldown/bloodsucker/power in powers) if(power.active && !power.can_use_in_torpor) power.DeactivatePower() if(owner.current.suiciding) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm index 0a799021e9..019bbe6fbd 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm @@ -1,22 +1,26 @@ -/datum/action/bloodsucker +/datum/action/cooldown/bloodsucker name = "Vampiric Gift" desc = "A vampiric gift." button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon background_icon_state = "vamp_power_off" //And this is the state for the background icon - var/background_icon_state_on = "vamp_power_on" // FULP: Our "ON" icon alternative. - var/background_icon_state_off = "vamp_power_off" // FULP: Our "OFF" icon alternative. icon_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the ACTION icon button_icon_state = "power_feed" //And this is the state for the action icon buttontooltipstyle = "cult" + transparent_when_unavailable = TRUE + + /// Cooldown you'll have to wait between each use, decreases depending on level. + cooldown_time = 2 SECONDS + + ///Background icon when the Power is active. + var/background_icon_state_on = "vamp_power_on" + ///Background icon when the Power is NOT active. + var/background_icon_state_off = "vamp_power_off" // Action-Related - //var/amPassive = FALSE // REMOVED: Just made it its own kind. // Am I just "on" at all times? (aka NO ICON) var/amTargetted = FALSE // Am I asked to choose a target when enabled? (Shows as toggled ON when armed) var/amToggle = FALSE // Can I be actively turned on and off? var/amSingleUse = FALSE // Am I removed after a single use? var/active = FALSE - var/cooldown = 20 // 10 ticks, 1 second. - var/cooldownUntil = 0 // From action.dm: next_use_time = world.time + cooldown_time // Power-Related var/level_current = 0 // Can increase to yield new abilities. Each power goes up in strength each Rank. //var/level_max = 1 // @@ -32,7 +36,7 @@ //var/not_bloodsucker = FALSE // This goes to Vassals or Hunters, but NOT bloodsuckers. var/must_be_concious = TRUE //Can't use this ability while unconcious. -/datum/action/bloodsucker/New() +/datum/action/cooldown/bloodsucker/New() if(bloodcost > 0) desc += "

COST: [bloodcost] Blood" // Modify description to add cost. if(warn_constant_cost) @@ -46,7 +50,7 @@ // click.dm <--- Where we can take over mouse clicks // spells.dm /add_ranged_ability() <--- How we take over the mouse click to use a power on a target. -/datum/action/bloodsucker/Trigger() +/datum/action/cooldown/bloodsucker/Trigger() // Active? DEACTIVATE AND END! if(active && CheckCanDeactivate(TRUE)) DeactivatePower() @@ -56,7 +60,7 @@ PayCost() if(amToggle) active = !active - UpdateButtonIcon() + UpdateButtons() if(!amToggle || !active) StartCooldown() // Must come AFTER UpdateButton(), otherwise icon will revert. ActivatePower() // NOTE: ActivatePower() freezes this power in place until it ends. @@ -65,13 +69,13 @@ if(amSingleUse) RemoveAfterUse() -/datum/action/bloodsucker/proc/CheckCanPayCost(display_error) +/datum/action/cooldown/bloodsucker/proc/CheckCanPayCost(display_error) if(!owner || !owner.mind) return FALSE // Cooldown? - if(cooldownUntil > world.time) + if(next_use_time > world.time) if(display_error) - to_chat(owner, "[src] is unavailable. Wait [(cooldownUntil - world.time) / 10] seconds.") + to_chat(owner, "[src] is unavailable. Wait [(next_use_time - world.time) / 10] seconds.") return FALSE // Have enough blood? var/mob/living/L = owner @@ -81,7 +85,7 @@ return FALSE return TRUE -/datum/action/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on. +/datum/action/cooldown/bloodsucker/proc/CheckCanUse(display_error) // These checks can be scanned every frame while a ranged power is on. if(!owner || !owner.mind) return FALSE // Torpor? @@ -123,79 +127,43 @@ return FALSE return TRUE -/datum/action/bloodsucker/proc/StartCooldown() - set waitfor = FALSE - // Alpha Out - button.color = rgb(128,0,0,128) - button.alpha = 100 - // Calculate Cooldown (by power's level) - var/this_cooldown = (cooldown_static || amSingleUse) ? cooldown : max(cooldown / 2, cooldown - (cooldown / 16 * (level_current-1))) - // NOTE: With this formula, you'll hit half cooldown at level 8 for that power. - - // Wait for cooldown - cooldownUntil = world.time + this_cooldown - spawn(this_cooldown) - // Alpha In - button.color = rgb(255,255,255,255) - button.alpha = 255 - -/datum/action/bloodsucker/proc/CheckCanDeactivate(display_error) +/datum/action/cooldown/bloodsucker/proc/CheckCanDeactivate(display_error) return TRUE -/datum/action/bloodsucker/UpdateButtonIcon(force = FALSE) +/datum/action/cooldown/bloodsucker/UpdateButton(atom/movable/screen/movable/action_button/button, force = FALSE) background_icon_state = active? background_icon_state_on : background_icon_state_off - ..()//UpdateButtonIcon() + ..()//UpdateButton() - -/datum/action/bloodsucker/proc/PayCost() +/datum/action/cooldown/bloodsucker/proc/PayCost() // owner for actions is the mob, not mind. var/mob/living/L = owner L.blood_volume -= bloodcost -/datum/action/bloodsucker/proc/ActivatePower() +/datum/action/cooldown/bloodsucker/proc/ActivatePower() -/datum/action/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/proc/DeactivatePower(mob/living/user = owner, mob/living/target) active = FALSE - UpdateButtonIcon() + UpdateButtons() StartCooldown() -/datum/action/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. +/datum/action/cooldown/bloodsucker/proc/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. return active && user && (!warn_constant_cost || user.blood_volume > 0) -/datum/action/bloodsucker/proc/RemoveAfterUse() +/datum/action/cooldown/bloodsucker/proc/RemoveAfterUse() // Un-Learn Me! (GO HOME var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) if (istype(bloodsuckerdatum)) bloodsuckerdatum.powers -= src Remove(owner) -/datum/action/bloodsucker/proc/Upgrade() +/datum/action/cooldown/bloodsucker/proc/Upgrade() level_current ++ -/////////////////////////////////// PASSIVE POWERS /////////////////////////////////// - -// New Type: Passive (Always on, no button) -/datum/action/bloodsucker/passive - -/datum/action/bloodsucker/passive/New() - // REMOVED: DO NOTHBING! - ..() - // Don't Display Button! (it doesn't do anything anyhow) - button.screen_loc = DEFAULT_BLOODSPELLS - button.moved = DEFAULT_BLOODSPELLS - button.ordered = FALSE - -/datum/action/bloodsucker/passive/Destroy() - if(owner) - Remove(owner) - target = null - return ..() - /////////////////////////////////// TARGETTED POWERS /////////////////////////////////// -/datum/action/bloodsucker/targeted +/datum/action/cooldown/bloodsucker/targeted // NOTE: All Targeted spells are Toggles! We just don't bother checking here. var/target_range = 99 var/message_Trigger = "Select a target." @@ -204,7 +172,7 @@ var/power_in_use = FALSE // Is this power LOCKED due to being used? -/datum/action/bloodsucker/targeted/New(Target) +/datum/action/cooldown/bloodsucker/targeted/New(Target) desc += "
\[Targeted Power\]" // Modify description to add notice that this is aimed. ..() // Create Proc Holder for intercepting clicks @@ -212,7 +180,7 @@ bs_proc_holder.linked_power = src // Click power: Begin Aim -/datum/action/bloodsucker/targeted/Trigger() +/datum/action/cooldown/bloodsucker/targeted/Trigger() if(active && CheckCanDeactivate(TRUE)) DeactivateRangedAbility() DeactivatePower() @@ -220,7 +188,7 @@ if(!CheckCanPayCost(TRUE) || !CheckCanUse(TRUE)) return active = !active - UpdateButtonIcon() + UpdateButtons() // Create & Link Targeting Proc var/mob/living/L = owner if(L.ranged_ability) @@ -230,7 +198,7 @@ if(message_Trigger != "") to_chat(owner, "[message_Trigger]") -/datum/action/bloodsucker/targeted/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/targeted/CheckCanUse(display_error) . = ..() if(!.) return @@ -238,21 +206,21 @@ return FALSE // doesn't let you remove powers if you're not there. So, let's just cancel the power entirely. return TRUE -/datum/action/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/targeted/DeactivatePower(mob/living/user = owner, mob/living/target) // Don't run ..(), we don't want to engage the cooldown until we USE this power! active = FALSE - UpdateButtonIcon() + UpdateButtons() -/datum/action/bloodsucker/targeted/proc/DeactivateRangedAbility() +/datum/action/cooldown/bloodsucker/targeted/proc/DeactivateRangedAbility() // Only Turned off when CLICK is disabled...aka, when you successfully clicked (or bs_proc_holder.remove_ranged_ability() // Check if target is VALID (wall, turf, or character?) -/datum/action/bloodsucker/targeted/proc/CheckValidTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/proc/CheckValidTarget(atom/A) return FALSE // FALSE targets nothing. // Check if valid target meets conditions -/datum/action/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error) +/datum/action/cooldown/bloodsucker/targeted/proc/CheckCanTarget(atom/A, display_error) // Out of Range if(!(A in view(target_range, owner))) if(display_error && target_range > 1) // Only warn for range if it's greater than 1. Brawn doesn't need to announce itself. @@ -261,7 +229,7 @@ return istype(A) // Click Target -/datum/action/bloodsucker/targeted/proc/ClickWithPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/proc/ClickWithPower(atom/A) // CANCEL RANGED TARGET check if(power_in_use || !CheckValidTarget(A)) return FALSE @@ -276,21 +244,21 @@ power_in_use = FALSE return TRUE -/datum/action/bloodsucker/targeted/proc/FireTargetedPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/proc/FireTargetedPower(atom/A) // Like ActivatePower, but specific to Targeted (and takes an atom input). We don't use ActivatePower for targeted. -/datum/action/bloodsucker/targeted/proc/PowerActivatedSuccessfully() +/datum/action/cooldown/bloodsucker/targeted/proc/PowerActivatedSuccessfully() // The power went off! We now pay the cost of the power. PayCost() DeactivateRangedAbility() DeactivatePower() StartCooldown() // Do AFTER UpdateIcon() inside of DeactivatePower. Otherwise icon just gets wiped. -/datum/action/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. +/datum/action/cooldown/bloodsucker/targeted/ContinueActive(mob/living/user, mob/living/target) // Used by loops to make sure this power can stay active. return ..() // Target Proc Holder /obj/effect/proc_holder/bloodsucker - var/datum/action/bloodsucker/targeted/linked_power + var/datum/action/cooldown/bloodsucker/targeted/linked_power /obj/effect/proc_holder/bloodsucker/remove_ranged_ability(msg) ..() diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm b/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm index a86cb374d2..88a4b6bb32 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_sunlight.dm @@ -55,8 +55,8 @@ bloodsuckerdatum.warn_sun_locker = FALSE bloodsuckerdatum.warn_sun_burn = FALSE // Remove Dawn Powers - for(var/datum/action/bloodsucker/P in bloodsuckerdatum.powers) - if(istype(P, /datum/action/bloodsucker/gohome)) + for(var/datum/action/cooldown/bloodsucker/P in bloodsuckerdatum.powers) + if(istype(P, /datum/action/cooldown/bloodsucker/gohome)) bloodsuckerdatum.powers -= P P.Remove(M.current) nighttime_duration += 100 //Each day makes the night a minute longer. @@ -149,5 +149,5 @@ if(!istype(M) || !istype(M.current)) continue var/datum/antagonist/bloodsucker/bloodsuckerdatum = M.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) - if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/bloodsucker/gohome) in bloodsuckerdatum.powers)) - bloodsuckerdatum.BuyPower(new /datum/action/bloodsucker/gohome) + if(istype(bloodsuckerdatum) && bloodsuckerdatum.lair && !(locate(/datum/action/cooldown/bloodsucker/gohome) in bloodsuckerdatum.powers)) + bloodsuckerdatum.BuyPower(new /datum/action/cooldown/bloodsucker/gohome) diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm b/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm index 486ae51117..3edffe9c31 100644 --- a/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm +++ b/code/modules/antagonists/bloodsucker/bloodsucker_ui.dm @@ -14,7 +14,7 @@ dat += "
" // Step One: Decide powers you CAN buy. - for(var/pickedpower in typesof(/datum/action/bloodsucker)) + for(var/pickedpower in typesof(/datum/action/cooldown/bloodsucker)) var/obj/effect/proc_holder/spell/bloodsucker/power = pickedpower // NAME dat += "[power.name]" diff --git a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm index 73625c894d..4044ac9616 100644 --- a/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm +++ b/code/modules/antagonists/bloodsucker/datum_bloodsucker.dm @@ -168,7 +168,7 @@ return fullname -/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/bloodsucker/power)//(obj/effect/proc_holder/spell/power) +/datum/antagonist/bloodsucker/proc/BuyPower(datum/action/cooldown/bloodsucker/power)//(obj/effect/proc_holder/spell/power) powers += power power.Grant(owner.current)// owner.AddSpell(power) @@ -177,9 +177,9 @@ add_hud() update_hud(TRUE) // Set blood value, current rank // Powers - BuyPower(new /datum/action/bloodsucker/feed) - BuyPower(new /datum/action/bloodsucker/masquerade) - BuyPower(new /datum/action/bloodsucker/veil) + BuyPower(new /datum/action/cooldown/bloodsucker/feed) + BuyPower(new /datum/action/cooldown/bloodsucker/masquerade) + BuyPower(new /datum/action/cooldown/bloodsucker/veil) // Traits for(var/T in defaultTraits) ADD_TRAIT(owner.current, T, BLOODSUCKER_TRAIT) @@ -221,7 +221,7 @@ remove_hud() // Powers while(powers.len) - var/datum/action/bloodsucker/power = pick(powers) + var/datum/action/cooldown/bloodsucker/power = pick(powers) powers -= power power.Remove(owner.current) // owner.RemoveSpell(power) @@ -267,7 +267,7 @@ to_chat(owner, "Bloodsucker Tip: If you cannot find or steal a coffin to use, you can build one from wooden planks.
") /datum/antagonist/bloodsucker/proc/LevelUpPowers() - for(var/datum/action/bloodsucker/power in powers) + for(var/datum/action/cooldown/bloodsucker/power in powers) power.level_current ++ /datum/antagonist/bloodsucker/proc/SpendRank() @@ -281,8 +281,8 @@ //TODO: Make this into a radial, or perhaps a tgui next UI // Purchase Power Prompt var/list/options = list() - for(var/pickedpower in typesof(/datum/action/bloodsucker)) - var/datum/action/bloodsucker/power = pickedpower + for(var/pickedpower in typesof(/datum/action/cooldown/bloodsucker)) + var/datum/action/cooldown/bloodsucker/power = pickedpower // If I don't own it, and I'm allowed to buy it. if(!(locate(power) in powers) && initial(power.bloodsucker_can_buy)) options[initial(power.name)] = power // TESTING: After working with TGUI, it seems you can use initial() to view the variables inside a path? @@ -303,7 +303,7 @@ to_chat(owner.current, "You dont have enough blood to thicken your blood, you need [level_bloodcost - L.blood_volume] units more!") return // Buy New Powers - var/datum/action/bloodsucker/P = options[choice] + var/datum/action/cooldown/bloodsucker/P = options[choice] AddBloodVolume(-level_bloodcost) BuyPower(new P) to_chat(owner.current, "You have used [level_bloodcost] units of blood and learned [initial(P.name)]!") diff --git a/code/modules/antagonists/bloodsucker/datum_hunter.dm b/code/modules/antagonists/bloodsucker/datum_hunter.dm index b221a83a60..9c862fe42a 100644 --- a/code/modules/antagonists/bloodsucker/datum_hunter.dm +++ b/code/modules/antagonists/bloodsucker/datum_hunter.dm @@ -26,7 +26,7 @@ //owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/hunter_edition) // Give Hunter Power - var/datum/action/P = new /datum/action/bloodsucker/trackvamp + var/datum/action/P = new /datum/action/cooldown/bloodsucker/trackvamp P.Grant(owner.current) // Give Hunter Martial Arts @@ -69,7 +69,7 @@ // Take Hunter Power if (owner.current) - for (var/datum/action/bloodsucker/P in owner.current.actions) + for (var/datum/action/cooldown/bloodsucker/P in owner.current.actions) P.Remove(owner.current) // Take Hunter Martial Arts @@ -166,7 +166,7 @@ /* -/datum/action/bloodsucker/trackvamp/ +/datum/action/cooldown/bloodsucker/trackvamp/ name = "Track Monster"//"Cellular Emporium" desc = "Take a moment to look for clues of any nearby monsters.
These creatures are slippery, and often look like the crew." button_icon = 'icons/mob/actions/bloodsucker.dmi' //This is the file for the BACKGROUND icon @@ -177,7 +177,7 @@ cooldown = 300 // 10 ticks, 1 second. bloodcost = 0 -/datum/action/bloodsucker/trackvamp/ActivatePower() +/datum/action/cooldown/bloodsucker/trackvamp/ActivatePower() var/mob/living/user = owner to_chat(user, "You look around, scanning your environment and discerning signs of any filthy, wretched affronts to the natural order.") @@ -192,7 +192,7 @@ // NOTE: DON'T DEACTIVATE! //DeactivatePower() -/datum/action/bloodsucker/trackvamp/proc/display_proximity() +/datum/action/cooldown/bloodsucker/trackvamp/proc/display_proximity() // Pick target var/turf/my_loc = get_turf(owner) //var/list/mob/living/carbon/vamps = list() diff --git a/code/modules/antagonists/bloodsucker/datum_vassal.dm b/code/modules/antagonists/bloodsucker/datum_vassal.dm index 5162897d60..9a2e3a1ae6 100644 --- a/code/modules/antagonists/bloodsucker/datum_vassal.dm +++ b/code/modules/antagonists/bloodsucker/datum_vassal.dm @@ -38,7 +38,7 @@ // Master Pinpointer owner.current.apply_status_effect(/datum/status_effect/agent_pinpointer/vassal_edition) // Powers - var/datum/action/bloodsucker/vassal/recuperate/new_Recuperate = new () + var/datum/action/cooldown/bloodsucker/vassal/recuperate/new_Recuperate = new () new_Recuperate.Grant(owner.current) powers += new_Recuperate // Give Vassal Objective diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm index 25de64fe34..5f3a3dcc6f 100644 --- a/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm +++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_organs.dm @@ -33,7 +33,7 @@ /obj/item/organ/heart/vampheart/Restart() beating = 0 // DONT run ..(). We don't want to start beating again. - return 0 + return FALSE /obj/item/organ/heart/vampheart/Stop() fakingit = 0 diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm index d58190cf66..df4a11b927 100644 --- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm +++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm @@ -122,7 +122,7 @@ update_icon() //to_chat(user, "You flip a secret latch and unlock [src].") // Don't bother. We know it's unlocked. locked = FALSE - return 1 + return TRUE else playsound(get_turf(src), 'sound/machines/door_locked.ogg', 20, 1) to_chat(user, "[src] is locked tight from the inside.") diff --git a/code/modules/antagonists/bloodsucker/powers/brawn.dm b/code/modules/antagonists/bloodsucker/powers/brawn.dm index db3ce92ec1..25a04d16cc 100644 --- a/code/modules/antagonists/bloodsucker/powers/brawn.dm +++ b/code/modules/antagonists/bloodsucker/powers/brawn.dm @@ -1,11 +1,11 @@ -/datum/action/bloodsucker/targeted/brawn +/datum/action/cooldown/bloodsucker/targeted/brawn name = "Brawn" desc = "Snap restraints with ease, or deal terrible damage with your bare hands." button_icon_state = "power_strength" bloodcost = 10 - cooldown = 90 + cooldown_time = 90 target_range = 1 power_activates_immediately = TRUE message_Trigger = ""//"Whom will you subvert to your will?" @@ -16,7 +16,7 @@ var/upgrade_canLocker = FALSE var/upgrade_canDoor = FALSE -/datum/action/bloodsucker/targeted/brawn/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/targeted/brawn/CheckCanUse(display_error) . = ..() if(!.) return @@ -38,10 +38,10 @@ // NOTE: We use . = FALSE so that we can break cuffs AND throw off our attacker in one use! //return TRUE -/datum/action/bloodsucker/targeted/brawn/CheckValidTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/brawn/CheckValidTarget(atom/A) return isliving(A) || istype(A, /obj/machinery/door) -/datum/action/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error) +/datum/action/cooldown/bloodsucker/targeted/brawn/CheckCanTarget(atom/A, display_error) // DEFAULT CHECKS (Distance) if(!..()) // Disable range notice for Brawn. return FALSE @@ -59,7 +59,7 @@ return TRUE return ..() // yes, FALSE! You failed if you got here! BAD TARGET -/datum/action/bloodsucker/targeted/brawn/FireTargetedPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/brawn/FireTargetedPower(atom/A) // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. var/mob/living/carbon/target = A var/mob/living/user = owner @@ -97,7 +97,7 @@ D.open(2) // open(2) is like a crowbar or jaws of life. // Target Type: Closet -/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakRestraints() +/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckBreakRestraints() if(!iscarbon(owner)) // || !owner.restrained() return FALSE // (NOTE: Just like biodegrade.dm, we only remove one thing per use // @@ -131,7 +131,7 @@ return TRUE return FALSE -/datum/action/bloodsucker/targeted/brawn/proc/CheckEscapePuller() +/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckEscapePuller() if(!owner.pulledby)// || owner.pulledby.grab_state <= GRAB_PASSIVE) return FALSE var/mob/M = owner.pulledby @@ -153,7 +153,7 @@ owner.pulledby = null // It's already done, but JUST IN CASE. return TRUE /* Doesnt work -/datum/action/bloodsucker/targeted/brawn/proc/CheckBreakLocker() +/datum/action/cooldown/bloodsucker/targeted/brawn/proc/CheckBreakLocker() if(!istype(owner.loc, /obj/structure/closet)) return FALSE playsound(get_turf(owner), 'sound/machines/airlock_alien_prying.ogg', 40, 1, -1) diff --git a/code/modules/antagonists/bloodsucker/powers/cloak.dm b/code/modules/antagonists/bloodsucker/powers/cloak.dm index 5383e8c1ac..cb3a1e9fcf 100644 --- a/code/modules/antagonists/bloodsucker/powers/cloak.dm +++ b/code/modules/antagonists/bloodsucker/powers/cloak.dm @@ -1,11 +1,11 @@ -/datum/action/bloodsucker/cloak +/datum/action/cooldown/bloodsucker/cloak name = "Cloak of Darkness" desc = "Blend into the shadows and become invisible to the untrained eye. Movement is slowed in brightly lit areas, and you cannot dissapear while mortals watch you." button_icon_state = "power_cloak" bloodcost = 5 - cooldown = 50 + cooldown_time = 50 bloodsucker_can_buy = TRUE amToggle = TRUE warn_constant_cost = TRUE @@ -14,7 +14,7 @@ var/walk_threshold = 0.4 // arbitrary number, to be changed. edit in last commit: this is fine after testing on box station for a bit var/lum -/datum/action/bloodsucker/cloak/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/cloak/CheckCanUse(display_error) . = ..() if(!.) return @@ -24,7 +24,7 @@ return FALSE return TRUE -/datum/action/bloodsucker/cloak/ActivatePower() +/datum/action/cooldown/bloodsucker/cloak/ActivatePower() var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) var/mob/living/user = owner @@ -52,7 +52,7 @@ sleep(5) // Check every few ticks -/datum/action/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target) +/datum/action/cooldown/bloodsucker/cloak/ContinueActive(mob/living/user, mob/living/target) if (!..()) return FALSE if(user.stat == !CONSCIOUS) // Must be CONSCIOUS @@ -60,7 +60,7 @@ return FALSE return TRUE -/datum/action/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/cloak/DeactivatePower(mob/living/user = owner, mob/living/target) ..() REMOVE_TRAIT(user, TRAIT_NORUNNING, "cloak of darkness") user.alpha = 255 diff --git a/code/modules/antagonists/bloodsucker/powers/feed.dm b/code/modules/antagonists/bloodsucker/powers/feed.dm index a4bdcfee54..b6b3c6be3e 100644 --- a/code/modules/antagonists/bloodsucker/powers/feed.dm +++ b/code/modules/antagonists/bloodsucker/powers/feed.dm @@ -1,12 +1,12 @@ -/datum/action/bloodsucker/feed +/datum/action/cooldown/bloodsucker/feed name = "Feed" desc = "Draw the heartsblood of living victims in your grasp.
None/Passive: Feed silently and unnoticed by your victim.
Aggressive: Subdue your target quickly." button_icon_state = "power_feed" bloodcost = 0 - cooldown = 30 + cooldown_time = 30 amToggle = TRUE bloodsucker_can_buy = TRUE can_be_staked = TRUE @@ -16,7 +16,7 @@ var/mob/living/feed_target // So we can validate more than just the guy we're grappling. var/target_grappled = FALSE // If you started grappled, then ending it will end your Feed. -/datum/action/bloodsucker/feed/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/feed/CheckCanUse(display_error) . = ..() if(!.) return @@ -33,7 +33,7 @@ // DONE! return TRUE -/datum/action/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim. +/datum/action/cooldown/bloodsucker/feed/proc/ValidateTarget(mob/living/target, display_error) // Called twice: validating a subtle victim, or validating your grapple victim. // Bloodsuckers + Animals MUST be grabbed aggressively! if(!owner.pulling || target == owner.pulling && owner.grab_state < GRAB_AGGRESSIVE) // NOTE: It's OKAY that we are checking if(!target) below, AFTER animals here. We want passive check vs animal to warn you first, THEN the standard warning. @@ -76,7 +76,7 @@ return TRUE // If I'm not grabbing someone, find me someone nearby. -/datum/action/bloodsucker/feed/proc/FindMyTarget(display_error) +/datum/action/cooldown/bloodsucker/feed/proc/FindMyTarget(display_error) // Default feed_target = null target_grappled = FALSE @@ -132,7 +132,7 @@ feed_target = pick(targets_valid)//targets[1] return TRUE -/datum/action/bloodsucker/feed/ActivatePower() +/datum/action/cooldown/bloodsucker/feed/ActivatePower() // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up Activate(), so Deactivate() can happen after. var/mob/living/target = feed_target // Stored during CheckCanUse(). Can be a grabbed OR adjecent character. var/mob/living/user = owner @@ -302,16 +302,16 @@ CheckKilledTarget(user,target) -/datum/action/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target) +/datum/action/cooldown/bloodsucker/feed/proc/CheckKilledTarget(mob/living/user, mob/living/target) // Bad Bloodsucker. You shouldn't do that. if(target && target.stat >= DEAD && ishuman(target)) SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankkilled", /datum/mood_event/drankkilled) // BAD // in bloodsucker_life.dm -/datum/action/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target) +/datum/action/cooldown/bloodsucker/feed/ContinueActive(mob/living/user, mob/living/target) return ..() && target && (!target_grappled || user.pulling == target) && blood_sucking_checks(target, TRUE, TRUE) // Active, and still antag, // NOTE: We only care about pulling if target started off that way. Mostly only important for Aggressive feed. -/datum/action/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target) +/datum/action/cooldown/bloodsucker/feed/proc/ApplyVictimEffects(mob/living/target) // Bloodsuckers not affected by "the Kiss" of another vampire if(!target.mind || !target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) target.Unconscious(50,0) @@ -320,7 +320,7 @@ if(ishuman(target)) target.adjustStaminaLoss(5, forced = TRUE)// Base Stamina Damage -/datum/action/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/feed/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) // No longer Feeding diff --git a/code/modules/antagonists/bloodsucker/powers/fortitude.dm b/code/modules/antagonists/bloodsucker/powers/fortitude.dm index 740ec81782..c343270910 100644 --- a/code/modules/antagonists/bloodsucker/powers/fortitude.dm +++ b/code/modules/antagonists/bloodsucker/powers/fortitude.dm @@ -2,12 +2,12 @@ -/datum/action/bloodsucker/fortitude +/datum/action/cooldown/bloodsucker/fortitude name = "Fortitude" desc = "Withstand egregious physical wounds and walk away from attacks that would stun, pierce, and dismember lesser beings. You cannot run while active." button_icon_state = "power_fortitude" bloodcost = 30 - cooldown = 80 + cooldown_time = 80 bloodsucker_can_buy = TRUE amToggle = TRUE warn_constant_cost = TRUE @@ -15,7 +15,7 @@ var/fortitude_resist // So we can raise and lower your brute resist based on what your level_current WAS. -/datum/action/bloodsucker/fortitude/ActivatePower() +/datum/action/cooldown/bloodsucker/fortitude/ActivatePower() var/datum/antagonist/bloodsucker/B = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) var/mob/living/user = owner to_chat(user, "Your flesh, skin, and muscles become as steel.") @@ -47,8 +47,8 @@ B.AddBloodVolume(-0.5) sleep(20) // Check every few ticks that we haven't disabled this power // Return to Running (if you were before) - -/datum/action/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target) + +/datum/action/cooldown/bloodsucker/fortitude/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // Restore Traits & Effects REMOVE_TRAIT(user, TRAIT_PIERCEIMMUNE, "fortitude") diff --git a/code/modules/antagonists/bloodsucker/powers/go_home.dm b/code/modules/antagonists/bloodsucker/powers/go_home.dm index a8060ad07e..e78b9089fb 100644 --- a/code/modules/antagonists/bloodsucker/powers/go_home.dm +++ b/code/modules/antagonists/bloodsucker/powers/go_home.dm @@ -1,6 +1,6 @@ -/datum/action/bloodsucker/gohome +/datum/action/cooldown/bloodsucker/gohome name = "Vanishing Act" desc = "As dawn aproaches, disperse into mist and return directly to your Lair.
WARNING: You will drop ALL of your possessions if observed by mortals." button_icon_state = "power_gohome" @@ -8,7 +8,7 @@ background_icon_state_off = "vamp_power_off_oneshot" bloodcost = 100 - cooldown = 99999 // It'll never come back. + cooldown_time = 99999 // It'll never come back. amToggle = FALSE amSingleUse = TRUE @@ -18,7 +18,7 @@ can_be_immobilized = TRUE must_be_concious = FALSE -/datum/action/bloodsucker/gohome/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/gohome/CheckCanUse(display_error) . = ..() if(!.) return @@ -30,12 +30,12 @@ return FALSE return TRUE -/datum/action/bloodsucker/gohome/proc/flicker_lights(var/flicker_range, var/beat_volume) +/datum/action/cooldown/bloodsucker/gohome/proc/flicker_lights(var/flicker_range, var/beat_volume) for(var/obj/machinery/light/L in view(flicker_range, get_turf(owner))) playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', beat_volume, 1) -/datum/action/bloodsucker/gohome/ActivatePower() +/datum/action/cooldown/bloodsucker/gohome/ActivatePower() var/mob/living/carbon/user = owner var/datum/antagonist/bloodsucker/bloodsuckerdatum = owner.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) // IMPORTANT: Check for lair at every step! It might get destroyed. diff --git a/code/modules/antagonists/bloodsucker/powers/haste.dm b/code/modules/antagonists/bloodsucker/powers/haste.dm index 05e2cd0330..6f7ff54749 100644 --- a/code/modules/antagonists/bloodsucker/powers/haste.dm +++ b/code/modules/antagonists/bloodsucker/powers/haste.dm @@ -3,12 +3,12 @@ // Level 2: Dodge Bullets // Level 3: Stun People Passed -/datum/action/bloodsucker/targeted/haste +/datum/action/cooldown/bloodsucker/targeted/haste name = "Immortal Haste" desc = "Dash somewhere with supernatural speed. Those nearby may be knocked away, stunned, or left empty-handed." button_icon_state = "power_speed" bloodcost = 6 - cooldown = 120 + cooldown_time = 120 target_range = 15 power_activates_immediately = TRUE message_Trigger = ""//"Whom will you subvert to your will?" @@ -18,7 +18,7 @@ /// If set, uses this speed in deciseconds instead of world.tick_lag var/speed_override -/datum/action/bloodsucker/targeted/haste/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/targeted/haste/CheckCanUse(display_error) . = ..() if(!.) return @@ -33,10 +33,10 @@ return FALSE return TRUE -/datum/action/bloodsucker/targeted/haste/CheckValidTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/haste/CheckValidTarget(atom/A) return isturf(A) || A.loc != owner.loc // Anything will do, if it's not me or my square -/datum/action/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error) +/datum/action/cooldown/bloodsucker/targeted/haste/CheckCanTarget(atom/A, display_error) // DEFAULT CHECKS (Distance) if (!..()) return FALSE @@ -45,7 +45,7 @@ // return FALSE return TRUE -/datum/action/bloodsucker/targeted/haste/FireTargetedPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/haste/FireTargetedPower(atom/A) // This is a non-async proc to make sure the power is "locked" until this finishes. hit = list() RegisterSignal(owner, COMSIG_MOVABLE_MOVED, .proc/on_move) @@ -78,11 +78,11 @@ hit = null user.update_mobility() -/datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE user.update_mobility() -/datum/action/bloodsucker/targeted/haste/proc/on_move() +/datum/action/cooldown/bloodsucker/targeted/haste/proc/on_move() for(var/mob/living/L in dview(1, get_turf(owner))) if(!hit[L] && (L != owner)) hit[L] = TRUE diff --git a/code/modules/antagonists/bloodsucker/powers/lunge.dm b/code/modules/antagonists/bloodsucker/powers/lunge.dm index db7868fa8a..5cd1a52e39 100644 --- a/code/modules/antagonists/bloodsucker/powers/lunge.dm +++ b/code/modules/antagonists/bloodsucker/powers/lunge.dm @@ -1,25 +1,25 @@ -/datum/action/bloodsucker/lunge +/datum/action/cooldown/bloodsucker/lunge name = "Predatory Lunge" desc = "Prepare the strenght to grapple your prey." button_icon_state = "power_lunge" bloodcost = 10 - cooldown = 30 + cooldown_time = 30 bloodsucker_can_buy = TRUE warn_constant_cost = TRUE amToggle = TRUE var/leap_skill_mod = 5 -/datum/action/bloodsucker/lunge/New() +/datum/action/cooldown/bloodsucker/lunge/New() . = ..() - -/datum/action/bloodsucker/lunge/Destroy() + +/datum/action/cooldown/bloodsucker/lunge/Destroy() . = ..() UnregisterSignal(owner, COMSIG_CARBON_TACKLED) -/datum/action/bloodsucker/lunge/ActivatePower() +/datum/action/cooldown/bloodsucker/lunge/ActivatePower() var/mob/living/carbon/user = owner var/datum/antagonist/bloodsucker/B = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) var/datum/component/tackler/T = user.LoadComponent(/datum/component/tackler) @@ -37,10 +37,10 @@ sleep(5) //Without this, the leap component would get removed too early, causing the normal crash into effects. -/datum/action/bloodsucker/lunge/proc/DelayedDeactivatePower() +/datum/action/cooldown/bloodsucker/lunge/proc/DelayedDeactivatePower() addtimer(CALLBACK(src, .proc/DeactivatePower), 1 SECONDS, TIMER_UNIQUE) -/datum/action/bloodsucker/lunge/DeactivatePower(mob/living/user = owner) +/datum/action/cooldown/bloodsucker/lunge/DeactivatePower(mob/living/user = owner) . = ..() qdel(user.GetComponent(/datum/component/tackler)) UnregisterSignal(user, COMSIG_CARBON_TACKLED) diff --git a/code/modules/antagonists/bloodsucker/powers/masquerade.dm b/code/modules/antagonists/bloodsucker/powers/masquerade.dm index f4ce531ef0..78748a3c80 100644 --- a/code/modules/antagonists/bloodsucker/powers/masquerade.dm +++ b/code/modules/antagonists/bloodsucker/powers/masquerade.dm @@ -16,12 +16,12 @@ // - -/datum/action/bloodsucker/masquerade +/datum/action/cooldown/bloodsucker/masquerade name = "Masquerade" desc = "Feign the vital signs of a mortal, and escape both casual and medical notice as the monster you truly are." button_icon_state = "power_human" bloodcost = 10 - cooldown = 50 + cooldown_time = 50 amToggle = TRUE bloodsucker_can_buy = TRUE warn_constant_cost = TRUE @@ -31,7 +31,7 @@ // NOTE: Firing off vulgar powers disables your Masquerade! -/*/datum/action/bloodsucker/masquerade/CheckCanUse(display_error) +/*/datum/action/cooldown/bloodsucker/masquerade/CheckCanUse(display_error) if(!..(display_error))// DEFAULT CHECKS return FALSE // DONE! @@ -39,7 +39,7 @@ */ -/datum/action/bloodsucker/masquerade/ActivatePower() +/datum/action/cooldown/bloodsucker/masquerade/ActivatePower() var/mob/living/user = owner var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) @@ -78,14 +78,14 @@ sleep(20) // Check every few ticks that we haven't disabled this power -/datum/action/bloodsucker/masquerade/ContinueActive(mob/living/user) +/datum/action/cooldown/bloodsucker/masquerade/ContinueActive(mob/living/user) // Disable if unable to use power anymore. //if (user.stat == DEAD || user.blood_volume <= 0) // not conscious or soft critor uncon, just dead // return FALSE return ..() // Active, and still Antag -/datum/action/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/masquerade/DeactivatePower(mob/living/user = owner, mob/living/target) ..() // activate = FALSE var/datum/antagonist/bloodsucker/bloodsuckerdatum = user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER) diff --git a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm index 25f50d7af4..ba6c4634f5 100644 --- a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm +++ b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm @@ -5,12 +5,12 @@ // FOLLOW: Target follows you, spouting random phrases from their history (or maybe Polly's or NPC's vocab?) // ATTACK: Target finds a nearby non-Bloodsucker victim to attack. -/datum/action/bloodsucker/targeted/mesmerize +/datum/action/cooldown/bloodsucker/targeted/mesmerize name = "Mesmerize" desc = "Dominate the mind of a mortal who can see your eyes." button_icon_state = "power_mez" bloodcost = 30 - cooldown = 300 + cooldown_time = 300 target_range = 2 power_activates_immediately = TRUE message_Trigger = "Whom will you subvert to your will?" @@ -18,7 +18,7 @@ bloodsucker_can_buy = TRUE var/success -/datum/action/bloodsucker/targeted/mesmerize/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckCanUse(display_error) . = ..() if(!.) return @@ -34,10 +34,10 @@ return FALSE return TRUE -/datum/action/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckValidTarget(atom/A) return iscarbon(A) -/datum/action/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/CheckCanTarget(atom/A,display_error) // Check: Self if(A == owner) return FALSE @@ -88,7 +88,7 @@ return FALSE return TRUE -/datum/action/bloodsucker/targeted/mesmerize/proc/ContinueTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/proc/ContinueTarget(atom/A) var/mob/living/carbon/target = A var/mob/living/L = owner @@ -103,7 +103,7 @@ to_chat(L, "[target] has escaped your gaze!") UnregisterSignal(target, COMSIG_MOVABLE_MOVED) -/datum/action/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/FireTargetedPower(atom/A) // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. var/mob/living/carbon/target = A var/mob/living/L = owner @@ -118,7 +118,7 @@ // 5 second windup addtimer(CALLBACK(src, .proc/apply_effects, L, target, power_time), 6 SECONDS) -/datum/action/bloodsucker/targeted/mesmerize/proc/apply_effects(aggressor, victim, power_time) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/proc/apply_effects(aggressor, victim, power_time) var/mob/living/carbon/target = victim var/mob/living/L = aggressor if(!success) @@ -135,5 +135,5 @@ to_chat(L, "[target] has snapped out of their trance.") -/datum/action/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target) +/datum/action/cooldown/bloodsucker/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target) return ..() && CheckCanUse() && CheckCanTarget(target) diff --git a/code/modules/antagonists/bloodsucker/powers/recuperate.dm b/code/modules/antagonists/bloodsucker/powers/recuperate.dm index 90a2e3ff38..6f6b204299 100644 --- a/code/modules/antagonists/bloodsucker/powers/recuperate.dm +++ b/code/modules/antagonists/bloodsucker/powers/recuperate.dm @@ -1,12 +1,12 @@ -/datum/action/bloodsucker/vassal/recuperate +/datum/action/cooldown/bloodsucker/vassal/recuperate name = "Sanguine Recuperation" desc = "Slowly heal brute damage while active. This process is exhausting, and requires some of your tainted blood." button_icon_state = "power_recup" amToggle = TRUE bloodcost = 5 - cooldown = 100 + cooldown_time = 100 -/datum/action/bloodsucker/vassal/recuperate/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/vassal/recuperate/CheckCanUse(display_error) . = ..() if(!.) return @@ -14,7 +14,7 @@ return FALSE return TRUE -/datum/action/bloodsucker/vassal/recuperate/ActivatePower() +/datum/action/cooldown/bloodsucker/vassal/recuperate/ActivatePower() to_chat(owner, "Your muscles clench and your skin crawls as your master's immortal blood knits your wounds and gives you stamina.") var/mob/living/carbon/C = owner var/mob/living/carbon/human/H @@ -35,5 +35,5 @@ // DONE! //DeactivatePower(owner) -/datum/action/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target) +/datum/action/cooldown/bloodsucker/vassal/recuperate/ContinueActive(mob/living/user, mob/living/target) return ..() && user.stat <= DEAD && user.blood_volume > 500 diff --git a/code/modules/antagonists/bloodsucker/powers/trespass.dm b/code/modules/antagonists/bloodsucker/powers/trespass.dm index 56b72a562e..9a64fe8cb3 100644 --- a/code/modules/antagonists/bloodsucker/powers/trespass.dm +++ b/code/modules/antagonists/bloodsucker/powers/trespass.dm @@ -1,12 +1,12 @@ -/datum/action/bloodsucker/targeted/trespass +/datum/action/cooldown/bloodsucker/targeted/trespass name = "Trespass" desc = "Become mist and advance two tiles in one direction, ignoring all obstacles except for walls. Useful for skipping past doors and barricades." button_icon_state = "power_tres" bloodcost = 10 - cooldown = 80 + cooldown_time = 80 amToggle = FALSE //target_range = 2 @@ -16,7 +16,7 @@ var/turf/target_turf // We need to decide where we're going based on where we clicked. It's not actually the tile we clicked. -/datum/action/bloodsucker/targeted/trespass/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/targeted/trespass/CheckCanUse(display_error) . = ..() if(!.) return @@ -26,7 +26,7 @@ return TRUE -/datum/action/bloodsucker/targeted/trespass/CheckValidTarget(atom/A) +/datum/action/cooldown/bloodsucker/targeted/trespass/CheckValidTarget(atom/A) // Can't target my tile if(A == get_turf(owner) || get_turf(A) == get_turf(owner)) return FALSE @@ -34,7 +34,7 @@ return TRUE // All we care about is destination. Anything you click is fine. -/datum/action/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error) +/datum/action/cooldown/bloodsucker/targeted/trespass/CheckCanTarget(atom/A, display_error) // NOTE: Do NOT use ..()! We don't want to check distance or anything. // Get clicked tile @@ -60,7 +60,7 @@ return TRUE -/datum/action/bloodsucker/targeted/trespass/FireTargetedPower(atom/A) +/datum/action/cooldown/bloodsucker/targeted/trespass/FireTargetedPower(atom/A) // set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done. // Find target turf, at or below Atom @@ -87,7 +87,7 @@ user.invisibility = INVISIBILITY_MAXIMUM // LOSE CUFFS - + // Wait... sleep(mist_delay / 2) diff --git a/code/modules/antagonists/bloodsucker/powers/veil.dm b/code/modules/antagonists/bloodsucker/powers/veil.dm index b170b9d442..9b04a6f774 100644 --- a/code/modules/antagonists/bloodsucker/powers/veil.dm +++ b/code/modules/antagonists/bloodsucker/powers/veil.dm @@ -1,10 +1,10 @@ -/datum/action/bloodsucker/veil +/datum/action/cooldown/bloodsucker/veil name = "Veil of Many Faces" desc = "Disguise yourself in the illusion of another identity." button_icon_state = "power_veil" bloodcost = 15 - cooldown = 100 + cooldown_time = 100 amToggle = TRUE bloodsucker_can_buy = TRUE warn_constant_cost = TRUE @@ -29,7 +29,7 @@ var/list/prev_features // For lizards and such -/datum/action/bloodsucker/veil/CheckCanUse(display_error) +/datum/action/cooldown/bloodsucker/veil/CheckCanUse(display_error) . = ..() if(!.) return @@ -37,7 +37,7 @@ return TRUE -/datum/action/bloodsucker/veil/ActivatePower() +/datum/action/cooldown/bloodsucker/veil/ActivatePower() cast_effect() // POOF @@ -47,14 +47,14 @@ Disguise_FaceName() -/datum/action/bloodsucker/veil/proc/Disguise_Outfit() +/datum/action/cooldown/bloodsucker/veil/proc/Disguise_Outfit() // Step One: Back up original items -/datum/action/bloodsucker/veil/proc/Disguise_FaceName() +/datum/action/cooldown/bloodsucker/veil/proc/Disguise_FaceName() // Change Name/Voice var/mob/living/carbon/human/H = owner @@ -112,7 +112,7 @@ sleep(50) -/datum/action/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target) +/datum/action/cooldown/bloodsucker/veil/DeactivatePower(mob/living/user = owner, mob/living/target) ..() if (ishuman(user)) var/mob/living/carbon/human/H = user @@ -149,7 +149,7 @@ cast_effect() // POOF // CAST EFFECT // // General effect (poof, splat, etc) when you cast. Doesn't happen automatically! -/datum/action/bloodsucker/veil/proc/cast_effect() +/datum/action/cooldown/bloodsucker/veil/proc/cast_effect() // Effect playsound(get_turf(owner), 'sound/magic/smoke.ogg', 20, 1) var/datum/effect_system/steam_spread/puff = new /datum/effect_system/steam_spread/() diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm index d825fa048e..3e48fca317 100644 --- a/code/modules/antagonists/changeling/cellular_emporium.dm +++ b/code/modules/antagonists/changeling/cellular_emporium.dm @@ -80,7 +80,6 @@ /datum/action/innate/cellular_emporium/New(our_target) . = ..() - button.name = name if(istype(our_target, /datum/cellular_emporium)) cellular_emporium = our_target else diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index b92722eb8f..f73f45e433 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -229,10 +229,10 @@ playsound(get_turf(owner.current), 'sound/effects/lingreadapt.ogg', 75, TRUE, 5) can_respec = 0 SSblackbox.record_feedback("tally", "changeling_power_purchase", 1, "Readapt") - return 1 + return TRUE else to_chat(owner.current, "You lack the power to readapt your evolutions!") - return 0 + return FALSE //Called in life() /datum/antagonist/changeling/proc/regenerate()//grants the HuD in life.dm @@ -285,7 +285,7 @@ if(verbose) to_chat(user, "[target] is not compatible with our biology.") return - return 1 + return TRUE /datum/antagonist/changeling/proc/create_profile(mob/living/carbon/human/H, protect = 0) diff --git a/code/modules/antagonists/changeling/changeling_power.dm b/code/modules/antagonists/changeling/changeling_power.dm index c784939c0f..8f48128562 100644 --- a/code/modules/antagonists/changeling/changeling_power.dm +++ b/code/modules/antagonists/changeling/changeling_power.dm @@ -47,10 +47,10 @@ the same goes for Remove(). if you override Remove(), call parent or else your p /datum/action/changeling/proc/sting_action(mob/user, mob/target) SSblackbox.record_feedback("nested tally", "changeling_powers", 1, list("[name]")) - return 0 + return FALSE /datum/action/changeling/proc/sting_feedback(mob/user, mob/target) - return 0 + return FALSE //Fairly important to remember to return TRUE on success >.< diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm index 7ce9da633e..714150fc93 100644 --- a/code/modules/antagonists/changeling/powers/fakedeath.dm +++ b/code/modules/antagonists/changeling/powers/fakedeath.dm @@ -44,7 +44,7 @@ name = "Reviving Stasis" desc = "We fall into a stasis, allowing us to regenerate and trick our enemies. Costs 15 chemicals." button_icon_state = "fake_death" - UpdateButtonIcon() + UpdateButtons() chemical_cost = 15 to_chat(user, "We have revived ourselves.") @@ -56,7 +56,7 @@ name = "Revive" desc = "We arise once more." button_icon_state = "revive" - UpdateButtonIcon() + UpdateButtons() chemical_cost = 0 revive_ready = TRUE diff --git a/code/modules/antagonists/changeling/powers/hivemind.dm b/code/modules/antagonists/changeling/powers/hivemind.dm index 95ad09c318..f4ac9adca7 100644 --- a/code/modules/antagonists/changeling/powers/hivemind.dm +++ b/code/modules/antagonists/changeling/powers/hivemind.dm @@ -94,7 +94,7 @@ GLOBAL_LIST_EMPTY(hivemind_bank) if(first_prof.name == user.real_name)//If our current DNA is the stalest, we gotta ditch it. to_chat(user, "We have reached our capacity to store genetic information! We must transform before absorbing more.") return - return 1 + return TRUE /datum/action/changeling/hivemind_download/sting_action(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) diff --git a/code/modules/antagonists/changeling/powers/humanform.dm b/code/modules/antagonists/changeling/powers/humanform.dm index 016ab5c6dd..c141e0db2e 100644 --- a/code/modules/antagonists/changeling/powers/humanform.dm +++ b/code/modules/antagonists/changeling/powers/humanform.dm @@ -13,7 +13,7 @@ if(!chosen_prof) return if(!user || user.mob_transforming) - return 0 + return FALSE to_chat(user, "We transform our appearance.") changeling.purchasedpowers -= src diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 9fe612ac07..0066af0cc8 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -40,7 +40,7 @@ var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) changeling.chem_recharge_slowdown -= recharge_slowdown user.update_inv_hands() - return 1 + return TRUE /datum/action/changeling/weapon/sting_action(mob/living/user) var/obj/item/held = user.get_active_held_item() @@ -597,7 +597,7 @@ /datum/action/changeling/gloves/proc/check_gloves(mob/user) var/datum/antagonist/changeling/changeling = user.mind.has_antag_datum(/datum/antagonist/changeling) if(!ishuman(user) || !changeling) - return 1 + return TRUE var/mob/living/carbon/human/H = user if(istype(H.gloves, glove_type)) H.visible_message("With a sickening crunch, [H] reforms [H.p_their()] [glove_name_simple] into hands!", "We assimilate our [glove_name_simple].", "You hear organic matter ripping and tearing!") @@ -609,7 +609,7 @@ playsound(H.loc, 'sound/effects/splat.ogg', 50, 1) //So real sounds changeling.chem_recharge_slowdown -= recharge_slowdown - return 1 + return TRUE /datum/action/changeling/gloves/Remove(mob/user) if(!ishuman(user)) diff --git a/code/modules/antagonists/changeling/powers/tiny_prick.dm b/code/modules/antagonists/changeling/powers/tiny_prick.dm index 351d8622c9..8969d90455 100644 --- a/code/modules/antagonists/changeling/powers/tiny_prick.dm +++ b/code/modules/antagonists/changeling/powers/tiny_prick.dm @@ -53,7 +53,7 @@ if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) sting_feedback(user, target) changeling.chem_charges -= chemical_cost - return 1 + return TRUE /datum/action/changeling/sting/sting_feedback(mob/user, mob/target) if(!target) @@ -61,7 +61,7 @@ to_chat(user, "We stealthily sting [target.name].") if(target.mind && target.mind.has_antag_datum(/datum/antagonist/changeling)) to_chat(target, "You feel a tiny prick.") - return 1 + return TRUE /datum/action/changeling/sting/transformation @@ -94,8 +94,8 @@ return if((HAS_TRAIT(target, TRAIT_HUSK)) || !iscarbon(target) || (NOTRANSSTING in target.dna.species.species_traits)) to_chat(user, "Our sting appears ineffective against its DNA.") - return 0 - return 1 + return FALSE + return TRUE /datum/action/changeling/sting/transformation/sting_action(mob/user, mob/target) if(ismonkey(target)) @@ -133,8 +133,8 @@ var/mob/living/L = target if((HAS_TRAIT(L, TRAIT_HUSK)) || !L.has_dna()) to_chat(user, "Our sting appears ineffective against its DNA.") - return 0 - return 1 + return FALSE + return TRUE /datum/action/changeling/sting/false_armblade/sting_action(mob/user, mob/target) log_combat(user, target, "stung", object="false armblade sting") diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm index 18211d0447..f55d0a5c75 100644 --- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm +++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm @@ -21,7 +21,7 @@ return ..() user.visible_message("[user] scatters [src] with [I]!", "You scatter [src] with [I]!") qdel(src) - return 1 + return TRUE return ..() /obj/effect/clockwork/sigil/attack_tk(mob/user) diff --git a/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm b/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm index 8d0dff0ea8..085eacca35 100644 --- a/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm +++ b/code/modules/antagonists/clockcult/clock_helpers/clock_powerdrain.dm @@ -16,22 +16,22 @@ drain_amount: How much is drained by default; Influenced by a multiplier on most var/obj/item/stock_parts/cell/cell = get_cell() if(cell) return cell.power_drain(clockcult_user, drain_weapons, recursive, drain_amount) - return 0 //Returns 0 instead of FALSE to symbolise it returning the power amount in other cases, not TRUE aka 1 + return FALSE //Returns 0 instead of FALSE to symbolise it returning the power amount in other cases, not TRUE aka 1 /obj/item/melee/baton/power_drain(clockcult_user, drain_weapons = FALSE, recursive = FALSE, drain_amount = MIN_CLOCKCULT_POWER) //balance memes if(!drain_weapons) - return 0 + return FALSE var/obj/item/stock_parts/cell/cell = get_cell() if(cell) return cell.power_drain(clockcult_user, drain_weapons, recursive, drain_amount) - return 0 //No need to recurse further in batons + return FALSE //No need to recurse further in batons /obj/item/gun/power_drain(clockcult_user, drain_weapons = FALSE, recursive = FALSE, drain_amount = MIN_CLOCKCULT_POWER) //balance memes if(!drain_weapons) - return 0 + return FALSE var/obj/item/stock_parts/cell/cell = get_cell() if(!cell) - return 0 + return FALSE if(cell.charge) . = min(cell.charge, drain_amount*4) //Done snowflakey because guns have far smaller cells than batons / other equipment, also no need to recurse further in guns cell.use(.) diff --git a/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_shield.dm b/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_shield.dm index 47105938e6..bc26aad155 100644 --- a/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_shield.dm +++ b/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_shield.dm @@ -25,7 +25,7 @@ /obj/item/shield/riot/ratvarian/proc/calc_bash_mult() var/bash_mult = 0 if(!dam_absorbed) - return 1 + return TRUE else bash_mult += round(clamp(1 + (dam_absorbed / bash_mult_steps), 1, max_bash_mult), 0.1) //Multiplies the effect of bashes by up to [max_bash_mult], though never less than one return bash_mult diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm index 06fea9bd91..751e6f16ca 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_armor.dm @@ -55,7 +55,7 @@ /obj/item/clothing/head/helmet/clockwork/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self) if(equipper && !is_servant_of_ratvar(equipper)) - return 0 + return FALSE return ..() /obj/item/clothing/suit/armor/clockwork @@ -100,7 +100,7 @@ /obj/item/clothing/suit/armor/clockwork/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self) if(equipper && !is_servant_of_ratvar(equipper)) - return 0 + return FALSE return ..() /obj/item/clothing/suit/armor/clockwork/equipped(mob/living/user, slot) @@ -160,7 +160,7 @@ /obj/item/clothing/gloves/clockwork/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self) if(equipper && !is_servant_of_ratvar(equipper)) - return 0 + return FALSE return ..() /obj/item/clothing/gloves/clockwork/equipped(mob/living/user, slot) @@ -210,7 +210,7 @@ /obj/item/clothing/shoes/clockwork/mob_can_equip(M, equipper, slot, disable_warning, bypass_equip_delay_self) if(equipper && !is_servant_of_ratvar(equipper)) - return 0 + return FALSE return ..() /obj/item/clothing/shoes/clockwork/equipped(mob/living/user, slot) diff --git a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm index 3298196de7..c4528b6ebc 100644 --- a/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm +++ b/code/modules/antagonists/clockcult/clock_items/clockwork_slab.dm @@ -411,6 +411,6 @@ Q.name = "[quickbind_slot.name] ([Q.scripture_index])" Q.desc = quickbind_slot.quickbind_desc Q.button_icon_state = quickbind_slot.name - Q.UpdateButtonIcon() + Q.UpdateButtons() if(isliving(loc)) Q.Grant(loc) diff --git a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm index dc53217486..fb99c67e0e 100644 --- a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm +++ b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm @@ -29,7 +29,7 @@ /obj/item/clothing/glasses/judicial_visor/item_action_slot_check(slot, mob/user, datum/action/A) if(slot != ITEM_SLOT_EYES) - return 0 + return FALSE return ..() /obj/item/clothing/glasses/judicial_visor/equipped(mob/living/user, slot) @@ -38,7 +38,7 @@ update_status(FALSE) if(blaster.ranged_ability_user) blaster.remove_ranged_ability() - return 0 + return FALSE if(is_servant_of_ratvar(user)) update_status(TRUE) else @@ -48,7 +48,7 @@ to_chat(user, "You suddenly catch fire!") user.adjust_fire_stacks(5) user.IgniteMob() - return 1 + return TRUE /obj/item/clothing/glasses/judicial_visor/dropped(mob/user) . = ..() @@ -67,27 +67,27 @@ /obj/item/clothing/glasses/judicial_visor/proc/update_status(change_to) if(recharging || !isliving(loc)) icon_state = "judicial_visor_0" - return 0 + return FALSE if(active == change_to) - return 0 + return FALSE var/mob/living/L = loc active = change_to icon_state = "judicial_visor_[active]" L.update_action_buttons_icon() L.update_inv_glasses() if(!is_servant_of_ratvar(L) || L.stat) - return 0 + return FALSE switch(active) if(TRUE) to_chat(L, "As you put on [src], its lens begins to glow, information flashing before your eyes.\n\ Judicial visor active. Use the action button to gain the ability to smite the unworthy.") if(FALSE) to_chat(L, "As you take off [src], its lens darkens once more.") - return 1 + return TRUE /obj/item/clothing/glasses/judicial_visor/proc/recharge_visor(mob/living/user) if(!src) - return 0 + return FALSE recharging = FALSE if(user && src == user.get_item_by_slot(ITEM_SLOT_EYES)) to_chat(user, "Your [name] hums. It is ready.") diff --git a/code/modules/antagonists/clockcult/clock_items/replica_fabricator.dm b/code/modules/antagonists/clockcult/clock_items/replica_fabricator.dm index 7be9ef039b..6f2607941e 100644 --- a/code/modules/antagonists/clockcult/clock_items/replica_fabricator.dm +++ b/code/modules/antagonists/clockcult/clock_items/replica_fabricator.dm @@ -23,7 +23,7 @@ /obj/item/clockwork/replica_fabricator/scarab/fabricate(atom/target, mob/living/user) if(!debug && !isdrone(user)) - return 0 + return FALSE return ..() /obj/item/clockwork/replica_fabricator/scarab/debug diff --git a/code/modules/antagonists/clockcult/clock_mobs.dm b/code/modules/antagonists/clockcult/clock_mobs.dm index a2263401aa..9104146dc5 100644 --- a/code/modules/antagonists/clockcult/clock_mobs.dm +++ b/code/modules/antagonists/clockcult/clock_mobs.dm @@ -38,7 +38,7 @@ fully_heal(TRUE) /mob/living/simple_animal/hostile/clockwork/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) - return 0 //ouch, my metal-unlikely-to-be-damaged-by-electricity-body + return FALSE //ouch, my metal-unlikely-to-be-damaged-by-electricity-body /mob/living/simple_animal/hostile/clockwork/examine(mob/user) var/t_He = p_they(TRUE) diff --git a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm index b3365e6e70..3369e136c7 100644 --- a/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm +++ b/code/modules/antagonists/clockcult/clock_mobs/clockwork_guardian.dm @@ -121,7 +121,7 @@ stat(null, "You do [melee_damage_upper] damage on melee attacks.") /mob/living/simple_animal/hostile/clockwork/guardian/Process_Spacemove(movement_dir = 0) - return 1 + return TRUE /mob/living/simple_animal/hostile/clockwork/guardian/proc/bind_to_host(mob/living/new_host) if(!new_host) diff --git a/code/modules/antagonists/clockcult/clock_structure.dm b/code/modules/antagonists/clockcult/clock_structure.dm index 2884886e47..b24e8f88a7 100644 --- a/code/modules/antagonists/clockcult/clock_structure.dm +++ b/code/modules/antagonists/clockcult/clock_structure.dm @@ -93,7 +93,7 @@ if(is_servant_of_ratvar(user) && I.tool_behaviour == TOOL_WRENCH && unanchored_icon) if(default_unfasten_wrench(user, I, 50) == SUCCESSFUL_UNFASTEN) update_anchored(user) - return 1 + return TRUE return ..() /obj/structure/destructible/clockwork/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1) diff --git a/code/modules/antagonists/clockcult/clock_structures/mania_motor.dm b/code/modules/antagonists/clockcult/clock_structures/mania_motor.dm index 40cadb53a2..69bf306782 100644 --- a/code/modules/antagonists/clockcult/clock_structures/mania_motor.dm +++ b/code/modules/antagonists/clockcult/clock_structures/mania_motor.dm @@ -37,7 +37,7 @@ if(user.canUseTopic(src, !issilicon(user), NO_DEXTERY) && is_servant_of_ratvar(user)) if(!can_access_clockwork_power(src, mania_cost)) to_chat(user, "[src] needs more power to function!") - return 0 + return FALSE toggle(0, user) /obj/structure/destructible/clockwork/powered/mania_motor/toggle(fast_process, mob/living/user) diff --git a/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm b/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm index c81b05145e..a8b318d6b8 100644 --- a/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm +++ b/code/modules/antagonists/clockcult/clock_structures/ocular_warden.dm @@ -144,10 +144,10 @@ /obj/structure/destructible/clockwork/ocular_warden/proc/lose_target() if(!target) - return 0 + return FALSE target = null visible_message("[src] settles and seems almost disappointed.") - return 1 + return TRUE /obj/structure/destructible/clockwork/ocular_warden/get_efficiency_mod() if(GLOB.ratvar_awakens) diff --git a/code/modules/antagonists/clockcult/clock_structures/prolonging_prism.dm b/code/modules/antagonists/clockcult/clock_structures/prolonging_prism.dm index ededd0174c..774c76f3a1 100644 --- a/code/modules/antagonists/clockcult/clock_structures/prolonging_prism.dm +++ b/code/modules/antagonists/clockcult/clock_structures/prolonging_prism.dm @@ -43,19 +43,19 @@ to_chat(user, "You break [src] apart, refunding some of the power used.") adjust_clockwork_power(power_refund) take_damage(max_integrity) - return 0 + return FALSE if(active) - return 0 + return FALSE var/turf/T = get_turf(src) if(!T || !is_station_level(T.z)) to_chat(user, "[src] must be on the station to function!") - return 0 + return FALSE if(SSshuttle.emergency.mode != SHUTTLE_CALL) to_chat(user, "No emergency shuttles are attempting to arrive at the station!") - return 0 + return FALSE if(!try_use_power(get_delay_cost())) to_chat(user, "[src] needs more power to function!") - return 0 + return FALSE delay_cost += delay_cost_increase delay_remaining += PRISM_DELAY_DURATION toggle(0, user) diff --git a/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm b/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm index 20cf8711e0..7836e9012c 100644 --- a/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm +++ b/code/modules/antagonists/clockcult/clock_structures/wall_gear.dm @@ -25,7 +25,7 @@ /obj/structure/destructible/clockwork/wall_gear/attackby(obj/item/I, mob/user, params) if(I.tool_behaviour == TOOL_WRENCH) default_unfasten_wrench(user, I, 10) - return 1 + return TRUE else if(I.tool_behaviour == TOOL_SCREWDRIVER) if(anchored) to_chat(user, "[src] needs to be unsecured to disassemble it!") @@ -34,7 +34,7 @@ if(I.use_tool(src, user, 30, volume=100) && !anchored) to_chat(user, "You disassemble [src].") deconstruct(TRUE) - return 1 + return TRUE else if(istype(I, /obj/item/stack/tile/brass)) var/obj/item/stack/tile/brass/W = I if(W.get_amount() < 1) @@ -64,7 +64,7 @@ qdel(src) else to_chat(user, "You need more brass to make a [anchored ? "false ":""]wall!") - return 1 + return TRUE return ..() /obj/structure/destructible/clockwork/wall_gear/deconstruct(disassembled = TRUE) diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm index 0efde2d3db..93280c4222 100644 --- a/code/modules/antagonists/cult/blood_magic.dm +++ b/code/modules/antagonists/cult/blood_magic.dm @@ -2,16 +2,11 @@ name = "Prepare Blood Magic" button_icon_state = "carve" desc = "Prepare blood magic by carving runes into your flesh. This rite is most effective with an empowering rune" + default_button_position = DEFAULT_BLOODSPELLS var/list/spells = list() var/channeling = FALSE var/holy_dispel = FALSE -/datum/action/innate/cult/blood_magic/Grant() - ..() - button.screen_loc = DEFAULT_BLOODSPELLS - button.moved = DEFAULT_BLOODSPELLS - button.ordered = FALSE - /datum/action/innate/cult/blood_magic/Remove() for(var/X in spells) qdel(X) @@ -23,15 +18,21 @@ return ..() /datum/action/innate/cult/blood_magic/proc/Positioning() - var/list/screen_loc_split = splittext(button.screen_loc,",") - var/list/screen_loc_X = splittext(screen_loc_split[1],":") - var/list/screen_loc_Y = splittext(screen_loc_split[2],":") - var/pix_X = text2num(screen_loc_X[2]) - for(var/datum/action/innate/cult/blood_spell/B in spells) - if(B.button.locked) - var/order = pix_X+spells.Find(B)*31 - B.button.screen_loc = "[screen_loc_X[1]]:[order],[screen_loc_Y[1]]:[screen_loc_Y[2]]" - B.button.moved = B.button.screen_loc + for(var/datum/hud/hud as anything in viewers) + var/our_view = hud.mymob?.client?.view || "15x15" + var/atom/movable/screen/movable/action_button/button = viewers[hud] + var/position = screen_loc_to_offset(button.screen_loc) + var/spells_iterated = 0 + for(var/datum/action/innate/cult/blood_spell/blood_spell in spells) + spells_iterated += 1 + if(blood_spell.positioned) + continue + var/atom/movable/screen/movable/action_button/moving_button = blood_spell.viewers[hud] + if(!moving_button) + continue + var/our_x = position[1] + spells_iterated * world.icon_size // Offset any new buttons into our list + hud.position_action(moving_button, offset_to_screen_loc(our_x, position[2], our_view)) + blood_spell.positioned = TRUE /datum/action/innate/cult/blood_magic/Activate() if(holy_dispel) @@ -99,6 +100,8 @@ var/base_desc //To allow for updating tooltips var/invocation var/health_cost = 0 + /// Have we already been positioned into our starting location? + var/positioned = FALSE /datum/action/innate/cult/blood_spell/Grant(mob/living/owner, datum/action/innate/cult/blood_magic/BM) if(health_cost) @@ -106,9 +109,7 @@ base_desc = desc desc += "
Has [charges] use\s remaining." all_magic = BM - ..() - button.locked = TRUE - button.ordered = FALSE + return ..() /datum/action/innate/cult/blood_spell/Remove() if(all_magic) @@ -273,7 +274,7 @@ attached_action.charges-- attached_action.desc = attached_action.base_desc attached_action.desc += "
Has [attached_action.charges] use\s remaining." - attached_action.UpdateButtonIcon() + attached_action.UpdateButtons() if(attached_action.charges <= 0) remove_ranged_ability("You have exhausted the spell's power!") qdel(src) @@ -325,7 +326,7 @@ qdel(src) desc = base_desc desc += "
Has [charges] use\s remaining." - UpdateButtonIcon() + UpdateButtons() /datum/action/innate/cult/blood_spell/manipulation name = "Blood Rites" @@ -373,7 +374,7 @@ source.charges = uses source.desc = source.base_desc source.desc += "
Has [uses] use\s remaining." - source.UpdateButtonIcon() + source.UpdateButtons() ..() /obj/item/melee/blood_magic/attack_self(mob/living/user) @@ -400,7 +401,7 @@ else if(source) source.desc = source.base_desc source.desc += "
Has [uses] use\s remaining." - source.UpdateButtonIcon() + source.UpdateButtons() //Stun /obj/item/melee/blood_magic/stun diff --git a/code/modules/antagonists/cult/cult.dm b/code/modules/antagonists/cult/cult.dm index 2850cb85cc..1bda5048c5 100644 --- a/code/modules/antagonists/cult/cult.dm +++ b/code/modules/antagonists/cult/cult.dm @@ -108,7 +108,7 @@ var/where = mob.equip_in_one_of_slots(T, slots, critical = TRUE) if(!where) to_chat(mob, "Unfortunately, you weren't able to get a [item_name]. This is very bad and you should adminhelp immediately (press F1).") - return 0 + return FALSE else to_chat(mob, "You have a [item_name] in your [where].") if(where == "backpack") diff --git a/code/modules/antagonists/cult/cult_comms.dm b/code/modules/antagonists/cult/cult_comms.dm index bbdf41ff48..e49dd8fa73 100644 --- a/code/modules/antagonists/cult/cult_comms.dm +++ b/code/modules/antagonists/cult/cult_comms.dm @@ -142,7 +142,7 @@ /datum/action/innate/cult/master/IsAvailable(silent = FALSE) if(!owner.mind || !owner.mind.has_antag_datum(/datum/antagonist/cult/master) || GLOB.cult_narsie) - return 0 + return FALSE return ..() /datum/action/innate/cult/master/finalreck diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index a522285210..4d15654411 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -795,14 +795,13 @@ desc = "Call the blood spear back to your hand!" background_icon_state = "bg_demon" button_icon_state = "bloodspear" + default_button_position = "6:157,4:-2" var/obj/item/cult_spear/spear var/cooldown = 0 /datum/action/innate/cult/spear/Grant(mob/user, obj/blood_spear) . = ..() spear = blood_spear - button.screen_loc = "6:157,4:-2" - button.moved = "6:157,4:-2" /datum/action/innate/cult/spear/Activate() if(owner == spear.loc || cooldown > world.time) diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm index 809a69d393..93de7981f6 100644 --- a/code/modules/antagonists/cult/runes.dm +++ b/code/modules/antagonists/cult/runes.dm @@ -243,12 +243,12 @@ structure_check() searches for nearby cultist structures required for the invoca for(var/M in invokers) to_chat(M, "You need at least two invokers to convert [convertee]!") log_game("Offer rune failed - tried conversion with one invoker") - return 0 + return FALSE if(convertee.anti_magic_check(TRUE, TRUE, chargecost = 0)) //Not major because it can be spammed for(var/M in invokers) to_chat(M, "Something is shielding [convertee]'s mind!") log_game("Offer rune failed - convertee had anti-magic") - return 0 + return FALSE var/brutedamage = convertee.getBruteLoss() var/burndamage = convertee.getFireLoss() if(brutedamage || burndamage) diff --git a/code/modules/antagonists/devil/devil.dm b/code/modules/antagonists/devil/devil.dm index 9f69f10887..6ee76d0098 100644 --- a/code/modules/antagonists/devil/devil.dm +++ b/code/modules/antagonists/devil/devil.dm @@ -389,43 +389,43 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master", if(iscarbon(body)) var/mob/living/carbon/H = body return H.reagents.has_reagent(/datum/reagent/water/holywater) - return 0 + return FALSE if(BANISH_COFFIN) return (body && istype(body.loc, /obj/structure/closet/crate/coffin)) if(BANISH_FORMALDYHIDE) if(iscarbon(body)) var/mob/living/carbon/H = body return H.reagents.has_reagent(/datum/reagent/toxin/formaldehyde) - return 0 + return FALSE if(BANISH_RUNES) if(body) for(var/obj/effect/decal/cleanable/crayon/R in range(0,body)) if (R.name == "rune") - return 1 - return 0 + return TRUE + return FALSE if(BANISH_CANDLES) if(body) var/count = 0 for(var/obj/item/candle/C in range(1,body)) count += C.lit if(count>=4) - return 1 - return 0 + return TRUE + return FALSE if(BANISH_DESTRUCTION) if(body) - return 0 - return 1 + return FALSE + return TRUE if(BANISH_FUNERAL_GARB) if(ishuman(body)) var/mob/living/carbon/human/H = body if(H.w_uniform && istype(H.w_uniform, /obj/item/clothing/under/misc/burial)) - return 1 - return 0 + return TRUE + return FALSE else for(var/obj/item/clothing/under/misc/burial/B in range(0,body)) if(B.loc == get_turf(B)) //Make sure it's not in someone's inventory or something. - return 1 - return 0 + return TRUE + return FALSE /datum/antagonist/devil/proc/hellish_resurrection(mob/living/body) message_admins("[owner.name] (true name is: [truename]) is resurrecting using hellish energy.") diff --git a/code/modules/antagonists/devil/devil_helpers.dm b/code/modules/antagonists/devil/devil_helpers.dm index 1fcbbf91d0..389aa43970 100644 --- a/code/modules/antagonists/devil/devil_helpers.dm +++ b/code/modules/antagonists/devil/devil_helpers.dm @@ -35,4 +35,4 @@ DefaultCombatKnockdown(40) qdel(weapon) return 2 - return 1 + return TRUE diff --git a/code/modules/antagonists/devil/sintouched/sintouched.dm b/code/modules/antagonists/devil/sintouched/sintouched.dm index c9bf474567..839d3cceeb 100644 --- a/code/modules/antagonists/devil/sintouched/sintouched.dm +++ b/code/modules/antagonists/devil/sintouched/sintouched.dm @@ -17,9 +17,9 @@ /datum/antagonist/sintouched/threat() switch(sin) if(SIN_GLUTTONY,SIN_ENVY) - return 1 + return TRUE else - return 0 + return FALSE /datum/antagonist/sintouched/New() . = ..() diff --git a/code/modules/antagonists/devil/true_devil/_true_devil.dm b/code/modules/antagonists/devil/true_devil/_true_devil.dm index d524a7edae..3b5d3cd416 100644 --- a/code/modules/antagonists/devil/true_devil/_true_devil.dm +++ b/code/modules/antagonists/devil/true_devil/_true_devil.dm @@ -84,7 +84,7 @@ . += "" /mob/living/carbon/true_devil/IsAdvancedToolUser() - return 1 + return TRUE /mob/living/carbon/true_devil/resist_buckle() if(buckled) @@ -110,7 +110,7 @@ return ..() //flashes don't stop devils UNLESS it's their bane. /mob/living/carbon/true_devil/soundbang_act() - return 0 + return FALSE /mob/living/carbon/true_devil/get_ear_protection() return 2 @@ -124,7 +124,7 @@ /mob/living/carbon/true_devil/singularity_act() if(ascended) - return 0 + return FALSE return ..() //ATTACK GHOST IGNORING PARENT RETURN VALUE @@ -138,7 +138,7 @@ return ..() /mob/living/carbon/true_devil/can_be_revived() - return 1 + return TRUE /mob/living/carbon/true_devil/resist_fire() //They're immune to fire. @@ -177,7 +177,7 @@ // devils do not need to breathe /mob/living/carbon/true_devil/is_literate() - return 1 + return TRUE /mob/living/carbon/true_devil/ex_act(severity, target, origin) if(!ascended) diff --git a/code/modules/antagonists/devil/true_devil/inventory.dm b/code/modules/antagonists/devil/true_devil/inventory.dm index 8856838a34..279a261cdb 100644 --- a/code/modules/antagonists/devil/true_devil/inventory.dm +++ b/code/modules/antagonists/devil/true_devil/inventory.dm @@ -1,8 +1,8 @@ /mob/living/carbon/true_devil/doUnEquip(obj/item/I, force, invdrop, silent = FALSE) if(..()) update_inv_hands() - return 1 - return 0 + return TRUE + return FALSE /mob/living/carbon/true_devil/update_inv_hands() //TODO LORDPIDEY: Figure out how to make the hands line up properly. the l/r_hand_overlay should use the down sprite when facing down, left, or right, and the up sprite when facing up. diff --git a/code/modules/antagonists/revenant/revenant.dm b/code/modules/antagonists/revenant/revenant.dm index 41fc16c922..5d753fa079 100644 --- a/code/modules/antagonists/revenant/revenant.dm +++ b/code/modules/antagonists/revenant/revenant.dm @@ -175,7 +175,7 @@ //Immunities /mob/living/simple_animal/revenant/ex_act(severity, target, origin) - return 1 //Immune to the effects of explosions. + return TRUE //Immune to the effects of explosions. /mob/living/simple_animal/revenant/wave_ex_act(power, datum/wave_explosion/explosion, dir) return power @@ -225,7 +225,7 @@ /mob/living/simple_animal/revenant/death() if(!revealed || stasis) //Revenants cannot die if they aren't revealed //or are already dead - return 0 + return FALSE stasis = TRUE to_chat(src, "NO! No... it's too late, you can feel your essence [pick("breaking apart", "drifting away")]...") mob_transforming = TRUE @@ -333,7 +333,7 @@ to_chat(src, "Gained [essence_amt]E[source ? " from [source]":""].") else to_chat(src, "Lost [essence_amt]E[source ? " from [source]":""].") - return 1 + return TRUE /mob/living/simple_animal/revenant/proc/telekinesis_cooldown_end() if(!telekinesis_cooldown) diff --git a/code/modules/antagonists/revenant/revenant_abilities.dm b/code/modules/antagonists/revenant/revenant_abilities.dm index 885921a944..4eee03303d 100644 --- a/code/modules/antagonists/revenant/revenant_abilities.dm +++ b/code/modules/antagonists/revenant/revenant_abilities.dm @@ -176,7 +176,7 @@ user.reveal(reveal) user.stun(stun) if(action) - action.UpdateButtonIcon() + action.UpdateButtons() return TRUE //Overload Light: Breaks a light that's online and sends out lightning bolts to all nearby people. diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index d2b698bce4..68c8cf4da3 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -210,7 +210,7 @@ return ..() /obj/item/organ/heart/demon/Stop() - return 0 // Always beating. + return FALSE // Always beating. /mob/living/simple_animal/slaughter/laughter // The laughter demon! It's everyone's best friend! It just wants to hug diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm index 4c48ad81dd..0eac4678d7 100644 --- a/code/modules/antagonists/swarmer/swarmer.dm +++ b/code/modules/antagonists/swarmer/swarmer.dm @@ -142,9 +142,9 @@ /mob/living/simple_animal/hostile/swarmer/CanAllowThrough(atom/movable/O) . = ..() if(istype(O, /obj/item/projectile/beam/disabler))//Allows for swarmers to fight as a group without wasting their shots hitting each other - return 1 + return TRUE if(isswarmer(O)) - return 1 + return TRUE ////CTRL CLICK FOR SWARMERS AND SWARMER_ACT()'S//// /mob/living/simple_animal/hostile/swarmer/AttackingTarget() @@ -191,11 +191,11 @@ return S.Integrate(src) /atom/movable/proc/IntegrateAmount() - return 0 + return FALSE /obj/item/IntegrateAmount() //returns the amount of resources gained when eating this item if(custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)] || custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)]) - return 1 + return TRUE return ..() /obj/item/gun/swarmer_act()//Stops you from eating the entire armory @@ -217,7 +217,7 @@ return 2 /obj/item/clockwork/alloy_shards/small/IntegrateAmount() - return 1 + return TRUE /turf/open/floor/swarmer_act()//ex_act() on turf calls it on its contents, this is to prevent attacking mobs by DisIntegrate()'ing the floor return FALSE @@ -494,7 +494,7 @@ resources -= fabrication_cost else to_chat(src, "You do not have the necessary resources to fabricate this object.") - return 0 + return FALSE return new fabrication_object(loc) /mob/living/simple_animal/hostile/swarmer/proc/Integrate(atom/movable/target) diff --git a/code/modules/antagonists/swarmer/swarmer_event.dm b/code/modules/antagonists/swarmer/swarmer_event.dm index e70d76812d..460ce687a6 100644 --- a/code/modules/antagonists/swarmer/swarmer_event.dm +++ b/code/modules/antagonists/swarmer/swarmer_event.dm @@ -13,9 +13,9 @@ /datum/round_event/spawn_swarmer/start() if(find_swarmer()) - return 0 + return FALSE if(!GLOB.the_gateway) - return 0 + return FALSE new /obj/effect/mob_spawn/swarmer(get_turf(GLOB.the_gateway)) if(prob(25)) //25% chance to announce it to the crew var/swarmer_report = "[command_name()] High-Priority Update" @@ -26,5 +26,5 @@ for(var/i in GLOB.mob_living_list) var/mob/living/L = i if(istype(L, /mob/living/simple_animal/hostile/swarmer) && L.client) //If there is a swarmer with an active client, we've found our swarmer - return 1 - return 0 + return TRUE + return FALSE diff --git a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm index e5fa38a415..a7ed574c87 100644 --- a/code/modules/antagonists/traitor/equipment/Malf_Modules.dm +++ b/code/modules/antagonists/traitor/equipment/Malf_Modules.dm @@ -33,9 +33,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( /datum/action/innate/ai/New() ..() - if(uses > 1) - desc = "[desc] It has [uses] use\s remaining." - button.desc = desc + desc = "[desc] It has [uses] use\s remaining." /datum/action/innate/ai/Grant(mob/living/L) . = ..() @@ -63,7 +61,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( if(!silent) to_chat(owner, "[name] now has [uses] use[uses > 1 ? "s" : ""] remaining.") desc = "[initial(desc)] It has [uses] use\s remaining." - UpdateButtonIcon() + UpdateButtons() return if(initial(uses) > 1) //no need to tell 'em if it was one-use anyway! to_chat(owner, "[name] has run out of uses!") @@ -92,7 +90,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( if(!silent) to_chat(owner, "[name] now has [uses] use[uses > 1 ? "s" : ""] remaining.") desc = "[initial(desc)] It has [uses] use\s remaining." - UpdateButtonIcon() + UpdateButtons() return if(initial(uses) > 1) //no need to tell 'em if it was one-use anyway! to_chat(owner, "[name] has run out of uses!") @@ -203,7 +201,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( else //Adding uses to an existing module action.uses += initial(action.uses) action.desc = "[initial(action.desc)] It has [action.uses] use\s remaining." - action.UpdateButtonIcon() + action.UpdateButtons() temp = "Additional use[action.uses > 1 ? "s" : ""] added to [action.name]!" processing_time -= AM.cost @@ -759,6 +757,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( uses = 3 auto_use_uses = FALSE +/datum/action/innate/ai/blackout/New() + ..() + desc = "[desc] It has [uses] use\s remaining." + /datum/action/innate/ai/blackout/Activate() for(var/obj/machinery/power/apc/apc in GLOB.apcs_list) if(prob(30 * apc.overload)) @@ -768,7 +770,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( to_chat(owner, "Overcurrent applied to the powernet.") owner.playsound_local(owner, "sparks", 50, 0) adjust_uses(-1) - + if(QDELETED(src) || uses) //Not sure if not having src here would cause a runtime, so it's here to be safe + return + desc = "[initial(desc)] It has [uses] use\s remaining." + UpdateButtons() //Disable Emergency Lights /datum/AI_Module/small/emergency_lights @@ -816,6 +821,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( auto_use_uses = FALSE cooldown_period = 30 +/datum/action/innate/ai/reactivate_cameras/New() + ..() + desc = "[desc] It has [uses] use\s remaining." + /datum/action/innate/ai/reactivate_cameras/Activate() var/fixed_cameras = 0 for(var/V in GLOB.cameranet.cameras) @@ -830,7 +839,10 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list( to_chat(owner, "Diagnostic complete! Cameras reactivated: [fixed_cameras]. Reactivations remaining: [uses].") owner.playsound_local(owner, 'sound/items/wirecutter.ogg', 50, 0) adjust_uses(0, TRUE) //Checks the uses remaining - + if(QDELETED(src) || !uses) //Not sure if not having src here would cause a runtime, so it's here to be safe + return + desc = "[initial(desc)] It has [uses] use\s remaining." + UpdateButtons() //Upgrade Camera Network: EMP-proofs all cameras, in addition to giving them X-ray vision. /datum/AI_Module/large/upgrade_cameras diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index 0701ade73c..3240b5cc11 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -21,18 +21,18 @@ if(istype(SSticker.mode,/datum/game_mode/dynamic)) var/datum/game_mode/dynamic/mode = SSticker.mode if(dynamic_requirement > 0 && mode.threat_level < dynamic_requirement) - return 0 - return 1 + return FALSE + return TRUE /datum/spellbook_entry/proc/CanBuy(mob/living/carbon/human/user,obj/item/spellbook/book) // Specific circumstances if(book.uses= aspell.level_max) to_chat(user, "This spell cannot be improved further.") - return 0 + return FALSE else aspell.name = initial(aspell.name) aspell.spell_level++ @@ -63,22 +63,22 @@ if(aspell.spell_level >= aspell.level_max) to_chat(user, "This spell cannot be strengthened any further.") SSblackbox.record_feedback("nested tally", "wizard_spell_improved", 1, list("[name]", "[aspell.spell_level]")) - return 1 + return TRUE //No same spell found - just learn it SSblackbox.record_feedback("tally", "wizard_spell_learned", 1, name) user.mind.AddSpell(S) to_chat(user, "You have learned [S.name].") - return 1 + return TRUE /datum/spellbook_entry/proc/CanRefund(mob/living/carbon/human/user,obj/item/spellbook/book) if(!refundable) - return 0 + return FALSE if(!S) S = new spell_type() for(var/obj/effect/proc_holder/spell/aspell in user.mind.spell_list) if(initial(S.name) == initial(aspell.name)) - return 1 - return 0 + return TRUE + return FALSE /datum/spellbook_entry/proc/Refund(mob/living/carbon/human/user,obj/item/spellbook/book) //return point value or -1 for failure var/area/wizard_station/A = GLOB.areas_by_type[/area/wizard_station] @@ -228,7 +228,7 @@ spell_type = /obj/effect/proc_holder/spell/aimed/lightningbolt cost = 3 -/datum/spellbook_entry/lightningbolt/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) //return 1 on success +/datum/spellbook_entry/lightningbolt/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) //return TRUE on success . = ..() ADD_TRAIT(user, TRAIT_TESLA_SHOCKIMMUNE, "lightning_bolt_spell") @@ -291,7 +291,7 @@ /datum/spellbook_entry/item/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) new item_path(get_turf(user)) SSblackbox.record_feedback("tally", "wizard_spell_learned", 1, name) - return 1 + return TRUE /datum/spellbook_entry/item/GetInfo() var/dat ="" @@ -520,7 +520,7 @@ /datum/spellbook_entry/summon/guns/IsAvailible() if(!SSticker.mode) // In case spellbook is placed on map - return 0 + return FALSE return (!CONFIG_GET(flag/no_summon_guns) && ..()) /datum/spellbook_entry/summon/guns/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) @@ -529,7 +529,7 @@ active = 1 playsound(get_turf(user), 'sound/magic/castsummon.ogg', 50, 1) to_chat(user, "You have cast summon guns!") - return 1 + return TRUE /datum/spellbook_entry/summon/magic name = "Summon Magic" @@ -539,7 +539,7 @@ /datum/spellbook_entry/summon/magic/IsAvailible() if(!SSticker.mode) // In case spellbook is placed on map - return 0 + return FALSE return (!CONFIG_GET(flag/no_summon_guns) && ..()) /datum/spellbook_entry/summon/magic/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) @@ -548,7 +548,7 @@ active = 1 playsound(get_turf(user), 'sound/magic/castsummon.ogg', 50, 1) to_chat(user, "You have cast summon magic!") - return 1 + return TRUE /datum/spellbook_entry/summon/events name = "Summon Events" @@ -558,7 +558,7 @@ /datum/spellbook_entry/summon/events/IsAvailible() if(!SSticker.mode) // In case spellbook is placed on map - return 0 + return FALSE return (!CONFIG_GET(flag/no_summon_events) && ..()) /datum/spellbook_entry/summon/events/Buy(mob/living/carbon/human/user,obj/item/spellbook/book) @@ -567,7 +567,7 @@ times++ playsound(get_turf(user), 'sound/magic/castsummon.ogg', 50, 1) to_chat(user, "You have cast summon events.") - return 1 + return TRUE /datum/spellbook_entry/summon/events/GetInfo() . = ..() @@ -755,7 +755,7 @@ if(H.stat || H.restrained()) return if(!ishuman(H)) - return 1 + return TRUE if(H.mind.special_role == "apprentice") temp = "If you got caught sneaking a peek from your teacher's spellbook, you'd likely be expelled from the Wizard Academy. Better not." diff --git a/code/modules/assembly/assembly.dm b/code/modules/assembly/assembly.dm index 67844d50bf..cd603baf55 100644 --- a/code/modules/assembly/assembly.dm +++ b/code/modules/assembly/assembly.dm @@ -30,7 +30,7 @@ var/activate_cooldown = 3 SECONDS /obj/item/assembly/get_part_rating() - return 1 + return TRUE /obj/item/assembly/proc/on_attach() diff --git a/code/modules/assembly/health.dm b/code/modules/assembly/health.dm index 0af6c85fb6..db79bb78c7 100644 --- a/code/modules/assembly/health.dm +++ b/code/modules/assembly/health.dm @@ -61,7 +61,7 @@ /obj/item/assembly/health/proc/toggle_scan() if(!secured) - return 0 + return FALSE scanning = !scanning if(scanning) START_PROCESSING(SSobj, src) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index fe7a8fdfaf..8b00fc49d0 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -278,7 +278,7 @@ we use a hook instead /datum/gas_mixture/copy_from_turf(turf/model) set_temperature(initial(model.initial_temperature)) parse_gas_string(model.initial_gas_mix) - return 1 + return TRUE /datum/gas_mixture/proc/__auxtools_parse_gas_string(gas_string) @@ -297,7 +297,7 @@ we use a hook instead for(var/id in gas) set_moles(id, text2num(gas[id])) archive() - return 1 + return TRUE */ /* /datum/gas_mixture/react(datum/holder) diff --git a/code/modules/atmospherics/gasmixtures/zextools_broke.dm b/code/modules/atmospherics/gasmixtures/zextools_broke.dm index fe7b1c462b..3b133b77ac 100644 --- a/code/modules/atmospherics/gasmixtures/zextools_broke.dm +++ b/code/modules/atmospherics/gasmixtures/zextools_broke.dm @@ -41,7 +41,7 @@ TOTAL_MOLES(cached_gases, .) . *= R_IDEAL_GAS_EQUATION * temperature / volume return - return 0 + return FALSE /datum/gas_mixture/return_temperature() //kelvins return temperature @@ -91,11 +91,11 @@ /datum/gas_mixture/archive() temperature_archived = temperature gas_archive = gases.Copy() - return 1 + return TRUE /datum/gas_mixture/merge(datum/gas_mixture/giver) if(!giver) - return 0 + return FALSE //heat transfer if(abs(temperature - giver.temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER) @@ -111,7 +111,7 @@ for(var/giver_id in giver_gases) cached_gases[giver_id] += giver_gases[giver_id] - return 1 + return TRUE /datum/gas_mixture/remove(amount) var/sum @@ -172,7 +172,7 @@ //remove all gases not in the sample cached_gases &= sample_gases - return 1 + return TRUE /datum/gas_mixture/copy_from_turf(turf/model) parse_gas_string(model.initial_gas_mix) @@ -182,7 +182,7 @@ if(model.temperature != initial(model.temperature) || model.temperature != initial(model_parent.temperature)) temperature = model.temperature - return 1 + return TRUE /datum/gas_mixture/share(datum/gas_mixture/sharer, atmos_adjacent_turfs = 4) diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 19b94eb64e..60b487c97c 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -16,10 +16,10 @@ if(min2 != -1 && val <= min2) return 2 if(max1 != -1 && val >= max1) - return 1 + return TRUE if(min1 != -1 && val <= min1) - return 1 - return 0 + return TRUE + return FALSE /datum/tlv/no_checks min2 = -1 @@ -488,16 +488,16 @@ /obj/machinery/airalarm/proc/shock(mob/user, prb) if((stat & (NOPOWER))) // unpowered, no shock - return 0 + return FALSE if(!prob(prb)) - return 0 //you lucked out, no shock for you + return FALSE //you lucked out, no shock for you var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread s.set_up(5, 1, src) s.start() //sparks always. if (electrocute_mob(user, get_area(src), src, 1, TRUE)) - return 1 + return TRUE else - return 0 + return FALSE /obj/machinery/airalarm/proc/refresh_all() var/area/A = get_base_area(src) @@ -519,7 +519,7 @@ /obj/machinery/airalarm/proc/send_signal(target, list/command, mob/user)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise if(!radio_connection) - return 0 + return FALSE var/datum/signal/signal = new(command) signal.data["tag"] = target @@ -527,7 +527,7 @@ signal.data["user"] = user radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) - return 1 + return TRUE /obj/machinery/airalarm/proc/get_mode_name(mode_value) switch(mode_value) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index f5c10b365f..e017b9186c 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -214,7 +214,7 @@ if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker). reagent_transfer = 0 - return 1 + return TRUE /obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos() ..() @@ -445,7 +445,7 @@ return // can't ventcrawl in or out of cryo. /obj/machinery/atmospherics/components/unary/cryo_cell/can_see_pipes() - return 0 // you can't see the pipe network when inside a cryo cell. + return FALSE // you can't see the pipe network when inside a cryo cell. /obj/machinery/atmospherics/components/unary/cryo_cell/return_temperature() var/datum/gas_mixture/G = airs[1] diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index b60cc7bb90..c8f25d6f6a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -84,7 +84,7 @@ update_parents() else active_power_usage = idle_power_usage - return 1 + return TRUE /obj/machinery/atmospherics/components/unary/thermomachine/power_change() ..() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 072babdf3e..919c283808 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -194,7 +194,7 @@ /obj/machinery/atmospherics/components/unary/vent_scrubber/receive_signal(datum/signal/signal) if(!is_operational() || !signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command")) - return 0 + return FALSE var/mob/signal_sender = signal.data["user"] diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index 1d0c59f789..dbf155b981 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -186,7 +186,7 @@ self_temperature_delta = -heat/total_heat_capacity sharer_temperature_delta = heat/sharer_heat_capacity else - return 1 + return TRUE air.set_temperature(air.return_temperature() + self_temperature_delta) modeled_location.TakeTemperature(sharer_temperature_delta) diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index e7ea86851b..48d69567af 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -57,18 +57,18 @@ /obj/machinery/meter/process_atmos() if(!(target?.flags_1 & INITIALIZED_1)) icon_state = "meterX" - return 0 + return FALSE if(stat & (BROKEN|NOPOWER)) icon_state = "meter0" - return 0 + return FALSE use_power(5) var/datum/gas_mixture/environment = target.return_air() if(!environment) icon_state = "meterX" - return 0 + return FALSE var/env_pressure = environment.return_pressure() if(env_pressure <= 0.15*ONE_ATMOSPHERE) diff --git a/code/modules/atmospherics/machinery/pipes/pipes.dm b/code/modules/atmospherics/machinery/pipes/pipes.dm index a514606e4d..beb0988f8d 100644 --- a/code/modules/atmospherics/machinery/pipes/pipes.dm +++ b/code/modules/atmospherics/machinery/pipes/pipes.dm @@ -76,7 +76,7 @@ parent = P /obj/machinery/atmospherics/pipe/zap_act(power, zap_flags) - return 0 // they're not really machines in the normal sense, probably shouldn't explode + return FALSE // they're not really machines in the normal sense, probably shouldn't explode /obj/machinery/atmospherics/pipe/Destroy() QDEL_NULL(parent) @@ -110,7 +110,7 @@ /obj/machinery/atmospherics/pipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 12) - return 0 + return FALSE . = ..() /obj/machinery/atmospherics/pipe/proc/paint(paint_color) diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm index fcfdd54aa9..3613a59e0a 100644 --- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm +++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm @@ -21,7 +21,7 @@ air_contents = new(volume) air_contents.set_temperature(T20C) - return 1 + return TRUE /obj/machinery/portable_atmospherics/Destroy() SSair.atmos_machinery -= src diff --git a/code/modules/awaymissions/mission_code/Cabin.dm b/code/modules/awaymissions/mission_code/Cabin.dm index b5ff23d75b..51c2c130c8 100644 --- a/code/modules/awaymissions/mission_code/Cabin.dm +++ b/code/modules/awaymissions/mission_code/Cabin.dm @@ -123,7 +123,7 @@ /datum/mapGeneratorModule/snow/checkPlaceAtom(turf/T) if(istype(T, /turf/open/floor/plating/asteroid/snow)) return ..(T) - return 0 + return FALSE /datum/mapGeneratorModule/bottomlayer/snow spawnableTurfs = list(/turf/open/floor/plating/asteroid/snow/atmosphere = 100) diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index bc7e2cbd08..95b3163256 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -168,4 +168,4 @@ to_chat(C, "You're already resurrecting!") return C.apply_status_effect(STATUS_EFFECT_WISH_GRANTERS_GIFT) - return 1 + return TRUE diff --git a/code/modules/buildmode/buildmode.dm b/code/modules/buildmode/buildmode.dm index e0703201a1..09a93f57f8 100644 --- a/code/modules/buildmode/buildmode.dm +++ b/code/modules/buildmode/buildmode.dm @@ -136,7 +136,7 @@ build_dir = newdir close_dirswitch() dirbutton.update_icon() - return 1 + return TRUE /datum/buildmode/proc/InterceptClickOn(mob/user, params, atom/object) mode.handle_click(user.client, params, object) diff --git a/code/modules/buildmode/buttons.dm b/code/modules/buildmode/buttons.dm index 5c5c0000d1..e29739f5ad 100644 --- a/code/modules/buildmode/buttons.dm +++ b/code/modules/buildmode/buttons.dm @@ -25,7 +25,7 @@ else if(pa.Find("right")) bd.mode.change_settings(usr.client) update_icon() - return 1 + return TRUE /atom/movable/screen/buildmode/mode/update_icon_state() icon_state = bd.mode.get_button_iconstate() @@ -37,7 +37,7 @@ /atom/movable/screen/buildmode/help/Click(location, control, params) bd.mode.show_help(usr.client) - return 1 + return TRUE /atom/movable/screen/buildmode/bdir icon_state = "build" @@ -50,7 +50,7 @@ /atom/movable/screen/buildmode/bdir/Click() bd.toggle_dirswitch() update_icon() - return 1 + return TRUE // used to switch between modes /atom/movable/screen/buildmode/modeswitch @@ -64,7 +64,7 @@ /atom/movable/screen/buildmode/modeswitch/Click() bd.change_mode(modetype) - return 1 + return TRUE // used to switch between dirs /atom/movable/screen/buildmode/dirswitch @@ -77,7 +77,7 @@ /atom/movable/screen/buildmode/dirswitch/Click() bd.change_dir(dir) - return 1 + return TRUE /atom/movable/screen/buildmode/quit icon_state = "buildquit" @@ -86,4 +86,4 @@ /atom/movable/screen/buildmode/quit/Click() bd.quit() - return 1 + return TRUE diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index 66713a3053..6ab72f2eb3 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -117,7 +117,7 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they // Checks the amount of exportable in object. Credits in the bill, sheets in the stack, etc. // Usually acts as a multiplier for a cost, so item that has 0 amount will be skipped in export. /datum/export/proc/get_amount(obj/O) - return 1 + return TRUE // Checks if the item is fit for export datum. /datum/export/proc/applies_to(obj/O, allowed_categories = NONE, apply_elastic = TRUE) diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm index e84d36d5dc..f6976d7f44 100644 --- a/code/modules/cargo/exports/materials.dm +++ b/code/modules/cargo/exports/materials.dm @@ -11,12 +11,12 @@ /datum/export/material/get_amount(obj/O) if(!material_id) - return 0 + return FALSE if(!isitem(O)) - return 0 + return FALSE var/obj/item/I = O if(!(SSmaterials.GetMaterialRef(material_id) in I.custom_materials)) - return 0 + return FALSE var/amount = I.custom_materials[SSmaterials.GetMaterialRef(material_id)] diff --git a/code/modules/cargo/exports/seeds.dm b/code/modules/cargo/exports/seeds.dm index 1a2a18c46b..3d3c38fbf3 100644 --- a/code/modules/cargo/exports/seeds.dm +++ b/code/modules/cargo/exports/seeds.dm @@ -9,9 +9,9 @@ /datum/export/seed/get_cost(obj/O) var/obj/item/seeds/S = O if(!needs_discovery && (S.type in discoveredPlants)) - return 0 + return FALSE if(needs_discovery && !(S.type in discoveredPlants)) - return 0 + return FALSE return ..() * S.rarity // That's right, no bonus for potency. Send a crappy sample first to "show improvement" later. /datum/export/seed/sell_object(obj/O) @@ -31,7 +31,7 @@ var/obj/item/seeds/S = O var/cost = ..() if(!cost) - return 0 + return FALSE var/potDiff = (S.potency - discoveredPlants[S.type]) diff --git a/code/modules/cargo/exports/sheets.dm b/code/modules/cargo/exports/sheets.dm index 058e0cc892..79b22aba8d 100644 --- a/code/modules/cargo/exports/sheets.dm +++ b/code/modules/cargo/exports/sheets.dm @@ -6,7 +6,7 @@ var/obj/item/stack/S = O if(istype(S)) return S.amount - return 0 + return FALSE // Hides diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index c1399ce646..14224cf02e 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -134,16 +134,16 @@ var/obj/item/active_mousedown_item = null ///Used in MouseDrag to preserve the original mouse click parameters var/mouseParams = "" - ///Used in MouseDrag to preserve the last mouse-entered location. - var/mouseLocation = null - ///Used in MouseDrag to preserve the last mouse-entered object. - var/mouseObject = null - var/mouseControlObject = null + ///Used in MouseDrag to preserve the last mouse-entered location. Weakref + var/datum/weakref/mouse_location_ref = null + ///Used in MouseDrag to preserve the last mouse-entered object. Weakref + var/datum/weakref/mouse_object_ref + var/mouse_control_object /// Messages currently seen by this client var/list/seen_messages /// viewsize datum for holding our view size - var/datum/viewData/view_size + var/datum/view_data/view_size /// our current tab var/stat_tab diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 6ca963df73..58103faf7d 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -167,8 +167,8 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( /client/proc/is_content_unlocked() if(!prefs.unlock_content) to_chat(src, "Become a BYOND member to access member-perks and features, as well as support the engine that makes this game possible. Only 10 bucks for 3 months! Click Here to find out more.") - return 0 - return 1 + return FALSE + return TRUE /* * Call back proc that should be checked in all paths where a client can send messages * @@ -199,11 +199,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( total_message_count = 0 total_count_reset = 0 cmd_admin_mute(src, mute_type, 1) - return 1 + return TRUE //Otherwise just supress the message else if(cache >= SPAM_TRIGGER_AUTOMUTE) - return 1 + return TRUE if(CONFIG_GET(flag/automute_on) && !holder && last_message == message) @@ -211,21 +211,21 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE) to_chat(src, "You have exceeded the spam filter limit for identical messages. An auto-mute was applied.") cmd_admin_mute(src, mute_type, 1) - return 1 + return TRUE if(src.last_message_count >= SPAM_TRIGGER_WARNING) to_chat(src, "You are nearing the spam filter limit for identical messages.") - return 0 + return FALSE else last_message = message src.last_message_count = 0 - return 0 + return FALSE //This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc. /client/AllowUpload(filename, filelength) if(filelength > UPLOAD_LIMIT) to_chat(src, "Error: AllowUpload(): File Upload too large. Upload Limit: [UPLOAD_LIMIT/1024]KiB.") - return 0 - return 1 + return FALSE + return TRUE /////////// @@ -393,7 +393,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( to_chat(src, "Because you are an admin, you are being allowed to walk past this limitation, But it is still STRONGLY suggested you upgrade") else qdel(src) - return 0 + return FALSE else if (byond_version < cwv) //We have words for this client. if(CONFIG_GET(flag/client_warn_popup)) var/msg = "Your version of byond may be getting out of date:
" @@ -413,11 +413,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if (!CONFIG_GET(flag/allow_webclient)) to_chat(src, "Web client is disabled") qdel(src) - return 0 + return FALSE if (CONFIG_GET(flag/webclient_only_byond_members) && !IsByondMember()) to_chat(src, "Sorry, but the web client is restricted to byond members only.") qdel(src) - return 0 + return FALSE if( (world.address == address || !address) && !GLOB.host ) GLOB.host = key @@ -881,9 +881,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( click_intercept_time = 0 //Reset and return. Next click should work, but not this one. return click_intercept_time = 0 //Just reset. Let's not keep re-checking forever. - var/list/L = params2list(params) + var/list/modifiers = params2list(params) - if(L["drag"]) + if(modifiers[DRAG]) return var/mcl = CONFIG_GET(number/minute_click_limit) @@ -929,6 +929,11 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( // so that the visual focus indicator matches reality. winset(src, null, "input.background-color=[COLOR_INPUT_DISABLED]") + else + winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED]") + + SEND_SIGNAL(src, COMSIG_CLIENT_CLICK, object, location, control, params, usr) + ..() /client/proc/add_verbs_from_config() diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index ae5bd1517e..70a58bcffb 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -41,10 +41,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/last_custom_holoform = 0 //Cooldowns for saving/loading. These are four are all separate due to loading code calling these one after another - var/saveprefcooldown - var/loadprefcooldown - var/savecharcooldown - var/loadcharcooldown + COOLDOWN_DECLARE(saveprefcooldown) + COOLDOWN_DECLARE(loadprefcooldown) + COOLDOWN_DECLARE(savecharcooldown) + COOLDOWN_DECLARE(loadcharcooldown) //game-preferences var/lastchangelog = "" //Saved changlog filesize to detect if there was a change @@ -65,7 +65,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/screentip_pref = SCREENTIP_PREFERENCE_ENABLED var/screentip_color = "#ffd391" var/screentip_images = TRUE - var/buttons_locked = FALSE var/hotkeys = FALSE ///Runechat preference. If true, certain messages will be displayed on the map, not ust on the chat area. Boolean. @@ -268,6 +267,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/loadout_errors = 0 + var/pref_queue + var/char_queue + /datum/preferences/New(client/C) parent = C @@ -1070,8 +1072,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Runechat message char limit: [max_chat_length]
" dat += "See Runechat for non-mobs: [see_chat_non_mob ? "Enabled" : "Disabled"]
" dat += "
" - dat += "Action Buttons: [(buttons_locked) ? "Locked In Place" : "Unlocked"]
" - dat += "
" dat += "PDA Color: [pda_color] Change
" dat += "PDA Style: [pda_style]
" dat += "PDA Reskin: [pda_skin]
" @@ -1578,7 +1578,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) SetJobPreferenceLevel(job, jpval) SetChoices(user) - return 1 + return TRUE /datum/preferences/proc/ResetJobs() @@ -1724,7 +1724,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) UpdateJobPreference(user, href_list["text"], text2num(href_list["level"])) else SetChoices(user) - return 1 + return TRUE else if(href_list["preference"] == "trait") switch(href_list["task"]) @@ -3003,8 +3003,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) chat_on_map = !chat_on_map if("see_chat_non_mob") see_chat_non_mob = !see_chat_non_mob - if("action_buttons") - buttons_locked = !buttons_locked if("tgui_fancy") tgui_fancy = !tgui_fancy if("outline_enabled") @@ -3219,6 +3217,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) load_character() if("changeslot") + if(char_queue) + deltimer(char_queue) // Do not dare. if(!load_character(text2num(href_list["num"]))) random_character() real_name = random_unique_name(gender) @@ -3335,7 +3335,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) user_gear[LOADOUT_CUSTOM_DESCRIPTION] = new_description ShowChoices(user) - return 1 + return TRUE /datum/preferences/proc/copy_to(mob/living/carbon/human/character, icon_updates = 1, roundstart_checks = TRUE, initial_spawn = FALSE) if(be_random_name) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 6bb704f8a5..f30665c35e 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -401,7 +401,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(istype(parent)) to_chat(parent, "You're attempting to load your preferences a little too fast. Wait half a second, then try again.") return FALSE - loadprefcooldown = world.time + PREF_SAVELOAD_COOLDOWN + COOLDOWN_START(src, loadprefcooldown, PREF_LOAD_COOLDOWN) if(!fexists(path)) return FALSE @@ -435,7 +435,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["see_chat_non_mob"] >> see_chat_non_mob S["tgui_fancy"] >> tgui_fancy S["tgui_lock"] >> tgui_lock - S["buttons_locked"] >> buttons_locked S["windowflash"] >> windowflashing S["be_special"] >> be_special @@ -513,7 +512,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car see_chat_non_mob = sanitize_integer(see_chat_non_mob, 0, 1, initial(see_chat_non_mob)) tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy)) tgui_lock = sanitize_integer(tgui_lock, 0, 1, initial(tgui_lock)) - buttons_locked = sanitize_integer(buttons_locked, 0, 1, initial(buttons_locked)) windowflashing = sanitize_integer(windowflashing, 0, 1, initial(windowflashing)) default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot)) toggles = sanitize_integer(toggles, 0, 16777215, initial(toggles)) @@ -595,18 +593,20 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(!GLOB.keybindings_by_name[bindname]) modless_key_bindings -= key -/datum/preferences/proc/save_preferences(bypass_cooldown = FALSE) +/datum/preferences/proc/save_preferences(bypass_cooldown = FALSE, silent = FALSE) if(!path) - return 0 + return FALSE if(!bypass_cooldown) if(world.time < saveprefcooldown) if(istype(parent)) - to_chat(parent, "You're attempting to save your preferences a little too fast. Wait half a second, then try again.") - return 0 - saveprefcooldown = world.time + PREF_SAVELOAD_COOLDOWN + queue_save_pref(PREF_SAVE_COOLDOWN, silent) + return FALSE + COOLDOWN_START(src, saveprefcooldown, PREF_SAVE_COOLDOWN) + if(pref_queue) + deltimer(pref_queue) var/savefile/S = new /savefile(path) if(!S) - return 0 + return FALSE S.cd = "/" WRITE_FILE(S["version"] , SAVEFILE_VERSION_MAX) //updates (or failing that the sanity checks) will ensure data is not invalid at load. Assume up-to-date @@ -626,7 +626,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["see_chat_non_mob"], see_chat_non_mob) WRITE_FILE(S["tgui_fancy"], tgui_fancy) WRITE_FILE(S["tgui_lock"], tgui_lock) - WRITE_FILE(S["buttons_locked"], buttons_locked) WRITE_FILE(S["windowflash"], windowflashing) WRITE_FILE(S["be_special"], be_special) WRITE_FILE(S["default_slot"], default_slot) @@ -676,7 +675,17 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else WRITE_FILE(S["unlockable_loadout"], safe_json_encode(list())) - return 1 + if(parent && !silent) + to_chat(parent, span_notice("Saved preferences!")) + + return TRUE + +/datum/preferences/proc/queue_save_pref(save_in, silent) + if(parent && !silent) + to_chat(parent, span_notice("Saving preferences in [save_in * 0.1] second\s.")) + if(pref_queue) + deltimer(pref_queue) + pref_queue = addtimer(CALLBACK(src, PROC_REF(save_preferences), TRUE, silent), save_in, TIMER_STOPPABLE) /datum/preferences/proc/load_character(slot, bypass_cooldown = FALSE) if(!path) @@ -686,7 +695,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(istype(parent)) to_chat(parent, "You're attempting to load your character a little too fast. Wait half a second, then try again.") return "SLOW THE FUCK DOWN" //the reason this isn't null is to make sure that people don't have their character slots overridden by random chars if they accidentally double-click a slot - loadcharcooldown = world.time + PREF_SAVELOAD_COOLDOWN + COOLDOWN_START(src, loadcharcooldown, PREF_LOAD_COOLDOWN) if(!fexists(path)) return FALSE var/savefile/S = new /savefile(path) @@ -1084,20 +1093,22 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car cit_character_pref_load(S) - return 1 + return TRUE -/datum/preferences/proc/save_character(bypass_cooldown = FALSE) +/datum/preferences/proc/save_character(bypass_cooldown = FALSE, silent = FALSE) if(!path) - return 0 + return FALSE if(!bypass_cooldown) if(world.time < savecharcooldown) if(istype(parent)) - to_chat(parent, "You're attempting to save your character a little too fast. Wait half a second, then try again.") - return 0 - savecharcooldown = world.time + PREF_SAVELOAD_COOLDOWN + queue_save_char(PREF_SAVE_COOLDOWN, silent) + return FALSE + COOLDOWN_START(src, savecharcooldown, PREF_SAVE_COOLDOWN) + if(char_queue) + deltimer(char_queue) var/savefile/S = new /savefile(path) if(!S) - return 0 + return FALSE S.cd = "/character[default_slot]" WRITE_FILE(S["version"] , SAVEFILE_VERSION_MAX) //load_character will sanitize any bad data, so assume up-to-date.) @@ -1281,8 +1292,17 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car cit_character_pref_save(S) - return 1 + if(parent && !silent) + to_chat(parent, span_notice("Saved character slot!")) + return TRUE + +/datum/preferences/proc/queue_save_char(save_in, silent) + if(parent && !silent) + to_chat(parent, span_notice("Saving character in [save_in * 0.1] second\s.")) + if(char_queue) + deltimer(char_queue) + char_queue = addtimer(CALLBACK(src, PROC_REF(save_character), TRUE, silent), save_in, TIMER_STOPPABLE) #undef SAVEFILE_VERSION_MAX #undef SAVEFILE_VERSION_MIN diff --git a/code/modules/clothing/chameleon.dm b/code/modules/clothing/chameleon.dm index 05ef6f18e0..c9d8bb563a 100644 --- a/code/modules/clothing/chameleon.dm +++ b/code/modules/clothing/chameleon.dm @@ -17,7 +17,7 @@ var/obj/item/clothing/mask/chameleon/drone/Z = target Z.chameleon_action.random_look(owner) - return 1 + return TRUE /datum/action/item_action/chameleon/drone/togglehatmask @@ -65,7 +65,7 @@ qdel(old_headgear) // where is `ITEM_SLOT_HEAD` defined? WHO KNOWS D.equip_to_slot(new_headgear, ITEM_SLOT_HEAD) - return 1 + return TRUE /datum/action/chameleon_outfit @@ -162,8 +162,8 @@ ..() /datum/action/item_action/chameleon/change/proc/initialize_disguises() - if(button) - button.name = "Change [chameleon_name] Appearance" + name = "Change [chameleon_name] Appearance" + UpdateButtons() chameleon_blacklist |= typecacheof(target.type) for(var/V in typesof(chameleon_type)) @@ -209,7 +209,7 @@ update_item(picked_item) var/obj/item/thing = target thing.update_slot_icon() - UpdateButtonIcon() + UpdateButtons() /datum/action/item_action/chameleon/change/proc/update_item(obj/item/picked_item) target.name = initial(picked_item.name) @@ -245,7 +245,7 @@ return select_look(owner) - return 1 + return TRUE /datum/action/item_action/chameleon/change/proc/emp_randomise(var/amount = EMP_RANDOMISE_TIME) START_PROCESSING(SSprocessing, src) @@ -435,9 +435,9 @@ CHAMELEON_CLOTHING_DEFINE(/obj/item/clothing/head/chameleon) ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT) chameleon_action.random_look() var/datum/action/item_action/chameleon/drone/togglehatmask/togglehatmask_action = new(src) - togglehatmask_action.UpdateButtonIcon() + togglehatmask_action.UpdateButtons() var/datum/action/item_action/chameleon/drone/randomise/randomise_action = new(src) - randomise_action.UpdateButtonIcon() + randomise_action.UpdateButtons() CHAMELEON_CLOTHING_DEFINE(/obj/item/clothing/mask/chameleon) name = "gas mask" @@ -489,9 +489,9 @@ CHAMELEON_CLOTHING_DEFINE(/obj/item/clothing/mask/chameleon) ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT) chameleon_action.random_look() var/datum/action/item_action/chameleon/drone/togglehatmask/togglehatmask_action = new(src) - togglehatmask_action.UpdateButtonIcon() + togglehatmask_action.UpdateButtons() var/datum/action/item_action/chameleon/drone/randomise/randomise_action = new(src) - randomise_action.UpdateButtonIcon() + randomise_action.UpdateButtons() /obj/item/clothing/mask/chameleon/drone/attack_self(mob/user) to_chat(user, "[src] does not have a voice changer.") diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 878b54de38..dd7a5802c2 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -113,7 +113,7 @@ if(do_after(user, 6 SECONDS, src)) if(S.use(3)) repair(user, params) - return 1 + return TRUE return ..() // Set the clothing's integrity back to 100%, remove all damage to bodyparts, and generally fix it up @@ -402,7 +402,7 @@ BLIND // can't see anything C.head_update(src, forced = 1) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() return TRUE /obj/item/clothing/proc/visor_toggling() //handles all the actual toggling of flags @@ -420,8 +420,8 @@ BLIND // can't see anything /obj/item/clothing/proc/can_use(mob/user) if(user && ismob(user)) if(!user.incapacitated()) - return 1 - return 0 + return TRUE + return FALSE /obj/item/clothing/obj_destruction(damage_flag) diff --git a/code/modules/clothing/glasses/_glasses.dm b/code/modules/clothing/glasses/_glasses.dm index b2a7f91e96..e323b1b000 100644 --- a/code/modules/clothing/glasses/_glasses.dm +++ b/code/modules/clothing/glasses/_glasses.dm @@ -121,7 +121,7 @@ /obj/item/clothing/glasses/science/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_EYES) - return 1 + return TRUE /obj/item/clothing/glasses/night name = "night vision goggles" diff --git a/code/modules/clothing/glasses/engine_goggles.dm b/code/modules/clothing/glasses/engine_goggles.dm index 013084e38f..395eeaeaa6 100644 --- a/code/modules/clothing/glasses/engine_goggles.dm +++ b/code/modules/clothing/glasses/engine_goggles.dm @@ -62,7 +62,7 @@ update_icon() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/glasses/meson/engine/attack_self(mob/user) toggle_mode(user, TRUE) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index ff78b51909..4f370866b3 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -389,7 +389,7 @@ set_light(0) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/head/helmet/durathread name = "makeshift helmet" diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm index 0a626a0558..4ef8d8caa1 100644 --- a/code/modules/clothing/head/misc.dm +++ b/code/modules/clothing/head/misc.dm @@ -203,7 +203,7 @@ /obj/item/clothing/head/fedora/suicide_act(mob/user) if(user.gender == FEMALE) - return 0 + return FALSE var/mob/living/carbon/human/H = user user.visible_message("[user] is donning [src]! It looks like [user.p_theyre()] trying to be nice to girls.") user.say("M'lady.", forced = "fedora suicide") diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index a2d13822f8..1c9b15b398 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -115,7 +115,7 @@ user.update_inv_wear_mask() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() to_chat(user, "Your Clown Mask has now morphed into [choice], all praise the Honkmother!") return TRUE @@ -181,7 +181,7 @@ user.update_inv_wear_mask() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() to_chat(user, "Your Mime Mask has now morphed into [choice]!") return TRUE @@ -274,7 +274,7 @@ user.update_inv_wear_mask() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() to_chat(M, "The Tiki Mask has now changed into the [choice] Mask!") return TRUE diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm index f96fe2ac2a..9f837654a0 100644 --- a/code/modules/clothing/masks/miscellaneous.dm +++ b/code/modules/clothing/masks/miscellaneous.dm @@ -109,9 +109,9 @@ user.update_inv_wear_mask() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() to_chat(user, "Your Joy mask now has a [choice] Emotion!") - return 1 + return TRUE /obj/item/clothing/mask/kitsuneblk name = "Black Kitsune Mask" @@ -475,6 +475,6 @@ user.update_inv_wear_mask() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() to_chat(user, "Your paper mask now has a [choice] symbol!") - return 1 + return TRUE diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index 726b284632..00da8bf9d8 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -36,7 +36,7 @@ user.update_gravity(user.has_gravity()) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/shoes/magboots/negates_gravity() return clothing_flags & NOSLIP diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm index 5ec0fad2e6..d3b51cd444 100644 --- a/code/modules/clothing/spacesuits/chronosuit.dm +++ b/code/modules/clothing/spacesuits/chronosuit.dm @@ -91,7 +91,7 @@ if(camera) camera.remove_target_ui() camera.forceMove(user) - teleport_now.UpdateButtonIcon() + teleport_now.UpdateButtons() /obj/item/clothing/suit/space/chronos/proc/chronowalk(atom/location) var/mob/living/carbon/human/user = src.loc @@ -105,7 +105,7 @@ if(camera) camera.remove_target_ui() - teleport_now.UpdateButtonIcon() + teleport_now.UpdateButtons() var/list/nonsafe_slots = list(ITEM_SLOT_BELT, ITEM_SLOT_BACK) var/list/exposed = list() diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index c946002fa2..275f674a23 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -51,7 +51,7 @@ /obj/item/clothing/head/helmet/space/hardsuit/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_HEAD) - return 1 + return TRUE /obj/item/clothing/head/helmet/space/hardsuit/equipped(mob/user, slot) ..() @@ -159,7 +159,7 @@ /obj/item/clothing/suit/space/hardsuit/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_OCLOTHING) //we only give the mob the ability to toggle the helmet if he's wearing the hardsuit. - return 1 + return TRUE //Engineering /obj/item/clothing/head/helmet/space/hardsuit/engine @@ -345,7 +345,7 @@ C.head_update(src, forced = 1) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/head/helmet/space/hardsuit/syndi/proc/toggle_hardsuit_mode(mob/user) //Helmet Toggles Suit Mode if(linkedsuit) @@ -937,7 +937,7 @@ set_light(0) for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/head/helmet/space/hardsuit/lavaknight/update_overlays() . = ..() diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm index 2f2c861b6b..3804cc5ae7 100644 --- a/code/modules/clothing/suits/reactive_armour.dm +++ b/code/modules/clothing/suits/reactive_armour.dm @@ -213,7 +213,7 @@ if(prob(hit_reaction_chance)) if(world.time < reactivearmor_cooldown) owner.visible_message("The repulse generator is still recharging!") - return 0 + return FALSE playsound(get_turf(owner),'sound/magic/repulse.ogg', 100, 1) owner.visible_message("[src] blocks [attack_text], converting the attack into a wave of force!") var/turf/T = get_turf(owner) diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm index 25cbf27cf6..9fc51b8287 100644 --- a/code/modules/clothing/suits/toggles.dm +++ b/code/modules/clothing/suits/toggles.dm @@ -32,7 +32,7 @@ /obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user, datum/action/A) if(slot == ITEM_SLOT_OCLOTHING || slot == ITEM_SLOT_NECK) - return 1 + return TRUE /obj/item/clothing/suit/hooded/equipped(mob/user, slot) if(slot != ITEM_SLOT_OCLOTHING && slot != ITEM_SLOT_NECK) @@ -127,7 +127,7 @@ set src in usr if(!can_use(usr)) - return 0 + return FALSE on_toggle(usr) if(src.suittoggled) @@ -139,7 +139,7 @@ usr.update_inv_wear_suit() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/clothing/suit/toggle/examine(mob/user) . = ..() diff --git a/code/modules/clothing/suits/wiz_robe.dm b/code/modules/clothing/suits/wiz_robe.dm index 0d8aa60ba5..e5ad047931 100644 --- a/code/modules/clothing/suits/wiz_robe.dm +++ b/code/modules/clothing/suits/wiz_robe.dm @@ -315,7 +315,7 @@ /obj/item/clothing/suit/space/hardsuit/shielded/wizard/ComponentInitialize() . = ..() - AddElement(/datum/element/spellcasting, SPELL_WIZARD_HAT, ITEM_SLOT_HEAD) + AddElement(/datum/element/spellcasting, SPELL_WIZARD_ROBE, ITEM_SLOT_OCLOTHING) /obj/item/clothing/head/helmet/space/hardsuit/shielded/wizard name = "battlemage helmet" @@ -330,7 +330,7 @@ /obj/item/clothing/head/helmet/space/hardsuit/shielded/wizard/ComponentInitialize() . = ..() - AddElement(/datum/element/spellcasting, SPELL_WIZARD_ROBE, ITEM_SLOT_OCLOTHING) + AddElement(/datum/element/spellcasting, SPELL_WIZARD_HAT, ITEM_SLOT_HEAD) /obj/item/clothing/head/helmet/space/hardsuit/shielded/wizard/attack_self(mob/user) return diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index fc4cee1bed..776d2c4a53 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -37,14 +37,14 @@ if((sensordamage || (has_sensor < HAS_SENSORS && has_sensor != NO_SENSORS)) && istype(I, /obj/item/stack/cable_coil)) if(damaged_clothes == CLOTHING_SHREDDED) to_chat(user,"[src] is too damaged to have its suit sensors repaired! Repair it first.") - return 0 + return FALSE var/obj/item/stack/cable_coil/C = I I.use_tool(src, user, 0, 1) has_sensor = HAS_SENSORS sensordamage = 0 sensor_mode = sensor_mode_intended to_chat(user,"You repair the suit sensors on [src] with [C].") - return 1 + return TRUE if(!attach_accessory(I, user)) return ..() @@ -233,13 +233,13 @@ return if(src.has_sensor == BROKEN_SENSORS) to_chat(usr, "The sensors have shorted out!") - return 0 + return FALSE if(src.sensor_flags & SENSOR_LOCKED) to_chat(usr, "The controls are locked.") - return 0 + return FALSE if(src.has_sensor <= NO_SENSORS) to_chat(usr, "This suit does not have any sensors.") - return 0 + return FALSE var/list/modes = list("Off", "Binary vitals", "Exact vitals", "Tracking beacon") var/switchMode = input("Select a sensor mode:", "Suit Sensor Mode", modes[sensor_mode + 1]) in modes @@ -292,10 +292,10 @@ if(src.has_sensor == BROKEN_SENSORS) to_chat(usr, "The sensors have shorted out!") - return 0 + return FALSE if(src.sensor_flags & SENSOR_LOCKED) to_chat(usr, "The controls are locked.") - return 0 + return FALSE if(has_sensor <= NO_SENSORS) to_chat(user, "This suit does not have any sensors.") return diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm index 2071dd6930..1f9c8fd2bd 100644 --- a/code/modules/clothing/under/miscellaneous.dm +++ b/code/modules/clothing/under/miscellaneous.dm @@ -141,7 +141,7 @@ H.visible_message("[H]'s suit automatically extinguishes [H.p_them()]!","Your suit automatically extinguishes you.") H.ExtinguishMob() new /obj/effect/particle_effect/water(get_turf(H)) - return 0 + return FALSE /obj/item/clothing/under/plasmaman/attackby(obj/item/E, mob/user, params) ..() diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index a9bedb3c57..bfc291c970 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -29,7 +29,7 @@ other_half.icon_state = "cracker2" target.put_in_active_hand(other_half) playsound(user, 'sound/effects/snap.ogg', 50, 1) - return 1 + return TRUE return ..() /obj/item/clothing/head/festive diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm index a48191e8a1..525b49ba6a 100644 --- a/code/modules/events/immovable_rod.dm +++ b/code/modules/events/immovable_rod.dm @@ -101,7 +101,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 walk_towards(src, destination, 1) /obj/effect/immovablerod/ex_act(severity, target, origin) - return 0 + return FALSE /obj/effect/immovablerod/singularity_act() return diff --git a/code/modules/events/pirates.dm b/code/modules/events/pirates.dm index 1b1fdee584..2f81b2d671 100644 --- a/code/modules/events/pirates.dm +++ b/code/modules/events/pirates.dm @@ -458,9 +458,9 @@ /datum/export/pirate/ransom/get_cost(atom/movable/AM) var/mob/living/carbon/human/H = AM if(H.stat != CONSCIOUS || !H.mind || !H.mind.assigned_role) //mint condition only - return 0 + return FALSE else if("pirate" in H.faction) //can't ransom your fellow pirates to CentCom! - return 0 + return FALSE else if(H.mind.assigned_role in GLOB.command_positions) return 3000 diff --git a/code/modules/events/portal_storm.dm b/code/modules/events/portal_storm.dm index b1b68fb585..49e60893f3 100644 --- a/code/modules/events/portal_storm.dm +++ b/code/modules/events/portal_storm.dm @@ -108,16 +108,16 @@ /datum/round_event/portal_storm/proc/spawn_hostile() if(!hostile_types || !hostile_types.len) - return 0 + return FALSE return ISMULTIPLE(activeFor, 2) /datum/round_event/portal_storm/proc/spawn_boss() if(!boss_types || !boss_types.len) - return 0 + return FALSE if(activeFor == next_boss_spawn) next_boss_spawn += CEILING(number_of_hostiles / number_of_bosses, 1) - return 1 + return TRUE /datum/round_event/portal_storm/proc/time_to_end() if(!hostile_types.len && !boss_types.len) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 1bbcb0dd92..44703a3b24 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -124,7 +124,7 @@ quality = MINOR_NEGATIVE /datum/spacevine_mutation/fire_proof/process_temperature(obj/structure/spacevine/holder, temp, volume) - return 1 + return TRUE /datum/spacevine_mutation/fire_proof/on_hit(obj/structure/spacevine/holder, mob/hitter, obj/item/I, expected_damage) if(I && I.damtype == "fire") diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index 1864ad6d20..50b133e0d3 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -13,7 +13,7 @@ if(!ishuman(M)) holder_canadates -= M if(!holder_canadates) //Very unlikely, but just in case - return 0 + return FALSE var/mob/living/carbon/human/H = pick(holder_canadates) new /obj/item/greentext(H.loc) diff --git a/code/modules/food_and_drinks/drinks/drinks.dm b/code/modules/food_and_drinks/drinks/drinks.dm index f4185ccf77..9a62b2a822 100644 --- a/code/modules/food_and_drinks/drinks/drinks.dm +++ b/code/modules/food_and_drinks/drinks/drinks.dm @@ -22,14 +22,14 @@ /obj/item/reagent_containers/food/drinks/attack(mob/living/M, mob/user, def_zone) if(!reagents || !reagents.total_volume) to_chat(user, "[src] is empty!") - return 0 + return FALSE if(!canconsume(M, user)) - return 0 + return FALSE if (!is_drainable()) to_chat(user, "[src]'s lid hasn't been opened!") - return 0 + return FALSE if(M == user) user.visible_message("[user] swallows a gulp of [src].", "You swallow a gulp of [src].") @@ -47,7 +47,7 @@ reagents.reaction(M, INGEST, fraction) reagents.trans_to(M, gulp_size, log = TRUE) playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) - return 1 + return TRUE /obj/item/reagent_containers/food/drinks/CheckAttackCooldown(mob/user, atom/target) var/fast = HAS_TRAIT(user, TRAIT_VORACIOUS) && (user == target) diff --git a/code/modules/food_and_drinks/food/condiment.dm b/code/modules/food_and_drinks/food/condiment.dm index dca12aa4f8..0b55d856f6 100644 --- a/code/modules/food_and_drinks/food/condiment.dm +++ b/code/modules/food_and_drinks/food/condiment.dm @@ -37,10 +37,10 @@ if(!reagents || !reagents.total_volume) to_chat(user, "None of [src] left, oh no!") - return 0 + return FALSE if(!canconsume(M, user)) - return 0 + return FALSE if(M == user) user.visible_message("[user] swallows some of contents of \the [src].", "You swallow some of contents of \the [src].") @@ -57,7 +57,7 @@ reagents.reaction(M, INGEST, fraction) reagents.trans_to(M, 10, log = TRUE) playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1) - return 1 + return TRUE /obj/item/reagent_containers/food/condiment/afterattack(obj/target, mob/user , proximity) . = ..() diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index cb1ed628c4..8f8f48412f 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -108,10 +108,10 @@ All foods are distributed among various categories. Use common sense. if(!reagents.total_volume) //Shouldn't be needed but it checks to see if it has anything left in it. to_chat(user, "None of [src] left, oh no!") qdel(src) - return 0 + return FALSE if(iscarbon(M)) if(!canconsume(M, user)) - return 0 + return FALSE var/fullness = M.nutrition + 10 for(var/datum/reagent/consumable/C in M.reagents.reagent_list) //we add the nutrition value of what we're currently digesting @@ -120,7 +120,7 @@ All foods are distributed among various categories. Use common sense. if(M == user) //If you're eating it yourself. if(junkiness && M.satiety < -150 && M.nutrition > NUTRITION_LEVEL_STARVING + 50 ) to_chat(M, "You don't feel like eating any more junk food at the moment.") - return 0 + return FALSE else if(fullness <= 50) user.visible_message("[user] hungrily takes a [eatverb] from \the [src], gobbling it down!", "You hungrily take a [eatverb] from \the [src], gobbling it down!") else if(fullness > 50 && fullness < 150) @@ -131,7 +131,7 @@ All foods are distributed among various categories. Use common sense. user.visible_message("[user] unwillingly takes a [eatverb] of a bit of \the [src].", "You unwillingly take a [eatverb] of a bit of \the [src].") else if(fullness > (600 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat user.visible_message("[user] cannot force any more of \the [src] to go down [user.p_their()] throat!", "You cannot force any more of \the [src] to go down your throat!") - return 0 + return FALSE else if(!isbrain(M)) //If you're feeding it to someone else. if(fullness <= (600 * (1 + M.overeatduration / 1000))) @@ -140,7 +140,7 @@ All foods are distributed among various categories. Use common sense. else M.visible_message("[user] cannot force any more of [src] down [M]'s throat!", \ "[user] cannot force any more of [src] down [M]'s throat!") - return 0 + return FALSE if(!do_mob(user, M)) return @@ -164,9 +164,9 @@ All foods are distributed among various categories. Use common sense. bitecount++ On_Consume(M) checkLiked(fraction, M) - return 1 + return TRUE - return 0 + return FALSE /obj/item/reagent_containers/food/snacks/CheckAttackCooldown(mob/user, atom/target) var/fast = HAS_TRAIT(user, TRAIT_VORACIOUS) && (user == target) @@ -193,26 +193,26 @@ All foods are distributed among various categories. Use common sense. /obj/item/reagent_containers/food/snacks/attackby(obj/item/W, mob/user, params) if(istype(W, /obj/item/storage)) ..() // -> item/attackby() - return 0 + return FALSE if(istype(W, /obj/item/reagent_containers/food/snacks)) var/obj/item/reagent_containers/food/snacks/S = W if(custom_food_type && ispath(custom_food_type)) if(S.w_class > WEIGHT_CLASS_SMALL) to_chat(user, "[S] is too big for [src]!") - return 0 + return FALSE if(!S.customfoodfilling || istype(W, /obj/item/reagent_containers/food/snacks/customizable) || istype(W, /obj/item/reagent_containers/food/snacks/pizzaslice/custom) || istype(W, /obj/item/reagent_containers/food/snacks/cakeslice/custom)) to_chat(user, "[src] can't be filled with [S]!") - return 0 + return FALSE if(contents.len >= 20) to_chat(user, "You can't add more ingredients to [src]!") - return 0 + return FALSE var/obj/item/reagent_containers/food/snacks/customizable/C = new custom_food_type(get_turf(src)) C.initialize_custom_food(src, S, user) - return 0 + return FALSE var/sharp = W.get_sharpness() if(sharp) if(slice(sharp, W, user)) - return 1 + return TRUE else ..() @@ -377,20 +377,20 @@ All foods are distributed among various categories. Use common sense. ..() if(W.w_class <= WEIGHT_CLASS_SMALL & !istype(W, /obj/item/reagent_containers/food/snacks)) //can't slip snacks inside, they're used for custom foods. if(W.get_sharpness()) - return 0 + return FALSE if(stored_item) - return 0 + return FALSE if(!iscarbon(user)) - return 0 + return FALSE if(contents.len >= 20) to_chat(user, "[src] is full.") - return 0 + return FALSE to_chat(user, "You slip [W] inside [src].") user.transferItemToLoc(W, src) add_fingerprint(user) contents += W stored_item = 1 - return 1 // no afterattack here + return TRUE // no afterattack here /obj/item/reagent_containers/food/snacks/MouseDrop(atom/over) var/turf/T = get_turf(src) diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index 9f36fc058f..964b932453 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -141,7 +141,7 @@ to_chat(user, "There is not enough ice cream left!") else to_chat(user, "[O] already has ice cream in it.") - return 1 + return TRUE if(istype(O, /obj/item/reagent_containers) && !(O.item_flags & ABSTRACT) && O.is_open_container()) . = TRUE //no afterattack var/obj/item/reagent_containers/B = O diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index ef2676fe83..6cd3a5d161 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -82,11 +82,11 @@ user.visible_message("[user] put [O] into [src].", \ "You put [O] into [src].") user.transferItemToLoc(O, src, TRUE) - return 1 + return TRUE else if(user.a_intent != INTENT_HARM) to_chat(user, "That probably won't blend!") - return 1 + return TRUE else return ..() diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index 4c199a9901..e7f33b9ad5 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -26,7 +26,7 @@ var/i = findtext(name," ") return copytext(name, 1, i) -// Return 1 if this holiday should be celebrated today +// return TRUE if this holiday should be celebrated today /datum/holiday/proc/shouldCelebrate(dd, mm, yy, ww, ddd) if(always_celebrate) return TRUE @@ -319,11 +319,11 @@ if(mm == 9) if(yy/4 == round(yy/4)) //Note: Won't work right on September 12th, 2200 (at least it's a Friday!) if(dd == 12) - return 1 + return TRUE else if(dd == 13) - return 1 - return 0 + return TRUE + return FALSE /datum/holiday/programmers/getStationPrefix() return pick("span>","DEBUG: ","null","/list","EVENT PREFIX NOT FOUND") //Portability diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm index d69b9da768..167974a193 100644 --- a/code/modules/holodeck/area_copy.dm +++ b/code/modules/holodeck/area_copy.dm @@ -56,7 +56,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list( // into the new area will not be moved. if(!A || !src) - return 0 + return FALSE var/list/turfs_src = get_area_turfs(src.type) var/list/turfs_trg = get_area_turfs(A.type) diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 28e537acbc..564c7e44a4 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -8,22 +8,22 @@ /mob/proc/bee_friendly() - return 0 + return FALSE /mob/living/simple_animal/hostile/poison/bees/bee_friendly() - return 1 + return TRUE /mob/living/carbon/human/bee_friendly() if(dna && dna.species && dna.species.id == "pod") //bees pollinate plants, duh. - return 1 + return TRUE if (wear_suit && head && istype(wear_suit, /obj/item/clothing) && istype(head, /obj/item/clothing)) var/obj/item/clothing/CS = wear_suit var/obj/item/clothing/CH = head if (CS.clothing_flags & CH.clothing_flags & THICKMATERIAL) - return 1 - return 0 + return TRUE + return FALSE /obj/structure/beebox diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 65d942ca2b..a338dd8db7 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -53,8 +53,8 @@ if(reagents) if(bitesize_mod) bitesize = 1 + round(reagents.total_volume / bitesize_mod) - return 1 - return 0 + return TRUE + return FALSE /obj/item/reagent_containers/food/snacks/grown/examine(user) . = ..() diff --git a/code/modules/hydroponics/grown/cereals.dm b/code/modules/hydroponics/grown/cereals.dm index 9bfdb2979c..06c1aaf2eb 100644 --- a/code/modules/hydroponics/grown/cereals.dm +++ b/code/modules/hydroponics/grown/cereals.dm @@ -105,4 +105,4 @@ var/obj/item/reagent_containers/food/snacks/meat/slab/meatwheat/M = new qdel(src) user.put_in_hands(M) - return 1 + return TRUE diff --git a/code/modules/hydroponics/growninedible.dm b/code/modules/hydroponics/growninedible.dm index 3c59deafdc..60e18a2894 100644 --- a/code/modules/hydroponics/growninedible.dm +++ b/code/modules/hydroponics/growninedible.dm @@ -45,8 +45,8 @@ /obj/item/grown/proc/add_juice() if(reagents) - return 1 - return 0 + return TRUE + return FALSE /obj/item/grown/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) if(!..()) //was it caught by a mob? diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 839e90c2df..fe688426dc 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -475,7 +475,7 @@ if(!reagent_source.reagents.total_volume) to_chat(user, "[reagent_source] is empty.") - return 1 + return TRUE if(reagents.total_volume >= reagents.maximum_volume && !reagent_source.reagents.has_reagent(/datum/reagent/water, 1)) to_chat(user, "[src] is full.") @@ -520,11 +520,11 @@ qdel(reagent_source) lastuser = user H.update_icon() - return 1 + return TRUE H.update_icon() if(reagent_source) // If the source wasn't composted and destroyed reagent_source.update_icon() - return 1 + return TRUE else if(istype(O, /obj/item/seeds) && !istype(O, /obj/item/seeds/sample)) if(!myseed) diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index e0e15ac111..ecdc466a0c 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -49,9 +49,9 @@ t_prod.forceMove(seedloc) t_amount++ qdel(O) - return 1 + return TRUE - return 0 + return FALSE /obj/machinery/seed_extractor diff --git a/code/modules/integrated_electronics/core/assemblies.dm b/code/modules/integrated_electronics/core/assemblies.dm index 4b6f76574f..174194a425 100644 --- a/code/modules/integrated_electronics/core/assemblies.dm +++ b/code/modules/integrated_electronics/core/assemblies.dm @@ -202,7 +202,7 @@ /obj/item/electronic_assembly/Topic(href, href_list) if(..()) - return 1 + return TRUE if(href_list["ghostscan"]) if((isobserver(usr) && ckeys_allowed_to_scan[usr.ckey]) || IsAdminGhost(usr)) diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index 547036f08a..ad8ef4ab21 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -697,11 +697,11 @@ if(isnum(new_code)) code = new_code if(!signal) - return 0 + return FALSE if(signal.data["code"] != code) - return 0 + return FALSE if(signal.source == src) // Don't trigger ourselves. - return 0 + return FALSE activate_pin(3) audible_message("[icon2html(src, hearers(src))] *beep* *beep* *beep*", null, hearing_range) diff --git a/code/modules/integrated_electronics/subtypes/weaponized.dm b/code/modules/integrated_electronics/subtypes/weaponized.dm index 0458700f44..a576ae123e 100644 --- a/code/modules/integrated_electronics/subtypes/weaponized.dm +++ b/code/modules/integrated_electronics/subtypes/weaponized.dm @@ -339,7 +339,7 @@ /obj/item/integrated_circuit/weaponized/proc/attempt_stun(var/mob/living/L,var/stunforce = 70) //Copied from stunbaton code. if(!L || !isliving(L)) - return 0 + return FALSE L.DefaultCombatKnockdown(stunforce) SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK) @@ -352,4 +352,4 @@ var/mob/living/carbon/human/H = L H.forcesay(GLOB.hit_appends) - return 1 + return TRUE diff --git a/code/modules/jobs/job_exp.dm b/code/modules/jobs/job_exp.dm index d9b98eea0a..8245563b7f 100644 --- a/code/modules/jobs/job_exp.dm +++ b/code/modules/jobs/job_exp.dm @@ -4,24 +4,24 @@ GLOBAL_PROTECT(exp_to_update) // Procs /datum/job/proc/required_playtime_remaining(client/C) if(!C) - return 0 + return FALSE if(!CONFIG_GET(flag/use_exp_tracking)) - return 0 + return FALSE if(!SSdbcore.Connect()) - return 0 + return FALSE if(!exp_requirements || !exp_type) - return 0 + return FALSE if(!job_is_xp_locked(src.title)) - return 0 + return FALSE if(CONFIG_GET(flag/use_exp_restrictions_admin_bypass) && check_rights_for(C,R_ADMIN)) - return 0 + return FALSE var/isexempt = C.prefs.db_flags & DB_FLAG_EXEMPT if(isexempt) - return 0 + return FALSE var/my_exp = C.calc_exp_type(get_exp_req_type()) var/job_requirement = get_exp_req_amount() if(my_exp >= job_requirement) - return 0 + return FALSE else return (job_requirement - my_exp) diff --git a/code/modules/jobs/job_types/_job.dm b/code/modules/jobs/job_types/_job.dm index 9a05f97cc7..a2752d33f0 100644 --- a/code/modules/jobs/job_types/_job.dm +++ b/code/modules/jobs/job_types/_job.dm @@ -210,15 +210,15 @@ /datum/job/proc/available_in_days(client/C) if(!C) - return 0 + return FALSE if(!CONFIG_GET(flag/use_age_restriction_for_jobs)) - return 0 + return FALSE if(!SSdbcore.Connect()) - return 0 //Without a database connection we can't get a player's age so we'll assume they're old enough for all jobs + return FALSE //Without a database connection we can't get a player's age so we'll assume they're old enough for all jobs if(C.prefs.db_flags & DB_FLAG_EXEMPT) - return 0 + return FALSE if(!isnum(minimal_player_age)) - return 0 + return FALSE return max(0, minimal_player_age - C.player_age) diff --git a/code/modules/keybindings/keybind/mob.dm b/code/modules/keybindings/keybind/mob.dm index 15911d831e..1599073154 100644 --- a/code/modules/keybindings/keybind/mob.dm +++ b/code/modules/keybindings/keybind/mob.dm @@ -85,6 +85,6 @@ description = "Immediately examine anything you're hovering your mouse over." /datum/keybinding/mob/examine_immediate/down(client/user) - var/atom/A = user.mouseObject + var/atom/A = user.mouse_object_ref?.resolve() if(A) A.attempt_examinate(user.mob) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 4f73b037c8..bd488230c4 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -574,7 +574,7 @@ if(istype(O, /obj/item/paper)) bind_book(user, O) else if(default_unfasten_wrench(user, O)) - return 1 + return TRUE else return ..() diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm index bd6bfdd177..8c1fbfcd56 100644 --- a/code/modules/lighting/lighting_object.dm +++ b/code/modules/lighting/lighting_object.dm @@ -125,7 +125,7 @@ // Variety of overrides so the overlays don't get affected by weird things. /atom/movable/lighting_object/ex_act(severity, target, origin) - return 0 + return FALSE /atom/movable/lighting_object/singularity_act() return diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index fc9cd0336d..f148fc441e 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -62,7 +62,7 @@ // Used to get a scaled lumcount. /turf/proc/get_lumcount(var/minlum = 0, var/maxlum = 1) if(!lighting_object) - return 1 + return TRUE var/totallums = (lc_topright? (lc_topright.lum_r + lc_topright.lum_g + lc_topright.lum_b) : 0) \ + (lc_bottomright? (lc_bottomright.lum_r + lc_bottomright.lum_g + lc_bottomright.lum_b) : 0) \ diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 18f816699c..13744aa100 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -179,13 +179,13 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) if(isliving(A)) var/mob/living/L = A if(L.stat != DEAD) - return 1 + return TRUE for(var/thing in A.GetAllContents()) if(isliving(A)) var/mob/living/L = A if(L.stat != DEAD) - return 1 - return 0 + return TRUE + return FALSE /obj/effect/extraction_holder/singularity_pull() return diff --git a/code/modules/mining/lavaland/ash_flora.dm b/code/modules/mining/lavaland/ash_flora.dm index b9ab6463c7..398e070bb2 100644 --- a/code/modules/mining/lavaland/ash_flora.dm +++ b/code/modules/mining/lavaland/ash_flora.dm @@ -27,7 +27,7 @@ /obj/structure/flora/ash/proc/harvest(user) if(harvested) - return 0 + return FALSE var/rand_harvested = rand(harvest_amount_low, harvest_amount_high) if(rand_harvested) @@ -46,7 +46,7 @@ desc = harvested_desc harvested = TRUE addtimer(CALLBACK(src, .proc/regrow), rand(regrowth_time_low, regrowth_time_high)) - return 1 + return TRUE /obj/structure/flora/ash/proc/regrow() icon_state = base_icon diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index b627d4cb69..514dab55f3 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -169,10 +169,10 @@ /mob/dead/new_player/Topic(href, href_list[]) if(src != usr) - return 0 + return FALSE if(!client) - return 0 + return FALSE //don't let people get to this unless they are specifically not verified if(href_list["Month"] && (CONFIG_GET(flag/age_verification) && !check_rights_for(client, R_ADMIN) && !(client.ckey in GLOB.bunker_passthrough))) @@ -727,7 +727,7 @@ src << browse(dat, "window=manifest;size=387x420;can_close=1") /mob/dead/new_player/Move() - return 0 + return FALSE /mob/dead/new_player/proc/close_spawn_windows() diff --git a/code/modules/mob/dead/new_player/poll.dm b/code/modules/mob/dead/new_player/poll.dm index 9b6e22bc23..6e26b0eb2c 100644 --- a/code/modules/mob/dead/new_player/poll.dm +++ b/code/modules/mob/dead/new_player/poll.dm @@ -461,7 +461,7 @@ return pollid = text2num(pollid) if (!pollid || pollid < 0) - return 0 + return FALSE //validate the poll is actually the right type of poll and its still active var/datum/db_query/query_validate_poll = SSdbcore.NewQuery({" SELECT id @@ -473,12 +473,12 @@ )) if(!query_validate_poll.warn_execute()) qdel(query_validate_poll) - return 0 + return FALSE if (!query_validate_poll.NextRow()) qdel(query_validate_poll) - return 0 + return FALSE qdel(query_validate_poll) - return 1 + return TRUE /** * Processes vote form data and saves results to the database for an IRV type poll. @@ -501,7 +501,7 @@ if(!QDELETED(client) && client.holder) admin_rank = client.holder.rank.name if (!vote_valid_check(pollid, client?.holder, POLLTYPE_IRV)) - return 0 + return FALSE var/list/special_columns = list( "datetime" = "NOW()", @@ -544,7 +544,7 @@ return //validate the poll if (!vote_valid_check(pollid, client.holder, POLLTYPE_OPTION)) - return 0 + return FALSE var/voted = poll_check_voted(pollid) if(isnull(voted) || voted) //Failed or already voted. return @@ -567,7 +567,7 @@ qdel(query_option_vote) if(!QDELETED(usr)) usr << browse(null,"window=playerpoll") - return 1 + return TRUE /mob/dead/new_player/proc/log_text_poll_reply(pollid, replytext) if(!SSdbcore.Connect()) @@ -581,7 +581,7 @@ return //validate the poll if (!vote_valid_check(pollid, client.holder, POLLTYPE_TEXT)) - return 0 + return FALSE if(!replytext) to_chat(usr, "The text you entered was blank. Please correct the text and submit again.") return @@ -611,7 +611,7 @@ qdel(query_text_vote) if(!QDELETED(usr)) usr << browse(null,"window=playerpoll") - return 1 + return TRUE /mob/dead/new_player/proc/vote_on_numval_poll(pollid, optionid, rating) if(!SSdbcore.Connect()) @@ -625,7 +625,7 @@ return //validate the poll if (!vote_valid_check(pollid, client.holder, POLLTYPE_RATING)) - return 0 + return FALSE var/datum/db_query/query_numval_hasvoted = SSdbcore.NewQuery({" SELECT id FROM [format_table_name("poll_vote")] @@ -655,7 +655,7 @@ qdel(query_numval_vote) if(!QDELETED(usr)) usr << browse(null,"window=playerpoll") - return 1 + return TRUE /** * Processes vote form data and saves results to the database for a multiple choice type poll. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index ec6657a956..4ca574cc1b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -233,7 +233,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/g_val var/color_format = length(input_color) if(color_format != length_char(input_color)) - return 0 + return FALSE if(color_format == 3) r_val = hex2num(copytext(input_color, 1, 2)) * 16 g_val = hex2num(copytext(input_color, 2, 3)) * 16 @@ -243,7 +243,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) g_val = hex2num(copytext(input_color, 3, 5)) b_val = hex2num(copytext(input_color, 5, 7)) else - return 0 //If the color format is not 3 or 6, you're using an unexpected way to represent a color. + return FALSE //If the color format is not 3 or 6, you're using an unexpected way to represent a color. r_val += (255 - r_val) * 0.4 if(r_val > 255) @@ -693,32 +693,32 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in possessible if(!target) - return 0 + return FALSE if(ismegafauna(target)) to_chat(src, "This creature is too powerful for you to possess!") - return 0 + return FALSE if(can_reenter_corpse && mind && mind.current) if(alert(src, "Your soul is still tied to your former life as [mind.current.name], if you go forward there is no going back to that life. Are you sure you wish to continue?", "Move On", "Yes", "No") == "No") - return 0 + return FALSE if(target.key) to_chat(src, "Someone has taken this body while you were choosing!") - return 0 + return FALSE transfer_ckey(target, FALSE) target.AddElement(/datum/element/ghost_role_eligibility, penalize_on_ghost = FALSE, free_ghosting = TRUE) target.faction = list("neutral") - return 1 + return TRUE //this is a mob verb instead of atom for performance reasons //see /mob/verb/examinate() in mob.dm for more info //overridden here and in /mob/living for different point span classes and sanity checks /mob/dead/observer/pointed(atom/A as mob|obj|turf in fov_view()) if(!..()) - return 0 + return FALSE usr.visible_message("[src] points to [A].") - return 1 + return TRUE /mob/dead/observer/verb/view_manifest() set name = "View Crew Manifest" @@ -839,7 +839,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return IsAdminGhost(usr) /mob/dead/observer/is_literate() - return 1 + return TRUE /mob/dead/observer/vv_edit_var(var_name, var_value) . = ..() @@ -947,7 +947,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp // Ghosts have no momentum, being massless ectoplasm /mob/dead/observer/Process_Spacemove(movement_dir) - return 1 + return TRUE /mob/dead/observer/vv_edit_var(var_name, var_value) . = ..() diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 79a0ccda77..0f90e27cec 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -379,7 +379,7 @@ //returns 0 if it cannot, 1 if successful /mob/proc/equip_to_appropriate_slot(obj/item/W, clothing_check = FALSE) if(!istype(W)) - return 0 + return FALSE var/slot_priority = W.slot_equipment_priority if(!slot_priority) @@ -396,9 +396,9 @@ for(var/slot in slot_priority) if(equip_to_slot_if_possible(W, slot, FALSE, TRUE, TRUE, FALSE, clothing_check)) //qdel_on_fail = 0; disable_warning = 1; redraw_mob = 1 - return 1 + return TRUE - return 0 + return FALSE /** * Used to return a list of equipped items on a mob; does not include held items (use get_all_gear) diff --git a/code/modules/mob/living/bloodcrawl.dm b/code/modules/mob/living/bloodcrawl.dm index 6f2f7094e6..f13219cc25 100644 --- a/code/modules/mob/living/bloodcrawl.dm +++ b/code/modules/mob/living/bloodcrawl.dm @@ -33,7 +33,7 @@ //entry when holding them // literally only an option for carbons though to_chat(C, "You may not hold items while blood crawling!") - return 0 + return FALSE var/obj/item/bloodcrawl/B1 = new(C) var/obj/item/bloodcrawl/B2 = new(C) B1.icon_state = "bloodhand_left" @@ -45,7 +45,7 @@ spawn(0) bloodpool_sink(B) src.mob_transforming = FALSE - return 1 + return TRUE /mob/living/proc/bloodpool_sink(obj/effect/decal/cleanable/B) var/turf/mobloc = get_turf(src.loc) @@ -89,7 +89,7 @@ var/success = bloodcrawl_consume(victim) if(!success) to_chat(src, "You happily devour... nothing? Your meal vanished at some point!") - return 1 + return TRUE /mob/living/proc/bloodcrawl_consume(mob/living/victim) to_chat(src, "You begin to feast on [victim]. You can not move while you are doing this.") @@ -161,7 +161,7 @@ /mob/living/proc/phasein(obj/effect/decal/cleanable/B) if(src.mob_transforming) to_chat(src, "Finish eating first!") - return 0 + return FALSE B.visible_message("[B] starts to bubble...") if(!do_after(src, 20, target = B)) return @@ -178,4 +178,4 @@ qdel(BC) qdel(src.holder) src.holder = null - return 1 + return TRUE diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index ca9edead48..a6a74fe4de 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -64,7 +64,7 @@ /mob/living/brain/can_be_revived() . = 1 if(!container || health <= HEALTH_THRESHOLD_DEAD) - return 0 + return FALSE /mob/living/brain/fully_replace_character_name(oldname,newname) ..() diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 1b7207d7eb..df9876d7a1 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -93,7 +93,7 @@ clear_alert("alien_fire") /mob/living/carbon/alien/reagent_check(datum/reagent/R) //can metabolize all reagents - return 0 + return FALSE /mob/living/carbon/alien/IsAdvancedToolUser() return has_fine_manipulation @@ -136,7 +136,7 @@ Des: Removes all infected images from the alien. return /mob/living/carbon/alien/canBeHandcuffed() - return 1 + return TRUE /mob/living/carbon/alien/get_standard_pixel_y_offset(lying = 0) return initial(pixel_y) diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 5081fd8a14..7e38c26c8c 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -123,7 +123,7 @@ In all, this is a lot like the monkey code. /N adjustEarDamage(15,60) /mob/living/carbon/alien/soundbang_act(intensity = 1, stun_pwr = 20, damage_pwr = 5, deafen_pwr = 15) - return 0 + return FALSE /mob/living/carbon/alien/acid_act(acidpwr, acid_volume) return 0//aliens are immune to acid. diff --git a/code/modules/mob/living/carbon/alien/damage_procs.dm b/code/modules/mob/living/carbon/alien/damage_procs.dm index 1b16537816..8f223e88c4 100644 --- a/code/modules/mob/living/carbon/alien/damage_procs.dm +++ b/code/modules/mob/living/carbon/alien/damage_procs.dm @@ -1,6 +1,6 @@ /mob/living/carbon/alien/getToxLoss(toxins_type = TOX_OMNI) - return 0 + return FALSE /mob/living/carbon/alien/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE, toxins_type = TOX_DEFAULT) //alien immune to tox damage return FALSE diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index a5ea6e1c89..ee8c27d1da 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -32,7 +32,7 @@ Doesn't work on other aliens/AI.*/ return /obj/effect/proc_holder/alien/fire(mob/living/carbon/user) - return 1 + return TRUE /obj/effect/proc_holder/alien/get_panel_text() . = ..() @@ -72,10 +72,10 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/plant/fire(mob/living/carbon/user) if(locate(/obj/structure/alien/weeds/node) in get_turf(user)) to_chat(user, "There's already a weed node here.") - return 0 + return FALSE user.visible_message("[user] has planted some alien weeds!") new/obj/structure/alien/weeds/node(user.loc) - return 1 + return TRUE /obj/effect/proc_holder/alien/whisper name = "Whisper" @@ -89,7 +89,7 @@ Doesn't work on other aliens/AI.*/ options += Ms var/mob/living/M = input("Select who to whisper to:","Whisper to?",null) as null|mob in options if(!M) - return 0 + return FALSE if(M.anti_magic_check(FALSE, FALSE, TRUE, 0)) to_chat(user, "As you try to communicate with [M], you're suddenly stopped by a vision of a massive tinfoil wall that streches beyond visible range. It seems you've been foiled.") return FALSE @@ -108,8 +108,8 @@ Doesn't work on other aliens/AI.*/ var/follow_link_whispee = FOLLOW_LINK(ded, M) to_chat(ded, "[follow_link_user] [user] Alien Whisper --> [follow_link_whispee] [M] [msg]") else - return 0 - return 1 + return FALSE + return TRUE /obj/effect/proc_holder/alien/transfer name = "Transfer Plasma" @@ -124,7 +124,7 @@ Doesn't work on other aliens/AI.*/ aliens_around.Add(A) var/mob/living/carbon/M = input("Select who to transfer to:","Transfer plasma to?",null) as mob in aliens_around if(!M) - return 0 + return FALSE var/amount = input("Amount:", "Transfer Plasma to [M]") as num if (amount) amount = min(abs(round(amount)), user.getPlasma()) @@ -153,21 +153,21 @@ Doesn't work on other aliens/AI.*/ if(target in oview(1,user)) if(target.acid_act(200, 100)) user.visible_message("[user] vomits globs of vile stuff all over [target]. It begins to sizzle and melt under the bubbling mess of acid!") - return 1 + return TRUE else to_chat(user, "You cannot dissolve this object.") - return 0 + return FALSE else to_chat(src, "[target] is too far away.") - return 0 + return FALSE /obj/effect/proc_holder/alien/acid/fire(mob/living/carbon/alien/user) var/O = input("Select what to dissolve:","Dissolve",null) as obj|turf in oview(1,user) if(!O || user.incapacitated()) - return 0 + return FALSE else return corrode(O,user) @@ -200,7 +200,7 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/neurotoxin/update_icon() action.button_icon_state = "alien_neurotoxin_[active]" - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/alien/neurotoxin/InterceptClickOn(mob/living/caller, params, atom/target) if(..()) @@ -320,21 +320,21 @@ Doesn't work on other aliens/AI.*/ /mob/living/carbon/proc/getPlasma() var/obj/item/organ/alien/plasmavessel/vessel = getorgan(/obj/item/organ/alien/plasmavessel) if(!vessel) - return 0 + return FALSE return vessel.storedPlasma /mob/living/carbon/proc/adjustPlasma(amount) var/obj/item/organ/alien/plasmavessel/vessel = getorgan(/obj/item/organ/alien/plasmavessel) if(!vessel) - return 0 + return FALSE vessel.storedPlasma = max(vessel.storedPlasma + amount,0) vessel.storedPlasma = min(vessel.storedPlasma, vessel.max_plasma) //upper limit of max_plasma, lower limit of 0 for(var/X in abilities) var/obj/effect/proc_holder/alien/APH = X if(APH.has_action) - APH.action.UpdateButtonIcon() - return 1 + APH.action.UpdateButtons() + return TRUE /mob/living/carbon/alien/adjustPlasma(amount) . = ..() @@ -343,6 +343,6 @@ Doesn't work on other aliens/AI.*/ /mob/living/carbon/proc/usePlasma(amount) if(getPlasma() >= amount) adjustPlasma(-amount) - return 1 + return TRUE - return 0 + return FALSE diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm index 3e8a5d8bdb..ff8fae2b62 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm @@ -27,18 +27,18 @@ var/obj/item/organ/alien/hivenode/node = user.getorgan(/obj/item/organ/alien/hivenode) if(!node) //Players are Murphy's Law. We may not expect there to ever be a living xeno with no hivenode, but they _WILL_ make it happen. to_chat(user, "Without the hivemind, you can't possibly hold the responsibility of leadership!") - return 0 + return FALSE if(node.recent_queen_death) to_chat(user, "Your thoughts are still too scattered to take up the position of leadership.") - return 0 + return FALSE if(!isturf(user.loc)) to_chat(user, "You can't evolve here!") - return 0 + return FALSE if(!get_alien_type(/mob/living/carbon/alien/humanoid/royal)) var/mob/living/carbon/alien/humanoid/royal/praetorian/new_xeno = new (user.loc) user.alien_evolve(new_xeno) - return 1 + return TRUE else to_chat(user, "We already have a living royal!") - return 0 + return FALSE diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm index 3e0faf44f0..183c17fa3e 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/praetorian.dm @@ -29,14 +29,14 @@ var/obj/item/organ/alien/hivenode/node = user.getorgan(/obj/item/organ/alien/hivenode) if(!node) //Just in case this particular Praetorian gets violated and kept by the RD as a replacement for Lamarr. to_chat(user, "Without the hivemind, you would be unfit to rule as queen!") - return 0 + return FALSE if(node.recent_queen_death) to_chat(user, "You are still too burdened with guilt to evolve into a queen.") - return 0 + return FALSE if(!get_alien_type(/mob/living/carbon/alien/humanoid/royal/queen)) var/mob/living/carbon/alien/humanoid/royal/queen/new_xeno = new (user.loc) user.alien_evolve(new_xeno) - return 1 + return TRUE else to_chat(user, "We already have an alive queen.") - return 0 + return FALSE diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm index 8177360d4a..c74527a1ab 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm @@ -19,7 +19,7 @@ playsound(loc, "punch", 25, 1, -1) visible_message("[user] has [hitverb] [src]!", \ "[user] has [hitverb] [src]!", null, COMBAT_MESSAGE_RANGE) - return 1 + return TRUE /mob/living/carbon/alien/humanoid/on_attack_hand(mob/living/carbon/human/M) . = ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 7e1c669e49..a5ef90f283 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -20,7 +20,7 @@ var/alt_inhands_file = 'icons/mob/alienqueen.dmi' /mob/living/carbon/alien/humanoid/royal/can_inject(mob/user, error_msg, target_zone, penetrate_thick = FALSE, bypass_immunity = FALSE) - return 0 + return FALSE /mob/living/carbon/alien/humanoid/royal/queen name = "alien queen" @@ -90,20 +90,20 @@ var/obj/item/queenpromote/prom if(get_alien_type(/mob/living/carbon/alien/humanoid/royal/praetorian/)) to_chat(user, "You already have a Praetorian!") - return 0 + return FALSE else for(prom in user) to_chat(user, "You discard [prom].") qdel(prom) - return 0 + return FALSE prom = new (user.loc) if(!user.put_in_active_hand(prom, 1)) to_chat(user, "You must empty your hands before preparing the parasite.") - return 0 + return FALSE else //Just in case telling the player only once is not enough! to_chat(user, "Use the royal parasite on one of your children to promote her to Praetorian!") - return 0 + return FALSE /obj/item/queenpromote name = "\improper royal parasite" diff --git a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm index 5832996a2c..e40bb96b62 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva_defense.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva_defense.dm @@ -30,7 +30,7 @@ "[user] has pummeled [src]!", null, COMBAT_MESSAGE_RANGE) adjustBruteLoss(5 + rand(1,9)) new /datum/forced_movement(src, get_step_away(user,src, 30), 1) - return 1 + return TRUE /mob/living/carbon/alien/larva/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect) if(!no_effect && !visual_effect_icon) diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index 7204759db5..567f52de54 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -17,7 +17,7 @@ user.layer = MOB_LAYER user.visible_message("[user] slowly peeks up from the ground...", \ "You stop hiding.") - return 1 + return TRUE /obj/effect/proc_holder/alien/larva_evolve @@ -57,7 +57,7 @@ new_xeno = new /mob/living/carbon/alien/humanoid/drone(L.loc) L.alien_evolve(new_xeno) - return 0 + return FALSE else to_chat(user, "You are not fully grown.") - return 0 + return FALSE diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index b56c897b03..f0abf405e9 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -9,7 +9,7 @@ if(!breath || (breath.total_moles() == 0)) //Aliens breathe in vaccuum - return 0 + return FALSE var/toxins_used = 0 var/tox_detect_threshold = 0.02 diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 7dedf5a739..56c1df68d8 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -97,12 +97,12 @@ /obj/item/clothing/mask/facehugger/on_found(mob/finder) if(stat == CONSCIOUS) return HasProximity(finder) - return 0 + return FALSE /obj/item/clothing/mask/facehugger/HasProximity(atom/movable/AM as mob|obj) if(CanHug(AM) && Adjacent(AM)) return Leap(AM) - return 0 + return FALSE /obj/item/clothing/mask/facehugger/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback) if(!..()) @@ -256,7 +256,7 @@ return FALSE if(ismonkey(M)) - return 1 + return TRUE var/mob/living/carbon/C = M if(ishuman(C) && !(ITEM_SLOT_MASK in C.dna.species.no_equip)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 13481655df..fba96230b1 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -227,7 +227,7 @@ . = (handcuffed || (!ignore_grab && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE)) /mob/living/carbon/proc/canBeHandcuffed() - return 0 + return FALSE /mob/living/carbon/Topic(href, href_list) ..() @@ -450,7 +450,7 @@ /mob/living/carbon/attack_ui(slot) if(!has_hand_for_held_index(active_hand_index)) - return 0 + return FALSE return ..() /mob/living/carbon/proc/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, vomit_type = VOMIT_TOXIC, harm = TRUE, force = FALSE, purge_ratio = 0.1) @@ -891,7 +891,7 @@ /mob/living/carbon/can_be_revived() . = ..() if(!getorgan(/obj/item/organ/brain) && (!mind || !mind.has_antag_datum(/datum/antagonist/changeling))) - return 0 + return FALSE /mob/living/carbon/harvest(mob/living/user) if(QDELETED(src)) diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index e70b1bcc92..a1ce8d2095 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -7,24 +7,24 @@ /mob/living/carbon/Process_Spacemove(movement_dir = 0) if(..()) - return 1 + return TRUE if(!isturf(loc)) - return 0 + return FALSE // Do we have a jetpack implant (and is it on)? var/obj/item/organ/cyberimp/chest/thrusters/T = getorganslot(ORGAN_SLOT_THRUSTERS) if(istype(T) && movement_dir && T.allow_thrust(0.01)) - return 1 + return TRUE var/obj/item/I = get_jetpack() if(istype(I, /obj/item/tank/jetpack)) var/obj/item/tank/jetpack/J = I if((movement_dir || J.stabilizers) && J.allow_thrust(0.01, src)) - return 1 + return TRUE else if(istype(I, /obj/item/mod/module/jetpack)) var/obj/item/mod/module/jetpack/J = I if((movement_dir || J.stabilizers) && J.allow_thrust()) - return 1 + return TRUE /mob/living/carbon/Moved() . = ..() diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index cd9cd5db4c..6b1b6e222e 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -13,7 +13,7 @@ /mob/living/carbon/regenerate_icons() if(mob_transforming) - return 1 + return TRUE update_inv_hands() update_inv_handcuffed() update_inv_legcuffed() diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 85c188d2ab..df0515196e 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -4,7 +4,7 @@ SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone) var/hit_percent = (100-blocked)/100 if(!forced && hit_percent <= 0) - return 0 + return FALSE var/obj/item/bodypart/BP = null if(!spread_damage) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index b8d102a2f1..410fbea279 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -478,17 +478,17 @@ return if(is_mouth_covered()) to_chat(src, "Remove your mask first!") - return 0 + return FALSE if(C.is_mouth_covered()) to_chat(src, "Remove [p_their()] mask first!") - return 0 + return FALSE if(C.cpr_time < world.time + 30) visible_message("[src] is trying to perform CPR on [C.name]!", \ "You try to perform CPR on [C.name]... Hold still!") if(!do_mob(src, C)) to_chat(src, "You fail to perform CPR on [C]!") - return 0 + return FALSE var/they_breathe = !HAS_TRAIT(C, TRAIT_NOBREATH) var/they_lung = C.getorganslot(ORGAN_SLOT_LUNGS) @@ -671,7 +671,7 @@ "You try to throw up, but there's nothing in your stomach!") if(stun) DefaultCombatKnockdown(200) - return 1 + return TRUE ..() /mob/living/carbon/human/vv_get_dropdown() diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 7525cfd216..7c0e6f4db8 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -1,6 +1,6 @@ /mob/living/carbon/human/getarmor(def_zone, type) if(HAS_TRAIT(src, TRAIT_ARMOR_BROKEN)) //trait that makes it act as if you have no armor at all, you take natural damage from all sources - return 0 + return FALSE var/armorval = 0 var/organnum = 0 @@ -22,7 +22,7 @@ /mob/living/carbon/human/proc/checkarmor(obj/item/bodypart/def_zone, d_type) if(!d_type || !def_zone) - return 0 + return FALSE var/protection = 0 var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform, back, gloves, shoes, belt, s_store, glasses, ears, wear_id, wear_neck) //Everything but pockets. Pockets are l_store and r_store. (if pockets were allowed, putting something armored, gloves or hats for example, would double up on the armor) for(var/bp in body_parts) @@ -93,7 +93,7 @@ /mob/living/carbon/human/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1) if(!I || !user) - return 0 + return FALSE var/obj/item/bodypart/affecting if(user == src) @@ -125,7 +125,7 @@ "[user] [hulk_verb_continous] you!", null, COMBAT_MESSAGE_RANGE, null, user, "You [hulk_verb_simple] [src]!") apply_damage(15, BRUTE, wound_bonus=10) - return 1 + return TRUE /mob/living/carbon/human/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) . = ..() @@ -168,7 +168,7 @@ if(..()) //successful monkey bite, this handles disease contraction. var/damage = rand(1, 3) apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, MELEE)) - return 1 + return TRUE /mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M) . = ..() @@ -183,7 +183,7 @@ visible_message("[M] has lunged at [src]!", \ "[M] has lunged at you!", target = M, \ target_message = "You have lunged at [src]!") - return 0 + return FALSE var/obj/item/bodypart/affecting = get_bodypart(ran_zone(M.zone_selected)) if(!affecting) affecting = get_bodypart(BODY_ZONE_CHEST) @@ -195,7 +195,7 @@ target_message = "You have slashed at [src]!") log_combat(M, src, "attacked") if(!dismembering_strike(M, M.zone_selected)) //Dismemberment successful - return 1 + return TRUE apply_damage(damage, BRUTE, affecting, armor_block) if(M.a_intent == INTENT_DISARM) //Always drop item in hand, if no item, get stun instead. @@ -252,7 +252,7 @@ var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful - return 1 + return TRUE var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) @@ -529,7 +529,7 @@ for(var/obj/item/I in inventory_items_to_kill) I.acid_act(acidpwr, acid_volume) - return 1 + return TRUE /mob/living/carbon/human/singularity_act() var/gain = 20 diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 2c58da29c9..8029ebdeab 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -103,11 +103,11 @@ /mob/living/carbon/human/can_track(mob/living/user) if(wear_id && istype(wear_id.GetID(), /obj/item/card/id/syndicate)) - return 0 + return FALSE if(istype(head, /obj/item/clothing/head)) var/obj/item/clothing/head/hat = head if(hat.blockTracking) - return 0 + return FALSE return ..() diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 141fbb89d7..4e9c58e1a4 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -11,14 +11,14 @@ /mob/living/carbon/human/slip(knockdown_amount, obj/O, lube) if(HAS_TRAIT(src, TRAIT_NOSLIPALL)) - return 0 + return FALSE if (!(lube & GALOSHES_DONT_HELP)) if(HAS_TRAIT(src, TRAIT_NOSLIPWATER)) - return 0 + return FALSE if(shoes && istype(shoes, /obj/item/clothing)) var/obj/item/clothing/CS = shoes if (CS.clothing_flags & NOSLIP) - return 0 + return FALSE if (lube & SLIDE_ICE) if(shoes && istype(shoes, /obj/item/clothing)) var/obj/item/clothing/CS = shoes @@ -32,7 +32,7 @@ if(shoes && istype(shoes, /obj/item/clothing)) var/obj/item/clothing/S = shoes if (S.clothing_flags & NOSLIP) - return 0 + return FALSE return ..() /mob/living/carbon/human/mob_has_gravity() diff --git a/code/modules/mob/living/carbon/human/innate_abilities/blobform.dm b/code/modules/mob/living/carbon/human/innate_abilities/blobform.dm index 482268f8f5..177444503b 100644 --- a/code/modules/mob/living/carbon/human/innate_abilities/blobform.dm +++ b/code/modules/mob/living/carbon/human/innate_abilities/blobform.dm @@ -37,7 +37,7 @@ to_chat(owner, "There's something stuck to your hand, stopping you from transforming!") return if(IsAvailable()) - UpdateButtonIcon() + UpdateButtons() var/mutcolor = owner.get_ability_property(INNATE_ABILITY_SLIME_BLOBFORM, PROPERTY_BLOBFORM_COLOR) || ("#" + H.dna.features["mcolor"]) if(!is_puddle) if(CHECK_MOBILITY(H, MOBILITY_USE)) //if we can use items, we can turn into a puddle @@ -78,7 +78,7 @@ owner.update_antag_overlays() transforming = FALSE - UpdateButtonIcon() + UpdateButtons() else detransform() else @@ -109,4 +109,4 @@ squeak.RemoveComponent() H.regenerate_icons() transforming = FALSE - UpdateButtonIcon() + UpdateButtons() diff --git a/code/modules/mob/living/carbon/human/innate_abilities/limb_regeneration.dm b/code/modules/mob/living/carbon/human/innate_abilities/limb_regeneration.dm index 6f3809c232..71b15bda2d 100644 --- a/code/modules/mob/living/carbon/human/innate_abilities/limb_regeneration.dm +++ b/code/modules/mob/living/carbon/human/innate_abilities/limb_regeneration.dm @@ -12,7 +12,7 @@ var/mob/living/carbon/human/H = owner var/list/limbs_to_heal = H.get_missing_limbs() if(limbs_to_heal.len < 1) - return 0 + return FALSE var/mode = H.get_ability_property(INNATE_ABILITY_LIMB_REGROWTH, PROPERTY_LIMB_REGROWTH_USAGE_TYPE) switch(mode) if(REGROWTH_USES_BLOOD) @@ -20,7 +20,7 @@ return TRUE else return FALSE - return 0 + return FALSE /datum/action/innate/ability/limb_regrowth/Activate() var/mob/living/carbon/human/H = owner diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 2dce987449..ace5cbaa6f 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -282,9 +282,9 @@ else O = outfit if(!istype(O)) - return 0 + return FALSE if(!O) - return 0 + return FALSE return O.equip(src, visualsOnly, preference_source) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 4221df31f6..bd32a08d9a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -223,7 +223,7 @@ if(cold) //CITADEL EDIT Mandatory for vore code. if(istype(loc, /obj/item/dogborg/sleeper) || isbelly(loc) || ismob(loc)) - return 1 //freezing to death in sleepers ruins fun. + return TRUE //freezing to death in sleepers ruins fun. //END EDIT temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. var/thermal_protection_flags = cold ? get_cold_protection_flags(temperature) : get_heat_protection_flags(temperature) @@ -254,7 +254,7 @@ if(missing_body_parts_flags & HAND_RIGHT) max_protection -= THERMAL_PROTECTION_HAND_RIGHT if(max_protection == 0) //Is it even a man if it doesn't have a body at all? Early return to avoid division by zero. - return 1 + return TRUE var/thermal_protection = 0 if(thermal_protection_flags) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 22cb10026b..7c4ba5e719 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -84,7 +84,7 @@ ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE - return 0 + return FALSE /mob/living/carbon/human/get_alt_name() if(name != GetVoice()) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index bed766519f..ca9d5c3e9e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -321,8 +321,8 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) //Please override this locally if you want to define when what species qualifies for what rank if human authority is enforced. /datum/species/proc/qualifies_for_rank(rank, list/features) //SPECIES JOB RESTRICTIONS //if(rank in GLOB.command_positions) Left as an example: The format qualifies for rank takes. - // return 0 //It returns false when it runs the proc so they don't get jobs from the global list. - return 1 //It returns 1 to say they are a-okay to continue. + // return FALSE //It returns false when it runs the proc so they don't get jobs from the global list. + return TRUE //It returns 1 to say they are a-okay to continue. /** * Corrects organs in a carbon, removing ones it doesn't need and adding ones it does. @@ -1589,7 +1589,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) H.throw_alert("nutrition", /atom/movable/screen/alert/starving) /datum/species/proc/update_health_hud(mob/living/carbon/human/H) - return 0 + return FALSE /datum/species/proc/handle_mutations_and_radiation(mob/living/carbon/human/H) . = FALSE @@ -1645,7 +1645,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) target.help_shake_act(user) if(target != user) log_combat(user, target, "shaked") - return 1 + return TRUE else var/we_breathe = !HAS_TRAIT(user, TRAIT_NOBREATH) var/we_lung = user.getorganslot(ORGAN_SLOT_LUNGS) @@ -1661,12 +1661,12 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(target.check_martial_melee_block()) target.visible_message("[target] blocks [user]'s grab attempt!", target = user, \ target_message = "[target] blocks your grab attempt!") - return 0 + return FALSE if(attacker_style && attacker_style.grab_act(user,target)) - return 1 + return TRUE else target.grabbedby(user) - return 1 + return TRUE /datum/species/proc/harm(mob/living/carbon/human/user, mob/living/carbon/human/target, datum/martial_art/attacker_style, attackchain_flags = NONE) if(!attacker_style && HAS_TRAIT(user, TRAIT_PACIFISM)) @@ -1929,11 +1929,11 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(user != H) var/list/block_return = list() if(H.mob_run_block(I, totitemdamage, "the [I.name]", ((attackchain_flags & ATTACK_IS_PARRY_COUNTERATTACK)? ATTACK_TYPE_PARRY_COUNTERATTACK : NONE) | ATTACK_TYPE_MELEE, I.armour_penetration, user, affecting.body_zone, block_return) & BLOCK_SUCCESS) - return 0 + return FALSE totitemdamage = block_calculate_resultant_damage(totitemdamage, block_return) if(H.check_martial_melee_block()) H.visible_message("[H] blocks [I]!") - return 0 + return FALSE var/hit_area @@ -1958,7 +1958,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) I.do_stagger_action(H, user, totitemdamage) if(!totitemdamage) - return 0 //item force is zero + return FALSE //item force is zero var/bloody = 0 if(((I.damtype == BRUTE) && I.force && prob(25 + (I.force * 2)))) @@ -2167,7 +2167,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/hit_percent = (100-(blocked+armor))/100 hit_percent = (hit_percent * (100-H.physiology.damage_resistance))/100 if(!forced && hit_percent <= 0) - return 0 + return FALSE var/obj/item/bodypart/BP = null if(!spread_damage) @@ -2224,7 +2224,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(BRAIN) var/damage_amount = forced ? damage : damage * hit_percent * H.physiology.brain_mod H.adjustOrganLoss(ORGAN_SLOT_BRAIN, damage_amount) - return 1 + return TRUE /datum/species/proc/on_hit(obj/item/projectile/P, mob/living/carbon/human/H) // called when hit by a projectile diff --git a/code/modules/mob/living/carbon/human/species_types/arachnid.dm b/code/modules/mob/living/carbon/human/species_types/arachnid.dm index 819f347353..e2b32b5010 100644 --- a/code/modules/mob/living/carbon/human/species_types/arachnid.dm +++ b/code/modules/mob/living/carbon/human/species_types/arachnid.dm @@ -43,7 +43,7 @@ /datum/species/arachnid/check_weakness(obj/item/weapon, mob/living/attacker) if(istype(weapon, /obj/item/melee/flyswatter)) return 9 //flyswatters deal 10x damage to arachnids - return 0 + return FALSE /datum/species/arachnid/on_species_gain(mob/living/carbon/human/H, datum/species/old_species) . = ..() diff --git a/code/modules/mob/living/carbon/human/species_types/flypeople.dm b/code/modules/mob/living/carbon/human/species_types/flypeople.dm index 86720289fe..fdd8434acc 100644 --- a/code/modules/mob/living/carbon/human/species_types/flypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/flypeople.dm @@ -37,4 +37,4 @@ /datum/species/fly/check_weakness(obj/item/weapon, mob/living/attacker) if(istype(weapon, /obj/item/melee/flyswatter)) return 29 //Flyswatters deal 30x damage to flypeople. - return 0 + return FALSE diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index c4be0d3948..b68199878e 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -421,7 +421,7 @@ I = AM var/mob/thrown_by = I.thrownby?.resolve() if(thrown_by == H) //No throwing stuff at yourself to trigger the teleport - return 0 + return FALSE else reactive_teleport(H) @@ -463,8 +463,8 @@ /datum/action/innate/unstable_teleport/IsAvailable(silent = FALSE) if(..()) if(world.time > last_teleport + cooldown) - return 1 - return 0 + return TRUE + return FALSE /datum/action/innate/unstable_teleport/Activate() var/mob/living/carbon/human/H = owner @@ -480,9 +480,9 @@ spark_system.start() do_teleport(H, get_turf(H), 12, asoundin = 'sound/weapons/emitter2.ogg', channel = TELEPORT_CHANNEL_BLUESPACE) last_teleport = world.time - UpdateButtonIcon() //action icon looks unavailable - sleep(cooldown + 5) - UpdateButtonIcon() //action icon looks available again + UpdateButtons() //action icon looks unavailable + //action icon looks available again + addtimer(CALLBACK(src, .proc/UpdateButtons), cooldown + 5) //honk @@ -546,7 +546,7 @@ if(istype(AM, /obj/item)) I = AM if(I.thrownby == H) //No throwing stuff at yourself to make bananas - return 0 + return FALSE else new/obj/item/grown/bananapeel/specialpeel(get_turf(H)) last_banana = world.time diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index e8042dfac9..a8fdd5e574 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -82,7 +82,7 @@ var/datum/action/innate/ability/regrowth = H.ability_actions[INNATE_ABILITY_LIMB_REGROWTH] if(regrowth) - regrowth.UpdateButtonIcon() + regrowth.UpdateButtons() return FALSE // to let living/handle_blood know that the species is handling blood instead @@ -183,8 +183,8 @@ if(..()) var/mob/living/carbon/human/H = owner if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT) - return 1 - return 0 + return TRUE + return FALSE /datum/action/innate/split_body/Activate() var/mob/living/carbon/human/H = owner @@ -472,9 +472,9 @@ /datum/species/jelly/luminescent/proc/update_slime_actions() integrate_extract.update_name() - integrate_extract.UpdateButtonIcon() - extract_minor.UpdateButtonIcon() - extract_major.UpdateButtonIcon() + integrate_extract.UpdateButtons() + extract_minor.UpdateButtons() + extract_major.UpdateButtons() /datum/species/jelly/luminescent/proc/update_glow(mob/living/carbon/C, intensity) if(intensity) @@ -514,7 +514,7 @@ name = "Eject Extract" desc = "Eject your current slime extract." -/datum/action/innate/integrate_extract/UpdateButtonIcon(status_only, force) +/datum/action/innate/integrate_extract/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force) if(!species || !species.current_extract) button_icon_state = "slimeconsume" else diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index 3b7ca3fa0a..0235be3268 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -70,7 +70,7 @@ H.equipOutfit(O, visualsOnly) H.internal = H.get_item_for_held_index(2) H.update_internals_hud_icon(1) - return 0 + return FALSE /datum/species/plasmaman/random_name(gender,unique,lastname) if(unique) diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 812ae12955..5a29818ed4 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -129,7 +129,7 @@ return ..() /obj/item/organ/heart/nightmare/Stop() - return 0 + return FALSE /obj/item/organ/heart/nightmare/on_death() if(!owner) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 69423bcffe..9b2db8b106 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -156,7 +156,7 @@ failed_last_breath = 1 throw_alert("not_enough_oxy", /atom/movable/screen/alert/not_enough_oxy) - return 0 + return FALSE var/safe_oxy_min = 16 var/safe_oxy_max = 50 @@ -312,7 +312,7 @@ //BREATH TEMPERATURE handle_breath_temperature(breath) - return 1 + return TRUE //Fourth and final link in a breath chain /mob/living/carbon/proc/handle_breath_temperature(datum/gas_mixture/breath) @@ -660,7 +660,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put //used in human and monkey handle_environment() /mob/living/carbon/proc/natural_bodytemperature_stabilization() if(HAS_TRAIT(src, TRAIT_COLDBLOODED) || HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM)) - return 0 //Return 0 as your natural temperature. Species proc handle_environment() will adjust your temperature based on this. + return FALSE //return FALSE as your natural temperature. Species proc handle_environment() will adjust your temperature based on this. var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature switch(bodytemperature) @@ -675,7 +675,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put /mob/living/carbon/proc/get_cooling_efficiency() if(!HAS_TRAIT(src, TRAIT_ROBOTIC_ORGANISM)) - return 1 + return TRUE var/integration_bonus = min(blood_volume * SYNTH_INTEGRATION_COOLANT_CAP, integrating_blood * SYNTH_INTEGRATION_COOLANT_PENALTY) //Integration blood somewhat helps, though only at 40% impact and to a cap of 25% of current blood level. var/blood_effective_volume = blood_volume + integration_bonus @@ -691,7 +691,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put return suitlink //If you are wearing full EVA or lavaland hazard gear (on lavaland), assume it has been made to accomodate your cooling needs. var/datum/gas_mixture/environment = loc.return_air() if(!environment) - return 0 + return FALSE var/pressure = environment.return_pressure() var/heat = environment.return_temperature() @@ -711,18 +711,18 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put var/turf/T = get_turf(src) if(istype(head_item, /obj/item/clothing/head/helmet/space) && istype(suit_item, /obj/item/clothing/suit/space)) - return 1 + return TRUE if(istype(head_item, /obj/item/clothing/head/mod) && istype(suit_item, /obj/item/clothing/suit/mod)) var/obj/item/clothing/suit/mod/modsuit = suit_item var/obj/item/mod/control/mod_control = modsuit.mod if(mod_control && mod_control.active) - return 1 + return TRUE if(T && is_mining_level(T.z) && istype(head_item, /obj/item/clothing/head/hooded/explorer) && istype(suit_item, /obj/item/clothing/suit/hooded/explorer)) - return 1 + return TRUE - return 0 + return FALSE ///////// //LIVER// diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm index 2640c642dd..700d7a5315 100644 --- a/code/modules/mob/living/carbon/monkey/combat.dm +++ b/code/modules/mob/living/carbon/monkey/combat.dm @@ -27,7 +27,7 @@ // taken from /mob/living/carbon/human/interactive/ /mob/living/carbon/monkey/proc/walk2derpless(target) if(!target || IsStandingStill()) - return 0 + return FALSE if(myPath.len <= 0) myPath = get_path_to(src, target, 250, 1) @@ -39,14 +39,14 @@ if(myPath.len >= 1) walk_to(src,myPath[1],0,5) myPath -= myPath[1] - return 1 + return TRUE // failed to path correctly so just try to head straight for a bit walk_to(src,get_turf(target),0,5) sleep(1) walk_to(src,0) - return 0 + return FALSE // taken from /mob/living/carbon/human/interactive/ /mob/living/carbon/monkey/proc/IsDeadOrIncap(checkDead = TRUE) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index a7bc0c11d5..e9afb6eef9 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -137,7 +137,7 @@ /mob/living/carbon/monkey/has_smoke_protection() if(wear_mask) if(wear_mask.clothing_flags & BLOCK_GAS_SMOKE_EFFECT) - return 1 + return TRUE /mob/living/carbon/monkey/handle_fire() . = ..() diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index bb35ff082b..4cdf1f1aeb 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -171,8 +171,8 @@ GLOBAL_LIST_INIT(strippable_monkey_items, create_strippable_list(list( /mob/living/carbon/monkey/IsVocal() if(!getorganslot(ORGAN_SLOT_LUNGS)) - return 0 - return 1 + return FALSE + return TRUE /mob/living/carbon/monkey/can_use_guns(obj/item/G) return TRUE diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm index 80d968b229..f0796e2c54 100644 --- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm +++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm @@ -114,7 +114,7 @@ if(!affecting) affecting = get_bodypart(BODY_ZONE_CHEST) if(!dismembering_strike(M, affecting.body_zone)) //Dismemberment successful - return 1 + return TRUE apply_damage(damage, BRUTE, affecting) else @@ -159,7 +159,7 @@ damage = rand(20, 40) var/dam_zone = dismembering_strike(M, pick(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) if(!dam_zone) //Dismemberment successful - return 1 + return TRUE var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone)) if(!affecting) affecting = get_bodypart(BODY_ZONE_CHEST) diff --git a/code/modules/mob/living/carbon/say.dm b/code/modules/mob/living/carbon/say.dm index 67c29b4211..9838d6f9b9 100644 --- a/code/modules/mob/living/carbon/say.dm +++ b/code/modules/mob/living/carbon/say.dm @@ -9,9 +9,9 @@ /mob/living/carbon/can_speak_vocal(message) if(silent) - return 0 + return FALSE if(get_selected_language() == /datum/language/signlanguage && handcuffed) - return 0 + return FALSE return ..() /mob/living/carbon/could_speak_language(datum/language/language) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index fcb0ffcefa..76e620b204 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -17,7 +17,7 @@ /mob/living/proc/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, spread_damage = FALSE, wound_bonus = 0, bare_wound_bonus = 0, sharpness = SHARP_NONE) var/hit_percent = (100-blocked)/100 if(!damage || (hit_percent <= 0)) - return 0 + return FALSE var/damage_amount = forced ? damage : damage * hit_percent switch(damagetype) if(BRUTE) @@ -32,7 +32,7 @@ adjustCloneLoss(damage_amount, forced = forced) if(STAMINA) adjustStaminaLoss(damage_amount, forced = forced) - return 1 + return TRUE /mob/living/proc/apply_damage_type(damage = 0, damagetype = BRUTE) //like apply damage except it always uses the damage procs switch(damagetype) @@ -67,7 +67,7 @@ /mob/living/proc/apply_damages(brute = 0, burn = 0, tox = 0, oxy = 0, clone = 0, def_zone = null, blocked = FALSE, stamina = 0, brain = 0) if(blocked >= 100) - return 0 + return FALSE if(brute) apply_damage(brute, BRUTE, def_zone, blocked) if(burn) @@ -82,12 +82,12 @@ apply_damage(stamina, STAMINA, def_zone, blocked) if(brain) apply_damage(brain, BRAIN, def_zone, blocked) - return 1 + return TRUE /mob/living/proc/apply_effect(effect = 0,effecttype = EFFECT_STUN, blocked = FALSE, knockdown_stamoverride, knockdown_stammax) var/hit_percent = (100-blocked)/100 if(!effect || (hit_percent <= 0)) - return 0 + return FALSE switch(effecttype) if(EFFECT_STUN) Stun(effect * hit_percent) @@ -109,7 +109,7 @@ if(EFFECT_JITTER) if((status_flags & CANSTUN) && !HAS_TRAIT(src, TRAIT_STUNIMMUNE)) jitteriness = max(jitteriness,(effect * hit_percent)) - return 1 + return TRUE /mob/living/proc/apply_effects(stun = 0, knockdown = 0, unconscious = 0, irradiate = 0, slur = 0, stutter = 0, eyeblur = 0, drowsy = 0, blocked = 0, stamina = 0, jitter = 0, kd_stamoverride, kd_stammax) @@ -163,7 +163,7 @@ /mob/living/proc/setOxyLoss(amount, updating_health = TRUE, forced = FALSE) if(status_flags & GODMODE) - return 0 + return FALSE oxyloss = amount if(updating_health) updatehealth() @@ -179,7 +179,7 @@ affected_by = TOX_SYSCORRUPT if(toxins_type != affected_by) - return 0 + return FALSE else return toxloss diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index f4f8060fb3..af911bd2a4 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -133,7 +133,7 @@ if(fire_stacks < 0) //If we've doused ourselves in water to avoid fire, dry off slowly fire_stacks = min(0, fire_stacks + 1)//So we dry ourselves back to default, nonflammable. if(!on_fire) - return 1 + return TRUE if(fire_stacks > 0) adjust_fire_stacks(-0.1) //the fire is slowly consumed else diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f6a2f1cb38..cd2bc3b38b 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -243,7 +243,7 @@ // If there's no dir_to_target then the player is on the same turf as the atom they're trying to push. // This can happen when a player is stood on the same turf as a directional window. All attempts to push - // the window will fail as get_dir will return 0 and the player will be unable to move the window when + // the window will fail as get_dir will return FALSE and the player will be unable to move the window when // it should be pushable. // In this scenario, we will use the facing direction of the /mob/living attempting to push the atom as // a fallback. @@ -636,7 +636,7 @@ if(mind) for(var/S in mind.spell_list) var/obj/effect/proc_holder/spell/spell = S - spell.updateButtonIcon() + spell.UpdateButton() //proc used to remove all immobilisation effects + reset stamina /mob/living/proc/remove_CC(should_update_mobility = TRUE) @@ -683,7 +683,7 @@ /mob/living/proc/can_be_revived() . = 1 if(health <= HEALTH_THRESHOLD_DEAD) - return 0 + return FALSE /mob/living/proc/update_damage_overlays() return @@ -1051,27 +1051,27 @@ //basic fast checks go first. When overriding this proc, I recommend calling ..() at the end. var/turf/T = get_turf(src) if(!T) - return 0 + return FALSE if(is_centcom_level(T.z)) //dont detect mobs on centcom - return 0 + return FALSE if(is_away_level(T.z)) - return 0 + return FALSE if(user != null && src == user) - return 0 + return FALSE if(invisibility || alpha == 0)//cloaked - return 0 + return FALSE if(digitalcamo || digitalinvis) - return 0 + return FALSE // Now, are they viewable by a camera? (This is last because it's the most intensive check) if(!near_camera(src)) - return 0 + return FALSE - return 1 + return TRUE //used in datum/reagents/reaction() proc /mob/living/proc/get_permeability_protection(list/target_zones) - return 0 + return FALSE /mob/living/proc/harvest(mob/living/user) //used for extra objects etc. in butchering return @@ -1120,7 +1120,7 @@ /mob/living/proc/check_weakness(obj/item/weapon, mob/living/attacker) if(mind && mind.has_antag_datum(/datum/antagonist/devil)) return check_devil_bane_multiplier(weapon, attacker) - return 1 + return TRUE /mob/living/proc/check_acedia() if(mind && mind.has_objective(/datum/objective/sintouched/acedia)) diff --git a/code/modules/mob/living/living_active_parry.dm b/code/modules/mob/living/living_active_parry.dm index 13240b2734..7dcc812863 100644 --- a/code/modules/mob/living/living_active_parry.dm +++ b/code/modules/mob/living/living_active_parry.dm @@ -241,7 +241,7 @@ // before doing anything, check if the user moused over them properly if(!client) return BLOCK_NONE - var/found = attacker == client.mouseObject + var/found = attacker == client.mouse_object_ref?.resolve() if(!found) for(var/i in client.moused_over_objects) if(i == object) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index cd46072921..e984367d8b 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -20,15 +20,15 @@ /mob/living/proc/getarmor(def_zone, type) - return 0 + return FALSE //this returns the mob's protection against eye damage (number between -1 and 2) from bright lights /mob/living/proc/get_eye_protection() - return 0 + return FALSE //this returns the mob's protection against ear damage (0:no protection; 1: some ear protection; 2: has no ears) /mob/living/proc/get_ear_protection() - return 0 + return FALSE /mob/living/proc/is_mouth_covered(head_only = 0, mask_only = 0) return FALSE @@ -96,7 +96,7 @@ return P.on_hit(src, final_percent, def_zone) ? BULLET_ACT_HIT : BULLET_ACT_BLOCK /mob/living/proc/check_projectile_dismemberment(obj/item/projectile/P, def_zone) - return 0 + return FALSE /obj/item/proc/get_volume_by_throwforce_and_or_w_class() if(throwforce && w_class) @@ -104,7 +104,7 @@ else if(w_class) return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100 else - return 0 + return FALSE /mob/living/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum) if(!isitem(AM)) @@ -202,11 +202,11 @@ if(GRAB_NECK) log_combat(user, src, "attempted to strangle", addition="kill grab") if(!do_mob(user, src, grab_upgrade_time)) - return 0 + return FALSE if(!user.pulling || user.pulling != src || user.grab_state != old_grab_state || user.a_intent != INTENT_GRAB) - return 0 + return FALSE if(user.voremode && user.grab_state == GRAB_AGGRESSIVE) - return 0 + return FALSE user.setGrabState(user.grab_state + 1) switch(user.grab_state) if(GRAB_AGGRESSIVE) @@ -240,7 +240,7 @@ if(!buckled && !density) Move(user.loc) user.set_pull_offsets(src, grab_state) - return 1 + return TRUE /mob/living/on_attack_hand(mob/user, act_intent = user.a_intent, attackchain_flags) ..() //Ignoring parent return value here. @@ -302,7 +302,7 @@ M.visible_message("\The [M] [M.friendly_verb_continuous] [src]!", "You [M.friendly_verb_simple] [src]!", target = src, target_message = "\The [M] [M.friendly_verb_continuous] you!") - return 0 + return FALSE else if(HAS_TRAIT(M, TRAIT_PACIFISM)) to_chat(M, "You don't want to hurt anyone!") @@ -310,7 +310,7 @@ var/damage = rand(M.melee_damage_lower, M.melee_damage_upper) var/list/return_list = list() if(mob_run_block(M, damage, "the [M.name]", ATTACK_TYPE_MELEE, M.armour_penetration, M, check_zone(M.zone_selected), return_list) & BLOCK_SUCCESS) - return 0 + return FALSE damage = block_calculate_resultant_damage(damage, return_list) if(M.attack_sound) playsound(src, M.attack_sound, 50, 1, 1) @@ -418,7 +418,7 @@ /mob/living/acid_act(acidpwr, acid_volume) take_bodypart_damage(acidpwr * min(1, acid_volume * 0.1)) - return 1 + return TRUE ///As the name suggests, this should be called to apply electric shocks. /mob/living/proc/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) @@ -518,7 +518,7 @@ //called when the mob receives a loud bang /mob/living/proc/soundbang_act() - return 0 + return FALSE //to damage the clothes worn by a mob /mob/living/proc/damage_clothes(damage_amount, damage_type = BRUTE, damage_flag = 0, def_zone) diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm index fcab9344d9..a09ecb0b54 100644 --- a/code/modules/mob/living/living_movement.dm +++ b/code/modules/mob/living/living_movement.dm @@ -81,7 +81,7 @@ if (!buckled.anchored) return buckled.Move(newloc, direct) else - return 0 + return FALSE var/old_direction = dir var/turf/T = loc diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 02a3e3684e..439bd377f6 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -208,7 +208,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( if(radio_return & REDUCE_RANGE) message_range = 1 if(radio_return & NOPASS) - return 1 + return TRUE //No screams in space, unless you're next to someone. var/turf/T = get_turf(src) @@ -226,7 +226,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( succumb() to_chat(src, compose_message(src, language, message, null, spans, message_mode)) - return 1 + return TRUE /mob/living/compose_message(atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode, face_name = FALSE, atom/movable/source) . = ..() @@ -358,23 +358,23 @@ GLOBAL_LIST_INIT(department_radio_keys, list( /mob/living/can_speak(message) //For use outside of Say() if(can_speak_basic(message) && can_speak_vocal(message)) - return 1 + return TRUE /mob/living/proc/can_speak_basic(message, ignore_spam = FALSE) //Check BEFORE handling of xeno and ling channels if(client) if(client.prefs.muted & MUTE_IC) to_chat(src, "You cannot speak in IC (muted).") - return 0 + return FALSE if(!ignore_spam && client.handle_spam_prevention(message,MUTE_IC)) - return 0 + return FALSE - return 1 + return TRUE /mob/living/proc/can_speak_vocal(message) //Check AFTER handling of xeno and ling channels var/obj/item/bodypart/leftarm = get_bodypart(BODY_ZONE_L_ARM) var/obj/item/bodypart/rightarm = get_bodypart(BODY_ZONE_R_ARM) if(HAS_TRAIT(src, TRAIT_MUTE) && get_selected_language() != /datum/language/signlanguage) - return 0 + return FALSE if (get_selected_language() == /datum/language/signlanguage) var/left_disabled = FALSE @@ -390,15 +390,15 @@ GLOBAL_LIST_INIT(department_radio_keys, list( else right_disabled = TRUE if (left_disabled && right_disabled) // We want this to only return false if both arms are either missing or disabled since you could technically sign one-handed. - return 0 + return FALSE if(is_muzzled()) - return 0 + return FALSE if(!IsVocal()) - return 0 + return FALSE - return 1 + return TRUE /mob/living/proc/get_key(message) var/key = message[1] @@ -468,9 +468,9 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return ITALICS | REDUCE_RANGE if(MODE_BINARY) - return ITALICS | REDUCE_RANGE //Does not return 0 since this is only reached by humans, not borgs or AIs. + return ITALICS | REDUCE_RANGE //Does not return FALSE since this is only reached by humans, not borgs or AIs. - return 0 + return FALSE /mob/living/say_mod(input, message_mode) . = ..() diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 0db472bb9d..64b17b2622 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -618,7 +618,7 @@ queueAlarm(text("--- [] alarm detected in []! (No Camera)", class, home.name), class) if (viewalerts) ai_alerts() - return 1 + return TRUE /mob/living/silicon/ai/freeCamera(area/home, obj/machinery/camera/cam) for(var/class in alarms) @@ -906,7 +906,7 @@ to_chat(user, "Transfer successful: [name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory.") /mob/living/silicon/ai/can_buckle() - return 0 + return FALSE /mob/living/silicon/ai/incapacitated(ignore_restraints, ignore_grab) if(aiRestorePowerRoutine) diff --git a/code/modules/mob/living/silicon/ai/ai_defense.dm b/code/modules/mob/living/silicon/ai/ai_defense.dm index 17d4e9d129..6cf3d5a68a 100644 --- a/code/modules/mob/living/silicon/ai/ai_defense.dm +++ b/code/modules/mob/living/silicon/ai/ai_defense.dm @@ -12,8 +12,8 @@ if (stat != DEAD) adjustBruteLoss(60) updatehealth() - return 1 - return 0 + return TRUE + return FALSE /mob/living/silicon/ai/emp_act(severity) . = ..() diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index a3ffd460dd..4a60c93960 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -177,8 +177,8 @@ GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new) if(chunk.changed) chunk.hasChanged(1) // Update now, no matter if it's visible or not. if(chunk.visibleTurfs[position]) - return 1 - return 0 + return TRUE + return FALSE /datum/cameranet/proc/stat_entry() if(!statclick) diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index bce18462b2..be1ac47abd 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -115,7 +115,7 @@ return TRUE /mob/camera/aiEye/Move() - return 0 + return FALSE /mob/camera/aiEye/proc/GetViewerClient() if(ai) diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 76eaa6ad0d..e23eb842ea 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -187,8 +187,8 @@ SEND_SOUND(M, voice) else SEND_SOUND(only_listener, voice) - return 1 - return 0 + return TRUE + return FALSE #undef VOX_DELAY #endif diff --git a/code/modules/mob/living/silicon/damage_procs.dm b/code/modules/mob/living/silicon/damage_procs.dm index b50aeb5f48..bff842cd04 100644 --- a/code/modules/mob/living/silicon/damage_procs.dm +++ b/code/modules/mob/living/silicon/damage_procs.dm @@ -2,14 +2,14 @@ /mob/living/silicon/apply_damage(damage = 0,damagetype = BRUTE, def_zone = null, blocked = FALSE, forced = FALSE, wound_bonus = 0, bare_wound_bonus = 0, sharpness = SHARP_NONE) var/hit_percent = (100-blocked)/100 if(!damage || (!forced && hit_percent <= 0)) - return 0 + return FALSE var/damage_amount = forced ? damage : damage * hit_percent switch(damagetype) if(BRUTE) adjustBruteLoss(damage_amount, forced = forced) if(BURN) adjustFireLoss(damage_amount, forced = forced) - return 1 + return TRUE /mob/living/silicon/apply_effect(effect = 0,effecttype = EFFECT_STUN, blocked = FALSE) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 435d1853f6..fb5b3ecb4c 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -230,7 +230,7 @@ /datum/action/innate/pai/Trigger() if(!ispAI(owner)) - return 0 + return FALSE P = owner /datum/action/innate/pai/software diff --git a/code/modules/mob/living/silicon/pai/personality.dm b/code/modules/mob/living/silicon/pai/personality.dm index 62f2ed7047..2225485da0 100644 --- a/code/modules/mob/living/silicon/pai/personality.dm +++ b/code/modules/mob/living/silicon/pai/personality.dm @@ -12,7 +12,7 @@ /datum/paiCandidate/proc/savefile_save(mob/user) if(IsGuestKey(user.key)) - return 0 + return FALSE var/savefile/F = new /savefile(src.savefile_path(user)) @@ -24,7 +24,7 @@ WRITE_FILE(F["version"], 1) - return 1 + return TRUE // loads the savefile corresponding to the mob's ckey // if silent=true, report incompatible savefiles @@ -33,12 +33,12 @@ /datum/paiCandidate/proc/savefile_load(mob/user, silent = TRUE) if (IsGuestKey(user.key)) - return 0 + return FALSE var/path = savefile_path(user) if (!fexists(path)) - return 0 + return FALSE var/savefile/F = new /savefile(path) @@ -52,10 +52,10 @@ fdel(path) if (!silent) alert(user, "Your savefile was incompatible with this version and was deleted.") - return 0 + return FALSE F["name"] >> src.name F["description"] >> src.description F["role"] >> src.role F["comments"] >> src.comments - return 1 + return TRUE diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 04665401c5..ad7bc79278 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -206,12 +206,12 @@ var/count = 0 while(!isliving(M)) if(!M || !M.loc) - return 0 //For a runtime where M ends up in nullspace (similar to bluespace but less colourful) + return FALSE //For a runtime where M ends up in nullspace (similar to bluespace but less colourful) M = M.loc count++ if(count >= 6) to_chat(src, "You are not being carried by anyone!") - return 0 + return FALSE spawn CheckDNA(M, src) if("pdamessage") diff --git a/code/modules/mob/living/silicon/robot/inventory.dm b/code/modules/mob/living/silicon/robot/inventory.dm index 559ffbbc08..146088f6e2 100644 --- a/code/modules/mob/living/silicon/robot/inventory.dm +++ b/code/modules/mob/living/silicon/robot/inventory.dm @@ -351,7 +351,7 @@ if(module_active) return held_items.Find(module_active) - return 0 + return FALSE /** * Selects the module in the slot module_num. diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 264bcc4404..5c2d3d2c33 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -271,7 +271,7 @@ if(source.z != z) return if(stat == DEAD) - return 1 + return TRUE var/list/our_sort = alarms[class] for(var/areaname in our_sort) if (areaname == home.name) @@ -279,7 +279,7 @@ var/list/sources = alarm[3] if (!(source in sources)) sources += source - return 1 + return TRUE var/obj/machinery/camera/cam = null var/list/our_cams = null @@ -979,7 +979,7 @@ ionpulse = FALSE revert_shell() - return 1 + return TRUE /mob/living/silicon/robot/proc/has_module() if(!module || module.type == /obj/item/robot_module) @@ -1302,7 +1302,7 @@ switch(choice) if("Resting") update_icons() - return 0 + return FALSE if("Sitting") sitting = 1 if("Belly up") diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 08aa3dd3e7..dcddff49d1 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -1095,10 +1095,10 @@ if (energy >= amount) energy -= amount if (energy == 0) - return 1 + return TRUE return 2 else - return 0 + return FALSE /datum/robot_energy_storage/proc/add_charge(amount) energy = min(energy + amount, max_energy) diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index 23500688ae..538f3c513f 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -1,6 +1,6 @@ /mob/living/silicon/robot/Process_Spacemove(movement_dir = 0) if(ionpulse()) - return 1 + return TRUE return ..() /mob/living/silicon/robot/mob_negates_gravity() diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index fbc1eb4eb9..298f5d5e00 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -24,10 +24,10 @@ to_chat(M, "[link] [rendered]") /mob/living/silicon/binarycheck() - return 1 + return TRUE /mob/living/silicon/lingcheck() - return 0 //Borged or AI'd lings can't speak on the ling channel. + return FALSE //Borged or AI'd lings can't speak on the ling channel. /mob/living/silicon/radio(message, message_mode, list/spans, language) . = ..() @@ -44,7 +44,7 @@ radio.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE - return 0 + return FALSE /mob/living/silicon/get_message_mode(message) . = ..() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 347c71673e..f58b27a537 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -364,12 +364,12 @@ to_chat(src, "Automatic announcements [Autochan == "None" ? "will not use the radio." : "set to [Autochan]."]") /mob/living/silicon/put_in_hand_check() // This check is for borgs being able to receive items, not put them in others' hands. - return 0 + return FALSE // The src mob is trying to place an item on someone // But the src mob is a silicon!! Disable. /mob/living/silicon/stripPanelEquip(obj/item/what, mob/who, slot) - return 0 + return FALSE /mob/living/silicon/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt silicon units @@ -434,7 +434,7 @@ return ..() /mob/living/silicon/is_literate() - return 1 + return TRUE /mob/living/silicon/get_inactive_held_item() return FALSE diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index e1a179ea52..771eeca2ce 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -95,7 +95,7 @@ for(var/mob/living/M in buckled_mobs) unbuckle_mob(M) M.electrocute_act(shock_damage/100, source, siemens_coeff, flags) //Hard metal shell conducts! - return 0 //So borgs they don't die trying to fix wiring + return FALSE //So borgs they don't die trying to fix wiring /mob/living/silicon/emp_act(severity) . = ..() diff --git a/code/modules/mob/living/simple_animal/animal_defense.dm b/code/modules/mob/living/simple_animal/animal_defense.dm index e605ffde31..05ee1554db 100644 --- a/code/modules/mob/living/simple_animal/animal_defense.dm +++ b/code/modules/mob/living/simple_animal/animal_defense.dm @@ -57,7 +57,7 @@ if(.) //successful larva bite var/damage = rand(1, 3) attack_threshold_check(damage) - return 1 + return TRUE if (M.a_intent == INTENT_HELP) if (health > 0) visible_message("[M.name] [response_help_continuous] [src].", \ diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index c3ae3898dd..864e42d1e1 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -349,8 +349,8 @@ /mob/living/simple_animal/bot/ed209/proc/check_for_weapons(var/obj/item/slot_item) if(slot_item && (slot_item.item_flags & NEEDS_PERMIT)) - return 1 - return 0 + return TRUE + return FALSE /mob/living/simple_animal/bot/ed209/explode() walk_to(src,0) diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 8cd1cd519d..683a06fab0 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -284,9 +284,9 @@ /mob/living/simple_animal/bot/floorbot/proc/is_hull_breach(turf/t) //Ignore space tiles not considered part of a structure, also ignores shuttle docking areas. var/area/t_area = get_area(t) if(t_area && (t_area.name == "Space" || findtext(t_area.name, "huttle"))) - return 0 + return FALSE else - return 1 + return TRUE //Floorbots, having several functions, need sort out special conditions here. /mob/living/simple_animal/bot/floorbot/process_scan(scan_target) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 7d37039fa1..4539c594a1 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -44,6 +44,9 @@ var/can_repair_constructs = FALSE var/can_repair_self = FALSE var/runetype + var/datum/action/innate/cult/create_rune/our_rune + /// Theme controls color. THEME_CULT is red THEME_WIZARD is purple and THEME_HOLY is blue + var/theme = "cult" var/datum/mind/original_mind /mob/living/simple_animal/hostile/construct/Initialize(mapload) @@ -51,24 +54,26 @@ update_health_hud() var/spellnum = 1 for(var/spell in construct_spells) - var/the_spell = new spell(null) - AddSpell(the_spell) - var/obj/effect/proc_holder/spell/S = mob_spell_list[spellnum] var/pos = 2+spellnum*31 if(construct_spells.len >= 4) pos -= 31*(construct_spells.len - 4) - S.action.button.screen_loc = "6:[pos],4:-2" - S.action.button.moved = "6:[pos],4:-2" + var/obj/effect/proc_holder/spell/the_spell = new spell(null) + the_spell?.action.default_button_position ="6:[pos],4:-2" + AddSpell(the_spell) spellnum++ if(runetype) - var/datum/action/innate/cult/create_rune/CR = new runetype(src) - CR.Grant(src) var/pos = 2+spellnum*31 - CR.button.screen_loc = "6:[pos],4:-2" - CR.button.moved = "6:[pos],4:-2" + if(construct_spells.len >= 4) + pos -= 31*(construct_spells.len - 4) + our_rune = new runetype(src) + our_rune.default_button_position = "6:[pos],4:-2" // Set the default position to this random position + our_rune.Grant(src) + if(icon_state) + add_overlay("glow_[icon_state]_[theme]") /mob/living/simple_animal/hostile/construct/Destroy() original_mind = null + QDEL_NULL(our_rune) . = ..() /mob/living/simple_animal/hostile/construct/death() @@ -274,17 +279,17 @@ if(isconstruct(A)) //is it a construct? var/mob/living/simple_animal/hostile/construct/C = A if(C.health < C.maxHealth) //is it hurt? let's go heal it if it is - return 1 + return TRUE else - return 0 + return FALSE else - return 0 + return FALSE /mob/living/simple_animal/hostile/construct/builder/CanAttack(atom/the_target) if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it - return 0 + return FALSE if(Found(the_target) || ..()) //If we Found it or Can_Attack it normally, we Can_Attack it as long as it wasn't invisible - return 1 //as a note this shouldn't be added to base hostile mobs because it'll mess up retaliate hostile mobs + return TRUE //as a note this shouldn't be added to base hostile mobs because it'll mess up retaliate hostile mobs /mob/living/simple_animal/hostile/construct/builder/MoveToTarget(var/list/possible_targets) ..() @@ -292,7 +297,7 @@ var/mob/living/L = target if(isconstruct(L) && L.health >= L.maxHealth) //is this target an unhurt construct? stop trying to heal it LoseTarget() - return 0 + return FALSE if(L.health <= melee_damage_lower+melee_damage_upper) //ey bucko you're hurt as fuck let's go hit you retreat_distance = null minimum_distance = 1 diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index e4d042a4cc..08612ccc7f 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -670,7 +670,7 @@ GLOBAL_LIST_INIT(strippable_corgi_items, create_strippable_list(list( vocal_pitch = 0.6 /mob/living/simple_animal/pet/dog/corgi/puppy/void/Process_Spacemove(movement_dir = 0) - return 1 //Void puppies can navigate space. + return TRUE //Void puppies can navigate space. //LISA! SQUEEEEEEEEE~ diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 6b524f6114..bb638ea104 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -276,7 +276,7 @@ return ..() /mob/living/simple_animal/drone/mob_negates_gravity() - return 1 + return TRUE /mob/living/simple_animal/drone/mob_has_gravity() return ..() || mob_negates_gravity() @@ -286,10 +286,10 @@ /mob/living/simple_animal/drone/bee_friendly() // Why would bees pay attention to drones? - return 1 + return TRUE /mob/living/simple_animal/drone/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE) - return 0 //So they don't die trying to fix wiring + return FALSE //So they don't die trying to fix wiring /mob/living/simple_animal/drone/can_see_reagents() . = ..() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm index 4acbd41977..e983335a22 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm @@ -176,7 +176,7 @@ /mob/living/simple_animal/drone/cogscarab/get_armor_effectiveness() if(GLOB.ratvar_awakens) - return 1 + return TRUE return ..() /mob/living/simple_animal/drone/cogscarab/triggerAlarm(class, area/A, O, obj/alarmsource) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm index b7545de517..7cd3919490 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/interaction.dm @@ -85,7 +85,7 @@ return (armorval * get_armor_effectiveness()) //armor is reduced for tiny fragile drones /mob/living/simple_animal/drone/proc/get_armor_effectiveness() - return 0 //multiplier for whatever head armor you wear as a drone + return FALSE //multiplier for whatever head armor you wear as a drone /mob/living/simple_animal/drone/proc/update_drone_hack(hack, clockwork) if(!istype(src) || !mind) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm index 4c112858da..c956e19a85 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/inventory.dm @@ -15,22 +15,22 @@ if(I == internal_storage) internal_storage = null update_inv_internal_storage() - return 1 - return 0 + return TRUE + return FALSE /mob/living/simple_animal/drone/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE, clothing_check = FALSE, list/return_warning) switch(slot) if(ITEM_SLOT_HEAD) if(head) - return 0 + return FALSE if(!((I.slot_flags & ITEM_SLOT_HEAD) || (I.slot_flags & ITEM_SLOT_MASK))) - return 0 - return 1 + return FALSE + return TRUE if(ITEM_SLOT_DEX_STORAGE) if(internal_storage) - return 0 - return 1 + return FALSE + return TRUE ..() diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 7893f7b26b..d53d596505 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -95,7 +95,7 @@ /mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O, mob/user, params) if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) udder.milkAnimal(O, user) - return 1 + return TRUE else return ..() @@ -159,7 +159,7 @@ /mob/living/simple_animal/cow/attackby(obj/item/O, mob/user, params) if(stat == CONSCIOUS && istype(O, /obj/item/reagent_containers/glass)) udder.milkAnimal(O, user) - return 1 + return TRUE else return ..() diff --git a/code/modules/mob/living/simple_animal/gremlin/gremlin.dm b/code/modules/mob/living/simple_animal/gremlin/gremlin.dm index da6fed4051..7901dbfd3e 100644 --- a/code/modules/mob/living/simple_animal/gremlin/gremlin.dm +++ b/code/modules/mob/living/simple_animal/gremlin/gremlin.dm @@ -228,7 +228,7 @@ GLOBAL_LIST(bad_gremlin_items) return ..() /mob/living/simple_animal/hostile/gremlin/IsAdvancedToolUser() - return 1 + return TRUE /mob/living/simple_animal/hostile/gremlin/proc/divide() //Health is halved and then reduced by 2. A new gremlin is spawned with the same health as the parent diff --git a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm index 4e57aa1562..7bc2121e78 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/dextrous.dm @@ -47,15 +47,15 @@ if(I == internal_storage) internal_storage = null update_inv_internal_storage() - return 1 - return 0 + return TRUE + return FALSE /mob/living/simple_animal/hostile/guardian/dextrous/can_equip(obj/item/I, slot, disable_warning = FALSE, bypass_equip_delay_self = FALSE, clothing_check = FALSE, list/return_warning) switch(slot) if(ITEM_SLOT_DEX_STORAGE) if(internal_storage) - return 0 - return 1 + return FALSE + return TRUE ..() /mob/living/simple_animal/hostile/guardian/dextrous/equip_to_slot(obj/item/I, slot) diff --git a/code/modules/mob/living/simple_animal/guardian/types/protector.dm b/code/modules/mob/living/simple_animal/guardian/types/protector.dm index 00d56edd55..605c23227e 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/protector.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/protector.dm @@ -29,7 +29,7 @@ /mob/living/simple_animal/hostile/guardian/protector/ToggleMode() if(cooldown > world.time) - return 0 + return FALSE cooldown = world.time + 10 if(toggle) cut_overlays() diff --git a/code/modules/mob/living/simple_animal/hostile/bosses/boss.dm b/code/modules/mob/living/simple_animal/hostile/bosses/boss.dm index 1dedf8cd29..88f25eb5ce 100644 --- a/code/modules/mob/living/simple_animal/hostile/bosses/boss.dm +++ b/code/modules/mob/living/simple_animal/hostile/bosses/boss.dm @@ -143,7 +143,7 @@ var/datum/action/boss/AB = ab if(!boss.client && (!AB.req_statuses || (boss.AIStatus in AB.req_statuses)) && prob(AB.usage_probability) && AB.Trigger()) break - AB.UpdateButtonIcon(TRUE) + AB.UpdateButtons(TRUE) /datum/boss_active_timed_battle/Destroy() diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 23a0d44d56..f2e64ddf95 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -246,7 +246,7 @@ /mob/living/simple_animal/hostile/poison/giant_spider/handle_automated_action() if(!..()) //AIStatus is off - return 0 + return FALSE if(AIStatus == AI_IDLE) //1% chance to skitter madly away if(!busy && prob(1)) @@ -255,7 +255,7 @@ spawn(50) stop_automated_movement = 0 walk(src,0) - return 1 + return TRUE /mob/living/simple_animal/hostile/poison/giant_spider/nurse/proc/GiveUp(C) spawn(100) @@ -336,7 +336,7 @@ if(L.blood_volume && (L.stat != DEAD || !consumed_mobs[L.tag])) //if they're not dead, you can consume them anyway consumed_mobs[L.tag] = TRUE fed++ - lay_eggs.UpdateButtonIcon(TRUE) + lay_eggs.UpdateButtons(TRUE) visible_message("[src] sticks a proboscis into [L] and sucks a viscous substance out.","You suck the nutriment out of [L], feeding you enough to lay a cluster of eggs.") L.death() //you just ate them, they're dead. else @@ -402,7 +402,7 @@ /obj/effect/proc_holder/wrap/update_icon() action.button_icon_state = "wrap_[active]" - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/wrap/Trigger(mob/living/simple_animal/hostile/poison/giant_spider/nurse/user) if(!istype(user)) @@ -418,7 +418,7 @@ else message = "You prepare to wrap something in a cocoon. Left-click your target to start wrapping!" add_ranged_ability(user, message, TRUE) - return 1 + return TRUE /obj/effect/proc_holder/wrap/InterceptClickOn(mob/living/caller, params, atom/target) if(..()) @@ -450,11 +450,11 @@ /datum/action/innate/spider/lay_eggs/IsAvailable(silent = FALSE) if(..()) if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) - return 0 + return FALSE var/mob/living/simple_animal/hostile/poison/giant_spider/nurse/S = owner if(S.fed) - return 1 - return 0 + return TRUE + return FALSE /datum/action/innate/spider/lay_eggs/Activate() if(!istype(owner, /mob/living/simple_animal/hostile/poison/giant_spider/nurse)) @@ -482,7 +482,7 @@ C.poison_per_bite = S.poison_per_bite C.faction = S.faction.Copy() S.fed-- - UpdateButtonIcon(TRUE) + UpdateButtons(TRUE) S.busy = SPIDER_IDLE S.stop_automated_movement = FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 89f27f067e..8ac583231f 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -86,7 +86,7 @@ /mob/living/simple_animal/hostile/handle_automated_action() if(AIStatus == AI_OFF) - return 0 + return FALSE var/list/possible_targets = ListTargets() //we look around for potential targets and make it a list for later use. if(environment_smash) @@ -98,7 +98,7 @@ if(!MoveToTarget(possible_targets)) //if we lose our target if(AIShouldSleep(possible_targets)) // we try to acquire a new one toggle_ai(AI_IDLE) // otherwise we go idle - return 1 + return TRUE /mob/living/simple_animal/hostile/handle_automated_movement() . = ..() @@ -273,7 +273,7 @@ if(target != null) GainPatience() Aggro() - return 1 + return TRUE //What we do after closing in /mob/living/simple_animal/hostile/proc/MeleeAction(patience = TRUE) @@ -295,12 +295,12 @@ stop_automated_movement = 1 if(!target || !CanAttack(target)) LoseTarget() - return 0 + return FALSE if(target in possible_targets) var/turf/T = get_turf(src) if(target.z != T.z) LoseTarget() - return 0 + return FALSE var/target_distance = get_dist(targets_from,target) if(ranged) //We ranged? Shoot at em if(!target.Adjacent(targets_from) && ranged_cooldown <= world.time) //But make sure they're not in range for a melee attack and our range attack is off cooldown @@ -310,7 +310,7 @@ return TRUE if(!Process_Spacemove()) //Drifting walk(src,0) - return 1 + return TRUE if(retreat_distance != null) //If we have a retreat distance, check if we need to run from our target if(target_distance <= retreat_distance) //If target's closer than our retreat distance, run walk_away(src,target,retreat_distance,move_to_delay) @@ -325,8 +325,8 @@ if(rapid_melee > 1 && target_distance <= melee_queue_distance) MeleeAction(FALSE) in_melee = FALSE //If we're just preparing to strike do not enter sidestep mode - return 1 - return 0 + return TRUE + return FALSE if(environment_smash) if(target.loc != null && get_dist(targets_from, target.loc) <= vision_range) //We can't see our target, but he's in our vision range still if(ranged_ignores_vision && ranged_cooldown <= world.time) //we can't see our target... but we can fire at them! @@ -334,12 +334,12 @@ if((environment_smash & ENVIRONMENT_SMASH_WALLS) || (environment_smash & ENVIRONMENT_SMASH_RWALLS)) //If we're capable of smashing through walls, forget about vision completely after finding our target Goto(target,move_to_delay,minimum_distance) FindHidden() - return 1 + return TRUE else if(FindHidden()) - return 1 + return TRUE LoseTarget() - return 0 + return FALSE /mob/living/simple_animal/hostile/proc/Goto(target, delay, minimum_distance) if(target == src.target) @@ -530,7 +530,7 @@ Goto(A,move_to_delay,minimum_distance) if(A.Adjacent(targets_from)) A.attack_animal(src) - return 1 + return TRUE /mob/living/simple_animal/hostile/RangedAttack(atom/A, params) //Player firing if(ranged && ranged_cooldown <= world.time) diff --git a/code/modules/mob/living/simple_animal/hostile/mecha_pilot.dm b/code/modules/mob/living/simple_animal/hostile/mecha_pilot.dm index 0f6c10d817..8463e252ad 100644 --- a/code/modules/mob/living/simple_animal/hostile/mecha_pilot.dm +++ b/code/modules/mob/living/simple_animal/hostile/mecha_pilot.dm @@ -70,7 +70,7 @@ /mob/living/simple_animal/hostile/syndicate/mecha_pilot/proc/enter_mecha(obj/vehicle/sealed/mecha/M) if(!M) - return 0 + return FALSE target = null //Target was our mecha, so null it out M.aimob_enter_mech(src) targets_from = M @@ -95,7 +95,7 @@ /mob/living/simple_animal/hostile/syndicate/mecha_pilot/proc/exit_mecha(obj/vehicle/sealed/mecha/M) if(!M) - return 0 + return FALSE mecha.aimob_exit_mech(src) allow_movement_on_non_turfs = FALSE @@ -280,7 +280,7 @@ /mob/living/simple_animal/hostile/syndicate/mecha_pilot/EscapeConfinement() if(mecha && loc == mecha) - return 0 + return FALSE ..() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index def5dc8c76..dfdc8a1bbc 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -153,7 +153,7 @@ Difficulty: Hard if(is_enraged()) visible_message("[src] deflects the projectile; [p_they()] can't be hit with ranged weapons while enraged!", "You deflect the projectile!") playsound(src, pick('sound/weapons/bulletflyby.ogg', 'sound/weapons/bulletflyby2.ogg', 'sound/weapons/bulletflyby3.ogg'), 300, 1) - return 0 + return FALSE return ..() /mob/living/simple_animal/hostile/megafauna/bubblegum/ex_act(severity, target, origin) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm index 49db738233..9f13b980b6 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -203,7 +203,7 @@ Difficulty: Medium if(!any_attack) for(var/obj/effect/temp_visual/drakewall/D in drakewalls) qdel(D) - return 0 // nothing to attack in the arena time for enraged attack if we still have a target + return FALSE // nothing to attack in the arena time for enraged attack if we still have a target for(var/turf/T in turfs) if(!(T in empty)) new /obj/effect/temp_visual/lava_warning(T) @@ -211,7 +211,7 @@ Difficulty: Medium new /obj/effect/temp_visual/lava_safe(T) amount-- sleep(24) - return 1 // attack finished completely + return TRUE // attack finished completely /mob/living/simple_animal/hostile/megafauna/dragon/proc/arena_escape_enrage() // you ran somehow / teleported away from my arena attack now i'm mad fucker SetRecoveryTime(80) diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 6370fae0e3..28be4c4865 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -143,8 +143,8 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(obj/O) if((isitem(O) || isstructure(O)) && !is_type_in_list(O, GLOB.protected_objects)) - return 1 - return 0 + return TRUE + return FALSE /mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(obj/O, mob/living/user, destroy_original = 0) if(destroy_original || CheckObject(O)) @@ -176,7 +176,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca faction += "[REF(creator)]" // very unique if(destroy_original) qdel(O) - return 1 + return TRUE /mob/living/simple_animal/hostile/mimic/copy/DestroySurroundings() if(destroy_objects) @@ -197,11 +197,11 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy/machine/CanAttack(atom/the_target) if(the_target == creator) // Don't attack our creator AI. - return 0 + return FALSE if(iscyborg(the_target)) var/mob/living/silicon/robot/R = the_target if(R.connected_ai == creator) // Only attack robots that aren't synced to our creator AI. - return 0 + return FALSE return ..() /mob/living/simple_animal/hostile/mimic/copy/ranged diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index 1f5cace824..3db1d1892b 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -72,19 +72,48 @@ While using this makes the system rely on OnFire, it still gives options for tim icon_icon = 'icons/mob/actions/actions_elites.dmi' button_icon_state = "" background_icon_state = "bg_default" - var/mob/living/simple_animal/hostile/asteroid/elite/M var/chosen_message var/chosen_attack_num = 0 +/datum/action/innate/elite_attack/CreateButton() + var/atom/movable/screen/movable/action_button/button = ..() + button.maptext = "" + button.maptext_x = 8 + button.maptext_y = 0 + button.maptext_width = 24 + button.maptext_height = 12 + return button + +/datum/action/innate/elite_attack/process() + if(owner == null) + STOP_PROCESSING(SSfastprocess, src) + qdel(src) + return + UpdateButtons() + +/datum/action/innate/elite_attack/UpdateButton(atom/movable/screen/movable/action_button/button, status_only = FALSE, force = FALSE) + . = ..() + if(!.) + return + if(status_only) + return + var/mob/living/simple_animal/hostile/asteroid/elite/elite_owner = owner + var/timeleft = max(elite_owner.ranged_cooldown - world.time, 0) + if(timeleft == 0) + button.maptext = "" + else + button.maptext = "[round(timeleft/10, 0.1)]" + /datum/action/innate/elite_attack/Grant(mob/living/L) if(istype(L, /mob/living/simple_animal/hostile/asteroid/elite)) - M = L + START_PROCESSING(SSfastprocess, src) return ..() return FALSE /datum/action/innate/elite_attack/Activate() - M.chosen_attack = chosen_attack_num - to_chat(M, chosen_message) + var/mob/living/simple_animal/hostile/asteroid/elite/elite_owner = owner + elite_owner.chosen_attack = chosen_attack_num + to_chat(elite_owner, chosen_message) /mob/living/simple_animal/hostile/asteroid/elite/updatehealth() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm index 92eb310595..1db137c0f9 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/retaliate.dm @@ -39,7 +39,7 @@ for(var/mob/living/simple_animal/hostile/retaliate/H in around) if(faction_check_mob(H) && !attack_same && !H.attack_same) H.enemies |= enemies - return 0 + return FALSE /mob/living/simple_animal/hostile/retaliate/adjustHealth(amount, updating_health = TRUE, forced = FALSE) . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/sharks.dm b/code/modules/mob/living/simple_animal/hostile/sharks.dm index af61149130..a101680cc1 100644 --- a/code/modules/mob/living/simple_animal/hostile/sharks.dm +++ b/code/modules/mob/living/simple_animal/hostile/sharks.dm @@ -36,7 +36,7 @@ faction = list("shark") /mob/living/simple_animal/hostile/shark/Process_Spacemove(var/movement_dir = 0) - return 1 //No drifting in space for space sharks....either! + return TRUE //No drifting in space for space sharks....either! /mob/living/simple_animal/hostile/shark/FindTarget() . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 9356c962fd..c32c06bbcb 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -78,7 +78,7 @@ if(can_be_seen(NewLoc)) if(client) to_chat(src, "You cannot move, there are eyes on you!") - return 0 + return FALSE return ..() /mob/living/simple_animal/hostile/statue/BiologicalLife(delta_time, times_fired) @@ -136,7 +136,7 @@ // Cannot talk /mob/living/simple_animal/hostile/statue/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) - return 0 + return FALSE // Turn to dust when gibbed @@ -150,7 +150,7 @@ if(isliving(the_target)) var/mob/living/L = the_target if(!L.client && !L.ckey) - return 0 + return FALSE return ..() // Don't attack your creator if there is one @@ -228,4 +228,4 @@ /mob/living/simple_animal/hostile/statue/restrained(ignore_grab) . = ..() if(can_be_seen(loc)) - return 1 + return TRUE diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 0c24dd36fa..8bf897b0cf 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -188,7 +188,7 @@ ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE - return 0 + return FALSE GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( /datum/strippable_item/parrot_headset, @@ -627,12 +627,12 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( parrot_state = PARROT_WANDER parrot_stuck = 0 parrot_lastmove = null - return 1 + return TRUE else parrot_lastmove = null else parrot_lastmove = src.loc - return 0 + return FALSE /mob/living/simple_animal/parrot/proc/attempt_item_theft() //Search for item to steal @@ -710,7 +710,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(held_item) to_chat(src, "You are already holding [held_item]!") - return 1 + return TRUE for(var/obj/item/I in view(1,src)) //Make sure we're not already holding it and it's small enough @@ -726,7 +726,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( return held_item to_chat(src, "There is nothing of interest to take!") - return 0 + return FALSE /mob/living/simple_animal/parrot/proc/steal_from_mob() set name = "Steal from mob" @@ -738,7 +738,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(held_item) to_chat(src, "You are already holding [held_item]!") - return 1 + return TRUE var/obj/item/stolen_item = null @@ -755,7 +755,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( return held_item to_chat(src, "There is nothing of interest to take!") - return 0 + return FALSE /mob/living/simple_animal/parrot/verb/drop_held_item_player() set name = "Drop held item" @@ -780,7 +780,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(!held_item) if(src == usr) //So that other mobs wont make this message appear when they're bludgeoning you. to_chat(src, "You have nothing to drop!") - return 0 + return FALSE //parrots will eat crackers instead of dropping them @@ -790,7 +790,7 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( if(health < maxHealth) adjustBruteLoss(-10) emote("me", EMOTE_VISIBLE, "[src] eagerly downs the cracker.") - return 1 + return TRUE if(!drop_gently) @@ -800,13 +800,13 @@ GLOBAL_LIST_INIT(strippable_parrot_items, create_strippable_list(list( G.prime() to_chat(src, "You let go of [held_item]!") held_item = null - return 1 + return TRUE to_chat(src, "You drop [held_item].") held_item.forceMove(drop_location()) held_item = null - return 1 + return TRUE /mob/living/simple_animal/parrot/proc/perch_player() set name = "Sit" diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 151cc70a27..3eb2f8bb0f 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -215,7 +215,7 @@ if(Process_Spacemove(anydir)) Move(get_step(src, anydir), anydir) turns_since_move = 0 - return 1 + return TRUE /mob/living/simple_animal/proc/handle_automated_speech(var/override) set waitfor = FALSE diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 274af333fc..42a419db23 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -620,11 +620,11 @@ /mob/living/simple_animal/slime/proc/will_hunt(hunger = -1) // Check for being stopped from feeding and chasing if (docile) - return 0 + return FALSE if (hunger == 2 || rabid || attacked) - return 1 + return TRUE if (Leader) - return 0 + return FALSE if (holding_still) - return 0 - return 1 + return FALSE + return TRUE diff --git a/code/modules/mob/living/simple_animal/slime/powers.dm b/code/modules/mob/living/simple_animal/slime/powers.dm index d93993bf1f..3624c00e6d 100644 --- a/code/modules/mob/living/simple_animal/slime/powers.dm +++ b/code/modules/mob/living/simple_animal/slime/powers.dm @@ -16,16 +16,16 @@ var/mob/living/simple_animal/slime/S = owner if(needs_growth == GROWTH_NEEDED) if(S.amount_grown >= SLIME_EVOLUTION_THRESHOLD) - return 1 - return 0 - return 1 + return TRUE + return FALSE + return TRUE /mob/living/simple_animal/slime/verb/Feed() set category = "Slime" set desc = "This will let you feed on any valid creature in the surrounding area. This should also be used to halt the feeding process." if(stat) - return 0 + return FALSE var/list/choices = list() for(var/mob/living/C in fov_view(1,src)) @@ -34,10 +34,10 @@ var/mob/living/M = input(src,"Who do you wish to feed on?") in null|choices if(!M) - return 0 + return FALSE if(CanFeedon(M)) Feedon(M) - return 1 + return TRUE /datum/action/innate/slime/feed name = "Feed" diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index 2b267c4d01..f37ecfe7e6 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -326,7 +326,7 @@ if(M.a_intent == INTENT_HELP || M.a_intent == INTENT_DISARM) for(var/datum/surgery/S in surgeries) if(S.next_step(M,M.a_intent)) - return 1 + return TRUE if(..()) //successful attack attacked += 10 @@ -343,7 +343,7 @@ if(user.a_intent == INTENT_HELP || user.a_intent == INTENT_DISARM) for(var/datum/surgery/S in surgeries) if(S.next_step(user,user.a_intent)) - return 1 + return TRUE if(istype(W, /obj/item/stack/sheet/mineral/plasma) && !stat) //Let's you feed slimes plasma. if (user in Friends) ++Friends[user] @@ -478,10 +478,10 @@ docile = 1 /mob/living/simple_animal/slime/can_unbuckle() - return 0 + return FALSE /mob/living/simple_animal/slime/can_buckle() - return 0 + return FALSE /mob/living/simple_animal/slime/get_mob_buckling_height(mob/seat) if(..()) diff --git a/code/modules/mob/living/status_procs.dm b/code/modules/mob/living/status_procs.dm index 498ca19a39..831e8f317b 100644 --- a/code/modules/mob/living/status_procs.dm +++ b/code/modules/mob/living/status_procs.dm @@ -29,7 +29,7 @@ var/datum/status_effect/incapacitating/stun/S = IsStun() if(S) return S.duration - world.time - return 0 + return FALSE /mob/living/proc/Stun(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STUN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -86,7 +86,7 @@ var/datum/status_effect/incapacitating/knockdown/K = IsKnockdown() if(K) return K.duration - world.time - return 0 + return FALSE /mob/living/proc/Knockdown(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_KNOCKDOWN, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -142,7 +142,7 @@ var/datum/status_effect/incapacitating/immobilized/I = IsImmobilized() if(I) return I.duration - world.time - return 0 + return FALSE /mob/living/proc/Immobilize(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_IMMOBILIZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -198,7 +198,7 @@ var/datum/status_effect/incapacitating/paralyzed/P = IsParalyzed(FALSE) if(P) return P.duration - world.time - return 0 + return FALSE /mob/living/proc/Paralyze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_PARALYZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -254,7 +254,7 @@ var/datum/status_effect/incapacitating/dazed/I = IsDazed() if(I) return I.duration - world.time - return 0 + return FALSE /mob/living/proc/Daze(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_DAZE, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -310,7 +310,7 @@ var/datum/status_effect/staggered/I = IsStaggered() if(I) return I.duration - world.time - return 0 + return FALSE /mob/living/proc/Stagger(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_STAGGER, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -417,7 +417,7 @@ var/datum/status_effect/incapacitating/unconscious/U = IsUnconscious() if(U) return U.duration - world.time - return 0 + return FALSE /mob/living/proc/Unconscious(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_UNCONSCIOUS, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) @@ -464,7 +464,7 @@ var/datum/status_effect/incapacitating/sleeping/S = IsSleeping() if(S) return S.duration - world.time - return 0 + return FALSE /mob/living/proc/Sleeping(amount, updating = TRUE, ignore_canstun = FALSE) //Can't go below remaining duration if(SEND_SIGNAL(src, COMSIG_LIVING_STATUS_SLEEP, amount, updating, ignore_canstun) & COMPONENT_NO_STUN) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 0399b2bacb..1e34bb722d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -62,7 +62,7 @@ set hidden = 1 if(!loc) - return 0 + return FALSE var/datum/gas_mixture/environment = loc.return_air() @@ -656,7 +656,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) return /mob/proc/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //For sec bot threat assessment - return 0 + return FALSE /mob/proc/get_ghost(even_if_they_cant_reenter = 0) if(mind) @@ -729,7 +729,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) if(isliving(seat)) var/mob/living/L = seat if(L.mob_size <= MOB_SIZE_SMALL) //being on top of a small mob doesn't put you very high. - return 0 + return FALSE return 9 //can the mob be buckled to something by default? @@ -783,7 +783,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) /mob/proc/fully_replace_character_name(oldname,newname) log_message("[src] name changed from [oldname] to [newname]", LOG_OWNERSHIP) if(!newname) - return 0 + return FALSE real_name = newname name = newname if(mind) @@ -801,7 +801,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) // Only update if this player is a target if(obj.target && obj.target.current && obj.target.current.real_name == name) obj.update_explanation_text() - return 1 + return TRUE //Updates GLOB.data_core records with new name , see mob/living/carbon/human /mob/proc/replace_records_name(oldname,newname) @@ -860,7 +860,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) client.mouse_pointer_icon = client.mouse_override_icon /mob/proc/is_literate() - return 0 + return FALSE /mob/proc/can_hold_items() return FALSE diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index cdad94cf3f..ea7900ebac 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -38,9 +38,9 @@ /proc/above_neck(zone) var/list/zones = list(BODY_ZONE_HEAD, BODY_ZONE_PRECISE_MOUTH, BODY_ZONE_PRECISE_EYES) if(zones.Find(zone)) - return 1 + return TRUE else - return 0 + return FALSE /** * Convert random parts of a passed in message to stars @@ -269,7 +269,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp var/mob/M = i if(M.real_name == msg) return M - return 0 + return FALSE /mob/proc/first_name() var/static/regex/firstname = new("^\[^\\s-\]+") //First word before whitespace or "-" @@ -364,7 +364,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return FALSE /mob/proc/reagent_check(datum/reagent/R) // utilized in the species code - return 1 + return TRUE /proc/notify_ghosts(message, ghost_sound, enter_link, atom/source, mutable_appearance/alert_overlay, action = NOTIFY_JUMP, flashwindow = TRUE, ignore_mapload = TRUE, ignore_key, ignore_dnr_observers = FALSE, header) //Easy notification of ghosts. if(ignore_mapload && SSatoms.initialized != INITIALIZATION_INNEW_REGULAR) //don't notify for objects created during a map load @@ -407,7 +407,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp H.update_damage_overlays() user.visible_message("[user] has fixed some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].", \ "You fix some of the [dam ? "dents on" : "burnt wires in"] [H]'s [affecting.name].") - return 1 //successful heal + return TRUE //successful heal else to_chat(user, "[affecting] is already in good condition!") @@ -478,9 +478,9 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /mob/proc/is_flying(mob/M = src) if(M.movement_type & FLYING) - return 1 + return TRUE else - return 0 + return FALSE /mob/proc/click_random_mob() var/list/nearby_mobs = list() diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index e39a9a976f..71f711e987 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -154,7 +154,7 @@ return TRUE /mob/proc/hivecheck() - return 0 + return FALSE /mob/proc/lingcheck() return LINGHIVE_NONE diff --git a/code/modules/mob/say_readme.dm b/code/modules/mob/say_readme.dm index 6b0eb187ad..3a61bfee1a 100644 --- a/code/modules/mob/say_readme.dm +++ b/code/modules/mob/say_readme.dm @@ -128,7 +128,7 @@ global procs handle_inherent_channels(message, message_mode) If message_mode is MODE_BINARY, MODE_ALIEN or MODE_CHANGELING (or, for AIs, MODE_HOLOPAD), this will - handle speaking in those modes. Return 1 to exit say(). + handle speaking in those modes. return TRUE to exit say(). treat_message(message) What it says on the tin. Treats the message according to masks, mutantraces, mutations, etc. @@ -143,7 +143,7 @@ global procs ITALICS = add italics to the message REDUCE_RANGE = reduce the message range to one tile. - Return 0 if no radio was spoken into. + return FALSE if no radio was spoken into. IMPORTANT: remember to call ..() and check for ..()'s return value properly! ============================RADIOS============================= diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index fa9dc9f4f8..8999941576 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -603,35 +603,35 @@ //Bad mobs! - Remember to add a comment explaining what's wrong with the mob if(!MP) - return 0 //Sanity, this should never happen. + return FALSE //Sanity, this should never happen. if(ispath(MP, /mob/living/simple_animal/hostile/construct)) - return 0 //Verbs do not appear for players. + return FALSE //Verbs do not appear for players. //Good mobs! if(ispath(MP, /mob/living/simple_animal/pet/cat)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/pet/dog/corgi)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/crab)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/hostile/carp)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/hostile/mushroom)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/hostile/construct/shade)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/hostile/killertomato)) - return 1 + return TRUE if(ispath(MP, /mob/living/simple_animal/mouse)) - return 1 //It is impossible to pull up the player panel for mice (Fixed! - Nodrak) + return TRUE //It is impossible to pull up the player panel for mice (Fixed! - Nodrak) if(ispath(MP, /mob/living/simple_animal/hostile/bear)) - return 1 //Bears will auto-attack mobs, even if they're player controlled (Fixed! - Nodrak) + return TRUE //Bears will auto-attack mobs, even if they're player controlled (Fixed! - Nodrak) if(ispath(MP, /mob/living/simple_animal/parrot)) - return 1 //Parrots are no longer unfinished! -Nodrak + return TRUE //Parrots are no longer unfinished! -Nodrak //Not in here? Must be untested! - return 0 + return FALSE #undef TRANSFORMATION_DURATION diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index 2d82988997..267691be39 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -392,7 +392,7 @@ if(network_card) return network_card.get_signal(specific_action) else - return 0 + return FALSE /obj/item/modular_computer/proc/add_log(text) if(!get_ntnet_status()) diff --git a/code/modules/modular_computers/computers/item/computer_power.dm b/code/modules/modular_computers/computers/item/computer_power.dm index f31c3c82cc..7c741507b5 100644 --- a/code/modules/modular_computers/computers/item/computer_power.dm +++ b/code/modules/modular_computers/computers/item/computer_power.dm @@ -24,7 +24,7 @@ var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL] if(battery_module?.battery) return battery_module.battery.give(amount) - return 0 + return FALSE /obj/item/modular_computer/get_cell() var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL] diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index 93324bffe8..f6aed4996b 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -170,7 +170,7 @@ active_program = P P.alert_pending = FALSE update_appearance() - return 1 + return TRUE if("PC_toggle_light") return toggle_flashlight() diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index dc0cdda5d1..264ee0bd2f 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -72,7 +72,7 @@ /datum/computer_file/program/proc/generate_network_log(text) if(computer) return computer.add_log(text) - return 0 + return FALSE /** *Runs when the device is used to attack an atom in non-combat mode. @@ -99,7 +99,7 @@ /datum/computer_file/program/proc/get_signal(specific_action = 0) if(computer) return computer.get_ntnet_status(specific_action) - return 0 + return FALSE // Called by Process() on device that runs us, once every tick. /datum/computer_file/program/proc/process_tick(delta_time) @@ -161,7 +161,7 @@ return computer.get_header_data() return list() -// This is performed on program startup. May be overridden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure. +// This is performed on program startup. May be overridden to add extra logic. Remember to include ..() call. return TRUE on success, 0 on failure. // When implementing new program based device, use this to run the program. /datum/computer_file/program/proc/run_program(mob/living/user) if(can_run(user, 1)) @@ -198,7 +198,7 @@ if(card_holder) ID = card_holder.GetID() generate_network_log("Connection closed -- Program ID: [filename] User:[ID?"[ID.registered_name]":"None"]") - return 1 + return TRUE /datum/computer_file/program/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 80c0c4dfa8..88d52646ac 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -23,7 +23,7 @@ program_icon_state = "alert-green" ui_header = "alarm_green.gif" update_computer_icon() - return 1 + return TRUE /datum/computer_file/program/alarm_monitor/ui_data(mob/user) var/list/data = get_header_data() diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm index cf5d950c0f..567ff436a6 100644 --- a/code/modules/modular_computers/file_system/programs/configurator.dm +++ b/code/modules/modular_computers/file_system/programs/configurator.dm @@ -27,7 +27,7 @@ // No computer connection, we can't get data from that. if(!movable) - return 0 + return FALSE var/list/data = get_header_data() diff --git a/code/modules/modular_computers/hardware/_hardware.dm b/code/modules/modular_computers/hardware/_hardware.dm index b1a44c4cc5..20995502ae 100644 --- a/code/modules/modular_computers/hardware/_hardware.dm +++ b/code/modules/modular_computers/hardware/_hardware.dm @@ -51,11 +51,11 @@ var/obj/item/stack/S = I if(obj_integrity == max_integrity) to_chat(user, span_warning("\The [src] doesn't seem to require repairs.")) - return 1 + return TRUE if(S.use(1)) to_chat(user, span_notice("You patch up \the [src] with a bit of \the [I].")) obj_integrity = min(obj_integrity + 10, max_integrity) - return 1 + return TRUE if(try_insert(I, user)) return TRUE diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index 074e158dbf..229b16c99d 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -34,16 +34,16 @@ // 0 - No signal, 1 - Low signal, 2 - High signal. 3 - Wired Connection /obj/item/computer_hardware/network_card/proc/get_signal(specific_action = 0) if(!holder) // Hardware is not installed in anything. No signal. How did this even get called? - return 0 + return FALSE if(!check_functionality()) - return 0 + return FALSE if(ethernet) // Computer is connected via wired connection. return 3 if(!SSnetworks.station_network || !SSnetworks.station_network.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. - return 0 + return FALSE if(holder) @@ -53,12 +53,12 @@ if(long_range) return 2 else - return 1 + return TRUE if(long_range) // Computer is not on station, but it has upgraded network card. Low signal. - return 1 + return TRUE - return 0 // Computer is not on station and does not have upgraded network card. No signal. + return FALSE // Computer is not on station and does not have upgraded network card. No signal. /obj/item/computer_hardware/network_card/advanced diff --git a/code/modules/modular_computers/hardware/recharger.dm b/code/modules/modular_computers/hardware/recharger.dm index e8c479db47..8e9183ead2 100644 --- a/code/modules/modular_computers/hardware/recharger.dm +++ b/code/modules/modular_computers/hardware/recharger.dm @@ -95,5 +95,5 @@ charge_rate = 100000 /obj/item/computer_hardware/recharger/lambda/use_power(amount, charging=0) - return 1 + return TRUE diff --git a/code/modules/movespeed/_movespeed_modifier.dm b/code/modules/movespeed/_movespeed_modifier.dm index 5fc415b2b6..1dfea6ac1a 100644 --- a/code/modules/movespeed/_movespeed_modifier.dm +++ b/code/modules/movespeed/_movespeed_modifier.dm @@ -199,7 +199,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache) /mob/proc/get_config_multiplicative_speed(floating = FALSE) var/list/read = floating? GLOB.mob_config_movespeed_type_lookup_floating : GLOB.mob_config_movespeed_type_lookup if(!islist(read) || !read[type]) - return 0 + return FALSE else return read[type] diff --git a/code/modules/newscaster/newspaper.dm b/code/modules/newscaster/newspaper.dm index 0afb36a7e7..0142e84e26 100644 --- a/code/modules/newscaster/newspaper.dm +++ b/code/modules/newscaster/newspaper.dm @@ -113,17 +113,17 @@ /obj/item/newspaper/proc/notContent(list/L) if(!L.len) - return 0 + return FALSE for(var/i=L.len;i>0;i--) var/num = abs(L[i]) if(creationTime <= num) continue else if(L[i] > 0) - return 1 + return TRUE else - return 0 - return 0 + return FALSE + return FALSE /obj/item/newspaper/Topic(href, href_list) var/mob/living/U = usr diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index f46d4bf029..d9f6607209 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -189,31 +189,31 @@ /obj/item/paper/contract/infernal/proc/attempt_signature(mob/living/carbon/human/user, blood = 0) if(!user.IsAdvancedToolUser() || !user.is_literate()) to_chat(user, "You don't know how to read or write.") - return 0 + return FALSE if(user.mind != target) to_chat(user, "Your signature simply slides off the sheet, it seems this contract is not meant for you to sign.") - return 0 + return FALSE if(user.mind.soulOwner == owner) to_chat(user, "This devil already owns your soul, you may not sell it to [owner.p_them()] again.") - return 0 + return FALSE if(signed) to_chat(user, "This contract has already been signed. It may not be signed again.") - return 0 + return FALSE if(!user.mind.hasSoul) to_chat(user, "You do not possess a soul.") - return 0 + return FALSE if(HAS_TRAIT(user, TRAIT_DUMB)) to_chat(user, "You quickly scrawl 'your name' on the contract.") signIncorrectly() - return 0 + return FALSE if (contractType == CONTRACT_REVIVE) to_chat(user, "You are already alive, this contract would do nothing.") - return 0 + return FALSE else to_chat(user, "You quickly scrawl your name on the contract") if(fulfillContract(target.current, blood)<=0) to_chat(user, "But it seemed to have no effect, perhaps even Hell itself cannot grant this boon?") - return 1 + return TRUE @@ -221,7 +221,7 @@ if (target == M.mind && M.stat == DEAD && M.mind.soulOwner == M.mind) if (cooldown) to_chat(user, "Give [M] a chance to think through the contract, don't rush [M.p_them()].") - return 0 + return FALSE cooldown = TRUE var/mob/living/carbon/human/H = M var/mob/dead/observer/ghost = H.get_ghost() diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm index 5b9bf71a9b..4d112dc111 100644 --- a/code/modules/power/antimatter/control.dm +++ b/code/modules/power/antimatter/control.dm @@ -197,23 +197,23 @@ /obj/machinery/power/am_control_unit/proc/add_shielding(obj/machinery/am_shielding/AMS, AMS_linking = 0) if(!istype(AMS)) - return 0 + return FALSE if(!anchored) - return 0 + return FALSE if(!AMS_linking && !AMS.link_control(src)) - return 0 + return FALSE linked_shielding.Add(AMS) update_shield_icons = 1 - return 1 + return TRUE /obj/machinery/power/am_control_unit/proc/remove_shielding(obj/machinery/am_shielding/AMS) if(!istype(AMS)) - return 0 + return FALSE linked_shielding.Remove(AMS) update_shield_icons = 2 if(active) toggle_power() - return 1 + return TRUE /obj/machinery/power/am_control_unit/proc/check_stability()//TODO: make it break when low also might want to add a way to fix it like a part or such that can be replaced if(stability <= 0) diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index e9ee1e70d0..e1e91d2f77 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -80,7 +80,7 @@ /obj/machinery/am_shielding/CanPass(atom/movable/mover, turf/target) - return 0 + return FALSE /obj/machinery/am_shielding/process() @@ -167,12 +167,12 @@ //Call this to link a detected shilding unit to the controller /obj/machinery/am_shielding/proc/link_control(obj/machinery/power/am_control_unit/AMC) if(!istype(AMC)) - return 0 + return FALSE if(control_unit && control_unit != AMC) return 0//Already have one control_unit = AMC control_unit.add_shielding(src,1) - return 1 + return TRUE //Scans cards for shields or the control unit and if all there it @@ -186,8 +186,8 @@ found_am_device = 1 break if(!found_am_device) - return 0 - return 1 + return FALSE + return TRUE /obj/machinery/am_shielding/proc/setup_core() diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 9896cc4088..d79cd979b7 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -860,7 +860,7 @@ /obj/machinery/power/apc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 10 && (!(stat & BROKEN) || malfai)) - return 0 + return FALSE . = ..() @@ -1343,7 +1343,7 @@ if(terminal) return terminal.surplus() else - return 0 + return FALSE /obj/machinery/power/apc/add_load(amount) if(terminal && terminal.powernet) @@ -1353,7 +1353,7 @@ if(terminal) return terminal.avail(amount) else - return 0 + return FALSE /obj/machinery/power/apc/process() if(icon_update_needed) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index c1439e773c..32c136dd90 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -198,12 +198,12 @@ By design, d1 is the smallest direction and d2 is the highest // shock the user with probability prb /obj/structure/cable/proc/shock(mob/user, prb, siemens_coeff = 1) if(!prob(prb)) - return 0 + return FALSE if (electrocute_mob(user, powernet, src, siemens_coeff)) do_sparks(5, TRUE, src) - return 1 + return TRUE else - return 0 + return FALSE /obj/structure/cable/singularity_pull(S, current_size) ..() @@ -235,13 +235,13 @@ By design, d1 is the smallest direction and d2 is the highest if(powernet) return clamp(powernet.avail-powernet.load, 0, powernet.avail) else - return 0 + return FALSE /obj/structure/cable/proc/avail(amount) if(powernet) return amount ? powernet.avail >= amount : powernet.avail else - return 0 + return FALSE /obj/structure/cable/proc/add_delayedload(amount) if(powernet) @@ -251,13 +251,13 @@ By design, d1 is the smallest direction and d2 is the highest if(powernet) return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail) else - return 0 + return FALSE /obj/structure/cable/proc/newavail() if(powernet) return powernet.newavail else - return 0 + return FALSE ///////////////////////////////////////////////// // Cable laying helpers diff --git a/code/modules/power/cell.dm b/code/modules/power/cell.dm index 6d1da2bc20..51710affc0 100644 --- a/code/modules/power/cell.dm +++ b/code/modules/power/cell.dm @@ -76,13 +76,13 @@ /obj/item/stock_parts/cell/use(amount, can_explode = TRUE) if(rigged && amount > 0 && can_explode) explode() - return 0 + return FALSE if(charge < amount) - return 0 + return FALSE charge -= amount if(!istype(loc, /obj/machinery/power/apc)) SSblackbox.record_feedback("tally", "cell_used", 1, type) - return 1 + return TRUE // recharge the cell /obj/item/stock_parts/cell/proc/give(amount) @@ -90,7 +90,7 @@ return if(rigged && amount > 0) explode() - return 0 + return FALSE if(maxcharge < amount) amount = maxcharge var/power_used = min(maxcharge-charge,amount) @@ -182,7 +182,7 @@ if(charge >= 1000) return clamp(round(charge/10000), 10, 90) + rand(-5,5) else - return 0 + return FALSE /obj/item/stock_parts/cell/get_part_rating() return rating * maxcharge @@ -298,7 +298,7 @@ chargerate = 30000 /obj/item/stock_parts/cell/infinite/use() - return 1 + return TRUE /obj/item/stock_parts/cell/infinite/abductor name = "void core" diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index a44a0faa06..24e7581966 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -44,13 +44,13 @@ if(powernet) return clamp(powernet.avail-powernet.load, 0, powernet.avail) else - return 0 + return FALSE /obj/machinery/power/proc/avail(amount) if(powernet) return amount ? powernet.avail >= amount : powernet.avail else - return 0 + return FALSE /obj/machinery/power/proc/add_delayedload(amount) if(powernet) @@ -60,13 +60,13 @@ if(powernet) return clamp(powernet.newavail - powernet.delayedload, 0, powernet.newavail) else - return 0 + return FALSE /obj/machinery/power/proc/newavail() if(powernet) return powernet.newavail else - return 0 + return FALSE /obj/machinery/power/proc/disconnect_terminal() // machines without a terminal will just return, no harm no fowl. return @@ -309,17 +309,17 @@ //No animations will be performed by this proc. /proc/electrocute_mob(mob/living/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE) if(!istype(M) || ismecha(M.loc)) - return 0 //feckin mechs are dumb + return FALSE //feckin mechs are dumb if(dist_check) if(!in_range(source,M)) - return 0 + return FALSE if(ishuman(M)) var/mob/living/carbon/human/H = M if(H.gloves) var/obj/item/clothing/gloves/G = H.gloves if(G.siemens_coefficient == 0) SEND_SIGNAL(M, COMSIG_LIVING_SHOCK_PREVENTED, power_source, source, siemens_coeff, dist_check) - return 0 //to avoid spamming with insulated glvoes on + return FALSE //to avoid spamming with insulated glvoes on var/area/source_area if(istype(power_source, /area)) @@ -342,12 +342,12 @@ if (apc.terminal) PN = apc.terminal.powernet else if (!power_source) - return 0 + return FALSE else log_admin("ERROR: /proc/electrocute_mob([M], [power_source], [source]): wrong power_source") - return 0 + return FALSE if (!cell && !PN) - return 0 + return FALSE var/PN_damage = 0 var/cell_damage = 0 if (PN) diff --git a/code/modules/power/powernet.dm b/code/modules/power/powernet.dm index ff69adc894..a8b52ca84a 100644 --- a/code/modules/power/powernet.dm +++ b/code/modules/power/powernet.dm @@ -98,4 +98,4 @@ if(avail >= 1000) return clamp(round(avail/10000), 10, 90) + rand(-5,5) else - return 0 + return FALSE diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index be03e8a9c9..0f6bd1aee7 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -426,7 +426,7 @@ for(var/obj/item/I in U.held_items) if(istype(I, /obj/item/turret_control)) qdel(I) - UpdateButtonIcon() + UpdateButtons() return else playsound(PE,'sound/mecha/mechmove01.ogg', 50, TRUE) @@ -443,7 +443,7 @@ else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand var/obj/item/turret_control/TC = new /obj/item/turret_control() U.put_in_hands(TC) - UpdateButtonIcon() + UpdateButtons() /obj/item/turret_control diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index 567ac00487..fba18c70dc 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -76,7 +76,7 @@ field_generator power level display if(get_dist(src, user) <= 1)//Need to actually touch the thing to turn it on if(active >= FG_CHARGING) to_chat(user, "You are unable to turn off [src] once it is online!") - return 1 + return TRUE else user.visible_message("[user] turns on [src].", \ "You turn on [src].", \ @@ -157,7 +157,7 @@ field_generator power level display /obj/machinery/field/generator/blob_act(obj/structure/blob/B) if(active) - return 0 + return FALSE else ..() @@ -207,25 +207,25 @@ field_generator power level display if(draw_power(round(power_draw/2,1))) check_power_level() - return 1 + return TRUE else visible_message("The [name] shuts down!", "You hear something shutting down.") turn_off() investigate_log("ran out of power and deactivated", INVESTIGATE_SINGULO) power = 0 check_power_level() - return 0 + return FALSE //This could likely be better, it tends to start loopin if you have a complex generator loop setup. Still works well enough to run the engine fields will likely recode the field gens and fields sometime -Mport /obj/machinery/field/generator/proc/draw_power(draw = 0, failsafe = FALSE, obj/machinery/field/generator/G = null, obj/machinery/field/generator/last = null) if((G && (G == src)) || (failsafe >= 8))//Loopin, set fail - return 0 + return FALSE else failsafe++ if(power >= draw)//We have enough power power -= draw - return 1 + return TRUE else//Need more power draw -= power @@ -236,14 +236,14 @@ field_generator power level display continue if(G)//Another gen is askin for power and we dont have it if(FG.draw_power(draw,failsafe,G,src))//Can you take the load - return 1 + return TRUE else - return 0 + return FALSE else//We are askin another for power if(FG.draw_power(draw,failsafe,src,src)) - return 1 + return TRUE else - return 0 + return FALSE /obj/machinery/field/generator/proc/start_fields() @@ -266,22 +266,22 @@ field_generator power level display /obj/machinery/field/generator/proc/setup_field(NSEW) var/turf/T = loc if(!istype(T)) - return 0 + return FALSE var/obj/machinery/field/generator/G = null var/steps = 0 if(!NSEW)//Make sure its ran right - return 0 + return FALSE for(var/dist in 0 to 7) // checks out to 8 tiles away for another generator T = get_step(T, NSEW) if(T.density)//We cant shoot a field though this - return 0 + return FALSE G = locate(/obj/machinery/field/generator) in T if(G) steps -= 1 if(!G.active) - return 0 + return FALSE break for(var/TC in T.contents) @@ -289,12 +289,12 @@ field_generator power level display if(ismob(A)) continue if(A.density) - return 0 + return FALSE steps++ if(!G) - return 0 + return FALSE T = loc for(var/dist in 0 to steps) // creates each field tile diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm index 6938352d16..a101521927 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm @@ -141,8 +141,8 @@ /obj/structure/particle_accelerator/proc/connect_master(obj/O) if(O.dir == dir) master = O - return 1 - return 0 + return TRUE + return FALSE /////////// // PARTS // diff --git a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm index fc7cca55e6..bfcb53db7c 100644 --- a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm +++ b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm @@ -21,8 +21,8 @@ /obj/structure/particle_accelerator/particle_emitter/proc/set_delay(delay) if(delay >= 0) fire_delay = delay - return 1 - return 0 + return TRUE + return FALSE /obj/structure/particle_accelerator/particle_emitter/proc/emit_particle(strength = 0) if((last_shot + fire_delay) <= world.time) @@ -39,5 +39,5 @@ if(3) P = new/obj/effect/accelerated_particle/powerful(T) P.setDir(dir) - return 1 - return 0 + return TRUE + return FALSE diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 29fd68d034..b1f8efae6e 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -57,7 +57,7 @@ return ..() else last_failed_movement = direct - return 0 + return FALSE /obj/singularity/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags) consume(user) @@ -74,10 +74,10 @@ /obj/singularity/attackby(obj/item/W, mob/user, params) consume(user) - return 1 + return TRUE /obj/singularity/Process_Spacemove() //The singularity stops drifting for no man! - return 0 + return FALSE /obj/singularity/blob_act(obj/structure/blob/B) return @@ -235,18 +235,18 @@ dissipate = 0 if(current_size == allowed_size) investigate_log("grew to size [current_size]", INVESTIGATE_SINGULO) - return 1 + return TRUE else if(current_size < (--temp_allowed_size)) expand(temp_allowed_size) else - return 0 + return FALSE /obj/singularity/proc/check_energy() if(energy <= 0) investigate_log("collapsed.", INVESTIGATE_SINGULO) qdel(src) - return 0 + return FALSE switch(energy)//Some of these numbers might need to be changed up later -Mport if(1 to 199) allowed_size = STAGE_ONE @@ -263,7 +263,7 @@ allowed_size = STAGE_FIVE if(current_size != allowed_size) expand() - return 1 + return TRUE /obj/singularity/proc/eat() @@ -296,7 +296,7 @@ /obj/singularity/proc/move(force_move = 0) if(!move_self) - return 0 + return FALSE var/movement_dir = pick(GLOB.alldirs - last_failed_movement) @@ -321,7 +321,7 @@ /obj/singularity/proc/check_turfs_in(direction = 0, step = 0) if(!direction) - return 0 + return FALSE var/steps = 0 if(!step) switch(current_size) @@ -342,7 +342,7 @@ for(var/i = 1 to steps) T = get_step(T,direction) if(!isturf(T)) - return 0 + return FALSE turfs.Add(T) var/dir2 = 0 var/dir3 = 0 @@ -357,35 +357,35 @@ for(var/j = 1 to steps-1) T2 = get_step(T2,dir2) if(!isturf(T2)) - return 0 + return FALSE turfs.Add(T2) for(var/k = 1 to steps-1) T = get_step(T,dir3) if(!isturf(T)) - return 0 + return FALSE turfs.Add(T) for(var/turf/T3 in turfs) if(isnull(T3)) continue if(!can_move(T3)) - return 0 - return 1 + return FALSE + return TRUE /obj/singularity/proc/can_move(turf/T) if(!T) - return 0 + return FALSE if((locate(/obj/machinery/field/containment) in T)||(locate(/obj/machinery/shieldwall) in T)) - return 0 + return FALSE else if(locate(/obj/machinery/field/generator) in T) var/obj/machinery/field/generator/G = locate(/obj/machinery/field/generator) in T if(G && G.active) - return 0 + return FALSE else if(locate(/obj/machinery/shieldwallgen) in T) var/obj/machinery/shieldwallgen/S = locate(/obj/machinery/shieldwallgen) in T if(S && S.active) - return 0 - return 1 + return FALSE + return TRUE /obj/singularity/proc/event() @@ -397,11 +397,11 @@ mezzer() if(3,4) //Sets all nearby mobs on fire if(current_size < STAGE_SIX) - return 0 + return FALSE combust_mobs() else - return 0 - return 1 + return FALSE + return TRUE /obj/singularity/proc/combust_mobs() diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 0f0f853036..4c5502a277 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -264,7 +264,7 @@ tracker = TRUE qdel(W) user.visible_message("[user] inserts the electronics into the solar assembly.", "You insert the electronics into the solar assembly.") - return 1 + return TRUE else if(W.tool_behaviour == TOOL_CROWBAR) new /obj/item/electronics/tracker(src.loc) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index a8f33ab07c..5096c54889 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -720,7 +720,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) if(damage > explosion_point) countdown() - return 1 + return TRUE /obj/machinery/power/supermatter_crystal/bullet_act(obj/item/projectile/Proj) var/turf/L = loc diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index c32bbc0c86..2a6df54e9b 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -194,6 +194,6 @@ if(anchored && !panel_open) flick("grounding_rodhit", src) zap_buckle_check(power) - return 0 + return FALSE else . = ..() diff --git a/code/modules/procedural_mapping/mapGenerator.dm b/code/modules/procedural_mapping/mapGenerator.dm index 323f74d0ef..3592e3bb1f 100644 --- a/code/modules/procedural_mapping/mapGenerator.dm +++ b/code/modules/procedural_mapping/mapGenerator.dm @@ -37,7 +37,7 @@ //Returns the map /datum/mapGenerator/proc/defineRegion(turf/Start, turf/End, replace = 0) if(!checkRegion(Start, End)) - return 0 + return FALSE if(replace) undefineRegion() @@ -49,7 +49,7 @@ //Returns the map /datum/mapGenerator/proc/defineCircularRegion(turf/Start, turf/End, replace = 0) if(!checkRegion(Start, End)) - return 0 + return FALSE var/centerX = max(abs((End.x+Start.x)/2),1) var/centerY = max(abs((End.y+Start.y)/2),1) @@ -92,7 +92,7 @@ . = 1 if(!Start || !End) - return 0 //Just bail + return FALSE //Just bail if(Start.x > world.maxx || End.x > world.maxx) . = 0 diff --git a/code/modules/procedural_mapping/mapGeneratorModule.dm b/code/modules/procedural_mapping/mapGeneratorModule.dm index 3a78d8385e..790d98576e 100644 --- a/code/modules/procedural_mapping/mapGeneratorModule.dm +++ b/code/modules/procedural_mapping/mapGeneratorModule.dm @@ -28,7 +28,7 @@ //Place a spawnable atom or turf on this turf /datum/mapGeneratorModule/proc/place(turf/T) if(!T) - return 0 + return FALSE var/clustering = 0 var/skipLoopIteration = FALSE @@ -107,7 +107,7 @@ /datum/mapGeneratorModule/proc/checkPlaceAtom(turf/T) . = 1 if(!T) - return 0 + return FALSE if(T.density) . = 0 for(var/atom/A in T) diff --git a/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm b/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm index 18607b919a..6f5efc32c7 100644 --- a/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm +++ b/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm @@ -61,8 +61,8 @@ for(var/direction in list(SOUTH,EAST,WEST,NORTH)) if (get_step(T,direction) in mother.map) continue - return 1 - return 0 + return TRUE + return FALSE /datum/mapGenerator/repressurize modules = list(/datum/mapGeneratorModule/bottomLayer/repressurize) diff --git a/code/modules/procedural_mapping/mapGenerators/cellular.dm b/code/modules/procedural_mapping/mapGenerators/cellular.dm index 5fc1344dc4..cf0423d2fd 100644 --- a/code/modules/procedural_mapping/mapGenerators/cellular.dm +++ b/code/modules/procedural_mapping/mapGenerators/cellular.dm @@ -78,10 +78,10 @@ value -= old_state[i][j] if(value in b_rule) - return 1 + return TRUE if(value in s_rule) return old_state[i][j] - return 0 + return FALSE /datum/mapGenerator/ca/caves b_rule = list(5,6,7,8) diff --git a/code/modules/projectiles/ammunition/_firing.dm b/code/modules/projectiles/ammunition/_firing.dm index 437b7dcc5a..4190db7803 100644 --- a/code/modules/projectiles/ammunition/_firing.dm +++ b/code/modules/projectiles/ammunition/_firing.dm @@ -19,7 +19,7 @@ user.DelayNextAction(considered_action = TRUE, immediate = FALSE) user.newtonian_move(get_dir(target, user)) update_icon() - return 1 + return TRUE /obj/item/ammo_casing/proc/ready_proj(atom/target, mob/living/user, quiet, zone_override = "", fired_from) if (!BB) @@ -52,7 +52,7 @@ /obj/item/ammo_casing/proc/throw_proj(atom/target, turf/targloc, mob/living/user, params, spread) var/turf/curloc = get_turf(user) if (!istype(targloc) || !istype(curloc) || !BB) - return 0 + return FALSE var/firing_dir if(BB.firer) @@ -68,7 +68,7 @@ BB.preparePixelProjectile(target, user, params, spread) BB.fire(null, direct_target) BB = null - return 1 + return TRUE /obj/item/ammo_casing/proc/spread(turf/target, turf/current, distro) var/dx = abs(target.x - current.x) diff --git a/code/modules/projectiles/boxes_magazines/_box_magazine.dm b/code/modules/projectiles/boxes_magazines/_box_magazine.dm index e44fcb38c8..3a84a6106c 100644 --- a/code/modules/projectiles/boxes_magazines/_box_magazine.dm +++ b/code/modules/projectiles/boxes_magazines/_box_magazine.dm @@ -51,12 +51,12 @@ /obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0) // Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type. if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type)) - return 0 + return FALSE if (stored_ammo.len < max_ammo) stored_ammo += R R.forceMove(src) - return 1 + return TRUE //for accessibles magazines (e.g internal ones) when full, start replacing spent ammo else if(replace_spent) @@ -67,12 +67,12 @@ stored_ammo += R R.forceMove(src) - return 1 + return TRUE - return 0 + return FALSE /obj/item/ammo_box/proc/can_load(mob/user) - return 1 + return TRUE /obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = FALSE, replace_spent = 0) var/num_loaded = 0 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index a0f98f4046..18feb97cf1 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -142,7 +142,7 @@ if(fire_select_modes.len > 1) firemode_action = new(src) firemode_action.button_icon_state = "fireselect_[fire_select]" - firemode_action.UpdateButtonIcon() + firemode_action.UpdateButtons() /obj/item/gun/ComponentInitialize() . = ..() @@ -219,7 +219,7 @@ playsound(user, 'sound/weapons/empty.ogg', 100, TRUE) update_appearance() firemode_action.button_icon_state = "fireselect_[fire_select]" - firemode_action.UpdateButtonIcon() + firemode_action.UpdateButtons() return TRUE /obj/item/gun/equipped(mob/living/user, slot) @@ -670,7 +670,7 @@ update_icon() for(var/X in actions) var/datum/action/A = X - A.UpdateButtonIcon() + A.UpdateButtons() /obj/item/gun/update_overlays() . = ..() @@ -807,7 +807,7 @@ return ..() /obj/item/gun/proc/getinaccuracy(mob/living/user, bonus_spread, stamloss) - return 0 // Replacement TBD: Exponential curved aim instability system. + return FALSE // Replacement TBD: Exponential curved aim instability system. /* if(inaccuracy_modifier == 0) diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index 5c6aff5564..4d2bd844ae 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -48,8 +48,8 @@ /obj/item/gun/ballistic/can_shoot() if(!magazine || !magazine.ammo_count(0)) - return 0 - return 1 + return FALSE + return TRUE /obj/item/gun/ballistic/attackby(obj/item/A, mob/user, params) ..() @@ -68,7 +68,7 @@ playsound(src, "gun_insert_empty_magazine", 70, 1) A.update_icon() update_icon() - return 1 + return TRUE else to_chat(user, "You cannot seem to get \the [src] out of your hands!") return @@ -89,7 +89,7 @@ to_chat(user, "You screw [S] onto [src].") install_suppressor(A) return - return 0 + return FALSE /obj/item/gun/ballistic/proc/install_suppressor(obj/item/suppressor/S) // this proc assumes that the suppressor is already inside src @@ -205,7 +205,7 @@ slot_flags |= ITEM_SLOT_BELT //but you can wear it on your belt (poorly concealed under a trenchcoat, ideally) sawn_off = TRUE update_icon() - return 1 + return TRUE /// is something supposed to happen here? /obj/item/gun/ballistic/proc/on_sawoff(mob/user) diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index 4d08520246..0bb1c3cada 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -52,7 +52,7 @@ chamber_round() A.update_icon() update_icon() - return 1 + return TRUE else to_chat(user, "You cannot seem to get \the [src] out of your hands!") diff --git a/code/modules/projectiles/guns/ballistic/magweapon.dm b/code/modules/projectiles/guns/ballistic/magweapon.dm index f3a11eb179..cdb88f754a 100644 --- a/code/modules/projectiles/guns/ballistic/magweapon.dm +++ b/code/modules/projectiles/guns/ballistic/magweapon.dm @@ -37,13 +37,13 @@ /obj/item/gun/ballistic/automatic/magrifle/can_shoot() if(QDELETED(cell)) - return 0 + return FALSE var/obj/item/ammo_casing/caseless/magnetic/shot = chambered if(!shot) - return 0 + return FALSE if(cell.charge < shot.energy_cost * burst_size) - return 0 + return FALSE . = ..() /obj/item/gun/ballistic/automatic/magrifle/shoot_live_shot(mob/living/user, pointblank = FALSE, mob/pbtarget, message = 1, stam_cost = 0) diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 0b92e63ca6..4841179185 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -37,7 +37,7 @@ /obj/item/gun/ballistic/shotgun/can_shoot() if(!chambered) - return 0 + return FALSE return (chambered.BB ? 1 : 0) /obj/item/gun/ballistic/shotgun/attack_self(mob/living/user) @@ -67,7 +67,7 @@ pump_unload(M) pump_reload(M) update_icon() //I.E. fix the desc - return 1 + return TRUE /obj/item/gun/ballistic/shotgun/proc/pump_unload(mob/M) if(chambered)//We have a shell in the chamber @@ -77,7 +77,7 @@ /obj/item/gun/ballistic/shotgun/proc/pump_reload(mob/M) if(!magazine.ammo_count()) - return 0 + return FALSE var/obj/item/ammo_casing/AC = magazine.get_round() //load next casing. chambered = AC @@ -147,7 +147,7 @@ pump_unload(M) bolt_open = !bolt_open update_icon() //I.E. fix the desc - return 1 + return TRUE /obj/item/gun/ballistic/shotgun/boltaction/attackby(obj/item/A, mob/user, params) if(!bolt_open) diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 9c9ccd2b8d..aa5fafac9b 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -203,7 +203,7 @@ /obj/item/gun/energy/kinetic_accelerator/getstamcost(mob/living/carbon/user) if(user && !lavaland_equipment_pressure_check(get_turf(user))) - return 0 + return FALSE else return ..() diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index 4192f038c2..eaa0dae83d 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -66,12 +66,12 @@ /obj/item/gun/magic/process() charge_tick++ if(charge_tick < recharge_rate || charges >= max_charges) - return 0 + return FALSE charge_tick = 0 charges++ if(charges == 1) recharge_newshot() - return 1 + return TRUE /obj/item/gun/magic/shoot_with_empty_chamber(mob/living/user as mob|obj) to_chat(user, "The [name] whizzles quietly.") diff --git a/code/modules/projectiles/guns/misc/beam_rifle.dm b/code/modules/projectiles/guns/misc/beam_rifle.dm index 6f70998834..ed68edf96e 100644 --- a/code/modules/projectiles/guns/misc/beam_rifle.dm +++ b/code/modules/projectiles/guns/misc/beam_rifle.dm @@ -200,7 +200,9 @@ else P.color = rgb(0, 255, 0) var/turf/curloc = get_turf(src) - var/turf/targloc = get_turf(current_user.client.mouseObject) + + var/atom/target_atom = current_user.client.mouse_object_ref?.resolve() + var/turf/targloc = get_turf(target_atom) if(!istype(targloc)) if(!istype(curloc)) return @@ -293,7 +295,9 @@ process_aim() if(fire_check() && can_trigger_gun(M)) sync_ammo() - do_fire(M.client.mouseObject, M, FALSE, M.client.mouseParams, M.zone_selected) + var/atom/target = M.client.mouse_object_ref?.resolve() + if(target) + afterattack(target, M, FALSE, M.client.mouseParams) stop_aiming() QDEL_LIST(current_tracers) return ..() @@ -469,7 +473,7 @@ return 0.5 if(istype(target, /obj/structure/blob)) return 0.65 //CIT CHANGE. - return 1 + return TRUE /obj/item/projectile/beam/beam_rifle/proc/handle_impact(atom/target) if(isobj(target)) diff --git a/code/modules/projectiles/guns/misc/blastcannon.dm b/code/modules/projectiles/guns/misc/blastcannon.dm index a88f395561..3372f70444 100644 --- a/code/modules/projectiles/guns/misc/blastcannon.dm +++ b/code/modules/projectiles/guns/misc/blastcannon.dm @@ -72,20 +72,20 @@ //returns the third value of a bomb blast /obj/item/gun/blastcannon/proc/calculate_bomb() if(!istype(bomb) || !istype(bomb.tank_one) || !istype(bomb.tank_two)) - return 0 + return FALSE var/datum/gas_mixture/temp = new(max(reaction_volume_mod, 0)) bomb.merge_gases(temp) if(prereaction) temp.react(src) var/prereaction_pressure = temp.return_pressure() if(prereaction_pressure < TANK_FRAGMENT_PRESSURE) - return 0 + return FALSE for(var/i in 1 to reaction_cycles) temp.react(src) var/pressure = temp.return_pressure() qdel(temp) if(pressure < TANK_FRAGMENT_PRESSURE) - return 0 + return FALSE return ((pressure - TANK_FRAGMENT_PRESSURE) / TANK_FRAGMENT_SCALE) /obj/item/gun/blastcannon/afterattack(atom/target, mob/user, flag, params) diff --git a/code/modules/projectiles/guns/misc/medbeam.dm b/code/modules/projectiles/guns/misc/medbeam.dm index 4a64317fd9..a4ee003d7b 100644 --- a/code/modules/projectiles/guns/misc/medbeam.dm +++ b/code/modules/projectiles/guns/misc/medbeam.dm @@ -87,7 +87,7 @@ if(mounted) user_turf = get_turf(user) else if(!istype(user_turf)) - return 0 + return FALSE var/obj/dummy = new(user_turf) dummy.pass_flags |= PASSTABLE|PASSGLASS|PASSGRILLE //Grille/Glass so it can be used through common windows for(var/turf/turf in getline(user_turf,target)) @@ -95,18 +95,18 @@ continue //Mechs are dense and thus fail the check if(turf.density) qdel(dummy) - return 0 + return FALSE for(var/atom/movable/AM in turf) if(!AM.CanPass(dummy,turf,1)) qdel(dummy) - return 0 + return FALSE for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams! if(B.owner.origin != current_beam.origin) explosion(B.loc,0,3,5,8) qdel(dummy) - return 0 + return FALSE qdel(dummy) - return 1 + return TRUE /obj/item/gun/medbeam/proc/on_beam_hit(var/mob/living/target) return diff --git a/code/modules/projectiles/guns/misc/syringe_gun.dm b/code/modules/projectiles/guns/misc/syringe_gun.dm index 8de7633a79..7ced76918c 100644 --- a/code/modules/projectiles/guns/misc/syringe_gun.dm +++ b/code/modules/projectiles/guns/misc/syringe_gun.dm @@ -38,18 +38,18 @@ /obj/item/gun/syringe/attack_self(mob/living/user) if(!syringes.len) to_chat(user, "[src] is empty!") - return 0 + return FALSE var/obj/item/reagent_containers/syringe/S = syringes[syringes.len] if(!S) - return 0 + return FALSE S.forceMove(user.loc) syringes.Remove(S) to_chat(user, "You unload [S] from \the [src].") - return 1 + return TRUE /obj/item/gun/syringe/attackby(obj/item/A, mob/user, params, show_msg = TRUE) if(istype(A, /obj/item/reagent_containers/syringe)) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 0aee51bb84..aa90ea470a 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -939,12 +939,10 @@ var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32 //Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average. - var/list/screenview = getviewsize(user.client.view) - var/screenviewX = screenview[1] * world.icon_size - var/screenviewY = screenview[2] * world.icon_size + var/list/screenview = view_to_pixels(user.client.view) - var/ox = round(screenviewX/2) - user.client.pixel_x //"origin" x - var/oy = round(screenviewY/2) - user.client.pixel_y //"origin" y + var/ox = round(screenview[1] / 2) - user.client.pixel_x //"origin" x + var/oy = round(screenview[2] / 2) - user.client.pixel_y //"origin" y angle = arctan(y - oy, x - ox) return list(angle, p_x, p_y) diff --git a/code/modules/reagents/chem_splash.dm b/code/modules/reagents/chem_splash.dm index b16392ecd1..36d75bf7dd 100644 --- a/code/modules/reagents/chem_splash.dm +++ b/code/modules/reagents/chem_splash.dm @@ -73,6 +73,6 @@ splash_holder.reaction(A, TOUCH, fraction) qdel(splash_holder) - return 1 + return TRUE diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 77d713047a..57e7d660b3 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -552,7 +552,7 @@ fermiIsReacting = FALSE SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[Ferm] explosion")) Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH) - return 0 + return FALSE //This is just to calc the on_reaction multiplier, and is a candidate for removal. for(var/B in cached_required_reagents) @@ -561,11 +561,11 @@ targetVol = cached_results[P]*multiplier if(!((chem_temp <= C.ExplodeTemp) && (chem_temp >= C.OptimalTempMin))) - return 0 //Not hot enough + return FALSE //Not hot enough if(! ((pH >= (C.OptimalpHMin - C.ReactpHLim)) && (pH <= (C.OptimalpHMax + C.ReactpHLim)) ))//To prevent pointless reactions - return 0 + return FALSE if (fermiIsReacting) - return 0 + return FALSE else START_PROCESSING(SSprocessing, src) selected_reaction.on_reaction(src, my_atom, multiplier) @@ -581,7 +581,7 @@ fermiIsReacting = FALSE SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[Ferm] explosion")) Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH) - return 0 + return FALSE for(var/B in cached_required_reagents) // multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), CHEMICAL_QUANTISATION_LEVEL)) @@ -621,7 +621,7 @@ while(reaction_occurred) update_total() - return 0 + return FALSE /datum/reagents/process() var/datum/chemical_reaction/C = fermiReactID @@ -838,7 +838,7 @@ update_total() if(my_atom) my_atom.on_reagent_change(DEL_REAGENT) - return 1 + return TRUE /datum/reagents/proc/update_total() var/list/cached_reagents = reagent_list @@ -853,7 +853,7 @@ total_volume += R.volume if(!reagent_list || !total_volume) pH = REAGENT_NORMAL_PH - return 0 + return FALSE /datum/reagents/proc/clear_reagents() var/list/cached_reagents = reagent_list @@ -861,7 +861,7 @@ var/datum/reagent/R = reagent del_reagent(R.type) pH = REAGENT_NORMAL_PH - return 0 + return FALSE /datum/reagents/proc/reaction(atom/A, method = TOUCH, volume_modifier = 1, show_message = 1, from_gas = 0) var/react_type @@ -1075,9 +1075,9 @@ if(round(R.volume, CHEMICAL_QUANTISATION_LEVEL) >= amount) return R else - return 0 + return FALSE - return 0 + return FALSE /datum/reagents/proc/get_reagent_amount(reagent) var/list/cached_reagents = reagent_list @@ -1086,7 +1086,7 @@ if (R.type == reagent) return round(R.volume, CHEMICAL_QUANTISATION_LEVEL) - return 0 + return FALSE /datum/reagents/proc/get_reagents() var/list/names = list() @@ -1099,7 +1099,7 @@ /datum/reagents/proc/remove_all_type(reagent_type, amount, strict = 0, safety = 1) // Removes all reagent of X type. @strict set to 1 determines whether the childs of the type are included. if(!isnum(amount)) - return 1 + return TRUE var/list/cached_reagents = reagent_list var/has_removed_reagent = 0 diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 0e53b0796b..8986d39008 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -440,7 +440,7 @@ num = round(num) return num else - return 0 + return FALSE /obj/machinery/chem_master/adjust_item_drop_location(atom/movable/AM) // Special version for chemmasters and condimasters diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 2fb8f58019..65fdb382f9 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -71,14 +71,14 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) /datum/reagent/proc/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message = 1, touch_protection = 0) if(!istype(M)) - return 0 + return FALSE if(method == VAPOR) //smoke, foam, spray if(M.reagents) var/modifier = clamp((1 - touch_protection), 0, 1) var/amount = round(reac_volume*modifier, 0.1) if(amount >= 0.5) M.reagents.add_reagent(type, amount) - return 1 + return TRUE /datum/reagent/proc/reaction_obj(obj/O, volume) if(O && volume && boiling_point) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index af670c00dc..106de64746 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -86,7 +86,7 @@ /datum/reagent/toxin/plasma/reaction_obj(obj/O, reac_volume) if((!O) || (!reac_volume)) - return 0 + return FALSE var/temp = holder ? holder.chem_temp : T20C O.atmos_spawn_air("plasma=[reac_volume];TEMP=[temp]") diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index df794f4842..b4c7779634 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -75,7 +75,7 @@ /obj/item/reagent_containers/proc/canconsume(mob/eater, mob/user) if(!iscarbon(eater)) - return 0 + return FALSE var/mob/living/carbon/C = eater var/covered = "" if(C.is_mouth_covered(head_only = 1)) @@ -85,8 +85,8 @@ if(covered) var/who = (isnull(user) || eater == user) ? "your" : "[eater.p_their()]" to_chat(user, "You have to remove [who] [covered] first!") - return 0 - return 1 + return FALSE + return TRUE /obj/item/reagent_containers/ex_act(severity, target, origin) if(reagents) diff --git a/code/modules/reagents/reagent_containers/borghypo.dm b/code/modules/reagents/reagent_containers/borghypo.dm index 0b3e5bcf75..a581463da2 100644 --- a/code/modules/reagents/reagent_containers/borghypo.dm +++ b/code/modules/reagents/reagent_containers/borghypo.dm @@ -53,7 +53,7 @@ Borg Hypospray charge_tick = 0 //update_icon() - return 1 + return TRUE // Use this to add more chemicals for the borghypo to produce. /obj/item/reagent_containers/borghypo/proc/add_reagent(datum/reagent/reagent) diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm index 8cf98008db..1549859cb2 100644 --- a/code/modules/reagents/reagent_containers/patch.dm +++ b/code/modules/reagents/reagent_containers/patch.dm @@ -28,8 +28,8 @@ /obj/item/reagent_containers/pill/patch/canconsume(mob/eater, mob/user) if(!iscarbon(eater)) - return 0 - return 1 // Masks were stopping people from "eating" patches. Thanks, inheritance. + return FALSE + return TRUE // Masks were stopping people from "eating" patches. Thanks, inheritance. /obj/item/reagent_containers/pill/patch/styptic name = "brute patch" diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index c1812d9121..c579938e46 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -189,7 +189,7 @@ if(reagents && reagents.total_volume) return clamp(round((reagents.total_volume / volume * 15),5), 1, 15) else - return 0 + return FALSE /obj/item/reagent_containers/syringe/epinephrine name = "syringe (epinephrine)" diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 8e4db6f2f2..fb3f775bb0 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -18,7 +18,7 @@ /obj/structure/reagent_dispensers/attackby(obj/item/W, mob/user, params) if(W.is_refillable()) - return 0 //so we can refill them via their afterattack. + return FALSE //so we can refill them via their afterattack. else return ..() diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm index 6c85bfc3ee..5dd0163204 100644 --- a/code/modules/recycling/disposal/pipe.dm +++ b/code/modules/recycling/disposal/pipe.dm @@ -140,7 +140,7 @@ /obj/structure/disposalpipe/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) if(damage_flag == MELEE && damage_amount < 10) - return 0 + return FALSE return ..() diff --git a/code/modules/research/machinery/_production.dm b/code/modules/research/machinery/_production.dm index 30d0c70566..1b3d0974fd 100644 --- a/code/modules/research/machinery/_production.dm +++ b/code/modules/research/machinery/_production.dm @@ -107,7 +107,7 @@ /obj/machinery/rnd/production/proc/check_mat(datum/design/being_built, var/mat) // now returns how many times the item can be built with the material if (!materials.mat_container) // no connected silo - return 0 + return FALSE var/list/all_materials = being_built.reagents_list + being_built.materials var/A = materials.mat_container.get_material_amount(mat) @@ -344,10 +344,10 @@ var/datum/component/material_container/mat_container = materials.mat_container if (!mat_container) say("No access to material storage, please contact the quartermaster.") - return 0 + return FALSE if (materials.on_hold()) say("Mineral access is on hold, please contact the quartermaster.") - return 0 + return FALSE var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location()) var/list/matlist = list() matlist[eject_sheet] = MINERAL_MATERIAL_AMOUNT diff --git a/code/modules/research/xenobiology/crossbreeding/_weapons.dm b/code/modules/research/xenobiology/crossbreeding/_weapons.dm index 00748d2609..63fb75abc5 100644 --- a/code/modules/research/xenobiology/crossbreeding/_weapons.dm +++ b/code/modules/research/xenobiology/crossbreeding/_weapons.dm @@ -24,7 +24,7 @@ /obj/item/gun/magic/bloodchill/process() charge_tick++ if(charge_tick < recharge_rate || charges >= max_charges) - return 0 + return FALSE charge_tick = 0 var/mob/living/M = loc if(istype(M) && M.blood_volume >= 5) @@ -32,7 +32,7 @@ M.blood_volume -= 5 if(charges == 1) recharge_newshot() - return 1 + return TRUE /obj/item/ammo_casing/magic/bloodchill projectile_type = /obj/item/projectile/magic/bloodchill diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index dd2579663a..50b8692f87 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -47,7 +47,7 @@ //Effect when activated by a Luminescent. Separated into a minor and major effect. Returns cooldown in deciseconds. /obj/item/slime_extract/proc/activate(mob/living/carbon/human/user, datum/species/jelly/luminescent/species, activation_type) to_chat(user, "Nothing happened... This slime extract cannot be activated this way.") - return 0 + return FALSE //Core-crossing: Feeding adult slimes extracts to obtain a much more powerful, single extract. /obj/item/slime_extract/attack(mob/living/simple_animal/slime/M, mob/user) @@ -97,7 +97,7 @@ to_chat(user, "You spit out [S].") return 350 else - return 0 + return FALSE /obj/item/slime_extract/gold name = "gold slime extract" diff --git a/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm b/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm index c8bc4b0568..e78628dcd6 100644 --- a/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm +++ b/code/modules/ruins/lavalandruin_code/elephantgraveyard.dm @@ -85,7 +85,7 @@ to_chat(user, "You fill in the oil well with soil.") O.play_tool_sound(src) deconstruct() - return 1 + return TRUE if(istype(O, /obj/item/reagent_containers)) //Refilling bottles with oil var/obj/item/reagent_containers/RG = O if(RG.is_refillable()) @@ -97,7 +97,7 @@ return FALSE if(user.a_intent != INTENT_HARM) to_chat(user, "You won't have any luck getting \the [O] out if you drop it in the oil.") - return 1 + return TRUE else return ..() @@ -170,14 +170,14 @@ user.gain_trauma(/datum/brain_trauma/magic/stalker) to_chat(user, "Oh no, no no no, THEY'RE EVERYWHERE! EVERY ONE OF THEM IS EVERYWHERE!") first_open = FALSE - return 1 - return 1 + return TRUE + return TRUE else to_chat(user, "You can't dig up a grave with \the [S.name].") - return 1 + return TRUE else to_chat(user, "The grave has already been dug up.") - return 1 + return TRUE else if((user.a_intent != INTENT_HELP) && opened) //checks to attempt to remove the grave entirely. if(istype(S,cutting_tool) && S.tool_behaviour == TOOL_SHOVEL) @@ -186,7 +186,7 @@ to_chat(user, "You remove \the [src] completely.") SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "graverobbing", /datum/mood_event/graverobbing) deconstruct(TRUE) - return 1 + return TRUE return /obj/structure/closet/crate/grave/bust_open() diff --git a/code/modules/ruins/lavalandruin_code/puzzle.dm b/code/modules/ruins/lavalandruin_code/puzzle.dm index 136acc7da7..45d3dd53a8 100644 --- a/code/modules/ruins/lavalandruin_code/puzzle.dm +++ b/code/modules/ruins/lavalandruin_code/puzzle.dm @@ -127,12 +127,12 @@ if(A.y > B.y) return -1 if(A.y < B.y) - return 1 + return TRUE if(A.x > B.x) - return 1 + return TRUE if(A.x < B.x) return -1 - return 0 + return FALSE /obj/effect/sliding_puzzle/proc/elements_in_order() return sortTim(elements,cmp=/proc/cmp_xy_desc) @@ -207,7 +207,7 @@ /obj/structure/puzzle_element/Move(nloc, dir) if(!isturf(nloc) || moving_diagonally || get_dist(get_step(src,dir),get_turf(source)) > 1) - return 0 + return FALSE else return ..() diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm index 94abd1ef0a..2c8d9e3237 100644 --- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm @@ -57,7 +57,7 @@ return QDEL_HINT_LETMELIVE /obj/structure/necropolis_gate/singularity_pull() - return 0 + return FALSE /obj/structure/necropolis_gate/CanAllowThrough(atom/movable/mover, turf/target) . = ..() @@ -67,7 +67,7 @@ /obj/structure/necropolis_gate/CheckExit(atom/movable/O, target) if(get_dir(O.loc, target) == dir) return !density - return 1 + return TRUE /obj/structure/opacity_blocker icon = 'icons/effects/96x96.dmi' @@ -81,7 +81,7 @@ anchored = TRUE /obj/structure/opacity_blocker/singularity_pull() - return 0 + return FALSE /obj/structure/opacity_blocker/Destroy(force) if(force) @@ -236,7 +236,7 @@ GLOBAL_DATUM(necropolis_gate, /obj/structure/necropolis_gate/legion_gate) add_overlay(top_overlay) /obj/structure/necropolis_arch/singularity_pull() - return 0 + return FALSE /obj/structure/necropolis_arch/Destroy(force) if(force) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 1fc81e38b8..5cb4a083cb 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -76,7 +76,7 @@ /obj/docking_port/singularity_pull() return /obj/docking_port/singularity_act() - return 0 + return FALSE /obj/docking_port/shuttleRotate() return //we don't rotate with shuttles via this code. @@ -954,7 +954,7 @@ /obj/docking_port/mobile/proc/get_engine_coeff(current,engine_mod) var/new_value = max(0,current + engine_mod) if(new_value == initial_engines) - return 1 + return TRUE if(new_value > initial_engines) var/delta = new_value - initial_engines var/change_per_engine = (1 - ENGINE_COEFF_MIN) / ENGINE_DEFAULT_MAXSPEED_ENGINES // 5 by default diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index 4be592b919..28cb9ac36c 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -165,7 +165,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if("holdervar") adjust_var(user, holder_var_type, holder_var_amount) if(action) - action.UpdateButtonIcon() + action.UpdateButtons() return TRUE /obj/effect/proc_holder/spell/proc/charge_check(mob/user, silent = FALSE) @@ -220,7 +220,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th /obj/effect/proc_holder/spell/Trigger(mob/user, skip_can_cast = TRUE) if(cast_check(FALSE, user, skip_can_cast)) choose_targets() - return 1 + return TRUE /obj/effect/proc_holder/spell/proc/choose_targets(mob/user = usr) //depends on subtype - /targeted or /aoe_turf return @@ -243,7 +243,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if(recharging && charge_type == "recharge" && (charge_counter < charge_max)) charge_counter += 2 //processes 5 times per second instead of 10. if(charge_counter >= charge_max) - action.UpdateButtonIcon() + action.UpdateButtons() charge_counter = charge_max recharging = FALSE @@ -259,7 +259,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th cast(targets,user=user) after_cast(targets) if(action) - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/spell/proc/before_cast(list/targets) if(overlay) @@ -321,7 +321,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th if("holdervar") adjust_var(user, holder_var_type, -holder_var_amount) if(action) - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/spell/proc/adjust_var(mob/living/target = usr, type, amount) //handles the adjustment of the var when the spell is used. has some hardcoded types if (!istype(target)) @@ -438,8 +438,8 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th perform(targets,user=user) -/obj/effect/proc_holder/spell/proc/updateButtonIcon(status_only, force) - action.UpdateButtonIcon(status_only, force) +/obj/effect/proc_holder/spell/proc/UpdateButton(atom/movable/screen/movable/action_button/button, status_only, force) + action.UpdateButtons(status_only, force) /obj/effect/proc_holder/spell/targeted/proc/los_check(mob/A,mob/B) //Checks for obstacles from A to B @@ -449,9 +449,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th for(var/atom/movable/AM in turf) if(!AM.CanPass(dummy,turf,1)) qdel(dummy) - return 0 + return FALSE qdel(dummy) - return 1 + return TRUE /obj/effect/proc_holder/spell/proc/can_cast(mob/user = usr, skipcharge = FALSE, silent = FALSE) var/magic_flags = SEND_SIGNAL(user, COMSIG_MOB_SPELL_CAN_CAST, src) diff --git a/code/modules/spells/spell_types/aimed.dm b/code/modules/spells/spell_types/aimed.dm index aa2a2e4083..62f65688d9 100644 --- a/code/modules/spells/spell_types/aimed.dm +++ b/code/modules/spells/spell_types/aimed.dm @@ -43,7 +43,7 @@ if(!action) return action.button_icon_state = "[base_icon_state][active]" - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/spell/aimed/InterceptClickOn(mob/living/caller, params, atom/target) if(..()) diff --git a/code/modules/spells/spell_types/lightning.dm b/code/modules/spells/spell_types/lightning.dm index f5aaca2a87..b62cd4ab04 100644 --- a/code/modules/spells/spell_types/lightning.dm +++ b/code/modules/spells/spell_types/lightning.dm @@ -18,7 +18,7 @@ /obj/effect/proc_holder/spell/targeted/tesla/Trigger(mob/user, skip_can_cast = TRUE) if(!ready && cast_check(FALSE, user, skip_can_cast)) StartChargeup(user) - return 1 + return TRUE /obj/effect/proc_holder/spell/targeted/tesla/proc/StartChargeup(mob/user = usr) ready = 1 diff --git a/code/modules/spells/spell_types/pointed/pointed.dm b/code/modules/spells/spell_types/pointed/pointed.dm index 7b942dee27..1c32f04710 100644 --- a/code/modules/spells/spell_types/pointed/pointed.dm +++ b/code/modules/spells/spell_types/pointed/pointed.dm @@ -63,7 +63,7 @@ action.button_icon_state = "[action_icon_state]1" else action.button_icon_state = "[action_icon_state]" - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/spell/pointed/InterceptClickOn(mob/living/caller, params, atom/target) if(..()) diff --git a/code/modules/spells/spell_types/taeclowndo.dm b/code/modules/spells/spell_types/taeclowndo.dm index 9d6d71a89f..3566a36a25 100644 --- a/code/modules/spells/spell_types/taeclowndo.dm +++ b/code/modules/spells/spell_types/taeclowndo.dm @@ -54,7 +54,7 @@ else action.button_icon_state = action_icon_state - action.UpdateButtonIcon() + action.UpdateButtons() return ////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/code/modules/spells/spell_types/touch_attacks.dm b/code/modules/spells/spell_types/touch_attacks.dm index a23e16cf88..4f0ac2964f 100644 --- a/code/modules/spells/spell_types/touch_attacks.dm +++ b/code/modules/spells/spell_types/touch_attacks.dm @@ -18,7 +18,7 @@ //Start recharging. attached_hand = null recharging = TRUE - action.UpdateButtonIcon() + action.UpdateButtons() /obj/effect/proc_holder/spell/targeted/touch/cast(list/targets,mob/user = usr) if(!QDELETED(attached_hand)) diff --git a/code/modules/surgery/amputation.dm b/code/modules/surgery/amputation.dm index 2c3524a598..a7c0bb104e 100644 --- a/code/modules/surgery/amputation.dm +++ b/code/modules/surgery/amputation.dm @@ -25,4 +25,4 @@ if(surgery.operated_bodypart) var/obj/item/bodypart/target_limb = surgery.operated_bodypart target_limb.drop_limb() - return 1 + return TRUE diff --git a/code/modules/surgery/bodyparts/helpers.dm b/code/modules/surgery/bodyparts/helpers.dm index 9be468079b..ed802781b3 100644 --- a/code/modules/surgery/bodyparts/helpers.dm +++ b/code/modules/surgery/bodyparts/helpers.dm @@ -94,10 +94,10 @@ //sometimes we want to ignore that we don't have the required amount of arms. /mob/proc/get_arm_ignore() - return 0 + return FALSE /mob/living/carbon/alien/larva/get_arm_ignore() - return 1 //so we can still handcuff larvas. + return TRUE //so we can still handcuff larvas. /mob/proc/get_num_legs(check_disabled = TRUE) diff --git a/code/modules/surgery/cavity_implant.dm b/code/modules/surgery/cavity_implant.dm index 7cc545027c..1b23568a6d 100644 --- a/code/modules/surgery/cavity_implant.dm +++ b/code/modules/surgery/cavity_implant.dm @@ -38,14 +38,14 @@ if(tool) if(IC || tool.w_class > WEIGHT_CLASS_NORMAL || HAS_TRAIT(tool, TRAIT_NODROP) || istype(tool, /obj/item/organ)) to_chat(user, "You can't seem to fit [tool] in [target]'s [target_zone]!") - return 0 + return FALSE else display_results(user, target, "You stuff [tool] into [target]'s [target_zone].", "[user] stuffs [tool] into [target]'s [target_zone]!", "[user] stuffs [tool.w_class > WEIGHT_CLASS_SMALL ? tool : "something"] into [target]'s [target_zone].") user.transferItemToLoc(tool, target, TRUE) CH.cavity_item = tool - return 1 + return TRUE else if(IC) display_results(user, target, "You pull [IC] out of [target]'s [target_zone].", @@ -53,7 +53,7 @@ "[user] pulls [IC.w_class > WEIGHT_CLASS_SMALL ? IC : "something"] out of [target]'s [target_zone].") user.put_in_hands(IC) CH.cavity_item = null - return 1 + return TRUE else to_chat(user, "You don't find anything in [target]'s [target_zone].") - return 0 + return FALSE diff --git a/code/modules/surgery/core_removal.dm b/code/modules/surgery/core_removal.dm index 683663c241..131e56e6b6 100644 --- a/code/modules/surgery/core_removal.dm +++ b/code/modules/surgery/core_removal.dm @@ -8,8 +8,8 @@ /datum/surgery/core_removal/can_start(mob/user, mob/living/target, obj/item/tool) if(target.stat == DEAD) - return 1 - return 0 + return TRUE + return FALSE //extract brain /datum/surgery_step/extract_core name = "extract core" @@ -33,9 +33,9 @@ if(slime.cores <= 0) slime.icon_state = "[slime.colour] baby slime dead-nocore" - return 1 + return TRUE else - return 0 + return FALSE else to_chat(user, "There aren't any cores left in [target]!") - return 1 + return TRUE diff --git a/code/modules/surgery/dental_implant.dm b/code/modules/surgery/dental_implant.dm index f41f299439..e8d0564c62 100644 --- a/code/modules/surgery/dental_implant.dm +++ b/code/modules/surgery/dental_implant.dm @@ -14,28 +14,29 @@ /datum/surgery_step/insert_pill/success(mob/user, mob/living/carbon/target, target_zone, var/obj/item/reagent_containers/pill/tool, datum/surgery/surgery) if(!istype(tool)) - return 0 + return FALSE user.transferItemToLoc(tool, target, TRUE) - var/datum/action/item_action/hands_free/activate_pill/P = new(tool) - P.button.name = "Activate [tool.name]" - P.target = tool - P.Grant(target) //The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it + var/datum/action/item_action/hands_free/activate_pill/pill_action = new(tool) + pill_action.name = "Activate [tool.name]" + pill_action.UpdateButtons() + pill_action.target = tool + pill_action.Grant(target) //The pill never actually goes in an inventory slot, so the owner doesn't inherit actions from it user.visible_message("[user] wedges \the [tool] into [target]'s [parse_zone(target_zone)]!", "You wedge [tool] into [target]'s [parse_zone(target_zone)].") - return 1 + return TRUE /datum/action/item_action/hands_free/activate_pill name = "Activate Pill" /datum/action/item_action/hands_free/activate_pill/Trigger() if(!..()) - return 0 + return FALSE to_chat(owner, "You grit your teeth and burst the implanted [target.name]!") log_combat(owner, null, "swallowed an implanted pill", target) if(target.reagents.total_volume) target.reagents.reaction(owner, INGEST) target.reagents.trans_to(owner, target.reagents.total_volume, log = "dental pill swallow") qdel(target) - return 1 + return TRUE diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 652c49519a..7cd315656f 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -97,7 +97,7 @@ else if(!current_surgery.step_in_progress) attempt_cancel_surgery(current_surgery, I, M, user) - return 1 + return TRUE /proc/attempt_cancel_surgery(datum/surgery/S, obj/item/I, mob/living/M, mob/user) var/selected_zone = user.zone_selected @@ -128,7 +128,7 @@ /proc/get_location_modifier(mob/M) var/turf/T = get_turf(M) if(locate(/obj/structure/table/optable, T)) - return 1 + return TRUE else if(locate(/obj/structure/table, T)) return 0.8 else if(locate(/obj/structure/bed, T)) @@ -157,42 +157,42 @@ switch(location) if(BODY_ZONE_HEAD) if(covered_locations & HEAD) - return 0 + return FALSE if(BODY_ZONE_PRECISE_EYES) if(covered_locations & HEAD || face_covered & HIDEEYES || eyesmouth_covered & GLASSESCOVERSEYES) - return 0 + return FALSE if(BODY_ZONE_PRECISE_MOUTH) if(covered_locations & HEAD || face_covered & HIDEFACE || eyesmouth_covered & MASKCOVERSMOUTH || eyesmouth_covered & HEADCOVERSMOUTH) - return 0 + return FALSE if(BODY_ZONE_CHEST) if(covered_locations & CHEST) - return 0 + return FALSE if(BODY_ZONE_PRECISE_GROIN) if(covered_locations & GROIN) - return 0 + return FALSE if(BODY_ZONE_L_ARM) if(covered_locations & ARM_LEFT) - return 0 + return FALSE if(BODY_ZONE_R_ARM) if(covered_locations & ARM_RIGHT) - return 0 + return FALSE if(BODY_ZONE_L_LEG) if(covered_locations & LEG_LEFT) - return 0 + return FALSE if(BODY_ZONE_R_LEG) if(covered_locations & LEG_RIGHT) - return 0 + return FALSE if(BODY_ZONE_PRECISE_L_HAND) if(covered_locations & HAND_LEFT) - return 0 + return FALSE if(BODY_ZONE_PRECISE_R_HAND) if(covered_locations & HAND_RIGHT) - return 0 + return FALSE if(BODY_ZONE_PRECISE_L_FOOT) if(covered_locations & FOOT_LEFT) - return 0 + return FALSE if(BODY_ZONE_PRECISE_R_FOOT) if(covered_locations & FOOT_RIGHT) - return 0 + return FALSE - return 1 + return TRUE diff --git a/code/modules/surgery/implant_removal.dm b/code/modules/surgery/implant_removal.dm index 5162fafbc0..6cfabdeb96 100644 --- a/code/modules/surgery/implant_removal.dm +++ b/code/modules/surgery/implant_removal.dm @@ -50,7 +50,7 @@ else to_chat(user, "You can't find anything in [target]'s [target_zone]!") - return 1 + return TRUE /datum/surgery/implant_removal/mechanic name = "implant removal" diff --git a/code/modules/surgery/lipoplasty.dm b/code/modules/surgery/lipoplasty.dm index ecdc5477f1..4689b2e40c 100644 --- a/code/modules/surgery/lipoplasty.dm +++ b/code/modules/surgery/lipoplasty.dm @@ -6,8 +6,8 @@ /datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target, obj/item/tool) if(HAS_TRAIT(target, TRAIT_FAT)) - return 1 - return 0 + return TRUE + return FALSE //cut fat /datum/surgery_step/cut_fat @@ -24,7 +24,7 @@ display_results(user, target, "You cut [target]'s excess fat loose.", "[user] cuts [target]'s excess fat loose!", "[user] finishes the cut on [target]'s [target_zone].") - return 1 + return TRUE //remove fat /datum/surgery_step/remove_fat @@ -56,4 +56,4 @@ newmeat.subjectjob = H.job newmeat.reagents.add_reagent (/datum/reagent/consumable/nutriment, (removednutriment / 15)) //To balance with nutriment_factor of nutriment newmeat.forceMove(target.loc) - return 1 + return TRUE diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index fb18d6d155..2ff6f9e1f9 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -157,4 +157,4 @@ display_results(user, target, "You can't extract anything from [target]'s [parse_zone(target_zone)]!", "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!", "[user] can't seem to extract anything from [target]'s [parse_zone(target_zone)]!") - return 1 + return TRUE diff --git a/code/modules/surgery/organic_steps.dm b/code/modules/surgery/organic_steps.dm index 9e93042f63..0e4f103210 100644 --- a/code/modules/surgery/organic_steps.dm +++ b/code/modules/surgery/organic_steps.dm @@ -120,7 +120,7 @@ display_results(user, target, "You saw [target]'s [parse_zone(target_zone)] open.", "[user] saws [target]'s [parse_zone(target_zone)] open!", "[user] saws [target]'s [parse_zone(target_zone)] open!") - return 1 + return TRUE //drill bone /datum/surgery_step/drill @@ -137,4 +137,4 @@ display_results(user, target, "You drill into [target]'s [parse_zone(target_zone)].", "[user] drills into [target]'s [parse_zone(target_zone)]!", "[user] drills into [target]'s [parse_zone(target_zone)]!") - return 1 + return TRUE diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm index 420810d7d2..c0242248a7 100644 --- a/code/modules/surgery/organs/augments_chest.dm +++ b/code/modules/surgery/organs/augments_chest.dm @@ -166,7 +166,7 @@ if(crit_fail || (organ_flags & ORGAN_FAILING)) if(!silent) to_chat(owner, "Your thrusters set seems to be broken!") - return 0 + return FALSE on = TRUE if(allow_thrust(0.01)) ion_trail.start() @@ -195,28 +195,28 @@ /obj/item/organ/cyberimp/chest/thrusters/proc/allow_thrust(num) if(!on || !owner) - return 0 + return FALSE var/turf/T = get_turf(owner) if(!T) // No more runtimes from being stuck in nullspace. - return 0 + return FALSE // Priority 1: use air from environment. var/datum/gas_mixture/environment = T.return_air() if(environment && environment.return_pressure() > 30) - return 1 + return TRUE // Priority 2: use plasma from internal plasma storage. // (just in case someone would ever use this implant system to make cyber-alien ops with jetpacks and taser arms) if(owner.getPlasma() >= num*100) owner.adjustPlasma(-num*100) - return 1 + return TRUE // Priority 3: use internals tank. var/obj/item/tank/I = owner.internal if(I && I.air_contents && I.air_contents.total_moles() >= num) T.assume_air_moles(I.air_contents, num) - return 1 + return TRUE toggle(silent = TRUE) - return 0 + return FALSE diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 6263284584..4ca6ff2806 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -49,12 +49,12 @@ /obj/item/organ/heart/proc/Stop() beating = 0 update_icon() - return 1 + return TRUE /obj/item/organ/heart/proc/Restart() beating = 1 update_icon() - return 1 + return TRUE /obj/item/organ/heart/proc/HeartStrengthMessage() if(beating) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index d4a2663374..a41b2046a0 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -245,7 +245,7 @@ //Try code/modules/mob/living/carbon/brain/brain_item.dm /mob/living/proc/regenerate_organs() - return 0 + return FALSE /mob/living/carbon/regenerate_organs(only_one = FALSE) var/breathes = TRUE diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index e41980cdd3..cbddd8db2f 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -134,7 +134,7 @@ var/cooldown = 0 if(!user || !user.can_speak() || user.stat) - return 0 //no cooldown + return FALSE //no cooldown var/log_message = uppertext(message) if(iscultist(user)) @@ -597,7 +597,7 @@ var/special_check = get_vog_special(user) if(!special_check) - return 0 + return FALSE . = min(base_multiplier * special_check, VOG_MAX_STANDARD_POWER) // anything above should require conscious admin fuckery, as things are balanced around 3 multiplier tops (see: damage being 15*3) if(!specific_listeners.len) @@ -617,7 +617,7 @@ return 0.5 if(user.mind.assigned_role in GLOB.command_positions) return 1.4 // heads are great at speaking with authority - return 1 + return TRUE ////////////////////////////////////// ///////ENTHRAL VELVET CHORDS////////// @@ -665,7 +665,7 @@ /proc/velvetspeech(message, mob/living/user, base_multiplier = 1, message_admins = FALSE, debug = FALSE) if(!user || !user.can_speak() || user.stat) - return 0 //no cooldown + return FALSE //no cooldown var/log_message = message @@ -688,7 +688,7 @@ listeners += L if(!listeners.len) - return 0 + return FALSE //POWER CALCULATIONS diff --git a/code/modules/surgery/prosthetic_replacement.dm b/code/modules/surgery/prosthetic_replacement.dm index b0102da7b7..a40fac6640 100644 --- a/code/modules/surgery/prosthetic_replacement.dm +++ b/code/modules/surgery/prosthetic_replacement.dm @@ -7,10 +7,10 @@ requires_bodypart_type = 0 /datum/surgery/prosthetic_replacement/can_start(mob/user, mob/living/carbon/target, obj/item/tool) if(!iscarbon(target)) - return 0 + return FALSE var/mob/living/carbon/C = target if(!C.get_bodypart(user.zone_selected)) //can only start if limb is missing - return 1 + return TRUE /datum/surgery_step/add_prosthetic name = "add prosthetic" implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100, /obj/item/chainsaw = 100, /obj/item/melee/synthetic_arm_blade = 100) @@ -70,7 +70,7 @@ display_results(user, target, "You succeed in replacing [target]'s [parse_zone(target_zone)].", "[user] successfully replaces [target]'s [parse_zone(target_zone)] with [tool]!", "[user] successfully replaces [target]'s [parse_zone(target_zone)]!") - return 1 + return TRUE else var/obj/item/bodypart/L = target.newBodyPart(target_zone, FALSE, FALSE) L.is_pseudopart = TRUE @@ -82,8 +82,8 @@ if(istype(tool, /obj/item/chainsaw)) var/obj/item/mounted_chainsaw/new_arm = new(target) target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) - return 1 + return TRUE else if(istype(tool, /obj/item/melee/synthetic_arm_blade)) var/obj/item/melee/arm_blade/new_arm = new(target,TRUE,TRUE) target_zone == BODY_ZONE_R_ARM ? target.put_in_r_hand(new_arm) : target.put_in_l_hand(new_arm) - return 1 + return TRUE diff --git a/code/modules/surgery/remove_embedded_object.dm b/code/modules/surgery/remove_embedded_object.dm index dfdb1f7eca..e2304d514b 100644 --- a/code/modules/surgery/remove_embedded_object.dm +++ b/code/modules/surgery/remove_embedded_object.dm @@ -40,4 +40,4 @@ else to_chat(user, "You can't find [target]'s [parse_zone(user.zone_selected)], let alone any objects embedded in it!") - return 1 + return TRUE diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 9e39ec58e8..0b71c5fbad 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -94,7 +94,7 @@ /datum/surgery/proc/next_step(mob/user, intent) if(step_in_progress) - return 1 + return TRUE var/try_to_fail = FALSE if(intent == INTENT_DISARM) diff --git a/code/modules/tooltip/tooltip.dm b/code/modules/tooltip/tooltip.dm index 01c74122bd..3ca7fd590d 100644 --- a/code/modules/tooltip/tooltip.dm +++ b/code/modules/tooltip/tooltip.dm @@ -87,13 +87,13 @@ Notes: /datum/tooltip/proc/hide() + queueHide = showing ? TRUE : FALSE + if (queueHide) addtimer(CALLBACK(src, .proc/do_hide), 1) else do_hide() - queueHide = showing ? TRUE : FALSE - return TRUE /datum/tooltip/proc/do_hide() diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html index fd8a0d7475..2f60a2b0b1 100644 --- a/code/modules/tooltip/tooltip.html +++ b/code/modules/tooltip/tooltip.html @@ -145,21 +145,29 @@ //alert(realIconSize + ' | ' +tooltip.tileSize + ' | ' + resizeRatio); //DEBUG - //Parse out the tile and cursor locations from params (e.g. "icon-x=32;icon-y=29;screen-loc=3:10,15:29") + const parameters = new Object(); + + //Parse out the contents of params (e.g. "icon-x=32;icon-y=29;screen-loc=3:10,15:29") + //It is worth noting that params is not always ordered in the same way. We therefore need to write the code + //To load their values in independantly of their order var paramsA = tooltip.params.cursor.split(';'); - if (paramsA.length < 3) {return false;} //Sometimes screen-loc is never sent ahaha fuck you byond + for (var i = 0; i < paramsA.length; i++) { + var entry = paramsA[i]; + var nameAndValue = entry.split("="); + parameters[nameAndValue[0]] = nameAndValue[1]; + } + + //Sometimes screen-loc is never sent ahaha fuck you byond + if (!parameters["icon-x"] || !parameters["icon-y"] || !parameters["screen-loc"]) { + return false; + } //icon-x - var iconX = paramsA[0]; - iconX = iconX.split('='); - iconX = parseInt(iconX[1]); + var iconX = parseInt(parameters["icon-x"]); //icon-y - var iconY = paramsA[1]; - iconY = iconY.split('='); - iconY = parseInt(iconY[1]); + var iconY = parseInt(parameters["icon-y"]); //screen-loc - var screenLoc = paramsA[2]; - screenLoc = screenLoc.split('='); - screenLoc = screenLoc[1].split(','); + var screenLoc = parameters["screen-loc"]; + screenLoc = screenLoc.split(','); if (screenLoc.length < 2) {return false;} var left = screenLoc[0]; var top = screenLoc[1]; diff --git a/code/modules/unit_tests/vore_tests.dm b/code/modules/unit_tests/vore_tests.dm index 6549aa9ce7..3a8df28479 100644 --- a/code/modules/unit_tests/vore_tests.dm +++ b/code/modules/unit_tests/vore_tests.dm @@ -35,11 +35,11 @@ H = new(T) startOxyloss = H.getOxyLoss() - return 1 + return TRUE /datum/unit_test/space_suffocation/check_result() if(H.life_tick < 10) - return 0 + return FALSE endOxyloss = H.getOxyLoss() @@ -47,7 +47,7 @@ Fail("Human mob is not taking oxygen damage in space. (Before: [startOxyloss]; after: [endOxyloss])") qdel(H) - return 1 + return TRUE /datum/unit_test/belly_nonsuffocation name = "MOB: human mob does not suffocate in a belly" diff --git a/code/modules/vehicles/mecha/combat/durand.dm b/code/modules/vehicles/mecha/combat/durand.dm index 36c5f75984..8567e31b07 100644 --- a/code/modules/vehicles/mecha/combat/durand.dm +++ b/code/modules/vehicles/mecha/combat/durand.dm @@ -194,7 +194,7 @@ own integrity back to max. Shield is automatically dropped if we run out of powe for(var/occupant in chassis.occupants) var/datum/action/button = chassis.occupant_actions[occupant][/datum/action/vehicle/sealed/mecha/mech_defense_mode] button.button_icon_state = "mech_defense_mode_[chassis.defense_mode ? "on" : "off"]" - button.UpdateButtonIcon() + button.UpdateButtons() set_light(light_range, light_power, light_color) diff --git a/code/modules/vehicles/mecha/combat/neovgre.dm b/code/modules/vehicles/mecha/combat/neovgre.dm index 7e40a1c352..feb14e3f24 100644 --- a/code/modules/vehicles/mecha/combat/neovgre.dm +++ b/code/modules/vehicles/mecha/combat/neovgre.dm @@ -98,5 +98,5 @@ /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy/neovgre/can_attach(obj/vehicle/sealed/mecha/combat/neovgre/M) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE diff --git a/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm b/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm index cb9e471ff8..b57fc44c63 100644 --- a/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/medical_tools.dm @@ -9,7 +9,7 @@ /obj/item/mecha_parts/mecha_equipment/medical/can_attach(obj/vehicle/sealed/mecha/medical/M) if(..() && istype(M)) - return 1 + return TRUE /obj/item/mecha_parts/mecha_equipment/medical/attach(obj/vehicle/sealed/mecha/M) @@ -46,7 +46,7 @@ return ..() /obj/item/mecha_parts/mecha_equipment/medical/sleeper/Exit(atom/movable/O) - return 0 + return FALSE /obj/item/mecha_parts/mecha_equipment/medical/sleeper/action(mob/source, mob/living/carbon/target, params) if(!action_checks(target)) @@ -197,7 +197,7 @@ /obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/inject_reagent(datum/reagent/R,obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/SG) if(!R || !patient || !SG || !(SG in chassis.equipment)) - return 0 + return FALSE var/to_inject = min(R.volume, inject_amount) if(to_inject && patient.reagents.get_reagent_amount(R.type) + to_inject <= inject_amount*2) to_chat(chassis.occupants, "[icon2html(src, chassis.occupants)]Injecting [patient] with [to_inject] units of [R.name].") @@ -213,7 +213,7 @@ send_byjax(chassis.occupants,"msleeper.browser","lossinfo",get_patient_dam()) send_byjax(chassis.occupants,"msleeper.browser","reagents",get_patient_reagents()) send_byjax(chassis.occupants,"msleeper.browser","injectwith",get_available_reagents()) - return 1 + return TRUE return /obj/item/mecha_parts/mecha_equipment/medical/sleeper/container_resist(mob/living/user) @@ -456,23 +456,23 @@ if(syringes.len= 2) to_chat(user, "[icon2html(src, user)]The syringe is too far away!") - return 0 + return FALSE for(var/obj/structure/D in S.loc)//Basic level check for structures in the way (Like grilles and windows) if(!(D.CanPass(S,src.loc))) to_chat(user, "[icon2html(src, user)]Unable to load syringe!") - return 0 + return FALSE for(var/obj/machinery/door/D in S.loc)//Checks for doors if(!(D.CanPass(S,src.loc))) to_chat(user, "[icon2html(src, user)]Unable to load syringe!") - return 0 + return FALSE S.reagents.trans_to(src, S.reagents.total_volume) S.forceMove(src) syringes += S to_chat(user, "[icon2html(src, user)]Syringe loaded.") update_equip_info() - return 1 + return TRUE to_chat(user, "[icon2html(src, user)][src]'s syringe chamber is full!") - return 0 + return FALSE /obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/proc/analyze_reagents(atom/A, mob/user) if(get_dist(src,A) >= 4) diff --git a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm index 348a4bb6ec..b25a8ae600 100644 --- a/code/modules/vehicles/mecha/equipment/tools/other_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/other_tools.dm @@ -410,7 +410,7 @@ return units else to_chat(user, "[icon2html(src, user)]Unit is full.") - return 0 + return FALSE else to_chat(user, "[icon2html(src, user)][fuel] traces in target minimal! [P] cannot be used as fuel.") return diff --git a/code/modules/vehicles/mecha/equipment/tools/work_tools.dm b/code/modules/vehicles/mecha/equipment/tools/work_tools.dm index dd9448a826..8c64384d78 100644 --- a/code/modules/vehicles/mecha/equipment/tools/work_tools.dm +++ b/code/modules/vehicles/mecha/equipment/tools/work_tools.dm @@ -19,8 +19,8 @@ /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/can_attach(obj/vehicle/sealed/mecha/working/ripley/M) if(..()) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/item/mecha_parts/mecha_equipment/hydraulic_clamp/attach(obj/vehicle/sealed/mecha/M) ..() @@ -239,7 +239,7 @@ if(W.loc == my_target) break sleep(2) - return 1 + return TRUE /obj/item/mecha_parts/mecha_equipment/extinguisher/get_equip_info() return "[..()] \[[src.reagents.total_volume]\]" @@ -247,8 +247,8 @@ /obj/item/mecha_parts/mecha_equipment/extinguisher/can_attach(obj/vehicle/sealed/mecha/working/M as obj) if(..()) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE diff --git a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm index b8818ef3f7..9254bc2ed4 100644 --- a/code/modules/vehicles/mecha/equipment/weapons/weapons.dm +++ b/code/modules/vehicles/mecha/equipment/weapons/weapons.dm @@ -426,8 +426,8 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/banana_mortar/can_attach(obj/vehicle/sealed/mecha/combat/honker/M) if(..()) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar name = "mousetrap mortar" @@ -444,8 +444,8 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/can_attach(obj/vehicle/sealed/mecha/combat/honker/M) if(..()) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/mousetrap_mortar/proj_init(obj/item/assembly/mousetrap/armed/M) M.secured = 1 @@ -475,8 +475,8 @@ /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/can_attach(obj/vehicle/sealed/mecha/combat/honker/M) if(..()) if(istype(M)) - return 1 - return 0 + return TRUE + return FALSE /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/launcher/punching_glove/get_equip_info() if(!chassis) diff --git a/code/modules/vehicles/mecha/mech_fabricator.dm b/code/modules/vehicles/mecha/mech_fabricator.dm index 29cc88a563..91313690a0 100644 --- a/code/modules/vehicles/mecha/mech_fabricator.dm +++ b/code/modules/vehicles/mecha/mech_fabricator.dm @@ -632,10 +632,10 @@ var/datum/component/material_container/mat_container = rmat.mat_container if (!mat_container) say("No access to material storage, please contact the quartermaster.") - return 0 + return FALSE if (rmat.on_hold()) say("Mineral access is on hold, please contact the quartermaster.") - return 0 + return FALSE var/count = mat_container.retrieve_sheets(text2num(eject_amt), eject_sheet, drop_location()) var/list/matlist = list() matlist[eject_sheet] = text2num(eject_amt) diff --git a/code/modules/vehicles/mecha/mech_melee_attack.dm b/code/modules/vehicles/mecha/mech_melee_attack.dm index 2f5faea172..81784ddbd0 100644 --- a/code/modules/vehicles/mecha/mech_melee_attack.dm +++ b/code/modules/vehicles/mecha/mech_melee_attack.dm @@ -35,9 +35,9 @@ playsound(src, 'sound/items/welder.ogg', 50, TRUE) if(TOX) playsound(src, 'sound/effects/spray2.ogg', 50, TRUE) - return 0 + return FALSE else - return 0 + return FALSE mecha_attacker.visible_message("[mecha_attacker.name] hits [src]!", "You hit [src]!", null, COMBAT_MESSAGE_RANGE) return take_damage(mecha_attacker.force * 3, mech_damtype, MELEE, play_soundeffect, get_dir(src, mecha_attacker)) // multiplied by 3 so we can hit objs hard but not be overpowered against mobs. diff --git a/code/modules/vehicles/mecha/mecha_actions.dm b/code/modules/vehicles/mecha/mecha_actions.dm index 09ccaad2c2..976ffea40a 100644 --- a/code/modules/vehicles/mecha/mecha_actions.dm +++ b/code/modules/vehicles/mecha/mecha_actions.dm @@ -37,7 +37,7 @@ button_icon_state = "mech_internals_[chassis.use_internal_tank ? "on" : "off"]" to_chat(chassis.occupants, "[icon2html(chassis, owner)]Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].") chassis.log_message("Now taking air from [chassis.use_internal_tank?"internal airtank":"environment"].", LOG_MECHA) - UpdateButtonIcon() + UpdateButtons() /datum/action/vehicle/sealed/mecha/mech_cycle_equip name = "Cycle Equipment" @@ -61,7 +61,7 @@ to_chat(owner, "[icon2html(chassis, owner)]You select [chassis.selected].") send_byjax(chassis.occupants,"exosuit.browser","eq_list",chassis.get_equipment_list()) button_icon_state = "mech_cycle_equip_on" - UpdateButtonIcon() + UpdateButtons() return var/number = 0 for(var/equipment in available_equipment) @@ -77,7 +77,7 @@ to_chat(owner, "[icon2html(chassis, owner)]You switch to [chassis.selected].") button_icon_state = "mech_cycle_equip_on" send_byjax(chassis.occupants,"exosuit.browser","eq_list",chassis.get_equipment_list()) - UpdateButtonIcon() + UpdateButtons() return @@ -100,7 +100,7 @@ chassis.set_light(0) to_chat(owner, "[icon2html(chassis, owner)]Toggled lights [(chassis.mecha_flags & LIGHTS_ON)?"on":"off"].") chassis.log_message("Toggled lights [(chassis.mecha_flags & LIGHTS_ON)?"on":"off"].", LOG_MECHA) - UpdateButtonIcon() + UpdateButtons() /datum/action/vehicle/sealed/mecha/mech_view_stats name = "View Stats" @@ -140,7 +140,7 @@ for(var/occupant in occupants) var/datum/action/action = LAZYACCESSASSOC(occupant_actions, occupant, /datum/action/vehicle/sealed/mecha/strafe) - action?.UpdateButtonIcon() + action?.UpdateButtons() //////////////////////////////////////// Specific Ability Actions /////////////////////////////////////////////// //Need to be granted by the mech type, Not default abilities. @@ -176,7 +176,7 @@ chassis.movedelay = initial(chassis.movedelay) chassis.step_energy_drain = chassis.normal_step_energy_drain to_chat(owner, "[icon2html(chassis, owner)]You disable leg actuators overload.") - UpdateButtonIcon() + UpdateButtons() /datum/action/vehicle/sealed/mecha/mech_smoke name = "Smoke" @@ -208,7 +208,7 @@ SEND_SOUND(owner, sound('sound/mecha/imag_enh.ogg',volume=50)) else owner.client.view_size.resetToDefault() //Let's not let this stack shall we? - UpdateButtonIcon() + UpdateButtons() /datum/action/vehicle/sealed/mecha/mech_switch_damtype name = "Reconfigure arm microtool arrays" @@ -231,7 +231,7 @@ chassis.damtype = new_damtype button_icon_state = "mech_damtype_[new_damtype]" playsound(chassis, 'sound/mecha/mechmove01.ogg', 50, TRUE) - UpdateButtonIcon() + UpdateButtons() ///swap seats, for two person mecha /datum/action/vehicle/sealed/mecha/swap_seat @@ -272,4 +272,4 @@ chassis.phasing = !chassis.phasing button_icon_state = "mech_phasing_[chassis.phasing ? "on" : "off"]" to_chat(owner, "[icon2html(chassis, owner)]En":"#f00\">Dis"]abled phasing.") - UpdateButtonIcon() + UpdateButtons() diff --git a/code/modules/vehicles/mecha/mecha_defense.dm b/code/modules/vehicles/mecha/mecha_defense.dm index 7208fdaa15..b53156dba7 100644 --- a/code/modules/vehicles/mecha/mecha_defense.dm +++ b/code/modules/vehicles/mecha/mecha_defense.dm @@ -24,7 +24,7 @@ /obj/vehicle/sealed/mecha/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir) . = ..() if(!damage_amount) - return 0 + return FALSE var/booster_deflection_modifier = 1 var/booster_damage_modifier = 1 if(damage_flag == BULLET || damage_flag == LASER || damage_flag == ENERGY) @@ -47,7 +47,7 @@ if(prob(deflect_chance * booster_deflection_modifier)) visible_message("[src]'s armour deflects the attack!") log_message("Armor saved.", LOG_MECHA) - return 0 + return FALSE if(.) . *= booster_damage_modifier @@ -72,7 +72,7 @@ log_message("Attack by simple animal. Attacker - [user].", LOG_MECHA, color="red") if(!user.melee_damage_upper && !user.obj_damage) user.emote("custom", message = "[user.friendly_verb_continuous] [src].") - return 0 + return FALSE else var/play_soundeffect = 1 if(user.environment_smash) @@ -84,7 +84,7 @@ animal_damage = min(animal_damage, 20*user.environment_smash) log_combat(user, src, "attacked") attack_generic(user, animal_damage, user.melee_damage_type, MELEE, play_soundeffect) - return 1 + return TRUE /obj/vehicle/sealed/mecha/hulk_damage() diff --git a/code/modules/vehicles/mecha/working/ripley.dm b/code/modules/vehicles/mecha/working/ripley.dm index 40b2e61402..6518c2fe05 100644 --- a/code/modules/vehicles/mecha/working/ripley.dm +++ b/code/modules/vehicles/mecha/working/ripley.dm @@ -153,7 +153,7 @@ /obj/vehicle/sealed/mecha/working/ripley/Exit(atom/movable/O) if(O in cargo) - return 0 + return FALSE return ..() /obj/vehicle/sealed/mecha/working/ripley/Topic(href, href_list) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 13a614449a..d8aaf6ac3b 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -33,10 +33,10 @@ /obj/vehicle/ridden/scooter/buckle_mob(mob/living/M, force = 0, check_loc = 1) if(!istype(M)) - return 0 + return FALSE if(M.get_num_legs() < 2 && M.get_num_arms() <= 0) to_chat(M, "Your limbless body can't ride \the [src].") - return 0 + return FALSE . = ..() /obj/vehicle/ridden/scooter/skateboard diff --git a/code/modules/vore/hook-defs.dm b/code/modules/vore/hook-defs.dm index 5c3c3d01c8..d48371f13c 100644 --- a/code/modules/vore/hook-defs.dm +++ b/code/modules/vore/hook-defs.dm @@ -33,5 +33,5 @@ if(!hook_vr("human_new",args)) result = 0 - //Return 1 to superhook + //return TRUE to superhook return result diff --git a/code/modules/vore/trycatch.dm b/code/modules/vore/trycatch.dm index d4b1ac2c05..8fcb9ee38d 100644 --- a/code/modules/vore/trycatch.dm +++ b/code/modules/vore/trycatch.dm @@ -24,7 +24,7 @@ The proc you're attemping should return nonzero values on success. catch(var/exception/e) stack_trace("attempt_vr runtimed when calling [procname] on [callon].") stack_trace("attempt_vr catch: [e] on [e.file]:[e.line]") - return 0 + return FALSE /* This is the _vr version of calling hooks. diff --git a/icons/effects/mouse_pointers/screen_drag.dmi b/icons/effects/mouse_pointers/screen_drag.dmi new file mode 100644 index 0000000000..48e4fce85f Binary files /dev/null and b/icons/effects/mouse_pointers/screen_drag.dmi differ diff --git a/icons/hud/64x16_actions.dmi b/icons/hud/64x16_actions.dmi new file mode 100644 index 0000000000..23865a80f0 Binary files /dev/null and b/icons/hud/64x16_actions.dmi differ diff --git a/icons/mob/screen_ai.dmi b/icons/mob/screen_ai.dmi index 8388ea3f80..e9360926a4 100644 Binary files a/icons/mob/screen_ai.dmi and b/icons/mob/screen_ai.dmi differ diff --git a/icons/mob/screen_alien.dmi b/icons/mob/screen_alien.dmi index 96d0e96fe0..ddb99fdb68 100644 Binary files a/icons/mob/screen_alien.dmi and b/icons/mob/screen_alien.dmi differ diff --git a/icons/mob/screen_clockwork.dmi b/icons/mob/screen_clockwork.dmi index 1a3da0a625..d84503c768 100644 Binary files a/icons/mob/screen_clockwork.dmi and b/icons/mob/screen_clockwork.dmi differ diff --git a/icons/mob/screen_cyborg.dmi b/icons/mob/screen_cyborg.dmi index 13aa792944..2f976f9d3a 100644 Binary files a/icons/mob/screen_cyborg.dmi and b/icons/mob/screen_cyborg.dmi differ diff --git a/icons/mob/screen_detective.dmi b/icons/mob/screen_detective.dmi index dfe74600af..5de29ad1e8 100644 Binary files a/icons/mob/screen_detective.dmi and b/icons/mob/screen_detective.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index 39e8eb4b45..0b286f9625 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/screen_glass.dmi b/icons/mob/screen_glass.dmi index e913494e33..4948171883 100644 Binary files a/icons/mob/screen_glass.dmi and b/icons/mob/screen_glass.dmi differ diff --git a/icons/mob/screen_midnight.dmi b/icons/mob/screen_midnight.dmi index 6c84b074e6..c180ed4f37 100644 Binary files a/icons/mob/screen_midnight.dmi and b/icons/mob/screen_midnight.dmi differ diff --git a/icons/mob/screen_operative.dmi b/icons/mob/screen_operative.dmi index 89a39274d1..8e2eeaa315 100644 Binary files a/icons/mob/screen_operative.dmi and b/icons/mob/screen_operative.dmi differ diff --git a/icons/mob/screen_plasmafire.dmi b/icons/mob/screen_plasmafire.dmi index 78ebfb2c2a..18f99515b9 100644 Binary files a/icons/mob/screen_plasmafire.dmi and b/icons/mob/screen_plasmafire.dmi differ diff --git a/icons/mob/screen_retro.dmi b/icons/mob/screen_retro.dmi index 44dc7bb5c4..8c8b920908 100644 Binary files a/icons/mob/screen_retro.dmi and b/icons/mob/screen_retro.dmi differ diff --git a/icons/mob/screen_slimecore.dmi b/icons/mob/screen_slimecore.dmi index df9d7b0eb6..91b01910e3 100644 Binary files a/icons/mob/screen_slimecore.dmi and b/icons/mob/screen_slimecore.dmi differ diff --git a/icons/mob/screen_trasenknox.dmi b/icons/mob/screen_trasenknox.dmi index 70cb09b146..bf229f7bad 100644 Binary files a/icons/mob/screen_trasenknox.dmi and b/icons/mob/screen_trasenknox.dmi differ diff --git a/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm b/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm index 9ea5a679fd..244b0be71e 100644 --- a/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm +++ b/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm @@ -702,7 +702,7 @@ GLOBAL_LIST_EMPTY(rain_sounds) else new /obj/item/stack/sheet/hay/(get_turf(src)) qdel(src) - return 1 + return TRUE else . = ..() diff --git a/modular_citadel/code/modules/festive/turfs.dm b/modular_citadel/code/modules/festive/turfs.dm index dd119a25e7..d7b450caf2 100644 --- a/modular_citadel/code/modules/festive/turfs.dm +++ b/modular_citadel/code/modules/festive/turfs.dm @@ -1503,9 +1503,9 @@ /obj/structure/festive/trainplatform/edge_north/CanPass(atom/movable/mover, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS)) - return 1 + return TRUE if(dir == FULLTILE_WINDOW_DIR) - return 0 + return FALSE if(get_dir(loc, target) == dir) return !density if(istype(mover, /obj/structure/festive/trainplatform/edge_north)) @@ -1518,14 +1518,14 @@ return FALSE else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir)) return FALSE - return 1 + return TRUE /obj/structure/festive/trainplatform/edge_north/CheckExit(atom/movable/O, turf/target) if(istype(O) && (O.pass_flags & PASSGLASS)) - return 1 + return TRUE if(get_dir(O.loc, target) == dir) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/festive/trainplatform/edge_north dir = SOUTH @@ -1561,9 +1561,9 @@ /obj/structure/festive/trainplatform/edge_south/CanPass(atom/movable/mover, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS)) - return 1 + return TRUE if(dir == FULLTILE_WINDOW_DIR) - return 0 + return FALSE if(get_dir(loc, target) == dir) return !density if(istype(mover, /obj/structure/festive/trainplatform/edge_south)) @@ -1576,14 +1576,14 @@ return FALSE else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir)) return FALSE - return 1 + return TRUE /obj/structure/festive/trainplatform/edge_north/CheckExit(atom/movable/O, turf/target) if(istype(O) && (O.pass_flags & PASSGLASS)) - return 1 + return TRUE if(get_dir(O.loc, target) == dir) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/festive/trainplatform/edge_south dir = NORTH @@ -1619,9 +1619,9 @@ /obj/structure/festive/trainplatform/edge_east/CanPass(atom/movable/mover, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS)) - return 1 + return TRUE if(dir == FULLTILE_WINDOW_DIR) - return 0 + return FALSE if(get_dir(loc, target) == dir) return !density if(istype(mover, /obj/structure/festive/trainplatform/edge_east)) @@ -1634,14 +1634,14 @@ return FALSE else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir)) return FALSE - return 1 + return TRUE /obj/structure/festive/trainplatform/edge_east/CheckExit(atom/movable/O, turf/target) if(istype(O) && (O.pass_flags & PASSGLASS)) - return 1 + return TRUE if(get_dir(O.loc, target) == dir) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/festive/trainplatform/edge_east dir = WEST @@ -1677,9 +1677,9 @@ /obj/structure/festive/trainplatform/edge_west/CanPass(atom/movable/mover, turf/target) if(istype(mover) && (mover.pass_flags & PASSGLASS)) - return 1 + return TRUE if(dir == FULLTILE_WINDOW_DIR) - return 0 + return FALSE if(get_dir(loc, target) == dir) return !density if(istype(mover, /obj/structure/festive/trainplatform/edge_west)) @@ -1692,14 +1692,14 @@ return FALSE else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir)) return FALSE - return 1 + return TRUE /obj/structure/festive/trainplatform/edge_west/CheckExit(atom/movable/O, turf/target) if(istype(O) && (O.pass_flags & PASSGLASS)) - return 1 + return TRUE if(get_dir(O.loc, target) == dir) - return 0 - return 1 + return FALSE + return TRUE /obj/structure/festive/trainplatform/edge_west dir = EAST diff --git a/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm index e5b81806e6..f3abc0603e 100644 --- a/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm +++ b/modular_citadel/code/modules/projectiles/guns/pumpenergy.dm @@ -68,7 +68,7 @@ playsound(M, 'sound/weapons/laserPump.ogg', 100, 1) //Ends with high pitched charging noise recharge_newshot() //try to charge a new shot update_icon() - return 1 + return TRUE /obj/item/gun/energy/pumpaction/AltClick(mob/living/user) //for changing firing modes since attackself is already used for pumping . = ..() diff --git a/tgstation.dme b/tgstation.dme index 61929f6089..45d3f018ad 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -20,6 +20,7 @@ #include "code\_compile_options.dm" #include "code\world.dm" #include "code\__DEFINES\_auxtools.dm" +#include "code\__DEFINES\_click.dm" #include "code\__DEFINES\_globals.dm" #include "code\__DEFINES\_protect.dm" #include "code\__DEFINES\_tick.dm" @@ -160,6 +161,7 @@ #include "code\__DEFINES\dcs\flags.dm" #include "code\__DEFINES\dcs\helpers.dm" #include "code\__DEFINES\dcs\signals.dm" +#include "code\__DEFINES\dcs\signals\signals_action.dm" #include "code\__DEFINES\dcs\signals\signals_global.dm" #include "code\__DEFINES\dcs\signals\signals_hud.dm" #include "code\__DEFINES\dcs\signals\signals_medical.dm" @@ -169,6 +171,7 @@ #include "code\__DEFINES\dcs\signals\signals_screentips.dm" #include "code\__DEFINES\dcs\signals\signals_subsystem.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_main.dm" +#include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_mouse.dm" #include "code\__DEFINES\dcs\signals\signals_atom\signals_atom_movement.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_living.dm" #include "code\__DEFINES\dcs\signals\signals_mob\signals_mob_main.dm" @@ -223,6 +226,7 @@ #include "code\__HELPERS\reagents.dm" #include "code\__HELPERS\roundend.dm" #include "code\__HELPERS\sanitize_values.dm" +#include "code\__HELPERS\screen_objs.dm" #include "code\__HELPERS\shell.dm" #include "code\__HELPERS\stat_tracking.dm" #include "code\__HELPERS\text.dm" @@ -281,7 +285,6 @@ #include "code\_onclick\right_item_attack.dm" #include "code\_onclick\right_other_mobs.dm" #include "code\_onclick\telekinesis.dm" -#include "code\_onclick\hud\_defines.dm" #include "code\_onclick\hud\action_button.dm" #include "code\_onclick\hud\ai.dm" #include "code\_onclick\hud\alert.dm"