Cleans up (mostly) defunt crit_fail var (#42908)

This commit is contained in:
ShizCalev
2019-03-01 13:45:30 +01:00
committed by AnturK
parent ae2da5aa2f
commit 05f2ac7317
20 changed files with 49 additions and 85 deletions
+2 -2
View File
@@ -41,7 +41,7 @@
/obj/machinery/flasher/power_change()
if (powered() && anchored && bulb)
stat &= ~NOPOWER
if(bulb.crit_fail)
if(bulb.burnt_out)
icon_state = "[base_state]1-p"
else
icon_state = "[base_state]1"
@@ -96,7 +96,7 @@
if (!powered() || !bulb)
return
if (bulb.crit_fail || (last_flash && world.time < src.last_flash + 150))
if (bulb.burnt_out || (last_flash && world.time < src.last_flash + 150))
return
if(!bulb.flash_recharge(30)) //Bulb can burn out if it's used too often too fast
@@ -51,9 +51,6 @@
to_chat(user, "<span class='warning'>You are unable to attach [src] to [M]!</span>")
return FALSE
/obj/item/mecha_parts/mecha_equipment/proc/critfail()
log_message("Critical failure", LOG_MECHA, color="red")
/obj/item/mecha_parts/mecha_equipment/proc/get_equip_info()
if(!chassis)
return
@@ -81,8 +78,6 @@
return 0
if(!equip_ready)
return 0
if(crit_fail)
return 0
if(energy_drain && !chassis.has_charge(energy_drain))
return 0
return 1
@@ -272,11 +272,6 @@
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/critfail()
..()
if(reagents)
DISABLE_BITFIELD(reagents.flags, NO_REACT)
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/can_attach(obj/mecha/medical/M)
if(..())
if(istype(M))
@@ -424,25 +424,6 @@
/obj/item/mecha_parts/mecha_equipment/generator/attackby(weapon,mob/user, params)
load_fuel(weapon)
/obj/item/mecha_parts/mecha_equipment/generator/critfail()
..()
var/turf/open/T = get_turf(src)
if(!istype(T))
return
var/datum/gas_mixture/GM = new
GM.add_gas(/datum/gas/plasma)
if(prob(10))
GM.gases[/datum/gas/plasma][MOLES] += 100
GM.temperature = 1500+T0C //should be enough to start a fire
T.visible_message("[src] suddenly disgorges a cloud of heated plasma.")
qdel(src)
else
GM.gases[/datum/gas/plasma][MOLES] += 5
GM.temperature = istype(T) ? T.air.return_temperature() : T20C
T.visible_message("[src] suddenly disgorges a cloud of plasma.")
T.assume_air(GM)
return
/obj/item/mecha_parts/mecha_equipment/generator/process()
if(!chassis)
STOP_PROCESSING(SSobj, src)
@@ -482,9 +463,6 @@
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/generator_init()
fuel = new /obj/item/stack/sheet/mineral/uranium(src, 0)
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/critfail()
return
/obj/item/mecha_parts/mecha_equipment/generator/nuclear/process()
if(..())
radiation_pulse(get_turf(src), rad_per_cycle)
-1
View File
@@ -103,7 +103,6 @@
data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mech.obj_integrity, "maxhealth" = recharge_port.recharging_mech.max_integrity, "cell" = null)
if(recharge_port.recharging_mech.cell && !QDELETED(recharge_port.recharging_mech.cell))
data["recharge_port"]["mech"]["cell"] = list(
"critfail" = recharge_port.recharging_mech.cell.crit_fail,
"charge" = recharge_port.recharging_mech.cell.charge,
"maxcharge" = recharge_port.recharging_mech.cell.maxcharge
)
+4 -4
View File
@@ -136,7 +136,7 @@
/obj/item/shield/riot/flash/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
. = ..()
if (. && !embedded_flash.crit_fail)
if (. && !embedded_flash.burnt_out)
embedded_flash.activate()
update_icon()
@@ -144,13 +144,13 @@
/obj/item/shield/riot/flash/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/assembly/flash/handheld))
var/obj/item/assembly/flash/handheld/flash = W
if(flash.crit_fail)
if(flash.burnt_out)
to_chat(user, "No sense replacing it with a broken bulb.")
return
else
to_chat(user, "You begin to replace the bulb.")
if(do_after(user, 20, target = user))
if(flash.crit_fail || !flash || QDELETED(flash))
if(flash.burnt_out || !flash || QDELETED(flash))
return
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
qdel(embedded_flash)
@@ -166,7 +166,7 @@
update_icon()
/obj/item/shield/riot/flash/update_icon()
if(!embedded_flash || embedded_flash.crit_fail)
if(!embedded_flash || embedded_flash.burnt_out)
icon_state = "riot"
item_state = "riot"
else
-1
View File
@@ -1,6 +1,5 @@
/obj
var/crit_fail = FALSE
animate_movement = 2
var/obj_flags = CAN_BE_HIT
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
@@ -137,7 +137,7 @@
if (!flash)
to_chat(admin, "<span class='danger'>Repairing flash failed!</span>")
else
flash.crit_fail = 0
flash.burnt_out = FALSE
flash.update_icon()
/datum/antagonist/rev/head/proc/admin_demote(datum/mind/target,mob/user)
+7 -7
View File
@@ -9,21 +9,21 @@
throwforce = 0
w_class = WEIGHT_CLASS_TINY
materials = list(MAT_METAL = 300, MAT_GLASS = 300)
crit_fail = FALSE //Is the flash burnt out?
light_color = LIGHT_COLOR_WHITE
light_power = FLASH_LIGHT_POWER
var/flashing_overlay = "flash-f"
var/times_used = 0 //Number of times it's been used.
var/burnt_out = FALSE //Is the flash burnt out?
var/burnout_resistance = 0
var/last_used = 0 //last world.time it was used.
var/cooldown = 0
var/last_trigger = 0 //Last time it was successfully triggered.
/obj/item/assembly/flash/suicide_act(mob/living/user)
if (crit_fail)
if(burnt_out)
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but it's burnt out!</span>")
return SHAME
else if (user.eye_blind)
else if(user.eye_blind)
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but [user.p_theyre()] blind!</span>")
return SHAME
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -33,7 +33,7 @@
/obj/item/assembly/flash/update_icon(flash = FALSE)
cut_overlays()
attached_overlays = list()
if(crit_fail)
if(burnt_out)
add_overlay("flashburnt")
attached_overlays += "flashburnt"
if(flash)
@@ -50,8 +50,8 @@
return TRUE
/obj/item/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
if(!crit_fail)
crit_fail = TRUE
if(!burnt_out)
burnt_out = TRUE
update_icon()
if(ismob(loc))
var/mob/M = loc
@@ -93,7 +93,7 @@
return typecache_filter_list(target_loc.GetAllContents(), GLOB.typecache_living)
/obj/item/assembly/flash/proc/try_use_flash(mob/user = null)
if(crit_fail || (world.time < last_trigger + cooldown))
if(burnt_out || (world.time < last_trigger + cooldown))
return FALSE
last_trigger = world.time
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
@@ -146,7 +146,7 @@
if(istype(I, /obj/item/assembly/flash))
var/obj/item/assembly/flash/F = I
F.times_used = 0
F.crit_fail = 0
F.burnt_out = FALSE
F.update_icon()
else if(istype(I, /obj/item/melee/baton))
var/obj/item/melee/baton/B = I
@@ -846,7 +846,7 @@ Pass a positive integer as an argument to override a bot's default speed.
return INITIALIZE_HINT_QDEL
/mob/living/simple_animal/bot/proc/topic_denied(mob/user) //Access check proc for bot topics! Remember to place in a bot's individual Topic if desired.
if(!user.canUseTopic(src))
if(!user.canUseTopic(src, !issilicon(user)))
return TRUE
// 0 for access, 1 for denied.
if(emagged == 2) //An emagged bot cannot be controlled by humans, silicons can if one hacked it.
@@ -99,6 +99,7 @@
ammo_x_offset = 1
ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/disabler)
selfcharge = 1
var/reactor_overloaded
var/fail_tick = 0
var/fail_chance = 0
@@ -123,7 +124,7 @@
if(201 to INFINITY)
SSobj.processing.Remove(src)
M.rad_act(80)
crit_fail = 1
reactor_overloaded = TRUE
to_chat(M, "<span class='userdanger'>Your [name]'s reactor overloads!</span>")
/obj/item/gun/energy/e_gun/nuclear/emp_act(severity)
@@ -134,7 +135,7 @@
/obj/item/gun/energy/e_gun/nuclear/update_icon()
..()
if(crit_fail)
if(reactor_overloaded)
add_overlay("[icon_state]_fail_3")
else
switch(fail_tick)
@@ -250,7 +250,7 @@
if(flash1 && flash2)
to_chat(user, "<span class='warning'>You have already inserted the eyes!</span>")
return
else if(F.crit_fail)
else if(F.burnt_out)
to_chat(user, "<span class='warning'>You can't use a broken flash!</span>")
return
else
+3 -3
View File
@@ -121,7 +121,7 @@
playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1)
/obj/item/organ/cyberimp/arm/ui_action_click()
if(crit_fail || (!holder && !contents.len))
if(broken_cyber_organ || (!holder && !contents.len))
to_chat(owner, "<span class='warning'>The implant doesn't respond. It seems to be broken...</span>")
return
@@ -145,7 +145,7 @@
. = ..()
if(. & EMP_PROTECT_SELF)
return
if(prob(30/severity) && owner && !crit_fail)
if(prob(30/severity) && owner && !broken_cyber_organ)
Retract()
owner.visible_message("<span class='danger'>A loud bang comes from [owner]\'s [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm!</span>")
playsound(get_turf(owner), 'sound/weapons/flashbang.ogg', 100, 1)
@@ -153,7 +153,7 @@
owner.adjust_fire_stacks(20)
owner.IgniteMob()
owner.adjustFireLoss(25)
crit_fail = 1
broken_cyber_organ = TRUE
/obj/item/organ/cyberimp/arm/gun/laser
@@ -144,7 +144,7 @@
/obj/item/organ/cyberimp/chest/thrusters/proc/toggle(silent = FALSE)
if(!on)
if(crit_fail)
if(broken_cyber_organ)
if(!silent)
to_chat(owner, "<span class='warning'>Your thrusters set seems to be broken!</span>")
return 0
@@ -128,7 +128,7 @@
))
/obj/item/organ/cyberimp/brain/anti_stun/proc/on_signal()
if(crit_fail || working)
if(broken_cyber_organ || working)
return
working = TRUE
if(owner.AmountStun() > stun_cap_amount)
@@ -143,13 +143,13 @@
/obj/item/organ/cyberimp/brain/anti_stun/emp_act(severity)
. = ..()
if(crit_fail || . & EMP_PROTECT_SELF)
if(broken_cyber_organ || . & EMP_PROTECT_SELF)
return
crit_fail = TRUE
broken_cyber_organ = TRUE
addtimer(CALLBACK(src, .proc/reboot), 90 / severity)
/obj/item/organ/cyberimp/brain/anti_stun/proc/reboot()
crit_fail = FALSE
broken_cyber_organ = FALSE
//[[[[MOUTH]]]]
/obj/item/organ/cyberimp/mouth
@@ -5,6 +5,7 @@
var/status = ORGAN_ORGANIC
w_class = WEIGHT_CLASS_SMALL
throwforce = 0
var/broken_cyber_organ = TRUE //if the organ stopped working.
var/zone = BODY_ZONE_CHEST
var/slot
// DO NOT add slots with matching names to different zones - it will break internal_organs_slot list!
@@ -56,7 +57,7 @@
/obj/item/organ/examine(mob/user)
..()
if(status == ORGAN_ROBOTIC && crit_fail)
if(status == ORGAN_ROBOTIC && broken_cyber_organ)
to_chat(user, "<span class='warning'>[src] seems to be broken!</span>")
+1 -1
View File
File diff suppressed because one or more lines are too long
+13 -13
View File
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
component.exports = {
data: {
mechChargeState(charge) {
let maxcharge = this.get('data.recharge_port.mech.cell.maxcharge')
let maxcharge = this.get('data.recharge_port.mech.cell.maxcharge')
if(charge >= (maxcharge/1.5)) return 'good'
else if(charge >= (maxcharge/3)) return 'average'
else return 'bad'
@@ -21,16 +21,12 @@
{{#if data.recharge_port}}
{{#if data.recharge_port.mech}}
<ui-section label='Integrity'>
<ui-bar min='0' max='{{adata.recharge_port.mech.maxhealth}}' value='{{adata.recharge_port.mech.health}}'state='{{mechHealthState(adata.recharge_port.mech.health)}}'>{{Math.round(adata.recharge_port.mech.health)}}/{{adata.recharge_port.mech.maxhealth}}</ui-bar>
<ui-bar min='0' max='{{adata.recharge_port.mech.maxhealth}}' value='{{adata.recharge_port.mech.health}}'state='{{mechHealthState(adata.recharge_port.mech.health)}}'>{{Math.round(adata.recharge_port.mech.health)}}/{{adata.recharge_port.mech.maxhealth}}</ui-bar>
</ui-section>
{{#if data.recharge_port.mech.cell}}
{{#if data.recharge_port.mech.cell.critfail}}
<ui-section label='Power'><span class='bad'>Cell Critical Failure</span></ui-section>
{{else}}
<ui-section label='Power'>
<ui-bar min='0' max='{{adata.recharge_port.mech.cell.maxcharge}}' value='{{adata.recharge_port.mech.cell.charge}}'state='{{mechChargeState(adata.recharge_port.mech.cell.charge)}}'>{{Math.round(adata.recharge_port.mech.cell.charge)}}/{{Math.round(adata.recharge_port.mech.cell.maxcharge)}}</ui-bar>
</ui-section>
{{/if}}
<ui-section label='Power'>
<ui-bar min='0' max='{{adata.recharge_port.mech.cell.maxcharge}}' value='{{adata.recharge_port.mech.cell.charge}}'state='{{mechChargeState(adata.recharge_port.mech.cell.charge)}}'>{{Math.round(adata.recharge_port.mech.cell.charge)}}/{{Math.round(adata.recharge_port.mech.cell.maxcharge)}}</ui-bar>
</ui-section>
{{else}}
<ui-section label='Power'><span class='bad'>Cell Missing</span></ui-section>
{{/if}}