Merge branch 'master' into cube-world

This commit is contained in:
TrilbySpaceClone
2020-04-23 02:04:56 -04:00
374 changed files with 5466 additions and 3233 deletions
@@ -70,7 +70,7 @@
/obj/structure/alien/weeds,
/obj/item/clothing/mask/facehugger/impregnated,
/obj/item/clothing/glasses/night,
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/effect/decal/cleanable/blood/old,
/obj/item/clothing/under/syndicate/tacticool,
/turf/open/floor/plating/asteroid/basalt/lava_land_surface,
@@ -526,8 +526,8 @@
/obj/structure/closet/crate/secure/gear{
req_access_txt = "150"
},
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/item/clothing/under/syndicate/combat,
/obj/item/clothing/under/syndicate/combat,
/obj/item/storage/belt/military,
@@ -4197,7 +4197,7 @@
"kw" = (
/obj/structure/table,
/obj/effect/decal/cleanable/dirt,
/obj/item/clothing/gloves/combat{
/obj/item/clothing/gloves/tackler/combat/insulated{
pixel_y = -6
},
/obj/item/tank/internals/emergency_oxygen{
+2 -2
View File
@@ -185,7 +185,7 @@
name = "Clothes"
},
/obj/item/clothing/head/chameleon,
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/item/clothing/suit/chameleon,
/obj/item/clothing/under/chameleon,
/obj/item/clothing/shoes/chameleon,
@@ -221,7 +221,7 @@
},
/obj/item/clothing/under/rank/centcom/commander,
/obj/item/clothing/head/centhat,
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/item/clothing/suit/armor/vest,
/obj/item/clothing/shoes/sneakers/brown,
/turf/open/floor/wood,
+2 -2
View File
@@ -2202,11 +2202,11 @@
/area/ruin/space/has_grav/deepstorage/armory)
"eO" = (
/obj/structure/table,
/obj/item/clothing/gloves/combat{
/obj/item/clothing/gloves/tackler/combat/insulated{
pixel_x = -3;
pixel_y = 4
},
/obj/item/clothing/gloves/combat{
/obj/item/clothing/gloves/tackler/combat/insulated{
pixel_x = 3;
pixel_y = -2
},
+1 -1
View File
@@ -4322,7 +4322,7 @@
/turf/open/floor/plating/asteroid/snow,
/area/awaymission/academy/academycellar)
"mV" = (
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/turf/open/floor/plating/asteroid/snow,
/area/awaymission/academy/academycellar)
"mW" = (
+1 -1
View File
@@ -243,7 +243,7 @@
/area/awaymission/spacebattle/syndicate1)
"bg" = (
/obj/structure/table/reinforced,
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/turf/open/floor/mineral/plastitanium/red,
/area/awaymission/spacebattle/syndicate1)
"bh" = (
+55 -24
View File
@@ -60,7 +60,9 @@
/obj/structure/cable{
icon_state = "4-8"
},
/obj/machinery/atmospherics/pipe/manifold/scrubbers/hidden,
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{
dir = 5
},
/turf/open/floor/plasteel,
/area/security/main)
"aai" = (
@@ -2696,6 +2698,9 @@
/obj/effect/turf_decal/tile/red{
dir = 8
},
/obj/machinery/atmospherics/pipe/simple/supply/hidden{
dir = 4
},
/turf/open/floor/plasteel,
/area/security/main)
"afp" = (
@@ -4439,9 +4444,6 @@
/obj/structure/cable{
icon_state = "4-8"
},
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{
dir = 4
},
/obj/effect/turf_decal/tile/red{
dir = 1
},
@@ -5100,9 +5102,6 @@
/obj/structure/cable{
icon_state = "2-4"
},
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{
dir = 4
},
/obj/structure/disposalpipe/segment{
dir = 6
},
@@ -5528,9 +5527,6 @@
dir = 1;
pixel_y = -24
},
/obj/machinery/atmospherics/pipe/simple/supply/hidden{
dir = 4
},
/obj/effect/turf_decal/tile/red{
dir = 1
},
@@ -5546,14 +5542,14 @@
/obj/structure/cable{
icon_state = "1-2"
},
/obj/machinery/atmospherics/pipe/manifold/supply/hidden{
dir = 1
},
/obj/effect/turf_decal/tile/red,
/obj/effect/turf_decal/tile/red{
dir = 8
},
/obj/structure/disposalpipe/segment,
/obj/machinery/atmospherics/pipe/simple/supply/hidden{
dir = 6
},
/turf/open/floor/plasteel,
/area/security/main)
"akj" = (
@@ -7986,6 +7982,9 @@
/obj/structure/disposalpipe/segment{
dir = 6
},
/obj/structure/cable{
icon_state = "2-8"
},
/turf/open/floor/plating,
/area/maintenance/fore/secondary)
"aqm" = (
@@ -9816,6 +9815,9 @@
name = "Dormitories Maintenance";
req_access_txt = "12"
},
/obj/structure/cable{
icon_state = "1-2"
},
/turf/open/floor/plating,
/area/maintenance/fore/secondary)
"avy" = (
@@ -10271,6 +10273,9 @@
/obj/structure/disposalpipe/segment{
dir = 5
},
/obj/structure/cable{
icon_state = "1-2"
},
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"awz" = (
@@ -23786,9 +23791,6 @@
"bfC" = (
/obj/structure/table/wood,
/obj/item/flashlight/lamp/green,
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{
dir = 5
},
/turf/open/floor/wood,
/area/crew_quarters/heads/captain)
"bfD" = (
@@ -55616,6 +55618,10 @@
},
/turf/open/floor/wood,
/area/crew_quarters/bar)
"iUK" = (
/obj/machinery/atmospherics/pipe/simple/supply/hidden,
/turf/open/floor/plasteel,
/area/security/vacantoffice/b)
"iVU" = (
/obj/machinery/atmospherics/pipe/simple/supply/hidden{
dir = 4
@@ -56974,6 +56980,12 @@
/obj/machinery/vending/autodrobe,
/turf/open/floor/wood,
/area/maintenance/bar)
"nfw" = (
/obj/structure/cable{
icon_state = "1-2"
},
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"ngs" = (
/obj/machinery/atmospherics/components/unary/vent_pump/on{
dir = 8
@@ -57837,6 +57849,13 @@
},
/turf/open/floor/plating,
/area/crew_quarters/fitness)
"pRW" = (
/obj/structure/disposalpipe/segment,
/obj/structure/cable{
icon_state = "1-2"
},
/turf/open/floor/plating,
/area/maintenance/fore/secondary)
"pTB" = (
/obj/structure/lattice/catwalk,
/obj/structure/cable{
@@ -59423,6 +59442,15 @@
},
/turf/open/floor/plating,
/area/space/nearstation)
"vaW" = (
/obj/machinery/atmospherics/pipe/simple/scrubbers/hidden{
dir = 4
},
/obj/structure/cable{
icon_state = "1-2"
},
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"vbi" = (
/obj/structure/table,
/obj/item/instrument/guitar{
@@ -59990,6 +60018,9 @@
dir = 1;
pixel_y = -22
},
/obj/structure/cable{
icon_state = "1-4"
},
/turf/open/floor/plasteel,
/area/crew_quarters/dorms)
"wrp" = (
@@ -86195,7 +86226,7 @@ cCi
aqX
arR
asj
arT
iUK
ajr
atY
auo
@@ -94674,15 +94705,15 @@ aoa
ajo
apt
aql
aoJ
aoJ
aoJ
aoJ
pRW
pRW
pRW
pRW
avw
awy
awr
awr
avG
nfw
nfw
vaW
wqF
aAh
aAh
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -7639,7 +7639,7 @@
/obj/item/clothing/suit/space/hardsuit/deathsquad{
pixel_y = 5
},
/obj/item/clothing/gloves/combat,
/obj/item/clothing/gloves/tackler/combat/insulated,
/obj/item/clothing/shoes/combat/swat,
/obj/item/clothing/mask/gas/sechailer/swat,
/obj/effect/turf_decal/stripes/line,
-32
View File
@@ -1,32 +0,0 @@
#if DM_VERSION < 513
#define ismovableatom(A) (istype(A, /atom/movable))
#define islist(L) (istype(L, /list))
#define CLAMP01(x) (CLAMP(x, 0, 1))
#define CLAMP(CLVALUE,CLMIN,CLMAX) ( max( (CLMIN), min((CLVALUE), (CLMAX)) ) )
#define ATAN2(x, y) ( !(x) && !(y) ? 0 : (y) >= 0 ? arccos((x) / sqrt((x)*(x) + (y)*(y))) : -arccos((x) / sqrt((x)*(x) + (y)*(y))) )
#define TAN(x) (sin(x) / cos(x))
#define arctan(x) (arcsin(x/sqrt(1+x*x)))
//////////////////////////////////////////////////
#else
#define ismovableatom(A) ismovable(A)
#define CLAMP01(x) clamp(x, 0, 1)
#define CLAMP(CLVALUE, CLMIN, CLMAX) clamp(CLVALUE, CLMIN, CLMAX)
#define TAN(x) tan(x)
#define ATAN2(x, y) arctan(x, y)
#endif
+1 -1
View File
@@ -99,7 +99,7 @@
#define NO_ASS_SLAP (1<<10)
#define BIMBOFICATION (1<<11)
#define TOGGLES_CITADEL (EATING_NOISES|DIGESTION_NOISES|BREAST_ENLARGEMENT|PENIS_ENLARGEMENT)
#define TOGGLES_CITADEL 0
//component stuff
#define COMSIG_VORE_TOGGLED "voremode_toggled" // totally not copypasta
+1 -1
View File
@@ -302,8 +302,8 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
/// Block priorities
#define BLOCK_PRIORITY_HELD_ITEM 100
#define BLOCK_PRIORITY_CLOTHING 50
#define BLOCK_PRIORITY_WEAR_SUIT 75
#define BLOCK_PRIORITY_CLOTHING 50
#define BLOCK_PRIORITY_UNIFORM 25
#define BLOCK_PRIORITY_DEFAULT BLOCK_PRIORITY_HELD_ITEM
+3
View File
@@ -73,6 +73,9 @@
#define CAT_AMMO "Ammunition"
#define CAT_ROBOT "Robots"
#define CAT_MISC "Misc"
#define CAT_MISCELLANEOUS "Miscellaneous"
#define CAT_TOOL "Tools & Storage"
#define CAT_FURNITURE "Furniture"
#define CAT_PRIMAL "Tribal"
#define CAT_CLOTHING "Clothing"
#define CAT_FOOD "Foods"
+6 -2
View File
@@ -119,6 +119,8 @@
#define COMSIG_MOVABLE_UNCROSSED "movable_uncrossed" //from base of atom/movable/Uncrossed(): (/atom/movable)
#define COMSIG_MOVABLE_BUMP "movable_bump" //from base of atom/movable/Bump(): (/atom)
#define COMSIG_MOVABLE_IMPACT "movable_impact" //from base of atom/movable/throw_impact(): (/atom/hit_atom, /datum/thrownthing/throwingdatum)
#define COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH 1 ///if true, flip if the impact will push what it hits
#define COMPONENT_MOVABLE_IMPACT_NEVERMIND 2 ///return true if you destroyed whatever it was you're impacting and there won't be anything for hitby() to run on
#define COMSIG_MOVABLE_IMPACT_ZONE "item_impact_zone" //from base of mob/living/hitby(): (mob/living/target, hit_zone)
#define COMSIG_MOVABLE_BUCKLE "buckle" //from base of atom/movable/buckle_mob(): (mob, force)
#define COMSIG_MOVABLE_UNBUCKLE "unbuckle" //from base of atom/movable/unbuckle_mob(): (mob, force)
@@ -138,7 +140,6 @@
#define HEARING_SOURCE 8*/
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)
#define COMSIG_MOVABLE_TELEPORTED "movable_teleported" //from base of do_teleport(): (channel, turf/origin, turf/destination)
// /mind signals
#define COMSIG_PRE_MIND_TRANSFER "pre_mind_transfer" //from base of mind/transfer_to() before it's done: (new_character, old_character)
#define COMPONENT_STOP_MIND_TRANSFER 1 //stops the mind transfer from happening.
@@ -148,6 +149,8 @@
#define COMSIG_MOB_EXAMINATE "mob_examinate" //from base of /mob/verb/examinate(): (atom/A)
#define COMSIG_MOB_DEATH "mob_death" //from base of mob/death(): (gibbed)
#define COMPONENT_BLOCK_DEATH_BROADCAST 1 //stops the death from being broadcasted in deadchat.
#define COMSIG_MOB_CLICKON "mob_clickon" //from base of mob/clickon(): (atom/A, params)
#define COMSIG_MOB_CANCEL_CLICKON 1
#define COMSIG_MOB_GHOSTIZE "mob_ghostize" //from base of mob/Ghostize(): (can_reenter_corpse, special, penalize)
#define COMPONENT_BLOCK_GHOSTING (1<<0)
#define COMPONENT_DO_NOT_PENALIZE_GHOSTING (1<<1)
@@ -197,6 +200,7 @@
#define COMSIG_LIVING_RUN_BLOCK "living_do_run_block" //from base of mob/living/do_run_block(): (real_attack, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone)
#define COMSIG_LIVING_COMBAT_ENABLED "combatmode_enabled" //from base of mob/living/enable_combat_mode() (was_forced)
#define COMSIG_LIVING_COMBAT_DISABLED "combatmode_disabled" //from base of mob/living/disable_combat_mode() (was_forced)
#define COMSIG_LIVING_GET_BLOCKING_ITEMS "get_blocking_items" //from base of mob/living/get_blocking_items(): (list/items)
//ALL OF THESE DO NOT TAKE INTO ACCOUNT WHETHER AMOUNT IS 0 OR LOWER AND ARE SENT REGARDLESS!
#define COMSIG_LIVING_STATUS_STUN "living_stun" //from base of mob/living/Stun() (amount, update, ignore)
@@ -212,7 +216,7 @@
// /mob/living/carbon signals
#define COMSIG_CARBON_SOUNDBANG "carbon_soundbang" //from base of mob/living/carbon/soundbang_act(): (list(intensity))
#define COMSIG_CARBON_IDENTITY_TRANSFERRED_TO "carbon_id_transferred_to" //from datum/dna/transfer_identity(): (datum/dna, transfer_SE)
#define COMSIG_CARBON_TACKLED "carbon_tackled" //sends from tackle.dm on tackle completion
// /mob/living/simple_animal/hostile signals
#define COMSIG_HOSTILE_ATTACKINGTARGET "hostile_attackingtarget"
#define COMPONENT_HOSTILE_NO_ATTACK 1
+2
View File
@@ -246,6 +246,8 @@ GLOBAL_LIST_INIT(pointed_types, typecacheof(list(
#define isgun(A) (istype(A, /obj/item/gun))
#define isfood(A) (istype(A, /obj/item/reagent_containers/food))
//Assemblies
#define isassembly(O) (istype(O, /obj/item/assembly))
+7 -5
View File
@@ -17,6 +17,8 @@
#define PERCENT(val) (round((val)*100, 0.1))
#define CLAMP01(x) clamp(x, 0, 1)
//time of day but automatically adjusts to the server going into the next day within the same round.
//for when you need a reliable time number that doesn't depend on byond time.
#define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK))
@@ -30,13 +32,13 @@
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
#define WRAP(val, min, max) CLAMP(( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),min,max-1)
#define WRAP(val, min, max) clamp(( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) ),min,max-1)
// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
// Cotangent
#define COT(x) (1 / TAN(x))
#define COT(x) (1 / tan(x))
// Secant
#define SEC(x) (1 / cos(x))
@@ -169,8 +171,8 @@
while(pixel_y < -16)
pixel_y += 32
new_y--
new_x = CLAMP(new_x, 0, world.maxx)
new_y = CLAMP(new_y, 0, world.maxy)
new_x = clamp(new_x, 0, world.maxx)
new_y = clamp(new_y, 0, world.maxy)
return locate(new_x, new_y, starting.z)
// Returns a list where [1] is all x values and [2] is all y values that overlap between the given pair of rectangles
@@ -195,7 +197,7 @@
#define EXP_DISTRIBUTION(desired_mean) ( -(1/(1/desired_mean)) * log(rand(1, 1000) * 0.001) )
#define LORENTZ_DISTRIBUTION(x, s) ( s*TAN(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_DISTRIBUTION(x, s) ( s*tan(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
+10 -10
View File
@@ -36,16 +36,16 @@
#define BLOODCRAWL_EAT 2
//Mob bio-types flags
#define MOB_ORGANIC 1 << 0
#define MOB_MINERAL 1 << 1
#define MOB_ROBOTIC 1 << 2
#define MOB_UNDEAD 1 << 3
#define MOB_HUMANOID 1 << 4
#define MOB_BUG 1 << 5
#define MOB_BEAST 1 << 6
#define MOB_EPIC 1 << 7 //megafauna
#define MOB_REPTILE 1 << 8
#define MOB_SPIRIT 1 << 9
#define MOB_ORGANIC (1 << 0)
#define MOB_MINERAL (1 << 1)
#define MOB_ROBOTIC (1 << 2)
#define MOB_UNDEAD (1 << 3)
#define MOB_HUMANOID (1 << 4)
#define MOB_BUG (1 << 5)
#define MOB_BEAST (1 << 6)
#define MOB_EPIC (1 << 7) //megafauna
#define MOB_REPTILE (1 << 8)
#define MOB_SPIRIT (1 << 9)
//Organ defines for carbon mobs
#define ORGAN_ORGANIC 1
+1 -1
View File
@@ -91,12 +91,12 @@
// Subsystem fire priority, from lowest to highest priority
// If the subsystem isn't listed here it's either DEFAULT or PROCESS (if it's a processing subsystem child)
#define FIRE_PRIORITY_VORE 5
#define FIRE_PRIORITY_PING 10
#define FIRE_PRIORITY_IDLE_NPC 10
#define FIRE_PRIORITY_SERVER_MAINT 10
#define FIRE_PRIORITY_RESEARCH 10
#define FIRE_PRIORITY_VIS 10
#define FIRE_PRIORITY_VORE 10
#define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_WET_FLOORS 20
#define FIRE_PRIORITY_AIR 20
+2
View File
@@ -150,6 +150,8 @@
#define TRAIT_PUGILIST "pugilist" //This guy punches people for a living
#define TRAIT_KI_VAMPIRE "ki-vampire" //when someone with this trait rolls maximum damage on a punch and stuns the target, they regain some stamina and do clone damage
#define TRAIT_PASSTABLE "passtable"
#define TRAIT_GIANT "giant"
#define TRAIT_DWARF "dwarf"
// mobility flag traits
// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it)
+13
View File
@@ -7,6 +7,19 @@
#define DM_ABSORB "Absorb"
#define DM_UNABSORB "Un-absorb"
#define DIGESTABLE (1<<0)
#define SHOW_VORE_PREFS (1<<1)
#define DEVOURABLE (1<<2)
#define FEEDING (1<<3)
#define NO_VORE (1<<4)
#define OPEN_PANEL (1<<5)
#define ABSORBED (1<<6)
#define VORE_INIT (1<<7)
#define VOREPREF_INIT (1<<8)
#define LICKABLE (1<<9)
#define MAX_VORE_FLAG (1<<10)-1 // change this whenever you add a vore flag, must be largest vore flag*2-1
#define isbelly(A) istype(A, /obj/belly)
#define QDEL_NULL_LIST(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }
+1 -1
View File
@@ -61,7 +61,7 @@
var/adjacencies = 0
var/atom/movable/AM
if(ismovableatom(A))
if(ismovable(A))
AM = A
if(AM.can_be_unanchored && !AM.anchored)
return 0
+1 -1
View File
@@ -11,7 +11,7 @@
var/screenviewY = screenview[2] * world.icon_size
var/ox = round(screenviewX/2) - client.pixel_x //"origin" x
var/oy = round(screenviewY/2) - client.pixel_y //"origin" y
var/angle = SIMPLIFY_DEGREES(ATAN2(y - oy, x - ox))
var/angle = SIMPLIFY_DEGREES(arctan(y - oy, x - ox))
return angle
//Wow, specific name!
+2 -2
View File
@@ -2,9 +2,9 @@
/proc/sanitize_frequency(frequency, free = FALSE)
frequency = round(frequency)
if(free)
. = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
. = clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
else
. = CLAMP(frequency, MIN_FREQ, MAX_FREQ)
. = clamp(frequency, MIN_FREQ, MAX_FREQ)
if(!(. % 2)) // Ensure the last digit is an odd number
. += 1
+7
View File
@@ -6,6 +6,13 @@
return number
return default
/proc/sanitize_num_clamp(number, min=0, max=1, default=0, quantize=0)
if(!isnum(number))
return default
. = clamp(number, min, max)
if(quantize)
. = round(number, quantize)
/proc/sanitize_text(text, default="")
if(istext(text))
return text
+5 -5
View File
@@ -777,8 +777,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
tX = splittext(tX[1], ":")
tX = tX[1]
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = CLAMP(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
tY = CLAMP(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
tX = clamp(origin.x + text2num(tX) - round(actual_view[1] / 2) - 1, 1, world.maxx)
tY = clamp(origin.y + text2num(tY) - round(actual_view[2] / 2) - 1, 1, world.maxy)
return locate(tX, tY, tZ)
/proc/screen_loc2turf(text, turf/origin, client/C)
@@ -791,8 +791,8 @@ GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list(
tX = text2num(tX[2])
tZ = origin.z
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = CLAMP(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = CLAMP(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
tX = clamp(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = clamp(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
return locate(tX, tY, tZ)
/proc/IsValidSrc(datum/D)
@@ -1568,7 +1568,7 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
/proc/blood_sucking_checks(var/mob/living/carbon/target, check_neck, check_blood)
//Bypass this if the target isnt carbon.
if(!iscarbon(target))
return TRUE
return TRUE
if(check_neck)
if(istype(target.get_item_by_slot(SLOT_NECK), /obj/item/clothing/neck/garlic_necklace))
return FALSE
+4 -23
View File
@@ -32,31 +32,12 @@
#endif
//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 512
#if DM_VERSION < MIN_COMPILER_VERSION
#define MIN_COMPILER_VERSION 513
#define MIN_COMPILER_BUILD 1508
#if DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD
//Don't forget to update this part
#error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update.
#error You need version 512 or higher
#endif
//Compatability -- These procs were added in 513.1493, not 513.1490
//Which really shoulda bumped us up to 514 right then and there but instead Lummox is a dumb dumb
#if DM_BUILD < 1493
#define length_char(args...) length(args)
#define text2ascii_char(args...) text2ascii(args)
#define copytext_char(args...) copytext(args)
#define splittext_char(args...) splittext(args)
#define spantext_char(args...) spantext(args)
#define nonspantext_char(args...) nonspantext(args)
#define findtext_char(args...) findtext(args)
#define findtextEx_char(args...) findtextEx(args)
#define findlasttext_char(args...) findlasttext(args)
#define findlasttextEx_char(args...) findlasttextEx(args)
#define replacetext_char(args...) replacetext(args)
#define replacetextEx_char(args...) replacetextEx(args)
// /regex procs
#define Find_char(args...) Find(args)
#define Replace_char(args...) Replace(args)
#error You need version 513.1508 or higher
#endif
//Additional code for the above flags.
@@ -115,5 +115,6 @@ GLOBAL_LIST_INIT(maintenance_loot, list(
/obj/item/autosurgeon/penis = 1,
/obj/item/autosurgeon/testicles = 1,
/obj/item/storage/box/marshmallow = 2,
/obj/item/clothing/gloves/tackler/offbrand = 1,
"" = 3
))
+3
View File
@@ -75,6 +75,9 @@
if(notransform)
return
if(SEND_SIGNAL(src, COMSIG_MOB_CLICKON, A, params) & COMSIG_MOB_CANCEL_CLICKON)
return
var/list/modifiers = params2list(params)
if(modifiers["shift"] && modifiers["middle"])
ShiftMiddleClickOn(A)
+2 -2
View File
@@ -102,8 +102,8 @@
add_overlay(standard_background)
/obj/screen/movable/pic_in_pic/proc/set_view_size(width, height, do_refresh = TRUE)
width = CLAMP(width, 0, max_dimensions)
height = CLAMP(height, 0, max_dimensions)
width = clamp(width, 0, max_dimensions)
height = clamp(height, 0, max_dimensions)
src.width = width
src.height = height
+2 -2
View File
@@ -155,9 +155,9 @@
/obj/item/proc/get_clamped_volume()
if(w_class)
if(force)
return CLAMP((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
return clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else
return CLAMP(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
var/message_verb = "attacked"
+1 -1
View File
@@ -5,7 +5,7 @@
return // seems legit.
// Things you might plausibly want to follow
if(ismovableatom(A))
if(ismovable(A))
ManualFollow(A)
// Otherwise jump
@@ -103,7 +103,7 @@
return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
config_entry_value = CLAMP(integer ? round(temp) : temp, min_val, max_val)
config_entry_value = clamp(integer ? round(temp) : temp, min_val, max_val)
if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [config_entry_value]!")
return TRUE
@@ -455,10 +455,12 @@
config_entry_value = RESIZE_DEFAULT_SIZE
min_val = 0.1 //to avoid issues with zeros and negative values.
max_val = RESIZE_DEFAULT_SIZE
integer = FALSE
/datum/config_entry/number/body_size_max
config_entry_value = RESIZE_DEFAULT_SIZE
min_val = RESIZE_DEFAULT_SIZE
integer = FALSE
//Pun-Pun movement slowdown given to characters with a body size smaller than this value,
//to compensate for their smaller hitbox.
@@ -467,13 +469,14 @@
config_entry_value = RESIZE_DEFAULT_SIZE * 0.85
min_val = 0
max_val = RESIZE_DEFAULT_SIZE
integer = FALSE
//multiplicative slowdown multiplier. See 'dna.update_body_size' for the operation.
//doesn't apply to floating or crawling mobs
/datum/config_entry/number/body_size_slowdown_multiplier
config_entry_value = 0.25
min_val = 0.1 //To encourage folks to disable the slowdown through the above config instead.
integer = FALSE
//Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones.
/datum/config_entry/number/allow_custom_skintones
config_entry_value = 1
/datum/config_entry/flag/allow_custom_skintones
+2
View File
@@ -428,6 +428,8 @@ SUBSYSTEM_DEF(job)
if(!joined_late)
var/obj/S = null
for(var/obj/effect/landmark/start/sloc in GLOB.start_landmarks_list)
if(!sloc.job_spawnpoint)
continue
if(sloc.name != rank)
S = sloc //so we can revert to spawning them on top of eachother if something goes wrong
continue
+1 -13
View File
@@ -5,7 +5,7 @@ SUBSYSTEM_DEF(profiler)
init_order = INIT_ORDER_PROFILER
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
wait = 3000
flags = SS_NO_TICK_CHECK
flags = SS_NO_TICK_CHECK
var/fetch_cost = 0
var/write_cost = 0
@@ -31,23 +31,12 @@ SUBSYSTEM_DEF(profiler)
return ..()
/datum/controller/subsystem/profiler/proc/StartProfiling()
#if DM_BUILD < 1506 || DM_VERSION < 513
stack_trace("Auto profiling unsupported on this byond version")
CONFIG_SET(flag/auto_profile, FALSE)
#else
world.Profile(PROFILE_START)
#endif
/datum/controller/subsystem/profiler/proc/StopProfiling()
#if DM_BUILD >= 1506 && DM_VERSION >= 513
world.Profile(PROFILE_STOP)
#endif
/datum/controller/subsystem/profiler/proc/DumpFile()
#if DM_BUILD < 1506 || DM_VERSION < 513
stack_trace("Auto profiling unsupported on this byond version")
CONFIG_SET(flag/auto_profile, FALSE)
#else
var/timer = TICK_USAGE_REAL
var/current_profile_data = world.Profile(PROFILE_REFRESH,format="json")
fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
@@ -60,4 +49,3 @@ SUBSYSTEM_DEF(profiler)
timer = TICK_USAGE_REAL
WRITE_FILE(json_file, current_profile_data)
write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
#endif
+1 -1
View File
@@ -23,7 +23,7 @@ SUBSYSTEM_DEF(time_track)
var/time_dilation_text
/datum/controller/subsystem/time_track/fire()
stat_time_text = "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]\n\nRound Time: [WORLDTIME2TEXT("hh:mm:ss")]\n\nStation Time: [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]\n\n[time_dilation_text]"
stat_time_text = "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]\n\nRound Time: [DisplayTimeText(world.time - SSticker.round_start_time, 1)] \n\nStation Time: [STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]\n\n[time_dilation_text]"
if(++last_measurement == measurement_delay)
last_measurement = 0
+1 -1
View File
@@ -4,7 +4,7 @@
var/list/bounce_signals = list(COMSIG_MOVABLE_IMPACT, COMSIG_ITEM_HIT_REACT, COMSIG_ITEM_ATTACK)
/datum/component/bouncy/Initialize(_bouncy_mod, list/_bounce_signals)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
if(_bouncy_mod)
bouncy_mod = _bouncy_mod
+14 -5
View File
@@ -55,7 +55,7 @@
log_combat(user, H, "starts slicing the throat of")
playsound(H.loc, butcher_sound, 50, TRUE, -1)
if(do_mob(user, H, CLAMP(500 / source.force, 30, 100)) && H.Adjacent(source))
if(do_mob(user, H, clamp(500 / source.force, 30, 100)) && H.Adjacent(source))
if(H.has_status_effect(/datum/status_effect/neck_slice))
user.show_message("<span class='warning'>[H]'s neck has already been already cut, you can't make the bleeding any worse!</span>", 1, \
"<span class='warning'>Their neck has already been already cut, you can't make the bleeding any worse!</span>")
@@ -65,13 +65,17 @@
"<span class='userdanger'>[user] slits your throat...</span>")
log_combat(user, H, "finishes slicing the throat of")
H.apply_damage(source.force, BRUTE, BODY_ZONE_HEAD)
H.bleed_rate = CLAMP(H.bleed_rate + 20, 0, 30)
H.bleed_rate = clamp(H.bleed_rate + 20, 0, 30)
H.apply_status_effect(/datum/status_effect/neck_slice)
/datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat)
var/meat_quality = 50 + (bonus_modifier/10) //increases through quality of butchering tool, and through if it was butchered in the kitchen or not
if(istype(get_area(butcher), /area/crew_quarters/kitchen))
meat_quality = meat_quality + 10
var/turf/T = meat.drop_location()
var/final_effectiveness = effectiveness - meat.butcher_difficulty
var/bonus_chance = max(0, (final_effectiveness - 100) + bonus_modifier) //so 125 total effectiveness = 25% extra chance
var/list/butchered_items = list()
for(var/V in meat.butcher_results)
var/obj/bones = V
var/amount = meat.butcher_results[bones]
@@ -83,16 +87,21 @@
if(butcher)
to_chat(butcher, "<span class='info'>You harvest some extra [initial(bones.name)] from [meat]!</span>")
for(var/i in 1 to 2)
new bones (T)
butchered_items += new bones (T)
else
new bones (T)
butchered_items += new bones (T)
meat.butcher_results.Remove(bones) //in case you want to, say, have it drop its results on gib
for(var/V in meat.guaranteed_butcher_results)
var/obj/sinew = V
var/amount = meat.guaranteed_butcher_results[sinew]
for(var/i in 1 to amount)
new sinew (T)
butchered_items += new sinew (T)
meat.guaranteed_butcher_results.Remove(sinew)
for(var/butchered_item in butchered_items)
if(isfood(butchered_item))
var/obj/item/reagent_containers/food/butchered_meat = butchered_item
butchered_meat.food_quality = meat_quality
if(butcher)
meat.visible_message("<span class='notice'>[butcher] butchers [meat].</span>")
ButcherEffects(meat)
+18 -2
View File
@@ -15,7 +15,7 @@
/datum/component/personal_crafting
var/busy
var/viewing_category = 1 //typical powergamer starting on the Weapons tab
var/viewing_category = 1
var/viewing_subcategory = 1
var/list/categories = list(
CAT_WEAPONRY = list(
@@ -23,7 +23,11 @@
CAT_AMMO,
),
CAT_ROBOT = CAT_NONE,
CAT_MISC = CAT_NONE,
CAT_MISC = list(
CAT_MISCELLANEOUS,
CAT_TOOL,
CAT_FURNITURE,
),
CAT_PRIMAL = CAT_NONE,
CAT_FOOD = list(
CAT_BREAD,
@@ -201,6 +205,18 @@
var/atom/movable/I = new R.result (get_turf(user.loc))
I.CheckParts(parts, R)
if(isitem(I))
if(isfood(I))
var/obj/item/reagent_containers/food/food_result = I
var/total_quality = 0
var/total_items = 0
for(var/obj/item/ingredient in parts)
var/obj/item/reagent_containers/food/food_ingredient = ingredient
total_items += 1
total_quality += food_ingredient.food_quality
if(total_items == 0)
food_result.adjust_food_quality(50)
else
food_result.adjust_food_quality(total_quality / total_items)
user.put_in_hands(I)
if(send_feedback)
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
@@ -23,3 +23,4 @@
*/
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
return TRUE
@@ -41,7 +41,7 @@
category = CAT_CLOTHING
/datum/crafting_recipe/armwraps
name = "armwraps"
name = "Armwraps"
result = /obj/item/clothing/gloves/fingerless/pugilist
time = 60
tools = list(TOOL_WIRECUTTER)
@@ -51,7 +51,7 @@
category = CAT_CLOTHING
/datum/crafting_recipe/armwrapsplusone
name = "armwraps of mighty fists"
name = "Armwraps of Mighty Fists"
result = /obj/item/clothing/gloves/fingerless/pugilist/magic
time = 300
tools = list(TOOL_WIRECUTTER, /obj/item/book/codex_gigas, /obj/item/clothing/head/wizard, /obj/item/clothing/suit/wizrobe)
@@ -327,3 +327,16 @@
/obj/item/stack/cable_coil = 10)
time = 100 //Takes awhile to put all the garlics on the coil and knot it.
category = CAT_CLOTHING
/datum/crafting_recipe/gripperoffbrand
name = "Improvised Gripper Gloves"
reqs = list(
/obj/item/clothing/gloves/fingerless = 1,
// /obj/item/stack/sticky_tape = 1
/obj/item/stack/cable_coil = 5,
/obj/item/stack/sheet/cloth = 2,
)
result = /obj/item/clothing/gloves/tackler/offbrand
category = CAT_CLOTHING
tools = list(TOOL_WIRECUTTER)
time = 20
@@ -8,6 +8,7 @@
/obj/item/stack/sheet/plastic = 2,
/obj/item/stack/rods = 1)
result = /obj/structure/curtain
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/guillotine
@@ -18,6 +19,7 @@
/obj/item/stack/sheet/mineral/wood = 20,
/obj/item/stack/cable_coil = 10)
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/femur_breaker
@@ -27,8 +29,88 @@
reqs = list(/obj/item/stack/sheet/metal = 20,
/obj/item/stack/cable_coil = 30)
tools = list(TOOL_SCREWDRIVER, TOOL_WRENCH, TOOL_WELDER)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
// Blood Sucker stuff //
/datum/crafting_recipe/bloodsucker/blackcoffin
name = "Black Coffin"
result = /obj/structure/closet/crate/coffin/blackcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/cloth = 1,
/obj/item/stack/sheet/mineral/wood = 5,
/obj/item/stack/sheet/metal = 1)
///obj/item/stack/packageWrap = 8,
///obj/item/pipe = 2)
time = 150
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/meatcoffin
name = "Meat Coffin"
result =/obj/structure/closet/crate/coffin/meatcoffin
tools = list(/obj/item/kitchen/knife,
/obj/item/kitchen/rollingpin)
reqs = list(/obj/item/reagent_containers/food/snacks/meat/slab = 5,
/obj/item/restraints/handcuffs/cable = 1)
time = 150
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/metalcoffin
name = "Metal Coffin"
result =/obj/structure/closet/crate/coffin/metalcoffin
tools = list(/obj/item/weldingtool,
/obj/item/screwdriver)
reqs = list(/obj/item/stack/sheet/metal = 5)
time = 100
subcategory = CAT_FURNITURE
category = CAT_MISC
always_availible = TRUE
/datum/crafting_recipe/bloodsucker/vassalrack
name = "Persuasion Rack"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/vassalrack
tools = list(/obj/item/weldingtool,
//obj/item/screwdriver,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/mineral/wood = 3,
/obj/item/stack/sheet/metal = 2,
/obj/item/restraints/handcuffs/cable = 2,
//obj/item/storage/belt = 1,
//obj/item/stack/sheet/animalhide = 1,
//obj/item/stack/sheet/leather = 1,
//obj/item/stack/sheet/plasteel = 5
)
//parts = list(/obj/item/storage/belt = 1
// )
time = 150
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/bloodsucker/candelabrum
name = "Candelabrum"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/candelabrum
tools = list(/obj/item/weldingtool,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/metal = 3,
/obj/item/stack/rods = 1,
/obj/item/candle = 1
)
time = 100
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
always_availible = FALSE // Disabled til learned
///////////////////
//Tools & Storage//
///////////////////
@@ -42,6 +124,7 @@
/obj/item/pipe = 3,
/obj/item/stack/cable_coil = 30)
category = CAT_MISC
subcategory = CAT_TOOL
tools = list(TOOL_WRENCH, TOOL_WELDER, TOOL_WIRECUTTER)
/datum/crafting_recipe/goldenbox
@@ -53,6 +136,23 @@
/obj/item/stack/sheet/mineral/gold = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/papersack
name = "Paper Sack"
result = /obj/item/storage/box/papersack
time = 10
reqs = list(/obj/item/paper = 5)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/smallcarton
name = "Small Carton"
result = /obj/item/reagent_containers/food/drinks/sillycup/smallcarton
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_driver
@@ -64,6 +164,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_welder
@@ -75,6 +176,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_wirecutters
@@ -86,6 +188,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_crowbar
@@ -97,6 +200,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/bronze_wrench
@@ -108,6 +212,7 @@
/obj/item/stack/tile/bronze = 1,
/datum/reagent/water = 15)
time = 40
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/rcl
@@ -116,6 +221,16 @@
time = 40
tools = list(TOOL_WELDER, TOOL_SCREWDRIVER, TOOL_WRENCH)
reqs = list(/obj/item/stack/sheet/metal = 15)
subcategory = CAT_TOOL
category = CAT_MISC
/datum/crafting_recipe/picket_sign
name = "Picket Sign"
result = /obj/item/picket_sign
reqs = list(/obj/item/stack/rods = 1,
/obj/item/stack/sheet/cardboard = 2)
time = 80
subcategory = CAT_TOOL
category = CAT_MISC
////////////
@@ -128,6 +243,7 @@
reqs = list(/obj/item/stack/sheet/plasteel = 2,
/obj/item/stack/rods = 8)
time = 100
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/skateboard
@@ -136,6 +252,7 @@
time = 60
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/rods = 10)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/scooter
@@ -144,6 +261,7 @@
time = 65
reqs = list(/obj/item/stack/sheet/metal = 5,
/obj/item/stack/rods = 12)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/////////
@@ -154,18 +272,21 @@
name = "Toy Sword"
reqs = list(/obj/item/light/bulb = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
result = /obj/item/toy/sword
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/extendohand
name = "Extendo-Hand"
reqs = list(/obj/item/bodypart/r_arm/robot = 1, /obj/item/clothing/gloves/boxing = 1)
result = /obj/item/extendohand
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/toyneb
name = "Non-Euplastic Blade"
reqs = list(/obj/item/light/tube = 1, /obj/item/stack/cable_coil = 1, /obj/item/stack/sheet/plastic = 4)
result = /obj/item/toy/sword/cx
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
////////////
@@ -176,6 +297,7 @@
name = "Black Carpet"
reqs = list(/obj/item/stack/tile/carpet = 50, /obj/item/toy/crayon/black = 1)
result = /obj/item/stack/tile/carpet/black/fifty
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/paperframes
@@ -183,6 +305,7 @@
result = /obj/item/stack/sheet/paperframes/five
time = 10
reqs = list(/obj/item/stack/sheet/mineral/wood = 5, /obj/item/paper = 20)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/naturalpaper
@@ -191,6 +314,7 @@
reqs = list(/datum/reagent/water = 50, /obj/item/stack/sheet/mineral/wood = 1)
tools = list(/obj/item/hatchet)
result = /obj/item/paper_bin/bundlenatural
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/bluespacehonker
@@ -200,6 +324,7 @@
reqs = list(/obj/item/stack/ore/bluespace_crystal = 1,
/obj/item/toy/crayon/blue = 1,
/obj/item/bikehorn = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/mousetrap
@@ -208,13 +333,7 @@
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1,
/obj/item/stack/rods = 1)
category = CAT_MISC
/datum/crafting_recipe/papersack
name = "Paper Sack"
result = /obj/item/storage/box/papersack
time = 10
reqs = list(/obj/item/paper = 5)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/flashlight_eyes
@@ -225,13 +344,7 @@
/obj/item/flashlight = 2,
/obj/item/restraints/handcuffs/cable = 1
)
category = CAT_MISC
/datum/crafting_recipe/smallcarton
name = "Small Carton"
result = /obj/item/reagent_containers/food/drinks/sillycup/smallcarton
time = 10
reqs = list(/obj/item/stack/sheet/cardboard = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/pressureplate
@@ -242,6 +355,7 @@
/obj/item/stack/tile/plasteel = 1,
/obj/item/stack/cable_coil = 2,
/obj/item/assembly/igniter = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/gold_horn
@@ -250,6 +364,7 @@
time = 20
reqs = list(/obj/item/stack/sheet/mineral/bananium = 5,
/obj/item/bikehorn = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/spooky_camera
@@ -259,6 +374,7 @@
reqs = list(/obj/item/camera = 1,
/datum/reagent/water/holywater = 10)
parts = list(/obj/item/camera = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/paperwork
@@ -267,6 +383,16 @@
time = 10 //Takes time for people to file and complete paper work!
tools = list(/obj/item/pen)
reqs = list(/obj/item/folder/paperwork = 1)
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
/datum/crafting_recipe/coconut_bong
name = "Coconut Bong"
result = /obj/item/bong/coconut
reqs = list(/obj/item/stack/sheet/mineral/bamboo = 2,
/obj/item/reagent_containers/food/snacks/grown/coconut = 1)
time = 70
subcategory = CAT_MISCELLANEOUS
category = CAT_MISC
//////////////
@@ -279,6 +405,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/captain/parade = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/engineering_banner
@@ -287,6 +414,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/engineering/engineer = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/cargo_banner
@@ -295,6 +423,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/cargo/tech = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/science_banner
@@ -303,6 +432,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/rnd/scientist = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/medical_banner
@@ -311,6 +441,7 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/medical/doctor = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/security_banner
@@ -319,50 +450,5 @@
time = 40
reqs = list(/obj/item/stack/rods = 2,
/obj/item/clothing/under/rank/security/officer = 1)
subcategory = CAT_FURNITURE
category = CAT_MISC
/datum/crafting_recipe/bloodsucker/vassalrack
name = "Persuasion Rack"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/vassalrack
tools = list(/obj/item/weldingtool,
///obj/item/screwdriver,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/mineral/wood = 3,
/obj/item/stack/sheet/metal = 2,
/obj/item/restraints/handcuffs/cable = 2,
///obj/item/storage/belt = 1
///obj/item/stack/sheet/animalhide = 1, // /obj/item/stack/sheet/leather = 1,
///obj/item/stack/sheet/plasteel = 5
)
//parts = list(/obj/item/storage/belt = 1
// )
time = 150
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/bloodsucker/candelabrum
name = "Candelabrum"
//desc = "For converting crewmembers into loyal Vassals."
result = /obj/structure/bloodsucker/candelabrum
tools = list(/obj/item/weldingtool,
/obj/item/wrench
)
reqs = list(/obj/item/stack/sheet/metal = 3,
/obj/item/stack/rods = 1,
/obj/item/candle = 1
)
time = 100
category = CAT_MISC
always_availible = FALSE // Disabled til learned
/datum/crafting_recipe/coconut_bong
name = "Coconut Bong"
result = /obj/item/bong/coconut
reqs = list(/obj/item/stack/sheet/mineral/bamboo = 2,
/obj/item/reagent_containers/food/snacks/grown/coconut = 1)
time = 70
category = CAT_MISC
+1 -1
View File
@@ -3,7 +3,7 @@
var/list/say_lines
/datum/component/edit_complainer/Initialize(list/text)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
var/static/list/default_lines = list(
+1 -1
View File
@@ -13,7 +13,7 @@
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/explodable_attack)
RegisterSignal(parent, COMSIG_TRY_STORAGE_INSERT, .proc/explodable_insert_item)
RegisterSignal(parent, COMSIG_ATOM_EX_ACT, .proc/detonate)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT, .proc/explodable_impact)
RegisterSignal(parent, COMSIG_MOVABLE_BUMP, .proc/explodable_bump)
if(isitem(parent))
+1 -1
View File
@@ -54,7 +54,7 @@
/datum/fantasy_affix/pyromantic/apply(datum/component/fantasy/comp, newName)
var/obj/item/master = comp.parent
comp.appliedComponents += master.AddComponent(/datum/component/igniter, CLAMP(comp.quality, 1, 10))
comp.appliedComponents += master.AddComponent(/datum/component/igniter, clamp(comp.quality, 1, 10))
return "pyromantic [newName]"
/datum/fantasy_affix/vampiric
+1 -1
View File
@@ -13,7 +13,7 @@
expire_time = world.time + expire_in
QDEL_IN(src, expire_in)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, .proc/clean)
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/try_infect_buckle)
+1 -1
View File
@@ -34,7 +34,7 @@
do_knockback(target, null, angle2dir(Angle))
/datum/component/knockback/proc/do_knockback(atom/target, mob/thrower, throw_dir)
if(!ismovableatom(target) || throw_dir == null)
if(!ismovable(target) || throw_dir == null)
return
var/atom/movable/throwee = target
if(throwee.anchored && !throw_anchored)
+1 -1
View File
@@ -2,7 +2,7 @@
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/examine)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, COMSIG_MOVABLE_CROSSED, .proc/crossed_react)
RegisterSignal(parent, COMSIG_MOVABLE_UNCROSSED, .proc/uncrossed_react)
for(var/i in get_turf(parent))
+2 -2
View File
@@ -14,8 +14,8 @@
var/x = target.x
var/y = target.y
var/z = target.z
var/turf/southwest = locate(CLAMP(x - (direction & WEST ? range : 0), 1, world.maxx), CLAMP(y - (direction & SOUTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/northeast = locate(CLAMP(x + (direction & EAST ? range : 0), 1, world.maxx), CLAMP(y + (direction & NORTH ? range : 0), 1, world.maxy), CLAMP(z, 1, world.maxz))
var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), clamp(z, 1, world.maxz))
//holder.vis_contents += block(southwest, northeast) // This doesnt work because of beta bug memes
for(var/i in block(southwest, northeast))
holder.vis_contents += i
+5 -5
View File
@@ -175,7 +175,7 @@
return (nanite_volume > 0)
/datum/component/nanites/proc/adjust_nanites(datum/source, amount)
nanite_volume = CLAMP(nanite_volume + amount, 0, max_nanites)
nanite_volume = clamp(nanite_volume + amount, 0, max_nanites)
if(nanite_volume <= 0) //oops we ran out
qdel(src)
@@ -187,7 +187,7 @@
if(remove || stealth)
return //bye icon
var/nanite_percent = (nanite_volume / max_nanites) * 100
nanite_percent = CLAMP(CEILING(nanite_percent, 10), 10, 100)
nanite_percent = clamp(CEILING(nanite_percent, 10), 10, 100)
holder.icon_state = "nanites[nanite_percent]"
/datum/component/nanites/proc/on_emp(datum/source, severity)
@@ -249,13 +249,13 @@
return FALSE
/datum/component/nanites/proc/set_volume(datum/source, amount)
nanite_volume = CLAMP(amount, 0, max_nanites)
nanite_volume = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_max_volume(datum/source, amount)
max_nanites = max(1, max_nanites)
/datum/component/nanites/proc/set_cloud(datum/source, amount)
cloud_id = CLAMP(amount, 0, 100)
cloud_id = clamp(amount, 0, 100)
/datum/component/nanites/proc/set_cloud_sync(datum/source, method)
switch(method)
@@ -267,7 +267,7 @@
cloud_active = TRUE
/datum/component/nanites/proc/set_safety(datum/source, amount)
safety_threshold = CLAMP(amount, 0, max_nanites)
safety_threshold = clamp(amount, 0, max_nanites)
/datum/component/nanites/proc/set_regen(datum/source, amount)
regen_rate = amount
+4 -4
View File
@@ -22,14 +22,14 @@
/datum/component/orbiter/RegisterWithParent()
. = ..()
var/atom/target = parent
while(ismovableatom(target))
while(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/move_react)
target = target.loc
/datum/component/orbiter/UnregisterFromParent()
. = ..()
var/atom/target = parent
while(ismovableatom(target))
while(ismovable(target))
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
target = target.loc
@@ -111,12 +111,12 @@
// These are prety rarely activated, how often are you following something in a bag?
if(oldloc && !isturf(oldloc)) // We used to be registered to it, probably
var/atom/target = oldloc
while(ismovableatom(target))
while(ismovable(target))
UnregisterSignal(target, COMSIG_MOVABLE_MOVED)
target = target.loc
if(orbited?.loc && orbited.loc != newturf) // We want to know when anything holding us moves too
var/atom/target = orbited.loc
while(ismovableatom(target))
while(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/move_react, TRUE)
target = target.loc
+1 -1
View File
@@ -21,7 +21,7 @@
var/list/offhands = list() // keyed list containing all the current riding offsets associated by mob
/datum/component/riding/Initialize()
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_MOVABLE_BUCKLE, .proc/vehicle_mob_buckle)
RegisterSignal(parent, COMSIG_MOVABLE_UNBUCKLE, .proc/vehicle_mob_unbuckle)
+1 -1
View File
@@ -14,7 +14,7 @@
var/default_rotation_direction = ROTATION_CLOCKWISE
/datum/component/simple_rotation/Initialize(rotation_flags = NONE ,can_user_rotate,can_be_rotated,after_rotation)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
//throw if no rotation direction is specificed ?
+191
View File
@@ -0,0 +1,191 @@
/datum/component/shielded
dupe_mode = COMPONENT_DUPE_ALLOWED
can_transfer = TRUE
var/charges = 3
var/max_charges = 3
var/recharge_delay = 20 SECONDS //How long after we've been attacked before we can start recharging.
var/recharge_rate = 1 //How quickly the shield recharges once it starts charging. Can be a decimal. set to zero to disable.
var/last_time_used //Last time the shield attempted to stop an attack.
var/accepted_slots
var/shield_state = "shield-old" //the state of the shield overlay.
var/broken_state //null by default.
var/recharge_sound = 'sound/magic/charge.ogg'
var/recharge_end_sound = 'sound/machines/ding.ogg'
var/mob/living/holder //who is currently benefiting from the shield.
var/dissipating = FALSE //Is this shield meant to dissipate over time instead of recharging.
var/del_on_overload = FALSE //will delete itself once it has no charges left.
/datum/component/shielded/Initialize(current, max = 3, delay = 20 SECONDS, rate = 1, slots, state = "shield-old", broken, \
sound = 'sound/magic/charge.ogg', end_sound = 'sound/machines/ding.ogg', diss = FALSE, del_overload = FALSE)
var/isitem = isitem(parent)
if(!isitem && !isliving(parent))
return COMPONENT_INCOMPATIBLE
max_charges = max
charges = !isnull(current) ? current : max_charges
recharge_delay = delay
recharge_rate = rate
accepted_slots = slots
shield_state = state
broken_state = broken
recharge_sound = sound
recharge_end_sound = end_sound
dissipating = diss
del_on_overload = del_overload
if(dissipating && recharge_rate > 0)
recharge_rate = -recharge_rate
if(recharge_delay && recharge_rate && (charges < max_charges || dissipating))
START_PROCESSING(SSdcs, src)
/datum/component/shielded/RegisterWithParent()
. = ..()
if(isitem(parent))
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/on_drop)
else //it's a mob
var/mob/living/L = parent
RegisterSignal(L, COMSIG_LIVING_RUN_BLOCK, .proc/living_block)
holder = L
var/to_add = charges >= 1 ? shield_state : broken_state
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (L.layer > MOB_LAYER ? L.layer : MOB_LAYER) + 0.01
holder.add_overlay(M, TRUE)
/datum/component/shielded/UnregisterFromParent()
. = ..()
if(parent != holder) //not a mob, thus an item.
UnregisterSignal(parent, list(COMSIG_ITEM_RUN_BLOCK,COMSIG_ITEM_CHECK_BLOCK,COMSIG_ITEM_EQUIPPED,COMSIG_ITEM_DROPPED))
if(holder)
UnregisterSignal(holder, list(COMSIG_LIVING_RUN_BLOCK, COMSIG_LIVING_GET_BLOCKING_ITEMS))
var/to_remove = charges >= 1 ? shield_state : broken_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
holder = null
/datum/component/shielded/process()
if(world.time < last_time_used && !dissipating)
return
var/old_charges = charges
charges = clamp(charges + recharge_rate, 0, max_charges)
if(round(old_charges) >= round(charges)) //only send outputs if it effectively gained at least one charge
return
var/sound = recharge_sound
if(dissipating ? !charges : charges == max_charges )
STOP_PROCESSING(SSdcs, src)
sound = recharge_end_sound
if(parent && sound)
playsound(parent, sound, 50, 1)
if(charges < 1 && del_on_overload)
if(holder)
holder.visible_message("[holder]'s shield overloads!")
qdel(src)
return
if(holder && (old_charges < 1 && charges >= 1) || (!del_on_overload && old_charges >= 1 && charges < 1))
update_shield_overlay(charges < 1)
/datum/component/shielded/proc/adjust_charges(amount)
var/old_charges = charges
charges = clamp(charges + amount, 0, max_charges)
if(recharge_delay && recharge_rate && (dissipating ? !charges : charges == max_charges))
STOP_PROCESSING(SSdcs, src)
if(charges < 1 && del_on_overload)
if(holder)
holder.visible_message("[holder]'s shield overloads!")
qdel(src)
return
if(holder && (old_charges < 1 && charges >= 1) || (!del_on_overload && old_charges >= 1 && charges < 1))
update_shield_overlay(charges < 1)
/datum/component/shielded/proc/update_shield_overlay(broken)
if(!holder)
return
var/to_remove = broken ? shield_state : broken_state
var/to_add = broken ? broken_state : shield_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (holder.layer > MOB_LAYER ? holder.layer : MOB_LAYER) + 0.01
holder.add_overlay(M, TRUE)
/datum/component/shielded/proc/on_equip(obj/item/source, mob/living/equipper, slot)
if(!(accepted_slots & slotdefine2slotbit(slot)))
return
holder = equipper
RegisterSignal(parent, COMSIG_ITEM_RUN_BLOCK, .proc/on_run_block)
RegisterSignal(parent, COMSIG_ITEM_CHECK_BLOCK, .proc/on_check_block)
RegisterSignal(equipper, COMSIG_LIVING_GET_BLOCKING_ITEMS, .proc/include_shield)
var/to_add = charges >= 1 ? shield_state : broken_state
if(to_add)
var/mutable_appearance/M = mutable_appearance('icons/effects/effects.dmi', to_add)
M.layer = (holder.layer > MOB_LAYER ? holder.layer : MOB_LAYER) + 0.01
equipper.add_overlay(M, TRUE)
/datum/component/shielded/proc/on_drop(obj/item/source, mob/dropper)
if(holder == dropper)
UnregisterSignal(holder, COMSIG_LIVING_GET_BLOCKING_ITEMS)
UnregisterSignal(parent, list(COMSIG_ITEM_RUN_BLOCK, COMSIG_ITEM_CHECK_BLOCK))
var/to_remove = charges >= 1 ? shield_state : broken_state
if(to_remove)
holder.cut_overlay(mutable_appearance('icons/effects/effects.dmi', to_remove), TRUE)
holder = null
/datum/component/shielded/proc/include_shield(mob/source, list/items)
items += parent
/datum/component/shielded/proc/on_run_block(obj/item/source, mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] >= 100) //already blocked by another shielded item, don't do anything.
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += round(charges)
return BLOCK_NONE
last_time_used = world.time + recharge_delay
if(charges < 1)
return BLOCK_NONE
var/datum/effect_system/spark_spread/s = new
s.set_up(2, 1, source)
s.start()
owner.visible_message("<span class='danger'>[holder]'s shields deflect [attack_text] in a shower of sparks!</span>")
charges--
var/rounded_charges = round(charges)
if(recharge_delay && recharge_rate && !dissipating)
START_PROCESSING(SSdcs, src)
if(charges < 1)
owner.visible_message("[holder]'s shield overloads!")
if(del_on_overload)
qdel(src)
else
update_shield_overlay(TRUE)
block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += rounded_charges
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL
/datum/component/shielded/proc/on_check_block(obj/item/source, mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
if(charges >= 1)
block_return[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
block_return[BLOCK_RETURN_BLOCK_CAPACITY] += round(charges)
/datum/component/shielded/proc/living_block(mob/living/source, real_attack, object, damage, attack_text, attack_type, armour_penetration, attacker, def_zone, return_list)
if(!real_attack)
if(charges >= 1)
return_list[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
return_list[BLOCK_RETURN_BLOCK_CAPACITY] = round(charges)
return
last_time_used = world.time + recharge_delay
if(charges < 1)
return BLOCK_NONE
var/datum/effect_system/spark_spread/s = new
s.set_up(2, 1, source)
s.start()
source.visible_message("<span class='danger'>[source]'s shields deflect [attack_text] in a shower of sparks!</span>")
charges--
var/rounded_charges = round(charges)
if(recharge_delay && recharge_rate && !dissipating)
START_PROCESSING(SSdcs, src)
if(charges < 1)
source.visible_message("[source]'s shield overloads!")
if(del_on_overload)
qdel(src)
else
update_shield_overlay(TRUE)
return_list[BLOCK_RETURN_NORMAL_BLOCK_CHANCE] = 100
return_list[BLOCK_RETURN_BLOCK_CAPACITY] += rounded_charges
return BLOCK_SUCCESS | BLOCK_PHYSICAL_EXTERNAL
+1 -1
View File
@@ -16,7 +16,7 @@
if(!isatom(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_BLOB_ACT, COMSIG_ATOM_HULK_ATTACK, COMSIG_PARENT_ATTACKBY), .proc/play_squeak)
if(ismovableatom(parent))
if(ismovable(parent))
RegisterSignal(parent, list(COMSIG_MOVABLE_BUMP, COMSIG_MOVABLE_IMPACT), .proc/play_squeak)
RegisterSignal(parent, list(COMSIG_MOVABLE_CROSSED, COMSIG_ITEM_WEARERCROSSED), .proc/play_squeak_crossed)
RegisterSignal(parent, COMSIG_MOVABLE_DISPOSING, .proc/disposing_react)
+1 -1
View File
@@ -5,7 +5,7 @@
var/allow_death = FALSE
/datum/component/stationloving/Initialize(inform_admins = FALSE, allow_death = FALSE)
if(!ismovableatom(parent))
if(!ismovable(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, list(COMSIG_MOVABLE_Z_CHANGED), .proc/check_in_bounds)
RegisterSignal(parent, list(COMSIG_MOVABLE_SECLUDED_LOCATION), .proc/relocate)
@@ -56,7 +56,8 @@
/obj/item/scalpel, /obj/item/reagent_containers/syringe, /obj/item/dnainjector,
/obj/item/reagent_containers/hypospray/medipen, /obj/item/reagent_containers/dropper,
/obj/item/implanter, /obj/item/screwdriver, /obj/item/weldingtool/mini,
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/automatic/magrifle/pistol
/obj/item/firing_pin, /obj/item/gun/ballistic/automatic/pistol, /obj/item/gun/ballistic/automatic/magrifle/pistol,
/obj/item/toy/plush/snakeplushie
))
/datum/component/storage/concrete/pockets/shoes/clown/Initialize()
+4 -4
View File
@@ -27,8 +27,8 @@
numbered_contents = _process_numerical_display()
adjusted_contents = numbered_contents.len
var/columns = CLAMP(max_items, 1, maxcolumns ? maxcolumns : screen_max_columns)
var/rows = CLAMP(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
var/columns = clamp(max_items, 1, maxcolumns ? maxcolumns : screen_max_columns)
var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
// First, boxes.
ui_boxes = get_ui_boxes()
@@ -105,7 +105,7 @@
// after this point we are sure we can somehow fit all items into our max number of rows.
// determine rows
var/rows = CLAMP(CEILING(min_pixels / horizontal_pixels, 1), 1, screen_max_rows)
var/rows = clamp(CEILING(min_pixels / horizontal_pixels, 1), 1, screen_max_rows)
var/overrun = FALSE
if(used > our_volume)
@@ -198,7 +198,7 @@
M.active_storage.ui_hide(M)
M.active_storage = src
LAZYOR(is_using, M)
if(volumetric_ui())
if(!M.client?.prefs?.no_tetris_storage && volumetric_ui())
//new volumetric ui bay-style
M.client.screen |= orient2hud_volumetric(M, maxallowedscreensize)
else
+491
View File
@@ -0,0 +1,491 @@
#define MAX_TABLE_MESSES 8 // how many things can we knock off a table at once?
/**
*#tackle.dm
*
* For when you want to throw a person at something and have fun stuff happen
*
* This component is made for carbon mobs (really, humans), and allows its parent to throw themselves and perform tackles. This is done by enabling throw mode, then clicking on your
* intended target with an empty hand. You will then launch toward your target. If you hit a carbon, you'll roll to see how hard you hit them. If you hit a solid non-mob, you'll
* roll to see how badly you just messed yourself up. If, along your journey, you hit a table, you'll slam onto it and send up to MAX_TABLE_MESSES (8) /obj/items on the table flying,
* and take a bit of extra damage and stun for each thing launched.
*
* There are 2 """skill rolls""" involved here, which are handled and explained in sack() and rollTackle() (for roll 1, carbons), and splat() (for roll 2, walls and solid objects)
*/
/datum/component/tackler
dupe_mode = COMPONENT_DUPE_UNIQUE
///How much stamina it takes to launch a tackle
var/stamina_cost
///Launching a tackle calls Knockdown on you for this long, so this is your cooldown. Once you stand back up, you can tackle again.
var/base_knockdown
///Your max range for how far you can tackle.
var/range
///How fast you sail through the air. Standard tackles are 1 speed, but gloves that throw you faster come at a cost: higher speeds make it more likely you'll be badly injured if you fly into a non-mob obstacle.
var/speed
///A flat modifier to your roll against your target, as described in [rollTackle()][/datum/component/tackler/proc/rollTackle]. Slightly misleading, skills aren't relevant here, this is a matter of what type of gloves (or whatever) is granting you the ability to tackle.
var/skill_mod
///Some gloves, generally ones that increase mobility, may have a minimum distance to fly. Rocket gloves are especially dangerous with this, be sure you'll hit your target or have a clear background if you miss, or else!
var/min_distance
///The throwdatum we're currently dealing with, if we need it
var/datum/thrownthing/tackle
/datum/component/tackler/Initialize(stamina_cost = 25, base_knockdown = 1 SECONDS, range = 4, speed = 1, skill_mod = 0, min_distance = min_distance)
if(!iscarbon(parent))
return COMPONENT_INCOMPATIBLE
src.stamina_cost = stamina_cost
src.base_knockdown = base_knockdown
src.range = range
src.speed = speed
src.skill_mod = skill_mod
src.min_distance = min_distance
var/mob/living/carbon/P = parent
to_chat(P, "<span class='notice'>You are now able to launch tackles! You can do so by activating throw intent, and clicking on your target with an empty hand.</span>")
P.tackling = TRUE
addtimer(CALLBACK(src, .proc/resetTackle), base_knockdown, TIMER_STOPPABLE)
/datum/component/tackler/Destroy()
var/mob/living/carbon/P = parent
to_chat(P, "<span class='notice'>You can no longer tackle.</span>")
P.tackling = FALSE
..()
/datum/component/tackler/RegisterWithParent()
RegisterSignal(parent, COMSIG_MOB_CLICKON, .proc/checkTackle)
RegisterSignal(parent, COMSIG_MOVABLE_IMPACT, .proc/sack)
RegisterSignal(parent, COMSIG_MOVABLE_POST_THROW, .proc/registerTackle)
/datum/component/tackler/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_MOB_CLICKON, COMSIG_MOVABLE_IMPACT, COMSIG_MOVABLE_MOVED, COMSIG_MOVABLE_POST_THROW))
///Store the thrownthing datum for later use
/datum/component/tackler/proc/registerTackle(mob/living/carbon/user, datum/thrownthing/TT)
tackle = TT
///See if we can tackle or not. If we can, leap!
/datum/component/tackler/proc/checkTackle(mob/living/carbon/user, atom/A, params)
if(!user.in_throw_mode || user.get_active_held_item() || user.pulling || user.buckling)
return
if(HAS_TRAIT(user, TRAIT_HULK))
to_chat(user, "<span class='warning'>You're too angry to remember how to tackle!</span>")
return
if(user.restrained())
to_chat(user, "<span class='warning'>You need free use of your hands to tackle!</span>")
return
if(!(user.mobility_flags & MOBILITY_STAND))
to_chat(user, "<span class='warning'>You must be standing to tackle!</span>")
return
if(user.tackling)
to_chat(user, "<span class='warning'>You're not ready to tackle!</span>")
return
if(user.has_status_effect(STATUS_EFFECT_TASED)) // can't tackle if you just got tased
to_chat(user, "<span class='warning'>You can't tackle while tased!</span>")
return
user.face_atom(A)
var/list/modifiers = params2list(params)
if(modifiers["alt"] || modifiers["shift"] || modifiers["ctrl"] || modifiers["middle"])
return
user.tackling = TRUE
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/checkObstacle)
playsound(user, 'sound/weapons/thudswoosh.ogg', 40, TRUE, -1)
var/leap_word = iscatperson(user) ? "pounce" : "leap" ///If cat, "pounce" instead of "leap".
if(can_see(user, A, 7))
user.visible_message("<span class='warning'>[user] [leap_word]s at [A]!</span>", "<span class='danger'>You [leap_word] at [A]!</span>")
else
user.visible_message("<span class='warning'>[user] [leap_word]s!</span>", "<span class='danger'>You [leap_word]!</span>")
if(get_dist(user, A) < min_distance)
A = get_ranged_target_turf(user, get_dir(user, A), min_distance) //TODO: this only works in cardinals/diagonals, make it work with in-betweens too!
user.Knockdown(base_knockdown, TRUE, TRUE)
user.adjustStaminaLoss(stamina_cost)
user.throw_at(A, range, speed, user, FALSE)
user.toggle_throw_mode()
addtimer(CALLBACK(src, .proc/resetTackle), base_knockdown, TIMER_STOPPABLE)
return(COMSIG_MOB_CANCEL_CLICKON)
/**
* sack()
*
* sack() is called when you actually smack into something, assuming we're mid-tackle. First it deals with smacking into non-carbons, in two cases:
* * If it's a non-carbon mob, we don't care, get out of here and do normal thrown-into-mob stuff
* * Else, if it's something dense (walls, machinery, structures, most things other than the floor), go to splat() and get ready for some high grade shit
*
* If it's a carbon we hit, we'll call rollTackle() which rolls a die and calculates modifiers for both the tackler and target, then gives us a number. Negatives favor the target, while positives favor the tackler.
* Check [rollTackle()][/datum/component/tackler/proc/rollTackle] for a more thorough explanation on the modifiers at play.
*
* Then, we figure out what effect we want, and we get to work! Note that with standard gripper gloves and no modifiers, the range of rolls is (-3, 3). The results are as follows, based on what we rolled:
* * -inf to -5: Seriously botched tackle, tackler suffers a concussion, brute damage, and a 3 second paralyze, target suffers nothing
* * -4 to -2: weak tackle, tackler gets 3 second knockdown, target gets shove slowdown but is otherwise fine
* * -1 to 0: decent tackle, tackler gets up a bit quicker than the target
* * 1: solid tackle, tackler has more of an advantage getting up quicker
* * 2 to 4: expert tackle, tackler has sizeable advantage and lands on their feet with a free passive grab
* * 5 to inf: MONSTER tackle, tackler gets up immediately and gets a free aggressive grab, target takes sizeable stamina damage from the hit and is paralyzed for one and a half seconds and knocked down for three seconds
*
* Finally, we return a bitflag to [COMSIG_MOVABLE_IMPACT] that forces the hitpush to false so that we don't knock them away.
*/
/datum/component/tackler/proc/sack(mob/living/carbon/user, atom/hit)
if(!user.tackling || !tackle)
return
if(!iscarbon(hit))
if(hit.density)
return splat(user, hit)
return
var/mob/living/carbon/target = hit
var/tackle_word = iscatperson(user) ? "pounce" : "tackle" ///If cat, "pounce" instead of "tackle".
var/roll = rollTackle(target)
user.tackling = FALSE
switch(roll)
if(-INFINITY to -5)
user.visible_message("<span class='danger'>[user] botches [user.p_their()] [tackle_word] and slams [user.p_their()] head into [target], knocking [user.p_them()]self silly!</span>", "<span class='userdanger'>You botch your [tackle_word] and slam your head into [target], knocking yourself silly!</span>", target)
to_chat(target, "<span class='userdanger'>[user] botches [user.p_their()] [tackle_word] and slams [user.p_their()] head into you, knocking [user.p_them()]self silly!</span>")
user.Paralyze(30)
var/obj/item/bodypart/head/hed = user.get_bodypart(BODY_ZONE_HEAD)
if(hed)
hed.receive_damage(brute=20, updating_health=TRUE)
user.gain_trauma(/datum/brain_trauma/mild/concussion)
if(-4 to -2) // glancing blow at best
user.visible_message("<span class='warning'>[user] lands a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!</span>", "<span class='userdanger'>You land a weak [tackle_word] on [target], briefly knocking [target.p_them()] off-balance!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a weak [tackle_word] on you, briefly knocking you off-balance!</span>")
user.Knockdown(30)
target.apply_status_effect(STATUS_EFFECT_TASED_WEAK, 6 SECONDS)
if(-1 to 0) // decent hit, both parties are about equally inconvenienced
user.visible_message("<span class='warning'>[user] lands a passable [tackle_word] on [target], sending them both tumbling!</span>", "<span class='userdanger'>You land a passable [tackle_word] on [target], sending you both tumbling!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a passable [tackle_word] on you, sending you both tumbling!</span>")
target.adjustStaminaLoss(stamina_cost)
target.Paralyze(5)
user.Knockdown(20)
target.Knockdown(25)
if(1 to 2) // solid hit, tackler has a slight advantage
user.visible_message("<span class='warning'>[user] lands a solid [tackle_word] on [target], knocking them both down hard!</span>", "<span class='userdanger'>You land a solid [tackle_word] on [target], knocking you both down hard!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a solid [tackle_word] on you, knocking you both down hard!</span>")
target.adjustStaminaLoss(30)
target.Paralyze(5)
user.Knockdown(10)
target.Knockdown(20)
if(3 to 4) // really good hit, the target is definitely worse off here. Without positive modifiers, this is as good a tackle as you can land
user.visible_message("<span class='warning'>[user] lands an expert [tackle_word] on [target], knocking [target.p_them()] down hard while landing on [user.p_their()] feet with a passive grip!</span>", "<span class='userdanger'>You land an expert [tackle_word] on [target], knocking [target.p_them()] down hard while landing on your feet with a passive grip!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands an expert [tackle_word] on you, knocking you down hard and maintaining a passive grab!</span>")
user.SetKnockdown(0)
user.set_resting(FALSE, TRUE, FALSE)
user.forceMove(get_turf(target))
target.adjustStaminaLoss(40)
target.Paralyze(5)
target.Knockdown(30)
if(ishuman(target) && iscarbon(user))
target.grabbedby(user)
if(5 to INFINITY) // absolutely BODIED
user.visible_message("<span class='warning'>[user] lands a monster [tackle_word] on [target], knocking [target.p_them()] senseless and applying an aggressive pin!</span>", "<span class='userdanger'>You land a monster [tackle_word] on [target], knocking [target.p_them()] senseless and applying an aggressive pin!</span>", target)
to_chat(target, "<span class='userdanger'>[user] lands a monster [tackle_word] on you, knocking you senseless and aggressively pinning you!</span>")
user.SetKnockdown(0)
user.set_resting(FALSE, TRUE, FALSE)
user.forceMove(get_turf(target))
target.adjustStaminaLoss(40)
target.Paralyze(5)
target.Knockdown(30)
if(ishuman(target) && iscarbon(user))
target.grabbedby(user)
target.grippedby(user, instant = TRUE)
SEND_SIGNAL(user, COMSIG_CARBON_TACKLED, roll)
return COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH
/**
* rollTackle()
*
* This handles all of the modifiers for the actual carbon-on-carbon tackling, and gets its own proc because of how many there are (with plenty more in mind!)
*
* The base roll is between (-3, 3), with negative numbers favoring the target, and positive numbers favoring the tackler. The target and the tackler are both assessed for
* how easy they are to knock over, with clumsiness and dwarfiness being strong maluses for each, and gigantism giving a bonus for each. These numbers and ideas
* are absolutely subject to change.
* In addition, after subtracting the defender's mod and adding the attacker's mod to the roll, the component's base (skill) mod is added as well. Some sources of tackles
* are better at taking people down, like the bruiser and rocket gloves, while the dolphin gloves have a malus in exchange for better mobility.
*/
/datum/component/tackler/proc/rollTackle(mob/living/carbon/target)
var/defense_mod = 0
var/attack_mod = 0
// DE-FENSE
if(target.drunkenness > 60) // drunks are easier to knock off balance
defense_mod -= 3
else if(target.drunkenness > 30)
defense_mod -= 1
if(HAS_TRAIT(target, TRAIT_CLUMSY))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_FAT)) // chonkers are harder to knock over
defense_mod += 1
//if(HAS_TRAIT(target, TRAIT_GRABWEAKNESS)) Todo, port the pushover trait
//defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_DWARF))
defense_mod -= 2
if(HAS_TRAIT(target, TRAIT_GIANT))
defense_mod += 2
if(ishuman(target))
var/mob/living/carbon/human/T = target
var/suit_slot = T.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(isnull(T.wear_suit) && isnull(T.w_uniform)) // who honestly puts all of their effort into tackling a naked guy?
defense_mod += 2
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/space/hardsuit)))
defense_mod += 1
if(T.is_shove_knockdown_blocked()) // riot armor and such
defense_mod += 5
if(T.is_holding_item_of_type(/obj/item/shield))
defense_mod += 2
if(islizard(T))
if(!T.getorganslot(ORGAN_SLOT_TAIL)) // lizards without tails are off-balance
defense_mod -= 1
else if(T.dna.species.is_wagging_tail()) // lizard tail wagging is robust and can swat away assailants!
defense_mod += 1
// OF-FENSE
var/mob/living/carbon/sacker = parent
if(sacker.drunkenness > 60) // you're far too drunk to hold back!
attack_mod += 1
else if(sacker.drunkenness > 30) // if you're only a bit drunk though, you're just sloppy
attack_mod -= 1
if(HAS_TRAIT(sacker, TRAIT_CLUMSY))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_DWARF))
attack_mod -= 2
if(HAS_TRAIT(sacker, TRAIT_GIANT))
attack_mod += 2
if(ishuman(target))
var/mob/living/carbon/human/S = sacker
var/suit_slot = S.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/armor/riot))) // tackling in riot armor is more effective, but tiring
attack_mod += 2
sacker.adjustStaminaLoss(20)
var/r = rand(-3, 3) - defense_mod + attack_mod + skill_mod
return r
/**
* splat()
*
* This is where we handle diving into dense atoms, generally with effects ranging from bad to REALLY bad. This works as a percentile roll that is modified in two steps as detailed below. The higher
* the roll, the more severe the result.
*
* Mod 1: Speed
* * Base tackle speed is 1, which is what normal gripper gloves use. For other sources with higher speed tackles, like dolphin and ESPECIALLY rocket gloves, we obey Newton's laws and hit things harder.
* * For every unit of speed above 1, move the lower bound of the roll up by 15. Unlike Mod 2, this only serves to raise the lower bound, so it can't be directly counteracted by anything you can control.
*
* Mod 2: Misc
* -Flat modifiers, these take whatever you rolled and add/subtract to it, with the end result capped between the minimum from Mod 1 and 100. Note that since we can't roll higher than 100 to start with,
* wearing a helmet should be enough to remove any chance of permanently paralyzing yourself and dramatically lessen knocking yourself unconscious, even with rocket gloves. Will expand on maybe
* * Wearing a helmet: -6
* * Wearing armor: -6
* * Clumsy: +6
*
* Effects: Below are the outcomes based off your roll, in order of increasing severity
* * 1-63: Knocked down for a few seconds and a bit of brute and stamina damage
* * 64-83: Knocked silly, gain some confusion as well as the above
* * 84-93: Cranial trauma, get a concussion and more confusion, plus more damage
* * 94-98: Knocked unconscious, significant chance to get a random mild brain trauma, as well as a fair amount of damage
* * 99-100: Break your spinal cord, get paralyzed, take a bunch of damage too. Very unlucky!
*/
/datum/component/tackler/proc/splat(mob/living/carbon/user, atom/hit)
if(istype(hit, /obj/structure/window))
var/obj/structure/window/W = hit
splatWindow(user, W)
if(QDELETED(W))
return COMPONENT_MOVABLE_IMPACT_NEVERMIND
return
var/oopsie_mod = 0
var/danger_zone = (speed - 1) * 15 // for every extra speed we have over 1, take away 15 of the safest chance
danger_zone = max(min(danger_zone, 100), 1)
if(ishuman(user))
var/mob/living/carbon/human/S = user
var/head_slot = S.get_item_by_slot(ITEM_SLOT_HEAD)
var/suit_slot = S.get_item_by_slot(ITEM_SLOT_OCLOTHING)
if(head_slot && (istype(head_slot,/obj/item/clothing/head/helmet) || istype(head_slot,/obj/item/clothing/head/hardhat)))
oopsie_mod -= 6
if(suit_slot && (istype(suit_slot,/obj/item/clothing/suit/armor/)))
oopsie_mod -= 6
if(HAS_TRAIT(user, TRAIT_CLUMSY))
oopsie_mod += 6 //honk!
var/oopsie = rand(danger_zone, 100)
if(oopsie >= 94 && oopsie_mod < 0) // good job avoiding getting paralyzed! gold star!
to_chat(user, "<span class='usernotice'>You're really glad you're wearing protection!</span>")
oopsie += oopsie_mod
switch(oopsie)
if(99 to INFINITY)
// can you imagine standing around minding your own business when all of the sudden some guy fucking launches himself into a wall at full speed and irreparably paralyzes himself?
user.visible_message("<span class='danger'>[user] slams face-first into [hit] at an awkward angle, severing [user.p_their()] spinal column with a sickening crack! Holy shit!</span>", "<span class='userdanger'>You slam face-first into [hit] at an awkward angle, severing your spinal column with a sickening crack! Holy shit!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(30)
playsound(user, 'sound/effects/blobattack.ogg', 60, TRUE)
playsound(user, 'sound/effects/splat.ogg', 70, TRUE)
user.emote("scream")
user.gain_trauma(/datum/brain_trauma/severe/paralysis/paraplegic) // oopsie indeed!
shake_camera(user, 7, 7)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 4.5)
if(94 to 98)
user.visible_message("<span class='danger'>[user] slams face-first into [hit] with a concerning squish, immediately going limp!</span>", "<span class='userdanger'>You slam face-first into [hit], and immediately lose consciousness!</span>")
user.adjustStaminaLoss(100)
user.adjustBruteLoss(30)
user.Unconscious(100)
user.gain_trauma_type(BRAIN_TRAUMA_MILD)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
shake_camera(user, 6, 6)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 3.5)
if(84 to 93)
user.visible_message("<span class='danger'>[user] slams head-first into [hit], suffering major cranial trauma!</span>", "<span class='userdanger'>You slam head-first into [hit], and the world explodes around you!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(30)
user.confused += 15
if(prob(80))
user.gain_trauma(/datum/brain_trauma/mild/concussion)
user.playsound_local(get_turf(user), 'sound/weapons/flashbang.ogg', 100, TRUE, 8, 0.9)
user.DefaultCombatKnockdown(40)
shake_camera(user, 5, 5)
user.overlay_fullscreen("flash", /obj/screen/fullscreen/flash)
user.clear_fullscreen("flash", 2.5)
if(64 to 83)
user.visible_message("<span class='danger'>[user] slams hard into [hit], knocking [user.p_them()] senseless!</span>", "<span class='userdanger'>You slam hard into [hit], knocking yourself senseless!</span>")
user.adjustStaminaLoss(30)
user.adjustBruteLoss(10)
user.confused += 10
user.DefaultCombatKnockdown(30)
shake_camera(user, 3, 4)
if(1 to 63)
user.visible_message("<span class='danger'>[user] slams into [hit]!</span>", "<span class='userdanger'>You slam into [hit]!</span>")
user.adjustStaminaLoss(20)
user.adjustBruteLoss(10)
user.DefaultCombatKnockdown(30)
shake_camera(user, 2, 2)
playsound(user, 'sound/weapons/smash.ogg', 70, TRUE)
/datum/component/tackler/proc/resetTackle()
var/mob/living/carbon/P = parent
P.tackling = FALSE
QDEL_NULL(tackle)
UnregisterSignal(parent, COMSIG_MOVABLE_MOVED)
///A special case for splatting for handling windows
/datum/component/tackler/proc/splatWindow(mob/living/carbon/user, obj/structure/window/W)
playsound(user, "sound/effects/Glasshit.ogg", 140, TRUE)
if(W.type in list(/obj/structure/window, /obj/structure/window/fulltile, /obj/structure/window/unanchored, /obj/structure/window/fulltile/unanchored)) // boring unreinforced windows
for(var/i = 0, i < speed, i++)
var/obj/item/shard/shard = new /obj/item/shard(get_turf(user))
//shard.embedding = list(embed_chance = 100, ignore_throwspeed_threshold = TRUE, impact_pain_mult=3, pain_chance=5)
//shard.AddElement(/datum/element/embed, shard.embedding)
user.hitby(shard, skipcatch = TRUE, hitpush = FALSE)
//shard.embedding = list()
//shard.AddElement(/datum/element/embed, shard.embedding)
W.obj_destruction()
user.adjustStaminaLoss(10 * speed)
user.DefaultCombatKnockdown(40)
user.Paralyze(5)
user.visible_message("<span class='danger'>[user] slams into [W] and shatters it, shredding [user.p_them()]self with glass!</span>", "<span class='userdanger'>You slam into [W] and shatter it, shredding yourself with glass!</span>")
else
user.visible_message("<span class='danger'>[user] slams into [W] like a bug, then slowly slides off it!</span>", "<span class='userdanger'>You slam into [W] like a bug, then slowly slide off it!</span>")
user.Paralyze(2)
user.DefaultCombatKnockdown(20)
W.take_damage(20 * speed)
user.adjustStaminaLoss(10 * speed)
user.adjustBruteLoss(5 * speed)
/datum/component/tackler/proc/delayedSmash(obj/structure/window/W)
if(W)
W.obj_destruction()
playsound(W, "shatter", 70, TRUE)
///Check to see if we hit a table, and if so, make a big mess!
/datum/component/tackler/proc/checkObstacle(mob/living/carbon/owner)
if(!owner.tackling)
return
var/turf/T = get_turf(owner)
var/obj/structure/table/kevved = locate(/obj/structure/table) in T.contents
if(!kevved)
return
var/list/messes = list()
// we split the mess-making into two parts (check what we're gonna send flying, intermission for dealing with the tackler, then actually send stuff flying) for the benefit of making sure the face-slam text
// comes before the list of stuff that goes flying, but can still adjust text + damage to how much of a mess it made
for(var/obj/item/I in T.contents)
if(!I.anchored)
messes += I
if(messes.len >= MAX_TABLE_MESSES)
break
/// for telling HOW big of a mess we just made
var/HOW_big_of_a_miss_did_we_just_make = ""
if(messes.len)
if(messes.len < MAX_TABLE_MESSES / 4)
HOW_big_of_a_miss_did_we_just_make = ", making a mess"
else if(messes.len < MAX_TABLE_MESSES / 2)
HOW_big_of_a_miss_did_we_just_make = ", making a big mess"
else if(messes.len < MAX_TABLE_MESSES)
HOW_big_of_a_miss_did_we_just_make = ", making a giant mess"
else
HOW_big_of_a_miss_did_we_just_make = ", making a ginormous mess!" // an extra exclamation point!! for emphasis!!!
owner.visible_message("<span class='danger'>[owner] trips over [kevved] and slams into it face-first[HOW_big_of_a_miss_did_we_just_make]!</span>", "<span class='userdanger'>You trip over [kevved] and slam into it face-first[HOW_big_of_a_miss_did_we_just_make]!</span>")
owner.adjustStaminaLoss(20 + messes.len * 2)
owner.adjustBruteLoss(10 + messes.len)
owner.Paralyze(2 * messes.len)
owner.DefaultCombatKnockdown(20 + 5 * messes.len) // 2 seconds of knockdown after the paralyze
for(var/obj/item/I in messes)
var/dist = rand(1, 3)
var/sp = 2
if(prob(25 * (src.speed - 1))) // if our tackle speed is higher than 1, with chance (speed - 1 * 25%), throw the thing at our tackle speed + 1
sp = speed + 1
I.throw_at(get_ranged_target_turf(I, pick(GLOB.alldirs), range = dist), range = dist, speed = sp)
I.visible_message("<span class='danger'>[I] goes flying[sp > 3 ? " dangerously fast" : ""]!</span>") // standard embed speed
playsound(owner, 'sound/weapons/smash.ogg', 70, TRUE)
tackle.finalize(hit=TRUE)
resetTackle()
#undef MAX_TABLE_MESSES
+1 -1
View File
@@ -181,7 +181,7 @@
/datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum)
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
time = clamp(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
else
time = min(duration_minimum, duration_maximum)
LAZYSET(time_left_list, "[type]", time)
+1 -1
View File
@@ -42,7 +42,7 @@
addtimer(CALLBACK(src, .proc/charge), charge_rate)
/datum/action/innate/dash/proc/charge()
current_charges = CLAMP(current_charges + 1, 0, max_charges)
current_charges = clamp(current_charges + 1, 0, max_charges)
holder.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, 1)
+3 -3
View File
@@ -246,10 +246,10 @@
else
visibility_flags &= ~HIDDEN_SCANNER
SetSpread(CLAMP(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE))
SetSpread(clamp(2 ** (properties["transmittable"] - symptoms.len), DISEASE_SPREAD_BLOOD, DISEASE_SPREAD_AIRBORNE))
permeability_mod = max(CEILING(0.4 * properties["transmittable"], 1), 1)
cure_chance = 15 - CLAMP(properties["resistance"], -5, 5) // can be between 10 and 20
cure_chance = 15 - clamp(properties["resistance"], -5, 5) // can be between 10 and 20
stage_prob = max(properties["stage_rate"], 2)
SetSeverity(properties["severity"])
GenerateCure(properties)
@@ -304,7 +304,7 @@
// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure()
if(properties && properties.len)
var/res = CLAMP(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
var/res = clamp(properties["resistance"] - (symptoms.len / 2), 1, advance_cures.len)
if(res == oldres)
return
cures = list(pick(advance_cures[res]))
+1 -1
View File
@@ -1,6 +1,6 @@
/datum/element/cleaning/Attach(datum/target)
. = ..()
if(!ismovableatom(target))
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
RegisterSignal(target, COMSIG_MOVABLE_MOVED, .proc/Clean)
+1 -1
View File
@@ -10,7 +10,7 @@
/datum/element/firestacker/Attach(datum/target, amount)
. = ..()
if(!ismovableatom(target))
if(!ismovable(target))
return ELEMENT_INCOMPATIBLE
src.amount = amount
+28
View File
@@ -0,0 +1,28 @@
#define SHORT 5/7
#define TALL 7/5
/datum/element/squish
element_flags = ELEMENT_DETACH
/datum/element/squish/Attach(datum/target, duration)
. = ..()
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE
var/mob/living/carbon/C = target
var/was_lying = (C.lying != 0)
addtimer(CALLBACK(src, .proc/Detach, C, was_lying), duration)
C.transform = C.transform.Scale(TALL, SHORT)
/datum/element/squish/Detach(mob/living/carbon/C, was_lying)
. = ..()
if(istype(C))
var/is_lying = (C.lying != 0)
if(was_lying == is_lying)
C.transform = C.transform.Scale(SHORT, TALL)
else
C.transform = C.transform.Scale(TALL, SHORT)
#undef SHORT
#undef TALL
+3 -3
View File
@@ -121,14 +121,14 @@ GLOBAL_LIST_EMPTY(explosions)
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, null, 100, 1, frequency, falloff = 5, S = explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 25, CLAMP(baseshakeamount, 0, 10))
shake_camera(M, 25, clamp(baseshakeamount, 0, 10))
// You hear a far explosion if you're outside the blast radius. Small bombs shouldn't be heard all over the station.
else if(dist <= far_dist)
var/far_volume = CLAMP(far_dist, 30, 50) // Volume is based on explosion size and dist
var/far_volume = clamp(far_dist, 30, 50) // Volume is based on explosion size and dist
far_volume += (dist <= far_dist * 0.5 ? 50 : 0) // add 50 volume if the mob is pretty close to the explosion
M.playsound_local(epicenter, null, far_volume, 1, frequency, falloff = 5, S = far_explosion_sound)
if(baseshakeamount > 0)
shake_camera(M, 10, CLAMP(baseshakeamount*0.25, 0, 2.5))
shake_camera(M, 10, clamp(baseshakeamount*0.25, 0, 2.5))
EX_PREPROCESS_CHECK_TICK
//postpone processing for a bit
+3 -1
View File
@@ -10,6 +10,7 @@
var/help_verb
var/pacifism_check = TRUE //are the martial arts combos/attacks unable to be used by pacifist.
var/allow_temp_override = TRUE //if this martial art can be overridden by temporary martial arts
var/pugilist = FALSE
/datum/martial_art/proc/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
return FALSE
@@ -61,7 +62,8 @@
if(help_verb)
H.verbs += help_verb
H.mind.martial_art = src
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
if(pugilist)
ADD_TRAIT(H, TRAIT_PUGILIST, MARTIAL_ARTIST_TRAIT)
return TRUE
/datum/martial_art/proc/store(datum/martial_art/M,mob/living/carbon/human/H)
+1
View File
@@ -2,6 +2,7 @@
name = "Boxing"
id = MARTIALART_BOXING
pacifism_check = FALSE //Let's pretend pacifists can boxe the heck out of other people, it only deals stamina damage right now.
pugilist = TRUE
/datum/martial_art/boxing/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
to_chat(A, "<span class='warning'>Can't disarm while boxing!</span>")
+1
View File
@@ -9,6 +9,7 @@
id = MARTIALART_CQC
help_verb = /mob/living/carbon/human/proc/CQC_help
block_chance = 75
pugilist = TRUE
var/old_grab_state = null
/datum/martial_art/cqc/reset_streak(mob/living/carbon/human/new_target)
+4 -3
View File
@@ -1,6 +1,7 @@
/datum/martial_art/krav_maga
name = "Krav Maga"
id = MARTIALART_KRAVMAGA
pugilist = TRUE
var/datum/action/neck_chop/neckchop = new/datum/action/neck_chop()
var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep()
var/datum/action/lung_punch/lungpunch = new/datum/action/lung_punch()
@@ -115,7 +116,7 @@
"<span class='userdanger'>[A] slams your chest! You can't breathe!</span>")
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
if(D.losebreath <= 10)
D.losebreath = CLAMP(D.losebreath + 5, 0, 10)
D.losebreath = clamp(D.losebreath + 5, 0, 10)
D.adjustOxyLoss(damage + 5)
log_combat(A, D, "quickchoked")
return TRUE
@@ -127,7 +128,7 @@
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
D.apply_damage(damage, BRUTE)
if(D.silent <= 10)
D.silent = CLAMP(D.silent + 10, 0, 10)
D.silent = clamp(D.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return TRUE
@@ -186,7 +187,7 @@
if(damage >= stunthreshold)
D.visible_message("<span class='warning'>[D] sputters and recoils in pain!</span>", "<span class='userdanger'>You recoil in pain as you are jabbed in a nerve!</span>")
D.drop_all_held_items()
return TRUE
//Krav Maga Gloves
+1
View File
@@ -6,6 +6,7 @@
name = "Plasma Fist"
id = MARTIALART_PLASMAFIST
help_verb = /mob/living/carbon/human/proc/plasma_fist_help
pugilist = TRUE
/datum/martial_art/plasma_fist/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
+1
View File
@@ -9,6 +9,7 @@
id = MARTIALART_RISINGBASS
allow_temp_override = FALSE
help_verb = /mob/living/carbon/human/proc/rising_bass_help
pugilist = TRUE
var/datum/action/risingbassmove/sidekick = new/datum/action/risingbassmove/sidekick()
var/datum/action/risingbassmove/deftswitch = new/datum/action/risingbassmove/deftswitch()
var/repulsecool = 0
+5
View File
@@ -7,6 +7,7 @@
id = MARTIALART_SLEEPINGCARP
allow_temp_override = FALSE
help_verb = /mob/living/carbon/human/proc/sleeping_carp_help
pugilist = TRUE
/datum/martial_art/the_sleeping_carp/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(findtext(streak,STRONG_PUNCH_COMBO))
@@ -140,8 +141,10 @@
ADD_TRAIT(H, TRAIT_NOGUNS, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_PIERCEIMMUNE, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_NODISMEMBER, SLEEPING_CARP_TRAIT)
ADD_TRAIT(H, TRAIT_TASED_RESISTANCE, SLEEPING_CARP_TRAIT)
H.physiology.brute_mod *= 0.4 //brute is really not gonna cut it
H.physiology.burn_mod *= 0.7 //burn is distinctly more useful against them than brute but they're still resistant
H.physiology.stamina_mod *= 0.5 //You take less stamina damage overall, but you do not reduce the damage from stun batons
H.physiology.stun_mod *= 0.3 //for those rare stuns
H.physiology.pressure_mod *= 0.3 //go hang out with carp
H.physiology.cold_mod *= 0.3 //cold mods are different to burn mods, they do stack however
@@ -154,8 +157,10 @@
REMOVE_TRAIT(H, TRAIT_NOGUNS, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_PIERCEIMMUNE, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_NODISMEMBER, SLEEPING_CARP_TRAIT)
REMOVE_TRAIT(H, TRAIT_TASED_RESISTANCE, SLEEPING_CARP_TRAIT)
H.physiology.brute_mod = initial(H.physiology.brute_mod)
H.physiology.burn_mod = initial(H.physiology.burn_mod)
H.physiology.stamina_mod = initial(H.physiology.stamina_mod)
H.physiology.stun_mod = initial(H.physiology.stun_mod)
H.physiology.pressure_mod = initial(H.physiology.pressure_mod) //no more carpies
H.physiology.cold_mod = initial(H.physiology.cold_mod)
+1 -1
View File
@@ -92,7 +92,7 @@ Unless you know what you're doing, only use the first three numbers. They're in
/datum/material/plasma/on_applied(atom/source, amount, material_flags)
. = ..()
if(ismovableatom(source))
if(ismovable(source))
source.AddElement(/datum/element/firestacker, amount=1)
source.AddComponent(/datum/component/explodable, 0, 0, amount / 2500, amount / 1250)
+13
View File
@@ -511,6 +511,19 @@
message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]")
log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]")
else if(href_list["traitor_class"])
var/static/list/choices
if(!choices)
choices = list()
for(var/C in GLOB.traitor_classes)
var/datum/traitor_class/t = C
choices[initial(t.employer)] = C
var/datum/antagonist/traitor/T = locate(href_list["target_antag"]) in antag_datums
if(T)
var/selected_type = input("Select traitor class:", "Traitor class", T.traitor_kind.employer) as null|anything in choices
selected_type = choices[selected_type]
T.set_traitor_kind(selected_type)
else if (href_list["obj_delete"])
var/datum/objective/objective
+4
View File
@@ -81,6 +81,7 @@
/datum/mutation/human/dwarfism/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION)
owner.transform = owner.transform.Scale(1, 0.8)
passtable_on(owner, GENETIC_MUTATION)
owner.visible_message("<span class='danger'>[owner] suddenly shrinks!</span>", "<span class='notice'>Everything around you seems to grow..</span>")
@@ -88,6 +89,7 @@
/datum/mutation/human/dwarfism/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_DWARF, GENETIC_MUTATION)
owner.transform = owner.transform.Scale(1, 1.25)
passtable_off(owner, GENETIC_MUTATION)
owner.visible_message("<span class='danger'>[owner] suddenly grows!</span>", "<span class='notice'>Everything around you seems to shrink..</span>")
@@ -339,6 +341,7 @@
/datum/mutation/human/gigantism/on_acquiring(mob/living/carbon/human/owner)
if(..())
return
ADD_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
owner.resize = 1.25
owner.update_transform()
owner.visible_message("<span class='danger'>[owner] suddenly grows!</span>", "<span class='notice'>Everything around you seems to shrink..</span>")
@@ -346,6 +349,7 @@
/datum/mutation/human/gigantism/on_losing(mob/living/carbon/human/owner)
if(..())
return
REMOVE_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
owner.resize = 0.8
owner.update_transform()
owner.visible_message("<span class='danger'>[owner] suddenly shrinks!</span>", "<span class='notice'>Everything around you seems to grow..</span>")
+1 -1
View File
@@ -20,7 +20,7 @@
return sqrt(((b.x - a.x) ** 2) + ((b.y - a.y) ** 2))
/proc/angle_between_points(datum/point/a, datum/point/b)
return ATAN2((b.y - a.y), (b.x - a.x))
return arctan((b.y - a.y), (b.x - a.x))
/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess.
var/x = 0
+1 -1
View File
@@ -38,7 +38,7 @@
if (user.client)
user.client.images += bar
progress = CLAMP(progress, 0, goal)
progress = clamp(progress, 0, goal)
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
user.client.images += bar
+2 -2
View File
@@ -336,7 +336,7 @@
if(prob(severity * 0.15))
to_chat(owner, "<span class='sevtug[span_part]'>\"[text2ratvar(pick(mania_messages))]\"</span>")
owner.playsound_local(get_turf(motor), hum, severity, 1)
owner.adjust_drugginess(CLAMP(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
owner.adjust_drugginess(clamp(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
if(owner.hallucination < 50)
owner.hallucination = min(owner.hallucination + max(severity * 0.075, 1), 50) //7.5% of severity per second, minimum 1
if(owner.dizziness < 50)
@@ -594,7 +594,7 @@
old_health = owner.health
if(!old_oxyloss)
old_oxyloss = owner.getOxyLoss()
var/health_difference = old_health - owner.health - CLAMP(owner.getOxyLoss() - old_oxyloss,0, owner.getOxyLoss())
var/health_difference = old_health - owner.health - clamp(owner.getOxyLoss() - old_oxyloss,0, owner.getOxyLoss())
if(!health_difference)
return
owner.visible_message("<span class='warning'>The light in [owner]'s eyes dims as [owner.p_theyre()] harmed!</span>", \
+2 -2
View File
@@ -192,7 +192,7 @@
reagents = new()
reagents.reagent_list.Add(A)
reagents.conditional_update()
else if(ismovableatom(A))
else if(ismovable(A))
var/atom/movable/M = A
if(isliving(M.loc))
var/mob/living/L = M.loc
@@ -692,7 +692,7 @@
/atom/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION("", "---------")
if(!ismovableatom(src))
if(!ismovable(src))
var/turf/curturf = get_turf(src)
if(curturf)
. += "<option value='?_src_=holder;[HrefToken()];adminplayerobservecoodjump=1;X=[curturf.x];Y=[curturf.y];Z=[curturf.z]'>Jump To</option>"
+7 -2
View File
@@ -251,8 +251,13 @@
/atom/movable/proc/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
set waitfor = 0
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
return hit_atom.hitby(src, throwingdatum=throwingdatum)
var/hitpush = TRUE
var/impact_signal = SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
if(impact_signal & COMPONENT_MOVABLE_IMPACT_FLIP_HITPUSH)
hitpush = FALSE // hacky, tie this to something else or a proper workaround later
if(impact_signal & ~COMPONENT_MOVABLE_IMPACT_NEVERMIND) // in case a signal interceptor broke or deleted the thing before we could process our hit
return hit_atom.hitby(src, throwingdatum = throwingdatum, hitpush = hitpush)
/atom/movable/hitby(atom/movable/AM, skipcatch, hitpush = TRUE, blocked, datum/thrownthing/throwingdatum)
if(!anchored && hitpush && (!throwingdatum || (throwingdatum.force >= (move_resist * MOVE_FORCE_PUSH_RATIO))))
@@ -53,7 +53,7 @@
restricted_jobs += "Assistant"
// Set number of Vamps
recommended_enemies = CLAMP(round(num_players()/10), 1, 6);
recommended_enemies = clamp(round(num_players()/10), 1, 6);
// Select Antags
for(var/i = 0, i < recommended_enemies, i++)
@@ -195,7 +195,7 @@
return FALSE
if(target.stat > UNCONSCIOUS)
return FALSE
// 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")
@@ -105,7 +105,7 @@
if (M.mind && M.mind.assigned_role && (M.mind.assigned_role in enemy_roles) && (!(M in candidates) || (M.mind.assigned_role in restricted_roles)))
job_check++ // Checking for "enemies" (such as sec officers). To be counters, they must either not be candidates to that rule, or have a job that restricts them from it
var/threat = CLAMP(round(mode.threat_level/10),1,10)
var/threat = clamp(round(mode.threat_level/10),1,10)
if (job_check < required_enemies[threat])
SSblackbox.record_feedback("tally","dynamic",1,"Times rulesets rejected due to not enough enemy roles")
return FALSE
@@ -671,7 +671,7 @@
message_admins("[ADMIN_LOOKUPFLW(Ninja)] has been made into a ninja by dynamic.")
log_game("[key_name(Ninja)] was spawned as a ninja by dynamic.")
return Ninja
/datum/dynamic_ruleset/midround/from_ghosts/ninja/finish_setup(mob/new_character, index)
return
@@ -789,7 +789,7 @@
if (prob(meteorminutes/2))
wavetype = GLOB.meteors_catastrophic
var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)
spawn_meteors(ramp_up_final, wavetype)
@@ -11,7 +11,7 @@
WAROPS_ALWAYS_ALLOWED: Can always do warops, regardless of threat level.
USE_PREF_WEIGHTS: Will use peoples' preferences to change the threat centre.
FORCE_IF_WON: If this mode won the vote, forces it
USE_PREV_ROUND_WEIGHTS: Changes its threat centre based on the average chaos of previous rounds.
USE_PREV_ROUND_WEIGHTS: Changes its threat centre based on the average chaos of previous rounds.
*/
var/flags = 0
var/dead_player_weight = 1 // How much dead players matter for threat calculation
@@ -22,11 +22,11 @@
var/datum/game_mode/dynamic/mode = null // Cached as soon as it's made, by dynamic.
/**
Property weights are:
Property weights are:
"story_potential" -- essentially how many different ways the antag can be played.
"trust" -- How much it makes the crew trust each other. Negative values means they're suspicious. Team antags are like this.
"chaos" -- How chaotic it makes the round. Has some overlap with "valid" and somewhat contradicts "extended".
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
"valid" -- How likely the non-antag-enemy crew are to get involved, e.g. nukies encouraging the warden to
let everyone into the armory, wizard moving around and being a nuisance, nightmare busting lights.
"extended" -- How much the antag is conducive to a long round. Nukies and cults are bad for this; Wizard is less bad; and so on.
"conversion" -- Basically a bool. Conversion antags, well, convert. It's its own class for a good reason.
@@ -34,13 +34,13 @@ Property weights are:
/datum/dynamic_storyteller/proc/start_injection_cooldowns()
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_latejoin_delay_max + GLOB.dynamic_first_latejoin_delay_min)
mode.latejoin_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
mode.latejoin_injection_cooldown = round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_first_latejoin_delay_min, GLOB.dynamic_first_latejoin_delay_max)) + world.time
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_first_midround_delay_min + GLOB.dynamic_first_midround_delay_max)
mode.midround_injection_cooldown = round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
mode.midround_injection_cooldown = round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_first_midround_delay_min, GLOB.dynamic_first_midround_delay_max)) + world.time
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
mode.event_injection_cooldown = (round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
mode.event_injection_cooldown = (round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max)) + world.time)
/datum/dynamic_storyteller/proc/calculate_threat()
var/threat = 0
@@ -99,15 +99,15 @@ Property weights are:
/datum/dynamic_storyteller/proc/get_midround_cooldown()
var/midround_injection_cooldown_middle = 0.5*(GLOB.dynamic_midround_delay_max + GLOB.dynamic_midround_delay_min)
return round(CLAMP(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
return round(clamp(EXP_DISTRIBUTION(midround_injection_cooldown_middle), GLOB.dynamic_midround_delay_min, GLOB.dynamic_midround_delay_max))
/datum/dynamic_storyteller/proc/get_event_cooldown()
var/event_injection_cooldown_middle = 0.5*(GLOB.dynamic_event_delay_max + GLOB.dynamic_event_delay_min)
return round(CLAMP(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
return round(clamp(EXP_DISTRIBUTION(event_injection_cooldown_middle), GLOB.dynamic_event_delay_min, GLOB.dynamic_event_delay_max))
/datum/dynamic_storyteller/proc/get_latejoin_cooldown()
var/latejoin_injection_cooldown_middle = 0.5*(GLOB.dynamic_latejoin_delay_max + GLOB.dynamic_latejoin_delay_min)
return round(CLAMP(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
return round(clamp(EXP_DISTRIBUTION(latejoin_injection_cooldown_middle), GLOB.dynamic_latejoin_delay_min, GLOB.dynamic_latejoin_delay_max))
/datum/dynamic_storyteller/proc/get_injection_chance(dry_run = FALSE)
if(mode.forced_injection)
@@ -144,7 +144,7 @@ Property weights are:
if(!(rule.flags & MINOR_RULESET)) // makes the traitor rulesets always possible anyway
var/cost_difference = abs(rule.cost-(mode.threat_level-mode.threat))
/* Basically, the closer the cost is to the current threat-level-away-from-threat, the more likely it is to
pick this particular ruleset.
pick this particular ruleset.
Let's use a toy example: there's 60 threat level and 10 threat spent.
We want to pick a ruleset that's close to that, so we run the below equation, on two rulesets.
Ruleset 1 has 30 cost, ruleset 2 has 5 cost.
@@ -212,7 +212,7 @@ Property weights are:
flags = WAROPS_ALWAYS_ALLOWED
min_players = 40
var/refund_cooldown = 0
/datum/dynamic_storyteller/chaotic/do_process()
if(refund_cooldown < world.time)
mode.create_threat(20)
@@ -221,7 +221,7 @@ Property weights are:
/datum/dynamic_storyteller/chaotic/get_midround_cooldown()
return ..() / 4
/datum/dynamic_storyteller/chaotic/get_latejoin_cooldown()
return ..() / 4
+1 -1
View File
@@ -32,7 +32,7 @@
/datum/antagonist/gang/farewell()
if(ishuman(owner.current))
owner.current.visible_message("<span class='deconversion_message'>[owner.current] looks like [owner.current.p_theyve()] just remembered [owner.current.p_their()] real allegiance!</span>", null, null, null, owner.current)
to_chat(owner, "<span class='userdanger'>You are no longer a gangster!</span>")
to_chat(owner, "<span class='userdanger'>You are no longer a gangster! Your memories from the time you were in a gang are hazy... You don't seem to be able to recall the names of your previous allies, not even your bosses...</span>")
/datum/antagonist/gang/on_gain()
if(!gang)
+1 -1
View File
@@ -25,7 +25,7 @@
if (prob(meteorminutes/2))
wavetype = GLOB.meteors_catastrophic
var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)
spawn_meteors(ramp_up_final, wavetype)
-1
View File
@@ -121,7 +121,6 @@
uniform = /obj/item/clothing/under/syndicate
shoes = /obj/item/clothing/shoes/combat
gloves = /obj/item/clothing/gloves/combat
back = /obj/item/storage/backpack
ears = /obj/item/radio/headset/syndicate/alt
l_pocket = /obj/item/pinpointer/nuke/syndicate
id = /obj/item/card/id/syndicate
+1 -1
View File
@@ -70,7 +70,7 @@
/datum/game_mode/revolution/post_setup()
var/list/heads = SSjob.get_living_heads()
var/list/sec = SSjob.get_living_sec()
var/weighted_score = CLAMP(round(heads.len - ((3 - sec.len) / 3)), 1, max_headrevs)
var/weighted_score = clamp(round(heads.len - ((3 - sec.len) / 3)), 1, max_headrevs)
for(var/datum/mind/rev_mind in headrev_candidates) //People with return to lobby may still be in the lobby. Let's pick someone else in that case.
if(isnewplayer(rev_mind.current))
+1 -1
View File
@@ -169,7 +169,7 @@
var/multiplier = text2num(href_list["multiplier"])
var/is_stack = ispath(being_built.build_path, /obj/item/stack)
multiplier = CLAMP(multiplier,1,50)
multiplier = clamp(multiplier,1,50)
/////////////////
+1 -1
View File
@@ -69,7 +69,7 @@
for(var/obj/item/stock_parts/manipulator/P in component_parts)
speed_coeff += (P.rating / 2)
speed_coeff = max(1, speed_coeff)
heal_level = CLAMP((efficiency * 10) + 10, MINIMUM_HEAL_LEVEL, 100)
heal_level = clamp((efficiency * 10) + 10, MINIMUM_HEAL_LEVEL, 100)
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
//TO-DO: Make the genetics machine accept them.
+2 -2
View File
@@ -150,7 +150,7 @@
return
log_activity("changed greater than charge filter to \"[new_filter]\"")
if(new_filter)
new_filter = CLAMP(new_filter, 0, 100)
new_filter = clamp(new_filter, 0, 100)
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
result_filters["Charge Above"] = new_filter
if(href_list["below_filter"])
@@ -160,7 +160,7 @@
return
log_activity("changed lesser than charge filter to \"[new_filter]\"")
if(new_filter)
new_filter = CLAMP(new_filter, 0, 100)
new_filter = clamp(new_filter, 0, 100)
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
result_filters["Charge Below"] = new_filter
if(href_list["access_filter"])
@@ -308,12 +308,12 @@
var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num
if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_rows = CLAMP(new_rows + 1, 4, 30)
new_rows = clamp(new_rows + 1, 4, 30)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num
if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_columns = CLAMP(new_columns + 1, 4, 50)
new_columns = clamp(new_columns + 1, 4, 50)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
var/grid_area = (new_rows - 1) * (new_columns - 1)
var/lower_limit = round(grid_area*0.156)
@@ -324,7 +324,7 @@
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
rows = new_rows
columns = new_columns
mine_limit = CLAMP(new_mine_limit, lower_limit, upper_limit)
mine_limit = clamp(new_mine_limit, lower_limit, upper_limit)
return TRUE
/obj/machinery/computer/arcade/minesweeper/proc/make_mines(var/reset_everything)
@@ -296,7 +296,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
if("rate")
var/target = text2num(params["rate"])
if(!isnull(target))
target = CLAMP(target, 0, MAX_TRANSFER_RATE)
target = clamp(target, 0, MAX_TRANSFER_RATE)
signal.data += list("tag" = input_tag, "set_volume_rate" = target)
. = TRUE
if("output")
@@ -305,7 +305,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
if("pressure")
var/target = text2num(params["pressure"])
if(!isnull(target))
target = CLAMP(target, 0, MAX_OUTPUT_PRESSURE)
target = clamp(target, 0, MAX_OUTPUT_PRESSURE)
signal.data += list("tag" = output_tag, "set_internal_pressure" = target)
. = TRUE
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
+7 -7
View File
@@ -604,13 +604,13 @@
if("setbufferlabel")
var/text = sanitize(input(usr, "Input a new label:", "Input a Text", null) as text|null)
if(num && text)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
buffer_slot["label"] = text
if("setbuffer")
if(num && viable_occupant)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
buffer[num] = list(
"label"="Buffer[num]:[viable_occupant.real_name]",
"UI"=viable_occupant.dna.uni_identity,
@@ -620,7 +620,7 @@
)
if("clearbuffer")
if(num)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
buffer_slot.Cut()
@@ -635,7 +635,7 @@
apply_buffer(SCANNER_ACTION_MIXED,num)
if("injector")
if(num && injectorready < world.time)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
var/obj/item/dnainjector/timed/I
@@ -662,11 +662,11 @@
injectorready = world.time + INJECTOR_TIMEOUT
if("loaddisk")
if(num && diskette && diskette.fields)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
buffer[num] = diskette.fields.Copy()
if("savedisk")
if(num && diskette && !diskette.read_only)
num = CLAMP(num, 1, NUMBER_OF_BUFFERS)
num = clamp(num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[num]
if(istype(buffer_slot))
diskette.name = "data disk \[[buffer_slot["label"]]\]"
@@ -953,7 +953,7 @@
return viable_occupant
/obj/machinery/computer/scan_consolenew/proc/apply_buffer(action,buffer_num)
buffer_num = CLAMP(buffer_num, 1, NUMBER_OF_BUFFERS)
buffer_num = clamp(buffer_num, 1, NUMBER_OF_BUFFERS)
var/list/buffer_slot = buffer[buffer_num]
var/mob/living/carbon/viable_occupant = get_viable_occupant()
if(istype(buffer_slot))
@@ -97,7 +97,7 @@
return
if(!new_goal)
new_goal = default_goal
contained_id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points
contained_id.goal = clamp(new_goal, 0, 1000) //maximum 1000 points
return TRUE
if("toggle_open")
if(teleporter.locked)
+1 -1
View File
@@ -33,7 +33,7 @@
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 40, volume=40))
obj_integrity = CLAMP(obj_integrity + 20, 0, max_integrity)
obj_integrity = clamp(obj_integrity + 20, 0, max_integrity)
else
return ..()
+1 -1
View File
@@ -135,7 +135,7 @@
. /= 10
/obj/machinery/door_timer/proc/set_timer(value)
var/new_time = CLAMP(value,0,MAX_TIMER)
var/new_time = clamp(value,0,MAX_TIMER)
. = new_time == timer_duration //return 1 on no change
timer_duration = new_time
+2 -2
View File
@@ -68,9 +68,9 @@
if(teleporting)
return
if(!isnull(x))
x_offset = CLAMP(x, -range, range)
x_offset = clamp(x, -range, range)
if(!isnull(y))
y_offset = CLAMP(y, -range, range)
y_offset = clamp(y, -range, range)
/obj/machinery/launchpad/proc/doteleport(mob/user, sending)
if(teleporting)
+2 -2
View File
@@ -55,9 +55,9 @@
new /obj/item/pipe_meter(loc)
wait = world.time + 15
if(href_list["layer_up"])
piping_layer = CLAMP(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
piping_layer = clamp(++piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
if(href_list["layer_down"])
piping_layer = CLAMP(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
piping_layer = clamp(--piping_layer, PIPING_LAYER_MIN, PIPING_LAYER_MAX)
return
/obj/machinery/pipedispenser/attackby(obj/item/W, mob/user, params)

Some files were not shown because too many files have changed in this diff Show More