mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] Planet time debug uncapping and broken weapon chat output (#9556)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
11d462cdb9
commit
1166e69eb4
@@ -98,34 +98,37 @@
|
||||
|
||||
/obj/item/broken_gun/proc/can_repair_with(obj/item/I, mob/user)
|
||||
for(var/path in material_needs)
|
||||
if(ispath(path) && istype(I, path))
|
||||
if(material_needs[path] > 0)
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, span_notice("You do not have enough [path] to continue repairs."))
|
||||
else
|
||||
return TRUE
|
||||
|
||||
if(!ispath(path) || !istype(I, path))
|
||||
continue
|
||||
if(material_needs[path] <= 0)
|
||||
continue
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
return TRUE
|
||||
else
|
||||
to_chat(user, span_notice("You do not have enough [I] to continue repairs."))
|
||||
else
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/broken_gun/proc/repair_with(obj/item/I, mob/user)
|
||||
for(var/path in material_needs)
|
||||
if(ispath(path) && istype(I, path))
|
||||
if(material_needs[path] > 0)
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
S.use(material_needs[path])
|
||||
material_needs[path] = 0
|
||||
to_chat(user, span_notice("You repair some damage on \the [src] with \the [S]."))
|
||||
else
|
||||
material_needs[path] = max(0, material_needs[path] - 1)
|
||||
user.drop_from_inventory(I)
|
||||
to_chat(user, span_notice("You repair some damage on \the [src] with \the [I]."))
|
||||
qdel(I)
|
||||
if(!ispath(path) || !istype(I, path))
|
||||
continue
|
||||
if(material_needs[path] <= 0)
|
||||
continue
|
||||
if(istype(I, /obj/item/stack))
|
||||
var/obj/item/stack/S = I
|
||||
if(S.can_use(material_needs[path]))
|
||||
S.use(material_needs[path])
|
||||
material_needs[path] = 0
|
||||
to_chat(user, span_notice("You repair some damage on \the [src] with \the [S]."))
|
||||
else
|
||||
material_needs[path] = max(0, material_needs[path] - 1)
|
||||
user.drop_from_inventory(I)
|
||||
to_chat(user, span_notice("You repair some damage on \the [src] with \the [I]."))
|
||||
qdel(I)
|
||||
|
||||
check_complete_repair(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user