mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-05 15:02:56 +00:00
Removed the infra sensor, as it was buggy, and, to be perfectly honest, utterly pointless. Slightly improved and moved dice code. Fixes issue 366. Fixes issue 317. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4555 316c924e-a436-60f5-8080-3fe189b3f50e
27 lines
874 B
Plaintext
27 lines
874 B
Plaintext
/obj/item/weapon/dice
|
|
name = "d6"
|
|
desc = "A dice with six sides."
|
|
var/sides = 6
|
|
icon = 'icons/obj/dice.dmi'
|
|
icon_state = "d66"
|
|
|
|
/obj/item/weapon/dice/New()
|
|
icon_state = "[name][rand(sides)]"
|
|
|
|
/obj/item/weapon/dice/d20
|
|
name = "d20"
|
|
desc = "A dice with twenty sides."
|
|
sides = 20
|
|
icon_state = "d2020"
|
|
|
|
/obj/item/weapon/dice/attack_self(mob/user as mob)
|
|
var/result = rand(1, sides)
|
|
var/comment = ""
|
|
if(sides == 20 && result == 20)
|
|
comment = "Nat 20!"
|
|
else if(sides == 20 && result == 1)
|
|
comment = "Ouch, bad luck."
|
|
icon_state = "[name][result]"
|
|
user.visible_message("<span class='notice'>[user] has thrown [src]. It lands on [result]. [comment]</span>", \
|
|
"<span class='notice'>You throw [src]. It lands on a [result]. [comment]</span>", \
|
|
"<span class='notice'>You hear [src] landing on a [result]. [comment]</span>") |