mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Merge branch 'master' of https://github.com/tgstation/tgstation into multiplierspeed
This commit is contained in:
@@ -4,7 +4,6 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s
|
||||
name = "item"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
var/item_state = null
|
||||
var/lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
|
||||
var/righthand_file = 'icons/mob/inhands/items_righthand.dmi'
|
||||
|
||||
//Dimensions of the icon file used when this item is worn, eg: hats.dmi
|
||||
|
||||
@@ -89,8 +89,18 @@
|
||||
else
|
||||
user << "<span class='warning'>You need one sheet of glass to replace lights!</span>"
|
||||
|
||||
if(istype(W, /obj/item/weapon/shard))
|
||||
if(uses >= max_uses)
|
||||
user << "<span class='warning'>[src.name] is full.</span>"
|
||||
return
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
AddUses(round(increment*0.75))
|
||||
user << "<span class='notice'>You insert a shard of glass into the [src.name]. You have [uses] light\s remaining.</span>"
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/light))
|
||||
var/new_bulbs = 0
|
||||
var/obj/item/weapon/light/L = W
|
||||
if(L.status == 0) // LIGHT OKAY
|
||||
if(uses < max_uses)
|
||||
@@ -101,11 +111,9 @@
|
||||
else
|
||||
if(!user.unEquip(W))
|
||||
return
|
||||
new_bulbs += AddShards(1)
|
||||
user << "<span class='notice'>You insert the [L.name] into the [src.name]</span>"
|
||||
AddShards(1, user)
|
||||
qdel(L)
|
||||
if(new_bulbs != 0)
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
user << "<span class='notice'>You insert the [L.name] into the [src.name]. " + status_string() + "</span>"
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/storage))
|
||||
@@ -126,7 +134,7 @@
|
||||
|
||||
else if(L.status == LIGHT_BROKEN || L.status == LIGHT_BURNED)
|
||||
replaced_something = TRUE
|
||||
AddShards(1)
|
||||
AddShards(1, user)
|
||||
qdel(L)
|
||||
|
||||
if(!found_lightbulbs)
|
||||
@@ -146,7 +154,6 @@
|
||||
/obj/item/device/lightreplacer/attack_self(mob/user)
|
||||
user << status_string()
|
||||
|
||||
|
||||
/obj/item/device/lightreplacer/update_icon()
|
||||
icon_state = "lightreplacer[emagged]"
|
||||
|
||||
@@ -154,7 +161,6 @@
|
||||
return "It has [uses] light\s remaining (plus [bulb_shards] fragment\s)."
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Use(mob/user)
|
||||
|
||||
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
|
||||
AddUses(-1)
|
||||
return 1
|
||||
@@ -163,12 +169,15 @@
|
||||
/obj/item/device/lightreplacer/proc/AddUses(amount = 1)
|
||||
uses = Clamp(uses + amount, 0, max_uses)
|
||||
|
||||
/obj/item/device/lightreplacer/proc/AddShards(amount = 1)
|
||||
/obj/item/device/lightreplacer/proc/AddShards(amount = 1, user)
|
||||
bulb_shards += amount
|
||||
var/new_bulbs = round(bulb_shards / shards_required)
|
||||
if(new_bulbs > 0)
|
||||
AddUses(new_bulbs)
|
||||
bulb_shards = bulb_shards % shards_required
|
||||
if(new_bulbs != 0)
|
||||
user << "<span class='notice'>\The [src] has fabricated a new bulb from the broken glass it has stored. It now has [uses] uses.</span>"
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
return new_bulbs
|
||||
|
||||
/obj/item/device/lightreplacer/proc/Charge(var/mob/user)
|
||||
@@ -185,11 +194,7 @@
|
||||
U << "<span class='notice'>You replace the [target.fitting] with \the [src].</span>"
|
||||
|
||||
if(target.status != LIGHT_EMPTY)
|
||||
var/new_bulbs = AddShards(1)
|
||||
if(new_bulbs != 0)
|
||||
U << "<span class='notice'>\The [src] has fabricated a new bulb from the broken bulbs it has stored. It now has [uses] uses.</span>"
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
|
||||
AddShards(1, U)
|
||||
target.status = LIGHT_EMPTY
|
||||
target.update()
|
||||
|
||||
@@ -223,11 +228,8 @@
|
||||
name = initial(name)
|
||||
update_icon()
|
||||
|
||||
//Can you use it?
|
||||
|
||||
/obj/item/device/lightreplacer/proc/CanUse(mob/living/user)
|
||||
src.add_fingerprint(user)
|
||||
//Not sure what else to check for. Maybe if clumsy?
|
||||
if(uses > 0)
|
||||
return 1
|
||||
else
|
||||
|
||||
@@ -330,7 +330,9 @@
|
||||
|
||||
|
||||
/obj/item/weapon/shard/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
if(istype(I, /obj/item/device/lightreplacer))
|
||||
I.attackby(src, user)
|
||||
else if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = I
|
||||
if(WT.remove_fuel(0, user))
|
||||
var/obj/item/stack/sheet/glass/NG = new (user.loc)
|
||||
@@ -367,4 +369,4 @@
|
||||
H.visible_message("<span class='danger'>[H] slides on the broken glass!</span>", \
|
||||
"<span class='userdanger'>You slide on the broken glass!</span>")
|
||||
|
||||
cooldown = world.time
|
||||
cooldown = world.time
|
||||
|
||||
@@ -135,7 +135,6 @@
|
||||
icon = 'icons/obj/guns/projectile.dmi'
|
||||
icon_state = "revolver"
|
||||
item_state = "gun"
|
||||
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/obj/machinery/implantchair
|
||||
name = "mindshield implanter"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
icon = 'icons/obj/pneumaticCannon.dmi'
|
||||
icon_state = "pneumaticCannon"
|
||||
item_state = "bulldog"
|
||||
lefthand_file = 'icons/mob/inhands/guns_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/guns_righthand.dmi'
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 60, acid = 50)
|
||||
var/maxWeightClass = 20 //The max weight of items that can fit into the cannon
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/obj/item/weapon/storage/lockbox
|
||||
name = "lockbox"
|
||||
|
||||
@@ -367,10 +367,10 @@
|
||||
W.plane = initial(W.plane)
|
||||
W.loc = new_location
|
||||
|
||||
if(usr)
|
||||
orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
for(var/mob/M in can_see_contents())
|
||||
orient2hud(M)
|
||||
show_to(M)
|
||||
|
||||
if(W.maptext)
|
||||
W.maptext = ""
|
||||
W.on_exit_storage(src)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/* Tools!
|
||||
* Note: Multitools are /obj/item/device
|
||||
|
||||
@@ -1,44 +1,5 @@
|
||||
/obj/item/weapon
|
||||
|
||||
var/unique_rename = 0 //allows renaming with a pen
|
||||
|
||||
/obj/item/weapon/examine(mob/user)
|
||||
..()
|
||||
if(unique_rename)
|
||||
user << "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
|
||||
|
||||
/obj/item/weapon/attackby(obj/item/I, mob/user, params)
|
||||
if(unique_rename)
|
||||
if(istype(I, /obj/item/weapon/pen))
|
||||
var/penchoice = alert("What would you like to edit?", "Rename or change description?", "Rename", "Change description", "Cancel")
|
||||
if(!qdeleted(src) && user.canUseTopic(src, BE_CLOSE))
|
||||
if(penchoice == "Rename")
|
||||
rename_weapon(user)
|
||||
if(penchoice == "Change description")
|
||||
redesc_weapon(user)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/proc/rename_weapon(mob/M)
|
||||
var/oldname = name
|
||||
var/input = stripped_input(M,"What do you want to name /the [name]?", ,"", MAX_NAME_LEN)
|
||||
|
||||
if(!qdeleted(src) && M.canUseTopic(src, BE_CLOSE) && input != "")
|
||||
name = input
|
||||
M << "/The [oldname] has successfully been renamed to /the [input]."
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/weapon/proc/redesc_weapon(mob/M)
|
||||
var/input = stripped_input(M,"Describe your object here", ,"", 100)
|
||||
|
||||
if(!qdeleted(src) && M.canUseTopic(src, BE_CLOSE) && input != "")
|
||||
desc = input
|
||||
M << "You have successfully changed /the [name]'s description."
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/weapon/banhammer
|
||||
desc = "A banhammer"
|
||||
name = "banhammer"
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
var/persistence_replacement = null //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
|
||||
var/is_frozen = FALSE
|
||||
var/unique_rename = 0 // can you customize the description/name of the thing?
|
||||
|
||||
|
||||
/obj/New()
|
||||
@@ -187,3 +188,44 @@
|
||||
/obj/vv_get_dropdown()
|
||||
. = ..()
|
||||
.["Delete all of type"] = "?_src_=vars;delall=\ref[src]"
|
||||
|
||||
/obj/examine(mob/user)
|
||||
..()
|
||||
if(unique_rename)
|
||||
user << "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
|
||||
|
||||
/obj/attackby(obj/item/I, mob/user, params)
|
||||
if(unique_rename)
|
||||
if(istype(I, /obj/item/weapon/pen))
|
||||
var/penchoice = alert("What would you like to edit?", "Rename or change description?", "Rename", "Change description", "Cancel")
|
||||
if(!qdeleted(src) && user.canUseTopic(src, BE_CLOSE))
|
||||
if(penchoice == "Rename")
|
||||
rename_obj(user)
|
||||
if(penchoice == "Change description")
|
||||
redesc_obj(user)
|
||||
..()
|
||||
|
||||
/obj/proc/rename_obj(mob/M)
|
||||
var/input = stripped_input(M,"What do you want to name \the [name]?", ,"", MAX_NAME_LEN)
|
||||
var/oldname = name
|
||||
|
||||
if(!qdeleted(src) && M.canUseTopic(src, BE_CLOSE) && input != "")
|
||||
if(oldname == input)
|
||||
M << "You changed \the [name] to... well... \the [name]."
|
||||
return
|
||||
else
|
||||
name = input
|
||||
M << "\The [oldname] has been successfully been renamed to \the [input]."
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/proc/redesc_obj(mob/M)
|
||||
var/input = stripped_input(M,"Describe \the [name] here", ,"", 100)
|
||||
|
||||
if(!qdeleted(src) && M.canUseTopic(src, BE_CLOSE) && input != "")
|
||||
desc = input
|
||||
M << "You have successfully changed \the [name]'s description."
|
||||
return
|
||||
else
|
||||
return
|
||||
@@ -1,4 +1,4 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
|
||||
/datum/song
|
||||
var/name = "Untitled"
|
||||
|
||||
Reference in New Issue
Block a user