Merge remote-tracking branch 'upstream/master' into botany-rework

This commit is contained in:
Fox-McCloud
2017-01-26 06:53:18 -05:00
27 changed files with 86 additions and 249 deletions
+2 -2
View File
@@ -24,8 +24,8 @@
#define BLOCK_GAS_SMOKE_EFFECT 8192 // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
#define THICKMATERIAL 8192 //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body. (NOTE: flag shared with BLOCK_GAS_SMOKE_EFFECT)
#define NOREACT 16384 //Reagents dont' react inside this container.
//Reagent flags
#define REAGENT_NOREACT 1
//Species flags.
+1 -2
View File
@@ -4,8 +4,7 @@
#define QDEL_HINT_LETMELIVE 1 //qdel should let the object live after calling destory.
#define QDEL_HINT_IWILLGC 2 //functionally the same as the above. qdel should assume the object will gc on its own, and not check it.
#define QDEL_HINT_HARDDEL_NOW 4 //qdel should assume this object won't gc, and hard del it post haste.
#define QDEL_HINT_PUTINPOOL 5 //qdel will put this object in the atom pool.
#define QDEL_HINT_FINDREFERENCE 6 //functionally identical to QDEL_HINT_QUEUE if TESTING is not enabled in _compiler_options.dm.
#define QDEL_HINT_FINDREFERENCE 5 //functionally identical to QDEL_HINT_QUEUE if TESTING is not enabled in _compiler_options.dm.
//if TESTING is enabled, qdel will call this object's find_references() verb.
// A convenient wrapper around checking for qdeletion/non-existence
+4 -1
View File
@@ -97,6 +97,10 @@ Made by Xhuis
shadow.special_role = SPECIAL_ROLE_SHADOWLING
shadow.restricted_roles = restricted_jobs
shadowlings--
var/thrall_scaling = round(num_players() / 3)
required_thralls = Clamp(thrall_scaling, 15, 25)
..()
return 1
@@ -150,7 +154,6 @@ Made by Xhuis
update_shadow_icons_added(new_thrall_mind)
new_thrall_mind.current.create_attack_log("<span class='danger'>Became a thrall</span>")
new_thrall_mind.current.add_language("Shadowling Hivemind")
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_glare(null))
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_shadow_walk(null))
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall(null))
to_chat(new_thrall_mind.current, "<span class='shadowling'><b>You see the truth. Reality has been torn away and you realize what a fool you've been.</b></span>")
@@ -49,39 +49,6 @@
M.AdjustSilence(10)
/obj/effect/proc_holder/spell/targeted/lesser_glare
name = "Lesser Glare"
desc = "Stuns and mutes a target for a short duration."
panel = "Thrall Abilities"
charge_max = 450
clothes_req = 0
action_icon_state = "glare"
/obj/effect/proc_holder/spell/targeted/lesser_glare/cast(list/targets)
for(var/mob/living/carbon/human/target in targets)
if(!ishuman(target) || !target)
to_chat(usr, "<span class='warning'>You nay only glare at humans!</span>")
charge_counter = charge_max
return
if(target.stat)
to_chat(usr, "<span class='warning'>[target] must be conscious!</span>")
charge_counter = charge_max
return
if(is_shadow_or_thrall(target))
to_chat(usr, "<span class='warning'>You cannot glare at allies!</span>")
charge_counter = charge_max
return
var/mob/living/carbon/human/M = target
usr.visible_message("<span class='warning'><b>[usr]'s eyes flash a blinding red!</b></span>")
target.visible_message("<span class='danger'>[target] freezes in place, their eyes glazing over...</span>")
if(in_range(target, usr))
to_chat(target, "<span class='userdanger'>Your gaze is forcibly drawn into [usr]'s eyes, and you are mesmerized by the heavenly lights...</span>")
else
to_chat(target, "<span class='userdanger'>Red lights suddenly dance in your vision, and you are mesmerized by their heavenly beauty...</span>")
target.Stun(3) //Roughly 30% as long as the normal one
M.AdjustSilence(3)
/obj/effect/proc_holder/spell/aoe_turf/veil
name = "Veil"
desc = "Extinguishes most nearby light sources."
@@ -421,7 +388,7 @@
return
for(var/mob/living/user in targets)
var/thralls = 0
var/victory_threshold = 15
var/victory_threshold = ticker.mode.required_thralls
var/mob/M
to_chat(user, "<span class='shadowling'><b>You focus your telepathic energies abound, harnessing and drawing together the strength of your thralls.</b></span>")
@@ -672,9 +639,8 @@
sleep(20)
thrallToRevive.visible_message("<span class='warning'>[thrallToRevive] slowly rises, no longer recognizable as human.</span>", \
"<span class='shadowling'><b>You feel new power flow into you. You have been gifted by your masters. You now closely resemble them. You are empowered in \
darkness but wither slowly in light. In addition, Lesser Glare and Guise have been upgraded into their true forms.</b></span>")
darkness but wither slowly in light. In addition, you now have glare and true shadow walk.</b></span>")
thrallToRevive.set_species("Lesser Shadowling")
thrallToRevive.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/lesser_glare)
thrallToRevive.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/lesser_shadow_walk)
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/glare(null))
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_walk(null))
@@ -243,7 +243,6 @@
desc = "Equipment for medical exosuits. A chem synthesizer with syringe gun. Reagents inside are held in stasis, so no reactions will occur."
icon = 'icons/obj/guns/projectile.dmi'
icon_state = "syringegun"
flags = NOREACT
var/list/syringes
var/list/known_reagents
var/list/processed_reagents
@@ -259,6 +258,7 @@
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/New()
..()
create_reagents(max_volume)
reagents.set_reacting(FALSE)
syringes = new
known_reagents = list("epinephrine"="Epinephrine","charcoal"="Charcoal")
processed_reagents = new
@@ -273,7 +273,8 @@
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/critfail()
..()
flags &= ~NOREACT
if(reagents)
reagents.set_reacting(TRUE)
/obj/item/mecha_parts/mecha_equipment/medical/syringe_gun/can_attach(obj/mecha/medical/M)
if(..())
@@ -1,44 +0,0 @@
/**
* Multitool -- A multitool is used for hacking electronic devices.
* TO-DO -- Using it as a power measurement tool for cables etc. Nannek.
*
*/
/obj/item/device/debugger
icon = 'icons/obj/hacktool.dmi'
name = "debugger"
desc = "Used to debug electronic equipment."
icon_state = "hacktool-g"
flags = CONDUCT
force = 5.0
w_class = 2
throwforce = 5.0
throw_range = 15
throw_speed = 3
desc = "You can use this on airlocks or APCs to try to hack them without cutting wires."
materials = list(MAT_METAL=50, MAT_GLASS=20)
origin_tech = "magnets=1;engineering=1"
var/obj/machinery/telecomms/buffer // simple machine buffer for device linkage
/obj/item/device/debugger/is_used_on(obj/O, mob/user)
if(istype(O, /obj/machinery/power/apc))
var/obj/machinery/power/apc/A = O
if(A.emagged || A.malfhack)
to_chat(user, "\red There is a software error with the device.")
else
to_chat(user, "\blue The device's software appears to be fine.")
return 1
if(istype(O, /obj/machinery/door))
var/obj/machinery/door/D = O
if(D.operating == -1)
to_chat(user, "\red There is a software error with the device.")
else
to_chat(user, "\blue The device's software appears to be fine.")
return 1
else if(istype(O, /obj/machinery))
var/obj/machinery/A = O
if(A.emagged)
to_chat(user, "\red There is a software error with the device.")
else
to_chat(user, "\blue The device's software appears to be fine.")
return 1
+5 -3
View File
@@ -42,11 +42,13 @@ LIGHTERS ARE IN LIGHTERS.DM
/obj/item/clothing/mask/cigarette/New()
..()
flags |= NOREACT // so it doesn't react until you light it
create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 30
reagents.set_reacting(FALSE) // so it doesn't react until you light it
/obj/item/clothing/mask/cigarette/Destroy()
qdel(reagents)
if(reagents)
qdel(reagents)
processing_objects -= src
return ..()
/obj/item/clothing/mask/cigarette/attack(var/mob/living/M, var/mob/living/user, def_zone)
@@ -135,7 +137,7 @@ LIGHTERS ARE IN LIGHTERS.DM
M.unEquip(src, 1)
qdel(src)
return
flags &= ~NOREACT // allowing reagents to react after being lit
reagents.set_reacting(TRUE)
reagents.handle_reactions()
icon_state = icon_on
item_state = icon_on
@@ -176,8 +176,8 @@
/obj/item/weapon/storage/fancy/cigarettes/New()
..()
flags |= NOREACT
create_reagents(30 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
reagents.set_reacting(FALSE)
for(var/i = 1 to storage_slots)
var/obj/item/clothing/mask/cigarette/C = new cigarette_type(src)
unlaced_cigarettes += C
-2
View File
@@ -61,8 +61,6 @@
nanomanager.close_uis(src)
return ..()
/obj/item/proc/is_used_on(obj/O, mob/user)
/obj/proc/process()
set waitfor = 0
processing_objects.Remove(src)
@@ -8,7 +8,7 @@
use_power = 1
idle_power_usage = 5
active_power_usage = 100
flags = OPENCONTAINER | NOREACT
flags = OPENCONTAINER
var/operating = 0 // Is it on?
var/dirty = 0 // = {0..100} Does it need cleaning?
var/broken = 0 // ={0,1,2} How broken is it???
@@ -33,6 +33,7 @@
/obj/machinery/kitchen_machine/New()
create_reagents(100)
reagents.set_reacting(FALSE)
if(!available_recipes)
available_recipes = new
acceptable_items = new
@@ -10,7 +10,6 @@
use_power = 1
idle_power_usage = 5
active_power_usage = 100
flags = NOREACT
var/max_n_of_items = 1500
var/icon_on = "smartfridge"
var/icon_off = "smartfridge-off"
@@ -25,6 +24,8 @@
/obj/machinery/smartfridge/New()
..()
create_reagents()
reagents.set_reacting(FALSE)
component_parts = list()
var/obj/item/weapon/circuitboard/smartfridge/board = new(null)
board.set_type(type)
@@ -149,8 +149,6 @@ var/global/datum/controller/process/garbage_collector/garbageCollector
del(D)
if(garbageCollector)
garbageCollector.dels_count++
if(QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool.
PlaceInPool(D,0)
if(QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion.
#ifdef TESTING
D.find_references(remove_from_queue = FALSE)
@@ -3,7 +3,6 @@
mouse_opacity = 0
simulated = 0
anchored = 1
flags = NOREACT
icon = LIGHTING_ICON
layer = LIGHTING_LAYER
invisibility = INVISIBILITY_LIGHTING
-125
View File
@@ -1,125 +0,0 @@
/*
/tg/station13 /datum Pool:
---------------------------------
By RemieRichards
Creation/Deletion is laggy, so let's reduce reuse and recycle!
Usage:
To get a object, just call
- PoolOrNew(type, arg) if you only want to pass one argument to New(), usually loc
- PoolOrNew(type, list) if you want to pass multiple arguments to New()
To put a object back in the pool, call PlaceInPool(object)
This will call destroy on the object, set its loc to null,
and reset all of its vars to their default
You can override your object's destroy to return QDEL_HINT_PUTINPOOL
to ensure its always placed in this pool (this will only be acted on if qdel calls destroy, and destroy will not get called twice)
For almost all pooling purposes, it is better to use the QDEL hint than to pool it directly with PlaceInPool
*/
var/global/list/GlobalPool = list()
//You'll be using this proc 90% of the time.
//It grabs a type from the pool if it can
//And if it can't, it creates one
//The pool is flexible and will expand to fit
//The new created atom when it eventually
//Goes into the pool
//Second argument can be a single arg
//Or a list of arguments
//Either way it gets passed to new
/proc/PoolOrNew(get_type,second_arg)
if(!get_type)
return
. = GetFromPool(get_type,second_arg)
if(!.)
if(ispath(get_type))
if(islist(second_arg))
. = new get_type (arglist(second_arg))
else
. = new get_type (second_arg)
/proc/GetFromPool(get_type,second_arg)
if(!get_type)
return
if(isnull(GlobalPool[get_type]))
return
if(length(GlobalPool[get_type]) == 0)
return
var/datum/pooled = pop(GlobalPool[get_type])
if(pooled)
var/atom/movable/AM
if(istype(pooled, /atom/movable))
AM = pooled
if(islist(second_arg))
if(AM)
AM.loc = second_arg[1] //we need to do loc setting explicetly before even calling New() to replicate new()'s behavior
pooled.New(arglist(second_arg))
else
if(AM)
AM.loc = second_arg
pooled.New(second_arg)
return pooled
/proc/PlaceInPool(datum/diver, destroy = 1)
if(!istype(diver))
return
if(diver in GlobalPool[diver.type])
return
if(!GlobalPool[diver.type])
GlobalPool[diver.type] = list()
GlobalPool[diver.type] |= diver
if(destroy)
diver.Destroy()
diver.ResetVars()
var/list/exclude = list("animate_movement", "contents", "loc", "locs", "parent_type", "vars", "verbs", "type")
var/list/pooledvariables = list()
//thanks to clusterfack @ /vg/station for these two procs
/datum/proc/createVariables()
pooledvariables[type] = new/list()
var/list/exclude = global.exclude + args
for(var/key in vars)
if(key in exclude)
continue
pooledvariables[type][key] = initial(vars[key])
/datum/proc/ResetVars()
if(!pooledvariables[type])
createVariables(args)
for(var/key in pooledvariables[type])
vars[key] = pooledvariables[type][key]
/atom/movable/ResetVars()
..()
loc = null
contents = initial(contents) //something is really wrong if this object still has stuff in it by this point
/image/ResetVars()
..()
loc = null
+3 -3
View File
@@ -52,12 +52,12 @@
to_chat(user, "You inject the solution into the power cell.")
if(S.reagents.has_reagent("plasma", 5))
if(S.reagents.has_reagent("plasma", 5) || S.reagents.has_reagent("plasma_dust", 5))
rigged = 1
log_admin("LOG: [user.name] ([user.ckey]) injected a power cell with plasma, rigging it to explode.")
message_admins("LOG: [user.name] ([user.ckey]) injected a power cell with plasma, rigging it to explode.")
log_admin("LOG: [key_name(user)] injected a power cell with plasma, rigging it to explode.")
message_admins("LOG: [key_name_admin(user)] injected a power cell with plasma, rigging it to explode.")
S.reagents.clear_reagents()
+3 -3
View File
@@ -674,10 +674,10 @@
to_chat(user, "You inject the solution into the [src].")
if(S.reagents.has_reagent("plasma", 5))
if(S.reagents.has_reagent("plasma", 5) || S.reagents.has_reagent("plasma_dust", 5))
log_admin("LOG: [user.name] ([user.ckey]) injected a light with plasma, rigging it to explode.")
message_admins("LOG: [user.name] ([user.ckey]) injected a light with plasma, rigging it to explode.")
log_admin("LOG: [key_name(user)] injected a light with plasma, rigging it to explode.")
message_admins("LOG: [key_name_admin(user)] injected a light with plasma, rigging it to explode.")
rigged = 1
@@ -246,9 +246,9 @@
/obj/item/ammo_casing/shotgun/dart/New()
..()
flags |= NOREACT
flags |= OPENCONTAINER
create_reagents(30)
reagents.set_reacting(FALSE)
/obj/item/ammo_casing/shotgun/dart/attackby()
return
+1 -1
View File
@@ -154,7 +154,7 @@
qdel(S)
D.icon_state = "syringeproj"
D.name = "syringe"
D.flags |= NOREACT
D.reagents.set_reacting(FALSE)
playsound(user.loc, 'sound/items/syringeproj.ogg', 50, 1)
for(var/i=0, i<6, i++)
@@ -87,7 +87,7 @@ obj/item/projectile/bullet/saw/incen/Move()
..()
var/turf/location = get_turf(src)
if(location)
PoolOrNew(/obj/effect/hotspot, location)
new /obj/effect/hotspot(location)
location.hotspot_expose(700, 50, 1)
/obj/item/projectile/bullet/saw/incen/on_hit(atom/target, blocked = 0)
@@ -243,8 +243,8 @@
/obj/item/projectile/bullet/dart/New()
..()
flags |= NOREACT
create_reagents(50)
reagents.set_reacting(FALSE)
/obj/item/projectile/bullet/dart/on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
if(iscarbon(target))
@@ -260,7 +260,7 @@
target.visible_message("<span class='danger'>The [name] was deflected!</span>", \
"<span class='userdanger'>You were protected against the [name]!</span>")
..(target, blocked, hit_zone)
flags &= ~NOREACT
reagents.set_reacting(TRUE)
reagents.handle_reactions()
return 1
+21 -6
View File
@@ -13,10 +13,12 @@ var/const/INGEST = 2
var/atom/my_atom = null
var/chem_temp = 300
var/list/datum/reagent/addiction_list = new/list()
var/flags
/datum/reagents/New(maximum=100)
/datum/reagents/New(maximum = 100)
maximum_volume = maximum
if(!(flags & REAGENT_NOREACT))
processing_objects |= src
//I dislike having these here but map-objects are initialised before world/New() is called. >_>
if(!chemical_reagents_list)
//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id
@@ -288,11 +290,24 @@ var/const/INGEST = 2
od_chems.Add(R.id)
return od_chems
/datum/reagents/proc/process()
if(flags & REAGENT_NOREACT)
processing_objects -= src
return
/datum/reagents/proc/reagent_on_tick()
for(var/datum/reagent/R in reagent_list)
R.on_tick()
return
/datum/reagents/proc/set_reacting(react = TRUE)
if(react)
// Order is important, process() can remove from processing if
// the flag is present
flags &= ~(REAGENT_NOREACT)
processing_objects |= src
else
processing_objects -= src
flags |= REAGENT_NOREACT
/*
if(!target) return
var/total_transfered = 0
@@ -337,7 +352,7 @@ var/const/INGEST = 2
update_total()
/datum/reagents/proc/handle_reactions()
if(my_atom.flags & NOREACT)
if(flags & REAGENT_NOREACT)
return //Yup, no reactions here. No siree.
var/reaction_occured = 0
@@ -731,7 +746,7 @@ atom/proc/create_reagents(max_vol)
/datum/reagents/Destroy()
. = ..()
processing_objects.Remove(src)
processing_objects -= src
for(var/datum/reagent/R in reagent_list)
qdel(R)
reagent_list.Cut()
@@ -30,7 +30,6 @@
if(!possible_transfer_amounts)
verbs -= /obj/item/weapon/reagent_containers/verb/set_APTFT
create_reagents(volume)
processing_objects.Add(src)
if(spawned_disease)
var/datum/disease/F = new spawned_disease(0)
var/list/data = list("viruses" = list(F), "blood_colour" = "#A10808")
@@ -38,11 +37,6 @@
if(list_reagents)
reagents.add_reagent_list(list_reagents)
/obj/item/weapon/reagent_containers/process()
if(reagents)
reagents.reagent_on_tick()
return
/obj/item/weapon/reagent_containers/ex_act()
if(reagents)
for(var/datum/reagent/R in reagents.reagent_list)
@@ -290,7 +290,11 @@
materials = list(MAT_GLASS=500)
volume = 50
amount_per_transfer_from_this = 10
flags = OPENCONTAINER | NOREACT
flags = OPENCONTAINER
/obj/item/weapon/reagent_containers/glass/beaker/noreact/New()
..()
reagents.set_reacting(FALSE)
/obj/item/weapon/reagent_containers/glass/beaker/bluespace
name = "bluespace beaker"
+17
View File
@@ -55,6 +55,23 @@
-->
<div class="commit sansserif">
<h2 class="date">26 January 2017</h2>
<h3 class="author">FalseIncarnate updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Plasma dust can now be used to rig lights and power cells, like the plasma reagent, with explosive results.</li>
</ul>
<h2 class="date">25 January 2017</h2>
<h3 class="author">FlattestGuitar updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Fixes shadowlings thrall scaling</li>
</ul>
<h3 class="author">scrubmcnoob updated:</h3>
<ul class="changes bgimages16">
<li class="tweak">Shadowling Thrall count now scales to a max of 25.</li>
<li class="tweak">Shadowling Thralls lose lesser glare</li>
</ul>
<h2 class="date">23 January 2017</h2>
<h3 class="author">FalseIncarnate updated:</h3>
<ul class="changes bgimages16">
+10
View File
@@ -3408,3 +3408,13 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.
- rscadd: NT Enforcer .45 pistol.
- rscadd: .45 and 9mm rubber bullets.
- imageadd: New shotgun ammo boxes.
2017-01-25:
FlattestGuitar:
- tweak: Fixes shadowlings thrall scaling
scrubmcnoob:
- tweak: Shadowling Thrall count now scales to a max of 25.
- tweak: Shadowling Thralls lose lesser glare
2017-01-26:
FalseIncarnate:
- tweak: Plasma dust can now be used to rig lights and power cells, like the plasma
reagent, with explosive results.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B

-2
View File
@@ -708,7 +708,6 @@
#include "code\game\objects\items\devices\autopsy.dm"
#include "code\game\objects\items\devices\camera_bug.dm"
#include "code\game\objects\items\devices\chameleonproj.dm"
#include "code\game\objects\items\devices\debugger.dm"
#include "code\game\objects\items\devices\flash.dm"
#include "code\game\objects\items\devices\flashlight.dm"
#include "code\game\objects\items\devices\floor_painter.dm"
@@ -1779,7 +1778,6 @@
#include "code\modules\pda\radio.dm"
#include "code\modules\pda\utilities.dm"
#include "code\modules\persistence\persistence.dm"
#include "code\modules\pooling\pool.dm"
#include "code\modules\power\apc.dm"
#include "code\modules\power\cable.dm"
#include "code\modules\power\cable_heavyduty.dm"