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

Handheld portable magnet #37316

Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6345bd2
fun item
Jun 25, 2023
5d6d4af
better refresh
Jun 25, 2023
46fa172
Merge branch 'Bleeding-Edge' into handheldmagnet
SECBATON-GRIFFON Nov 3, 2024
0455668
new icon
SECBATON-GRIFFON Nov 3, 2024
678f857
cleaner, also wayyy too many things have a siemens coefficient so thi…
SECBATON-GRIFFON Nov 3, 2024
1e451bd
comment explanation
SECBATON-GRIFFON Nov 3, 2024
aa6c69d
just to be sure
SECBATON-GRIFFON Nov 3, 2024
7da0b5b
recursion
SECBATON-GRIFFON Nov 3, 2024
6bc712a
since this is 1 for most items, commented out
SECBATON-GRIFFON Nov 3, 2024
59aacda
test item
SECBATON-GRIFFON Nov 3, 2024
22b2c8a
WAS PULLING ANCHORED STUFF, FIX
SECBATON-GRIFFON Nov 3, 2024
9d88d25
this was probably needed
SECBATON-GRIFFON Nov 3, 2024
878aad1
or here
SECBATON-GRIFFON Nov 3, 2024
04f5bb2
finally got it
SECBATON-GRIFFON Nov 3, 2024
7256ae0
hopefully works like this, will pr if so
SECBATON-GRIFFON Nov 3, 2024
e28832d
(unused var)
SECBATON-GRIFFON Nov 3, 2024
4abc1a0
removes screw cover stuff, shows cell info here
SECBATON-GRIFFON Nov 3, 2024
496dbcb
updates here!
SECBATON-GRIFFON Nov 3, 2024
d94fcca
allows all robotic mobs to be pulled now
SECBATON-GRIFFON Nov 3, 2024
ae1ce27
here
SECBATON-GRIFFON Nov 3, 2024
248fb2c
some more balance
SECBATON-GRIFFON Nov 3, 2024
4da9430
compresses the looping
SECBATON-GRIFFON Nov 4, 2024
40a5758
stops a runtime with pockets
SECBATON-GRIFFON Nov 4, 2024
4dc5da0
moves it here
SECBATON-GRIFFON Nov 6, 2024
d341757
space pulling!
SECBATON-GRIFFON Nov 6, 2024
aabfa2b
some more fun
SECBATON-GRIFFON Nov 6, 2024
a24ef52
fix
SECBATON-GRIFFON Nov 7, 2024
d8a42a2
smaller mobs get pulled to bigger ones too!
SECBATON-GRIFFON Nov 7, 2024
b27ec70
sanity
SECBATON-GRIFFON Nov 7, 2024
d6d591c
bit more
SECBATON-GRIFFON Nov 7, 2024
5d134ef
just for the sake of it
SECBATON-GRIFFON Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removes screw cover stuff, shows cell info here
  • Loading branch information
SECBATON-GRIFFON committed Nov 3, 2024
commit 4abc1a05d6cef15e4e68f8c3aaaa4b7fc41d01e7
45 changes: 13 additions & 32 deletions code/game/objects/items/devices/handheld_magnet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
origin_tech = Tc_MAGNETS + "=5;" + Tc_ENGINEERING + "=4;" + Tc_MATERIALS + "=4;" + Tc_PROGRAMMING + "=3;" + Tc_SYNDICATE + "=5;" + Tc_BLUESPACE + "=3"
autoignition_temperature = AUTOIGNITION_PLASTIC
var/on = 0
var/cover_open = 0
var/base_state = "hhmagnet"
var/obj/item/weapon/cell/power_src = null
var/power_usage = 250
Expand All @@ -32,7 +31,8 @@

var/dat = {"Power: <a href='?src=\ref[src];toggleon=1'>[on ? "On" : "Off"]</a><br>
Range: <a href='?src=\ref[src];magfield=1'>[magnetic_field] metres</a><br>
Interval: <a href='?src=\ref[src];interval=1'>[pull_interval] deciseconds</a><br>"}
Interval: <a href='?src=\ref[src];interval=1'>[pull_interval] deciseconds</a><br>
[power_src ? "[power_src] charge: [round(power_src.percent())]%" : "No power cell inserted"]"}

var/datum/browser/popup = new(user, "\ref[src]", name, 400, 500)
popup.set_content(dat)
Expand Down Expand Up @@ -67,7 +67,7 @@
attack_self(usr)

/obj/item/device/handheld_magnet/attack_hand(mob/user)
if (cover_open && power_src && user.is_holding_item(src))
if (power_src && user.is_holding_item(src))
user.put_in_hands(power_src)
power_src.add_fingerprint(user)
power_src.updateicon()
Expand All @@ -85,27 +85,14 @@
..()

/obj/item/device/handheld_magnet/attackby(obj/item/W as obj, mob/user as mob)
if (W.is_screwdriver(user))
cover_open = !cover_open
if (cover_open)
to_chat(user, "<span class='notice'>You open up the power cell cover.</span>")
else
to_chat(user, "<span class='notice'>You close the power cell cover.</span>")
src.add_fingerprint(user)
return

if (istype(W, /obj/item/weapon/cell))
if (cover_open)
if (power_src)
to_chat(user, "<span class='warning'>There is already a cell inside, remove it first.</span>")
return
if (user.drop_item(W, src))
power_src = W
user.visible_message("<span class='notice'>[user] inserts a cell into [src].</span>", "<span class='notice'>You insert a cell into [src].</span>")
src.add_fingerprint(user)
return
else
to_chat(user, "<span class='warning'>You have to open the cover first, it's closed!</span>")
if (power_src)
to_chat(user, "<span class='warning'>There is already a cell inside, remove it first.</span>")
return
if (user.drop_item(W, src))
power_src = W
user.visible_message("<span class='notice'>[user] inserts a cell into [src].</span>", "<span class='notice'>You insert a cell into [src].</span>")
src.add_fingerprint(user)
return
..()

Expand Down Expand Up @@ -157,17 +144,11 @@

/obj/item/device/handheld_magnet/examine(mob/user)
..()
to_chat(user, "The cover is [cover_open ? "open" : "closed"].")
to_chat(user, "<span class='warning'>It's turned [on ? "on!" : "off."]</span>")
// Can only see cell charge % if its turned on
// or if the cover is open
if (cover_open)
to_chat(user, "There is [power_src ? "a" : "no"] power cell inside.")
if (power_src)
to_chat(user, "You can see that it's current charge is [round(power_src.percent())]%")
else
if (on)
to_chat(user, "Current charge: [round(power_src.percent())]%")
to_chat(user, "There is [power_src ? "a" : "no"] power cell inside.")
if (power_src)
to_chat(user, "Its current charge is [round(power_src.percent())]%")

/obj/item/device/handheld_magnet/admin/New()
. = ..()
Expand Down