Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toxins Troubles #5771

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
27 changes: 26 additions & 1 deletion code/game/objects/structures/noticeboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
name = "Research bulletin board"
desc = "A board containing vital notices and official memos for the Soteria research"
icon_state = "nboard00"
notices = 1
notices = 2

/obj/structure/noticeboard/research/New()
var/obj/item/paper/P = new()
Expand All @@ -261,6 +261,31 @@
src.contents += P
update_icon()

P = new()
P.name = "Memo RE: Toxins Testing Value Index"
P.info = "Index Contents:<ol> \
<li> Shooting Targets: 5.\
<li> Machine Frames: 15 (17 If frame has wires or a cruitboard).\
Trilbyspaceclone marked this conversation as resolved.
Show resolved Hide resolved
<li> Any Flora (Not produce/trays): 2.\
<li> Compressed Cubes: 7.\
<li> Salvageable Machines: 60.\
<li> Filingcabinets: 30.\
<li> Metal Grilles: 2.\
<li> Barricades: 3.\
<li> Bookcases: 15.\
<li> Catwalks: 2.\
<li> Tables: 2.\
<li> Railing: 2 (5 if reinforced).\
<li> Beds and Chairs: 2.\
<li> Windows: Normal 2. Reinforced 3. Plasma 5 .Reinforced Plasma 10\
<li> Reagent Dispensers (Such as: Watercoolers, Welder Fuel Tanks, Beer Kegs): 25.\
<li> Lockers and Closets: 10.\
<li> Damaged Floors: -2 (Reduces Value)</ol> "
P.add_overlay(list("paper_stamp-dots"))
P.stamped &= STAMP_FACTION
src.contents += P
update_icon()

/obj/structure/noticeboard/guild
name = "Artificers Guild bulletin board"
desc = "A board containing vital notices and official memos for the colonies resident Guild"
Expand Down
21 changes: 21 additions & 0 deletions code/modules/paperwork/paper_premade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,27 @@
<BR>\n\t\t\tThe effect are cumulative.
<BR>\n\t\tWARNING: It is a crime to use this without authorization"}

/obj/item/paper/toxin_index
name = "Memo RE: Toxins Testing Value Index"
info = {"Index Contents:<ol> \
<li> Shooting Targets: 5.\
<li> Machine Frames: 15 (17 If frame has wires or a cruitboard).\
Trilbyspaceclone marked this conversation as resolved.
Show resolved Hide resolved
<li> Any Flora (Not produce/trays): 2.\
<li> Compressed Cubes: 7.\
<li> Salvageable Machines: 60.\
<li> Filingcabinets: 30.\
<li> Metal Grilles: 2.\
<li> Barricades: 3.\
<li> Bookcases: 15.\
<li> Catwalks: 2.\
<li> Tables: 2.\
<li> Railing: 2 (5 if reinforced).\
<li> Beds and Chairs: 2.\
<li> Windows: Normal 2. Reinforced 3. Plasma 5 .Reinforced Plasma 10\
<li> Reagent Dispensers (Such as: Watercoolers, Welder Fuel Tanks, Beer Kegs): 25.\
<li> Lockers and Closets: 10.\
<li> Damaged Floors: -2 (Reduces Value)</ol> "}

/obj/item/paper/courtroom
name = "A Crash Course in Legal SOP on the colony."
info = {"<B>Roles:</B>
Expand Down
55 changes: 0 additions & 55 deletions code/modules/research/experiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,61 +247,6 @@ GLOBAL_LIST_EMPTY(explosion_watcher_list)

saved_best_explosion = max(saved_best_explosion, O.saved_best_explosion)


// Grants research points when explosion happens nearby
/obj/item/device/radio/beacon/explosion_watcher
name = "Kinetic Energy Scanner"
desc = "Scans the level of kinetic energy from explosions. This beacon, is in fact bomb proof and to use it properly you must use the bomb within 10 tiles of this scanner."

channels = list("Science" = 1)
var/targetBoom
var/stored_points //This is how many points we hve stored, we use them up when successfull

/obj/item/device/radio/beacon/explosion_watcher/examine()
..()
to_chat(usr, "EXPECTED EXPLOSION - [targetBoom]")
to_chat(usr, "Points Left - [stored_points]")
return

/obj/item/device/radio/beacon/explosion_watcher/ex_act(severity)
return

/obj/item/device/radio/beacon/explosion_watcher/Initialize()
. = ..()
GLOB.explosion_watcher_list += src
targetBoom = rand(10,35)
stored_points = 250000 //6.1 perfect bombs

/obj/item/device/radio/beacon/explosion_watcher/Destroy()
GLOB.explosion_watcher_list -= src
return ..()

/obj/item/device/radio/beacon/explosion_watcher/proc/react_explosion(turf/epicenter, power)
power = round(power)
var/calculated_research_points = -1
for(var/obj/machinery/computer/rdconsole/RD in GLOB.computer_list)
if(RD.id == 1) // only core gets the science
var missed

missed = abs(power-targetBoom) * 8000 // each step away from the target will result in 8,000 points less, this is a range of 11.
if(stored_points >= 40000)
calculated_research_points = max(0,40000 - missed)
else
calculated_research_points = max(0,stored_points - missed)


stored_points -= calculated_research_points
RD.files.adjust_research_points(calculated_research_points)

if(calculated_research_points > 0 && stored_points)
autosay("Detected explosion with power level [power]. Expected explosion was [targetBoom]. Received [calculated_research_points] Research Points", name ,"Science")
if(0 >= stored_points)
autosay("Detected explosion with power level [power]. Expected explosion was [targetBoom]. No Additional Data Points Able To Gather", name ,"Science")
if(0 >= calculated_research_points)
autosay("Detected explosion with power level [power], Expected explosion was [targetBoom]. Test Results Outside Expected Range", name ,"Science")
targetBoom = rand(10,35)
autosay("Next expected power level is [targetBoom]", name ,"Science")

// Universal tool to get research points from autopsy reports, virus info reports, archeology reports, slime cores
/obj/item/device/science_tool
name = "science tool"
Expand Down
144 changes: 144 additions & 0 deletions code/modules/research/experiment_toxins.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@

// Grants research points when explosion happens nearby
/obj/item/device/radio/beacon/explosion_watcher
name = "Kinetic Energy Scanner"
desc = "Scans the level of kinetic energy from explosions. \
This beacon, is in fact bomb proof and to use it properly you must use the bomb within 10 tiles of this scanner."
Trilbyspaceclone marked this conversation as resolved.
Show resolved Hide resolved

channels = list("Science" = 1)
var/targetBoom
var/stored_points = 250000 //This is how many points we hve stored, we use them up when successfull
//6.1 perfect bombs
var/target_wealth = 0 //Used for how much stuff is worth around.
var/over_value_punishment = 1.5

/obj/item/device/radio/beacon/explosion_watcher/examine()
..()
to_chat(usr, "EXPECTED EXPLOSION - [targetBoom]")
to_chat(usr, "Points Left - [stored_points]")
to_chat(usr, "Required Asset Value - [target_wealth] to [target_wealth*over_value_punishment]")
to_chat(usr, "Assets in view worth - [asset_wealth(give_value=TRUE)]")
return

/obj/item/device/radio/beacon/explosion_watcher/ex_act(severity)
return

/obj/item/device/radio/beacon/explosion_watcher/Initialize()
. = ..()
GLOB.explosion_watcher_list += src
targetBoom = rand(10,35)
target_wealth = rand(100, 200)

/obj/item/device/radio/beacon/explosion_watcher/Destroy()
GLOB.explosion_watcher_list -= src
return ..()

/obj/item/device/radio/beacon/explosion_watcher/proc/asset_wealth(give_value = FALSE)
var/gathered_value = 0
for(var/obj/structure/S in oview(src,8))
Trilbyspaceclone marked this conversation as resolved.
Show resolved Hide resolved
if(istype(S, /obj/structure/closet))
gathered_value += 10

if(istype(S, /obj/structure/railing))
gathered_value += 2
var/obj/structure/railing/R = S
if(R.reinforced) //If we add a few extra bits of reinforcement then we add a small amount
gathered_value += 3

if(istype(S, /obj/structure/low_wall))
gathered_value += 5

if(istype(S, /obj/structure/window))
gathered_value += 2
if(istype(S, /obj/structure/window/reinforced))
gathered_value += 1
if(istype(S, /obj/structure/window/reinforced/plasma))
gathered_value += 8
if(istype(S, /obj/structure/window/plasmabasic))
gathered_value += 3

if(istype(S, /obj/structure/table))
gathered_value += 5
if(istype(S, /obj/structure/bed))
gathered_value += 2
if(istype(S, /obj/structure/catwalk))
gathered_value += 1
if(istype(S, /obj/structure/bookcase))
gathered_value += 15
if(istype(S, /obj/structure/barricade))
gathered_value += 3
if(istype(S, /obj/structure/grille))
gathered_value += 2
if(istype(S, /obj/structure/filingcabinet))
gathered_value += 30
//Bringind trash down or going to a trash ritch area should be rewarded
if(istype(S, /obj/structure/salvageable))
gathered_value += 60
if(istype(S, /obj/structure/scrap_cube))
gathered_value += 7
if(istype(S, /obj/structure/flora))
gathered_value += 2
if(istype(S, /obj/structure/reagent_dispensers))
gathered_value += 25 //Rare-ish

for(var/obj/item/target/T in oview(8))
if(T)
gathered_value += 5 //Targets are worth 5 as you can buy and stack like 400 in a single tile!

for(var/obj/machinery/constructable_frame/machine_frame/CF in oview(8))
if(CF)
gathered_value += 15
if(CF.state > 1)
gathered_value += 2

for(var/turf/simulated/floor/F in oview(8))
if(F.health != F.maxHealth)
gathered_value -= 2 // Repair the floors you smucks!

if(give_value)
return gathered_value

if(gathered_value > (target_wealth * over_value_punishment))
return FALSE
if(gathered_value < target_wealth)
return FALSE
return TRUE

/obj/item/device/radio/beacon/explosion_watcher/proc/react_explosion(turf/epicenter, power)
power = round(power)
var/calculated_research_points = -1
var/target_wealth_achived = asset_wealth()
for(var/obj/machinery/computer/rdconsole/RD in GLOB.computer_list)
if(RD.id == 1) // only core gets the science
var missed

if(target_wealth_achived)
missed = abs(power-targetBoom) * 8000 // each step away from the target will result in 8,000 points less, this is a range of 11.
if(stored_points >= 40000)
calculated_research_points = max(0,40000 - missed)
else
calculated_research_points = max(0,stored_points - missed)
stored_points -= calculated_research_points
RD.files.adjust_research_points(calculated_research_points)
else
autosay("Notice: Explosion environment not correctly fielded. No Points generated.", name ,"Science")

if(target_wealth_achived)
if(calculated_research_points > 0 && stored_points)
autosay("Detected explosion with power level [power]. Expected explosion was [targetBoom]. Received [calculated_research_points] Research Points", name ,"Science")
if(0 >= stored_points)
autosay("Detected explosion with power level [power]. Expected explosion was [targetBoom]. No Additional Data Points Able To Gather", name ,"Science")
if(0 >= calculated_research_points)
autosay("Detected explosion with power level [power], Expected explosion was [targetBoom]. Test Results Outside Expected Range", name ,"Science")
targetBoom = rand(10,35)
if(target_wealth == initial(target_wealth))
target_wealth = rand(100, 200)

else
if(calculated_research_points)
var/wealth_mult = initial(calculated_research_points)/(calculated_research_points + 1)
target_wealth = target_wealth = rand(125, 150) * wealth_mult
target_wealth = round(target_wealth)
autosay("Next expected power level is [targetBoom]; Asset Value Range: [target_wealth] to [target_wealth*over_value_punishment].", name ,"Science")


54 changes: 54 additions & 0 deletions maps/__DeepTunnels/map/_Nadezhda_Deep_Tunnels.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -7984,6 +7984,7 @@
"uJ" = (
/obj/structure/table/reinforced,
/obj/item/device/radio/beacon/explosion_watcher,
/obj/item/paper/toxin_index,
/turf/simulated/floor/tiled/white/gray_perforated,
/area/nadezhda/rnd/mixing)
"uK" = (
Expand Down Expand Up @@ -8408,6 +8409,53 @@
/obj/machinery/atmospherics/unary/vent_pump{
dir = 8
},
/obj/structure/closet/crate,
/obj/item/target,
/obj/item/target,
/obj/item/target,
/obj/item/target,
/obj/item/target,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/alien,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/clown,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/target/syndicate,
/obj/item/stack/material/wood/full,
/obj/item/stack/material/wood/full,
/obj/item/stack/rods/random,
/obj/item/stack/rods/random,
/obj/item/stack/rods/random,
/obj/item/stack/material/glass/plasmaglass/random,
/obj/item/stack/material/glass/plasmaglass/random,
/obj/item/stack/material/glass/plasmaglass/random,
/obj/item/stack/material/glass/plasmaglass/random,
/obj/item/stack/material/glass/random,
/obj/item/stack/material/glass/random,
/obj/item/stack/material/glass/random,
/obj/item/stack/material/glass/random,
/obj/item/stack/material/steel/random,
/obj/item/stack/material/steel/random,
/obj/item/stack/material/steel/random,
/obj/item/stack/material/steel/random,
/obj/item/stack/material/steel/random,
/obj/item/stack/material/steel/random,
/turf/simulated/floor/tiled/white,
/area/nadezhda/rnd/mixing)
"BR" = (
Expand Down Expand Up @@ -9191,6 +9239,9 @@
name = "Toxins mass driver"
},
/obj/effect/floor_decal/industrial/warningred/full,
/obj/structure/noticeboard/research{
pixel_y = 32
},
/turf/simulated/floor/reinforced,
/area/nadezhda/rnd/mixing)
"Uf" = (
Expand Down Expand Up @@ -9347,6 +9398,9 @@
id = "Toxins_Pad";
name = "Launch-pad door-control"
},
/obj/structure/noticeboard/research{
pixel_y = 32
},
/turf/simulated/floor/tiled/white,
/area/nadezhda/rnd/mixing)
"XP" = (
Expand Down
1 change: 1 addition & 0 deletions sojourn-station.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3158,6 +3158,7 @@
#include "code\modules\research\designs.dm"
#include "code\modules\research\destructive_analyzer.dm"
#include "code\modules\research\experiment.dm"
#include "code\modules\research\experiment_toxins.dm"
#include "code\modules\research\message_server.dm"
#include "code\modules\research\rd-readme.dm"
#include "code\modules\research\rdconsole.dm"
Expand Down
Loading