mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 09:02:27 +00:00
Made it so items get their pixel x/y reset on pickup.
Thrown items now also get their pixel placement slightly randomized.
Tweaked the center of mass on a boatload of items to be more accurate to their sprite art.
Replaced a bunch of randomized pixel placement code into a unifying proc; randpixel_xy() that uses an item's randpixel var.
68 lines
1.7 KiB
Plaintext
68 lines
1.7 KiB
Plaintext
/obj/item/battle_monsters/
|
|
icon = 'icons/obj/battle_monsters/card.dmi'
|
|
icon_state = ""
|
|
var/facedown = TRUE
|
|
var/rotated = FALSE
|
|
|
|
/obj/item/battle_monsters/dropped(mob/user as mob)
|
|
set_dir(user.dir)
|
|
if(rotated)
|
|
set_dir(turn(dir,90))
|
|
update_icon()
|
|
. = ..()
|
|
|
|
/obj/item/battle_monsters/pickup(mob/user as mob)
|
|
set_dir(NORTH)
|
|
if(rotated)
|
|
set_dir(turn(dir,90))
|
|
update_icon()
|
|
. = ..()
|
|
|
|
/obj/item/battle_monsters/MouseDrop(mob/user) //Dropping the card onto something else.
|
|
if(istype(user))
|
|
user.put_in_active_hand(src)
|
|
src.pickup(user)
|
|
return
|
|
|
|
. = ..()
|
|
|
|
/obj/item/battle_monsters/MouseDrop_T(var/atom/movable/C, mob/user) //Dropping C onto the card
|
|
if(istype(C,/obj/item/battle_monsters))
|
|
src.attackby(C,user)
|
|
return
|
|
|
|
. = ..()
|
|
|
|
/obj/item/battle_monsters/AltClick(var/mob/user)
|
|
RotateCard(user)
|
|
|
|
/obj/item/battle_monsters/CtrlClick(var/mob/user)
|
|
attack_self(user)
|
|
|
|
/obj/item/battle_monsters/proc/RotateCard(var/mob/user)
|
|
|
|
rotated = !rotated
|
|
|
|
if(rotated)
|
|
if(src.loc == user)
|
|
to_chat(user,span("notice", "You prepare \the [name] to be played horizontally."))
|
|
set_dir(turn(NORTH,90))
|
|
else
|
|
set_dir(turn(user.dir,90))
|
|
user.visible_message(\
|
|
span("notice","\The [user] adjusts the orientation of \the [src] horizontally."),\
|
|
span("notice","You adjust the orientation of \the [src] horizontally.")\
|
|
)
|
|
else
|
|
if(src.loc == user)
|
|
to_chat(user,span("notice", "You prepare \the [name] to be played vertically."))
|
|
set_dir(NORTH)
|
|
else
|
|
set_dir(user.dir)
|
|
user.visible_message(\
|
|
span("notice","\The [user] adjusts the orientation of \the [src] vertically."),\
|
|
span("notice","You adjust the orientation of \the [src] vertically.")\
|
|
)
|
|
|
|
update_icon()
|