Files
Aurora.3/code/game/objects/items/weapons/dice.dm
Alberyk 94a1af3577 Custom items 08/05 (#4698)
Adds the following items:

-Dull Headwraps - JIX - kyres1
-Dull Robes - JIX - kyres1
-Titanium Faceplate - IRD - kyres1
-BARON's Dice - BARON - iamcrystalclear
-Vasili Mine Zippo - Nikit Vasili - simontheminer
-O.R.B. cyborg sprites
-COFFIN SENTINEL cyborg sprites

Other changes:
Removes Muhawir's wallet at the player request. Delete pointless items, that were just bloat since they had no custom sprite or function of their own, and implement them with the config. Also, adds support for weighted dices, since this was needed for an item.
2018-05-09 23:56:35 +03:00

66 lines
1.6 KiB
Plaintext

/obj/item/weapon/dice
name = "d6"
desc = "A dice with six sides."
icon = 'icons/obj/dice.dmi'
icon_state = "d66"
w_class = 1
var/sides = 6
var/weighted = FALSE //if this dice can cheat or something
var/favored_number = 1 //related to the var above
var/weighted_value = 70 //what is the chance of falling on the favored number
attack_verb = list("diced")
/obj/item/weapon/dice/New()
icon_state = "[name][rand(1,sides)]"
/obj/item/weapon/dice/throw_impact(atom/hit_atom)
..()
var/result
if((weighted) && (prob(weighted_value)))
result = favored_number
else
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]"
src.visible_message("<span class='notice'>\The [name] lands on [result]. [comment]</span>")
/obj/item/weapon/dice/d4
name = "d4"
desc = "A dice with four sides."
icon_state = "d44"
sides = 4
/obj/item/weapon/dice/d8
name = "d8"
desc = "A dice with eight sides."
icon_state = "d88"
sides = 8
/obj/item/weapon/dice/d10
name = "d10"
desc = "A dice with ten sides."
icon_state = "d1010"
sides = 10
/obj/item/weapon/dice/d12
name = "d12"
desc = "A dice with twelve sides."
icon_state = "d1212"
sides = 12
/obj/item/weapon/dice/d20
name = "d20"
desc = "A dice with twenty sides."
icon_state = "d2020"
sides = 20
/obj/item/weapon/dice/d100
name = "d100"
desc = "A dice with ten sides. This one is for the tens digit."
icon_state = "d10010"
sides = 10