Merge pull request #4580 from Jarcolr/master

Coin Flipping, AKA the D2
This commit is contained in:
Ccomp5950
2014-03-16 00:55:52 -05:00

View File

@@ -81,45 +81,46 @@
throwforce = 0.0
w_class = 1.0
var/string_attached
var/sides = 2
/obj/item/weapon/coin/New()
pixel_x = rand(0,16)-8
pixel_y = rand(0,8)-8
/obj/item/weapon/coin/gold
name = "Gold coin"
name = "gold coin"
icon_state = "coin_gold"
/obj/item/weapon/coin/silver
name = "Silver coin"
name = "silver coin"
icon_state = "coin_silver"
/obj/item/weapon/coin/diamond
name = "Diamond coin"
name = "diamond coin"
icon_state = "coin_diamond"
/obj/item/weapon/coin/iron
name = "Iron coin"
name = "iron coin"
icon_state = "coin_iron"
/obj/item/weapon/coin/plasma
name = "Solid plasma coin"
name = "solid plasma coin"
icon_state = "coin_plasma"
/obj/item/weapon/coin/uranium
name = "Uranium coin"
name = "uranium coin"
icon_state = "coin_uranium"
/obj/item/weapon/coin/clown
name = "Bananaium coin"
name = "bananaium coin"
icon_state = "coin_clown"
/obj/item/weapon/coin/adamantine
name = "Adamantine coin"
name = "adamantine coin"
icon_state = "coin_adamantine"
/obj/item/weapon/coin/mythril
name = "Mythril coin"
name = "mythril coin"
icon_state = "coin_mythril"
/obj/item/weapon/coin/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -150,3 +151,13 @@
string_attached = null
user << "\blue You detach the string from the coin."
else ..()
/obj/item/weapon/coin/attack_self(mob/user as mob)
var/result = rand(1, sides)
var/comment = ""
if(result == 1)
comment = "tails"
else if(result == 2)
comment = "heads"
user.visible_message("<span class='notice'>[user] has thrown the [src]. It lands on [comment]! </span>", \
"<span class='notice'>You throw the [src]. It lands on [comment]! </span>")