Miscellaneous Fixes (#1868)

changes:

Engineering now actually gets engineering-type alert consoles instead of the non-functional base type.
Lighting is no longer broken by shuttles.
The ERT shuttle autoannouncer should no longer cause lighting runtimes.
Fixed some bad newlines in some character setup help texts.
Custom loadout tweaks now properly write to SQL.
Custom loadout is now saved as JSON.
Players are now shown a notice when the server was unable to load their custom loadout.
Drowsyness is now clamped to zero.
Added some new tips to the example.
Tweaked some tips' grammar.
Removed some tips that do not apply to our code base.
Probably fixes embraced vampire thralls not getting vampire verbs.
Fixes #1844.
Fixes #1835.
Probably fixes #1687.
Probably fixes #1824.
Fixes #1839
This commit is contained in:
Lohikar
2017-03-05 07:14:28 -06:00
committed by skull132
parent 3080c20428
commit 73c29bd5a7
17 changed files with 103 additions and 81 deletions

View File

@@ -105,12 +105,12 @@
return TOPIC_NOACTION
else if(href_list["namehelp"])
alert(user, "Due to game mechanics, you are no longer able to edit the name for this character. The grace period offered is 5 days since the character's initial save.<br><br>If you have a need to change the character's name, or further questions regarding this policy, please contact an administrator.")
alert(user, "Due to game mechanics, you are no longer able to edit the name for this character. The grace period offered is 5 days since the character's initial save.\n\nIf you have a need to change the character's name, or further questions regarding this policy, please contact an administrator.")
return TOPIC_NOACTION
else if(href_list["random_name"])
if (!pref.can_edit_name)
alert(user, "You can no longer edit the name of your character.<br><br>If there is a legitimate need, please contact an administrator regarding the matter.")
alert(user, "You can no longer edit the name of your character.\n\nIf there is a legitimate need, please contact an administrator regarding the matter.")
return TOPIC_NOACTION
pref.real_name = random_name(pref.gender, pref.species)
@@ -141,4 +141,4 @@
pref.metadata = sanitize(new_metadata)
return TOPIC_REFRESH
return ..()
return ..()

View File

@@ -34,6 +34,7 @@ var/list/gear_datums = list()
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
@@ -51,7 +52,7 @@ var/list/gear_datums = list()
return list("ss13_characters" = list("gear", "id" = 1, "ckey" = 1))
/datum/category_item/player_setup_item/loadout/gather_save_parameters()
return list(":gear" = list2params(pref.gear), ":id" = pref.current_character, ":ckey" = pref.client.ckey)
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()
@@ -66,9 +67,18 @@ var/list/gear_datums = list()
. += gear_name
/datum/category_item/player_setup_item/loadout/sanitize_character(var/sql_load = 0)
if (sql_load)
pref.gear = params2list(pref.gear)
gear_reset = FALSE
if (pref.gear && istext(pref.gear))
try
pref.gear = json_decode(pref.gear)
catch
log_debug("SQL_CHAR: Unable to load preferences 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))
@@ -106,6 +116,8 @@ var/list/gear_datums = list()
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>"

View File

@@ -62,8 +62,8 @@ datum/preferences
var/species = "Human" //Species datum to use.
var/species_preview //Used for the species selection window.
var/list/alternate_languages = list() //Secondary language(s)
var/list/language_prefixes = list() //Kanguage prefix keys
var/list/gear //Custom/fluff item loadout.
var/list/language_prefixes = list() // Language prefix keys
var/list/gear // Custom/fluff item loadout.
//Some faction information.
var/home_system = "Unset" //System of birth.

View File

@@ -29,3 +29,9 @@
/datum/effect_system/proc/bind(var/target)
holder = target
/datum/effect_system/proc/set_loc(var/atom/movable/loc)
if (istype(loc, /turf/))
location = loc
else
location = get_turf(loc)

View File

@@ -5,13 +5,10 @@
// Using the spark procs is preferred to directly instancing this.
/datum/effect_system/sparks/New(var/atom/movable/loc, var/start_immediately = TRUE, var/amt = 1, var/list/spread_dirs = list())
if(!loc || loc.gcDestroyed)
if(QDELETED(loc))
return
if (istype(loc, /turf))
location = loc
else
holder = loc
set_loc(loc)
if (amt)
amount = amt
@@ -34,8 +31,9 @@
var/total_sparks = 1
if (location)
var/obj/visual_effect/sparks/S = new /obj/visual_effect/sparks(location, src, 0) //Trigger one on the tile it's on
var/obj/visual_effect/sparks/S = getFromPool(/obj/visual_effect/sparks, location, src, 0) //Trigger one on the tile it's on
S.start()
playsound(location, "sparks", 100, 1)
effects_visuals += S // Queue it.
while (total_sparks <= src.amount)
@@ -47,7 +45,7 @@
else
direction = pick(src.spread)
S = new /obj/visual_effect/sparks(location, src)
S = getFromPool(/obj/visual_effect/sparks, location, src)
S.start(direction)
effects_visuals += S
total_sparks++

View File

@@ -1,19 +1,13 @@
// -- Spark visual_effect --
/obj/visual_effect/sparks
name = "sparks"
icon = 'icons/effects/effects.dmi'
//icon_state = "sparks"
icon_state = "sparks"
anchored = 1
mouse_opacity = 0
live_icon_state = "sparks"
/obj/visual_effect/sparks/New(var/turf/loc)
..(loc)
life_ticks = rand(2,10)
/obj/visual_effect/sparks/resetVariables()
. = ..()
life_ticks = rand(2,10)
life_ticks = rand(5,10)
/obj/visual_effect/sparks/tick()
. = ..()
@@ -22,6 +16,9 @@
if(T)
T.hotspot_expose(1000, 100)
if (life_ticks < 2)
animate(src, alpha = 0, time = 2, easing = SINE_EASING | EASE_IN)
/obj/visual_effect/sparks/start(var/direction)
..()
if (direction)

View File

@@ -1,23 +1,22 @@
/obj/visual_effect
name = "effect"
icon = 'icons/effects/effects.dmi'
anchored = 1
simulated = 0
mouse_opacity = 0
var/life_ticks // How many ticks this effect will life before it stops processing.
var/life_ticks_max // The high limit for the random tick picker.
var/life_ticks_min // The low limit for the random tick picker.
var/live_icon_state // The icon-state to use when this object is shown to the user.
/obj/visual_effect/New(var/life_min = 3 SECONDS, var/life_max = 5 SECONDS)
..()
life_ticks_min = life_min
life_ticks_max = life_max
life_ticks = rand(life_ticks_min, life_ticks_max)
flick(icon_state, src)
// Called when the visual_effect is manifested.
/obj/visual_effect/proc/start()
if (live_icon_state)
icon_state = live_icon_state
// Called every effects processor tick. Return value determines what the process does to this object.
/obj/visual_effect/proc/tick()
@@ -30,8 +29,6 @@
// Called just before the visual_effect is returned to the pool.
/obj/visual_effect/proc/end()
loc = null
if (live_icon_state)
icon_state = null
/obj/visual_effect/Destroy()
// ¯\_(ツ)_/¯

View File

@@ -332,6 +332,9 @@
var/static/update_gen = 1
applied = 1
if (!source_turf)
return
var/Tx
var/Ty
var/Sx = source_turf.x

View File

@@ -1055,11 +1055,14 @@
handle_statuses()
if (drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
if (drowsyness < 0)
drowsyness = 0
else
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
confused = max(0, confused - 1)