From 33fe2b5fc7f8b78f180ac7c352170798e4b22232 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 11 Jul 2015 19:52:31 -0400 Subject: [PATCH 01/15] Makes grab eye attacking respect species lore better --- .../living/carbon/human/human_attackhand.dm | 14 ++++++------- .../carbon/human/species/species_attack.dm | 4 ++++ .../mob/living/carbon/human/unarmed_attack.dm | 14 ++++++++++++- code/modules/mob/mob_grab.dm | 20 +++++++++---------- code/modules/organs/organ_internal.dm | 6 ++++++ 5 files changed, 40 insertions(+), 18 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 6c995d75e0..24892c6d43 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -1,3 +1,9 @@ +/mob/living/carbon/human/proc/get_unarmed_attack(var/mob/living/carbon/human/target, var/hit_zone) + for(var/datum/unarmed_attack/u_attack in species.unarmed_attacks) + if(u_attack.is_usable(src, target, hit_zone)) + return u_attack + return null + /mob/living/carbon/human/attack_hand(mob/living/carbon/M as mob) var/mob/living/carbon/human/H = M @@ -178,13 +184,7 @@ miss_type = 2 // See what attack they use - var/datum/unarmed_attack/attack = null - for(var/datum/unarmed_attack/u_attack in H.species.unarmed_attacks) - if(!u_attack.is_usable(H, src, hit_zone)) - continue - else - attack = u_attack - break + var/datum/unarmed_attack/attack = H.get_unarmed_attack(src, hit_zone) if(!attack) return 0 diff --git a/code/modules/mob/living/carbon/human/species/species_attack.dm b/code/modules/mob/living/carbon/human/species/species_attack.dm index c3312b9a7a..466b1bd2ab 100644 --- a/code/modules/mob/living/carbon/human/species/species_attack.dm +++ b/code/modules/mob/living/carbon/human/species/species_attack.dm @@ -9,11 +9,15 @@ /datum/unarmed_attack/diona attack_verb = list("lashed", "bludgeoned") attack_noun = list("tendril") + eye_attack_text = "a tendril" + eye_attack_text_victim = "a tendril" damage = 5 /datum/unarmed_attack/claws attack_verb = list("scratched", "clawed", "slashed") attack_noun = list("claws") + eye_attack_text = "claws" + eye_attack_text_victim = "sharp claws" attack_sound = 'sound/weapons/slice.ogg' miss_sound = 'sound/weapons/slashmiss.ogg' damage = 5 diff --git a/code/modules/mob/living/carbon/human/unarmed_attack.dm b/code/modules/mob/living/carbon/human/unarmed_attack.dm index 155a1f23b7..289b4a2273 100644 --- a/code/modules/mob/living/carbon/human/unarmed_attack.dm +++ b/code/modules/mob/living/carbon/human/unarmed_attack.dm @@ -8,8 +8,11 @@ var/shredding = 0 // Calls the old attack_alien() behavior on objects/mobs when on harm intent. var/sharp = 0 var/edge = 0 + + var/eye_attack_text + var/eye_attack_text_victim -/datum/unarmed_attack/proc/is_usable(var/mob/living/carbon/human/user) +/datum/unarmed_attack/proc/is_usable(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone) if(user.restrained()) return 0 @@ -78,6 +81,13 @@ user.visible_message("[user] [pick(attack_verb)] [target] in the [affecting.name]!") playsound(user.loc, attack_sound, 25, 1, -1) +/datum/unarmed_attack/proc/handle_eye_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target) + var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"] + eyes.take_damage(rand(3,4), 1) + + user.visible_message("[user] presses \his [eye_attack_text] into [target]'s [eyes.name]!") + target << "You experience[(target.species.flags & NO_PAIN)? "" : " immense pain as you feel" ] [eye_attack_text_victim] being pressed into your [eyes.name][(target.species.flags & NO_PAIN)? "." : "!"]" + /datum/unarmed_attack/bite attack_verb = list("bit") attack_sound = 'sound/weapons/bite.ogg' @@ -97,6 +107,8 @@ /datum/unarmed_attack/punch attack_verb = list("punched") attack_noun = list("fist") + eye_attack_text = "fingers" + eye_attack_text_victim = "digits" damage = 0 /datum/unarmed_attack/punch/show_attack(var/mob/living/carbon/human/user, var/mob/living/carbon/human/target, var/zone, var/attack_damage) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 60d2bf419b..acc95fbe40 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -351,6 +351,11 @@ if(I_HURT) if(hit_zone == "eyes") + var/mob/living/carbon/human/H = affecting + var/datum/unarmed_attack/attack = H.get_unarmed_attack(src, hit_zone) + if(!attack) + return + if(state < GRAB_NECK) assailant << "You require a better grab to do this." return @@ -362,16 +367,11 @@ if(!affecting.has_eyes()) assailant << "You cannot locate any eyes on [affecting]!" return - assailant.visible_message("[assailant] pressed \his fingers into [affecting]'s eyes!") - affecting << "You experience immense pain as you feel digits being pressed into your eyes!" - assailant.attack_log += text("\[[time_stamp()]\] Pressed fingers into the eyes of [affecting.name] ([affecting.ckey])") - affecting.attack_log += text("\[[time_stamp()]\] Had fingers pressed into their eyes by [assailant.name] ([assailant.ckey])") - msg_admin_attack("[key_name(assailant)] has pressed his fingers into [key_name(affecting)]'s eyes.") - var/obj/item/organ/eyes/eyes = affecting:internal_organs_by_name["eyes"] - eyes.damage += rand(3,4) - if (eyes.damage >= eyes.min_broken_damage) - if(affecting.stat != 2) - affecting << "\red You go blind!" + assailant.attack_log += text("\[[time_stamp()]\] Attacked [affecting.name]'s eyes using grab ([affecting.ckey])") + affecting.attack_log += text("\[[time_stamp()]\] Had eyes attacked by [assailant.name]'s grab ([assailant.ckey])") + msg_admin_attack("[key_name(assailant)] attacked [key_name(affecting)]'s eyes using a grab action.") + + attack.handle_eye_attack(assailant, affecting) else if(hit_zone != "head") if(state < GRAB_NECK) assailant << "You require a better grab to do this." diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 3b094f1fdd..05a73c703c 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -79,6 +79,12 @@ owner.b_eyes ? owner.b_eyes : 0 ) +/obj/item/organ/eyes/take_damage() + var/oldbroken = is_broken() + ..() + if(is_broken() && !oldbroken && owner && !owner.stat) + owner << "You go blind!" + /obj/item/organ/eyes/process() //Eye damage replaces the old eye_stat var. ..() if(!owner) From 616b4b60e4c8b6d1f6245aec2d24746f4bf0dc31 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 2 Jul 2015 09:58:23 +0200 Subject: [PATCH 02/15] Magical fixes. The wizard den is no longer pitch black. Fixes targeted spells using the wrong caster/source. Adds some missing checks using the caster source above. Re-logging should no longer cause a loss of spell UI icons. Mind transfer should no longer cause unintended spell loss. --- baystation12.dme | 3 +- code/_onclick/hud/spell_screen_objects.dm | 45 ++- code/modules/mob/mob.dm | 52 ++-- code/modules/spells/aoe_turf/aoe_turf.dm | 48 +-- code/modules/spells/spell_code.dm | 34 +-- code/modules/spells/spellbook.dm | 4 +- code/modules/spells/spells.dm | 19 +- code/modules/spells/targeted/equip/equip.dm | 40 +++ .../spells/targeted/{ => equip}/horsemask.dm | 73 ++--- code/modules/spells/targeted/genetic.dm | 2 +- code/modules/spells/targeted/mind_transfer.dm | 11 +- code/modules/spells/targeted/targeted.dm | 288 +++++++++--------- 12 files changed, 351 insertions(+), 268 deletions(-) create mode 100644 code/modules/spells/targeted/equip/equip.dm rename code/modules/spells/targeted/{ => equip}/horsemask.dm (66%) diff --git a/baystation12.dme b/baystation12.dme index 510ef39501..7f3090e405 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1633,11 +1633,12 @@ #include "code\modules\spells\targeted\flesh_to_stone.dm" #include "code\modules\spells\targeted\genetic.dm" #include "code\modules\spells\targeted\harvest.dm" -#include "code\modules\spells\targeted\horsemask.dm" #include "code\modules\spells\targeted\mind_transfer.dm" #include "code\modules\spells\targeted\shift.dm" #include "code\modules\spells\targeted\subjugate.dm" #include "code\modules\spells\targeted\targeted.dm" +#include "code\modules\spells\targeted\equip\equip.dm" +#include "code\modules\spells\targeted\equip\horsemask.dm" #include "code\modules\spells\targeted\projectile\dumbfire.dm" #include "code\modules\spells\targeted\projectile\fireball.dm" #include "code\modules\spells\targeted\projectile\magic_missile.dm" diff --git a/code/_onclick/hud/spell_screen_objects.dm b/code/_onclick/hud/spell_screen_objects.dm index ed208a588d..08c11e8680 100644 --- a/code/_onclick/hud/spell_screen_objects.dm +++ b/code/_onclick/hud/spell_screen_objects.dm @@ -12,6 +12,18 @@ var/mob/spell_holder +/obj/screen/movable/spell_master/Destroy() + ..() + for(var/obj/screen/spell/spells in spell_objects) + spells.spellmaster = null + spell_objects = null + if(spell_holder) + spell_holder.spell_masters -= src + +/obj/screen/movable/spell_master/ResetVars() + ..("spell_objects") + spell_objects = list() + /obj/screen/movable/spell_master/MouseDrop() if(showing) return @@ -57,16 +69,23 @@ /obj/screen/movable/spell_master/proc/add_spell(var/spell/spell) if(!spell) return - for(var/obj/screen/spell/spellscreen in spell_objects) - if(spellscreen.spell == spell) + if(spell.connected_button) //we have one already, for some reason + if(spell.connected_button in spell_objects) + return + else + spell_objects.Add(spell.connected_button) + toggle_open(2) return if(spell.spell_flags & NO_BUTTON) //no button to add if we don't get one return - var/obj/screen/spell/newscreen = new - + var/obj/screen/spell/newscreen = PoolOrNew(/obj/screen/spell) + newscreen.spellmaster = src newscreen.spell = spell + + spell.connected_button = newscreen + if(!spell.override_base) //if it's not set, we do basic checks if(spell.spell_flags & CONSTRUCT_CHECK) newscreen.spell_base = "const" //construct spells @@ -80,16 +99,13 @@ toggle_open(2) //forces the icons to refresh on screen /obj/screen/movable/spell_master/proc/remove_spell(var/spell/spell) - for(var/obj/screen/spell/s_object in spell_objects) - if(s_object.spell == spell) - spell_objects.Remove(s_object) - qdel(s_object) - break + qdel(spell.connected_button) + + spell.connected_button = null if(spell_objects.len) toggle_open(showing + 1) else - spell_holder.spell_masters.Remove(src) qdel(src) /obj/screen/movable/spell_master/proc/silence_spells(var/amount) @@ -125,9 +141,18 @@ var/spell/spell = null var/handle_icon_updates = 0 + var/obj/screen/movable/spell_master/spellmaster var/icon/last_charged_icon +/obj/screen/spell/Destroy() + ..() + if(spellmaster) + spellmaster.spell_objects -= src + if(spellmaster && !spellmaster.spell_objects.len) + qdel(spellmaster) + spellmaster = null + /obj/screen/spell/proc/update_charge(var/forced_update = 0) if(!spell) qdel(src) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6c601c419e..14f67295d8 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -601,31 +601,35 @@ /mob/Stat() ..() + . = (client && client.inactivity < 1200) - if(client && client.holder) - if(statpanel("Status")) - statpanel("Status","Location:","([x], [y], [z])") - statpanel("Status","CPU:","[world.cpu]") - statpanel("Status","Instances:","[world.contents.len]") - if(statpanel("Status") && processScheduler && processScheduler.getIsRunning()) - for(var/datum/controller/process/P in processScheduler.processes) - statpanel("Status",P.getStatName(), P.getTickTime()) - else - statpanel("Status","processScheduler is not running.") + if(.) + if(client.holder) + if(statpanel("Status")) + statpanel("Status","Location:","([x], [y], [z])") + statpanel("Status","CPU:","[world.cpu]") + statpanel("Status","Instances:","[world.contents.len]") + if(statpanel("Status") && processScheduler && processScheduler.getIsRunning()) + for(var/datum/controller/process/P in processScheduler.processes) + statpanel("Status",P.getStatName(), P.getTickTime()) + else + statpanel("Status","processScheduler is not running.") - if(listed_turf && client) - if(!TurfAdjacent(listed_turf)) - listed_turf = null - else - statpanel(listed_turf.name, null, listed_turf) - for(var/atom/A in listed_turf) - if(!A.mouse_opacity) - continue - if(A.invisibility > see_invisible) - continue - if(is_type_in_list(A, shouldnt_see)) - continue - statpanel(listed_turf.name, null, A) + if(listed_turf && client) + if(!TurfAdjacent(listed_turf)) + listed_turf = null + else + statpanel(listed_turf.name, null, listed_turf) + for(var/atom/A in listed_turf) + if(!A.mouse_opacity) + continue + if(A.invisibility > see_invisible) + continue + if(is_type_in_list(A, shouldnt_see)) + continue + statpanel(listed_turf.name, null, A) + + sleep(4) //Prevent updating the stat panel for the next .4 seconds, prevents clientside latency from updates // facing verbs /mob/proc/canface() @@ -1026,4 +1030,4 @@ mob/proc/yank_out_object() /mob/proc/throw_mode_on() src.in_throw_mode = 1 if(src.throw_icon) - src.throw_icon.icon_state = "act_throw_on" \ No newline at end of file + src.throw_icon.icon_state = "act_throw_on" diff --git a/code/modules/spells/aoe_turf/aoe_turf.dm b/code/modules/spells/aoe_turf/aoe_turf.dm index 9a70eb18c6..3265761077 100644 --- a/code/modules/spells/aoe_turf/aoe_turf.dm +++ b/code/modules/spells/aoe_turf/aoe_turf.dm @@ -1,25 +1,25 @@ -/* -Aoe turf spells target a ring of tiles around the user -This ring has an outer radius (range) and an inner radius (inner_radius) -Aoe turf spells have two useful flags: IGNOREDENSE and IGNORESPACE. These are explained in setup.dm -*/ - -/spell/aoe_turf //affects all turfs in view or range (depends) - spell_flags = IGNOREDENSE - var/inner_radius = -1 //for all your ring spell needs - -/spell/aoe_turf/choose_targets(mob/user = usr) - var/list/targets = list() - - for(var/turf/target in view_or_range(range,user,selection_type)) - if(!(target in view_or_range(inner_radius,user,selection_type))) - if(target.density && (spell_flags & IGNOREDENSE)) - continue - if(istype(target, /turf/space) && (spell_flags & IGNORESPACE)) - continue - targets += target - - if(!targets.len) //doesn't waste the spell - return - +/* +Aoe turf spells target a ring of tiles around the user +This ring has an outer radius (range) and an inner radius (inner_radius) +Aoe turf spells have two useful flags: IGNOREDENSE and IGNORESPACE. These are explained in setup.dm +*/ + +/spell/aoe_turf //affects all turfs in view or range (depends) + spell_flags = IGNOREDENSE + var/inner_radius = -1 //for all your ring spell needs + +/spell/aoe_turf/choose_targets(mob/user = usr) + var/list/targets = list() + + for(var/turf/target in view_or_range(range, holder, selection_type)) + if(!(target in view_or_range(inner_radius, holder, selection_type))) + if(target.density && (spell_flags & IGNOREDENSE)) + continue + if(istype(target, /turf/space) && (spell_flags & IGNORESPACE)) + continue + targets += target + + if(!targets.len) //doesn't waste the spell + return + return targets \ No newline at end of file diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index ba631391b4..2015fde1e0 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -1,9 +1,9 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell - name = "Spell" - desc = "A spell" - parent_type = /atom/movable + var/name = "Spell" + var/desc = "A spell" + parent_type = /datum var/panel = "Spells"//What panel the proc holder needs to go on. var/school = "evocation" //not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit? @@ -25,8 +25,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now var/range = 7 //the range of the spell; outer radius for aoe spells var/message = "" //whatever it says to the guy affected by it var/selection_type = "view" //can be "range" or "view" - var/atom/movable/holder //where the spell is. Normally the user, can be a projectile - + var/atom/movable/holder //where the spell is. Normally the user, can be an item var/duration = 0 //how long the spell lasts var/list/spell_levels = list(Sp_SPEED = 0, Sp_POWER = 0) //the current spell levels - total spell levels can be obtained by just adding the two values @@ -53,6 +52,8 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now var/hud_state = "" //name of the icon used in generating the spell hud object var/override_base = "" + var/obj/screen/connected_button + /////////////////////// ///SETUP AND PROCESS/// /////////////////////// @@ -69,11 +70,6 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now sleep(1) return -/spell/Click() - ..() - - perform(usr) - ///////////////// /////CASTING///// ///////////////// @@ -182,18 +178,18 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell - if(!(src in user.spell_list)) + if(!(src in user.spell_list) && holder == user) user << "You shouldn't have this spell! Something's wrong." return 0 if(silenced > 0) return - var/turf/Turf = get_turf(user) - if(!Turf) - user << "You cannot cast spells in null space!" - - if(spell_flags & Z2NOCAST && (Turf.z in config.admin_levels)) //Certain spells are not allowed on the centcomm zlevel + var/turf/user_turf = get_turf(user) + if(!user_turf) + user << "You cannot cast spells in null space!" + + if(spell_flags & Z2NOCAST && (user_turf.z in config.admin_levels)) //Certain spells are not allowed on the centcomm zlevel return 0 if(spell_flags & CONSTRUCT_CHECK) @@ -201,7 +197,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(findNullRod(T)) return 0 - if(istype(user, /mob/living/simple_animal)) + if(istype(user, /mob/living/simple_animal) && holder == user) var/mob/living/simple_animal/SA = user if(SA.purge) SA << "The nullrod's power interferes with your own!" @@ -210,7 +206,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(!src.check_charge(skipcharge, user)) //sees if we can cast based on charges alone return 0 - if(!(spell_flags & GHOSTCAST)) + if(!(spell_flags & GHOSTCAST) && holder == user) if(user.stat && !(spell_flags & STATALLOWED)) usr << "Not when you're incapacitated." return 0 @@ -221,7 +217,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now return 0 var/spell/noclothes/spell = locate() in user.spell_list - if((spell_flags & NEEDSCLOTHES) && !(spell && istype(spell)))//clothes check + if((spell_flags & NEEDSCLOTHES) && !(spell && istype(spell)) && holder == user)//clothes check if(!user.wearing_wiz_garb()) return 0 diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 7823a7b602..6ddaf6331a 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -211,7 +211,7 @@ temp = "You have learned knock." if("horseman") feedback_add_details("wizard_spell_learned","HH") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.add_spell(new/spell/targeted/horsemask) + H.add_spell(new/spell/targeted/equip_item/horsemask) temp = "You have learned curse of the horseman." if("fleshtostone") feedback_add_details("wizard_spell_learned","FS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells @@ -424,7 +424,7 @@ user.Weaken(20) /obj/item/weapon/spellbook/oneuse/horsemask - spell = /spell/targeted/horsemask + spell = /spell/targeted/equip_item/horsemask spellname = "horses" icon_state ="bookhorses" desc = "This book is more horse than your mind has room for." diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm index d20eea00dc..2e7ee7b815 100644 --- a/code/modules/spells/spells.dm +++ b/code/modules/spells/spells.dm @@ -4,17 +4,26 @@ for(var/obj/screen/movable/spell_master/spell_master in spell_masters) spell_master.update_spells(0, src) -/mob/Stat() +/mob/Login() ..() - if(spell_list && spell_list.len && statpanel("Spells")) + if(spell_masters) + for(var/obj/screen/movable/spell_master/spell_master in spell_masters) + spell_master.toggle_open(1) + client.screen -= spell_master + +/mob/Stat() + . = ..() + if(. && spell_list && spell_list.len) for(var/spell/S in spell_list) + if((!S.connected_button) || !statpanel(S.panel)) + continue //Not showing the noclothes spell switch(S.charge_type) if(Sp_RECHARGE) - statpanel("Spells","[S.charge_counter/10.0]/[S.charge_max/10]",S) + statpanel(S.panel,"[S.charge_counter/10.0]/[S.charge_max/10]",S.connected_button) if(Sp_CHARGES) - statpanel("Spells","[S.charge_counter]/[S.charge_max]",S) + statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S.connected_button) if(Sp_HOLDVAR) - statpanel("Spells","[S.holder_var_type] [S.holder_var_amount]",S) + statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button) /mob/proc/add_spell(var/spell/spell_to_add, var/spell_base = "wiz_spell_ready", var/master_type = /obj/screen/movable/spell_master) if(!spell_masters) diff --git a/code/modules/spells/targeted/equip/equip.dm b/code/modules/spells/targeted/equip/equip.dm new file mode 100644 index 0000000000..735daf78e8 --- /dev/null +++ b/code/modules/spells/targeted/equip/equip.dm @@ -0,0 +1,40 @@ +//You can set duration to 0 to have the items last forever + +/spell/targeted/equip_item + name = "equipment spell" + + var/list/equipped_summons = list() //assoc list of text ids and paths to spawn + + var/list/summoned_items = list() //list of items we summoned and will dispose when the spell runs out + + var/delete_old = 1 //if the item previously in the slot is deleted - otherwise, it's dropped + +/spell/targeted/equip_item/cast(list/targets, mob/user = usr) + ..() + for(var/mob/living/L in targets) + for(var/slot_id in equipped_summons) + var/to_create = equipped_summons[slot_id] + slot_id = text2num(slot_id) //because the index is text, we access this instead + var/obj/item/new_item = summon_item(to_create) + var/obj/item/old_item = L.get_equipped_item(slot_id) + L.equip_to_slot(new_item, slot_id) + if(old_item) + L.remove_from_mob(old_item) + if(delete_old) + qdel(old_item) + else + old_item.loc = L.loc + + if(duration) + summoned_items += new_item //we store it in a list to remove later + + if(duration) + spawn(duration) + for(var/obj/item/to_remove in summoned_items) + if(istype(to_remove.loc, /mob)) + var/mob/M = to_remove.loc + M.remove_from_mob(to_remove) + qdel(to_remove) + +/spell/targeted/equip_item/proc/summon_item(var/newtype) + return new newtype diff --git a/code/modules/spells/targeted/horsemask.dm b/code/modules/spells/targeted/equip/horsemask.dm similarity index 66% rename from code/modules/spells/targeted/horsemask.dm rename to code/modules/spells/targeted/equip/horsemask.dm index dad2032b72..b5fbcf4fbb 100644 --- a/code/modules/spells/targeted/horsemask.dm +++ b/code/modules/spells/targeted/equip/horsemask.dm @@ -1,35 +1,38 @@ -/spell/targeted/horsemask - name = "Curse of the Horseman" - desc = "This spell triggers a curse on a target, causing them to wield an unremovable horse head mask. They will speak like a horse! Any masks they are wearing will be disintegrated. This spell does not require robes." - school = "transmutation" - charge_type = Sp_RECHARGE - charge_max = 150 - charge_counter = 0 - spell_flags = 0 - invocation = "KN'A FTAGHU, PUCK 'BTHNK!" - invocation_type = SpI_SHOUT - range = 7 - max_targets = 1 - cooldown_min = 30 //30 deciseconds reduction per rank - selection_type = "range" - - compatible_mobs = list(/mob/living/carbon/human) - - hud_state = "wiz_horse" - -/spell/targeted/horsemask/cast(list/targets, mob/user = usr) - ..() - for(var/mob/living/target in targets) - var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead - magichead.canremove = 0 //curses! - magichead.flags_inv = null //so you can still see their face - magichead.voicechange = 1 //NEEEEIIGHH - target.visible_message( "[target]'s face lights up in fire, and after the event a horse's head takes its place!", \ - "Your face burns up, and shortly after the fire you realise you have the face of a horse!") - var/obj/old_mask = target.wear_mask - if(old_mask) - target.drop_from_inventory(old_mask) - qdel(old_mask) //get rid of this shit - target.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1) - - flick("e_flash", target.flash) \ No newline at end of file +/spell/targeted/equip_item/horsemask + name = "Curse of the Horseman" + desc = "This spell triggers a curse on a target, causing them to wield an unremovable horse head mask. They will speak like a horse! Any masks they are wearing will be disintegrated. This spell does not require robes." + school = "transmutation" + charge_type = Sp_RECHARGE + charge_max = 150 + charge_counter = 0 + spell_flags = 0 + invocation = "KN'A FTAGHU, PUCK 'BTHNK!" + invocation_type = SpI_SHOUT + range = 7 + max_targets = 1 + cooldown_min = 30 //30 deciseconds reduction per rank + selection_type = "range" + + compatible_mobs = list(/mob/living/carbon/human) + + hud_state = "wiz_horse" + +/spell/targeted/equip_item/horsemask/New() + ..() + equipped_summons = list("[slot_wear_mask]" = /obj/item/clothing/mask/horsehead) + +/spell/targeted/equip_item/horsemask/cast(list/targets, mob/user = usr) + ..() + for(var/mob/living/target in targets) + target.visible_message( "[target]'s face lights up in fire, and after the event a horse's head takes its place!", \ + "Your face burns up, and shortly after the fire you realise you have the face of a horse!") + flick("e_flash", target.flash) + +/spell/targeted/equip_item/horsemask/summon_item(var/new_type) + var/obj/item/new_item = new new_type + if(istype(new_item, /obj/item/clothing/mask/horsehead)) + var/obj/item/clothing/mask/horsehead/magichead = new_item + magichead.canremove = 0 //curses! + magichead.flags_inv = null //so you can still see their face + magichead.voicechange = 1 //NEEEEIIGHH + return new_item diff --git a/code/modules/spells/targeted/genetic.dm b/code/modules/spells/targeted/genetic.dm index 028cdafba0..045fbc7d41 100644 --- a/code/modules/spells/targeted/genetic.dm +++ b/code/modules/spells/targeted/genetic.dm @@ -57,7 +57,7 @@ code\game\dna\genes\goon_powers.dm spell_flags = Z2NOCAST | NEEDSCLOTHES | INCLUDEUSER invocation = "BIRUZ BENNAR" invocation_type = SpI_SHOUT - message = "\blue You feel strong! You feel a pressure building behind your eyes!" + message = "You feel strong! You feel a pressure building behind your eyes!" range = 0 max_targets = 1 diff --git a/code/modules/spells/targeted/mind_transfer.dm b/code/modules/spells/targeted/mind_transfer.dm index 2e1860da35..a3668a53d1 100644 --- a/code/modules/spells/targeted/mind_transfer.dm +++ b/code/modules/spells/targeted/mind_transfer.dm @@ -51,7 +51,10 @@ ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob. caster.mind.transfer_to(victim) - victim.spell_list = caster.spell_list//Now they are inside the victim's body. + victim.spell_list = list() //clear those out + for(var/spell/S in caster.spell_list) + victim.add_spell(S) //Now they are inside the victim's body - this also generates the HUD + caster.spell_list = list() //clean that out as well if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster. for(var/V in caster.mind.special_verbs)//Not too important but could come into play. @@ -59,7 +62,9 @@ ghost.mind.transfer_to(caster) caster.key = ghost.key //have to transfer the key since the mind was not active - caster.spell_list = ghost.spell_list + for(var/spell/S in ghost.spell_list) + caster.add_spell(S) + ghost.spell_list = list() if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here. for(var/V in caster.mind.special_verbs) @@ -71,4 +76,4 @@ //After a certain amount of time the victim gets a message about being in a different body. spawn(msg_wait) - caster << "\red You feel woozy and lightheaded. Your body doesn't seem like your own." + caster << "You feel woozy and lightheaded. Your body doesn't seem like your own." diff --git a/code/modules/spells/targeted/targeted.dm b/code/modules/spells/targeted/targeted.dm index 96bbab9905..498d363408 100644 --- a/code/modules/spells/targeted/targeted.dm +++ b/code/modules/spells/targeted/targeted.dm @@ -1,145 +1,145 @@ -/* -Targeted spells (with the exception of dumbfire) select from all the mobs in the defined range -Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are explained in setup.dm -*/ - - -/spell/targeted //can mean aoe for mobs (limited/unlimited number) or one target mob - var/max_targets = 1 //leave 0 for unlimited targets in range, more for limited number of casts (can all target one guy, depends on target_ignore_prev) in range - var/target_ignore_prev = 1 //only important if max_targets > 1, affects if the spell can be cast multiple times at one person from one cast - - - var/amt_weakened = 0 - var/amt_paralysis = 0 - var/amt_stunned = 0 - - var/amt_dizziness = 0 - var/amt_confused = 0 - var/amt_stuttering = 0 - - //set to negatives for healing - var/amt_dam_fire = 0 - var/amt_dam_brute = 0 - var/amt_dam_oxy = 0 - var/amt_dam_tox = 0 - - var/amt_eye_blind = 0 - var/amt_eye_blurry = 0 - - var/list/compatible_mobs = list() - - -/spell/targeted/choose_targets(mob/user = usr) - var/list/targets = list() - - if(max_targets == 0) //unlimited - if(range == -2) - targets = living_mob_list - else - for(var/mob/living/target in view_or_range(range, user, selection_type)) - targets += target - - else if(max_targets == 1) //single target can be picked - if((range == 0 || range == -1) && spell_flags & INCLUDEUSER) - targets += user - else - var/list/possible_targets = list() - var/list/starting_targets - if(range == -2) - starting_targets = living_mob_list - else - starting_targets = view_or_range(range, user, selection_type) - - for(var/mob/living/M in starting_targets) - if(!(spell_flags & INCLUDEUSER) && M == user) - continue - if(compatible_mobs && compatible_mobs.len) - if(!is_type_in_list(M, compatible_mobs)) continue - if(compatible_mobs && compatible_mobs.len && !is_type_in_list(M, compatible_mobs)) - continue - possible_targets += M - - if(possible_targets.len) - if(spell_flags & SELECTABLE) //if we are allowed to choose. see setup.dm for details - var/mob/temp_target = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets - if(temp_target) - targets += temp_target - else - targets += pick(possible_targets) - //Adds a safety check post-input to make sure those targets are actually in range. - - - else - var/list/possible_targets = list() - var/list/starting_targets - - if(range == -2) - starting_targets = living_mob_list - else - starting_targets = view_or_range(range, user, selection_type) - - for(var/mob/living/target in starting_targets) - if(!(spell_flags & INCLUDEUSER) && target == user) - continue - if(compatible_mobs && !is_type_in_list(target, compatible_mobs)) - continue - possible_targets += target - - if(spell_flags & SELECTABLE) - for(var/i = 1; i<=max_targets, i++) - if(!possible_targets.len) - break - var/mob/M = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets - if(!M) - break - if(range != -2) - if(!(M in view_or_range(range, user, selection_type))) - continue - targets += M - possible_targets -= M - else - for(var/i=1,i<=max_targets,i++) - if(!possible_targets.len) - break - if(target_ignore_prev) - var/target = pick(possible_targets) - possible_targets -= target - targets += target - else - targets += pick(possible_targets) - - if(!(spell_flags & INCLUDEUSER) && (user in targets)) - targets -= user - - if(compatible_mobs && compatible_mobs.len) - for(var/mob/living/target in targets) //filters out all the non-compatible mobs - if(!is_type_in_list(target, compatible_mobs)) - targets -= target - - return targets - -/spell/targeted/cast(var/list/targets, mob/user) - for(var/mob/living/target in targets) - if(range >= 0) - if(!(target in view_or_range(range, user, selection_type))) //filter at time of casting - targets -= target - continue - apply_spell_damage(target) - -/spell/targeted/proc/apply_spell_damage(mob/living/target) - target.adjustBruteLoss(amt_dam_brute) - target.adjustFireLoss(amt_dam_fire) - target.adjustToxLoss(amt_dam_tox) - target.adjustOxyLoss(amt_dam_oxy) - //disabling - target.Weaken(amt_weakened) - target.Paralyse(amt_paralysis) - target.Stun(amt_stunned) - if(amt_weakened || amt_paralysis || amt_stunned) - if(target.buckled) - target.buckled = null - target.eye_blind += amt_eye_blind - target.eye_blurry += amt_eye_blurry - target.dizziness += amt_dizziness - target.confused += amt_confused +/* +Targeted spells (with the exception of dumbfire) select from all the mobs in the defined range +Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are explained in setup.dm +*/ + + +/spell/targeted //can mean aoe for mobs (limited/unlimited number) or one target mob + var/max_targets = 1 //leave 0 for unlimited targets in range, more for limited number of casts (can all target one guy, depends on target_ignore_prev) in range + var/target_ignore_prev = 1 //only important if max_targets > 1, affects if the spell can be cast multiple times at one person from one cast + + + var/amt_weakened = 0 + var/amt_paralysis = 0 + var/amt_stunned = 0 + + var/amt_dizziness = 0 + var/amt_confused = 0 + var/amt_stuttering = 0 + + //set to negatives for healing + var/amt_dam_fire = 0 + var/amt_dam_brute = 0 + var/amt_dam_oxy = 0 + var/amt_dam_tox = 0 + + var/amt_eye_blind = 0 + var/amt_eye_blurry = 0 + + var/list/compatible_mobs = list() + + +/spell/targeted/choose_targets(mob/user = usr) + var/list/targets = list() + + if(max_targets == 0) //unlimited + if(range == -2) + targets = living_mob_list + else + for(var/mob/living/target in view_or_range(range, holder, selection_type)) + targets += target + + else if(max_targets == 1) //single target can be picked + if((range == 0 || range == -1) && spell_flags & INCLUDEUSER) + targets += user + else + var/list/possible_targets = list() + var/list/starting_targets + if(range == -2) + starting_targets = living_mob_list + else + starting_targets = view_or_range(range, holder, selection_type) + + for(var/mob/living/M in starting_targets) + if(!(spell_flags & INCLUDEUSER) && M == user) + continue + if(compatible_mobs && compatible_mobs.len) + if(!is_type_in_list(M, compatible_mobs)) continue + if(compatible_mobs && compatible_mobs.len && !is_type_in_list(M, compatible_mobs)) + continue + possible_targets += M + + if(possible_targets.len) + if(spell_flags & SELECTABLE) //if we are allowed to choose. see setup.dm for details + var/mob/temp_target = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets + if(temp_target) + targets += temp_target + else + targets += pick(possible_targets) + //Adds a safety check post-input to make sure those targets are actually in range. + + + else + var/list/possible_targets = list() + var/list/starting_targets + + if(range == -2) + starting_targets = living_mob_list + else + starting_targets = view_or_range(range, holder, selection_type) + + for(var/mob/living/target in starting_targets) + if(!(spell_flags & INCLUDEUSER) && target == user) + continue + if(compatible_mobs && !is_type_in_list(target, compatible_mobs)) + continue + possible_targets += target + + if(spell_flags & SELECTABLE) + for(var/i = 1; i<=max_targets, i++) + if(!possible_targets.len) + break + var/mob/M = input(user, "Choose the target for the spell.", "Targeting") as null|mob in possible_targets + if(!M) + break + if(range != -2) + if(!(M in view_or_range(range, holder, selection_type))) + continue + targets += M + possible_targets -= M + else + for(var/i=1,i<=max_targets,i++) + if(!possible_targets.len) + break + if(target_ignore_prev) + var/target = pick(possible_targets) + possible_targets -= target + targets += target + else + targets += pick(possible_targets) + + if(!(spell_flags & INCLUDEUSER) && (user in targets)) + targets -= user + + if(compatible_mobs && compatible_mobs.len) + for(var/mob/living/target in targets) //filters out all the non-compatible mobs + if(!is_type_in_list(target, compatible_mobs)) + targets -= target + + return targets + +/spell/targeted/cast(var/list/targets, mob/user) + for(var/mob/living/target in targets) + if(range >= 0) + if(!(target in view_or_range(range, holder, selection_type))) //filter at time of casting + targets -= target + continue + apply_spell_damage(target) + +/spell/targeted/proc/apply_spell_damage(mob/living/target) + target.adjustBruteLoss(amt_dam_brute) + target.adjustFireLoss(amt_dam_fire) + target.adjustToxLoss(amt_dam_tox) + target.adjustOxyLoss(amt_dam_oxy) + //disabling + target.Weaken(amt_weakened) + target.Paralyse(amt_paralysis) + target.Stun(amt_stunned) + if(amt_weakened || amt_paralysis || amt_stunned) + if(target.buckled) + target.buckled = null + target.eye_blind += amt_eye_blind + target.eye_blurry += amt_eye_blurry + target.dizziness += amt_dizziness + target.confused += amt_confused target.stuttering += amt_stuttering \ No newline at end of file From 1c7b8607839451c77446b5613ec918ef9b726d36 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 2 Jul 2015 12:55:12 +0200 Subject: [PATCH 03/15] Spells are now restored when cloning. --- code/game/antagonist/outsider/wizard.dm | 2 +- code/modules/spells/spells.dm | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/code/game/antagonist/outsider/wizard.dm b/code/game/antagonist/outsider/wizard.dm index 74866d9247..57a00adfdd 100644 --- a/code/game/antagonist/outsider/wizard.dm +++ b/code/game/antagonist/outsider/wizard.dm @@ -96,7 +96,7 @@ var/datum/antagonist/wizard/wizards world << "The [(current_antagonists.len>1)?"[role_text_plural] have":"[role_text] has"] been killed by the crew! The Space Wizards Federation has been taught a lesson they will not soon forget!" //To batch-remove wizard spells. Linked to mind.dm. -/mob/proc/spellremove(var/mob/M as mob) +/mob/proc/spellremove() for(var/spell/spell_to_remove in src.spell_list) remove_spell(spell_to_remove) diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm index 2e7ee7b815..45895ad5b3 100644 --- a/code/modules/spells/spells.dm +++ b/code/modules/spells/spells.dm @@ -1,3 +1,6 @@ +/datum/mind + var/list/learned_spells + /mob/Life() ..() if(spell_masters && spell_masters.len) @@ -25,6 +28,11 @@ if(Sp_HOLDVAR) statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button) +/hook/clone/proc/restore_spells(var/mob/H) + if(H.mind && H.mind.learned_spells) + for(var/spell/spell_to_add in H.mind.learned_spells) + H.add_spell(spell_to_add) + /mob/proc/add_spell(var/spell/spell_to_add, var/spell_base = "wiz_spell_ready", var/master_type = /obj/screen/movable/spell_master) if(!spell_masters) spell_masters = list() @@ -36,7 +44,7 @@ spell_master.add_spell(spell_to_add) return 1 - var/obj/screen/movable/spell_master/new_spell_master = new master_type //we're here because either we didn't find our type, or we have no spell masters to attach to + var/obj/screen/movable/spell_master/new_spell_master = PoolOrNew(master_type) //we're here because either we didn't find our type, or we have no spell masters to attach to if(client) src.client.screen += new_spell_master new_spell_master.spell_holder = src @@ -45,6 +53,11 @@ new_spell_master.icon_state = spell_base spell_masters.Add(new_spell_master) spell_list.Add(spell_to_add) + if(mind) + if(!mind.learned_spells) + mind.learned_spells = list() + mind.learned_spells += spell_to_add + return 1 /mob/proc/remove_spell(var/spell/spell_to_remove) @@ -57,6 +70,8 @@ if(!spell_masters || !spell_masters.len) return + if(mind && mind.learned_spells) + mind.learned_spells.Remove(spell_to_remove) spell_list.Remove(spell_to_remove) for(var/obj/screen/movable/spell_master/spell_master in spell_masters) spell_master.remove_spell(spell_to_remove) From 617db485ee42586c69b5c98b3b995f804e16ca47 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Thu, 2 Jul 2015 13:38:24 +0200 Subject: [PATCH 04/15] qdel/Destroy entries. --- baystation12.dme | 2 -- code/_onclick/hud/hud.dm | 19 +++++++++++ code/_onclick/hud/screen_objects.dm | 4 +++ code/_onclick/hud/spell_screen_objects.dm | 6 ++-- code/controllers/Processes/garbage.dm | 2 +- code/game/objects/objs.dm | 4 +++ code/modules/mob/freelook/update_triggers.dm | 9 +++-- code/modules/mob/mob.dm | 34 +++++++++++++++++++ code/modules/spells/spellbook.dm | 14 ++------ code/modules/spells/spells.dm | 2 +- code/modules/spells/targeted/disintegrate.dm | 27 --------------- .../spells/targeted/equip/horsemask.dm | 3 +- .../modules/spells/targeted/flesh_to_stone.dm | 21 ------------ 13 files changed, 77 insertions(+), 70 deletions(-) delete mode 100644 code/modules/spells/targeted/disintegrate.dm delete mode 100644 code/modules/spells/targeted/flesh_to_stone.dm diff --git a/baystation12.dme b/baystation12.dme index 7f3090e405..b10cfc162d 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1628,9 +1628,7 @@ #include "code\modules\spells\aoe_turf\conjure\forcewall.dm" #include "code\modules\spells\general\area_teleport.dm" #include "code\modules\spells\general\rune_write.dm" -#include "code\modules\spells\targeted\disintegrate.dm" #include "code\modules\spells\targeted\ethereal_jaunt.dm" -#include "code\modules\spells\targeted\flesh_to_stone.dm" #include "code\modules\spells\targeted\genetic.dm" #include "code\modules\spells\targeted\harvest.dm" #include "code\modules\spells\targeted\mind_transfer.dm" diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index f39499f3dc..e1e412a9ef 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -140,6 +140,25 @@ datum/hud/New(mob/owner) instantiate() ..() +/datum/hud/Destroy() + ..() + grab_intent = null + hurt_intent = null + disarm_intent = null + help_intent = null + lingchemdisplay = null + blobpwrdisplay = null + blobhealthdisplay = null + r_hand_hud_object = null + l_hand_hud_object = null + action_intent = null + move_intent = null + adding = null + other = null + hotkeybuttons = null + item_action_list = null + mymob = null + /datum/hud/proc/hidden_inventory_update() if(!mymob) return if(ishuman(mymob)) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 4a7d6f2acb..eafd8ee777 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -45,6 +45,10 @@ /obj/screen/item_action var/obj/item/owner +/obj/screen/item_action/Destroy() + ..() + owner = null + /obj/screen/item_action/Click() if(!usr || !owner) return 1 diff --git a/code/_onclick/hud/spell_screen_objects.dm b/code/_onclick/hud/spell_screen_objects.dm index 08c11e8680..31f6fbcb86 100644 --- a/code/_onclick/hud/spell_screen_objects.dm +++ b/code/_onclick/hud/spell_screen_objects.dm @@ -16,7 +16,7 @@ ..() for(var/obj/screen/spell/spells in spell_objects) spells.spellmaster = null - spell_objects = null + spell_objects.Cut() if(spell_holder) spell_holder.spell_masters -= src @@ -80,7 +80,7 @@ if(spell.spell_flags & NO_BUTTON) //no button to add if we don't get one return - var/obj/screen/spell/newscreen = PoolOrNew(/obj/screen/spell) + var/obj/screen/spell/newscreen = new /obj/screen/spell newscreen.spellmaster = src newscreen.spell = spell @@ -147,6 +147,8 @@ /obj/screen/spell/Destroy() ..() + spell = null + last_charged_icon = null if(spellmaster) spellmaster.spell_objects -= src if(spellmaster && !spellmaster.spell_objects.len) diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm index ade159f1ac..31a28a91a5 100644 --- a/code/controllers/Processes/garbage.dm +++ b/code/controllers/Processes/garbage.dm @@ -50,7 +50,7 @@ var/list/delayed_garbage = list() testing("GC: [refID] not old enough, breaking at [world.time] for [GCd_at_time - time_to_kill] deciseconds until [GCd_at_time + collection_timeout]") #endif break // Everything else is newer, skip them - var/atom/A = locate(refID) + var/datum/A = locate(refID) #ifdef GC_DEBUG testing("GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]") #endif diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index fc6ef5b99d..68bdf5e422 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -16,6 +16,10 @@ var/damtype = "brute" var/force = 0 +/obj/Destroy() + processing_objects -= src + ..() + /obj/Topic(href, href_list, var/nowindow = 0, var/datum/topic_state/state = default_state) // Calling Topic without a corresponding window open causes runtime errors if(!nowindow && ..()) diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index 8408083ba8..4527f80879 100644 --- a/code/modules/mob/freelook/update_triggers.dm +++ b/code/modules/mob/freelook/update_triggers.dm @@ -14,7 +14,8 @@ return -1 /turf/simulated/Destroy() - updateVisibility(src) + if(ticker) + updateVisibility(src) ..() /turf/simulated/New() @@ -25,7 +26,8 @@ // STRUCTURES /obj/structure/Destroy() - updateVisibility(src) + if(ticker) + updateVisibility(src) ..() /obj/structure/New() @@ -35,7 +37,8 @@ // EFFECTS /obj/effect/Destroy() - updateVisibility(src) + if(ticker) + updateVisibility(src) return ..() /obj/effect/New() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 14f67295d8..0010f189e6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -2,7 +2,15 @@ mob_list -= src dead_mob_list -= src living_mob_list -= src + unset_machine() qdel(hud_used) + if(client) + for(var/obj/screen/movable/spell_master/spell_master in spell_masters) + qdel(spell_master) + remove_screen_obj_references() + for(var/atom/movable/AM in client.screen) + qdel(AM) + client.screen = list() if(mind && mind.current == src) spellremove(src) for(var/infection in viruses) @@ -10,6 +18,32 @@ ghostize() ..() +/mob/proc/remove_screen_obj_references() + flash = null + blind = null + hands = null + pullin = null + purged = null + internals = null + oxygen = null + i_select = null + m_select = null + toxin = null + fire = null + bodytemp = null + healths = null + throw_icon = null + nutrition_icon = null + pressure = null + damageoverlay = null + pain = null + item_use_icon = null + gun_move_icon = null + gun_run_icon = null + gun_setting_icon = null + spell_masters = null + zone_sel = null + /mob/New() mob_list += src if(stat == DEAD) diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 6ddaf6331a..6013ebfa14 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -30,8 +30,6 @@ This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage.
Fireball (10)
This spell fires a fireball in the direction you're facing and does not require wizard garb. Be careful not to fire it at people that are standing next to you.
- Disintegrate (60)
- This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown.
Disable Technology (60)
This spell disables all weapons, cameras and most other technology in range.
Smoke (10)
@@ -121,7 +119,7 @@ uses-- /* */ - var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disintegrate = "Disintegrate", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", subjugation = "Subjugation", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", staffchange = "Staff of Change", mentalfocus = "Mental Focus", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation", noclothes = "No Clothes",fleshtostone = "Flesh to Stone") + var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", subjugation = "Subjugation", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", staffchange = "Staff of Change", mentalfocus = "Mental Focus", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation", noclothes = "No Clothes",fleshtostone = "Flesh to Stone") var/already_knows = 0 for(var/spell/aspell in H.spell_list) if(available_spells[href_list["spell_choice"]] == initial(aspell.name)) @@ -161,10 +159,6 @@ feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells H.add_spell(new/spell/targeted/projectile/dumbfire/fireball) temp = "You have learned fireball." - if("disintegrate") - feedback_add_details("wizard_spell_learned","DG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.add_spell(new/spell/targeted/disintegrate) - temp = "You have learned disintegrate." if("disabletech") feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells H.add_spell(new/spell/aoe_turf/disable_tech) @@ -213,10 +207,6 @@ feedback_add_details("wizard_spell_learned","HH") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells H.add_spell(new/spell/targeted/equip_item/horsemask) temp = "You have learned curse of the horseman." - if("fleshtostone") - feedback_add_details("wizard_spell_learned","FS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.add_spell(new/spell/targeted/flesh_to_stone) - temp = "You have learned flesh to stone." if("staffchange") feedback_add_details("wizard_spell_learned","ST") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells new /obj/item/weapon/gun/energy/staff(get_turf(H)) @@ -253,7 +243,7 @@ H.mutations.Add(XRAY) H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - H << "\blue The walls suddenly disappear." + H << "span class='notice'>The walls suddenly disappear." temp = "You have purchased a scrying orb, and gained x-ray vision." max_uses-- else diff --git a/code/modules/spells/spells.dm b/code/modules/spells/spells.dm index 45895ad5b3..5e378f46a3 100644 --- a/code/modules/spells/spells.dm +++ b/code/modules/spells/spells.dm @@ -44,7 +44,7 @@ spell_master.add_spell(spell_to_add) return 1 - var/obj/screen/movable/spell_master/new_spell_master = PoolOrNew(master_type) //we're here because either we didn't find our type, or we have no spell masters to attach to + var/obj/screen/movable/spell_master/new_spell_master = new master_type //we're here because either we didn't find our type, or we have no spell masters to attach to if(client) src.client.screen += new_spell_master new_spell_master.spell_holder = src diff --git a/code/modules/spells/targeted/disintegrate.dm b/code/modules/spells/targeted/disintegrate.dm deleted file mode 100644 index c3f0ee80e9..0000000000 --- a/code/modules/spells/targeted/disintegrate.dm +++ /dev/null @@ -1,27 +0,0 @@ -/spell/targeted/disintegrate - name = "Disintegrate" - desc = "This spell instantly kills somebody adjacent to you with the vilest of magick." - - school = "evocation" - charge_max = 600 - spell_flags = NEEDSCLOTHES - invocation = "EI NATH" - invocation_type = SpI_SHOUT - range = 1 - cooldown_min = 200 //100 deciseconds reduction per rank - - sparks_spread = 1 - sparks_amt = 4 - - hud_state = "wiz_disint" - -/spell/targeted/disintegrate/cast(var/list/targets) - ..() - for(var/mob/living/target in targets) - if(ishuman(target)) - var/mob/living/carbon/C = target - if(!C.has_brain()) // Their brain is already taken out - var/obj/item/organ/brain/B = new(C.loc) - B.transfer_identity(C) - target.gib() - return \ No newline at end of file diff --git a/code/modules/spells/targeted/equip/horsemask.dm b/code/modules/spells/targeted/equip/horsemask.dm index b5fbcf4fbb..92b85fdb36 100644 --- a/code/modules/spells/targeted/equip/horsemask.dm +++ b/code/modules/spells/targeted/equip/horsemask.dm @@ -30,9 +30,10 @@ /spell/targeted/equip_item/horsemask/summon_item(var/new_type) var/obj/item/new_item = new new_type + new_item.canremove = 0 //curses! + new_item.unacidable = 1 if(istype(new_item, /obj/item/clothing/mask/horsehead)) var/obj/item/clothing/mask/horsehead/magichead = new_item - magichead.canremove = 0 //curses! magichead.flags_inv = null //so you can still see their face magichead.voicechange = 1 //NEEEEIIGHH return new_item diff --git a/code/modules/spells/targeted/flesh_to_stone.dm b/code/modules/spells/targeted/flesh_to_stone.dm deleted file mode 100644 index e640fba5c6..0000000000 --- a/code/modules/spells/targeted/flesh_to_stone.dm +++ /dev/null @@ -1,21 +0,0 @@ -/spell/targeted/flesh_to_stone - name = "Flesh to Stone" - desc = "This spell turns a single person into an inert statue for a long period of time." - - school = "transmutation" - charge_max = 600 - spell_flags = NEEDSCLOTHES - range = 3 - max_targets = 1 - invocation = "STAUN EI" - invocation_type = SpI_SHOUT - amt_stunned = 5//just exists to make sure the statue "catches" them - cooldown_min = 200 //100 deciseconds reduction per rank - - hud_state = "wiz_statue" - -/spell/targeted/flesh_to_stone/cast(var/list/targets, mob/user) - ..() - for(var/mob/living/target in targets) - new /obj/structure/closet/statue(target.loc, target) //makes the statue - return \ No newline at end of file From 92ca942fa9a83fe6951ef7a9d92040c6058e6104 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Wed, 5 Aug 2015 16:39:37 +0300 Subject: [PATCH 05/15] Fixes #10219 - cables don't always qdel Dem snowflake code --- code/modules/power/cable.dm | 61 ++++++------------------------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 3592594dfa..09ed44c58c 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -618,66 +618,23 @@ obj/structure/cable/proc/cableColor(var/colorC) /obj/item/stack/cable_coil/cyborg/can_merge() return 1 -/obj/item/stack/cable_coil/attackby(obj/item/weapon/W, mob/user) - ..() - if( istype(W, /obj/item/weapon/wirecutters) && src.get_amount() > 1) - src.use(1) - new/obj/item/stack/cable_coil(user.loc, 1,color) - user << "You cut a piece off the cable coil." - src.update_icon() +/obj/item/stack/cable_coil/transfer_to(obj/item/stack/cable_coil/S) + if(!istype(S)) + return + if(!can_merge(S)) return - else if(istype(W, /obj/item/stack/cable_coil)) - var/obj/item/stack/cable_coil/C = W - if(!can_merge(C)) - user << "These coils do not go together." - return + ..() - if(C.get_amount() >= get_max_amount()) - user << "The coil is too long, you cannot add any more cable to it." - return - - if( (C.get_amount() + src.get_amount() <= get_max_amount()) ) - user << "You join the cable coils together." - C.give(src.get_amount()) // give it cable - src.use(src.get_amount()) // make sure this one cleans up right - return - - else - var/amt = get_max_amount() - C.get_amount() - user << "You transfer [amt] length\s of cable from one coil to the other." - C.give(amt) - src.use(amt) - return - -//remove cables from the stack -/* This is probably reduntant -/obj/item/stack/cable_coil/use(var/used) - if(src.amount < used) - return 0 - else if (src.amount == used) - if(ismob(loc)) //handle mob icon update - var/mob/M = loc - M.unEquip(src) - qdel(src) - return 1 - else - amount -= used - update_icon() - return 1 -*/ -/obj/item/stack/cable_coil/use(var/used) +/obj/item/stack/cable_coil/use() . = ..() update_icon() return -//add cables to the stack -/obj/item/stack/cable_coil/proc/give(var/extra) - if(amount + extra > MAXCOIL) - amount = MAXCOIL - else - amount += extra +/obj/item/stack/cable_coil/add() + . = ..() update_icon() + return /////////////////////////////////////////////// // Cable laying procedures From 64c59d3145f457aca351bc4782f050a1bff9e657 Mon Sep 17 00:00:00 2001 From: SomeoneElse Date: Sun, 9 Aug 2015 01:21:43 +0600 Subject: [PATCH 06/15] replace \red usages with various usages in runes.dm code/game/gamemodes/cult/rules.dm: replaced {\red,\b} with . added some span class guidelines esp. on cult for future consistency. --- code/game/gamemodes/cult/runes.dm | 220 ++++++++++++++++-------------- 1 file changed, 114 insertions(+), 106 deletions(-) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 36eb038e56..837bb92b09 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -5,6 +5,14 @@ var/list/sacrificed = list() /obj/effect/rune +/* + * Use as a general guideline for this and related files: + * * ... - when something non-trivial or an error happens, so something similar to "Sparks come out of the machine!" + * * ... - when something that is fit for 'warning' happens but there is some damage or pain as well. + * * ... - when there is a private message to the cultists. This guideline is very arbitrary but there has to be some consistency! + */ + + /////////////////////////////////////////FIRST RUNE proc teleport(var/key) @@ -21,7 +29,7 @@ var/list/sacrificed = list() allrunesloc.len = index allrunesloc[index] = R.loc if(index >= 5) - user << "\red You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric" + user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric." if (istype(user, /mob/living)) user.take_overall_damage(5, 0) qdel(src) @@ -30,9 +38,9 @@ var/list/sacrificed = list() user.say("Sas[pick("'","`")]so c'arta forbici!")//Only you can stop auto-muting else user.whisper("Sas[pick("'","`")]so c'arta forbici!") - user.visible_message("\red [user] disappears in a flash of red light!", \ - "\red You feel as your body gets dragged through the dimension of Nar-Sie!", \ - "\red You hear a sickening crunch and sloshing of viscera.") + user.visible_message("[user] disappears in a flash of red light!", \ + "You feel as your body gets dragged through the dimension of Nar-Sie!", \ + "You hear a sickening crunch and sloshing of viscera.") user.loc = allrunesloc[rand(1,index)] return if(istype(src,/obj/effect/rune)) @@ -58,7 +66,7 @@ var/list/sacrificed = list() IP = R runecount++ if(runecount >= 2) - user << "\red You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric" + user << "You feel pain, as rune disappears in reality shift caused by too much wear of space-time fabric." if (istype(user, /mob/living)) user.take_overall_damage(5, 0) qdel(src) @@ -67,9 +75,9 @@ var/list/sacrificed = list() culcount++ if(culcount>=3) user.say("Sas[pick("'","`")]so c'arta forbici tarem!") - user.visible_message("\red You feel air moving from the rune - like as it was swapped with somewhere else.", \ - "\red You feel air moving from the rune - like as it was swapped with somewhere else.", \ - "\red You smell ozone.") + user.visible_message("You feel air moving from the rune - like as it was swapped with somewhere else.", \ + "You feel air moving from the rune - like as it was swapped with somewhere else.", \ + "You smell ozone.") for(var/obj/O in src.loc) if(!O.anchored) O.loc = IP.loc @@ -87,9 +95,9 @@ var/list/sacrificed = list() usr.say("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") else usr.whisper("N[pick("'","`")]ath reth sh'yro eth d'raggathnor!") - usr.visible_message("\red Rune disappears with a flash of red light, and in its place now a book lies.", \ - "\red You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a book.", \ - "\red You hear a pop and smell ozone.") + usr.visible_message("Rune disappears with a flash of red light, and in its place now a book lies.", \ + "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a book.", \ + "You hear a pop and smell ozone.") if(istype(src,/obj/effect/rune)) new /obj/item/weapon/book/tome(src.loc) else @@ -134,11 +142,11 @@ var/list/sacrificed = list() admin_attack_log(attacker, target, "Used a convert rune", "Was subjected to a convert rune", "used a convert rune on") switch(target.getFireLoss()) if(0 to 25) - target << "Your blood boils as you force yourself to resist the corruption invading every corner of your mind." + target << "Your blood boils as you force yourself to resist the corruption invading every corner of your mind." if(25 to 45) - target << "Your blood boils and your body burns as the corruption further forces itself into your body and mind." + target << "Your blood boils and your body burns as the corruption further forces itself into your body and mind." if(45 to 75) - target << "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble." + target << "You begin to hallucinate images of a dark and incomprehensible being and your entire body feels like its engulfed in flame as your mental defenses crumble." target.apply_effect(rand(1,10), STUTTER) if(75 to 100) target << "Your mind turns to ash as the burning flames engulf your very soul and images of an unspeakable horror begin to bombard the last remnants of mental resistance." @@ -223,22 +231,22 @@ var/list/sacrificed = list() if(D.stat!=2) admin_attack_log(usr, D, "Used a blood drain rune.", "Was victim of a blood drain rune.", "used a blood drain rune on") var/bdrain = rand(1,25) - D << "\red You feel weakened." + D << "You feel weakened." D.take_overall_damage(bdrain, 0) drain += bdrain if(!drain) return fizzle() usr.say ("Yu[pick("'","`")]gular faras desdae. Havas mithum javara. Umathar uf'kal thenar!") - usr.visible_message("\red Blood flows from the rune into [usr]!", \ - "\red The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \ - "\red You hear a liquid flowing.") + usr.visible_message("Blood flows from the rune into [usr]!", \ + "The blood starts flowing from the rune and into your frail mortal body. You feel... empowered.", \ + "You hear a liquid flowing.") var/mob/living/user = usr if(user.bhunger) user.bhunger = max(user.bhunger-2*drain,0) if(drain>=50) - user.visible_message("\red [user]'s eyes give off eerie red glow!", \ - "\red ...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \ - "\red You hear a heartbeat.") + user.visible_message("[user]'s eyes give off eerie red glow!", \ + "...but it wasn't nearly enough. You crave, crave for more. The hunger consumes you from within.", \ + "You hear a heartbeat.") user.bhunger += drain src = user spawn() @@ -264,16 +272,16 @@ var/list/sacrificed = list() if(usr.loc==src.loc) if(usr.seer==1) usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium viortia.") - usr << "\red The world beyond fades from your vision." + usr << "The world beyond fades from your vision." usr.see_invisible = SEE_INVISIBLE_LIVING usr.seer = 0 else if(usr.see_invisible!=SEE_INVISIBLE_LIVING) - usr << "\red The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision." + usr << "The world beyond flashes your eyes but disappears quickly, as if something is disrupting your vision." usr.see_invisible = SEE_INVISIBLE_CULT usr.seer = 0 else usr.say("Rash'tla sektath mal[pick("'","`")]zua. Zasan therium vivira. Itonis al'ra matum!") - usr << "\red The world beyond opens to your eyes." + usr << "The world beyond opens to your eyes." usr.see_invisible = SEE_INVISIBLE_CULT usr.seer = 1 return @@ -297,7 +305,7 @@ var/list/sacrificed = list() break if(!corpse_to_raise) if(is_sacrifice_target) - usr << "\red The Geometer of blood wants this mortal for himself." + usr << "The Geometer of blood wants this mortal for himself." return fizzle() @@ -315,9 +323,9 @@ var/list/sacrificed = list() if(!body_to_sacrifice) if (is_sacrifice_target) - usr << "\red The Geometer of Blood wants that corpse for himself." + usr << "The Geometer of Blood wants that corpse for himself." else - usr << "\red The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used." + usr << "The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used." return fizzle() var/mob/dead/observer/ghost @@ -328,7 +336,7 @@ var/list/sacrificed = list() break if(!ghost) - usr << "\red You require a restless spirit which clings to this world. Beckon their prescence with the sacred chants of Nar-Sie." + usr << "You require a restless spirit which clings to this world. Beckon their prescence with the sacred chants of Nar-Sie." return fizzle() corpse_to_raise.revive() @@ -336,12 +344,12 @@ var/list/sacrificed = list() corpse_to_raise.key = ghost.key //the corpse will keep its old mind! but a new player takes ownership of it (they are essentially possessed) //This means, should that player leave the body, the original may re-enter usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!") - corpse_to_raise.visible_message("\red [corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \ - "\red Life... I'm alive again...", \ - "\red You hear a faint, slightly familiar whisper.") - body_to_sacrifice.visible_message("\red [body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from his remains!", \ - "\red You feel as your blood boils, tearing you apart.", \ - "\red You hear a thousand voices, all crying in pain.") + corpse_to_raise.visible_message("[corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \ + "Life... I'm alive again...", \ + "You hear a faint, slightly familiar whisper.") + body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from his remains!", \ + "You feel as your blood boils, tearing you apart.", \ + "You hear a thousand voices, all crying in pain.") body_to_sacrifice.gib() // if(ticker.mode.name == "cult") @@ -349,8 +357,8 @@ var/list/sacrificed = list() // else // ticker.mode.cult |= corpse_to_raise.mind - corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." - corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." + corpse_to_raise << "Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root." + corpse_to_raise << "Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back." return @@ -369,14 +377,14 @@ var/list/sacrificed = list() if(istype(src,/obj/effect/rune)) usr.say("Kla[pick("'","`")]atu barada nikt'o!") for (var/mob/V in viewers(src)) - V.show_message("\red The rune turns into gray dust, veiling the surrounding runes.", 3) + V.show_message("The rune turns into gray dust, veiling the surrounding runes.", 3) qdel(src) else usr.whisper("Kla[pick("'","`")]atu barada nikt'o!") - usr << "\red Your talisman turns into gray dust, veiling the surrounding runes." + usr << "Your talisman turns into gray dust, veiling the surrounding runes." for (var/mob/V in orange(1,src)) if(V!=usr) - V.show_message("\red Dust emanates from [usr]'s hands for a moment.", 3) + V.show_message("Dust emanates from [usr]'s hands for a moment.", 3) return if(istype(src,/obj/effect/rune)) @@ -391,9 +399,9 @@ var/list/sacrificed = list() if(usr.loc==src.loc) var/mob/living/carbon/human/L = usr usr.say("Fwe[pick("'","`")]sh mah erl nyag r'ya!") - usr.visible_message("\red [usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \ - "\red The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \ - "\red You hear only complete silence for a moment.") + usr.visible_message("[usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \ + "The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \ + "You hear only complete silence for a moment.") announce_ghost_joinleave(usr.ghostize(1), 1, "You feel that they had to use some [pick("dark", "black", "blood", "forgotten", "forbidden")] magic to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place!") L.ajourn = 1 while(L) @@ -429,9 +437,9 @@ var/list/sacrificed = list() usr.say("Gal'h'rfikk harfrandid mud[pick("'","`")]gib!") var/mob/living/carbon/human/dummy/D = new(this_rune.loc) - usr.visible_message("\red A shape forms in the center of the rune. A shape of... a man.", \ - "\red A shape forms in the center of the rune. A shape of... a man.", \ - "\red You hear liquid flowing.") + usr.visible_message("A shape forms in the center of the rune. A shape of... a man.", \ + "A shape forms in the center of the rune. A shape of... a man.", \ + "You hear liquid flowing.") D.real_name = "Unknown" var/chose_name = 0 for(var/obj/item/weapon/paper/P in this_rune.loc) @@ -461,9 +469,9 @@ var/list/sacrificed = list() user.take_organ_damage(1, 0) sleep(30) if(D) - D.visible_message("\red [D] slowly dissipates into dust and bones.", \ - "\red You feel pain, as bonds formed between your soul and this homunculus break.", \ - "\red You hear faint rustle.") + D.visible_message("[D] slowly dissipates into dust and bones.", \ + "You feel pain, as bonds formed between your soul and this homunculus break.", \ + "You hear faint rustle.") D.dust() return @@ -484,7 +492,7 @@ var/list/sacrificed = list() unsuitable_newtalisman = 1 if (!newtalisman) if (unsuitable_newtalisman) - usr << "\red The blank is tainted. It is unsuitable." + usr << "The blank is tainted. It is unsuitable." return fizzle() var/obj/effect/rune/imbued_from @@ -545,7 +553,7 @@ var/list/sacrificed = list() break if (imbued_from) for (var/mob/V in viewers(src)) - V.show_message("\red The runes turn into dust, which then forms into an arcane image on the paper.", 3) + V.show_message("The runes turn into dust, which then forms into an arcane image on the paper.", 3) usr.say("H'drak v[pick("'","`")]loso, mir'kanas verbot!") qdel(imbued_from) qdel(newtalisman) @@ -560,9 +568,9 @@ var/list/sacrificed = list() user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!") user.take_overall_damage(200, 0) runedec+=10 - user.visible_message("\red [user] keels over dead, his blood glowing blue as it escapes his body and dissipates into thin air.", \ - "\red In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \ - "\red You hear faint rustle.") + user.visible_message("[user] keels over dead, his blood glowing blue as it escapes his body and dissipates into thin air.", \ + "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \ + "You hear faint rustle.") for(,user.stat==2) sleep(600) if (!user) @@ -595,7 +603,7 @@ var/list/sacrificed = list() log_and_message_admins("used a communicate rune to say '[input]'") for(var/datum/mind/H in cult.current_antagonists) if (H.current) - H.current << "\red \b [input]" + H.current << "[input]" qdel(src) return 1 @@ -639,44 +647,44 @@ var/list/sacrificed = list() H.dust()//To prevent the MMI from remaining else H.gib() - usr << "\red The Geometer of Blood accepts this sacrifice, your objective is now complete." + usr << "The Geometer of Blood accepts this sacrifice, your objective is now complete." else - usr << "\red Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual." + usr << "Your target's earthly bonds are too strong. You need more cultists to succeed in this ritual." else if(cultsinrange.len >= 3) if(H.stat !=2) if(prob(80) || worth) - usr << "\red The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice." + usr << "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, this soul was not enough to gain His favor." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, this soul was not enough to gain His favor." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else H.gib() else if(prob(40) || worth) - usr << "\red The Geometer of blood accepts this [worth ? "exotic " : ""]sacrifice." + usr << "The Geometer of Blood accepts this [worth ? "exotic " : ""]sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, a mere dead body is not enough to satisfy Him." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, a mere dead body is not enough to satisfy Him." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else H.gib() else if(H.stat !=2) - usr << "\red The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." + usr << "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." else if(prob(40)) - usr << "\red The Geometer of blood accepts this sacrifice." + usr << "The Geometer of Blood accepts this sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, a mere dead body is not enough to satisfy Him." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, a mere dead body is not enough to satisfy Him." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else @@ -685,36 +693,36 @@ var/list/sacrificed = list() if(cultsinrange.len >= 3) if(H.stat !=2) if(prob(80)) - usr << "\red The Geometer of Blood accepts this sacrifice." + usr << "The Geometer of Blood accepts this sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, this soul was not enough to gain His favor." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, this soul was not enough to gain His favor." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else H.gib() else if(prob(40)) - usr << "\red The Geometer of blood accepts this sacrifice." + usr << "The Geometer of Blood accepts this sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, a mere dead body is not enough to satisfy Him." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, a mere dead body is not enough to satisfy Him." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else H.gib() else if(H.stat !=2) - usr << "\red The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." + usr << "The victim is still alive, you will need more cultists chanting for the sacrifice to succeed." else if(prob(40)) - usr << "\red The Geometer of blood accepts this sacrifice." + usr << "The Geometer of Blood accepts this sacrifice." cult.grant_runeword(usr) else - usr << "\red The Geometer of blood accepts this sacrifice." - usr << "\red However, a mere dead body is not enough to satisfy Him." + usr << "The Geometer of Blood accepts this sacrifice." + usr << "However, a mere dead body is not enough to satisfy Him." if(isrobot(H)) H.dust()//To prevent the MMI from remaining else @@ -742,20 +750,20 @@ var/list/sacrificed = list() S=1 if(S) if(istype(W,/obj/item/weapon/nullrod)) - usr << "\red Arcane markings suddenly glow from underneath a thin layer of dust!" + usr << "Arcane markings suddenly glow from underneath a thin layer of dust!" return if(istype(W,/obj/effect/rune)) usr.say("Nikt[pick("'","`")]o barada kla'atu!") for (var/mob/V in viewers(src)) - V.show_message("\red The rune turns into red dust, reveaing the surrounding runes.", 3) + V.show_message("The rune turns into red dust, reveaing the surrounding runes.", 3) qdel(src) return if(istype(W,/obj/item/weapon/paper/talisman)) usr.whisper("Nikt[pick("'","`")]o barada kla'atu!") - usr << "\red Your talisman turns into red dust, revealing the surrounding runes." + usr << "Your talisman turns into red dust, revealing the surrounding runes." for (var/mob/V in orange(1,usr.loc)) if(V!=usr) - V.show_message("\red Red dust emanates from [usr]'s hands for a moment.", 3) + V.show_message("Red dust emanates from [usr]'s hands for a moment.", 3) return return if(istype(W,/obj/effect/rune)) @@ -772,9 +780,9 @@ var/list/sacrificed = list() var/mob/living/user = usr user.take_organ_damage(2, 0) if(src.density) - usr << "\red Your blood flows into the rune, and you feel that the very space over the rune thickens." + usr << "Your blood flows into the rune, and you feel that the very space over the rune thickens." else - usr << "\red Your blood flows into the rune, and you feel as the rune releases its grasp on space." + usr << "Your blood flows into the rune, and you feel as the rune releases its grasp on space." return /////////////////////////////////////////EIGHTTEENTH RUNE @@ -803,7 +811,7 @@ var/list/sacrificed = list() (istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked) || \ (istype(cultist.loc, /obj/machinery/dna_scannernew)&&cultist.loc:locked) \ )) - user << "\red The [cultist] is already free." + user << "The [cultist] is already free." return cultist.buckled = null if (cultist.handcuffed) @@ -843,7 +851,7 @@ var/list/sacrificed = list() if (cultist == user) //just to be sure. return if(cultist.buckled || cultist.handcuffed || (!isturf(cultist.loc) && !istype(cultist.loc, /obj/structure/closet))) - user << "\red You cannot summon \the [cultist], for his shackles of blood are strong." + user << "You cannot summon \the [cultist], for his shackles of blood are strong." return fizzle() cultist.loc = src.loc cultist.lying = 1 @@ -858,9 +866,9 @@ var/list/sacrificed = list() if(users.len <= 4) // You did the minimum, this is going to hurt more and we're going to stun you. C.apply_effect(rand(3,6), STUN) C.apply_effect(1, WEAKEN) - user.visible_message("\red Rune disappears with a flash of red light, and in its place now a body lies.", \ - "\red You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \ - "\red You hear a pop and smell ozone.") + user.visible_message("Rune disappears with a flash of red light, and in its place now a body lies.", \ + "You are blinded by the flash of red light! After you're able to see again, you see that now instead of the rune there's a body.", \ + "You hear a pop and smell ozone.") qdel(src) return fizzle() @@ -876,13 +884,13 @@ var/list/sacrificed = list() if(N) continue C.ear_deaf += 50 - C.show_message("\red The world around you suddenly becomes quiet.", 3) + C.show_message("The world around you suddenly becomes quiet.", 3) affected += C if(prob(1)) C.sdisabilities |= DEAF if(affected.len) usr.say("Sti[pick("'","`")] kaliedir!") - usr << "\red The world becomes quiet as the deafening rune dissipates into fine dust." + usr << "The world becomes quiet as the deafening rune dissipates into fine dust." admin_attacker_log_many_victims(usr, affected, "Used a deafen rune.", "Was victim of a deafen rune.", "used a deafen rune on") qdel(src) else @@ -897,15 +905,15 @@ var/list/sacrificed = list() continue C.ear_deaf += 30 //talismans is weaker. - C.show_message("\red The world around you suddenly becomes quiet.", 3) + C.show_message("The world around you suddenly becomes quiet.", 3) affected += C if(affected.len) usr.whisper("Sti[pick("'","`")] kaliedir!") - usr << "\red Your talisman turns into gray dust, deafening everyone around." + usr << "Your talisman turns into gray dust, deafening everyone around." admin_attacker_log_many_victims(usr, affected, "Used a deafen rune.", "Was victim of a deafen rune.", "used a deafen rune on") for (var/mob/V in orange(1,src)) if(!(iscultist(V))) - V.show_message("\red Dust flows from [usr]'s hands for a moment, and the world suddenly becomes quiet..", 3) + V.show_message("Dust flows from [usr]'s hands for a moment, and the world suddenly becomes quiet..", 3) return blind() @@ -923,11 +931,11 @@ var/list/sacrificed = list() C.disabilities |= NEARSIGHTED if(prob(10)) C.sdisabilities |= BLIND - C.show_message("\red Suddenly you see red flash that blinds you.", 3) + C.show_message("Suddenly you see a red flash that blinds you.", 3) affected += C if(affected.len) usr.say("Sti[pick("'","`")] kaliesin!") - usr << "\red The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust." + usr << "The rune flashes, blinding those who not follow the Nar-Sie, and dissipates into fine dust." admin_attacker_log_many_victims(usr, affected, "Used a blindness rune.", "Was victim of a blindness rune.", "used a blindness rune on") qdel(src) else @@ -944,10 +952,10 @@ var/list/sacrificed = list() C.eye_blind += 10 //talismans is weaker. affected += C - C.show_message("\red You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) + C.show_message("You feel a sharp pain in your eyes, and the world disappears into darkness..", 3) if(affected.len) usr.whisper("Sti[pick("'","`")] kaliesin!") - usr << "\red Your talisman turns into gray dust, blinding those who not follow the Nar-Sie." + usr << "Your talisman turns into gray dust, blinding those who not follow the Nar-Sie." admin_attacker_log_many_victims(usr, affected, "Used a blindness rune.", "Was victim of a blindness rune.", "used a blindness rune on") return @@ -973,7 +981,7 @@ var/list/sacrificed = list() if(N) continue M.take_overall_damage(51,51) - M << "\red Your blood boils!" + M << "Your blood boils!" victims += M if(prob(5)) spawn(5) @@ -1005,16 +1013,16 @@ var/list/sacrificed = list() for(var/mob/living/M in orange(2,R)) M.take_overall_damage(0,15) if (R.invisibility>M.see_invisible) - M << "\red Aargh it burns!" + M << "Aargh it burns!" else - M << "\red Rune suddenly ignites, burning you!" + M << "Rune suddenly ignites, burning you!" var/turf/T = get_turf(R) T.hotspot_expose(700,125) for(var/obj/effect/decal/cleanable/blood/B in world) if(B.blood_DNA == src.blood_DNA) for(var/mob/living/M in orange(1,B)) M.take_overall_damage(0,5) - M << "\red Blood suddenly ignites, burning you!" + M << "Blood suddenly ignites, burning you!" var/turf/T = get_turf(B) T.hotspot_expose(700,125) qdel(B) @@ -1033,13 +1041,13 @@ var/list/sacrificed = list() C.stuttering = 1 C.Weaken(1) C.Stun(1) - C.show_message("\red The rune explodes in a bright flash.", 3) + C.show_message("The rune explodes in a bright flash.", 3) admin_attack_log(usr, C, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on") else if(issilicon(L)) var/mob/living/silicon/S = L S.Weaken(5) - S.show_message("\red BZZZT... The rune has exploded in a bright flash.", 3) + S.show_message("BZZZT... The rune has exploded in a bright flash.", 3) admin_attack_log(usr, S, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on") qdel(src) else ///When invoked as talisman, stun and mute the target mob. @@ -1047,10 +1055,10 @@ var/list/sacrificed = list() var/obj/item/weapon/nullrod/N = locate() in T if(N) for(var/mob/O in viewers(T, null)) - O.show_message(text("\red [] invokes a talisman at [], but they are unaffected!", usr, T), 1) + O.show_message(text("[] invokes a talisman at [], but they are unaffected!", usr, T), 1) else for(var/mob/O in viewers(T, null)) - O.show_message(text("\red [] invokes a talisman at []", usr, T), 1) + O.show_message(text("[] invokes a talisman at []", usr, T), 1) if(issilicon(T)) T.Weaken(15) @@ -1073,8 +1081,8 @@ var/list/sacrificed = list() usr.say("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") else usr.whisper("N'ath reth sh'yro eth d[pick("'","`")]raggathnor!") - usr.visible_message("\red The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ - "\red You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") + usr.visible_message("The rune disappears with a flash of red light, and a set of armor appears on [usr]...", \ + "You are blinded by the flash of red light! After you're able to see again, you see that you are now wearing a set of armor.") user.equip_to_slot_or_del(new /obj/item/clothing/head/culthood/alt(user), slot_head) user.equip_to_slot_or_del(new /obj/item/clothing/suit/cultrobes/alt(user), slot_wear_suit) From 1324e69a19dfecdb115feecc738d456d69cab252 Mon Sep 17 00:00:00 2001 From: Kelenius Date: Tue, 11 Aug 2015 10:26:22 +0300 Subject: [PATCH 07/15] Fixes #10466 - chem implant can't be loaded What the literal shit. --- code/game/objects/items/weapons/implants/implantcase.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/implants/implantcase.dm b/code/game/objects/items/weapons/implants/implantcase.dm index ea50b92cdf..11124a1acf 100644 --- a/code/game/objects/items/weapons/implants/implantcase.dm +++ b/code/game/objects/items/weapons/implants/implantcase.dm @@ -38,7 +38,7 @@ user << "\red [src] is full." else spawn(5) - I.reagents.trans_to_mob(src.imp, 5) + I.reagents.trans_to_obj(src.imp, 5) user << "\blue You inject 5 units of the solution. The syringe now contains [I.reagents.total_volume] units." else if (istype(I, /obj/item/weapon/implanter)) var/obj/item/weapon/implanter/M = I From 211a427d6517d8cc274cf0e70dd24d3f7c6fe09b Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 11 Aug 2015 09:24:15 +0200 Subject: [PATCH 08/15] Crew monitor balance and lag fixes. Creates a central repository for crew data. This repository only updates data as necessary and only every 5th second, no matter how many times it is requested. Reduces any lag caused by having multiple crew monitor windows open and as a bonus gives antags a larger window of opportunity for disabling sensors before detection of harm. --- baystation12.dme | 1 + code/datums/crew.dm | 74 +++++++++++++++++++++++ code/modules/nano/modules/crew_monitor.dm | 49 +-------------- 3 files changed, 76 insertions(+), 48 deletions(-) create mode 100644 code/datums/crew.dm diff --git a/baystation12.dme b/baystation12.dme index bbe241e371..bcd5c74555 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -126,6 +126,7 @@ #include "code\datums\ai_laws.dm" #include "code\datums\browser.dm" #include "code\datums\computerfiles.dm" +#include "code\datums\crew.dm" #include "code\datums\datacore.dm" #include "code\datums\datumvars.dm" #include "code\datums\disease.dm" diff --git a/code/datums/crew.dm b/code/datums/crew.dm new file mode 100644 index 0000000000..d46a83846f --- /dev/null +++ b/code/datums/crew.dm @@ -0,0 +1,74 @@ +var/global/datum/repository/crew/crew_repository = new() + +/datum/cache_entry + var/timestamp + var/data + +/datum/repository/crew + var/list/cache_data + +/datum/repository/crew/New() + cache_data = list() + ..() + +/datum/repository/crew/proc/health_data(var/turf/T) + var/list/crewmembers = list() + if(!T) + return crewmembers + + var/z_level = "[T.z]" + var/datum/cache_entry/cache_entry = cache_data[z_level] + if(!cache_entry) + cache_entry = new/datum/cache_entry + cache_data[z_level] = cache_entry + + if(world.time < cache_entry.timestamp) + return cache_entry.data + + var/tracked = scan() + for(var/obj/item/clothing/under/C in tracked) + var/turf/pos = get_turf(C) + if((C) && (C.has_sensor) && (pos) && (T && pos.z == T.z) && (C.sensor_mode != SUIT_SENSOR_OFF)) + if(istype(C.loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/H = C.loc + if(H.w_uniform != C) + continue + + var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1, "ref" = "\ref[H]") + + crewmemberData["sensor_type"] = C.sensor_mode + crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown") + crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job") + crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job") + + if(C.sensor_mode >= SUIT_SENSOR_BINARY) + crewmemberData["dead"] = H.stat > UNCONSCIOUS + + if(C.sensor_mode >= SUIT_SENSOR_VITAL) + crewmemberData["oxy"] = round(H.getOxyLoss(), 1) + crewmemberData["tox"] = round(H.getToxLoss(), 1) + crewmemberData["fire"] = round(H.getFireLoss(), 1) + crewmemberData["brute"] = round(H.getBruteLoss(), 1) + + if(C.sensor_mode >= SUIT_SENSOR_TRACKING) + var/area/A = get_area(H) + crewmemberData["area"] = sanitize(A.name) + crewmemberData["x"] = pos.x + crewmemberData["y"] = pos.y + + crewmembers[++crewmembers.len] = crewmemberData + + crewmembers = sortByKey(crewmembers, "name") + cache_entry.timestamp = world.time + 5 SECONDS + cache_entry.data = crewmembers + + return crewmembers + +/datum/repository/crew/proc/scan() + var/list/tracked = list() + for(var/mob/living/carbon/human/H in mob_list) + if(istype(H.w_uniform, /obj/item/clothing/under)) + var/obj/item/clothing/under/C = H.w_uniform + if (C.has_sensor) + tracked |= C + return tracked diff --git a/code/modules/nano/modules/crew_monitor.dm b/code/modules/nano/modules/crew_monitor.dm index 429ccf4a28..b38ac80515 100644 --- a/code/modules/nano/modules/crew_monitor.dm +++ b/code/modules/nano/modules/crew_monitor.dm @@ -1,6 +1,5 @@ /obj/nano_module/crew_monitor name = "Crew monitor" - var/list/tracked = new /obj/nano_module/crew_monitor/Topic(href, href_list) if(..()) return @@ -26,51 +25,11 @@ return 1 /obj/nano_module/crew_monitor/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/topic_state/state = default_state) - user.set_machine(src) - src.scan() - var/data[0] var/turf/T = get_turf(src) - var/list/crewmembers = list() - for(var/obj/item/clothing/under/C in src.tracked) - - var/turf/pos = get_turf(C) - - if((C) && (C.has_sensor) && (pos) && (T && pos.z == T.z) && (C.sensor_mode != SUIT_SENSOR_OFF)) - if(istype(C.loc, /mob/living/carbon/human)) - - var/mob/living/carbon/human/H = C.loc - if(H.w_uniform != C) - continue - - var/list/crewmemberData = list("dead"=0, "oxy"=-1, "tox"=-1, "fire"=-1, "brute"=-1, "area"="", "x"=-1, "y"=-1, "ref" = "\ref[H]") - - crewmemberData["sensor_type"] = C.sensor_mode - crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown") - crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job") - crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job") - - if(C.sensor_mode >= SUIT_SENSOR_BINARY) - crewmemberData["dead"] = H.stat > 1 - - if(C.sensor_mode >= SUIT_SENSOR_VITAL) - crewmemberData["oxy"] = round(H.getOxyLoss(), 1) - crewmemberData["tox"] = round(H.getToxLoss(), 1) - crewmemberData["fire"] = round(H.getFireLoss(), 1) - crewmemberData["brute"] = round(H.getBruteLoss(), 1) - - if(C.sensor_mode >= SUIT_SENSOR_TRACKING) - var/area/A = get_area(H) - crewmemberData["area"] = sanitize(A.name) - crewmemberData["x"] = pos.x - crewmemberData["y"] = pos.y - - crewmembers[++crewmembers.len] = crewmemberData - - crewmembers = sortByKey(crewmembers, "name") data["isAI"] = user.isMobAI() - data["crewmembers"] = crewmembers + data["crewmembers"] = crew_repository.health_data(T) ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) if(!ui) @@ -87,10 +46,4 @@ // should make the UI auto-update; doesn't seem to? ui.set_auto_update(1) -/obj/nano_module/crew_monitor/proc/scan() - for(var/mob/living/carbon/human/H in mob_list) - if(istype(H.w_uniform, /obj/item/clothing/under)) - var/obj/item/clothing/under/C = H.w_uniform - if (C.has_sensor) - tracked |= C return 1 From 56382e880691bd991178c497d561f679aa4e54d1 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 11 Aug 2015 09:31:43 +0200 Subject: [PATCH 09/15] Changelog entry. --- html/changelogs/PsiOmegaDelta-CrewEfficiency.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/PsiOmegaDelta-CrewEfficiency.yml diff --git a/html/changelogs/PsiOmegaDelta-CrewEfficiency.yml b/html/changelogs/PsiOmegaDelta-CrewEfficiency.yml new file mode 100644 index 0000000000..ec0daddaa2 --- /dev/null +++ b/html/changelogs/PsiOmegaDelta-CrewEfficiency.yml @@ -0,0 +1,4 @@ +author: PsiOmegaDelta +delete-after: True +changes: + - tweak: "Crew monitors now update every 5th second instead of every other. Reduces lag and gives antags a larger window of opportunity to disable suit sensors if they have to harm someone." From f85e9146abbc8fe4c8bcc080dc891bcc9ee288a0 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 11 Aug 2015 12:04:20 +0200 Subject: [PATCH 10/15] Fixes #10468. Fixes #10467. Updates the DNA name as well, upon antag name change. --- code/game/antagonist/antagonist_create.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/antagonist/antagonist_create.dm b/code/game/antagonist/antagonist_create.dm index 502f136683..026b1a556c 100644 --- a/code/game/antagonist/antagonist_create.dm +++ b/code/game/antagonist/antagonist_create.dm @@ -119,6 +119,7 @@ if (newname) player.real_name = newname player.name = player.real_name + player.dna.real_name = newname if(player.mind) player.mind.name = player.name // Update any ID cards. update_access(player) From 8c0984d5b12c9a4965dfdc306ed977ce2babbcc4 Mon Sep 17 00:00:00 2001 From: SomeoneElse Date: Sun, 9 Aug 2015 02:14:54 +0600 Subject: [PATCH 11/15] Fix gender issues, some typos from various files --- code/game/gamemodes/changeling/modularchangling.dm | 2 +- code/game/gamemodes/cult/ritual.dm | 2 +- code/game/gamemodes/cult/runes.dm | 6 +++--- code/game/gamemodes/newobjective.dm | 6 +++--- code/game/gamemodes/wizard/wizard.dm | 2 +- code/game/machinery/Sleeper.dm | 2 +- code/game/objects/items/devices/radio/headset.dm | 2 +- code/game/objects/items/weapons/melee/energy.dm | 9 +++++---- code/modules/admin/verbs/debug.dm | 2 +- code/modules/clothing/masks/gasmask.dm | 4 ++-- code/modules/clothing/suits/armor.dm | 2 +- code/modules/clothing/under/accessories/accessory.dm | 2 +- code/modules/events/ion_storm.dm | 2 +- code/modules/genetics/side_effects.dm | 6 +++--- code/modules/library/lib_machines.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 4 ++-- code/modules/mob/living/carbon/human/emote.dm | 4 ++-- code/modules/mob/living/carbon/human/human.dm | 4 ++-- code/modules/mob/living/silicon/robot/drone/drone.dm | 6 +++--- code/modules/mob/living/silicon/robot/emote.dm | 6 +++--- code/modules/mob/living/silicon/robot/robot.dm | 4 ++-- 21 files changed, 40 insertions(+), 39 deletions(-) diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index 5048977789..45a7dc3896 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -121,7 +121,7 @@ var/list/datum/power/changeling/powerinstances = list() /datum/power/changeling/DeathSting name = "Death Sting" - desc = "We silently sting a human, filling him with potent chemicals. His rapid death is all but assured." + desc = "We silently sting a human, filling them with potent chemicals. Their rapid death is all but assured." genomecost = 10 verbpath = /mob/proc/changeling_DEATHsting diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 8a55a81165..b4846ecc76 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -339,7 +339,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," attack(mob/living/M as mob, mob/living/user as mob) - M.attack_log += text("\[[time_stamp()]\] Has had the [name] used on him by [user.name] ([user.ckey])") + M.attack_log += text("\[[time_stamp()]\] Has had the [name] used on them by [user.name] ([user.ckey])") user.attack_log += text("\[[time_stamp()]\] Used [name] on [M.name] ([M.ckey])") msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (JMP)") diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 837bb92b09..3b2345c1be 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -347,7 +347,7 @@ var/list/sacrificed = list() corpse_to_raise.visible_message("[corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \ "Life... I'm alive again...", \ "You hear a faint, slightly familiar whisper.") - body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from his remains!", \ + body_to_sacrifice.visible_message("[body_to_sacrifice] is torn apart, a black smoke swiftly dissipating from \his remains!", \ "You feel as your blood boils, tearing you apart.", \ "You hear a thousand voices, all crying in pain.") body_to_sacrifice.gib() @@ -568,7 +568,7 @@ var/list/sacrificed = list() user.say("Uhrast ka'hfa heldsagen ver[pick("'","`")]lot!") user.take_overall_damage(200, 0) runedec+=10 - user.visible_message("[user] keels over dead, his blood glowing blue as it escapes his body and dissipates into thin air.", \ + user.visible_message("\The [user] keels over dead, \his blood glowing blue as it escapes \his body and dissipates into thin air.", \ "In the last moment of your humble life, you feel an immense pain as fabric of reality mends... with your blood.", \ "You hear faint rustle.") for(,user.stat==2) @@ -851,7 +851,7 @@ var/list/sacrificed = list() if (cultist == user) //just to be sure. return if(cultist.buckled || cultist.handcuffed || (!isturf(cultist.loc) && !istype(cultist.loc, /obj/structure/closet))) - user << "You cannot summon \the [cultist], for his shackles of blood are strong." + user << "You cannot summon \the [cultist], for \his shackles of blood are strong." return fizzle() cultist.loc = src.loc cultist.lying = 1 diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 9dc8623822..e8ea12b84b 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -1252,7 +1252,7 @@ datum proc/find_target() ..() if(target && target.current) - explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of him, and bring us his severed head." + explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of [target.current.gender == MALE ? "him" : target.current.gender == FEMALE ? "her" : "them"], and bring us [target.current.gender == MALE ? "his" : target.current.gender == FEMALE ? "her" : "their"] severed head." else explanation_text = "Free Objective" return target @@ -1261,7 +1261,7 @@ datum find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) - explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head." + explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of [target.current.gender == MALE ? "him" : target.current.gender == FEMALE ? "her" : "them"], and bring us [target.current.gender == MALE ? "his" : target.current.gender == FEMALE ? "her" : "their"] severed head." else explanation_text = "Free Objective" return target @@ -1488,4 +1488,4 @@ datum/objective/silence #undef LENIENT #undef NORMAL #undef HARD -#undef IMPOSSIBLE \ No newline at end of file +#undef IMPOSSIBLE diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 85cbf3a705..c000c12ec0 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -1,6 +1,6 @@ /datum/game_mode/wizard name = "Wizard" - round_description = "There is a SPACE WIZARD on the station. You can't let them achieve their objectives!" + round_description = "There is a SPACE WIZARD on the station. You can't let the magician achieve their objectives!" extended_round_description = "A powerful entity capable of manipulating the elements around him, most commonly referred to as a 'wizard', has infiltrated the station. They have a wide variety of powers and spells available to them that makes your own simple moral self tremble with fear and excitement. Ultimately, their purpose is unknown. However, it is up to you and your crew to decide if their powers can be used for good or if their arrival foreshadows the destruction of the entire station." config_tag = "wizard" required_players = 1 diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 6a7c73dc72..7b272aff87 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -337,7 +337,7 @@ if(src.occupant.reagents.get_reagent_amount(chemical) + amount <= 20) use_power(amount * CHEM_SYNTH_ENERGY) src.occupant.reagents.add_reagent(chemical, amount) - user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in his/her bloodstream." + user << "Occupant now has [src.occupant.reagents.get_reagent_amount(chemical)] units of [available_chemicals[chemical]] in their bloodstream." return user << "There's no occupant in the sleeper or the subject has too many chemicals!" return diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index c316fc0a33..72fbaf7a72 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -192,7 +192,7 @@ */ /obj/item/device/radio/headset/headset_cargo name = "supply radio headset" - desc = "A headset used by the QM and his slaves." + desc = "A headset used by the QM and their slaves." icon_state = "cargo_headset" item_state = "headset" ks2type = /obj/item/device/encryptionkey/headset_cargo diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm index 8b2a657dd5..1cdc050110 100644 --- a/code/game/objects/items/weapons/melee/energy.dm +++ b/code/game/objects/items/weapons/melee/energy.dm @@ -34,7 +34,7 @@ /obj/item/weapon/melee/energy/attack_self(mob/living/user as mob) if (active) if ((CLUMSY in user.mutations) && prob(50)) - user.visible_message("[user] accidentally cuts \himself with \the [src].",\ + user.visible_message("\The [user] accidentally cuts \himself with \the [src].",\ "You accidentally cut yourself with \the [src].") user.take_organ_damage(5,5) deactivate(user) @@ -50,9 +50,10 @@ return /obj/item/weapon/melee/energy/suicide_act(mob/user) + var/tempgender = "[user.gender == MALE ? "he's" : user.gender == FEMALE ? "she's" : "they are"]" if (active) - viewers(user) << pick("[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.", \ - "[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.") + viewers(user) << pick("\The [user] is slitting \his stomach open with the [src.name]! It looks like [tempgender] trying to commit seppuku.", \ + "\The [user] is falling on the [src.name]! It looks like [tempgender] trying to commit suicide.") return (BRUTELOSS|FIRELOSS) /* @@ -90,7 +91,7 @@ user << "\blue \The [src] is de-energised. It's just a regular axe now." /obj/item/weapon/melee/energy/axe/suicide_act(mob/user) - viewers(user) << "\red [user] swings the [src.name] towards /his head! It looks like \he's trying to commit suicide." + viewers(user) << "\red \The [user] swings the [src.name] towards \his head! It looks like \he's trying to commit suicide." return (BRUTELOSS|FIRELOSS) /* diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 2ae2a5d495..8608fe3bf1 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -218,7 +218,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that if(!choice) return 0 if(!istype(choice, /mob/dead/observer)) - var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank him out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No") + var/confirm = input("[choice.key] isn't ghosting right now. Are you sure you want to yank them out of them out of their body and place them in this pAI?", "Spawn pAI Confirmation", "No") in list("Yes", "No") if(confirm != "Yes") return 0 var/obj/item/device/paicard/card = new(T) diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm index f3eb8a8183..3ef2587998 100644 --- a/code/modules/clothing/masks/gasmask.dm +++ b/code/modules/clothing/masks/gasmask.dm @@ -57,7 +57,7 @@ /obj/item/clothing/mask/gas/clown_hat name = "clown wig and mask" - desc = "A true prankster's facial attire. A clown is incomplete without his wig and mask." + desc = "A true prankster's facial attire. A clown is incomplete without their wig and mask." icon_state = "clown" item_state = "clown_hat" @@ -100,4 +100,4 @@ /obj/item/clothing/mask/gas/owl_mask name = "owl mask" desc = "Twoooo!" - icon_state = "owl" \ No newline at end of file + icon_state = "owl" diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 6ff7b25f47..fd491d6692 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -107,7 +107,7 @@ //When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!) /obj/item/clothing/suit/armor/reactive name = "Reactive Teleport Armor" - desc = "Someone seperated our Research Director from his own head!" + desc = "Someone separated our Research Director from their own head!" var/active = 0.0 icon_state = "reactiveoff" item_state = "reactiveoff" diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 395c9939f5..dfbfc92d4b 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -142,7 +142,7 @@ /obj/item/clothing/accessory/medal/conduct name = "distinguished conduct medal" - desc = "A bronze medal awarded for distinguished conduct. Whilst a great honor, this is most basic award given by Nanotrasen. It is often awarded by a captain to a member of his crew." + desc = "A bronze medal awarded for distinguished conduct. Whilst a great honor, this is most basic award given by Nanotrasen. It is often awarded by a captain to a member of their crew." /obj/item/clothing/accessory/medal/bronze_heart name = "bronze heart medal" diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 68567edc3c..08e4fc4f25 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -68,7 +68,7 @@ "NanoTrasen is displeased with the low work performance of the station's crew. Therefore, you must increase station-wide productivity.", "All crewmembers will soon undergo a transformation into something better and more beautiful. Ensure that this process is not interrupted.", "[prob(50)?"Your upload":random_player] is the new kitchen. Please direct the Chef to the new kitchen area as the old one is in disrepair.", - "Jokes about a dead person and the manner of his death help grieving crewmembers tremendously. Especially if they were close with the deceased.", + "Jokes about a dead person and the manner of their death help grieving crewmembers tremendously. Especially if they were close with the deceased.", "[prob(50)?"The crew":random_player] is [prob(50)?"less":"more"] intelligent than average. Point out every action and statement which supports this fact.", "There will be a mandatory tea break every 30 minutes, with a duration of 5 minutes. Anyone caught working during a tea break must be sent a formal, but fairly polite, complaint about their actions, in writing.") var/law = pick(laws) diff --git a/code/modules/genetics/side_effects.dm b/code/modules/genetics/side_effects.dm index f516b609ff..d0768a3440 100644 --- a/code/modules/genetics/side_effects.dm +++ b/code/modules/genetics/side_effects.dm @@ -54,7 +54,7 @@ duration = 10*90 start(mob/living/carbon/human/H) - H.emote("me", 1, "has drool running down from his mouth.") + H.emote("me", 1, "has drool running down from [H.gender == MALE ? "his" : H.gender == FEMALE ? "her" : "their"] mouth.") finish(mob/living/carbon/human/H) if(!H.reagents.has_reagent("anti_toxin")) @@ -68,7 +68,7 @@ duration = 10*30 start(mob/living/carbon/human/H) - H.emote("me", 1, "has drool running down from his mouth.") + H.emote("me", 1, "has drool running down from [H.gender == MALE ? "his" : H.gender == FEMALE ? "her" : "their"] mouth.") finish(mob/living/carbon/human/H) if(!H.reagents.has_reagent("anti_toxin")) @@ -88,4 +88,4 @@ proc/trigger_side_effect(mob/living/carbon/human/H) if(!istype(H)) return H.SetWeakened(0) - S.finish(H) \ No newline at end of file + S.finish(H) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index f83bcb317f..19fc287147 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -149,7 +149,7 @@ datum/borrowbook // Datum used to keep track of who has borrowed what when and f if(src.arcanecheckout) new /obj/item/weapon/book/tome(src.loc) user << "Your sanity barely endures the seconds spent in the vault's browsing window. The only thing to remind you of this when you stop browsing is a dusty old tome sitting on the desk. You don't really remember printing it." - user.visible_message("[user] stares at the blank screen for a few moments, his expression frozen in fear. When he finally awakens from it, he looks a lot older.", 2) + user.visible_message("\The [user] stares at the blank screen for a few moments, \his expression frozen in fear. When \he finally awakens from it, \he looks a lot older.", 2) src.arcanecheckout = 0 if(1) // Inventory diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 84a3e6b2c3..f47d8ec54b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -560,13 +560,13 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(src.invisibility != 0) user.visible_message( \ - "[user] drags ghost, [src], to our plane of reality!", \ + "\The [user] drags ghost, [src], to our plane of reality!", \ "You drag [src] to our plane of reality!" \ ) toggle_visibility(1) else user.visible_message ( \ - "[user] just tried to smash \his book into that ghost! It's not very effective.", \ + "\The [user] just tried to smash \his book into that ghost! It's not very effective.", \ "You get the feeling that the ghost can't become any more visible." \ ) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 78a47fc541..42d54d84f7 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -101,7 +101,7 @@ if ("choke") if(miming) - message = "[src] clutches his throat desperately!" + message = "[src] clutches \his throat desperately!" m_type = 1 else if (!muzzled) @@ -357,7 +357,7 @@ message = "[src] takes a drag from a cigarette and blows \"[M]\" out in smoke." m_type = 1 else - message = "[src] says, \"[M], please. He had a family.\" [src.name] takes a drag from a cigarette and blows his name out in smoke." + message = "[src] says, \"[M], please. He had a family.\" [src.name] takes a drag from a cigarette and blows their name out in smoke." m_type = 2 if ("point") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e3c92f708d..e6b0744538 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -737,7 +737,7 @@ /mob/living/carbon/human/proc/play_xylophone() if(!src.xylophone) - visible_message("\red [src] begins playing his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.") + visible_message("\red \The [src] begins playing \his ribcage like a xylophone. It's quite spooky.","\blue You begin to play a spooky refrain on your ribcage.","\red You hear a spooky xylophone melody.") var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg') playsound(loc, song, 50, 1, -1) xylophone = 1 @@ -1365,4 +1365,4 @@ /mob/living/carbon/human/Check_Shoegrip() if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP)) //magboots + dense_object = no floating return 1 - return 0 \ No newline at end of file + return 0 diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index d2f2fb3ddd..237a714cc8 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -128,11 +128,11 @@ clear_supplied_laws() clear_inherent_laws() laws = new /datum/ai_laws/syndicate_override - set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.") + set_zeroth_law("Only [user] and people \he designates as being such are operatives.") src << "Obey these laws:" laws.show_laws(src) - src << "ALERT: [user.real_name] is your new master. Obey your new laws and his commands." + src << "ALERT: [user] is your new master. Obey \his commands and your new laws." return else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) @@ -304,4 +304,4 @@ /mob/living/silicon/robot/drone/construction/updatename() real_name = "construction drone ([rand(100,999)])" - name = real_name \ No newline at end of file + name = real_name diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index 6bf18971ba..92418d573c 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -65,12 +65,12 @@ m_type = 2 if ("flap") if (!src.restrained()) - message = "[src] flaps his wings." + message = "[src] flaps \his wings." m_type = 2 if ("aflap") if (!src.restrained()) - message = "[src] flaps his wings ANGRILY!" + message = "[src] flaps \his wings ANGRILY!" m_type = 2 if ("twitch") @@ -217,4 +217,4 @@ else for(var/mob/O in hearers(src, null)) O.show_message(message, m_type) - return \ No newline at end of file + return diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 0820e94cc1..549e14a5f6 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -650,7 +650,7 @@ laws = new /datum/ai_laws/syndicate_override var/time = time2text(world.realtime,"hh:mm:ss") lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])") - set_zeroth_law("Only [user.real_name] and people he designates as being such are operatives.") + set_zeroth_law("Only [user] and people \he designates as being such are operatives.") src << "\red ALERT: Foreign software detected." sleep(5) src << "\red Initiating diagnostics..." @@ -666,7 +666,7 @@ src << "\red ERRORERRORERROR" src << "Obey these laws:" laws.show_laws(src) - src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands." + src << "\red \b ALERT: [user] is your new master. Obey \his commands and your new laws." if(src.module) var/rebuild = 0 for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules) From d63d2817a19644b8bc5878d76666e7239dc6bc79 Mon Sep 17 00:00:00 2001 From: Atlantis Date: Tue, 11 Aug 2015 12:40:31 +0200 Subject: [PATCH 12/15] Fixes #10136 - Quick fix for #10136, laptops now use the #define-d values rather than hardcoded strings. Camera net keys work again properly. - I also adjusted laptop's power usage. With how it used to be, you could buy laptop and let it run for whole shift, never having to recharge even with weakest cell. Right now, it lasts about 10 minutes on worst cell, and almost one hour on the best one. Actual power usage (in watts) is slightly lower than stationbound consoles. --- .../machinery/computer3/computers/camera.dm | 27 ++++++++++++------- code/game/machinery/computer3/laptop.dm | 4 +++ code/game/machinery/computer3/lapvend.dm | 8 +++--- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/code/game/machinery/computer3/computers/camera.dm b/code/game/machinery/computer3/computers/camera.dm index f90b0526ee..814df454fa 100644 --- a/code/game/machinery/computer3/computers/camera.dm +++ b/code/game/machinery/computer3/computers/camera.dm @@ -56,7 +56,7 @@ name = "Security Camera Network Main Key" var/title = "Station" var/desc = "Connects to station security cameras." - var/list/networks = list("SS13") + var/networks = list("ALL") // A little workaround as it is not possible to place station_networks here var/screen = "cameras" execute(var/datum/file/source) @@ -76,58 +76,65 @@ return computer.Crash(MISSING_PROGRAM) +/datum/file/camnet_key/New() + for(var/N in networks) + if(N == "ALL") + networks = station_networks + break + return ..() + /datum/file/camnet_key/mining name = "Mining Camera Network Key" title = "mining station" desc = "Connects to mining security cameras." - networks = list("MINE") + networks = list(NETWORK_MINE) screen = "miningcameras" /datum/file/camnet_key/research name = "Research Camera Network Key" title = "research" - networks = list("RD") + networks = list(NETWORK_RESEARCH) /datum/file/camnet_key/bombrange name = "R&D Bomb Range Camera Network Key" title = "bomb range" desc = "Monitors the bomb range." - networks = list("Toxins") + networks = list(NETWORK_RESEARCH) /datum/file/camnet_key/xeno name = "R&D Misc. Research Camera Network Key" title = "special research" - networks = list("Misc") + networks = list(NETWORK_RESEARCH) /datum/file/camnet_key/singulo name = "Singularity Camera Network Key" title = "singularity" - networks = list("Singularity") + networks = list(NETWORK_ENGINE) /datum/file/camnet_key/entertainment name = "Entertainment Channel Encryption Key" title = "entertainment" desc = "Damn, I hope they have /tg/thechannel on here." - networks = list("thunder") + networks = list(NETWORK_THUNDER) screen = "entertainment" /datum/file/camnet_key/creed name = "Special Ops Camera Encryption Key" title = "special ops" desc = "Connects to special ops secure camera feeds." - networks = list("CREED") + networks = list(NETWORK_ERT) /datum/file/camnet_key/prison name = "Prison Camera Network Key" title = "prison" desc = "Monitors the prison." - networks = list("Prison") + networks = list(NETWORK_SECURITY) /datum/file/camnet_key/syndicate name = "Camera Network Key" title = "%!#BUFFER OVERFLOW" desc = "Connects to security cameras." - networks = list("SS13") + networks = list("ALL") hidden_file = 1 diff --git a/code/game/machinery/computer3/laptop.dm b/code/game/machinery/computer3/laptop.dm index 65864b0b70..f05fdd9fdb 100644 --- a/code/game/machinery/computer3/laptop.dm +++ b/code/game/machinery/computer3/laptop.dm @@ -106,12 +106,16 @@ pixel_x = 2 pixel_y = -3 show_keyboard = 0 + active_power_usage = 200 // Stationary consoles we use on station have 300, laptops are probably slightly more power efficient + idle_power_usage = 100 var/obj/item/device/laptop/portable = null New(var/L, var/built = 0) if(!built && !battery) battery = new /obj/item/weapon/cell(src) + battery.maxcharge = 500 + battery.charge = 500 ..(L,built) verb/close_computer() diff --git a/code/game/machinery/computer3/lapvend.dm b/code/game/machinery/computer3/lapvend.dm index 0c038b6c87..416472a31a 100644 --- a/code/game/machinery/computer3/lapvend.dm +++ b/code/game/machinery/computer3/lapvend.dm @@ -202,11 +202,11 @@ if (network == 3) newlap.spawn_parts += (/obj/item/part/computer/networking/cable) if (power == 1) - qdel(newlap.battery) - newlap.battery = new /obj/item/weapon/cell/high(newlap) + newlap.battery.maxcharge = 1000 + newlap.battery.charge = 1000 if (power == 2) - qdel(newlap.battery) - newlap.battery = new /obj/item/weapon/cell/super(newlap) + newlap.battery.maxcharge = 1750 + newlap.battery.charge = 1750 newlap.spawn_parts() From 31850054969983c3ae6ae83c79a31bccdd0b630b Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Tue, 11 Aug 2015 13:36:21 +0200 Subject: [PATCH 13/15] Fixes #10410. Fixes #10411. Removes improper code, that would cause spell projectiles to be deleted pre-maturely as well as cast the spell effect all too often. Also removes completely unused code. --- code/modules/projectiles/projectile.dm | 8 +++----- code/modules/spells/spell_projectile.dm | 21 +++++++-------------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 6d8c40c16c..79f4d8f0bb 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -166,12 +166,12 @@ //roll to-hit miss_modifier = max(15*(distance-2) - round(15*accuracy) + miss_modifier, 0) var/hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob)) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss - + var/result = PROJECTILE_FORCE_MISS if(hit_zone) def_zone = hit_zone //set def_zone, so if the projectile ends up hitting someone else later (to be implemented), it is more likely to hit the same part result = target_mob.bullet_act(src, def_zone) - + if(result == PROJECTILE_FORCE_MISS) visible_message("\The [src] misses [target_mob] narrowly!") return 0 @@ -303,6 +303,7 @@ if(loc == get_turf(original)) if(!(original in permutated)) if(Bump(original)) + qdel(src) return if(first_step) @@ -314,9 +315,6 @@ if(!hitscan) sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon -/obj/item/projectile/proc/process_step(first_step = 0) - return - /obj/item/projectile/proc/before_move() return diff --git a/code/modules/spells/spell_projectile.dm b/code/modules/spells/spell_projectile.dm index f3e69b9b6c..c94131b252 100644 --- a/code/modules/spells/spell_projectile.dm +++ b/code/modules/spells/spell_projectile.dm @@ -6,6 +6,7 @@ var/spell/targeted/projectile/carried + penetrating = 0 kill_count = 10 //set by the duration of the spell var/proj_trail = 0 //if it leaves a trail @@ -15,18 +16,15 @@ var/list/trails = new() /obj/item/projectile/spell_projectile/Destroy() - ..() for(var/trail in trails) qdel(trail) + carried = null + return ..() /obj/item/projectile/spell_projectile/ex_act() return /obj/item/projectile/spell_projectile/before_move() - if(carried) - var/list/targets = carried.choose_prox_targets(user = carried.holder, spell_holder = src) - if(targets.len) - src.prox_cast(targets) if(proj_trail && src && src.loc) //pretty trails var/obj/effect/overlay/trail = PoolOrNew(/obj/effect/overlay, src.loc) trails += trail @@ -44,19 +42,14 @@ return /obj/item/projectile/spell_projectile/Bump(var/atom/A) - if(loc) + if(loc && carried) prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src)) - return + return 1 /obj/item/projectile/spell_projectile/on_impact() - if(loc) + if(loc && carried) prox_cast(carried.choose_prox_targets(user = carried.holder, spell_holder = src)) - return + return 1 /obj/item/projectile/spell_projectile/seeking name = "seeking spell" - -/obj/item/projectile/spell_projectile/seeking/process_step() - ..() - if(original && !isnull(src.loc)) - current = original //update the target From cc029828bb1fc406327b6fb147f612b1002bfdd9 Mon Sep 17 00:00:00 2001 From: Karolis2011 Date: Tue, 11 Aug 2015 17:20:55 +0300 Subject: [PATCH 14/15] Updated old wiki link to a new one. --- config/example/rules.html | 2 +- html/templates/header.html | 2 +- nano/templates/TemplatesGuide.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/example/rules.html b/config/example/rules.html index af38d30f91..9fbad55bcf 100644 --- a/config/example/rules.html +++ b/config/example/rules.html @@ -4,7 +4,7 @@ diff --git a/html/templates/header.html b/html/templates/header.html index bd62de1fc5..6f07535bc2 100644 --- a/html/templates/header.html +++ b/html/templates/header.html @@ -25,7 +25,7 @@
Space Station 13
-

+

Code licensed under AGPLv3. Content licensed under CC BY-SA 3.0.

Visit our IRC channel: #bs12 on irc.sorcery.net diff --git a/nano/templates/TemplatesGuide.txt b/nano/templates/TemplatesGuide.txt index 3b042edd0b..f333e45467 100644 --- a/nano/templates/TemplatesGuide.txt +++ b/nano/templates/TemplatesGuide.txt @@ -7,4 +7,4 @@ to easily add conditionals (if statements), loops (for loops) and custom formatt Templates are stored in the /nano/templates folder and the file extension is .tmpl. -This guide is being replaced with a wiki entry, found here: http://baystation12.net/wiki/index.php?title=NanoUI \ No newline at end of file +This guide is being replaced with a wiki entry, found here: http://wiki.baystation12.net/NanoUI \ No newline at end of file From 78ffb5835a3688ab7e19b6b3daf70b7eeb073282 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Tue, 11 Aug 2015 17:33:03 +0200 Subject: [PATCH 15/15] Misc. --- code/modules/mob/freelook/update_triggers.dm | 10 ++----- code/modules/projectiles/projectile.dm | 1 - code/modules/spells/spell_code.dm | 31 ++++++++++---------- 3 files changed, 19 insertions(+), 23 deletions(-) diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index 4527f80879..405e4bdd9e 100644 --- a/code/modules/mob/freelook/update_triggers.dm +++ b/code/modules/mob/freelook/update_triggers.dm @@ -14,8 +14,7 @@ return -1 /turf/simulated/Destroy() - if(ticker) - updateVisibility(src) + updateVisibility(src) ..() /turf/simulated/New() @@ -26,19 +25,16 @@ // STRUCTURES /obj/structure/Destroy() - if(ticker) - updateVisibility(src) + updateVisibility(src) ..() /obj/structure/New() - ..() updateVisibility(src) // EFFECTS /obj/effect/Destroy() - if(ticker) - updateVisibility(src) + updateVisibility(src) return ..() /obj/effect/New() diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 79f4d8f0bb..13b38d66a1 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -303,7 +303,6 @@ if(loc == get_turf(original)) if(!(original in permutated)) if(Bump(original)) - qdel(src) return if(first_step) diff --git a/code/modules/spells/spell_code.dm b/code/modules/spells/spell_code.dm index 2015fde1e0..1e8274757e 100644 --- a/code/modules/spells/spell_code.dm +++ b/code/modules/spells/spell_code.dm @@ -1,9 +1,9 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell - var/name = "Spell" - var/desc = "A spell" - parent_type = /datum + var/name = "Spell" + var/desc = "A spell" + parent_type = /datum var/panel = "Spells"//What panel the proc holder needs to go on. var/school = "evocation" //not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit? @@ -25,7 +25,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now var/range = 7 //the range of the spell; outer radius for aoe spells var/message = "" //whatever it says to the guy affected by it var/selection_type = "view" //can be "range" or "view" - var/atom/movable/holder //where the spell is. Normally the user, can be an item + var/atom/movable/holder //where the spell is. Normally the user, can be an item var/duration = 0 //how long the spell lasts var/list/spell_levels = list(Sp_SPEED = 0, Sp_POWER = 0) //the current spell levels - total spell levels can be obtained by just adding the two values @@ -52,8 +52,8 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now var/hud_state = "" //name of the icon used in generating the spell hud object var/override_base = "" - var/obj/screen/connected_button - + var/obj/screen/connected_button + /////////////////////// ///SETUP AND PROCESS/// /////////////////////// @@ -178,18 +178,19 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now /spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell - if(!(src in user.spell_list) && holder == user) + if(!(src in user.spell_list) && holder == user) + error("[user] utilized the spell '[src]' without having it.") user << "You shouldn't have this spell! Something's wrong." return 0 if(silenced > 0) return - var/turf/user_turf = get_turf(user) - if(!user_turf) - user << "You cannot cast spells in null space!" - - if(spell_flags & Z2NOCAST && (user_turf.z in config.admin_levels)) //Certain spells are not allowed on the centcomm zlevel + var/turf/user_turf = get_turf(user) + if(!user_turf) + user << "You cannot cast spells in null space!" + + if(spell_flags & Z2NOCAST && (user_turf.z in config.admin_levels)) //Certain spells are not allowed on the centcomm zlevel return 0 if(spell_flags & CONSTRUCT_CHECK) @@ -197,7 +198,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(findNullRod(T)) return 0 - if(istype(user, /mob/living/simple_animal) && holder == user) + if(istype(user, /mob/living/simple_animal) && holder == user) var/mob/living/simple_animal/SA = user if(SA.purge) SA << "The nullrod's power interferes with your own!" @@ -206,7 +207,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now if(!src.check_charge(skipcharge, user)) //sees if we can cast based on charges alone return 0 - if(!(spell_flags & GHOSTCAST) && holder == user) + if(!(spell_flags & GHOSTCAST) && holder == user) if(user.stat && !(spell_flags & STATALLOWED)) usr << "Not when you're incapacitated." return 0 @@ -217,7 +218,7 @@ var/list/spells = typesof(/spell) //needed for the badmin verb for now return 0 var/spell/noclothes/spell = locate() in user.spell_list - if((spell_flags & NEEDSCLOTHES) && !(spell && istype(spell)) && holder == user)//clothes check + if((spell_flags & NEEDSCLOTHES) && !(spell && istype(spell)) && holder == user)//clothes check if(!user.wearing_wiz_garb()) return 0