mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Merge pull request #2149 from tigercat2000/redbook_save_us
Make EXPERI-Mentor SetTypeReactions() way more efficient
This commit is contained in:
@@ -57,30 +57,27 @@
|
||||
/obj/machinery/r_n_d/experimentor/proc/SetTypeReactions()
|
||||
var/probWeight = 0
|
||||
for(var/I in typesof(/obj/item))
|
||||
if(istype(I,/obj/item/weapon/relic))
|
||||
if(istype(I,/obj/item/weapon/relic)) //does istype even work here
|
||||
item_reactions["[I]"] = SCANTYPE_DISCOVER
|
||||
else
|
||||
item_reactions["[I]"] = pick(SCANTYPE_POKE,SCANTYPE_IRRADIATE,SCANTYPE_GAS,SCANTYPE_HEAT,SCANTYPE_COLD,SCANTYPE_OBLITERATE)
|
||||
if(ispath(I,/obj/item/weapon/stock_parts) || ispath(I,/obj/item/weapon/grenade/chem_grenade) || ispath(I,/obj/item/weapon/kitchen))
|
||||
var/obj/item/tempCheck = new I()
|
||||
if(tempCheck.icon_state != null) //check it's an actual usable item, in a hacky way
|
||||
var/obj/item/tempCheck = I
|
||||
if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way
|
||||
valid_items += 15
|
||||
valid_items += I
|
||||
probWeight++
|
||||
qdel(tempCheck)
|
||||
|
||||
if(ispath(I,/obj/item/weapon/reagent_containers/food))
|
||||
var/obj/item/tempCheck = new I()
|
||||
if(tempCheck.icon_state != null) //check it's an actual usable item, in a hacky way
|
||||
var/obj/item/tempCheck = I
|
||||
if(initial(tempCheck.icon_state) != null) //check it's an actual usable item, in a hacky way
|
||||
valid_items += rand(1,max(2,35-probWeight))
|
||||
valid_items += I
|
||||
qdel(tempCheck)
|
||||
|
||||
if(ispath(I,/obj/item/weapon/rcd) || ispath(I,/obj/item/weapon/grenade) || ispath(I,/obj/item/device/aicard) || ispath(I,/obj/item/weapon/storage/backpack/holding) || ispath(I,/obj/item/slime_extract) || ispath(I,/obj/item/device/onetankbomb) || ispath(I,/obj/item/device/transfer_valve))
|
||||
var/obj/item/tempCheck = new I()
|
||||
if(tempCheck.icon_state != null)
|
||||
var/obj/item/tempCheck = I
|
||||
if(initial(tempCheck.icon_state) != null)
|
||||
critical_items += I
|
||||
qdel(tempCheck)
|
||||
|
||||
|
||||
/obj/machinery/r_n_d/experimentor/New()
|
||||
|
||||
Reference in New Issue
Block a user