diff --git a/code/datums/spell.dm b/code/datums/spell.dm
index 251e401a957..8fcd4b44adf 100644
--- a/code/datums/spell.dm
+++ b/code/datums/spell.dm
@@ -31,6 +31,8 @@ var/list/spells = typesof(/obj/proc_holder/spell) //needed for the badmin verb f
var/smoke_spread = 0 //1 - harmless, 2 - harmful
var/smoke_amt = 0 //cropped at 10
+ var/critfailchance = 0
+
/obj/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell
if(!(src in usr.spell_list))
@@ -111,7 +113,10 @@ var/list/spells = typesof(/obj/proc_holder/spell) //needed for the badmin verb f
spawn(0)
if(charge_type == "recharge" && recharge)
start_recharge()
- cast(targets)
+ if(prob(critfailchance))
+ critfail(targets)
+ else
+ cast(targets)
after_cast(targets)
/obj/proc_holder/spell/proc/before_cast(list/targets)
@@ -156,6 +161,9 @@ var/list/spells = typesof(/obj/proc_holder/spell) //needed for the badmin verb f
/obj/proc_holder/spell/proc/cast(list/targets)
return
+/obj/proc_holder/spell/proc/critfail(list/targets)
+ return
+
/obj/proc_holder/spell/proc/revert_cast() //resets recharge or readds a charge
switch(charge_type)
if("recharge")
diff --git a/code/datums/spells/inflict_handler.dm b/code/datums/spells/inflict_handler.dm
index e2e5e0cf1cc..a1562b95d7b 100644
--- a/code/datums/spells/inflict_handler.dm
+++ b/code/datums/spells/inflict_handler.dm
@@ -29,7 +29,7 @@
continue
//damage
if(amt_dam_brute > 0)
- if(amt_dam_fire > 0)
+ if(amt_dam_fire >= 0)
target.take_overall_damage(amt_dam_brute,amt_dam_fire)
else if (amt_dam_fire < 0)
target.take_overall_damage(amt_dam_brute,0)
@@ -38,7 +38,7 @@
if(amt_dam_fire > 0)
target.take_overall_damage(0,amt_dam_fire)
target.heal_overall_damage(amt_dam_brute,0)
- else if (amt_dam_fire < 0)
+ else if (amt_dam_fire <= 0)
target.heal_overall_damage(amt_dam_brute,amt_dam_fire)
target.toxloss += amt_dam_tox
target.oxyloss += amt_dam_oxy
diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm
index efcfca2f3c9..bf19c00f134 100644
--- a/code/datums/spells/projectile.dm
+++ b/code/datums/spells/projectile.dm
@@ -45,6 +45,7 @@
if(proj_homing)
if(proj_insubstantial)
+ projectile.dir = get_dir(projectile,target)
projectile.loc = get_step_to(projectile,target)
else
step_to(projectile,target)
diff --git a/code/game/objects/devices/PDA/uplink.dm b/code/game/objects/devices/PDA/uplink.dm
index e7c1d08ca30..5092cb2af39 100644
--- a/code/game/objects/devices/PDA/uplink.dm
+++ b/code/game/objects/devices/PDA/uplink.dm
@@ -55,6 +55,8 @@
menu_message += "
"
menu_message += "Binary Translator (3)
"
menu_message += "Hacked AI Module (7)
"
+ menu_message += "
"
+ menu_message += "Singularity Beacon (does not include a screwdriver) (1)
"
menu_message += "
"
return
@@ -162,6 +164,10 @@
if (uses >= 3)
uses -= 3
new /obj/item/device/radio/headset/traitor(get_turf(hostpda))
+ if("singubeacon")
+ if(uses)
+ uses--
+ new /obj/machinery/singularity_beacon/syndicate(get_turf(hostpda))
generate_menu()
print_to_host(menu_message)
diff --git a/code/game/spacecraft/syndicatebeacon.dm b/code/game/spacecraft/syndicatebeacon.dm
index 14cebc2977b..479bc6dc4c5 100644
--- a/code/game/spacecraft/syndicatebeacon.dm
+++ b/code/game/spacecraft/syndicatebeacon.dm
@@ -98,17 +98,73 @@
selfdestructing = 1
spawn() explosion(src.loc, rand(3,8), rand(1,3), 1, 10)
+#define SCREWED 32
+
/obj/machinery/singularity_beacon //not the best place for it but it's a hack job anyway -- Urist
name = "ominous beacon"
desc = "This looks suspicious..."
- icon = 'device.dmi'
- icon_state = "syndbeacon"
+ icon = 'singularity.dmi'
+ icon_state = "beacon"
- anchored = 1
+ anchored = 0
density = 1
- New(loc)
+ stat = 0
+
+ var/active = 0 //It doesn't use up power, so use_power wouldn't really suit it
+ var/icontype = "beacon"
+
+ proc/Activate(mob/user = null)
+ for(var/obj/machinery/singularity/singulo in world)
+ if(singulo.z == z)
+ singulo.target = src
+ icon_state = "[icontype]1"
+ active = 1
+ if(user) user << "\blue You activate the beacon."
+
+ proc/Deactivate(mob/user = null)
+ for(var/obj/machinery/singularity/singulo in world)
+ if(singulo.target == src)
+ singulo.target = null
+ icon_state = "[icontype]0"
+ active = 0
+ if(user) user << "\blue You deactivate the beacon."
+
+ attack_ai(mob/user as mob)
+ return
+
+ attack_hand(var/mob/user as mob)
+ if(stat & SCREWED)
+ return active ? Deactivate(user) : Activate(user)
+ else
+ user << "\red You need to screw the beacon to the floor first!"
+ return
+
+ attackby(obj/item/weapon/W as obj, mob/user as mob)
+ if(istype(W,/obj/item/weapon/screwdriver))
+ if(stat & SCREWED)
+ if(active)
+ user << "\red You need to deactivate the beacon first!"
+ return
+ else
+ stat &= ~SCREWED
+ anchored = 0
+ user << "\blue You unscrew the beacon from the floor."
+ return
+ else
+ stat |= SCREWED
+ anchored = 1
+ user << "\blue You screw the beacon to the floor."
+ return
+
..()
- for(var/obj/machinery/singularity/singulo in world)
- singulo.target = src
\ No newline at end of file
+ Del()
+ if(active) Deactivate()
+ ..()
+
+/obj/machinery/singularity_beacon/syndicate
+ icontype = "beaconsynd"
+ icon_state = "beaconsynd0"
+
+#undef SCREWED
\ No newline at end of file
diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm
index 7d9549329d3..ad685ce4813 100644
--- a/code/modules/power/singularity/singularity.dm
+++ b/code/modules/power/singularity/singularity.dm
@@ -36,8 +36,9 @@ var/global/list/uneatable = list(
del(src)
..()
for(var/obj/machinery/singularity_beacon/singubeacon in world)
- target = singubeacon
- break
+ if(singubeacon.active)
+ target = singubeacon
+ break
return
@@ -195,25 +196,22 @@ var/global/list/uneatable = list(
eat()
- for(var/atom/X in orange(consume_range,src))
- if(isarea(X))
- continue
+ for(var/atom/movable/X in orange(consume_range,src))
consume(X)
- for(var/atom/X in orange(grav_pull,src))
- if(isarea(X))
- continue
+ for(var/turf/X in orange(consume_range,src))
+ consume(X)
+ for(var/atom/movable/X in orange(grav_pull,src))
if(is_type_in_list(X, uneatable))
continue
- if(!isturf(X))
- if((!X:anchored && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9))
- step_towards(X,src)
- else if(istype(X,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = X
- if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
- var/obj/item/clothing/shoes/magboots/M = H.shoes
- if(M.magpulse)
- continue
- step_towards(H,src)
+ if((!X:anchored && (!istype(X,/mob/living/carbon/human)))|| (src.current_size >= 9))
+ step_towards(X,src)
+ else if(istype(X,/mob/living/carbon/human))
+ var/mob/living/carbon/human/H = X
+ if(istype(H.shoes,/obj/item/clothing/shoes/magboots))
+ var/obj/item/clothing/shoes/magboots/M = H.shoes
+ if(M.magpulse)
+ continue
+ step_towards(H,src)
return
diff --git a/icons/obj/singularity.dmi b/icons/obj/singularity.dmi
index bd39b710bd4..350052781f7 100644
Binary files a/icons/obj/singularity.dmi and b/icons/obj/singularity.dmi differ