Update from dev.

This commit is contained in:
Zuhayr
2015-02-12 23:15:47 +10:30
33 changed files with 1886 additions and 1550 deletions
+10 -3
View File
@@ -1174,15 +1174,22 @@ var/global/floorIsLava = 0
switch(detail)
if(0)
return "<b>[key_name(C, link, name, highlight_special)]</b>"
if(1)
if(1) //Private Messages
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>)</b>"
if(2)
if(2) //Admins
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=holder;adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>) (<A HREF='?_src_=holder;check_antagonist=1'>CA</A>)</b>"
if(3)
if(3) //Devs
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)](<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>)(<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>)</b>"
if(4) //Mentors
var/ref_mob = "\ref[M]"
return "<b>[key_name(C, link, name, highlight_special)] (<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservejump=[ref_mob]'>JMP</A>)</b>"
/proc/ishost(whom)
if(!whom)
+5 -1
View File
@@ -87,7 +87,11 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
var/ai_cl
if(ai_found)
ai_cl = " (<A HREF='?_src_=holder;adminchecklaws=\ref[mob]'>CL</A>)"
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 0, 0, 1, 0)][ai_cl]:</b> [msg]"
//Options bar: mob, details ( admin = 2, dev = 3, mentor = 4, character name (0 = just ckey, 1 = ckey and character name), link? (0 no don't make it a link, 1 do so),
// highlight special roles (0 = everyone has same looking name, 1 = antags / special roles get a golden name)
var/mentor_msg = "\blue <b><font color=red>Request for Help: </font>[get_options_bar(mob, 4, 1, 1, 0)][ai_cl]:</b> [msg]"
msg = "\blue <b><font color=red>Request for Help:: </font>[get_options_bar(mob, 2, 1, 1)][ai_cl]:</b> [msg]"
var/admin_number_afk = 0
@@ -197,8 +197,8 @@
target_mob = H
if(target_mob != H)
H << "<span class='danger'>You inject [target_mob] with [chems_to_use] unit[chems_to_use == 1 ? "" : "s"] of [charge.display_name].</span>"
target_mob << "<span class='danger'>You feel a rushing in your veins as [chems_to_use] unit[chems_to_use == 1 ? "" : "s"] of [charge.display_name] [chems_to_use == 1 ? "is" : "are"] injected.</span>"
H << "<span class='danger'>You inject [target_mob] with [chems_to_use] unit\s of [charge.display_name].</span>"
target_mob << "<span class='danger'>You feel a rushing in your veins as [chems_to_use] unit\s of [charge.display_name] [chems_to_use == 1 ? "is" : "are"] injected.</span>"
target_mob.reagents.add_reagent(charge.display_name, chems_to_use)
charge.charges -= chems_to_use
+1 -1
View File
@@ -375,7 +375,7 @@
if(prob(90))
set_trait(TRAIT_REQUIRES_NUTRIENTS,1)
set_trait(TRAIT_NUTRIENT_CONSUMPTION,rand(100)*0.1)
set_trait(TRAIT_NUTRIENT_CONSUMPTION,rand(25)/25)
else
set_trait(TRAIT_REQUIRES_NUTRIENTS,0)
+1 -1
View File
@@ -23,7 +23,7 @@
"exotic matter" = 0
)
for(var/turf/T in oview(3,get_turf(user)))
for(var/turf/T in range(3,get_turf(user)))
if(!T.has_resources)
continue
+1 -1
View File
@@ -107,7 +107,7 @@
return
else
if(language)
message = language.scramble(language)
message = language.scramble(message)
else
message = stars(message)
+22 -1
View File
@@ -1,3 +1,5 @@
#define SCRAMBLE_CACHE_LEN 20
/*
Datum based languages. Easily editable and modular.
*/
@@ -35,11 +37,21 @@
return "[trim(full_name)]"
/datum/language
var/list/scramble_cache = list()
/datum/language/proc/scramble(var/input)
if(!syllables || !syllables.len)
return stars(input)
// If the input is cached already, move it to the end of the cache and return it
if(input in scramble_cache)
var/n = scramble_cache[input]
scramble_cache -= input
scramble_cache[input] = n
return n
var/input_size = length(input)
var/scrambled_text = ""
var/capitalize = 1
@@ -64,6 +76,13 @@
var/input_ending = copytext(input, input_size)
if(input_ending in list("!","?","."))
scrambled_text += input_ending
// Add it to cache, cutting old entries if the list is too long
scramble_cache[input] = scrambled_text
if(scramble_cache.len > SCRAMBLE_CACHE_LEN)
scramble_cache.Cut(1, scramble_cache.len-SCRAMBLE_CACHE_LEN-1)
return scrambled_text
/datum/language/proc/format_message(message, verb)
@@ -496,4 +515,6 @@
"al", "an", "ar", "as", "at", "ea", "ed", "en", "er", "es", "ha", "he", "hi", "in", "is", "it",
"le", "me", "nd", "ne", "ng", "nt", "on", "or", "ou", "re", "se", "st", "te", "th", "ti", "to",
"ve", "wa", "all", "and", "are", "but", "ent", "era", "ere", "eve", "for", "had", "hat", "hen", "her", "hin",
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
"his", "ing", "ion", "ith", "not", "ome", "oul", "our", "sho", "ted", "ter", "tha", "the", "thi")
#undef SCRAMBLE_CACHE_LEN
+2 -1
View File
@@ -434,7 +434,8 @@
step(pulling, get_dir(pulling.loc, T))
M.start_pulling(t)
if(t)
M.start_pulling(t)
else
if (pulling)
if (istype(pulling, /obj/structure/window))
+5
View File
@@ -893,6 +893,11 @@
if(!can_use(usr, 1))
return 1
if(!istype(usr, /mob/living/silicon) && locked)
// Shouldn't happen, this is here to prevent href exploits
usr << "You must unlock the panel to use this!"
return 1
if (href_list["lock"])
coverlocked = !coverlocked
+73 -40
View File
@@ -15,7 +15,7 @@
var/power_output = 1
/obj/machinery/power/port_gen/proc/IsBroken()
return (crit_fail || (stat & BROKEN|EMPED))
return (crit_fail || (stat & (BROKEN|EMPED)))
/obj/machinery/power/port_gen/proc/HasFuel() //Placeholder for fuel check.
return 1
@@ -68,7 +68,7 @@
if(3)
if(prob(10)) stat &= BROKEN
duration = 300
stat |= EMPED
if(duration)
spawn(duration)
@@ -84,12 +84,12 @@
//A power generator that runs on solid plasma sheets.
/obj/machinery/power/port_gen/pacman
name = "\improper P.A.C.M.A.N.-type Portable Generator"
desc = "A power generator that runs on solid plasma sheets. Rated for 80 kW max safe output."
var/sheet_name = "solid plasma sheet"
desc = "A power generator that runs on solid phoron sheets. Rated for 80 kW max safe output."
var/sheet_name = "Phoron Sheets"
var/sheet_path = /obj/item/stack/sheet/mineral/phoron
var/board_path = "/obj/item/weapon/circuitboard/pacman"
var/board_path = "/obj/item/weapon/circuitboard/pacman"
/*
These values were chosen so that the generator can run safely up to 80 kW
A full 50 phoron sheet stack should last 20 minutes at power_output = 4
@@ -98,15 +98,16 @@
*/
power_gen = 20000 //Watts output per power_output level
var/max_power_output = 5 //The maximum power setting without emagging.
var/max_safe_output = 4 // For UI use, maximal output that won't cause overheat.
var/time_per_sheet = 96 //fuel efficiency - how long 1 sheet lasts at power level 1
var/max_sheets = 100 //max capacity of the hopper
var/max_temperature = 300 //max temperature before overheating increases
var/temperature_gain = 50 //how much the temperature increases per power output level, in degrees per level
var/sheets = 0 //How many sheets of material are loaded in the generator
var/sheet_left = 0 //How much is left of the current sheet
var/temperature = 0 //The current temperature
var/overheating = 0 //if this gets high enough the generator explodes
var/temperature = 0 //The current temperature
var/overheating = 0 //if this gets high enough the generator explodes
/obj/machinery/power/port_gen/pacman/initialize()
..()
@@ -122,8 +123,6 @@
component_parts += new /obj/item/stack/cable_coil(src)
component_parts += new /obj/item/weapon/stock_parts/capacitor(src)
component_parts += new board_path(src)
var/obj/sheet = new sheet_path(null)
sheet_name = sheet.name
RefreshParts()
/obj/machinery/power/port_gen/pacman/Del()
@@ -137,20 +136,20 @@
max_sheets = SP.rating * SP.rating * 50
else if(istype(SP, /obj/item/weapon/stock_parts/micro_laser) || istype(SP, /obj/item/weapon/stock_parts/capacitor))
temp_rating += SP.rating
var/temp_reliability = 0
var/part_count = 0
for(var/obj/item/weapon/CP in component_parts)
temp_reliability += CP.reliability
part_count++
reliability = min(round(temp_reliability / part_count), 100)
power_gen = round(initial(power_gen) * (max(2, temp_rating) / 2))
/obj/machinery/power/port_gen/pacman/examine(mob/user)
..(user)
user << "\The [src] appears to be producing [power_gen*power_output] W."
user << "There are [sheets] [sheet_name]\s left in the hopper."
user << "There [sheets == 1 ? "is" : "are"] [sheets] sheet\s left in the hopper."
if(IsBroken()) user << "<span class='warning'>\The [src] seems to have broken down.</span>"
if(overheating) user << "<span class='danger'>\The [src] is overheating!</span>"
@@ -179,7 +178,7 @@
//how much material are we using this iteration?
var/needed_sheets = power_output / time_per_sheet
//HasFuel() should guarantee us that there is enough fuel left, so no need to check that
//the only thing we need to worry about is if we are going to rollover to the next sheet
if (needed_sheets > sheet_left)
@@ -192,7 +191,7 @@
//This should probably depend on the external temperature somehow, but whatever.
var/lower_limit = 56 + power_output * temperature_gain
var/upper_limit = 76 + power_output * temperature_gain
/*
Hot or cold environments can affect the equilibrium temperature
The lower the pressure the less effect it has. I guess it cools using a radiator or something when in vacuum.
@@ -205,16 +204,16 @@
var/ambient = environment.temperature - T20C
lower_limit += ambient*ratio
upper_limit += ambient*ratio
var/average = (upper_limit + lower_limit)/2
//calculate the temperature increase
var/bias = 0
if (temperature < lower_limit)
bias = min(round((average - temperature)/TEMPERATURE_DIVISOR, 1), TEMPERATURE_CHANGE_MAX)
else if (temperature > upper_limit)
bias = max(round((temperature - average)/TEMPERATURE_DIVISOR, 1), -TEMPERATURE_CHANGE_MAX)
temperature += rand(-7 + bias, 7 + bias)
if (temperature > max_temperature)
@@ -229,13 +228,16 @@
var/ratio = min(environment.return_pressure()/ONE_ATMOSPHERE, 1)
var/ambient = environment.temperature - T20C
cooling_temperature += ambient*ratio
if (temperature > cooling_temperature)
var/temp_loss = (temperature - cooling_temperature)/TEMPERATURE_DIVISOR
temp_loss = between(2, round(temp_loss, 1), TEMPERATURE_CHANGE_MAX)
temperature = max(temperature - temp_loss, cooling_temperature)
src.updateDialog()
if(overheating)
overheating--
/obj/machinery/power/port_gen/pacman/proc/overheat()
overheating++
if (overheating > 60)
@@ -249,7 +251,7 @@
var/datum/gas_mixture/environment = loc.return_air()
if (environment)
environment.adjust_gas_temp("phoron", phoron/10, temperature + T0C)
sheets = 0
sheet_left = 0
..()
@@ -261,7 +263,7 @@
if(amount < 1)
user << "\blue The [src.name] is full!"
return
user << "\blue You add [amount] [addstack.singular_name]\s to the [src.name]."
user << "\blue You add [amount] sheet\s to the [src.name]."
sheets += amount
addstack.use(amount)
updateUsrDialog()
@@ -305,11 +307,46 @@
..()
if (!anchored)
return
interact(user)
ui_interact(user)
/obj/machinery/power/port_gen/pacman/attack_ai(mob/user as mob)
interact(user)
ui_interact(user)
/obj/machinery/power/port_gen/pacman/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
if(IsBroken())
return
var/data[0]
data["active"] = active
if(istype(user, /mob/living/silicon/ai))
data["is_ai"] = 1
else if(istype(user, /mob/living/silicon/robot) && !Adjacent(user))
data["is_ai"] = 1
else
data["is_ai"] = 0
data["output_set"] = power_output
data["output_max"] = max_power_output
data["output_safe"] = max_safe_output
data["output_watts"] = power_output * power_gen
data["temperature_current"] = src.temperature
data["temperature_max"] = src.max_temperature
data["temperature_overheat"] = overheating
// 1 sheet = 1000cm3?
data["fuel_stored"] = round((sheets * 1000) + (sheet_left * 1000))
data["fuel_capacity"] = round(max_sheets * 1000, 0.1)
data["fuel_usage"] = active ? round((power_output / time_per_sheet) * 1000) : 0
data["fuel_type"] = sheet_name
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
if (!ui)
ui = new(user, src, ui_key, "pacman.tmpl", src.name, 500, 560)
ui.open()
ui.set_auto_update(1)
/*
/obj/machinery/power/port_gen/pacman/interact(mob/user)
if (get_dist(src, user) > 1 )
if (!istype(user, /mob/living/silicon/ai))
@@ -329,12 +366,13 @@
dat += text("Current stack: [stack_percent]% <br>")
dat += text("Power output: <A href='?src=\ref[src];action=lower_power'>-</A> [power_gen * power_output] Watts<A href='?src=\ref[src];action=higher_power'>+</A><br>")
dat += text("Power current: [(powernet == null ? "Unconnected" : "[avail()]")]<br>")
var/tempstr = "Temperature: [temperature]&deg;C<br>"
dat += (overheating)? "<span class='danger'>[tempstr]</span>" : tempstr
dat += "<br><A href='?src=\ref[src];action=close'>Close</A>"
user << browse("[dat]", "window=port_gen")
onclose(user, "port_gen")
*/
/obj/machinery/power/port_gen/pacman/Topic(href, href_list)
if(..())
@@ -346,33 +384,26 @@
if(!active && HasFuel() && !IsBroken())
active = 1
icon_state = "portgen1"
src.updateUsrDialog()
if(href_list["action"] == "disable")
if (active)
active = 0
icon_state = "portgen0"
src.updateUsrDialog()
if(href_list["action"] == "eject")
if(!active)
DropFuel()
src.updateUsrDialog()
if(href_list["action"] == "lower_power")
if (power_output > 1)
power_output--
src.updateUsrDialog()
if (href_list["action"] == "higher_power")
if (power_output < max_power_output || (emagged && power_output < round(max_power_output*2.5)))
power_output++
src.updateUsrDialog()
if (href_list["action"] == "close")
usr << browse(null, "window=port_gen")
usr.unset_machine()
/obj/machinery/power/port_gen/pacman/super
name = "S.U.P.E.R.P.A.C.M.A.N.-type Portable Generator"
desc = "A power generator that utilizes uranium sheets as fuel. Can run for much longer than the standard PACMAN type generators. Rated for 80 kW max safe output."
icon_state = "portgen1"
sheet_path = /obj/item/stack/sheet/mineral/uranium
sheet_name = "Uranium Sheets"
time_per_sheet = 576 //same power output, but a 50 sheet stack will last 2 hours at max safe power
board_path = "/obj/item/weapon/circuitboard/pacman/super"
@@ -390,26 +421,28 @@
//should really fall with the square of the distance, but that makes the rads value drop too fast
//I dunno, maybe physics works different when you live in 2D -- SM radiation also works like this, apparently
L.apply_effect(max(20, round(rads/get_dist(L,src))), IRRADIATE)
explosion(src.loc, 3, 3, 5, 3)
del(src)
del(src)
/obj/machinery/power/port_gen/pacman/mrs
name = "M.R.S.P.A.C.M.A.N.-type Portable Generator"
desc = "An advanced power generator that runs on tritium. Rated for 200 kW maximum safe output!"
icon_state = "portgen2"
sheet_path = /obj/item/stack/sheet/mineral/tritium
sheet_path = /obj/item/stack/sheet/mineral/tritium
sheet_name = "Tritium Fuel Sheets"
//I don't think tritium has any other use, so we might as well make this rewarding for players
//max safe power output (power level = 8) is 200 kW and lasts for 1 hour - 3 or 4 of these could power the station
power_gen = 25000 //watts
max_power_output = 10
max_safe_output = 8
time_per_sheet = 576
max_temperature = 800
temperature_gain = 90
board_path = "/obj/item/weapon/circuitboard/pacman/mrs"
/obj/machinery/power/port_gen/pacman/mrs/explode()
//no special effects, but the explosion is pretty big (same as a supermatter shard).
explosion(src.loc, 3, 6, 12, 16, 1)
del(src)
del(src)
+4 -2
View File
@@ -63,8 +63,10 @@
if(!src.loc)
return 0
if(!use_power)
return 1
//Don't do this. It allows machines that set use_power to 0 when off (many machines) to
//be turned on again and used after a power failure because they never gain the NOPOWER flag.
//if(!use_power)
// return 1
var/area/A = src.loc.loc // make sure it's in an area
if(!A || !isarea(A) || !A.master)
+1 -1
View File
@@ -315,7 +315,7 @@
if (!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "smes.tmpl", "SMES Power Storage Unit", 540, 380)
ui = new(user, src, ui_key, "smes.tmpl", "SMES Unit", 540, 380)
// when the ui is first opened this is the data it will use
ui.set_initial_data(data)
// open the new ui window
+2 -2
View File
@@ -462,10 +462,10 @@
if(prob(75))
I.loc = src
for(var/mob/M in viewers(src))
M.show_message("\the [I] lands in \the [src].", 3)
M.show_message("\The [I] lands in \the [src].", 3)
else
for(var/mob/M in viewers(src))
M.show_message("\the [I] bounces off of \the [src]'s rim!", 3)
M.show_message("\The [I] bounces off of \the [src]'s rim!", 3)
return 0
else
return ..(mover, target, height, air_group)