Merge branch 'master' into swordsandbow

This commit is contained in:
Greenjoe12345
2022-04-03 21:00:59 +01:00
committed by GitHub
194 changed files with 1273 additions and 1610 deletions
-4
View File
@@ -42,10 +42,6 @@
/atom/movable/proc/has_buckled_mobs()
return LAZYLEN(buckled_mobs)
/atom/movable/Destroy()
unbuckle_all_mobs()
return ..()
/atom/movable/proc/buckle_mob(mob/living/M, forced = FALSE, check_loc = TRUE)
if(check_loc && M.loc != loc)
@@ -12,9 +12,6 @@
create_reagents(500)
return
/obj/effect/vfx/smoke/chem/Destroy()
walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/effect/vfx/smoke/chem/transparent
opacity = FALSE
-112
View File
@@ -1,112 +0,0 @@
/obj/effect/decal/cleanable/chempuddle
name = "puddle"
icon = 'icons/effects/chempuddle.dmi'
icon_state = "puddle"
mouse_opacity = FALSE
/obj/effect/decal/cleanable/chempuddle/Initialize()
. = ..()
create_reagents(100)
addtimer(CALLBACK(src, .proc/evaporation_pulse), 10 SECONDS)
/obj/effect/decal/cleanable/chempuddle/Destroy()
var/turf/T = get_turf(src)
. = ..()
for(var/obj/effect/decal/cleanable/chempuddle/CP in range(1, T))
CP.update_icon(TRUE)
/obj/effect/decal/cleanable/chempuddle/proc/Spread(exclude=list())
if(!reagents) // Destroy ourselves if we are an empty husk somehow.
if(!QDELETED(src))
qdel(src)
return
if(reagents.total_volume < (25 * reagents.get_viscosity())) return
var/turf/simulated/S = get_turf(src)
if(!istype(S)) return
exclude |= S
var/list/possible_targets = list()
for(var/d in cardinal)
var/turf/simulated/target = get_step(src,d)
var/turf/simulated/origin = get_turf(src)
if(!(target in exclude))
if((target in origin.AdjacentTurfs()))
if(istype(target))
possible_targets |= target
if(LAZYLEN(possible_targets))
while(possible_targets.len)
var/turf/T = pick(possible_targets) // Don't always go NORTH, please. It's kind of weird.
var/obj/effect/decal/cleanable/chempuddle/other_puddle = locate() in T
if(!istype(other_puddle))
other_puddle = new(T)
reagents.trans_to_holder(other_puddle.reagents, (reagents.total_volume - (25 * reagents.get_viscosity())) * (1 / possible_targets.len))
possible_targets -= T
other_puddle.Spread(exclude)
if(reagents.total_volume)
for(var/datum/reagent/current in reagents.reagent_list)
current.touch_turf(S, current.volume / 4)
reagents.update_total()
update_icon()
/obj/effect/decal/cleanable/chempuddle/fire_act() // Boil bubble toil and trouble. This will "evaporate" chems, and allow some to do their more dangerous effects, IE Fuel.
. = ..()
Spread()
/obj/effect/decal/cleanable/chempuddle/Crossed(atom/movable/AM, oldloc)
Spread() // Splashing through puddles can disturb them enough to spread them.
. = ..()
if(reagents.total_volume)
reagents.touch(AM, max(min(3, reagents.total_volume),reagents.total_volume / 3))
/obj/effect/decal/cleanable/chempuddle/update_icon(var/recursion = FALSE)
var/list/cardinals = list(NORTH,SOUTH,EAST,WEST)
var/list/present_puddles = list()
for(var/dir in cardinals)
if(locate(/obj/effect/decal/cleanable/chempuddle) in get_step(src, dir))
present_puddles |= dir
if(LAZYLEN(present_puddles))
icon_state = initial(icon_state)
for(var/dir in present_puddles)
icon_state += "-[dir]"
if(!recursion)
for(var/obj/effect/decal/cleanable/chempuddle/CP in range(1, src))
CP.update_icon(TRUE)
color = reagents.get_color()
/obj/effect/decal/cleanable/chempuddle/proc/evaporation_pulse()
set waitfor = FALSE
var/turf/T = get_turf(src)
var/evaporation_rate = 1
if(istype(T, /turf/space))
evaporation_rate = 10
else if(T.outdoors)
evaporation_rate = 3
if(T.temperature > T0C + 10)
evaporation_rate *= 2
reagents.remove_any(evaporation_rate)
if(!reagents || reagents.total_volume <= 0)
qdel(src)
return
Spread()
addtimer(CALLBACK(src, .proc/evaporation_pulse), 10 SECONDS)
-1
View File
@@ -163,7 +163,6 @@
/obj/effect/spider/spiderling/Destroy()
STOP_PROCESSING(SSobj, src)
walk(src, 0) // Because we might have called walk_to, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/effect/spider/spiderling/Bump(atom/user)
+1 -1
View File
@@ -39,7 +39,7 @@
if(dist <= round(max_range + world.view - 2, 1))
M.playsound_local(epicenter, get_sfx("explosion"), 100, 1, frequency, falloff = 5) // get_sfx() is so that everyone gets the same sound
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, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5)
+2 -2
View File
@@ -276,9 +276,9 @@
/obj/item/proc/get_volume_by_throwforce_and_or_w_class() // This is used for figuring out how loud our sounds are for throwing.
if(throwforce && w_class)
return CLAMP((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
return clamp((throwforce + w_class) * 5, 30, 100)// Add the item's throwforce to its weight class and multiply by 5, then clamp the value between 30 and 100
else if(w_class)
return CLAMP(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
return clamp(w_class * 8, 20, 100) // Multiply the item's weight class by 8, then clamp the value between 20 and 100
else
return 0
@@ -41,7 +41,7 @@
/obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(user.get_active_hand() == src)
newtime = CLAMP(newtime, 10, 60000)
newtime = clamp(newtime, 10, 60000)
timer = newtime
to_chat(user, "Timer set for [timer] seconds.")
@@ -93,10 +93,6 @@
else if(M.ear_damage >= 5)
to_chat(M, "<span class='danger'>Your ears start to ring!</span>")
/obj/item/weapon/grenade/flashbang/Destroy()
walk(src, 0) // Because we might have called walk_away, we must stop the walk loop or BYOND keeps an internal reference to us forever.
return ..()
/obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve
desc = "Use of this weapon may constiute a war crime in your area, consult your local Site Manager."
@@ -103,7 +103,7 @@
origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2)
var/uses = 10
/obj/item/weapon/card/emag/resolve_attackby(atom/A, mob/user, var/click_parameters)
/obj/item/weapon/card/emag/resolve_attackby(atom/A, mob/user, attack_modifier, click_parameters)
var/used_uses = A.emag_act(uses, user, src)
if(used_uses < 0)
return ..(A, user, click_parameters)
@@ -230,17 +230,48 @@ Protectiveness | Armor %
material_slowdown_modifier = 0
material_slowdown_multiplier = 0.5
/obj/item/clothing/accessory/material/custom //Not yet craftable, advanced version made with science!
/obj/item/clothing/accessory/material/advanced
name = "custom armor plate"
desc = "A composite plate of custom machined material, designed to fit into a plate carrier. Attaches to a plate carrier."
icon = 'icons/obj/clothing/modular_armor.dmi'
description_info = "This armoured plate has been custom machined out of a piece of material. It is backed by a shear-hardening gel layer, allowing the whole piece to flex and conform to the wearer's body shape. If it was made using strong materials it could be very protective."
icon_state = "armor_tactical"
body_parts_covered = UPPER_TORSO|LOWER_TORSO
body_parts_covered = UPPER_TORSO | LOWER_TORSO
slot = ACCESSORY_SLOT_ARMOR_C
material_armor_modifier = 1.2
material_slowdown_modifier = 0.5
material_slowdown_multiplier = 0.4
/obj/item/clothing/accessory/material/advanced/armguards
name = "arm guards"
desc = "A pair of arm pads reinforced with material. Attaches to a plate carrier."
icon = 'icons/obj/clothing/modular_armor.dmi'
icon_override = 'icons/mob/modular_armor.dmi'
icon_state = "armguards_material"
gender = PLURAL
body_parts_covered = ARMS
slot = ACCESSORY_SLOT_ARMOR_A
material_armor_modifier = 1.1
material_slowdown_modifier = 1
material_slowdown_multiplier = 0.4
/obj/item/clothing/accessory/material/advanced/legguards
name = "leg guards"
desc = "A pair of leg guards reinforced with material. Attaches to a plate carrier."
icon = 'icons/obj/clothing/modular_armor.dmi'
icon_override = 'icons/mob/modular_armor.dmi'
icon_state = "legguards_material"
gender = PLURAL
body_parts_covered = LEGS
slot = ACCESSORY_SLOT_ARMOR_L
material_armor_modifier = 1.1
material_slowdown_modifier = 1
material_slowdown_multiplier = 0.4
/obj/item/clothing/accessory/material/makeshift/armguards
name = "arm guards"
desc = "A pair of arm pads reinforced with material. Attaches to a plate carrier."
@@ -290,7 +321,7 @@ Protectiveness | Armor %
unbreakable = FALSE
name = "plate insert"
desc = "used to craft armor plates for a plate carrier. Trim with a welder for light armor or add a second for heavy armor"
/obj/item/weapon/material/armor_plating/attackby(var/obj/O, mob/user)
if(istype(O, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/S = O
@@ -1,224 +0,0 @@
/* Two-handed Weapons
* Contains:
* Twohanded
* Fireaxe
* Double-Bladed Energy Swords
*/
/*##################################################################
##################### TWO HANDED WEAPONS BE HERE~ -Agouri :3 ########
####################################################################*/
//Rewrote TwoHanded weapons stuff and put it all here. Just copypasta fireaxe to make new ones ~Carn
//This rewrite means we don't have two variables for EVERY item which are used only by a few weapons.
//It also tidies stuff up elsewhere.
/*
* Twohanded
*/
/obj/item/weapon/material/twohanded
w_class = 4
var/wielded = 0
var/force_wielded = 0
var/force_unwielded
var/wieldsound = null
var/unwieldsound = null
var/base_icon
var/base_name
var/unwielded_force_divisor = 0.25
/obj/item/weapon/material/twohanded/proc/unwield()
wielded = 0
force = force_unwielded
name = "[base_name]"
update_icon()
/obj/item/weapon/material/twohanded/proc/wield()
wielded = 1
force = force_wielded
name = "[base_name] (Wielded)"
update_icon()
/obj/item/weapon/material/twohanded/update_force()
base_name = name
if(sharp || edge)
force_wielded = material.get_edge_damage()
else
force_wielded = material.get_blunt_damage()
force_wielded = round(force_wielded*force_divisor)
force_unwielded = round(force_wielded*unwielded_force_divisor)
force = force_unwielded
throwforce = round(force*thrown_force_divisor)
//world << "[src] has unwielded force [force_unwielded], wielded force [force_wielded] and throwforce [throwforce] when made from default material [material.name]"
/obj/item/weapon/material/twohanded/Initialize()
. = ..()
update_icon()
/obj/item/weapon/material/twohanded/mob_can_equip(M as mob, slot)
//Cannot equip wielded items.
if(wielded)
M << "<span class='warning'>Unwield the [base_name] first!</span>"
return 0
return ..()
/obj/item/weapon/material/twohanded/dropped(mob/user as mob)
//handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
if(user)
var/obj/item/weapon/material/twohanded/O = user.get_inactive_hand()
if(istype(O))
O.unwield()
return unwield()
/obj/item/weapon/material/twohanded/update_icon()
icon_state = "[base_icon][wielded]"
item_state = icon_state
/obj/item/weapon/material/twohanded/pickup(mob/user)
unwield()
/obj/item/weapon/material/twohanded/attack_self(mob/user as mob)
..()
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(H.species.is_small)
user << "<span class='warning'>It's too heavy for you to wield fully.</span>"
return
else
return
if(wielded) //Trying to unwield it
unwield()
user << "<span class='notice'>You are now carrying the [name] with one hand.</span>"
if (src.unwieldsound)
playsound(src.loc, unwieldsound, 50, 1)
var/obj/item/weapon/material/twohanded/offhand/O = user.get_inactive_hand()
if(O && istype(O))
O.unwield()
else //Trying to wield it
if(user.get_inactive_hand())
user << "<span class='warning'>You need your other hand to be empty</span>"
return
wield()
user << "<span class='notice'>You grab the [base_name] with both hands.</span>"
if (src.wieldsound)
playsound(src.loc, wieldsound, 50, 1)
var/obj/item/weapon/material/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
O.name = "[base_name] - offhand"
O.desc = "Your second grip on the [base_name]."
user.put_in_inactive_hand(O)
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/H = user
H.update_inv_l_hand()
H.update_inv_r_hand()
return
///////////OFFHAND///////////////
/obj/item/weapon/material/twohanded/offhand
w_class = 5
icon_state = "offhand"
name = "offhand"
default_material = "placeholder"
/obj/item/weapon/material/twohanded/offhand/unwield()
qdel(src)
/obj/item/weapon/material/twohanded/offhand/wield()
qdel(src)
/obj/item/weapon/material/twohanded/offhand/update_icon()
return
/*
* Fireaxe
*/
/obj/item/weapon/material/twohanded/fireaxe // DEM AXES MAN, marker -Agouri
icon_state = "fireaxe0"
base_icon = "fireaxe"
name = "fire axe"
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
unwielded_force_divisor = 0.25
force_divisor = 0.7 // 10/42 with hardness 60 (steel) and 0.25 unwielded divisor
sharp = 1
edge = 1
slot_flags = SLOT_BACK
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
applies_material_colour = 0
/obj/item/weapon/material/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return
..()
if(A && wielded)
if(istype(A,/obj/structure/window))
var/obj/structure/window/W = A
W.shatter()
/*
/*
* Double-Bladed Energy Swords - Cheridan
*/
// Not sure what to do with this one, it won't work nicely with the material system,
// but I don't want to copypaste all the twohanded procs..
/obj/item/weapon/material/twohanded/dualsaber
icon_state = "dualsaber0"
base_icon = "dualsaber"
name = "double-bladed energy sword"
desc = "Handle with care."
force = 3
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
force_wielded = 30
wieldsound = 'sound/weapons/saberon.ogg'
unwieldsound = 'sound/weapons/saberoff.ogg'
flags = NOSHIELD
origin_tech = "magnets=3;syndicate=4"
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharp = 1
edge = 1
applies_material_colour = 0
/obj/item/weapon/material/twohanded/dualsaber/attack(target as mob, mob/living/user as mob)
..()
if((CLUMSY in user.mutations) && (wielded) &&prob(40))
user << "\red You twirl around a bit before losing your balance and impaling yourself on the [src]."
user.take_organ_damage(20,25)
return
if((wielded) && prob(50))
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2))
user.set_dir(i)
sleep(1)
/obj/item/weapon/material/twohanded/dualsaber/IsShield()
if(wielded)
return 1
else
return 0
*/
//spears, bay edition
/obj/item/weapon/material/twohanded/spear
icon_state = "spearglass0"
base_icon = "spearglass"
name = "spear"
desc = "A haphazardly-constructed yet still deadly weapon of ancient design."
slot_flags = SLOT_BACK
force_wielded = 0.75 // 22 when wielded with hardness 15 (glass)
unwielded_force_divisor = 0.65 // 14 when unwielded based on above
thrown_force_divisor = 1.5 // 20 when thrown with weight 15 (glass)
throw_speed = 3
edge = 1
sharp = 1
flags = NOSHIELD
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
default_material = "glass"
@@ -494,7 +494,7 @@ var/list/global/tank_gauge_cache = list()
var/release_ratio = 0.002
if(tank_pressure)
release_ratio = CLAMP(sqrt(max(tank_pressure-env_pressure,0)/tank_pressure), 0.002, 1)
release_ratio = clamp(sqrt(max(tank_pressure-env_pressure,0)/tank_pressure), 0.002, 1)
var/datum/gas_mixture/leaked_gas = air_contents.remove_ratio(release_ratio)
//dynamic air release based on ambient pressure
@@ -145,11 +145,9 @@
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers) && get_dist(src,O) <= 1)
var/obj/structure/reagent_dispensers/tank = O
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1)
if(!welding && max_fuel)
O.reagents.trans_to_obj(src, max_fuel)
reagents.isolate_reagent("fuel")
to_chat(user, "<span class='notice'>Welder refueled</span>")
playsound(src, 'sound/effects/refill.ogg', 50, 1, -6)
return
@@ -157,11 +155,11 @@
to_chat(user, "<span class='notice'>[src] doesn't use fuel.</span>")
return
else
if(O.reagents.has_any_reagent(list("phoron","fuel","hydrophoron")))
message_admins("[key_name_admin(user)] ruptured a reagent tank with a welding tool, triggering an explosion.")
log_game("[key_name(user)] ruptured a reagent tank with a welding tool, triggering an explosion.")
to_chat(user, "<span class='danger'>You begin welding on the reagent tank and with a moment of lucidity you realize, this might not have been the smartest thing you've ever done.</span>")
tank.rupture()
message_admins("[key_name_admin(user)] triggered a fueltank explosion with a welding tool.")
log_game("[key_name(user)] triggered a fueltank explosion with a welding tool.")
to_chat(user, "<span class='danger'>You begin welding on the fueltank and with a moment of lucidity you realize, this might not have been the smartest thing you've ever done.</span>")
var/obj/structure/reagent_dispensers/fueltank/tank = O
tank.explode()
return
if (src.welding)
remove_fuel(1)
@@ -267,14 +267,7 @@
reagents.splash(O, 10)
/obj/machinery/shower/process()
// A drain for every shower! ..If, there's a liquid on its turf.
var/obj/effect/decal/cleanable/chempuddle/to_drain = locate() in get_turf(src)
if(to_drain)
if(!QDELETED(to_drain))
qdel(to_drain)
if(!on) return
for(var/thing in loc)
var/atom/movable/AM = thing
var/mob/living/L = thing