Updates Components (#13594)

* Updates Components

* signal documentation too

* minor fixes
This commit is contained in:
Fox McCloud
2020-06-15 20:18:07 -04:00
committed by GitHub
parent dde7e5e343
commit 75a8efa65c
36 changed files with 1294 additions and 560 deletions
@@ -627,6 +627,7 @@ GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "step_size", "bound_h
if(!O.vv_edit_var(variable, var_new))
to_chat(src, "Your edit was rejected by the object.")
return
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_VAR_EDIT, args)
log_world("### VarEdit by [src]: [O.type] [variable]=[html_encode("[var_new]")]")
log_admin("[key_name(src)] modified [original_name]'s [variable] to [var_new]")
var/msg = "[key_name_admin(src)] modified [original_name]'s [variable] to [var_new]"
+2 -3
View File
@@ -73,16 +73,15 @@ obj/item/clothing/shoes/magboots/syndie/advance //For the Syndicate Strike Team
shoe_sound = "clownstep"
origin_tech = "magnets=4;syndicate=2"
var/enabled_waddle = TRUE
var/datum/component/waddle
/obj/item/clothing/shoes/magboots/clown/equipped(mob/user, slot)
. = ..()
if(slot == slot_shoes && enabled_waddle)
waddle = user.AddComponent(/datum/component/waddling)
user.AddElement(/datum/element/waddling)
/obj/item/clothing/shoes/magboots/clown/dropped(mob/user)
. = ..()
QDEL_NULL(waddle)
user.RemoveElement(/datum/element/waddling)
/obj/item/clothing/shoes/magboots/clown/CtrlClick(mob/living/user)
if(!isliving(user))
+2 -3
View File
@@ -71,16 +71,15 @@
var/footstep = 1 //used for squeeks whilst walking
shoe_sound = "clownstep"
var/enabled_waddle = TRUE
var/datum/component/waddle
/obj/item/clothing/shoes/clown_shoes/equipped(mob/user, slot)
. = ..()
if(slot == slot_shoes && enabled_waddle)
waddle = user.AddComponent(/datum/component/waddling)
user.AddElement(/datum/element/waddling)
/obj/item/clothing/shoes/clown_shoes/dropped(mob/user)
. = ..()
QDEL_NULL(waddle)
user.RemoveElement(/datum/element/waddling)
/obj/item/clothing/shoes/clown_shoes/CtrlClick(mob/living/user)
if(!isliving(user))
+6 -6
View File
@@ -98,7 +98,7 @@
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
QDEL_NULL(files)
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
return ..()
@@ -120,7 +120,7 @@
CONSOLE.updateUsrDialog()
/obj/machinery/mineral/processing_unit/proc/process_ore(obj/item/stack/ore/O)
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!materials.has_space(material_amount))
unload_mineral(O)
@@ -132,7 +132,7 @@
/obj/machinery/mineral/processing_unit/proc/get_machine_data()
var/dat = "<b>Smelter control console</b><br><br>"
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
dat += "<span class=\"res_name\">[M.name]: </span>[M.amount] cm&sup3;"
@@ -165,7 +165,7 @@
return dat
/obj/machinery/mineral/processing_unit/proc/smelt_ore()
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/datum/material/mat = materials.materials[selected_material]
if(mat)
var/sheets_to_remove = (mat.amount >= (MINERAL_MATERIAL_AMOUNT * SMELT_AMOUNT) ) ? SMELT_AMOUNT : round(mat.amount / MINERAL_MATERIAL_AMOUNT)
@@ -187,7 +187,7 @@
on = FALSE
return
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.use_amount(alloy.materials, amount)
generate_mineral(alloy.build_path)
@@ -198,7 +198,7 @@
var/build_amount = SMELT_AMOUNT
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
+6 -6
View File
@@ -67,7 +67,7 @@
/obj/machinery/mineral/ore_redemption/Destroy()
QDEL_NULL(files)
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
return ..()
@@ -92,7 +92,7 @@
if(O && O.refined_type)
points += O.points * point_upgrade * O.amount
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
var/material_amount = materials.get_item_material_amount(O)
if(!material_amount)
@@ -111,7 +111,7 @@
var/build_amount = 0
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in D.materials)
var/M = D.materials[mat_id]
var/datum/material/redemption_mat = materials.materials[mat_id]
@@ -147,7 +147,7 @@
var/has_minerals = FALSE
var/mineral_name = null
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
var/mineral_amount = M.amount / MINERAL_MATERIAL_AMOUNT
@@ -251,7 +251,7 @@
else
dat += "No ID inserted. <A href='?src=[UID()];insert_id=1'>Insert ID.</A><br><br>"
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(M.amount)
@@ -302,7 +302,7 @@
/obj/machinery/mineral/ore_redemption/Topic(href, href_list)
if(..())
return
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(href_list["eject_id"])
usr.put_in_hands(inserted_id)
inserted_id = null
+3 -3
View File
@@ -23,7 +23,7 @@
if(!T)
return
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/obj/item/stack/sheet/O in T)
materials.insert_stack(O, O.amount)
@@ -32,7 +32,7 @@
return
var/dat = "<b>Coin Press</b><br>"
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
for(var/mat_id in materials.materials)
var/datum/material/M = materials.materials[mat_id]
if(!M.amount && chosen != mat_id)
@@ -65,7 +65,7 @@
if(processing == 1)
to_chat(usr, "<span class='notice'>The machine is processing.</span>")
return
GET_COMPONENT(materials, /datum/component/material_container)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
if(href_list["choose"])
if(materials.materials[href_list["choose"]])
chosen = href_list["choose"]
+1 -1
View File
@@ -138,7 +138,7 @@
span = mind.speech_span
if((COMIC in mutations) \
|| (locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs) \
|| GetComponent(/datum/component/jestosterone))
|| HAS_TRAIT(src, TRAIT_JESTER))
span = "sans"
if(WINGDINGS in mutations)
@@ -636,12 +636,11 @@
H.mutations.Add(COMIC)
H.equip_to_slot_or_del(new /obj/item/reagent_containers/food/drinks/bottle/bottleofbanana(H), slot_r_store)
H.equip_to_slot_or_del(new /obj/item/bikehorn(H), slot_l_store)
H.AddComponent(/datum/component/waddling)
H.AddElement(/datum/element/waddling)
/datum/species/golem/bananium/on_species_loss(mob/living/carbon/C)
. = ..()
GET_COMPONENT_FROM(waddling, /datum/component/waddling, C)
waddling.Destroy()
C.RemoveElement(/datum/element/waddling)
/datum/species/golem/bananium/get_random_name()
var/clown_name = pick(GLOB.clown_names)
@@ -18,7 +18,7 @@
/mob/living/simple_animal/pet/penguin/Initialize(mapload)
. = ..()
AddComponent(/datum/component/waddling)
AddElement(/datum/element/waddling)
/mob/living/simple_animal/pet/penguin/emperor
name = "Emperor penguin"
@@ -450,21 +450,18 @@
var/mob/living/carbon/C = holder.my_atom
if(!istype(C))
return
var/mind_type = FALSE
if(C.mind)
if(C.mind.assigned_role == "Clown" || C.mind.assigned_role == SPECIAL_ROLE_HONKSQUAD)
mind_type = "Clown"
to_chat(C, "<span class='notice'>Whatever that was, it feels great!</span>")
else if(C.mind.assigned_role == "Mime")
mind_type = "Mime"
to_chat(C, "<span class='warning'>You feel nauseous.</span>")
C.AdjustDizzy(volume)
else
to_chat(C, "<span class='warning'>Something doesn't feel right...</span>")
C.AdjustDizzy(volume)
C.AddComponent(/datum/component/jestosterone, mind_type)
ADD_TRAIT(C, TRAIT_JESTER, id)
C.AddComponent(/datum/component/squeak, null, null, null, null, null, TRUE)
C.AddComponent(/datum/component/waddling)
C.AddElement(/datum/element/waddling)
/datum/reagent/jestosterone/on_mob_life(mob/living/carbon/M)
if(!istype(M))
@@ -472,8 +469,7 @@
var/update_flags = STATUS_UPDATE_NONE
if(prob(10))
M.emote("giggle")
GET_COMPONENT_FROM(jestosterone_component, /datum/component/jestosterone, M)
if(jestosterone_component.mind_type == "Clown")
if(M?.mind.assigned_role == "Clown" || M?.mind.assigned_role == SPECIAL_ROLE_HONKSQUAD)
update_flags |= M.adjustBruteLoss(-1.5 * REAGENTS_EFFECT_MULTIPLIER) //Screw those pesky clown beatings!
else
M.AdjustDizzy(10, 0, 500)
@@ -493,18 +489,15 @@
"Your legs feel like jelly.",
"You feel like telling a pun.")
to_chat(M, "<span class='warning'>[pick(clown_message)]</span>")
if(jestosterone_component.mind_type == "Mime")
if(M?.mind.assigned_role == "Mime")
update_flags |= M.adjustToxLoss(1.5 * REAGENTS_EFFECT_MULTIPLIER)
return ..() | update_flags
/datum/reagent/jestosterone/on_mob_delete(mob/living/M)
..()
GET_COMPONENT_FROM(remove_fun, /datum/component/jestosterone, M)
GET_COMPONENT_FROM(squeaking, /datum/component/squeak, M)
GET_COMPONENT_FROM(waddling, /datum/component/waddling, M)
remove_fun.Destroy()
squeaking.Destroy()
waddling.Destroy()
REMOVE_TRAIT(M, TRAIT_JESTER, id)
qdel(M.GetComponent(/datum/component/squeak))
M.RemoveElement(/datum/element/waddling)
/datum/reagent/royal_bee_jelly
name = "royal bee jelly"
+1 -1
View File
@@ -449,7 +449,7 @@
visible_message("<span class='warning'>[src]'s crushing mechanism slowly and smoothly descends, flattening the [exp_on]!</span>")
new /obj/item/stack/sheet/plasteel(get_turf(pick(oview(1,src))))
if(linked_console.linked_lathe)
GET_COMPONENT_FROM(linked_materials, /datum/component/material_container, linked_console.linked_lathe)
var/datum/component/material_container/linked_materials = linked_console.linked_lathe.GetComponent(/datum/component/material_container)
for(var/material in exp_on.materials)
linked_materials.insert_amount( min((linked_materials.max_amount - linked_materials.total_amount), (exp_on.materials[material])), material)
if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
+1 -3
View File
@@ -20,9 +20,7 @@
var/datum/component/material_container/materials //Store for hyper speed!
/obj/machinery/r_n_d/New()
materials = AddComponent(/datum/component/material_container,
list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), 0,
TRUE, /obj/item/stack, CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert))
materials = AddComponent(/datum/component/material_container, list(MAT_METAL, MAT_GLASS, MAT_SILVER, MAT_GOLD, MAT_DIAMOND, MAT_PLASMA, MAT_URANIUM, MAT_BANANIUM, MAT_TRANQUILLITE, MAT_TITANIUM, MAT_BLUESPACE, MAT_PLASTIC), 0, TRUE, /obj/item/stack, CALLBACK(src, .proc/is_insertion_ready), CALLBACK(src, .proc/AfterMaterialInsert))
materials.precise_insertion = TRUE
..()
wires["Red"] = 0
@@ -107,6 +107,7 @@ GLOBAL_DATUM_INIT(space_manager, /datum/zlev_manager, new())
// Increments the max z-level by one
// For convenience's sake returns the z-level added
/datum/zlev_manager/proc/add_new_zlevel(name, linkage = SELFLOOPING, traits = list(BLOCK_TELEPORT))
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_Z, args)
if(name in levels_by_name)
throw EXCEPTION("Name already in use: [name]")
world.maxz++
@@ -225,7 +225,6 @@
slot = "brain_tumor"
var/organhonked = 0
var/suffering_delay = 900
var/datum/component/waddle
var/datum/component/squeak
/obj/item/organ/internal/honktumor/insert(mob/living/carbon/M, special = 0)
@@ -237,7 +236,7 @@
genemutcheck(M,GLOB.clumsyblock,null,MUTCHK_FORCED)
genemutcheck(M,GLOB.comicblock,null,MUTCHK_FORCED)
organhonked = world.time
waddle = M.AddComponent(/datum/component/waddling)
M.AddElement(/datum/element/waddling)
squeak = M.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50)
/obj/item/organ/internal/honktumor/remove(mob/living/carbon/M, special = 0)
@@ -249,7 +248,7 @@
M.dna.SetSEState(GLOB.comicblock,0)
genemutcheck(M,GLOB.clumsyblock,null,MUTCHK_FORCED)
genemutcheck(M,GLOB.comicblock,null,MUTCHK_FORCED)
QDEL_NULL(waddle)
M.RemoveElement(/datum/element/waddling)
QDEL_NULL(squeak)
qdel(src)