mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Fixes for my last commit:
Removed the AM engine code. This should be temporary. Moved asteroid/device.dm to unused. Readded biomass.dmi git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3876 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -451,8 +451,10 @@
|
||||
message = text("\red <B>[] is trying to inject []!</B>", source, target)
|
||||
if("pill")
|
||||
message = text("\red <B>[] is trying to force [] to swallow []!</B>", source, target, item)
|
||||
if("fuel")
|
||||
message = text("\red [source] is trying to force [target] to eat the [item:content]!")
|
||||
// dear god this is all horrible, godspeed carn ;-;
|
||||
// mport: i dunno if you care about this, but it's related to AM. -Pete
|
||||
// if("fuel")
|
||||
// message = text("\red [source] is trying to force [target] to eat the [item:content]!")
|
||||
if("drink")
|
||||
message = text("\red <B>[] is trying to force [] to swallow a gulp of []!</B>", source, target, item)
|
||||
if("dnainjector")
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
|
||||
|
||||
/obj/machinery/computer/am_engine
|
||||
name = "Antimatter Engine Console"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "comm_computer"
|
||||
req_access = list(access_engine)
|
||||
var/engine_id = 0
|
||||
var/authenticated = 0
|
||||
var/obj/machinery/power/am_engine/engine/connected_E = null
|
||||
var/obj/machinery/power/am_engine/injector/connected_I = null
|
||||
var/state = STATE_DEFAULT
|
||||
var/const/STATE_DEFAULT = 1
|
||||
var/const/STATE_INJECTOR = 2
|
||||
var/const/STATE_ENGINE = 3
|
||||
|
||||
/obj/machinery/computer/am_engine/New()
|
||||
..()
|
||||
spawn( 24 )
|
||||
for(var/obj/machinery/power/am_engine/engine/E in world)
|
||||
if(E.engine_id == src.engine_id)
|
||||
src.connected_E = E
|
||||
for(var/obj/machinery/power/am_engine/injector/I in world)
|
||||
if(I.engine_id == src.engine_id)
|
||||
src.connected_I = I
|
||||
return
|
||||
|
||||
/obj/machinery/computer/am_engine/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.machine = src
|
||||
|
||||
if(!href_list["operation"])
|
||||
return
|
||||
switch(href_list["operation"])
|
||||
// main interface
|
||||
if("activate")
|
||||
src.connected_E.engine_process()
|
||||
if("engine")
|
||||
src.state = STATE_ENGINE
|
||||
if("injector")
|
||||
src.state = STATE_INJECTOR
|
||||
if("main")
|
||||
src.state = STATE_DEFAULT
|
||||
if("login")
|
||||
var/mob/M = usr
|
||||
var/obj/item/weapon/card/id/I = M.equipped()
|
||||
if (I && istype(I))
|
||||
if(src.check_access(I))
|
||||
authenticated = 1
|
||||
if("deactivate")
|
||||
src.connected_E.stopping = 1
|
||||
if("logout")
|
||||
authenticated = 0
|
||||
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/am_engine/attack_ai(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/am_engine/attack_paw(var/mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/am_engine/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<head><title>Engine Computer</title></head><body>"
|
||||
switch(src.state)
|
||||
if(STATE_DEFAULT)
|
||||
if (src.authenticated)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=logout'>Log Out</A> \]<br>"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=engine'>Engine Menu</A> \]"
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=injector'>Injector Menu</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=login'>Log In</A> \]"
|
||||
if(STATE_INJECTOR)
|
||||
if(src.connected_I.injecting)
|
||||
dat += "<BR>\[ Injecting \]<br>"
|
||||
else
|
||||
dat += "<BR>\[ Injecting not in progress \]<br>"
|
||||
if(STATE_ENGINE)
|
||||
if(src.connected_E.stopping)
|
||||
dat += "<BR>\[ STOPPING \]"
|
||||
else if(src.connected_E.operating && !src.connected_E.stopping)
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=deactivate'>Emergency Stop</A> \]"
|
||||
else
|
||||
dat += "<BR>\[ <A HREF='?src=\ref[src];operation=activate'>Activate Engine</A> \]"
|
||||
dat += "<BR>Contents:<br>[src.connected_E.H_fuel]kg of Hydrogen<br>[src.connected_E.antiH_fuel]kg of Anti-Hydrogen<br>"
|
||||
|
||||
dat += "<BR>\[ [(src.state != STATE_DEFAULT) ? "<A HREF='?src=\ref[src];operation=main'>Main Menu</A> | " : ""]<A HREF='?src=\ref[user];mach_close=communications'>Close</A> \]"
|
||||
user << browse(dat, "window=communications;size=400x500")
|
||||
onclose(user, "communications")
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
/obj/machinery/power/am_engine
|
||||
icon = 'AM_Engine.dmi'
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
flags = ON_BORDER
|
||||
|
||||
/obj/machinery/power/am_engine/bits
|
||||
name = "Antimatter Engine"
|
||||
icon_state = "1"
|
||||
|
||||
/obj/machinery/power/am_engine/engine
|
||||
name = "Antimatter Engine"
|
||||
icon_state = "am_engine"
|
||||
var/engine_id = 0
|
||||
var/H_fuel = 0
|
||||
var/antiH_fuel = 0
|
||||
var/operating = 0
|
||||
var/stopping = 0
|
||||
var/obj/machinery/power/am_engine/injector/connected = null
|
||||
|
||||
/obj/machinery/power/am_engine/injector
|
||||
name = "Injector"
|
||||
icon_state = "injector"
|
||||
var/engine_id = 0
|
||||
var/injecting = 0
|
||||
var/fuel = 0
|
||||
var/obj/machinery/power/am_engine/engine/connected = null
|
||||
|
||||
//injector
|
||||
|
||||
/obj/machinery/power/am_engine/injector/New()
|
||||
..()
|
||||
spawn( 13 )
|
||||
var/loc = get_step(src, NORTH)
|
||||
src.connected = locate(/obj/machinery/power/am_engine/engine, get_step(loc, NORTH))
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/am_engine/injector/attackby(obj/item/weapon/fuel/F, mob/user)
|
||||
if( (stat & BROKEN) || !connected) return
|
||||
|
||||
if(istype(F, /obj/item/weapon/fuel/H))
|
||||
if(injecting)
|
||||
user << "Theres already a fuel rod in the injector!"
|
||||
return
|
||||
user << "You insert the rod into the injector"
|
||||
injecting = 1
|
||||
var/fuel = F.fuel
|
||||
del(F)
|
||||
spawn( 300 )
|
||||
injecting = 0
|
||||
new/obj/item/weapon/fuel(src.loc)
|
||||
connected.H_fuel += fuel
|
||||
|
||||
if(istype(F, /obj/item/weapon/fuel/antiH))
|
||||
if(injecting)
|
||||
user << "Theres already a fuel rod in the injector!"
|
||||
return
|
||||
user << "You insert the rod into the injector"
|
||||
injecting = 1
|
||||
var/fuel = F.fuel
|
||||
del(F)
|
||||
spawn( 300 )
|
||||
injecting = 0
|
||||
new /obj/item/weapon/fuel(src.loc)
|
||||
connected.antiH_fuel += fuel
|
||||
|
||||
return
|
||||
|
||||
|
||||
//engine
|
||||
|
||||
|
||||
/obj/machinery/power/am_engine/engine/New()
|
||||
..()
|
||||
spawn( 7 )
|
||||
var/loc = get_step(src, SOUTH)
|
||||
src.connected = locate(/obj/machinery/power/am_engine/injector, get_step(loc, SOUTH))
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/am_engine/engine/proc/engine_go()
|
||||
|
||||
if( (!src.connected) || (stat & BROKEN) )
|
||||
return
|
||||
|
||||
if(!antiH_fuel || !H_fuel)
|
||||
return
|
||||
|
||||
operating = 1
|
||||
var/energy = 0
|
||||
|
||||
if(antiH_fuel == H_fuel)
|
||||
var/mass = antiH_fuel + H_fuel
|
||||
energy = convert2energy(mass)
|
||||
H_fuel = 0
|
||||
antiH_fuel = 0
|
||||
else
|
||||
var/residual_matter = modulus(H_fuel - antiH_fuel)
|
||||
var/mass = antiH_fuel + H_fuel - residual_matter
|
||||
energy = convert2energy(mass)
|
||||
if( H_fuel > antiH_fuel )
|
||||
H_fuel = residual_matter
|
||||
antiH_fuel = 0
|
||||
else
|
||||
H_fuel = 0
|
||||
antiH_fuel = residual_matter
|
||||
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M.show_message(text("\red You hear a loud bang!"))
|
||||
|
||||
//Q = k x (delta T)
|
||||
|
||||
energy = energy*0.75
|
||||
operating = 0
|
||||
|
||||
//TODO: DEFERRED Heat tile
|
||||
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/power/am_engine/engine/proc/engine_process()
|
||||
|
||||
do
|
||||
if( (!src.connected) || (stat & BROKEN) )
|
||||
return
|
||||
|
||||
if(!antiH_fuel || !H_fuel)
|
||||
return
|
||||
|
||||
if(operating)
|
||||
return
|
||||
|
||||
operating = 1
|
||||
|
||||
sleep(50)
|
||||
|
||||
var/energy //energy from the reaction
|
||||
var/H //residual matter if H
|
||||
var/antiH //residual matter if antiH
|
||||
var/mass //total mass
|
||||
|
||||
if(antiH_fuel == H_fuel) //if they're equal then convert the whole mass to energy
|
||||
mass = antiH_fuel + H_fuel
|
||||
energy = convert2energy(mass)
|
||||
|
||||
else //else if they're not equal determine which isn't equal
|
||||
//and set it equal to either H or antiH so we don't lose anything
|
||||
|
||||
var/residual_matter = modulus(H_fuel - antiH_fuel)
|
||||
mass = antiH_fuel + H_fuel - residual_matter
|
||||
energy = convert2energy(mass)
|
||||
|
||||
if( H_fuel > antiH_fuel )
|
||||
H = residual_matter
|
||||
else
|
||||
antiH = residual_matter
|
||||
|
||||
|
||||
if(energy > convert2energy(8e-12)) //TOO MUCH ENERGY
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M.show_message(text("\red You hear a loud whirring!"))
|
||||
sleep(20)
|
||||
|
||||
//Q = k x (delta T)
|
||||
//Too much energy so machine panics and dissapates half of it as heat
|
||||
//The rest of the energetic photons then form into H and anti H particles again!
|
||||
|
||||
H_fuel -= H
|
||||
antiH_fuel -= antiH
|
||||
antiH_fuel = antiH_fuel/2
|
||||
H_fuel = H_fuel/2
|
||||
|
||||
energy = convert2energy(H_fuel + antiH_fuel)
|
||||
|
||||
H_fuel += H
|
||||
antiH_fuel += antiH
|
||||
|
||||
if(energy > convert2energy(8e-12)) //FAR TOO MUCH ENERGY STILL
|
||||
for(var/mob/M in hearers(src, null))
|
||||
M.show_message(text("\red <big>BANG!</big>"))
|
||||
new /obj/effect/bhole(src.loc)
|
||||
|
||||
else //this amount of energy is okay so it does the proper output thing
|
||||
|
||||
sleep(60)
|
||||
//E = Pt
|
||||
//Lets say its 86% efficient
|
||||
var/output = 0.86*energy/20
|
||||
add_avail(output)
|
||||
//yeah the machine realises that something isn't right and accounts for it if H or antiH
|
||||
H_fuel -= H
|
||||
antiH_fuel -= antiH
|
||||
antiH_fuel = antiH_fuel/4
|
||||
H_fuel = H_fuel/4
|
||||
H_fuel += H
|
||||
antiH_fuel += antiH
|
||||
operating = 0
|
||||
sleep(100)
|
||||
|
||||
while(!stopping)
|
||||
|
||||
stopping = 0
|
||||
|
||||
return
|
||||
@@ -1,100 +0,0 @@
|
||||
/obj/item/weapon/fuel
|
||||
name = "Magnetic Storage Ring"
|
||||
desc = "A magnetic storage ring."
|
||||
icon = 'items.dmi'
|
||||
icon_state = "rcdammo"
|
||||
opacity = 0
|
||||
density = 0
|
||||
anchored = 0.0
|
||||
var/fuel = 0
|
||||
var/s_time = 1.0
|
||||
var/content = null
|
||||
|
||||
/obj/item/weapon/fuel/H
|
||||
name = "Hydrogen storage ring"
|
||||
content = "Hydrogen"
|
||||
fuel = 1e-12 //pico-kilogram
|
||||
|
||||
/obj/item/weapon/fuel/antiH
|
||||
name = "Anti-Hydrogen storage ring"
|
||||
content = "Anti-Hydrogen"
|
||||
fuel = 1e-12 //pico-kilogram
|
||||
|
||||
/obj/item/weapon/fuel/attackby(obj/item/weapon/fuel/F, mob/user)
|
||||
..()
|
||||
if(istype(src, /obj/item/weapon/fuel/antiH))
|
||||
if(istype(F, /obj/item/weapon/fuel/antiH))
|
||||
src.fuel += F.fuel
|
||||
F.fuel = 0
|
||||
user << "You have added the anti-Hydrogen to the storage ring, it now contains [src.fuel]kg"
|
||||
if(istype(F, /obj/item/weapon/fuel/H))
|
||||
src.fuel += F.fuel
|
||||
del(F)
|
||||
src:annihilation(src.fuel)
|
||||
if(istype(src, /obj/item/weapon/fuel/H))
|
||||
if(istype(F, /obj/item/weapon/fuel/H))
|
||||
src.fuel += F.fuel
|
||||
F.fuel = 0
|
||||
user << "You have added the Hydrogen to the storage ring, it now contains [src.fuel]kg"
|
||||
if(istype(F, /obj/item/weapon/fuel/antiH))
|
||||
src.fuel += F.fuel
|
||||
del(src)
|
||||
F:annihilation(F.fuel)
|
||||
|
||||
/obj/item/weapon/fuel/antiH/proc/annihilation(var/mass)
|
||||
|
||||
var/strength = convert2energy(mass)
|
||||
|
||||
if (strength < 773.0)
|
||||
var/turf/T = get_turf(src.loc)
|
||||
|
||||
if (strength > (450+T0C))
|
||||
explosion(T, 0, 1, 2, 4)
|
||||
else
|
||||
if (strength > (300+T0C))
|
||||
explosion(T, 0, 0, 2, 3)
|
||||
|
||||
del(src)
|
||||
return
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
|
||||
var/ground_zero_range = round(strength / 387)
|
||||
explosion(ground_zero, ground_zero_range, ground_zero_range*2, ground_zero_range*3, ground_zero_range*4)
|
||||
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/fuel/examine()
|
||||
set src in view(1)
|
||||
if(usr && !usr.stat)
|
||||
usr << "A magnetic storage ring, it contains [fuel]kg of [content ? content : "nothing"]."
|
||||
|
||||
/obj/item/weapon/fuel/proc/injest(mob/M as mob)
|
||||
switch(content)
|
||||
if("Anti-Hydrogen")
|
||||
M.gib()
|
||||
if("Hydrogen")
|
||||
M << "\blue You feel very light, as if you might just float away..."
|
||||
del(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/fuel/attack(mob/M as mob, mob/user as mob)
|
||||
if (user != M)
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = user
|
||||
O.target = M
|
||||
O.item = src
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = M.loc
|
||||
O.place = "fuel"
|
||||
M.requests += O
|
||||
spawn( 0 )
|
||||
O.process()
|
||||
return
|
||||
else
|
||||
for(var/mob/O in viewers(M, null))
|
||||
O.show_message(text("\red [M] ate the [content ? content : "empty canister"]!"), 1)
|
||||
src.injest(M)
|
||||
BIN
icons/obj/biomass.dmi
Normal file
BIN
icons/obj/biomass.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
@@ -125,7 +125,6 @@
|
||||
#define FILE_DIR "code/modules/mob/simple_animal"
|
||||
#define FILE_DIR "code/modules/paperwork"
|
||||
#define FILE_DIR "code/modules/power"
|
||||
#define FILE_DIR "code/modules/power/antimatter"
|
||||
#define FILE_DIR "code/modules/power/singularity"
|
||||
#define FILE_DIR "code/modules/power/singularity/particle_accelerator"
|
||||
#define FILE_DIR "code/modules/projectiles"
|
||||
@@ -380,7 +379,6 @@
|
||||
#include "code\game\area\areas.dm"
|
||||
#include "code\game\asteroid\artifacts.dm"
|
||||
#include "code\game\asteroid\asteroid.dm"
|
||||
#include "code\game\asteroid\device.dm"
|
||||
#include "code\game\asteroid\turf.dm"
|
||||
#include "code\game\gamemodes\events.dm"
|
||||
#include "code\game\gamemodes\factions.dm"
|
||||
@@ -1038,9 +1036,6 @@
|
||||
#include "code\modules\power\terminal.dm"
|
||||
#include "code\modules\power\tracker.dm"
|
||||
#include "code\modules\power\turbine.dm"
|
||||
#include "code\modules\power\antimatter\computer.dm"
|
||||
#include "code\modules\power\antimatter\engine.dm"
|
||||
#include "code\modules\power\antimatter\fuel.dm"
|
||||
#include "code\modules\power\singularity\collector.dm"
|
||||
#include "code\modules\power\singularity\containment_field.dm"
|
||||
#include "code\modules\power\singularity\emitter.dm"
|
||||
|
||||
Reference in New Issue
Block a user