mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 15:38:02 +01:00
spooky
This commit is contained in:
@@ -7,13 +7,13 @@ world/IsBanned(key,address,computer_id)
|
||||
//Guest Checking
|
||||
if(!config.guests_allowed && IsGuestKey(key))
|
||||
log_access("Failed Login: [key] - Guests not allowed")
|
||||
message_admins("\blue Failed Login: [key] - Guests not allowed")
|
||||
message_admins("<font color='blue'>Failed Login: [key] - Guests not allowed</font>")
|
||||
return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.")
|
||||
|
||||
//check if the IP address is a known TOR node
|
||||
if(config && config.ToRban && ToRban_isbanned(address))
|
||||
log_access("Failed Login: [src] - Banned: ToR")
|
||||
message_admins("\blue Failed Login: [src] - Banned: ToR")
|
||||
message_admins("<font color='blue'>Failed Login: [src] - Banned: ToR</font>")
|
||||
//ban their computer_id and ckey for posterity
|
||||
AddBan(ckey(key), computer_id, "Use of ToR", "Automated Ban", 0, 0)
|
||||
return list("reason"="Using ToR", "desc"="\nReason: The network you are using to connect has been banned.\nIf you believe this is a mistake, please request help at [config.banappeals]")
|
||||
@@ -25,7 +25,7 @@ world/IsBanned(key,address,computer_id)
|
||||
. = CheckBan( ckey(key), computer_id, address )
|
||||
if(.)
|
||||
log_access("Failed Login: [key] [computer_id] [address] - Banned [.["reason"]]")
|
||||
message_admins("\blue Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]")
|
||||
message_admins("<font color='blue'>Failed Login: [key] id:[computer_id] ip:[address] - Banned [.["reason"]]</font>")
|
||||
return .
|
||||
|
||||
return ..() //default pager ban stuff
|
||||
|
||||
@@ -673,7 +673,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
//This is basically how death alarms do it
|
||||
var/obj/item/device/radio/headset/a = new /obj/item/device/radio/headset/ert(null)
|
||||
|
||||
var/channel = input("Channel for message:","Channel", null) as null|anything in (list("Common") + a.keyslot1.channels + a.keyslot2.channels)
|
||||
var/channel = input("Channel for message:","Channel", null) as null|anything in (list("Common") + a.keyslot2.channels) // + a.keyslot1.channels
|
||||
|
||||
if(channel) //They picked a channel
|
||||
var/sender = input("Name of sender (max 75):", "Announcement", "Announcement Computer") as null|text
|
||||
@@ -802,7 +802,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
else
|
||||
world << "<B>New players may now enter the game.</B>"
|
||||
log_admin("[key_name(usr)] toggled new player game entering.")
|
||||
message_admins("\blue [key_name_admin(usr)] toggled new player game entering.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] toggled new player game entering.</font>", 1)
|
||||
world.update_status()
|
||||
feedback_add_details("admin_verb","TE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -828,7 +828,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
world << "<B>You may now respawn.</B>"
|
||||
else
|
||||
world << "<B>You may no longer respawn :(</B>"
|
||||
message_admins("\blue [key_name_admin(usr)] toggled respawn to [config.abandon_allowed ? "On" : "Off"].", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] toggled respawn to [config.abandon_allowed ? "On" : "Off"].</font>", 1)
|
||||
log_admin("[key_name(usr)] toggled respawn to [config.abandon_allowed ? "On" : "Off"].")
|
||||
world.update_status()
|
||||
feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
@@ -860,7 +860,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
if (!ticker || ticker.current_state != GAME_STATE_PREGAME)
|
||||
ticker.delay_end = !ticker.delay_end
|
||||
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("\blue [key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
||||
message_admins("<font color='blue'>[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].</font>", 1)
|
||||
return //alert("Round end delayed", null, null, null, null, null)
|
||||
round_progressing = !round_progressing
|
||||
if (!round_progressing)
|
||||
@@ -876,7 +876,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
set desc="Toggle admin jumping"
|
||||
set name="Toggle Jump"
|
||||
config.allow_admin_jump = !(config.allow_admin_jump)
|
||||
message_admins("\blue Toggled admin jumping to [config.allow_admin_jump].")
|
||||
message_admins("<font color='blue'>Toggled admin jumping to [config.allow_admin_jump].</font>")
|
||||
feedback_add_details("admin_verb","TJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/adspawn()
|
||||
@@ -884,7 +884,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
set desc="Toggle admin spawning"
|
||||
set name="Toggle Spawn"
|
||||
config.allow_admin_spawning = !(config.allow_admin_spawning)
|
||||
message_admins("\blue Toggled admin item spawning to [config.allow_admin_spawning].")
|
||||
message_admins("<font color='blue'>Toggled admin item spawning to [config.allow_admin_spawning].</font>")
|
||||
feedback_add_details("admin_verb","TAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/adrev()
|
||||
@@ -892,7 +892,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
set desc="Toggle admin revives"
|
||||
set name="Toggle Revive"
|
||||
config.allow_admin_rev = !(config.allow_admin_rev)
|
||||
message_admins("\blue Toggled reviving to [config.allow_admin_rev].")
|
||||
message_admins("<font color='blue'>Toggled reviving to [config.allow_admin_rev].</font>")
|
||||
feedback_add_details("admin_verb","TAR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/immreboot()
|
||||
@@ -902,7 +902,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
if(!usr.client.holder) return
|
||||
if( alert("Reboot server?",,"Yes","No") == "No")
|
||||
return
|
||||
world << "\red <b>Rebooting world!</b> \blue Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!"
|
||||
world << "<font color='red'><b>Rebooting world!</b></font> <font color='blue'>Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!</font>"
|
||||
log_admin("[key_name(usr)] initiated an immediate reboot.")
|
||||
|
||||
feedback_set_details("end_error","immediate admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
|
||||
@@ -1166,7 +1166,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
else
|
||||
world << "<B>Guests may now enter the game.</B>"
|
||||
log_admin("[key_name(usr)] toggled guests game entering [config.guests_allowed?"":"dis"]allowed.")
|
||||
message_admins("\blue [key_name_admin(usr)] toggled guests game entering [config.guests_allowed?"":"dis"]allowed.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] toggled guests game entering [config.guests_allowed?"":"dis"]allowed.</font>", 1)
|
||||
feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/datum/admins/proc/output_ai_laws()
|
||||
|
||||
@@ -449,11 +449,11 @@ var/list/admin_verbs_mentor = list(
|
||||
if(holder && mob)
|
||||
if(mob.invisibility == INVISIBILITY_OBSERVER)
|
||||
mob.invisibility = initial(mob.invisibility)
|
||||
mob << "\red <b>Invisimin off. Invisibility reset.</b>"
|
||||
mob << "<font color='red'><b>Invisimin off. Invisibility reset.</b></font>"
|
||||
mob.alpha = max(mob.alpha + 100, 255)
|
||||
else
|
||||
mob.invisibility = INVISIBILITY_OBSERVER
|
||||
mob << "\blue <b>Invisimin on. You are now as invisible as a ghost.</b>"
|
||||
mob << "<font color='blue'><b>Invisimin on. You are now as invisible as a ghost.</b></font>"
|
||||
mob.alpha = max(mob.alpha - 100, 0)
|
||||
|
||||
|
||||
@@ -619,7 +619,7 @@ var/list/admin_verbs_mentor = list(
|
||||
var/light_impact_range = input("Light impact range (in tiles):") as num
|
||||
var/flash_range = input("Flash range (in tiles):") as num
|
||||
explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
message_admins("\blue [ckey] creating an admin explosion at [epicenter.loc].")
|
||||
message_admins("<font color='blue'>[ckey] creating an admin explosion at [epicenter.loc].</font>")
|
||||
feedback_add_details("admin_verb","DB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/give_disease2(mob/T as mob in mob_list) // -- Giacom
|
||||
@@ -651,7 +651,7 @@ var/list/admin_verbs_mentor = list(
|
||||
|
||||
feedback_add_details("admin_verb","GD2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].")
|
||||
message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] gave [key_name(T)] a [greater] disease2 with infection chance [D.infectionchance].</font>", 1)
|
||||
|
||||
/client/proc/make_sound(var/obj/O in world) // -- TLE
|
||||
set category = "Special Verbs"
|
||||
@@ -664,7 +664,7 @@ var/list/admin_verbs_mentor = list(
|
||||
for (var/mob/V in hearers(O))
|
||||
V.show_message(message, 2)
|
||||
log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound")
|
||||
message_admins("\blue [key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z]. make a sound.</font>", 1)
|
||||
feedback_add_details("admin_verb","MS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -698,7 +698,7 @@ var/list/admin_verbs_mentor = list(
|
||||
usr << "<b>Disabled air processing.</b>"
|
||||
feedback_add_details("admin_verb","KA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] used 'kill air'.")
|
||||
message_admins("\blue [key_name_admin(usr)] used 'kill air'.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] used 'kill air'.</font>", 1)
|
||||
|
||||
/client/proc/readmin_self()
|
||||
set name = "Re-Admin self"
|
||||
@@ -839,7 +839,7 @@ var/list/admin_verbs_mentor = list(
|
||||
var/mob/living/carbon/human/M = input("Select mob.", "Edit Appearance") as null|anything in human_mob_list
|
||||
|
||||
if(!istype(M, /mob/living/carbon/human))
|
||||
usr << "\red You can only do this to humans!"
|
||||
usr << "<font color='red'>You can only do this to humans!</font>"
|
||||
return
|
||||
switch(alert("Are you sure you wish to edit this mob's appearance? Skrell, Unathi, Tajaran can result in unintended consequences.",,"Yes","No"))
|
||||
if("No")
|
||||
@@ -959,7 +959,7 @@ var/list/admin_verbs_mentor = list(
|
||||
T << "<span class='notice'>Move on.</span>"
|
||||
|
||||
log_admin("[key_name(usr)] told [key_name(T)] to man up and deal with it.")
|
||||
message_admins("\blue [key_name_admin(usr)] told [key_name(T)] to man up and deal with it.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] told [key_name(T)] to man up and deal with it.</font>", 1)
|
||||
|
||||
/client/proc/global_man_up()
|
||||
set category = "Fun"
|
||||
@@ -971,7 +971,7 @@ var/list/admin_verbs_mentor = list(
|
||||
T << 'sound/voice/ManUp1.ogg'
|
||||
|
||||
log_admin("[key_name(usr)] told everyone to man up and deal with it.")
|
||||
message_admins("\blue [key_name_admin(usr)] told everyone to man up and deal with it.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] told everyone to man up and deal with it.</font>", 1)
|
||||
|
||||
/client/proc/give_spell(mob/T as mob in mob_list) // -- Urist
|
||||
set category = "Fun"
|
||||
@@ -982,4 +982,4 @@ var/list/admin_verbs_mentor = list(
|
||||
T.spell_list += new S
|
||||
feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
log_admin("[key_name(usr)] gave [key_name(T)] the spell [S].")
|
||||
message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] the spell [S].", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] gave [key_name(T)] the spell [S].</font>", 1)
|
||||
|
||||
@@ -85,14 +85,14 @@
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');")
|
||||
log_query.Execute()
|
||||
usr << "\blue New admin added."
|
||||
usr << "<font color='blue'>New admin added.</font>"
|
||||
else
|
||||
if(!isnull(admin_id) && isnum(admin_id))
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET rank = '[new_rank]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');")
|
||||
log_query.Execute()
|
||||
usr << "\blue Admin rank changed."
|
||||
usr << "<font color='blue'>Admin rank changed.</font>"
|
||||
|
||||
/datum/admins/proc/log_admin_permission_modification(var/adm_ckey, var/new_permission)
|
||||
if(config.admin_legacy_system) return
|
||||
@@ -140,10 +140,10 @@
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Removed permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');")
|
||||
log_query.Execute()
|
||||
usr << "\blue Permission removed."
|
||||
usr << "<font color='blue'>Permission removed.</font>"
|
||||
else //This admin doesn't have this permission, so we are adding it.
|
||||
var/DBQuery/insert_query = dbcon.NewQuery("UPDATE `erro_admin` SET flags = '[admin_rights | new_permission]' WHERE id = [admin_id]")
|
||||
insert_query.Execute()
|
||||
var/DBQuery/log_query = dbcon.NewQuery("INSERT INTO `test`.`erro_admin_log` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]')")
|
||||
log_query.Execute()
|
||||
usr << "\blue Permission added."
|
||||
usr << "<font color='blue'>Permission added.</font>"
|
||||
@@ -103,7 +103,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
infos += P
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(user)] has edited [key]'s notes.")
|
||||
message_admins("<font color='blue'>[key_name_admin(user)] has edited [key]'s notes.</font>")
|
||||
log_admin("[key_name(user)] has edited [key]'s notes.")
|
||||
|
||||
del(info) // savefile, so NOT qdel
|
||||
@@ -128,7 +128,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
infos.Remove(item)
|
||||
info << infos
|
||||
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] deleted one of [key]'s notes.</font>")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
qdel(info)
|
||||
|
||||
+49
-49
@@ -197,7 +197,7 @@
|
||||
if (emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] called the Emergency Shuttle to the station.</font>", 1)
|
||||
|
||||
if("2")
|
||||
if (!( ticker ) || !emergency_shuttle.location())
|
||||
@@ -205,12 +205,12 @@
|
||||
if (emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
log_admin("[key_name(usr)] called the Emergency Shuttle")
|
||||
message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] called the Emergency Shuttle to the station.</font>", 1)
|
||||
|
||||
else if (emergency_shuttle.can_recall())
|
||||
emergency_shuttle.recall()
|
||||
log_admin("[key_name(usr)] sent the Emergency Shuttle back")
|
||||
message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] sent the Emergency Shuttle back.</font>", 1)
|
||||
|
||||
href_list["secretsadmin"] = "check_antagonist"
|
||||
|
||||
@@ -223,14 +223,14 @@
|
||||
emergency_shuttle.launch_time = world.time + new_time_left*10
|
||||
|
||||
log_admin("[key_name(usr)] edited the Emergency Shuttle's launch time to [new_time_left]")
|
||||
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] edited the Emergency Shuttle's launch time to [new_time_left*10]</font>", 1)
|
||||
else if (emergency_shuttle.shuttle.has_arrive_time())
|
||||
|
||||
var/new_time_left = input("Enter new shuttle arrival time (seconds):","Edit Shuttle Arrival Time", emergency_shuttle.estimate_arrival_time() ) as num
|
||||
emergency_shuttle.shuttle.arrive_time = world.time + new_time_left*10
|
||||
|
||||
log_admin("[key_name(usr)] edited the Emergency Shuttle's arrival time to [new_time_left]")
|
||||
message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left*10]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] edited the Emergency Shuttle's arrival time to [new_time_left*10]</font>", 1)
|
||||
else
|
||||
alert("The shuttle is neither counting down to launch nor is it in transit. Please try again when it is.")
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
|
||||
ticker.delay_end = !ticker.delay_end
|
||||
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
|
||||
message_admins("\blue [key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
|
||||
message_admins("<font color='blue'>[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].</font>", 1)
|
||||
href_list["secretsadmin"] = "check_antagonist"
|
||||
|
||||
else if(href_list["simplemake"])
|
||||
@@ -259,7 +259,7 @@
|
||||
if("Yes") delmob = 1
|
||||
|
||||
log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]")
|
||||
message_admins("\blue [key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]</font>", 1)
|
||||
|
||||
switch(href_list["simplemake"])
|
||||
if("observer") M.change_mob_type( /mob/observer/dead , null, null, delmob )
|
||||
@@ -339,7 +339,7 @@
|
||||
|
||||
log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
||||
ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]")
|
||||
message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]</font>", 1)
|
||||
Banlist.cd = "/base/[banfolder]"
|
||||
Banlist["reason"] << reason
|
||||
Banlist["temp"] << temp
|
||||
@@ -686,7 +686,7 @@
|
||||
usr << "<span class='warning'> You Cannot issue temporary job-bans!</span>"
|
||||
return
|
||||
if(config.ban_legacy_system)
|
||||
usr << "\red Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban."
|
||||
usr << "<font color='red'>Your server is using the legacy banning system, which does not support temporary job bans. Consider upgrading. Aborting ban.</font>"
|
||||
return
|
||||
var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null
|
||||
if(!mins)
|
||||
@@ -711,10 +711,10 @@
|
||||
else
|
||||
msg += ", [job]"
|
||||
notes_add(M.ckey, "Banned from [msg] - [reason]", usr)
|
||||
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes", 1)
|
||||
M << "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG>"
|
||||
M << "\red <B>The reason is: [reason]</B>"
|
||||
M << "\red This jobban will be lifted in [mins] minutes."
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] banned [key_name_admin(M)] from [msg] for [mins] minutes</font>", 1)
|
||||
M << "<font color='red'><BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG></font>"
|
||||
M << "<font color='red'><B>The reason is: [reason]</B></font>"
|
||||
M << "<font color='red'>This jobban will be lifted in [mins] minutes.</font>"
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
if("No")
|
||||
@@ -732,10 +732,10 @@
|
||||
if(!msg) msg = job
|
||||
else msg += ", [job]"
|
||||
notes_add(M.ckey, "Banned from [msg] - [reason]", usr)
|
||||
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1)
|
||||
M << "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG>"
|
||||
M << "\red <B>The reason is: [reason]</B>"
|
||||
M << "\red Jobban can be lifted only upon request."
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] banned [key_name_admin(M)] from [msg]</font>", 1)
|
||||
M << "<font color='red'><BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG></font>"
|
||||
M << "<font color='red'><B>The reason is: [reason]</B></font>"
|
||||
M << "<font color='red'>Jobban can be lifted only upon request.</font>"
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
if("Cancel")
|
||||
@@ -765,8 +765,8 @@
|
||||
else
|
||||
continue
|
||||
if(msg)
|
||||
message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]", 1)
|
||||
M << "\red<BIG><B>You have been un-jobbanned by [usr.client.ckey] from [msg].</B></BIG>"
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]</font>", 1)
|
||||
M << "<font color='red'><BIG><B>You have been un-jobbanned by [usr.client.ckey] from [msg].</B></BIG></font>"
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
return 0 //we didn't do anything!
|
||||
@@ -778,11 +778,11 @@
|
||||
return
|
||||
var/reason = sanitize(input("Please enter reason"))
|
||||
if(!reason)
|
||||
M << "\red You have been kicked from the server"
|
||||
M << "<font color='red'>You have been kicked from the server</font>"
|
||||
else
|
||||
M << "\red You have been kicked from the server: [reason]"
|
||||
M << "<font color='red'>You have been kicked from the server: [reason]</font>"
|
||||
log_admin("[key_name(usr)] booted [key_name(M)].")
|
||||
message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] booted [key_name_admin(M)].</font>", 1)
|
||||
//M.client = null
|
||||
qdel(M.client)
|
||||
|
||||
@@ -793,7 +793,7 @@
|
||||
if(t)
|
||||
if((alert("Do you want to unjobban [t]?","Unjobban confirmation", "Yes", "No") == "Yes") && t) //No more misclicks! Unless you do it twice.
|
||||
log_admin("[key_name(usr)] removed [t]")
|
||||
message_admins("\blue [key_name_admin(usr)] removed [t]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] removed [t]</font>", 1)
|
||||
jobban_remove(t)
|
||||
href_list["ban"] = 1 // lets it fall through and refresh
|
||||
var/t_split = splittext(t, " - ")
|
||||
@@ -830,17 +830,17 @@
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins)
|
||||
ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.")
|
||||
notes_add(M.ckey,"[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.",usr)
|
||||
M << "\red<BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG>"
|
||||
M << "\red This is a temporary ban, it will be removed in [mins] minutes."
|
||||
M << "<font color='red'><BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG></font>"
|
||||
M << "<font color='red'>This is a temporary ban, it will be removed in [mins] minutes.</font>"
|
||||
feedback_inc("ban_tmp",1)
|
||||
DB_ban_record(BANTYPE_TEMP, M, mins, reason)
|
||||
feedback_inc("ban_tmp_mins",mins)
|
||||
if(config.banappeals)
|
||||
M << "\red To try to resolve this matter head to [config.banappeals]"
|
||||
M << "<font color='red'>To try to resolve this matter head to [config.banappeals]</font>"
|
||||
else
|
||||
M << "\red No ban appeals URL has been set."
|
||||
M << "<font color='red'>No ban appeals URL has been set.</font>"
|
||||
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.")
|
||||
message_admins("<font color='blue'>[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.</font>")
|
||||
|
||||
qdel(M.client)
|
||||
//qdel(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends.
|
||||
@@ -855,16 +855,16 @@
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP)
|
||||
if("No")
|
||||
AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0)
|
||||
M << "\red<BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG>"
|
||||
M << "\red This is a permanent ban."
|
||||
M << "<font color='red'><BIG><B>You have been banned by [usr.client.ckey].\nReason: [reason].</B></BIG></font>"
|
||||
M << "<font color='red'>This is a permanent ban.</font>"
|
||||
if(config.banappeals)
|
||||
M << "\red To try to resolve this matter head to [config.banappeals]"
|
||||
M << "<font color='red'>To try to resolve this matter head to [config.banappeals]</font>"
|
||||
else
|
||||
M << "\red No ban appeals URL has been set."
|
||||
M << "<font color='red'>No ban appeals URL has been set.</font>"
|
||||
ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.")
|
||||
notes_add(M.ckey,"[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.",usr)
|
||||
log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
|
||||
message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.")
|
||||
message_admins("<font color='blue'>[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.</font>")
|
||||
feedback_inc("ban_perma",1)
|
||||
DB_ban_record(BANTYPE_PERMA, M, -1, reason)
|
||||
|
||||
@@ -920,8 +920,8 @@
|
||||
return alert(usr, "The game has already started.", null, null, null, null)
|
||||
master_mode = href_list["c_mode2"]
|
||||
log_admin("[key_name(usr)] set the mode as [config.mode_names[master_mode]].")
|
||||
message_admins("\blue [key_name_admin(usr)] set the mode as [config.mode_names[master_mode]].", 1)
|
||||
world << "\blue <b>The mode is now: [config.mode_names[master_mode]]</b>"
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] set the mode as [config.mode_names[master_mode]].</font>", 1)
|
||||
world << "<font color='blue'><b>The mode is now: [config.mode_names[master_mode]]</b></font>"
|
||||
Game() // updates the main game menu
|
||||
world.save_mode(master_mode)
|
||||
.(href, list("c_mode"=1))
|
||||
@@ -935,7 +935,7 @@
|
||||
return alert(usr, "The game mode has to be secret!", null, null, null, null)
|
||||
secret_force_mode = href_list["f_secret2"]
|
||||
log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].")
|
||||
message_admins("\blue [key_name_admin(usr)] set the forced secret mode as [secret_force_mode].", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].</font>", 1)
|
||||
Game() // updates the main game menu
|
||||
.(href, list("f_secret"=1))
|
||||
|
||||
@@ -948,7 +948,7 @@
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)]")
|
||||
message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]</font>", 1)
|
||||
H.monkeyize()
|
||||
|
||||
else if(href_list["corgione"])
|
||||
@@ -960,7 +960,7 @@
|
||||
return
|
||||
|
||||
log_admin("[key_name(usr)] attempting to corgize [key_name(H)]")
|
||||
message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(H)]", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] attempting to corgize [key_name_admin(H)]</font>", 1)
|
||||
H.corgize()
|
||||
|
||||
else if(href_list["forcespeech"])
|
||||
@@ -975,7 +975,7 @@
|
||||
M.say(speech)
|
||||
speech = sanitize(speech) // Nah, we don't trust them
|
||||
log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]")
|
||||
message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]")
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]</font>")
|
||||
|
||||
else if(href_list["sendtoprison"])
|
||||
if(!check_rights(R_ADMIN)) return
|
||||
@@ -1014,9 +1014,9 @@
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform)
|
||||
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes)
|
||||
|
||||
M << "\red You have been sent to the prison station!"
|
||||
M << "<font color='red'>You have been sent to the prison station!</font>"
|
||||
log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.")
|
||||
message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.</font>", 1)
|
||||
|
||||
else if(href_list["tdome1"])
|
||||
if(!check_rights(R_FUN)) return
|
||||
@@ -1039,7 +1039,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdome1)
|
||||
spawn(50)
|
||||
M << "\blue You have been sent to the Thunderdome."
|
||||
M << "<font color='blue'>You have been sent to the Thunderdome.</font>"
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)", 1)
|
||||
|
||||
@@ -1064,7 +1064,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdome2)
|
||||
spawn(50)
|
||||
M << "\blue You have been sent to the Thunderdome."
|
||||
M << "<font color='blue'>You have been sent to the Thunderdome.</font>"
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)", 1)
|
||||
|
||||
@@ -1086,7 +1086,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeadmin)
|
||||
spawn(50)
|
||||
M << "\blue You have been sent to the Thunderdome."
|
||||
M << "<font color='blue'>You have been sent to the Thunderdome.</font>"
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)", 1)
|
||||
|
||||
@@ -1115,7 +1115,7 @@
|
||||
sleep(5)
|
||||
M.loc = pick(tdomeobserve)
|
||||
spawn(50)
|
||||
M << "\blue You have been sent to the Thunderdome."
|
||||
M << "<font color='blue'>You have been sent to the Thunderdome.</font>"
|
||||
log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)")
|
||||
message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)", 1)
|
||||
|
||||
@@ -1129,7 +1129,7 @@
|
||||
|
||||
if(config.allow_admin_rev)
|
||||
L.revive()
|
||||
message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!", 1)
|
||||
message_admins("<font color='red'>Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!</font>", 1)
|
||||
log_admin("[key_name(usr)] healed / Rrvived [key_name(L)]")
|
||||
else
|
||||
usr << "Admin Rejuvinates have been disabled"
|
||||
@@ -1142,7 +1142,7 @@
|
||||
usr << "This can only be used on instances of type /mob/living/carbon/human"
|
||||
return
|
||||
|
||||
message_admins("\red Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!", 1)
|
||||
message_admins("<font color='red'>Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!</font>", 1)
|
||||
log_admin("[key_name(usr)] AIized [key_name(H)]")
|
||||
H.AIize()
|
||||
|
||||
@@ -1317,7 +1317,7 @@
|
||||
log_admin("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]")
|
||||
message_admins("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]")
|
||||
feedback_inc("admin_cookies_spawned",1)
|
||||
H << "\blue Your prayers have been answered!! You received the <b>best cookie</b>!"
|
||||
H << "<font color='blue'>Your prayers have been answered!! You received the <b>best cookie</b>!</font>"
|
||||
|
||||
else if(href_list["BlueSpaceArtillery"])
|
||||
if(!check_rights(R_ADMIN|R_FUN)) return
|
||||
@@ -1421,7 +1421,7 @@
|
||||
|
||||
usr << browse(data, "window=[B.name]")
|
||||
else
|
||||
usr << "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]"
|
||||
usr << "<font color='red'>The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]</font>"
|
||||
|
||||
else if (href_list["AdminFaxViewPage"])
|
||||
var/page = text2num(href_list["AdminFaxViewPage"])
|
||||
|
||||
@@ -217,7 +217,7 @@ var/list/debug_verbs = list (
|
||||
var/turf/simulated/location = get_turf(usr)
|
||||
|
||||
if(!istype(location, /turf/simulated)) // We're in space, let's not cause runtimes.
|
||||
usr << "\red this debug tool cannot be used from space"
|
||||
usr << "<font color='red'>this debug tool cannot be used from space</font>"
|
||||
return
|
||||
|
||||
var/icon/red = new('icons/misc/debug_group.dmi', "red") //created here so we don't have to make thousands of these.
|
||||
@@ -368,7 +368,7 @@ var/global/prevent_airgroup_regroup = 0
|
||||
set category = "Mapping"
|
||||
set name = "Regroup All Airgroups Attempt"
|
||||
|
||||
usr << "\red Proc disabled."
|
||||
usr << "<font color='red'>Proc disabled.</font>" //Why not.. Delete the procs instead?
|
||||
|
||||
/*prevent_airgroup_regroup = 0
|
||||
for(var/datum/air_group/AG in air_master.air_groups)
|
||||
@@ -379,7 +379,7 @@ var/global/prevent_airgroup_regroup = 0
|
||||
set category = "Mapping"
|
||||
set name = "Kill pipe processing"
|
||||
|
||||
usr << "\red Proc disabled."
|
||||
usr << "<font color='red'>Proc disabled.</font>"
|
||||
|
||||
/*pipe_processing_killed = !pipe_processing_killed
|
||||
if(pipe_processing_killed)
|
||||
@@ -391,7 +391,7 @@ var/global/prevent_airgroup_regroup = 0
|
||||
set category = "Mapping"
|
||||
set name = "Kill air processing"
|
||||
|
||||
usr << "\red Proc disabled."
|
||||
usr << "<font color='red'>Proc disabled.</font>"
|
||||
|
||||
/*air_processing_killed = !air_processing_killed
|
||||
if(air_processing_killed)
|
||||
@@ -405,7 +405,7 @@ var/global/say_disabled = 0
|
||||
set category = "Mapping"
|
||||
set name = "Disable all communication verbs"
|
||||
|
||||
usr << "\red Proc disabled."
|
||||
usr << "<font color='red'>Proc disabled.</font>"
|
||||
|
||||
/*say_disabled = !say_disabled
|
||||
if(say_disabled)
|
||||
@@ -420,7 +420,7 @@ var/global/movement_disabled_exception //This is the client that calls the proc,
|
||||
set category = "Mapping"
|
||||
set name = "Disable all movement"
|
||||
|
||||
usr << "\red Proc disabled."
|
||||
usr << "<font color='red'>Proc disabled.</font>"
|
||||
|
||||
/*movement_disabled = !movement_disabled
|
||||
if(movement_disabled)
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
if(ticker.triai)
|
||||
ticker.triai = 0
|
||||
usr << "Only one AI will be spawned at round start."
|
||||
message_admins("\blue [key_name_admin(usr)] has toggled off triple AIs at round start.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] has toggled off triple AIs at round start.</font>", 1)
|
||||
else
|
||||
ticker.triai = 1
|
||||
usr << "There will be an AI Triumvirate at round start."
|
||||
message_admins("\blue [key_name_admin(usr)] has toggled on triple AIs at round start.", 1)
|
||||
message_admins("<font color='blue'>[key_name_admin(usr)] has toggled on triple AIs at round start.</font>", 1)
|
||||
return
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
H.updatehealth()
|
||||
else if(ismouse(target))
|
||||
var/mob/living/simple_animal/mouse/M = target
|
||||
visible_message("\red <b>SPLAT!</b>")
|
||||
visible_message("<font color='red'><b>SPLAT!</b></font>")
|
||||
M.splat()
|
||||
playsound(target.loc, 'sound/effects/snap.ogg', 50, 1)
|
||||
layer = MOB_LAYER - 0.2
|
||||
|
||||
@@ -133,7 +133,7 @@ obj/machinery/gateway/centerstation/process()
|
||||
|
||||
/obj/machinery/gateway/centerstation/attackby(obj/item/device/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/multitool))
|
||||
user << "\black The gate is already calibrated, there is no work for you to do here."
|
||||
user << "<font color='black'>The gate is already calibrated, there is no work for you to do here.</font>"
|
||||
return
|
||||
|
||||
/////////////////////////////////////Away////////////////////////
|
||||
@@ -219,7 +219,7 @@ obj/machinery/gateway/centerstation/process()
|
||||
if(istype(M, /mob/living/carbon))
|
||||
for(var/obj/item/weapon/implant/exile/E in M)//Checking that there is an exile implant in the contents
|
||||
if(E.imp_in == M)//Checking that it's actually implanted vs just in their pocket
|
||||
M << "\black The station gate has detected your exile implant and is blocking your entry."
|
||||
M << "<font color='black'>The station gate has detected your exile implant and is blocking your entry.</font>"
|
||||
return
|
||||
M.loc = get_step(stationgate.loc, SOUTH)
|
||||
M.set_dir(SOUTH)
|
||||
@@ -228,9 +228,9 @@ obj/machinery/gateway/centerstation/process()
|
||||
/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/multitool))
|
||||
if(calibrated)
|
||||
user << "\black The gate is already calibrated, there is no work for you to do here."
|
||||
user << "<font color='black'>The gate is already calibrated, there is no work for you to do here.</font>"
|
||||
return
|
||||
else
|
||||
user << "\blue <b>Recalibration successful!</b>: \black This gate's systems have been fine tuned. Travel to this gate will now be on target."
|
||||
user << "<font color='blue'><b>Recalibration successful!</b>:</font><font color='black'> This gate's systems have been fine tuned. Travel to this gate will now be on target.</font>"
|
||||
calibrated = 1
|
||||
return
|
||||
@@ -74,6 +74,9 @@
|
||||
if(GR)
|
||||
qdel(GR)
|
||||
return
|
||||
for(var/obj/structure/reagent_dispensers/fueltank/Fuel in T)
|
||||
Fuel.ex_act(2)
|
||||
return
|
||||
for(var/obj/machinery/door/D in T) // There can be several - and some of them can be open, locate() is not suitable
|
||||
if(D.density)
|
||||
D.ex_act(2)
|
||||
|
||||
@@ -253,7 +253,10 @@
|
||||
"Are You Feeling It",
|
||||
"Great White Snark",
|
||||
"No Shirt No Shoes",
|
||||
"Callsign"
|
||||
"Callsign",
|
||||
"Three Ships in a Trenchcoat",
|
||||
"Not Wearing Pants",
|
||||
"Ridiculous Naming Convention"
|
||||
|
||||
|
||||
)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
src.preload_rsc = pick(config.resource_urls)
|
||||
else src.preload_rsc = 1 // If config.resource_urls is not set, preload like normal.
|
||||
|
||||
src << "\red If the title screen is black, resources are still downloading. Please be patient until the title screen appears."
|
||||
src << "<font color='red'>If the title screen is black, resources are still downloading. Please be patient until the title screen appears.</font>"
|
||||
|
||||
|
||||
clients += src
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
//Set species_restricted list
|
||||
switch(target_species)
|
||||
if("Human", "Skrell") //humanoid bodytypes
|
||||
species_restricted = list("Human", "Skrell") //skrell/humans can wear each other's suits
|
||||
species_restricted = list("Human", "Skrell", "Promethean") //skrell/humans can wear each other's suits
|
||||
else
|
||||
species_restricted = list(target_species)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
//Set species_restricted list
|
||||
switch(target_species)
|
||||
if("Skrell")
|
||||
species_restricted = list("Human", "Skrell") //skrell helmets fit humans too
|
||||
species_restricted = list("Human", "Skrell", "Promethean") //skrell helmets fit humans too
|
||||
|
||||
else
|
||||
species_restricted = list(target_species)
|
||||
@@ -214,7 +214,7 @@
|
||||
return
|
||||
|
||||
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
|
||||
user.visible_message("\red [user] cuts the fingertips off of the [src].","\red You cut the fingertips off of the [src].")
|
||||
user.visible_message("<font color='red'>[user] cuts the fingertips off of the [src].</font>","<font color='red'>You cut the fingertips off of the [src].</font>")
|
||||
|
||||
clipped = 1
|
||||
name = "modified [name]"
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
siemens_coefficient = 0.9 //...what?
|
||||
|
||||
/obj/item/clothing/head/flatcap/grey
|
||||
icon_state = "flat_capg"
|
||||
icon_state = "flat_capw"
|
||||
item_state_slots = list(slot_r_hand_str = "greysoft", slot_l_hand_str = "greysoft")
|
||||
|
||||
/obj/item/clothing/head/pirate
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
camera = new /obj/machinery/camera(src)
|
||||
camera.replace_networks(camera_networks)
|
||||
camera.c_tag = user.name
|
||||
user << "\blue User scanned as [camera.c_tag]. Camera activated."
|
||||
user << "<font color='blue'>User scanned as [camera.c_tag]. Camera activated.</font>"
|
||||
user.update_action_buttons()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// flags_inv = HIDEEARS|BLOCKHAIR
|
||||
|
||||
//Species-specific stuff.
|
||||
species_restricted = list("Human")
|
||||
species_restricted = list("Human", "Promethean")
|
||||
sprite_sheets_refit = list(
|
||||
"Unathi" = 'icons/mob/species/unathi/helmet.dmi',
|
||||
"Tajara" = 'icons/mob/species/tajaran/helmet.dmi',
|
||||
@@ -38,7 +38,7 @@
|
||||
heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
|
||||
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
|
||||
|
||||
species_restricted = list("Human", "Skrell")
|
||||
species_restricted = list("Human", "Skrell", "Promethean")
|
||||
sprite_sheets_refit = list(
|
||||
"Unathi" = 'icons/mob/species/unathi/suit.dmi',
|
||||
"Tajara" = 'icons/mob/species/tajaran/suit.dmi',
|
||||
|
||||
@@ -197,10 +197,10 @@
|
||||
/obj/item/clothing/suit/armor/reactive/attack_self(mob/user as mob)
|
||||
active = !( active )
|
||||
if (active)
|
||||
user << "\blue The reactive armor is now active."
|
||||
user << "<font color='blue'>The reactive armor is now active.</font>"
|
||||
icon_state = "reactive"
|
||||
else
|
||||
user << "\blue The reactive armor is now inactive."
|
||||
user << "<font color='blue'>The reactive armor is now inactive.</font>"
|
||||
icon_state = "reactiveoff"
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
if(bloodsamp.dna != null)
|
||||
data = "Spectometric analysis on provided sample has determined the presence of [bloodsamp.dna.len] strings of DNA.<br><br>"
|
||||
for(var/blood in bloodsamp.dna)
|
||||
data += "\blue Blood type: [bloodsamp.dna[blood]]<br>\nDNA: [blood]<br><br>"
|
||||
data += "<font color='blue'>Blood type: [bloodsamp.dna[blood]]<br>\nDNA: [blood]<br><br></font>"
|
||||
else
|
||||
data += "No DNA found.<br>"
|
||||
P.info = "<b>[src] analysis report #[report_num]</b><br>"
|
||||
|
||||
@@ -156,4 +156,4 @@ proc/spawn_money(var/sum, spawnloc, mob/living/carbon/human/human_user as mob)
|
||||
/obj/item/weapon/spacecash/ewallet/examine(mob/user)
|
||||
..(user)
|
||||
if (!(user in view(2)) && user!=src.loc) return
|
||||
user << "\blue Charge card's owner: [src.owner_name]. Thalers remaining: [src.worth]."
|
||||
user << "<font color='blue'>Charge card's owner: [src.owner_name]. Thalers remaining: [src.worth].</font>"
|
||||
|
||||
@@ -48,12 +48,13 @@
|
||||
|
||||
|
||||
/var/list/economic_species_modifier = list(
|
||||
/datum/species/human = 10,
|
||||
/datum/species/skrell = 12,
|
||||
/datum/species/teshari = 9, // Skrell sponsored,
|
||||
/datum/species/tajaran = 7,
|
||||
/datum/species/unathi = 7,
|
||||
/datum/species/diona = 7
|
||||
/datum/species/human = 10,
|
||||
/datum/species/skrell = 12,
|
||||
/datum/species/teshari = 9, // Skrell sponsored,
|
||||
/datum/species/tajaran = 7,
|
||||
/datum/species/unathi = 7,
|
||||
/datum/species/diona = 7,
|
||||
/datum/species/shapeshifter/promethean = 3
|
||||
)
|
||||
|
||||
//---- The following corporations are friendly with NanoTrasen and loosely enable trade and travel:
|
||||
|
||||
@@ -19,7 +19,7 @@ mob/living/carbon/proc/dream()
|
||||
|
||||
spawn(0)
|
||||
for(var/i = rand(1,4),i > 0, i--)
|
||||
src << "\blue <i>... [pick(dreams)] ...</i>"
|
||||
src << "<font color='blue'><i>... [pick(dreams)] ...</i></font>"
|
||||
sleep(rand(40,70))
|
||||
if(paralysis <= 0)
|
||||
dreaming = 0
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
if(world.time < (last_change + 15))//To prevent super-spam clicking, reduced process size and annoyance -Sieve
|
||||
return 0
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("\b ERROR. Recalibrating projection apparatus.")
|
||||
M.show_message("<b>ERROR. Recalibrating projection apparatus.</b>")
|
||||
last_change = world.time
|
||||
return 0
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
if(world.time < (last_gravity_change + 15))//To prevent super-spam clicking
|
||||
return
|
||||
for(var/mob/M in range(3,src))
|
||||
M.show_message("\b ERROR. Recalibrating gravity field.")
|
||||
M.show_message("<b>ERROR. Recalibrating gravity field.</b>")
|
||||
last_change = world.time
|
||||
return
|
||||
|
||||
|
||||
@@ -2,19 +2,44 @@
|
||||
#define IC_OUTPUT "output"
|
||||
#define IC_ACTIVATOR "activator"
|
||||
|
||||
// Pin functionality.
|
||||
#define DATA_CHANNEL "data channel"
|
||||
#define PULSE_CHANNEL "pulse channel"
|
||||
|
||||
#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box.
|
||||
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be autogenerated for RnD.
|
||||
// Methods of obtaining a circuit.
|
||||
#define IC_SPAWN_DEFAULT 1 // If the circuit comes in the default circuit box and able to be printed in the IC printer.
|
||||
#define IC_SPAWN_RESEARCH 2 // If the circuit design will be available in the IC printer after upgrading it.
|
||||
|
||||
// Displayed along with the pin name to show what type of pin it is.
|
||||
#define IC_FORMAT_ANY "\<ANY\>"
|
||||
#define IC_FORMAT_STRING "\<TEXT\>"
|
||||
#define IC_FORMAT_CHAR "\<CHAR\>"
|
||||
#define IC_FORMAT_COLOR "\<COLOR\>"
|
||||
#define IC_FORMAT_NUMBER "\<NUM\>"
|
||||
#define IC_FORMAT_DIR "\<DIR\>"
|
||||
#define IC_FORMAT_BOOLEAN "\<BOOL\>"
|
||||
#define IC_FORMAT_REF "\<REF\>"
|
||||
#define IC_FORMAT_LIST "\<LIST\>"
|
||||
#define IC_FORMAT_ANY "\<ANY\>"
|
||||
|
||||
#define IC_FORMAT_PULSE "\<PULSE\>"
|
||||
|
||||
// Used inside input/output list to tell the constructor what pin to make.
|
||||
#define IC_PINTYPE_ANY /datum/integrated_io
|
||||
#define IC_PINTYPE_STRING /datum/integrated_io/string
|
||||
#define IC_PINTYPE_CHAR /datum/integrated_io/char
|
||||
#define IC_PINTYPE_COLOR /datum/integrated_io/color
|
||||
#define IC_PINTYPE_NUMBER /datum/integrated_io/number
|
||||
#define IC_PINTYPE_DIR /datum/integrated_io/dir
|
||||
#define IC_PINTYPE_BOOLEAN /datum/integrated_io/boolean
|
||||
#define IC_PINTYPE_REF /datum/integrated_io/ref
|
||||
#define IC_PINTYPE_LIST /datum/integrated_io/list
|
||||
|
||||
#define IC_PINTYPE_PULSE_IN /datum/integrated_io/activate
|
||||
#define IC_PINTYPE_PULSE_OUT /datum/integrated_io/activate/out
|
||||
|
||||
// Data limits.
|
||||
#define IC_MAX_LIST_LENGTH 200
|
||||
|
||||
var/list/all_integrated_circuits = list()
|
||||
|
||||
/proc/initialize_integrated_circuits_list()
|
||||
@@ -30,8 +55,10 @@ var/list/all_integrated_circuits = list()
|
||||
var/obj/item/device/electronic_assembly/assembly = null // Reference to the assembly holding this circuit, if any.
|
||||
var/extended_desc = null
|
||||
var/list/inputs = list()
|
||||
var/list/inputs_default = list() // Assoc list which will fill a pin with data upon creation. e.g. "2" = 0 will set input pin 2 to equal 0 instead of null.
|
||||
var/list/outputs = list()
|
||||
var/list/activators = list() //associated_list, = 1 for inbound, = 0 for outbound
|
||||
var/list/outputs_default = list() // Ditto, for output.
|
||||
var/list/activators = list()
|
||||
var/next_use = 0 //Uses world.time
|
||||
var/complexity = 1 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
|
||||
var/size = null //This acts as a limitation on building machines, bigger components cost more 'space'. -1 for size 0
|
||||
@@ -40,7 +67,6 @@ var/list/all_integrated_circuits = list()
|
||||
var/power_draw_idle = 0 // How much power is drawn when doing nothing.
|
||||
var/spawn_flags = null // Used for world initializing, see the #defines above.
|
||||
var/category_text = "NO CATEGORY THIS IS A BUG" // To show up on circuit printer, and perhaps other places.
|
||||
var/autopulse = -1 // When input is received, the circuit will pulse itself if set to 1. 0 means it won't. -1 means it is permanently off.
|
||||
var/removable = TRUE // Determines if a circuit is removable from the assembly.
|
||||
var/displayed_name = ""
|
||||
var/allow_multitool = 1 // Allows additional multitool functionality
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
/obj/item/device/electronic_assembly
|
||||
name = "electronic assembly"
|
||||
desc = "It's a case, for building electronics with."
|
||||
desc = "It's a case, for building small electronics with."
|
||||
w_class = ITEMSIZE_SMALL
|
||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||
icon_state = "setup_small"
|
||||
@@ -17,6 +17,7 @@
|
||||
/obj/item/device/electronic_assembly/medium
|
||||
name = "electronic mechanism"
|
||||
icon_state = "setup_medium"
|
||||
desc = "It's a case, for building medium-sized electronics with."
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
max_components = IC_COMPONENTS_BASE * 2
|
||||
max_complexity = IC_COMPLEXITY_BASE * 2
|
||||
@@ -24,6 +25,7 @@
|
||||
/obj/item/device/electronic_assembly/large
|
||||
name = "electronic machine"
|
||||
icon_state = "setup_large"
|
||||
desc = "It's a case, for building large electronics with."
|
||||
w_class = ITEMSIZE_LARGE
|
||||
max_components = IC_COMPONENTS_BASE * 4
|
||||
max_complexity = IC_COMPLEXITY_BASE * 4
|
||||
@@ -31,6 +33,7 @@
|
||||
/obj/item/device/electronic_assembly/drone
|
||||
name = "electronic drone"
|
||||
icon_state = "setup_drone"
|
||||
desc = "It's a case, for building mobile electronics with."
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
max_components = IC_COMPONENTS_BASE * 1.5
|
||||
max_complexity = IC_COMPLEXITY_BASE * 1.5
|
||||
@@ -38,9 +41,10 @@
|
||||
/obj/item/device/electronic_assembly/implant
|
||||
name = "electronic implant"
|
||||
icon_state = "setup_implant"
|
||||
desc = "It's a case, for building very tiny electronics with."
|
||||
w_class = ITEMSIZE_TINY
|
||||
max_components = IC_COMPONENTS_BASE / 4
|
||||
max_complexity = IC_COMPLEXITY_BASE / 4
|
||||
max_components = IC_COMPONENTS_BASE / 2
|
||||
max_complexity = IC_COMPLEXITY_BASE / 2
|
||||
var/obj/item/weapon/implant/integrated_circuit/implant = null
|
||||
|
||||
/obj/item/device/electronic_assembly/New()
|
||||
|
||||
@@ -1,8 +1,22 @@
|
||||
/obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type)
|
||||
/obj/item/integrated_circuit/proc/setup_io(var/list/io_list, var/io_type, var/list/io_default_list)
|
||||
var/list/io_list_copy = io_list.Copy()
|
||||
io_list.Cut()
|
||||
var/i = 0
|
||||
for(var/io_entry in io_list_copy)
|
||||
io_list.Add(new io_type(src, io_entry, io_list_copy[io_entry]))
|
||||
var/default_data = null
|
||||
var/io_type_override = null
|
||||
// Override the default data.
|
||||
if(io_default_list && io_default_list.len) // List containing special pin types that need to be added.
|
||||
default_data = io_default_list["[i]"] // This is deliberately text because the index is a number in text form.
|
||||
// Override the pin type.
|
||||
if(io_list_copy[io_entry])
|
||||
io_type_override = io_list_copy[io_entry]
|
||||
|
||||
if(io_type_override)
|
||||
// world << "io_type_override is now [io_type_override] on [src]."
|
||||
io_list.Add(new io_type_override(src, io_entry, default_data))
|
||||
else
|
||||
io_list.Add(new io_type(src, io_entry, default_data))
|
||||
|
||||
/obj/item/integrated_circuit/proc/set_pin_data(var/pin_type, var/pin_number, var/new_data)
|
||||
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)
|
||||
|
||||
@@ -11,10 +11,10 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
// This should be used when someone is examining while the case is opened.
|
||||
/obj/item/integrated_circuit/proc/internal_examine(mob/user)
|
||||
to_chat(user, "This board has [inputs.len] input pin\s, [outputs.len] output pin\s and [activators.len] activation pin\s.")
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I.linked.len)
|
||||
to_chat(user, "The '[I]' is connected to [I.get_linked_to_desc()].")
|
||||
for(var/datum/integrated_io/output/O in outputs)
|
||||
for(var/datum/integrated_io/O in outputs)
|
||||
if(O.linked.len)
|
||||
to_chat(user, "The '[O]' is connected to [O.get_linked_to_desc()].")
|
||||
for(var/datum/integrated_io/activate/A in activators)
|
||||
@@ -34,8 +34,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
displayed_name = name
|
||||
if(!size) size = w_class
|
||||
if(size == -1) size = 0
|
||||
setup_io(inputs, /datum/integrated_io/input)
|
||||
setup_io(outputs, /datum/integrated_io/output)
|
||||
setup_io(inputs, /datum/integrated_io, inputs_default)
|
||||
setup_io(outputs, /datum/integrated_io, outputs_default)
|
||||
setup_io(activators, /datum/integrated_io/activate)
|
||||
..()
|
||||
|
||||
@@ -85,8 +85,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
/obj/item/integrated_circuit/interact(mob/user)
|
||||
if(!check_interactivity(user))
|
||||
return
|
||||
if(!assembly)
|
||||
return
|
||||
// if(!assembly)
|
||||
// return
|
||||
|
||||
var/window_height = 350
|
||||
var/window_width = 600
|
||||
@@ -128,7 +128,7 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
if(1)
|
||||
io = get_pin_ref(IC_INPUT, i)
|
||||
if(io)
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data()]</a></b><br>"
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.display_pin_type()] [io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data(io.data)]</a></b><br>"
|
||||
if(io.linked.len)
|
||||
for(var/datum/integrated_io/linked in io.linked)
|
||||
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
|
||||
@@ -139,14 +139,14 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
height = 1
|
||||
if(2)
|
||||
if(i == 1)
|
||||
words += "[src.displayed_name]<br>([src.name])<hr>[src.desc]"
|
||||
words += "[src.displayed_name]<br>[src.name != src.displayed_name ? "([src.name])":""]<hr>[src.desc]"
|
||||
height = row_height
|
||||
else
|
||||
continue
|
||||
if(3)
|
||||
io = get_pin_ref(IC_OUTPUT, i)
|
||||
if(io)
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data()]</a></b><br>"
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]>[io.display_pin_type()] [io.name]</a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]>[io.display_data(io.data)]</a></b><br>"
|
||||
if(io.linked.len)
|
||||
for(var/datum/integrated_io/linked in io.linked)
|
||||
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
|
||||
@@ -162,7 +162,7 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
var/datum/integrated_io/io = activator
|
||||
var/words = list()
|
||||
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]><font color='FF0000'>[io.name]</font></a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]><font color='FF0000'>[io.data?"\<PULSE IN\>":"\<PULSE OUT\>"]</font></a></b><br>"
|
||||
words += "<b><a href=?src=\ref[src];pin_name=1;pin=\ref[io]><font color='FF0000'>[io.name]</font></a> <a href=?src=\ref[src];pin_data=1;pin=\ref[io]><font color='FF0000'>[io.data?"\<PULSE OUT\>":"\<PULSE IN\>"]</font></a></b><br>"
|
||||
if(io.linked.len)
|
||||
for(var/datum/integrated_io/linked in io.linked)
|
||||
// words += "<a href=?src=\ref[linked.holder];pin_name=1;pin=\ref[linked];link=\ref[io]>\[[linked.name]\]</a>
|
||||
@@ -176,10 +176,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
HTML += "</table>"
|
||||
HTML += "</div>"
|
||||
|
||||
if(autopulse != -1)
|
||||
HTML += "<br><font color='33CC33'>Meta Variables;</font>"
|
||||
HTML += "<br><font color='33CC33'><a href='?src=\ref[src];autopulse=1'>\[Autopulse\]</a> = <b>[autopulse ? "ON" : "OFF"]</b></font>"
|
||||
HTML += "<br>"
|
||||
// HTML += "<br><font color='33CC33'>Meta Variables;</font>" // If more meta vars get introduced, uncomment this.
|
||||
// HTML += "<br>"
|
||||
|
||||
HTML += "<br><font color='0000AA'>Complexity: [complexity]</font>"
|
||||
if(power_draw_idle)
|
||||
@@ -235,6 +233,8 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
|
||||
else
|
||||
var/datum/integrated_io/io = pin
|
||||
io.ask_for_pin_data(usr) // The pins themselves will determine how to ask for data, and will validate the data.
|
||||
/*
|
||||
if(io.io_type == DATA_CHANNEL)
|
||||
|
||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in list("string","number", "null")
|
||||
@@ -260,6 +260,7 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
else if(io.io_type == PULSE_CHANNEL)
|
||||
io.holder.check_then_do_work(ignore_power = TRUE)
|
||||
to_chat(usr, "<span class='notice'>You pulse \the [io.holder]'s [io] pin.</span>")
|
||||
*/
|
||||
|
||||
|
||||
if(href_list["pin_unwire"])
|
||||
@@ -313,10 +314,6 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You need a multitool/debugger set to 'ref' mode to do that.</span>")
|
||||
|
||||
if(href_list["autopulse"])
|
||||
if(autopulse != -1)
|
||||
autopulse = !autopulse
|
||||
|
||||
if(href_list["return"])
|
||||
if(A)
|
||||
update_to_assembly = 1
|
||||
@@ -354,11 +351,11 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/proc/push_data()
|
||||
for(var/datum/integrated_io/output/O in outputs)
|
||||
for(var/datum/integrated_io/O in outputs)
|
||||
O.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/proc/pull_data()
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/proc/draw_idle_power()
|
||||
@@ -391,9 +388,9 @@ a creative player the means to solve many problems. Circuits are held inside an
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/proc/disconnect_all()
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.disconnect()
|
||||
for(var/datum/integrated_io/output/O in outputs)
|
||||
for(var/datum/integrated_io/O in outputs)
|
||||
O.disconnect()
|
||||
for(var/datum/integrated_io/activate/A in activators)
|
||||
A.disconnect()
|
||||
|
||||
@@ -25,10 +25,11 @@ D [1]/ ||
|
||||
var/list/linked = list()
|
||||
var/io_type = DATA_CHANNEL
|
||||
|
||||
/datum/integrated_io/New(var/newloc, var/name, var/data)
|
||||
/datum/integrated_io/New(var/newloc, var/name, var/new_data)
|
||||
..()
|
||||
src.name = name
|
||||
src.data = data
|
||||
if(new_data)
|
||||
src.data = new_data
|
||||
holder = newloc
|
||||
if(!istype(holder))
|
||||
message_admins("ERROR: An integrated_io ([src.name]) spawned without a valid holder! This is a bug.")
|
||||
@@ -50,17 +51,43 @@ D [1]/ ||
|
||||
var/output = w.resolve()
|
||||
return istype(output, as_type) ? output : null
|
||||
|
||||
/datum/integrated_io/proc/display_data()
|
||||
if(isnull(data))
|
||||
/datum/integrated_io/proc/display_data(var/input)
|
||||
if(isnull(input))
|
||||
return "(null)" // Empty data means nothing to show.
|
||||
if(istext(data))
|
||||
return "(\"[data]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'.
|
||||
if(isweakref(data))
|
||||
var/weakref/w = data
|
||||
|
||||
if(istext(input))
|
||||
return "(\"[input]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'.
|
||||
|
||||
/*
|
||||
list[](
|
||||
"A",
|
||||
"B",
|
||||
"C"
|
||||
)
|
||||
*/
|
||||
|
||||
if(islist(input))
|
||||
var/list/my_list = input
|
||||
var/result = "list\[[my_list.len]\]("
|
||||
if(my_list.len)
|
||||
result += "<br>"
|
||||
var/pos = 0
|
||||
for(var/line in my_list)
|
||||
result += "[display_data(line)]"
|
||||
pos++
|
||||
if(pos != my_list.len)
|
||||
result += ",<br>"
|
||||
result += "<br>"
|
||||
result += ")"
|
||||
return result
|
||||
|
||||
if(isweakref(input))
|
||||
var/weakref/w = input
|
||||
var/atom/A = w.resolve()
|
||||
//return A ? "([A.name] \[Ref\])" : "(null)" // For refs, we want just the name displayed.
|
||||
return A ? "(\ref[A] \[Ref\])" : "(null)"
|
||||
return "([data])" // Nothing special needed for numbers or other stuff.
|
||||
|
||||
return "([input])" // Nothing special needed for numbers or other stuff.
|
||||
|
||||
/datum/integrated_io/activate/display_data()
|
||||
return "(\[pulse\])"
|
||||
@@ -117,23 +144,44 @@ D [1]/ ||
|
||||
//Now that we're removed from them, we gotta remove them from us.
|
||||
src.linked.Remove(their_io)
|
||||
|
||||
/datum/integrated_io/input
|
||||
name = "input pin"
|
||||
/datum/integrated_io/proc/ask_for_data_type(mob/user, var/default, var/list/allowed_data_types = list("string","number","null"))
|
||||
var/type_to_use = input("Please choose a type to use.","[src] type setting") as null|anything in allowed_data_types
|
||||
if(!holder.check_interactivity(user))
|
||||
return
|
||||
|
||||
/datum/integrated_io/output
|
||||
name = "output pin"
|
||||
var/new_data = null
|
||||
switch(type_to_use)
|
||||
if("string")
|
||||
new_data = input("Now type in a string.","[src] string writing", istext(default) ? default : null) as null|text
|
||||
if(istext(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
return new_data
|
||||
if("number")
|
||||
new_data = input("Now type in a number.","[src] number writing", isnum(default) ? default : null) as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
return new_data
|
||||
if("null")
|
||||
if(holder.check_interactivity(user))
|
||||
to_chat(user, "<span class='notice'>You clear the pin's memory.</span>")
|
||||
return new_data
|
||||
|
||||
// Basically a null check
|
||||
/datum/integrated_io/proc/is_valid()
|
||||
return !isnull(data)
|
||||
|
||||
// This proc asks for the data to write, then writes it.
|
||||
/datum/integrated_io/proc/ask_for_pin_data(mob/user)
|
||||
var/new_data = ask_for_data_type(user)
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/activate/ask_for_pin_data(mob/user) // This just pulses the pin.
|
||||
holder.check_then_do_work(ignore_power = TRUE)
|
||||
to_chat(user, "<span class='notice'>You pulse \the [holder]'s [src] pin.</span>")
|
||||
|
||||
/datum/integrated_io/activate
|
||||
name = "activation pin"
|
||||
io_type = PULSE_CHANNEL
|
||||
|
||||
/datum/integrated_io/list
|
||||
name = "list pin"
|
||||
|
||||
/datum/integrated_io/list/write_data_to_pin(var/new_data)
|
||||
if(islist(new_data))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/list/display_pin_type()
|
||||
return IC_FORMAT_LIST
|
||||
/datum/integrated_io/activate/out // All this does is just make the UI say 'out' instead of 'in'
|
||||
data = 1
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
|
||||
/obj/item/device/integrated_circuit_printer
|
||||
name = "integrated circuit printer"
|
||||
desc = "A portable(ish) machine made to print tiny modular circuitry out of metal."
|
||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||
icon_state = "circuit_printer"
|
||||
w_class = ITEMSIZE_LARGE
|
||||
var/metal = 0
|
||||
var/max_metal = 100
|
||||
var/metal_per_sheet = 10 // One sheet equals this much metal.
|
||||
|
||||
var/upgraded = FALSE // When hit with an upgrade disk, will turn true, allowing it to print the higher tier circuits.
|
||||
var/can_clone = FALSE // Same for above, but will allow the printer to duplicate a specific assembly.
|
||||
var/static/list/recipe_list = list()
|
||||
var/current_category = null
|
||||
var/obj/item/device/electronic_assembly/assembly_to_clone = null
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/upgraded
|
||||
upgraded = TRUE
|
||||
can_clone = TRUE
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/initialize()
|
||||
..()
|
||||
if(!recipe_list.len)
|
||||
// Unfortunately this needed a lot of loops, but it should only be run once at init.
|
||||
|
||||
// First loop is to seperate the actual circuits from base circuits.
|
||||
var/list/circuits_to_use = list()
|
||||
for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
|
||||
if((IC.spawn_flags & IC_SPAWN_DEFAULT) || (IC.spawn_flags & IC_SPAWN_RESEARCH))
|
||||
circuits_to_use.Add(IC)
|
||||
|
||||
// Second loop is to find all categories.
|
||||
var/list/found_categories = list()
|
||||
for(var/obj/item/integrated_circuit/IC in circuits_to_use)
|
||||
if(!(IC.category_text in found_categories))
|
||||
found_categories.Add(IC.category_text)
|
||||
|
||||
// Third loop is to initialize lists by category names, then put circuits matching the category inside.
|
||||
for(var/category in found_categories)
|
||||
recipe_list[category] = list()
|
||||
var/list/current_list = recipe_list[category]
|
||||
for(var/obj/item/integrated_circuit/IC in circuits_to_use)
|
||||
if(IC.category_text == category)
|
||||
current_list.Add(IC)
|
||||
|
||||
// Now for non-circuit things.
|
||||
var/list/assembly_list = list()
|
||||
assembly_list.Add(
|
||||
new /obj/item/device/electronic_assembly(null),
|
||||
new /obj/item/device/electronic_assembly/medium(null),
|
||||
new /obj/item/device/electronic_assembly/large(null),
|
||||
new /obj/item/device/electronic_assembly/drone(null),
|
||||
new /obj/item/weapon/implant/integrated_circuit(null),
|
||||
new /obj/item/device/assembly/electronic_assembly(null)
|
||||
)
|
||||
recipe_list["Assemblies"] = assembly_list
|
||||
|
||||
var/list/tools_list = list()
|
||||
tools_list.Add(
|
||||
new /obj/item/device/integrated_electronics/wirer(null),
|
||||
new /obj/item/device/integrated_electronics/debugger(null)
|
||||
)
|
||||
recipe_list["Tools"] = tools_list
|
||||
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/attackby(var/obj/item/O, var/mob/user)
|
||||
if(istype(O,/obj/item/stack/material))
|
||||
var/obj/item/stack/material/stack = O
|
||||
if(stack.material.name == DEFAULT_WALL_MATERIAL)
|
||||
var/num = min((max_metal - metal) / metal_per_sheet, stack.amount)
|
||||
if(num < 1)
|
||||
to_chat(user, "<span class='warning'>\The [src] is too full to add more metal.</span>")
|
||||
return
|
||||
if(stack.use(num))
|
||||
to_chat(user, "<span class='notice'>You add [num] sheet\s to \the [src].</span>")
|
||||
metal += num * metal_per_sheet
|
||||
interact(user)
|
||||
return TRUE
|
||||
|
||||
if(istype(O,/obj/item/integrated_circuit))
|
||||
to_chat(user, "<span class='notice'>You insert the circuit into \the [src]. </span>")
|
||||
user.unEquip(O)
|
||||
metal = min(metal + O.w_class, max_metal)
|
||||
qdel(O)
|
||||
interact(user)
|
||||
return TRUE
|
||||
|
||||
if(istype(O,/obj/item/weapon/disk/integrated_circuit/upgrade/advanced))
|
||||
if(upgraded)
|
||||
to_chat(user, "<span class='warning'>\The [src] already has this upgrade. </span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You install \the [O] into \the [src]. </span>")
|
||||
upgraded = TRUE
|
||||
interact(user)
|
||||
return TRUE
|
||||
|
||||
if(istype(O,/obj/item/weapon/disk/integrated_circuit/upgrade/clone))
|
||||
if(can_clone)
|
||||
to_chat(user, "<span class='warning'>\The [src] already has this upgrade. </span>")
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>You install \the [O] into \the [src]. </span>")
|
||||
can_clone = TRUE
|
||||
interact(user)
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/attack_self(var/mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/interact(mob/user)
|
||||
var/window_height = 600
|
||||
var/window_width = 500
|
||||
|
||||
if(isnull(current_category))
|
||||
current_category = recipe_list[1]
|
||||
|
||||
var/HTML = "<center><h2>Integrated Circuit Printer</h2></center><br>"
|
||||
HTML += "Metal: [metal/metal_per_sheet]/[max_metal/metal_per_sheet] sheets.<br>"
|
||||
HTML += "Circuits available: [upgraded ? "Regular":"Advanced"]."
|
||||
HTML += "Assembly Cloning: [can_clone ? "Available": "Unavailable"]."
|
||||
if(assembly_to_clone)
|
||||
HTML += "Assembly '[assembly_to_clone.name]' loaded."
|
||||
HTML += "Crossed out circuits mean that the printer is not sufficentally upgraded to create that circuit.<br>"
|
||||
HTML += "<hr>"
|
||||
HTML += "Categories:"
|
||||
for(var/category in recipe_list)
|
||||
if(category != current_category)
|
||||
HTML += " <a href='?src=\ref[src];category=[category]'>\[[category]\]</a> "
|
||||
else // Bold the button if it's already selected.
|
||||
HTML += " <b>\[[category]\]</b> "
|
||||
HTML += "<hr>"
|
||||
HTML += "<center><h4>[current_category]</h4></center>"
|
||||
|
||||
var/list/current_list = recipe_list[current_category]
|
||||
for(var/obj/O in current_list)
|
||||
var/can_build = TRUE
|
||||
if(istype(O, /obj/item/integrated_circuit))
|
||||
var/obj/item/integrated_circuit/IC = O
|
||||
if((IC.spawn_flags & IC_SPAWN_RESEARCH) && (!(IC.spawn_flags & IC_SPAWN_DEFAULT)) && !upgraded)
|
||||
can_build = FALSE
|
||||
if(can_build)
|
||||
HTML += "<A href='?src=\ref[src];build=[O.type]'>\[[O.name]\]</A>: [O.desc]<br>"
|
||||
else
|
||||
HTML += "<s>\[[O.name]\]: [O.desc]</s><br>"
|
||||
|
||||
user << browse(jointext(HTML, null), "window=integrated_printer;size=[window_width]x[window_height];border=1;can_resize=1;can_close=1;can_minimize=1")
|
||||
|
||||
/obj/item/device/integrated_circuit_printer/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(href_list["category"])
|
||||
current_category = href_list["category"]
|
||||
|
||||
if(href_list["build"])
|
||||
var/build_type = text2path(href_list["build"])
|
||||
if(!build_type || !ispath(build_type))
|
||||
return 1
|
||||
|
||||
var/cost = 1
|
||||
if(ispath(build_type, /obj/item/device/electronic_assembly))
|
||||
var/obj/item/device/electronic_assembly/E = build_type
|
||||
cost = round( (initial(E.max_complexity) + initial(E.max_components) ) / 4)
|
||||
else if(ispath(build_type, /obj/item/integrated_circuit))
|
||||
var/obj/item/integrated_circuit/IC = build_type
|
||||
cost = initial(IC.w_class)
|
||||
|
||||
if(metal - cost < 0)
|
||||
to_chat(usr, "<span class='warning'>You need [cost] metal to build that!.</span>")
|
||||
return 1
|
||||
metal -= cost
|
||||
new build_type(get_turf(loc))
|
||||
|
||||
interact(usr)
|
||||
|
||||
// FUKKEN UPGRADE DISKS
|
||||
/obj/item/weapon/disk/integrated_circuit/upgrade
|
||||
name = "integrated circuit printer upgrade disk"
|
||||
desc = "Install this into your integrated circuit printer to enhance it."
|
||||
icon = 'icons/obj/electronic_assemblies.dmi'
|
||||
icon_state = "upgrade_disk"
|
||||
item_state = "card-id"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 4)
|
||||
|
||||
/obj/item/weapon/disk/integrated_circuit/upgrade/advanced
|
||||
name = "integrated circuit printer upgrade disk - advanced designs"
|
||||
desc = "Install this into your integrated circuit printer to enhance it. This one adds new, advanced designs to the printer."
|
||||
|
||||
// To be implemented later.
|
||||
/obj/item/weapon/disk/integrated_circuit/upgrade/clone
|
||||
name = "integrated circuit printer upgrade disk - circuit cloner"
|
||||
desc = "Install this into your integrated circuit printer to enhance it. This one allows the printer to duplicate assemblies."
|
||||
icon_state = "upgrade_disk_clone"
|
||||
origin_tech = list(TECH_ENGINEERING = 5, TECH_DATA = 6)
|
||||
@@ -0,0 +1,25 @@
|
||||
// These pins only contain 0 or 1. Null is not allowed.
|
||||
/datum/integrated_io/boolean
|
||||
name = "boolean pin"
|
||||
data = FALSE
|
||||
|
||||
/datum/integrated_io/boolean/ask_for_pin_data(mob/user) // 'Ask' is a bit misleading, acts more like a toggle.
|
||||
var/new_data = !data
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/boolean/write_data_to_pin(var/new_data)
|
||||
if(new_data == FALSE || new_data == TRUE)
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/boolean/scramble()
|
||||
write_data_to_pin(rand(FALSE,TRUE))
|
||||
push_data()
|
||||
|
||||
/datum/integrated_io/boolean/display_pin_type()
|
||||
return IC_FORMAT_BOOLEAN
|
||||
|
||||
/datum/integrated_io/boolean/display_data(var/input)
|
||||
if(data == TRUE)
|
||||
return "(True)"
|
||||
return "(False)"
|
||||
@@ -0,0 +1,27 @@
|
||||
// These pins can only contain a 1 character string or null.
|
||||
/datum/integrated_io/char
|
||||
name = "char pin"
|
||||
|
||||
/datum/integrated_io/char/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please type in one character.","[src] char writing") as null|text
|
||||
if(holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/char/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || istext(new_data))
|
||||
if(length(new_data) > 1)
|
||||
return
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
// This makes the text go from "A" to "%".
|
||||
/datum/integrated_io/char/scramble()
|
||||
if(!is_valid())
|
||||
return
|
||||
var/list/options = list("!","@","#","$","%","^","&","*") + alphabet_uppercase
|
||||
data = pick(options)
|
||||
push_data()
|
||||
|
||||
/datum/integrated_io/char/display_pin_type()
|
||||
return IC_FORMAT_CHAR
|
||||
@@ -0,0 +1,51 @@
|
||||
// These pins can only contain a color (in the form of #FFFFFF) or null.
|
||||
/datum/integrated_io/color
|
||||
name = "color pin"
|
||||
|
||||
/datum/integrated_io/color/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please select a color.","[src] color writing") as null|color
|
||||
if(holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input a <font color='[new_data]'>new color</font> into the pin.</span>")
|
||||
world << "new_data equals [new_data]."
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/color/write_data_to_pin(var/new_data)
|
||||
// Since this is storing the color as a string hex color code, we need to make sure it's actually one.
|
||||
if(isnull(new_data) || istext(new_data))
|
||||
if(istext(new_data))
|
||||
new_data = uppertext(new_data)
|
||||
if(length(new_data) != 7) // We can hex if we want to, we can leave your strings behind
|
||||
world << "Wrong length."
|
||||
return // Cause your strings don't hex and if they don't hex
|
||||
var/friends = copytext(new_data, 2, 8) // Well they're are no strings of mine
|
||||
world << "friends equal [friends]."
|
||||
// I say, we can go where we want to, a place where they will never find
|
||||
var/safety_dance = 1
|
||||
while(safety_dance >= 7) // And we can act like we come from out of this world.log
|
||||
var/hex = copytext(friends, safety_dance, safety_dance+1)
|
||||
world << "Checking [hex]."
|
||||
if(!(hex in list("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F")))
|
||||
world << "Hex [hex] failed"
|
||||
return // Leave the fake one far behind,
|
||||
safety_dance++
|
||||
|
||||
data = new_data // And we can hex
|
||||
holder.on_data_written()
|
||||
world << "Done."
|
||||
world << "Rip."
|
||||
|
||||
// This randomizes the color.
|
||||
/datum/integrated_io/color/scramble()
|
||||
if(!is_valid())
|
||||
return
|
||||
var/new_data = get_random_colour(simple = FALSE, lower = 0, upper = 255)
|
||||
data = new_data
|
||||
push_data()
|
||||
|
||||
/datum/integrated_io/color/display_pin_type()
|
||||
return IC_FORMAT_COLOR
|
||||
|
||||
/datum/integrated_io/color/display_data(var/input)
|
||||
if(!isnull(data))
|
||||
return "(<font color='[data]'>[data]</font>)"
|
||||
return ..()
|
||||
@@ -0,0 +1,33 @@
|
||||
// These pins can only contain directions (1,2,4,8...) or null.
|
||||
/datum/integrated_io/dir
|
||||
name = "dir pin"
|
||||
|
||||
/datum/integrated_io/dir/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please type in a valid dir number. \
|
||||
Valid dirs are;\n\
|
||||
North/Fore = [NORTH],\n\
|
||||
South/Aft = [SOUTH],\n\
|
||||
East/Starboard = [EAST],\n\
|
||||
West/Port = [WEST],\n\
|
||||
Northeast = [NORTHEAST],\n\
|
||||
Northwest = [NORTHWEST],\n\
|
||||
Southeast = [SOUTHEAST],\n\
|
||||
Southwest = [SOUTHWEST],\n\
|
||||
Up = [UP],\n\
|
||||
Down = [DOWN]","[src] dir writing") as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/dir/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || new_data in alldirs + list(UP, DOWN))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/dir/display_pin_type()
|
||||
return IC_FORMAT_DIR
|
||||
|
||||
/datum/integrated_io/dir/display_data(var/input)
|
||||
if(!isnull(data))
|
||||
return "([dir2text(data)])"
|
||||
return ..()
|
||||
@@ -0,0 +1,150 @@
|
||||
// These pins contain a list. Null is not allowed.
|
||||
/datum/integrated_io/list
|
||||
name = "list pin"
|
||||
data = list()
|
||||
|
||||
|
||||
/datum/integrated_io/list/ask_for_pin_data(mob/user)
|
||||
interact(user)
|
||||
|
||||
/datum/integrated_io/list/proc/interact(mob/user)
|
||||
var/list/my_list = data
|
||||
var/t = "<h2>[src]</h2><br>"
|
||||
t += "List length: [my_list.len]<br>"
|
||||
t += "<a href='?src=\ref[src]'>\[Refresh\]</a> | "
|
||||
t += "<a href='?src=\ref[src];add=1'>\[Add\]</a> | "
|
||||
t += "<a href='?src=\ref[src];swap=1'>\[Swap\]</a> | "
|
||||
t += "<a href='?src=\ref[src];clear=1'>\[Clear\]</a><br>"
|
||||
t += "<hr>"
|
||||
var/i = 0
|
||||
for(var/line in my_list)
|
||||
i++
|
||||
t += "#[i] | [display_data(line)] | "
|
||||
t += "<a href='?src=\ref[src];edit=1;pos=[i]'>\[Edit\]</a> | "
|
||||
t += "<a href='?src=\ref[src];remove=1;pos=[i]'>\[Remove\]</a><br>"
|
||||
user << browse(t, "window=list_pin_\ref[src];size=500x400")
|
||||
|
||||
/datum/integrated_io/list/proc/add_to_list(mob/user, var/new_entry)
|
||||
if(!new_entry && user)
|
||||
new_entry = ask_for_data_type(user)
|
||||
if(is_valid(new_entry))
|
||||
Add(new_entry)
|
||||
|
||||
/datum/integrated_io/list/proc/Add(var/new_entry)
|
||||
var/list/my_list = data
|
||||
if(my_list.len > IC_MAX_LIST_LENGTH)
|
||||
my_list.Cut(Start=1,End=2)
|
||||
my_list.Add(new_entry)
|
||||
|
||||
/datum/integrated_io/list/proc/remove_from_list_by_position(mob/user, var/position)
|
||||
var/list/my_list = data
|
||||
if(!my_list.len)
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to remove.</span>")
|
||||
return
|
||||
if(!position)
|
||||
return
|
||||
var/target_entry = my_list.Find(position)
|
||||
if(target_entry)
|
||||
my_list.Remove(target_entry)
|
||||
|
||||
/datum/integrated_io/list/proc/remove_from_list(mob/user, var/target_entry)
|
||||
var/list/my_list = data
|
||||
if(!my_list.len)
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to remove.</span>")
|
||||
return
|
||||
if(!target_entry)
|
||||
target_entry = input("Which piece of data do you want to remove?", "Remove") as null|anything in my_list
|
||||
if(target_entry)
|
||||
my_list.Remove(target_entry)
|
||||
|
||||
/datum/integrated_io/list/proc/edit_in_list(mob/user, var/target_entry)
|
||||
var/list/my_list = data
|
||||
if(!my_list.len)
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to modify.</span>")
|
||||
return
|
||||
if(!target_entry)
|
||||
target_entry = input("Which piece of data do you want to edit?", "Edit") as null|anything in my_list
|
||||
if(target_entry)
|
||||
var/edited_entry = ask_for_data_type(user, target_entry)
|
||||
if(edited_entry)
|
||||
target_entry = edited_entry
|
||||
|
||||
/datum/integrated_io/list/proc/edit_in_list_by_position(mob/user, var/position)
|
||||
var/list/my_list = data
|
||||
if(!my_list.len)
|
||||
to_chat(user, "<span class='warning'>The list is empty, there's nothing to modify.</span>")
|
||||
return
|
||||
if(!position)
|
||||
return
|
||||
var/target_entry = my_list.Find(position)
|
||||
if(target_entry)
|
||||
var/edited_entry = ask_for_data_type(user, target_entry)
|
||||
if(edited_entry)
|
||||
target_entry = edited_entry
|
||||
|
||||
/datum/integrated_io/list/proc/swap_inside_list(mob/user, var/first_target, var/second_target)
|
||||
var/list/my_list = data
|
||||
if(my_list.len <= 1)
|
||||
to_chat(user, "<span class='warning'>The list is empty, or too small to do any meaningful swapping.</span>")
|
||||
return
|
||||
if(!first_target)
|
||||
first_target = input("Which piece of data do you want to swap? (1)", "Swap") as null|anything in my_list
|
||||
|
||||
if(first_target)
|
||||
if(!second_target)
|
||||
second_target = input("Which piece of data do you want to swap? (2)", "Swap") as null|anything in my_list - first_target
|
||||
|
||||
if(second_target)
|
||||
var/first_pos = my_list.Find(first_target)
|
||||
var/second_pos = my_list.Find(second_target)
|
||||
my_list.Swap(first_pos, second_pos)
|
||||
|
||||
/datum/integrated_io/list/proc/clear_list(mob/user)
|
||||
var/list/my_list = data
|
||||
my_list.Cut()
|
||||
|
||||
/datum/integrated_io/list/scramble()
|
||||
var/list/my_list = data
|
||||
my_list = shuffle(my_list)
|
||||
push_data()
|
||||
|
||||
/datum/integrated_io/list/write_data_to_pin(var/new_data)
|
||||
if(islist(new_data))
|
||||
var/list/new_list = new_data
|
||||
data = new_list.Copy()
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/list/display_pin_type()
|
||||
return IC_FORMAT_LIST
|
||||
|
||||
/datum/integrated_io/list/Topic(href, href_list, state = interactive_state)
|
||||
if(!holder.check_interactivity(usr))
|
||||
return
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["add"])
|
||||
add_to_list(usr)
|
||||
|
||||
if(href_list["swap"])
|
||||
swap_inside_list(usr)
|
||||
|
||||
if(href_list["clear"])
|
||||
clear_list(usr)
|
||||
|
||||
if(href_list["remove"])
|
||||
world << "Removing [href_list["pos"]]"
|
||||
if(href_list["pos"])
|
||||
remove_from_list_by_position(usr, text2num(href_list["pos"]))
|
||||
else
|
||||
remove_from_list(usr)
|
||||
|
||||
if(href_list["edit"])
|
||||
if(href_list["pos"])
|
||||
edit_in_list_by_position(usr, text2num(href_list["pos"]))
|
||||
else
|
||||
edit_in_list(usr)
|
||||
|
||||
holder.interact(usr) // Refresh the main UI,
|
||||
interact(usr) // and the list UI.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
// These pins can only contain numbers (int and floating point) or null.
|
||||
/datum/integrated_io/number
|
||||
name = "number pin"
|
||||
// data = 0
|
||||
|
||||
/datum/integrated_io/number/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please type in a number.","[src] number writing") as null|num
|
||||
if(isnum(new_data) && holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/number/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || isnum(new_data))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/number/display_pin_type()
|
||||
return IC_FORMAT_NUMBER
|
||||
@@ -0,0 +1,14 @@
|
||||
// These pins only contain weakrefs or null.
|
||||
/datum/integrated_io/ref
|
||||
name = "ref pin"
|
||||
|
||||
/datum/integrated_io/ref/ask_for_pin_data(mob/user) // This clears the pin.
|
||||
write_data_to_pin(null)
|
||||
|
||||
/datum/integrated_io/ref/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || isweakref(new_data))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
/datum/integrated_io/ref/display_pin_type()
|
||||
return IC_FORMAT_REF
|
||||
@@ -0,0 +1,29 @@
|
||||
// These pins can only contain text and null.
|
||||
/datum/integrated_io/string
|
||||
name = "string pin"
|
||||
|
||||
/datum/integrated_io/string/ask_for_pin_data(mob/user)
|
||||
var/new_data = input("Please type in a string.","[src] string writing") as null|text
|
||||
if(holder.check_interactivity(user) )
|
||||
to_chat(user, "<span class='notice'>You input [new_data ? "new_data" : "NULL"] into the pin.</span>")
|
||||
write_data_to_pin(new_data)
|
||||
|
||||
/datum/integrated_io/string/write_data_to_pin(var/new_data)
|
||||
if(isnull(new_data) || istext(new_data))
|
||||
data = new_data
|
||||
holder.on_data_written()
|
||||
|
||||
// This makes the text go "from this" to "#G&*!HD$%L"
|
||||
/datum/integrated_io/string/scramble()
|
||||
if(!is_valid())
|
||||
return
|
||||
var/string_length = length(data)
|
||||
var/list/options = list("!","@","#","$","%","^","&","*") + alphabet_uppercase
|
||||
var/new_data = ""
|
||||
while(string_length)
|
||||
new_data += pick(options)
|
||||
string_length--
|
||||
push_data()
|
||||
|
||||
/datum/integrated_io/string/display_pin_type()
|
||||
return IC_FORMAT_STRING
|
||||
@@ -2,25 +2,20 @@
|
||||
/obj/item/integrated_circuit/arithmetic
|
||||
complexity = 1
|
||||
inputs = list(
|
||||
"\<NUM\> A",
|
||||
"\<NUM\> B",
|
||||
"\<NUM\> C",
|
||||
"\<NUM\> D",
|
||||
"\<NUM\> E",
|
||||
"\<NUM\> F",
|
||||
"\<NUM\> G",
|
||||
"\<NUM\> H"
|
||||
"A" = IC_PINTYPE_NUMBER,
|
||||
"B" = IC_PINTYPE_NUMBER,
|
||||
"C" = IC_PINTYPE_NUMBER,
|
||||
"D" = IC_PINTYPE_NUMBER,
|
||||
"E" = IC_PINTYPE_NUMBER,
|
||||
"F" = IC_PINTYPE_NUMBER,
|
||||
"G" = IC_PINTYPE_NUMBER,
|
||||
"H" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
outputs = list("\<NUM\> result")
|
||||
activators = list("compute" = 1, "on computed" = 0)
|
||||
outputs = list("result" = IC_PINTYPE_NUMBER)
|
||||
activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
|
||||
category_text = "Arithmetic"
|
||||
autopulse = 1
|
||||
power_draw_per_use = 5 // Math is pretty cheap.
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/on_data_written()
|
||||
if(autopulse == 1)
|
||||
check_then_do_work()
|
||||
|
||||
// +Adding+ //
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/addition
|
||||
@@ -34,7 +29,7 @@
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/addition/do_work()
|
||||
var/result = 0
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.pull_data()
|
||||
if(isnum(I.data))
|
||||
result = result + I.data
|
||||
@@ -60,7 +55,7 @@
|
||||
return
|
||||
var/result = A.data
|
||||
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I == A)
|
||||
continue
|
||||
I.pull_data()
|
||||
@@ -88,7 +83,7 @@
|
||||
if(!isnum(A.data))
|
||||
return
|
||||
var/result = A.data
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I == A)
|
||||
continue
|
||||
I.pull_data()
|
||||
@@ -116,7 +111,7 @@
|
||||
return
|
||||
var/result = A.data
|
||||
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
if(I == A)
|
||||
continue
|
||||
I.pull_data()
|
||||
@@ -133,7 +128,7 @@
|
||||
name = "exponent circuit"
|
||||
desc = "Outputs A to the power of B."
|
||||
icon_state = "exponent"
|
||||
inputs = list("A", "B")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/exponent/do_work()
|
||||
@@ -154,7 +149,7 @@
|
||||
desc = "This will say if a number is positive, negative, or zero."
|
||||
extended_desc = "Will output 1, -1, or 0, depending on if A is a postive number, a negative number, or zero, respectively."
|
||||
icon_state = "sign"
|
||||
inputs = list("A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/sign/do_work()
|
||||
@@ -179,7 +174,7 @@
|
||||
desc = "Rounds A to the nearest B multiple of A."
|
||||
extended_desc = "If B is not given a number, it will output the floor of A instead."
|
||||
icon_state = "round"
|
||||
inputs = list("A", "B")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/round/do_work()
|
||||
@@ -203,12 +198,12 @@
|
||||
name = "absolute circuit"
|
||||
desc = "This outputs a non-negative version of the number you put in. This may also be thought of as its distance from zero."
|
||||
icon_state = "absolute"
|
||||
inputs = list("A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/absolute/do_work()
|
||||
var/result = 0
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.pull_data()
|
||||
if(isnum(I.data))
|
||||
result = abs(I.data)
|
||||
@@ -229,7 +224,7 @@
|
||||
/obj/item/integrated_circuit/arithmetic/average/do_work()
|
||||
var/result = 0
|
||||
var/inputs_used = 0
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.pull_data()
|
||||
if(isnum(I.data))
|
||||
inputs_used++
|
||||
@@ -262,7 +257,7 @@
|
||||
extended_desc = "'Inclusive' means that the upper bound is included in the range of numbers, e.g. L = 1 and H = 3 will allow \
|
||||
for outputs of 1, 2, or 3. H being the higher number is not <i>strictly</i> required."
|
||||
icon_state = "random"
|
||||
inputs = list("\<NUM\> L","\<NUM\> H")
|
||||
inputs = list("L" = IC_PINTYPE_NUMBER,"H" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/random/do_work()
|
||||
@@ -283,12 +278,12 @@
|
||||
name = "square root circuit"
|
||||
desc = "This outputs the square root of a number you put in."
|
||||
icon_state = "square_root"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/square_root/do_work()
|
||||
var/result = 0
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.pull_data()
|
||||
if(isnum(I.data))
|
||||
result = sqrt(I.data)
|
||||
@@ -303,7 +298,7 @@
|
||||
name = "modulo circuit"
|
||||
desc = "Gets the remainder of A / B."
|
||||
icon_state = "modulo"
|
||||
inputs = list("\<NUM\> A", "\<NUM\> B")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER, "B" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/arithmetic/modulo/do_work()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
name = "assembly input"
|
||||
desc = "A built in chip for handling pulses from attached assembly items."
|
||||
complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
|
||||
activators = list("on pulsed" = 0)
|
||||
activators = list("on pulsed" = IC_PINTYPE_PULSE_OUT)
|
||||
|
||||
/obj/item/integrated_circuit/built_in/device_input/do_work()
|
||||
activate_pin(1)
|
||||
@@ -20,7 +20,7 @@
|
||||
name = "assembly out"
|
||||
desc = "A built in chip for pulsing attached assembly items."
|
||||
complexity = 0 //This acts as a limitation on building machines, more resource-intensive components cost more 'space'.
|
||||
activators = list("pulse attached" = 1)
|
||||
activators = list("pulse attached" = IC_PINTYPE_PULSE_IN)
|
||||
|
||||
/obj/item/integrated_circuit/built_in/device_output/do_work()
|
||||
if(istype(assembly, /obj/item/device/electronic_assembly/device))
|
||||
|
||||
@@ -3,29 +3,24 @@
|
||||
complexity = 2
|
||||
inputs = list("input")
|
||||
outputs = list("output")
|
||||
activators = list("convert" = 1, "on convert" = 0)
|
||||
activators = list("convert" = IC_PINTYPE_PULSE_IN, "on convert" = IC_PINTYPE_PULSE_OUT)
|
||||
category_text = "Converter"
|
||||
autopulse = 1
|
||||
power_draw_per_use = 10
|
||||
|
||||
/obj/item/integrated_circuit/converter/on_data_written()
|
||||
if(autopulse == 1)
|
||||
check_then_do_work()
|
||||
|
||||
/obj/item/integrated_circuit/converter/num2text
|
||||
name = "number to string"
|
||||
desc = "This circuit can convert a number variable into a string."
|
||||
extended_desc = "Because of game limitations null/false variables will output a '0' string."
|
||||
icon_state = "num-string"
|
||||
inputs = list("\<NUM\> input")
|
||||
outputs = list("\<TEXT\> output")
|
||||
inputs = list("input" = IC_PINTYPE_NUMBER)
|
||||
outputs = list("output" = IC_PINTYPE_STRING)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/num2text/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && isnum(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = num2text(incoming)
|
||||
else if(!incoming)
|
||||
result = "0"
|
||||
@@ -38,15 +33,15 @@
|
||||
name = "string to number"
|
||||
desc = "This circuit can convert a string variable into a number."
|
||||
icon_state = "string-num"
|
||||
inputs = list("\<TEXT\> input")
|
||||
outputs = list("\<NUM\> output")
|
||||
inputs = list("input" = IC_PINTYPE_STRING)
|
||||
outputs = list("output" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/text2num/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && istext(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = text2num(incoming)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -57,8 +52,8 @@
|
||||
name = "reference to string"
|
||||
desc = "This circuit can convert a reference to something else to a string, specifically the name of that reference."
|
||||
icon_state = "ref-string"
|
||||
inputs = list("\<REF\> input")
|
||||
outputs = list("\<TEXT\> output")
|
||||
inputs = list("input" = IC_PINTYPE_REF)
|
||||
outputs = list("output" = IC_PINTYPE_STRING)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/ref2text/do_work()
|
||||
@@ -76,15 +71,15 @@
|
||||
name = "lowercase string converter"
|
||||
desc = "this will cause a string to come out in all lowercase."
|
||||
icon_state = "lowercase"
|
||||
inputs = list("\<TEXT\> input")
|
||||
outputs = list("\<TEXT\> output")
|
||||
inputs = list("input" = IC_PINTYPE_STRING)
|
||||
outputs = list("output" = IC_PINTYPE_STRING)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/lowercase/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && istext(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = lowertext(incoming)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -95,15 +90,15 @@
|
||||
name = "uppercase string converter"
|
||||
desc = "THIS WILL CAUSE A STRING TO COME OUT IN ALL UPPERCASE."
|
||||
icon_state = "uppercase"
|
||||
inputs = list("\<TEXT\> input")
|
||||
outputs = list("\<TEXT\> output")
|
||||
inputs = list("input" = IC_PINTYPE_STRING)
|
||||
outputs = list("output" = IC_PINTYPE_STRING)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/uppercase/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && istext(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = uppertext(incoming)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -112,34 +107,31 @@
|
||||
|
||||
/obj/item/integrated_circuit/converter/concatenator
|
||||
name = "concatenator"
|
||||
desc = "This joins many strings or numbers together to get one big string."
|
||||
desc = "This joins many strings together to get one big string."
|
||||
complexity = 4
|
||||
inputs = list(
|
||||
"\<TEXT/NUM\> A",
|
||||
"\<TEXT/NUM\> B",
|
||||
"\<TEXT/NUM\> C",
|
||||
"\<TEXT/NUM\> D",
|
||||
"\<TEXT/NUM\> E",
|
||||
"\<TEXT/NUM\> F",
|
||||
"\<TEXT/NUM\> G",
|
||||
"\<TEXT/NUM\> H"
|
||||
"A" = IC_PINTYPE_STRING,
|
||||
"B" = IC_PINTYPE_STRING,
|
||||
"C" = IC_PINTYPE_STRING,
|
||||
"D" = IC_PINTYPE_STRING,
|
||||
"E" = IC_PINTYPE_STRING,
|
||||
"F" = IC_PINTYPE_STRING,
|
||||
"G" = IC_PINTYPE_STRING,
|
||||
"H" = IC_PINTYPE_STRING
|
||||
)
|
||||
outputs = list("\<TEXT\> result")
|
||||
activators = list("concatenate" = 1, "on concatenated" = 0)
|
||||
outputs = list("result" = IC_PINTYPE_STRING)
|
||||
activators = list("concatenate" = IC_PINTYPE_PULSE_IN, "on concatenated" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/concatenator/do_work()
|
||||
var/result = null
|
||||
for(var/datum/integrated_io/input/I in inputs)
|
||||
for(var/datum/integrated_io/I in inputs)
|
||||
I.pull_data()
|
||||
if(istext(I.data))
|
||||
if(!isnull(I.data))
|
||||
result = result + I.data
|
||||
else if(!isnull(I.data) && num2text(I.data))
|
||||
result = result + num2text(I.data)
|
||||
|
||||
var/datum/integrated_io/outgoing = outputs[1]
|
||||
outgoing.data = result
|
||||
outgoing.push_data()
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/converter/separator
|
||||
@@ -150,14 +142,14 @@
|
||||
will split into 'a p' and 'erson'."
|
||||
complexity = 4
|
||||
inputs = list(
|
||||
"\<TEXT\> string",
|
||||
"\<NUM\> index",
|
||||
"string to split" = IC_PINTYPE_STRING,
|
||||
"index" = IC_PINTYPE_NUMBER,
|
||||
)
|
||||
outputs = list(
|
||||
"\<TEXT\> before split",
|
||||
"\<TEXT\> after split"
|
||||
"before split" = IC_PINTYPE_STRING,
|
||||
"after split" = IC_PINTYPE_STRING
|
||||
)
|
||||
activators = list("separate" = 1, "on separated" = 0)
|
||||
activators = list("separate" = IC_PINTYPE_PULSE_IN, "on separated" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
|
||||
@@ -170,12 +162,9 @@
|
||||
var/before_text = copytext(text, 1, split)
|
||||
var/after_text = copytext(text, split, 0)
|
||||
|
||||
var/datum/integrated_io/outgoing1 = outputs[1]
|
||||
var/datum/integrated_io/outgoing2 = outputs[2]
|
||||
outgoing1.data = before_text
|
||||
outgoing2.data = after_text
|
||||
outgoing1.push_data()
|
||||
outgoing2.push_data()
|
||||
set_pin_data(IC_OUTPUT, 1, before_text)
|
||||
set_pin_data(IC_OUTPUT, 2, after_text)
|
||||
push_data()
|
||||
|
||||
activate_pin(2)
|
||||
|
||||
@@ -183,15 +172,15 @@
|
||||
/obj/item/integrated_circuit/converter/radians2degrees
|
||||
name = "radians to degrees converter"
|
||||
desc = "Converts radians to degrees."
|
||||
inputs = list("\<NUM\> radian")
|
||||
outputs = list("\<NUM\> degrees")
|
||||
inputs = list("radian" = IC_PINTYPE_NUMBER)
|
||||
outputs = list("degrees" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/radians2degrees/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && isnum(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = ToDegrees(incoming)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -201,15 +190,15 @@
|
||||
/obj/item/integrated_circuit/converter/degrees2radians
|
||||
name = "degrees to radians converter"
|
||||
desc = "Converts degrees to radians."
|
||||
inputs = list("\<NUM\> degrees")
|
||||
outputs = list("\<NUM\> radians")
|
||||
inputs = list("degrees" = IC_PINTYPE_NUMBER)
|
||||
outputs = list("radians" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/degrees2radians/do_work()
|
||||
var/result = null
|
||||
pull_data()
|
||||
var/incoming = get_pin_data(IC_INPUT, 1)
|
||||
if(incoming && isnum(incoming))
|
||||
if(!isnull(incoming))
|
||||
result = ToRadians(incoming)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -221,9 +210,17 @@
|
||||
name = "abs to rel coordinate converter"
|
||||
desc = "Easily convert absolute coordinates to relative coordinates with this."
|
||||
complexity = 4
|
||||
inputs = list("\<NUM\> X1", "\<NUM\> Y1", "\<NUM\> X2", "\<NUM\> Y2")
|
||||
outputs = list("\<NUM\> X", "\<NUM\> Y")
|
||||
activators = list("compute rel coordinates" = 1, "on convert" = 0)
|
||||
inputs = list(
|
||||
"X1" = IC_PINTYPE_NUMBER,
|
||||
"Y1" = IC_PINTYPE_NUMBER,
|
||||
"X2" = IC_PINTYPE_NUMBER,
|
||||
"Y2" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
outputs = list(
|
||||
"X" = IC_PINTYPE_NUMBER,
|
||||
"Y" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
activators = list("compute rel coordinates" = IC_PINTYPE_PULSE_IN, "on convert" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/converter/abs_to_rel_coords/do_work()
|
||||
@@ -233,7 +230,7 @@
|
||||
var/x2 = get_pin_data(IC_INPUT, 3)
|
||||
var/y2 = get_pin_data(IC_INPUT, 4)
|
||||
|
||||
if(x1 && y1 && x2 && y2)
|
||||
if(!isnull(x1) && !isnull(y1) && !isnull(x2) && !isnull(y2))
|
||||
set_pin_data(IC_OUTPUT, 1, x1 - x2)
|
||||
set_pin_data(IC_OUTPUT, 2, y1 - y2)
|
||||
|
||||
|
||||
@@ -1,114 +1,25 @@
|
||||
/obj/item/integrated_circuit/transfer
|
||||
category_text = "Data Transfer"
|
||||
autopulse = 1
|
||||
power_draw_per_use = 2
|
||||
|
||||
/obj/item/integrated_circuit/transfer/on_data_written()
|
||||
if(autopulse == 1)
|
||||
check_then_do_work()
|
||||
|
||||
/obj/item/integrated_circuit/transfer/splitter
|
||||
name = "splitter"
|
||||
desc = "Splits incoming data into all of the output pins."
|
||||
icon_state = "splitter"
|
||||
complexity = 3
|
||||
inputs = list("data to split")
|
||||
outputs = list("A","B")
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/transfer/splitter/medium
|
||||
name = "four splitter"
|
||||
icon_state = "splitter4"
|
||||
complexity = 5
|
||||
outputs = list("A","B","C","D")
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/transfer/splitter/large
|
||||
name = "eight splitter"
|
||||
icon_state = "splitter8"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 9
|
||||
outputs = list("A","B","C","D","E","F","G","H")
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 8
|
||||
|
||||
/obj/item/integrated_circuit/transfer/splitter/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
for(var/datum/integrated_io/output/O in outputs)
|
||||
O.data = I.data
|
||||
|
||||
/obj/item/integrated_circuit/transfer/activator_splitter
|
||||
name = "activator splitter"
|
||||
desc = "Splits incoming activation pulses into all of the output pins."
|
||||
icon_state = "splitter"
|
||||
complexity = 3
|
||||
activators = list(
|
||||
"pulse" = 1,
|
||||
"pulse A" = 0,
|
||||
"pulse B" = 0
|
||||
)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 2
|
||||
|
||||
/obj/item/integrated_circuit/transfer/activator_splitter/do_work()
|
||||
for(var/datum/integrated_io/activate/A in outputs)
|
||||
if(A == activators[1])
|
||||
continue
|
||||
if(A.linked.len)
|
||||
for(var/datum/integrated_io/activate/target in A.linked)
|
||||
target.holder.check_then_do_work()
|
||||
|
||||
/obj/item/integrated_circuit/transfer/activator_splitter/medium
|
||||
name = "four activator splitter"
|
||||
icon_state = "splitter4"
|
||||
complexity = 5
|
||||
activators = list(
|
||||
"pulse" = 1,
|
||||
"pulse A" = 0,
|
||||
"pulse B" = 0,
|
||||
"pulse C" = 0,
|
||||
"pulse D" = 0
|
||||
)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/transfer/activator_splitter/large
|
||||
name = "eight activator splitter"
|
||||
icon_state = "splitter4"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 9
|
||||
activators = list(
|
||||
"incoming pulse" = 1,
|
||||
"outgoing pulse A" = 0,
|
||||
"outgoing pulse B" = 0,
|
||||
"outgoing pulse C" = 0,
|
||||
"outgoing pulse D" = 0,
|
||||
"outgoing pulse E" = 0,
|
||||
"outgoing pulse F" = 0,
|
||||
"outgoing pulse G" = 0,
|
||||
"outgoing pulse H" = 0
|
||||
)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 8
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/transfer/multiplexer
|
||||
name = "two multiplexer"
|
||||
desc = "This is what those in the business tend to refer to as a 'mux' or data selector. It moves data from one of the selected inputs to the output."
|
||||
extended_desc = "The first input pin is used to select which of the other input pins which has its data moved to the output. If the input selection is outside the valid range then no output is given."
|
||||
extended_desc = "The first input pin is used to select which of the other input pins which has its data moved to the output. \
|
||||
If the input selection is outside the valid range then no output is given."
|
||||
complexity = 2
|
||||
icon_state = "mux2"
|
||||
inputs = list("input selection")
|
||||
outputs = list("output")
|
||||
activators = list("select" = 1, "on select" = 0)
|
||||
inputs = list("input selection" = IC_PINTYPE_NUMBER)
|
||||
outputs = list("output" = IC_PINTYPE_ANY)
|
||||
activators = list("select" = IC_PINTYPE_PULSE_IN, "on select" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
var/number_of_inputs = 2
|
||||
|
||||
/obj/item/integrated_circuit/transfer/multiplexer/New()
|
||||
for(var/i = 1 to number_of_inputs)
|
||||
inputs += "input [i]"
|
||||
inputs["input [i]"] = IC_PINTYPE_ANY // This is just a string since pins don't get built until ..() is called.
|
||||
// inputs += "input [i]"
|
||||
complexity = number_of_inputs
|
||||
..()
|
||||
desc += " It has [number_of_inputs] input pins."
|
||||
@@ -118,7 +29,7 @@
|
||||
var/input_index = get_pin_data(IC_INPUT, 1)
|
||||
var/output = null
|
||||
|
||||
if(isnum(input_index) && (input_index >= 1 && input_index < inputs.len))
|
||||
if(!isnull(input_index) && (input_index >= 1 && input_index < inputs.len))
|
||||
output = get_pin_data(IC_INPUT, input_index + 1)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, output)
|
||||
@@ -145,19 +56,21 @@
|
||||
/obj/item/integrated_circuit/transfer/demultiplexer
|
||||
name = "two demultiplexer"
|
||||
desc = "This is what those in the business tend to refer to as a 'demux'. It moves data from the input to one of the selected outputs."
|
||||
extended_desc = "The first input pin is used to select which of the output pins is given the data from the second input pin. If the output selection is outside the valid range then no output is given."
|
||||
extended_desc = "The first input pin is used to select which of the output pins is given the data from the second input pin. \
|
||||
If the output selection is outside the valid range then no output is given."
|
||||
complexity = 2
|
||||
icon_state = "dmux2"
|
||||
inputs = list("output selection","input")
|
||||
inputs = list("output selection" = IC_PINTYPE_NUMBER, "input" = IC_PINTYPE_ANY)
|
||||
outputs = list()
|
||||
activators = list("select" = 1)
|
||||
activators = list("select" = IC_PINTYPE_PULSE_IN, "on select" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
var/number_of_outputs = 2
|
||||
|
||||
/obj/item/integrated_circuit/transfer/demultiplexer/New()
|
||||
for(var/i = 1 to number_of_outputs)
|
||||
outputs += "output [i]"
|
||||
// outputs += "output [i]"
|
||||
outputs["output [i]"] = IC_PINTYPE_ANY
|
||||
complexity = number_of_outputs
|
||||
|
||||
..()
|
||||
@@ -171,6 +84,8 @@
|
||||
for(var/i = 1 to outputs.len)
|
||||
set_pin_data(IC_OUTPUT, i, i == output_index ? output : null)
|
||||
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/transfer/demultiplexer/medium
|
||||
name = "four demultiplexer"
|
||||
icon_state = "dmux4"
|
||||
|
||||
@@ -0,0 +1,433 @@
|
||||
/obj/item/integrated_circuit/input
|
||||
var/can_be_asked_input = 0
|
||||
category_text = "Input"
|
||||
power_draw_per_use = 5
|
||||
|
||||
/obj/item/integrated_circuit/input/proc/ask_for_input(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/input/button
|
||||
name = "button"
|
||||
desc = "This tiny button must do something, right?"
|
||||
icon_state = "button"
|
||||
complexity = 1
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("on pressed" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/input/button/ask_for_input(mob/user) //Bit misleading name for this specific use.
|
||||
to_chat(user, "<span class='notice'>You press the button labeled '[src.name]'.</span>")
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/toggle_button
|
||||
name = "toggle button"
|
||||
desc = "It toggles on, off, on, off..."
|
||||
icon_state = "toggle_button"
|
||||
complexity = 1
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("on" = IC_PINTYPE_BOOLEAN)
|
||||
activators = list("on toggle" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/input/toggle_button/ask_for_input(mob/user) // Ditto.
|
||||
set_pin_data(IC_OUTPUT, 1, !get_pin_data(IC_OUTPUT, 1))
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
to_chat(user, "<span class='notice'>You toggle the button labeled '[src.name]' [get_pin_data(IC_OUTPUT, 1) ? "on" : "off"].</span>")
|
||||
|
||||
/obj/item/integrated_circuit/input/numberpad
|
||||
name = "number pad"
|
||||
desc = "This small number pad allows someone to input a number into the system."
|
||||
icon_state = "numberpad"
|
||||
complexity = 2
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("number entered" = IC_PINTYPE_NUMBER)
|
||||
activators = list("on entered" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
|
||||
var/new_input = input(user, "Enter a number, please.","Number pad") as null|num
|
||||
if(isnum(new_input) && CanInteract(user, physical_state))
|
||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/textpad
|
||||
name = "text pad"
|
||||
desc = "This small text pad allows someone to input a string into the system."
|
||||
icon_state = "textpad"
|
||||
complexity = 2
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("string entered" = IC_PINTYPE_STRING)
|
||||
activators = list("on entered" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
|
||||
var/new_input = input(user, "Enter some words, please.","Number pad") as null|text
|
||||
if(istext(new_input) && CanInteract(user, physical_state))
|
||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/med_scanner
|
||||
name = "integrated medical analyser"
|
||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is."
|
||||
icon_state = "medscan"
|
||||
complexity = 4
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list(
|
||||
"total health %" = IC_PINTYPE_NUMBER,
|
||||
"total missing health" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
|
||||
power_draw_per_use = 40
|
||||
|
||||
/obj/item/integrated_circuit/input/med_scanner/do_work()
|
||||
var/mob/living/carbon/human/H = get_pin_data_as_type(IC_INPUT, 1, /mob/living/carbon/human)
|
||||
if(!istype(H)) //Invalid input
|
||||
return
|
||||
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
|
||||
var/total_health = round(H.health/H.getMaxHealth(), 0.01)*100
|
||||
var/missing_health = H.getMaxHealth() - H.health
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, total_health)
|
||||
set_pin_data(IC_OUTPUT, 2, missing_health)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/adv_med_scanner
|
||||
name = "integrated advanced medical analyser"
|
||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is. \
|
||||
This type is much more precise, allowing the machine to know much more about the target than a normal analyzer."
|
||||
icon_state = "medscan_adv"
|
||||
complexity = 12
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list(
|
||||
"total health %" = IC_PINTYPE_NUMBER,
|
||||
"total missing health" = IC_PINTYPE_NUMBER,
|
||||
"brute damage" = IC_PINTYPE_NUMBER,
|
||||
"burn damage" = IC_PINTYPE_NUMBER,
|
||||
"tox damage" = IC_PINTYPE_NUMBER,
|
||||
"oxy damage" = IC_PINTYPE_NUMBER,
|
||||
"clone damage" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
activators = list("scan" = IC_PINTYPE_PULSE_IN, "on scanned" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4)
|
||||
power_draw_per_use = 80
|
||||
|
||||
/obj/item/integrated_circuit/input/adv_med_scanner/do_work()
|
||||
var/mob/living/carbon/human/H = get_pin_data_as_type(IC_INPUT, 1, /mob/living/carbon/human)
|
||||
if(!istype(H)) //Invalid input
|
||||
return
|
||||
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
|
||||
var/total_health = round(H.health/H.getMaxHealth(), 0.01)*100
|
||||
var/missing_health = H.getMaxHealth() - H.health
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, total_health)
|
||||
set_pin_data(IC_OUTPUT, 2, missing_health)
|
||||
set_pin_data(IC_OUTPUT, 3, H.getBruteLoss())
|
||||
set_pin_data(IC_OUTPUT, 4, H.getFireLoss())
|
||||
set_pin_data(IC_OUTPUT, 5, H.getToxLoss())
|
||||
set_pin_data(IC_OUTPUT, 6, H.getOxyLoss())
|
||||
set_pin_data(IC_OUTPUT, 7, H.getCloneLoss())
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/local_locator
|
||||
name = "local locator"
|
||||
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
||||
that is holding the machine containing it."
|
||||
inputs = list()
|
||||
outputs = list("located ref")
|
||||
activators = list("locate" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 20
|
||||
|
||||
/obj/item/integrated_circuit/input/local_locator/do_work()
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
O.data = null
|
||||
if(assembly)
|
||||
if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us.
|
||||
O.data = weakref(assembly.loc)
|
||||
|
||||
O.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/input/adjacent_locator
|
||||
name = "adjacent locator"
|
||||
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
||||
that is standing a meter away from the machine."
|
||||
extended_desc = "The first pin requires a ref to a kind of object that you want the locator to acquire. This means that it will \
|
||||
give refs to nearby objects that are similar. If more than one valid object is found nearby, it will choose one of them at \
|
||||
random."
|
||||
inputs = list("desired type ref")
|
||||
outputs = list("located ref")
|
||||
activators = list("locate" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 30
|
||||
|
||||
/obj/item/integrated_circuit/input/adjacent_locator/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
O.data = null
|
||||
|
||||
if(!isweakref(I.data))
|
||||
return
|
||||
var/atom/A = I.data.resolve()
|
||||
if(!A)
|
||||
return
|
||||
var/desired_type = A.type
|
||||
|
||||
var/list/nearby_things = range(1, get_turf(src))
|
||||
var/list/valid_things = list()
|
||||
for(var/atom/thing in nearby_things)
|
||||
if(thing.type != desired_type)
|
||||
continue
|
||||
valid_things.Add(thing)
|
||||
if(valid_things.len)
|
||||
O.data = weakref(pick(valid_things))
|
||||
O.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler
|
||||
name = "integrated signaler"
|
||||
desc = "Signals from a signaler can be received with this, allowing for remote control. Additionally, it can send signals as well."
|
||||
extended_desc = "When a signal is received from another signaler, the 'on signal received' activator pin will be pulsed. \
|
||||
The two input pins are to configure the integrated signaler's settings. Note that the frequency should not have a decimal in it. \
|
||||
Meaning the default frequency is expressed as 1457, not 145.7. To send a signal, pulse the 'send signal' activator pin."
|
||||
icon_state = "signal"
|
||||
complexity = 4
|
||||
inputs = list("frequency" = IC_PINTYPE_NUMBER,"code" = IC_PINTYPE_NUMBER)
|
||||
outputs = list()
|
||||
activators = list(
|
||||
"send signal" = IC_PINTYPE_PULSE_IN,
|
||||
"on signal sent" = IC_PINTYPE_PULSE_OUT,
|
||||
"on signal received" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2)
|
||||
power_draw_idle = 5
|
||||
power_draw_per_use = 40
|
||||
|
||||
var/frequency = 1457
|
||||
var/code = 30
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
// Set the pins so when someone sees them, they won't show as null
|
||||
set_pin_data(IC_INPUT, 1, frequency)
|
||||
set_pin_data(IC_INPUT, 2, code)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
frequency = 0
|
||||
. = ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/on_data_written()
|
||||
var/new_freq = get_pin_data(IC_INPUT, 1)
|
||||
var/new_code = get_pin_data(IC_INPUT, 2)
|
||||
if(isnum(new_freq) && new_freq > 0)
|
||||
set_frequency(new_freq)
|
||||
if(isnum(new_code))
|
||||
code = new_code
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/do_work() // Sends a signal.
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = "ACTIVATE"
|
||||
radio_connection.post_signal(src, signal)
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency)
|
||||
if(!frequency)
|
||||
return
|
||||
if(!radio_controller)
|
||||
sleep(20)
|
||||
if(!radio_controller)
|
||||
return
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/receive_signal(datum/signal/signal)
|
||||
var/new_code = get_pin_data(IC_INPUT, 2)
|
||||
var/code = 0
|
||||
|
||||
if(isnum(new_code))
|
||||
code = new_code
|
||||
if(!signal)
|
||||
return 0
|
||||
if(signal.encryption != code)
|
||||
return 0
|
||||
if(signal.source == src) // Don't trigger ourselves.
|
||||
return 0
|
||||
|
||||
activate_pin(3)
|
||||
|
||||
for(var/mob/O in hearers(1, get_turf(src)))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2
|
||||
name = "\improper EPv2 circuit"
|
||||
desc = "Enables the sending and receiving of messages on the Exonet with the EPv2 protocol."
|
||||
extended_desc = "An EPv2 address is a string with the format of XXXX:XXXX:XXXX:XXXX. Data can be send or received using the \
|
||||
second pin on each side, with additonal data reserved for the third pin. When a message is received, the second activaiton pin \
|
||||
will pulse whatever's connected to it. Pulsing the first activation pin will send a message."
|
||||
icon_state = "signal"
|
||||
complexity = 4
|
||||
inputs = list(
|
||||
"target EPv2 address" = IC_PINTYPE_STRING,
|
||||
"data to send" = IC_PINTYPE_STRING,
|
||||
"secondary text" = IC_PINTYPE_STRING
|
||||
)
|
||||
outputs = list(
|
||||
"address received" = IC_PINTYPE_STRING,
|
||||
"data received" = IC_PINTYPE_STRING,
|
||||
"secondary text received" = IC_PINTYPE_STRING
|
||||
)
|
||||
activators = list("send data" = IC_PINTYPE_PULSE_IN, "on data received" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2)
|
||||
power_draw_per_use = 50
|
||||
var/datum/exonet_protocol/exonet = null
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/New()
|
||||
..()
|
||||
exonet = new(src)
|
||||
exonet.make_address("EPv2_circuit-\ref[src]")
|
||||
desc += "<br>This circuit's EPv2 address is: [exonet.address]"
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/Destroy()
|
||||
if(exonet)
|
||||
exonet.remove_address()
|
||||
qdel(exonet)
|
||||
exonet = null
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/do_work()
|
||||
var/target_address = get_pin_data(IC_INPUT, 1)
|
||||
var/message = get_pin_data(IC_INPUT, 2)
|
||||
var/text = get_pin_data(IC_INPUT, 3)
|
||||
|
||||
if(target_address && istext(target_address))
|
||||
exonet.send_message(target_address, message, text)
|
||||
|
||||
/obj/item/integrated_circuit/input/receive_exonet_message(var/atom/origin_atom, var/origin_address, var/message, var/text)
|
||||
set_pin_data(IC_OUTPUT, 1, origin_address)
|
||||
set_pin_data(IC_OUTPUT, 2, message)
|
||||
set_pin_data(IC_OUTPUT, 3, text)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
//This circuit gives information on where the machine is.
|
||||
/obj/item/integrated_circuit/input/gps
|
||||
name = "global positioning system"
|
||||
desc = "This allows you to easily know the position of a machine containing this device."
|
||||
extended_desc = "The GPS's coordinates it gives is absolute, not relative."
|
||||
icon_state = "gps"
|
||||
complexity = 4
|
||||
inputs = list()
|
||||
outputs = list("X"= IC_PINTYPE_NUMBER, "Y" = IC_PINTYPE_NUMBER)
|
||||
activators = list("get coordinates" = IC_PINTYPE_PULSE_IN, "on get coordinates" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 30
|
||||
|
||||
/obj/item/integrated_circuit/input/gps/do_work()
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, null)
|
||||
set_pin_data(IC_OUTPUT, 2, null)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, T.x)
|
||||
set_pin_data(IC_OUTPUT, 2, T.y)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone
|
||||
name = "microphone"
|
||||
desc = "Useful for spying on people or for voice activated machines."
|
||||
extended_desc = "This will automatically translate most languages it hears to Galactic Common. \
|
||||
The first activation pin is always pulsed when the circuit hears someone talk, while the second one \
|
||||
is only triggered if it hears someone speaking a language other than Galactic Common."
|
||||
icon_state = "recorder"
|
||||
complexity = 8
|
||||
inputs = list()
|
||||
outputs = list(
|
||||
"speaker" = IC_PINTYPE_STRING,
|
||||
"message" = IC_PINTYPE_STRING
|
||||
)
|
||||
activators = list("on message received" = IC_PINTYPE_PULSE_IN, "on translation" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 15
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/New()
|
||||
..()
|
||||
listening_objects |= src
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/Destroy()
|
||||
listening_objects -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/hear_talk(mob/living/M, msg, var/verb="says", datum/language/speaking=null)
|
||||
var/translated = FALSE
|
||||
if(M && msg)
|
||||
if(speaking)
|
||||
if(!speaking.machine_understands)
|
||||
msg = speaking.scramble(msg)
|
||||
if(!istype(speaking, /datum/language/common))
|
||||
translated = TRUE
|
||||
set_pin_data(IC_OUTPUT, 1, M.GetVoice())
|
||||
set_pin_data(IC_OUTPUT, 2, msg)
|
||||
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
if(translated)
|
||||
activate_pin(2)
|
||||
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/sensor
|
||||
name = "sensor"
|
||||
desc = "Scans and obtains a reference for any objects or persons near you. All you need to do is shove the machine in their face."
|
||||
extended_desc = "If 'ignore storage' pin is set to true, the sensor will disregard scanning various storage containers such as backpacks."
|
||||
icon_state = "recorder"
|
||||
complexity = 12
|
||||
inputs = list("ignore storage" = IC_PINTYPE_BOOLEAN)
|
||||
outputs = list("scanned" = IC_PINTYPE_REF)
|
||||
activators = list("on scanned" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 120
|
||||
|
||||
/obj/item/integrated_circuit/input/sensor/proc/scan(var/atom/A)
|
||||
var/ignore_bags = get_pin_data(IC_INPUT, 1)
|
||||
if(ignore_bags)
|
||||
if(istype(A, /obj/item/weapon/storage))
|
||||
return FALSE
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, weakref(A))
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
return TRUE
|
||||
|
||||
@@ -1,762 +0,0 @@
|
||||
/obj/item/integrated_circuit/input
|
||||
var/can_be_asked_input = 0
|
||||
category_text = "Input"
|
||||
power_draw_per_use = 5
|
||||
|
||||
/obj/item/integrated_circuit/input/proc/ask_for_input(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/integrated_circuit/input/button
|
||||
name = "button"
|
||||
desc = "This tiny button must do something, right?"
|
||||
icon_state = "button"
|
||||
complexity = 1
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("on pressed" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/input/button/ask_for_input(mob/user) //Bit misleading name for this specific use.
|
||||
to_chat(user, "<span class='notice'>You press the button labeled '[src.name]'.</span>")
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/toggle_button
|
||||
name = "toggle button"
|
||||
desc = "It toggles on, off, on, off..."
|
||||
icon_state = "toggle_button"
|
||||
complexity = 1
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("\<NUM\> on" = 0)
|
||||
activators = list("on toggle" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/input/toggle_button/ask_for_input(mob/user) // Ditto.
|
||||
set_pin_data(IC_OUTPUT, 1, !get_pin_data(IC_OUTPUT, 1))
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
to_chat(user, "<span class='notice'>You toggle the button labeled '[src.name]' [get_pin_data(IC_OUTPUT, 1) ? "on" : "off"].</span>")
|
||||
|
||||
/obj/item/integrated_circuit/input/numberpad
|
||||
name = "number pad"
|
||||
desc = "This small number pad allows someone to input a number into the system."
|
||||
icon_state = "numberpad"
|
||||
complexity = 2
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("\<NUM\> number entered")
|
||||
activators = list("on entered" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/input/numberpad/ask_for_input(mob/user)
|
||||
var/new_input = input(user, "Enter a number, please.","Number pad") as null|num
|
||||
if(isnum(new_input) && CanInteract(user, physical_state))
|
||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/textpad
|
||||
name = "text pad"
|
||||
desc = "This small text pad allows someone to input a string into the system."
|
||||
icon_state = "textpad"
|
||||
complexity = 2
|
||||
can_be_asked_input = 1
|
||||
inputs = list()
|
||||
outputs = list("\<TEXT\> string entered")
|
||||
activators = list("on entered" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
/obj/item/integrated_circuit/input/textpad/ask_for_input(mob/user)
|
||||
var/new_input = input(user, "Enter some words, please.","Number pad") as null|text
|
||||
if(istext(new_input) && CanInteract(user, physical_state))
|
||||
set_pin_data(IC_OUTPUT, 1, new_input)
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
|
||||
/obj/item/integrated_circuit/input/med_scanner
|
||||
name = "integrated medical analyser"
|
||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is."
|
||||
icon_state = "medscan"
|
||||
complexity = 4
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list("\<NUM\> total health %", "\<NUM\> total missing health")
|
||||
activators = list("scan" = 1, "on scanned" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
|
||||
power_draw_per_use = 40
|
||||
|
||||
/obj/item/integrated_circuit/input/med_scanner/do_work()
|
||||
var/mob/living/carbon/human/H = get_pin_data_as_type(IC_INPUT, 1, /mob/living/carbon/human)
|
||||
if(!istype(H)) //Invalid input
|
||||
return
|
||||
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
|
||||
var/total_health = round(H.health/H.getMaxHealth(), 0.1)*100
|
||||
var/missing_health = H.getMaxHealth() - H.health
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, total_health)
|
||||
set_pin_data(IC_OUTPUT, 2, missing_health)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/adv_med_scanner
|
||||
name = "integrated advanced medical analyser"
|
||||
desc = "A very small version of the common medical analyser. This allows the machine to know how healthy someone is. \
|
||||
This type is much more precise, allowing the machine to know much more about the target than a normal analyzer."
|
||||
icon_state = "medscan_adv"
|
||||
complexity = 12
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list(
|
||||
"\<NUM\> total health %",
|
||||
"\<NUM\> total missing health",
|
||||
"\<NUM\> brute damage",
|
||||
"\<NUM\> burn damage",
|
||||
"\<NUM\> tox damage",
|
||||
"\<NUM\> oxy damage",
|
||||
"\<NUM\> clone damage"
|
||||
)
|
||||
activators = list("scan" = 1, "on scanned" = 0)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 4)
|
||||
power_draw_per_use = 80
|
||||
|
||||
/obj/item/integrated_circuit/input/adv_med_scanner/do_work()
|
||||
var/mob/living/carbon/human/H = get_pin_data_as_type(IC_INPUT, 1, /mob/living/carbon/human)
|
||||
if(!istype(H)) //Invalid input
|
||||
return
|
||||
if(H.Adjacent(get_turf(src))) // Like normal analysers, it can't be used at range.
|
||||
var/total_health = round(H.health/H.getMaxHealth(), 0.1)*100
|
||||
var/missing_health = H.getMaxHealth() - H.health
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, total_health)
|
||||
set_pin_data(IC_OUTPUT, 2, missing_health)
|
||||
set_pin_data(IC_OUTPUT, 3, H.getBruteLoss())
|
||||
set_pin_data(IC_OUTPUT, 4, H.getFireLoss())
|
||||
set_pin_data(IC_OUTPUT, 5, H.getToxLoss())
|
||||
set_pin_data(IC_OUTPUT, 6, H.getOxyLoss())
|
||||
set_pin_data(IC_OUTPUT, 7, H.getCloneLoss())
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/local_locator
|
||||
name = "local locator"
|
||||
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
||||
that is holding the machine containing it."
|
||||
inputs = list()
|
||||
outputs = list("located ref")
|
||||
activators = list("locate" = 1)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 20
|
||||
|
||||
/obj/item/integrated_circuit/input/local_locator/do_work()
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
O.data = null
|
||||
if(assembly)
|
||||
if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us.
|
||||
O.data = weakref(assembly.loc)
|
||||
|
||||
O.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/input/adjacent_locator
|
||||
name = "adjacent locator"
|
||||
desc = "This is needed for certain devices that demand a reference for a target to act upon. This type only locates something \
|
||||
that is standing a meter away from the machine."
|
||||
extended_desc = "The first pin requires a ref to a kind of object that you want the locator to acquire. This means that it will \
|
||||
give refs to nearby objects that are similar. If more than one valid object is found nearby, it will choose one of them at \
|
||||
random."
|
||||
inputs = list("desired type ref")
|
||||
outputs = list("located ref")
|
||||
activators = list("locate" = 1)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 30
|
||||
|
||||
/obj/item/integrated_circuit/input/adjacent_locator/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
O.data = null
|
||||
|
||||
if(!isweakref(I.data))
|
||||
return
|
||||
var/atom/A = I.data.resolve()
|
||||
if(!A)
|
||||
return
|
||||
var/desired_type = A.type
|
||||
|
||||
var/list/nearby_things = range(1, get_turf(src))
|
||||
var/list/valid_things = list()
|
||||
for(var/atom/thing in nearby_things)
|
||||
if(thing.type != desired_type)
|
||||
continue
|
||||
valid_things.Add(thing)
|
||||
if(valid_things.len)
|
||||
O.data = weakref(pick(valid_things))
|
||||
O.push_data()
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler
|
||||
name = "integrated signaler"
|
||||
desc = "Signals from a signaler can be received with this, allowing for remote control. Additionally, it can send signals as well."
|
||||
extended_desc = "When a signal is received from another signaler, the 'on signal received' activator pin will be pulsed. \
|
||||
The two input pins are to configure the integrated signaler's settings. Note that the frequency should not have a decimal in it. \
|
||||
Meaning the default frequency is expressed as 1457, not 145.7. To send a signal, pulse the 'send signal' activator pin."
|
||||
icon_state = "signal"
|
||||
complexity = 4
|
||||
inputs = list("\<NUM\> frequency","\<NUM\> code")
|
||||
outputs = list()
|
||||
activators = list("send signal" = 1,"on signal sent" = 0, "on signal received" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2)
|
||||
power_draw_idle = 5
|
||||
power_draw_per_use = 40
|
||||
|
||||
var/frequency = 1457
|
||||
var/code = 30
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
// Set the pins so when someone sees them, they won't show as null
|
||||
set_pin_data(IC_INPUT, 1, frequency)
|
||||
set_pin_data(IC_INPUT, 2, code)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
frequency = 0
|
||||
. = ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/on_data_written()
|
||||
var/new_freq = get_pin_data(IC_INPUT, 1)
|
||||
var/new_code = get_pin_data(IC_INPUT, 2)
|
||||
if(isnum(new_freq) && new_freq > 0)
|
||||
set_frequency(new_freq)
|
||||
if(isnum(new_code))
|
||||
code = new_code
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/do_work() // Sends a signal.
|
||||
if(!radio_connection)
|
||||
return
|
||||
|
||||
var/datum/signal/signal = new()
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = "ACTIVATE"
|
||||
radio_connection.post_signal(src, signal)
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/proc/set_frequency(new_frequency)
|
||||
if(!frequency)
|
||||
return
|
||||
if(!radio_controller)
|
||||
sleep(20)
|
||||
if(!radio_controller)
|
||||
return
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
/obj/item/integrated_circuit/input/signaler/receive_signal(datum/signal/signal)
|
||||
var/new_code = get_pin_data(IC_INPUT, 2)
|
||||
var/code = 0
|
||||
|
||||
if(isnum(new_code))
|
||||
code = new_code
|
||||
if(!signal)
|
||||
return 0
|
||||
if(signal.encryption != code)
|
||||
return 0
|
||||
if(signal.source == src) // Don't trigger ourselves.
|
||||
return 0
|
||||
|
||||
activate_pin(3)
|
||||
|
||||
for(var/mob/O in hearers(1, get_turf(src)))
|
||||
O.show_message(text("\icon[] *beep* *beep*", src), 3, "*beep* *beep*", 2)
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2
|
||||
name = "\improper EPv2 circuit"
|
||||
desc = "Enables the sending and receiving of messages on the Exonet with the EPv2 protocol."
|
||||
extended_desc = "An EPv2 address is a string with the format of XXXX:XXXX:XXXX:XXXX. Data can be send or received using the \
|
||||
second pin on each side, with additonal data reserved for the third pin. When a message is received, the second activaiton pin \
|
||||
will pulse whatever's connected to it. Pulsing the first activation pin will send a message."
|
||||
icon_state = "signal"
|
||||
complexity = 4
|
||||
inputs = list("\<TEXT\> target EPv2 address", "\<TEXT\> data to send", "\<TEXT\> secondary text")
|
||||
outputs = list("\<TEXT\> address received", "\<TEXT\> data received", "\<TEXT\> secondary text received")
|
||||
activators = list("send data" = 1, "on data received" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_MAGNET = 2, TECH_BLUESPACE = 2)
|
||||
power_draw_per_use = 50
|
||||
var/datum/exonet_protocol/exonet = null
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/New()
|
||||
..()
|
||||
exonet = new(src)
|
||||
exonet.make_address("EPv2_circuit-\ref[src]")
|
||||
desc += "<br>This circuit's EPv2 address is: [exonet.address]"
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/Destroy()
|
||||
if(exonet)
|
||||
exonet.remove_address()
|
||||
qdel(exonet)
|
||||
exonet = null
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/EPv2/do_work()
|
||||
var/target_address = get_pin_data(IC_INPUT, 1)
|
||||
var/message = get_pin_data(IC_INPUT, 2)
|
||||
var/text = get_pin_data(IC_INPUT, 3)
|
||||
|
||||
if(target_address && istext(target_address))
|
||||
exonet.send_message(target_address, message, text)
|
||||
|
||||
/obj/item/integrated_circuit/input/receive_exonet_message(var/atom/origin_atom, var/origin_address, var/message, var/text)
|
||||
set_pin_data(IC_OUTPUT, 1, origin_address)
|
||||
set_pin_data(IC_OUTPUT, 2, message)
|
||||
set_pin_data(IC_OUTPUT, 3, text)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
//This circuit gives information on where the machine is.
|
||||
/obj/item/integrated_circuit/input/gps
|
||||
name = "global positioning system"
|
||||
desc = "This allows you to easily know the position of a machine containing this device."
|
||||
extended_desc = "The GPS's coordinates it gives is absolute, not relative."
|
||||
icon_state = "gps"
|
||||
complexity = 4
|
||||
inputs = list()
|
||||
outputs = list("\<NUM\> X", "\<NUM\> Y")
|
||||
activators = list("get coordinates" = 1, "on get coordinates" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 30
|
||||
|
||||
/obj/item/integrated_circuit/input/gps/do_work()
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, null)
|
||||
set_pin_data(IC_OUTPUT, 2, null)
|
||||
if(!T)
|
||||
return
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, T.x)
|
||||
set_pin_data(IC_OUTPUT, 2, T.y)
|
||||
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone
|
||||
name = "microphone"
|
||||
desc = "Useful for spying on people or for voice activated machines."
|
||||
extended_desc = "This will automatically translate most languages it hears to Galactic Common. \
|
||||
The first activation pin is always pulsed when the circuit hears someone talk, while the second one \
|
||||
is only triggered if it hears someone speaking a language other than Galactic Common."
|
||||
icon_state = "recorder"
|
||||
complexity = 8
|
||||
inputs = list()
|
||||
outputs = list("\<TEXT\> speaker", "\<TEXT\> message")
|
||||
activators = list("on message received" = 1, "on translation" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 15
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/New()
|
||||
..()
|
||||
listening_objects |= src
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/Destroy()
|
||||
listening_objects -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/input/microphone/hear_talk(mob/living/M, msg, var/verb="says", datum/language/speaking=null)
|
||||
var/translated = FALSE
|
||||
if(M && msg)
|
||||
if(speaking)
|
||||
if(!speaking.machine_understands)
|
||||
msg = speaking.scramble(msg)
|
||||
if(!istype(speaking, /datum/language/common))
|
||||
translated = TRUE
|
||||
set_pin_data(IC_OUTPUT, 1, M.GetVoice())
|
||||
set_pin_data(IC_OUTPUT, 2, msg)
|
||||
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
if(translated)
|
||||
activate_pin(2)
|
||||
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/input/sensor
|
||||
name = "sensor"
|
||||
desc = "Scans and obtains a reference for any objects or persons near you. All you need to do is shove the machine in their face."
|
||||
extended_desc = "If 'ignore storage' pin is set to 1, the sensor will disregard scanning various storage containers such as backpacks."
|
||||
icon_state = "recorder"
|
||||
complexity = 12
|
||||
inputs = list("\<NUM\> ignore storage" = 1)
|
||||
outputs = list("\<REF\> scanned")
|
||||
activators = list("on scanned" = 0)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 120
|
||||
|
||||
/obj/item/integrated_circuit/input/sensor/proc/scan(var/atom/A)
|
||||
var/ignore_bags = get_pin_data(IC_INPUT, 1)
|
||||
if(ignore_bags)
|
||||
if(istype(A, /obj/item/weapon/storage))
|
||||
return FALSE
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, weakref(A))
|
||||
push_data()
|
||||
activate_pin(1)
|
||||
return TRUE
|
||||
|
||||
/obj/item/integrated_circuit/output
|
||||
category_text = "Output"
|
||||
|
||||
/obj/item/integrated_circuit/output/screen
|
||||
name = "small screen"
|
||||
desc = "This small screen can display a single piece of data, when the machine is examined closely."
|
||||
icon_state = "screen"
|
||||
inputs = list("\<TEXT/NUM\> displayed data")
|
||||
outputs = list()
|
||||
activators = list("load data" = 1)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 10
|
||||
autopulse = 1
|
||||
var/stuff_to_display = null
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/disconnect_all()
|
||||
..()
|
||||
stuff_to_display = null
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
|
||||
to_chat(user, "There is a little screen labeled '[name]', which displays [stuff_to_display ? "'[stuff_to_display]'" : "nothing"].")
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
if(isweakref(I.data))
|
||||
var/datum/d = I.data_as_type(/datum)
|
||||
if(d)
|
||||
stuff_to_display = "[d]"
|
||||
else
|
||||
stuff_to_display = I.data
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/medium
|
||||
name = "screen"
|
||||
desc = "This screen allows for people holding the device to see a piece of data."
|
||||
icon_state = "screen_medium"
|
||||
power_draw_per_use = 20
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/medium/do_work()
|
||||
..()
|
||||
var/list/nearby_things = range(0, get_turf(src))
|
||||
for(var/mob/M in nearby_things)
|
||||
var/obj/O = assembly ? assembly : src
|
||||
to_chat(M, "<span class='notice'>\icon[O] [stuff_to_display]</span>")
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large
|
||||
name = "large screen"
|
||||
desc = "This screen allows for people able to see the device to see a piece of data."
|
||||
icon_state = "screen_large"
|
||||
power_draw_per_use = 40
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large/do_work()
|
||||
..()
|
||||
var/obj/O = assembly ? loc : assembly
|
||||
O.visible_message("<span class='notice'>\icon[O] [stuff_to_display]</span>")
|
||||
|
||||
/obj/item/integrated_circuit/output/light
|
||||
name = "light"
|
||||
desc = "This light can turn on and off on command."
|
||||
icon_state = "light"
|
||||
complexity = 4
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("toggle light" = 1)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
var/light_toggled = 0
|
||||
var/light_brightness = 3
|
||||
var/light_rgb = "#FFFFFF"
|
||||
power_draw_idle = 0 // Adjusted based on brightness.
|
||||
|
||||
/obj/item/integrated_circuit/output/light/do_work()
|
||||
light_toggled = !light_toggled
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/proc/update_lighting()
|
||||
if(light_toggled)
|
||||
set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb)
|
||||
else
|
||||
set_light(0)
|
||||
power_draw_idle = light_toggled ? light_brightness * 2 : 0
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced/update_lighting()
|
||||
var/R = get_pin_data(IC_INPUT, 1)
|
||||
var/G = get_pin_data(IC_INPUT, 2)
|
||||
var/B = get_pin_data(IC_INPUT, 3)
|
||||
var/brightness = get_pin_data(IC_INPUT, 4)
|
||||
|
||||
if(isnum(R) && isnum(G) && isnum(B) && isnum(brightness))
|
||||
R = Clamp(R, 0, 255)
|
||||
G = Clamp(G, 0, 255)
|
||||
B = Clamp(B, 0, 255)
|
||||
brightness = Clamp(brightness, 0, 6)
|
||||
light_rgb = rgb(R, G, B)
|
||||
light_brightness = brightness
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left.
|
||||
light_toggled = FALSE
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced
|
||||
name = "advanced light"
|
||||
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
|
||||
icon_state = "light_adv"
|
||||
complexity = 8
|
||||
inputs = list(
|
||||
"\<NUM\> R",
|
||||
"\<NUM\> G",
|
||||
"\<NUM\> B",
|
||||
"\<NUM\> Brightness"
|
||||
)
|
||||
outputs = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/sound
|
||||
name = "speaker circuit"
|
||||
desc = "A miniature speaker is attached to this component."
|
||||
icon_state = "speaker"
|
||||
complexity = 8
|
||||
cooldown_per_use = 4 SECONDS
|
||||
inputs = list(
|
||||
"\<TEXT\> sound ID",
|
||||
"\<NUM\> volume",
|
||||
"\<NUM\> frequency"
|
||||
)
|
||||
outputs = list()
|
||||
activators = list("play sound" = 1)
|
||||
power_draw_per_use = 20
|
||||
var/list/sounds = list()
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech
|
||||
name = "text-to-speech circuit"
|
||||
desc = "A miniature speaker is attached to this component."
|
||||
extended_desc = "This unit is more advanced than the plain speaker circuit, able to transpose any valid text to speech."
|
||||
icon_state = "speaker"
|
||||
complexity = 12
|
||||
cooldown_per_use = 4 SECONDS
|
||||
inputs = list("text")
|
||||
outputs = list()
|
||||
activators = list("to speech" = 1)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 60
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech/do_work()
|
||||
var/datum/integrated_io/text = inputs[1]
|
||||
if(istext(text.data))
|
||||
var/obj/O = assembly ? loc : assembly
|
||||
audible_message("\icon[O] \The [O.name] states, \"[text.data]\"")
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/New()
|
||||
..()
|
||||
extended_desc = list()
|
||||
extended_desc += "The first input pin determines which sound is used. The choices are; "
|
||||
extended_desc += jointext(sounds, ", ")
|
||||
extended_desc += ". The second pin determines the volume of sound that is played"
|
||||
extended_desc += ", and the third determines if the frequency of the sound will vary with each activation."
|
||||
extended_desc = jointext(extended_desc, null)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/do_work()
|
||||
var/datum/integrated_io/ID = inputs[1]
|
||||
var/datum/integrated_io/vol = inputs[2]
|
||||
var/datum/integrated_io/frequency = inputs[3]
|
||||
if(istext(ID.data) && isnum(vol.data) && isnum(frequency.data))
|
||||
var/selected_sound = sounds[ID.data]
|
||||
if(!selected_sound)
|
||||
return
|
||||
vol.data = Clamp(vol.data, 0, 100)
|
||||
frequency.data = round(Clamp(frequency.data, 0, 1))
|
||||
playsound(get_turf(src), selected_sound, vol.data, frequency.data, -1)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/beeper
|
||||
name = "beeper circuit"
|
||||
desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \
|
||||
the speaker to tell the user if something goes very wrong when booting up. It can also do other similar synthetic sounds such \
|
||||
as buzzing, pinging, chiming, and more."
|
||||
sounds = list(
|
||||
"beep" = 'sound/machines/twobeep.ogg',
|
||||
"chime" = 'sound/machines/chime.ogg',
|
||||
"buzz sigh" = 'sound/machines/buzz-sigh.ogg',
|
||||
"buzz twice" = 'sound/machines/buzz-two.ogg',
|
||||
"ping" = 'sound/machines/ping.ogg',
|
||||
"synth yes" = 'sound/machines/synth_yes.ogg',
|
||||
"synth no" = 'sound/machines/synth_no.ogg',
|
||||
"warning buzz" = 'sound/machines/warning-buzzer.ogg'
|
||||
)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/beepsky
|
||||
name = "securitron sound circuit"
|
||||
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
|
||||
sounds = list(
|
||||
"creep" = 'sound/voice/bcreep.ogg',
|
||||
"criminal" = 'sound/voice/bcriminal.ogg',
|
||||
"freeze" = 'sound/voice/bfreeze.ogg',
|
||||
"god" = 'sound/voice/bgod.ogg',
|
||||
"i am the law" = 'sound/voice/biamthelaw.ogg',
|
||||
"insult" = 'sound/voice/binsult.ogg',
|
||||
"radio" = 'sound/voice/bradio.ogg',
|
||||
"secure day" = 'sound/voice/bsecureday.ogg',
|
||||
)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/medbot
|
||||
name = "medbot sound circuit"
|
||||
desc = "A miniature speaker is attached to this component, used to annoy patients while they get pricked by a medbot."
|
||||
sounds = list(
|
||||
"surgeon" = 'sound/voice/medbot/msurgeon.ogg',
|
||||
"radar" = 'sound/voice/medbot/mradar.ogg',
|
||||
"feel better" = 'sound/voice/medbot/mfeelbetter.ogg',
|
||||
"patched up" = 'sound/voice/medbot/mpatchedup.ogg',
|
||||
"injured" = 'sound/voice/medbot/minjured.ogg',
|
||||
"insult" = 'sound/voice/medbot/minsult.ogg',
|
||||
"coming" = 'sound/voice/medbot/mcoming.ogg',
|
||||
"help" = 'sound/voice/medbot/mhelp.ogg',
|
||||
"live" = 'sound/voice/medbot/mlive.ogg',
|
||||
"lost" = 'sound/voice/medbot/mlost.ogg',
|
||||
"flies" = 'sound/voice/medbot/mflies.ogg',
|
||||
"catch" = 'sound/voice/medbot/mcatch.ogg',
|
||||
"delicious" = 'sound/voice/medbot/mdelicious.ogg',
|
||||
"apple" = 'sound/voice/medbot/mapple.ogg',
|
||||
"no" = 'sound/voice/medbot/mno.ogg',
|
||||
)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 1)
|
||||
|
||||
//'sound/voice/medbot/mfeelbetter.ogg'
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera
|
||||
name = "video camera circuit"
|
||||
desc = "This small camera allows a remote viewer to see what it sees."
|
||||
extended_desc = "The camera is linked to the Research camera network."
|
||||
icon_state = "video_camera"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 10
|
||||
inputs = list("camera name" = "video camera circuit", "camera active" = 0)
|
||||
outputs = list()
|
||||
activators = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_idle = 5 // Raises to 80 when on.
|
||||
var/obj/machinery/camera/network/research/camera
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/New()
|
||||
..()
|
||||
camera = new(src)
|
||||
on_data_written()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/Destroy()
|
||||
qdel_null(camera)
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(var/status)
|
||||
if(camera)
|
||||
camera.set_status(status)
|
||||
power_draw_idle = camera.status ? 80 : 5
|
||||
if(camera.status) // Ensure that there's actually power.
|
||||
if(!draw_idle_power())
|
||||
power_fail()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/on_data_written()
|
||||
if(camera)
|
||||
var/datum/integrated_io/cam_name = inputs[1]
|
||||
var/datum/integrated_io/cam_active = inputs[2]
|
||||
if(istext(cam_name.data))
|
||||
camera.c_tag = cam_name.data
|
||||
if(isnum(cam_active.data))
|
||||
set_camera_status(cam_active.data)
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/power_fail()
|
||||
if(camera)
|
||||
set_camera_status(0)
|
||||
var/datum/integrated_io/cam_active = inputs[2]
|
||||
cam_active.data = FALSE
|
||||
|
||||
/obj/item/integrated_circuit/output/led
|
||||
name = "light-emitting diode"
|
||||
desc = "This a LED that is lit whenever there is TRUE-equivalent data on its input."
|
||||
extended_desc = "TRUE-equivalent values are: Non-empty strings, non-zero numbers, and valid refs."
|
||||
complexity = 0.1
|
||||
icon_state = "led"
|
||||
inputs = list("lit")
|
||||
outputs = list()
|
||||
activators = list()
|
||||
power_draw_idle = 0 // Raises to 1 when lit.
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
var/led_color
|
||||
|
||||
/obj/item/integrated_circuit/output/led/on_data_written()
|
||||
power_draw_idle = get_pin_data(IC_INPUT, 1) ? 1 : 0
|
||||
|
||||
/obj/item/integrated_circuit/output/led/power_fail()
|
||||
set_pin_data(IC_INPUT, 1, FALSE)
|
||||
|
||||
/obj/item/integrated_circuit/output/led/any_examine(mob/user)
|
||||
var/text_output = list()
|
||||
var/initial_name = initial(name)
|
||||
|
||||
// Doing all this work just to have a color-blind friendly output.
|
||||
text_output += "There is "
|
||||
if(name == initial_name)
|
||||
text_output += "\an [name]"
|
||||
else
|
||||
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
|
||||
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
|
||||
to_chat(user,jointext(text_output,null))
|
||||
|
||||
/obj/item/integrated_circuit/output/led/red
|
||||
name = "red LED"
|
||||
led_color = COLOR_RED
|
||||
|
||||
/obj/item/integrated_circuit/output/led/orange
|
||||
name = "orange LED"
|
||||
led_color = COLOR_ORANGE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/yellow
|
||||
name = "yellow LED"
|
||||
led_color = COLOR_YELLOW
|
||||
|
||||
/obj/item/integrated_circuit/output/led/green
|
||||
name = "green LED"
|
||||
led_color = COLOR_GREEN
|
||||
|
||||
/obj/item/integrated_circuit/output/led/blue
|
||||
name = "blue LED"
|
||||
led_color = COLOR_BLUE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/purple
|
||||
name = "purple LED"
|
||||
led_color = COLOR_PURPLE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/cyan
|
||||
name = "cyan LED"
|
||||
led_color = COLOR_CYAN
|
||||
|
||||
/obj/item/integrated_circuit/output/led/white
|
||||
name = "white LED"
|
||||
led_color = COLOR_WHITE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/pink
|
||||
name = "pink LED"
|
||||
led_color = COLOR_PINK
|
||||
@@ -0,0 +1,89 @@
|
||||
//These circuits do things with lists, and use special list pins for stability.
|
||||
/obj/item/integrated_circuit/list
|
||||
complexity = 1
|
||||
inputs = list(
|
||||
"input" = IC_PINTYPE_LIST
|
||||
)
|
||||
outputs = list("result" = IC_PINTYPE_STRING)
|
||||
activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
|
||||
category_text = "Lists"
|
||||
power_draw_per_use = 20
|
||||
|
||||
/obj/item/integrated_circuit/list/pick
|
||||
name = "pick circuit"
|
||||
desc = "This circuit will randomly 'pick' an element from a list that is inputted."
|
||||
extended_desc = "Will output null if the list is empty. Input list is unmodified."
|
||||
icon_state = "addition"
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/list/pick/do_work()
|
||||
var/result = null
|
||||
var/list/input_list = get_pin_data(IC_INPUT, 1) // List pins guarantee that there is a list inside, even if just an empty one.
|
||||
if(input_list.len)
|
||||
result = pick(input_list)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/list/append
|
||||
name = "append circuit"
|
||||
desc = "This circuit will add an element to a list."
|
||||
extended_desc = "The new element will always be at the bottom of the list."
|
||||
inputs = list(
|
||||
"list to append" = IC_PINTYPE_LIST,
|
||||
"input" = IC_PINTYPE_ANY
|
||||
)
|
||||
outputs = list(
|
||||
"appended list" = IC_PINTYPE_LIST
|
||||
)
|
||||
icon_state = "addition"
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/list/append/do_work()
|
||||
var/list/input_list = get_pin_data(IC_INPUT, 1)
|
||||
var/list/output_list = list()
|
||||
var/new_entry = get_pin_data(IC_INPUT, 2)
|
||||
output_list = input_list.Copy()
|
||||
output_list.Add(new_entry)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, output_list)
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
|
||||
/obj/item/integrated_circuit/list/jointext
|
||||
name = "join text circuit"
|
||||
desc = "This circuit will add all elements of a list into one string, seperated by a character."
|
||||
extended_desc = "Default settings will encode the entire list into a string."
|
||||
inputs = list(
|
||||
"list to join" = IC_PINTYPE_LIST,
|
||||
"delimiter" = IC_PINTYPE_CHAR,
|
||||
"start" = IC_PINTYPE_NUMBER,
|
||||
"end" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
inputs_default = list(
|
||||
"2" = ",",
|
||||
"3" = 1,
|
||||
"4" = 0
|
||||
)
|
||||
outputs = list(
|
||||
"joined text" = IC_PINTYPE_STRING
|
||||
)
|
||||
icon_state = "addition"
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/list/jointext/do_work()
|
||||
var/list/input_list = get_pin_data(IC_INPUT, 1)
|
||||
var/delimiter = get_pin_data(IC_INPUT, 2)
|
||||
var/start = get_pin_data(IC_INPUT, 3)
|
||||
var/end = get_pin_data(IC_INPUT, 4)
|
||||
|
||||
var/result = null
|
||||
|
||||
if(input_list.len && delimiter && !isnull(start) && !isnull(end))
|
||||
result = jointext(input_list, delimiter, start, end)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
push_data()
|
||||
activate_pin(2)
|
||||
@@ -4,21 +4,16 @@
|
||||
extended_desc = "Logic circuits will treat a null, 0, and a \"\" string value as FALSE and anything else as TRUE."
|
||||
complexity = 3
|
||||
outputs = list("result")
|
||||
activators = list("compare" = 1)
|
||||
activators = list("compare" = IC_PINTYPE_PULSE_IN)
|
||||
category_text = "Logic"
|
||||
autopulse = 1
|
||||
power_draw_per_use = 1
|
||||
|
||||
/obj/item/integrated_circuit/logic/on_data_written()
|
||||
if(autopulse == 1)
|
||||
check_then_do_work()
|
||||
|
||||
/obj/item/integrated_circuit/logic/do_work()
|
||||
push_data()
|
||||
|
||||
/obj/item/integrated_circuit/logic/binary
|
||||
inputs = list("\<ANY\> A","\<ANY\> B")
|
||||
activators = list("compare" = 1, "on true result" = 0, "on false result" = 0)
|
||||
inputs = list("A","B")
|
||||
activators = list("compare" = IC_PINTYPE_PULSE_IN, "on true result" = IC_PINTYPE_PULSE_OUT, "on false result" = IC_PINTYPE_PULSE_OUT)
|
||||
|
||||
/obj/item/integrated_circuit/logic/binary/do_work()
|
||||
pull_data()
|
||||
@@ -37,8 +32,8 @@
|
||||
return FALSE
|
||||
|
||||
/obj/item/integrated_circuit/logic/unary
|
||||
inputs = list("\<ANY\> A")
|
||||
activators = list("compare" = 1, "on compare" = 0)
|
||||
inputs = list("A")
|
||||
activators = list("compare" = IC_PINTYPE_PULSE_IN, "on compare" = IC_PINTYPE_PULSE_OUT)
|
||||
|
||||
/obj/item/integrated_circuit/logic/unary/do_work()
|
||||
pull_data()
|
||||
@@ -128,7 +123,7 @@
|
||||
desc = "This gate inverts what's fed into it."
|
||||
icon_state = "not"
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
activators = list("invert" = 1, "on inverted" = 0)
|
||||
activators = list("invert" = IC_PINTYPE_PULSE_IN, "on inverted" = IC_PINTYPE_PULSE_OUT)
|
||||
|
||||
/obj/item/integrated_circuit/logic/unary/not/do_check(var/datum/integrated_io/A)
|
||||
return !A.data
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
size = 3
|
||||
inputs = list(
|
||||
"\<NUM\> target X rel",
|
||||
"\<NUM\> target Y rel"
|
||||
"target X rel" = IC_PINTYPE_NUMBER,
|
||||
"target Y rel" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
outputs = list()
|
||||
activators = list(
|
||||
"fire" = 1
|
||||
"fire" = IC_PINTYPE_PULSE_IN
|
||||
)
|
||||
var/obj/item/weapon/gun/installed_gun = null
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
@@ -104,24 +104,15 @@
|
||||
name = "locomotion circuit"
|
||||
desc = "This allows a machine to move in a given direction."
|
||||
icon_state = "locomotion"
|
||||
extended_desc = "The circuit accepts a number as a direction to move towards.<br> \
|
||||
North/Fore = 1,<br>\
|
||||
South/Aft = 2,<br>\
|
||||
East/Starboard = 4,<br>\
|
||||
West/Port = 8,<br>\
|
||||
Northeast = 5,<br>\
|
||||
Northwest = 9,<br>\
|
||||
Southeast = 6,<br>\
|
||||
Southwest = 10<br>\
|
||||
<br>\
|
||||
extended_desc = "The circuit accepts a 'dir' number as a direction to move towards.<br>\
|
||||
Pulsing the 'step towards dir' activator pin will cause the machine to move a meter in that direction, assuming it is not \
|
||||
being held, or anchored in some way. It should be noted that the ability to move is dependant on the type of assembly that this circuit inhabits."
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
complexity = 20
|
||||
// size = 5
|
||||
inputs = list("dir num")
|
||||
inputs = list("direction" = IC_PINTYPE_DIR)
|
||||
outputs = list()
|
||||
activators = list("step towards dir" = 1)
|
||||
activators = list("step towards dir" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 100
|
||||
|
||||
@@ -146,9 +137,9 @@
|
||||
icon_state = "grenade"
|
||||
complexity = 30
|
||||
size = 2
|
||||
inputs = list("\<NUM\> detonation time")
|
||||
inputs = list("detonation time" = IC_PINTYPE_NUMBER)
|
||||
outputs = list()
|
||||
activators = list("prime grenade" = 1)
|
||||
activators = list("prime grenade" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 4)
|
||||
var/obj/item/weapon/grenade/attached_grenade
|
||||
|
||||
@@ -3,12 +3,20 @@
|
||||
desc = "This tiny chip can store one piece of data."
|
||||
icon_state = "memory"
|
||||
complexity = 1
|
||||
inputs = list("input pin 1")
|
||||
outputs = list("output pin 1")
|
||||
activators = list("set" = 1, "on set")
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("set" = IC_PINTYPE_PULSE_IN, "on set" = IC_PINTYPE_PULSE_OUT)
|
||||
category_text = "Memory"
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 1
|
||||
var/number_of_pins = 1
|
||||
|
||||
/obj/item/integrated_circuit/memory/New()
|
||||
for(var/i = 1 to number_of_pins)
|
||||
inputs["input [i]"] = IC_PINTYPE_ANY // This is just a string since pins don't get built until ..() is called.
|
||||
outputs["output [i]"] = IC_PINTYPE_ANY
|
||||
complexity = number_of_pins
|
||||
..()
|
||||
|
||||
/obj/item/integrated_circuit/memory/examine(mob/user)
|
||||
..()
|
||||
@@ -36,83 +44,26 @@
|
||||
name = "memory circuit"
|
||||
desc = "This circuit can store four pieces of data."
|
||||
icon_state = "memory4"
|
||||
complexity = 4
|
||||
inputs = list("input pin 1","input pin 2","input pin 3","input pin 4")
|
||||
outputs = list("output pin 1","output pin 2","output pin 3","output pin 4")
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 2
|
||||
number_of_pins = 4
|
||||
|
||||
/obj/item/integrated_circuit/memory/large
|
||||
name = "large memory circuit"
|
||||
desc = "This big circuit can hold eight pieces of data."
|
||||
icon_state = "memory8"
|
||||
complexity = 8
|
||||
inputs = list(
|
||||
"input pin 1",
|
||||
"input pin 2",
|
||||
"input pin 3",
|
||||
"input pin 4",
|
||||
"input pin 5",
|
||||
"input pin 6",
|
||||
"input pin 7",
|
||||
"input pin 8")
|
||||
outputs = list(
|
||||
"output pin 1",
|
||||
"output pin 2",
|
||||
"output pin 3",
|
||||
"output pin 4",
|
||||
"output pin 5",
|
||||
"output pin 6",
|
||||
"output pin 7",
|
||||
"output pin 8")
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
|
||||
power_draw_per_use = 4
|
||||
number_of_pins = 8
|
||||
|
||||
/obj/item/integrated_circuit/memory/huge
|
||||
name = "large memory stick"
|
||||
desc = "This stick of memory can hold up up to sixteen pieces of data."
|
||||
icon_state = "memory16"
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
complexity = 16
|
||||
inputs = list(
|
||||
"input pin 1",
|
||||
"input pin 2",
|
||||
"input pin 3",
|
||||
"input pin 4",
|
||||
"input pin 5",
|
||||
"input pin 6",
|
||||
"input pin 7",
|
||||
"input pin 8",
|
||||
"input pin 9",
|
||||
"input pin 10",
|
||||
"input pin 11",
|
||||
"input pin 12",
|
||||
"input pin 13",
|
||||
"input pin 14",
|
||||
"input pin 15",
|
||||
"input pin 16"
|
||||
)
|
||||
outputs = list(
|
||||
"output pin 1",
|
||||
"output pin 2",
|
||||
"output pin 3",
|
||||
"output pin 4",
|
||||
"output pin 5",
|
||||
"output pin 6",
|
||||
"output pin 7",
|
||||
"output pin 8",
|
||||
"output pin 9",
|
||||
"output pin 10",
|
||||
"output pin 11",
|
||||
"output pin 12",
|
||||
"output pin 13",
|
||||
"output pin 14",
|
||||
"output pin 15",
|
||||
"output pin 16")
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4)
|
||||
power_draw_per_use = 8
|
||||
number_of_pins = 16
|
||||
|
||||
/obj/item/integrated_circuit/memory/constant
|
||||
name = "constant chip"
|
||||
@@ -120,8 +71,8 @@
|
||||
icon_state = "memory"
|
||||
complexity = 1
|
||||
inputs = list()
|
||||
outputs = list("output pin")
|
||||
activators = list("push data" = 0)
|
||||
outputs = list("output pin" = IC_PINTYPE_ANY)
|
||||
activators = list("push data" = IC_PINTYPE_PULSE_IN)
|
||||
var/accepting_refs = 0
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
@@ -142,13 +93,13 @@
|
||||
new_data = input("Now type in a string.","[src] string writing") as null|text
|
||||
if(istext(new_data) && CanInteract(user, physical_state))
|
||||
O.data = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data()].</span>")
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
if("number")
|
||||
accepting_refs = 0
|
||||
new_data = input("Now type in a number.","[src] number writing") as null|num
|
||||
if(isnum(new_data) && CanInteract(user, physical_state))
|
||||
O.data = new_data
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data()].</span>")
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to [O.display_data(O.data)].</span>")
|
||||
if("ref")
|
||||
accepting_refs = 1
|
||||
to_chat(user, "<span class='notice'>You turn \the [src]'s ref scanner on. Slide it across \
|
||||
@@ -162,6 +113,6 @@
|
||||
var/datum/integrated_io/O = outputs[1]
|
||||
O.data = weakref(target)
|
||||
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [O.display_data()]. The ref scanner is \
|
||||
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [O.display_data(O.data)]. The ref scanner is \
|
||||
now off.</span>")
|
||||
accepting_refs = 0
|
||||
@@ -0,0 +1,339 @@
|
||||
/obj/item/integrated_circuit/output
|
||||
category_text = "Output"
|
||||
|
||||
/obj/item/integrated_circuit/output/screen
|
||||
name = "small screen"
|
||||
desc = "This small screen can display a single piece of data, when the machine is examined closely."
|
||||
icon_state = "screen"
|
||||
inputs = list("displayed data" = IC_PINTYPE_ANY)
|
||||
outputs = list()
|
||||
activators = list("load data" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 10
|
||||
var/stuff_to_display = null
|
||||
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/disconnect_all()
|
||||
..()
|
||||
stuff_to_display = null
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/any_examine(mob/user)
|
||||
to_chat(user, "There is a little screen labeled '[name]', which displays [!isnull(stuff_to_display) ? "'[stuff_to_display]'" : "nothing"].")
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/do_work()
|
||||
var/datum/integrated_io/I = inputs[1]
|
||||
if(isweakref(I.data))
|
||||
var/datum/d = I.data_as_type(/datum)
|
||||
if(d)
|
||||
stuff_to_display = "[d]"
|
||||
else
|
||||
stuff_to_display = I.data
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/medium
|
||||
name = "screen"
|
||||
desc = "This screen allows for people holding the device to see a piece of data."
|
||||
icon_state = "screen_medium"
|
||||
power_draw_per_use = 20
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/medium/do_work()
|
||||
..()
|
||||
var/list/nearby_things = range(0, get_turf(src))
|
||||
for(var/mob/M in nearby_things)
|
||||
var/obj/O = assembly ? assembly : src
|
||||
to_chat(M, "<span class='notice'>\icon[O] [stuff_to_display]</span>")
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large
|
||||
name = "large screen"
|
||||
desc = "This screen allows for people able to see the device to see a piece of data."
|
||||
icon_state = "screen_large"
|
||||
power_draw_per_use = 40
|
||||
|
||||
/obj/item/integrated_circuit/output/screen/large/do_work()
|
||||
..()
|
||||
var/obj/O = assembly ? loc : assembly
|
||||
O.visible_message("<span class='notice'>\icon[O] [stuff_to_display]</span>")
|
||||
|
||||
/obj/item/integrated_circuit/output/light
|
||||
name = "light"
|
||||
desc = "This light can turn on and off on command."
|
||||
icon_state = "light"
|
||||
complexity = 4
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("toggle light" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
var/light_toggled = 0
|
||||
var/light_brightness = 3
|
||||
var/light_rgb = "#FFFFFF"
|
||||
power_draw_idle = 0 // Adjusted based on brightness.
|
||||
|
||||
/obj/item/integrated_circuit/output/light/do_work()
|
||||
light_toggled = !light_toggled
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/proc/update_lighting()
|
||||
if(light_toggled)
|
||||
if(assembly)
|
||||
assembly.set_light(l_range = light_brightness, l_power = light_brightness, l_color = light_rgb)
|
||||
else
|
||||
if(assembly)
|
||||
assembly.set_light(0)
|
||||
power_draw_idle = light_toggled ? light_brightness * 2 : 0
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced/update_lighting()
|
||||
var/new_color = get_pin_data(IC_INPUT, 1)
|
||||
var/brightness = get_pin_data(IC_INPUT, 2)
|
||||
|
||||
if(new_color && isnum(brightness))
|
||||
brightness = Clamp(brightness, 0, 6)
|
||||
light_rgb = new_color
|
||||
light_brightness = brightness
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/power_fail() // Turns off the flashlight if there's no power left.
|
||||
light_toggled = FALSE
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced
|
||||
name = "advanced light"
|
||||
desc = "This light can turn on and off on command, in any color, and in various brightness levels."
|
||||
icon_state = "light_adv"
|
||||
complexity = 8
|
||||
inputs = list(
|
||||
"color" = IC_PINTYPE_COLOR,
|
||||
"brightness" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
outputs = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3)
|
||||
|
||||
/obj/item/integrated_circuit/output/light/advanced/on_data_written()
|
||||
update_lighting()
|
||||
|
||||
/obj/item/integrated_circuit/output/sound
|
||||
name = "speaker circuit"
|
||||
desc = "A miniature speaker is attached to this component."
|
||||
icon_state = "speaker"
|
||||
complexity = 8
|
||||
cooldown_per_use = 4 SECONDS
|
||||
inputs = list(
|
||||
"sound ID" = IC_PINTYPE_STRING,
|
||||
"volume" = IC_PINTYPE_NUMBER,
|
||||
"frequency" = IC_PINTYPE_BOOLEAN
|
||||
)
|
||||
outputs = list()
|
||||
activators = list("play sound" = IC_PINTYPE_PULSE_IN)
|
||||
power_draw_per_use = 20
|
||||
var/list/sounds = list()
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech
|
||||
name = "text-to-speech circuit"
|
||||
desc = "A miniature speaker is attached to this component."
|
||||
extended_desc = "This unit is more advanced than the plain speaker circuit, able to transpose any valid text to speech."
|
||||
icon_state = "speaker"
|
||||
complexity = 12
|
||||
cooldown_per_use = 4 SECONDS
|
||||
inputs = list("text" = IC_PINTYPE_STRING)
|
||||
outputs = list()
|
||||
activators = list("to speech" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 60
|
||||
|
||||
/obj/item/integrated_circuit/output/text_to_speech/do_work()
|
||||
text = get_pin_data(IC_INPUT, 1)
|
||||
if(!isnull(text))
|
||||
var/obj/O = assembly ? loc : assembly
|
||||
audible_message("\icon[O] \The [O.name] states, \"[text]\"")
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/New()
|
||||
..()
|
||||
extended_desc = list()
|
||||
extended_desc += "The first input pin determines which sound is used. The choices are; "
|
||||
extended_desc += jointext(sounds, ", ")
|
||||
extended_desc += ". The second pin determines the volume of sound that is played"
|
||||
extended_desc += ", and the third determines if the frequency of the sound will vary with each activation."
|
||||
extended_desc = jointext(extended_desc, null)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/do_work()
|
||||
var/ID = get_pin_data(IC_INPUT, 1)
|
||||
var/vol = get_pin_data(IC_INPUT, 2)
|
||||
var/freq = get_pin_data(IC_INPUT, 3)
|
||||
if(!isnull(ID) && !isnull(vol))
|
||||
var/selected_sound = sounds[ID]
|
||||
if(!selected_sound)
|
||||
return
|
||||
vol = between(0, vol, 100)
|
||||
playsound(get_turf(src), selected_sound, vol, freq, -1)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/beeper
|
||||
name = "beeper circuit"
|
||||
desc = "A miniature speaker is attached to this component. This is often used in the construction of motherboards, which use \
|
||||
the speaker to tell the user if something goes very wrong when booting up. It can also do other similar synthetic sounds such \
|
||||
as buzzing, pinging, chiming, and more."
|
||||
sounds = list(
|
||||
"beep" = 'sound/machines/twobeep.ogg',
|
||||
"chime" = 'sound/machines/chime.ogg',
|
||||
"buzz sigh" = 'sound/machines/buzz-sigh.ogg',
|
||||
"buzz twice" = 'sound/machines/buzz-two.ogg',
|
||||
"ping" = 'sound/machines/ping.ogg',
|
||||
"synth yes" = 'sound/machines/synth_yes.ogg',
|
||||
"synth no" = 'sound/machines/synth_no.ogg',
|
||||
"warning buzz" = 'sound/machines/warning-buzzer.ogg'
|
||||
)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/beepsky
|
||||
name = "securitron sound circuit"
|
||||
desc = "A miniature speaker is attached to this component. Considered by some to be the essential component for a securitron."
|
||||
sounds = list(
|
||||
"creep" = 'sound/voice/bcreep.ogg',
|
||||
"criminal" = 'sound/voice/bcriminal.ogg',
|
||||
"freeze" = 'sound/voice/bfreeze.ogg',
|
||||
"god" = 'sound/voice/bgod.ogg',
|
||||
"i am the law" = 'sound/voice/biamthelaw.ogg',
|
||||
"insult" = 'sound/voice/binsult.ogg',
|
||||
"radio" = 'sound/voice/bradio.ogg',
|
||||
"secure day" = 'sound/voice/bsecureday.ogg',
|
||||
)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_ILLEGAL = 1)
|
||||
|
||||
/obj/item/integrated_circuit/output/sound/medbot
|
||||
name = "medbot sound circuit"
|
||||
desc = "A miniature speaker is attached to this component, used to annoy patients while they get pricked by a medbot."
|
||||
sounds = list(
|
||||
"surgeon" = 'sound/voice/medbot/msurgeon.ogg',
|
||||
"radar" = 'sound/voice/medbot/mradar.ogg',
|
||||
"feel better" = 'sound/voice/medbot/mfeelbetter.ogg',
|
||||
"patched up" = 'sound/voice/medbot/mpatchedup.ogg',
|
||||
"injured" = 'sound/voice/medbot/minjured.ogg',
|
||||
"insult" = 'sound/voice/medbot/minsult.ogg',
|
||||
"coming" = 'sound/voice/medbot/mcoming.ogg',
|
||||
"help" = 'sound/voice/medbot/mhelp.ogg',
|
||||
"live" = 'sound/voice/medbot/mlive.ogg',
|
||||
"lost" = 'sound/voice/medbot/mlost.ogg',
|
||||
"flies" = 'sound/voice/medbot/mflies.ogg',
|
||||
"catch" = 'sound/voice/medbot/mcatch.ogg',
|
||||
"delicious" = 'sound/voice/medbot/mdelicious.ogg',
|
||||
"apple" = 'sound/voice/medbot/mapple.ogg',
|
||||
"no" = 'sound/voice/medbot/mno.ogg',
|
||||
)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 1)
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera
|
||||
name = "video camera circuit"
|
||||
desc = "This small camera allows a remote viewer to see what it sees."
|
||||
extended_desc = "The camera is linked to the Research camera network."
|
||||
icon_state = "video_camera"
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 10
|
||||
inputs = list(
|
||||
"camera name" = IC_PINTYPE_STRING,
|
||||
"camera active" = IC_PINTYPE_BOOLEAN
|
||||
)
|
||||
inputs_default = list("1" = "video camera circuit")
|
||||
outputs = list()
|
||||
activators = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_idle = 5 // Raises to 80 when on.
|
||||
var/obj/machinery/camera/network/research/camera
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/New()
|
||||
..()
|
||||
camera = new(src)
|
||||
on_data_written()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/Destroy()
|
||||
qdel_null(camera)
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/proc/set_camera_status(var/status)
|
||||
if(camera)
|
||||
camera.set_status(status)
|
||||
power_draw_idle = camera.status ? 80 : 5
|
||||
if(camera.status) // Ensure that there's actually power.
|
||||
if(!draw_idle_power())
|
||||
power_fail()
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/on_data_written()
|
||||
if(camera)
|
||||
var/cam_name = get_pin_data(IC_INPUT, 1)
|
||||
var/cam_active = get_pin_data(IC_INPUT, 2)
|
||||
if(!isnull(cam_name))
|
||||
camera.c_tag = cam_name
|
||||
set_camera_status(cam_active)
|
||||
|
||||
/obj/item/integrated_circuit/output/video_camera/power_fail()
|
||||
if(camera)
|
||||
set_camera_status(0)
|
||||
set_pin_data(IC_INPUT, 2, FALSE)
|
||||
|
||||
/obj/item/integrated_circuit/output/led
|
||||
name = "light-emitting diode"
|
||||
desc = "This a LED that is lit whenever there is TRUE-equivalent data on its input."
|
||||
extended_desc = "TRUE-equivalent values are: Non-empty strings, non-zero numbers, and valid refs."
|
||||
complexity = 0.1
|
||||
icon_state = "led"
|
||||
inputs = list("lit" = IC_PINTYPE_BOOLEAN)
|
||||
outputs = list()
|
||||
activators = list()
|
||||
power_draw_idle = 0 // Raises to 1 when lit.
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
var/led_color
|
||||
|
||||
/obj/item/integrated_circuit/output/led/on_data_written()
|
||||
power_draw_idle = get_pin_data(IC_INPUT, 1) ? 1 : 0
|
||||
|
||||
/obj/item/integrated_circuit/output/led/power_fail()
|
||||
set_pin_data(IC_INPUT, 1, FALSE)
|
||||
|
||||
/obj/item/integrated_circuit/output/led/any_examine(mob/user)
|
||||
var/text_output = list()
|
||||
var/initial_name = initial(name)
|
||||
|
||||
// Doing all this work just to have a color-blind friendly output.
|
||||
text_output += "There is "
|
||||
if(name == initial_name)
|
||||
text_output += "\an [name]"
|
||||
else
|
||||
text_output += "\an ["\improper[initial_name]"] labeled '[name]'"
|
||||
text_output += " which is currently [get_pin_data(IC_INPUT, 1) ? "lit <font color=[led_color]>¤</font>" : "unlit."]"
|
||||
to_chat(user,jointext(text_output,null))
|
||||
|
||||
/obj/item/integrated_circuit/output/led/red
|
||||
name = "red LED"
|
||||
led_color = COLOR_RED
|
||||
|
||||
/obj/item/integrated_circuit/output/led/orange
|
||||
name = "orange LED"
|
||||
led_color = COLOR_ORANGE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/yellow
|
||||
name = "yellow LED"
|
||||
led_color = COLOR_YELLOW
|
||||
|
||||
/obj/item/integrated_circuit/output/led/green
|
||||
name = "green LED"
|
||||
led_color = COLOR_GREEN
|
||||
|
||||
/obj/item/integrated_circuit/output/led/blue
|
||||
name = "blue LED"
|
||||
led_color = COLOR_BLUE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/purple
|
||||
name = "purple LED"
|
||||
led_color = COLOR_PURPLE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/cyan
|
||||
name = "cyan LED"
|
||||
led_color = COLOR_CYAN
|
||||
|
||||
/obj/item/integrated_circuit/output/led/white
|
||||
name = "white LED"
|
||||
led_color = COLOR_WHITE
|
||||
|
||||
/obj/item/integrated_circuit/output/led/pink
|
||||
name = "pink LED"
|
||||
led_color = COLOR_PINK
|
||||
@@ -11,9 +11,13 @@
|
||||
some power is lost due to ineffiency."
|
||||
w_class = ITEMSIZE_SMALL
|
||||
complexity = 16
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list("\<NUM\> target cell charge", "\<NUM\> target cell max charge", "\<NUM\> target cell percentage")
|
||||
activators = list("transmit" = 1)
|
||||
inputs = list("target" = IC_PINTYPE_REF)
|
||||
outputs = list(
|
||||
"target cell charge" = IC_PINTYPE_NUMBER,
|
||||
"target cell max charge" = IC_PINTYPE_NUMBER,
|
||||
"target cell percentage" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
activators = list("transmit" = IC_PINTYPE_PULSE_IN, "on transmit" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 4, TECH_POWER = 4, TECH_MAGNET = 3)
|
||||
power_draw_per_use = 500 // Inefficency has to come from somewhere.
|
||||
@@ -67,6 +71,7 @@
|
||||
set_pin_data(IC_OUTPUT, 1, cell.charge)
|
||||
set_pin_data(IC_OUTPUT, 2, cell.maxcharge)
|
||||
set_pin_data(IC_OUTPUT, 3, cell.percent())
|
||||
activate_pin(2)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
desc = "Unlike most electronics, creating smoke is completely intentional."
|
||||
icon_state = "smoke"
|
||||
extended_desc = "This smoke generator creates clouds of smoke on command. It can also hold liquids inside, which will go \
|
||||
into the smoke clouds when activated."
|
||||
into the smoke clouds when activated. The reagents are consumed when smoke is made."
|
||||
flags = OPENCONTAINER
|
||||
complexity = 20
|
||||
cooldown_per_use = 30 SECONDS
|
||||
inputs = list()
|
||||
outputs = list()
|
||||
activators = list("create smoke" = 1)
|
||||
activators = list("create smoke" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_BIO = 3)
|
||||
volume = 100
|
||||
@@ -43,9 +43,10 @@
|
||||
flags = OPENCONTAINER
|
||||
complexity = 20
|
||||
cooldown_per_use = 6 SECONDS
|
||||
inputs = list("\<REF\> target", "\<NUM\> injection amount" = 5)
|
||||
inputs = list("target" = IC_PINTYPE_REF, "injection amount" = IC_PINTYPE_NUMBER)
|
||||
inputs_default = list("2" = 5)
|
||||
outputs = list()
|
||||
activators = list("inject" = 1)
|
||||
activators = list("inject" = IC_PINTYPE_PULSE_IN)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
volume = 30
|
||||
power_draw_per_use = 15
|
||||
@@ -88,19 +89,20 @@
|
||||
outside the machine if it is next to the machine. Note that this cannot be used on entities."
|
||||
flags = OPENCONTAINER
|
||||
complexity = 8
|
||||
inputs = list("\<REF\> source", "\<REF\> target", "\<NUM\> injection amount" = 10)
|
||||
inputs = list("source" = IC_PINTYPE_REF, "target" = IC_PINTYPE_REF, "injection amount" = IC_PINTYPE_NUMBER)
|
||||
inputs_default = list("3" = 5)
|
||||
outputs = list()
|
||||
activators = list("transfer reagents" = 1, "on transfer" = 0)
|
||||
activators = list("transfer reagents" = IC_PINTYPE_PULSE_IN, "on transfer" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
|
||||
var/transfer_amount = 10
|
||||
power_draw_per_use = 10
|
||||
|
||||
/obj/item/integrated_circuit/reagent/pump/on_data_written()
|
||||
var/datum/integrated_io/amount = inputs[3]
|
||||
if(isnum(amount.data))
|
||||
amount.data = Clamp(amount.data, 0, 50)
|
||||
transfer_amount = amount.data
|
||||
var/new_amount = get_pin_data(IC_INPUT, 3)
|
||||
if(!isnull(new_amount))
|
||||
new_amount = Clamp(new_amount, 0, 50)
|
||||
transfer_amount = new_amount
|
||||
|
||||
/obj/item/integrated_circuit/reagent/pump/do_work()
|
||||
var/atom/movable/source = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
|
||||
@@ -130,16 +132,15 @@
|
||||
flags = OPENCONTAINER
|
||||
complexity = 4
|
||||
inputs = list()
|
||||
outputs = list("volume used")
|
||||
outputs = list("volume used" = IC_PINTYPE_NUMBER)
|
||||
activators = list()
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2, TECH_BIO = 2)
|
||||
volume = 60
|
||||
|
||||
/obj/item/integrated_circuit/reagent/storage/on_reagent_change()
|
||||
var/datum/integrated_io/A = outputs[1]
|
||||
A.data = reagents.total_volume
|
||||
A.push_data()
|
||||
set_pin_data(IC_OUTPUT, 1, reagents.total_volume)
|
||||
push_data()
|
||||
|
||||
/obj/item/integrated_circuit/reagent/storage/cryo
|
||||
name = "cryo reagent storage"
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
cannot see the target, it will not be able to calculate the correct direction."
|
||||
icon_state = "numberpad"
|
||||
complexity = 25
|
||||
inputs = list("\<REF\> target")
|
||||
outputs = list("\<NUM\> dir")
|
||||
activators = list("calculate dir" = 1, "on calculated" = 0)
|
||||
inputs = list("target" = IC_PINTYPE_REF)
|
||||
outputs = list("dir" = IC_PINTYPE_DIR)
|
||||
activators = list("calculate dir" = IC_PINTYPE_PULSE_IN, "on calculated" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_DATA = 5)
|
||||
power_draw_per_use = 40
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
This circuit is set to send a pulse after a delay of two seconds."
|
||||
icon_state = "delay-20"
|
||||
var/delay = 2 SECONDS
|
||||
activators = list("incoming"= 1,"outgoing" = 0)
|
||||
activators = list("incoming"= IC_PINTYPE_PULSE_IN,"outgoing" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 2
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
desc = "This sends a pulse signal out after a delay, critical for ensuring proper control flow in a complex machine. \
|
||||
This circuit's delay can be customized, between 1/10th of a second to one hour. The delay is updated upon receiving a pulse."
|
||||
icon_state = "delay"
|
||||
inputs = list("\<NUM\> delay time")
|
||||
inputs = list("delay time" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/time/delay/custom/do_work()
|
||||
@@ -78,8 +78,8 @@
|
||||
var/ticks_to_pulse = 4
|
||||
var/ticks_completed = 0
|
||||
var/is_running = FALSE
|
||||
inputs = list("\<NUM\> enable ticking" = 0)
|
||||
activators = list("outgoing pulse" = 0)
|
||||
inputs = list("enable ticking" = IC_PINTYPE_BOOLEAN)
|
||||
activators = list("outgoing pulse" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
@@ -131,8 +131,13 @@
|
||||
desc = "Tells you what the local time is, specific to your station or planet."
|
||||
icon_state = "clock"
|
||||
inputs = list()
|
||||
outputs = list("\<TEXT\> time", "\<NUM\> hours", "\<NUM\> minutes", "\<NUM\> seconds")
|
||||
activators = list("get time" = 1,"on time got" = 0)
|
||||
outputs = list(
|
||||
"time" = IC_PINTYPE_STRING,
|
||||
"hours" = IC_PINTYPE_NUMBER,
|
||||
"minutes" = IC_PINTYPE_NUMBER,
|
||||
"seconds" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
activators = list("get time" = IC_PINTYPE_PULSE_IN, "on time got" = IC_PINTYPE_PULSE_OUT)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
power_draw_per_use = 4
|
||||
|
||||
|
||||
@@ -2,40 +2,35 @@
|
||||
/obj/item/integrated_circuit/trig
|
||||
complexity = 1
|
||||
inputs = list(
|
||||
"\<NUM\> A",
|
||||
"\<NUM\> B",
|
||||
"\<NUM\> C",
|
||||
"\<NUM\> D",
|
||||
"\<NUM\> E",
|
||||
"\<NUM\> F",
|
||||
"\<NUM\> G",
|
||||
"\<NUM\> H"
|
||||
"A" = IC_PINTYPE_NUMBER,
|
||||
"B" = IC_PINTYPE_NUMBER,
|
||||
"C" = IC_PINTYPE_NUMBER,
|
||||
"D" = IC_PINTYPE_NUMBER,
|
||||
"E" = IC_PINTYPE_NUMBER,
|
||||
"F" = IC_PINTYPE_NUMBER,
|
||||
"G" = IC_PINTYPE_NUMBER,
|
||||
"H" = IC_PINTYPE_NUMBER
|
||||
)
|
||||
outputs = list("\<NUM\> result")
|
||||
activators = list("compute" = 1, "on computed" = 0)
|
||||
outputs = list("result" = IC_PINTYPE_NUMBER)
|
||||
activators = list("compute" = IC_PINTYPE_PULSE_IN, "on computed" = IC_PINTYPE_PULSE_OUT)
|
||||
category_text = "Trig"
|
||||
extended_desc = "Input and output are in degrees."
|
||||
autopulse = 1
|
||||
power_draw_per_use = 1 // Still cheap math.
|
||||
|
||||
/obj/item/integrated_circuit/trig/on_data_written()
|
||||
if(autopulse == 1)
|
||||
check_then_do_work()
|
||||
|
||||
// Sine //
|
||||
|
||||
/obj/item/integrated_circuit/trig/sine
|
||||
name = "sin circuit"
|
||||
desc = "Has nothing to do with evil, unless you consider trigonometry to be evil. Outputs the sine of A."
|
||||
icon_state = "sine"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/sine/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = sin(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -48,14 +43,14 @@
|
||||
name = "cos circuit"
|
||||
desc = "Outputs the cosine of A."
|
||||
icon_state = "cosine"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/cosine/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = cos(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -68,14 +63,14 @@
|
||||
name = "tan circuit"
|
||||
desc = "Outputs the tangent of A. Guaranteed to not go on a tangent about its existance."
|
||||
icon_state = "tangent"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/tangent/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = Tan(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -88,14 +83,14 @@
|
||||
name = "csc circuit"
|
||||
desc = "Outputs the cosecant of A."
|
||||
icon_state = "cosecant"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/cosecant/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = Csc(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -109,14 +104,14 @@
|
||||
name = "sec circuit"
|
||||
desc = "Outputs the secant of A. Has nothing to do with the security department."
|
||||
icon_state = "secant"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/secant/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = Sec(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
@@ -130,14 +125,14 @@
|
||||
name = "cot circuit"
|
||||
desc = "Outputs the cotangent of A."
|
||||
icon_state = "cotangent"
|
||||
inputs = list("\<NUM\> A")
|
||||
inputs = list("A" = IC_PINTYPE_NUMBER)
|
||||
spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH
|
||||
|
||||
/obj/item/integrated_circuit/trig/cotangent/do_work()
|
||||
pull_data()
|
||||
var/result = null
|
||||
var/A = get_pin_data(IC_INPUT, 1)
|
||||
if(isnum(A))
|
||||
if(!isnull(A))
|
||||
result = Cot(A)
|
||||
|
||||
set_pin_data(IC_OUTPUT, 1, result)
|
||||
|
||||
@@ -8,9 +8,29 @@
|
||||
#undef IC_SPAWN_DEFAULT
|
||||
//#undef IC_SPAWN_RESEARCH // Research designs depend on this unfortunately.
|
||||
|
||||
#undef IC_FORMAT_ANY
|
||||
#undef IC_FORMAT_STRING
|
||||
#undef IC_FORMAT_CHAR
|
||||
#undef IC_FORMAT_COLOR
|
||||
#undef IC_FORMAT_NUMBER
|
||||
#undef IC_FORMAT_DIR
|
||||
#undef IC_FORMAT_BOOLEAN
|
||||
#undef IC_FORMAT_REF
|
||||
#undef IC_FORMAT_LIST
|
||||
#undef IC_FORMAT_ANY
|
||||
#undef IC_FORMAT_PULSE
|
||||
|
||||
#undef IC_FORMAT_PULSE
|
||||
|
||||
#undef IC_PINTYPE_ANY
|
||||
#undef IC_PINTYPE_STRING
|
||||
#undef IC_PINTYPE_CHAR
|
||||
#undef IC_PINTYPE_COLOR
|
||||
#undef IC_PINTYPE_NUMBER
|
||||
#undef IC_PINTYPE_DIR
|
||||
#undef IC_PINTYPE_BOOLEAN
|
||||
#undef IC_PINTYPE_REF
|
||||
#undef IC_PINTYPE_LIST
|
||||
|
||||
#undef IC_PINTYPE_PULSE_IN
|
||||
#undef IC_PINTYPE_PULSE_OUT
|
||||
|
||||
#undef IC_MAX_LIST_LENGTH
|
||||
@@ -67,7 +67,7 @@
|
||||
CC.update_icon()
|
||||
overlays = list()
|
||||
string_attached = null
|
||||
user << "\blue You detach the string from the coin."
|
||||
user << "<font color='blue'>You detach the string from the coin.</font>"
|
||||
else ..()
|
||||
|
||||
/obj/item/weapon/coin/attack_self(mob/user as mob)
|
||||
|
||||
@@ -134,12 +134,12 @@
|
||||
drill_verb = "drilling"
|
||||
|
||||
/obj/item/weapon/pickaxe/borgdrill
|
||||
name = "cyborg mining drill"
|
||||
icon_state = "diamonddrill"
|
||||
name = "enhanced sonic jackhammer"
|
||||
icon_state = "jackhammer"
|
||||
item_state = "jackhammer"
|
||||
digspeed = 15
|
||||
desc = ""
|
||||
drill_verb = "drilling"
|
||||
desc = "Cracks rocks with sonic blasts. This one seems like an improved design."
|
||||
drill_verb = "hammering"
|
||||
|
||||
/*****************************Shovel********************************/
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
usr.set_machine(src)
|
||||
src.add_fingerprint(usr)
|
||||
if(processing==1)
|
||||
usr << "\blue The machine is processing."
|
||||
usr << "<font color='blue'>The machine is processing.</font>"
|
||||
return
|
||||
if(href_list["choose"])
|
||||
chosen = href_list["choose"]
|
||||
|
||||
@@ -50,14 +50,14 @@
|
||||
..()
|
||||
if (istype(W, /obj/item/weapon/coin))
|
||||
var/obj/item/weapon/coin/C = W
|
||||
user << "\blue You add the [C.name] into the bag."
|
||||
user << "<font color='blue'>You add the [C.name] into the bag.</font>"
|
||||
usr.drop_item()
|
||||
contents += C
|
||||
if (istype(W, /obj/item/weapon/moneybag))
|
||||
var/obj/item/weapon/moneybag/C = W
|
||||
for (var/obj/O in C.contents)
|
||||
contents += O;
|
||||
user << "\blue You empty the [C.name] into the bag."
|
||||
user << "<font color='blue'>You empty the [C.name] into the bag.</font>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/moneybag/Topic(href, href_list)
|
||||
|
||||
@@ -32,7 +32,7 @@ var/global/list/image/ghost_sightless_images = list() //this is a list of images
|
||||
var/anonsay = 0
|
||||
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
|
||||
var/ghostvision = 1 //is the ghost able to see things humans can't?
|
||||
var/seedarkness = 1
|
||||
// var/seedarkness = 1
|
||||
incorporeal_move = 1
|
||||
|
||||
var/is_manifest = 0 //If set to 1, the ghost is able to whisper. Usually only set if a cultist drags them through the veil.
|
||||
@@ -298,10 +298,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return
|
||||
if(medHUD)
|
||||
medHUD = 0
|
||||
src << "\blue <B>Medical HUD Disabled</B>"
|
||||
src << "<font color='blue'><B>Medical HUD Disabled</B></font>"
|
||||
else
|
||||
medHUD = 1
|
||||
src << "\blue <B>Medical HUD Enabled</B>"
|
||||
src << "<font color='blue'><B>Medical HUD Enabled</B></font>"
|
||||
|
||||
/mob/observer/dead/verb/toggle_antagHUD()
|
||||
set category = "Ghost"
|
||||
@@ -312,11 +312,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
return
|
||||
var/mentor = is_mentor(usr.client)
|
||||
if(!config.antag_hud_allowed && (!client.holder || mentor))
|
||||
src << "\red Admins have disabled this for this round."
|
||||
src << "<font color='red'>Admins have disabled this for this round.</font>"
|
||||
return
|
||||
var/mob/observer/dead/M = src
|
||||
if(jobban_isbanned(M, "AntagHUD"))
|
||||
src << "\red <B>You have been banned from using this feature</B>"
|
||||
src << "<font color='red'><B>You have been banned from using this feature</B></font>"
|
||||
return
|
||||
if(config.antag_hud_restricted && !M.has_enabled_antagHUD && (!client.holder || mentor))
|
||||
var/response = alert(src, "If you turn this on, you will not be able to take any part in the round.","Are you sure you want to turn this feature on?","Yes","No")
|
||||
@@ -326,10 +326,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
M.has_enabled_antagHUD = 1
|
||||
if(M.antagHUD)
|
||||
M.antagHUD = 0
|
||||
src << "\blue <B>AntagHUD Disabled</B>"
|
||||
src << "<font color='blue'><B>AntagHUD Disabled</B></font>"
|
||||
else
|
||||
M.antagHUD = 1
|
||||
src << "\blue <B>AntagHUD Enabled</B>"
|
||||
src << "<font color='blue'><B>AntagHUD Enabled</B></font>"
|
||||
|
||||
/mob/observer/dead/proc/dead_tele(var/area/A in return_sorted_areas())
|
||||
set category = "Ghost"
|
||||
@@ -461,11 +461,11 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
|
||||
/mob/observer/dead/memory()
|
||||
set hidden = 1
|
||||
src << "\red You are dead! You have no mind to store memory!"
|
||||
src << "<font color='red'>You are dead! You have no mind to store memory!</font>"
|
||||
|
||||
/mob/observer/dead/add_memory()
|
||||
set hidden = 1
|
||||
src << "\red You are dead! You have no mind to store memory!"
|
||||
src << "<font color='red'>You are dead! You have no mind to store memory!</font>"
|
||||
|
||||
/mob/observer/dead/Post_Incorpmove()
|
||||
following = null
|
||||
@@ -485,16 +485,16 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles
|
||||
|
||||
src << "\blue <B>Results:</B>"
|
||||
src << "<font color='blue'><B>Results:</B></font>"
|
||||
if(abs(pressure - ONE_ATMOSPHERE) < 10)
|
||||
src << "\blue Pressure: [round(pressure,0.1)] kPa"
|
||||
src << "<font color='blue'>Pressure: [round(pressure,0.1)] kPa</font>"
|
||||
else
|
||||
src << "\red Pressure: [round(pressure,0.1)] kPa"
|
||||
src << "<font color='red'>Pressure: [round(pressure,0.1)] kPa</font>"
|
||||
if(total_moles)
|
||||
for(var/g in environment.gas)
|
||||
src << "\blue [gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)"
|
||||
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)"
|
||||
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"
|
||||
src << "<font color='blue'>[gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)</font>"
|
||||
src << "<font color='blue'>Temperature: [round(environment.temperature-T0C,0.1)]°C ([round(environment.temperature,0.1)]K)</font>"
|
||||
src << "<font color='blue'>Heat Capacity: [round(environment.heat_capacity(),0.1)]</font>"
|
||||
|
||||
/mob/observer/dead/verb/become_mouse()
|
||||
set name = "Become mouse"
|
||||
@@ -570,7 +570,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set desc = "If the round is sufficiently spooky, write a short message in blood on the floor or a wall. Remember, no IC in OOC or OOC in IC."
|
||||
|
||||
if(!(config.cult_ghostwriter))
|
||||
src << "\red That verb is not currently permitted."
|
||||
src << "<font color='red'>That verb is not currently permitted.</font>"
|
||||
return
|
||||
|
||||
if (!src.stat)
|
||||
@@ -635,7 +635,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
W.update_icon()
|
||||
W.message = message
|
||||
W.add_hiddenprint(src)
|
||||
W.visible_message("\red Invisible fingers crudely paint something in blood on [T]...")
|
||||
W.visible_message("<font color='red'>Invisible fingers crudely paint something in blood on [T]...</font>")
|
||||
|
||||
/mob/observer/dead/pointed(atom/A as mob|obj|turf in view())
|
||||
if(!..())
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
/obj/item/device/mmi/digital/attack_self(mob/user as mob)
|
||||
if(brainmob && !brainmob.key && searching == 0)
|
||||
//Start the process of searching for a new user.
|
||||
user << "\blue You carefully locate the manual activation switch and start the [src]'s boot process."
|
||||
user << "<font color='blue'>You carefully locate the manual activation switch and start the [src]'s boot process.</font>"
|
||||
src.searching = 1
|
||||
src.request_player()
|
||||
spawn(600) reset_search()
|
||||
@@ -256,7 +256,7 @@
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
|
||||
M.show_message("<font color='blue'>The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?</font>")
|
||||
|
||||
/obj/item/device/mmi/digital/proc/question(var/client/C)
|
||||
spawn(0)
|
||||
@@ -285,7 +285,7 @@
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The [src] chimes quietly.")
|
||||
M.show_message("<font color='blue'>The [src] chimes quietly.</font>")
|
||||
|
||||
/obj/item/device/mmi/digital/robot
|
||||
name = "robotic intelligence circuit"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/obj/item/device/mmi/digital/posibrain/attack_self(mob/user as mob)
|
||||
if(brainmob && !brainmob.key && searching == 0)
|
||||
//Start the process of searching for a new user.
|
||||
user << "\blue You carefully locate the manual activation switch and start the positronic brain's boot process."
|
||||
user << "<font color='blue'>You carefully locate the manual activation switch and start the positronic brain's boot process.</font>"
|
||||
icon_state = "posibrain-searching"
|
||||
src.searching = 1
|
||||
src.request_player()
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The positronic brain chimes quietly.")
|
||||
M.show_message("<font color='blue'>The positronic brain chimes quietly.</font>")
|
||||
icon_state = "posibrain-occupied"
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
|
||||
@@ -81,7 +81,7 @@
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
|
||||
M.show_message("<font color='blue'>The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?</font>")
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/examine(mob/user)
|
||||
if(!..(user))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
for(var/R in cures)
|
||||
if(H.reagents.has_reagent(R))
|
||||
if (cure_message)
|
||||
H <<"\blue [cure_message]"
|
||||
H <<"<font color='blue'>[cure_message]</font>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
for(var/R in cures)
|
||||
if(H.reagents.has_reagent(R))
|
||||
if (cure_message)
|
||||
H <<"\blue [cure_message]"
|
||||
H <<"<font color='blue'>[cure_message]</font>"
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
@@ -399,7 +399,7 @@ emp_act
|
||||
var/obj/item/organ/external/affecting = get_organ(zone)
|
||||
var/hit_area = affecting.name
|
||||
|
||||
src.visible_message("\red [src] has been hit in the [hit_area] by [O].")
|
||||
src.visible_message("<font color='red'>[src] has been hit in the [hit_area] by [O].</font>")
|
||||
|
||||
if(ismob(O.thrower))
|
||||
var/mob/M = O.thrower
|
||||
@@ -451,7 +451,7 @@ emp_act
|
||||
if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED)
|
||||
var/dir = get_dir(O.throw_source, src)
|
||||
|
||||
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
|
||||
visible_message("<font color='red'>[src] staggers under the impact!</font>","<font color='red'>You stagger under the impact!</font>")
|
||||
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
|
||||
|
||||
if(!O || !src) return
|
||||
|
||||
@@ -106,8 +106,8 @@
|
||||
var/msg = sanitize(input("Message:", "Psychic Whisper") as text|null)
|
||||
if(msg)
|
||||
log_say("PsychicWhisper: [key_name(src)]->[M.key] : [msg]")
|
||||
M << "\green You hear a strange, alien voice in your head... \italic [msg]"
|
||||
src << "\green You said: \"[msg]\" to [M]"
|
||||
M << "<font color='green'>You hear a strange, alien voice in your head... <i>[msg]</i></font>"
|
||||
src << "<font color='green'>You said: \"[msg]\" to [M]</font>"
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/diona_split_nymph()
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
h_style = "Teshari Default"
|
||||
..(new_loc, "Teshari")
|
||||
|
||||
/mob/living/carbon/human/promethean/New(var/new_loc)
|
||||
..(new_loc, "Promethean")
|
||||
|
||||
/mob/living/carbon/human/machine/New(var/new_loc)
|
||||
h_style = "blue IPC screen"
|
||||
..(new_loc, "Machine")
|
||||
|
||||
@@ -1128,10 +1128,16 @@
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
seer = 0
|
||||
|
||||
if(!seedarkness)
|
||||
sight = species.get_vision_flags(src)
|
||||
see_in_dark = 8
|
||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
|
||||
else
|
||||
sight = species.get_vision_flags(src)
|
||||
see_in_dark = species.darksight
|
||||
see_invisible = see_in_dark>2 ? SEE_INVISIBLE_LEVEL_ONE : SEE_INVISIBLE_LIVING
|
||||
|
||||
var/tmp/glasses_processed = 0
|
||||
var/obj/item/weapon/rig/rig = back
|
||||
if(istype(rig) && rig.visor)
|
||||
@@ -1150,7 +1156,7 @@
|
||||
|
||||
if(!glasses_processed && (species.get_vision_flags(src) > 0))
|
||||
sight |= species.get_vision_flags(src)
|
||||
if(!seer && !glasses_processed)
|
||||
if(!seer && !glasses_processed && seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_LIVING
|
||||
|
||||
if(healths)
|
||||
|
||||
@@ -14,7 +14,7 @@ var/datum/species/shapeshifter/promethean/prometheans
|
||||
blood_color = "#05FF9B"
|
||||
flesh_color = "#05FFFB"
|
||||
|
||||
hunger_factor = DEFAULT_HUNGER_FACTOR //todo
|
||||
hunger_factor = 0.2
|
||||
reagent_tag = IS_SLIME
|
||||
mob_size = MOB_SMALL
|
||||
bump_flag = SLIME
|
||||
@@ -31,27 +31,26 @@ var/datum/species/shapeshifter/promethean/prometheans
|
||||
male_cough_sounds = list('sound/effects/slime_squish.ogg')
|
||||
female_cough_sounds = list('sound/effects/slime_squish.ogg')
|
||||
|
||||
gluttonous = 1
|
||||
virus_immune = 1
|
||||
blood_volume = 560
|
||||
min_age = 1
|
||||
max_age = 5
|
||||
brute_mod = 0.5
|
||||
burn_mod = 2
|
||||
oxy_mod = 0
|
||||
total_health = 120
|
||||
gluttonous = 1
|
||||
virus_immune = 1
|
||||
blood_volume = 560
|
||||
min_age = 1
|
||||
max_age = 5
|
||||
brute_mod = 0.75
|
||||
burn_mod = 2
|
||||
oxy_mod = 0
|
||||
|
||||
cold_level_1 = 260
|
||||
cold_level_2 = 200
|
||||
cold_level_3 = 120
|
||||
cold_level_1 = 280 //Default 260 - Lower is better
|
||||
cold_level_2 = 220 //Default 200
|
||||
cold_level_3 = 130 //Default 120
|
||||
|
||||
heat_level_1 = 360
|
||||
heat_level_2 = 400
|
||||
heat_level_3 = 1000
|
||||
heat_level_1 = 320 //Default 360
|
||||
heat_level_2 = 370 //Default 400
|
||||
heat_level_3 = 600 //Default 1000
|
||||
|
||||
body_temperature = 310.15
|
||||
|
||||
siemens_coefficient = -1
|
||||
siemens_coefficient = 0.3
|
||||
rarity_value = 5
|
||||
|
||||
unarmed_types = list(/datum/unarmed_attack/slime_glomp)
|
||||
@@ -83,7 +82,7 @@ var/datum/species/shapeshifter/promethean/prometheans
|
||||
valid_transform_species = list("Human", "Unathi", "Tajara", "Skrell", "Diona", "Teshari", "Monkey")
|
||||
monochromatic = 1
|
||||
|
||||
var/heal_rate = 5 // Temp. Regen per tick.
|
||||
var/heal_rate = 0.5 // Temp. Regen per tick.
|
||||
|
||||
/datum/species/shapeshifter/promethean/New()
|
||||
..()
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
min_age = 32
|
||||
max_age = 260
|
||||
|
||||
blurb = "A heavily reptillian species, Unathi (or 'Sinta as they call themselves) hail from the \
|
||||
blurb = "A heavily reptillian species, Unathi hail from the \
|
||||
Uuosa-Eso system, which roughly translates to 'burning mother'.<br/><br/>Coming from a harsh, inhospitable \
|
||||
planet, they mostly hold ideals of honesty, virtue, proficiency and bravery above all \
|
||||
else, frequently even their own lives. They prefer warmer temperatures than most species and \
|
||||
@@ -319,6 +319,7 @@
|
||||
reagent_tag = IS_DIONA
|
||||
|
||||
genders = list(PLURAL)
|
||||
|
||||
/datum/species/diona/can_understand(var/mob/other)
|
||||
var/mob/living/carbon/alien/diona/D = other
|
||||
if(istype(D))
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
src << "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate. You can also set your face with: \n\nnomood, pout, sad, angry, frown, smile"
|
||||
|
||||
else
|
||||
src << "\blue Unusable emote '[act]'. Say *help for a list."
|
||||
src << "<font color='blue'>Unusable emote '[act]'. Say *help for a list.</font>"
|
||||
if ((message && src.stat == 0))
|
||||
if (m_type & 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
|
||||
@@ -179,6 +179,10 @@
|
||||
return
|
||||
|
||||
/mob/living/proc/update_sight()
|
||||
if(!seedarkness)
|
||||
see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
else
|
||||
see_invisible = initial(see_invisible)
|
||||
return
|
||||
|
||||
/mob/living/proc/handle_hud_icons()
|
||||
|
||||
@@ -153,7 +153,7 @@ default behaviour is:
|
||||
if ((src.health < 0 && src.health > (5-src.getMaxHealth()))) // Health below Zero but above 5-away-from-death, as before, but variable
|
||||
src.adjustOxyLoss(src.health + src.getMaxHealth() * 2) // Deal 2x health in OxyLoss damage, as before but variable.
|
||||
src.health = src.getMaxHealth() - src.getOxyLoss() - src.getToxLoss() - src.getFireLoss() - src.getBruteLoss()
|
||||
src << "\blue You have given up life and succumbed to death."
|
||||
src << "<font color='blue'>You have given up life and succumbed to death.</font>"
|
||||
|
||||
|
||||
/mob/living/proc/updatehealth()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
if (layer != 2.45)
|
||||
layer = 2.45 //Just above cables with their 2.44
|
||||
src << text("\blue You are now hiding.")
|
||||
src << text("<font color='blue'>You are now hiding.</font>")
|
||||
else
|
||||
layer = MOB_LAYER
|
||||
src << text("\blue You have stopped hiding.")
|
||||
src << text("<font color='blue'>You have stopped hiding.</font>")
|
||||
@@ -240,7 +240,7 @@
|
||||
if ("help")
|
||||
src << "salute, bow-(none)/mob, clap, flap, aflap, twitch, twitch_s, nod, deathgasp, glare-(none)/mob, stare-(none)/mob, look, beep, ping, \nbuzz, law, halt, yes, no"
|
||||
else
|
||||
src << "\blue Unusable emote '[act]'. Say *help for a list."
|
||||
src << "<font color='blue'>Unusable emote '[act]'. Say *help for a list.</font>"
|
||||
|
||||
if ((message && src.stat == 0))
|
||||
custom_emote(m_type,message)
|
||||
|
||||
@@ -172,6 +172,12 @@
|
||||
src.sight |= SEE_MOBS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
else if (!seedarkness)
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
src.sight &= ~SEE_OBJS
|
||||
src.see_in_dark = 8
|
||||
src.see_invisible = SEE_INVISIBLE_NOLIGHTING
|
||||
else if (src.stat != 2)
|
||||
src.sight &= ~SEE_MOBS
|
||||
src.sight &= ~SEE_TURFS
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
var/opened = 0
|
||||
var/emagged = 0
|
||||
var/emag_items = 0
|
||||
var/wiresexposed = 0
|
||||
var/locked = 1
|
||||
var/has_power = 1
|
||||
@@ -739,7 +740,7 @@
|
||||
dat += text("[obj]: <B>Activated</B><BR>")
|
||||
else
|
||||
dat += text("[obj]: <A HREF=?src=\ref[src];act=\ref[obj]>Activate</A><BR>")
|
||||
if (emagged)
|
||||
if (emagged || emag_items)
|
||||
if(activated(module.emag))
|
||||
dat += text("[module.emag]: <B>Activated</B><BR>")
|
||||
else
|
||||
@@ -1056,14 +1057,6 @@
|
||||
src << "<b>Obey these laws:</b>"
|
||||
laws.show_laws(src)
|
||||
src << "<span class='danger'>ALERT: [user.real_name] is your new master. Obey your new laws and his commands.</span>"
|
||||
if(src.module)
|
||||
var/rebuild = 0
|
||||
for(var/obj/item/weapon/pickaxe/borgdrill/D in src.module.modules)
|
||||
qdel(D)
|
||||
rebuild = 1
|
||||
if(rebuild)
|
||||
src.module.modules += new /obj/item/weapon/pickaxe/diamonddrill(src.module)
|
||||
src.module.rebuild()
|
||||
updateicon()
|
||||
else
|
||||
user << "You fail to hack [src]'s interface."
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
overlays += image("icon" = I.icon, "icon_state" = I.icon_state, "layer" = 30 + I.layer)
|
||||
addedSomething = 1
|
||||
if ( addedSomething )
|
||||
user.visible_message("\blue [user] load some items onto their service tray.")
|
||||
user.visible_message("<font color='blue'>[user] load some items onto their service tray.</font>")
|
||||
|
||||
return
|
||||
|
||||
@@ -206,9 +206,9 @@
|
||||
sleep(rand(2,4))
|
||||
if ( droppedSomething )
|
||||
if ( foundtable )
|
||||
user.visible_message("\blue [user] unloads their service tray.")
|
||||
user.visible_message("<font color='blue'>[user] unloads their service tray.</font>")
|
||||
else
|
||||
user.visible_message("\blue [user] drops all the items on their tray.")
|
||||
user.visible_message("<font color='blue'>[user] drops all the items on their tray.</font>")
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -288,7 +288,7 @@
|
||||
deploy_paper(get_turf(src))
|
||||
|
||||
/obj/item/weapon/form_printer/proc/deploy_paper(var/turf/T)
|
||||
T.visible_message("\blue \The [src.loc] dispenses a sheet of crisp white paper.")
|
||||
T.visible_message("<font color='blue'>\The [src.loc] dispenses a sheet of crisp white paper.</font>")
|
||||
new /obj/item/weapon/paper(T)
|
||||
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ var/global/list/robot_modules = list(
|
||||
"Basic" = "robot_old",
|
||||
"Android" = "droid",
|
||||
"Drone" = "drone-standard"
|
||||
)
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/standard/New()
|
||||
..()
|
||||
@@ -203,7 +203,8 @@ var/global/list/robot_modules = list(
|
||||
"Basic" = "Medbot",
|
||||
"Advanced Droid" = "droid-medical",
|
||||
"Needles" = "medicalrobot",
|
||||
"Drone" = "drone-surgery"
|
||||
"Drone" = "drone-surgery",
|
||||
"Handy" = "handy-med"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/medical/surgeon/New()
|
||||
@@ -339,7 +340,8 @@ var/global/list/robot_modules = list(
|
||||
"Landmate" = "landmate",
|
||||
"Landmate - Treaded" = "engiborg+tread",
|
||||
"Drone" = "drone-engineer",
|
||||
"Treadwell" = "treadwell"
|
||||
"Treadwell" = "treadwell",
|
||||
"Handy" = "handy-engineer"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/engineering/construction
|
||||
@@ -478,7 +480,7 @@ var/global/list/robot_modules = list(
|
||||
"Basic" = "secborg",
|
||||
"Black Knight" = "securityrobot",
|
||||
"Drone" = "drone-sec"
|
||||
)
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/security/general/New()
|
||||
..()
|
||||
@@ -682,6 +684,7 @@ var/global/list/robot_modules = list(
|
||||
src.modules += new /obj/item/weapon/gripper/miner(src)
|
||||
src.modules += new /obj/item/weapon/mining_scanner(src)
|
||||
src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src)
|
||||
src.emag = new /obj/item/weapon/pickaxe/diamonddrill(src)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/research
|
||||
name = "research module"
|
||||
@@ -693,7 +696,8 @@ var/global/list/robot_modules = list(
|
||||
"WTDove" = "whitespider",
|
||||
"WTOperator" = "sleekscience",
|
||||
"Droid" = "droid-science",
|
||||
"Drone" = "drone-science"
|
||||
"Drone" = "drone-science",
|
||||
"Handy" = "handy-science"
|
||||
)
|
||||
|
||||
/obj/item/weapon/robot_module/robot/research/New()
|
||||
|
||||
@@ -49,19 +49,16 @@
|
||||
for(var/mob/M in view())
|
||||
M << 'sound/effects/mousesqueek.ogg'
|
||||
|
||||
if(!ckey && stat == CONSCIOUS && prob(0.5))
|
||||
stat = UNCONSCIOUS
|
||||
icon_state = "mouse_[body_color]_sleep"
|
||||
wander = 0
|
||||
if(!resting && prob(0.5))
|
||||
lay_down()
|
||||
speak_chance = 0
|
||||
//snuffles
|
||||
|
||||
else if(stat == UNCONSCIOUS)
|
||||
if(ckey || prob(1))
|
||||
stat = CONSCIOUS
|
||||
icon_state = "mouse_[body_color]"
|
||||
wander = 1
|
||||
else if(prob(5))
|
||||
else if(resting)
|
||||
if(prob(1))
|
||||
lay_down()
|
||||
speak_chance = initial(speak_chance)
|
||||
else if(prob(1))
|
||||
audible_emote("snuffles.")
|
||||
|
||||
/mob/living/simple_animal/mouse/New()
|
||||
@@ -97,7 +94,7 @@
|
||||
if( ishuman(AM) )
|
||||
if(!stat)
|
||||
var/mob/M = AM
|
||||
M << "\blue \icon[src] Squeek!"
|
||||
M << "<font color='blue'>\icon[src] Squeek!</font>"
|
||||
M << 'sound/effects/mousesqueek.ogg'
|
||||
..()
|
||||
|
||||
|
||||
@@ -63,16 +63,16 @@
|
||||
if(host.reagents.has_reagent("sugar"))
|
||||
if(!docile)
|
||||
if(controlling)
|
||||
host << "\blue You feel the soporific flow of sugar in your host's blood, lulling you into docility."
|
||||
host << "<font color='blue'>You feel the soporific flow of sugar in your host's blood, lulling you into docility.</font>"
|
||||
else
|
||||
src << "\blue You feel the soporific flow of sugar in your host's blood, lulling you into docility."
|
||||
src << "<font color='blue'>You feel the soporific flow of sugar in your host's blood, lulling you into docility.</font>"
|
||||
docile = 1
|
||||
else
|
||||
if(docile)
|
||||
if(controlling)
|
||||
host << "\blue You shake off your lethargy as the sugar leaves your host's blood."
|
||||
host << "<font color='blue'>You shake off your lethargy as the sugar leaves your host's blood.</font>"
|
||||
else
|
||||
src << "\blue You shake off your lethargy as the sugar leaves your host's blood."
|
||||
src << "<font color='blue'>You shake off your lethargy as the sugar leaves your host's blood.</font>"
|
||||
docile = 0
|
||||
|
||||
if(chemicals < 250)
|
||||
@@ -80,7 +80,7 @@
|
||||
if(controlling)
|
||||
|
||||
if(docile)
|
||||
host << "\blue You are feeling far too docile to continue controlling your host..."
|
||||
host << "<font color='blue'>You are feeling far too docile to continue controlling your host...</font>"
|
||||
host.release_control()
|
||||
return
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
if (src.client)
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
src << "\red You cannot speak in IC (muted)."
|
||||
src << "<font color='red'>You cannot speak in IC (muted).</font>"
|
||||
return
|
||||
|
||||
if(istype(src.loc,/mob/living/simple_animal/borer))
|
||||
|
||||
@@ -210,3 +210,5 @@
|
||||
var/list/active_genes=list()
|
||||
var/mob_size = MOB_MEDIUM
|
||||
var/forbid_seeing_deadchat = FALSE // Used for lings to not see deadchat, and to have ghosting behave as if they were not really dead.
|
||||
|
||||
var/seedarkness = 1 //Determines mob's ability to see shadows. 1 = Normal vision, 0 = darkvision
|
||||
@@ -53,19 +53,19 @@
|
||||
|
||||
/obj/item/organ/external/arm/unbreakable/slime
|
||||
nonsolid = 1
|
||||
max_damage = 15
|
||||
max_damage = 5
|
||||
|
||||
/obj/item/organ/external/arm/right/unbreakable/slime
|
||||
nonsolid = 1
|
||||
max_damage = 15
|
||||
max_damage = 5
|
||||
|
||||
/obj/item/organ/external/leg/unbreakable/slime
|
||||
nonsolid = 1
|
||||
max_damage = 15
|
||||
max_damage = 5
|
||||
|
||||
/obj/item/organ/external/leg/right/unbreakable/slime
|
||||
nonsolid = 1
|
||||
max_damage = 15
|
||||
max_damage = 5
|
||||
|
||||
/obj/item/organ/external/foot/unbreakable/slime
|
||||
nonsolid = 1
|
||||
@@ -85,4 +85,4 @@
|
||||
|
||||
/obj/item/organ/external/head/unbreakable/slime
|
||||
nonsolid = 1
|
||||
max_damage = 15
|
||||
max_damage = 5
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
if(!ismob(M))
|
||||
return
|
||||
user << "<span class='warning'>You stab [M] with the pen.</span>"
|
||||
// M << "\red You feel a tiny prick!" //That's a whole lot of meta!
|
||||
// M << "<font color='red'>You feel a tiny prick!</font>" //That's a whole lot of meta!
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stabbed with [name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to stab [M.name] ([M.ckey])</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
@@ -197,7 +197,7 @@
|
||||
var/colourName = "red" //for updateIcon purposes
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is jamming the [src.name] up \his nose and into \his brain. It looks like \he's trying to commit suicide.</b>"
|
||||
viewers(user) << "<font color='red'><b>[user] is jamming the [src.name] up \his nose and into \his brain. It looks like \he's trying to commit suicide.</b></font>"
|
||||
return (BRUTELOSS|OXYLOSS)
|
||||
|
||||
New()
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
usr << "\blue These cables are too tough to be cut with those [W.name]."
|
||||
usr << "<font color='blue'>These cables are too tough to be cut with those [W.name].</font>"
|
||||
return
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
usr << "\blue You will need heavier cables to connect to these."
|
||||
usr << "<font color='blue'>You will need heavier cables to connect to these.</font>"
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
/obj/machinery/power/fractal_reactor/New()
|
||||
..()
|
||||
if(!mapped_in)
|
||||
world << "<b><font color='red'>WARNING: \black Map testing power source activated at: X:[src.loc.x] Y:[src.loc.y] Z:[src.loc.z]</font></b>"
|
||||
world << "<b><font color='red'>WARNING:</font><font color='black'> Map testing power source activated at: X:[src.loc.x] Y:[src.loc.y] Z:[src.loc.z]</font></b>"
|
||||
|
||||
/obj/machinery/power/fractal_reactor/process()
|
||||
if(!powernet && !powernet_connection_failed)
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
/obj/item/weapon/circuitboard/fusion_fuel_compressor
|
||||
name = "circuit board (fusion fuel compressor)"
|
||||
build_path = /obj/machinery/fusion_fuel_compressor
|
||||
board_type = "machine"
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 4, TECH_MATERIAL = 4)
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/manipulator/pico = 2,
|
||||
/obj/item/weapon/stock_parts/manipulator/nano = 2,
|
||||
/obj/item/weapon/stock_parts/matter_bin/super = 2,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/stack/cable_coil = 5
|
||||
@@ -28,12 +28,11 @@
|
||||
/obj/item/weapon/circuitboard/fusion_core
|
||||
name = "internal circuitry (fusion core)"
|
||||
build_path = /obj/machinery/power/fusion_core
|
||||
board_type = "machine"
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_BLUESPACE = 2, TECH_MAGNET = 4, TECH_POWER = 4)
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/manipulator/pico = 2,
|
||||
/obj/item/weapon/stock_parts/micro_laser/ultra = 1,
|
||||
/obj/item/weapon/stock_parts/subspace/crystal = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator/nano = 2,
|
||||
/obj/item/weapon/stock_parts/micro_laser/high = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/stack/cable_coil = 5
|
||||
)
|
||||
@@ -41,16 +40,27 @@
|
||||
/obj/item/weapon/circuitboard/fusion_injector
|
||||
name = "internal circuitry (fusion fuel injector)"
|
||||
build_path = /obj/machinery/fusion_fuel_injector
|
||||
board_type = "machine"
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_POWER = 3, TECH_ENGINEERING = 4, TECH_MATERIAL = 4)
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/manipulator/pico = 2,
|
||||
/obj/item/weapon/stock_parts/scanning_module/phasic = 1,
|
||||
/obj/item/weapon/stock_parts/manipulator/nano = 2,
|
||||
/obj/item/weapon/stock_parts/scanning_module/adv = 1,
|
||||
/obj/item/weapon/stock_parts/matter_bin/super = 1,
|
||||
/obj/item/weapon/stock_parts/console_screen = 1,
|
||||
/obj/item/stack/cable_coil = 5
|
||||
)
|
||||
|
||||
/obj/item/weapon/circuitboard/gyrotron
|
||||
name = "circuit board (gyrotron)"
|
||||
build_path = /obj/machinery/power/emitter/gyrotron
|
||||
board_type = new /datum/frame/frame_types/machine
|
||||
origin_tech = list(TECH_POWER = 4, TECH_ENGINEERING = 4, TECH_MATERIAL = 5, TECH_MAGNET = 3)
|
||||
req_components = list(
|
||||
/obj/item/weapon/stock_parts/scanning_module/adv = 1,
|
||||
/obj/item/weapon/stock_parts/micro_laser/high = 3,
|
||||
/obj/item/weapon/stock_parts/capacitor/adv = 1
|
||||
)
|
||||
|
||||
/datum/design/circuit/fusion
|
||||
name = "fusion core control console"
|
||||
id = "fusion_core_control"
|
||||
|
||||
@@ -54,7 +54,7 @@ var/global/list/rad_collectors = list()
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [user.key]. [P?"Fuel: [round(P.air_contents.gas["phoron"]/0.29)]%":"<font color='red'>It is empty</font>"].","singulo")
|
||||
return
|
||||
else
|
||||
user << "\red The controls are locked!"
|
||||
user << "<font color='red'>The controls are locked!</font>"
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -62,10 +62,10 @@ var/global/list/rad_collectors = list()
|
||||
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/weapon/tank/phoron))
|
||||
if(!src.anchored)
|
||||
user << "\red The [src] needs to be secured to the floor first."
|
||||
user << "<font color='red'>The [src] needs to be secured to the floor first.</font>"
|
||||
return 1
|
||||
if(src.P)
|
||||
user << "\red There's already a phoron tank loaded."
|
||||
user << "<font color='red'>There's already a phoron tank loaded.</font>"
|
||||
return 1
|
||||
user.drop_item()
|
||||
src.P = W
|
||||
@@ -78,7 +78,7 @@ var/global/list/rad_collectors = list()
|
||||
return 1
|
||||
else if(istype(W, /obj/item/weapon/wrench))
|
||||
if(P)
|
||||
user << "\blue Remove the phoron tank first."
|
||||
user << "<font color='blue'>Remove the phoron tank first.</font>"
|
||||
return 1
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
|
||||
src.anchored = !src.anchored
|
||||
@@ -97,9 +97,9 @@ var/global/list/rad_collectors = list()
|
||||
user << "The controls are now [src.locked ? "locked." : "unlocked."]"
|
||||
else
|
||||
src.locked = 0 //just in case it somehow gets locked
|
||||
user << "\red The controls can only be locked when the [src] is active"
|
||||
user << "<font color='red'>The controls can only be locked when the [src] is active.</font>"
|
||||
else
|
||||
user << "\red Access denied!"
|
||||
user << "<font color='red'>Access denied!</font>"
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
var/radiation = (energy*2)
|
||||
M.apply_effect((radiation*3),IRRADIATE,0)
|
||||
M.updatehealth()
|
||||
//M << "\red You feel odd."
|
||||
//M << "<font color='red'>You feel odd.</font>"
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@
|
||||
if(src.z in using_map.station_levels)
|
||||
if(prob(1)) //explosion
|
||||
for(var/mob/M in viewers(src))
|
||||
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
|
||||
M.show_message("<font color='red'>The [src.name] is making strange noises!</font>", 3, "<font color='red'>You hear sizzling electronics.</font>", 2)
|
||||
sleep(10*pick(4,5,6,7,10,14))
|
||||
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
|
||||
smoke.set_up(3, 0, src.loc)
|
||||
|
||||
@@ -407,7 +407,7 @@ var/list/solars_list = list()
|
||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
user << "<font color='blue'>The broken glass falls out.</font>"
|
||||
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
|
||||
new /obj/item/weapon/material/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
|
||||
@@ -420,7 +420,7 @@ var/list/solars_list = list()
|
||||
A.anchored = 1
|
||||
qdel(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
user << "<font color='blue'>You disconnect the monitor.</font>"
|
||||
var/obj/structure/frame/A = new /obj/structure/frame( src.loc )
|
||||
var/obj/item/weapon/circuitboard/solar_control/M = new /obj/item/weapon/circuitboard/solar_control( A )
|
||||
for (var/obj/C in src)
|
||||
|
||||
@@ -32,13 +32,14 @@
|
||||
//var/list/icon_keys = list() //keys
|
||||
//var/list/ammo_states = list() //values
|
||||
|
||||
/obj/item/weapon/gun/projectile/New()
|
||||
/obj/item/weapon/gun/projectile/New(loc, var/starts_loaded = 1)
|
||||
..()
|
||||
if(ispath(ammo_type) && (load_method & (SINGLE_CASING|SPEEDLOADER)))
|
||||
for(var/i in 1 to max_shells)
|
||||
loaded += new ammo_type(src)
|
||||
if(ispath(magazine_type) && (load_method & MAGAZINE))
|
||||
ammo_magazine = new magazine_type(src)
|
||||
if(starts_loaded)
|
||||
if(ispath(ammo_type) && (load_method & (SINGLE_CASING|SPEEDLOADER)))
|
||||
for(var/i in 1 to max_shells)
|
||||
loaded += new ammo_type(src)
|
||||
if(ispath(magazine_type) && (load_method & MAGAZINE))
|
||||
ammo_magazine = new magazine_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/projectile/consume_next_projectile()
|
||||
|
||||
@@ -96,25 +96,25 @@
|
||||
// return
|
||||
..()
|
||||
if (beakers.len)
|
||||
user << "\blue [src] contains:"
|
||||
user << "<font color='blue'>[src] contains:</font>"
|
||||
for(var/obj/item/weapon/reagent_containers/glass/beaker/B in beakers)
|
||||
if(B.reagents && B.reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in B.reagents.reagent_list)
|
||||
user << "\blue [R.volume] units of [R.name]"
|
||||
user << "<font color='blue'>[R.volume] units of [R.name]</font>"
|
||||
|
||||
/obj/item/weapon/gun/projectile/dartgun/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/reagent_containers/glass))
|
||||
if(!istype(I, container_type))
|
||||
user << "\blue [I] doesn't seem to fit into [src]."
|
||||
user << "<font color='blue'>[I] doesn't seem to fit into [src].</font>"
|
||||
return
|
||||
if(beakers.len >= max_beakers)
|
||||
user << "\blue [src] already has [max_beakers] beakers in it - another one isn't going to fit!"
|
||||
user << "<font color='blue'>[src] already has [max_beakers] beakers in it - another one isn't going to fit!</font>"
|
||||
return
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/B = I
|
||||
user.drop_item()
|
||||
B.loc = src
|
||||
beakers += B
|
||||
user << "\blue You slot [B] into [src]."
|
||||
user << "<font color='blue'>You slot [B] into [src].</font>"
|
||||
src.updateUsrDialog()
|
||||
return 1
|
||||
..()
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
////////////// PTR-7 Anti-Materiel Rifle //////////////
|
||||
|
||||
/obj/item/weapon/gun/projectile/heavysniper/collapsible
|
||||
|
||||
/obj/item/weapon/gun/projectile/heavysniper/collapsible/verb/take_down()
|
||||
set category = "Object"
|
||||
set name = "Disassemble Rifle"
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if(user.stat)
|
||||
return
|
||||
|
||||
if(chambered)
|
||||
to_chat(user, "<span class='warning'>You need to empty the rifle to break it down.</span>")
|
||||
else
|
||||
collapse_rifle(user)
|
||||
|
||||
/obj/item/weapon/gun/projectile/heavysniper/proc/collapse_rifle(mob/user)
|
||||
to_chat(user, "<span class='warning'>You begin removing \the [src]'s barrel.</span>")
|
||||
if(do_after(user, 40))
|
||||
if(user.unEquip(src, force=1))
|
||||
to_chat(user, "<span class='warning'>You remove \the [src]'s barrel.</span>")
|
||||
qdel(src)
|
||||
var/obj/item/barrel = new /obj/item/sniper_rifle_part/barrel(user)
|
||||
var/obj/item/sniper_rifle_part/assembly = new /obj/item/sniper_rifle_part/trigger_group(user)
|
||||
var/obj/item/sniper_rifle_part/stock/stock = new(assembly)
|
||||
assembly.stock = stock
|
||||
assembly.part_count = 2
|
||||
assembly.update_build()
|
||||
user.put_in_any_hand_if_possible(assembly) || assembly.dropInto(user.loc)
|
||||
user.put_in_any_hand_if_possible(barrel) || barrel.dropInto(user.loc)
|
||||
|
||||
|
||||
/obj/item/sniper_rifle_part
|
||||
name = "AM rifle part"
|
||||
desc = "A part of an antimateriel rifle."
|
||||
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
|
||||
var/obj/item/sniper_rifle_part/barrel = null
|
||||
var/obj/item/sniper_rifle_part/stock = null
|
||||
var/obj/item/sniper_rifle_part/trigger_group = null
|
||||
var/part_count = 1
|
||||
|
||||
|
||||
/obj/item/sniper_rifle_part/barrel
|
||||
name = "AM rifle barrel"
|
||||
icon_state = "heavysniper-barrel"
|
||||
|
||||
/obj/item/sniper_rifle_part/barrel/New()
|
||||
..()
|
||||
barrel = src
|
||||
|
||||
/obj/item/sniper_rifle_part/stock
|
||||
name = "AM rifle stock"
|
||||
icon_state = "heavysniper-stock"
|
||||
|
||||
/obj/item/sniper_rifle_part/stock/New()
|
||||
..()
|
||||
stock = src
|
||||
|
||||
/obj/item/sniper_rifle_part/trigger_group
|
||||
name = "AM rifle trigger assembly"
|
||||
icon_state = "heavysniper-trig"
|
||||
|
||||
/obj/item/sniper_rifle_part/trigger_group/New()
|
||||
..()
|
||||
trigger_group = src
|
||||
|
||||
/obj/item/sniper_rifle_part/attack_self(mob/user as mob)
|
||||
if(part_count == 1)
|
||||
to_chat(user, "<span class='warning'>You can't disassemble this further!</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You start disassembling \the [src].</span>")
|
||||
if(!do_after(user, 40))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You disassemble \the [src].</span>")
|
||||
for(var/obj/item/sniper_rifle_part/P in list(barrel, stock, trigger_group))
|
||||
if(P.barrel != P)
|
||||
P.barrel = null
|
||||
if(P.stock != P)
|
||||
P.stock = null
|
||||
if(P.trigger_group != P)
|
||||
P.trigger_group = null
|
||||
if(P != src)
|
||||
user.put_in_any_hand_if_possible(P) || P.dropInto(loc)
|
||||
P.part_count = 1
|
||||
|
||||
update_build()
|
||||
|
||||
/obj/item/sniper_rifle_part/attackby(var/obj/item/sniper_rifle_part/A as obj, mob/user as mob)
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin adding \the [A] to \the [src].</span>")
|
||||
if(!do_after(user, 30))
|
||||
return
|
||||
|
||||
|
||||
|
||||
if(istype(A, /obj/item/sniper_rifle_part/trigger_group))
|
||||
if(A.part_count > 1 && src.part_count > 1)
|
||||
to_chat(user, "<span class='warning'>Disassemble one of these parts first!</span>")
|
||||
return
|
||||
|
||||
if(!trigger_group)
|
||||
if(user.unEquip(A, force=1))
|
||||
trigger_group = A
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a trigger group!</span>")
|
||||
return
|
||||
|
||||
else if(istype(A, /obj/item/sniper_rifle_part/barrel))
|
||||
if(!barrel)
|
||||
if(user.unEquip(A, force=1))
|
||||
barrel = A
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a barrel!</span>")
|
||||
return
|
||||
|
||||
else if(istype(A, /obj/item/sniper_rifle_part/stock))
|
||||
if(!stock)
|
||||
if(user.unEquip(A, force=1))
|
||||
stock = A
|
||||
else
|
||||
to_chat(user, "<span class='warning'>There's already a stock!</span>")
|
||||
return
|
||||
|
||||
A.forceMove(src)
|
||||
to_chat(user, "<span class='notice'>You install \the [A].</span>")
|
||||
|
||||
if(A.barrel && !src.barrel)
|
||||
src.barrel = A.barrel
|
||||
if(A.stock && !src.stock)
|
||||
src.stock = A.stock
|
||||
if(A.trigger_group && !src.trigger_group)
|
||||
src.trigger_group = A.trigger_group
|
||||
|
||||
|
||||
part_count = A.part_count + src.part_count
|
||||
update_build(user)
|
||||
|
||||
|
||||
/obj/item/sniper_rifle_part/proc/update_build()
|
||||
switch(part_count)
|
||||
if(1)
|
||||
name = initial(name)
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
icon_state = initial(icon_state)
|
||||
if(2)
|
||||
if(barrel && trigger_group)
|
||||
name = "AM rifle barrel-trigger assembly"
|
||||
icon_state = "heavysniper-trigbar"
|
||||
else if(stock && trigger_group)
|
||||
name = "AM rifle stock-trigger assembly"
|
||||
icon_state = "heavysniper-trigstock"
|
||||
else if(stock && barrel)
|
||||
name = "AM rifle stock-barrel assembly"
|
||||
icon_state = "heavysniper-barstock"
|
||||
w_class = ITEMSIZE_LARGE
|
||||
|
||||
if(3)
|
||||
var/obj/item/weapon/gun/projectile/heavysniper/collapsible/gun = new (get_turf(src), 0)
|
||||
if(usr && istype(usr, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/user = usr
|
||||
user.unEquip(src, force=1)
|
||||
user.put_in_any_hand_if_possible(gun) || gun.dropInto(loc)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/gun/projectile/heavysniper/update_icon()
|
||||
if(bolt_open)
|
||||
icon_state = "heavysniper-open"
|
||||
else
|
||||
icon_state = "heavysniper"
|
||||
@@ -258,7 +258,7 @@
|
||||
|
||||
/datum/reagent/oxycodone/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
M.add_chemical_effect(CE_PAINKILLER, 200)
|
||||
M.eye_blurry += 10
|
||||
M.eye_blurry = min(M.eye_blurry + 10, 250)
|
||||
M.Confuse(5)
|
||||
|
||||
/datum/reagent/oxycodone/overdose(var/mob/living/carbon/M, var/alien)
|
||||
@@ -291,6 +291,23 @@
|
||||
M.adjustToxLoss(5 * removed) // It used to be incredibly deadly due to an oversight. Not anymore!
|
||||
M.add_chemical_effect(CE_PAINKILLER, 20)
|
||||
|
||||
/datum/reagent/hyperzine
|
||||
name = "Hyperzine"
|
||||
id = "hyperzine"
|
||||
description = "Hyperzine is a highly effective, long lasting, muscle stimulant."
|
||||
taste_description = "bitterness"
|
||||
reagent_state = LIQUID
|
||||
color = "#FF3300"
|
||||
overdose = REAGENTS_OVERDOSE * 0.5
|
||||
|
||||
/datum/reagent/hyperzine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
if(alien == IS_TAJARA)
|
||||
removed *= 1.25
|
||||
..()
|
||||
if(prob(5))
|
||||
M.emote(pick("twitch", "blink_r", "shiver"))
|
||||
M.add_chemical_effect(CE_SPEEDBOOST, 1)
|
||||
|
||||
/datum/reagent/alkysine
|
||||
name = "Alkysine"
|
||||
id = "alkysine"
|
||||
@@ -352,7 +369,7 @@
|
||||
I.damage = max(I.damage - removed, 0)
|
||||
H.Confuse(5)
|
||||
if(I.damage <= 5 && I.organ_tag == O_EYES)
|
||||
H.eye_blurry += 10 //Eyes need to reset, or something
|
||||
H.eye_blurry = min(M.eye_blurry + 10, 250) //Eyes need to reset, or something
|
||||
H.sdisabilities &= ~BLIND
|
||||
|
||||
/datum/reagent/osteodaxon
|
||||
@@ -391,7 +408,7 @@
|
||||
/datum/reagent/myelamine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
if(alien == IS_DIONA)
|
||||
return
|
||||
M.eye_blurry += (repair_strength * removed)
|
||||
M.eye_blurry += min(M.eye_blurry + (repair_strength * removed), 250)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/wound_heal = removed * repair_strength
|
||||
|
||||
@@ -128,24 +128,6 @@
|
||||
M.adjustOxyLoss(20 * removed)
|
||||
M.sleeping += 1
|
||||
|
||||
/datum/reagent/toxin/hyperzine
|
||||
name = "Hyperzine"
|
||||
id = "hyperzine"
|
||||
description = "Hyperzine is a highly effective, long lasting, muscle stimulant."
|
||||
taste_description = "bitterness"
|
||||
reagent_state = LIQUID
|
||||
color = "#FF3300"
|
||||
overdose = REAGENTS_OVERDOSE * 0.5
|
||||
strength = 2
|
||||
|
||||
/datum/reagent/toxin/hyperzine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
if(alien == IS_TAJARA)
|
||||
removed *= 1.25
|
||||
..()
|
||||
if(prob(5))
|
||||
M.emote(pick("twitch", "blink_r", "shiver"))
|
||||
M.add_chemical_effect(CE_SPEEDBOOST, 1)
|
||||
|
||||
/datum/reagent/toxin/stimm //Homemade Hyperzine
|
||||
name = "Stimm"
|
||||
id = "stimm"
|
||||
|
||||
@@ -1595,6 +1595,24 @@ CIRCUITS BELOW
|
||||
build_path = /obj/item/device/assembly/electronic_assembly
|
||||
sort_string = "VCAAF"
|
||||
|
||||
/datum/design/item/custom_circuit_printer
|
||||
name = "Portable integrated circuit printer"
|
||||
desc = "A portable(ish) printer for modular machines."
|
||||
id = "ic_printer"
|
||||
req_tech = list(TECH_MATERIAL = 3, TECH_ENGINEERING = 4, TECH_DATA = 5)
|
||||
materials = list(DEFAULT_WALL_MATERIAL = 10000)
|
||||
build_path = /obj/item/device/integrated_circuit_printer
|
||||
sort_string = "VCAAG"
|
||||
|
||||
/datum/design/item/custom_circuit_printer
|
||||
name = "Integrated circuit printer upgrade - advanced designs"
|
||||
desc = "Allows the integrated circuit printer to create advanced circuits"
|
||||
id = "ic_printer_upgrade_adv"
|
||||
req_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 4)
|
||||
materials = list(DEFAULT_WALL_MATERIAL = 2000)
|
||||
build_path = /obj/item/weapon/disk/integrated_circuit/upgrade/advanced
|
||||
sort_string = "VCAAH"
|
||||
|
||||
/datum/design/item/translator
|
||||
name = "handheld translator"
|
||||
id = "translator"
|
||||
|
||||
@@ -136,7 +136,7 @@ var/global/list/obj/machinery/message_server/message_servers = list()
|
||||
|
||||
|
||||
/obj/machinery/message_server/attack_hand(user as mob)
|
||||
// user << "\blue There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays."
|
||||
// user << "<font color='blue'>There seem to be some parts missing from this server. They should arrive on the station in a few days, give or take a few CentCom delays.</font>"
|
||||
user << "You toggle PDA message passing from [active ? "On" : "Off"] to [active ? "Off" : "On"]"
|
||||
active = !active
|
||||
update_icon()
|
||||
|
||||
@@ -54,7 +54,7 @@ research holder datum.
|
||||
known_tech += new T(src)
|
||||
for(var/D in typesof(/datum/design) - /datum/design)
|
||||
possible_designs += new D(src)
|
||||
generate_integrated_circuit_designs()
|
||||
// generate_integrated_circuit_designs()
|
||||
RefreshResearch()
|
||||
|
||||
/datum/research/techonly
|
||||
@@ -129,7 +129,7 @@ research holder datum.
|
||||
var/datum/tech/check_tech = T
|
||||
if(initial(check_tech.id) == ID)
|
||||
return initial(check_tech.name)
|
||||
|
||||
/*
|
||||
/datum/research/proc/generate_integrated_circuit_designs()
|
||||
spawn(2 SECONDS) // So the list has time to initialize.
|
||||
for(var/obj/item/integrated_circuit/IC in all_integrated_circuits)
|
||||
@@ -143,6 +143,7 @@ research holder datum.
|
||||
D.req_tech = list(TECH_ENGINEERING = 2, TECH_DATA = 2)
|
||||
D.build_path = IC.type
|
||||
possible_designs += D
|
||||
*/
|
||||
|
||||
/***************************************************************
|
||||
** Technology Datums **
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
feedback_inc("alert_keycard_auth_maintRevoke",1)
|
||||
if("Emergency Response Team")
|
||||
if(is_ert_blocked())
|
||||
usr << "\red All emergency response teams are dispatched and can not be called at this time."
|
||||
usr << "<font color='red'>All emergency response teams are dispatched and can not be called at this time.</font>"
|
||||
return
|
||||
|
||||
trigger_armed_response_team(1)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user