Die of fate tweaks and fixes (#42073)

* Die of fate tweaks and fixes

🆑 coiax
fix: Rolling a 6 with a die of fate now reduces your speed as intended.
fix: Rolling an 8 with a die of fate will cause the explosion to be
around the roller, not the die.
tweak: Die of fate effects now make loud visible messages so it's
obvious what has happened.
admin: Dice can now be "totally rigged" with admin edits to
unconditionally always roll a certain value, rather than just some of
the time. A new "cursed die of fate" has been added to demonstrate this
effect.
/🆑

- new proc `do_smoke` that does basic smoke effects, to avoid the same
pattern for making smoke effects.
- Dice rigging has been split into two vars, "rigged" for the severity
of the rigging (not rigged, basically rigged, totally rigged), and
rigged_value for the value it's trying to rig to.

* Stealth die of fates

* Code review II?
This commit is contained in:
coiax
2019-01-07 06:17:45 +00:00
committed by oranges
parent 8d89466f91
commit 074b2f942e
5 changed files with 98 additions and 37 deletions
@@ -327,3 +327,9 @@
/obj/effect/particle_effect/smoke/transparent
opaque = FALSE
/proc/do_smoke(range=0, location=null, smoke_type=/obj/effect/particle_effect/smoke)
var/datum/effect_system/smoke_spread/smoke = new
smoke.effect_type = smoke_type
smoke.set_up(range, location)
smoke.start()
+17 -8
View File
@@ -43,12 +43,15 @@
var/sides = 6
var/result = null
var/list/special_faces = list() //entries should match up to sides var if used
var/can_be_rigged = TRUE
var/rigged = FALSE
var/microwave_riggable = TRUE
var/rigged = DICE_NOT_RIGGED
var/rigged_value
/obj/item/dice/Initialize()
. = ..()
result = roll(sides)
if(!result)
result = roll(sides)
update_icon()
/obj/item/dice/suicide_act(mob/user)
@@ -166,9 +169,14 @@
/obj/item/dice/proc/diceroll(mob/user)
result = roll(sides)
if(rigged && result != rigged)
if(prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
result = rigged
if(rigged != DICE_NOT_RIGGED && result != rigged_value)
if(rigged == DICE_BASICALLY_RIGGED && prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
result = rigged_value
else if(rigged == DICE_TOTALLY_RIGGED)
result = rigged_value
. = result
var/fake_result = roll(sides)//Daredevil isn't as good as he used to be
var/comment = ""
if(sides == 20 && result == 20)
@@ -192,6 +200,7 @@
add_overlay("[src.icon_state]-[src.result]")
/obj/item/dice/microwave_act(obj/machinery/microwave/M)
if(can_be_rigged)
rigged = result
if(microwave_riggable)
rigged = DICE_BASICALLY_RIGGED
rigged_value = result
..(M)