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
@@ -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)