Singularity Engine
-Recoded some parts, still works mostly the same
Welders
-Recoded, it works mostly the same but is easier to use in code
-Cyborgs have a larger fuel tank
-Brought most if not all of the areas that use welders upto spec
Moved the changeling chem recharge code into the human life proc
New players who log out before spawning in are now deleted
New minor Common event
Machines around the station use more power, system might need some changes later
Likely few other minor changes that I just cant think of atm

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@945 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-02-03 08:15:17 +00:00
parent e78f6c0d50
commit cd79ae951d
67 changed files with 3276 additions and 3238 deletions
+10 -2
View File
@@ -19,7 +19,7 @@
src.icon = 'alert.dmi'
src.layer = 10
// update_lights()
if(name == "Space") // override defaults for space
requires_power = 0
@@ -56,7 +56,15 @@
A = A.loc
return null
*/
/*
/area/proc/update_lights()
var/new_power = 0
for(var/obj/machinery/light/L in src.contents)
if(L.on)
new_power += (L.luminosity * 20)
lighting_power_usage = new_power
return
*/
/area/proc/poweralert(var/state, var/source)
if (state != poweralm)
poweralm = state
-1
View File
@@ -645,7 +645,6 @@
/obj/machinery/scan_consolenew/process() //not really used right now
if(stat & (NOPOWER|BROKEN))
return
use_power(250) // power stuff
if (!( src.status )) //remove this
return
return
+3
View File
@@ -1,4 +1,7 @@
/proc/start_events()
if(prob(50))//Every 120 seconds and prob 50 4-8 weak spacedusts will hit the station
spawn(1)
dust_swarm("weak")
if (!event && prob(eventchance))
event()
hadevent = 1
+117
View File
@@ -0,0 +1,117 @@
/*
Space dust
Commonish random event that causes small clumps of "space dust" to hit the station at high speeds.
No command report on the common version of this event.
The "dust" will damage the hull of the station causin minor hull breaches.
*/
/proc/dust_swarm(var/strength = "weak")
var/numbers = 1
switch(strength)
if("weak")
numbers = rand(4,8)
for(var/i = 0 to numbers)
new/obj/space_dust/weak()
if("norm")
numbers = rand(5,10)
for(var/i = 0 to numbers)
new/obj/space_dust()
if("strong")
numbers = rand(10,15)
for(var/i = 0 to numbers)
new/obj/space_dust/strong()
if("super")
numbers = rand(15,25)
for(var/i = 0 to numbers)
new/obj/space_dust/super()
return
/obj/space_dust
name = "Space Dust"
desc = "Dust in space."
icon = 'meteor.dmi'
icon_state = "space_dust"
density = 1
anchored = 1
var
strength = 2 //ex_act severity number
life = 2 //how many things we hit before del(src)
weak
strength = 3
life = 1
strong
strength = 1
life = 6
super
strength = 1
life = 40
New()
var/startx = 0
var/starty = 0
var/endy = 0
var/endx = 0
var/startside = pick(cardinal)
switch(startside)
if(NORTH)
starty = world.maxy-1
startx = rand(1, world.maxx-1)
endy = 1
endx = rand(1, world.maxx-1)
if(EAST)
starty = rand(1,world.maxy-1)
startx = world.maxx-1
endy = rand(1, world.maxy-1)
endx = 1
if(SOUTH)
starty = 1
startx = rand(1, world.maxx-1)
endy = world.maxy-1
endx = rand(1, world.maxx-1)
if(WEST)
starty = rand(1, world.maxy-1)
startx = 1
endy = rand(1,world.maxy-1)
endx = world.maxx-1
var/goal = locate(endx, endy, src.z)
src.x = startx
src.y = starty
spawn(0)
walk_towards(src, goal, 1)
return
Bump(atom/A)
spawn(0)
if(prob(50))
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
if (A)
playsound(src.loc, 'meteorimpact.ogg', 40, 1)
if(ismob(A))
A.meteorhit(src)//This should work for now I guess
else
A.ex_act(strength)
life--
if(life <= 0)
spawn(0)
del(src)
return 0
return
Bumped(atom/A)
Bump(A)
return
ex_act(severity)
del(src)
return
+3 -4
View File
@@ -1,5 +1,7 @@
/obj/machinery/alarm
power_usage = 5
power_channel = ENVIRON
var/frequency = 1439
var/list/sensors = list()
var/list/vents = list()
@@ -61,7 +63,7 @@
return
spawn (10)
send_signal(m_id, "init", new_name )
set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
@@ -352,7 +354,6 @@
icon_state = "alarmp"
return
use_power(5, ENVIRON)
if (!( istype(location, /turf) ))
return 0
@@ -574,8 +575,6 @@
if(stat & (NOPOWER|BROKEN))
return
use_power(10, ENVIRON)
var/area/A = src.loc
A = A.loc
+1
View File
@@ -16,6 +16,7 @@ the blender or the processor: Processor items are solid objects and Blender resu
icon_state = "blender_e"
density = 1
anchored = 1
power_usage = 20
flags = OPENCONTAINER //So that you can pour stuff into it.
var/processing = 0 //This turns on (1) while it is processing so you don't accidentally get multiples from the same item.
var/container = 1 //Is there a jug attached? Could have been done with a for loop but it's less code this way.
+1 -4
View File
@@ -781,8 +781,7 @@ Auto Patrol: []"},
src.icon_state = "ed209_shell"
del(W)
else if ((istype(W, /obj/item/weapon/weldingtool)) && (src.build_step == 3))
if ((W:welding) && (W:get_fuel() >= 1))
W:use_fuel(1)
if (W:remove_fuel(1,user))
src.build_step++
src.name = "shielded frame assembly"
user << "You welded the vest to [src]!"
@@ -864,10 +863,8 @@ Auto Patrol: []"},
var/obj/beam/a_laser/A
if (src.emagged)
A = new /obj/beam/a_laser( loc )
use_power(50)
else
A = new /obj/bullet/electrode( loc )
use_power(100)
if (!( istype(U, /turf) ))
//A = null
+1 -2
View File
@@ -756,8 +756,7 @@ Auto Patrol: []"},
/obj/item/weapon/secbot_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
if ((istype(W, /obj/item/weapon/weldingtool)) && (!src.build_step))
if ((W:welding) && (W:get_fuel() >= 1))
W:use_fuel(1)
if(W:remove_fuel(1,user))
src.build_step++
src.overlays += image('aibots.dmi', "hs_hole")
user << "You weld a hole in [src]!"
+1 -1
View File
@@ -143,7 +143,7 @@
/obj/machinery/computer/aifixer/process()
if(stat & (NOPOWER|BROKEN))
return
use_power(500)
src.updateDialog()
return
+3 -7
View File
@@ -800,19 +800,15 @@ About the new airlock wires panel:
src.add_fingerprint(user)
if ((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density))
var/obj/item/weapon/weldingtool/W = C
if(W.welding)
if (W.get_fuel() > 2)
W.use_fuel(2)
W.eyecheck(user)
else
user << "Need more welding fuel!"
return
if(W.remove_fuel(2,user))
if (!src.welded)
src.welded = 1
else
src.welded = null
src.update_icon()
return
else
return
else if (istype(C, /obj/item/weapon/screwdriver))
src.p_open = !( src.p_open )
src.update_icon()
+26 -32
View File
@@ -20,44 +20,38 @@
src.add_fingerprint(user)
if ((istype(C, /obj/item/weapon/weldingtool) && !( src.operating ) && src.density))
var/obj/item/weapon/weldingtool/W = C
if(W.welding)
if (W.get_fuel() > 2)
W.use_fuel(2)
if (!( src.blocked ))
src.blocked = 1
else
src.blocked = 0
if(W.remove_fuel(2, user))
src.blocked = !src.blocked
user << text("\red You [blocked?"welded":"unwelded"] the [src]")
update_icon()
return
if (!( istype(C, /obj/item/weapon/crowbar) ))
return
if (istype(C, /obj/item/weapon/crowbar))
if (!src.blocked && !src.operating)
if(src.density)
spawn( 0 )
src.operating = 1
if (!src.blocked && !src.operating)
if(src.density)
spawn( 0 )
src.operating = 1
animate("opening")
sleep(15)
src.density = 0
update_icon()
animate("opening")
sleep(15)
src.density = 0
update_icon()
src.sd_SetOpacity(0)
src.operating = 0
return
else //close it up again
spawn( 0 )
src.operating = 1
src.sd_SetOpacity(0)
src.operating = 0
return
else //close it up again
spawn( 0 )
src.operating = 1
animate("closing")
src.density = 1
sleep(15)
update_icon()
animate("closing")
src.density = 1
sleep(15)
update_icon()
src.sd_SetOpacity(1)
src.operating = 0
return
src.sd_SetOpacity(1)
src.operating = 0
return
..()
return
/obj/machinery/door/firedoor/process()
-2
View File
@@ -53,8 +53,6 @@
src.state = "off"
src.icon_state = "holopad0"
src.slave_holo = null
else
use_power(300)
if(src.state == "off" && src.slave_holo) //usually happens if the power ran out
del(src.slave_holo) //code for returning the control back to the AI is in the mob's del() code
src.slave_holo = null
+1
View File
@@ -3,6 +3,7 @@ obj/machinery/recharger
icon = 'stationobjs.dmi'
icon_state = "recharger0"
name = "recharger"
power_usage = 50
var
obj/item/weapon/gun/energy/charging = null
+1 -1
View File
@@ -4,7 +4,7 @@
icon_state = "pod_0"
density = 1
anchored = 1.0
power_usage = 80
var/mob/occupant = null
+1 -2
View File
@@ -7,6 +7,7 @@
var/metal_amount = 0
var/operating = 0
var/obj/item/robot_parts/being_built = null
power_usage = 1000
/obj/machinery/robotic_fabricator/attackby(var/obj/item/O as obj, var/mob/user as mob)
if (istype(O, /obj/item/stack/sheet/metal))
@@ -39,8 +40,6 @@
if (stat & (NOPOWER | BROKEN))
return
use_power(1000)
/obj/machinery/robotic_fabricator/attack_paw(user as mob)
return src.attack_hand(user)
+1
View File
@@ -34,6 +34,7 @@
var/obj/cable/attached // the attached cable
var/storedpower = 0
flags = FPRINT | CONDUCT
power_usage = 500
/obj/machinery/shield
name = "shield"
File diff suppressed because it is too large Load Diff
+1 -5
View File
@@ -11,7 +11,7 @@
name = "status display"
anchored = 1
density = 1
power_usage = 250
var/mode = 1 // 0 = Blank
// 1 = Shuttle timer
// 2 = Arbitrary message(s)
@@ -49,8 +49,6 @@
overlays = null
return
use_power(200)
update()
@@ -270,8 +268,6 @@
overlays = null
return
use_power(200)
update()
proc/update()
+3 -3
View File
@@ -63,6 +63,7 @@
var/wasvalid = 0
var/lastfired = 0
var/shot_delay = 30 //3 seconds between shots
power_usage = 100
/obj/machinery/turretcover
name = "pop-up turret cover"
@@ -107,7 +108,6 @@
lastfired = world.time
if (src.cover==null)
src.cover = new /obj/machinery/turretcover(src.loc)
use_power(50)
var/loc = src.loc
if (istype(loc, /turf))
loc = loc:loc
@@ -252,10 +252,10 @@
var/obj/beam/a_laser/A
if (src.lasers)
A = new /obj/beam/a_laser( loc )
use_power(50)
use_power(500)
else
A = new /obj/bullet/electrode( loc )
use_power(100)
use_power(200)
if (!( istype(U, /turf) ))
//A = null
+1 -1
View File
@@ -127,7 +127,7 @@ var/list/sacrificed = list()
M.say("Tok-lyr rqa'nap g'lt-ulotf!")
cultist_count += 1
if(cultist_count >= 9)
var/obj/machinery/the_singularity/S = new /obj/machinery/the_singularity/(src.loc)
var/obj/machinery/singularity/S = new /obj/machinery/singularity/(src.loc)
S.icon = 'magic_terror.dmi'
S.name = "Tear in the Fabric of Reality"
S.desc = "Your mind begins to bubble and ooze as it tries to comprehend what it sees."
+5 -3
View File
@@ -11,6 +11,7 @@ datum/controller/game_controller
setup()
if(master_controller && (master_controller != src))
del(src)
return
//There can be only one master.
if(!air_master)
@@ -76,9 +77,7 @@ datum/controller/game_controller
M.Life()
else
M.Life()
if (M && M.mind) //I think it will be better if author place this under mob/Life() - rastaf0
if (M.mind.special_role == "Changeling")
M.chem_charges = between(0, (max((0.9 - (M.chem_charges / 50)), 0.1) + M.chem_charges), 50)
sleep(-1)
for(var/datum/disease/D in active_diseases)
@@ -86,6 +85,9 @@ datum/controller/game_controller
for(var/obj/machinery/machine in machines)
machine.process()
if(machine)//Testing this for now, might change it up later - Mport
if(machine.power_usage && machine.power_channel)
machine.use_power(machine.power_usage,machine.power_channel)
sleep(-1)
sleep(1)
+5 -7
View File
@@ -705,17 +705,15 @@
return
else if(istype(W, /obj/item/weapon/weldingtool) && W:welding)
if (W:get_fuel() < 2)
user << "\blue You need more welding fuel to complete this task."
if (W:remove_fuel(1,user))
if (src.internal_damage & MECHA_INT_TANK_BREACH)
src.internal_damage &= ~MECHA_INT_TANK_BREACH
user << "\blue You repair the damaged gas tank."
else
return
if (src.internal_damage & MECHA_INT_TANK_BREACH)
src.internal_damage &= ~MECHA_INT_TANK_BREACH
user << "\blue You repair the damaged gas tank."
W:use_fuel(1)
if(src.health<initial(src.health))
user << "\blue You repair some damage to [src.name]."
src.health += min(20, initial(src.health)-src.health)
W:use_fuel(1)
else
user << "The [src.name] is at full integrity"
return
+3 -5
View File
@@ -139,12 +139,10 @@
custom_action(step, atom/used_atom, mob/user)
if(istype(used_atom, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = used_atom
if(W.get_fuel() < 2)
user << ("You need more fuel to complete current task")
return 0
if (W:remove_fuel(2, user))
playsound(holder, 'Welder2.ogg', 50, 1)
else
W.use_fuel(1)
playsound(holder, 'Welder.ogg', 50, 1)
return 0
else if(istype(used_atom, /obj/item/weapon/wrench))
playsound(holder, 'Ratchet.ogg', 50, 1)
+4 -5
View File
@@ -26,18 +26,17 @@
if(salvage_num <= 0)
user << "You can't see anything of value left on this wreck."
return
if (W:get_fuel() < 2)
user << "\blue You need more welding fuel to complete this task."
else
if (W:remove_fuel(1,user))
var/type = prob(70)?pick(welder_salvage):null
if(type)
var/N = new type(get_turf(user))
user.visible_message("[user] cuts [N] from [src]", "You cut [N] from [src]", "You hear a sound of welder nearby")
W:use_fuel(1)
else
user << "You failed to salvage anything valuable from [src]."
salvage_num--
return
else
user << "\blue You need more welding fuel to complete this task."
return
if(istype(W, /obj/item/weapon/wirecutters))
if(salvage_num <= 0)
user << "You can't see anything of value left on this wreck."
+2 -5
View File
@@ -142,10 +142,9 @@
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
if (W:get_fuel() < 2)
if (!W:remove_fuel(1,user))
user << "\blue You need more welding fuel to complete this task."
return
W:use_fuel(1)
new /obj/item/stack/sheet/metal(src.loc)
for (var/mob/M in viewers(src))
M.show_message("\red [src] has been cut apart by [user.name] with the weldingtool.", 3, "\red You hear welding.", 2)
@@ -158,11 +157,9 @@
W.loc = src.loc
else if(istype(W, /obj/item/weapon/weldingtool) && W:welding)
if (W:get_fuel() < 2)
if (!W:remove_fuel(1,user))
user << "\blue You need more welding fuel to complete this task."
return
W:eyecheck(user)
W:use_fuel(1)
src.welded =! src.welded
for(var/mob/M in viewers(src))
M.show_message("\red [src] has been [welded?"welded shut":"unwelded"] by [user.name].", 3, "\red You hear welding.", 2)
+10 -12
View File
@@ -84,20 +84,18 @@ obj/door_assembly
/obj/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/weldingtool) && W:welding && !anchored )
if (W:get_fuel() < 1)
if (W:remove_fuel(1,user))
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
playsound(src.loc, 'Welder2.ogg', 50, 1)
if(do_after(user, 40))
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(get_turf(src), 4)
if(src.glass==1)
new /obj/item/stack/sheet/rglass(get_turf(src))
del(src)
else
user << "\blue You need more welding fuel to dissassemble the airlock assembly."
return
W:use_fuel(1)
user.visible_message("[user] dissassembles the airlock assembly.", "You start to dissassemble the airlock assembly.")
playsound(src.loc, 'Welder2.ogg', 50, 1)
var/turf/T = get_turf(user)
sleep(40)
if(get_turf(user) == T)
user << "\blue You dissasembled the airlock assembly!"
new /obj/item/stack/sheet/metal(get_turf(src), 4)
if(src.glass==1)
new /obj/item/stack/sheet/rglass(get_turf(src))
del(src)
else if(istype(W, /obj/item/weapon/wrench) && !anchored )
playsound(src.loc, 'Ratchet.ogg', 100, 1)
var/turf/T = get_turf(user)
+7 -1
View File
@@ -70,4 +70,10 @@
if(mo)
var/rendered = "<span class='game say'><span class='name'>[M.name]: </span> <span class='message'>[text]</span></span>"
mo.show_message(rendered, 2)
return
return
/proc/is_item_in_list(var/list/L, var/atom/A)
for(var/atom/O in L)
if(O == A)
return 1
return 0
+218 -161
View File
@@ -81,169 +81,226 @@ WELDINGTOOOL
// WELDING TOOL
/obj/item/weapon/weldingtool/New()
var/datum/reagents/R = new/datum/reagents(20)
reagents = R
R.my_atom = src
R.add_reagent("fuel", 20)
return
/obj/item/weapon/weldingtool/examine()
set src in usr
usr << text("\icon[] [] contains [] units of fuel left!", src, src.name, get_fuel() )
return
/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/screwdriver))
status = !status
if (status)
user << "\blue You resecure the welder."
else
user << "\blue The welder can now be attached and modified."
src.add_fingerprint(user)
else if (status == 1 && istype(W,/obj/item/stack/rods))
var/obj/item/stack/rods/R = W
R.use(1)
var/obj/item/assembly/weld_rod/F = new /obj/item/assembly/weld_rod( user )
src.loc = F
F.part1 = src
if (user.client)
user.client.screen -= src
if (user.r_hand == src)
user.u_equip(src)
user.r_hand = F
else
user.u_equip(src)
user.l_hand = F
R.master = F
src.master = F
src.layer = initial(src.layer)
user.u_equip(src)
if (user.client)
user.client.screen -= src
src.loc = F
F.part2 = W
F.layer = 20
R.layer = 20
F.loc = user
src.add_fingerprint(user)
else
..()
// helper functions for weldingtool fuel use
// return fuel amount
/obj/item/weapon/weldingtool/proc/get_fuel()
return reagents.get_reagent_amount("fuel")
// remove fuel amount
/obj/item/weapon/weldingtool/proc/use_fuel(var/amount)
amount = min( get_fuel() , amount)
reagents.remove_reagent("fuel", amount)
return
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob)
if (istype(O, /obj/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, 20)
user << "\blue Welder refueled"
playsound(src.loc, 'refill.ogg', 50, 1, -6)
else if (istype(O, /obj/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.welding)
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
user << "\red That was stupid of you."
explosion(O.loc,-1,0,2)
if(O)
del(O)
else if (src.welding)
use_fuel(1)
/obj/item/weapon/weldingtool
name = "weldingtool"
icon = 'items.dmi'
icon_state = "welder"
flags = FPRINT | TABLEPASS| CONDUCT
force = 3.0
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = 2.0
m_amt = 70
g_amt = 30
var
welding = 0
status = 0
max_fuel = 20
if (get_fuel() <= 0)
usr << "\blue Need more fuel!"
src.welding = 0
src.force = 3
src.damtype = "brute"
src.icon_state = "welder"
var/turf/location = user.loc
if (istype(location, /turf))
location.hotspot_expose(700, 50, 1)
return
/obj/item/weapon/weldingtool/proc/eyecheck(mob/user as mob)
//check eye protection
var/safety = null
if (istype(user, /mob/living/carbon/human))
if (istype(user:head, /obj/item/clothing/head/helmet/welding) || istype(user:head, /obj/item/clothing/head/helmet/space))
safety = 2
else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses))
safety = 1
else if (istype(user:glasses, /obj/item/clothing/glasses/thermal))
safety = -1
else
safety = 0
else if(istype(user, /mob/living/carbon))
safety = 0
switch(safety)
if(1)
usr << "\red Your eyes sting a little."
user.eye_stat += rand(1, 2)
if(user.eye_stat > 12)
user.eye_blurry += rand(3,6)
if(0)
usr << "\red Your eyes burn."
user.eye_stat += rand(2, 4)
if(user.eye_stat > 10)
user.eye_blurry += rand(4,10)
if(-1)
usr << "\red Your thermals intensify the welder's glow. Your eyes itch and burn severely."
user.eye_blurry += rand(12,20)
user.eye_stat += rand(12, 16)
if(user.eye_stat > 10 && safety < 2)
user << "\red Your eyes are really starting to hurt. This can't be good for you!"
if (prob(user.eye_stat - 25 + 1))
user << "\red You go blind!"
user.sdisabilities |= 1
else if (prob(user.eye_stat - 15 + 1))
user << "\red You go blind!"
user.eye_blind = 5
user.eye_blurry = 5
user.disabilities |= 1
spawn(100)
user.disabilities &= ~1
/obj/item/weapon/weldingtool/attack_self(mob/user as mob)
if(status > 1) return
src.welding = !( src.welding )
if (src.welding)
if (get_fuel() <= 0)
user << "\blue Need more fuel!"
src.welding = 0
return 0
user << "\blue You will now weld when you attack."
src.force = 15
src.damtype = "fire"
src.icon_state = "welder1"
processing_items.Add(src)
else
user << "\blue Not welding anymore."
src.force = 3
src.damtype = "brute"
src.icon_state = "welder"
return
/obj/item/weapon/weldingtool/process()
if(!welding)
processing_items.Remove(src)
New()
var/random_fuel = min(rand(10,20),max_fuel)
var/datum/reagents/R = new/datum/reagents(max_fuel)
reagents = R
R.my_atom = src
R.add_reagent("fuel", random_fuel)
return
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/M = location
if(M.l_hand == src || M.r_hand == src)
location = M.loc
if (istype(location, /turf))
location.hotspot_expose(700, 5)
examine()
set src in usr
usr << text("\icon[] [] contains []/[] units of fuel!", src, src.name, get_fuel(),src.max_fuel )
return
attackby(obj/item/W as obj, mob/user as mob)
if (istype(W,/obj/item/weapon/screwdriver))
status = !status
if (status)
user << "\blue You resecure the welder."
else
user << "\blue The welder can now be attached and modified."
src.add_fingerprint(user)
else if (status == 1 && istype(W,/obj/item/stack/rods))
var/obj/item/stack/rods/R = W
R.use(1)
var/obj/item/assembly/weld_rod/F = new /obj/item/assembly/weld_rod( user )
src.loc = F
F.part1 = src
if (user.client)
user.client.screen -= src
if (user.r_hand == src)
user.u_equip(src)
user.r_hand = F
else
user.u_equip(src)
user.l_hand = F
R.master = F
src.master = F
src.layer = initial(src.layer)
user.u_equip(src)
if (user.client)
user.client.screen -= src
src.loc = F
F.part2 = W
F.layer = 20
R.layer = 20
F.loc = user
src.add_fingerprint(user)
else
..()
process()
if(!welding)
processing_items.Remove(src)
return
var/turf/location = src.loc
if(istype(location, /mob/))
var/mob/M = location
if(M.l_hand == src || M.r_hand == src)
location = get_turf(M)
if (istype(location, /turf))
location.hotspot_expose(700, 5)
if(prob(20))//Welders left on now use up fuel, but lets not have them run out quite that fast
remove_fuel(1)
afterattack(obj/O as obj, mob/user as mob)
if (istype(O, /obj/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, max_fuel)
user << "\blue Welder refueled"
playsound(src.loc, 'refill.ogg', 50, 1, -6)
return
else if (istype(O, /obj/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && src.welding)
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
user << "\red That was stupid of you."
explosion(O.loc,-1,0,2)
if(O)
del(O)
return
if (src.welding)
remove_fuel(1)
var/turf/location = get_turf(user)
if (istype(location, /turf))
location.hotspot_expose(700, 50, 1)
return
attack_self(mob/user as mob)
toggle()
return
proc
///GET prop for fuel
get_fuel()
return reagents.get_reagent_amount("fuel")
///SET prop for fuel
///Will also turn it off if it is out of fuel
///The mob argument is not needed but if included will call eyecheck() on it if the welder is on.
remove_fuel(var/amount = 1, var/mob/M = null)
if(!welding || !check_status())
return 0
if(get_fuel() >= amount)
reagents.remove_reagent("fuel", amount)
check_status()
if(M)
eyecheck()//TODO:eyecheck should really be in mob not here
return 1
else
if(M)
M << "\blue You need more welding fuel to complete this task."
return 0
///Quick check to see if we even have any fuel and should shut off
///This could use a better name
check_status()
if((get_fuel() <= 0) && welding)
toggle(1)
return 0
return 1
//toggles the welder off and on
toggle(var/message = 0)
if(status > 1) return
src.welding = !( src.welding )
if (src.welding)
if (remove_fuel(1))
usr << "\blue You switch the [src] on."
src.force = 15
src.damtype = "fire"
src.icon_state = "welder1"
processing_items.Add(src)
else
usr << "\blue Need more fuel!"
src.welding = 0
return
else
if(!message)
usr << "\blue You switch the [src] off."
else
usr << "\blue The [src] shuts off!"
src.force = 3
src.damtype = "brute"
src.icon_state = "welder"
src.welding = 0
eyecheck(mob/user as mob)//TODO:Move this over to /mob/ where it should be
//check eye protection
if(!ishuman() && !ismonkey())
return 1
var/safety = 0
if (istype(user, /mob/living/carbon/human))
if (istype(user:head, /obj/item/clothing/head/helmet/welding) || istype(user:head, /obj/item/clothing/head/helmet/space))
safety = 2
else if (istype(user:glasses, /obj/item/clothing/glasses/sunglasses))
safety = 1
else if (istype(user:glasses, /obj/item/clothing/glasses/thermal))
safety = -1
else
safety = 0
switch(safety)
if(1)
usr << "\red Your eyes sting a little."
user.eye_stat += rand(1, 2)
if(user.eye_stat > 12)
user.eye_blurry += rand(3,6)
if(0)
usr << "\red Your eyes burn."
user.eye_stat += rand(2, 4)
if(user.eye_stat > 10)
user.eye_blurry += rand(4,10)
if(-1)
usr << "\red Your thermals intensify the welder's glow. Your eyes itch and burn severely."
user.eye_blurry += rand(12,20)
user.eye_stat += rand(12, 16)
if(user.eye_stat > 10 && safety < 2)
user << "\red Your eyes are really starting to hurt. This can't be good for you!"
if (prob(user.eye_stat - 25 + 1))
user << "\red You go blind!"
user.sdisabilities |= 1
else if (prob(user.eye_stat - 15 + 1))
user << "\red You go blind!"
user.eye_blind = 5
user.eye_blurry = 5
user.disabilities |= 1
spawn(100)
user.disabilities &= ~1
return
/obj/item/weapon/weldingtool/largetank
name = "weldingtool"
icon = 'items.dmi'
icon_state = "welder"
max_fuel = 40
+11 -15
View File
@@ -15,21 +15,17 @@ FLOOR TILES
if(amount < 2)
user << "\red You need at least two rods to do this."
return
if (W:get_fuel() < 3)
user << "\red You need more welding fuel to complete this task."
return
W:eyecheck(user)
W:use_fuel(2)
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
new_item.add_to_stacks(usr)
for (var/mob/M in viewers(src))
M.show_message("\red [src] is shaped into metal by [user.name] with the weldingtool.", 3, "\red You hear welding.", 2)
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(2)
if (!R && replace)
user.put_in_hand(new_item)
if(W:remove_fuel(2,user))
var/obj/item/stack/sheet/metal/new_item = new(usr.loc)
new_item.add_to_stacks(usr)
for (var/mob/M in viewers(src))
M.show_message("\red [src] is shaped into metal by [user.name] with the weldingtool.", 3, "\red You hear welding.", 2)
var/obj/item/stack/rods/R = src
src = null
var/replace = (user.get_inactive_hand()==R)
R.use(2)
if (!R && replace)
user.put_in_hand(new_item)
return
..()
+20 -22
View File
@@ -325,8 +325,7 @@
return
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
W:eyecheck(user)
var/turf/T = user.loc
var/turf/T = get_turf(user)
if (!( istype(T, /turf) ))
return
@@ -346,19 +345,18 @@
spawn(100) del(O)
return
if (W:get_fuel() < 5)
if (W:remove_fuel(5,user))
user << "\blue Now disassembling the outer wall plating."
playsound(src.loc, 'Welder.ogg', 100, 1)
sleep(100)
if (istype(src, /turf/simulated/wall))
if ((get_turf(user) == T && user.equipped() == W))
user << "\blue You disassembled the outer wall plating."
dismantle_wall()
else
user << "\blue You need more welding fuel to complete this task."
return
W:use_fuel(5)
user << "\blue Now disassembling the outer wall plating."
playsound(src.loc, 'Welder.ogg', 100, 1)
sleep(100)
if (istype(src, /turf/simulated/wall))
if ((user.loc == T && user.equipped() == W))
user << "\blue You disassembled the outer wall plating."
dismantle_wall()
else if(istype(W,/obj/item/apc_frame))
var/obj/item/apc_frame/AH = W
AH.try_build(src)
@@ -809,7 +807,7 @@ turf/simulated/floor/proc/update_icon()
var/list/y_arr
if(src.x <= 1)
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
@@ -884,7 +882,7 @@ turf/simulated/floor/proc/update_icon()
A.loc.Entered(A)
else if (src.y >= world.maxy)
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
var/list/cur_pos = src.get_global_map_pos()
@@ -914,7 +912,7 @@ turf/simulated/floor/proc/update_icon()
if (src.x <= 2)
if(prob(50))
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -935,7 +933,7 @@ turf/simulated/floor/proc/update_icon()
if ((A && A.loc))
A.loc.Entered(A)
else
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -957,7 +955,7 @@ turf/simulated/floor/proc/update_icon()
A.loc.Entered(A)
else if (A.x >= (world.maxx - 1))
if(prob(50))
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -978,7 +976,7 @@ turf/simulated/floor/proc/update_icon()
if ((A && A.loc))
A.loc.Entered(A)
else
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -1000,7 +998,7 @@ turf/simulated/floor/proc/update_icon()
A.loc.Entered(A)
else if (src.y <= 2)
if(prob(50))
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -1021,7 +1019,7 @@ turf/simulated/floor/proc/update_icon()
if ((A && A.loc))
A.loc.Entered(A)
else
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -1044,7 +1042,7 @@ turf/simulated/floor/proc/update_icon()
else if (A.y >= (world.maxy - 1))
if(prob(50))
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))
@@ -1065,7 +1063,7 @@ turf/simulated/floor/proc/update_icon()
if ((A && A.loc))
A.loc.Entered(A)
else
if(istype(A, /obj/meteor))
if(istype(A, /obj/meteor)||istype(A, /obj/space_dust))
del(A)
return
if(istype(A,/mob/living/carbon/human))