mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-20 15:12:57 +00:00
* Sideports a couple of init unit tests from Neb. * Trying to unfuck initialize logic. * Removing del()s. * Adjusting return values to Initialize(). * Moving some dangerous object logic from obj onto the two types that use it. * Rolling back some init changes and commenting out initialized atom unit test. * this comment formatting is a minor war crime * Removed sleep() from signaler circuit Initialize(). * Additional Init fixes post-rebase. * Uncomments subsystem test since that's passing.
251 lines
7.1 KiB
Plaintext
251 lines
7.1 KiB
Plaintext
/* The old single tank bombs that dont really work anymore
|
|
/obj/effect/spawner/bomb
|
|
name = "bomb"
|
|
icon = 'icons/mob/screen1.dmi'
|
|
icon_state = "x"
|
|
var/btype = 0 //0 = radio, 1= prox, 2=time
|
|
var/explosive = 1 // 0= firebomb
|
|
var/btemp = 500 // bomb temperature (degC)
|
|
var/active = 0
|
|
|
|
/obj/effect/spawner/bomb/radio
|
|
btype = 0
|
|
|
|
/obj/effect/spawner/bomb/proximity
|
|
btype = 1
|
|
|
|
/obj/effect/spawner/bomb/timer
|
|
btype = 2
|
|
|
|
/obj/effect/spawner/bomb/timer/syndicate
|
|
btemp = 450
|
|
|
|
/obj/effect/spawner/bomb/suicide
|
|
btype = 3
|
|
|
|
/obj/effect/spawner/bomb/New()
|
|
..()
|
|
|
|
switch (src.btype)
|
|
// radio
|
|
if (0)
|
|
var/obj/item/assembly/r_i_ptank/R = new /obj/item/assembly/r_i_ptank(src.loc)
|
|
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
|
var/obj/item/device/radio/signaler/p1 = new /obj/item/device/radio/signaler(R)
|
|
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
|
R.part1 = p1
|
|
R.part2 = p2
|
|
R.part3 = p3
|
|
p1.master = R
|
|
p2.master = R
|
|
p3.master = R
|
|
R.status = explosive
|
|
p1.b_stat = 0
|
|
p2.secured = 1
|
|
p3.air_contents.temperature = btemp + T0C
|
|
|
|
// proximity
|
|
if (1)
|
|
var/obj/item/assembly/m_i_ptank/R = new /obj/item/assembly/m_i_ptank(src.loc)
|
|
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
|
var/obj/item/device/prox_sensor/p1 = new /obj/item/device/prox_sensor(R)
|
|
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
|
R.part1 = p1
|
|
R.part2 = p2
|
|
R.part3 = p3
|
|
p1.master = R
|
|
p2.master = R
|
|
p3.master = R
|
|
R.status = explosive
|
|
|
|
p3.air_contents.temperature = btemp + T0C
|
|
p2.secured = 1
|
|
|
|
if(src.active)
|
|
R.part1.secured = 1
|
|
R.part1.icon_state = text("motion[]", 1)
|
|
R.c_state(1, src)
|
|
|
|
// timer
|
|
if (2)
|
|
var/obj/item/assembly/t_i_ptank/R = new /obj/item/assembly/t_i_ptank(src.loc)
|
|
var/obj/item/weapon/tank/phoron/p3 = new /obj/item/weapon/tank/phoron(R)
|
|
var/obj/item/device/timer/p1 = new /obj/item/device/timer(R)
|
|
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
|
R.part1 = p1
|
|
R.part2 = p2
|
|
R.part3 = p3
|
|
p1.master = R
|
|
p2.master = R
|
|
p3.master = R
|
|
R.status = explosive
|
|
|
|
p3.air_contents.temperature = btemp + T0C
|
|
p2.secured = 1
|
|
//bombvest
|
|
if(3)
|
|
var/obj/item/clothing/suit/armor/a_i_a_ptank/R = new /obj/item/clothing/suit/armor/a_i_a_ptank(src.loc)
|
|
var/obj/item/weapon/tank/phoron/p4 = new /obj/item/weapon/tank/phoron(R)
|
|
var/obj/item/device/healthanalyzer/p1 = new /obj/item/device/healthanalyzer(R)
|
|
var/obj/item/device/igniter/p2 = new /obj/item/device/igniter(R)
|
|
var/obj/item/clothing/suit/armor/vest/p3 = new /obj/item/clothing/suit/armor/vest(R)
|
|
R.part1 = p1
|
|
R.part2 = p2
|
|
R.part3 = p3
|
|
R.part4 = p4
|
|
p1.master = R
|
|
p2.master = R
|
|
p3.master = R
|
|
p4.master = R
|
|
R.status = explosive
|
|
|
|
p4.air_contents.temperature = btemp + T0C
|
|
p2.secured = 1
|
|
|
|
qdel(src)
|
|
*/
|
|
|
|
/client/proc/spawn_tanktransferbomb()
|
|
set category = "Debug"
|
|
set desc = "Spawn a tank transfer valve bomb"
|
|
set name = "Instant TTV"
|
|
|
|
if(!check_rights(R_SPAWN)) return
|
|
|
|
var/obj/effect/spawner/newbomb/proto = /obj/effect/spawner/newbomb/radio/custom
|
|
|
|
var/p = input("Enter phoron amount (mol):","Phoron", initial(proto.phoron_amt)) as num|null
|
|
if(p == null) return
|
|
|
|
var/o = input("Enter oxygen amount (mol):","Oxygen", initial(proto.oxygen_amt)) as num|null
|
|
if(o == null) return
|
|
|
|
var/c = input("Enter carbon dioxide amount (mol):","Carbon Dioxide", initial(proto.carbon_amt)) as num|null
|
|
if(c == null) return
|
|
|
|
new /obj/effect/spawner/newbomb/radio/custom(get_turf(mob), p, o, c)
|
|
|
|
/obj/effect/spawner/newbomb
|
|
name = "TTV bomb"
|
|
icon = 'icons/mob/screen1.dmi'
|
|
icon_state = "x"
|
|
|
|
var/assembly_type = /obj/item/device/assembly/signaler
|
|
|
|
//Note that the maximum amount of gas you can put in a 70L air tank at 1013.25 kPa and 519K is 16.44 mol.
|
|
var/phoron_amt = 12
|
|
var/oxygen_amt = 18
|
|
var/carbon_amt = 0
|
|
|
|
/obj/effect/spawner/newbomb/timer
|
|
name = "TTV bomb - timer"
|
|
assembly_type = /obj/item/device/assembly/timer
|
|
|
|
/obj/effect/spawner/newbomb/timer/syndicate
|
|
name = "TTV bomb - merc"
|
|
//High yield bombs. Yes, it is possible to make these with toxins
|
|
phoron_amt = 18.5
|
|
oxygen_amt = 28.5
|
|
|
|
/obj/effect/spawner/newbomb/proximity
|
|
name = "TTV bomb - proximity"
|
|
assembly_type = /obj/item/device/assembly/prox_sensor
|
|
|
|
/obj/effect/spawner/newbomb/radio/custom/New(var/newloc, ph, ox, co)
|
|
if(ph != null) phoron_amt = ph
|
|
if(ox != null) oxygen_amt = ox
|
|
if(co != null) carbon_amt = co
|
|
..()
|
|
|
|
/obj/effect/spawner/newbomb/Initialize(newloc)
|
|
..(newloc)
|
|
var/obj/item/device/transfer_valve/V = new(src.loc)
|
|
var/obj/item/weapon/tank/phoron/PT = new(V)
|
|
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
|
|
|
V.tank_one = PT
|
|
V.tank_two = OT
|
|
|
|
PT.master = V
|
|
OT.master = V
|
|
|
|
PT.valve_welded = 1
|
|
PT.air_contents.gas["phoron"] = phoron_amt
|
|
PT.air_contents.gas["carbon_dioxide"] = carbon_amt
|
|
PT.air_contents.total_moles = phoron_amt + carbon_amt
|
|
PT.air_contents.temperature = PHORON_MINIMUM_BURN_TEMPERATURE+1
|
|
PT.air_contents.update_values()
|
|
|
|
OT.valve_welded = 1
|
|
OT.air_contents.gas["oxygen"] = oxygen_amt
|
|
OT.air_contents.total_moles = oxygen_amt
|
|
OT.air_contents.temperature = PHORON_MINIMUM_BURN_TEMPERATURE+1
|
|
OT.air_contents.update_values()
|
|
|
|
var/obj/item/device/assembly/S = new assembly_type(V)
|
|
V.attached_device = S
|
|
|
|
S.holder = V
|
|
S.toggle_secure()
|
|
|
|
V.update_icon()
|
|
return INITIALIZE_HINT_QDEL
|
|
|
|
|
|
///////////////////////
|
|
//One Tank Bombs, WOOOOOOO! -Luke
|
|
///////////////////////
|
|
|
|
/obj/effect/spawner/onetankbomb
|
|
name = "Single-tank bomb"
|
|
icon = 'icons/mob/screen1.dmi'
|
|
icon_state = "x"
|
|
|
|
// var/assembly_type = /obj/item/device/assembly/signaler
|
|
|
|
//Note that the maximum amount of gas you can put in a 70L air tank at 1013.25 kPa and 519K is 16.44 mol.
|
|
var/phoron_amt = 0
|
|
var/oxygen_amt = 0
|
|
|
|
/obj/effect/spawner/onetankbomb/New(newloc) //just needs an assembly.
|
|
..(newloc)
|
|
|
|
var/type = pick(/obj/item/weapon/tank/phoron/onetankbomb, /obj/item/weapon/tank/oxygen/onetankbomb)
|
|
new type(src.loc)
|
|
|
|
qdel(src)
|
|
|
|
/obj/effect/spawner/onetankbomb/full
|
|
name = "Single-tank bomb"
|
|
icon = 'icons/mob/screen1.dmi'
|
|
icon_state = "x"
|
|
|
|
// var/assembly_type = /obj/item/device/assembly/signaler
|
|
|
|
//Note that the maximum amount of gas you can put in a 70L air tank at 1013.25 kPa and 519K is 16.44 mol.
|
|
/obj/effect/spawner/onetankbomb/full/New(newloc) //just needs an assembly.
|
|
..(newloc)
|
|
|
|
var/type = pick(/obj/item/weapon/tank/phoron/onetankbomb/full, /obj/item/weapon/tank/oxygen/onetankbomb/full)
|
|
new type(src.loc)
|
|
|
|
qdel(src)
|
|
|
|
/obj/effect/spawner/onetankbomb/frag
|
|
name = "Single-tank bomb"
|
|
icon = 'icons/mob/screen1.dmi'
|
|
icon_state = "x"
|
|
|
|
// var/assembly_type = /obj/item/device/assembly/signaler
|
|
|
|
//Note that the maximum amount of gas you can put in a 70L air tank at 1013.25 kPa and 519K is 16.44 mol.
|
|
/obj/effect/spawner/onetankbomb/full/New(newloc) //just needs an assembly.
|
|
..(newloc)
|
|
|
|
var/type = pick(/obj/item/weapon/tank/phoron/onetankbomb/full, /obj/item/weapon/tank/oxygen/onetankbomb/full)
|
|
new type(src.loc)
|
|
|
|
qdel(src)
|
|
|
|
|