mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Engine:
-fixed cyborgs/AI problems with emitters; -collector controller now without delay display state of singularity, beware red circle; APC repairing: -emagged APCs can be easily fixed; -blowed up and malfhacked APCs can be fixed with lot of work; --Note: malf timer will NOT slowdown due to gameplay reasons; -APC now actually use power for charging its cells; Power cells: -explosions strength now depends on charge; -in general explosions were nerfed; -power cells can lose quality in several circumstances; Food processor -now messages appears in right moments; -code rewritten, adding recipes now easy; -recipes still same; -new recipe: non-player monkey -> bucket of blood; git-svn-id: http://tgstation13.googlecode.com/svn/trunk@709 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1,105 +1,125 @@
|
||||
/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(src.contents.len > 0)
|
||||
user << "Something is already in the processing chamber."
|
||||
return 0
|
||||
else
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/potato) || istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/wheat) || istype(O, /obj/item/weapon/reagent_containers/food/snacks/humanmeat) || istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeymeat))
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
if(istype(G.affecting, /mob/living/carbon/alien/larva/metroid))
|
||||
G.affecting.loc = src
|
||||
user.drop_item()
|
||||
else
|
||||
user << "That probably won't blend."
|
||||
return 0
|
||||
/datum/food_processor_process
|
||||
var/input
|
||||
var/output
|
||||
var/time = 40
|
||||
proc/process(loc, what)
|
||||
if (src.output && loc)
|
||||
new src.output(loc)
|
||||
if (what)
|
||||
del(what)
|
||||
|
||||
/* objs */
|
||||
wheat
|
||||
input = /obj/item/weapon/reagent_containers/food/snacks/grown/wheat
|
||||
output = /obj/item/weapon/reagent_containers/food/snacks/flour
|
||||
monkeymeat
|
||||
input = /obj/item/weapon/reagent_containers/food/snacks/monkeymeat
|
||||
output = /obj/item/weapon/reagent_containers/food/snacks/faggot
|
||||
|
||||
humanmeat
|
||||
input = /obj/item/weapon/reagent_containers/food/snacks/humanmeat
|
||||
output = /obj/item/weapon/reagent_containers/food/snacks/faggot
|
||||
|
||||
potato
|
||||
input = /obj/item/weapon/reagent_containers/food/snacks/grown/potato
|
||||
output = /obj/item/weapon/reagent_containers/food/snacks/fries
|
||||
|
||||
/obj/machinery/processor/attack_hand(user as mob)
|
||||
if(src.processing)
|
||||
user << "The processor is in the process of processing."
|
||||
return
|
||||
for(var/obj/O in src.contents)
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/wheat))
|
||||
src.processing = 1
|
||||
sleep(40)
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
del(O)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/flour(src.loc)
|
||||
src.processing = 0
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeymeat))
|
||||
src.processing = 1
|
||||
sleep(40)
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
del(O)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/faggot(src.loc)
|
||||
src.processing = 0
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/weapon/reagent_containers/food/snacks/humanmeat))
|
||||
src.processing = 1
|
||||
sleep(40)
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
del(O)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/faggot(src.loc)
|
||||
processing = 0
|
||||
return
|
||||
|
||||
if (istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown/potato))
|
||||
src.processing = 1
|
||||
sleep(40)
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
del(O)
|
||||
new /obj/item/weapon/reagent_containers/food/snacks/fries(src.loc)
|
||||
processing = 0
|
||||
return
|
||||
|
||||
|
||||
for(var/mob/O in src.contents)
|
||||
if(istype(O, /mob/living/carbon/alien/larva/metroid))
|
||||
src.processing = 1
|
||||
sleep(40)
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
var/mob/dead/observer/newmob
|
||||
/* mobs */
|
||||
mob
|
||||
process(loc, what)
|
||||
var/mob/O = what
|
||||
if (O.client)
|
||||
newmob = new/mob/dead/observer(O)
|
||||
O:client:mob = newmob
|
||||
newmob:client:eye = newmob
|
||||
del(O)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/jar(src.loc)
|
||||
src.processing = 0
|
||||
return
|
||||
user << "There doesn't appear to be anything in the processing chamber."
|
||||
/*
|
||||
/obj/machinery/processor/attackby(obj/item/weapon/grab/G as obj, mob/user as mob)
|
||||
if(istype(G.affecting, /mob/living/carbon/alien/larva/metroid))
|
||||
sleep(40)
|
||||
var/mob/dead/observer/newmob = new/mob/dead/observer(O)
|
||||
O.client.mob = newmob
|
||||
newmob.client.eye = newmob
|
||||
..()
|
||||
|
||||
|
||||
metroid
|
||||
input = /mob/living/carbon/alien/larva/metroid
|
||||
output = /obj/item/weapon/reagent_containers/food/drinks/jar
|
||||
|
||||
monkey
|
||||
process(loc, what)
|
||||
var/mob/living/carbon/monkey/O = what
|
||||
if (O.client) //grief-proof
|
||||
O.loc = loc
|
||||
O.visible_message("\blue Suddenly [O] jumps out from the processor!", \
|
||||
"You jump out from the processor", \
|
||||
"You hear chimp")
|
||||
return
|
||||
var/obj/item/weapon/reagent_containers/glass/bucket/bucket_of_blood = new(loc)
|
||||
var/datum/reagent/blood/B = new()
|
||||
B.holder = bucket_of_blood
|
||||
B.volume = 70
|
||||
//set reagent data
|
||||
B.data["donor"] = O
|
||||
if(O.virus && O.virus.spread_type != SPECIAL)
|
||||
B.data["virus"] = new O.virus.type(0)
|
||||
B.data["blood_DNA"] = copytext(O.dna.unique_enzymes,1,0)
|
||||
if(O.resistances&&O.resistances.len)
|
||||
B.data["resistances"] = O.resistances.Copy()
|
||||
bucket_of_blood.reagents.reagent_list += B
|
||||
bucket_of_blood.reagents.update_total()
|
||||
bucket_of_blood.on_reagent_change()
|
||||
//bucket_of_blood.reagents.handle_reactions() //blood doesn't react
|
||||
..()
|
||||
|
||||
input = /mob/living/carbon/monkey
|
||||
output = null
|
||||
|
||||
/obj/machinery/processor/proc/select_recipe(var/X)
|
||||
for (var/Type in typesof(/datum/food_processor_process) - /datum/food_processor_process - /datum/food_processor_process/mob)
|
||||
var/datum/food_processor_process/P = new Type()
|
||||
if (!istype(X, P.input))
|
||||
continue
|
||||
return P
|
||||
return 0
|
||||
|
||||
/obj/machinery/processor/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(src.processing)
|
||||
user << "\red The processor is in the process of processing."
|
||||
return 1
|
||||
if(src.contents.len > 0) //TODO: several items at once? several different items?
|
||||
user << "\red Something is already in the processing chamber."
|
||||
return 1
|
||||
var/what = O
|
||||
if (istype(O, /obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
what = G.affecting
|
||||
|
||||
var/datum/food_processor_process/P = select_recipe(what)
|
||||
if (!P)
|
||||
user << "\red That probably won't blend."
|
||||
return 1
|
||||
user.visible_message("[user] put [what] into [src].", \
|
||||
"You put the [what] into [src].")
|
||||
user.drop_item()
|
||||
what:loc = src
|
||||
return
|
||||
|
||||
/obj/machinery/processor/attack_hand(var/mob/user as mob)
|
||||
if(src.processing)
|
||||
user << "\red The processor is in the process of processing."
|
||||
return 1
|
||||
if(src.contents.len == 0)
|
||||
user << "\red The processor is empty."
|
||||
return 1
|
||||
for(var/O in src.contents)
|
||||
var/datum/food_processor_process/P = select_recipe(O)
|
||||
if (!P)
|
||||
log_admin("DEBUG: [O] in processor havent suitable recipe. How do you put it in?") //-rastaf0
|
||||
continue
|
||||
src.processing = 1
|
||||
user.visible_message("\blue [user] turns on \a [src].", \
|
||||
"You turn on \a [src].", \
|
||||
"You hear food processor")
|
||||
playsound(src.loc, 'blender.ogg', 50, 1)
|
||||
for(var/mob/V in viewers(src, null))
|
||||
V.show_message(text("\blue [user] turns on \a [src]."))
|
||||
var/mob/dead/observer/newmob
|
||||
if (G.affecting.client)
|
||||
newmob = new/mob/dead/observer(G.affecting)
|
||||
G.affecting:client:mob = newmob
|
||||
newmob:client:eye = newmob
|
||||
del(G.affecting)
|
||||
del(G)
|
||||
new /obj/item/weapon/reagent_containers/food/drinks/jar(src.loc)
|
||||
*/
|
||||
sleep(P.time)
|
||||
P.process(src.loc, O)
|
||||
src.processing = 0
|
||||
src.visible_message("\blue \the [src] finished processing.", \
|
||||
"You hear food processor stop")
|
||||
|
||||
|
||||
|
||||
|
||||
+126
-124
@@ -5,6 +5,8 @@ tbh this could likely be better and I did not use all that many comments on it.
|
||||
However people seem to like it for some reason.
|
||||
*/////////////////////////////////////////////////
|
||||
|
||||
#define collector_control_range 12
|
||||
|
||||
/////SINGULARITY SPAWNER
|
||||
/obj/machinery/the_singularitygen/
|
||||
name = "Gravitational Singularity Generator"
|
||||
@@ -73,6 +75,7 @@ However people seem to like it for some reason.
|
||||
if(Ti)
|
||||
src.Dtime = Ti
|
||||
..()
|
||||
notify_collector_controller()
|
||||
|
||||
/obj/machinery/the_singularity/attack_hand(mob/user as mob)
|
||||
return 1
|
||||
@@ -83,12 +86,17 @@ However people seem to like it for some reason.
|
||||
/obj/machinery/the_singularity/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src) //TODO: some animation
|
||||
del(src)
|
||||
return
|
||||
if(2.0 to 3.0) //no way
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/the_singularity/Del()
|
||||
//TODO: some animation
|
||||
notify_collector_controller()
|
||||
..()
|
||||
|
||||
/obj/machinery/the_singularity/process()
|
||||
eat()
|
||||
|
||||
@@ -113,6 +121,7 @@ However people seem to like it for some reason.
|
||||
if ( is_surrounded && active )
|
||||
src.active = 0
|
||||
src.dieot = 0
|
||||
notify_collector_controller()
|
||||
spawn(50)
|
||||
if (!active)
|
||||
grav_pull = 6
|
||||
@@ -121,12 +130,18 @@ However people seem to like it for some reason.
|
||||
src.active = 1
|
||||
src.dieot = 1
|
||||
grav_pull = 8
|
||||
notify_collector_controller()
|
||||
if(active == 1)
|
||||
move()
|
||||
spawn(5)
|
||||
move()
|
||||
|
||||
|
||||
/obj/machinery/the_singularity/proc/notify_collector_controller()
|
||||
var/oldsrc = src
|
||||
src = 0 //for spawn() working even after Del(), see byond documentation about sleep() -rastaf0
|
||||
for(var/obj/machinery/power/collector_control/myCC in orange(collector_control_range,oldsrc))
|
||||
spawn() myCC.updatecons()
|
||||
|
||||
/obj/machinery/the_singularity
|
||||
var/global/list/uneatable = list(\
|
||||
@@ -287,6 +302,7 @@ However people seem to like it for some reason.
|
||||
new/obj/item/weapon/tile (X)
|
||||
X:break_tile_to_plating()
|
||||
else
|
||||
|
||||
X:break_tile()
|
||||
else if(istype(X,/turf/simulated/wall))
|
||||
if (istype(X,/turf/simulated/wall/r_wall))
|
||||
@@ -566,51 +582,30 @@ However people seem to like it for some reason.
|
||||
icon_state = "Emitter"
|
||||
|
||||
/obj/machinery/emitter/attack_hand(mob/user as mob)
|
||||
if (..())
|
||||
return
|
||||
if(state == 3)
|
||||
if(!src.locked)
|
||||
if(!src.locked || istype(user, /mob/living/silicon))
|
||||
src.add_fingerprint(user)
|
||||
if(src.active==1)
|
||||
src.active = 0
|
||||
user << "You turn off the emitter."
|
||||
user << "You turn off the [src]."
|
||||
else
|
||||
src.active = 1
|
||||
user << "You turn on the emitter."
|
||||
user << "You turn on the [src]."
|
||||
src.shot_number = 0
|
||||
src.fire_delay = 100
|
||||
update_icon()
|
||||
else
|
||||
user << "The controls are locked!"
|
||||
else
|
||||
user << "The emitter needs to be firmly secured to the floor first."
|
||||
user << "The [src] needs to be firmly secured to the floor first."
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/emitter/attack_ai(mob/user as mob)
|
||||
if (..())
|
||||
return
|
||||
if(state == 3)
|
||||
src.add_fingerprint(user)
|
||||
if(src.active==1)
|
||||
src.active = 0
|
||||
user << "You turn off the emitter."
|
||||
else
|
||||
src.active = 1
|
||||
user << "You turn on the emitter."
|
||||
src.shot_number = 0
|
||||
src.fire_delay = 100
|
||||
update_icon()
|
||||
else
|
||||
user << "The emitter needs to be firmly secured to the floor first."
|
||||
|
||||
|
||||
/obj/machinery/emitter/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(!src.state == 3)
|
||||
if(!src.state == 3 || !anchored)
|
||||
src.active = 0
|
||||
return
|
||||
|
||||
@@ -661,7 +656,7 @@ However people seem to like it for some reason.
|
||||
/obj/machinery/emitter/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
user << "\red Turn off the emitter first."
|
||||
user << "\red Turn off the [src] first."
|
||||
return 1
|
||||
|
||||
else if(state == 0)
|
||||
@@ -685,10 +680,10 @@ However people seem to like it for some reason.
|
||||
|
||||
else if(istype(W, /obj/item/weapon/weldingtool) && W:welding)
|
||||
if (state == 0)
|
||||
user << "\red The emitter needs to be wrenched to the floor first."
|
||||
user << "\red The [src] needs to be wrenched to the floor first."
|
||||
return 1
|
||||
|
||||
if (W:get_fuel() < 1)
|
||||
if (W:get_fuel() < 2) //weldingtool always uses 1 additional unit of fuel
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return 1
|
||||
W:use_fuel(1)
|
||||
@@ -697,21 +692,21 @@ However people seem to like it for some reason.
|
||||
|
||||
if(state == 1)
|
||||
user.visible_message("[user.name] start to weld [src.name] to the floor.", \
|
||||
"You start to weld the emitter to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 3
|
||||
user << "You weld the emitter to the floor."
|
||||
user << "You weld the [src] to the floor."
|
||||
else
|
||||
return 1
|
||||
|
||||
else if(state == 3)
|
||||
user.visible_message("[user.name] start to cut [src.name] to the floor.", \
|
||||
"You start to cut the emitter free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 1
|
||||
user << "You cut the emitter free from the floor."
|
||||
user << "You cut the [src] free from the floor."
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -776,20 +771,34 @@ However people seem to like it for some reason.
|
||||
icon_state = "ca"
|
||||
flick("ca_deactive", src)
|
||||
|
||||
/obj/machinery/power/collector_array/proc/eject()
|
||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||
Z.loc = get_turf(src)
|
||||
Z.layer = initial(Z.layer)
|
||||
src.P = null
|
||||
if (src.active)
|
||||
src.active = 0
|
||||
updateicon_off()
|
||||
else
|
||||
updateicon()
|
||||
if (CU)
|
||||
CU.updatecons()
|
||||
|
||||
/obj/machinery/power/collector_array/power_change()
|
||||
..()
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/power/collector_array/process()
|
||||
|
||||
if(P)
|
||||
if(P.air_contents.toxins <= 0)
|
||||
if(src.active == 1)
|
||||
if(P)
|
||||
if(P.air_contents.toxins <= 0)
|
||||
P.air_contents.toxins = 0
|
||||
src.active = 0
|
||||
updateicon_off()
|
||||
else
|
||||
src.active = 0
|
||||
updateicon_off()
|
||||
else if(src.active == 1)
|
||||
src.active = 0
|
||||
updateicon_off()
|
||||
..()
|
||||
//use_power called from collector_array/process
|
||||
|
||||
/obj/machinery/power/collector_array/attack_hand(mob/user as mob)
|
||||
if (..())
|
||||
@@ -838,17 +847,7 @@ However people seem to like it for some reason.
|
||||
else if(istype(W, /obj/item/weapon/crowbar))
|
||||
if(!P)
|
||||
return 1
|
||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||
Z.loc = get_turf(src)
|
||||
Z.layer = initial(Z.layer)
|
||||
src.P = null
|
||||
if (src.active)
|
||||
src.active = 0
|
||||
updateicon_off()
|
||||
else
|
||||
updateicon()
|
||||
if (CU)
|
||||
CU.updatecons()
|
||||
eject()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(active)
|
||||
@@ -866,8 +865,8 @@ However people seem to like it for some reason.
|
||||
user.visible_message("[user.name] unsecure [src.name] reinforcing bolts to the floor.", \
|
||||
"You undo the external reinforcing bolts.", \
|
||||
"You hear ratchet")
|
||||
if (CU)
|
||||
CU.updatecons()
|
||||
for(var/obj/machinery/power/collector_control/myCC in orange(1,src))
|
||||
myCC.updatecons()
|
||||
|
||||
else
|
||||
user.visible_message("\red The [src.name] has been hit with the [W.name] by [user.name]!", \
|
||||
@@ -878,11 +877,14 @@ However people seem to like it for some reason.
|
||||
/obj/machinery/power/collector_array/ex_act(severity)
|
||||
switch(severity)
|
||||
if(2.0 to 3.0)
|
||||
var/obj/item/weapon/tank/plasma/Z = src.P
|
||||
Z.loc = get_turf(src)
|
||||
Z.layer = initial(Z.layer)
|
||||
src.P = null
|
||||
eject()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/collector_array/Del()
|
||||
. = ..()
|
||||
for(var/obj/machinery/power/collector_control/myCC in orange(1,src))
|
||||
myCC.updatecons()
|
||||
|
||||
////////////CONTROL UNIT
|
||||
|
||||
/obj/machinery/power/collector_control
|
||||
@@ -921,14 +923,19 @@ However people seem to like it for some reason.
|
||||
|
||||
/obj/machinery/power/collector_control/proc/updatecons()
|
||||
S = list()
|
||||
for(var/obj/machinery/the_singularity/myS in orange(12,src))
|
||||
for(var/obj/machinery/the_singularity/myS in orange(collector_control_range,src))
|
||||
S += myS
|
||||
|
||||
for (var/ca_dir in cardinal)
|
||||
for (var/ca_dir in list( WEST, EAST, NORTH, SOUTH ) /* cardinal*/ )
|
||||
var/obj/machinery/power/collector_array/newCA = locate() in get_step(src,ca_dir)
|
||||
if (isnull(newCA))
|
||||
continue
|
||||
if (!newCA.anchored)
|
||||
if (!isnull(newCA.CU) && newCA.CU != src)
|
||||
var/n = CA.Find(newCA)
|
||||
if (n)
|
||||
CA[n] = null
|
||||
continue
|
||||
if (!newCA.anchored || (!isnull(newCA.CU) && newCA.CU != src))
|
||||
var/n = CA.Find(newCA)
|
||||
if (n)
|
||||
CA[n] = null
|
||||
@@ -947,12 +954,14 @@ However people seem to like it for some reason.
|
||||
return
|
||||
overlays += image('singularity.dmi', "cu on")
|
||||
var/err = 0
|
||||
for (var/i = 1, ((i<= CA.len) && (i<=4)), i++)
|
||||
for (var/i = 1, i <= CA.len, i++)
|
||||
var/obj/machinery/power/collector_array/myCA = CA[i]
|
||||
if(myCA)
|
||||
if (myCA.P)
|
||||
if(myCA.active)
|
||||
overlays += image('singularity.dmi', "cu [i] on")
|
||||
if (myCA.P.air_contents.toxins <= 0)
|
||||
err = 1
|
||||
else
|
||||
err = 1
|
||||
if(err)
|
||||
@@ -962,7 +971,7 @@ However people seem to like it for some reason.
|
||||
overlays += image('singularity.dmi', "cu sing")
|
||||
break
|
||||
for (var/obj/machinery/the_singularity/myS in S)
|
||||
if(myS && !myS.active)
|
||||
if(myS && myS.active)
|
||||
overlays += image('singularity.dmi', "cu conterr")
|
||||
break
|
||||
|
||||
@@ -977,31 +986,30 @@ However people seem to like it for some reason.
|
||||
/obj/machinery/power/collector_control/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(src.active == 1)
|
||||
var/power_a = 0
|
||||
var/power_s = 0
|
||||
var/power_p = 0
|
||||
if(!active)
|
||||
return
|
||||
var/power_a = 0
|
||||
var/power_s = 0
|
||||
var/power_p = 0
|
||||
|
||||
for (var/obj/machinery/the_singularity/myS in S)
|
||||
if(!isnull(myS))
|
||||
power_s += myS.energy
|
||||
for (var/obj/machinery/the_singularity/myS in S)
|
||||
if(!isnull(myS))
|
||||
power_s += myS.energy
|
||||
|
||||
for (var/i = 1, i<= CA.len, i++)
|
||||
var/obj/machinery/power/collector_array/myCA = CA[i]
|
||||
if (!myCA)
|
||||
continue
|
||||
var/obj/item/weapon/tank/plasma/myP = myCA.P
|
||||
if(myP)
|
||||
if (myCA.active)
|
||||
myCA.use_power(250)
|
||||
power_p += myP.air_contents.toxins
|
||||
myP.air_contents.toxins -= 0.001
|
||||
for (var/i = 1, i<= CA.len, i++)
|
||||
var/obj/machinery/power/collector_array/myCA = CA[i]
|
||||
if (!myCA)
|
||||
continue
|
||||
var/obj/item/weapon/tank/plasma/myP = myCA.P
|
||||
if (myCA.active && myP)
|
||||
myCA.use_power(250)
|
||||
power_p += myP.air_contents.toxins
|
||||
myP.air_contents.toxins -= 0.001
|
||||
|
||||
power_a = power_p*power_s*50
|
||||
src.lastpower = power_a
|
||||
add_avail(power_a)
|
||||
use_power(250)
|
||||
..()
|
||||
power_a = power_p*power_s*50
|
||||
src.lastpower = power_a
|
||||
add_avail(power_a)
|
||||
use_power(250)
|
||||
|
||||
|
||||
/obj/machinery/power/collector_control/attack_hand(mob/user as mob)
|
||||
@@ -1013,14 +1021,14 @@ However people seem to like it for some reason.
|
||||
return 1
|
||||
src.active = !src.active
|
||||
if(!src.active)
|
||||
user << "You turn off the collector control."
|
||||
user << "You turn off the [src]."
|
||||
src.lastpower = 0
|
||||
updateicon()
|
||||
if(src.active)
|
||||
user << "You turn on the collector control."
|
||||
user << "You turn on the [src]."
|
||||
updatecons()
|
||||
else
|
||||
user << "\red The collector control needs to be secured to the floor first."
|
||||
user << "\red The [src] needs to be secured to the floor first."
|
||||
return 1
|
||||
|
||||
/obj/machinery/power/collector_control/attackby(obj/item/W, mob/user)
|
||||
@@ -1040,7 +1048,7 @@ However people seem to like it for some reason.
|
||||
connect_to_network()
|
||||
else
|
||||
user.visible_message("[user.name] unsecure [src.name] to the floor.", \
|
||||
"You undo the collector control securing bolts.", \
|
||||
"You undo the [src] securing bolts.", \
|
||||
"You hear ratchet")
|
||||
disconnect_from_network()
|
||||
else
|
||||
@@ -1050,7 +1058,7 @@ However people seem to like it for some reason.
|
||||
src.add_fingerprint(user)
|
||||
|
||||
/////FIELD GEN
|
||||
|
||||
#define field_generator_max_power 250
|
||||
/obj/machinery/field_generator
|
||||
name = "Field Generator"
|
||||
desc = "Projects an energy field when active"
|
||||
@@ -1063,7 +1071,6 @@ However people seem to like it for some reason.
|
||||
var/Varpower = 0
|
||||
var/active = 0
|
||||
var/power = 20
|
||||
var/max_power = 250
|
||||
var/state = 0
|
||||
//var/steps = 0
|
||||
//var/last_check = 0
|
||||
@@ -1081,9 +1088,9 @@ However people seem to like it for some reason.
|
||||
return
|
||||
var/level = 3
|
||||
switch (power)
|
||||
if(0 to 40)
|
||||
if(0 to 60)
|
||||
level = 1
|
||||
if(41 to 220)
|
||||
if(61 to 220)
|
||||
level = 2
|
||||
if(221 to INFINITY)
|
||||
level = 3
|
||||
@@ -1092,9 +1099,16 @@ However people seem to like it for some reason.
|
||||
powerlevel = level
|
||||
icon_state = "Field_Gen +a[powerlevel]"
|
||||
|
||||
/obj/machinery/field_generator/proc/turn_off()
|
||||
src.active = 0
|
||||
spawn(1)
|
||||
src.cleanup()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/field_generator/proc/turn_on()
|
||||
src.active = 1
|
||||
warming_up = 1
|
||||
powerlevel = 0
|
||||
spawn(1)
|
||||
while (warming_up<3 && active)
|
||||
sleep(50)
|
||||
@@ -1104,36 +1118,23 @@ However people seem to like it for some reason.
|
||||
|
||||
/obj/machinery/field_generator/attack_hand(mob/user as mob)
|
||||
if(state == 3)
|
||||
if(!src.locked)
|
||||
if(!src.locked || istype(user, /mob/living/silicon))
|
||||
if(src.active >= 1)
|
||||
// src.active = 0
|
||||
// icon_state = "Field_Gen"
|
||||
user << "You are unable to turn off the field generator, wait till it powers down."
|
||||
user << "You are unable to turn off the [src]r, wait till it powers down."
|
||||
// src.cleanup()
|
||||
return 1
|
||||
else
|
||||
user.visible_message("[user.name] turn on [src.name]", \
|
||||
"You turn on the field generator.", \
|
||||
"You turn on the [src].", \
|
||||
"You hear heavy droning")
|
||||
turn_on()
|
||||
src.add_fingerprint(user)
|
||||
else
|
||||
user << "The controls are locked!"
|
||||
else
|
||||
user << "The field generator needs to be firmly secured to the floor first."
|
||||
|
||||
/obj/machinery/field_generator/attack_ai(mob/user as mob)
|
||||
if(state == 3)
|
||||
if(src.active >= 1)
|
||||
user << "You are unable to turn off the field generator, wait till it powers down."
|
||||
else
|
||||
user.visible_message("[user.name] turn on [src.name]", \
|
||||
"You turn on the field generator.", \
|
||||
"You hear heavy droning")
|
||||
turn_on()
|
||||
src.add_fingerprint(user)
|
||||
else
|
||||
user << "The field generator needs to be firmly secured to the floor first."
|
||||
user << "The [src] needs to be firmly secured to the floor first."
|
||||
|
||||
/obj/machinery/field_generator/New()
|
||||
..()
|
||||
@@ -1146,13 +1147,14 @@ However people seem to like it for some reason.
|
||||
if(src.active == 0)
|
||||
src.active = 1
|
||||
src.state = 3
|
||||
src.power = 250
|
||||
src.power = field_generator_max_power
|
||||
src.anchored = 1
|
||||
src.warming_up = 1
|
||||
Varedit_start = 0
|
||||
|
||||
if(src.active == 1)
|
||||
if(!src.state == 3)
|
||||
src.active = 0
|
||||
if(!src.state == 3 || !anchored)
|
||||
turn_off()
|
||||
return
|
||||
spawn(1)
|
||||
setup_field(1)
|
||||
@@ -1165,17 +1167,16 @@ However people seem to like it for some reason.
|
||||
src.active = 2
|
||||
if(src.power < 0)
|
||||
src.power = 0
|
||||
if(src.power > src.max_power)
|
||||
src.power = src.max_power
|
||||
if(src.power > field_generator_max_power)
|
||||
src.power = field_generator_max_power
|
||||
if(src.active >= 1)
|
||||
src.power -= 1
|
||||
if(Varpower == 0)
|
||||
if(src.power <= 0)
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] shuts down due to lack of power!")
|
||||
src.active = 0
|
||||
spawn(1)
|
||||
src.cleanup()
|
||||
turn_off()
|
||||
return
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/field_generator/proc/setup_field(var/NSEW)
|
||||
@@ -1214,7 +1215,7 @@ However people seem to like it for some reason.
|
||||
/obj/machinery/field_generator/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/wrench) && state!=3)
|
||||
if(active)
|
||||
user << "Turn off the field generator first."
|
||||
user << "Turn off the [src] first."
|
||||
return 1
|
||||
|
||||
if(state == 0)
|
||||
@@ -1237,7 +1238,7 @@ However people seem to like it for some reason.
|
||||
if(state == 0)
|
||||
user << "\red The [src.name] needs to be wrenched to the floor first."
|
||||
return 1
|
||||
if (W:get_fuel() < 1)
|
||||
if (W:get_fuel() < 2)
|
||||
user << "\blue You need more welding fuel to complete this task."
|
||||
return 1
|
||||
W:use_fuel(1)
|
||||
@@ -1246,7 +1247,7 @@ However people seem to like it for some reason.
|
||||
|
||||
if(state == 1)
|
||||
user.visible_message("[user.name] start to weld [src.name] to the floor.", \
|
||||
"You start to weld the field generator to the floor.", \
|
||||
"You start to weld the [src] to the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 3
|
||||
@@ -1256,11 +1257,11 @@ However people seem to like it for some reason.
|
||||
|
||||
else if(state == 3)
|
||||
user.visible_message("[user.name] start to cut [src.name] free from the floor.", \
|
||||
"You start to cut the field generator free from the floor.", \
|
||||
"You start to cut the [src] free from the floor.", \
|
||||
"You hear welding")
|
||||
if (do_after(user,20))
|
||||
state = 1
|
||||
user << "You cut the field generator free from the floor."
|
||||
user << "You cut the [src] free from the floor."
|
||||
else
|
||||
return 1
|
||||
|
||||
@@ -1302,7 +1303,8 @@ However people seem to like it for some reason.
|
||||
if (isnull(F))
|
||||
continue
|
||||
G = (F.gen_primary == src) ? F.gen_secondary : F.gen_primary
|
||||
G.fields -= F
|
||||
if (G)
|
||||
G.fields -= F
|
||||
del(F)
|
||||
fields = list()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user