mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-27 23:28:10 +01:00
What was supposed to be another straightforward major system overhaul that once again spiraled out of control (#8220)
* get_tool_quality has numerical meaning * Basic tools set tool quality * Toolspeed is replaced by tool quality checks * Addresses assorted results from live test * Extra cleanup
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
qdel(W)
|
||||
|
||||
if(8)
|
||||
if(W.is_screwdriver())
|
||||
if(W.get_tool_quality(TOOL_SCREWDRIVER))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
to_chat(user, "<span class='notice'>Now attaching the gun to the frame...</span>")
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return
|
||||
else if(O.is_screwdriver())
|
||||
else if(O.get_tool_quality(TOOL_SCREWDRIVER))
|
||||
if(!locked)
|
||||
open = !open
|
||||
to_chat(user, "<span class='notice'>Maintenance panel is now [open ? "opened" : "closed"].</span>")
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
qdel(W)
|
||||
|
||||
if(8)
|
||||
if(W.is_screwdriver())
|
||||
if(W.get_tool_quality(TOOL_SCREWDRIVER))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
to_chat(user, "<span class='notice'>Now attaching the gun to the frame...</span>")
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
qdel(W)
|
||||
|
||||
if(7)
|
||||
if(W.is_screwdriver())
|
||||
if(W.get_tool_quality(TOOL_SCREWDRIVER))
|
||||
playsound(src, W.usesound, 100, 1)
|
||||
var/turf/T = get_turf(user)
|
||||
to_chat(user, "<span class='notice'>Attatching the mop to the frame...</span>")
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
|
||||
src.searching = 0
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='blue'>\The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?</font>")
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
// to_chat(src.brainmob, "<b>Use say #b to speak to other artificial intelligences.</b>")
|
||||
src.brainmob.mind.assigned_role = "Synthetic Brain"
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='blue'>\The [src] chimes quietly.</font>")
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
to_chat(src.brainmob, "<b>Use say #b to speak to other artificial intelligences.</b>")
|
||||
src.brainmob.mind.assigned_role = "Positronic Brain"
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='blue'>The positronic brain beeps as it loads a personality.</font>")
|
||||
playsound(src, 'sound/misc/boobeebeep.ogg', 50, 1)
|
||||
@@ -80,7 +80,7 @@
|
||||
src.searching = 0
|
||||
icon_state = "posibrain"
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='blue'>The positronic brain buzzes and beeps, and the golden lights fade away. Perhaps you could try again?</font>")
|
||||
playsound(src, 'sound/misc/buzzbeep.ogg', 50, 1)
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
return 0
|
||||
|
||||
//Apply weapon damage
|
||||
var/weapon_sharp = is_sharp(I)
|
||||
var/weapon_edge = has_edge(I)
|
||||
var/weapon_sharp = I.sharp
|
||||
var/weapon_edge = I.edge
|
||||
var/hit_embed_chance = I.embed_chance
|
||||
if(prob(getarmor(hit_zone, "melee"))) //melee armour provides a chance to turn sharp/edge weapon attacks into blunt ones
|
||||
weapon_sharp = 0
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
amount *= M.incoming_damage_percent
|
||||
if(!isnull(M.incoming_brute_damage_percent))
|
||||
amount *= M.incoming_brute_damage_percent
|
||||
O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
O.take_damage(amount, 0, damage_source.sharp, damage_source.edge, damage_source)
|
||||
else
|
||||
for(var/datum/modifier/M in modifiers)
|
||||
if(!isnull(M.incoming_healing_percent))
|
||||
@@ -175,7 +175,7 @@
|
||||
amount *= M.incoming_damage_percent
|
||||
if(!isnull(M.incoming_fire_damage_percent))
|
||||
amount *= M.incoming_fire_damage_percent
|
||||
O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
O.take_damage(0, amount, damage_source.sharp, damage_source.edge, damage_source)
|
||||
else
|
||||
for(var/datum/modifier/M in modifiers)
|
||||
if(!isnull(M.incoming_healing_percent))
|
||||
|
||||
@@ -441,14 +441,13 @@ emp_act
|
||||
|
||||
var/armor = run_armor_check(affecting, "melee", O.armor_penetration, "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
|
||||
if(armor < 100)
|
||||
apply_damage(throw_damage, dtype, zone, armor, soaked, is_sharp(O), has_edge(O), O)
|
||||
apply_damage(throw_damage, dtype, zone, armor, soaked, O.sharp, O.edge, O)
|
||||
|
||||
|
||||
//thrown weapon embedded object code.
|
||||
if(dtype == BRUTE && istype(O,/obj/item))
|
||||
var/obj/item/I = O
|
||||
if (!is_robot_module(I))
|
||||
var/sharp = is_sharp(I)
|
||||
var/damage = throw_damage
|
||||
if (soaked)
|
||||
damage -= soaked
|
||||
@@ -456,12 +455,11 @@ emp_act
|
||||
damage /= armor+1
|
||||
|
||||
//blunt objects should really not be embedding in things unless a huge amount of force is involved
|
||||
var/embed_chance = sharp? damage/I.w_class : damage/(I.w_class*3)
|
||||
var/embed_threshold = sharp? 5*I.w_class : 15*I.w_class
|
||||
|
||||
var/embed_chance = I.sharp ? damage/I.w_class : damage/(I.w_class*3)
|
||||
var/embed_threshold = I.sharp ? 5*I.w_class : 15*I.w_class
|
||||
//Sharp objects will always embed if they do enough damage.
|
||||
//Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold
|
||||
if((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
|
||||
if((I.sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
|
||||
affecting.embed(I)
|
||||
|
||||
// Begin BS12 momentum-transfer code.
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
//Armor
|
||||
var/soaked = get_armor_soak(def_zone, P.check_armour, P.armor_penetration)
|
||||
var/absorb = run_armor_check(def_zone, P.check_armour, P.armor_penetration)
|
||||
var/proj_sharp = is_sharp(P)
|
||||
var/proj_edge = has_edge(P)
|
||||
var/proj_sharp = P.sharp
|
||||
var/proj_edge = P.edge
|
||||
|
||||
if ((proj_sharp || proj_edge) && (soaked >= round(P.damage*0.8)))
|
||||
proj_sharp = 0
|
||||
@@ -246,8 +246,8 @@
|
||||
if(!effective_force || blocked >= 100)
|
||||
return 0
|
||||
//Apply weapon damage
|
||||
var/weapon_sharp = is_sharp(I)
|
||||
var/weapon_edge = has_edge(I)
|
||||
var/weapon_sharp = I.sharp
|
||||
var/weapon_edge = I.edge
|
||||
|
||||
if(getsoak(hit_zone, "melee",) - (I.armor_penetration/5) > round(effective_force*0.8)) //soaking a hit turns sharp attacks into blunt ones
|
||||
weapon_sharp = 0
|
||||
@@ -282,7 +282,7 @@
|
||||
var/soaked = get_armor_soak(null, "melee")
|
||||
|
||||
|
||||
apply_damage(throw_damage, dtype, null, armor, soaked, is_sharp(O), has_edge(O), O)
|
||||
apply_damage(throw_damage, dtype, null, armor, soaked, O.sharp, O.edge, O)
|
||||
|
||||
O.throwing = 0 //it hit, so stop moving
|
||||
|
||||
|
||||
@@ -760,14 +760,14 @@ var/list/ai_verbs_default = list(
|
||||
var/obj/item/device/aicard/card = W
|
||||
card.grab_ai(src, user)
|
||||
|
||||
else if(W.is_wrench())
|
||||
else if(W.get_tool_quality(TOOL_WRENCH))
|
||||
if(user == deployed_shell)
|
||||
to_chat(user, "<span class='notice'>The shell's subsystems resist your efforts to tamper with your bolts.</span>")
|
||||
return
|
||||
if(anchored)
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
user.visible_message("<font color='blue'>\The [user] starts to unbolt \the [src] from the plating...</font>")
|
||||
if(!do_after(user,40 * W.toolspeed))
|
||||
if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
|
||||
user.visible_message("<font color='blue'>\The [user] decides not to unbolt \the [src].</font>")
|
||||
return
|
||||
user.visible_message("<font color='blue'>\The [user] finishes unfastening \the [src]!</font>")
|
||||
@@ -776,7 +776,7 @@ var/list/ai_verbs_default = list(
|
||||
else
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
user.visible_message("<font color='blue'>\The [user] starts to bolt \the [src] to the plating...</font>")
|
||||
if(!do_after(user,40 * W.toolspeed))
|
||||
if(!do_after(user,40 * W.get_tool_speed(TOOL_WRENCH)))
|
||||
user.visible_message("<font color='blue'>\The [user] decides not to bolt \the [src].</font>")
|
||||
return
|
||||
user.visible_message("<font color='blue'>\The [user] finishes fastening down \the [src]!</font>")
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
if(src.cable)
|
||||
if(get_dist(src, src.cable) > 1)
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='red'>The data cable rapidly retracts back into its spool.</font>", 3, "<font color='red'>You hear a click and the sound of wire spooling rapidly.</font>", 2)
|
||||
playsound(src, 'sound/machines/click.ogg', 50, 1)
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
src.silence_time = world.timeofday + 120 * 10 // Silence for 2 minutes
|
||||
to_chat(src, "<font color=green><b>Communication circuit overload. Shutting down and reloading communication circuits - speech and messaging functionality will be unavailable until the reboot is complete.</b></font>")
|
||||
if(prob(20))
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("<font color='red'>A shower of sparks spray from [src]'s inner workings.</font>", 3, "<font color='red'>You hear and smell the ozone hiss of electrical sparks being expelled violently.</font>", 2)
|
||||
return src.death(0)
|
||||
|
||||
@@ -178,7 +178,7 @@ var/list/mob_hat_cache = list()
|
||||
to_chat(user, "<span class='danger'>\The [src] is not compatible with \the [W].</span>")
|
||||
return
|
||||
|
||||
else if (W.is_crowbar())
|
||||
else if (W.get_tool_quality(TOOL_CROWBAR))
|
||||
to_chat(user, "<span class='danger'>\The [src] is hermetically sealed. You can't open the case.</span>")
|
||||
return
|
||||
|
||||
|
||||
@@ -540,7 +540,7 @@
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("<font color='red'>[user] has fixed some of the burnt wires on [src]!</font>"), 1)
|
||||
|
||||
else if (W.is_crowbar() && user.a_intent != I_HURT) // crowbar means open or close the cover
|
||||
else if (W.get_tool_quality(TOOL_CROWBAR) && user.a_intent != I_HURT) // crowbar means open or close the cover
|
||||
if(opened)
|
||||
if(cell)
|
||||
to_chat(user, "You close the cover.")
|
||||
@@ -617,26 +617,26 @@
|
||||
C.brute_damage = 0
|
||||
C.electronics_damage = 0
|
||||
|
||||
else if (W.is_wirecutter() || istype(W, /obj/item/device/multitool))
|
||||
else if (W.get_tool_quality(TOOL_WIRECUTTER) || W.get_tool_quality(TOOL_MULTITOOL))
|
||||
if (wiresexposed)
|
||||
wires.Interact(user)
|
||||
else
|
||||
to_chat(user, "You can't reach the wiring.")
|
||||
|
||||
else if(W.is_screwdriver() && opened && !cell) // haxing
|
||||
else if(W.get_tool_quality(TOOL_SCREWDRIVER) && opened && !cell) // haxing
|
||||
wiresexposed = !wiresexposed
|
||||
to_chat(user, "The wires have been [wiresexposed ? "exposed" : "unexposed"]")
|
||||
playsound(src, W.usesound, 50, 1)
|
||||
updateicon()
|
||||
|
||||
else if(W.is_screwdriver() && opened && cell) // radio
|
||||
else if(W.get_tool_quality(TOOL_SCREWDRIVER) && opened && cell) // radio
|
||||
if(radio)
|
||||
radio.attackby(W,user)//Push it to the radio to let it handle everything
|
||||
else
|
||||
to_chat(user, "Unable to locate a radio.")
|
||||
updateicon()
|
||||
|
||||
else if(W.is_wrench() && opened && !cell)
|
||||
else if(W.get_tool_quality(TOOL_WRENCH) && opened && !cell)
|
||||
if(bolt)
|
||||
to_chat(user,"You begin removing \the [bolt].")
|
||||
|
||||
|
||||
@@ -2,7 +2,4 @@
|
||||
gib_on_butchery = TRUE
|
||||
|
||||
/mob/living/simple_mob/can_butcher(var/mob/user, var/obj/item/I) // Override for special butchering checks.
|
||||
. = ..()
|
||||
|
||||
if(. && (!is_sharp(I) || !has_edge(I)))
|
||||
return FALSE
|
||||
return ..() && I.sharp && I.edge
|
||||
@@ -64,7 +64,7 @@
|
||||
if(!(P.damage_type == BRUTE || P.damage_type == BURN))
|
||||
projectile_dam_type = BRUTE
|
||||
incoming_damage = round(incoming_damage / 4) //Damage from strange sources is converted to brute for physical projectiles, though severely decreased.
|
||||
apply_damage(incoming_damage, projectile_dam_type, null, armorcheck, soakedcheck, is_sharp(P), has_edge(P), P)
|
||||
apply_damage(incoming_damage, projectile_dam_type, null, armorcheck, soakedcheck, P.sharp, P.edge, P)
|
||||
return -1 //Doesn't reflect non-beams or non-energy projectiles. They just smack and drop with little to no effect.
|
||||
else
|
||||
visible_message("<span class='danger'>The [P.name] gets reflected by [src]'s shell!</span>", \
|
||||
@@ -74,7 +74,7 @@
|
||||
if(!(P.damage_type == BRUTE || P.damage_type == BURN))
|
||||
projectile_dam_type = BURN
|
||||
incoming_damage = round(incoming_damage / 4) //Damage from strange sources is converted to burn for energy-type projectiles, though severely decreased.
|
||||
apply_damage(incoming_damage, P.damage_type, null, armorcheck, soakedcheck, is_sharp(P), has_edge(P), P)
|
||||
apply_damage(incoming_damage, P.damage_type, null, armorcheck, soakedcheck, P.sharp, P.edge, P)
|
||||
|
||||
// Find a turf near or on the original location to bounce to
|
||||
if(P.starting)
|
||||
|
||||
Reference in New Issue
Block a user