mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Merge branch 'master' of https://github.com/tgstation/-tg-station into many_hands_make_light_work
This commit is contained in:
@@ -38,7 +38,7 @@ LINEN BINS
|
||||
|
||||
/obj/item/weapon/bedsheet/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/weapon/wirecutters) || I.is_sharp())
|
||||
var/obj/item/stack/sheet/cloth/C = new (loc, 3)
|
||||
var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3)
|
||||
transfer_fingerprints_to(C)
|
||||
C.add_fingerprint(user)
|
||||
qdel(src)
|
||||
|
||||
@@ -27,13 +27,17 @@
|
||||
if ("small")
|
||||
new /obj/item/weapon/tank/internals/emergency_oxygen(src)
|
||||
new /obj/item/weapon/tank/internals/emergency_oxygen(src)
|
||||
new /obj/item/clothing/mask/breath(src)
|
||||
new /obj/item/clothing/mask/breath(src)
|
||||
|
||||
if ("aid")
|
||||
new /obj/item/weapon/tank/internals/emergency_oxygen(src)
|
||||
new /obj/item/weapon/storage/firstaid/o2(src)
|
||||
new /obj/item/clothing/mask/breath(src)
|
||||
|
||||
if ("tank")
|
||||
new /obj/item/weapon/tank/internals/air(src)
|
||||
new /obj/item/clothing/mask/breath(src)
|
||||
|
||||
if ("both")
|
||||
new /obj/item/weapon/tank/internals/emergency_oxygen(src)
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/obj/structure/destructible //a base for destructible structures
|
||||
var/max_health = 100
|
||||
var/health = 100
|
||||
var/takes_damage = TRUE //If the structure can be damaged
|
||||
var/break_message = "<span class='warning'>The strange, admin-y structure breaks!</span>" //The message shown when a structure breaks
|
||||
var/break_sound = 'sound/magic/clockwork/invoke_general.ogg' //The sound played when a structure breaks
|
||||
var/list/debris = null //Parts left behind when a structure breaks, takes the form of list(path = amount_to_spawn)
|
||||
|
||||
/obj/structure/destructible/proc/take_damage(amount, damage_type)
|
||||
var/static/list/physical_damage_types = list(BRUTE = TRUE, BURN = TRUE)
|
||||
if(!takes_damage || !amount || !damage_type || !physical_damage_types[damage_type])
|
||||
return 0
|
||||
health = max(0, health - amount)
|
||||
if(!health)
|
||||
destroyed()
|
||||
return amount
|
||||
|
||||
/obj/structure/destructible/proc/destroyed()
|
||||
if(!takes_damage)
|
||||
return 0
|
||||
if(islist(debris))
|
||||
for(var/I in debris)
|
||||
for(var/i in 1 to debris[I])
|
||||
new I (get_turf(src))
|
||||
visible_message(break_message)
|
||||
playsound(src, break_sound, 50, 1)
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
/obj/structure/destructible/burn()
|
||||
SSobj.burning -= src
|
||||
if(takes_damage)
|
||||
playsound(src, 'sound/items/Welder.ogg', 100, 1)
|
||||
visible_message("<span class='warning'>[src] is warped by the heat!</span>")
|
||||
take_damage(rand(50, 100), BURN)
|
||||
|
||||
/obj/structure/destructible/ex_act(severity)
|
||||
var/damage = 0
|
||||
switch(severity)
|
||||
if(1)
|
||||
damage = max_health //100% max health lost
|
||||
if(2)
|
||||
damage = max_health * (0.01 * rand(50, 70)) //50-70% max health lost
|
||||
if(3)
|
||||
damage = max_health * (0.01 * rand(10, 30)) //10-30% max health lost
|
||||
if(damage)
|
||||
take_damage(damage, BRUTE)
|
||||
|
||||
/obj/structure/destructible/bullet_act(obj/item/projectile/P)
|
||||
. = ..()
|
||||
visible_message("<span class='danger'>[src] is hit by \a [P]!</span>")
|
||||
playsound(src, P.hitsound, 50, 1)
|
||||
take_damage(P.damage, P.damage_type)
|
||||
|
||||
/obj/structure/destructible/proc/attack_generic(mob/user, damage = 0, damage_type = BRUTE) //used by attack_alien, attack_animal, and attack_slime
|
||||
user.do_attack_animation(src)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
user.visible_message("<span class='danger'>[user] smashes into [src]!</span>")
|
||||
take_damage(damage, damage_type)
|
||||
|
||||
/obj/structure/destructible/attack_alien(mob/living/user)
|
||||
playsound(src, 'sound/weapons/bladeslice.ogg', 50, 1)
|
||||
attack_generic(user, 15)
|
||||
|
||||
/obj/structure/destructible/attack_animal(mob/living/simple_animal/M)
|
||||
if(!M.melee_damage_upper && !M.obj_damage)
|
||||
return
|
||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
if(M.obj_damage)
|
||||
attack_generic(M, M.obj_damage, M.melee_damage_type)
|
||||
else
|
||||
attack_generic(M, M.melee_damage_upper, M.melee_damage_type)
|
||||
|
||||
/obj/structure/destructible/attack_slime(mob/living/simple_animal/slime/user)
|
||||
if(!user.is_adult)
|
||||
return
|
||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
attack_generic(user, rand(10, 15))
|
||||
|
||||
/obj/structure/destructible/attacked_by(obj/item/I, mob/living/user)
|
||||
. = ..()
|
||||
var/turf/T = get_turf(src)
|
||||
if(take_damage(I.force, I.damtype))
|
||||
playsound(T, I.hitsound, 50, 1)
|
||||
|
||||
/obj/structure/destructible/mech_melee_attack(obj/mecha/M)
|
||||
if(..())
|
||||
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
|
||||
take_damage(M.force, M.damtype)
|
||||
@@ -23,7 +23,9 @@
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] fells [src] with the [W].</span>","<span class='notice'>You fell [src] with the [W].</span>", "You hear the sound of a tree falling.")
|
||||
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0)
|
||||
icon = 'icons/obj/flora/pinetrees.dmi'
|
||||
icon_state = "tree_stump"
|
||||
pixel_x = -16
|
||||
name += " stump"
|
||||
cut = TRUE
|
||||
for(var/i=1 to log_amount)
|
||||
@@ -56,6 +58,15 @@
|
||||
icon = 'icons/obj/flora/deadtrees.dmi'
|
||||
icon_state = "tree_1"
|
||||
|
||||
/obj/structure/flora/tree/palm
|
||||
icon = 'icons/misc/beach2.dmi'
|
||||
icon_state = "palm1"
|
||||
|
||||
/obj/structure/flora/tree/palm/New()
|
||||
..()
|
||||
icon_state = pick("palm1","palm2")
|
||||
pixel_x = 0
|
||||
|
||||
/obj/structure/festivus
|
||||
name = "festivus pole"
|
||||
icon = 'icons/obj/flora/pinetrees.dmi'
|
||||
|
||||
@@ -35,8 +35,7 @@
|
||||
user << "<span class='warning'>You need one plasteel sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [P] to [src]...</span>"
|
||||
if(do_after(user, 50, target = src))
|
||||
P.use(1)
|
||||
if(do_after(user, 50, target = src) && P.use(1))
|
||||
new /obj/structure/table/reinforced(src.loc)
|
||||
qdel(src)
|
||||
else if(istype(I, /obj/item/stack/sheet/metal))
|
||||
@@ -45,8 +44,7 @@
|
||||
user << "<span class='warning'>You need one metal sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [M] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src))
|
||||
M.use(1)
|
||||
if(do_after(user, 20, target = src) && M.use(1))
|
||||
new /obj/structure/table(src.loc)
|
||||
qdel(src)
|
||||
else if(istype(I, /obj/item/stack/sheet/glass))
|
||||
@@ -55,9 +53,7 @@
|
||||
user << "<span class='warning'>You need one glass sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [G] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src))
|
||||
G.use(1)
|
||||
|
||||
if(do_after(user, 20, target = src) && G.use(1))
|
||||
new /obj/structure/table/glass(src.loc)
|
||||
qdel(src)
|
||||
else if(istype(I, /obj/item/stack/sheet/mineral/silver))
|
||||
@@ -66,10 +62,18 @@
|
||||
user << "<span class='warning'>You need one silver sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [S] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src))
|
||||
S.use(1)
|
||||
if(do_after(user, 20, target = src) && S.use(1))
|
||||
new /obj/structure/table/optable(src.loc)
|
||||
qdel(src)
|
||||
else if(istype(I, /obj/item/stack/tile/carpet))
|
||||
var/obj/item/stack/tile/carpet/C = I
|
||||
if(C.get_amount() < 1)
|
||||
user << "<span class='warning'>You need one carpet sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [C] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src) && C.use(1))
|
||||
new /obj/structure/table/wood/fancy(src.loc)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -101,8 +105,7 @@
|
||||
user << "<span class='warning'>You need one wood sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [W] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src))
|
||||
W.use(1)
|
||||
if(do_after(user, 20, target = src) && W.use(1))
|
||||
new /obj/structure/table/wood(src.loc)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -112,8 +115,7 @@
|
||||
user << "<span class='warning'>You need one carpet sheet to do this!</span>"
|
||||
return
|
||||
user << "<span class='notice'>You start adding [C] to [src]...</span>"
|
||||
if(do_after(user, 20, target = src))
|
||||
C.use(1)
|
||||
if(do_after(user, 20, target = src) && C.use(1))
|
||||
new /obj/structure/table/wood/poker(src.loc)
|
||||
qdel(src)
|
||||
else
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
check_break(M)
|
||||
|
||||
/obj/structure/table/glass/proc/check_break(mob/living/M)
|
||||
if(has_gravity(M) && M.mob_size > MOB_SIZE_SMALL)
|
||||
if(M.has_gravity() && M.mob_size > MOB_SIZE_SMALL)
|
||||
table_shatter(M)
|
||||
|
||||
/obj/structure/table/glass/proc/table_shatter(mob/M)
|
||||
@@ -334,6 +334,24 @@
|
||||
/obj/structure/table/wood/poker/narsie_act()
|
||||
new /obj/structure/table/wood(src.loc)
|
||||
|
||||
/obj/structure/table/wood/fancy
|
||||
name = "fancy table"
|
||||
desc = "A standard metal table frame covered with an amazingly fancy, patterned cloth."
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
icon_state = "fancy_table"
|
||||
frame = /obj/structure/table_frame
|
||||
framestack = /obj/item/stack/rods
|
||||
buildstack = /obj/item/stack/tile/carpet
|
||||
canSmoothWith = list(/obj/structure/table/wood/fancy)
|
||||
|
||||
/obj/structure/table/wood/fancy/New()
|
||||
icon = 'icons/obj/smooth_structures/fancy_table.dmi' //so that the tables place correctly in the map editor
|
||||
..()
|
||||
|
||||
/obj/structure/table/wood/fancy/burn() //basically made out of metal
|
||||
new frame(loc)
|
||||
qdel(src)
|
||||
|
||||
/*
|
||||
* Reinforced tables
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user