Merge remote-tracking branch 'refs/remotes/origin/master' into upstream-merge-35475

This commit is contained in:
deathride58
2018-03-09 14:18:47 -05:00
179 changed files with 3274 additions and 1999 deletions
+21 -17
View File
@@ -223,25 +223,27 @@
/datum/browser/modal/listpicker
var/valueslist = list()
/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,inputtype="checkbox")
/datum/browser/modal/listpicker/New(User,Message,Title,Button1="Ok",Button2,Button3,StealFocus = 1, Timeout = FALSE,list/values,inputtype="checkbox", width, height, slidecolor)
if (!User)
return
var/output = {"<form><input type="hidden" name="src" value="[REF(src)]"><ul class="sparse">"}
if (inputtype == "checkbox" || inputtype == "radio")
for (var/i in values)
var/div_slider = slidecolor
if(!i["allowed_edit"])
div_slider = "locked"
output += {"<li>
<label class="switch">
<input type="[inputtype]" value="1" name="[i["name"]]"[i["checked"] ? " checked" : ""]>
<div class="slider"></div>
<span>[i["name"]]</span>
</label>
</li>"}
<label class="switch">
<input type="[inputtype]" value="1" name="[i["name"]]"[i["checked"] ? " checked" : ""][i["allowed_edit"] ? "" : " onclick='return false' onkeydown='return false'"]>
<div class="slider [div_slider ? "[div_slider]" : ""]"></div>
<span>[i["name"]]</span>
</label>
</li>"}
else
for (var/i in values)
output += {"<li><input id="name="[i["name"]]"" style="width: 50px" type="[type]" name="[i["name"]]" value="[i["value"]]">
<label for="[i["name"]]">[i["name"]]</label></li>"}
<label for="[i["name"]]">[i["name"]]</label></li>"}
output += {"</ul><div style="text-align:center">
<button type="submit" name="button" value="1" style="font-size:large;float:[( Button2 ? "left" : "right" )]">[Button1]</button>"}
@@ -252,7 +254,7 @@
output += {"<button type="submit" name="button" value="3" style="font-size:large;float:right">[Button3]</button>"}
output += {"</form></div>"}
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, 350, 350, src, StealFocus, Timeout)
..(User, ckey("[User]-[Message]-[Title]-[world.time]-[rand(1,10000)]"), Title, width, height, src, StealFocus, Timeout)
set_content(output)
/datum/browser/modal/listpicker/Topic(href,href_list)
@@ -272,30 +274,32 @@
opentime = 0
close()
/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values, inputtype = "checkbox")
/proc/presentpicker(var/mob/User,Message, Title, Button1="Ok", Button2, Button3, StealFocus = 1,Timeout = 6000,list/values, inputtype = "checkbox", width, height, slidecolor)
if (!istype(User))
if (istype(User, /client/))
var/client/C = User
User = C.mob
else
return
var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values, inputtype)
var/datum/browser/modal/listpicker/A = new(User, Message, Title, Button1, Button2, Button3, StealFocus,Timeout, values, inputtype, width, height, slidecolor)
A.open()
A.wait()
if (A.selectedbutton)
return list("button" = A.selectedbutton, "values" = A.valueslist)
/proc/input_bitfield(var/mob/User, title, bitfield, current_value)
/proc/input_bitfield(var/mob/User, title, bitfield, current_value, nwidth = 350, nheight = 350, nslidecolor, allowed_edit_list = null)
if (!User || !(bitfield in GLOB.bitfields))
return
var/list/pickerlist = list()
for (var/i in GLOB.bitfields[bitfield])
var/can_edit = 1
if(!isnull(allowed_edit_list) && !(allowed_edit_list & GLOB.bitfields[bitfield][i]))
can_edit = 0
if (current_value & GLOB.bitfields[bitfield][i])
pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i))
pickerlist += list(list("checked" = 1, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit))
else
pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i))
var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist)
pickerlist += list(list("checked" = 0, "value" = GLOB.bitfields[bitfield][i], "name" = i, "allowed_edit" = can_edit))
var/list/result = presentpicker(User, "", title, Button1="Save", Button2 = "Cancel", Timeout=FALSE, values = pickerlist, width = nwidth, height = nheight, slidecolor = nslidecolor)
if (islist(result))
if (result["button"] == 2) // If the user pressed the cancel button
return
+1
View File
@@ -109,6 +109,7 @@
return
..()
//Proc to use when you 100% want to try to infect someone (ignoreing protective clothing and such), as long as they aren't immune
/mob/living/proc/ForceContractDisease(datum/disease/D, make_copy = TRUE, del_on_fail = FALSE)
if(!CanContractDisease(D))
+3 -5
View File
@@ -109,6 +109,7 @@
A.symptoms += S.Copy()
A.properties = properties.Copy()
A.id = id
A.mutable = mutable
//this is a new disease starting over at stage 1, so processing is not copied
return A
@@ -166,13 +167,10 @@
var/the_id = GetDiseaseID()
if(!SSdisease.archive_diseases[the_id])
if(new_name)
AssignName()
SSdisease.archive_diseases[the_id] = src // So we don't infinite loop
SSdisease.archive_diseases[the_id] = Copy()
var/datum/disease/advance/A = SSdisease.archive_diseases[the_id]
name = A.name
if(new_name)
AssignName()
//Generate disease properties based on the effects. Returns an associated list.
/datum/disease/advance/proc/GenerateProperties()
+16
View File
@@ -18,6 +18,8 @@
var/map_file = "BoxStation.dmm"
var/traits = null
var/space_ruin_levels = 7
var/space_empty_levels = 1
var/minetype = "lavaland"
@@ -106,6 +108,20 @@
log_world("map_config traits is not a list!")
return
var/temp = json["space_ruin_levels"]
if (isnum(temp))
space_ruin_levels = temp
else if (!isnull(temp))
log_world("map_config space_ruin_levels is not a number!")
return
temp = json["space_empty_levels"]
if (isnum(temp))
space_empty_levels = temp
else if (!isnull(temp))
log_world("map_config space_empty_levels is not a number!")
return
if ("minetype" in json)
minetype = json["minetype"]
+36
View File
@@ -0,0 +1,36 @@
/datum/martial_art/mushpunch
name = "Mushroom Punch"
/datum/martial_art/mushpunch/basic_hit(mob/living/carbon/human/A, mob/living/carbon/human/D)
var/atk_verb
to_chat(A, "<span class='spider'>You begin to wind up an attack...</span>")
if(do_after(A, 25, target = D))
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
atk_verb = pick("punches", "smashes", "ruptures", "cracks")
D.visible_message("<span class='danger'>[A] [atk_verb] [D] with inhuman strength, sending [D.p_them()] flying backwards!</span>", \
"<span class='userdanger'>[A] [atk_verb] you with inhuman strength, sending you flying backwards!</span>")
D.apply_damage(rand(15,30), BRUTE)
playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, 1, -1)
var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A)))
D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time.
D.Knockdown(20)
if(atk_verb)
add_logs(A, D, "[atk_verb] (Mushroom Punch)")
return TRUE
return FALSE
/obj/item/mushpunch
name = "mysterious mushroom"
desc = "<I>Sapienza Ophioglossoides</I>:An odd mushroom from the flesh of a mushroom person. it has apparently retained some innate power of it's owner, as it quivers with barely-contained POWER!"
icon = 'icons/obj/hydroponics/growing_mushrooms.dmi'
icon_state = "mycelium-angel"
/obj/item/mushpunch/attack_self(mob/living/carbon/human/user)
if(!istype(user) || !user)
return
var/message = "<span class='spider'>You devour [src], and a confluence of skill and power from the mushroom enhances your punches! You do need a short moment to charge these powerful punches.</span>"
to_chat(user, message)
var/datum/martial_art/mushpunch/mush = new(null)
mush.teach(user)
qdel(src)
visible_message("<span class='warning'>[user] devours [src].</span>")
+2
View File
@@ -85,6 +85,8 @@
if(backpack_contents)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
if(!isnum(number))//Default to 1
number = 1
for(var/i=0,i<number,i++)
H.equip_to_slot_or_del(new path(H),slot_in_backpack)
+22 -3
View File
@@ -11,7 +11,7 @@
var/mob_trait //if applicable, apply and remove this mob trait
var/mob/living/trait_holder
/datum/trait/New(mob/living/trait_mob)
/datum/trait/New(mob/living/trait_mob, spawn_effects)
..()
if(!trait_mob || (human_only && !ishuman(trait_mob)) || trait_mob.has_trait_datum(type))
qdel(src)
@@ -23,9 +23,9 @@
trait_holder.add_trait(mob_trait, ROUNDSTART_TRAIT)
START_PROCESSING(SStraits, src)
add()
if(!SSticker.HasRoundStarted()) //on roundstart or on latejoin; latejoin code is in new_player.dm
if(spawn_effects)
on_spawn()
addtimer(CALLBACK(src, .proc/post_add), 30)
addtimer(CALLBACK(src, .proc/post_add), 30)
/datum/trait/Destroy()
STOP_PROCESSING(SStraits, src)
@@ -38,16 +38,25 @@
SStraits.trait_objects -= src
return ..()
/datum/trait/proc/transfer_mob(mob/living/to_mob)
trait_holder.roundstart_traits -= src
to_mob.roundstart_traits += src
trait_holder = to_mob
on_transfer()
/datum/trait/proc/add() //special "on add" effects
/datum/trait/proc/on_spawn() //these should only trigger when the character is being created for the first time, i.e. roundstart/latejoin
/datum/trait/proc/remove() //special "on remove" effects
/datum/trait/proc/on_process() //process() has some special checks, so this is the actual process
/datum/trait/proc/post_add() //for text, disclaimers etc. given after you spawn in with the trait
/datum/trait/proc/on_transfer() //code called when the trait is transferred to a new mob
/datum/trait/process()
if(QDELETED(trait_holder))
qdel(src)
return
if(trait_holder.stat == DEAD)
return
on_process()
/mob/living/proc/get_trait_string(medical) //helper string. gets a string of all the traits the mob has
@@ -67,6 +76,16 @@
return "None"
return dat.Join("<br>")
/mob/living/proc/cleanse_trait_datums() //removes all trait datums
for(var/V in roundstart_traits)
var/datum/trait/T = V
qdel(T)
/mob/living/proc/transfer_trait_datums(mob/living/to_mob)
for(var/V in roundstart_traits)
var/datum/trait/T = V
T.transfer_mob(to_mob)
/*
Commented version of Nearsighted to help you add your own traits
+1 -1
View File
@@ -26,7 +26,7 @@
desc = "You walk with a gentle step, making stepping on sharp objects quieter and less painful."
value = 1
mob_trait = TRAIT_LIGHT_STEP
gain_text = "<span class='notice'>You walk with a little more lithenessk.</span>"
gain_text = "<span class='notice'>You walk with a little more litheness.</span>"
lose_text = "<span class='danger'>You start tromping around like a barbarian.</span>"
+1 -1
View File
@@ -114,7 +114,7 @@
if(trait_holder.reagents.has_reagent("mindbreaker"))
trait_holder.hallucination = 0
return
if(prob(1)) //we'll all be mad soon enough
if(prob(2)) //we'll all be mad soon enough
madness()
/datum/trait/insanity/proc/madness(mad_fools)