mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 16:12:19 +00:00
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.
* this is probably important
* Remove cascade disabling SSgarbage
* Fixed a bug where dust() did not qdel the target mob
* Misc fixes
* Fix decals surviving break-to-plating
* Subsystem flag tweaks
* Apparently subsystems are new'd before config is.
* Fix paper icons
* Speculative fix for insane lag
* Better machinery stat
* Make organs not use SSoverlay
* Misc bugfixes & tweaks
* Nightmode fixes
* Changelog for SMC
* Port /tg/'s improved MC crash handling
* Add some more SS Recover() procs
* supply_controller -> SScargo
* More New() -> Initialize()
* pAI and robot construction overlays
* Fix cargo unit tests
* Merge the DMM Suite's atom/New() into atoms_init
* Lighting pre-baking
* Lighting initialization logging
* Fix some bad SS init orders
* Fix SSlighting logging; rename Processes to MC
* Speculative fix for insane GC lag
* Prebaked openturf/icon_smooth & fix lighting prebake
* SS init status; SSatoms LATEQDEL
* Fix bug with MC init stat panel
* Fix parallax
* Misc
* Ignore SS_NO_DISPLAY during init
* apparently this is important
* REEEEEE
* Image GC fixes; broadcaster radio-new sanity
* RCON Cleanup
* Move pAI recruiter into subsystem
* Move global solars list into sun subsystem
* Make chickens not use a global
* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup
* Speed up space init a little
* Fix bad timer flags on floor drying
* Subsystem panic-restart verb for mins
* Explosion speedup
* Minor subsystem & MC logging tweaks
* SSopenturf improvements
* Make pipenet actually initialize (whoops)
* Minor tweaks
* Implement lighting rounding
* comments are hard okay
* Minor lattice tweaks
* Fix some timer issues & better closet init
* Timer sanity
* Request console tweaks + Storage init sanity
* Minor SSmachiner RCON improvements
* Further reduce world-start timer count
* Standardize subsystem logging
* Garbage hard delete profiling from /tg/
* Timer hang detection & recovery
* Log machines that sleep in process() and fuck up SSmachinery
* Fix an issue with external airlocks sleeping in process()
* Failsafe logging
* Minor tweaks
* Revert "Request console tweaks + Storage init sanity"
This reverts commit 98d3579e35.
* Re-implement RC changes
* Fix SQL FT saving
* Fix SSmachinery sleep in disposals
* Minor SS tweaks
* Paper fixes
* Blood drying fixes
* Merge gameticker and SSticker
* Minor global list init cleanup
* Lagcheck biogenerator & bags
* Tweak SScargo init order; RIG Initialize()
* Caching tweaks
* Remove rogue comma
* Initialize fixes
* Lighting destroy cleanup
* Fix emagging airlocks
* Initial SSicon implementation
* Tweaks & Fixes
* Fire + Air alarm queued icon updates
* Overlays + Queued icon cleanup
* Runtime & background fixes
* Kill some meaningless set statements
* Kill some image qdels
* Bump up lighting rounding val
* Fix adv. scanner destroy runtimes
* Remove unneeded icon update limiting
* Move icon smoothing into helpers
* Show a warning if DM 510 compiles without memory leak hack enabled
* Re-organize subsystems & MC defines a little
* Airlock SFX
* Log of Changes
* Make SSicon_update disable itself when not doing anything
* Fix respawn verb runtime when used early in server-init
* Add more information to MC's stat_entry()
* Replace direct refernces to gcDestroyed with QDEL* macros
* plant_controller -> SSplants
* More plant tweaks
* Add more humor to changelog
* Move parallax globals into SSparallax
* Lighting responsiveness tweaks
* Fix parallax init order & better MC init panel stat
* Make mobs GC
* More overlays + Remove intercom spawn()
* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.
* Update changelog
* Mob GC tweaks
* Del() cleanup
* Fix insomniac ZAS connection edges
* Minor pAI cleanup
* Convert more things to SSoverlay; fix duplicated overlay in field gens
* SM Bluespace turf tweaks
* Update SSgarbage debug globals list
* Human-type qdel tweaks
* Subsystem suspension; stat_entry improvements
* SQL Statistics cleanup
* Fix runtimes with ambrosia
* More disable() -> suspend(); fix nightmode again
* Human qdel fix; minor tweaks
* Update turbolift to work with StonedMC
* Make lifts use timers instead of a subsystem
* Make SSassets start earlier
* Convert the radio controller into a subsystem
* Fix some missing CHECK_TICKs in asteroid generation
* MC stat tweaks; make shouldnt_see a typecache
* Kill some redundant debug-controller entries
* radio_controller -> SSradio
* Better SSgarbage hard-del logging from /tg/ upstream
* Logging tweaks + GELF
* Misc client caching improvements
* Slime SSoverlay
* Oven icon fixes
* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.
* Holder tweaks + Welding tool Initialize()
* Fix some bad subsystem logging
* Fix suit cooling units spawning without cells
* Starlight tweaks
* Gibber infinite gib fix
* More SSoverlay stuff
* Make crates use CUT_OVERLAY_IN
* Make SSarrivals suspend instead of disable
* Make openturf use split/phased tick checks
* Speculative fix for unwet timer runtimes
* Blood overlay tweaks/fixes
* Update crusher to play nice with SMC + SSoverlay
* Openturf improvements and fixes
* Minor turbolift tweaks
* Lighting performance improvements + ChangeTurf tweaks
* this is probably important
* Fix wall weld noises on changeturf
* More ChangeTurf tweaks
* Explosion tweaks
* Pre-game lobby tweaks
* Openturf tweaks
* Prevent admins from starting the game before init finishes
* Fix Travis
* Kill an unused var
* Fix ChangeTurf runtimes on openturfs
* Fixes
* Browser datum fixes, asset caching
* Update changelog
* Changelog
* Lobby tweaks
* Ticker tweaks; kill ticker var
* Further lobby tweaks
* Cascade tweaks
* air_master -> SSair
* Reduce overhead from radio autosay
* alarm_manager -> SSalarm
* bomb_processor -> SSexplosives
* corp_regs -> SSlaw
* ZAS overlay fixes
* Small wall icon optimization
* Fix effects master
* Assembly tweaks
* Megavend fixes
* Shuttle fixes
* Camera alert performance improvements
* Fix some world.log spam from lighting overlays
* Fix some Initialize() procs
* Openspace responsiveness tweaks
* Make HE pipes animate through openturfs
* Kill a spawn
246 lines
8.6 KiB
Plaintext
246 lines
8.6 KiB
Plaintext
var/list/loadout_categories = list()
|
|
var/list/gear_datums = list()
|
|
|
|
/datum/loadout_category
|
|
var/category = ""
|
|
var/list/gear = list()
|
|
|
|
/datum/loadout_category/New(var/cat)
|
|
category = cat
|
|
..()
|
|
|
|
/hook/startup/proc/populate_gear_list()
|
|
// Setup custom loadout.
|
|
//create a list of gear datums to sort
|
|
for(var/geartype in subtypesof(/datum/gear))
|
|
var/datum/gear/G = geartype
|
|
|
|
var/use_name = initial(G.display_name)
|
|
var/use_category = initial(G.sort_category)
|
|
|
|
if(!loadout_categories[use_category])
|
|
loadout_categories[use_category] = new /datum/loadout_category(use_category)
|
|
var/datum/loadout_category/LC = loadout_categories[use_category]
|
|
gear_datums[use_name] = new geartype
|
|
LC.gear[use_name] = gear_datums[use_name]
|
|
|
|
sortTim(loadout_categories, /proc/cmp_text_asc, FALSE)
|
|
for(var/loadout_category in loadout_categories)
|
|
var/datum/loadout_category/LC = loadout_categories[loadout_category]
|
|
sortTim(LC.gear, /proc/cmp_text_asc, FALSE)
|
|
|
|
return TRUE
|
|
|
|
/datum/category_item/player_setup_item/loadout
|
|
name = "Loadout"
|
|
sort_order = 1
|
|
var/current_tab = "General"
|
|
var/gear_reset = FALSE
|
|
|
|
/datum/category_item/player_setup_item/loadout/load_character(var/savefile/S)
|
|
S["gear"] >> pref.gear
|
|
|
|
/datum/category_item/player_setup_item/loadout/save_character(var/savefile/S)
|
|
S["gear"] << pref.gear
|
|
|
|
/datum/category_item/player_setup_item/loadout/gather_load_parameters()
|
|
return list(":id" = pref.current_character)
|
|
|
|
/datum/category_item/player_setup_item/loadout/gather_load_query()
|
|
return list("ss13_characters" = list("vars" = list("gear"), "args" = list("id")))
|
|
|
|
/datum/category_item/player_setup_item/loadout/gather_save_query()
|
|
return list("ss13_characters" = list("gear", "id" = 1, "ckey" = 1))
|
|
|
|
/datum/category_item/player_setup_item/loadout/gather_save_parameters()
|
|
return list(":gear" = json_encode(pref.gear), ":id" = pref.current_character, ":ckey" = pref.client.ckey)
|
|
|
|
/datum/category_item/player_setup_item/loadout/proc/valid_gear_choices(var/max_cost)
|
|
. = list()
|
|
var/mob/preference_mob = preference_mob()
|
|
for(var/gear_name in gear_datums)
|
|
var/datum/gear/G = gear_datums[gear_name]
|
|
|
|
if(G.whitelisted && !is_alien_whitelisted(preference_mob, all_species[G.whitelisted]))
|
|
continue
|
|
if(max_cost && G.cost > max_cost)
|
|
continue
|
|
. += gear_name
|
|
|
|
/datum/category_item/player_setup_item/loadout/sanitize_character(var/sql_load = 0)
|
|
if (sql_load)
|
|
gear_reset = FALSE
|
|
if (pref.gear && istext(pref.gear))
|
|
try
|
|
pref.gear = json_decode(pref.gear)
|
|
catch
|
|
log_debug("SQL CHARACTER LOAD: Unable to load custom loadout for client [pref.client ? pref.client.ckey : "UNKNOWN"].")
|
|
|
|
pref.gear = list()
|
|
gear_reset = TRUE
|
|
else
|
|
pref.gear = list()
|
|
gear_reset = TRUE
|
|
|
|
var/mob/preference_mob = preference_mob()
|
|
if(!islist(pref.gear))
|
|
pref.gear = list()
|
|
|
|
for(var/gear_name in pref.gear)
|
|
if(!(gear_name in gear_datums))
|
|
pref.gear -= gear_name
|
|
var/total_cost = 0
|
|
for(var/gear_name in pref.gear)
|
|
if(!gear_datums[gear_name])
|
|
preference_mob << "<span class='warning'>You cannot have more than one of the \the [gear_name]</span>"
|
|
pref.gear -= gear_name
|
|
else if(!(gear_name in valid_gear_choices()))
|
|
preference_mob << "<span class='warning'>You cannot take \the [gear_name] as you are not whitelisted for the species.</span>"
|
|
pref.gear -= gear_name
|
|
else
|
|
var/datum/gear/G = gear_datums[gear_name]
|
|
if(total_cost + G.cost > MAX_GEAR_COST)
|
|
pref.gear -= gear_name
|
|
preference_mob << "<span class='warning'>You cannot afford to take \the [gear_name]</span>"
|
|
else
|
|
total_cost += G.cost
|
|
|
|
/datum/category_item/player_setup_item/loadout/content()
|
|
var/total_cost = 0
|
|
if(pref.gear && pref.gear.len)
|
|
for(var/i = 1; i <= pref.gear.len; i++)
|
|
var/datum/gear/G = gear_datums[pref.gear[i]]
|
|
if(G)
|
|
total_cost += G.cost
|
|
|
|
var/fcolor = "#3366CC"
|
|
if(total_cost < MAX_GEAR_COST)
|
|
fcolor = "#E67300"
|
|
. = list()
|
|
. += "<table align = 'center' width = 100%>"
|
|
if (gear_reset)
|
|
. += "<tr><td colspan=3><center><i>Your loadout failed to load and will be reset if you save this slot.</i></center></td></tr>"
|
|
. += "<tr><td colspan=3><center><b><font color = '[fcolor]'>[total_cost]/[MAX_GEAR_COST]</font> loadout points spent.</b> \[<a href='?src=\ref[src];clear_loadout=1'>Clear Loadout</a>\]</center></td></tr>"
|
|
|
|
. += "<tr><td colspan=3><center><b>"
|
|
var/firstcat = 1
|
|
for(var/category in loadout_categories)
|
|
|
|
if(firstcat)
|
|
firstcat = 0
|
|
else
|
|
. += " |"
|
|
if(category == current_tab)
|
|
. += " [category] "
|
|
else
|
|
var/datum/loadout_category/LC = loadout_categories[category]
|
|
var/tcolor = "#3366CC"
|
|
for(var/thing in LC.gear)
|
|
if(thing in pref.gear)
|
|
tcolor = "#E67300"
|
|
break
|
|
. += " <a href='?src=\ref[src];select_category=[category]'><font color = '[tcolor]'>[category]</font></a> "
|
|
. += "</b></center></td></tr>"
|
|
|
|
var/datum/loadout_category/LC = loadout_categories[current_tab]
|
|
. += "<tr><td colspan=3><hr></td></tr>"
|
|
. += "<tr><td colspan=3><b><center>[LC.category]</center></b></td></tr>"
|
|
. += "<tr><td colspan=3><hr></td></tr>"
|
|
for(var/gear_name in LC.gear)
|
|
if(!(gear_name in valid_gear_choices()))
|
|
continue
|
|
var/datum/gear/G = LC.gear[gear_name]
|
|
var/ticked = (G.display_name in pref.gear)
|
|
. += "<tr style='vertical-align:top'><td width=25%><a href='?src=\ref[src];toggle_gear=[G.display_name]'><font color='[ticked ? "#E67300" : "#3366CC"]'>[G.display_name]</font></a></td>"
|
|
. += "<td width = 10% style='vertical-align:top'>[G.cost]</td>"
|
|
. += "<td><font size=2><i>[G.description]</i></font></td></tr>"
|
|
if(ticked)
|
|
. += "<tr><td colspan=3>"
|
|
for(var/datum/gear_tweak/tweak in G.gear_tweaks)
|
|
. += " <a href='?src=\ref[src];gear=[G.display_name];tweak=\ref[tweak]'>[tweak.get_contents(get_tweak_metadata(G, tweak))]</a>"
|
|
. += "</td></tr>"
|
|
. += "</table>"
|
|
. = jointext(.,null)
|
|
|
|
/datum/category_item/player_setup_item/loadout/proc/get_gear_metadata(var/datum/gear/G)
|
|
. = pref.gear[G.display_name]
|
|
if(!.)
|
|
. = list()
|
|
pref.gear[G.display_name] = .
|
|
|
|
/datum/category_item/player_setup_item/loadout/proc/get_tweak_metadata(var/datum/gear/G, var/datum/gear_tweak/tweak)
|
|
var/list/metadata = get_gear_metadata(G)
|
|
. = metadata["[tweak]"]
|
|
if(!.)
|
|
. = tweak.get_default()
|
|
metadata["[tweak]"] = .
|
|
|
|
/datum/category_item/player_setup_item/loadout/proc/set_tweak_metadata(var/datum/gear/G, var/datum/gear_tweak/tweak, var/new_metadata)
|
|
var/list/metadata = get_gear_metadata(G)
|
|
metadata["[tweak]"] = new_metadata
|
|
|
|
/datum/category_item/player_setup_item/loadout/OnTopic(href, href_list, user)
|
|
if(href_list["toggle_gear"])
|
|
var/datum/gear/TG = gear_datums[href_list["toggle_gear"]]
|
|
if(TG.display_name in pref.gear)
|
|
pref.gear -= TG.display_name
|
|
else
|
|
var/total_cost = 0
|
|
for(var/gear_name in pref.gear)
|
|
var/datum/gear/G = gear_datums[gear_name]
|
|
if(istype(G)) total_cost += G.cost
|
|
if((total_cost+TG.cost) <= MAX_GEAR_COST)
|
|
pref.gear += TG.display_name
|
|
return TOPIC_REFRESH
|
|
if(href_list["gear"] && href_list["tweak"])
|
|
var/datum/gear/gear = gear_datums[href_list["gear"]]
|
|
var/datum/gear_tweak/tweak = locate(href_list["tweak"])
|
|
if(!tweak || !istype(gear) || !(tweak in gear.gear_tweaks))
|
|
return TOPIC_NOACTION
|
|
var/metadata = tweak.get_metadata(user, get_tweak_metadata(gear, tweak))
|
|
if(!metadata || !CanUseTopic(user))
|
|
return TOPIC_NOACTION
|
|
set_tweak_metadata(gear, tweak, metadata)
|
|
return TOPIC_REFRESH
|
|
else if(href_list["select_category"])
|
|
current_tab = href_list["select_category"]
|
|
return TOPIC_REFRESH
|
|
else if(href_list["clear_loadout"])
|
|
pref.gear.Cut()
|
|
return TOPIC_REFRESH
|
|
return ..()
|
|
|
|
/datum/gear
|
|
var/display_name //Name/index. Must be unique.
|
|
var/description //Description of this gear. If left blank will default to the description of the pathed item.
|
|
var/path //Path to item.
|
|
var/cost = 1 //Number of points used. Items in general cost 1 point, storage/armor/gloves/special use costs 2 points.
|
|
var/slot //Slot to equip to.
|
|
var/list/allowed_roles //Roles that can spawn with this item.
|
|
var/whitelisted //Term to check the whitelist for..
|
|
var/sort_category = "General"
|
|
var/list/gear_tweaks = list() //List of datums which will alter the item after it has been spawned.
|
|
|
|
/datum/gear/New()
|
|
..()
|
|
if(!description)
|
|
var/obj/O = path
|
|
description = initial(O.desc)
|
|
|
|
/datum/gear_data
|
|
var/path
|
|
var/location
|
|
|
|
/datum/gear_data/New(var/path, var/location)
|
|
src.path = path
|
|
src.location = location
|
|
|
|
/datum/gear/proc/spawn_item(var/location, var/metadata)
|
|
var/datum/gear_data/gd = new(path, location)
|
|
for(var/datum/gear_tweak/gt in gear_tweaks)
|
|
gt.tweak_gear_data(metadata["[gt]"], gd)
|
|
var/item = new gd.path(gd.location)
|
|
for(var/datum/gear_tweak/gt in gear_tweaks)
|
|
gt.tweak_item(item, metadata["[gt]"])
|
|
return item
|