Files
kiwistation/code/modules/research/research_disk.dm
T
ArcaneMusic e39eea7b17 [Ready] Adds a new RnD method, the B.E.P.I.S. (#48040)
* Squashes Commits, has BEPIS, Techs, TGUIs, Rewards, and fixes.

* Makes rewardable techs a variable in all_nodes, and removes RnD Points rewards from the minor reward pool.

* Fixes conflict with pubby and beam icon.

* Review comments and basic cleanup A

* Review Comments and basic cleanup B, also cleans up icon states to work fluidly.

* Map Update

* Indentation, flipped Update_decal_path, and rebuilds tgui

* One last clean up of icon_state, adds the last bit of changes from review, and that should be everything.

* Alright last change for real I swear 105%

* Last change, adds simple sanity check for silicons.

* Moved Human and card variables into ui_interact.

* Fixes map conflict

* Alright Review Round 2 Part A, Fixes Grammar, splits polycircuit into it's own file, UI QOL improvements, Withdrawing credits, changes from arbitary values on the mini RLD, etc.

* More review bits, Part 2:B. Easier returns for less processing, Defines, fixes the merge conflict and updates the UI with new buttons. Just need to figure out Button Mapping for the UI and Duplicate prevention.

* Implemented duplicate tech protection. Yeet.

* Get back in there you

* Alright why are you breaking on me god damnit.

* It's optimized, closer to god, nearly perfect, all together it's ready to ship.

* Cleans up all of the decal painter, shorter, cleaner, works around all the turf_decal quirks.

* Tab spacing on github will look fucky

* More review changes.

* Uses use_power == ACTIVE_POWER_USE instead of powered except for the UI
2019-12-25 23:48:28 +01:00

96 lines
2.9 KiB
Plaintext

/obj/item/disk/tech_disk
name = "technology disk"
desc = "A disk for storing technology data for further research."
icon_state = "datadisk0"
custom_materials = list(/datum/material/iron=300, /datum/material/glass=100)
var/datum/techweb/stored_research
/obj/item/disk/tech_disk/Initialize()
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
stored_research = new /datum/techweb
/obj/item/disk/tech_disk/debug
name = "\improper CentCom technology disk"
desc = "A debug item for research"
custom_materials = null
/obj/item/disk/tech_disk/debug/Initialize()
. = ..()
stored_research = new /datum/techweb/admin
/obj/item/disk/tech_disk/major
name = "Reformatted technology disk"
desc = "A disk containing a new, completed tech from the B.E.P.I.S. Upload the disk to an R&D Console to redeem the tech."
icon_state = "rndmajordisk"
custom_materials = list(/datum/material/iron=300, /datum/material/glass=100)
/obj/item/disk/tech_disk/major/Initialize()
. = ..()
stored_research = new /datum/techweb/bepis
/obj/item/research_notes
name = "research notes"
desc = "Valuable scientific data. Use it in a research console to scan it."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "paper"
item_state = "paper"
w_class = WEIGHT_CLASS_SMALL
///research points it holds
var/value = 69
///origin of the research
var/origin_type = "debug"
///if it ws merged with different origins to apply a bonus
var/mixed = FALSE
/obj/item/research_notes/Initialize(mapload, _value, _origin_type)
. = ..()
if(_value)
value = _value
if(_origin_type)
origin_type = _origin_type
change_vol()
/obj/item/research_notes/examine(mob/user)
. = ..()
. += "<span class='notice'>It is worth [value] research points.</span>"
/// proc that changes name and icon depending on value
/obj/item/research_notes/proc/change_vol()
if(value >= 10000)
name = "revolutionary discovery in the field of [origin_type]"
icon_state = "docs_verified"
return
else if(value >= 2500)
name = "essay about [origin_type]"
icon_state = "paper_words"
return
else if(value >= 100)
name = "notes of [origin_type]"
icon_state = "paperslip_words"
return
else
name = "fragmentary data of [origin_type]"
icon_state = "scrap"
return
///proc when you slap research notes into another one, it applies a bonus if they are of different origin (only applied once)
/obj/item/research_notes/proc/merge(obj/item/research_notes/new_paper)
var/bonus = min(value , new_paper.value)
value = value + new_paper.value
if(origin_type != new_paper.origin_type && !mixed)
value += bonus * 0.3
origin_type = "[origin_type] and [new_paper.origin_type]"
mixed = TRUE
change_vol()
qdel(new_paper)
/obj/item/research_notes/attackby(obj/item/I, mob/user, params)
. = ..()
if(istype(I, /obj/item/research_notes))
var/obj/item/research_notes/R = I
merge(R)
return TRUE