Merge remote-tracking branch 'remotes/git-svn' into bs12_with_tgport
Conflicts: code/controllers/configuration.dm code/game/atoms.dm code/game/gamemodes/changeling/modularchangling.dm code/game/gamemodes/factions.dm code/game/objects/items/devices/uplinks.dm code/game/verbs/ooc.dm code/game/verbs/who.dm code/modules/admin/admin.dm code/modules/admin/admin_verbs.dm code/modules/admin/player_panel.dm code/modules/admin/verbs/adminpm.dm code/modules/admin/verbs/getlogs.dm code/modules/client/client defines.dm code/modules/client/client procs.dm code/modules/mob/living/login.dm code/modules/mob/new_player/preferences_setup.dm code/modules/paperwork/paper.dm config/config.txt html/changelog.html icons/mob/human.dmi icons/mob/human_face.dmi Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
@@ -262,6 +262,7 @@
|
||||
#define FILE_DIR "sound/misc"
|
||||
#define FILE_DIR "sound/music"
|
||||
#define FILE_DIR "sound/piano"
|
||||
#define FILE_DIR "sound/violin"
|
||||
#define FILE_DIR "sound/voice"
|
||||
#define FILE_DIR "sound/weapons"
|
||||
#define FILE_DIR "tools"
|
||||
@@ -675,6 +676,7 @@
|
||||
#include "code\game\objects\items\devices\traitordevices.dm"
|
||||
#include "code\game\objects\items\devices\transfer_valve.dm"
|
||||
#include "code\game\objects\items\devices\uplinks.dm"
|
||||
#include "code\game\objects\items\devices\violin.dm"
|
||||
#include "code\game\objects\items\devices\PDA\cart.dm"
|
||||
#include "code\game\objects\items\devices\PDA\chatroom.dm"
|
||||
#include "code\game\objects\items\devices\PDA\PDA.dm"
|
||||
@@ -705,6 +707,7 @@
|
||||
#include "code\game\objects\items\weapons\cards_ids.dm"
|
||||
#include "code\game\objects\items\weapons\cigs_lighters.dm"
|
||||
#include "code\game\objects\items\weapons\clown_items.dm"
|
||||
#include "code\game\objects\items\weapons\cosmetics.dm"
|
||||
#include "code\game\objects\items\weapons\dice.dm"
|
||||
#include "code\game\objects\items\weapons\dna_injector.dm"
|
||||
#include "code\game\objects\items\weapons\explosives.dm"
|
||||
@@ -851,6 +854,7 @@
|
||||
#include "code\modules\admin\create_mob.dm"
|
||||
#include "code\modules\admin\create_object.dm"
|
||||
#include "code\modules\admin\create_turf.dm"
|
||||
#include "code\modules\admin\holder2.dm"
|
||||
#include "code\modules\admin\IsBanned.dm"
|
||||
#include "code\modules\admin\NewBan.dm"
|
||||
#include "code\modules\admin\newbanjob.dm"
|
||||
@@ -993,7 +997,6 @@
|
||||
#include "code\modules\mob\update_icons.dm"
|
||||
#include "code\modules\mob\dead\death.dm"
|
||||
#include "code\modules\mob\dead\observer\hud.dm"
|
||||
#include "code\modules\mob\dead\observer\login.dm"
|
||||
#include "code\modules\mob\dead\observer\logout.dm"
|
||||
#include "code\modules\mob\dead\observer\observer.dm"
|
||||
#include "code\modules\mob\dead\observer\say.dm"
|
||||
|
||||
@@ -546,12 +546,6 @@ What are the archived variables for?
|
||||
var/old_self_heat_capacity = 0
|
||||
var/old_sharer_heat_capacity = 0
|
||||
|
||||
|
||||
//These two variables have been commented out. The author did not leave documentation on what they were supposed to be for. -Rockdtben
|
||||
//These two variables are only changed and do not exist outside of this proc. -Rockdtben
|
||||
//var/heat_self_to_sharer = 0
|
||||
//var/heat_sharer_to_self = 0
|
||||
|
||||
var/heat_capacity_self_to_sharer = 0
|
||||
var/heat_capacity_sharer_to_self = 0
|
||||
|
||||
@@ -561,28 +555,22 @@ What are the archived variables for?
|
||||
if(delta_air)
|
||||
var/air_heat_capacity = SPECIFIC_HEAT_AIR*delta_air
|
||||
if(delta_air > 0)
|
||||
//heat_self_to_sharer += air_heat_capacity*temperature_archived
|
||||
heat_capacity_self_to_sharer += air_heat_capacity
|
||||
else
|
||||
//heat_sharer_to_self -= air_heat_capacity*sharer.temperature_archived
|
||||
heat_capacity_sharer_to_self -= air_heat_capacity
|
||||
|
||||
if(delta_carbon_dioxide)
|
||||
var/carbon_dioxide_heat_capacity = SPECIFIC_HEAT_CDO*delta_carbon_dioxide
|
||||
if(delta_carbon_dioxide > 0)
|
||||
//heat_self_to_sharer += carbon_dioxide_heat_capacity*temperature_archived
|
||||
heat_capacity_self_to_sharer += carbon_dioxide_heat_capacity
|
||||
else
|
||||
//heat_sharer_to_self -= carbon_dioxide_heat_capacity*sharer.temperature_archived
|
||||
heat_capacity_sharer_to_self -= carbon_dioxide_heat_capacity
|
||||
|
||||
if(delta_toxins)
|
||||
var/toxins_heat_capacity = SPECIFIC_HEAT_TOXIN*delta_toxins
|
||||
if(delta_toxins > 0)
|
||||
//heat_self_to_sharer += toxins_heat_capacity*temperature_archived
|
||||
heat_capacity_self_to_sharer += toxins_heat_capacity
|
||||
else
|
||||
//heat_sharer_to_self -= toxins_heat_capacity*sharer.temperature_archived
|
||||
heat_capacity_sharer_to_self -= toxins_heat_capacity
|
||||
|
||||
old_self_heat_capacity = heat_capacity()*group_multiplier
|
||||
@@ -624,10 +612,8 @@ What are the archived variables for?
|
||||
if(delta)
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
if(delta > 0)
|
||||
//heat_self_to_sharer += individual_heat_capacity*temperature_archived
|
||||
heat_capacity_self_to_sharer += individual_heat_capacity
|
||||
else
|
||||
//heat_sharer_to_self -= individual_heat_capacity*sharer.temperature_archived
|
||||
heat_capacity_sharer_to_self -= individual_heat_capacity
|
||||
|
||||
moved_moles += delta
|
||||
@@ -652,7 +638,6 @@ What are the archived variables for?
|
||||
|
||||
//Guaranteed transfer from sharer to self
|
||||
var/individual_heat_capacity = trace_gas.specific_heat*delta
|
||||
//heat_sharer_to_self += individual_heat_capacity*sharer.temperature_archived
|
||||
heat_capacity_sharer_to_self += individual_heat_capacity
|
||||
|
||||
moved_moles += -delta
|
||||
|
||||
@@ -277,8 +277,7 @@ datum
|
||||
return 1
|
||||
|
||||
process_update_tiles()
|
||||
for(var/turf in tiles_to_update)
|
||||
var/turf/simulated/T = turf
|
||||
for(var/turf/simulated/T in tiles_to_update)
|
||||
T.update_air_properties()
|
||||
/*
|
||||
for(var/obj/movable/floor/O in tiles_to_update)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
Modified DynamicAreaLighting for TGstation - Coded by Carnwennan
|
||||
|
||||
This is TG's 'new' lighting system. It's basically a heavily modified mix of combination of Forum_Account's and
|
||||
This is TG's 'new' lighting system. It's basically a heavily modified combination of Forum_Account's and
|
||||
ShadowDarke's respective lighting libraries. Credits, where due, to them.
|
||||
|
||||
Like sd_DAL (what we used to use), it changes the shading overlays of areas by splitting each type of area into sub-areas
|
||||
@@ -29,7 +29,6 @@
|
||||
mob luminosity will be lower than expected when one of multiple light sources is dropped after exceeding the maximum luminosity
|
||||
Shuttles still do not have support for dynamic lighting (I hope to fix this at some point)
|
||||
No directional lighting support. Fairly easy to add this and the code is ready.
|
||||
When opening airlocks etc, lighting does not always update to account for the change in opacity.
|
||||
*/
|
||||
|
||||
#define LIGHTING_MAX_LUMINOSITY 12 //Hard maximum luminosity to prevet lag which could be caused by coders making mini-suns
|
||||
@@ -272,13 +271,13 @@ area
|
||||
|
||||
proc/SetLightLevel(light)
|
||||
if(!src) return
|
||||
if(light < 0)
|
||||
if(light <= 0)
|
||||
light = 0
|
||||
// luminosity = 0
|
||||
luminosity = 0
|
||||
else
|
||||
if(light > lighting_controller.lighting_states)
|
||||
light = lighting_controller.lighting_states
|
||||
// luminosity = 1
|
||||
luminosity = 1
|
||||
|
||||
if(lighting_overlay)
|
||||
overlays -= lighting_overlay
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
var/kick_inactive = 0 //force disconnect for inactive players
|
||||
var/load_jobs_from_txt = 0
|
||||
var/ToRban = 0
|
||||
var/automute_on = 0 //enables automuting/spam prevention
|
||||
|
||||
var/usealienwhitelist = 0
|
||||
|
||||
@@ -342,10 +343,7 @@
|
||||
if("tor_ban")
|
||||
ToRban = 1
|
||||
|
||||
if("usealienwhitelist")
|
||||
usealienwhitelist = 1
|
||||
|
||||
else
|
||||
if("automute_on") automute_on = 1 if("usealienwhitelist") usealienwhitelist = 1 else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
else if(type == "game_options")
|
||||
|
||||
@@ -53,10 +53,25 @@ datum/controller/vote
|
||||
proc/get_result()
|
||||
//get the highest number of votes
|
||||
var/greatest_votes = 0
|
||||
var/total_votes = 0
|
||||
for(var/option in choices)
|
||||
var/votes = choices[option]
|
||||
total_votes += votes
|
||||
if(votes > greatest_votes)
|
||||
greatest_votes = votes
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/non_voters = (client_list.len - total_votes)
|
||||
if(non_voters > 0)
|
||||
if(mode == "restart")
|
||||
choices["Continue Playing"] += non_voters
|
||||
if(choices["Continue Playing"] >= greatest_votes)
|
||||
greatest_votes = choices["Continue Playing"]
|
||||
else if(mode == "gamemode")
|
||||
if(master_mode in choices)
|
||||
choices[master_mode] += non_voters
|
||||
if(choices[master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[master_mode]
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
|
||||
@@ -487,6 +487,7 @@ datum/mind
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a head revolutionary!</B></FONT>"
|
||||
ticker.mode.update_rev_icons_removed(src)
|
||||
special_role = null
|
||||
log_admin("[key_name_admin(usr)] has de-rev'ed [current].")
|
||||
|
||||
if("rev")
|
||||
if(src in ticker.mode.head_revolutionaries)
|
||||
@@ -500,6 +501,7 @@ datum/mind
|
||||
ticker.mode.revolutionaries += src
|
||||
ticker.mode.update_rev_icons_added(src)
|
||||
special_role = "Revolutionary"
|
||||
log_admin("[key_name(usr)] has rev'ed [current].")
|
||||
|
||||
if("headrev")
|
||||
if(src in ticker.mode.revolutionaries)
|
||||
@@ -524,6 +526,7 @@ datum/mind
|
||||
ticker.mode.head_revolutionaries += src
|
||||
ticker.mode.update_rev_icons_added(src)
|
||||
special_role = "Head Revolutionary"
|
||||
log_admin("[key_name_admin(usr)] has head-rev'ed [current].")
|
||||
|
||||
if("autoobjectives")
|
||||
ticker.mode.forge_revolutionary_objectives(src)
|
||||
@@ -572,6 +575,7 @@ datum/mind
|
||||
cult.memoize_cult_objectives(src)
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a cultist!</B></FONT>"
|
||||
memory = ""
|
||||
log_admin("[key_name_admin(usr)] has de-cult'ed [current].")
|
||||
if("cultist")
|
||||
if(!(src in ticker.mode.cult))
|
||||
ticker.mode.cult += src
|
||||
@@ -582,6 +586,7 @@ datum/mind
|
||||
var/datum/game_mode/cult/cult = ticker.mode
|
||||
if (istype(cult))
|
||||
cult.memoize_cult_objectives(src)
|
||||
log_admin("[key_name_admin(usr)] has cult'ed [current].")
|
||||
if("tome")
|
||||
var/mob/living/carbon/human/H = current
|
||||
if (istype(H))
|
||||
@@ -612,12 +617,14 @@ datum/mind
|
||||
special_role = null
|
||||
current.spellremove(current, config.feature_object_spell_system? "object":"verb")
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a wizard!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-wizard'ed [current].")
|
||||
if("wizard")
|
||||
if(!(src in ticker.mode.wizards))
|
||||
ticker.mode.wizards += src
|
||||
special_role = "Wizard"
|
||||
//ticker.mode.learn_basic_spells(current)
|
||||
current << "<B>\red You are the Space Wizard!</B>"
|
||||
log_admin("[key_name_admin(usr)] has wizard'ed [current].")
|
||||
if("lair")
|
||||
current.loc = pick(wizardstart)
|
||||
if("dressup")
|
||||
@@ -637,12 +644,14 @@ datum/mind
|
||||
current.remove_changeling_powers()
|
||||
if(changeling) del(changeling)
|
||||
current << "<FONT color='red' size = 3><B>You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-changeling'ed [current].")
|
||||
if("changeling")
|
||||
if(!(src in ticker.mode.changelings))
|
||||
ticker.mode.changelings += src
|
||||
ticker.mode.grant_changeling_powers(current)
|
||||
special_role = "Changeling"
|
||||
current << "<B><font color='red'>Your powers are awoken. A flash of memory returns to us...we are a changeling!</font></B>"
|
||||
log_admin("[key_name_admin(usr)] has changeling'ed [current].")
|
||||
if("autoobjectives")
|
||||
ticker.mode.forge_changeling_objectives(src)
|
||||
usr << "\blue The objectives for changeling [key] have been generated. You can edit them and anounce manually."
|
||||
@@ -666,6 +675,7 @@ datum/mind
|
||||
for (var/datum/objective/nuclear/O in objectives)
|
||||
objectives-=O
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a syndicate operative!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-nuke op'ed [current].")
|
||||
if("nuclear")
|
||||
if(!(src in ticker.mode.syndicates))
|
||||
ticker.mode.syndicates += src
|
||||
@@ -678,6 +688,7 @@ datum/mind
|
||||
current << "\blue You are a [syndicate_name()] agent!"
|
||||
ticker.mode.forge_syndicate_objectives(src)
|
||||
ticker.mode.greet_syndicate(src)
|
||||
log_admin("[key_name_admin(usr)] has nuke op'ed [current].")
|
||||
if("lair")
|
||||
current.loc = get_turf(locate("landmark*Syndicate-Spawn"))
|
||||
if("dressup")
|
||||
@@ -713,12 +724,14 @@ datum/mind
|
||||
ticker.mode.traitors -= src
|
||||
special_role = null
|
||||
current << "\red <FONT size = 3><B>You have been brainwashed! You are no longer a traitor!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-traitor'ed [current].")
|
||||
|
||||
if("traitor")
|
||||
if(!(src in ticker.mode.traitors))
|
||||
ticker.mode.traitors += src
|
||||
special_role = "traitor"
|
||||
current << "<B>\red You are a traitor!</B>"
|
||||
log_admin("[key_name_admin(usr)] has traitor'ed [current].")
|
||||
|
||||
if("autoobjectives")
|
||||
ticker.mode.forge_traitor_objectives(src)
|
||||
@@ -798,9 +811,11 @@ datum/mind
|
||||
current.icon_state = "ai"
|
||||
|
||||
current << "\red <FONT size = 3><B>You have been patched! You are no longer malfunctioning!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-malf'ed [current].")
|
||||
|
||||
if("malf")
|
||||
make_AI_Malf()
|
||||
log_admin("[key_name_admin(usr)] has malf'ed [current].")
|
||||
|
||||
if("unemag")
|
||||
var/mob/living/silicon/robot/R = current
|
||||
@@ -817,6 +832,7 @@ datum/mind
|
||||
else if(R.module_state_3 == R.module.emag)
|
||||
R.module_state_3 = null
|
||||
R.contents -= R.module.emag
|
||||
log_admin("[key_name_admin(usr)] has unemag'ed [R].")
|
||||
|
||||
if("unemagcyborgs")
|
||||
if (istype(current, /mob/living/silicon/ai))
|
||||
@@ -835,6 +851,7 @@ datum/mind
|
||||
else if(R.module_state_3 == R.module.emag)
|
||||
R.module_state_3 = null
|
||||
R.contents -= R.module.emag
|
||||
log_admin("[key_name_admin(usr)] has unemag'ed [ai]'s Cyborgs.")
|
||||
|
||||
else if (href_list["common"])
|
||||
switch(href_list["common"])
|
||||
|
||||
@@ -599,7 +599,8 @@
|
||||
/datum/supply_packs/randomised/contraband
|
||||
num_contained = 5
|
||||
contains = list(/obj/item/weapon/contraband/poster,
|
||||
/obj/item/weapon/cigpacket/dromedaryco)
|
||||
/obj/item/weapon/cigpacket/dromedaryco,
|
||||
/obj/item/weapon/lipstick/random)
|
||||
name = "Contraband crate"
|
||||
cost = 30
|
||||
containertype = /obj/structure/closet/crate
|
||||
|
||||
@@ -25,22 +25,6 @@
|
||||
mouse_opacity = 0
|
||||
unacidable = 1//Just to be sure.
|
||||
|
||||
/obj/admins
|
||||
name = "admins"
|
||||
var/rank = null
|
||||
var/owner = null
|
||||
var/state = 1
|
||||
//state = 1 for playing : default
|
||||
//state = 2 for observing
|
||||
var/admincaster_screen = 0 //See newscaster.dm under machinery for a full description
|
||||
var/datum/feed_message/admincaster_feed_message = new /datum/feed_message //These two will act as holders.
|
||||
var/datum/feed_channel/admincaster_feed_channel = new /datum/feed_channel
|
||||
var/admincaster_signature //What you'll sign the newsfeeds as
|
||||
|
||||
/obj/admins/New()
|
||||
src.admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]"
|
||||
..()
|
||||
|
||||
/obj/effect/beam
|
||||
name = "beam"
|
||||
unacidable = 1//Just to be sure.
|
||||
|
||||
@@ -544,7 +544,7 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
else
|
||||
linked = 0
|
||||
|
||||
if (the_client && the_client.holder && the_client.stealth && !include_name)
|
||||
if (the_client && the_client.holder && the_client.holder.fakekey && !include_name)
|
||||
text += "Administrator"
|
||||
else
|
||||
text += "[the_key]"
|
||||
|
||||
@@ -1091,7 +1091,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
|
||||
See the previous More info, for... more info...
|
||||
*/
|
||||
|
||||
if (!( ok ))
|
||||
//del(D) // Garbage Collect Dummy D.loc = null D = null // ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE ------- if (!( ok ))
|
||||
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
|
||||
return 0
|
||||
|
||||
@@ -1355,4 +1355,4 @@ var/list/DummyCache = list()
|
||||
return 0
|
||||
|
||||
/atom/proc/checkpass(passflag)
|
||||
return pass_flags&passflag
|
||||
return pass_flags&passflag/*/client/verb/check_dummy() set name = "List Dummies" set category = "Debug" var/list/dummies = list() for(var/obj/item/weapon/dummy/D in world) usr << "[D] - [D.x], [D.y], [D.z] - [D.loc]" dummies += D usr << "[dummies.len] found!"*/
|
||||
@@ -12,6 +12,16 @@
|
||||
if(!(P in src.verbs))
|
||||
src.verbs += P.verbpath
|
||||
|
||||
if(!powerinstances.len)
|
||||
for(var/P in powers)
|
||||
powerinstances += new P()
|
||||
|
||||
// Code to auto-purchase free powers.
|
||||
for(var/datum/power/changeling/P in powerinstances)
|
||||
if(!P.genomecost) // Is it free?
|
||||
if(!(P in mind.changeling.purchasedpowers)) // Do we not have it already?
|
||||
mind.changeling.purchasePower(P.name)// Purchase it.
|
||||
|
||||
mind.changeling.absorbed_dna |= dna
|
||||
return 1
|
||||
|
||||
@@ -25,29 +35,29 @@
|
||||
|
||||
//Helper proc. Does all the checks and stuff for us to avoid copypasta
|
||||
/mob/proc/changeling_power(var/required_chems=0, var/required_dna=0, var/max_genetic_damage=100, var/max_stat=0)
|
||||
if(!usr) return
|
||||
if(!usr.mind) return
|
||||
if(!iscarbon(usr)) return
|
||||
if(!src) return
|
||||
if(!src.mind) return
|
||||
if(!iscarbon(src)) return
|
||||
|
||||
var/datum/changeling/changeling = usr.mind.changeling
|
||||
var/datum/changeling/changeling = src.mind.changeling
|
||||
if(!changeling)
|
||||
world.log << "[src] has the changeling_transform() verb but is not a changeling."
|
||||
return
|
||||
|
||||
if(usr.stat > max_stat)
|
||||
usr << "<span class='warning'>We are incapacitated.</span>"
|
||||
src << "<span class='warning'>We are incapacitated.</span>"
|
||||
return
|
||||
|
||||
if(changeling.absorbed_dna.len < required_dna)
|
||||
usr << "<span class='warning'>We require at least [required_dna] samples of compatible DNA.</span>"
|
||||
src << "<span class='warning'>We require at least [required_dna] samples of compatible DNA.</span>"
|
||||
return
|
||||
|
||||
if(changeling.chem_charges < required_chems)
|
||||
usr << "<span class='warning'>We require at least [required_chems] units of chemicals to do that!</span>"
|
||||
src << "<span class='warning'>We require at least [required_chems] units of chemicals to do that!</span>"
|
||||
return
|
||||
|
||||
if(changeling.geneticdamage > max_genetic_damage)
|
||||
usr << usr << "<span class='warning'>Our geneomes are still reassembling. We need time to recover first.</span>"
|
||||
src << "<span class='warning'>Our geneomes are still reassembling. We need time to recover first.</span>"
|
||||
return
|
||||
|
||||
return changeling
|
||||
@@ -586,7 +596,7 @@
|
||||
var/mob/living/carbon/T = changeling_sting(30,/mob/proc/changeling_paralysis_sting)
|
||||
if(!T) return 0
|
||||
T << "<span class='danger'>Your muscles begin to painfully tighten.</span>"
|
||||
T.Weaken(10)
|
||||
T.Weaken(20)
|
||||
feedback_add_details("changeling_powers","PS")
|
||||
return 1
|
||||
|
||||
|
||||
@@ -424,18 +424,21 @@ var/list/datum/power/changeling/powerinstances = list()
|
||||
|
||||
|
||||
|
||||
/datum/changeling/proc/purchasePower(var/datum/power/changeling/Pname)
|
||||
/datum/changeling/proc/purchasePower(var/Pname)
|
||||
if(!usr.mind || !usr.mind.changeling)
|
||||
return
|
||||
// src = usr.mind.changeling
|
||||
|
||||
var/datum/power/changeling/Thepower = null
|
||||
var/datum/power/changeling/Thepower = Pname
|
||||
|
||||
|
||||
for (var/datum/power/changeling/P in powerinstances)
|
||||
//world << "[P] - [Pname] = [P.name == Pname ? "True" : "False"]"
|
||||
if(P.name == Pname)
|
||||
Thepower = P
|
||||
break
|
||||
|
||||
|
||||
if(Thepower == null)
|
||||
usr << "This is awkward. Changeling power purchase failed, please report this bug to a coder!"
|
||||
return
|
||||
|
||||
@@ -134,7 +134,7 @@ Whitespace:Seperator;
|
||||
Stealth and Camouflage Items;
|
||||
/obj/item/clothing/under/chameleon:3:Chameleon Jumpsuit;
|
||||
/obj/item/clothing/shoes/syndigaloshes:2:No-Slip Syndicate Shoes;
|
||||
/obj/item/weapon/card/id/syndicate:3:Agent ID card;
|
||||
/obj/item/weapon/card/id/syndicate:2:Agent ID card;
|
||||
/obj/item/clothing/mask/gas/voice:4:Voice Changer;
|
||||
/obj/item/device/chameleon:4:Chameleon-Projector;
|
||||
Whitespace:Seperator;
|
||||
|
||||
@@ -44,7 +44,7 @@ Whitespace:Seperator;
|
||||
Stealth and Camouflage Items;
|
||||
/obj/item/clothing/under/chameleon:3:Chameleon Jumpsuit;
|
||||
/obj/item/clothing/shoes/syndigaloshes:2:No-Slip Syndicate Shoes;
|
||||
/obj/item/weapon/card/id/syndicate:3:Agent ID card;
|
||||
/obj/item/weapon/card/id/syndicate:2:Agent ID card;
|
||||
/obj/item/clothing/mask/gas/voice:4:Voice Changer;
|
||||
/obj/item/device/chameleon:4:Chameleon-Projector;
|
||||
Whitespace:Seperator;
|
||||
|
||||
@@ -138,14 +138,17 @@ Nah
|
||||
return
|
||||
|
||||
var/dat = {"<b>Disposal Pipes</b><br><br>
|
||||
<A href='?src=\ref[src];dmake=0'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];dmake=1'>Bent Pipe</A><BR>
|
||||
<A href='?src=\ref[src];dmake=2'>Junction</A><BR>
|
||||
<A href='?src=\ref[src];dmake=3'>Y-Junction</A><BR>
|
||||
<A href='?src=\ref[src];dmake=4'>Trunk</A><BR>
|
||||
<A href='?src=\ref[src];dmake=5'>Bin</A><BR>
|
||||
<A href='?src=\ref[src];dmake=6'>Outlet</A><BR>
|
||||
<A href='?src=\ref[src];dmake=7'>Chute</A><BR>
|
||||
<A href='?src=\ref[src];ptype=0'>Pipe</A><BR>
|
||||
<A href='?src=\ref[src];ptype=1'>Bent Pipe</A><BR><BR>
|
||||
|
||||
<A href='?src=\ref[src];ptype=2'>Junction</A><BR>
|
||||
<A href='?src=\ref[src];ptype=4'>Y-Junction</A><BR>
|
||||
<A href='?src=\ref[src];ptype=9'>Sorting Junction</A><BR><BR>
|
||||
|
||||
<A href='?src=\ref[src];ptype=5'>Trunk</A><BR>
|
||||
<A href='?src=\ref[src];ptype=6;density=1'>Bin</A><BR>
|
||||
<A href='?src=\ref[src];ptype=7;density=1'>Outlet</A><BR>
|
||||
<A href='?src=\ref[src];ptype=8;density=1'>Chute</A><BR>
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src]</TITLE></HEAD><TT>[dat]</TT>", "window=pipedispenser")
|
||||
@@ -159,33 +162,20 @@ Nah
|
||||
return
|
||||
usr.machine = src
|
||||
src.add_fingerprint(usr)
|
||||
if(href_list["dmake"])
|
||||
if(href_list["ptype"])
|
||||
if(unwrenched || !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
usr << browse(null, "window=pipedispenser")
|
||||
return
|
||||
if(!wait)
|
||||
var/p_type = text2num(href_list["dmake"])
|
||||
var/obj/structure/disposalconstruct/C = new (src.loc)
|
||||
switch(p_type)
|
||||
if(0)
|
||||
C.ptype = 0
|
||||
if(1)
|
||||
C.ptype = 1
|
||||
if(2)
|
||||
C.ptype = 2
|
||||
if(3)
|
||||
C.ptype = 4
|
||||
if(4)
|
||||
C.ptype = 5
|
||||
if(5)
|
||||
C.ptype = 6
|
||||
C.density = 1
|
||||
if(6)
|
||||
C.ptype = 7
|
||||
C.density = 1
|
||||
if(7)
|
||||
C.ptype = 8
|
||||
C.density = 1
|
||||
|
||||
var/p_type = text2num(href_list["ptype"])
|
||||
C.ptype = p_type
|
||||
|
||||
if(href_list["density"])
|
||||
var/p_density = text2num(href_list["density"])
|
||||
C.density = p_density
|
||||
|
||||
C.add_fingerprint(usr)
|
||||
C.update()
|
||||
wait = 1
|
||||
|
||||
@@ -282,7 +282,6 @@ Code:
|
||||
if (43) //Muskets' and Rockdtben's power monitor :D
|
||||
menu = "<h4><img src=pda_power.png> Power Monitors - Please select one</h4><BR>"
|
||||
powmonitor = null
|
||||
powermonitors = null
|
||||
powermonitors = list()
|
||||
var/powercount = 0
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
A.loc = src
|
||||
user << "<span class='notice'>You attach the [item] to the valve controls and secure it.</span>"
|
||||
A.holder = src
|
||||
A.toggle_secure()
|
||||
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
|
||||
|
||||
bombers += "[key_name(user)] attached a [item] to a transfer valve."
|
||||
message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
//This could either be split into the proper DM files or placed somewhere else all together, but it'll do for now -Nodrak
|
||||
|
||||
/*
|
||||
@@ -373,3 +374,380 @@ A list of items and costs is stored under the datum of every game mode, alongsid
|
||||
|
||||
|
||||
|
||||
=======
|
||||
//This could either be split into the proper DM files or placed somewhere else all together, but it'll do for now -Nodrak
|
||||
|
||||
/*
|
||||
|
||||
A list of items and costs is stored under the datum of every game mode, alongside the number of crystals, and the welcoming message.
|
||||
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink
|
||||
var/welcome // Welcoming menu message
|
||||
var/items // List of items
|
||||
var/item_data // raw item text
|
||||
var/list/ItemList // Parsed list of items
|
||||
var/uses // Numbers of crystals
|
||||
// List of items not to shove in their hands.
|
||||
var/list/NotInHand = list(/obj/machinery/singularity_beacon/syndicate)
|
||||
|
||||
/obj/item/device/uplink/New()
|
||||
welcome = ticker.mode.uplink_welcome
|
||||
if(!item_data)
|
||||
items = dd_replacetext(ticker.mode.uplink_items, "\n", "") // Getting the text string of items
|
||||
else
|
||||
items = dd_replacetext(item_data)
|
||||
ItemList = dd_text2list(src.items, ";") // Parsing the items text string
|
||||
uses = ticker.mode.uplink_uses
|
||||
|
||||
//Let's build a menu!
|
||||
/obj/item/device/uplink/proc/generate_menu()
|
||||
|
||||
var/dat = "<B>[src.welcome]</B><BR>"
|
||||
dat += "Tele-Crystals left: [src.uses]<BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<B>Request item:</B><BR>"
|
||||
dat += "<I>Each item costs a number of tele-crystals as indicated by the number following their name.</I><br><BR>"
|
||||
|
||||
var/cost
|
||||
var/item
|
||||
var/name
|
||||
var/path_obj
|
||||
var/path_text
|
||||
var/category_items = 1 //To prevent stupid :P
|
||||
|
||||
for(var/D in ItemList)
|
||||
var/list/O = stringsplit(D, ":")
|
||||
if(O.len != 3) //If it is not an actual item, make a break in the menu.
|
||||
if(O.len == 1) //If there is one item, it's probably a title
|
||||
dat += "<b>[O[1]]</b><br>"
|
||||
category_items = 0
|
||||
else //Else, it's a white space.
|
||||
if(category_items < 1) //If there were no itens in the last category...
|
||||
dat += "<i>We apologize, as you could not afford anything from this category.</i><br>"
|
||||
dat += "<br>"
|
||||
continue
|
||||
|
||||
path_text = O[1]
|
||||
cost = text2num(O[2])
|
||||
|
||||
if(cost>uses)
|
||||
continue
|
||||
|
||||
path_obj = text2path(path_text)
|
||||
item = new path_obj()
|
||||
name = O[3]
|
||||
del item
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=[path_text];cost=[cost]'>[name]</A> ([cost])<BR>"
|
||||
category_items++
|
||||
|
||||
dat += "<A href='byond://?src=\ref[src];buy_item=random'>Random Item (??)</A><br>"
|
||||
dat += "<HR>"
|
||||
return dat
|
||||
|
||||
//If 'random' was selected
|
||||
/obj/item/device/uplink/proc/chooseRandomItem()
|
||||
var/list/randomItems = list()
|
||||
|
||||
//Sorry for all the ifs, but it makes it 1000 times easier for other people/servers to add or remove items from this list
|
||||
//Add only items the player can afford:
|
||||
if(uses > 19)
|
||||
randomItems.Add("/obj/item/weapon/circuitboard/teleporter") //Teleporter Circuit Board (costs 20, for nuke ops)
|
||||
|
||||
if(uses > 9)
|
||||
randomItems.Add("/obj/item/toy/syndicateballoon")//Syndicate Balloon
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_uplink") //Uplink Implanter
|
||||
randomItems.Add("/obj/item/weapon/storage/box/syndicate") //Syndicate bundle
|
||||
|
||||
//if(uses > 8) //Nothing... yet.
|
||||
//if(uses > 7) //Nothing... yet.
|
||||
|
||||
if(uses > 6)
|
||||
randomItems.Add("/obj/item/weapon/aiModule/syndicate") //Hacked AI Upload Module
|
||||
randomItems.Add("/obj/item/device/radio/beacon/syndicate") //Singularity Beacon
|
||||
|
||||
if(uses > 5)
|
||||
randomItems.Add("/obj/item/weapon/gun/projectile") //Revolver
|
||||
|
||||
if(uses > 4)
|
||||
randomItems.Add("/obj/item/weapon/gun/energy/crossbow") //Energy Crossbow
|
||||
randomItems.Add("/obj/item/device/powersink") //Powersink
|
||||
|
||||
if(uses > 3)
|
||||
randomItems.Add("/obj/item/weapon/melee/energy/sword") //Energy Sword
|
||||
randomItems.Add("/obj/item/clothing/mask/gas/voice") //Voice Changer
|
||||
randomItems.Add("/obj/item/device/chameleon") //Chameleon Projector
|
||||
|
||||
if(uses > 2)
|
||||
randomItems.Add("/obj/item/weapon/storage/emp_kit") //EMP Grenades
|
||||
randomItems.Add("/obj/item/weapon/pen/paralysis") //Paralysis Pen
|
||||
randomItems.Add("/obj/item/weapon/cartridge/syndicate") //Detomatix Cartridge
|
||||
randomItems.Add("/obj/item/clothing/under/chameleon") //Chameleon Jumpsuit
|
||||
randomItems.Add("/obj/item/weapon/card/id/syndicate") //Agent ID Card
|
||||
randomItems.Add("/obj/item/weapon/card/emag") //Cryptographic Sequencer
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/space") //Syndicate Space Suit
|
||||
randomItems.Add("/obj/item/device/encryptionkey/binary") //Binary Translator Key
|
||||
randomItems.Add("/obj/item/weapon/storage/syndie_kit/imp_freedom") //Freedom Implant
|
||||
randomItems.Add("/obj/item/clothing/glasses/thermal/syndi") //Thermal Imaging Goggles
|
||||
|
||||
if(uses > 1)
|
||||
/*
|
||||
var/list/usrItems = usr.get_contents() //Checks to see if the user has a revolver before giving ammo
|
||||
var/hasRevolver = 0
|
||||
for(var/obj/I in usrItems) //Only add revolver ammo if the user has a gun that can shoot it
|
||||
if(istype(I,/obj/item/weapon/gun/projectile))
|
||||
hasRevolver = 1
|
||||
|
||||
if(hasRevolver) randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
*/
|
||||
randomItems.Add("/obj/item/ammo_magazine/a357") //Revolver ammo
|
||||
randomItems.Add("/obj/item/clothing/shoes/syndigaloshes") //No-Slip Syndicate Shoes
|
||||
randomItems.Add("/obj/item/weapon/plastique") //C4
|
||||
|
||||
if(uses > 0)
|
||||
randomItems.Add("/obj/item/weapon/soap/syndie") //Syndicate Soap
|
||||
randomItems.Add("/obj/item/weapon/storage/toolbox/syndicate") //Syndicate Toolbox
|
||||
|
||||
if(!randomItems.len)
|
||||
del(randomItems)
|
||||
return 0
|
||||
else
|
||||
var/buyItem = pick(randomItems)
|
||||
|
||||
switch(buyItem) //Ok, this gets a little messy, sorry.
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
uses -= 20
|
||||
if("/obj/item/toy/syndicateballoon" , "/obj/item/weapon/storage/syndie_kit/imp_uplink" , "/obj/item/weapon/storage/box/syndicate")
|
||||
uses -= 10
|
||||
if("/obj/item/weapon/aiModule/syndicate" , "/obj/item/device/radio/beacon/syndicate")
|
||||
uses -= 7
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
uses -= 6
|
||||
if("/obj/item/weapon/gun/energy/crossbow" , "/obj/item/device/powersink")
|
||||
uses -= 5
|
||||
if("/obj/item/weapon/melee/energy/sword" , "/obj/item/clothing/mask/gas/voice" , "/obj/item/device/chameleon")
|
||||
uses -= 4
|
||||
if("/obj/item/weapon/storage/emp_kit" , "/obj/item/weapon/pen/paralysis" , "/obj/item/weapon/cartridge/syndicate" , "/obj/item/clothing/under/chameleon" , \
|
||||
"/obj/item/weapon/card/emag" , "/obj/item/weapon/storage/syndie_kit/space" , "/obj/item/device/encryptionkey/binary" , \
|
||||
"/obj/item/weapon/storage/syndie_kit/imp_freedom" , "/obj/item/clothing/glasses/thermal/syndi")
|
||||
uses -= 3
|
||||
if("/obj/item/ammo_magazine/a357" , "/obj/item/clothing/shoes/syndigaloshes" , "/obj/item/weapon/plastique", "/obj/item/weapon/card/id/syndicate")
|
||||
uses -= 2
|
||||
if("/obj/item/weapon/soap/syndie" , "/obj/item/weapon/storage/toolbox/syndicate")
|
||||
uses -= 1
|
||||
del(randomItems)
|
||||
return buyItem
|
||||
|
||||
/obj/item/device/uplink/proc/handleStatTracking(var/boughtItem)
|
||||
//For stat tracking, sorry for making it so ugly
|
||||
if(!boughtItem) return
|
||||
|
||||
switch(boughtItem)
|
||||
if("/obj/item/weapon/circuitboard/teleporter")
|
||||
feedback_add_details("traitor_uplink_items_bought","TP")
|
||||
if("/obj/item/toy/syndicateballoon")
|
||||
feedback_add_details("traitor_uplink_items_bought","BS")
|
||||
if("/obj/item/weapon/storage/syndie_kit/imp_uplink")
|
||||
feedback_add_details("traitor_uplink_items_bought","UI")
|
||||
if("/obj/item/weapon/storage/box/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","BU")
|
||||
if("/obj/item/weapon/aiModule/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","AI")
|
||||
if("/obj/item/device/radio/beacon/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","SB")
|
||||
if("/obj/item/weapon/gun/projectile")
|
||||
feedback_add_details("traitor_uplink_items_bought","RE")
|
||||
if("/obj/item/weapon/gun/energy/crossbow")
|
||||
feedback_add_details("traitor_uplink_items_bought","XB")
|
||||
if("/obj/item/device/powersink")
|
||||
feedback_add_details("traitor_uplink_items_bought","PS")
|
||||
if("/obj/item/weapon/melee/energy/sword")
|
||||
feedback_add_details("traitor_uplink_items_bought","ES")
|
||||
if("/obj/item/clothing/mask/gas/voice")
|
||||
feedback_add_details("traitor_uplink_items_bought","VC")
|
||||
if("/obj/item/device/chameleon")
|
||||
feedback_add_details("traitor_uplink_items_bought","CP")
|
||||
if("/obj/item/weapon/storage/emp_kit")
|
||||
feedback_add_details("traitor_uplink_items_bought","EM")
|
||||
if("/obj/item/weapon/pen/paralysis")
|
||||
feedback_add_details("traitor_uplink_items_bought","PP")
|
||||
if("/obj/item/weapon/cartridge/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","DC")
|
||||
if("/obj/item/clothing/under/chameleon")
|
||||
feedback_add_details("traitor_uplink_items_bought","CJ")
|
||||
if("/obj/item/weapon/card/id/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","AC")
|
||||
if("/obj/item/weapon/card/emag")
|
||||
feedback_add_details("traitor_uplink_items_bought","EC")
|
||||
if("/obj/item/weapon/storage/syndie_kit/space")
|
||||
feedback_add_details("traitor_uplink_items_bought","SS")
|
||||
if("/obj/item/device/encryptionkey/binary")
|
||||
feedback_add_details("traitor_uplink_items_bought","BT")
|
||||
if("/obj/item/weapon/storage/syndie_kit/imp_freedom")
|
||||
feedback_add_details("traitor_uplink_items_bought","FI")
|
||||
if("/obj/item/clothing/glasses/thermal/syndi")
|
||||
feedback_add_details("traitor_uplink_items_bought","TM")
|
||||
if("/obj/item/ammo_magazine/a357")
|
||||
feedback_add_details("traitor_uplink_items_bought","RA")
|
||||
if("/obj/item/clothing/shoes/syndigaloshes")
|
||||
feedback_add_details("traitor_uplink_items_bought","SH")
|
||||
if("/obj/item/weapon/plastique")
|
||||
feedback_add_details("traitor_uplink_items_bought","C4")
|
||||
if("/obj/item/weapon/soap/syndie")
|
||||
feedback_add_details("traitor_uplink_items_bought","SP")
|
||||
if("/obj/item/weapon/storage/toolbox/syndicate")
|
||||
feedback_add_details("traitor_uplink_items_bought","ST")
|
||||
|
||||
/obj/item/device/uplink/Topic(href, href_list)
|
||||
|
||||
if (href_list["buy_item"])
|
||||
if(href_list["buy_item"] == "random")
|
||||
var/boughtItem = chooseRandomItem()
|
||||
if(boughtItem)
|
||||
href_list["buy_item"] = boughtItem
|
||||
feedback_add_details("traitor_uplink_items_bought","RN")
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
else
|
||||
if(text2num(href_list["cost"]) > uses) // Not enough crystals for the item
|
||||
return 0
|
||||
|
||||
//if(usr:mind && ticker.mode.traitors[usr:mind])
|
||||
//var/datum/traitorinfo/info = ticker.mode.traitors[usr:mind]
|
||||
//info.spawnlist += href_list["buy_item"]
|
||||
|
||||
uses -= text2num(href_list["cost"])
|
||||
handleStatTracking(href_list["buy_item"]) //Note: chooseRandomItem handles it's own stat tracking. This proc is not meant for 'random'.
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
// HIDDEN UPLINK - Can be stored in anything but the host item has to have a trigger for it.
|
||||
/* How to create an uplink in 3 easy steps!
|
||||
|
||||
1. All obj/item 's have a hidden_uplink var. By default it's null. Give the item one with "new(src)", it must be in it's contents. Feel free to add "uses".
|
||||
|
||||
2. Code in the triggers. Use check_trigger for this, I recommend closing the item's menu with "usr << browse(null, "window=windowname") if it returns true.
|
||||
The var/value is the value that will be compared with the var/target. If they are equal it will activate the menu.
|
||||
|
||||
3. If you want the menu to stay until the users locks his uplink, add an active_uplink_check(mob/user as mob) in your interact/attack_hand proc.
|
||||
Then check if it's true, if true return. This will stop the normal menu appearing and will instead show the uplink menu.
|
||||
*/
|
||||
|
||||
/obj/item/device/uplink/hidden
|
||||
name = "Hidden Uplink."
|
||||
desc = "There is something wrong if you're examining this."
|
||||
var/active = 0
|
||||
var/list/purchase_log = list()
|
||||
|
||||
// The hidden uplink MUST be inside an obj/item's contents.
|
||||
/obj/item/device/uplink/hidden/New()
|
||||
spawn(2)
|
||||
if(!istype(src.loc, /obj/item))
|
||||
del(src)
|
||||
..()
|
||||
|
||||
// Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated.
|
||||
/obj/item/device/uplink/hidden/proc/toggle()
|
||||
active = !active
|
||||
|
||||
// Directly trigger the uplink. Turn on if it isn't already.
|
||||
/obj/item/device/uplink/hidden/proc/trigger(mob/user as mob)
|
||||
if(!active)
|
||||
toggle()
|
||||
interact(user)
|
||||
|
||||
// Checks to see if the value meets the target. Like a frequency being a traitor_frequency, in order to unlock a headset.
|
||||
// If true, it accesses trigger() and returns 1. If it fails, it returns false. Use this to see if you need to close the
|
||||
// current item's menu.
|
||||
/obj/item/device/uplink/hidden/proc/check_trigger(mob/user as mob, var/value, var/target)
|
||||
if(value == target)
|
||||
trigger(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// Interaction code. Gathers a list of items purchasable from the paren't uplink and displays it. It also adds a lock button.
|
||||
/obj/item/device/uplink/hidden/proc/interact(mob/user as mob)
|
||||
|
||||
var/dat = "<body link='yellow' alink='white' bgcolor='#601414'><font color='white'>"
|
||||
dat += src.generate_menu()
|
||||
dat += "<A href='byond://?src=\ref[src];lock=1'>Lock</a>"
|
||||
dat += "</font></body>"
|
||||
user << browse(dat, "window=hidden")
|
||||
onclose(user, "hidden")
|
||||
return
|
||||
|
||||
// The purchasing code.
|
||||
/obj/item/device/uplink/hidden/Topic(href, href_list)
|
||||
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
if (!( istype(usr, /mob/living/carbon/human)))
|
||||
return 0
|
||||
|
||||
if ((usr.contents.Find(src.loc) || (in_range(src.loc, usr) && istype(src.loc.loc, /turf))))
|
||||
usr.machine = src
|
||||
if(href_list["lock"])
|
||||
toggle()
|
||||
usr << browse(null, "window=hidden")
|
||||
return 1
|
||||
|
||||
if(..(href, href_list) == 1)
|
||||
var/path_obj = text2path(href_list["buy_item"])
|
||||
var/obj/I = new path_obj(get_turf(usr))
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/A = usr
|
||||
A.put_in_any_hand_if_possible(I)
|
||||
purchase_log += "[usr] ([usr.ckey]) bought [I]."
|
||||
interact(usr)
|
||||
return
|
||||
|
||||
// I placed this here because of how relevant it is.
|
||||
// You place this in your uplinkable item to check if an uplink is active or not.
|
||||
// If it is, it will display the uplink menu and return 1, else it'll return false.
|
||||
// If it returns true, I recommend closing the item's normal menu with "user << browse(null, "window=name")"
|
||||
/obj/item/proc/active_uplink_check(mob/user as mob)
|
||||
// Activates the uplink if it's active
|
||||
if(src.hidden_uplink)
|
||||
if(src.hidden_uplink.active)
|
||||
src.hidden_uplink.trigger(user)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
// PRESET UPLINKS
|
||||
// A collection of preset uplinks.
|
||||
//
|
||||
// Includes normal radio uplink, multitool uplink,
|
||||
// implant uplink (not the implant tool) and a preset headset uplink.
|
||||
|
||||
/obj/item/device/radio/uplink/New()
|
||||
hidden_uplink = new(src)
|
||||
icon_state = "radio"
|
||||
|
||||
/obj/item/device/radio/uplink/attack_self(mob/user as mob)
|
||||
if(hidden_uplink)
|
||||
hidden_uplink.trigger(user)
|
||||
|
||||
/obj/item/device/multitool/uplink/New()
|
||||
hidden_uplink = new(src)
|
||||
|
||||
/obj/item/device/multitool/uplink/attack_self(mob/user as mob)
|
||||
if(hidden_uplink)
|
||||
hidden_uplink.trigger(user)
|
||||
|
||||
/obj/item/device/radio/headset/uplink
|
||||
traitor_frequency = 1445
|
||||
|
||||
/obj/item/device/radio/headset/uplink/New()
|
||||
..()
|
||||
hidden_uplink = new(src)
|
||||
hidden_uplink.uses = 10
|
||||
|
||||
|
||||
|
||||
>>>>>>> remotes/git-svn
|
||||
|
||||
393
code/game/objects/items/devices/violin.dm
Normal file
@@ -0,0 +1,393 @@
|
||||
//copy pasta of the space piano, don't hurt me -Pete
|
||||
|
||||
/obj/item/device/violin
|
||||
name = "space violin"
|
||||
desc = "A wooden musical instrument with four strings and a bow. \"The devil went down to space, he was looking for an assistant to grief.\""
|
||||
icon = 'icons/obj/musician.dmi'
|
||||
icon_state = "violin"
|
||||
item_state = "violin"
|
||||
force = 10
|
||||
var/datum/song/song
|
||||
var/playing = 0
|
||||
var/help = 0
|
||||
var/edit = 1
|
||||
var/repeat = 0
|
||||
|
||||
/obj/item/device/violin/proc/playnote(var/note as text)
|
||||
//world << "Note: [note]"
|
||||
var/soundfile
|
||||
/*BYOND loads resource files at compile time if they are ''. This means you can't really manipulate them dynamically.
|
||||
Tried doing it dynamically at first but its more trouble than its worth. Would have saved many lines tho.*/
|
||||
switch(note)
|
||||
if("Cn1") soundfile = 'sound/violin/Cn1.ogg'
|
||||
if("C#1") soundfile = 'sound/violin/C#1.ogg'
|
||||
if("Db1") soundfile = 'sound/violin/Db1.ogg'
|
||||
if("Dn1") soundfile = 'sound/violin/Dn1.ogg'
|
||||
if("D#1") soundfile = 'sound/violin/D#1.ogg'
|
||||
if("Eb1") soundfile = 'sound/violin/Eb1.ogg'
|
||||
if("En1") soundfile = 'sound/violin/En1.ogg'
|
||||
if("E#1") soundfile = 'sound/violin/E#1.ogg'
|
||||
if("Fb1") soundfile = 'sound/violin/Fb1.ogg'
|
||||
if("Fn1") soundfile = 'sound/violin/Fn1.ogg'
|
||||
if("F#1") soundfile = 'sound/violin/F#1.ogg'
|
||||
if("Gb1") soundfile = 'sound/violin/Gb1.ogg'
|
||||
if("Gn1") soundfile = 'sound/violin/Gn1.ogg'
|
||||
if("G#1") soundfile = 'sound/violin/G#1.ogg'
|
||||
if("Ab1") soundfile = 'sound/violin/Ab1.ogg'
|
||||
if("An1") soundfile = 'sound/violin/An1.ogg'
|
||||
if("A#1") soundfile = 'sound/violin/A#1.ogg'
|
||||
if("Bb1") soundfile = 'sound/violin/Bb1.ogg'
|
||||
if("Bn1") soundfile = 'sound/violin/Bn1.ogg'
|
||||
if("B#1") soundfile = 'sound/violin/B#1.ogg'
|
||||
if("Cb2") soundfile = 'sound/violin/Cb2.ogg'
|
||||
if("Cn2") soundfile = 'sound/violin/Cn2.ogg'
|
||||
if("C#2") soundfile = 'sound/violin/C#2.ogg'
|
||||
if("Db2") soundfile = 'sound/violin/Db2.ogg'
|
||||
if("Dn2") soundfile = 'sound/violin/Dn2.ogg'
|
||||
if("D#2") soundfile = 'sound/violin/D#2.ogg'
|
||||
if("Eb2") soundfile = 'sound/violin/Eb2.ogg'
|
||||
if("En2") soundfile = 'sound/violin/En2.ogg'
|
||||
if("E#2") soundfile = 'sound/violin/E#2.ogg'
|
||||
if("Fb2") soundfile = 'sound/violin/Fb2.ogg'
|
||||
if("Fn2") soundfile = 'sound/violin/Fn2.ogg'
|
||||
if("F#2") soundfile = 'sound/violin/F#2.ogg'
|
||||
if("Gb2") soundfile = 'sound/violin/Gb2.ogg'
|
||||
if("Gn2") soundfile = 'sound/violin/Gn2.ogg'
|
||||
if("G#2") soundfile = 'sound/violin/G#2.ogg'
|
||||
if("Ab2") soundfile = 'sound/violin/Ab2.ogg'
|
||||
if("An2") soundfile = 'sound/violin/An2.ogg'
|
||||
if("A#2") soundfile = 'sound/violin/A#2.ogg'
|
||||
if("Bb2") soundfile = 'sound/violin/Bb2.ogg'
|
||||
if("Bn2") soundfile = 'sound/violin/Bn2.ogg'
|
||||
if("B#2") soundfile = 'sound/violin/B#2.ogg'
|
||||
if("Cb3") soundfile = 'sound/violin/Cb3.ogg'
|
||||
if("Cn3") soundfile = 'sound/violin/Cn3.ogg'
|
||||
if("C#3") soundfile = 'sound/violin/C#3.ogg'
|
||||
if("Db3") soundfile = 'sound/violin/Db3.ogg'
|
||||
if("Dn3") soundfile = 'sound/violin/Dn3.ogg'
|
||||
if("D#3") soundfile = 'sound/violin/D#3.ogg'
|
||||
if("Eb3") soundfile = 'sound/violin/Eb3.ogg'
|
||||
if("En3") soundfile = 'sound/violin/En3.ogg'
|
||||
if("E#3") soundfile = 'sound/violin/E#3.ogg'
|
||||
if("Fb3") soundfile = 'sound/violin/Fb3.ogg'
|
||||
if("Fn3") soundfile = 'sound/violin/Fn3.ogg'
|
||||
if("F#3") soundfile = 'sound/violin/F#3.ogg'
|
||||
if("Gb3") soundfile = 'sound/violin/Gb3.ogg'
|
||||
if("Gn3") soundfile = 'sound/violin/Gn3.ogg'
|
||||
if("G#3") soundfile = 'sound/violin/G#3.ogg'
|
||||
if("Ab3") soundfile = 'sound/violin/Ab3.ogg'
|
||||
if("An3") soundfile = 'sound/violin/An3.ogg'
|
||||
if("A#3") soundfile = 'sound/violin/A#3.ogg'
|
||||
if("Bb3") soundfile = 'sound/violin/Bb3.ogg'
|
||||
if("Bn3") soundfile = 'sound/violin/Bn3.ogg'
|
||||
if("B#3") soundfile = 'sound/violin/B#3.ogg'
|
||||
if("Cb4") soundfile = 'sound/violin/Cb4.ogg'
|
||||
if("Cn4") soundfile = 'sound/violin/Cn4.ogg'
|
||||
if("C#4") soundfile = 'sound/violin/C#4.ogg'
|
||||
if("Db4") soundfile = 'sound/violin/Db4.ogg'
|
||||
if("Dn4") soundfile = 'sound/violin/Dn4.ogg'
|
||||
if("D#4") soundfile = 'sound/violin/D#4.ogg'
|
||||
if("Eb4") soundfile = 'sound/violin/Eb4.ogg'
|
||||
if("En4") soundfile = 'sound/violin/En4.ogg'
|
||||
if("E#4") soundfile = 'sound/violin/E#4.ogg'
|
||||
if("Fb4") soundfile = 'sound/violin/Fb4.ogg'
|
||||
if("Fn4") soundfile = 'sound/violin/Fn4.ogg'
|
||||
if("F#4") soundfile = 'sound/violin/F#4.ogg'
|
||||
if("Gb4") soundfile = 'sound/violin/Gb4.ogg'
|
||||
if("Gn4") soundfile = 'sound/violin/Gn4.ogg'
|
||||
if("G#4") soundfile = 'sound/violin/G#4.ogg'
|
||||
if("Ab4") soundfile = 'sound/violin/Ab4.ogg'
|
||||
if("An4") soundfile = 'sound/violin/An4.ogg'
|
||||
if("A#4") soundfile = 'sound/violin/A#4.ogg'
|
||||
if("Bb4") soundfile = 'sound/violin/Bb4.ogg'
|
||||
if("Bn4") soundfile = 'sound/violin/Bn4.ogg'
|
||||
if("B#4") soundfile = 'sound/violin/B#4.ogg'
|
||||
if("Cb5") soundfile = 'sound/violin/Cb5.ogg'
|
||||
if("Cn5") soundfile = 'sound/violin/Cn5.ogg'
|
||||
if("C#5") soundfile = 'sound/violin/C#5.ogg'
|
||||
if("Db5") soundfile = 'sound/violin/Db5.ogg'
|
||||
if("Dn5") soundfile = 'sound/violin/Dn5.ogg'
|
||||
if("D#5") soundfile = 'sound/violin/D#5.ogg'
|
||||
if("Eb5") soundfile = 'sound/violin/Eb5.ogg'
|
||||
if("En5") soundfile = 'sound/violin/En5.ogg'
|
||||
if("E#5") soundfile = 'sound/violin/E#5.ogg'
|
||||
if("Fb5") soundfile = 'sound/violin/Fb5.ogg'
|
||||
if("Fn5") soundfile = 'sound/violin/Fn5.ogg'
|
||||
if("F#5") soundfile = 'sound/violin/F#5.ogg'
|
||||
if("Gb5") soundfile = 'sound/violin/Gb5.ogg'
|
||||
if("Gn5") soundfile = 'sound/violin/Gn5.ogg'
|
||||
if("G#5") soundfile = 'sound/violin/G#5.ogg'
|
||||
if("Ab5") soundfile = 'sound/violin/Ab5.ogg'
|
||||
if("An5") soundfile = 'sound/violin/An5.ogg'
|
||||
if("A#5") soundfile = 'sound/violin/A#5.ogg'
|
||||
if("Bb5") soundfile = 'sound/violin/Bb5.ogg'
|
||||
if("Bn5") soundfile = 'sound/violin/Bn5.ogg'
|
||||
if("B#5") soundfile = 'sound/violin/B#5.ogg'
|
||||
if("Cb6") soundfile = 'sound/violin/Cb6.ogg'
|
||||
if("Cn6") soundfile = 'sound/violin/Cn6.ogg'
|
||||
if("C#6") soundfile = 'sound/violin/C#6.ogg'
|
||||
if("Db6") soundfile = 'sound/violin/Db6.ogg'
|
||||
if("Dn6") soundfile = 'sound/violin/Dn6.ogg'
|
||||
if("D#6") soundfile = 'sound/violin/D#6.ogg'
|
||||
if("Eb6") soundfile = 'sound/violin/Eb6.ogg'
|
||||
if("En6") soundfile = 'sound/violin/En6.ogg'
|
||||
if("E#6") soundfile = 'sound/violin/E#6.ogg'
|
||||
if("Fb6") soundfile = 'sound/violin/Fb6.ogg'
|
||||
if("Fn6") soundfile = 'sound/violin/Fn6.ogg'
|
||||
if("F#6") soundfile = 'sound/violin/F#6.ogg'
|
||||
if("Gb6") soundfile = 'sound/violin/Gb6.ogg'
|
||||
if("Gn6") soundfile = 'sound/violin/Gn6.ogg'
|
||||
if("G#6") soundfile = 'sound/violin/G#6.ogg'
|
||||
if("Ab6") soundfile = 'sound/violin/Ab6.ogg'
|
||||
if("An6") soundfile = 'sound/violin/An6.ogg'
|
||||
if("A#6") soundfile = 'sound/violin/A#6.ogg'
|
||||
if("Bb6") soundfile = 'sound/violin/Bb6.ogg'
|
||||
if("Bn6") soundfile = 'sound/violin/Bn6.ogg'
|
||||
if("B#6") soundfile = 'sound/violin/B#6.ogg'
|
||||
if("Cb7") soundfile = 'sound/violin/Cb7.ogg'
|
||||
if("Cn7") soundfile = 'sound/violin/Cn7.ogg'
|
||||
if("C#7") soundfile = 'sound/violin/C#7.ogg'
|
||||
if("Db7") soundfile = 'sound/violin/Db7.ogg'
|
||||
if("Dn7") soundfile = 'sound/violin/Dn7.ogg'
|
||||
if("D#7") soundfile = 'sound/violin/D#7.ogg'
|
||||
if("Eb7") soundfile = 'sound/violin/Eb7.ogg'
|
||||
if("En7") soundfile = 'sound/violin/En7.ogg'
|
||||
if("E#7") soundfile = 'sound/violin/E#7.ogg'
|
||||
if("Fb7") soundfile = 'sound/violin/Fb7.ogg'
|
||||
if("Fn7") soundfile = 'sound/violin/Fn7.ogg'
|
||||
if("F#7") soundfile = 'sound/violin/F#7.ogg'
|
||||
if("Gb7") soundfile = 'sound/violin/Gb7.ogg'
|
||||
if("Gn7") soundfile = 'sound/violin/Gn7.ogg'
|
||||
if("G#7") soundfile = 'sound/violin/G#7.ogg'
|
||||
if("Ab7") soundfile = 'sound/violin/Ab7.ogg'
|
||||
if("An7") soundfile = 'sound/violin/An7.ogg'
|
||||
if("A#7") soundfile = 'sound/violin/A#7.ogg'
|
||||
if("Bb7") soundfile = 'sound/violin/Bb7.ogg'
|
||||
if("Bn7") soundfile = 'sound/violin/Bn7.ogg'
|
||||
if("B#7") soundfile = 'sound/violin/B#7.ogg'
|
||||
if("Cb8") soundfile = 'sound/violin/Cb8.ogg'
|
||||
if("Cn8") soundfile = 'sound/violin/Cn8.ogg'
|
||||
if("C#8") soundfile = 'sound/violin/C#8.ogg'
|
||||
if("Db8") soundfile = 'sound/violin/Db8.ogg'
|
||||
if("Dn8") soundfile = 'sound/violin/Dn8.ogg'
|
||||
if("D#8") soundfile = 'sound/violin/D#8.ogg'
|
||||
if("Eb8") soundfile = 'sound/violin/Eb8.ogg'
|
||||
if("En8") soundfile = 'sound/violin/En8.ogg'
|
||||
if("E#8") soundfile = 'sound/violin/E#8.ogg'
|
||||
if("Fb8") soundfile = 'sound/violin/Fb8.ogg'
|
||||
if("Fn8") soundfile = 'sound/violin/Fn8.ogg'
|
||||
if("F#8") soundfile = 'sound/violin/F#8.ogg'
|
||||
if("Gb8") soundfile = 'sound/violin/Gb8.ogg'
|
||||
if("Gn8") soundfile = 'sound/violin/Gn8.ogg'
|
||||
if("G#8") soundfile = 'sound/violin/G#8.ogg'
|
||||
if("Ab8") soundfile = 'sound/violin/Ab8.ogg'
|
||||
if("An8") soundfile = 'sound/violin/An8.ogg'
|
||||
if("A#8") soundfile = 'sound/violin/A#8.ogg'
|
||||
if("Bb8") soundfile = 'sound/violin/Bb8.ogg'
|
||||
if("Bn8") soundfile = 'sound/violin/Bn8.ogg'
|
||||
if("B#8") soundfile = 'sound/violin/B#8.ogg'
|
||||
if("Cb9") soundfile = 'sound/violin/Cb9.ogg'
|
||||
if("Cn9") soundfile = 'sound/violin/Cn9.ogg'
|
||||
else return
|
||||
|
||||
hearers(15, get_turf(src)) << sound(soundfile)
|
||||
|
||||
/obj/item/device/violin/proc/playsong()
|
||||
do
|
||||
var/cur_oct[7]
|
||||
var/cur_acc[7]
|
||||
for(var/i = 1 to 7)
|
||||
cur_oct[i] = "3"
|
||||
cur_acc[i] = "n"
|
||||
|
||||
for(var/line in song.lines)
|
||||
//world << line
|
||||
for(var/beat in dd_text2list(lowertext(line), ","))
|
||||
//world << "beat: [beat]"
|
||||
var/list/notes = dd_text2list(beat, "/")
|
||||
for(var/note in dd_text2list(notes[1], "-"))
|
||||
//world << "note: [note]"
|
||||
if(!playing || !isliving(loc))//If the violin is playing, or isn't held by a person
|
||||
playing = 0
|
||||
return
|
||||
if(lentext(note) == 0)
|
||||
continue
|
||||
//world << "Parse: [copytext(note,1,2)]"
|
||||
var/cur_note = text2ascii(note) - 96
|
||||
if(cur_note < 1 || cur_note > 7)
|
||||
continue
|
||||
for(var/i=2 to lentext(note))
|
||||
var/ni = copytext(note,i,i+1)
|
||||
if(!text2num(ni))
|
||||
if(ni == "#" || ni == "b" || ni == "n")
|
||||
cur_acc[cur_note] = ni
|
||||
else if(ni == "s")
|
||||
cur_acc[cur_note] = "#" // so shift is never required
|
||||
else
|
||||
cur_oct[cur_note] = ni
|
||||
playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note])
|
||||
if(notes.len >= 2 && text2num(notes[2]))
|
||||
sleep(song.tempo / text2num(notes[2]))
|
||||
else
|
||||
sleep(song.tempo)
|
||||
if(repeat > 0)
|
||||
repeat-- //Infinite loops are baaaad.
|
||||
while(repeat > 0)
|
||||
playing = 0
|
||||
|
||||
/obj/item/device/violin/attack_self(mob/user as mob)
|
||||
if(!isliving(user) || user.stat || user.restrained() || user.lying) return
|
||||
user.machine = src
|
||||
|
||||
var/dat = "<HEAD><TITLE>Violin</TITLE></HEAD><BODY>"
|
||||
|
||||
if(song)
|
||||
if(song.lines.len > 0 && !(playing))
|
||||
dat += "<A href='?src=\ref[src];play=1'>Play Song</A><BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];repeat=1'>Repeat Song: [repeat] times.</A><BR><BR>"
|
||||
if(playing)
|
||||
dat += "<A href='?src=\ref[src];stop=1'>Stop Playing</A><BR>"
|
||||
dat += "Repeats left: [repeat].<BR><BR>"
|
||||
if(!edit)
|
||||
dat += "<A href='?src=\ref[src];edit=2'>Show Editor</A><BR><BR>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];edit=1'>Hide Editor</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];newsong=1'>Start a New Song</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];import=1'>Import a Song</A><BR><BR>"
|
||||
if(song)
|
||||
var/calctempo = (10/song.tempo)*60
|
||||
dat += "Tempo : <A href='?src=\ref[src];tempo=10'>-</A><A href='?src=\ref[src];tempo=1'>-</A> [calctempo] BPM <A href='?src=\ref[src];tempo=-1'>+</A><A href='?src=\ref[src];tempo=-10'>+</A><BR><BR>"
|
||||
var/linecount = 0
|
||||
for(var/line in song.lines)
|
||||
linecount += 1
|
||||
dat += "Line [linecount]: [line] <A href='?src=\ref[src];deleteline=[linecount]'>Delete Line</A> <A href='?src=\ref[src];modifyline=[linecount]'>Modify Line</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];newline=1'>Add Line</A><BR><BR>"
|
||||
if(help)
|
||||
dat += "<A href='?src=\ref[src];help=1'>Hide Help</A><BR>"
|
||||
dat += {"
|
||||
Lines are a series of chords, separated by commas (,), each with notes seperated by hyphens (-).<br>
|
||||
Every note in a chord will play together, with chord timed by the tempo.<br>
|
||||
<br>
|
||||
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
|
||||
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
|
||||
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
|
||||
After a note has an accidental placed, it will be remembered: <i>C,C4,C,C3</i> is C3,C4,C4,C3</i><br>
|
||||
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#,Gn-B</i><br>
|
||||
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
|
||||
To make a chord be a different time, end it with /x, where the chord length will be length<br>
|
||||
defined by tempo / x: <i>C,G/2,E/4</i><br>
|
||||
Combined, an example is: <i>E-E4/4,/2,G#/8,B/8,E3-E4/4</i>
|
||||
<br>
|
||||
Lines may be up to 50 characters.<br>
|
||||
A song may only contain up to 50 lines.<br>
|
||||
"}
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];help=2'>Show Help</A><BR>"
|
||||
dat += "</BODY></HTML>"
|
||||
user << browse(dat, "window=violin;size=700x300")
|
||||
onclose(user, "violin")
|
||||
|
||||
/obj/item/device/violin/Topic(href, href_list)
|
||||
|
||||
if(!in_range(src, usr) || issilicon(usr) || !isliving(usr) || !usr.canmove || usr.restrained())
|
||||
usr << browse(null, "window=violin;size=700x300")
|
||||
onclose(usr, "violin")
|
||||
return
|
||||
|
||||
if(href_list["newsong"])
|
||||
song = new()
|
||||
else if(song)
|
||||
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
|
||||
if(playing) return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing.
|
||||
var/tempnum = input("How many times do you want to repeat this piece? (max:10)") as num|null
|
||||
if(tempnum > 10)
|
||||
tempnum = 10
|
||||
if(tempnum < 0)
|
||||
tempnum = 0
|
||||
repeat = round(tempnum)
|
||||
|
||||
else if(href_list["tempo"])
|
||||
song.tempo += round(text2num(href_list["tempo"]))
|
||||
if(song.tempo < 1)
|
||||
song.tempo = 1
|
||||
|
||||
else if(href_list["play"])
|
||||
if(song)
|
||||
playing = 1
|
||||
spawn() playsong()
|
||||
|
||||
else if(href_list["newline"])
|
||||
var/newline = html_encode(input("Enter your line: ", "violin") as text|null)
|
||||
if(!newline)
|
||||
return
|
||||
if(song.lines.len > 50)
|
||||
return
|
||||
if(lentext(newline) > 50)
|
||||
newline = copytext(newline, 1, 50)
|
||||
song.lines.Add(newline)
|
||||
|
||||
else if(href_list["deleteline"])
|
||||
var/num = round(text2num(href_list["deleteline"]))
|
||||
if(num > song.lines.len || num < 1)
|
||||
return
|
||||
song.lines.Cut(num, num+1)
|
||||
|
||||
else if(href_list["modifyline"])
|
||||
var/num = round(text2num(href_list["modifyline"]),1)
|
||||
var/content = html_encode(input("Enter your line: ", "violin", song.lines[num]) as text|null)
|
||||
if(!content)
|
||||
return
|
||||
if(lentext(content) > 50)
|
||||
content = copytext(content, 1, 50)
|
||||
if(num > song.lines.len || num < 1)
|
||||
return
|
||||
song.lines[num] = content
|
||||
|
||||
else if(href_list["stop"])
|
||||
playing = 0
|
||||
|
||||
else if(href_list["help"])
|
||||
help = text2num(href_list["help"]) - 1
|
||||
|
||||
else if(href_list["edit"])
|
||||
edit = text2num(href_list["edit"]) - 1
|
||||
|
||||
else if(href_list["import"])
|
||||
var/t = ""
|
||||
do
|
||||
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
|
||||
if(!in_range(src, usr))
|
||||
return
|
||||
|
||||
if(lentext(t) >= 3072)
|
||||
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
|
||||
if(cont == "no")
|
||||
break
|
||||
while(lentext(t) > 3072)
|
||||
|
||||
//split into lines
|
||||
spawn()
|
||||
var/list/lines = dd_text2list(t, "\n")
|
||||
var/tempo = 5
|
||||
if(copytext(lines[1],1,6) == "BPM: ")
|
||||
tempo = 600 / text2num(copytext(lines[1],6))
|
||||
lines.Cut(1,2)
|
||||
if(lines.len > 50)
|
||||
usr << "Too many lines!"
|
||||
lines.Cut(51)
|
||||
var/linenum = 1
|
||||
for(var/l in lines)
|
||||
if(lentext(l) > 50)
|
||||
usr << "Line [linenum] too long!"
|
||||
lines.Remove(l)
|
||||
else
|
||||
linenum++
|
||||
song = new()
|
||||
song.lines = lines
|
||||
song.tempo = tempo
|
||||
|
||||
add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, loc))
|
||||
if((M.client && M.machine == src))
|
||||
attack_self(M)
|
||||
return
|
||||
87
code/game/objects/items/weapons/cosmetics.dm
Normal file
@@ -0,0 +1,87 @@
|
||||
/obj/item/weapon/lipstick
|
||||
name = "red lipstick"
|
||||
desc = "A generic brand of lipstick."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "lipstick"
|
||||
flags = FPRINT | TABLEPASS
|
||||
w_class = 1.0
|
||||
var/colour = "red"
|
||||
var/open = 0
|
||||
|
||||
|
||||
/obj/item/weapon/lipstick/purple
|
||||
name = "purple lipstick"
|
||||
colour = "purple"
|
||||
|
||||
/obj/item/weapon/lipstick/jade
|
||||
name = "jade lipstick"
|
||||
colour = "jade"
|
||||
|
||||
/obj/item/weapon/lipstick/black
|
||||
name = "black lipstick"
|
||||
colour = "black"
|
||||
|
||||
|
||||
/obj/item/weapon/lipstick/random
|
||||
name = "lipstick"
|
||||
|
||||
/obj/item/weapon/lipstick/random/New()
|
||||
colour = pick("red","purple","jade","black")
|
||||
name = "[colour] lipstick"
|
||||
|
||||
|
||||
/obj/item/weapon/lipstick/attack_self(mob/user as mob)
|
||||
user << "<span class='notice'>You twist \the [src] [open ? "closed" : "open"].</span>"
|
||||
open = !open
|
||||
if(open)
|
||||
icon_state = "[initial(icon_state)]_[colour]"
|
||||
else
|
||||
icon_state = initial(icon_state)
|
||||
|
||||
/obj/item/weapon/lipstick/attack(mob/M as mob, mob/user as mob)
|
||||
if(!open) return
|
||||
|
||||
if(!istype(M, /mob)) return
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.lip_style) //if they already have lipstick on
|
||||
user << "<span class='notice'>You need to wipe off the old lipstick first!</span>"
|
||||
return
|
||||
if(H == user)
|
||||
user.visible_message("<span class='notice'>[user] does their lips with \the [src].</span>", \
|
||||
"<span class='notice'>You take a moment to apply \the [src]. Perfect!</span>")
|
||||
H.lip_style = colour
|
||||
H.update_body()
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] begins to do [H]'s lips with \the [src].</span>", \
|
||||
"<span class='notice'>You begin to apply \the [src].</span>")
|
||||
if(do_after(user, 20) && do_after(H, 20, 5, 0)) //user needs to keep their active hand, H does not.
|
||||
user.visible_message("<span class='notice'>[user] does [H]'s lips with \the [src].</span>", \
|
||||
"<span class='notice'>You apply \the [src].</span>")
|
||||
H.lip_style = colour
|
||||
H.update_body()
|
||||
else
|
||||
user << "<span class='notice'>Where are the lips on that?</span>"
|
||||
|
||||
//you can wipe off lipstick with paper!
|
||||
/obj/item/weapon/paper/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(user.zone_sel.selecting == "mouth")
|
||||
if(!istype(M, /mob)) return
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H == user)
|
||||
user << "<span class='notice'>You wipe off the lipstick with [src].</span>"
|
||||
H.lip_style = null
|
||||
H.update_body()
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] begins to wipe [H]'s lipstick off with \the [src].</span>", \
|
||||
"<span class='notice'>You begin to wipe off [H]'s lipstick.</span>")
|
||||
if(do_after(user, 10) && do_after(H, 10, 5, 0)) //user needs to keep their active hand, H does not.
|
||||
user.visible_message("<span class='notice'>[user] wipes [H]'s lipstick off with \the [src].</span>", \
|
||||
"<span class='notice'>You wipe off [H]'s lipstick.</span>")
|
||||
H.lip_style = null
|
||||
H.update_body()
|
||||
else
|
||||
..()
|
||||
@@ -3,8 +3,6 @@
|
||||
name = "mop"
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "mop"
|
||||
var/mopping = 0
|
||||
var/mopcount = 0
|
||||
force = 3.0
|
||||
throwforce = 10.0
|
||||
throw_speed = 5
|
||||
@@ -12,6 +10,8 @@
|
||||
w_class = 3.0
|
||||
flags = FPRINT | TABLEPASS
|
||||
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
|
||||
var/mopping = 0
|
||||
var/mopcount = 0
|
||||
|
||||
|
||||
/obj/item/weapon/mop/New()
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
|
||||
obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
|
||||
src.reagents.reaction(A,1,10)
|
||||
reagents.reaction(A,1,10)
|
||||
A.clean_blood()
|
||||
for(var/obj/effect/O in A)
|
||||
if( istype(O,/obj/effect/rune) || istype(O,/obj/effect/decal/cleanable) || istype(O,/obj/effect/overlay) )
|
||||
@@ -35,35 +35,20 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A as turf)
|
||||
|
||||
|
||||
/obj/item/weapon/mop/afterattack(atom/A, mob/user as mob)
|
||||
if (src.reagents.total_volume < 1 || mopcount >= 5)
|
||||
user << "\blue Your mop is dry!"
|
||||
if(reagents.total_volume < 1 || mopcount >= 5)
|
||||
user << "<span class='notice'>Your mop is dry!</span>"
|
||||
return
|
||||
|
||||
if (istype(A, /turf/simulated))
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red <B>[user] begins to clean \the [A]</B>", 1)
|
||||
sleep(40)
|
||||
if(A)
|
||||
clean(A)
|
||||
user << "\blue You have finished mopping!"
|
||||
mopcount++
|
||||
else if (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red <B>[user] begins to clean \the [get_turf(A)]</B>", 1)
|
||||
sleep(40)
|
||||
if(A)
|
||||
clean(get_turf(A))
|
||||
user << "\blue You have finished mopping!"
|
||||
mopcount++
|
||||
if(istype(A, /turf/simulated) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
|
||||
user.visible_message("<span class='warning'>[user] begins to clean \the [get_turf(A)].</span>")
|
||||
if(do_after(user, 40))
|
||||
if(A)
|
||||
clean(get_turf(A))
|
||||
user << "<span class='notice'>You have finished mopping!</span>"
|
||||
mopcount++
|
||||
|
||||
if(mopcount >= 5) //Okay this stuff is an ugly hack and i feel bad about it.
|
||||
spawn(5)
|
||||
src.reagents.clear_reagents()
|
||||
reagents.clear_reagents()
|
||||
mopcount = 0
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return
|
||||
@@ -7,7 +7,6 @@
|
||||
var/reliability = 100 //Used by SOME devices to determine how reliable they are.
|
||||
var/crit_fail = 0
|
||||
var/unacidable = 0 //universal "unacidabliness" var, here so you can use it in any obj.
|
||||
var/datum/marked_datum
|
||||
animate_movement = 2
|
||||
var/throwforce = 1
|
||||
var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
if(!broken)
|
||||
if(prob(50/severity))
|
||||
src.locked = !src.locked
|
||||
src.update_icon()
|
||||
if(prob(20/severity) && !opened)
|
||||
if(!locked)
|
||||
open()
|
||||
|
||||
@@ -2,305 +2,514 @@
|
||||
|
||||
/datum/song
|
||||
var/name = "Untitled"
|
||||
var/list/lines = new()
|
||||
|
||||
var/sourcestring = ""
|
||||
var/compiledstring = ""
|
||||
var/compilesuccess = 0
|
||||
|
||||
//For those other infidels who uses this datum
|
||||
//VIOLINSSS
|
||||
var/list/lines
|
||||
|
||||
var/tempo = 5
|
||||
|
||||
var/global/gid = 1
|
||||
var/id = 0
|
||||
New()
|
||||
id = gid
|
||||
gid++;
|
||||
|
||||
//Same text2list, but 20000 cap instead of 1000
|
||||
/proc/dd_text2list_highcap(text, separator, var/list/withinList)
|
||||
var/textlength = length(text)
|
||||
var/separatorlength = length(separator)
|
||||
if(withinList && !withinList.len) withinList = null
|
||||
var/list/textList = new()
|
||||
var/searchPosition = 1
|
||||
var/findPosition = 1
|
||||
var/loops = 0
|
||||
while(1)
|
||||
if(loops >= 20000)
|
||||
break
|
||||
loops++
|
||||
|
||||
findPosition = findtext(text, separator, searchPosition, 0)
|
||||
var/buggyText = copytext(text, searchPosition, findPosition)
|
||||
if(!withinList || (buggyText in withinList)) textList += "[buggyText]"
|
||||
if(!findPosition) return textList
|
||||
searchPosition = findPosition + separatorlength
|
||||
if(searchPosition > textlength)
|
||||
textList += ""
|
||||
return textList
|
||||
return
|
||||
|
||||
/obj/structure/device/piano
|
||||
name = "space minimoog"
|
||||
icon = 'icons/obj/musician.dmi'
|
||||
icon_state = "minimoog"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/datum/song/song
|
||||
|
||||
var/datum/song/currentsong = new()
|
||||
var/list/internalsongs = new()
|
||||
|
||||
var/playing = 0
|
||||
var/help = 0
|
||||
var/edit = 1
|
||||
var/repeat = 0
|
||||
var/repeat = 1
|
||||
|
||||
/obj/structure/device/piano/New()
|
||||
if(prob(50))
|
||||
name = "space minimoog"
|
||||
desc = "This is a minimoog, like a space piano, but more spacey!"
|
||||
icon_state = "minimoog"
|
||||
else
|
||||
name = "space piano"
|
||||
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
|
||||
icon_state = "piano"
|
||||
var/showcontrol = 1
|
||||
var/showeditor = 0
|
||||
var/showhelp = 0
|
||||
|
||||
/obj/structure/device/piano/proc/playnote(var/note as text)
|
||||
//world << "Note: [note]"
|
||||
var/soundfile
|
||||
/*BYOND loads resource files at compile time if they are ''. This means you can't really manipulate them dynamically.
|
||||
Tried doing it dynamically at first but its more trouble than its worth. Would have saved many lines tho.*/
|
||||
switch(note)
|
||||
if("Cn1") soundfile = 'sound/piano/Cn1.ogg'
|
||||
if("C#1") soundfile = 'sound/piano/C#1.ogg'
|
||||
if("Db1") soundfile = 'sound/piano/Db1.ogg'
|
||||
if("Dn1") soundfile = 'sound/piano/Dn1.ogg'
|
||||
if("D#1") soundfile = 'sound/piano/D#1.ogg'
|
||||
if("Eb1") soundfile = 'sound/piano/Eb1.ogg'
|
||||
if("En1") soundfile = 'sound/piano/En1.ogg'
|
||||
if("E#1") soundfile = 'sound/piano/E#1.ogg'
|
||||
if("Fb1") soundfile = 'sound/piano/Fb1.ogg'
|
||||
if("Fn1") soundfile = 'sound/piano/Fn1.ogg'
|
||||
if("F#1") soundfile = 'sound/piano/F#1.ogg'
|
||||
if("Gb1") soundfile = 'sound/piano/Gb1.ogg'
|
||||
if("Gn1") soundfile = 'sound/piano/Gn1.ogg'
|
||||
if("G#1") soundfile = 'sound/piano/G#1.ogg'
|
||||
if("Ab1") soundfile = 'sound/piano/Ab1.ogg'
|
||||
if("An1") soundfile = 'sound/piano/An1.ogg'
|
||||
if("A#1") soundfile = 'sound/piano/A#1.ogg'
|
||||
if("Bb1") soundfile = 'sound/piano/Bb1.ogg'
|
||||
if("Bn1") soundfile = 'sound/piano/Bn1.ogg'
|
||||
if("B#1") soundfile = 'sound/piano/B#1.ogg'
|
||||
if("Cb2") soundfile = 'sound/piano/Cb2.ogg'
|
||||
if("Cn2") soundfile = 'sound/piano/Cn2.ogg'
|
||||
if("C#2") soundfile = 'sound/piano/C#2.ogg'
|
||||
if("Db2") soundfile = 'sound/piano/Db2.ogg'
|
||||
if("Dn2") soundfile = 'sound/piano/Dn2.ogg'
|
||||
if("D#2") soundfile = 'sound/piano/D#2.ogg'
|
||||
if("Eb2") soundfile = 'sound/piano/Eb2.ogg'
|
||||
if("En2") soundfile = 'sound/piano/En2.ogg'
|
||||
if("E#2") soundfile = 'sound/piano/E#2.ogg'
|
||||
if("Fb2") soundfile = 'sound/piano/Fb2.ogg'
|
||||
if("Fn2") soundfile = 'sound/piano/Fn2.ogg'
|
||||
if("F#2") soundfile = 'sound/piano/F#2.ogg'
|
||||
if("Gb2") soundfile = 'sound/piano/Gb2.ogg'
|
||||
if("Gn2") soundfile = 'sound/piano/Gn2.ogg'
|
||||
if("G#2") soundfile = 'sound/piano/G#2.ogg'
|
||||
if("Ab2") soundfile = 'sound/piano/Ab2.ogg'
|
||||
if("An2") soundfile = 'sound/piano/An2.ogg'
|
||||
if("A#2") soundfile = 'sound/piano/A#2.ogg'
|
||||
if("Bb2") soundfile = 'sound/piano/Bb2.ogg'
|
||||
if("Bn2") soundfile = 'sound/piano/Bn2.ogg'
|
||||
if("B#2") soundfile = 'sound/piano/B#2.ogg'
|
||||
if("Cb3") soundfile = 'sound/piano/Cb3.ogg'
|
||||
if("Cn3") soundfile = 'sound/piano/Cn3.ogg'
|
||||
if("C#3") soundfile = 'sound/piano/C#3.ogg'
|
||||
if("Db3") soundfile = 'sound/piano/Db3.ogg'
|
||||
if("Dn3") soundfile = 'sound/piano/Dn3.ogg'
|
||||
if("D#3") soundfile = 'sound/piano/D#3.ogg'
|
||||
if("Eb3") soundfile = 'sound/piano/Eb3.ogg'
|
||||
if("En3") soundfile = 'sound/piano/En3.ogg'
|
||||
if("E#3") soundfile = 'sound/piano/E#3.ogg'
|
||||
if("Fb3") soundfile = 'sound/piano/Fb3.ogg'
|
||||
if("Fn3") soundfile = 'sound/piano/Fn3.ogg'
|
||||
if("F#3") soundfile = 'sound/piano/F#3.ogg'
|
||||
if("Gb3") soundfile = 'sound/piano/Gb3.ogg'
|
||||
if("Gn3") soundfile = 'sound/piano/Gn3.ogg'
|
||||
if("G#3") soundfile = 'sound/piano/G#3.ogg'
|
||||
if("Ab3") soundfile = 'sound/piano/Ab3.ogg'
|
||||
if("An3") soundfile = 'sound/piano/An3.ogg'
|
||||
if("A#3") soundfile = 'sound/piano/A#3.ogg'
|
||||
if("Bb3") soundfile = 'sound/piano/Bb3.ogg'
|
||||
if("Bn3") soundfile = 'sound/piano/Bn3.ogg'
|
||||
if("B#3") soundfile = 'sound/piano/B#3.ogg'
|
||||
if("Cb4") soundfile = 'sound/piano/Cb4.ogg'
|
||||
if("Cn4") soundfile = 'sound/piano/Cn4.ogg'
|
||||
if("C#4") soundfile = 'sound/piano/C#4.ogg'
|
||||
if("Db4") soundfile = 'sound/piano/Db4.ogg'
|
||||
if("Dn4") soundfile = 'sound/piano/Dn4.ogg'
|
||||
if("D#4") soundfile = 'sound/piano/D#4.ogg'
|
||||
if("Eb4") soundfile = 'sound/piano/Eb4.ogg'
|
||||
if("En4") soundfile = 'sound/piano/En4.ogg'
|
||||
if("E#4") soundfile = 'sound/piano/E#4.ogg'
|
||||
if("Fb4") soundfile = 'sound/piano/Fb4.ogg'
|
||||
if("Fn4") soundfile = 'sound/piano/Fn4.ogg'
|
||||
if("F#4") soundfile = 'sound/piano/F#4.ogg'
|
||||
if("Gb4") soundfile = 'sound/piano/Gb4.ogg'
|
||||
if("Gn4") soundfile = 'sound/piano/Gn4.ogg'
|
||||
if("G#4") soundfile = 'sound/piano/G#4.ogg'
|
||||
if("Ab4") soundfile = 'sound/piano/Ab4.ogg'
|
||||
if("An4") soundfile = 'sound/piano/An4.ogg'
|
||||
if("A#4") soundfile = 'sound/piano/A#4.ogg'
|
||||
if("Bb4") soundfile = 'sound/piano/Bb4.ogg'
|
||||
if("Bn4") soundfile = 'sound/piano/Bn4.ogg'
|
||||
if("B#4") soundfile = 'sound/piano/B#4.ogg'
|
||||
if("Cb5") soundfile = 'sound/piano/Cb5.ogg'
|
||||
if("Cn5") soundfile = 'sound/piano/Cn5.ogg'
|
||||
if("C#5") soundfile = 'sound/piano/C#5.ogg'
|
||||
if("Db5") soundfile = 'sound/piano/Db5.ogg'
|
||||
if("Dn5") soundfile = 'sound/piano/Dn5.ogg'
|
||||
if("D#5") soundfile = 'sound/piano/D#5.ogg'
|
||||
if("Eb5") soundfile = 'sound/piano/Eb5.ogg'
|
||||
if("En5") soundfile = 'sound/piano/En5.ogg'
|
||||
if("E#5") soundfile = 'sound/piano/E#5.ogg'
|
||||
if("Fb5") soundfile = 'sound/piano/Fb5.ogg'
|
||||
if("Fn5") soundfile = 'sound/piano/Fn5.ogg'
|
||||
if("F#5") soundfile = 'sound/piano/F#5.ogg'
|
||||
if("Gb5") soundfile = 'sound/piano/Gb5.ogg'
|
||||
if("Gn5") soundfile = 'sound/piano/Gn5.ogg'
|
||||
if("G#5") soundfile = 'sound/piano/G#5.ogg'
|
||||
if("Ab5") soundfile = 'sound/piano/Ab5.ogg'
|
||||
if("An5") soundfile = 'sound/piano/An5.ogg'
|
||||
if("A#5") soundfile = 'sound/piano/A#5.ogg'
|
||||
if("Bb5") soundfile = 'sound/piano/Bb5.ogg'
|
||||
if("Bn5") soundfile = 'sound/piano/Bn5.ogg'
|
||||
if("B#5") soundfile = 'sound/piano/B#5.ogg'
|
||||
if("Cb6") soundfile = 'sound/piano/Cb6.ogg'
|
||||
if("Cn6") soundfile = 'sound/piano/Cn6.ogg'
|
||||
if("C#6") soundfile = 'sound/piano/C#6.ogg'
|
||||
if("Db6") soundfile = 'sound/piano/Db6.ogg'
|
||||
if("Dn6") soundfile = 'sound/piano/Dn6.ogg'
|
||||
if("D#6") soundfile = 'sound/piano/D#6.ogg'
|
||||
if("Eb6") soundfile = 'sound/piano/Eb6.ogg'
|
||||
if("En6") soundfile = 'sound/piano/En6.ogg'
|
||||
if("E#6") soundfile = 'sound/piano/E#6.ogg'
|
||||
if("Fb6") soundfile = 'sound/piano/Fb6.ogg'
|
||||
if("Fn6") soundfile = 'sound/piano/Fn6.ogg'
|
||||
if("F#6") soundfile = 'sound/piano/F#6.ogg'
|
||||
if("Gb6") soundfile = 'sound/piano/Gb6.ogg'
|
||||
if("Gn6") soundfile = 'sound/piano/Gn6.ogg'
|
||||
if("G#6") soundfile = 'sound/piano/G#6.ogg'
|
||||
if("Ab6") soundfile = 'sound/piano/Ab6.ogg'
|
||||
if("An6") soundfile = 'sound/piano/An6.ogg'
|
||||
if("A#6") soundfile = 'sound/piano/A#6.ogg'
|
||||
if("Bb6") soundfile = 'sound/piano/Bb6.ogg'
|
||||
if("Bn6") soundfile = 'sound/piano/Bn6.ogg'
|
||||
if("B#6") soundfile = 'sound/piano/B#6.ogg'
|
||||
if("Cb7") soundfile = 'sound/piano/Cb7.ogg'
|
||||
if("Cn7") soundfile = 'sound/piano/Cn7.ogg'
|
||||
if("C#7") soundfile = 'sound/piano/C#7.ogg'
|
||||
if("Db7") soundfile = 'sound/piano/Db7.ogg'
|
||||
if("Dn7") soundfile = 'sound/piano/Dn7.ogg'
|
||||
if("D#7") soundfile = 'sound/piano/D#7.ogg'
|
||||
if("Eb7") soundfile = 'sound/piano/Eb7.ogg'
|
||||
if("En7") soundfile = 'sound/piano/En7.ogg'
|
||||
if("E#7") soundfile = 'sound/piano/E#7.ogg'
|
||||
if("Fb7") soundfile = 'sound/piano/Fb7.ogg'
|
||||
if("Fn7") soundfile = 'sound/piano/Fn7.ogg'
|
||||
if("F#7") soundfile = 'sound/piano/F#7.ogg'
|
||||
if("Gb7") soundfile = 'sound/piano/Gb7.ogg'
|
||||
if("Gn7") soundfile = 'sound/piano/Gn7.ogg'
|
||||
if("G#7") soundfile = 'sound/piano/G#7.ogg'
|
||||
if("Ab7") soundfile = 'sound/piano/Ab7.ogg'
|
||||
if("An7") soundfile = 'sound/piano/An7.ogg'
|
||||
if("A#7") soundfile = 'sound/piano/A#7.ogg'
|
||||
if("Bb7") soundfile = 'sound/piano/Bb7.ogg'
|
||||
if("Bn7") soundfile = 'sound/piano/Bn7.ogg'
|
||||
if("B#7") soundfile = 'sound/piano/B#7.ogg'
|
||||
if("Cb8") soundfile = 'sound/piano/Cb8.ogg'
|
||||
if("Cn8") soundfile = 'sound/piano/Cn8.ogg'
|
||||
if("C#8") soundfile = 'sound/piano/C#8.ogg'
|
||||
if("Db8") soundfile = 'sound/piano/Db8.ogg'
|
||||
if("Dn8") soundfile = 'sound/piano/Dn8.ogg'
|
||||
if("D#8") soundfile = 'sound/piano/D#8.ogg'
|
||||
if("Eb8") soundfile = 'sound/piano/Eb8.ogg'
|
||||
if("En8") soundfile = 'sound/piano/En8.ogg'
|
||||
if("E#8") soundfile = 'sound/piano/E#8.ogg'
|
||||
if("Fb8") soundfile = 'sound/piano/Fb8.ogg'
|
||||
if("Fn8") soundfile = 'sound/piano/Fn8.ogg'
|
||||
if("F#8") soundfile = 'sound/piano/F#8.ogg'
|
||||
if("Gb8") soundfile = 'sound/piano/Gb8.ogg'
|
||||
if("Gn8") soundfile = 'sound/piano/Gn8.ogg'
|
||||
if("G#8") soundfile = 'sound/piano/G#8.ogg'
|
||||
if("Ab8") soundfile = 'sound/piano/Ab8.ogg'
|
||||
if("An8") soundfile = 'sound/piano/An8.ogg'
|
||||
if("A#8") soundfile = 'sound/piano/A#8.ogg'
|
||||
if("Bb8") soundfile = 'sound/piano/Bb8.ogg'
|
||||
if("Bn8") soundfile = 'sound/piano/Bn8.ogg'
|
||||
if("B#8") soundfile = 'sound/piano/B#8.ogg'
|
||||
if("Cb9") soundfile = 'sound/piano/Cb9.ogg'
|
||||
if("Cn9") soundfile = 'sound/piano/Cn9.ogg'
|
||||
else return
|
||||
var/status = "Ok"
|
||||
|
||||
hearers(15, src) << sound(soundfile)
|
||||
var/global/list/soundlist = new()
|
||||
|
||||
/obj/structure/device/piano/proc/playsong()
|
||||
do
|
||||
var/cur_oct[7]
|
||||
var/cur_acc[7]
|
||||
for(var/i = 1 to 7)
|
||||
cur_oct[i] = "3"
|
||||
cur_acc[i] = "n"
|
||||
New()
|
||||
if(prob(50))
|
||||
name = "space minimoog"
|
||||
desc = "This is a minimoog, like a space piano, but more spacey!"
|
||||
icon_state = "minimoog"
|
||||
else
|
||||
name = "space piano"
|
||||
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
|
||||
icon_state = "piano"
|
||||
|
||||
for(var/line in song.lines)
|
||||
//world << line
|
||||
for(var/beat in dd_text2list(lowertext(line), ","))
|
||||
//world << "beat: [beat]"
|
||||
var/list/notes = dd_text2list(beat, "/")
|
||||
for(var/note in dd_text2list(notes[1], "-"))
|
||||
//world << "note: [note]"
|
||||
if(!playing || !anchored)//If the piano is playing, or is loose
|
||||
playing = 0
|
||||
//This shit is not used anywhere, but is needed to cache the sounds
|
||||
soundlist["Cn1"] = 'sound/piano/Cn1.ogg'
|
||||
soundlist["C#1"] = 'sound/piano/C#1.ogg'
|
||||
//soundlist["Db1"] = 'sound/piano/Db1.ogg'
|
||||
soundlist["Dn1"] = 'sound/piano/Dn1.ogg'
|
||||
soundlist["D#1"] = 'sound/piano/D#1.ogg'
|
||||
//soundlist["Eb1"] = 'sound/piano/Eb1.ogg'
|
||||
soundlist["En1"] = 'sound/piano/En1.ogg'
|
||||
soundlist["E#1"] = 'sound/piano/E#1.ogg'
|
||||
//soundlist["Fb1"] = 'sound/piano/Fb1.ogg'
|
||||
soundlist["Fn1"] = 'sound/piano/Fn1.ogg'
|
||||
soundlist["F#1"] = 'sound/piano/F#1.ogg'
|
||||
//soundlist["Gb1"] = 'sound/piano/Gb1.ogg'
|
||||
soundlist["Gn1"] = 'sound/piano/Gn1.ogg'
|
||||
soundlist["G#1"] = 'sound/piano/G#1.ogg'
|
||||
//soundlist["Ab1"] = 'sound/piano/Ab1.ogg'
|
||||
soundlist["An1"] = 'sound/piano/An1.ogg'
|
||||
soundlist["A#1"] = 'sound/piano/A#1.ogg'
|
||||
//soundlist["Bb1"] = 'sound/piano/Bb1.ogg'
|
||||
soundlist["Bn1"] = 'sound/piano/Bn1.ogg'
|
||||
soundlist["B#1"] = 'sound/piano/B#1.ogg'
|
||||
soundlist["Cb2"] = 'sound/piano/Cb2.ogg'
|
||||
soundlist["Cn2"] = 'sound/piano/Cn2.ogg'
|
||||
soundlist["C#2"] = 'sound/piano/C#2.ogg'
|
||||
//soundlist["Db2"] = 'sound/piano/Db2.ogg'
|
||||
soundlist["Dn2"] = 'sound/piano/Dn2.ogg'
|
||||
soundlist["D#2"] = 'sound/piano/D#2.ogg'
|
||||
//soundlist["Eb2"] = 'sound/piano/Eb2.ogg'
|
||||
soundlist["En2"] = 'sound/piano/En2.ogg'
|
||||
soundlist["E#2"] = 'sound/piano/E#2.ogg'
|
||||
//soundlist["Fb2"] = 'sound/piano/Fb2.ogg'
|
||||
soundlist["Fn2"] = 'sound/piano/Fn2.ogg'
|
||||
soundlist["F#2"] = 'sound/piano/F#2.ogg'
|
||||
//soundlist["Gb2"] = 'sound/piano/Gb2.ogg'
|
||||
soundlist["Gn2"] = 'sound/piano/Gn2.ogg'
|
||||
soundlist["G#2"] = 'sound/piano/G#2.ogg'
|
||||
//soundlist["Ab2"] = 'sound/piano/Ab2.ogg'
|
||||
soundlist["An2"] = 'sound/piano/An2.ogg'
|
||||
soundlist["A#2"] = 'sound/piano/A#2.ogg'
|
||||
//soundlist["Bb2"] = 'sound/piano/Bb2.ogg'
|
||||
soundlist["Bn2"] = 'sound/piano/Bn2.ogg'
|
||||
soundlist["B#2"] = 'sound/piano/B#2.ogg'
|
||||
soundlist["Cb3"] = 'sound/piano/Cb3.ogg'
|
||||
soundlist["Cn3"] = 'sound/piano/Cn3.ogg'
|
||||
soundlist["C#3"] = 'sound/piano/C#3.ogg'
|
||||
//soundlist["Db3"] = 'sound/piano/Db3.ogg'
|
||||
soundlist["Dn3"] = 'sound/piano/Dn3.ogg'
|
||||
soundlist["D#3"] = 'sound/piano/D#3.ogg'
|
||||
//soundlist["Eb3"] = 'sound/piano/Eb3.ogg'
|
||||
soundlist["En3"] = 'sound/piano/En3.ogg'
|
||||
soundlist["E#3"] = 'sound/piano/E#3.ogg'
|
||||
//soundlist["Fb3"] = 'sound/piano/Fb3.ogg'
|
||||
soundlist["Fn3"] = 'sound/piano/Fn3.ogg'
|
||||
soundlist["F#3"] = 'sound/piano/F#3.ogg'
|
||||
//soundlist["Gb3"] = 'sound/piano/Gb3.ogg'
|
||||
soundlist["Gn3"] = 'sound/piano/Gn3.ogg'
|
||||
soundlist["G#3"] = 'sound/piano/G#3.ogg'
|
||||
//soundlist["Ab3"] = 'sound/piano/Ab3.ogg'
|
||||
soundlist["An3"] = 'sound/piano/An3.ogg'
|
||||
soundlist["A#3"] = 'sound/piano/A#3.ogg'
|
||||
//soundlist["Bb3"] = 'sound/piano/Bb3.ogg'
|
||||
soundlist["Bn3"] = 'sound/piano/Bn3.ogg'
|
||||
soundlist["B#3"] = 'sound/piano/B#3.ogg'
|
||||
soundlist["Cb4"] = 'sound/piano/Cb4.ogg'
|
||||
soundlist["Cn4"] = 'sound/piano/Cn4.ogg'
|
||||
soundlist["C#4"] = 'sound/piano/C#4.ogg'
|
||||
//soundlist["Db4"] = 'sound/piano/Db4.ogg'
|
||||
soundlist["Dn4"] = 'sound/piano/Dn4.ogg'
|
||||
soundlist["D#4"] = 'sound/piano/D#4.ogg'
|
||||
//soundlist["Eb4"] = 'sound/piano/Eb4.ogg'
|
||||
soundlist["En4"] = 'sound/piano/En4.ogg'
|
||||
soundlist["E#4"] = 'sound/piano/E#4.ogg'
|
||||
//soundlist["Fb4"] = 'sound/piano/Fb4.ogg'
|
||||
soundlist["Fn4"] = 'sound/piano/Fn4.ogg'
|
||||
soundlist["F#4"] = 'sound/piano/F#4.ogg'
|
||||
//soundlist["Gb4"] = 'sound/piano/Gb4.ogg'
|
||||
soundlist["Gn4"] = 'sound/piano/Gn4.ogg'
|
||||
soundlist["G#4"] = 'sound/piano/G#4.ogg'
|
||||
//soundlist["Ab4"] = 'sound/piano/Ab4.ogg'
|
||||
soundlist["An4"] = 'sound/piano/An4.ogg'
|
||||
soundlist["A#4"] = 'sound/piano/A#4.ogg'
|
||||
//soundlist["Bb4"] = 'sound/piano/Bb4.ogg'
|
||||
soundlist["Bn4"] = 'sound/piano/Bn4.ogg'
|
||||
soundlist["B#4"] = 'sound/piano/B#4.ogg'
|
||||
soundlist["Cb5"] = 'sound/piano/Cb5.ogg'
|
||||
soundlist["Cn5"] = 'sound/piano/Cn5.ogg'
|
||||
soundlist["C#5"] = 'sound/piano/C#5.ogg'
|
||||
//soundlist["Db5"] = 'sound/piano/Db5.ogg'
|
||||
soundlist["Dn5"] = 'sound/piano/Dn5.ogg'
|
||||
soundlist["D#5"] = 'sound/piano/D#5.ogg'
|
||||
//soundlist["Eb5"] = 'sound/piano/Eb5.ogg'
|
||||
soundlist["En5"] = 'sound/piano/En5.ogg'
|
||||
soundlist["E#5"] = 'sound/piano/E#5.ogg'
|
||||
//soundlist["Fb5"] = 'sound/piano/Fb5.ogg'
|
||||
soundlist["Fn5"] = 'sound/piano/Fn5.ogg'
|
||||
soundlist["F#5"] = 'sound/piano/F#5.ogg'
|
||||
//soundlist["Gb5"] = 'sound/piano/Gb5.ogg'
|
||||
soundlist["Gn5"] = 'sound/piano/Gn5.ogg'
|
||||
soundlist["G#5"] = 'sound/piano/G#5.ogg'
|
||||
//soundlist["Ab5"] = 'sound/piano/Ab5.ogg'
|
||||
soundlist["An5"] = 'sound/piano/An5.ogg'
|
||||
soundlist["A#5"] = 'sound/piano/A#5.ogg'
|
||||
//soundlist["Bb5"] = 'sound/piano/Bb5.ogg'
|
||||
soundlist["Bn5"] = 'sound/piano/Bn5.ogg'
|
||||
soundlist["B#5"] = 'sound/piano/B#5.ogg'
|
||||
soundlist["Cb6"] = 'sound/piano/Cb6.ogg'
|
||||
soundlist["Cn6"] = 'sound/piano/Cn6.ogg'
|
||||
soundlist["C#6"] = 'sound/piano/C#6.ogg'
|
||||
//soundlist["Db6"] = 'sound/piano/Db6.ogg'
|
||||
soundlist["Dn6"] = 'sound/piano/Dn6.ogg'
|
||||
soundlist["D#6"] = 'sound/piano/D#6.ogg'
|
||||
//soundlist["Eb6"] = 'sound/piano/Eb6.ogg'
|
||||
soundlist["En6"] = 'sound/piano/En6.ogg'
|
||||
soundlist["E#6"] = 'sound/piano/E#6.ogg'
|
||||
//soundlist["Fb6"] = 'sound/piano/Fb6.ogg'
|
||||
soundlist["Fn6"] = 'sound/piano/Fn6.ogg'
|
||||
soundlist["F#6"] = 'sound/piano/F#6.ogg'
|
||||
//soundlist["Gb6"] = 'sound/piano/Gb6.ogg'
|
||||
soundlist["Gn6"] = 'sound/piano/Gn6.ogg'
|
||||
soundlist["G#6"] = 'sound/piano/G#6.ogg'
|
||||
//soundlist["Ab6"] = 'sound/piano/Ab6.ogg'
|
||||
soundlist["An6"] = 'sound/piano/An6.ogg'
|
||||
soundlist["A#6"] = 'sound/piano/A#6.ogg'
|
||||
//soundlist["Bb6"] = 'sound/piano/Bb6.ogg'
|
||||
soundlist["Bn6"] = 'sound/piano/Bn6.ogg'
|
||||
soundlist["B#6"] = 'sound/piano/B#6.ogg'
|
||||
soundlist["Cb7"] = 'sound/piano/Cb7.ogg'
|
||||
soundlist["Cn7"] = 'sound/piano/Cn7.ogg'
|
||||
soundlist["C#7"] = 'sound/piano/C#7.ogg'
|
||||
//soundlist["Db7"] = 'sound/piano/Db7.ogg'
|
||||
soundlist["Dn7"] = 'sound/piano/Dn7.ogg'
|
||||
soundlist["D#7"] = 'sound/piano/D#7.ogg'
|
||||
//soundlist["Eb7"] = 'sound/piano/Eb7.ogg'
|
||||
soundlist["En7"] = 'sound/piano/En7.ogg'
|
||||
soundlist["E#7"] = 'sound/piano/E#7.ogg'
|
||||
//soundlist["Fb7"] = 'sound/piano/Fb7.ogg'
|
||||
soundlist["Fn7"] = 'sound/piano/Fn7.ogg'
|
||||
soundlist["F#7"] = 'sound/piano/F#7.ogg'
|
||||
//soundlist["Gb7"] = 'sound/piano/Gb7.ogg'
|
||||
soundlist["Gn7"] = 'sound/piano/Gn7.ogg'
|
||||
soundlist["G#7"] = 'sound/piano/G#7.ogg'
|
||||
//soundlist["Ab7"] = 'sound/piano/Ab7.ogg'
|
||||
soundlist["An7"] = 'sound/piano/An7.ogg'
|
||||
soundlist["A#7"] = 'sound/piano/A#7.ogg'
|
||||
//soundlist["Bb7"] = 'sound/piano/Bb7.ogg'
|
||||
soundlist["Bn7"] = 'sound/piano/Bn7.ogg'
|
||||
soundlist["B#7"] = 'sound/piano/B#7.ogg'
|
||||
soundlist["Cb8"] = 'sound/piano/Cb8.ogg'
|
||||
soundlist["Cn8"] = 'sound/piano/Cn8.ogg'
|
||||
soundlist["C#8"] = 'sound/piano/C#8.ogg'
|
||||
//soundlist["Db8"] = 'sound/piano/Db8.ogg'
|
||||
soundlist["Dn8"] = 'sound/piano/Dn8.ogg'
|
||||
soundlist["D#8"] = 'sound/piano/D#8.ogg'
|
||||
//soundlist["Eb8"] = 'sound/piano/Eb8.ogg'
|
||||
soundlist["En8"] = 'sound/piano/En8.ogg'
|
||||
soundlist["E#8"] = 'sound/piano/E#8.ogg'
|
||||
//soundlist["Fb8"] = 'sound/piano/Fb8.ogg'
|
||||
soundlist["Fn8"] = 'sound/piano/Fn8.ogg'
|
||||
soundlist["F#8"] = 'sound/piano/F#8.ogg'
|
||||
//soundlist["Gb8"] = 'sound/piano/Gb8.ogg'
|
||||
soundlist["Gn8"] = 'sound/piano/Gn8.ogg'
|
||||
soundlist["G#8"] = 'sound/piano/G#8.ogg'
|
||||
//soundlist["Ab8"] = 'sound/piano/Ab8.ogg'
|
||||
soundlist["An8"] = 'sound/piano/An8.ogg'
|
||||
soundlist["A#8"] = 'sound/piano/A#8.ogg'
|
||||
//soundlist["Bb8"] = 'sound/piano/Bb8.ogg'
|
||||
soundlist["Bn8"] = 'sound/piano/Bn8.ogg'
|
||||
soundlist["B#8"] = 'sound/piano/B#8.ogg'
|
||||
soundlist["Cb9"] = 'sound/piano/Cb9.ogg'
|
||||
soundlist["Cn9"] = 'sound/piano/Cn9.ogg'
|
||||
|
||||
proc/statusmsg( var/txt as text )
|
||||
status = txt
|
||||
updateUsrDialog()
|
||||
|
||||
proc/playsong()
|
||||
if(currentsong.compilesuccess == 0)
|
||||
playing = 0
|
||||
statusmsg("Playback Error: Compile it first!")
|
||||
return
|
||||
|
||||
var/list/tokens = dd_text2list_highcap(currentsong.compiledstring, "<22>")
|
||||
|
||||
//Remove last token
|
||||
tokens.Cut(tokens.len-1)
|
||||
|
||||
var/repetitions = 0
|
||||
while(repetitions < repeat)
|
||||
repetitions++
|
||||
|
||||
for(var/token in tokens)
|
||||
if(playing == 0)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
var/type = copytext(token, 1, 2)
|
||||
switch(type)
|
||||
if("x")
|
||||
var/soundfile = copytext(token, 2)
|
||||
soundfile = "sound/piano/[soundfile].ogg"
|
||||
|
||||
hearers(15, src) << sound(soundfile)
|
||||
if("y")
|
||||
sleep(text2num(copytext(token, 2)))
|
||||
|
||||
playing = 0
|
||||
updateUsrDialog()
|
||||
|
||||
|
||||
proc/compilesong()
|
||||
var/compilestring = ""
|
||||
|
||||
var/strippedsourcestring = dd_replacetext(currentsong.sourcestring, "\n", "")
|
||||
|
||||
|
||||
for(var/part in dd_text2list(strippedsourcestring, ","))
|
||||
var/list/x = dd_text2list(part, "/")
|
||||
var/xlen = x.len
|
||||
var/list/tones = dd_text2list(x[1], "-")
|
||||
|
||||
var/tempodiv = 1
|
||||
if(xlen==2)
|
||||
tempodiv = text2num(x[2])
|
||||
if(tempodiv == 0)
|
||||
statusmsg( "Compile Error: Can't divide by 0!\nAt Part:'[part]' Tone:" )
|
||||
return
|
||||
else if(xlen>2)
|
||||
statusmsg( "Compile Error: Tempo Syntax Error!\nAt Part:'[part]' Tone:" )
|
||||
return
|
||||
|
||||
for(var/tone in tones)
|
||||
var/len = lentext(tone)
|
||||
|
||||
if(len==0)
|
||||
break
|
||||
else if(len>3)
|
||||
statusmsg( "Compile Error: Tone Syntax Error!\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
|
||||
var/note = copytext(tone, 1, 2)
|
||||
var/accidental = "n"
|
||||
var/octave = "3"
|
||||
|
||||
var/notenum = text2ascii(note)
|
||||
if(notenum < 65 || notenum > 71)
|
||||
statusmsg( "Compile Error: Invalid Note Letter (A-G)\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
|
||||
if(len>=2)
|
||||
var/x2 = copytext(tone, 2, 3)
|
||||
var/x2num = text2num(x2)
|
||||
if(x2 == "b" || x2 == "n" || x2 == "#")
|
||||
accidental = x2
|
||||
else if(x2num >= 1 && x2num <= 9)
|
||||
octave = x2
|
||||
if(len==3)
|
||||
statusmsg( "Compile Error: Tone Syntax Error! (incorrect order)\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
else
|
||||
statusmsg( "Compile Error: Invalid Letter At Char (2)\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
if(lentext(note) == 0)
|
||||
continue
|
||||
//world << "Parse: [copytext(note,1,2)]"
|
||||
var/cur_note = text2ascii(note) - 96
|
||||
if(cur_note < 1 || cur_note > 7)
|
||||
continue
|
||||
for(var/i=2 to lentext(note))
|
||||
var/ni = copytext(note,i,i+1)
|
||||
if(!text2num(ni))
|
||||
if(ni == "#" || ni == "b" || ni == "n")
|
||||
cur_acc[cur_note] = ni
|
||||
else if(ni == "s")
|
||||
cur_acc[cur_note] = "#" // so shift is never required
|
||||
|
||||
if(len==3)
|
||||
var/x3 = copytext(tone, 3, 4)
|
||||
var/x3num = text2num(x3)
|
||||
if(x3num >= 1 && x3num <= 9)
|
||||
octave = x3
|
||||
else
|
||||
cur_oct[cur_note] = ni
|
||||
playnote(uppertext(copytext(note,1,2)) + cur_acc[cur_note] + cur_oct[cur_note])
|
||||
if(notes.len >= 2 && text2num(notes[2]))
|
||||
sleep(song.tempo / text2num(notes[2]))
|
||||
else
|
||||
sleep(song.tempo)
|
||||
if(repeat > 0)
|
||||
repeat-- //Infinite loops are baaaad.
|
||||
while(repeat > 0)
|
||||
playing = 0
|
||||
updateUsrDialog()
|
||||
statusmsg( "Compile Error: Invalid Octave! (1-9)\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
|
||||
//Optimize part
|
||||
|
||||
// Replace a flat with a sharp from the note one step darker
|
||||
// If we're on the darkest note, we can't replace it by some darker (note != "C")
|
||||
// C D E F G A B
|
||||
if(accidental == "b" && note != "C")
|
||||
accidental = "#"
|
||||
if(note == "A")
|
||||
note = "G"
|
||||
else
|
||||
note = ascii2text(text2ascii(note)-1) // Decrement by one
|
||||
|
||||
var/finaltone = note + accidental + octave
|
||||
//Check if invalid note
|
||||
if((octave == "9" && (finaltone != "Cb9" && finaltone != "Cn9")) || finaltone == "Cb1")
|
||||
statusmsg( "Compile Error: Invalid Tone! (Check bottom of help for more info)\nAt Part:'[part]' Tone:'[tone]'" )
|
||||
return
|
||||
|
||||
// TODO: OPTIMIZE SHARPS AND FLATS
|
||||
//x indicates its a tone to be played
|
||||
compilestring += "x" + finaltone + "<22>"
|
||||
|
||||
//y indicates its a sleep
|
||||
compilestring += "y[round((currentsong.tempo / tempodiv)*100)/100]<5D>"
|
||||
|
||||
currentsong.compiledstring = compilestring
|
||||
currentsong.compilesuccess = 1
|
||||
|
||||
statusmsg("Compiled successfully!")
|
||||
|
||||
/obj/structure/device/piano/attack_hand(var/mob/user as mob)
|
||||
if(!anchored)
|
||||
return
|
||||
|
||||
usr.machine = src
|
||||
var/dat = "<HEAD><TITLE>Piano</TITLE></HEAD><BODY>"
|
||||
|
||||
if(song)
|
||||
if(song.lines.len > 0 && !(playing))
|
||||
dat += "<A href='?src=\ref[src];play=1'>Play Song</A><BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];repeat=1'>Repeat Song: [repeat] times.</A><BR><BR>"
|
||||
if(playing)
|
||||
dat += "<A href='?src=\ref[src];stop=1'>Stop Playing</A><BR>"
|
||||
dat += "Repeats left: [repeat].<BR><BR>"
|
||||
if(!edit)
|
||||
dat += "<A href='?src=\ref[src];edit=2'>Show Editor</A><BR><BR>"
|
||||
/*
|
||||
BPM TO TEMPO
|
||||
ds = 10/(BPM/60)
|
||||
|
||||
TEMPO TO BPM
|
||||
BPM = (10/ds)*60
|
||||
*/
|
||||
|
||||
var/calctempo = round((10/currentsong.tempo)*60)
|
||||
var/dat = {"
|
||||
<html>
|
||||
<head>
|
||||
<title>Piano</title>
|
||||
<style type="text/css">
|
||||
div.content
|
||||
{
|
||||
background-color:#AAAAAA;
|
||||
width:100%;
|
||||
padding:10;
|
||||
margin:5;
|
||||
}
|
||||
table.noborders {
|
||||
border-width: 0px;
|
||||
border-spacing: 0px;
|
||||
border-style: none;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.noborders th {
|
||||
border-width: 0px;
|
||||
padding: 0px;
|
||||
border-style: inset;
|
||||
}
|
||||
table.noborders td {
|
||||
border-width: 0px;
|
||||
padding: 0px;
|
||||
border-style: inset;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<center><h1>[src.name == "space piano" ? "Space Piano" : "Space Minimoog"]</h1></center>
|
||||
<table class="noborders" width="100%"><tr>
|
||||
<td>
|
||||
<div bgcolor="#AAAAAA" class="content" style="height:100%;">"}
|
||||
if(showcontrol)
|
||||
dat += {" <a href='?src=\ref[src];controltoggle=1'>Hide Controlpanel</a><br>"}
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];edit=1'>Hide Editor</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];newsong=1'>Start a New Song</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];import=1'>Import a Song</A><BR><BR>"
|
||||
if(song)
|
||||
var/calctempo = (10/song.tempo)*60
|
||||
dat += "Tempo : <A href='?src=\ref[src];tempo=10'>-</A><A href='?src=\ref[src];tempo=1'>-</A> [calctempo] BPM <A href='?src=\ref[src];tempo=-1'>+</A><A href='?src=\ref[src];tempo=-10'>+</A><BR><BR>"
|
||||
var/linecount = 0
|
||||
for(var/line in song.lines)
|
||||
linecount += 1
|
||||
dat += "Line [linecount]: [line] <A href='?src=\ref[src];deleteline=[linecount]'>Delete Line</A> <A href='?src=\ref[src];modifyline=[linecount]'>Modify Line</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];newline=1'>Add Line</A><BR><BR>"
|
||||
if(help)
|
||||
dat += "<A href='?src=\ref[src];help=1'>Hide Help</A><BR>"
|
||||
dat += {"
|
||||
Lines are a series of chords, separated by commas (,), each with notes seperated by hyphens (-).<br>
|
||||
Every note in a chord will play together, with chord timed by the tempo.<br>
|
||||
<br>
|
||||
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
|
||||
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
|
||||
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
|
||||
After a note has an accidental placed, it will be remembered: <i>C,C4,C,C3</i> is C3,C4,C4,C3</i><br>
|
||||
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#,Gn-B</i><br>
|
||||
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
|
||||
To make a chord be a different time, end it with /x, where the chord length will be length<br>
|
||||
defined by tempo / x: <i>C,G/2,E/4</i><br>
|
||||
Combined, an example is: <i>E-E4/4,/2,G#/8,B/8,E3-E4/4</i>
|
||||
<br>
|
||||
Lines may be up to 50 characters.<br>
|
||||
A song may only contain up to 50 lines.<br>
|
||||
"}
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];help=2'>Show Help</A><BR>"
|
||||
dat += "</BODY></HTML>"
|
||||
user << browse(dat, "window=piano;size=700x300")
|
||||
dat += {" <a href='?src=\ref[src];controltoggle=1'>Show Controlpanel</a><br>"}
|
||||
|
||||
if(showcontrol)
|
||||
dat += {"
|
||||
|
||||
<a href='?src=\ref[src];toggleplay=1'>[playing ? "Stop Playing" : "Play [currentsong.name]"]</a><br>
|
||||
<br>
|
||||
<a href='?src=\ref[src];newsong=1'>New Song</a><br>
|
||||
<a href='?src=\ref[src];name=1'>Rename Song</a><br>
|
||||
<a href='?src=\ref[src];savesong=1'>Save [currentsong.name]</a><br>
|
||||
<br>
|
||||
<a href='?src=\ref[src];repeat=1'>Repeat: [repeat]</a><br>
|
||||
<div style="width:auto; height:auto; background-color:#888888;" bgcolor="#888888">
|
||||
<pre>Status:<br>[status]</pre>
|
||||
</div>"}
|
||||
|
||||
dat+={"
|
||||
</div>
|
||||
</td>
|
||||
<td width="150px">
|
||||
<div bgcolor="#AAAAAA" class="content" style="width:150px; height:100%; margin-left:0;">
|
||||
"}
|
||||
if(showcontrol)
|
||||
for(var/datum/song/isong in internalsongs)
|
||||
dat += "<a href='?src=\ref[src];setsong=[isong.id]'>[isong.name]</a><br>"
|
||||
dat += {"
|
||||
</div>
|
||||
</td>
|
||||
</tr></table>
|
||||
<div bgcolor="#AAAAAA" class="content" style="margin-top:0;">"}
|
||||
|
||||
if(showeditor)
|
||||
dat += {"<a href='?src=\ref[src];editortoggle=1'>Hide Editor</a><br>"}
|
||||
else
|
||||
dat += {"<a href='?src=\ref[src];editortoggle=1'>Show Editor</a><br>"}
|
||||
|
||||
if(showeditor)
|
||||
dat += {"
|
||||
Tempo:
|
||||
<a href='?src=\ref[src];tempo=-3'>-</a><a href='?src=\ref[src];tempo=-2'>-</a><a href='?src=\ref[src];tempo=-1'>-</a>
|
||||
[calctempo] BPM
|
||||
<a href='?src=\ref[src];tempo=1'>+</a><a href='?src=\ref[src];tempo=2'>+</a><a href='?src=\ref[src];tempo=3'>+</a><br>
|
||||
<a href='?src=\ref[src];compile=1'>Compile</a>
|
||||
<a href='?src=\ref[src];edit=1'>Edit</a>
|
||||
<div bgcolor="#888888" style="padding-left:5px; margin-top:5px; background-color:#888888"><pre>[currentsong.sourcestring]</pre></div>"}
|
||||
dat+={"
|
||||
</div>
|
||||
<div bgcolor="#AAAAAA" class="content">"}
|
||||
|
||||
if(showhelp)
|
||||
dat += {"<a href='?src=\ref[src];helptoggle=1'>Hide Help</a><br>"}
|
||||
else
|
||||
dat += {"<a href='?src=\ref[src];helptoggle=1'>Show Help</a><br>"}
|
||||
|
||||
if(showhelp)
|
||||
dat += {"
|
||||
Songs are a series of chords, separated by commas (,), each with notes seperated by hyphens (-).<br>
|
||||
Every note in a chord will play together, with chord timed by the tempo.<br>
|
||||
<br>
|
||||
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
|
||||
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
|
||||
Octave can be a number between 1 and 9<br>
|
||||
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
|
||||
After a note has an accidental placed, it will be remembered: <i>C#,C4,Cb,C3</i> is <i>C#3,Cn4,Cb3,Cn3</i><br>
|
||||
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#-Gn-B</i><br>
|
||||
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
|
||||
To make a chord be a different time, end it with /x, where the chord length will be length<br>
|
||||
defined by 'tempo / x': <i>C,G/2,E/4</i><br>
|
||||
Combined, an example is: <i>E-Eb4/4,/2,G#/8,B/8,E3-E4/4</i><br>
|
||||
<br>
|
||||
A song may only contain up to 4000 letters.<br>
|
||||
If you're playing a small piece over and over, remember to put a pause at the end for it to sound properly.<br<
|
||||
<br>
|
||||
Note: Due to limitations in the engine, some tones doesn't exist. These are:<br>
|
||||
Cb1<br>
|
||||
All tones in the ninth octave <b>except Cb9 and Cn9</b>
|
||||
"}
|
||||
dat+={"
|
||||
</div>
|
||||
</body>
|
||||
</html>"}
|
||||
user << browse(dat, "window=piano;size=700x500")
|
||||
onclose(user, "piano")
|
||||
|
||||
/obj/structure/device/piano/Topic(href, href_list)
|
||||
@@ -310,98 +519,113 @@
|
||||
onclose(usr, "piano")
|
||||
return
|
||||
|
||||
if(href_list["newsong"])
|
||||
song = new()
|
||||
else if(song)
|
||||
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
|
||||
if(playing) return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing.
|
||||
var/tempnum = input("How many times do you want to repeat this piece? (max:10)") as num|null
|
||||
if(tempnum > 10)
|
||||
tempnum = 10
|
||||
if(tempnum < 0)
|
||||
tempnum = 0
|
||||
repeat = round(tempnum)
|
||||
if(href_list["toggleplay"])
|
||||
if(playing)
|
||||
playing = 0
|
||||
else
|
||||
playing = 1
|
||||
spawn() playsong()
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["controltoggle"])
|
||||
showcontrol = 1-showcontrol
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["editortoggle"])
|
||||
showeditor = 1-showeditor
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["helptoggle"])
|
||||
showhelp = 1-showhelp
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["name"])
|
||||
var/input = html_encode(input(usr, "", "Rename", currentsong.name) as text|null)
|
||||
currentsong.name = copytext(input,1,30)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["savesong"])
|
||||
|
||||
//Check if the song already exists in the internal
|
||||
var/foundsong = 0
|
||||
for(var/datum/song/isong in internalsongs)
|
||||
if(isong.id == currentsong.id)
|
||||
foundsong = 1
|
||||
isong.compiledstring = currentsong.compiledstring
|
||||
isong.sourcestring = currentsong.sourcestring
|
||||
isong.name = currentsong.name
|
||||
break
|
||||
|
||||
//If not, add it as new
|
||||
if(!foundsong)
|
||||
internalsongs += currentsong
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
if(playing)
|
||||
if(href_list["newsong"]||href_list["setsong"]||href_list["tempo"]||href_list["compile"]||href_list["edit"]||href_list["repeat"])
|
||||
statusmsg("Playback Error: Stop the song first!")
|
||||
else
|
||||
if(href_list["newsong"])
|
||||
var/answer = alert(usr, "This will overwrite any current song you're editing!", "Are you sure?", "Yes", "No")
|
||||
if(answer == "No")
|
||||
return
|
||||
|
||||
currentsong = new()
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["setsong"])
|
||||
|
||||
var/matchid = text2num(href_list["setsong"])
|
||||
for(var/datum/song/isong in internalsongs)
|
||||
if(isong.id == matchid)
|
||||
currentsong = isong
|
||||
break
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["tempo"])
|
||||
song.tempo += round(text2num(href_list["tempo"]))
|
||||
if(song.tempo < 1)
|
||||
song.tempo = 1
|
||||
var/tempoinc = text2num(href_list["tempo"])
|
||||
|
||||
else if(href_list["play"])
|
||||
if(song)
|
||||
playing = 1
|
||||
spawn() playsong()
|
||||
currentsong.tempo += tempoinc*-1
|
||||
if(currentsong.tempo<1)
|
||||
currentsong.tempo = 1
|
||||
currentsong.compilesuccess = 0
|
||||
|
||||
else if(href_list["newline"])
|
||||
var/newline = html_encode(input("Enter your line: ", "Piano") as text|null)
|
||||
if(!newline)
|
||||
return
|
||||
if(song.lines.len > 50)
|
||||
return
|
||||
if(lentext(newline) > 50)
|
||||
newline = copytext(newline, 1, 50)
|
||||
song.lines.Add(newline)
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["deleteline"])
|
||||
var/num = round(text2num(href_list["deleteline"]))
|
||||
if(num > song.lines.len || num < 1)
|
||||
return
|
||||
song.lines.Cut(num, num+1)
|
||||
else if(href_list["compile"])
|
||||
|
||||
else if(href_list["modifyline"])
|
||||
var/num = round(text2num(href_list["modifyline"]),1)
|
||||
var/content = html_encode(input("Enter your line: ", "Piano", song.lines[num]) as text|null)
|
||||
if(!content)
|
||||
return
|
||||
if(lentext(content) > 50)
|
||||
content = copytext(content, 1, 50)
|
||||
if(num > song.lines.len || num < 1)
|
||||
return
|
||||
song.lines[num] = content
|
||||
compilesong()
|
||||
|
||||
else if(href_list["stop"])
|
||||
playing = 0
|
||||
|
||||
else if(href_list["help"])
|
||||
help = text2num(href_list["help"]) - 1
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["edit"])
|
||||
edit = text2num(href_list["edit"]) - 1
|
||||
|
||||
else if(href_list["import"])
|
||||
var/t = ""
|
||||
do
|
||||
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", src.name), t) as message)
|
||||
if (!in_range(src, usr))
|
||||
return
|
||||
var/input = html_encode(input(usr, "", "Edit", currentsong.sourcestring) as message|null)
|
||||
|
||||
if(lentext(t) >= 3072)
|
||||
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
|
||||
if(cont == "no")
|
||||
break
|
||||
while(lentext(t) > 3072)
|
||||
input = dd_replacetext(input, " ", "")
|
||||
input = dd_replacetext(input, "\t", "")
|
||||
|
||||
//split into lines
|
||||
spawn()
|
||||
var/list/lines = dd_text2list(t, "\n")
|
||||
var/tempo = 5
|
||||
if(copytext(lines[1],1,6) == "BPM: ")
|
||||
tempo = 600 / text2num(copytext(lines[1],6))
|
||||
lines.Cut(1,2)
|
||||
if(lines.len > 50)
|
||||
usr << "Too many lines!"
|
||||
lines.Cut(51)
|
||||
var/linenum = 1
|
||||
for(var/l in lines)
|
||||
if(lentext(l) > 50)
|
||||
usr << "Line [linenum] too long!"
|
||||
lines.Remove(l)
|
||||
else
|
||||
linenum++
|
||||
song = new()
|
||||
song.lines = lines
|
||||
song.tempo = tempo
|
||||
updateUsrDialog()
|
||||
if(lentext(input)>4000)
|
||||
statusmsg("Editor Error: Song too long, end was cutoff (max 4000)")
|
||||
input = copytext(input, 1, 4001)
|
||||
|
||||
currentsong.sourcestring = input
|
||||
currentsong.compilesuccess = 0
|
||||
|
||||
updateUsrDialog()
|
||||
|
||||
else if(href_list["repeat"])
|
||||
|
||||
var/input = round(input(usr, "", "Repeat", "How many times do you want to repeat? (max 10)") as num|null)
|
||||
if(input < 1)
|
||||
input = 1
|
||||
else if(input > 10)
|
||||
input = 10
|
||||
|
||||
repeat = input
|
||||
|
||||
add_fingerprint(usr)
|
||||
updateUsrDialog()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite
|
||||
set category = "OOC"
|
||||
if (IsGuestKey(src.key))
|
||||
src << "You are not authorized to communicate over these channels."
|
||||
src << "Guests may not use OOC."
|
||||
return
|
||||
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
|
||||
if(!msg)
|
||||
@@ -28,8 +28,8 @@
|
||||
usr << "\red OOC for dead mobs has been turned off."
|
||||
return
|
||||
else if (src.client)
|
||||
if(src.client.muted_ooc)
|
||||
src << "\red You cannot use OOC (muted by admins)."
|
||||
if(src.client.muted & MUTE_OOC)
|
||||
src << "\red You cannot use OOC (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(msg,MUTE_OOC))
|
||||
@@ -44,16 +44,7 @@
|
||||
|
||||
for (var/client/C)
|
||||
if(C.listen_ooc)
|
||||
if (src.client.holder && (!src.client.stealth || (C.holder && C.holder.level != 0)))
|
||||
if (src.client.holder.rank == "Admin Observer")
|
||||
C << "<span class='adminobserverooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
|
||||
else if (src.client.holder.rank == "Retired Admin")
|
||||
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
|
||||
else if (src.client.holder.rank == "Moderator")
|
||||
C << "<span class='modooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
|
||||
else if (src.client.holder.level >= 5)
|
||||
C << "<font color=[src.client.ooccolor]><b><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>"
|
||||
else
|
||||
C << "<span class='adminooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
|
||||
if (src.client.holder && (!src.client.stealth || (C.holder && C.holder.level != 0))) if(!src.client.holder.fakekey || C.holder) if (src.client.holder.rank == "Admin Observer") C << "<span class='adminobserverooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>" else if (src.client.holder.level >= 5) C << "<font color=[src.client.holder.ooccolor]><b><span class='prefix'>OOC:</span> <EM>[src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>" else if (src.client.holder.rank == "Retired Admin") C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>" else if (src.client.holder.rank == "Moderator") C << "<span class='modooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>" else C << "<span class='adminooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>" else
|
||||
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.client.holder.fakekey ? src.client.holder.fakekey : src.key]:</EM> <span class='message'>[msg]</span></span>"
|
||||
else
|
||||
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.client.stealth ? src.client.fakekey : src.key]:</EM> <span class='message'>[msg]</span></span>"
|
||||
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key]:</EM> <span class='message'>[msg]</span></span>"
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
/mob/verb/togglemidis()
|
||||
/client/verb/togglemidis()
|
||||
set category = "Special Verbs"
|
||||
set name = "Toggle Midis"
|
||||
set desc = "This will prevent further admin midis from playing, as well as cut off the current one."
|
||||
|
||||
if(istype(usr,/mob))
|
||||
var/mob/M = usr
|
||||
|
||||
if(M.client)
|
||||
M.client.midis = !M.client.midis
|
||||
if(!M.client.midis)
|
||||
M << sound(null, 0, 0, 777) // breaks the client's sound output on channel 777
|
||||
|
||||
M << "You will now [M.client.midis? "start":"stop"] receiving any sounds uploaded by admins[M.client.midis? "":", and any current midis playing have been disabled"]."
|
||||
return
|
||||
midis = !midis
|
||||
if(!midis)
|
||||
var/sound/break_sound = sound(null, repeat = 0, wait = 0, channel = 777)
|
||||
break_sound.priority = 250
|
||||
src << break_sound //breaks the client's sound output on channel 777
|
||||
|
||||
src << "You will now [midis? "start":"stop"] receiving any sounds uploaded by admins[midis? "":", and any current midis playing have been disabled"]."
|
||||
|
||||
|
||||
/mob/verb/toggletitlemusic()
|
||||
|
||||
@@ -26,6 +26,7 @@ proc/get_all_admin_clients()
|
||||
var/list/peeps = list()
|
||||
|
||||
for (var/client/C in client_list)
|
||||
<<<<<<< HEAD
|
||||
var/entry = ""
|
||||
if (C.stealth && !usr.client.holder)
|
||||
entry += "\t[C.fakekey]"
|
||||
@@ -33,6 +34,13 @@ proc/get_all_admin_clients()
|
||||
entry += "\t[C.key][C.stealth ? " <i>(as [C.fakekey])</i>" : ""]"
|
||||
|
||||
if(usr.client.holder && (usr.client.holder.level != 0))
|
||||
=======
|
||||
var/entry = "\t"
|
||||
if(usr.client.holder)
|
||||
entry += "[C.key]"
|
||||
if(C.holder && C.holder.fakekey)
|
||||
entry += " <i>(as [C.holder.fakekey])</i>"
|
||||
>>>>>>> remotes/git-svn
|
||||
var/mob/M = C.mob
|
||||
entry += " - Playing as [M.real_name]"
|
||||
switch(M.stat)
|
||||
@@ -50,6 +58,11 @@ proc/get_all_admin_clients()
|
||||
if(is_special_character(C.mob))
|
||||
entry += " - <b><font color='red'>Antagonist</font></b>"
|
||||
entry += " (<A HREF='?src=\ref[src.client.holder];adminmoreinfo=\ref[M]'>?</A>)"
|
||||
else
|
||||
if(C.holder && C.holder.fakekey)
|
||||
entry += "[C.holder.fakekey]"
|
||||
else
|
||||
entry += "[C.key]"
|
||||
|
||||
peeps += entry
|
||||
|
||||
@@ -73,10 +86,10 @@ proc/get_all_admin_clients()
|
||||
if(C.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
|
||||
afk = 1
|
||||
if(isobserver(C.mob))
|
||||
usr << "[C] is a [C.holder.rank][C.stealth ? " <i>(as [C.fakekey])</i>" : ""] - Observing [afk ? "(AFK)" : ""]"
|
||||
usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " <i>(as [C.holder.fakekey])</i>" : ""] - Observing [afk ? "(AFK)" : ""]"
|
||||
else if(istype(C.mob,/mob/new_player))
|
||||
usr << "[C] is a [C.holder.rank][C.stealth ? " <i>(as [C.fakekey])</i>" : ""] - Has not entered [afk ? "(AFK)" : ""]"
|
||||
usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " <i>(as [C.holder.fakekey])</i>" : ""] - Has not entered [afk ? "(AFK)" : ""]"
|
||||
else if(istype(C.mob,/mob/living))
|
||||
usr << "[C] is a [C.holder.rank][C.stealth ? " <i>(as [C.fakekey])</i>" : ""] - Playing [afk ? "(AFK)" : ""]"
|
||||
else if(!C.stealth)
|
||||
usr << "\t[C] is a [C.holder.rank]"
|
||||
usr << "\t[C] is a [C.holder.rank][C.holder.fakekey ? " <i>(as [C.holder.fakekey])</i>" : ""] - Playing [afk ? "(AFK)" : ""]"
|
||||
else if(!C.holder.fakekey)
|
||||
usr << "\t[C] is a [C.holder.rank]"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
obj/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0)
|
||||
datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1, var/reason, var/job = "", var/rounds = 0)
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
@@ -79,7 +79,7 @@ obj/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration = -1
|
||||
|
||||
|
||||
|
||||
obj/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
|
||||
datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
@@ -149,7 +149,7 @@ obj/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
|
||||
DB_ban_unban_by_id(ban_id)
|
||||
|
||||
|
||||
obj/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
datum/admins/proc/DB_ban_unban_by_id(var/id)
|
||||
var/user = sqlfdbklogin
|
||||
var/pass = sqlfdbkpass
|
||||
var/db = sqlfdbkdb
|
||||
|
||||
@@ -163,7 +163,7 @@ var/savefile/Banlist
|
||||
timeleftstring = "[exp] Minutes"
|
||||
return timeleftstring
|
||||
|
||||
/obj/admins/proc/unbanpanel()
|
||||
/datum/admins/proc/unbanpanel()
|
||||
var/count = 0
|
||||
var/dat
|
||||
//var/dat = "<HR><B>Unban Player:</B> \blue(U) = Unban , (E) = Edit Ban\green (Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >"
|
||||
|
||||
@@ -17,28 +17,32 @@
|
||||
// verbs += /client/proc/Cell //More air things
|
||||
|
||||
/client/proc/update_admins(var/rank)
|
||||
|
||||
if(!holder)
|
||||
holder = new /obj/admins(src)
|
||||
holder = new /datum/admins(rank)
|
||||
admin_list |= src
|
||||
admins[ckey] = holder
|
||||
|
||||
holder.rank = rank
|
||||
/* Unused
|
||||
if(!holder.state)
|
||||
var/state = alert("Which state do you want the admin to begin in?", "Admin-state", "Play", "Observe", "Neither")
|
||||
if(state == "Play")
|
||||
var/need_update = 0
|
||||
//check if our rank has changed
|
||||
if(holder.rank != rank)
|
||||
holder.rank = rank
|
||||
need_update = 1
|
||||
//check if our state has changed
|
||||
if(istype(mob,/mob/living))
|
||||
if(holder.state != 1)
|
||||
holder.state = 1
|
||||
admin_play()
|
||||
return
|
||||
else if(state == "Observe")
|
||||
need_update = 1
|
||||
else
|
||||
if(holder.state != 2)
|
||||
holder.state = 2
|
||||
admin_observe()
|
||||
return
|
||||
else
|
||||
del(holder)
|
||||
return */
|
||||
need_update = 1
|
||||
|
||||
switch (rank)
|
||||
if ("Game Master")
|
||||
if(!need_update) return
|
||||
|
||||
clear_admin_verbs()
|
||||
|
||||
switch(rank)
|
||||
if("Game Master")
|
||||
holder.level = 6
|
||||
|
||||
if ("Game Admin")
|
||||
@@ -71,7 +75,7 @@
|
||||
holder.level = 2
|
||||
if(holder.state == 2) // if observing
|
||||
deadchat = 1
|
||||
verbs += /obj/admins/proc/toggleaban //abandon mob
|
||||
verbs += /datum/admins/proc/toggleaban //abandon mob
|
||||
verbs += /client/proc/deadchat //toggles deadchat
|
||||
verbs += /client/proc/cmd_admin_check_contents
|
||||
verbs += /client/proc/Jump
|
||||
@@ -88,10 +92,10 @@
|
||||
if ("Admin Observer")
|
||||
holder.level = -1
|
||||
|
||||
if ("Banned")
|
||||
holder.level = -2
|
||||
del(src)
|
||||
return
|
||||
// if ("Banned")
|
||||
// holder.level = -2
|
||||
// del(src)
|
||||
// return
|
||||
|
||||
if ("Retired Admin")
|
||||
holder.level = -3
|
||||
@@ -119,6 +123,7 @@
|
||||
|
||||
//Moderator
|
||||
if (holder.level >= 0)
|
||||
|
||||
verbs += /client/proc/cmd_admin_pm_context
|
||||
verbs += /client/proc/cmd_admin_pm_panel
|
||||
verbs += /client/proc/hide_verbs
|
||||
@@ -135,18 +140,6 @@
|
||||
verbs -= /client/proc/cmd_admin_gib_self
|
||||
verbs += /client/proc/mod_panel
|
||||
|
||||
//Temporary Admin
|
||||
if (holder.level >= 1)
|
||||
verbs += /obj/admins/proc/delay //game start delay
|
||||
verbs += /obj/admins/proc/immreboot //immediate reboot
|
||||
verbs += /obj/admins/proc/restart //restart
|
||||
verbs += /client/proc/cmd_admin_check_contents
|
||||
verbs += /client/proc/cmd_admin_create_centcom_report
|
||||
verbs += /client/proc/toggle_hear_deadcast
|
||||
verbs += /client/proc/toggle_hear_radio
|
||||
verbs += /client/proc/deadmin_self
|
||||
//verbs += /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
|
||||
//
|
||||
//MOVED FROM MODERATOR
|
||||
//
|
||||
@@ -172,9 +165,23 @@
|
||||
verbs += /client/proc/unjobban_panel
|
||||
verbs += /client/proc/check_ai_laws
|
||||
//verbs += /client/proc/cmd_admin_prison --Merged with player panel
|
||||
//verbs += /obj/admins/proc/unprison --Merged with player panel
|
||||
//verbs += /datum/admins/proc/unprison --Merged with player panel
|
||||
else return
|
||||
|
||||
|
||||
else return
|
||||
//Temporary Admin
|
||||
if (holder.level >= 1)
|
||||
verbs += /obj/admins/proc/delay //game start delay
|
||||
verbs += /obj/admins/proc/immreboot //immediate reboot
|
||||
verbs += /obj/admins/proc/restart //restart
|
||||
verbs += /client/proc/cmd_admin_check_contents
|
||||
verbs += /client/proc/cmd_admin_create_centcom_report
|
||||
verbs += /client/proc/toggle_hear_deadcast
|
||||
verbs += /client/proc/toggle_hear_radio
|
||||
verbs += /client/proc/deadmin_self
|
||||
//verbs += /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
|
||||
//Admin Candidate
|
||||
if (holder.level >= 2)
|
||||
verbs += /client/proc/cmd_admin_add_random_ai_law
|
||||
@@ -191,10 +198,10 @@
|
||||
seeprayers = 1
|
||||
|
||||
verbs += /client/proc/invisimin
|
||||
verbs += /obj/admins/proc/view_txt_log
|
||||
verbs += /obj/admins/proc/view_atk_log
|
||||
verbs += /obj/admins/proc/toggleaban //abandon mob
|
||||
verbs += /obj/admins/proc/show_traitor_panel
|
||||
verbs += /datum/admins/proc/view_txt_log
|
||||
verbs += /datum/admins/proc/view_atk_log
|
||||
verbs += /datum/admins/proc/toggleaban //abandon mob
|
||||
verbs += /datum/admins/proc/show_traitor_panel
|
||||
verbs += /client/proc/getserverlog //fetch an old serverlog to look at
|
||||
//verbs += /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything
|
||||
verbs += /client/proc/admin_call_shuttle
|
||||
@@ -215,10 +222,10 @@
|
||||
|
||||
//Badmin
|
||||
if (holder.level >= 4)
|
||||
verbs += /obj/admins/proc/adrev //toggle admin revives
|
||||
verbs += /obj/admins/proc/adspawn //toggle admin item spawning
|
||||
verbs += /datum/admins/proc/adrev //toggle admin revives
|
||||
verbs += /datum/admins/proc/adspawn //toggle admin item spawning
|
||||
verbs += /client/proc/debug_variables
|
||||
verbs += /obj/admins/proc/access_news_network //Admin access to the newscaster network
|
||||
verbs += /datum/admins/proc/access_news_network //Admin access to the newscaster network
|
||||
verbs += /client/proc/cmd_modify_ticker_variables
|
||||
verbs += /client/proc/Debug2 //debug toggle switch
|
||||
verbs += /client/proc/toggle_view_range
|
||||
@@ -246,7 +253,7 @@
|
||||
|
||||
//Game Admin
|
||||
if (holder.level >= 5)
|
||||
verbs += /obj/admins/proc/spawn_atom
|
||||
verbs += /datum/admins/proc/spawn_atom
|
||||
verbs += /client/proc/cmd_admin_list_open_jobs
|
||||
verbs += /client/proc/cmd_admin_direct_narrate
|
||||
verbs += /client/proc/colorooc
|
||||
@@ -284,9 +291,9 @@
|
||||
|
||||
//Game Master
|
||||
if (holder.level >= 6)
|
||||
verbs += /obj/admins/proc/toggle_aliens //toggle aliens
|
||||
verbs += /obj/admins/proc/toggle_space_ninja //toggle ninjas
|
||||
verbs += /obj/admins/proc/adjump
|
||||
verbs += /datum/admins/proc/toggle_aliens //toggle aliens
|
||||
verbs += /datum/admins/proc/toggle_space_ninja //toggle ninjas
|
||||
verbs += /datum/admins/proc/adjump
|
||||
verbs += /client/proc/callproc
|
||||
verbs += /client/proc/triple_ai
|
||||
verbs += /client/proc/get_admin_state
|
||||
@@ -308,127 +315,132 @@
|
||||
|
||||
/client/proc/clear_admin_verbs()
|
||||
deadchat = 0
|
||||
|
||||
verbs -= /obj/admins/proc/announce
|
||||
verbs -= /obj/admins/proc/startnow
|
||||
verbs -= /obj/admins/proc/toggleAI //Toggle the AI
|
||||
verbs -= /obj/admins/proc/toggleenter //Toggle enterting
|
||||
verbs -= /obj/admins/proc/toggleguests //Toggle guests entering
|
||||
verbs -= /obj/admins/proc/toggleooc //toggle ooc
|
||||
verbs -= /obj/admins/proc/toggleoocdead //toggle ooc for dead/unc
|
||||
verbs -= /obj/admins/proc/delay //game start delay
|
||||
verbs -= /obj/admins/proc/immreboot //immediate reboot
|
||||
verbs -= /obj/admins/proc/restart //restart
|
||||
verbs -= /obj/admins/proc/show_traitor_panel
|
||||
verbs -= /obj/admins/proc/show_player_panel
|
||||
verbs -= /obj/admins/proc/toggle_aliens //toggle aliens
|
||||
verbs -= /obj/admins/proc/toggle_space_ninja //toggle ninjas
|
||||
verbs -= /obj/admins/proc/adjump
|
||||
verbs -= /obj/admins/proc/view_txt_log
|
||||
verbs -= /obj/admins/proc/view_atk_log
|
||||
verbs -= /obj/admins/proc/spawn_atom
|
||||
verbs -= /obj/admins/proc/adrev //toggle admin revives
|
||||
verbs -= /obj/admins/proc/adspawn //toggle admin item spawning
|
||||
verbs -= /obj/admins/proc/toggleaban //abandon mob
|
||||
verbs -= /client/proc/hide_verbs
|
||||
verbs -= /client/proc/hide_most_verbs
|
||||
verbs -= /client/proc/show_verbs
|
||||
verbs -= /client/proc/colorooc
|
||||
verbs -= /client/proc/triple_ai
|
||||
verbs -= /client/proc/get_admin_state
|
||||
verbs -= /client/proc/reload_admins
|
||||
verbs -= /client/proc/kill_air
|
||||
verbs -= /client/proc/cmd_debug_make_powernets
|
||||
verbs -= /client/proc/object_talk
|
||||
verbs -= /client/proc/strike_team
|
||||
verbs -= /client/proc/cmd_admin_list_open_jobs
|
||||
verbs -= /client/proc/cmd_admin_direct_narrate
|
||||
verbs -= /client/proc/cmd_admin_world_narrate
|
||||
verbs -= /client/proc/callproc
|
||||
verbs -= /client/proc/Cell
|
||||
verbs -= /client/proc/cmd_debug_del_all
|
||||
verbs -= /client/proc/cmd_debug_tog_aliens
|
||||
// verbs -= /client/proc/mapload
|
||||
verbs -= /client/proc/check_words
|
||||
verbs -= /client/proc/drop_bomb
|
||||
verbs.Remove(
|
||||
/datum/admins/proc/announce,
|
||||
/datum/admins/proc/startnow,
|
||||
/datum/admins/proc/toggleAI, /*Toggle the AI*/
|
||||
/datum/admins/proc/toggleenter, /*Toggle enterting*/
|
||||
/datum/admins/proc/toggleguests, /*Toggle guests entering*/
|
||||
/datum/admins/proc/toggleooc, /*toggle ooc*/
|
||||
/datum/admins/proc/toggleoocdead, /*toggle ooc for dead/unc*/
|
||||
/datum/admins/proc/delay, /*game start delay*/
|
||||
/datum/admins/proc/immreboot, /*immediate reboot*/
|
||||
/datum/admins/proc/restart, /*restart*/
|
||||
/datum/admins/proc/show_traitor_panel,
|
||||
/datum/admins/proc/show_player_panel,
|
||||
/datum/admins/proc/toggle_aliens, /*toggle aliens*/
|
||||
/datum/admins/proc/toggle_space_ninja,/*toggle ninjas*/
|
||||
/datum/admins/proc/adjump,
|
||||
/datum/admins/proc/view_txt_log,
|
||||
/datum/admins/proc/view_atk_log,
|
||||
/datum/admins/proc/spawn_atom,
|
||||
/datum/admins/proc/adrev, /*toggle admin revives*/
|
||||
/datum/admins/proc/adspawn, /*toggle admin item spawning*/
|
||||
/datum/admins/proc/toggleaban, /*abandon mob*/
|
||||
/client/proc/hide_verbs,
|
||||
/client/proc/hide_most_verbs,
|
||||
/client/proc/show_verbs,
|
||||
/client/proc/colorooc,
|
||||
/client/proc/triple_ai,
|
||||
/client/proc/get_admin_state,
|
||||
/client/proc/reload_admins,
|
||||
/client/proc/kill_air,
|
||||
/client/proc/cmd_debug_make_powernets,
|
||||
/client/proc/object_talk,
|
||||
/client/proc/strike_team,
|
||||
/client/proc/cmd_admin_list_open_jobs,
|
||||
/client/proc/cmd_admin_direct_narrate,
|
||||
/client/proc/cmd_admin_world_narrate,
|
||||
/client/proc/callproc,
|
||||
/client/proc/Cell,
|
||||
/client/proc/cmd_debug_del_all,
|
||||
/client/proc/cmd_debug_tog_aliens,
|
||||
/client/proc/check_words,
|
||||
/client/proc/drop_bomb,
|
||||
/client/proc/make_sound,
|
||||
/client/proc/only_one,
|
||||
/client/proc/send_space_ninja,
|
||||
/client/proc/debug_variables,
|
||||
/client/proc/cmd_modify_ticker_variables,
|
||||
/client/proc/Debug2, /*debug toggle switch*/
|
||||
/client/proc/toggle_view_range,
|
||||
/client/proc/Getmob,
|
||||
/client/proc/Getkey,
|
||||
/client/proc/sendmob,
|
||||
/client/proc/Jump,
|
||||
/client/proc/jumptokey,
|
||||
/client/proc/jumptomob,
|
||||
/client/proc/jumptoturf,
|
||||
/client/proc/cmd_admin_add_freeform_ai_law,
|
||||
/client/proc/cmd_admin_add_random_ai_law,
|
||||
/client/proc/cmd_admin_rejuvenate,
|
||||
/client/proc/cmd_admin_delete,
|
||||
/client/proc/toggleadminhelpsound,
|
||||
/client/proc/admin_call_shuttle,
|
||||
/client/proc/admin_cancel_shuttle,
|
||||
/client/proc/cmd_admin_dress,
|
||||
/client/proc/respawn_character,
|
||||
/client/proc/spawn_xeno,
|
||||
/client/proc/cmd_admin_add_random_ai_law,
|
||||
/client/proc/secrets,
|
||||
/client/proc/check_antagonists,
|
||||
/client/proc/play_sound,
|
||||
/client/proc/stealth,
|
||||
/client/proc/cmd_admin_check_contents,
|
||||
/client/proc/cmd_admin_create_centcom_report,
|
||||
/client/proc/deadchat, /*toggles deadchat*/
|
||||
/client/proc/cmd_admin_pm_context,
|
||||
/client/proc/cmd_admin_pm_panel,
|
||||
/client/proc/cmd_admin_say,
|
||||
/client/proc/cmd_admin_subtle_message,
|
||||
/client/proc/dsay,
|
||||
/client/proc/admin_ghost,
|
||||
/client/proc/game_panel,
|
||||
/client/proc/player_panel,
|
||||
/client/proc/unban_panel,
|
||||
/client/proc/jobbans,
|
||||
/client/proc/unjobban_panel,
|
||||
/client/proc/hide_verbs,
|
||||
/client/proc/general_report,
|
||||
/client/proc/air_report,
|
||||
/client/proc/cmd_admin_say,
|
||||
/client/proc/cmd_admin_gib_self,
|
||||
/client/proc/restart_controller,
|
||||
/client/proc/play_local_sound,
|
||||
/client/proc/enable_debug_verbs,
|
||||
/client/proc/toggleprayers,
|
||||
/client/proc/toggle_clickproc, /*TODO ERRORAGE (Temporary proc while the enw clickproc is being tested)*/
|
||||
/client/proc/toggle_hear_deadcast,
|
||||
/client/proc/toggle_hear_radio,
|
||||
/client/proc/player_panel_new,
|
||||
/client/proc/toggle_gravity_on,
|
||||
/client/proc/toggle_gravity_off,
|
||||
/client/proc/toggle_random_events,
|
||||
/client/proc/deadmin_self,
|
||||
/client/proc/jumptocoord,
|
||||
/client/proc/everyone_random,
|
||||
/client/proc/Set_Holiday,
|
||||
/client/proc/giveruntimelog, /*used by coders to retrieve runtime logs*/
|
||||
/client/proc/getserverlog,
|
||||
/client/proc/cinematic, /*show a cinematic sequence*/
|
||||
/client/proc/admin_memo,
|
||||
/client/proc/investigate_show, /*investigate in-game mishaps using various logs.*/
|
||||
/client/proc/toggle_log_hrefs,
|
||||
/client/proc/ToRban,
|
||||
/proc/possess,
|
||||
/proc/release,
|
||||
/client/proc/togglebuildmodeself,
|
||||
/client/proc/kill_airgroup,
|
||||
/client/proc/debug_controller,
|
||||
/client/proc/startSinglo,
|
||||
/client/proc/check_ai_laws,
|
||||
/client/proc/cmd_debug_mob_lists,
|
||||
/datum/admins/proc/access_news_network,
|
||||
/client/proc/one_click_antag,
|
||||
/client/proc/invisimin
|
||||
)
|
||||
//verbs -= /client/proc/mapload
|
||||
//verbs -= /client/proc/cmd_admin_drop_everything --merged with view variables
|
||||
verbs -= /client/proc/make_sound
|
||||
verbs -= /client/proc/only_one
|
||||
verbs -= /client/proc/send_space_ninja
|
||||
verbs -= /client/proc/debug_variables
|
||||
verbs -= /client/proc/cmd_modify_ticker_variables
|
||||
verbs -= /client/proc/Debug2 //debug toggle switch
|
||||
verbs -= /client/proc/toggle_view_range
|
||||
verbs -= /client/proc/Getmob
|
||||
verbs -= /client/proc/Getkey
|
||||
verbs -= /client/proc/sendmob
|
||||
verbs -= /client/proc/Jump
|
||||
verbs -= /client/proc/jumptokey
|
||||
verbs -= /client/proc/jumptomob
|
||||
verbs -= /client/proc/jumptoturf
|
||||
verbs -= /client/proc/cmd_admin_add_freeform_ai_law
|
||||
verbs -= /client/proc/cmd_admin_add_random_ai_law
|
||||
verbs -= /client/proc/cmd_admin_rejuvenate
|
||||
verbs -= /client/proc/cmd_admin_delete
|
||||
verbs -= /client/proc/toggleadminhelpsound
|
||||
//verbs -= /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything
|
||||
verbs -= /client/proc/admin_call_shuttle
|
||||
verbs -= /client/proc/admin_cancel_shuttle
|
||||
verbs -= /client/proc/cmd_admin_dress
|
||||
verbs -= /client/proc/respawn_character
|
||||
verbs -= /client/proc/spawn_xeno
|
||||
verbs -= /client/proc/cmd_admin_add_random_ai_law
|
||||
verbs -= /client/proc/secrets
|
||||
verbs -= /client/proc/check_antagonists
|
||||
verbs -= /client/proc/play_sound
|
||||
verbs -= /client/proc/stealth
|
||||
verbs -= /client/proc/cmd_admin_check_contents
|
||||
verbs -= /client/proc/cmd_admin_create_centcom_report
|
||||
verbs -= /client/proc/deadchat //toggles deadchat
|
||||
//verbs -= /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro
|
||||
verbs -= /client/proc/cmd_admin_pm_context
|
||||
verbs -= /client/proc/cmd_admin_pm_panel
|
||||
verbs -= /client/proc/cmd_admin_say
|
||||
verbs -= /client/proc/cmd_admin_subtle_message
|
||||
//verbs -= /client/proc/warn
|
||||
verbs -= /client/proc/dsay
|
||||
verbs -= /client/proc/admin_ghost
|
||||
verbs -= /client/proc/game_panel
|
||||
verbs -= /client/proc/player_panel
|
||||
verbs -= /client/proc/unban_panel
|
||||
verbs -= /client/proc/jobbans
|
||||
verbs -= /client/proc/unjobban_panel
|
||||
verbs -= /client/proc/hide_verbs
|
||||
verbs -= /client/proc/general_report
|
||||
verbs -= /client/proc/air_report
|
||||
verbs -= /client/proc/cmd_admin_say
|
||||
verbs -= /client/proc/cmd_admin_gib_self
|
||||
verbs -= /client/proc/restart_controller
|
||||
verbs -= /client/proc/play_local_sound
|
||||
verbs -= /client/proc/enable_debug_verbs
|
||||
verbs -= /client/proc/toggleprayers
|
||||
// verbs -= /client/proc/Blobize
|
||||
// verbs -= /client/proc/Blobcount
|
||||
verbs -= /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the enw clickproc is being tested)
|
||||
verbs -= /client/proc/toggle_hear_deadcast
|
||||
verbs -= /client/proc/toggle_hear_radio
|
||||
verbs -= /client/proc/player_panel_new
|
||||
verbs -= /client/proc/toggle_gravity_on
|
||||
verbs -= /client/proc/toggle_gravity_off
|
||||
verbs -= /client/proc/toggle_random_events
|
||||
verbs -= /client/proc/deadmin_self
|
||||
verbs -= /client/proc/jumptocoord
|
||||
verbs -= /client/proc/everyone_random
|
||||
verbs -= /client/proc/Set_Holiday
|
||||
verbs -= /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
||||
verbs -= /client/proc/getserverlog
|
||||
verbs -= /client/proc/cinematic //show a cinematic sequence
|
||||
verbs -= /client/proc/admin_memo
|
||||
verbs -= /client/proc/investigate_show //investigate in-game mishaps using various logs.
|
||||
verbs -= /client/proc/toggle_log_hrefs
|
||||
verbs -= /client/proc/ToRban
|
||||
verbs -= /proc/possess
|
||||
verbs -= /proc/release
|
||||
//verbs -= /client/proc/give_spell --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_ninjafy --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_modify_object_variables --Merged with view variables
|
||||
@@ -440,17 +452,13 @@
|
||||
//verbs -= /client/proc/cmd_admin_attack_log --Merged with view variables
|
||||
//verbs -= /proc/togglebuildmode --Merged with view variables
|
||||
//verbs -= /client/proc/cmd_admin_prison --Merged with player panel
|
||||
//verbs -= /obj/admins/proc/unprison --Merged with player panel
|
||||
//verbs -= /datum/admins/proc/unprison --Merged with player panel
|
||||
//verbs -= /client/proc/cmd_switch_radio --removed because tcommsat is staying
|
||||
verbs -= /client/proc/togglebuildmodeself
|
||||
verbs -= /client/proc/kill_airgroup
|
||||
verbs -= /client/proc/debug_controller
|
||||
verbs -= /client/proc/startSinglo
|
||||
verbs -= /client/proc/check_ai_laws
|
||||
verbs -= /client/proc/cmd_debug_mob_lists
|
||||
verbs -= /obj/admins/proc/access_news_network
|
||||
verbs -= /client/proc/one_click_antag
|
||||
verbs -= /client/proc/invisimin
|
||||
// verbs -= /client/proc/Blobize
|
||||
// verbs -= /client/proc/Blobcount
|
||||
//verbs -= /client/proc/warn
|
||||
//verbs -= /client/proc/cmd_admin_mute --was never used (according to stats trackind) - use show player panel --erro
|
||||
//verbs -= /client/proc/cmd_admin_remove_plasma --This proc is outdated, does not do anything
|
||||
//BS12 Admin Verbs
|
||||
verbs -= /client/proc/update_mob_sprite
|
||||
verbs -= /client/proc/mod_panel
|
||||
@@ -472,11 +480,14 @@
|
||||
ghost.can_reenter_corpse = 1 //just in-case.
|
||||
ghost.reenter_corpse()
|
||||
feedback_add_details("admin_verb","P") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
else if(istype(mob,/mob/new_player))
|
||||
src << "<font color='red'>Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.</font>"
|
||||
else
|
||||
//ghostize
|
||||
var/mob/body = mob
|
||||
body.ghostize(1)
|
||||
if(body) body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus
|
||||
if(body && !body.key)
|
||||
body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus
|
||||
feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -573,30 +584,26 @@
|
||||
/client/proc/colorooc()
|
||||
set category = "Fun"
|
||||
set name = "OOC Text Color"
|
||||
ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color
|
||||
if(holder)
|
||||
var/new_ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color|null
|
||||
if(new_ooccolor) holder.ooccolor = new_ooccolor
|
||||
feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/client/proc/stealth()
|
||||
set category = "Admin"
|
||||
set name = "Stealth Mode"
|
||||
if(!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
stealth = !stealth
|
||||
if(stealth)
|
||||
var/new_key = trim(input("Enter your desired display name.", "Fake Key", key))
|
||||
if(!new_key)
|
||||
stealth = 0
|
||||
return
|
||||
new_key = strip_html(new_key)
|
||||
if(length(new_key) >= 26)
|
||||
new_key = copytext(new_key, 1, 26)
|
||||
fakekey = new_key
|
||||
else
|
||||
fakekey = null
|
||||
log_admin("[key_name(usr)] has turned stealth mode [stealth ? "ON" : "OFF"]")
|
||||
message_admins("[key_name_admin(usr)] has turned stealth mode [stealth ? "ON" : "OFF"]", 1)
|
||||
if(holder)
|
||||
if(holder.fakekey)
|
||||
holder.fakekey = null
|
||||
else
|
||||
var/new_key = ckeyEx(input("Enter your desired display name.", "Fake Key", key) as text|null)
|
||||
if(!new_key) return
|
||||
if(length(new_key) >= 26)
|
||||
new_key = copytext(new_key, 1, 26)
|
||||
holder.fakekey = new_key
|
||||
log_admin("[key_name(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]")
|
||||
message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]", 1)
|
||||
feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/playernotes()
|
||||
@@ -697,8 +704,9 @@
|
||||
/client/proc/toggleadminhelpsound()
|
||||
set name = "Toggle Adminhelp Sound"
|
||||
set category = "Admin"
|
||||
sound_adminhelp = !sound_adminhelp
|
||||
if(sound_adminhelp)
|
||||
if(!holder) return
|
||||
holder.sound_adminhelp = !holder.sound_adminhelp
|
||||
if(holder.sound_adminhelp)
|
||||
usr << "You will now hear a sound when adminhelps arrive"
|
||||
else
|
||||
usr << "You will no longer hear a sound when adminhelps arrive"
|
||||
@@ -735,7 +743,7 @@
|
||||
src << "Restoring admin verbs back"
|
||||
|
||||
var/temp = deadchat
|
||||
clear_admin_verbs()
|
||||
holder.state = null //forces a full verbs update
|
||||
update_admins(holder.rank)
|
||||
deadchat = temp
|
||||
feedback_add_details("admin_verb","TAVVS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -773,13 +781,9 @@
|
||||
|
||||
if(src.holder)
|
||||
if(alert("Confirm self-deadmin for the round? You can't re-admin yourself without someont promoting you.",,"Yes","No") == "Yes")
|
||||
del(holder)
|
||||
log_admin("[src] deadmined themself.")
|
||||
message_admins("[src] deadmined themself.", 1)
|
||||
src.clear_admin_verbs()
|
||||
src.update_admins(null)
|
||||
admins.Remove(src.ckey)
|
||||
admin_list -= src
|
||||
deadmin()
|
||||
usr << "You are now a normal player."
|
||||
feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -816,7 +820,7 @@
|
||||
verbs += /client/proc/cmd_admin_gib_self
|
||||
|
||||
verbs += /client/proc/deadchat //toggles deadchat
|
||||
verbs += /obj/admins/proc/toggleooc //toggle ooc
|
||||
verbs += /datum/admins/proc/toggleooc //toggle ooc
|
||||
verbs += /client/proc/cmd_admin_say//asay
|
||||
verbs += /client/proc/toggleadminhelpsound
|
||||
feedback_add_details("admin_verb","HMV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -836,7 +840,7 @@
|
||||
verbs += /client/proc/show_verbs
|
||||
|
||||
verbs += /client/proc/deadchat //toggles deadchat
|
||||
verbs += /obj/admins/proc/toggleooc //toggle ooc
|
||||
verbs += /datum/admins/proc/toggleooc //toggle ooc
|
||||
verbs += /client/proc/cmd_admin_say//asay
|
||||
feedback_add_details("admin_verb","TAVVH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/var/create_mob_html = null
|
||||
/obj/admins/proc/create_mob(var/mob/user)
|
||||
/datum/admins/proc/create_mob(var/mob/user)
|
||||
if (!create_mob_html)
|
||||
var/mobjs = null
|
||||
mobjs = dd_list2text(typesof(/mob), ";")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/var/create_object_html = null
|
||||
|
||||
/obj/admins/proc/create_object(var/mob/user)
|
||||
/datum/admins/proc/create_object(var/mob/user)
|
||||
if (!create_object_html)
|
||||
var/objectjs = null
|
||||
objectjs = dd_list2text(typesof(/obj), ";")
|
||||
@@ -10,7 +10,7 @@
|
||||
user << browse(dd_replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475")
|
||||
|
||||
|
||||
/obj/admins/proc/quick_create_object(var/mob/user)
|
||||
/datum/admins/proc/quick_create_object(var/mob/user)
|
||||
|
||||
var/quick_create_object_html = null
|
||||
var/pathtext = null
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/var/create_turf_html = null
|
||||
/obj/admins/proc/create_turf(var/mob/user)
|
||||
/datum/admins/proc/create_turf(var/mob/user)
|
||||
if (!create_turf_html)
|
||||
var/turfjs = null
|
||||
turfjs = dd_list2text(typesof(/turf), ";")
|
||||
|
||||
2583
code/modules/admin/holder2.dm
Normal file
@@ -203,7 +203,7 @@ var/savefile/Banlistjob
|
||||
timeleftstring = "[exp] Minutes"
|
||||
return timeleftstring
|
||||
|
||||
/obj/admins/proc/unjobbanpanel()
|
||||
/datum/admins/proc/unjobbanpanel()
|
||||
var/count = 0
|
||||
var/dat
|
||||
//var/dat = "<HR><B>Unban Player:</B> \blue(U) = Unban , (E) = Edit Ban\green (Total<HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >"
|
||||
@@ -217,7 +217,7 @@ var/savefile/Banlistjob
|
||||
dat = "<HR><B>Bans:</B> <FONT COLOR=blue>(U) = Unban , </FONT> - <FONT COLOR=green>([count] Bans)</FONT><HR><table border=1 rules=all frame=void cellspacing=0 cellpadding=3 >[dat]"
|
||||
usr << browse(dat, "window=unbanp;size=875x400")
|
||||
|
||||
/*/obj/admins/proc/permjobban(ckey, computerid, reason, bannedby, temp, minutes, rank)
|
||||
/*/datum/admins/proc/permjobban(ckey, computerid, reason, bannedby, temp, minutes, rank)
|
||||
if(AddBanjob(ckey, computerid, reason, usr.ckey, 0, 0, job))
|
||||
M << "\red<BIG><B>You have been banned from [job] by [usr.client.ckey].\nReason: [reason].</B></BIG>"
|
||||
M << "\red This is a permanent ban."
|
||||
@@ -227,7 +227,7 @@ var/savefile/Banlistjob
|
||||
M << "\red No ban appeals URL has been set."
|
||||
log_admin("[usr.client.ckey] has banned from [job] [ckey].\nReason: [reason]\nThis is a permanent ban.")
|
||||
message_admins("\blue[usr.client.ckey] has banned from [job] [ckey].\nReason: [reason]\nThis is a permanent ban.")
|
||||
/obj/admins/proc/timejobban(ckey, computerid, reason, bannedby, temp, minutes, rank)
|
||||
/datum/admins/proc/timejobban(ckey, computerid, reason, bannedby, temp, minutes, rank)
|
||||
if(AddBanjob(ckey, computerid, reason, usr.ckey, 1, mins, job))
|
||||
M << "\red<BIG><B>You have been jobbanned from [job] by [usr.client.ckey].\nReason: [reason].</B></BIG>"
|
||||
M << "\red This is a temporary ban, it will be removed in [mins] minutes."
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
#define NOTESFILE "data/player_notes.sav" //where the player notes are saved
|
||||
|
||||
obj/admins/proc/notes_show(var/ckey)
|
||||
datum/admins/proc/notes_show(var/ckey)
|
||||
usr << browse("<head><title>Player Notes</title></head><body>[notes_gethtml(ckey)]</body>","window=player_notes;size=700x400")
|
||||
|
||||
|
||||
obj/admins/proc/notes_gethtml(var/ckey)
|
||||
datum/admins/proc/notes_gethtml(var/ckey)
|
||||
var/savefile/notesfile = new(NOTESFILE)
|
||||
if(!notesfile) return "<font color='red'>Error: Cannot access [NOTESFILE]</font>"
|
||||
if(ckey)
|
||||
|
||||
@@ -1,231 +1,8 @@
|
||||
/obj/admins/proc/player_panel_new()//The new one
|
||||
|
||||
/datum/admins/proc/player_panel_new()//The new one
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/dat = "<html><head><title>Player Menu</title></head>"
|
||||
dat += "<body><table border=1 cellspacing=5><B><tr><th>Name/Real Name</th><th>Type</th><th>Assigned Job</th><th>Info</th><th>Options</th><th>Traitor?</th></tr></B>"
|
||||
//add <th>IP:</th> to this if wanting to add back in IP checking
|
||||
//add <td>(IP: [M.lastKnownIP])</td> if you want to know their ip to the lists below
|
||||
var/list/mobs = get_sorted_mobs()
|
||||
var/i = 1
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
if(M.ckey)
|
||||
var/color = "#e6e6e6"
|
||||
i++
|
||||
if(i%2 == 0)
|
||||
color = "#f2f2f2"
|
||||
var/real = (M.name == M.real_name ? "<b>[M.name]/[M.real_name]</b>" : "<b>[M.real_name] (as [M.name]/[M.real_name])</b>")
|
||||
var/turf/T = get_turf(M)
|
||||
var/client_key = (M.key? M.key : "No key")
|
||||
dat += "<tr align='center' bgcolor='[color]'><td>[real] <br>[M.client ? M.client : "No client ([client_key])"] at ([T.x], [T.y], [T.z])</td>" // Adds current name
|
||||
if(isobserver(M))
|
||||
dat += "<td>Ghost</td>"
|
||||
else if(isalien(M))
|
||||
dat += "<td>Alien</td>"
|
||||
else if(islarva(M))
|
||||
dat += "<td>Alien larva</td>"
|
||||
else if(istajaran(M))
|
||||
dat += "<td>Tajaran</td>"
|
||||
else if(ishuman(M))
|
||||
dat += "<td>[M.job]</td>"
|
||||
else if(ismetroid(M))
|
||||
dat += "<td>Metroid</td>"
|
||||
else if(ismonkey(M))
|
||||
dat += "<td>Monkey</td>"
|
||||
else if(isAI(M))
|
||||
dat += "<td>AI</td>"
|
||||
else if(ispAI(M))
|
||||
dat += "<td>pAI</td>"
|
||||
else if(isrobot(M))
|
||||
dat += "<td>Cyborg</td>"
|
||||
else if(isanimal(M))
|
||||
dat += "<td>Animal</td>"
|
||||
else if(iscorgi(M))
|
||||
dat += "<td>Corgi</td>"
|
||||
else if(istype(M,/mob/new_player))
|
||||
dat += "<td>New Player</td>"
|
||||
else
|
||||
dat += "<td>\red ERROR</td>\black"
|
||||
|
||||
if(M.mind && M.mind.assigned_role && istype(M, /mob/living/carbon/human)) // Adds a column to Player Panel that shows their current job.
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
if (H.wear_id)
|
||||
var/obj/item/weapon/card/id/id
|
||||
|
||||
if(istype(H.wear_id, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/PDA = H.wear_id
|
||||
if(!isnull(PDA.id)) // The PDA may contain no ID
|
||||
id = PDA.id // The ID is contained inside the PDA
|
||||
|
||||
else
|
||||
id = H.wear_id // The ID was on the ID slot
|
||||
|
||||
if(!id) // Happens when there's no ID in the PDA located on the wear_id slot
|
||||
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
|
||||
|
||||
else if(isnull(id.assignment)) // Preventing runtime errors blocking the player panel
|
||||
if(istype(id, /obj/item/weapon/card/id/syndicate))
|
||||
dat += "<td><font color=purple>Antagonist</font></td>"
|
||||
else
|
||||
usr << "<font color=red>ERROR:</font> Inform the coders that an [id.name] was checked for its assignment variable, and it was null."
|
||||
dat += "<td><font color=red>ERROR</font></td>"
|
||||
|
||||
else
|
||||
if(M.mind.assigned_role == id.assignment) // Polymorph
|
||||
dat += "<td>[M.mind.assigned_role]</td>"
|
||||
|
||||
else
|
||||
dat += "<td>[M.mind.assigned_role] ([id.assignment])"
|
||||
|
||||
else
|
||||
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
|
||||
|
||||
else
|
||||
dat += "<td>No Assigned Role</td>"
|
||||
|
||||
var/muting = "Not Currently Working"
|
||||
// if(M.client)
|
||||
// muting = {"<A href='?src=\ref[src];mute2=\ref[M]'>Mute: [(M.client.muted ? "Muted" : "Voiced")]</A> |
|
||||
// <A href='?src=\ref[src];mute_complete=\ref[M]'>Complete mute: [(M.client.muted ? "Completely Muted" : "Voiced")]</A>
|
||||
// "}
|
||||
|
||||
dat += {"<td><A HREF='?src=\ref[src];player_info=[M.ckey]'>[player_has_info(M.ckey) ? "Info" : "N/A"] </A></td>
|
||||
<td><A href='?src=\ref[usr];priv_msg=\ref[M]'><b>PM</b></A> |
|
||||
<A HREF='?src=\ref[src];adminplayeropts=\ref[M]'>PP</A> |
|
||||
<A HREF='?src=\ref[src];adminplayervars=\ref[M]'>VV</A> |
|
||||
<A HREF='?src=\ref[src];traitor_panel_pp=\ref[M]'>TP</A> |
|
||||
<A HREF='?src=\ref[src];adminplayersubtlemessage=\ref[M]'>SM</A> |
|
||||
<A HREF='?src=\ref[src];adminplayerobservejump=\ref[M]'>JMP</A></font>
|
||||
<br><font size="2">[muting]</font><br>
|
||||
<font size="2"><A href='?src=\ref[src];warn=\ref[M]'>Warn</A> | <A href='?src=\ref[src];boot2=\ref[M]'>Boot</A> | <A href='?src=\ref[src];newban=\ref[M]'>Ban</A> | <A href='?src=\ref[src];jobban2=\ref[M]'>Jobban</A></td>
|
||||
"}
|
||||
|
||||
switch(is_special_character(M))
|
||||
if(0)
|
||||
dat += {"<td align=center><A HREF='?src=\ref[src];traitor=\ref[M]'>Traitor?</A></td>"}
|
||||
if(1)
|
||||
dat += {"<td align=center><A HREF='?src=\ref[src];traitor=\ref[M]'><font color=red>Traitor?</font></A></td>"}
|
||||
if(2)
|
||||
dat += {"<td align=center><A HREF='?src=\ref[src];traitor=\ref[M]'><font color=red><b>Traitor?</b></font></A></td>"}
|
||||
|
||||
dat += "</table></body></html>"
|
||||
|
||||
usr << browse(dat, "window=players;size=905x600")
|
||||
|
||||
|
||||
/obj/admins/proc/mod_panel()//The new one
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/dat = "<html><head><title>Player Menu</title></head>"
|
||||
dat += "<body><table border=1 cellspacing=5><B><tr><th>Name/Real Name</th><th>IP/CID</th><th>Info</th><th>Options</th><th>Traitor?</th></tr></B>"
|
||||
//add <th>IP:</th> to this if wanting to add back in IP checking <th>Type</th> <th>Assigned Job</th> <th>Traitor?</th>
|
||||
//add <td>(IP: [M.lastKnownIP])</td> if you want to know their ip to the lists below
|
||||
var/list/mobs = get_sorted_mobs()
|
||||
var/i = 1
|
||||
|
||||
for(var/mob/M in mobs)
|
||||
if(M.ckey)
|
||||
var/color = "#e6e6e6"
|
||||
i++
|
||||
if(i%2 == 0)
|
||||
color = "#f2f2f2"
|
||||
var/real = (M.name == M.real_name ? "<b>[M.name]/[M.real_name]</b>" : "<b>[M.real_name] (as [M.name]/[M.real_name])</b>")
|
||||
var/turf/T = get_turf(M)
|
||||
var/client_key = (M.key? M.key : "No key")
|
||||
dat += "<tr align='center' bgcolor='[color]'><td>[real] <br>[M.client ? M.client : "No client ([client_key])"] at ([T.x], [T.y], [T.z])</td>" // Adds current name
|
||||
/* if(isobserver(M))
|
||||
dat += "<td>Ghost</td>"
|
||||
else if(isalien(M))
|
||||
dat += "<td>Alien</td>"
|
||||
else if(islarva(M))
|
||||
dat += "<td>Alien larva</td>"
|
||||
else if(istajaran(M))
|
||||
dat += "<td>Tajaran</td>"
|
||||
else if(ishuman(M))
|
||||
dat += "<td>[M.job]</td>"
|
||||
else if(ismetroid(M))
|
||||
dat += "<td>Metroid</td>"
|
||||
else if(ismonkey(M))
|
||||
dat += "<td>Monkey</td>"
|
||||
else if(isAI(M))
|
||||
dat += "<td>AI</td>"
|
||||
else if(ispAI(M))
|
||||
dat += "<td>pAI</td>"
|
||||
else if(isrobot(M))
|
||||
dat += "<td>Cyborg</td>"
|
||||
else if(isanimal(M))
|
||||
dat += "<td>Animal</td>"
|
||||
else if(iscorgi(M))
|
||||
dat += "<td>Corgi</td>"
|
||||
else if(istype(M,/mob/new_player))
|
||||
dat += "<td>New Player</td>"
|
||||
else
|
||||
dat += "<td>\red ERROR</td>\black"
|
||||
|
||||
if(M.mind && M.mind.assigned_role && istype(M, /mob/living/carbon/human)) // Adds a column to Player Panel that shows their current job.
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
if (H.wear_id)
|
||||
var/obj/item/weapon/card/id/id
|
||||
|
||||
if(istype(H.wear_id, /obj/item/device/pda))
|
||||
var/obj/item/device/pda/PDA = H.wear_id
|
||||
if(!isnull(PDA.id)) // The PDA may contain no ID
|
||||
id = PDA.id // The ID is contained inside the PDA
|
||||
|
||||
else
|
||||
id = H.wear_id // The ID was on the ID slot
|
||||
|
||||
if(!id) // Happens when there's no ID in the PDA located on the wear_id slot
|
||||
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
|
||||
|
||||
else if(isnull(id.assignment)) // Preventing runtime errors blocking the player panel
|
||||
if(istype(id, /obj/item/weapon/card/id/syndicate))
|
||||
dat += "<td><font color=purple>Antagonist</font></td>"
|
||||
else
|
||||
usr << "<font color=red>ERROR:</font> Inform the coders that an [id.name] was checked for its assignment variable, and it was null."
|
||||
dat += "<td><font color=red>ERROR</font></td>"
|
||||
|
||||
else
|
||||
if(M.mind.assigned_role == id.assignment) // Polymorph
|
||||
dat += "<td>[M.mind.assigned_role]</td>"
|
||||
|
||||
else
|
||||
dat += "<td>[M.mind.assigned_role] ([id.assignment])"
|
||||
|
||||
else
|
||||
dat += "<td>[M.mind.assigned_role] (No ID)</td>"
|
||||
|
||||
else
|
||||
dat += "<td>No Assigned Role</td>"
|
||||
*/
|
||||
dat += {"<td>IP: [M.client ? M.client.address : "Disconnected"]<br>
|
||||
CID: [M.client ? M.client.computer_id : "Disconnected"]</td>
|
||||
"}
|
||||
|
||||
dat += {"<td><A HREF='?src=\ref[src];player_info=[M.ckey]'>[player_has_info(M.ckey) ? "Info" : "N/A"] </A></td>
|
||||
<td><A href='?src=\ref[usr];priv_msg=\ref[M]'><b>PM</b></A></td>
|
||||
"}
|
||||
|
||||
switch(is_special_character(M))
|
||||
if(0)
|
||||
dat += {"<td align=center>Loyal</td>"}
|
||||
if(1)
|
||||
dat += {"<td align=center><font color=red>Antag</font></td>"}
|
||||
if(2)
|
||||
dat += {"<td align=center><font color=red><b>Mode-Antag</b></font></td>"}
|
||||
|
||||
dat += "</table></body></html>"
|
||||
|
||||
usr << browse(dat, "window=players;size=600x600")
|
||||
|
||||
|
||||
/* //TG Player Panel
|
||||
/obj/admins/proc/player_panel_new()//The new one
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/dat = "<html><head><title>Player Panel</title></head>"
|
||||
var/dat = "<html><head><title>Admin Player Panel</title></head>"
|
||||
|
||||
//javascript, the part that does most of the work~
|
||||
dat += {"
|
||||
@@ -540,9 +317,329 @@
|
||||
"}
|
||||
|
||||
usr << browse(dat, "window=players;size=600x480")
|
||||
*/
|
||||
|
||||
//this is a direct copy paste
|
||||
/datum/admins/proc/mod_panel()
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/dat = "<html><head><title>Mod Player Panel</title></head>"
|
||||
|
||||
//javascript, the part that does most of the work~
|
||||
dat += {"
|
||||
|
||||
<head>
|
||||
<script type='text/javascript'>
|
||||
|
||||
var locked_tabs = new Array();
|
||||
|
||||
function updateSearch(){
|
||||
|
||||
|
||||
var filter_text = document.getElementById('filter');
|
||||
var filter = filter_text.value.toLowerCase();
|
||||
|
||||
if(complete_list != null && complete_list != ""){
|
||||
var mtbl = document.getElementById("maintable_data_archive");
|
||||
mtbl.innerHTML = complete_list;
|
||||
}
|
||||
|
||||
if(filter.value == ""){
|
||||
return;
|
||||
}else{
|
||||
|
||||
var maintable_data = document.getElementById('maintable_data');
|
||||
var ltr = maintable_data.getElementsByTagName("tr");
|
||||
for ( var i = 0; i < ltr.length; ++i )
|
||||
{
|
||||
try{
|
||||
var tr = ltr\[i\];
|
||||
if(tr.getAttribute("id").indexOf("data") != 0){
|
||||
continue;
|
||||
}
|
||||
var ltd = tr.getElementsByTagName("td");
|
||||
var td = ltd\[0\];
|
||||
var lsearch = td.getElementsByTagName("b");
|
||||
var search = lsearch\[0\];
|
||||
//var inner_span = li.getElementsByTagName("span")\[1\] //Should only ever contain one element.
|
||||
//document.write("<p>"+search.innerText+"<br>"+filter+"<br>"+search.innerText.indexOf(filter))
|
||||
if ( search.innerText.toLowerCase().indexOf(filter) == -1 )
|
||||
{
|
||||
//document.write("a");
|
||||
//ltr.removeChild(tr);
|
||||
td.innerHTML = "";
|
||||
i--;
|
||||
}
|
||||
}catch(err) { }
|
||||
}
|
||||
}
|
||||
|
||||
var count = 0;
|
||||
var index = -1;
|
||||
var debug = document.getElementById("debug");
|
||||
|
||||
locked_tabs = new Array();
|
||||
|
||||
}
|
||||
|
||||
function expand(id,job,name,real_name,image,key,ip,antagonist,ref){
|
||||
|
||||
clearAll();
|
||||
|
||||
var span = document.getElementById(id);
|
||||
|
||||
body = "<table><tr><td>";
|
||||
|
||||
body += "</td><td align='center'>";
|
||||
|
||||
body += "<font size='2'><b>"+job+" "+name+"</b><br><b>Real name "+real_name+"</b><br><b>Played by "+key+" ("+ip+")</b></font>"
|
||||
|
||||
body += "</td><td align='center'>";
|
||||
|
||||
body += "<a href='?src=\ref[src];adminplayeropts="+ref+"'>PP</a> - "
|
||||
body += "<a href='?src=\ref[src];notes=show;mob="+ref+"'>N</a> - "
|
||||
body += "<a href='?src=\ref[src];adminplayervars="+ref+"'>VV</a> - "
|
||||
body += "<a href='?src=\ref[src];traitor_panel_pp="+ref+"'>TP</a> - "
|
||||
body += "<a href='?src=\ref[usr];priv_msg=\ref"+ref+"'>PM</a> - "
|
||||
body += "<a href='?src=\ref[src];adminplayersubtlemessage="+ref+"'>SM</a> - "
|
||||
body += "<a href='?src=\ref[src];adminplayerobservejump="+ref+"'>JMP</a><br>"
|
||||
if(antagonist > 0)
|
||||
body += "<font size='2'><a href='?src=\ref[src];secretsadmin=check_antagonist'><font color='red'><b>Antagonist</b></font></a></font>";
|
||||
|
||||
body += "</td></tr></table>";
|
||||
|
||||
|
||||
span.innerHTML = body
|
||||
}
|
||||
|
||||
function clearAll(){
|
||||
var spans = document.getElementsByTagName('span');
|
||||
for(var i = 0; i < spans.length; i++){
|
||||
var span = spans\[i\];
|
||||
|
||||
var id = span.getAttribute("id");
|
||||
|
||||
if(!(id.indexOf("item")==0))
|
||||
continue;
|
||||
|
||||
var pass = 1;
|
||||
|
||||
for(var j = 0; j < locked_tabs.length; j++){
|
||||
if(locked_tabs\[j\]==id){
|
||||
pass = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(pass != 1)
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
|
||||
span.innerHTML = "";
|
||||
}
|
||||
}
|
||||
|
||||
function addToLocked(id,link_id,notice_span_id){
|
||||
var link = document.getElementById(link_id);
|
||||
var decision = link.getAttribute("name");
|
||||
if(decision == "1"){
|
||||
link.setAttribute("name","2");
|
||||
}else{
|
||||
link.setAttribute("name","1");
|
||||
removeFromLocked(id,link_id,notice_span_id);
|
||||
return;
|
||||
}
|
||||
|
||||
var pass = 1;
|
||||
for(var j = 0; j < locked_tabs.length; j++){
|
||||
if(locked_tabs\[j\]==id){
|
||||
pass = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!pass)
|
||||
return;
|
||||
locked_tabs.push(id);
|
||||
var notice_span = document.getElementById(notice_span_id);
|
||||
notice_span.innerHTML = "<font color='red'>Locked</font> ";
|
||||
//link.setAttribute("onClick","attempt('"+id+"','"+link_id+"','"+notice_span_id+"');");
|
||||
//document.write("removeFromLocked('"+id+"','"+link_id+"','"+notice_span_id+"')");
|
||||
//document.write("aa - "+link.getAttribute("onClick"));
|
||||
}
|
||||
|
||||
function attempt(ab){
|
||||
return ab;
|
||||
}
|
||||
|
||||
function removeFromLocked(id,link_id,notice_span_id){
|
||||
//document.write("a");
|
||||
var index = 0;
|
||||
var pass = 0;
|
||||
for(var j = 0; j < locked_tabs.length; j++){
|
||||
if(locked_tabs\[j\]==id){
|
||||
pass = 1;
|
||||
index = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!pass)
|
||||
return;
|
||||
locked_tabs\[index\] = "";
|
||||
var notice_span = document.getElementById(notice_span_id);
|
||||
notice_span.innerHTML = "";
|
||||
//var link = document.getElementById(link_id);
|
||||
//link.setAttribute("onClick","addToLocked('"+id+"','"+link_id+"','"+notice_span_id+"')");
|
||||
}
|
||||
|
||||
function selectTextField(){
|
||||
var filter_text = document.getElementById('filter');
|
||||
filter_text.focus();
|
||||
filter_text.select();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
"}
|
||||
|
||||
//body tag start + onload and onkeypress (onkeyup) javascript event calls
|
||||
dat += "<body onload='selectTextField(); updateSearch();' onkeyup='updateSearch();'>"
|
||||
|
||||
//title + search bar
|
||||
dat += {"
|
||||
|
||||
<table width='560' align='center' cellspacing='0' cellpadding='5' id='maintable'>
|
||||
<tr id='title_tr'>
|
||||
<td align='center'>
|
||||
<font size='5'><b>Player panel</b></font><br>
|
||||
Hover over a line to see more information - <a href='?src=\ref[src];secretsadmin=check_antagonist'>Check antagonists</a>
|
||||
<p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='search_tr'>
|
||||
<td align='center'>
|
||||
<b>Search:</b> <input type='text' id='filter' value='' style='width:300px;'>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
"}
|
||||
|
||||
//player table header
|
||||
dat += {"
|
||||
<span id='maintable_data_archive'>
|
||||
<table width='560' align='center' cellspacing='0' cellpadding='5' id='maintable_data'>"}
|
||||
|
||||
var/list/mobs = sortmobs()
|
||||
var/i = 1
|
||||
for(var/mob/M in mobs)
|
||||
if(M.ckey)
|
||||
|
||||
var/color = "#e6e6e6"
|
||||
if(i%2 == 0)
|
||||
color = "#f2f2f2"
|
||||
var/is_antagonist = is_special_character(M)
|
||||
|
||||
var/M_job = ""
|
||||
|
||||
if(isliving(M))
|
||||
|
||||
if(iscarbon(M)) //Carbon stuff
|
||||
if(ishuman(M))
|
||||
M_job = M.job
|
||||
else if(ismetroid(M))
|
||||
M_job = "Metroid"
|
||||
else if(ismonkey(M))
|
||||
M_job = "Monkey"
|
||||
else if(isalien(M)) //aliens
|
||||
if(islarva(M))
|
||||
M_job = "Alien larva"
|
||||
else
|
||||
M_job = "Alien"
|
||||
else
|
||||
M_job = "Carbon-based"
|
||||
|
||||
else if(issilicon(M)) //silicon
|
||||
if(isAI(M))
|
||||
M_job = "AI"
|
||||
else if(ispAI(M))
|
||||
M_job = "pAI"
|
||||
else if(isrobot(M))
|
||||
M_job = "Cyborg"
|
||||
else
|
||||
M_job = "Silicon-based"
|
||||
|
||||
else if(isanimal(M)) //simple animals
|
||||
if(iscorgi(M))
|
||||
M_job = "Corgi"
|
||||
else
|
||||
M_job = "Animal"
|
||||
|
||||
else
|
||||
M_job = "Living"
|
||||
|
||||
else if(istype(M,/mob/new_player))
|
||||
M_job = "New player"
|
||||
|
||||
else if(isobserver(M))
|
||||
M_job = "Ghost"
|
||||
|
||||
M_job = dd_replacetext(M_job, "'", "")
|
||||
M_job = dd_replacetext(M_job, "\"", "")
|
||||
M_job = dd_replacetext(M_job, "\\", "")
|
||||
|
||||
var/M_name = M.name
|
||||
M_name = dd_replacetext(M_name, "'", "")
|
||||
M_name = dd_replacetext(M_name, "\"", "")
|
||||
M_name = dd_replacetext(M_name, "\\", "")
|
||||
var/M_rname = M.real_name
|
||||
M_rname = dd_replacetext(M_rname, "'", "")
|
||||
M_rname = dd_replacetext(M_rname, "\"", "")
|
||||
M_rname = dd_replacetext(M_rname, "\\", "")
|
||||
|
||||
var/M_key = M.key
|
||||
M_key = dd_replacetext(M_key, "'", "")
|
||||
M_key = dd_replacetext(M_key, "\"", "")
|
||||
M_key = dd_replacetext(M_key, "\\", "")
|
||||
|
||||
//output for each mob
|
||||
dat += {"
|
||||
|
||||
<tr id='data[i]' name='[i]' onClick="addToLocked('item[i]','data[i]','notice_span[i]')">
|
||||
<td align='center' bgcolor='[color]'>
|
||||
<span id='notice_span[i]'></span>
|
||||
<a id='link[i]'
|
||||
onmouseover='expand("item[i]","[M_job]","[M_name]","[M_rname]","--unused--","[M_key]","[M.lastKnownIP]",[is_antagonist],"\ref[M]")'
|
||||
>
|
||||
<b id='search[i]'>[M_name] - [M_rname] - [M_key] ([M_job])</b>
|
||||
</a>
|
||||
<br><span id='item[i]'></span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
"}
|
||||
|
||||
i++
|
||||
|
||||
|
||||
//player table ending
|
||||
dat += {"
|
||||
</table>
|
||||
</span>
|
||||
|
||||
<script type='text/javascript'>
|
||||
var maintable = document.getElementById("maintable_data_archive");
|
||||
var complete_list = maintable.innerHTML;
|
||||
</script>
|
||||
</body></html>
|
||||
"}
|
||||
|
||||
usr << browse(dat, "window=players;size=600x480")
|
||||
|
||||
//The old one
|
||||
/obj/admins/proc/player_panel_old()
|
||||
/datum/admins/proc/player_panel_old()
|
||||
if (!usr.client.holder)
|
||||
return
|
||||
var/dat = "<html><head><title>Player Menu</title></head>"
|
||||
@@ -601,7 +698,7 @@
|
||||
|
||||
|
||||
|
||||
/obj/admins/proc/check_antagonists()
|
||||
/datum/admins/proc/check_antagonists()
|
||||
if (ticker && ticker.current_state >= GAME_STATE_PLAYING)
|
||||
var/dat = "<html><head><title>Round Status</title></head><body><h1><B>Round Status</B></h1>"
|
||||
dat += "Current Game Mode: <B>[ticker.mode.name]</B><BR>"
|
||||
@@ -716,4 +813,4 @@
|
||||
dat += "</body></html>"
|
||||
usr << browse(dat, "window=roundstatus;size=400x500")
|
||||
else
|
||||
alert("The game hasn't started yet!")
|
||||
alert("The game hasn't started yet!")
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/client/proc/restartcontroller()
|
||||
set category = "Debug"
|
||||
set name = "Restart Master Controller"
|
||||
if(!holder) return
|
||||
switch(alert("Are you sure? If the control is still running it will now be running twice.",,"Yes","No"))
|
||||
if("Yes")
|
||||
src = null
|
||||
usr = null //weird things were happening after restarting MC.
|
||||
spawn(0)
|
||||
master_controller.process()
|
||||
if("No")
|
||||
return 0
|
||||
feedback_add_details("admin_verb","RMC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/client/proc/debug_master_controller()
|
||||
set category = "Debug"
|
||||
set name = "Debug Master Controller"
|
||||
debug_variables(master_controller)
|
||||
feedback_add_details("admin_verb","DMC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
@@ -7,8 +7,8 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
set category = "Admin"
|
||||
set name = "Adminhelp"
|
||||
|
||||
if (muted_adminhelp)
|
||||
src << "<font color='red'>Error: Admin-PM: You cannot send adminhelps (Muted by admins).</font>"
|
||||
if(muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You cannot send adminhelps (Muted).</font>"
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
@@ -97,7 +97,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
admin_number++
|
||||
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
|
||||
admin_number_afk++
|
||||
if(X.sound_adminhelp)
|
||||
if(X.holder.sound_adminhelp)
|
||||
X << 'sound/effects/adminhelp.ogg'
|
||||
var/check_laws_text = ""
|
||||
if(ai_found)
|
||||
@@ -114,7 +114,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an", "monkey", "ali
|
||||
admin_number++
|
||||
if( X.inactivity > AFK_THRESHOLD ) //When I made this, the AFK_THRESHOLD was 3000ds = 300s = 5m, see setup.dm for the new one.
|
||||
admin_number_afk++
|
||||
if(X.sound_adminhelp)
|
||||
if(X.holder.sound_adminhelp)
|
||||
X << 'sound/effects/adminhelp.ogg'
|
||||
var/msg_to_send = "\blue <b><font color=red>HELP: </font>[key_name(src, X)] (<A HREF='?src=\ref[X.holder];adminplayervars=[ref_client]'>VV</A>) (<A HREF='?src=\ref[X.holder];secretsadmin=check_antagonist'>CA</A>):</b> [msg]"
|
||||
msg_to_send = dd_replacetext(msg_to_send, "HOLDERREF", "\ref[X.holder]")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
//allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm
|
||||
/client/proc/cmd_admin_pm_context(mob/M as mob in mob_list)
|
||||
set category = null
|
||||
@@ -118,3 +119,116 @@
|
||||
for(var/client/X) //there are fewer clients than mobs
|
||||
if(X.holder && X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient
|
||||
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]:</B> \blue [msg]</font>" //inform X
|
||||
=======
|
||||
//allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm
|
||||
/client/proc/cmd_admin_pm_context(mob/M as mob in mob_list)
|
||||
set category = null
|
||||
set name = "Admin PM Mob"
|
||||
if(!holder)
|
||||
src << "<font color='red'>Error: Admin-PM-Context: Only administrators may use this command.</font>"
|
||||
return
|
||||
if( !ismob(M) || !M.client ) return
|
||||
cmd_admin_pm(M.client,null)
|
||||
feedback_add_details("admin_verb","APMM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
//shows a list of clients we could send PMs to, then forwards our choice to cmd_admin_pm
|
||||
/client/proc/cmd_admin_pm_panel()
|
||||
set category = "Admin"
|
||||
set name = "Admin PM"
|
||||
if(!holder)
|
||||
src << "<font color='red'>Error: Admin-PM-Panel: Only administrators may use this command.</font>"
|
||||
return
|
||||
var/list/client/targets[0]
|
||||
for(var/client/T)
|
||||
if(T.mob)
|
||||
if(istype(T.mob, /mob/new_player))
|
||||
targets["(New Player) - [T]"] = T
|
||||
else if(istype(T.mob, /mob/dead/observer))
|
||||
targets["[T.mob.name](Ghost) - [T]"] = T
|
||||
else
|
||||
targets["[T.mob.real_name](as [T.mob.name]) - [T]"] = T
|
||||
else
|
||||
targets["(No Mob) - [T]"] = T
|
||||
var/list/sorted = sortList(targets)
|
||||
var/target = input(src,"To whom shall we send a message?","Admin PM",null) in sorted|null
|
||||
cmd_admin_pm(targets[target],null)
|
||||
feedback_add_details("admin_verb","APM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
//takes input from cmd_admin_pm_context, cmd_admin_pm_panel or /client/Topic and sends them a PM.
|
||||
//Fetching a message if needed. src is the sender and C is the target client
|
||||
/client/proc/cmd_admin_pm(var/client/C, var/msg)
|
||||
if(src.muted & MUTE_ADMINHELP)
|
||||
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
|
||||
return
|
||||
|
||||
if( !C || !istype(C,/client) )
|
||||
if(holder) src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
|
||||
else adminhelp(msg) //admin we are replying to left. adminhelp instead
|
||||
return
|
||||
|
||||
//get message text, limit it's length.and clean/escape html
|
||||
if(!msg)
|
||||
msg = input(src,"Message:", "Private message to [C.key]") as text|null
|
||||
|
||||
if(!msg) return
|
||||
if(!C)
|
||||
if(holder) src << "<font color='red'>Error: Admin-PM: Client not found.</font>"
|
||||
else adminhelp(msg) //admin we are replying to has vanished, adminhelp instead
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
return
|
||||
|
||||
//clean the message if it's not sent by a GA or GM
|
||||
if( !holder || !(holder.rank in list("Game Admin", "Game Master")) )
|
||||
msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN))
|
||||
if(!msg) return
|
||||
|
||||
if(C.holder)
|
||||
if(holder) //both are admins
|
||||
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
|
||||
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
|
||||
|
||||
else //recipient is an admin but sender is not
|
||||
C << "<font color='red'>Reply PM from-<b>[key_name(src, C, 1)]</b>: [msg]</font>"
|
||||
src << "<font color='blue'>PM to-<b>Admins</b>: [msg]</font>"
|
||||
|
||||
//play the recieving admin the adminhelp sound (if they have them enabled)
|
||||
if(C.holder.sound_adminhelp)
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
|
||||
else
|
||||
if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT
|
||||
C << "<font color='red' size='4'><b>-- Administrator private message --</b></font>"
|
||||
C << "<font color='red'>Admin PM from-<b>[key_name(src, C, 0)]</b>: [msg]</font>"
|
||||
C << "<font color='red'><i>Click on the administrator's name to reply.</i></font>"
|
||||
src << "<font color='blue'>Admin PM to-<b>[key_name(C, src, 1)]</b>: [msg]</font>"
|
||||
|
||||
//always play non-admin recipients the adminhelp sound
|
||||
C << 'sound/effects/adminhelp.ogg'
|
||||
|
||||
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
|
||||
if(config.popup_admin_pm)
|
||||
spawn() //so we don't hold the caller proc up
|
||||
var/sender = src
|
||||
var/sendername = key
|
||||
var/reply = input(C, msg,"Admin PM from-[sendername]", "") as text|null //show message and await a reply
|
||||
if(C && reply)
|
||||
if(sender)
|
||||
C.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
|
||||
else
|
||||
adminhelp(reply) //sender has left, adminhelp instead
|
||||
return
|
||||
|
||||
else //neither are admins
|
||||
src << "<font color='red'>Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.</font>"
|
||||
return
|
||||
|
||||
log_admin("PM: [key_name(src)]->[key_name(C)]: [msg]")
|
||||
|
||||
//we don't use message_admins here because the sender/receiver might get it too
|
||||
for(var/client/X) //there are fewer clients than mobs
|
||||
if(X.holder && X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient
|
||||
X << "<B><font color='blue'>PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]:</B> \blue [msg]</font>" //inform X
|
||||
>>>>>>> remotes/git-svn
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
if (src.muted_adminhelp)
|
||||
src << "You cannot send ASAY messages (muted by admins)."
|
||||
if (src.muted & MUTE_ADMINHELP)
|
||||
src << "You cannot send ASAY messages (muted)."
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
return
|
||||
if(!src.mob)
|
||||
return
|
||||
if(src.muted_deadchat)
|
||||
src << "\red You cannot send DSAY messages (muted by admins)."
|
||||
if(src.muted & MUTE_DEADCHAT)
|
||||
src << "\red You cannot send DSAY messages (muted)."
|
||||
return
|
||||
|
||||
if (src.handle_spam_prevention(msg,MUTE_DEADCHAT))
|
||||
@@ -20,7 +20,7 @@
|
||||
if (!msg)
|
||||
return
|
||||
|
||||
var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>ADMIN([src.stealth ? pick("BADMIN", "hornigranny", "TLF", "scaredforshadows", "KSI", "Silnazi", "HerpEs", "BJ69", "SpoofedEdd", "Uhangay", "Wario90900", "Regarity", "MissPhareon", "LastFish", "unMportant", "Deurpyn", "Fatbeaver") : src.key])</span> says, <span class='message'>\"[msg]\"</span></span>"
|
||||
var/rendered = "<span class='game deadsay'><span class='prefix'>DEAD:</span> <span class='name'>ADMIN([src.holder.fakekey ? pick("BADMIN", "hornigranny", "TLF", "scaredforshadows", "KSI", "Silnazi", "HerpEs", "BJ69", "SpoofedEdd", "Uhangay", "Wario90900", "Regarity", "MissPhareon", "LastFish", "unMportant", "Deurpyn", "Fatbeaver") : src.key])</span> says, <span class='message'>\"[msg]\"</span></span>"
|
||||
|
||||
for (var/mob/M in player_list)
|
||||
if (istype(M, /mob/new_player))
|
||||
|
||||
@@ -170,24 +170,7 @@
|
||||
|
||||
message_admins("[usr] manually reloaded admins.txt")
|
||||
usr << "You reload admins.txt"
|
||||
var/text = file2text("config/admins.txt")
|
||||
if (!text)
|
||||
diary << "Failed to reload config/admins.txt\n"
|
||||
else
|
||||
var/list/lines = dd_text2list(text, "\n")
|
||||
for(var/line in lines)
|
||||
if (!line)
|
||||
continue
|
||||
|
||||
if (copytext(line, 1, 2) == ";")
|
||||
continue
|
||||
|
||||
var/pos = findtext(line, " - ", 1, null)
|
||||
if (pos)
|
||||
var/m_key = copytext(line, 1, pos)
|
||||
var/a_lev = copytext(line, pos + 3, length(line) + 1)
|
||||
admins[m_key] = a_lev
|
||||
diary << ("ADMIN: [m_key] = [a_lev]")
|
||||
world.load_admins()
|
||||
feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
//todo:
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
//Other log stuff put here for the sake of organisation
|
||||
|
||||
//Shows today's server log
|
||||
/obj/admins/proc/view_txt_log()
|
||||
/datum/admins/proc/view_txt_log()
|
||||
set category = "Admin"
|
||||
set name = "Show Server Log"
|
||||
set desc = "Shows today's server log."
|
||||
@@ -127,7 +127,7 @@
|
||||
return
|
||||
|
||||
//Shows today's attack log
|
||||
/obj/admins/proc/view_atk_log()
|
||||
/datum/admins/proc/view_atk_log()
|
||||
set category = "Admin"
|
||||
set name = "Show Server Attack Log"
|
||||
set desc = "Shows today's server attack log."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var/list/forbidden_varedit_object_types = list(
|
||||
/obj/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea.
|
||||
/datum/admins, //Admins editing their own admin-power object? Yup, sounds like a good idea.
|
||||
/obj/machinery/blackbox_recorder, //Prevents people messing with feedback gathering
|
||||
/datum/feedback_variable //Prevents people messing with feedback gathering
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ client/proc/one_click_antag()
|
||||
return
|
||||
|
||||
|
||||
/obj/admins/proc/one_click_antag()
|
||||
/datum/admins/proc/one_click_antag()
|
||||
|
||||
var/dat = {"<B>One-click Antagonist</B><br>
|
||||
<a href='?src=\ref[src];makeAntag=1'>Make Tratiors</a><br>
|
||||
@@ -32,7 +32,7 @@ client/proc/one_click_antag()
|
||||
return
|
||||
|
||||
|
||||
/obj/admins/proc/makeMalfAImode()
|
||||
/datum/admins/proc/makeMalfAImode()
|
||||
|
||||
var/list/mob/living/silicon/AIs = list()
|
||||
var/mob/living/silicon/malfAI = null
|
||||
@@ -53,7 +53,7 @@ client/proc/one_click_antag()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/admins/proc/makeTratiors()
|
||||
/datum/admins/proc/makeTratiors()
|
||||
var/datum/game_mode/traitor/temp = new
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
@@ -89,7 +89,7 @@ client/proc/one_click_antag()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/admins/proc/makeChanglings()
|
||||
/datum/admins/proc/makeChanglings()
|
||||
|
||||
var/datum/game_mode/changeling/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
@@ -124,7 +124,7 @@ client/proc/one_click_antag()
|
||||
|
||||
return 0
|
||||
|
||||
/obj/admins/proc/makeRevs()
|
||||
/datum/admins/proc/makeRevs()
|
||||
|
||||
var/datum/game_mode/revolution/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
@@ -158,7 +158,7 @@ client/proc/one_click_antag()
|
||||
|
||||
return 0
|
||||
|
||||
/obj/admins/proc/makeWizard()
|
||||
/datum/admins/proc/makeWizard()
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
@@ -194,7 +194,7 @@ client/proc/one_click_antag()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/admins/proc/makeCult()
|
||||
/datum/admins/proc/makeCult()
|
||||
|
||||
var/datum/game_mode/cult/temp = new
|
||||
if(config.protect_roles_from_antagonist)
|
||||
@@ -232,7 +232,7 @@ client/proc/one_click_antag()
|
||||
|
||||
|
||||
|
||||
/obj/admins/proc/makeNukeTeam()
|
||||
/datum/admins/proc/makeNukeTeam()
|
||||
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
@@ -325,15 +325,15 @@ client/proc/one_click_antag()
|
||||
|
||||
|
||||
|
||||
/obj/admins/proc/makeAliens()
|
||||
/datum/admins/proc/makeAliens()
|
||||
alien_infestation(3)
|
||||
return 1
|
||||
|
||||
/obj/admins/proc/makeSpaceNinja()
|
||||
/datum/admins/proc/makeSpaceNinja()
|
||||
space_ninja_arrival()
|
||||
return 1
|
||||
|
||||
/obj/admins/proc/makeDeathsquad()
|
||||
/datum/admins/proc/makeDeathsquad()
|
||||
var/list/mob/dead/observer/candidates = list()
|
||||
var/mob/dead/observer/theghost = null
|
||||
var/time_passed = world.time
|
||||
@@ -401,7 +401,7 @@ client/proc/one_click_antag()
|
||||
return 1
|
||||
|
||||
|
||||
/obj/admins/proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
/datum/admins/proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
|
||||
if(!G_found || !G_found.key) return
|
||||
|
||||
//First we spawn a dude.
|
||||
@@ -423,7 +423,7 @@ client/proc/one_click_antag()
|
||||
|
||||
return new_character
|
||||
|
||||
/obj/admins/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
|
||||
/datum/admins/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
|
||||
var/mob/living/carbon/human/new_syndicate_commando = new(spawn_location.loc)
|
||||
var/syndicate_commando_leader_rank = pick("Lieutenant", "Captain", "Major")
|
||||
var/syndicate_commando_rank = pick("Corporal", "Sergeant", "Staff Sergeant", "Sergeant 1st Class", "Master Sergeant", "Sergeant Major")
|
||||
|
||||
@@ -6,10 +6,8 @@
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
|
||||
var/sound/uploaded_sound = sound(S,0,1,0)
|
||||
uploaded_sound.channel = 777
|
||||
uploaded_sound.priority = 255
|
||||
uploaded_sound.wait = 1
|
||||
var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777)
|
||||
uploaded_sound.priority = 250
|
||||
|
||||
if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin" || src.holder.rank == "Badmin")
|
||||
log_admin("[key_name(src)] played sound [S]")
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
return
|
||||
|
||||
if (usr.client)
|
||||
if(usr.client.muted_pray)
|
||||
if(usr.client.muted & MUTE_PRAY)
|
||||
usr << "\red You cannot pray (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(msg,MUTE_PRAY))
|
||||
|
||||
@@ -123,73 +123,55 @@
|
||||
message_admins("[key_name_admin(usr)] has toggled [key_name_admin(M)]'s nodamage to [(M.nodamage ? "On" : "Off")]", 1)
|
||||
feedback_add_details("admin_verb","GOD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
|
||||
if(!automute)
|
||||
if(usr && usr.client)
|
||||
if(!usr.client.holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
if (M.client && M.client.holder && (M.client.holder.level >= usr.client.holder.level))
|
||||
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
|
||||
return
|
||||
if(!M.client)
|
||||
src << "This mob doesn't have a client tied to it."
|
||||
if(automute)
|
||||
if(!config.automute_on) return
|
||||
else
|
||||
if(!usr || !usr.client)
|
||||
return
|
||||
if(!usr.client.holder)
|
||||
usr << "<font color='red'>Error: cmd_admin_mute: You don't have permission to do this.</font>"
|
||||
return
|
||||
if(!M.client)
|
||||
usr << "<font color='red'>Error: cmd_admin_mute: This mob doesn't have a client tied to it.</font>"
|
||||
if(M.client.holder)
|
||||
usr << "<font color='red'>Error: cmd_admin_mute: You cannot mute an admin.</font>"
|
||||
if(!M.client) return
|
||||
if(M.client.holder) return
|
||||
|
||||
var/muteunmute
|
||||
var/mute_string
|
||||
|
||||
switch(mute_type)
|
||||
if(MUTE_IC) mute_string = "IC (say and emote)"
|
||||
if(MUTE_OOC) mute_string = "OOC"
|
||||
if(MUTE_PRAY) mute_string = "pray"
|
||||
if(MUTE_ADMINHELP) mute_string = "adminhelp, admin PM and ASAY"
|
||||
if(MUTE_DEADCHAT) mute_string = "deadchat and DSAY"
|
||||
if(MUTE_ALL) mute_string = "everything"
|
||||
else return
|
||||
|
||||
if(automute)
|
||||
muteunmute = "auto-muted"
|
||||
M.client.muted |= mute_type
|
||||
log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(M)] from [mute_string]")
|
||||
message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(M)] from [mute_string].", 1)
|
||||
M << "You have been [muteunmute] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin."
|
||||
feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
var/muteunmute = 0 //0 = unmuted; 1 = muted
|
||||
var/mute_string = "unknown"
|
||||
|
||||
//The '| automute' thing ensures that if an automute is being applied by code, it always mutes to prevent any potential for automute to unmute someone who was muted.
|
||||
switch(mute_type)
|
||||
if(MUTE_IC)
|
||||
M.client.muted_ic = !M.client.muted_ic | automute
|
||||
muteunmute = M.client.muted_ic
|
||||
mute_string = "IC (say and emote)"
|
||||
if(MUTE_OOC)
|
||||
M.client.muted_ooc = !M.client.muted_ooc | automute
|
||||
muteunmute = M.client.muted_ooc
|
||||
mute_string = "OOC"
|
||||
if(MUTE_PRAY)
|
||||
M.client.muted_pray = !M.client.muted_pray | automute
|
||||
muteunmute = M.client.muted_pray
|
||||
mute_string = "pray"
|
||||
if(MUTE_ADMINHELP)
|
||||
M.client.muted_adminhelp = !M.client.muted_adminhelp | automute
|
||||
muteunmute = M.client.muted_adminhelp
|
||||
mute_string = "adminhelp, admin PM and ASAY"
|
||||
if(MUTE_DEADCHAT)
|
||||
M.client.muted_deadchat = !M.client.muted_deadchat | automute
|
||||
muteunmute = M.client.muted_deadchat
|
||||
mute_string = "deadchat and DSAY"
|
||||
if(MUTE_ALL)
|
||||
mute_string = "everything"
|
||||
if( M.client.muted_ic )
|
||||
M.client.muted_ic = 1
|
||||
M.client.muted_ooc = 1
|
||||
M.client.muted_pray = 1
|
||||
M.client.muted_adminhelp = 1
|
||||
M.client.muted_deadchat = 1
|
||||
muteunmute = 1
|
||||
else
|
||||
M.client.muted_ic = 0
|
||||
M.client.muted_ooc = 0
|
||||
M.client.muted_pray = 0
|
||||
M.client.muted_adminhelp = 0
|
||||
M.client.muted_deadchat = 0
|
||||
muteunmute = 0
|
||||
|
||||
if(!automute)
|
||||
log_admin("[key_name(usr)] has [(muteunmute ? "muted" : "voiced")] [key_name(M)] from [mute_string]")
|
||||
message_admins("[key_name_admin(usr)] has [(muteunmute ? "muted" : "voiced")] [key_name_admin(M)] from [mute_string].", 1)
|
||||
|
||||
M << "You have been [(muteunmute ? "muted" : "voiced")] from [mute_string] by [(usr.client.stealth)?"an admin":"[usr.client]"]."
|
||||
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
if(M.client.muted & mute_type)
|
||||
muteunmute = "unmuted"
|
||||
M.client.muted &= ~mute_type
|
||||
else
|
||||
log_admin("SPAM AUTOMUTE: [(muteunmute ? "muted" : "voiced")] [key_name(M)] from [mute_string]")
|
||||
message_admins("SPAM AUTOMUTE: [(muteunmute ? "muted" : "voiced")] [key_name_admin(M)] from [mute_string].", 1)
|
||||
muteunmute = "muted"
|
||||
M.client.muted |= mute_type
|
||||
|
||||
M << "You have been [(muteunmute ? "muted" : "voiced")] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin."
|
||||
feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] has [muteunmute] [key_name(M)] from [mute_string]")
|
||||
message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(M)] from [mute_string].", 1)
|
||||
M << "You have been [muteunmute] from [mute_string]."
|
||||
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
/client/proc/cmd_admin_add_random_ai_law()
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
signal()
|
||||
return 1
|
||||
|
||||
update_icon()
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
return
|
||||
|
||||
interact(mob/user as mob, flag1)
|
||||
var/t1 = "-------"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
//Some of this is being changed to a datum to cut down on uneccessary variables at the client level. ~Carn
|
||||
/client
|
||||
////////////////
|
||||
@@ -58,3 +59,54 @@
|
||||
|
||||
|
||||
|
||||
=======
|
||||
/client
|
||||
////////////////
|
||||
//ADMIN THINGS//
|
||||
////////////////
|
||||
var/datum/admins/holder = null
|
||||
var/buildmode = 0
|
||||
var/seeprayers = 0
|
||||
|
||||
var/muted = 0
|
||||
|
||||
var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming.
|
||||
var/last_message_count = 0 //contins a number of how many times a message identical to last_message was sent.
|
||||
|
||||
var/warned = 0
|
||||
|
||||
/////////
|
||||
//OTHER//
|
||||
/////////
|
||||
var/listen_ooc = 1
|
||||
var/move_delay = 1
|
||||
var/moving = null
|
||||
var/adminobs = null
|
||||
var/deadchat = 0
|
||||
var/changes = 0
|
||||
var/area = null
|
||||
var/played = 0
|
||||
var/be_alien = 0 //Check if that guy wants to be an alien
|
||||
var/be_pai = 1 //Consider client when searching for players to recruit as a pAI
|
||||
var/activeslot = 1 //Default active slot!
|
||||
var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security
|
||||
var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security
|
||||
|
||||
///////////////
|
||||
//SOUND STUFF//
|
||||
///////////////
|
||||
var/canplaysound = 1
|
||||
var/ambience_playing= null
|
||||
var/no_ambi = 0 //Toggle Ambience
|
||||
var/midis = 1 //Toggle Midis
|
||||
|
||||
////////////
|
||||
//SECURITY//
|
||||
////////////
|
||||
var/next_allowed_topic_time = 10
|
||||
// comment out the line below when debugging locally to enable the options & messages menu
|
||||
control_freak = 1
|
||||
|
||||
|
||||
|
||||
>>>>>>> remotes/git-svn
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
if( findtext(href,"<script",1,0) )
|
||||
world.log << "Attempted use of scripts within a topic call, by [src]"
|
||||
message_admins("Attempted use of scripts within a topic call, by [src]")
|
||||
del(usr)
|
||||
//del(usr)
|
||||
return
|
||||
|
||||
//Admin PM
|
||||
@@ -55,7 +55,7 @@
|
||||
..() //redirect to [locate(hsrc)]/Topic()
|
||||
|
||||
/client/proc/handle_spam_prevention(var/message, var/mute_type)
|
||||
if(src.last_message == message)
|
||||
if(config.automute_on && !holder && src.last_message == message)
|
||||
src.last_message_count++
|
||||
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
|
||||
src << "\red You have exceeded the spam filter limit for identical messages. An auto-mute was applied."
|
||||
@@ -103,22 +103,23 @@
|
||||
host = key
|
||||
world.update_status()
|
||||
|
||||
..() //calls mob.Login()
|
||||
//makejson()
|
||||
|
||||
if(custom_event_msg && custom_event_msg != "")
|
||||
..() //calls mob.Login() //makejson() if(custom_event_msg && custom_event_msg != "")
|
||||
src << "<h1 class='alert'>Custom Event</h1>"
|
||||
src << "<h2 class='alert'>A custom event is taking place. OOC Info:</h2>"
|
||||
src << "<span class='alert'>[html_encode(custom_event_msg)]</span>"
|
||||
src << "<br>"
|
||||
|
||||
//Admin Authorisation
|
||||
if( ckey in admins )
|
||||
holder = new /obj/admins(src)
|
||||
holder.rank = admins[ckey]
|
||||
var/datum/admins/Admin_Obj = admins[ckey]
|
||||
if(istype(Admin_Obj))
|
||||
admin_list += src
|
||||
update_admins(admins[ckey])
|
||||
holder = Admin_Obj
|
||||
holder.owner = src
|
||||
holder.state = null
|
||||
|
||||
..() //calls mob.Login()
|
||||
|
||||
if(holder)
|
||||
admin_memo_show()
|
||||
|
||||
log_client_to_db()
|
||||
@@ -128,11 +129,9 @@
|
||||
//DISCONNECT//
|
||||
//////////////
|
||||
/client/Del()
|
||||
|
||||
spawn(0)
|
||||
if(holder)
|
||||
admin_list -= src
|
||||
del(holder)
|
||||
if(holder)
|
||||
holder.state = null
|
||||
admin_list -= src
|
||||
client_list -= src
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -1,7 +1,2 @@
|
||||
/mob/dead/observer/Login()
|
||||
..()
|
||||
if(client.holder && client.holder.state != 2)
|
||||
client.holder.state = 2
|
||||
var/rank = client.holder.rank
|
||||
client.clear_admin_verbs()
|
||||
client.update_admins(rank)
|
||||
..()
|
||||
@@ -10,8 +10,8 @@
|
||||
log_say("Ghost/[src.key] : [message]")
|
||||
|
||||
if (src.client)
|
||||
if(src.client.muted_deadchat)
|
||||
src << "\red You cannot talk in deadchat (muted by admins)."
|
||||
if(src.client.muted & MUTE_DEADCHAT)
|
||||
src << "\red You cannot talk in deadchat (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(message,MUTE_DEADCHAT))
|
||||
|
||||
@@ -267,6 +267,8 @@
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in vent_found.network.normal_members)
|
||||
if(temp_vent.loc == loc)
|
||||
continue
|
||||
if(temp_vent.welded)
|
||||
continue
|
||||
var/turf/T = get_turf(temp_vent)
|
||||
|
||||
if(!T || T.z != loc.z)
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
if(silent)
|
||||
return
|
||||
if (src.client)
|
||||
if (client.muted_ic)
|
||||
src << "\red You cannot send IC messages (muted by admins)."
|
||||
if (client.muted & MUTE_IC)
|
||||
src << "\red You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
var/s_tone = 0 //Skin tone
|
||||
|
||||
var/lip_style = null //no lipstick by default- arguably misleading, as it could be used for general makeup
|
||||
|
||||
var/age = 30 //Player's age (pure fluff)
|
||||
var/b_type = "A+" //Player's bloodtype (Not currently used, just character fluff)
|
||||
|
||||
|
||||
@@ -302,9 +302,10 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
stand_icon.Blend(eyes_s, ICON_OVERLAY)
|
||||
lying_icon.Blend(eyes_l, ICON_OVERLAY)
|
||||
|
||||
//Mouth
|
||||
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "mouth_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new/icon('icons/mob/human_face.dmi', "mouth_[g]_l"), ICON_OVERLAY)
|
||||
//Mouth (lipstick!)
|
||||
if(lip_style)
|
||||
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_l"), ICON_OVERLAY)
|
||||
|
||||
//Underwear
|
||||
if(underwear < 6 && underwear > 0)
|
||||
@@ -758,8 +759,9 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
|
||||
// Used mostly for creating head items
|
||||
/mob/living/carbon/human/proc/generate_head_icon()
|
||||
var/g = "m"
|
||||
if (gender == FEMALE) g = "f"
|
||||
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
|
||||
// var/g = "m"
|
||||
// if (gender == FEMALE) g = "f"
|
||||
|
||||
//base icons
|
||||
var/icon/face_lying = new /icon('icons/mob/human_face.dmi',"bald_l")
|
||||
@@ -780,14 +782,12 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
|
||||
//Eyes
|
||||
// Note: These used to be in update_face(), and the fact they're here will make it difficult to create a disembodied head
|
||||
var/icon/eyes_s = new/icon('icons/mob/human_face.dmi', "eyes_s")
|
||||
var/icon/eyes_l = new/icon('icons/mob/human_face.dmi', "eyes_l")
|
||||
eyes_s.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
eyes_l.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
|
||||
face_lying.Blend(eyes_l, ICON_OVERLAY)
|
||||
|
||||
//Mouth
|
||||
face_lying.Blend(new/icon('icons/mob/human_face.dmi', "mouth_[g]_l"), ICON_OVERLAY)
|
||||
if(lip_style)
|
||||
face_lying.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_l"), ICON_OVERLAY)
|
||||
|
||||
var/image/face_lying_image = new /image(icon = face_lying)
|
||||
return face_lying_image
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
log_whisper("[src.name]/[src.key] : [message]")
|
||||
|
||||
if (src.client)
|
||||
if (src.client.muted_ic)
|
||||
src << "\red You cannot whisper (muted by admins)."
|
||||
if (src.client.muted & MUTE_IC)
|
||||
src << "\red You cannot whisper (muted)."
|
||||
return
|
||||
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
|
||||
@@ -762,7 +762,10 @@ mob/living/carbon/metroid/var/temperature_resistance = T0C+75
|
||||
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
|
||||
ok = 0
|
||||
|
||||
del(D)
|
||||
//del(D)
|
||||
//Garbage Collect Dummy
|
||||
D.loc = null
|
||||
D = null
|
||||
if (!( ok ))
|
||||
|
||||
return 0
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/mob/living/Login()
|
||||
..()
|
||||
//Mind updates
|
||||
@@ -62,4 +63,63 @@
|
||||
if ("changeling")
|
||||
if (podman.mind in ticker.mode:changelings)
|
||||
podman.make_changeling()
|
||||
=======
|
||||
/mob/living/Login()
|
||||
..()
|
||||
//Mind updates
|
||||
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
|
||||
mind.active = 1 //indicates that the mind is currently synced with a client
|
||||
|
||||
//Round specific stuff like hud updates
|
||||
if(ticker && ticker.mode)
|
||||
switch(ticker.mode.name)
|
||||
if("sandbox")
|
||||
CanBuild()
|
||||
if("revolution")
|
||||
if((mind in ticker.mode.revolutionaries) || (src.mind in ticker.mode:head_revolutionaries))
|
||||
ticker.mode.update_rev_icons_added(src.mind)
|
||||
if("cult")
|
||||
if(mind in ticker.mode:cult)
|
||||
ticker.mode.update_cult_icons_added(src.mind)
|
||||
if("nuclear emergency")
|
||||
if(mind in ticker.mode:syndicates)
|
||||
ticker.mode.update_all_synd_icons()
|
||||
return .
|
||||
|
||||
//This stuff needs to be merged from cloning.dm but I'm not in the mood to be shouted at for breaking all the things :< ~Carn
|
||||
/* clones
|
||||
switch(ticker.mode.name)
|
||||
if("revolution")
|
||||
if(src.occupant.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode:update_all_rev_icons() //So the icon actually appears
|
||||
if(src.occupant.mind in ticker.mode:head_revolutionaries)
|
||||
ticker.mode:update_all_rev_icons()
|
||||
if("nuclear emergency")
|
||||
if (src.occupant.mind in ticker.mode:syndicates)
|
||||
ticker.mode:update_all_synd_icons()
|
||||
if("cult")
|
||||
if (src.occupant.mind in ticker.mode:cult)
|
||||
ticker.mode:add_cultist(src.occupant.mind)
|
||||
ticker.mode:update_all_cult_icons() //So the icon actually appears
|
||||
*/
|
||||
|
||||
/* Plantpeople
|
||||
switch(ticker.mode.name)
|
||||
if ("revolution")
|
||||
if (podman.mind in ticker.mode:revolutionaries)
|
||||
ticker.mode:add_revolutionary(podman.mind)
|
||||
ticker.mode:update_all_rev_icons() //So the icon actually appears
|
||||
if (podman.mind in ticker.mode:head_revolutionaries)
|
||||
ticker.mode:update_all_rev_icons()
|
||||
if ("nuclear emergency")
|
||||
if (podman.mind in ticker.mode:syndicates)
|
||||
ticker.mode:update_all_synd_icons()
|
||||
if ("cult")
|
||||
if (podman.mind in ticker.mode:cult)
|
||||
ticker.mode:add_cultist(podman.mind)
|
||||
ticker.mode:update_all_cult_icons() //So the icon actually appears
|
||||
if ("changeling")
|
||||
if (podman.mind in ticker.mode:changelings)
|
||||
podman.make_changeling()
|
||||
>>>>>>> remotes/git-svn
|
||||
*/
|
||||
@@ -86,8 +86,8 @@ var/list/department_radio_keys = list(
|
||||
return say_dead(message)
|
||||
|
||||
if (src.client)
|
||||
if(client.muted_ic)
|
||||
src << "\red You cannot speak in IC (muted by admins)."
|
||||
if(client.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
if ("me")
|
||||
if (src.client)
|
||||
if(client.muted_ic)
|
||||
src << "You cannot send IC messages (muted by admins)."
|
||||
if(client.muted & MUTE_IC)
|
||||
src << "You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
return
|
||||
|
||||
if (src.client)
|
||||
if(client.muted_ic)
|
||||
src << "You cannot send IC messages (muted by admins)."
|
||||
if(client.muted & MUTE_IC)
|
||||
src << "You cannot send IC messages (muted)."
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
//handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
|
||||
/mob/proc/update_Login_details()
|
||||
//trigger admin holder updates. This is hear as all Login() calls this proc.
|
||||
if(client.holder)
|
||||
client.update_admins(client.holder.rank)
|
||||
|
||||
//Multikey checks and logging
|
||||
lastKnownIP = client.address
|
||||
computer_id = client.computer_id
|
||||
log_access("Login: [key_name(src)] from [lastKnownIP ? lastKnownIP : "localhost"]-[computer_id] || BYOND v[client.byond_version]")
|
||||
|
||||
@@ -1120,9 +1120,10 @@ datum/preferences
|
||||
|
||||
proc/setup_client(var/client/C)
|
||||
if(C)
|
||||
C.sound_adminhelp = src.sound_adminhelp
|
||||
if(C.holder)
|
||||
C.holder.sound_adminhelp = src.sound_adminhelp
|
||||
C.holder.ooccolor = src.ooccolor
|
||||
C.midis = src.midis
|
||||
C.ooccolor = src.ooccolor
|
||||
C.be_alien = be_special & BE_ALIEN
|
||||
C.be_pai = be_special & BE_PAI
|
||||
if(isnull(src.ghost_ears)) src.ghost_ears = 1 //There were problems where the default was null before someone saved their profile.
|
||||
|
||||
@@ -540,7 +540,6 @@ datum/preferences
|
||||
preview_icon_side = new(preview_icon, dir = WEST)
|
||||
|
||||
del(preview_icon)
|
||||
del(mouth_s)
|
||||
del(eyes_s)
|
||||
del(clothes_s)
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
/obj/item/weapon/paper
|
||||
name = "paper"
|
||||
gender = PLURAL
|
||||
@@ -297,4 +298,307 @@
|
||||
user << "<span class='notice'>You stamp the paper with your rubber stamp.</span>"
|
||||
|
||||
add_fingerprint(user)
|
||||
=======
|
||||
/obj/item/weapon/paper
|
||||
name = "paper"
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "paper"
|
||||
throwforce = 0
|
||||
w_class = 1.0
|
||||
throw_speed = 3
|
||||
throw_range = 15
|
||||
layer = 4
|
||||
pressure_resistance = 1
|
||||
slot_flags = SLOT_HEAD
|
||||
body_parts_covered = HEAD
|
||||
attack_verb = list("")
|
||||
|
||||
var/info //What's actually written on the paper.
|
||||
var/info_links //A different version of the paper which includes html links at fields and EOF
|
||||
var/stamps //The (text for the) stamps on the paper.
|
||||
var/fields //Amount of user created fields
|
||||
var/list/stamped
|
||||
var/rigged = 0
|
||||
var/spam_flag = 0
|
||||
|
||||
var/const/deffont = "Verdana"
|
||||
var/const/signfont = "Times New Roman"
|
||||
var/const/crayonfont = "Comic Sans MS"
|
||||
|
||||
//lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm!
|
||||
|
||||
/obj/item/weapon/paper/New()
|
||||
..()
|
||||
src.pixel_y = rand(-8, 8)
|
||||
src.pixel_x = rand(-9, 9)
|
||||
spawn(2)
|
||||
if(src.info)
|
||||
src.overlays += "paper_words"
|
||||
updateinfolinks()
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/update_icon()
|
||||
if(src.info)
|
||||
src.overlays += "paper_words"
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/examine()
|
||||
set src in oview(1)
|
||||
|
||||
// ..() //We don't want them to see the dumb "this is a paper" thing every time.
|
||||
// I didn't like the idea that people can read tiny pieces of paper from across the room.
|
||||
// Now you need to be next to the paper in order to read it.
|
||||
if(in_range(usr, src))
|
||||
if(!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)))
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
|
||||
onclose(usr, "[name]")
|
||||
else
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
|
||||
onclose(usr, "[name]")
|
||||
else
|
||||
usr << "<span class='notice'>It is too far away.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/verb/rename()
|
||||
set name = "Rename paper"
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if ((CLUMSY in usr.mutations) && prob(50))
|
||||
usr << "<span class='warning'>You cut yourself on the paper.</span>"
|
||||
return
|
||||
var/n_name = input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text
|
||||
n_name = copytext(n_name, 1, 32)
|
||||
if ((loc == usr && usr.stat == 0))
|
||||
name = "paper[(n_name ? text("- '[n_name]'") : null)]"
|
||||
add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/attack_self(mob/living/user as mob)
|
||||
examine()
|
||||
if(rigged && (Holiday == "April Fool's Day"))
|
||||
if(spam_flag == 0)
|
||||
spam_flag = 1
|
||||
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1)
|
||||
spawn(20)
|
||||
spam_flag = 0
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/attack_ai(var/mob/living/silicon/ai/user as mob)
|
||||
var/dist
|
||||
if (istype(user) && user.current) //is AI
|
||||
dist = get_dist(src, user.current)
|
||||
else //cyborg or AI not seeing through a camera
|
||||
dist = get_dist(src, user)
|
||||
if (dist < 2)
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info][stamps]</BODY></HTML>", "window=[name]")
|
||||
onclose(usr, "[name]")
|
||||
else
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
|
||||
onclose(usr, "[name]")
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/proc/addtofield(var/id, var/text, var/links = 0)
|
||||
var/locid = 0
|
||||
var/laststart = 1
|
||||
var/textindex = 1
|
||||
while(1) // I know this can cause infinite loops and fuck up the whole server, but the if(istart==0) should be safe as fuck
|
||||
var/istart = 0
|
||||
if(links)
|
||||
istart = findtext(info_links, "<span class=\"paper_field\">", laststart)
|
||||
else
|
||||
istart = findtext(info, "<span class=\"paper_field\">", laststart)
|
||||
|
||||
if(istart==0)
|
||||
return // No field found with matching id
|
||||
|
||||
laststart = istart+1
|
||||
locid++
|
||||
if(locid == id)
|
||||
var/iend = 1
|
||||
if(links)
|
||||
iend = findtext(info_links, "</span>", istart)
|
||||
else
|
||||
iend = findtext(info, "</span>", istart)
|
||||
|
||||
//textindex = istart+26
|
||||
textindex = iend
|
||||
break
|
||||
|
||||
if(links)
|
||||
var/before = copytext(info_links, 1, textindex)
|
||||
var/after = copytext(info_links, textindex)
|
||||
info_links = before + text + after
|
||||
else
|
||||
var/before = copytext(info, 1, textindex)
|
||||
var/after = copytext(info, textindex)
|
||||
info = before + text + after
|
||||
updateinfolinks()
|
||||
|
||||
/obj/item/weapon/paper/proc/updateinfolinks()
|
||||
info_links = info
|
||||
var/i = 0
|
||||
for(i=1,i<=fields,i++)
|
||||
addtofield(i, "<font face=\"[deffont]\"><A href='?src=\ref[src];write=[i]'>write</A></font>", 1)
|
||||
info_links = info_links + "<font face=\"[deffont]\"><A href='?src=\ref[src];write=end'>write</A></font>"
|
||||
|
||||
/obj/item/weapon/paper/proc/clearpaper()
|
||||
info = null
|
||||
stamps = null
|
||||
stamped = list()
|
||||
overlays = null
|
||||
updateinfolinks()
|
||||
|
||||
/obj/item/weapon/paper/proc/parsepencode(var/t, var/obj/item/weapon/pen/P, mob/user as mob, var/iscrayon = 0)
|
||||
// t = copytext(sanitize(t),1,MAX_MESSAGE_LEN)
|
||||
|
||||
t = dd_replacetext(t, "\[center\]", "<center>")
|
||||
t = dd_replacetext(t, "\[/center\]", "</center>")
|
||||
t = dd_replacetext(t, "\[br\]", "<BR>")
|
||||
t = dd_replacetext(t, "\[b\]", "<B>")
|
||||
t = dd_replacetext(t, "\[/b\]", "</B>")
|
||||
t = dd_replacetext(t, "\[i\]", "<I>")
|
||||
t = dd_replacetext(t, "\[/i\]", "</I>")
|
||||
t = dd_replacetext(t, "\[u\]", "<U>")
|
||||
t = dd_replacetext(t, "\[/u\]", "</U>")
|
||||
t = dd_replacetext(t, "\[large\]", "<font size=\"4\">")
|
||||
t = dd_replacetext(t, "\[/large\]", "</font>")
|
||||
t = dd_replacetext(t, "\[sign\]", "<font face=\"[signfont]\"><i>[user.real_name]</i></font>")
|
||||
t = dd_replacetext(t, "\[field\]", "<span class=\"paper_field\"></span>")
|
||||
|
||||
if(!iscrayon)
|
||||
t = dd_replacetext(t, "\[*\]", "<li>")
|
||||
t = dd_replacetext(t, "\[hr\]", "<HR>")
|
||||
t = dd_replacetext(t, "\[small\]", "<font size = \"1\">")
|
||||
t = dd_replacetext(t, "\[/small\]", "</font>")
|
||||
t = dd_replacetext(t, "\[list\]", "<ul>")
|
||||
t = dd_replacetext(t, "\[/list\]", "</ul>")
|
||||
|
||||
t = "<font face=\"[deffont]\" color=[P.colour]>[t]</font>"
|
||||
else // If it is a crayon, and he still tries to use these, make them empty!
|
||||
t = dd_replacetext(t, "\[*\]", "")
|
||||
t = dd_replacetext(t, "\[hr\]", "")
|
||||
t = dd_replacetext(t, "\[small\]", "")
|
||||
t = dd_replacetext(t, "\[/small\]", "")
|
||||
t = dd_replacetext(t, "\[list\]", "")
|
||||
t = dd_replacetext(t, "\[/list\]", "")
|
||||
|
||||
t = "<font face=\"[crayonfont]\" color=[P.colour]><b>[t]</b></font>"
|
||||
|
||||
// t = dd_replacetext(t, "#", "") // Junk converted to nothing!
|
||||
|
||||
//Count the fields
|
||||
var/laststart = 1
|
||||
while(1)
|
||||
var/i = findtext(t, "<span class=\"paper_field\">", laststart)
|
||||
if(i==0)
|
||||
break
|
||||
laststart = i+1
|
||||
fields++
|
||||
|
||||
return t
|
||||
|
||||
|
||||
/obj/item/weapon/paper/proc/openhelp(mob/user as mob)
|
||||
user << browse({"<HTML><HEAD><TITLE>Pen Help</TITLE></HEAD>
|
||||
<BODY>
|
||||
<b><center>Crayon&Pen commands</center></b><br>
|
||||
<br>
|
||||
\[br\] : Creates a linebreak.<br>
|
||||
\[center\] - \[/center\] : Centers the text.<br>
|
||||
\[b\] - \[/b\] : Makes the text <b>bold</b>.<br>
|
||||
\[i\] - \[/i\] : Makes the text <i>italic</i>.<br>
|
||||
\[u\] - \[/u\] : Makes the text <u>underlined</u>.<br>
|
||||
\[large\] - \[/large\] : Increases the <font size = \"4\">size</font> of the text.<br>
|
||||
\[sign\] : Inserts a signature of your name in a foolproof way.<br>
|
||||
\[field\] : Inserts an invisible field which lets you start type from there. Useful for forms.<br>
|
||||
<br>
|
||||
<b><center>Pen exclusive commands</center></b><br>
|
||||
\[small\] - \[/small\] : Decreases the <font size = \"1\">size</font> of the text.<br>
|
||||
\[list\] - \[/list\] : A list.<br>
|
||||
\[*\] : A dot used for lists.<br>
|
||||
\[hr\] : Adds a horizontal rule.
|
||||
</BODY></HTML>"}, "window=paper_help")
|
||||
|
||||
/obj/item/weapon/paper/Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
|
||||
if(href_list["write"])
|
||||
var/id = href_list["write"]
|
||||
//var/t = strip_html_simple(input(usr, "What text do you wish to add to " + (id=="end" ? "the end of the paper" : "field "+id) + "?", "[name]", null),8192) as message
|
||||
var/t = strip_html_simple(input("Enter what you want to write:", "Write", null, null) as message, MAX_MESSAGE_LEN)
|
||||
var/obj/item/i = usr.get_active_hand() // Check to see if he still got that darn pen, also check if he's using a crayon or pen.
|
||||
var/iscrayon = 0
|
||||
if(!istype(i, /obj/item/weapon/pen))
|
||||
if(!istype(i, /obj/item/toy/crayon))
|
||||
return
|
||||
iscrayon = 1
|
||||
|
||||
|
||||
if ((!in_range(src, usr) && src.loc != usr && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != usr && usr.get_active_hand() != i)) // Some check to see if he's allowed to write
|
||||
return
|
||||
|
||||
t = parsepencode(t, i, usr, iscrayon) // Encode everything from pencode to html
|
||||
|
||||
if(id!="end")
|
||||
addtofield(text2num(id), t) // He wants to edit a field, let him.
|
||||
else
|
||||
info += t // Oh, he wants to edit to the end of the file, let him.
|
||||
updateinfolinks()
|
||||
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]") // Update the window
|
||||
|
||||
if(!overlays.Find("paper_words"))
|
||||
overlays += "paper_words"
|
||||
|
||||
/obj/item/weapon/paper/attackby(obj/item/weapon/P as obj, mob/user as mob)
|
||||
..()
|
||||
var/clown = 0
|
||||
if(user.mind && (user.mind.assigned_role == "Clown"))
|
||||
clown = 1
|
||||
|
||||
if (istype(P, /obj/item/weapon/pen) || istype(P, /obj/item/toy/crayon))
|
||||
usr << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[info_links][stamps]</BODY></HTML>", "window=[name]")
|
||||
//openhelp(user)
|
||||
return
|
||||
else if(istype(P, /obj/item/weapon/stamp))
|
||||
if ((!in_range(src, usr) && src.loc != user && !( istype(src.loc, /obj/item/weapon/clipboard) ) && src.loc.loc != user && user.get_active_hand() != P))
|
||||
return
|
||||
|
||||
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
|
||||
|
||||
switch(P.type)
|
||||
if(/obj/item/weapon/stamp/captain)
|
||||
overlays += "paper_stamped_cap"
|
||||
if(/obj/item/weapon/stamp/hop)
|
||||
overlays += "paper_stamped_hop"
|
||||
if(/obj/item/weapon/stamp/hos)
|
||||
overlays += "paper_stamped_hos"
|
||||
if(/obj/item/weapon/stamp/ce)
|
||||
overlays += "paper_stamped_ce"
|
||||
if(/obj/item/weapon/stamp/rd)
|
||||
overlays += "paper_stamped_rd"
|
||||
if(/obj/item/weapon/stamp/cmo)
|
||||
overlays += "paper_stamped_cmo"
|
||||
if(/obj/item/weapon/stamp/denied)
|
||||
overlays += "paper_stamped_denied"
|
||||
if(/obj/item/weapon/stamp/clown)
|
||||
if (!clown)
|
||||
usr << "<span class='notice'>You are totally unable to use the stamp. HONK!</span>"
|
||||
return
|
||||
else
|
||||
overlays += "paper_stamped_clown"
|
||||
else
|
||||
overlays += "paper_stamped"
|
||||
if(!stamped)
|
||||
stamped = new
|
||||
stamped += P.type
|
||||
|
||||
user << "<span class='notice'>You stamp the paper with your rubber stamp.</span>"
|
||||
|
||||
add_fingerprint(user)
|
||||
>>>>>>> remotes/git-svn
|
||||
return
|
||||
@@ -58,8 +58,16 @@
|
||||
base_state = "intake"
|
||||
dpdir = dir
|
||||
|
||||
if(9)
|
||||
base_state = "pipe-j1s"
|
||||
dpdir = dir | right | flip
|
||||
|
||||
if(ptype<6)
|
||||
if(10)
|
||||
base_state = "pipe-j2s"
|
||||
dpdir = dir | left | flip
|
||||
|
||||
|
||||
if(ptype<6 || ptype>8)
|
||||
icon_state = "con[base_state]"
|
||||
else
|
||||
icon_state = base_state
|
||||
@@ -100,10 +108,16 @@
|
||||
return
|
||||
|
||||
dir = turn(dir, 180)
|
||||
if(ptype == 2)
|
||||
ptype = 3
|
||||
else if(ptype == 3)
|
||||
ptype = 2
|
||||
switch(ptype)
|
||||
if(2)
|
||||
ptype = 3
|
||||
if(3)
|
||||
ptype = 2
|
||||
if(9)
|
||||
ptype = 10
|
||||
if(10)
|
||||
ptype = 9
|
||||
|
||||
update()
|
||||
|
||||
// returns the type path of disposalpipe corresponding to this item dtype
|
||||
@@ -121,6 +135,8 @@
|
||||
return /obj/structure/disposaloutlet
|
||||
if(8)
|
||||
return /obj/machinery/disposal/deliveryChute
|
||||
if(9,10)
|
||||
return /obj/structure/disposalpipe/sortjunction
|
||||
return
|
||||
|
||||
|
||||
@@ -140,6 +156,9 @@
|
||||
nicetype = "disposal outlet"
|
||||
if(8)
|
||||
nicetype = "delivery chute"
|
||||
if(9, 10)
|
||||
nicetype = "sorting pipe"
|
||||
ispipe = 1
|
||||
else
|
||||
nicetype = "pipe"
|
||||
ispipe = 1
|
||||
@@ -150,7 +169,7 @@
|
||||
return
|
||||
|
||||
var/obj/structure/disposalpipe/CP = locate() in T
|
||||
if(ptype>=6) // Disposal or outlet
|
||||
if(ptype>=6 && ptype <= 8) // Disposal or outlet
|
||||
if(CP) // There's something there
|
||||
if(!istype(CP,/obj/structure/disposalpipe/trunk))
|
||||
user << "The [nicetype] requires a trunk underneath it in order to work."
|
||||
@@ -168,7 +187,6 @@
|
||||
user << "There is already a [nicetype] at that location."
|
||||
return
|
||||
|
||||
var/obj/structure/disposalpipe/trunk/Trunk = CP
|
||||
|
||||
if(istype(I, /obj/item/weapon/wrench))
|
||||
if(anchored)
|
||||
@@ -210,6 +228,11 @@
|
||||
P.dpdir = dpdir
|
||||
P.updateicon()
|
||||
|
||||
//Needs some special treatment ;)
|
||||
if(ptype==9 || ptype==10)
|
||||
var/obj/structure/disposalpipe/sortjunction/SortP = P
|
||||
SortP.updatedir()
|
||||
|
||||
else if(ptype==6) // Disposal bin
|
||||
var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
|
||||
src.transfer_fingerprints_to(P)
|
||||
@@ -220,6 +243,7 @@
|
||||
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
|
||||
src.transfer_fingerprints_to(P)
|
||||
P.dir = dir
|
||||
var/obj/structure/disposalpipe/trunk/Trunk = CP
|
||||
Trunk.linked = P
|
||||
|
||||
else if(ptype==8) // Disposal outlet
|
||||
|
||||
@@ -856,6 +856,10 @@
|
||||
C.ptype = 4
|
||||
if("pipe-t")
|
||||
C.ptype = 5
|
||||
if("pipe-j1s")
|
||||
C.ptype = 9
|
||||
if("pipe-j2s")
|
||||
C.ptype = 10
|
||||
src.transfer_fingerprints_to(C)
|
||||
C.dir = dir
|
||||
C.density = 0
|
||||
@@ -933,28 +937,51 @@
|
||||
//a three-way junction that sorts objects
|
||||
/obj/structure/disposalpipe/sortjunction
|
||||
|
||||
desc = "An underfloor disposal pipe with a package sorting mechanism."
|
||||
icon_state = "pipe-j1s"
|
||||
var/sortType = 0
|
||||
var/posdir = 0
|
||||
var/negdir = 0
|
||||
var/sortdir = 0
|
||||
|
||||
New()
|
||||
..()
|
||||
proc/updatedesc()
|
||||
desc = "An underfloor disposal pipe with a package sorting mechanism."
|
||||
if(sortType>0)
|
||||
var/tag = uppertext(TAGGERLOCATIONS[sortType])
|
||||
desc += "\nIt's tagged with [tag]"
|
||||
|
||||
proc/updatedir()
|
||||
posdir = dir
|
||||
negdir = turn(posdir, 180)
|
||||
|
||||
if(icon_state == "pipe-j1s")
|
||||
sortdir = turn(posdir, -90)
|
||||
negdir = turn(posdir, 180)
|
||||
else
|
||||
icon_state = "pipe-j2s"
|
||||
sortdir = turn(posdir, 90)
|
||||
negdir = turn(posdir, 180)
|
||||
|
||||
dpdir = sortdir | posdir | negdir
|
||||
|
||||
New()
|
||||
..()
|
||||
updatedir()
|
||||
updatedesc()
|
||||
update()
|
||||
return
|
||||
|
||||
attackby(var/obj/item/I, var/mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/device/destTagger))
|
||||
var/obj/item/device/destTagger/O = I
|
||||
|
||||
if(O.currTag > 0)// Tag set
|
||||
sortType = O.currTag
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
|
||||
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
|
||||
user << "\blue Changed filter to [tag]"
|
||||
updatedesc()
|
||||
|
||||
|
||||
// next direction to move
|
||||
// if coming in from negdir, then next is primary dir or sortdir
|
||||
@@ -1017,6 +1044,21 @@
|
||||
update()
|
||||
return
|
||||
|
||||
New()
|
||||
..()
|
||||
posdir = dir
|
||||
if(icon_state == "pipe-j1s")
|
||||
sortdir = turn(posdir, -90)
|
||||
negdir = turn(posdir, 180)
|
||||
else
|
||||
icon_state = "pipe-j2s"
|
||||
sortdir = turn(posdir, 90)
|
||||
negdir = turn(posdir, 180)
|
||||
dpdir = sortdir | posdir | negdir
|
||||
|
||||
update()
|
||||
return
|
||||
|
||||
|
||||
// next direction to move
|
||||
// if coming in from negdir, then next is primary dir or sortdir
|
||||
|
||||
@@ -21,8 +21,13 @@
|
||||
attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/destTagger))
|
||||
var/obj/item/device/destTagger/O = W
|
||||
user << "\blue *TAGGED*"
|
||||
src.sortTag = O.currTag
|
||||
|
||||
if(src.sortTag != O.currTag)
|
||||
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
|
||||
user << "\blue *[tag]*"
|
||||
src.sortTag = O.currTag
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
|
||||
if(!str || !length(str))
|
||||
@@ -57,8 +62,13 @@
|
||||
attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/destTagger))
|
||||
var/obj/item/device/destTagger/O = W
|
||||
user << "\blue *TAGGED*"
|
||||
src.sortTag = O.currTag
|
||||
|
||||
if(src.sortTag != O.currTag)
|
||||
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
|
||||
user << "\blue *[tag]*"
|
||||
src.sortTag = O.currTag
|
||||
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
|
||||
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
|
||||
if(!str || !length(str))
|
||||
@@ -140,17 +150,18 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/destTagger
|
||||
name = "destination tagger"
|
||||
desc = "Used to set the destination of properly wrapped packages."
|
||||
icon_state = "forensic0"
|
||||
var/currTag = 0
|
||||
var/list/locationList = list("Disposals",
|
||||
// Old, non-global name: "locationList"
|
||||
var/list/TAGGERLOCATIONS = list("Disposals",
|
||||
"Cargo Bay", "QM Office", "Engineering", "CE Office",
|
||||
"Atmospherics", "Security", "HoS Office", "Medbay",
|
||||
"CMO Office", "Chemistry", "Research", "RD Office",
|
||||
"Robotics", "HoP Office", "Library", "Chapel", "Theatre",
|
||||
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics")
|
||||
/obj/item/device/destTagger
|
||||
name = "destination tagger"
|
||||
desc = "Used to set the destination of properly wrapped packages."
|
||||
icon_state = "forensic0"
|
||||
var/currTag = 0
|
||||
//The whole system for the sorttype var is determined based on the order of this list,
|
||||
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude
|
||||
|
||||
@@ -162,20 +173,23 @@
|
||||
flags = FPRINT | TABLEPASS | CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
var/dat = "<TT><B>TagMaster 2.2</B><BR><BR>"
|
||||
if (src.currTag == 0)
|
||||
dat += "<br>Current Selection: None<br>"
|
||||
else
|
||||
dat += "<br>Current Selection: [locationList[currTag]]<br><br>"
|
||||
for (var/i = 1, i <= locationList.len, i++)
|
||||
dat += "<A href='?src=\ref[src];nextTag=[i]'>[locationList[i]]</A>"
|
||||
proc/openwindow(mob/user as mob)
|
||||
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"
|
||||
|
||||
dat += "<table style='width:100%; padding:4px;'><tr>"
|
||||
for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
|
||||
dat += "<td><a href='?src=\ref[src];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"
|
||||
|
||||
if (i%4==0)
|
||||
dat += "<br>"
|
||||
else
|
||||
dat += " "
|
||||
user << browse(dat, "window=destTagScreen")
|
||||
dat += "</tr><tr>"
|
||||
|
||||
dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
|
||||
|
||||
user << browse(dat, "window=destTagScreen;size=450x350")
|
||||
onclose(user, "destTagScreen")
|
||||
|
||||
attack_self(mob/user as mob)
|
||||
openwindow(user)
|
||||
return
|
||||
|
||||
Topic(href, href_list)
|
||||
@@ -183,29 +197,7 @@
|
||||
if(href_list["nextTag"])
|
||||
var/n = text2num(href_list["nextTag"])
|
||||
src.currTag = n
|
||||
src.updateUsrDialog()
|
||||
|
||||
|
||||
/*
|
||||
attack(target as obj, mob/user as mob)
|
||||
user << "/blue *TAGGED*"
|
||||
target.sortTag = src.currTag
|
||||
|
||||
attack(target as obj, mob/user as mob)
|
||||
user << "/blue You can only tag properly wrapped delivery packages!"
|
||||
*/
|
||||
attack(target as obj, mob/user as mob)
|
||||
if (istype(target, /obj/structure/bigDelivery))
|
||||
user << "\blue *TAGGED*"
|
||||
var/obj/structure/bigDelivery/O = target
|
||||
O.sortTag = src.currTag
|
||||
else if (istype(target, /obj/item/smallDelivery))
|
||||
user << "\blue *TAGGED*"
|
||||
var/obj/item/smallDelivery/O = target
|
||||
O.sortTag = src.currTag
|
||||
else
|
||||
user << "\blue You can only tag properly wrapped delivery packages!"
|
||||
return
|
||||
openwindow(usr)
|
||||
|
||||
/obj/machinery/disposal/deliveryChute
|
||||
name = "Delivery chute"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
#define DEBUG
|
||||
|
||||
#define PI 3.1415
|
||||
|
||||
#define R_IDEAL_GAS_EQUATION 8.31 //kPa*L/(K*mol)
|
||||
@@ -445,12 +447,14 @@ var/list/liftable_structures = list(\
|
||||
/obj/machinery/portable_atmospherics/canister)
|
||||
|
||||
//A set of constants used to determine which type of mute an admin wishes to apply:
|
||||
#define MUTE_IC 1
|
||||
#define MUTE_OOC 2
|
||||
#define MUTE_PRAY 3
|
||||
#define MUTE_ADMINHELP 4
|
||||
#define MUTE_DEADCHAT 5
|
||||
#define MUTE_ALL 6
|
||||
//Please read and understand the muting/automuting stuff before changing these. MUTE_IC_AUTO etc = (MUTE_IC << 1)
|
||||
//Therefore there needs to be a gap between the flags for the automute flags
|
||||
#define MUTE_IC 1
|
||||
#define MUTE_OOC 2
|
||||
#define MUTE_PRAY 4
|
||||
#define MUTE_ADMINHELP 8
|
||||
#define MUTE_DEADCHAT 16
|
||||
#define MUTE_ALL 31
|
||||
|
||||
//Number of identical messages required to get the spam-prevention automute thing to trigger warnings and automutes
|
||||
#define SPAM_TRIGGER_WARNING 5
|
||||
|
||||
@@ -136,7 +136,7 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")]
|
||||
|
||||
for(var/client/C in client_list)
|
||||
if(C.holder)
|
||||
if(C.stealth)
|
||||
if(C.holder.fakekey)
|
||||
continue //so stealthmins aren't revealed by the hub
|
||||
admins++
|
||||
s["player[n]"] = C.key
|
||||
@@ -209,7 +209,7 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")]
|
||||
if (pos)
|
||||
var/m_key = copytext(line, 1, pos)
|
||||
var/a_lev = copytext(line, pos + 3, length(line) + 1)
|
||||
admins[m_key] = a_lev
|
||||
admins[m_key] = new /datum/admins(a_lev)
|
||||
diary << ("ADMIN: [m_key] = [a_lev]")
|
||||
|
||||
|
||||
|
||||
@@ -166,5 +166,5 @@ TICKCOMP 0
|
||||
## Whether the server will talk to other processes through socket_talk
|
||||
SOCKET_TALK 0
|
||||
|
||||
## Uncomment to restrict non-admins using humanoid alien races
|
||||
USEALIENWHITELIST
|
||||
## Uncomment this to ban use of ToR
|
||||
#TOR_BAN## Comment this out to disable automuting#AUTOMUTE_ON## Uncomment to restrict non-admins using humanoid alien racesUSEALIENWHITELIST
|
||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 121 KiB |
|
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 176 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 99 KiB After Width: | Height: | Size: 107 KiB |