mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Some assembly fixes and tidying up. Plus, improved infrared emitters, with new sprites by Pewtershmitz!
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
This commit is contained in:
@@ -1,22 +1,27 @@
|
||||
/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) // Roll the dice -- TLE
|
||||
var/temp_sides
|
||||
if(src.sides < 1)
|
||||
temp_sides = 2
|
||||
else
|
||||
temp_sides = src.sides
|
||||
var/result = rand(1,temp_sides)
|
||||
/obj/item/weapon/dice/attack_self(mob/user as mob)
|
||||
var/result = rand(1, sides)
|
||||
var/comment = ""
|
||||
if(temp_sides == 20 && result == 20)
|
||||
if(sides == 20 && result == 20)
|
||||
comment = "Nat 20!"
|
||||
else if(temp_sides == 20 && result == 1)
|
||||
else if(sides == 20 && result == 1)
|
||||
comment = "Ouch, bad luck."
|
||||
user << text("\red You throw a [src]. It lands on a [result]. [comment]")
|
||||
icon_state = "[name][result]"
|
||||
for(var/mob/O in viewers(user, null))
|
||||
if(O == (user))
|
||||
continue
|
||||
else
|
||||
O.show_message(text("\red [user] has thrown a [src]. It lands on [result]. [comment]"), 1)
|
||||
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>")
|
||||
Reference in New Issue
Block a user