Files
fulpstation/code/__HELPERS/random_items.dm
John Willard 7199947c08 [MDB IGNORE] [IDB IGNORE] WIP TGU (#1427)
Several months worth of updates.

---------

Co-authored-by: A miscellaneous Fern <80640114+FernandoJ8@users.noreply.github.com>
Co-authored-by: Pepsilawn <reisenrui@gmail.com>
Co-authored-by: Ray <64306407+OneAsianTortoise@users.noreply.github.com>
Co-authored-by: Cure221 <106662180+Cure221@users.noreply.github.com>
2025-11-06 08:20:20 -05:00

18 lines
855 B
Plaintext

// Its not full proof but it standerizes behavoir between gifts and lootboxes
/// Used for random item gen to try and generate a list of types that arent weird parent types and similar
/proc/get_sane_item_types(requested_type)
if(!ispath(requested_type, /obj/item))
return list()
var/list/all_valid_types = list()
for(var/obj/item/iter_type as anything in typesof(requested_type))
if((iter_type.abstract_type == iter_type) || (iter_type.item_flags & ABSTRACT))
continue
if(iter_type.spawn_blacklisted)
continue
// The original behavior also included inhand icon states but that seems dumb
// if(!iter_type.icon_state || !iter_type.inhand_icon_state)
if(!iter_type.icon_state)
continue // With the existance of abstract_type we could prob depricate this handling at some point
all_valid_types += iter_type
return all_valid_types