Glorious comeback update.

Object spells - fixed two minor bugs. Added the possibility of making a critical failure effect for the spells.
Singularity beacon - added to traitor spawn list. Must be screwdrivered to the floor before you can activate it.
Singularity - optimised the code a bit.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1709 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-06-23 08:29:42 +00:00
parent c1f8e47a94
commit c46d689e2b
7 changed files with 96 additions and 27 deletions
+9 -1
View File
@@ -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")
+2 -2
View File
@@ -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
+1
View File
@@ -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)
+6
View File
@@ -55,6 +55,8 @@
menu_message += "<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=botchat'>Binary Translator</A> (3)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=lawmod'>Hacked AI Module</A> (7)<BR>"
menu_message += "<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=singubeacon'>Singularity Beacon</A> (does not include a screwdriver) (1)<BR>"
menu_message += "<HR>"
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)
+62 -6
View File
@@ -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
Del()
if(active) Deactivate()
..()
/obj/machinery/singularity_beacon/syndicate
icontype = "beaconsynd"
icon_state = "beaconsynd0"
#undef SCREWED
+16 -18
View File
@@ -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
Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 27 KiB