Mass replace

This commit is contained in:
Tigercat2000
2016-07-07 19:34:02 -07:00
parent dc408f090d
commit 71e5344a98
870 changed files with 7679 additions and 7679 deletions
+18 -18
View File
@@ -11,16 +11,16 @@
var/heal_burn = 0
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
if (!istype(M))
if(!istype(M))
to_chat(user, "<span class='danger'>\The [src] cannot be applied to [M]!</span>")
return 1
if (!user.IsAdvancedToolUser())
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='danger'>You don't have the dexterity to do this!</span>")
return 1
if (istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
@@ -57,7 +57,7 @@
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
@@ -66,13 +66,13 @@
to_chat(user, "\red The wounds on [M]'s [affecting.name] have already been bandaged.")
return 1
else
for (var/datum/wound/W in affecting.wounds)
if (W.internal)
for(var/datum/wound/W in affecting.wounds)
if(W.internal)
continue
if (W.current_stage <= W.max_bleeding_stage)
if(W.current_stage <= W.max_bleeding_stage)
user.visible_message( "\blue [user] bandages \the [W.desc] on [M]'s [affecting.name].", \
"\blue You bandage \the [W.desc] on [M]'s [affecting.name]." )
else if (istype(W,/datum/wound/bruise))
else if(istype(W,/datum/wound/bruise))
user.visible_message( "\blue [user] places a bruise patch over \the [W.desc] on [M]'s [affecting.name].", \
"\blue You place a bruise patch over \the [W.desc] on [M]'s [affecting.name]." )
else
@@ -98,7 +98,7 @@
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
@@ -144,7 +144,7 @@
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
@@ -156,20 +156,20 @@
to_chat(user, "\red The wounds on [M]'s [affecting.name] have already been treated.")
return 1
else
for (var/datum/wound/W in affecting.wounds)
if (W.internal)
for(var/datum/wound/W in affecting.wounds)
if(W.internal)
continue
if (W.current_stage <= W.max_bleeding_stage)
if(W.current_stage <= W.max_bleeding_stage)
user.visible_message( "\blue [user] cleans \the [W.desc] on [M]'s [affecting.name] and seals the edges with bioglue.", \
"\blue You clean and seal \the [W.desc] on [M]'s [affecting.name]." )
//H.add_side_effect("Itch")
else if (istype(W,/datum/wound/bruise))
else if(istype(W,/datum/wound/bruise))
user.visible_message( "\blue [user] places a medicine patch over \the [W.desc] on [M]'s [affecting.name].", \
"\blue You place a medicine patch over \the [W.desc] on [M]'s [affecting.name]." )
else
user.visible_message( "\blue [user] smears some bioglue over [W.desc] on [M]'s [affecting.name].", \
"\blue You smear some bioglue over [W.desc] on [M]'s [affecting.name]." )
if (bandaged)
if(bandaged)
affecting.heal_damage(heal_brute,0)
use(1)
else
@@ -188,7 +188,7 @@
if(..())
return 1
if (istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
@@ -232,7 +232,7 @@
affecting.status &= ~ORGAN_SPLINTED
to_chat(user, "<span class='notice'>You remove the splint from [M]'s [limb].")
return
if (M != user)
if(M != user)
user.visible_message("\red [user] starts to apply \the [src] to [M]'s [limb].", "\red You start to apply \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
else
if((!user.hand && affecting.limb_name in list("r_arm", "r_hand")) || (user.hand && affecting.limb_name in list("l_arm", "l_hand")))
@@ -240,7 +240,7 @@
return
user.visible_message("\red [user] starts to apply \the [src] to their [limb].", "\red You start to apply \the [src] to your [limb].", "\red You hear something being wrapped.")
if(do_after(user, 50, target = M))
if (M != user)
if(M != user)
user.visible_message("\red [user] finishes applying \the [src] to [M]'s [limb].", "\red You finish applying \the [src] to [M]'s [limb].", "\red You hear something being wrapped.")
else
if(prob(25))
+5 -5
View File
@@ -9,11 +9,11 @@
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob)
if (!istype(M) || !istype(user))
if(!istype(M) || !istype(user))
return 0
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
if(istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
var/mob/living/silicon/robot/R = M
if (R.getBruteLoss() || R.getFireLoss() )
if(R.getBruteLoss() || R.getFireLoss() )
R.adjustBruteLoss(-15)
R.adjustFireLoss(-15)
R.updatehealth()
@@ -23,11 +23,11 @@
else
to_chat(user, "<span class='notice'>All [R]'s systems are nominal.</span>")
if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs
if(istype(M,/mob/living/carbon/human)) //Repairing robolimbs
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
if (S && (S.status & ORGAN_ROBOT))
if(S && (S.status & ORGAN_ROBOT))
if(S.get_damage())
S.heal_damage(15, 15, robo_repair = 1)
H.updatehealth()
+5 -5
View File
@@ -31,7 +31,7 @@
icon_state = "rods"
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob, params)
if (istype(W, /obj/item/weapon/weldingtool))
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(get_amount() < 2)
@@ -51,7 +51,7 @@
var/replace = user.get_inactive_hand() == src
use(2)
if (get_amount() <= 0 && replace)
if(get_amount() <= 0 && replace)
user.unEquip(src, 1)
if(new_item)
user.put_in_hands(new_item)
@@ -64,9 +64,9 @@
if(!istype(user.loc,/turf)) return 0
if (locate(/obj/structure/grille, usr.loc))
if(locate(/obj/structure/grille, usr.loc))
for(var/obj/structure/grille/G in usr.loc)
if (G.destroyed)
if(G.destroyed)
G.health = 10
G.density = 1
G.destroyed = 0
@@ -80,7 +80,7 @@
return
to_chat(usr, "\blue Assembling grille...")
if (!do_after(usr, 10, target = user))
if(!do_after(usr, 10, target = user))
return
var /obj/structure/grille/F = new /obj/structure/grille/ ( usr.loc )
@@ -50,7 +50,7 @@
src = null
var/replace = (user.get_inactive_hand()==G)
G.use(1)
if (!G && !RG && replace)
if(!G && !RG && replace)
user.put_in_hands(RG)
else
return ..()
@@ -70,7 +70,7 @@
var/list/directions = new/list(cardinal)
var/i = 0
for (var/obj/structure/window/win in user.loc)
for(var/obj/structure/window/win in user.loc)
i++
if(i >= 4)
to_chat(user, "<span class='danger'>There are too many windows in this location.</span>")
@@ -173,7 +173,7 @@
if(src.loc != user) return 1
var/list/directions = new/list(cardinal)
var/i = 0
for (var/obj/structure/window/win in user.loc)
for(var/obj/structure/window/win in user.loc)
i++
if(i >= 4)
to_chat(user, "<span class='danger'>There are too many windows in this location.</span>")
@@ -282,7 +282,7 @@
src = null
var/replace = (user.get_inactive_hand()==G)
G.use(1)
if (!G && !RG && replace)
if(!G && !RG && replace)
user.put_in_hands(RG)
else
return ..()
@@ -301,7 +301,7 @@
if(src.loc != user) return 1
var/list/directions = new/list(cardinal)
var/i = 0
for (var/obj/structure/window/win in user.loc)
for(var/obj/structure/window/win in user.loc)
i++
if(i >= 4)
to_chat(user, "<span class='danger'>There are too many windows in this location.</span>")
@@ -373,7 +373,7 @@
if(src.loc != user) return 1
var/list/directions = new/list(cardinal)
var/i = 0
for (var/obj/structure/window/win in user.loc)
for(var/obj/structure/window/win in user.loc)
i++
if(i >= 4)
to_chat(user, "<span class='danger'>There are too many windows in this location.</span>")
@@ -15,11 +15,11 @@
// item/attackby() properly, making this unnecessary
/*/obj/item/stack/sheet/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if (istype(W, /obj/item/weapon/storage/bag/sheetsnatcher))
if(istype(W, /obj/item/weapon/storage/bag/sheetsnatcher))
var/obj/item/weapon/storage/bag/sheetsnatcher/S = W
if(!S.mode)
S.add(src,user)
else
for (var/obj/item/stack/sheet/stack in locate(src.x,src.y,src.z))
for(var/obj/item/stack/sheet/stack in locate(src.x,src.y,src.z))
S.add(stack,user)
..()*/
+49 -49
View File
@@ -17,12 +17,12 @@
/obj/item/stack/New(var/loc, var/amount=null)
..()
if (amount!=null) //Allow for stacks with the amount=0
if(amount!=null) //Allow for stacks with the amount=0
src.amount=amount
return
/obj/item/stack/Destroy()
if (usr && usr.machine==src)
if(usr && usr.machine==src)
usr << browse(null, "window=stack")
return ..()
@@ -35,62 +35,62 @@
list_recipes(user)
/obj/item/stack/proc/list_recipes(mob/user as mob, recipes_sublist)
if (!recipes)
if(!recipes)
return
if (!src || amount<=0)
if(!src || amount<=0)
user << browse(null, "window=stack")
user.set_machine(src) //for correct work of onclose
var/list/recipe_list = recipes
if (recipes_sublist && recipe_list[recipes_sublist] && istype(recipe_list[recipes_sublist], /datum/stack_recipe_list))
if(recipes_sublist && recipe_list[recipes_sublist] && istype(recipe_list[recipes_sublist], /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = recipe_list[recipes_sublist]
recipe_list = srl.recipes
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
for(var/i=1;i<=recipe_list.len,i++)
var/E = recipe_list[i]
if (isnull(E))
if(isnull(E))
t1 += "<hr>"
continue
if (i>1 && !isnull(recipe_list[i-1]))
if(i>1 && !isnull(recipe_list[i-1]))
t1+="<br>"
if (istype(E, /datum/stack_recipe_list))
if(istype(E, /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = E
if (src.amount >= srl.req_amount)
if(src.amount >= srl.req_amount)
t1 += "<a href='?src=\ref[src];sublist=[i]'>[srl.title] ([srl.req_amount] [src.singular_name]\s)</a>"
else
t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)<br>"
if (istype(E, /datum/stack_recipe))
if(istype(E, /datum/stack_recipe))
var/datum/stack_recipe/R = E
var/max_multiplier = round(src.amount / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
/*
if (R.one_per_turf)
if(R.one_per_turf)
can_build = can_build && !(locate(R.result_type) in usr.loc)
if (R.on_floor)
if(R.on_floor)
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
*/
if (R.res_amount>1)
if(R.res_amount>1)
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
if (can_build)
if(can_build)
t1 += text("<A href='?src=\ref[src];sublist=[recipes_sublist];make=[i]'>[title]</A> ")
else
t1 += text("[]", title)
continue
if (R.max_res_amount>1 && max_multiplier>1)
if(R.max_res_amount>1 && max_multiplier>1)
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
t1 += " |"
var/list/multipliers = list(5,10,25)
for (var/n in multipliers)
if (max_multiplier>=n)
for(var/n in multipliers)
if(max_multiplier>=n)
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
if (!(max_multiplier in multipliers))
if(!(max_multiplier in multipliers))
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
t1 += "</TT></body></HTML>"
@@ -100,71 +100,71 @@
/obj/item/stack/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.get_active_hand() != src))
if((usr.restrained() || usr.stat || usr.get_active_hand() != src))
return
if (href_list["sublist"] && !href_list["make"])
if(href_list["sublist"] && !href_list["make"])
list_recipes(usr, text2num(href_list["sublist"]))
if (href_list["make"])
if (src.amount < 1) del(src) //Never should happen
if(href_list["make"])
if(src.amount < 1) del(src) //Never should happen
var/list/recipes_list = recipes
if (href_list["sublist"])
if(href_list["sublist"])
var/datum/stack_recipe_list/srl = recipes_list[text2num(href_list["sublist"])]
recipes_list = srl.recipes
var/datum/stack_recipe/R = recipes_list[text2num(href_list["make"])]
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
if (src.amount < R.req_amount*multiplier)
if (R.req_amount*multiplier>1)
if(!multiplier) multiplier = 1
if(src.amount < R.req_amount*multiplier)
if(R.req_amount*multiplier>1)
to_chat(usr, "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!")
else
to_chat(usr, "\red You haven't got enough [src] to build \the [R.title]!")
return
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
if(R.one_per_turf && (locate(R.result_type) in usr.loc))
to_chat(usr, "\red There is another [R.title] here!")
return
if (R.on_floor && !istype(usr.loc, /turf/simulated))
if(R.on_floor && !istype(usr.loc, /turf/simulated))
to_chat(usr, "\red \The [R.title] must be constructed on the floor!")
return
if (R.time)
if(R.time)
to_chat(usr, "\blue Building [R.title] ...")
if (!do_after(usr, R.time, target = usr))
if(!do_after(usr, R.time, target = usr))
return
if (src.amount < R.req_amount*multiplier)
if(src.amount < R.req_amount*multiplier)
return
var/atom/O = new R.result_type( usr.loc )
O.dir = usr.dir
if (R.max_res_amount>1)
if(R.max_res_amount>1)
var/obj/item/stack/new_item = O
new_item.amount = R.res_amount*multiplier
//new_item.add_to_stacks(usr)
src.amount-=R.req_amount*multiplier
if (src.amount < 1) // Just in case a stack's amount ends up fractional somehow
if(src.amount < 1) // Just in case a stack's amount ends up fractional somehow
var/oldsrc = src
src = null //dont kill proc after del()
usr.unEquip(oldsrc, 1)
del(oldsrc) // Not qdel, because qdel'd stacks act strange for cyborgs
if (istype(O,/obj/item))
if(istype(O,/obj/item))
usr.put_in_hands(O)
O.add_fingerprint(usr)
//BubbleWrap - so newly formed boxes are empty
if ( istype(O, /obj/item/weapon/storage) )
for (var/obj/item/I in O)
if( istype(O, /obj/item/weapon/storage) )
for(var/obj/item/I in O)
del(I)
//BubbleWrap END
if (src && usr.machine==src) //do not reopen closed window
if(src && usr.machine==src) //do not reopen closed window
spawn( 0 )
src.interact(usr)
return
return
/obj/item/stack/proc/use(var/used)
if (amount < used)
if(amount < used)
return 0
amount -= used
if (amount < 1) // Just in case a stack's amount ends up fractional somehow
if(amount < 1) // Just in case a stack's amount ends up fractional somehow
if(usr)
usr.unEquip(src, 1)
spawn()
@@ -175,12 +175,12 @@
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
var/obj/item/stack/oldsrc = src
src = null
for (var/obj/item/stack/item in usr.loc)
if (item==oldsrc)
for(var/obj/item/stack/item in usr.loc)
if(item==oldsrc)
continue
if (!istype(item, oldsrc.type))
if(!istype(item, oldsrc.type))
continue
if (item.amount>=item.max_amount)
if(item.amount>=item.max_amount)
continue
oldsrc.attackby(item, usr)
to_chat(usr, "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s.")
@@ -204,7 +204,7 @@
return F
/obj/item/stack/attack_hand(mob/user as mob)
if (user.get_inactive_hand() == src)
if(user.get_inactive_hand() == src)
var/obj/item/stack/F = split(user, 1)
user.put_in_hands(F)
if(src && usr.machine == src)
@@ -215,12 +215,12 @@
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob, params)
..()
if (istype(W, src.type))
if(istype(W, src.type))
var/obj/item/stack/S = W
if (S.amount >= max_amount)
if(S.amount >= max_amount)
return 1
var/to_transfer as num
if (user.get_inactive_hand()==src)
if(user.get_inactive_hand()==src)
var/desired = input("How much would you like to transfer from this stack?", "How much?", 1) as null|num
if(!desired)
return
@@ -229,10 +229,10 @@
else
to_transfer = min(src.amount, S.max_amount-S.amount)
S.amount+=to_transfer
if (S && usr.machine==S)
if(S && usr.machine==S)
spawn(0) S.interact(usr)
src.use(to_transfer)
if (src && usr.machine==src)
if(src && usr.machine==src)
spawn(0) src.interact(usr)
S.update_icon()
else return ..()