Emitter's beam direction glitch was fixed.

Working emitter no longer can be unwelded.
Collectors and collector controllers now can be locked using ID.
Singularity now eat underfloor wires.


git-svn-id: http://tgstation13.googlecode.com/svn/trunk@874 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
rastaf.zero@gmail.com
2011-01-16 15:09:15 +00:00
parent 33bf34e94c
commit 6f2e89d9a3
3 changed files with 105 additions and 77 deletions

View File

@@ -18,8 +18,6 @@ However people seem to like it for some reason.
//////////////////////Singularity gen START //////////////////////Singularity gen START
/obj/machinery/the_singularitygen/New()
..()
/obj/machinery/the_singularitygen/process() /obj/machinery/the_singularitygen/process()
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
@@ -120,8 +118,13 @@ However people seem to like it for some reason.
if(1000 to 1999) if(1000 to 1999)
for(var/obj/machinery/field_generator/F in orange(5,src)) for(var/obj/machinery/field_generator/F in orange(5,src))
F.turn_off() F.turn_off()
Zzzzap()
BHolerip()
Toxmob()
if(2000 to INFINITY) if(2000 to INFINITY)
explosion(src.loc, 4, 8, 15, 0) explosion(src.loc, 4, 8, 15, 0)
Zzzzap()
Toxmob()
src.ex_act(1) //if it survived the explosion src.ex_act(1) //if it survived the explosion
if(prob(15))//Chance for it to run a special event if(prob(15))//Chance for it to run a special event
@@ -171,10 +174,11 @@ However people seem to like it for some reason.
return 1 return 1
/obj/machinery/the_singularity/proc/eat() /obj/machinery/the_singularity/proc/eat()
for (var/atom/X in orange(grav_pull,src)) for (var/atom/X in orange(grav_pull,src))
if(isarea(X)) if(isarea(X))
continue continue
if (!is_eatable(X)) if(!is_eatable(X))
continue continue
if(istype(X,/obj/machinery/field_generator)) if(istype(X,/obj/machinery/field_generator))
@@ -216,6 +220,7 @@ However people seem to like it for some reason.
var/gain = 0 var/gain = 0
if (!is_eatable(A)) if (!is_eatable(A))
return return
if (istype(A,/mob/living))//if its a mob if (istype(A,/mob/living))//if its a mob
gain = 20 gain = 20
if(istype(A,/mob/living/carbon/human)) if(istype(A,/mob/living/carbon/human))
@@ -230,15 +235,13 @@ However people seem to like it for some reason.
gain = 2 gain = 2
else if(isturf(A)) else if(isturf(A))
/*if(!active) var/turf/T = A
if(isturf(A,/turf/simulated/floor/engine)) //here was a bug. But now it's a feature. -rasta0 if(T.intact) //stolen from t-ray
return*/ for(var/obj/O in T.contents)
if(O.level != 1)
/* if(istype(A,/turf/simulated/floor)) continue
A:ReplaceWithSpace() if(O.invisibility == 101)
gain = 2 src.Bumped(O)
else
A:ReplaceWithFloor()*/
A:ReplaceWithSpace() // A:ReplaceWithSpace() //
gain = 2 gain = 2
@@ -255,9 +258,9 @@ However people seem to like it for some reason.
BHolerip() BHolerip()
else else
event() event()
if(3)//tox damage all carbon mobs in area if(3,4)//tox damage all carbon mobs in area
Toxmob() Toxmob()
if(4)//Stun mobs who lack optic scanners if(5)//Stun mobs who lack optic scanners
Mezzer() Mezzer()
else else
//do nothing //do nothing
@@ -265,17 +268,24 @@ However people seem to like it for some reason.
/obj/machinery/the_singularity/proc/Toxmob() /obj/machinery/the_singularity/proc/Toxmob()
for(var/mob/living/carbon/M in view(7, src.loc)) var/toxrange = 7
if (src.energy>100)
toxrange+=round((src.energy-100)/100)
var/toxloss = 3
var/radiation = 10
var/fireloss = 0
if (src.energy>150)
toxloss += ((src.energy-150)/50)*3
radiation += ((src.energy-150)/50)*10
if (src.energy>300)
fireloss += ((src.energy-300)/50)*3
for(var/mob/living/carbon/M in view(toxrange, src.loc))
if(istype(M,/mob/living/carbon/human)) if(istype(M,/mob/living/carbon/human))
if(M:wear_suit) if(M:wear_suit) //TODO: check for radiation protection
return return
M.toxloss += 3 M.toxloss += toxloss
M.radiation += 10 M.radiation += radiation
if (src.energy>150) M.fireloss += fireloss
M.toxloss += ((src.energy-150)/50)*3
M.radiation += ((src.energy-150)/50)*10
if (src.energy>300)
M.fireloss += ((src.energy-300)/50)*3
M.updatehealth() M.updatehealth()
M << "\red You feel odd." M << "\red You feel odd."
@@ -619,7 +629,7 @@ However people seem to like it for some reason.
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
return return
if(!src.state == 3 || !anchored) if(src.state != 3)
src.active = 0 src.active = 0
return return
@@ -641,7 +651,7 @@ However people seem to like it for some reason.
var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread var/datum/effects/system/spark_spread/s = new /datum/effects/system/spark_spread
s.set_up(5, 1, src) s.set_up(5, 1, src)
s.start() s.start()
A.dir = src.dir
if(src.dir == 1)//Up if(src.dir == 1)//Up
A.yo = 20 A.yo = 20
A.xo = 0 A.xo = 0
@@ -693,6 +703,9 @@ However people seem to like it for some reason.
return 1 return 1
else if(istype(W, /obj/item/weapon/weldingtool) && W:welding) else if(istype(W, /obj/item/weapon/weldingtool) && W:welding)
if(active)
user << "\red Turn off the [src] first."
return 1
if (state == 0) if (state == 0)
user << "\red The [src] needs to be wrenched to the floor first." user << "\red The [src] needs to be wrenched to the floor first."
return 1 return 1
@@ -756,6 +769,7 @@ However people seem to like it for some reason.
var/active = 0 var/active = 0
var/obj/item/weapon/tank/plasma/P = null var/obj/item/weapon/tank/plasma/P = null
var/obj/machinery/power/collector_control/CU = null var/obj/machinery/power/collector_control/CU = null
var/locked
/////////////ARRAY START /////////////ARRAY START
@@ -819,18 +833,18 @@ However people seem to like it for some reason.
/obj/machinery/power/collector_array/attack_hand(mob/user as mob) /obj/machinery/power/collector_array/attack_hand(mob/user as mob)
if (..()) if (..())
return return
if(src.anchored != 1) if(!src.anchored)
user << "\red The [src] needs to be secured to the floor first." user << "\red The [src] needs to be secured to the floor first."
return 1 return 1
if (!src.allowed(user))
user << "\red Access denied."
return 1
if (!P) if (!P)
user << "\red The [src] cannot be turned on without plasma." user << "\red The [src] cannot be turned on without plasma."
return 1 return 1
if (!CU) if (!CU)
user << "\red The [src] is not connected with The Radiation Collector Control." user << "\red The [src] is not connected with The Radiation Collector Control."
return 1 return 1
if(src.locked)
user << "\red The controls are locked."
return 1
src.active = !src.active src.active = !src.active
if(src.active) if(src.active)
updateicon_on() updateicon_on()
@@ -844,25 +858,27 @@ However people seem to like it for some reason.
/obj/machinery/power/collector_array/attackby(obj/item/W, mob/user) /obj/machinery/power/collector_array/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/tank/plasma)) if(istype(W, /obj/item/weapon/tank/plasma))
if(src.anchored == 1) if(!src.anchored)
if(src.P)
user << "\red There appears to already be a plasma tank loaded!"
return 1
src.P = W
W.loc = src
if (user.client)
user.client.screen -= W
user.u_equip(W)
updateicon()
if (CU)
CU.updatecons()
else
user << "The collector needs to be secured to the floor first." user << "The collector needs to be secured to the floor first."
return 1 return 1
if(src.P)
user << "\red There appears to already be a plasma tank loaded!"
return 1
src.P = W
W.loc = src
if (user.client)
user.client.screen -= W
user.u_equip(W)
updateicon()
if (CU)
CU.updatecons()
else if(istype(W, /obj/item/weapon/crowbar)) else if(istype(W, /obj/item/weapon/crowbar))
if(!P) if(!P)
return 1 return 1
if(active)
user << "\red Turn off the collector first."
return 1
eject() eject()
else if(istype(W, /obj/item/weapon/wrench)) else if(istype(W, /obj/item/weapon/wrench))
@@ -870,20 +886,25 @@ However people seem to like it for some reason.
user << "\red Turn off the collector first." user << "\red Turn off the collector first."
return 1 return 1
playsound(src.loc, 'Ratchet.ogg', 75, 1)
src.anchored = !src.anchored
if(src.anchored == 1)
user.visible_message("[user.name] secures [src.name] reinforcing bolts to the floor.", \
"You secure the collector reinforcing bolts.", \
"You hear ratchet")
else else
playsound(src.loc, 'Ratchet.ogg', 75, 1) user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \
src.anchored = !src.anchored "You undo the external reinforcing bolts.", \
if(src.anchored == 1) "You hear ratchet")
user.visible_message("[user.name] secures [src.name] reinforcing bolts to the floor.", \ for(var/obj/machinery/power/collector_control/myCC in orange(1,src))
"You secure the collector reinforcing bolts.", \ myCC.updatecons()
"You hear ratchet") else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
else if (src.allowed(user))
user.visible_message("[user.name] unsecures [src.name] reinforcing bolts from the floor.", \ src.locked = !src.locked
"You undo the external reinforcing bolts.", \ user << "Controls are now [src.locked ? "locked." : "unlocked."]"
"You hear ratchet") else
for(var/obj/machinery/power/collector_control/myCC in orange(1,src)) user << "\red Access denied."
myCC.updatecons() return 1
else else
user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \ user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \
"\red You hit the [src.name] with your [W.name]!", \ "\red You hit the [src.name] with your [W.name]!", \
@@ -892,14 +913,18 @@ However people seem to like it for some reason.
/obj/machinery/power/collector_array/ex_act(severity) /obj/machinery/power/collector_array/ex_act(severity)
switch(severity) switch(severity)
if(2.0 to 3.0) if(2, 3)
eject() eject()
return ..() return ..()
/obj/machinery/power/collector_array/Del() /obj/machinery/power/collector_array/Del()
var/oldsrc = src
src = null
spawn(1)
for(var/obj/machinery/power/collector_control/myCC in orange(1,src))
myCC.updatecons()
src = oldsrc
. = ..() . = ..()
for(var/obj/machinery/power/collector_control/myCC in orange(1,src))
myCC.updatecons()
////////////CONTROL UNIT ////////////CONTROL UNIT
@@ -916,6 +941,7 @@ However people seem to like it for some reason.
var/lastpower = 0 var/lastpower = 0
var/obj/machinery/power/collector_array/CA[4] var/obj/machinery/power/collector_array/CA[4]
var/list/obj/machinery/the_singularity/S var/list/obj/machinery/the_singularity/S
var/locked
////////////CONTROL UNIT START ////////////CONTROL UNIT START
@@ -1031,21 +1057,20 @@ However people seem to like it for some reason.
/obj/machinery/power/collector_control/attack_hand(mob/user as mob) /obj/machinery/power/collector_control/attack_hand(mob/user as mob)
if (..()) if (..())
return return
if(src.anchored==1) if(!src.anchored)
if (!src.allowed(user))
user << "\red Access denied."
return 1
src.active = !src.active
if(!src.active)
user << "You turn off the [src]."
src.lastpower = 0
updateicon()
if(src.active)
user << "You turn on the [src]."
updatecons()
else
user << "\red The [src] needs to be secured to the floor first." user << "\red The [src] needs to be secured to the floor first."
return 1 return 1
if(src.locked)
user << "\red The controls are locked."
return 1
src.active = !src.active
if(!src.active)
user << "You turn off the [src]."
src.lastpower = 0
updateicon()
if(src.active)
user << "You turn on the [src]."
updatecons()
/obj/machinery/power/collector_control/attackby(obj/item/W, mob/user) /obj/machinery/power/collector_control/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/device/analyzer)) if(istype(W, /obj/item/device/analyzer))
@@ -1067,6 +1092,13 @@ However people seem to like it for some reason.
"You undo the [src] securing bolts.", \ "You undo the [src] securing bolts.", \
"You hear ratchet") "You hear ratchet")
disconnect_from_network() disconnect_from_network()
else if(istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda))
if (src.allowed(user))
src.locked = !src.locked
user << "Controls are now [src.locked ? "locked." : "unlocked."]"
else
user << "\red Access denied."
return 1
else else
user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \ user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \
"\red You hit the [src.name] with your [W.name]!", \ "\red You hit the [src.name] with your [W.name]!", \

View File

@@ -1,6 +1,2 @@
deuryn - Host rastaf0 - Host
tle - Host
uristmcdorf - Host
mport2004 - Coder

View File

@@ -1 +1 @@
extended extended