mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit698
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
if(!..())
|
||||
return 0
|
||||
var/mob/M = target
|
||||
M.ghostize(1)
|
||||
M.ghostize(can_reenter_corpse = TRUE, voluntary = TRUE)
|
||||
|
||||
/datum/action/proc/OnUpdatedIcon()
|
||||
UpdateButtonIcon()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
),
|
||||
CAT_ROBOT = CAT_NONE,
|
||||
CAT_MISC = list(
|
||||
CAT_MISC,
|
||||
CAT_MISCELLANEOUS,
|
||||
CAT_TOOL,
|
||||
CAT_FURNITURE,
|
||||
),
|
||||
@@ -205,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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,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
|
||||
@@ -28,12 +29,119 @@
|
||||
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//
|
||||
///////////////////
|
||||
|
||||
/datum/crafting_recipe/upgraded_gauze
|
||||
name = "Improved Gauze"
|
||||
result = /obj/item/stack/medical/gauze/adv
|
||||
time = 1
|
||||
reqs = list(/obj/item/stack/medical/gauze = 1,
|
||||
/datum/reagent/space_cleaner/sterilizine = 10)
|
||||
category = CAT_MISC
|
||||
subcategory = CAT_TOOL
|
||||
|
||||
/datum/crafting_recipe/bruise_pack
|
||||
name = "Bruise Pack"
|
||||
result = /obj/item/stack/medical/bruise_pack
|
||||
time = 1
|
||||
reqs = list(/obj/item/stack/medical/gauze = 1,
|
||||
/datum/reagent/medicine/styptic_powder = 10)
|
||||
category = CAT_MISC
|
||||
subcategory = CAT_TOOL
|
||||
|
||||
/datum/crafting_recipe/burn_pack
|
||||
name = "Brun Ointment"
|
||||
result = /obj/item/stack/medical/ointment
|
||||
time = 1
|
||||
reqs = list(/obj/item/stack/medical/gauze = 1,
|
||||
/datum/reagent/medicine/silver_sulfadiazine = 10)
|
||||
category = CAT_MISC
|
||||
subcategory = CAT_TOOL
|
||||
|
||||
/datum/crafting_recipe/ghettojetpack
|
||||
name = "Improvised Jetpack"
|
||||
result = /obj/item/tank/jetpack/improvised
|
||||
@@ -162,6 +270,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
|
||||
@@ -170,6 +279,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
|
||||
@@ -178,6 +288,7 @@
|
||||
time = 65
|
||||
reqs = list(/obj/item/stack/sheet/metal = 5,
|
||||
/obj/item/stack/rods = 12)
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISC
|
||||
|
||||
/////////
|
||||
@@ -188,18 +299,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
|
||||
|
||||
////////////
|
||||
@@ -210,6 +324,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
|
||||
@@ -217,6 +332,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
|
||||
@@ -225,6 +341,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
|
||||
@@ -234,6 +351,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
|
||||
@@ -242,6 +360,7 @@
|
||||
time = 10
|
||||
reqs = list(/obj/item/stack/sheet/cardboard = 1,
|
||||
/obj/item/stack/rods = 1)
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/flashlight_eyes
|
||||
@@ -252,6 +371,7 @@
|
||||
/obj/item/flashlight = 2,
|
||||
/obj/item/restraints/handcuffs/cable = 1
|
||||
)
|
||||
subcategory = CAT_MISCELLANEOUS
|
||||
category = CAT_MISC
|
||||
|
||||
/datum/crafting_recipe/pressureplate
|
||||
@@ -262,6 +382,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
|
||||
@@ -270,6 +391,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
|
||||
@@ -279,6 +401,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
|
||||
@@ -287,6 +410,7 @@
|
||||
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
|
||||
@@ -295,6 +419,7 @@
|
||||
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
|
||||
|
||||
//////////////
|
||||
@@ -354,41 +479,3 @@
|
||||
/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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
88
code/datums/components/identification.dm
Normal file
88
code/datums/components/identification.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Identification components
|
||||
*/
|
||||
/datum/component/identification
|
||||
/// General flags for how we should work.
|
||||
var/identification_flags = NONE
|
||||
/// General flags for what we should do.
|
||||
var/identification_effect_flags = NONE
|
||||
/// General flags for how we can be identified.
|
||||
var/identification_method_flags = NONE
|
||||
/// If this is set, show this on examine to the examiner if they know how to use it.
|
||||
var/additional_examine_text = "<span class='notice'>You seem to know more about this item than others..</span>"
|
||||
/// Added to deconstructive analyzer say on success if set
|
||||
var/deconstructor_reveal_text = "item operation instructions"
|
||||
|
||||
/datum/component/identification/Initialize(id_flags, id_effect_flags, id_method_flags)
|
||||
if(!isobj(parent))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
. = ..()
|
||||
if(. & COMPONENT_INCOMPATIBLE)
|
||||
return
|
||||
identification_flags = id_flags
|
||||
identification_effect_flags = id_effect_flags
|
||||
identification_method_flags = id_method_flags
|
||||
|
||||
/datum/component/identification/RegisterWithParent()
|
||||
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
|
||||
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/on_equip)
|
||||
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
|
||||
RegisterSignal(parent, COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN, .proc/on_deconstructor_deepscan)
|
||||
|
||||
/datum/component/identification/UnregisterFromParent()
|
||||
var/list/unregister = list(COMSIG_PARENT_EXAMINE)
|
||||
if(identification_effect_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
unregister += COMSIG_ITEM_EQUIPPED
|
||||
if(identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR)
|
||||
unregister += COMSIG_ITEM_DECONSTRUCTOR_DEEPSCAN
|
||||
UnregisterSignal(parent, unregister)
|
||||
|
||||
/datum/component/identification/proc/on_examine(datum/source, mob/user, list/returnlist)
|
||||
if(check_knowledge(user) != ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
return
|
||||
if(!additional_examine_text)
|
||||
return
|
||||
returnlist += additional_examine_text
|
||||
|
||||
/datum/component/identification/vv_edit_var(var_name, var_value)
|
||||
// since i care SOOO much about memory optimization, we only register signals we need to
|
||||
// so when someone vv's us, we should probably make sure we have the ones we need to with an update.
|
||||
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
|
||||
UnregisterFromParent()
|
||||
. = ..()
|
||||
if((var_value == NAMEOF(src, identification_flags)) || (var_value == NAMEOF(src, identification_effect_flags)) || (var_value == NAMEOF(src, identification_method_flags)))
|
||||
RegisterWithParent()
|
||||
|
||||
/datum/component/identification/proc/on_equip(datum/source, mob/user)
|
||||
if(check_knowledge(user) == ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
return
|
||||
if(identification_method_flags & ID_COMPONENT_EFFECT_NO_ACTIONS)
|
||||
return COMPONENT_NO_GRANT_ACTIONS
|
||||
|
||||
/datum/component/identification/proc/check_knowledge(mob/user)
|
||||
return ID_COMPONENT_KNOWLEDGE_NONE
|
||||
|
||||
/datum/component/identification/proc/on_identify(mob/user)
|
||||
if(identification_flags & ID_COMPONENT_DEL_ON_IDENTIFY)
|
||||
qdel(src)
|
||||
|
||||
/datum/component/identification/proc/on_deconstructor_deepscan(datum/source, obj/machinery/rnd/destructive_analyzer/analyzer, mob/user, list/information = list())
|
||||
if((identification_method_flags & ID_COMPONENT_IDENTIFY_WITH_DECONSTRUCTOR) && !(identification_flags & ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED))
|
||||
identification_flags |= ID_COMPONENT_DECONSTRUCTOR_DEEPSCANNED
|
||||
on_identify(user)
|
||||
if(deconstructor_reveal_text)
|
||||
information += deconstructor_reveal_text
|
||||
return COMPONENT_DEEPSCAN_UNCOVERED_INFORMATION
|
||||
|
||||
/**
|
||||
* Identification component subtype - Syndicate
|
||||
*
|
||||
* Checks if the user is a traitor.
|
||||
*/
|
||||
/datum/component/identification/syndicate
|
||||
|
||||
/datum/component/identification/syndicate/check_knowledge(mob/user)
|
||||
. = ..()
|
||||
if(user?.mind?.has_antag_datum(/datum/antagonist/traitor))
|
||||
. = max(., ID_COMPONENT_KNOWLEDGE_FULL)
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -175,27 +175,27 @@
|
||||
switch(sanity)
|
||||
if(-INFINITY to SANITY_CRAZY)
|
||||
setInsanityEffect(MAJOR_INSANITY_PEN)
|
||||
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1.5) //Did we change something ? movetypes is runtiming, movetypes=(~FLYING))
|
||||
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/insane)
|
||||
sanity_level = 6
|
||||
if(SANITY_CRAZY to SANITY_UNSTABLE)
|
||||
setInsanityEffect(MINOR_INSANITY_PEN)
|
||||
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=1)//, movetypes=(~FLYING))
|
||||
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/crazy)
|
||||
sanity_level = 5
|
||||
if(SANITY_UNSTABLE to SANITY_DISTURBED)
|
||||
setInsanityEffect(0)
|
||||
master.add_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE, 100, override=TRUE, multiplicative_slowdown=0.5)//, movetypes=(~FLYING))
|
||||
master.add_movespeed_modifier(/datum/movespeed_modifier/sanity/disturbed)
|
||||
sanity_level = 4
|
||||
if(SANITY_DISTURBED to SANITY_NEUTRAL)
|
||||
setInsanityEffect(0)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
||||
sanity_level = 3
|
||||
if(SANITY_NEUTRAL+1 to SANITY_GREAT+1) //shitty hack but +1 to prevent it from responding to super small differences
|
||||
setInsanityEffect(0)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
||||
sanity_level = 2
|
||||
if(SANITY_GREAT+1 to INFINITY)
|
||||
setInsanityEffect(0)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY, TRUE)
|
||||
master.remove_movespeed_modifier(MOVESPEED_ID_SANITY)
|
||||
sanity_level = 1
|
||||
//update_mood_icon()
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/list/datum/nanite_program/programs = list()
|
||||
var/max_programs = NANITE_PROGRAM_LIMIT
|
||||
|
||||
var/list/datum/nanite_program/protocol/protocols = list() ///Separate list of protocol programs, to avoid looping through the whole programs list when cheking for conflicts
|
||||
var/list/datum/nanite_program/protocol/protocols = list() ///Separate list of protocol programs, to avoid looping through the whole programs list when checking for conflicts
|
||||
var/start_time = 0 ///Timestamp to when the nanites were first inserted in the host
|
||||
var/stealth = FALSE //if TRUE, does not appear on HUDs and health scans
|
||||
var/diagnostics = TRUE //if TRUE, displays program list when scanned by nanite scanners
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -198,13 +198,14 @@
|
||||
|
||||
/datum/component/riding/human/Initialize()
|
||||
. = ..()
|
||||
directional_vehicle_layers = list(TEXT_NORTH = MOB_LOWER_LAYER, TEXT_SOUTH = MOB_UPPER_LAYER, TEXT_EAST = MOB_UPPER_LAYER, TEXT_WEST = MOB_UPPER_LAYER)
|
||||
RegisterSignal(parent, COMSIG_HUMAN_MELEE_UNARMED_ATTACK, .proc/on_host_unarmed_melee)
|
||||
|
||||
/datum/component/riding/human/vehicle_mob_unbuckle(datum/source, mob/living/M, force = FALSE)
|
||||
. = ..()
|
||||
var/mob/living/carbon/human/H = parent
|
||||
if(!length(H.buckled_mobs))
|
||||
H.remove_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING)
|
||||
H.remove_movespeed_modifier(/datum/movespeed_modifier/human_carry)
|
||||
if(!fireman_carrying)
|
||||
M.Daze(25)
|
||||
REMOVE_TRAIT(M, TRAIT_MOBILITY_NOUSE, src)
|
||||
@@ -213,7 +214,7 @@
|
||||
. = ..()
|
||||
var/mob/living/carbon/human/H = parent
|
||||
if(length(H.buckled_mobs))
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_HUMAN_CARRYING, multiplicative_slowdown = fireman_carrying? FIREMAN_CARRY_SLOWDOWN : PIGGYBACK_CARRY_SLOWDOWN)
|
||||
H.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/human_carry, TRUE, fireman_carrying? FIREMAN_CARRY_SLOWDOWN : PIGGYBACK_CARRY_SLOWDOWN)
|
||||
if(fireman_carrying)
|
||||
ADD_TRAIT(M, TRAIT_MOBILITY_NOUSE, src)
|
||||
|
||||
@@ -261,6 +262,10 @@
|
||||
|
||||
/datum/component/riding/cyborg
|
||||
|
||||
/datum/component/riding/cyborg/Initialize()
|
||||
. = ..()
|
||||
directional_vehicle_layers = list(TEXT_NORTH = MOB_LOWER_LAYER, TEXT_SOUTH = MOB_UPPER_LAYER, TEXT_EAST = MOB_UPPER_LAYER, TEXT_WEST = MOB_UPPER_LAYER)
|
||||
|
||||
/datum/component/riding/cyborg/ride_check(mob/user)
|
||||
var/atom/movable/AM = parent
|
||||
if(user.incapacitated())
|
||||
|
||||
@@ -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
code/datums/components/shielded.dm
Normal file
191
code/datums/components/shielded.dm
Normal 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
|
||||
@@ -14,7 +14,7 @@
|
||||
parent_atom.opacity = 0
|
||||
if(isliving(parent_atom))
|
||||
var/mob/living/L = parent_atom
|
||||
L.add_movespeed_modifier(MOVESPEED_ID_SHRINK_RAY, update=TRUE, priority=100, multiplicative_slowdown=4)
|
||||
L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
|
||||
if(iscarbon(L))
|
||||
var/mob/living/carbon/C = L
|
||||
C.unequip_everything()
|
||||
@@ -35,7 +35,7 @@
|
||||
parent_atom.opacity = oldopac
|
||||
if(isliving(parent_atom))
|
||||
var/mob/living/L = parent_atom
|
||||
L.remove_movespeed_modifier(MOVESPEED_ID_SHRINK_RAY)
|
||||
L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
|
||||
if(ishuman(L))
|
||||
var/mob/living/carbon/human/H = L
|
||||
H.physiology.damage_resistance += 100
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
var/datum/component/storage/concrete/master //If not null, all actions act on master and this is just an access point.
|
||||
|
||||
var/list/can_hold //if this is set, only things in this typecache will fit.
|
||||
var/list/can_hold_extra //if this is set, it will also be able to hold these.
|
||||
var/list/cant_hold //if this is set, anything in this typecache will not be able to fit.
|
||||
|
||||
var/list/mob/is_using //lazy list of mobs looking at the contents of this storage.
|
||||
@@ -493,26 +494,25 @@
|
||||
if(M && !stop_messages)
|
||||
host.add_fingerprint(M)
|
||||
return FALSE
|
||||
if(length(can_hold))
|
||||
if(!is_type_in_typecache(I, can_hold))
|
||||
if(!length(can_hold_extra) || !is_type_in_typecache(I, can_hold_extra))
|
||||
if(length(can_hold) && !is_type_in_typecache(I, can_hold))
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
|
||||
return FALSE
|
||||
if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
|
||||
return FALSE
|
||||
// STORAGE LIMITS
|
||||
if(is_type_in_typecache(I, cant_hold)) //Check for specific items which this container can't hold.
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[host] cannot hold [I]!</span>")
|
||||
return FALSE
|
||||
if(storage_flags & STORAGE_LIMIT_MAX_W_CLASS && I.w_class > max_w_class)
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[I] is too long for [host]!</span>")
|
||||
return FALSE
|
||||
// STORAGE LIMITS
|
||||
if(storage_flags & STORAGE_LIMIT_MAX_ITEMS)
|
||||
if(real_location.contents.len >= max_items)
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[host] has too many things in it, make some space!</span>")
|
||||
return FALSE //Storage item is full
|
||||
if(storage_flags & STORAGE_LIMIT_MAX_W_CLASS)
|
||||
if(I.w_class > max_w_class)
|
||||
if(!stop_messages)
|
||||
to_chat(M, "<span class='warning'>[I] is too long for [host]!</span>")
|
||||
return FALSE
|
||||
if(storage_flags & STORAGE_LIMIT_COMBINED_W_CLASS)
|
||||
var/sum_w_class = I.w_class
|
||||
for(var/obj/item/_I in real_location)
|
||||
|
||||
@@ -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
code/datums/components/tackle.dm
Normal file
491
code/datums/components/tackle.dm
Normal 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
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
VV_DROPDOWN_OPTION(VV_HK_MARK, "Mark Object")
|
||||
VV_DROPDOWN_OPTION(VV_HK_DELETE, "Delete")
|
||||
VV_DROPDOWN_OPTION(VV_HK_EXPOSE, "Show VV To Player")
|
||||
// VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Modify Traits")
|
||||
VV_DROPDOWN_OPTION(VV_HK_ADDCOMPONENT, "Add Component/Element")
|
||||
VV_DROPDOWN_OPTION(VV_HK_MODIFY_TRAITS, "Modify Traits")
|
||||
|
||||
//This proc is only called if everything topic-wise is verified. The only verifications that should happen here is things like permission checks!
|
||||
//href_list is a reference, modifying it in these procs WILL change the rest of the proc in topic.dm of admin/view_variables!
|
||||
@@ -37,8 +38,8 @@
|
||||
/datum/proc/vv_do_topic(list/href_list)
|
||||
if(!usr || !usr.client || !usr.client.holder || !check_rights(NONE))
|
||||
return FALSE //This is VV, not to be called by anything else.
|
||||
// if(href_list[VV_HK_MODIFY_TRAITS])
|
||||
// usr.client.holder.modify_traits(src)
|
||||
if(href_list[VV_HK_MODIFY_TRAITS])
|
||||
usr.client.holder.modify_traits(src)
|
||||
return TRUE
|
||||
|
||||
/datum/proc/vv_get_header()
|
||||
|
||||
@@ -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]))
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
unique_enzymes = generate_unique_enzymes()
|
||||
uni_identity = generate_uni_identity()
|
||||
generate_dna_blocks()
|
||||
features = random_features(species?.id)
|
||||
features = random_features(species?.id, holder?.gender)
|
||||
|
||||
|
||||
/datum/dna/stored //subtype used by brain mob's stored_dna
|
||||
@@ -662,6 +662,6 @@
|
||||
var/danger = CONFIG_GET(number/threshold_body_size_slowdown)
|
||||
if(features["body_size"] < danger)
|
||||
var/slowdown = 1 + round(danger/features["body_size"], 0.1) * CONFIG_GET(number/body_size_slowdown_multiplier)
|
||||
holder.add_movespeed_modifier(MOVESPEED_ID_SMALL_STRIDE, TRUE, 100, NONE, TRUE, slowdown, ALL, FLOATING|CRAWLING)
|
||||
holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, slowdown)
|
||||
else if(old_size < danger)
|
||||
holder.remove_movespeed_modifier(MOVESPEED_ID_SMALL_STRIDE)
|
||||
holder.remove_movespeed_modifier(/datum/movespeed_modifier/small_stride)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/datum/element/firestacker/Attach(datum/target, amount)
|
||||
. = ..()
|
||||
|
||||
if(!ismovableatom(target))
|
||||
if(!ismovable(target))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
src.amount = amount
|
||||
|
||||
28
code/datums/elements/squish.dm
Normal file
28
code/datums/elements/squish.dm
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -116,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
|
||||
@@ -128,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
|
||||
|
||||
@@ -187,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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -63,7 +63,11 @@
|
||||
var/force_escaped = FALSE // Set by Into The Sunset command of the shuttle manipulator
|
||||
var/list/learned_recipes //List of learned recipe TYPES.
|
||||
|
||||
/// Our skill holder.
|
||||
var/datum/skill_holder/skill_holder
|
||||
|
||||
/datum/mind/New(var/key)
|
||||
skill_holder = new
|
||||
src.key = key
|
||||
soulOwner = src
|
||||
martial_art = default_martial_art
|
||||
|
||||
@@ -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>")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
16
code/datums/skills/_check_skills.dm
Normal file
16
code/datums/skills/_check_skills.dm
Normal file
@@ -0,0 +1,16 @@
|
||||
// yeah yeah verbs suck whatever I suck at this fix this someone please - kevinz000
|
||||
|
||||
/mob/verb/check_skills()
|
||||
set name = "Check Skills"
|
||||
set category = "IC"
|
||||
set desc = "Check your skills (if you have any..)"
|
||||
|
||||
if(!mind)
|
||||
to_chat(usr, "<span class='warning'>How do you check the skills of [(usr == src)? "yourself when you are" : "something"] without a mind?</span>")
|
||||
return
|
||||
if(!mind.skill_holder)
|
||||
to_chat(usr, "<span class='warning'>How do you check the skills of [(usr == src)? "yourself when you are" : "something"] without the capability for skills? (PROBABLY A BUG, PRESS F1.)</span>")
|
||||
return
|
||||
var/datum/browser/B = new(usr, "skilldisplay_[REF(src)]", "Skills of [src]")
|
||||
B.set_content(mind.skill_holder.html_readout())
|
||||
B.open()
|
||||
95
code/datums/skills/_skill.dm
Normal file
95
code/datums/skills/_skill.dm
Normal file
@@ -0,0 +1,95 @@
|
||||
GLOBAL_LIST_INIT(skill_datums, init_skill_datums())
|
||||
|
||||
/proc/init_skill_datums()
|
||||
. = list()
|
||||
for(var/path in subtypesof(/datum/skill))
|
||||
var/datum/skill/S = path
|
||||
if(initial(S.abstract_type) == path)
|
||||
continue
|
||||
S = new path
|
||||
.[S.type] = S
|
||||
|
||||
/proc/get_skill_datum(path)
|
||||
return GLOB.skill_datums[path]
|
||||
|
||||
/proc/sanitize_skill_value(path, value)
|
||||
var/datum/skill/S = get_skill_datum(path)
|
||||
// don't check, if we runtime let it happen.
|
||||
return S.sanitize_value(value)
|
||||
|
||||
/proc/is_skill_value_greater(path, existing, new_value)
|
||||
var/datum/skill/S = get_skill_datum(path)
|
||||
// don't check, if we runtime let it happen.
|
||||
return S.is_value_greater(existing, new_value)
|
||||
|
||||
/**
|
||||
* Skill datums
|
||||
*/
|
||||
/datum/skill
|
||||
/// Our name
|
||||
var/name
|
||||
/// Our description
|
||||
var/desc
|
||||
/// Our progression type
|
||||
var/progression_type
|
||||
/// Abstract type
|
||||
var/abstract_type = /datum/skill
|
||||
|
||||
/**
|
||||
* Ensures what someone's setting as a value for this skill is valid.
|
||||
*/
|
||||
/datum/skill/proc/sanitize_value(new_value)
|
||||
return new_value
|
||||
|
||||
/**
|
||||
* Checks if a value is greater
|
||||
*/
|
||||
/datum/skill/proc/is_value_greater(existing, new_value)
|
||||
if(!existing)
|
||||
return TRUE
|
||||
return new_value > existing
|
||||
|
||||
/**
|
||||
* Standard value "render"
|
||||
*/
|
||||
/datum/skill/proc/standard_render_value(value)
|
||||
return value
|
||||
|
||||
// Just saying, the choice to use different sub-parent-types is to force coders to resolve issues as I won't be implementing custom procs to grab skill levels in a certain context.
|
||||
// Aka: So people don't forget to change checks if they change a skill's progression type.
|
||||
|
||||
/datum/skill/binary
|
||||
abstract_type = /datum/skill/binary
|
||||
progression_type = SKILL_PROGRESSION_BINARY
|
||||
|
||||
/datum/skill/binary/sanitize_value(new_value)
|
||||
return new_value? TRUE : FALSE
|
||||
|
||||
/datum/skill/binary/standard_render_value(value)
|
||||
return value? "Yes" : "No"
|
||||
|
||||
/datum/skill/numerical
|
||||
abstract_type = /datum/skill/numerical
|
||||
progression_type = SKILL_PROGRESSION_NUMERICAL
|
||||
/// Max value of this skill
|
||||
var/max_value = 100
|
||||
/// Min value of this skill
|
||||
var/min_value = 0
|
||||
/// Display as a percent in standard_render_value?
|
||||
var/display_as_percent = FALSE
|
||||
|
||||
/datum/skill/numerical/sanitize_value(new_value)
|
||||
return clamp(new_value, min_value, max_value)
|
||||
|
||||
/datum/skill/numerical/standard_render_value(value)
|
||||
return display_as_percent? "[round(value/max_value/100, 0.01)]%" : "[value] / [max_value]"
|
||||
|
||||
/datum/skill/enum
|
||||
abstract_type = /datum/skill/enum
|
||||
progression_type = SKILL_PROGRESSION_ENUM
|
||||
/// Valid values for the skill
|
||||
var/list/valid_values = list()
|
||||
|
||||
/datum/skill/enum/sanitize_value(new_value)
|
||||
if(new_value in valid_values)
|
||||
return new_value
|
||||
78
code/datums/skills/_skill_holder.dm
Normal file
78
code/datums/skills/_skill_holder.dm
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Skill holder datums
|
||||
*/
|
||||
/datum/skill_holder
|
||||
/// Our list of skills and values. Lazylist. Associative. Keys are datum typepaths to the skill.
|
||||
var/list/skills
|
||||
/// Same as [skills] but affinities, which are multiplied to increase amount when gaining skills.
|
||||
var/list/skill_affinities
|
||||
|
||||
/**
|
||||
* Grabs the value of a skill.
|
||||
*/
|
||||
/datum/skill_holder/proc/get_skill_value(skill)
|
||||
if(!ispath(skill))
|
||||
CRASH("Invalid get_skill_value call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
|
||||
if(!skills)
|
||||
return null
|
||||
return skills[skill]
|
||||
|
||||
/**
|
||||
* Grabs our affinity for a skill. !!This is a multiplier!!
|
||||
*/
|
||||
/datum/skill_holder/proc/get_skill_affinity(skill)
|
||||
if(!ispath(skill))
|
||||
CRASH("Invalid get_skill_affinity call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
|
||||
if(!skills)
|
||||
return 1
|
||||
var/affinity = skill_affinities[skill]
|
||||
if(isnull(affinity))
|
||||
return 1
|
||||
return affinity
|
||||
|
||||
/**
|
||||
* Sets the value of a skill.
|
||||
*/
|
||||
/datum/skill_holder/proc/set_skill_value(skill, value)
|
||||
if(!ispath(skill))
|
||||
CRASH("Invalid set_skill_value call. Use typepaths.") //until a time when we somehow need text ids for dynamic skills, I'm enforcing this.
|
||||
LAZYINITLIST(skills)
|
||||
value = sanitize_skill_value(skill, value)
|
||||
if(!isnull(value))
|
||||
skills[skill] = value
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Boosts a skill to a value if not aobve
|
||||
*/
|
||||
/datum/skill_holder/proc/boost_skill_value_to(skill, value)
|
||||
var/current = get_skill_value(skill)
|
||||
if(!is_skill_value_greater(skill, current, value))
|
||||
return FALSE
|
||||
set_skill_value(skill, value)
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
* Automatic skill increase, multiplied by skill affinity if existing.
|
||||
* Only works if skill is numerical.
|
||||
*/
|
||||
/datum/skill_holder/proc/auto_gain_experience(skill, value)
|
||||
if(!ispath(skill, /datum/skill/numerical))
|
||||
CRASH("You cannot auto increment a non numerical skill!")
|
||||
var/current = get_skill_value(skill)
|
||||
var/affinity = get_skill_affinity(skill)
|
||||
boost_skill_value_to(skill, current + (value * affinity))
|
||||
|
||||
/**
|
||||
* Generates a HTML readout of our skills.
|
||||
* Port to tgui-next when?
|
||||
*/
|
||||
/datum/skill_holder/proc/html_readout()
|
||||
var/list/out = list("<center><h1>Skills</h1></center><hr>")
|
||||
out += "<table style=\"width:100%\"><tr><th><b>Skill</b><th><b>Value</b></tr>"
|
||||
for(var/path in skills)
|
||||
var/datum/skill/S = GLOB.skill_datums[path]
|
||||
out += "<tr><td>[S.name]</td><td>[S.standard_render_value(skills[path])]</td></tr>"
|
||||
out += "</table>"
|
||||
return out.Join("")
|
||||
3
code/datums/skills/medical.dm
Normal file
3
code/datums/skills/medical.dm
Normal file
@@ -0,0 +1,3 @@
|
||||
/datum/skill/numerical/surgery
|
||||
name = "Surgery"
|
||||
desc = "How proficient you are at doing surgery."
|
||||
@@ -120,12 +120,12 @@
|
||||
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
|
||||
. = ..()
|
||||
ADD_TRAIT(owner, TRAIT_MUTE, "mesmerize")
|
||||
owner.add_movespeed_modifier("[STATUS_EFFECT_MESMERIZE]_[id]", TRUE, priority = 64, override = TRUE, multiplicative_slowdown = 5, blacklisted_movetypes = FALSE? NONE : CRAWLING)
|
||||
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
|
||||
|
||||
/datum/status_effect/mesmerize/on_remove()
|
||||
. = ..()
|
||||
REMOVE_TRAIT(owner, TRAIT_MUTE, "mesmerize")
|
||||
owner.remove_movespeed_modifier("[STATUS_EFFECT_MESMERIZE]_[id]")
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/mesmerize)
|
||||
|
||||
/datum/status_effect/mesmerize/on_creation(mob/living/new_owner, set_duration)
|
||||
if(isnum(set_duration))
|
||||
@@ -141,9 +141,7 @@
|
||||
/datum/status_effect/electrode
|
||||
id = "tased"
|
||||
alert_type = null
|
||||
var/slowdown = 1.5
|
||||
var/slowdown_priority = 50 //to make sure the stronger effect overrides
|
||||
var/affect_crawl = FALSE
|
||||
var/movespeed_mod = /datum/movespeed_modifier/status_effect/tased
|
||||
var/nextmove_modifier = 1
|
||||
var/stamdmg_per_ds = 0 //a 20 duration would do 20 stamdmg, disablers do 24 or something
|
||||
var/last_tick = 0 //fastprocess processing speed is a goddamn sham, don't trust it.
|
||||
@@ -155,12 +153,12 @@
|
||||
last_tick = world.time
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
C.add_movespeed_modifier("[MOVESPEED_ID_TASED_STATUS]_[id]", TRUE, priority = slowdown_priority, override = TRUE, multiplicative_slowdown = slowdown, blacklisted_movetypes = affect_crawl? NONE : CRAWLING)
|
||||
C.add_movespeed_modifier(movespeed_mod)
|
||||
|
||||
/datum/status_effect/electrode/on_remove()
|
||||
if(iscarbon(owner))
|
||||
var/mob/living/carbon/C = owner
|
||||
C.remove_movespeed_modifier("[MOVESPEED_ID_TASED_STATUS]_[id]")
|
||||
C.remove_movespeed_modifier(movespeed_mod)
|
||||
. = ..()
|
||||
|
||||
/datum/status_effect/electrode/tick()
|
||||
@@ -178,8 +176,7 @@
|
||||
|
||||
/datum/status_effect/electrode/no_combat_mode
|
||||
id = "tased_strong"
|
||||
slowdown = 8
|
||||
slowdown_priority = 100
|
||||
movespeed_mod = /datum/movespeed_modifier/status_effect/tased/no_combat_mode
|
||||
nextmove_modifier = 2
|
||||
blocks_combatmode = TRUE
|
||||
stamdmg_per_ds = 1
|
||||
@@ -336,7 +333,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 +591,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>", \
|
||||
@@ -650,11 +647,11 @@
|
||||
if(isnum(set_duration))
|
||||
duration = set_duration
|
||||
. = ..()
|
||||
owner.add_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF, multiplicative_slowdown = 1, movetypes = GROUND)
|
||||
owner.add_movespeed_modifier(/datum/movespeed_modifier/status_effect/electrostaff)
|
||||
|
||||
/datum/status_effect/electrostaff/on_remove()
|
||||
. = ..()
|
||||
owner.remove_movespeed_modifier(MOVESPEED_ID_ELECTROSTAFF)
|
||||
owner.remove_movespeed_modifier(/datum/movespeed_modifier/status_effect/electrostaff)
|
||||
|
||||
//GOLEM GANG
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/datum/wires/autoylathe
|
||||
holder_type = /obj/machinery/autoylathe
|
||||
proper_name = "Autoylathe"
|
||||
|
||||
/datum/wires/autoylathe/New(atom/holder)
|
||||
wires = list(
|
||||
WIRE_HACK, WIRE_DISABLE,
|
||||
WIRE_SHOCK, WIRE_ZAP
|
||||
)
|
||||
add_duds(6)
|
||||
..()
|
||||
|
||||
/datum/wires/autoylathe/interactable(mob/user)
|
||||
var/obj/machinery/autoylathe/A = holder
|
||||
if(A.panel_open)
|
||||
return TRUE
|
||||
|
||||
/datum/wires/autoylathe/get_status()
|
||||
var/obj/machinery/autoylathe/A = holder
|
||||
var/list/status = list()
|
||||
status += "The red light is [A.disabled ? "on" : "off"]."
|
||||
status += "The blue light is [A.hacked ? "on" : "off"]."
|
||||
return status
|
||||
|
||||
/datum/wires/autoylathe/on_pulse(wire)
|
||||
var/obj/machinery/autoylathe/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
A.adjust_hacked(!A.hacked)
|
||||
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
|
||||
if(WIRE_SHOCK)
|
||||
A.shocked = !A.shocked
|
||||
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
|
||||
if(WIRE_DISABLE)
|
||||
A.disabled = !A.disabled
|
||||
addtimer(CALLBACK(A, /obj/machinery/autoylathe.proc/reset, wire), 60)
|
||||
|
||||
/datum/wires/autoylathe/on_cut(wire, mend)
|
||||
var/obj/machinery/autoylathe/A = holder
|
||||
switch(wire)
|
||||
if(WIRE_HACK)
|
||||
A.adjust_hacked(!mend)
|
||||
if(WIRE_HACK)
|
||||
A.shocked = !mend
|
||||
if(WIRE_DISABLE)
|
||||
A.disabled = !mend
|
||||
if(WIRE_ZAP)
|
||||
A.shock(usr, 50)
|
||||
@@ -169,7 +169,7 @@
|
||||
.["real_mode"] = SSticker.mode.name
|
||||
// Key-authed callers may know the truth behind the "secret"
|
||||
|
||||
.["security_level"] = get_security_level()
|
||||
.["security_level"] = NUM2SECLEVEL(GLOB.security_level)
|
||||
.["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0
|
||||
// Amount of world's ticks in seconds, useful for calculating round duration
|
||||
|
||||
|
||||
Reference in New Issue
Block a user