Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vending machines can be shot over when tipped, and shot to be tipped over #15273

Merged
merged 40 commits into from Aug 15, 2023
Merged
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a4bd4c7
Adds my change to my forked repo i think
MeggalBozale Jun 27, 2023
f65b9b4
Merge branch 'goonstation:master' into master
MeggalBozale Jun 26, 2023
be8c0eb
Merge branch 'goonstation:master' into master
MeggalBozale Jun 29, 2023
52bec18
Move the checking code to the pills
MeggalBozale Jun 30, 2023
92ccf3e
Merge branch 'master' of https://github.com/MeggalBozale/goonstation
MeggalBozale Jun 30, 2023
0c68f73
I paid for the whole pill I'm gonna use the whole pill
MeggalBozale Jun 30, 2023
bded627
Move check to on_reagent_change()
MeggalBozale Jun 30, 2023
aa2da4b
Was not supposed to work, needs tweaking but cool
MeggalBozale Jun 30, 2023
e8fe36c
a singular line of extra whitespace. unacceptable
MeggalBozale Jun 30, 2023
dde14f1
call parent, make sure parent gets called
MeggalBozale Jun 30, 2023
d244c78
Merge branch 'master' into master
MeggalBozale Jun 30, 2023
7fddbda
Merge branch 'master' into master
MeggalBozale Jul 1, 2023
5e2676d
Merge branch 'goonstation:master' into master
MeggalBozale Jul 2, 2023
539bfec
Try out removing this stuff
MeggalBozale Jul 2, 2023
256a021
Update code/atom.dm
MeggalBozale Jul 5, 2023
c7c4d67
Update code/modules/chemistry/Chemistry-Holder.dm
MeggalBozale Jul 5, 2023
208eca2
Merge branch 'master' into master
MeggalBozale Jul 5, 2023
4f420ba
a bit of whitespace was goofing things up
MeggalBozale Jul 5, 2023
5a447f8
Merge branch 'goonstation:master' into master
MeggalBozale Jul 8, 2023
b22a281
Merge branch 'goonstation:master' into master
MeggalBozale Jul 31, 2023
9f1d697
Merge branch 'goonstation:master' into master
MeggalBozale Aug 4, 2023
6fe197d
Merge branch 'goonstation:master' into master
MeggalBozale Aug 5, 2023
d0d35c8
more deconstructable stuff
MeggalBozale Aug 6, 2023
5b92ef4
lol thats not for the pr
MeggalBozale Aug 6, 2023
e99d375
also not here
MeggalBozale Aug 6, 2023
245762e
oh what i forgot to commit this
MeggalBozale Aug 6, 2023
0494ef8
wahhh
MeggalBozale Aug 6, 2023
b7301f2
KIND OF IMPORTANT AGH
MeggalBozale Aug 6, 2023
67eab98
Merge branch 'master' into destruct
MeggalBozale Aug 6, 2023
65c89b2
clean up clean up everybody clean up
MeggalBozale Aug 6, 2023
77c2491
Merge branch 'destruct' of https://github.com/MeggalBozale/goonstatio…
MeggalBozale Aug 6, 2023
0cff617
(did not understand the bitflag)
MeggalBozale Aug 6, 2023
415c519
more cleanup
MeggalBozale Aug 6, 2023
1418a44
split can_fall into two vars for readability
MeggalBozale Aug 6, 2023
193d46c
Merge branch 'master' into destruct
MeggalBozale Aug 7, 2023
41410c2
Merge branch 'master' into destruct
MeggalBozale Aug 8, 2023
f00df60
Merge branch 'master' into destruct
MeggalBozale Aug 11, 2023
f186e94
guns that deal kinetic damage ONLY
MeggalBozale Aug 14, 2023
88127b3
pushing for now but i dont want to do it like this
MeggalBozale Aug 15, 2023
4dd8595
feels better
MeggalBozale Aug 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 18 additions & 6 deletions code/modules/vending/vending.dm
Expand Up @@ -110,6 +110,7 @@ ADMIN_INTERACT_PROCS(/obj/machinery/vending, proc/throw_item)

var/extended_inventory = FALSE //can we access the hidden inventory?
var/can_fall = TRUE //Can this machine be knocked over?
var/fallen = FALSE // Is it CURRENTLY knocked over?
var/can_hack = TRUE //Can this machine have it's panel open?

var/panel_open = FALSE //Hacking that vending machine. Gonna get a free candy bar.
Expand Down Expand Up @@ -277,18 +278,24 @@ ADMIN_INTERACT_PROCS(/obj/machinery/vending, proc/throw_item)
/obj/machinery/vending/blob_act(var/power)
if (prob(power * 1.25))
SPAWN(0)
if (prob(power / 3) && can_fall == 2)
if (prob(power / 3) && fallen)
for (var/i = 0, i < rand(4,7), i++)
src.malfunction()
qdel(src)
if (prob(50) || can_fall == 2)
if (prob(50) || fallen)
src.malfunction()
else
src.fall()
return

return

/obj/machinery/vending/bullet_act(var/obj/projectile/P)
if(P.proj_data.damage_type & (D_KINETIC | D_PIERCING | D_SLASHING))
if((src.can_fall) && prob(P.power))
src.fall()
..()

/obj/machinery/vending/emag_act(var/mob/user, var/obj/item/card/emag/E)
if (!src.emagged)
src.emagged = 1
Expand Down Expand Up @@ -913,7 +920,7 @@ ADMIN_INTERACT_PROCS(/obj/machinery/vending, proc/throw_item)
return

/obj/machinery/vending/power_change()
if (can_fall == 2)
if (fallen)
icon_state = icon_fallen ? icon_fallen : "[initial(icon_state)]-fallen"
light.disable()
return
Expand All @@ -933,9 +940,9 @@ ADMIN_INTERACT_PROCS(/obj/machinery/vending, proc/throw_item)
light.disable()

/obj/machinery/vending/proc/fall(mob/living/carbon/victim)
if (can_fall != 1)
if (!can_fall)
return
can_fall = 2
fallen = TRUE
status |= BROKEN
var/turf/vicTurf = get_turf(victim)
src.icon_state = "[initial(icon_state)]-fallen"
Expand Down Expand Up @@ -1139,12 +1146,17 @@ ADMIN_INTERACT_PROCS(/obj/machinery/vending, proc/throw_item)
return 0

/obj/machinery/vending/proc/right()
src.can_fall = 1
src.fallen = FALSE
src.layer = initial(src.layer)
src.anchored = ANCHORED
src.status &= ~BROKEN
src.power_change()

/obj/machinery/vending/Cross(atom/movable/mover)
if (src.fallen && mover.flags & TABLEPASS)
return TRUE
. = ..()

/datum/action/bar/icon/right_vendor //This is used when you try to remove someone elses handcuffs.
duration = 5 SECONDS
interrupt_flags = INTERRUPT_MOVE | INTERRUPT_ACT | INTERRUPT_STUNNED | INTERRUPT_ACTION
Expand Down