Added an upgraded mopbucket for the janitor and placed it on the map.

Updated the changelog.

Moved Agouri's vehicle code into his dm in unused. Moved the vehicle dmi into icons/obj.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5234 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
petethegoat@gmail.com
2012-11-30 22:37:00 +00:00
parent 9e8ee77049
commit dd909aa5f8
16 changed files with 520 additions and 362 deletions

114
code/defines/janicart.dm Normal file
View File

@@ -0,0 +1,114 @@
/obj/structure/stool/bed/chair/janicart
name = "janicart"
icon = 'icons/obj/vehicles.dmi'
icon_state = "pussywagon"
anchored = 1
density = 1
flags = OPENCONTAINER
//copypaste sorry
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/stool/bed/chair/janicart/New()
handle_rotation()
var/datum/reagents/R = new/datum/reagents(100)
reagents = R
R.my_atom = src
/obj/structure/stool/bed/chair/janicart/examine()
set src in usr
usr << "\icon[src] This pimpin' ride contains [reagents.total_volume] unit\s of water!"
/obj/structure/stool/bed/chair/janicart/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/weapon/mop))
if(reagents.total_volume >= 2)
reagents.trans_to(W, 2)
user << "<span class='notice'>You wet the mop in the pimpin' ride.</span>"
playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
if(reagents.total_volume < 1)
user << "<span class='notice'>This pimpin' ride is out of water!</span>"
else if(istype(W, /obj/item/key))
user << "Hold [I] in one of your hands while you drive this pimpin' ride."
return
/obj/structure/stool/bed/chair/janicart/relaymove(mob/user, direction)
if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key))
step(src, direction)
update_mob()
handle_rotation()
else
user << "<span class='notice'>You'll need the keys to drive this pimpin' ride.</span>"
/obj/structure/stool/bed/chair/janicart/Move()
..()
if(buckled_mob)
if(buckled_mob.buckled == src)
buckled_mob.loc = loc
/obj/structure/stool/bed/chair/janicart/buckle_mob(mob/M, mob/user)
if(M != user || !ismob(M) || get_dist(src, user) > 1 || user.restrained() || user.lying || user.stat || M.buckled || istype(user, /mob/living/silicon))
return
unbuckle()
M.visible_message(\
"<span class='notice'>[M] climbs onto [src]!</span>",\
"<span class='notice'>You climb onto [src]!</span>")
M.buckled = src
M.loc = loc
M.dir = dir
M.update_canmove()
buckled_mob = M
update_mob()
add_fingerprint(user)
return
/obj/structure/stool/bed/chair/janicart/unbuckle()
if(buckled_mob)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 0
..()
/obj/structure/stool/bed/chair/janicart/handle_rotation()
if(dir == SOUTH)
layer = FLY_LAYER
else
layer = OBJ_LAYER
if(buckled_mob)
if(buckled_mob.loc != loc)
buckled_mob.buckled = null //Temporary, so Move() succeeds.
buckled_mob.buckled = src //Restoring
update_mob()
/obj/structure/stool/bed/chair/janicart/proc/update_mob()
if(buckled_mob)
buckled_mob.dir = dir
switch(dir)
if(SOUTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 7
if(WEST)
buckled_mob.pixel_x = 13
buckled_mob.pixel_y = 7
if(NORTH)
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 4
if(EAST)
buckled_mob.pixel_x = -13
buckled_mob.pixel_y = 7
/obj/structure/stool/bed/chair/janicart/bullet_act(var/obj/item/projectile/Proj)
if(buckled_mob)
if(prob(50))
return buckled_mob.bullet_act(Proj)
visible_message("<span class='warning'>[Proj] ricochets off the pimpin' ride!</span>")
/obj/item/key
name = "key"
desc = "A keyring with a small steel key, and a pink fob reading \"Pussy Wagon\"."
icon = 'icons/obj/vehicles.dmi'
icon_state = "keys"
w_class = 1

View File

@@ -246,6 +246,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/janitor(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/key(H), slot_l_store)
return 1

View File

@@ -4,7 +4,6 @@
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
density = 1
flags = FPRINT
pressure_resistance = ONE_ATMOSPHERE
flags = FPRINT | TABLEPASS | OPENCONTAINER
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite

View File

@@ -98,6 +98,12 @@
/obj/structure/stool/bed/chair/office
anchored = 0
/obj/structure/stool/bed/chair/office/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/weldingtool))
icon = 'icons/obj/joustchair.dmi'
pixel_x = -16
pixel_y = -16
/obj/structure/stool/bed/chair/comfy/black
icon_state = "comfychair_black"

View File

@@ -1,165 +0,0 @@
/obj/vehicle/airtight
//inner atmos
var/use_internal_tank = 0
var/internal_tank_valve = ONE_ATMOSPHERE
var/obj/machinery/portable_atmospherics/canister/internal_tank
var/datum/gas_mixture/cabin_air
var/obj/machinery/atmospherics/portables_connector/connected_port = null
var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
var/datum/global_iterator/pr_give_air //moves air from tank to cabin
/obj/vehicle/airtight/New()
..()
src.add_airtank()
src.add_cabin()
src.add_airtight_iterators()
//######################################### Helpers for airtight vehicles #########################################
/obj/vehicle/airtight/proc/add_cabin()
cabin_air = new
cabin_air.temperature = T20C
cabin_air.volume = 200
cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
return cabin_air
/obj/vehicle/airtight/proc/add_airtank()
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank
/obj/vehicle/airtight/proc/add_airtight_iterators()
pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src))
pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src))
//######################################### Specific datums for airtight vehicles #################################
/datum/global_iterator/vehicle_preserve_temp //normalizing cabin air temperature to 20 degrees celsium
delay = 20
process(var/obj/vehicle/airtight/V)
if(V.cabin_air && V.cabin_air.return_volume() > 0)
var/delta = V.cabin_air.temperature - T20C
V.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
return
/datum/global_iterator/vehicle_tank_give_air
delay = 15
process(var/obj/vehicle/airtight/V)
if(V.internal_tank)
var/datum/gas_mixture/tank_air = V.internal_tank.return_air()
var/datum/gas_mixture/cabin_air = V.cabin_air
var/release_pressure = V.internal_tank_valve
var/cabin_pressure = cabin_air.return_pressure()
var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
var/transfer_moles = 0
if(pressure_delta > 0) //cabin pressure lower than release pressure
if(tank_air.return_temperature() > 0)
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
cabin_air.merge(removed)
else if(pressure_delta < 0) //cabin pressure higher than release pressure
var/datum/gas_mixture/t_air = V.get_turf_air()
pressure_delta = cabin_pressure - release_pressure
if(t_air)
pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
if(pressure_delta > 0) //if location pressure is lower than cabin pressure
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
if(t_air)
t_air.merge(removed)
else //just delete the cabin gas, we're in space or some shit
del(removed)
else
return stop()
return
//######################################### Atmospherics for vehicles #############################################
/obj/vehicle/proc/get_turf_air()
var/turf/T = get_turf(src)
if(T)
. = T.return_air()
return
/obj/vehicle/airtight/remove_air(amount)
if(use_internal_tank)
return cabin_air.remove(amount)
else
var/turf/T = get_turf(src)
if(T)
return T.remove_air(amount)
return
/obj/vehicle/airtight/return_air()
if(use_internal_tank)
return cabin_air
return get_turf_air()
/obj/vehicle/airtight/proc/return_pressure()
. = 0
if(use_internal_tank)
. = cabin_air.return_pressure()
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_pressure()
return
/obj/vehicle/airtight/proc/return_temperature()
. = 0
if(use_internal_tank)
. = cabin_air.return_temperature()
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_temperature()
return
/obj/vehicle/airtight/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
//Make sure not already connected to something else
if(connected_port || !new_port || new_port.connected_device)
return 0
//Make sure are close enough for a valid connection
if(new_port.loc != src.loc)
return 0
//Perform the connection
connected_port = new_port
connected_port.connected_device = src
//Actually enforce the air sharing
var/datum/pipe_network/network = connected_port.return_network(src)
if(network && !(internal_tank.return_air() in network.gases))
network.gases += internal_tank.return_air()
network.update = 1
log_message("Vehicle airtank connected to external port.")
return 1
/obj/vehicle/airtight/proc/disconnect()
if(!connected_port)
return 0
var/datum/pipe_network/network = connected_port.return_network(src)
if(network)
network.gases -= internal_tank.return_air()
connected_port.connected_device = null
connected_port = null
src.log_message("Vehicle airtank disconnected from external port.")
return 1

View File

@@ -1,190 +0,0 @@
/obj/vehicle
name = "Vehicle"
icon = 'icons/vehicles/vehicles.dmi'
density = 1
anchored = 1
unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
layer = MOB_LAYER
//var/can_move = 1
var/mob/living/carbon/occupant = null
//var/step_in = 10 //make a step in step_in/10 sec.
//var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
//var/step_energy_drain = 10
var/health = 300 //health is health
//var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
//the values in this list show how much damage will pass through, not how much will be absorbed.
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
var/obj/item/weapon/cell/cell //Our power source
var/state = 0
var/list/log = new
var/last_message = 0
var/add_req_access = 1
var/maint_access = 1
//var/dna //dna-locking the mech
var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect/effect/system/spark_spread/spark_system = new
var/lights = 0
var/lights_power = 6
//inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
//var/use_internal_tank = 0
//var/internal_tank_valve = ONE_ATMOSPHERE
//var/obj/machinery/portable_atmospherics/canister/internal_tank
//var/datum/gas_mixture/cabin_air
//var/obj/machinery/atmospherics/portables_connector/connected_port = null
var/obj/item/device/radio/radio = null
var/max_temperature = 2500
//var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
var/internal_damage = 0 //contains bitflags
var/list/operation_req_access = list()//required access level for mecha operation
var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
//var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
//var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
var/datum/global_iterator/pr_internal_damage //processes internal damage
var/wreckage
var/list/equipment = new
var/obj/selected
//var/max_equip = 3
var/datum/events/events
/obj/vehicle/New()
..()
events = new
icon_state += "-unmanned"
add_radio()
//add_cabin() //No cabin for non-airtights
spark_system.set_up(2, 0, src)
spark_system.attach(src)
add_cell()
add_iterators()
removeVerb(/obj/mecha/verb/disconnect_from_port)
removeVerb(/atom/movable/verb/pull)
log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
loc.Entered(src)
return
//################ Helpers ###########################################################
/obj/vehicle/proc/removeVerb(verb_path)
verbs -= verb_path
/obj/vehicle/proc/addVerb(verb_path)
verbs += verb_path
/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank*/
/obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null)
if(C)
C.forceMove(src)
cell = C
return
cell = new(src)
cell.charge = 15000
cell.maxcharge = 15000
/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
cabin_air = new
cabin_air.temperature = T20C
cabin_air.volume = 200
cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
return cabin_air*/
/obj/vehicle/proc/add_radio()
radio = new(src)
radio.name = "[src] radio"
radio.icon = icon
radio.icon_state = icon_state
radio.subspace_transmission = 1
/obj/vehicle/proc/add_iterators()
pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
//pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
//pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
//pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
/obj/vehicle/proc/check_for_support()
if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
return 1
else
return 0
//################ Logs and messages ############################################
/obj/vehicle/proc/log_message(message as text,red=null)
log.len++
log[log.len] = list("time"=world.timeofday,"message"="[red?"<font color='red'>":null][message][red?"</font>":null]")
return log.len
//################ Global Iterator Datums ######################################
/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
delay = 7
process(var/obj/vehicle/V as obj, direction)
if(direction)
if(!step(V, direction)||V.check_for_support())
src.stop()
else
src.stop()
return
/datum/global_iterator/mecha_internal_damage // processing internal damage
process(var/obj/mecha/mecha)
if(!mecha.hasInternalDamage())
return stop()
if(mecha.hasInternalDamage(MECHA_INT_FIRE))
if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
mecha.clearInternalDamage(MECHA_INT_FIRE)
if(mecha.internal_tank)
if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
mecha.pr_int_temp_processor.stop()
if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
if(mecha.internal_tank)
var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
if(mecha.loc && hascall(mecha.loc,"assume_air"))
mecha.loc.assume_air(leaked_gas)
else
del(leaked_gas)
if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
if(mecha.get_charge())
mecha.spark_system.start()
mecha.cell.charge -= min(20,mecha.cell.charge)
mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
return

View File

@@ -250,6 +250,10 @@
return
if(Process_Grab()) return
if(mob.buckled) //if we're buckled to something, tell it we moved.
return mob.buckled.relaymove(mob, direct)
if(!mob.canmove) return

View File

@@ -1,3 +1,387 @@
/*
/obj/vehicle/airtight
//inner atmos
var/use_internal_tank = 0
var/internal_tank_valve = ONE_ATMOSPHERE
var/obj/machinery/portable_atmospherics/canister/internal_tank
var/datum/gas_mixture/cabin_air
var/obj/machinery/atmospherics/portables_connector/connected_port = null
var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature
var/datum/global_iterator/pr_give_air //moves air from tank to cabin
/obj/vehicle/airtight/New()
..()
src.add_airtank()
src.add_cabin()
src.add_airtight_iterators()
//######################################### Helpers for airtight vehicles #########################################
/obj/vehicle/airtight/proc/add_cabin()
cabin_air = new
cabin_air.temperature = T20C
cabin_air.volume = 200
cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
return cabin_air
/obj/vehicle/airtight/proc/add_airtank()
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank
/obj/vehicle/airtight/proc/add_airtight_iterators()
pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src))
pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src))
//######################################### Specific datums for airtight vehicles #################################
/datum/global_iterator/vehicle_preserve_temp //normalizing cabin air temperature to 20 degrees celsium
delay = 20
process(var/obj/vehicle/airtight/V)
if(V.cabin_air && V.cabin_air.return_volume() > 0)
var/delta = V.cabin_air.temperature - T20C
V.cabin_air.temperature -= max(-10, min(10, round(delta/4,0.1)))
return
/datum/global_iterator/vehicle_tank_give_air
delay = 15
process(var/obj/vehicle/airtight/V)
if(V.internal_tank)
var/datum/gas_mixture/tank_air = V.internal_tank.return_air()
var/datum/gas_mixture/cabin_air = V.cabin_air
var/release_pressure = V.internal_tank_valve
var/cabin_pressure = cabin_air.return_pressure()
var/pressure_delta = min(release_pressure - cabin_pressure, (tank_air.return_pressure() - cabin_pressure)/2)
var/transfer_moles = 0
if(pressure_delta > 0) //cabin pressure lower than release pressure
if(tank_air.return_temperature() > 0)
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
cabin_air.merge(removed)
else if(pressure_delta < 0) //cabin pressure higher than release pressure
var/datum/gas_mixture/t_air = V.get_turf_air()
pressure_delta = cabin_pressure - release_pressure
if(t_air)
pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
if(pressure_delta > 0) //if location pressure is lower than cabin pressure
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
if(t_air)
t_air.merge(removed)
else //just delete the cabin gas, we're in space or some shit
del(removed)
else
return stop()
return
//######################################### Atmospherics for vehicles #############################################
/obj/vehicle/proc/get_turf_air()
var/turf/T = get_turf(src)
if(T)
. = T.return_air()
return
/obj/vehicle/airtight/remove_air(amount)
if(use_internal_tank)
return cabin_air.remove(amount)
else
var/turf/T = get_turf(src)
if(T)
return T.remove_air(amount)
return
/obj/vehicle/airtight/return_air()
if(use_internal_tank)
return cabin_air
return get_turf_air()
/obj/vehicle/airtight/proc/return_pressure()
. = 0
if(use_internal_tank)
. = cabin_air.return_pressure()
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_pressure()
return
/obj/vehicle/airtight/proc/return_temperature()
. = 0
if(use_internal_tank)
. = cabin_air.return_temperature()
else
var/datum/gas_mixture/t_air = get_turf_air()
if(t_air)
. = t_air.return_temperature()
return
/obj/vehicle/airtight/proc/connect(obj/machinery/atmospherics/portables_connector/new_port)
//Make sure not already connected to something else
if(connected_port || !new_port || new_port.connected_device)
return 0
//Make sure are close enough for a valid connection
if(new_port.loc != src.loc)
return 0
//Perform the connection
connected_port = new_port
connected_port.connected_device = src
//Actually enforce the air sharing
var/datum/pipe_network/network = connected_port.return_network(src)
if(network && !(internal_tank.return_air() in network.gases))
network.gases += internal_tank.return_air()
network.update = 1
log_message("Vehicle airtank connected to external port.")
return 1
/obj/vehicle/airtight/proc/disconnect()
if(!connected_port)
return 0
var/datum/pipe_network/network = connected_port.return_network(src)
if(network)
network.gases -= internal_tank.return_air()
connected_port.connected_device = null
connected_port = null
src.log_message("Vehicle airtank disconnected from external port.")
return 1
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/obj/vehicle
name = "Vehicle"
icon = 'icons/vehicles/vehicles.dmi'
density = 1
anchored = 1
unacidable = 1 //To avoid the pilot-deleting shit that came with mechas
layer = MOB_LAYER
//var/can_move = 1
var/mob/living/carbon/occupant = null
//var/step_in = 10 //make a step in step_in/10 sec.
//var/dir_in = 2//What direction will the mech face when entered/powered on? Defaults to South.
//var/step_energy_drain = 10
var/health = 300 //health is health
//var/deflect_chance = 10 //chance to deflect the incoming projectiles, hits, or lesser the effect of ex_act.
//the values in this list show how much damage will pass through, not how much will be absorbed.
var/list/damage_absorption = list("brute"=0.8,"fire"=1.2,"bullet"=0.9,"laser"=1,"energy"=1,"bomb"=1)
var/obj/item/weapon/cell/cell //Our power source
var/state = 0
var/list/log = new
var/last_message = 0
var/add_req_access = 1
var/maint_access = 1
//var/dna //dna-locking the mech
var/list/proc_res = list() //stores proc owners, like proc_res["functionname"] = owner reference
var/datum/effect/effect/system/spark_spread/spark_system = new
var/lights = 0
var/lights_power = 6
//inner atmos //These go in airtight.dm, not all vehicles are space-faring -Agouri
//var/use_internal_tank = 0
//var/internal_tank_valve = ONE_ATMOSPHERE
//var/obj/machinery/portable_atmospherics/canister/internal_tank
//var/datum/gas_mixture/cabin_air
//var/obj/machinery/atmospherics/portables_connector/connected_port = null
var/obj/item/device/radio/radio = null
var/max_temperature = 2500
//var/internal_damage_threshold = 50 //health percentage below which internal damage is possible
var/internal_damage = 0 //contains bitflags
var/list/operation_req_access = list()//required access level for mecha operation
var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment
//var/datum/global_iterator/pr_int_temp_processor //normalizes internal air mixture temperature //In airtight.dm you go -Agouri
var/datum/global_iterator/pr_inertial_movement //controls intertial movement in spesss
//var/datum/global_iterator/pr_give_air //moves air from tank to cabin //Y-you too -Agouri
var/datum/global_iterator/pr_internal_damage //processes internal damage
var/wreckage
var/list/equipment = new
var/obj/selected
//var/max_equip = 3
var/datum/events/events
/obj/vehicle/New()
..()
events = new
icon_state += "-unmanned"
add_radio()
//add_cabin() //No cabin for non-airtights
spark_system.set_up(2, 0, src)
spark_system.attach(src)
add_cell()
add_iterators()
removeVerb(/obj/mecha/verb/disconnect_from_port)
removeVerb(/atom/movable/verb/pull)
log_message("[src.name]'s functions initialised. Work protocols active - Entering IDLE mode.")
loc.Entered(src)
return
//################ Helpers ###########################################################
/obj/vehicle/proc/removeVerb(verb_path)
verbs -= verb_path
/obj/vehicle/proc/addVerb(verb_path)
verbs += verb_path
/*/obj/vehicle/proc/add_airtank() //In airtight.dm -Agouri
internal_tank = new /obj/machinery/portable_atmospherics/canister/air(src)
return internal_tank*/
/obj/vehicle/proc/add_cell(var/obj/item/weapon/cell/C=null)
if(C)
C.forceMove(src)
cell = C
return
cell = new(src)
cell.charge = 15000
cell.maxcharge = 15000
/*/obj/vehicle/proc/add_cabin() //In airtight.dm -Agouri
cabin_air = new
cabin_air.temperature = T20C
cabin_air.volume = 200
cabin_air.oxygen = O2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
cabin_air.nitrogen = N2STANDARD*cabin_air.volume/(R_IDEAL_GAS_EQUATION*cabin_air.temperature)
return cabin_air*/
/obj/vehicle/proc/add_radio()
radio = new(src)
radio.name = "[src] radio"
radio.icon = icon
radio.icon_state = icon_state
radio.subspace_transmission = 1
/obj/vehicle/proc/add_iterators()
pr_inertial_movement = new /datum/global_iterator/vehicle_intertial_movement(null,0)
//pr_internal_damage = new /datum/global_iterator/vehicle_internal_damage(list(src),0)
//pr_int_temp_processor = new /datum/global_iterator/vehicle_preserve_temp(list(src)) //In airtight.dm's add_airtight_iterators -Agouri
//pr_give_air = new /datum/global_iterator/vehicle_tank_give_air(list(src) //Same here -Agouri
/obj/vehicle/proc/check_for_support()
if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
return 1
else
return 0
//################ Logs and messages ############################################
/obj/vehicle/proc/log_message(message as text,red=null)
log.len++
log[log.len] = list("time"=world.timeofday,"message"="[red?"<font color='red'>":null][message][red?"</font>":null]")
return log.len
//################ Global Iterator Datums ######################################
/datum/global_iterator/vehicle_intertial_movement //inertial movement in space
delay = 7
process(var/obj/vehicle/V as obj, direction)
if(direction)
if(!step(V, direction)||V.check_for_support())
src.stop()
else
src.stop()
return
/datum/global_iterator/mecha_internal_damage // processing internal damage
process(var/obj/mecha/mecha)
if(!mecha.hasInternalDamage())
return stop()
if(mecha.hasInternalDamage(MECHA_INT_FIRE))
if(!mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL) && prob(5))
mecha.clearInternalDamage(MECHA_INT_FIRE)
if(mecha.internal_tank)
if(mecha.internal_tank.return_pressure()>mecha.internal_tank.maximum_pressure && !(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)))
mecha.setInternalDamage(MECHA_INT_TANK_BREACH)
var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
if(int_tank_air && int_tank_air.return_volume()>0) //heat the air_contents
int_tank_air.temperature = min(6000+T0C, int_tank_air.temperature+rand(10,15))
if(mecha.cabin_air && mecha.cabin_air.return_volume()>0)
mecha.cabin_air.temperature = min(6000+T0C, mecha.cabin_air.return_temperature()+rand(10,15))
if(mecha.cabin_air.return_temperature()>mecha.max_temperature/2)
mecha.take_damage(4/round(mecha.max_temperature/mecha.cabin_air.return_temperature(),0.1),"fire")
if(mecha.hasInternalDamage(MECHA_INT_TEMP_CONTROL)) //stop the mecha_preserve_temp loop datum
mecha.pr_int_temp_processor.stop()
if(mecha.hasInternalDamage(MECHA_INT_TANK_BREACH)) //remove some air from internal tank
if(mecha.internal_tank)
var/datum/gas_mixture/int_tank_air = mecha.internal_tank.return_air()
var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.10)
if(mecha.loc && hascall(mecha.loc,"assume_air"))
mecha.loc.assume_air(leaked_gas)
else
del(leaked_gas)
if(mecha.hasInternalDamage(MECHA_INT_SHORT_CIRCUIT))
if(mecha.get_charge())
mecha.spark_system.start()
mecha.cell.charge -= min(20,mecha.cell.charge)
mecha.cell.maxcharge -= min(20,mecha.cell.maxcharge)
return
*/
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/*/turf/DblClick()
if(istype(usr, /mob/living/silicon/ai))
return move_camera_by_click()

View File

@@ -48,6 +48,14 @@ Stuff which is in development and not yet visible to players or just code relate
should be listed in the changelog upon commit tho. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<h2 class="date">30 November 2012</h2>
<h3 class="author">Petethegoat updated:</h3>
<ul class="changes bgimages16">
<li class="rscadd">Janitor has recieved a slightly upgrade mop bucket. The old one is still there too.</li>
</ul>
</div>
<div class="commit sansserif">
<h2 class="date">28 November 2012</h2>
<h3 class="author">Kor updated:</h3>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
icons/obj/vehicles.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -3977,7 +3977,7 @@
"byy" = (/obj/structure/closet/l3closet/janitor,/obj/machinery/atmospherics/pipe/manifold{color = "red"; dir = 1; icon_state = "manifold-r-f"; level = 1; name = "pipe manifold"},/obj/machinery/alarm{frequency = 1439; pixel_y = 23},/turf/simulated/floor,/area/janitor)
"byz" = (/obj/item/weapon/storage/lightbox/mixed,/obj/item/weapon/storage/lightbox/mixed,/obj/machinery/atmospherics/pipe/manifold{color = "red"; icon_state = "manifold-r-f"; level = 1; name = "pipe manifold"},/obj/machinery/light_switch{pixel_y = 28},/obj/machinery/camera{c_tag = "Custodial Closet"},/turf/simulated/floor,/area/janitor)
"byA" = (/obj/structure/disposalpipe/segment{dir = 1; icon_state = "pipe-c"},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/turf/simulated/floor,/area/janitor)
"byB" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/item/device/radio/intercom{pixel_y = 25},/turf/simulated/floor,/area/janitor)
"byB" = (/obj/structure/disposalpipe/segment{dir = 4},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/item/device/radio/intercom{pixel_y = 25},/obj/structure/stool/bed/chair/janicart,/turf/simulated/floor,/area/janitor)
"byC" = (/obj/structure/disposalpipe/sortjunction{dir = 8; icon_state = "pipe-j2s"; sortType = 22},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/structure/cable{d1 = 2; d2 = 4; icon_state = "2-4"; tag = ""},/turf/simulated/floor,/area/janitor)
"byD" = (/obj/machinery/door/window/westleft{name = "Janitoral Delivery"; req_access_txt = "26"},/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; tag = ""},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/structure/disposalpipe/segment{dir = 4},/turf/simulated/floor{icon_state = "delivery"},/area/janitor)
"byE" = (/obj/machinery/navbeacon{codes_txt = "delivery;dir=8"; freq = 1400; location = "Janitor"},/obj/structure/cable{d1 = 4; d2 = 8; icon_state = "4-8"; pixel_y = 0; tag = ""},/obj/machinery/atmospherics/pipe/simple{color = "red"; dir = 4; icon_state = "intact-r-f"; level = 1; name = "pipe"},/obj/structure/disposalpipe/segment{dir = 4},/obj/structure/plasticflaps{opacity = 1},/turf/simulated/floor{icon_state = "bot"},/area/janitor)
@@ -4308,7 +4308,7 @@
"bER" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/mob/living/simple_animal/mouse/brown/Tom,/turf/simulated/floor{tag = "icon-vault (SOUTHEAST)"; icon_state = "vault"; dir = 6},/area/security/nuke_storage)
"bES" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/obj/machinery/light/small,/turf/simulated/floor{tag = "icon-vault"; icon_state = "vault"},/area/security/nuke_storage)
"bET" = (/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor{tag = "icon-vault (SOUTHWEST)"; icon_state = "vault"; dir = 10},/area/security/nuke_storage)
"bEU" = (/obj/machinery/atmospherics/pipe/manifold{color = "blue"; icon_state = "manifold-b-f"; level = 1; name = "pipe manifold"},/obj/structure/safe,/obj/item/clothing/mask/pig,/obj/item/clothing/glasses/sunglasses/big,/obj/item/weapon/cigpacket/dromedaryco,/obj/item/weapon/lighter/zippo,/obj/item/clothing/mask/owl_mask,/obj/item/toy/gun,/obj/item/toy/katana,/turf/simulated/floor{tag = "icon-vault (EAST)"; icon_state = "vault"; dir = 4},/area/security/nuke_storage)
"bEU" = (/obj/machinery/atmospherics/pipe/manifold{color = "blue"; icon_state = "manifold-b-f"; level = 1; name = "pipe manifold"},/obj/structure/safe,/obj/item/clothing/under/color/yellow,/obj/item/key,/obj/item/toy/katana,/turf/simulated/floor{tag = "icon-vault (EAST)"; icon_state = "vault"; dir = 4},/area/security/nuke_storage)
"bEV" = (/obj/structure/disposalpipe/segment,/obj/structure/cable{icon_state = "0-2"; d2 = 2},/obj/structure/cable,/obj/structure/grille,/obj/structure/window/reinforced{dir = 4},/obj/structure/window/reinforced{dir = 8},/obj/machinery/atmospherics/pipe/manifold{color = "blue"; icon_state = "manifold-b-f"; level = 1; name = "pipe manifold"},/turf/simulated/floor/plating,/area/security/nuke_storage)
"bEW" = (/obj/machinery/atmospherics/pipe/manifold{color = "blue"; icon_state = "manifold-b-f"; level = 1; name = "pipe manifold"},/turf/simulated/floor{dir = 8; icon_state = "warning"},/area/hallway/primary/aft)
"bEX" = (/obj/structure/cable{d1 = 1; d2 = 2; icon_state = "1-2"; tag = ""},/obj/machinery/atmospherics/pipe/simple/supply/hidden{dir = 4},/turf/simulated/floor,/area/hallway/primary/aft)

View File

@@ -137,6 +137,7 @@
#include "code\datums\spells\trigger.dm"
#include "code\datums\spells\turf_teleport.dm"
#include "code\datums\spells\wizard.dm"
#include "code\defines\janicart.dm"
#include "code\defines\obj.dm"
#include "code\defines\obj\hydro.dm"
#include "code\defines\obj\machinery.dm"
@@ -594,10 +595,6 @@
#include "code\game\turfs\unsimulated\beach.dm"
#include "code\game\turfs\unsimulated\floor.dm"
#include "code\game\turfs\unsimulated\walls.dm"
#include "code\game\vehicles\vehicle.dm"
#include "code\game\vehicles\airtight\airtight.dm"
#include "code\game\vehicles\airtight\land.dm"
#include "code\game\vehicles\airtight\space.dm"
#include "code\game\verbs\atom_verbs.dm"
#include "code\game\verbs\ooc.dm"
#include "code\game\verbs\suicide.dm"