Merge remote-tracking branch 'upstream/master' into swarming-component

This commit is contained in:
Fox McCloud
2020-06-16 15:09:51 -04:00
83 changed files with 2060 additions and 1044 deletions
-19
View File
@@ -98,15 +98,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
var/icon_override = null //Used to override hardcoded clothing dmis in human clothing proc.
var/sprite_sheets_obj = null //Used to override hardcoded clothing inventory object dmis in human clothing proc.
var/trip_verb = TV_TRIP
var/trip_chance = 0
var/trip_stun = 0
var/trip_weaken = 0
var/trip_any = FALSE
var/trip_walksafe = TRUE
var/trip_tiles = 0
//Tooltip vars
var/in_inventory = FALSE //is this item equipped into an inventory slot or hand of a mob?
var/tip_timer = 0
@@ -606,16 +597,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect
/obj/item/proc/is_equivalent(obj/item/I)
return I == src
/obj/item/Crossed(atom/movable/AM, oldloc)
. = ..()
if(prob(trip_chance) && ishuman(AM))
var/mob/living/carbon/human/H = AM
on_trip(H)
/obj/item/proc/on_trip(mob/living/carbon/human/H)
if(H.slip(src, trip_stun, trip_weaken, trip_tiles, trip_walksafe, trip_any, trip_verb))
return TRUE
/obj/item/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
return
+36 -9
View File
@@ -1023,6 +1023,18 @@ obj/item/toy/cards/deck/syndicate/black
name = "orange fox plushie"
icon_state = "orangefox"
/obj/item/toy/plushie/orange_fox/grump
name = "grumpy fox"
desc = "An ancient plushie that seems particularly grumpy."
/obj/item/toy/plushie/orange_fox/grump/ComponentInitialize()
. = ..()
var/static/list/grumps = list("Ahh, yes, you're so clever, var editing that.", "Really?", "If you make a runtime with var edits, it's your own damn fault.",
"Don't you dare post issues on the git when you don't even know how this works.", "Was that necessary?", "Ohhh, setting admin edited var must be your favorite pastime!",
"Oh, so you have time to var edit, but you don't have time to ban that greytider?", "Oh boy, is this another one of those 'events'?", "Seriously, just stop.", "You do realize this is incurring proc call overhead.",
"Congrats, you just left a reference with your dirty client and now that thing you edited will never garbage collect properly.", "Is it that time of day, again, for unecessary adminbus?")
AddComponent(/datum/component/edit_complainer, grumps)
/obj/item/toy/plushie/coffee_fox
name = "coffee fox plushie"
icon_state = "coffeefox"
@@ -1087,6 +1099,21 @@ obj/item/toy/cards/deck/syndicate/black
return
..()
/obj/item/toy/plushie/ipcplushie
name = "IPC plushie"
desc = "An adorable IPC plushie, straight from New Canaan. Arguably more durable than the real deal. Toaster functionality included."
icon_state = "plushie_ipc"
item_state = "plushie_ipc"
/obj/item/toy/plushie/ipcplushie/attackby(obj/item/B, mob/user, params)
if(istype(B, /obj/item/reagent_containers/food/snacks/breadslice))
new /obj/item/reagent_containers/food/snacks/toast(get_turf(loc))
to_chat(user, "<span class='notice'> You insert bread into the toaster. </span>")
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
qdel(B)
else
return ..()
//New generation TG plushies
/obj/item/toy/plushie/lizardplushie
@@ -1117,15 +1144,15 @@ obj/item/toy/cards/deck/syndicate/black
* Foam Armblade
*/
/obj/item/toy/foamblade
name = "foam armblade"
desc = "it says \"Sternside Changs #1 fan\" on it. "
icon = 'icons/obj/toy.dmi'
icon_state = "foamblade"
item_state = "arm_blade"
attack_verb = list("pricked", "absorbed", "gored")
w_class = WEIGHT_CLASS_SMALL
resistance_flags = FLAMMABLE
/obj/item/toy/foamblade
name = "foam armblade"
desc = "it says \"Sternside Changs #1 fan\" on it. "
icon = 'icons/obj/toy.dmi'
icon_state = "foamblade"
item_state = "arm_blade"
attack_verb = list("pricked", "absorbed", "gored")
w_class = WEIGHT_CLASS_SMALL
resistance_flags = FLAMMABLE
/*
* Toy/fake flash
@@ -13,22 +13,12 @@
/obj/item/grenade/clown_grenade/prime()
..()
playsound(src.loc, 'sound/items/bikehorn.ogg', 25, -3)
/*
for(var/turf/simulated/floor/T in view(affected_area, src.loc))
if(prob(75))
banana(T)
*/
var/i = 0
var/number = 0
for(var/direction in GLOB.alldirs)
for(i = 0; i < 2; i++)
number++
var/obj/item/grown/bananapeel/traitorpeel/peel = new /obj/item/grown/bananapeel/traitorpeel(get_turf(src.loc))
/* var/direction = pick(alldirs)
var/spaces = pick(1;150, 2)
var/a = 0
for(a = 0; a < spaces; a++)
step(peel,direction)*/
var/a = 1
if(number & 2)
for(a = 1; a <= 2; a++)
@@ -39,21 +29,17 @@
qdel(src)
return
/obj/item/grown/bananapeel/traitorpeel
trip_stun = 0
trip_weaken = 7
trip_tiles = 4
trip_walksafe = FALSE
trip_chance = 100
/obj/item/grown/bananapeel/traitorpeel/on_trip(mob/living/carbon/human/H)
/obj/item/grown/bananapeel/traitorpeel/New(newloc, obj/item/seeds/new_seed)
. = ..()
if(.)
to_chat(H, "<span class='warning'>Your feet feel like they're on fire!</span>")
H.take_overall_damage(0, rand(2,8))
H.take_organ_damage(2) // Was 5 -- TLE
// The reason this AddComponent is here and not in ComponentInitialize() is because if it's put there, it will be ran before the parent New proc for /grown types.
// And then be overriden by the generic component placed onto it by the `/datum/plant_gene/trait/slip`.
AddComponent(/datum/component/slippery, src, 0, 7, 100, 4, FALSE)
/obj/item/grown/bananapeel/traitorpeel/after_slip(mob/living/carbon/human/H)
to_chat(H, "<span class='warning'>Your feet feel like they're on fire!</span>")
H.take_overall_damage(0, rand(2,8))
H.take_organ_damage(2)
return ..()
/obj/item/grown/bananapeel/traitorpeel/throw_impact(atom/hit_atom)
var/burned = rand(1,3)
+3 -7
View File
@@ -11,15 +11,11 @@
throw_speed = 4
throw_range = 20
discrete = 1
trip_stun = 4
trip_weaken = 2
trip_chance = 100
trip_walksafe = FALSE
trip_verb = TV_SLIP
var/cleanspeed = 50 //slower than mop
/obj/item/soap/ComponentInitialize()
AddComponent(/datum/component/slippery, src, 4, 2, 100, 0, FALSE)
/obj/item/soap/afterattack(atom/target, mob/user, proximity)
if(!proximity) return
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
@@ -55,7 +55,7 @@
new /obj/item/radio/headset( src )
/obj/structure/closet/secure_closet/personal/attackby(obj/item/W, mob/user, params)
if(!istype(W, /obj/item/card/id))
if(opened || !istype(W, /obj/item/card/id))
return ..()
if(broken)
+86 -61
View File
@@ -1,3 +1,5 @@
#define MAX_TANK_STORAGE 10
/obj/structure/dispenser
name = "tank storage unit"
desc = "A simple yet bulky storage device for gas tanks. Has room for up to ten oxygen tanks, and ten plasma tanks."
@@ -5,29 +7,51 @@
icon_state = "dispenser"
density = 1
anchored = 1.0
var/oxygentanks = 10
var/plasmatanks = 10
var/list/oxytanks = list() //sorry for the similar var names
var/list/platanks = list()
var/starting_oxygen_tanks = MAX_TANK_STORAGE // The starting amount of oxygen tanks the dispenser gets when it's spawned
var/starting_plasma_tanks = MAX_TANK_STORAGE // Starting amount of plasma tanks
var/list/stored_oxygen_tanks = list() // List of currently stored oxygen tanks
var/list/stored_plasma_tanks = list() // And plasma tanks
/obj/structure/dispenser/oxygen
plasmatanks = 0
starting_plasma_tanks = 0
/obj/structure/dispenser/plasma
oxygentanks = 0
starting_oxygen_tanks = 0
/obj/structure/dispenser/New()
..()
initialize_tanks()
update_icon()
/obj/structure/dispenser/Destroy()
QDEL_LIST(stored_plasma_tanks)
QDEL_LIST(stored_oxygen_tanks)
return ..()
/obj/structure/dispenser/proc/initialize_tanks()
for(var/I in 1 to starting_plasma_tanks)
var/obj/item/tank/plasma/P = new(src)
stored_plasma_tanks.Add(P)
for(var/I in 1 to starting_oxygen_tanks)
var/obj/item/tank/oxygen/O = new(src)
stored_oxygen_tanks.Add(O)
/obj/structure/dispenser/update_icon()
overlays.Cut()
switch(oxygentanks)
if(1 to 3) overlays += "oxygen-[oxygentanks]"
if(4 to INFINITY) overlays += "oxygen-4"
switch(plasmatanks)
if(1 to 4) overlays += "plasma-[plasmatanks]"
if(5 to INFINITY) overlays += "plasma-5"
cut_overlays()
var/oxy_tank_amount = LAZYLEN(stored_oxygen_tanks)
switch(oxy_tank_amount)
if(1 to 3)
overlays += "oxygen-[oxy_tank_amount]"
if(4 to INFINITY)
overlays += "oxygen-4"
var/pla_tank_amount = LAZYLEN(stored_plasma_tanks)
switch(pla_tank_amount)
if(1 to 4)
overlays += "plasma-[pla_tank_amount]"
if(5 to INFINITY)
overlays += "plasma-5"
/obj/structure/dispenser/attack_hand(mob/user)
if(..())
@@ -38,7 +62,7 @@
/obj/structure/dispenser/attack_ghost(mob/user)
ui_interact(user)
/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, var/master_ui = null, var/datum/topic_state/state = GLOB.default_state)
/obj/structure/dispenser/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, master_ui = null, datum/topic_state/state = GLOB.default_state)
user.set_machine(src)
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
@@ -47,35 +71,19 @@
/obj/structure/dispenser/ui_data(user)
var/list/data = list()
data["o_tanks"] = oxygentanks
data["p_tanks"] = plasmatanks
data["o_tanks"] = LAZYLEN(stored_oxygen_tanks)
data["p_tanks"] = LAZYLEN(stored_plasma_tanks)
return data
/obj/structure/dispenser/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/tank/oxygen) || istype(I, /obj/item/tank/air) || istype(I, /obj/item/tank/anesthetic))
if(oxygentanks < 10)
user.drop_item()
I.forceMove(src)
oxytanks.Add(I)
oxygentanks++
update_icon()
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] is full.</span>")
SSnanoui.update_uis(src)
try_insert_tank(user, stored_oxygen_tanks, I)
return
if(istype(I, /obj/item/tank/plasma))
if(plasmatanks < 10)
user.drop_item()
I.forceMove(src)
platanks.Add(I)
plasmatanks++
update_icon()
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
else
to_chat(user, "<span class='notice'>[src] is full.</span>")
SSnanoui.update_uis(src)
try_insert_tank(user, stored_plasma_tanks, I)
return
if(istype(I, /obj/item/wrench))
if(anchored)
to_chat(user, "<span class='notice'>You lean down and unwrench [src].</span>")
@@ -88,40 +96,55 @@
/obj/structure/dispenser/Topic(href, href_list)
if(..())
return 1
return TRUE
if(Adjacent(usr))
usr.set_machine(src)
// The oxygen tank button
if(href_list["oxygen"])
if(oxygentanks > 0)
var/obj/item/tank/oxygen/O
if(oxytanks.len == oxygentanks)
O = oxytanks[1]
oxytanks.Remove(O)
else
O = new /obj/item/tank/oxygen(loc)
O.loc = loc
to_chat(usr, "<span class='notice'>You take [O] out of [src].</span>")
oxygentanks--
update_icon()
try_remove_tank(usr, stored_oxygen_tanks)
// The plasma tank button
if(href_list["plasma"])
if(plasmatanks > 0)
var/obj/item/tank/plasma/P
if(platanks.len == plasmatanks)
P = platanks[1]
platanks.Remove(P)
else
P = new /obj/item/tank/plasma(loc)
P.loc = loc
to_chat(usr, "<span class='notice'>You take [P] out of [src].</span>")
plasmatanks--
update_icon()
try_remove_tank(usr, stored_plasma_tanks)
add_fingerprint(usr)
updateUsrDialog()
SSnanoui.update_uis(src)
SSnanoui.try_update_ui(usr, src)
else
SSnanoui.close_user_uis(usr,src)
return 1
return TRUE
/// Called when the user clicks on the oxygen or plasma tank UI buttons, and tries to withdraw a tank.
/obj/structure/dispenser/proc/try_remove_tank(mob/living/user, list/tank_list)
if(!LAZYLEN(tank_list))
return // There are no tanks left to withdraw.
var/obj/item/tank/T = tank_list[1]
tank_list.Remove(T)
if(!user.put_in_hands(T))
T.forceMove(loc) // If the user's hands are full, place it on the tile of the dispenser.
to_chat(user, "<span class='notice'>You take [T] out of [src].</span>")
update_icon()
/// Called when the user clicks on the dispenser with a tank. Tries to insert the tank into the dispenser, and updates the UI if successful.
/obj/structure/dispenser/proc/try_insert_tank(mob/living/user, list/tank_list, obj/item/tank/T)
if(LAZYLEN(tank_list) >= MAX_TANK_STORAGE)
to_chat(user, "<span class='warning'>[src] is full.</span>")
return
if(!user.drop_item()) // Antidrop check
to_chat(user, "<span class='warning'>[T] is stuck to your hand!</span>")
return
T.forceMove(src)
tank_list.Add(T)
update_icon()
to_chat(user, "<span class='notice'>You put [T] in [src].</span>")
SSnanoui.try_update_ui(user, src)
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
@@ -130,3 +153,5 @@
I.forceMove(loc)
new /obj/item/stack/sheet/metal(loc, 2)
qdel(src)
#undef MAX_TANK_STORAGE