Just some general cleanup

Moved the spacecraft folder into the unused section, moved syndiebeacon into machinery.
Research moved into Modules.
Virus2 moved into WIP - is anyone even working on this, it looks almost done?
Computer2,optics,pda2,experimental moved unto unused.
WIP Chemistry things moved into Chemical Module
Cameras.dm moved into weapons
GameKit.dm moved into unused
BrokenInHands.dm moved into unused
Removed Grillify.dm
Moved all of the files listed as unused in the mining module to unused
Removed several empty folders in modules
Moved cloning.dm into machinery
Moved NewBan.dm into admin
Changed humanoid aliens new_life.dm into life.dm
Moved beast mob into unused
Moved hivebot into unused
Moved carpedexplosion.dm into unused
Moved ai_lockdown.dm verb into unused and removed it from the AIs verb list as it didn't actually do anything.
Removed mastercontroler2.dm
Moved savefile.dm from human to new_player

Bugfix
People spawning on the starting screen on rev/cult should be fixed.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1964 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
mport2004@gmail.com
2011-07-31 21:31:00 +00:00
parent ce470a81ba
commit 2224916ab9
94 changed files with 608 additions and 1126 deletions
+24
View File
@@ -0,0 +1,24 @@
/mob/living/silicon/hivebot/death(gibbed)
if(src.mainframe)
src.mainframe.return_to(src)
src.stat = 2
src.canmove = 0
if(src.blind)
src.blind.layer = 0
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
src.updateicon()
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
store_memory("Time of death: [tod]", 0)
if (src.key)
spawn(50)
if(src.key && src.stat == 2)
src.verbs += /mob/proc/ghost
return ..(gibbed)
+140
View File
@@ -0,0 +1,140 @@
/mob/living/silicon/hivebot/emote(var/act)
var/param = null
if (findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
var/m_type = 1
var/message
switch(act)
if ("salute")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> salutes to [param]."
else
message = "<B>[src]</b> salutes."
m_type = 1
if ("bow")
if (!src.buckled)
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> bows to [param]."
else
message = "<B>[src]</B> bows."
m_type = 1
if ("clap")
if (!src.restrained())
message = "<B>[src]</B> claps."
m_type = 2
if ("flap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings."
m_type = 2
if ("aflap")
if (!src.restrained())
message = "<B>[src]</B> flaps his wings ANGRILY!"
m_type = 2
if ("custom")
var/input = input("Choose an emote to display.") as text|null
if (!input)
return
input = sanitize(input)
var/input2 = input("Is this a visible or hearable emote?") in list("Visible","Hearable")
if (input2 == "Visible")
m_type = 1
else if (input2 == "Hearable")
m_type = 2
else
alert("Unable to use this emote, must be either hearable or visible.")
return
message = "<B>[src]</B> [input]"
if ("twitch")
message = "<B>[src]</B> twitches violently."
m_type = 1
if ("twitch_s")
message = "<B>[src]</B> twitches."
m_type = 1
if ("nod")
message = "<B>[src]</B> nods."
m_type = 1
if ("glare")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> glares at [param]."
else
message = "<B>[src]</B> glares."
if ("stare")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> stares at [param]."
else
message = "<B>[src]</B> stares."
if ("look")
var/M = null
if (param)
for (var/mob/A in view(null, null))
if (param == A.name)
M = A
break
if (!M)
param = null
if (param)
message = "<B>[src]</B> looks at [param]."
else
message = "<B>[src]</B> looks."
m_type = 1
else
src << text("Invalid Emote: []", act)
if ((message && src.stat == 0))
if (m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
else
for(var/mob/O in hearers(src, null))
O.show_message(message, m_type)
return
+20
View File
@@ -0,0 +1,20 @@
/mob/living/silicon/hivebot/examine()
set src in oview()
usr << "\blue *---------*"
usr << text("\blue This is \icon[src] <B>[src.name]</B>!")
if (src.stat == 2)
usr << text("\red [src.name] is powered-down.")
if (src.bruteloss)
if (src.bruteloss < 75)
usr << text("\red [src.name] looks slightly dented")
else
usr << text("\red <B>[src.name] looks severely dented!</B>")
if (src.fireloss)
if (src.fireloss < 75)
usr << text("\red [src.name] looks slightly burnt!")
else
usr << text("\red <B>[src.name] looks severely burnt!</B>")
if (src.stat == 1)
usr << text("\red [src.name] doesn't seem to be responding.")
return
+57
View File
@@ -0,0 +1,57 @@
/obj/item/weapon/hive_module
name = "hive robot module"
icon = 'module.dmi'
icon_state = "std_module"
w_class = 2.0
item_state = "electronic"
flags = FPRINT|TABLEPASS | CONDUCT
var/list/modules = list()
/obj/item/weapon/hive_module/standard
name = "give standard robot module"
/obj/item/weapon/hive_module/engineering
name = "HiveBot engineering robot module"
/obj/item/weapon/hive_module/New()//Shit all the mods have
src.modules += new /obj/item/device/flash(src)
/obj/item/weapon/hive_module/standard/New()
..()
src.modules += new /obj/item/weapon/melee/baton(src)
src.modules += new /obj/item/weapon/extinguisher(src)
//var/obj/item/weapon/gun/mp5/M = new /obj/item/weapon/gun/mp5(src)
//M.weapon_lock = 0
//src.modules += M
/obj/item/weapon/hive_module/engineering/New()
src.modules += new /obj/item/weapon/extinguisher(src)
src.modules += new /obj/item/weapon/screwdriver(src)
src.modules += new /obj/item/weapon/weldingtool(src)
src.modules += new /obj/item/weapon/wrench(src)
src.modules += new /obj/item/device/analyzer(src)
src.modules += new /obj/item/device/flashlight(src)
var/obj/item/weapon/rcd/R = new /obj/item/weapon/rcd(src)
R.matter = 30
src.modules += R
src.modules += new /obj/item/device/t_scanner(src)
src.modules += new /obj/item/weapon/crowbar(src)
src.modules += new /obj/item/weapon/wirecutters(src)
src.modules += new /obj/item/device/multitool(src)
var/obj/item/stack/sheet/metal/M = new /obj/item/stack/sheet/metal(src)
M.amount = 50
src.modules += M
var/obj/item/stack/sheet/rglass/G = new /obj/item/stack/sheet/rglass(src)
G.amount = 50
src.modules += G
var/obj/item/weapon/cable_coil/W = new /obj/item/weapon/cable_coil(src)
W.amount = 50
src.modules += W
+506
View File
@@ -0,0 +1,506 @@
/mob/living/silicon/hivebot/New(loc,mainframe)
src << "\blue Your icons have been generated!"
updateicon()
if(mainframe)
dependent = 1
src.real_name = mainframe:name
src.name = src.real_name
else
src.real_name = "Robot [pick(rand(1, 999))]"
src.name = src.real_name
src.radio = new /obj/item/device/radio(src)
..()
/mob/living/silicon/hivebot/proc/pick_module()
if(src.module)
return
var/mod = input("Please, select a module!", "Robot", null, null) in list("Combat", "Engineering")
if(src.module)
return
switch(mod)
if("Combat")
src.module = new /obj/item/weapon/hive_module/standard(src)
if("Engineering")
src.module = new /obj/item/weapon/hive_module/engineering(src)
src.hands.icon_state = "malf"
updateicon()
/mob/living/silicon/hivebot/blob_act()
if (src.stat != 2)
src.bruteloss += 60
src.updatehealth()
return 1
return 0
/mob/living/silicon/hivebot/Stat()
..()
statpanel("Status")
if (src.client.statpanel == "Status")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/*
if(ticker.mode.name == "AI malfunction")
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
*/
stat(null, text("Charge Left: [src.energy]/[src.energy_max]"))
/mob/living/silicon/hivebot/restrained()
return 0
/mob/living/silicon/hivebot/ex_act(severity)
flick("flash", src.flash)
if (src.stat == 2 && src.client)
src.gib(1)
return
else if (src.stat == 2 && !src.client)
del(src)
return
var/b_loss = src.bruteloss
var/f_loss = src.fireloss
switch(severity)
if(1.0)
if (src.stat != 2)
b_loss += 100
f_loss += 100
src.gib(1)
return
if(2.0)
if (src.stat != 2)
b_loss += 60
f_loss += 60
if(3.0)
if (src.stat != 2)
b_loss += 30
src.bruteloss = b_loss
src.fireloss = f_loss
src.updatehealth()
/mob/living/silicon/hivebot/meteorhit(obj/O as obj)
for(var/mob/M in viewers(src, null))
M.show_message(text("\red [src] has been hit by [O]"), 1)
//Foreach goto(19)
if (src.health > 0)
src.bruteloss += 30
if ((O.icon_state == "flaming"))
src.fireloss += 40
src.updatehealth()
return
/mob/living/silicon/hivebot/bullet_act(flag)
/*
if (flag == PROJECTILE_BULLET)
if (src.stat != 2)
src.bruteloss += 60
src.updatehealth()
else if (flag == PROJECTILE_MEDBULLET)
if (src.stat != 2)
src.bruteloss += 30
src.updatehealth()
else if (flag == PROJECTILE_WEAKBULLET)
if (src.stat != 2)
src.bruteloss += 15
src.updatehealth()
else if (flag == PROJECTILE_MPBULLET)
if (src.stat != 2)
src.bruteloss += 20
src.updatehealth()
else if (flag == PROJECTILE_SLUG)
if (src.stat != 2)
src.bruteloss += 40
src.updatehealth()
else if (flag == PROJECTILE_BAG)
if (src.stat != 2)
src.bruteloss += 2
src.updatehealth()
else if (flag == PROJECTILE_TASER)
return
else if (flag == PROJECTILE_WAVE)
if (src.stat != 2)
src.bruteloss += 25
src.updatehealth()
return
else if(flag == PROJECTILE_LASER)
if (src.stat != 2)
src.bruteloss += 20
src.updatehealth()
else if(flag == PROJECTILE_PULSE)
if (src.stat != 2)
src.bruteloss += 40
src.updatehealth()
*/
return
/mob/living/silicon/hivebot/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
if ((!( yes ) || src.now_pushing))
return
src.now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(istype(tmob, /mob/living/carbon/human) && tmob.mutations & FAT)
if(prob(20))
for(var/mob/M in viewers(src, null))
if(M.client)
M << M << "\red <B>[src] fails to push [tmob]'s fat ass out of the way.</B>"
src.now_pushing = 0
//src.unlock_medal("That's No Moon, That's A Gourmand!", 1)
return
src.now_pushing = 0
..()
if (!istype(AM, /atom/movable))
return
if (!src.now_pushing)
src.now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
step(AM, t)
src.now_pushing = null
return
return
/mob/living/silicon/hivebot/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/weldingtool) && W:welding)
if (W:remove_fuel(0))
src.bruteloss -= 30
if(src.bruteloss < 0) src.bruteloss = 0
src.updatehealth()
src.add_fingerprint(user)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
else
user << "Need more welding fuel!"
return
/mob/living/silicon/hivebot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
if (M.a_intent == "grab")
if (M == src)
return
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab( M )
G.assailant = M
if (M.hand)
M.l_hand = G
else
M.r_hand = G
G.layer = 20
G.affecting = src
src.grabbed_by += G
G.synch()
playsound(src.loc, 'thudswoosh.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red [] has grabbed [] passively!", M, src), 1)
else if (M.a_intent == "hurt")
var/damage = rand(5, 10)
if (prob(90))
/*
if (M.class == "combat")
damage += 15
if(prob(20))
src.weakened = max(src.weakened,4)
src.stunned = max(src.stunned,4)
*/
playsound(src.loc, 'slash.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
if(prob(8))
flick("noise", src.flash)
src.bruteloss += damage
src.updatehealth()
else
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] took a swipe at []!</B>", M, src), 1)
return
else if (M.a_intent == "disarm")
if(!(src.lying))
var/randn = rand(1, 100)
if (randn <= 40)
src.stunned = 5
step(src,get_dir(M,src))
spawn(5) step(src,get_dir(M,src))
playsound(src.loc, 'slash.ogg', 50, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] has pushed back []!</B>", M, src), 1)
else
playsound(src.loc, 'slashmiss.ogg', 25, 1, -1)
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>[] attempted to push back []!</B>", M, src), 1)
return
/mob/living/silicon/hivebot/attack_hand(mob/user)
..()
return
/mob/living/silicon/hivebot/proc/allowed(mob/M)
//check if it doesn't require any access at all
if(src.check_access(null))
return 1
return 0
/mob/living/silicon/hivebot/proc/check_access(obj/item/weapon/card/id/I)
if(!istype(src.req_access, /list)) //something's very wrong
return 1
var/list/L = src.req_access
if(!L.len) //no requirements
return 1
if(!I || !istype(I, /obj/item/weapon/card/id) || !I.access) //not ID or no access
return 0
for(var/req in src.req_access)
if(!(req in I.access)) //doesn't have this access
return 0
return 1
/mob/living/silicon/hivebot/proc/updateicon()
src.overlays = null
if(src.stat == 0)
src.overlays += "eyes"
else
src.overlays -= "eyes"
/mob/living/silicon/hivebot/proc/installed_modules()
if(!src.module)
src.pick_module()
return
var/dat = "<HEAD><TITLE>Modules</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
dat += {"<A HREF='?src=\ref[src];mach_close=robotmod'>Close</A>
<BR>
<BR>
<B>Activated Modules</B>
<BR>
Module 1: [module_state_1 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_1]>[module_state_1]<A>" : "No Module"]<BR>
Module 2: [module_state_2 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_2]>[module_state_2]<A>" : "No Module"]<BR>
Module 3: [module_state_3 ? "<A HREF=?src=\ref[src];mod=\ref[module_state_3]>[module_state_3]<A>" : "No Module"]<BR>
<BR>
<B>Installed Modules</B><BR><BR>"}
for (var/obj in src.module.modules)
if(src.activated(obj))
dat += text("[obj]: <B>Activated</B><BR>")
else
dat += text("[obj]: <A HREF=?src=\ref[src];act=\ref[obj]>Activate</A><BR>")
/*
if(src.activated(obj))
dat += text("[obj]: \[<B>Activated</B> | <A HREF=?src=\ref[src];deact=\ref[obj]>Deactivate</A>\]<BR>")
else
dat += text("[obj]: \[<A HREF=?src=\ref[src];act=\ref[obj]>Activate</A> | <B>Deactivated</B>\]<BR>")
*/
src << browse(dat, "window=robotmod&can_close=0")
/mob/living/silicon/hivebot/Topic(href, href_list)
..()
if (href_list["mach_close"])
var/t1 = text("window=[href_list["mach_close"]]")
src.machine = null
src << browse(null, t1)
return
if (href_list["mod"])
var/obj/item/O = locate(href_list["mod"])
O.attack_self(src)
if (href_list["act"])
var/obj/item/O = locate(href_list["act"])
if(activated(O))
src << "Already activated"
return
if(!src.module_state_1)
src.module_state_1 = O
O.layer = 20
src.contents += O
else if(!src.module_state_2)
src.module_state_2 = O
O.layer = 20
src.contents += O
else if(!src.module_state_3)
src.module_state_3 = O
O.layer = 20
src.contents += O
else
src << "You need to disable a module first!"
src.installed_modules()
if (href_list["deact"])
var/obj/item/O = locate(href_list["deact"])
if(activated(O))
if(src.module_state_1 == O)
src.module_state_1 = null
src.contents -= O
else if(src.module_state_2 == O)
src.module_state_2 = null
src.contents -= O
else if(src.module_state_3 == O)
src.module_state_3 = null
src.contents -= O
else
src << "Module isn't activated."
else
src << "Module isn't activated"
src.installed_modules()
return
/mob/living/silicon/hivebot/proc/uneq_active()
if(isnull(src.module_active))
return
if(src.module_state_1 == src.module_active)
if (src.client)
src.client.screen -= module_state_1
src.contents -= module_state_1
src.module_active = null
src.module_state_1 = null
src.inv1.icon_state = "inv1"
else if(src.module_state_2 == src.module_active)
if (src.client)
src.client.screen -= module_state_2
src.contents -= module_state_2
src.module_active = null
src.module_state_2 = null
src.inv2.icon_state = "inv2"
else if(src.module_state_3 == src.module_active)
if (src.client)
src.client.screen -= module_state_3
src.contents -= module_state_3
src.module_active = null
src.module_state_3 = null
src.inv3.icon_state = "inv3"
/mob/living/silicon/hivebot/proc/activated(obj/item/O)
if(src.module_state_1 == O)
return 1
else if(src.module_state_2 == O)
return 1
else if(src.module_state_3 == O)
return 1
else
return 0
/mob/living/silicon/hivebot/proc/radio_menu()
var/dat = {"
<TT>
Microphone: [src.radio.broadcasting ? "<A href='byond://?src=\ref[src.radio];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];talk=1'>Disengaged</A>"]<BR>
Speaker: [src.radio.listening ? "<A href='byond://?src=\ref[src.radio];listen=0'>Engaged</A>" : "<A href='byond://?src=\ref[src.radio];listen=1'>Disengaged</A>"]<BR>
Frequency:
<A href='byond://?src=\ref[src.radio];freq=-10'>-</A>
<A href='byond://?src=\ref[src.radio];freq=-2'>-</A>
[format_frequency(src.radio.frequency)]
<A href='byond://?src=\ref[src.radio];freq=2'>+</A>
<A href='byond://?src=\ref[src.radio];freq=10'>+</A><BR>
-------
</TT>"}
src << browse(dat, "window=radio")
onclose(src, "radio")
return
/mob/living/silicon/hivebot/Move(a, b, flag)
if (src.buckled)
return
if (src.restrained())
src.pulling = null
var/t7 = 1
if (src.restrained())
for(var/mob/M in range(src, 1))
if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
t7 = null
if ((t7 && (src.pulling && ((get_dist(src, src.pulling) <= 1 || src.pulling.loc == src.loc) && (src.client && src.client.moving)))))
var/turf/T = src.loc
. = ..()
if (src.pulling && src.pulling.loc)
if(!( isturf(src.pulling.loc) ))
src.pulling = null
return
else
if(Debug)
diary <<"src.pulling disappeared? at [__LINE__] in mob.dm - src.pulling = [src.pulling]"
diary <<"REPORT THIS"
/////
if(src.pulling && src.pulling.anchored)
src.pulling = null
return
if (!src.restrained())
var/diag = get_dir(src, src.pulling)
if ((diag - 1) & diag)
else
diag = null
if ((get_dist(src, src.pulling) > 1 || diag))
if (ismob(src.pulling))
var/mob/M = src.pulling
var/ok = 1
if (locate(/obj/item/weapon/grab, M.grabbed_by))
if (prob(75))
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
if (istype(G, /obj/item/weapon/grab))
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [G.affecting] has been pulled from [G.assailant]'s grip by [src]"), 1)
del(G)
else
ok = 0
if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
ok = 0
if (ok)
var/t = M.pulling
M.pulling = null
step(src.pulling, get_dir(src.pulling.loc, T))
M.pulling = t
else
if (src.pulling)
step(src.pulling, get_dir(src.pulling.loc, T))
else
src.pulling = null
. = ..()
if ((src.s_active && !( s_active in src.contents ) ))
src.s_active.close(src)
return
/mob/living/silicon/hivebot/verb/cmd_return_mainframe()
set category = "Robot Commands"
set name = "Recall to Mainframe."
return_mainframe()
/mob/living/silicon/hivebot/proc/return_mainframe()
if(mainframe)
mainframe.return_to(src)
else
src << "\red You lack a dedicated mainframe!"
return
+46
View File
@@ -0,0 +1,46 @@
/mob/living/silicon/hivebot
name = "Robot"
icon = 'hivebot.dmi'
icon_state = "basic"
health = 80
var/health_max = 80
robot_talk_understand = 2
//HUD
var/obj/screen/cells = null
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
//3 Modules can be activated at any one time.
var/obj/item/weapon/robot_module/module = null
var/module_active = null
var/module_state_1 = null
var/module_state_2 = null
var/module_state_3 = null
var/obj/item/device/radio/radio = null
var/list/req_access = list(access_robotics)
var/energy = 4000
var/energy_max = 4000
var/jetpack = 0
var/mob/living/silicon/hive_mainframe/mainframe = null
var/dependent = 0
var/shell = 1
/mob/living/silicon/hive_mainframe
name = "Robot Mainframe"
voice_name = "synthesized voice"
icon_state = "hive_main"
health = 200
var/health_max = 200
robot_talk_understand = 2
anchored = 1
var/online = 1
var/mob/living/silicon/hivebot = null
var/hivebot_name = null
var/force_mind = 0
+250
View File
@@ -0,0 +1,250 @@
/obj/hud/proc/hivebot_hud()
src.adding = list( )
src.other = list( )
src.intents = list( )
src.mon_blo = list( )
src.m_ints = list( )
src.mov_int = list( )
src.vimpaired = list( )
src.darkMask = list( )
src.g_dither = new src.h_type( src )
src.g_dither.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.g_dither.name = "Mask"
src.g_dither.icon_state = "dither12g"
src.g_dither.layer = 18
src.g_dither.mouse_opacity = 0
src.alien_view = new src.h_type(src)
src.alien_view.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.alien_view.name = "Alien"
src.alien_view.icon_state = "alien"
src.alien_view.layer = 18
src.alien_view.mouse_opacity = 0
src.blurry = new src.h_type( src )
src.blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.blurry.name = "Blurry"
src.blurry.icon_state = "blurry"
src.blurry.layer = 17
src.blurry.mouse_opacity = 0
src.druggy = new src.h_type( src )
src.druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
src.druggy.name = "Druggy"
src.druggy.icon_state = "druggy"
src.druggy.layer = 17
src.druggy.mouse_opacity = 0
// station explosion cinematic
src.station_explosion = new src.h_type( src )
src.station_explosion.icon = 'station_explosion.dmi'
src.station_explosion.icon_state = "start"
src.station_explosion.layer = 20
src.station_explosion.mouse_opacity = 0
src.station_explosion.screen_loc = "1,3"
var/obj/screen/using
//Radio
using = new src.h_type( src )
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Generic overlays
using = new src.h_type(src) //Right hud bar
using.dir = SOUTH
using.icon = 'screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH to EAST+1,NORTH"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Lower hud bar
using.dir = EAST
using.icon = 'screen1_robot.dmi'
using.screen_loc = "WEST,SOUTH-1 to EAST,SOUTH-1"
using.layer = 19
src.adding += using
using = new src.h_type(src) //Corner Button
using.dir = NORTHWEST
using.icon = 'screen1_robot.dmi'
using.screen_loc = "EAST+1,SOUTH-1"
using.layer = 19
src.adding += using
//Module select
using = new src.h_type( src )
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new src.h_type( src )
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new src.h_type( src )
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new src.h_type( src )
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new src.h_type( src )
using.name = "arrowleft"
using.icon = 'screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = WEST
using.screen_loc = ui_iarrowleft
using.layer = 19
src.adding += using
using = new src.h_type( src )
using.name = "arrowright"
using.icon = 'screen1_robot.dmi'
using.icon_state = "s_arrow"
using.dir = EAST
using.screen_loc = ui_iarrowright
using.layer = 19
src.adding += using
//End of Intent
//Cell
mymob:cells = new /obj/screen( null )
mymob:cells.icon = 'screen1_robot.dmi'
mymob:cells.icon_state = "charge-empty"
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
//Health
mymob.healths = new /obj/screen( null )
mymob.healths.icon = 'screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
//Installed Module
mymob.hands = new /obj/screen( null )
mymob.hands.icon = 'screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_dropbutton
//Module Panel
using = new src.h_type( src )
using.name = "panel"
using.icon = 'screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_throw
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen(null)
mymob.throw_icon.icon = 'screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_hand
//Temp
mymob.bodytemp = new /obj/screen( null )
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
//does nothing (fire and oxy)
mymob.oxygen = new /obj/screen( null )
mymob.oxygen.icon = 'screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen( null )
mymob.fire.icon = 'screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen( null )
mymob.pullin.icon = 'screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull
mymob.blind = new /obj/screen( null )
mymob.blind.icon = 'screen1_robot.dmi'
mymob.blind.icon_state = "black"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1 to 15,15"
mymob.blind.layer = 0
mymob.flash = new /obj/screen( null )
mymob.flash.icon = 'screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.sleep = new /obj/screen( null )
mymob.sleep.icon = 'screen1_robot.dmi'
mymob.sleep.icon_state = "sleep0"
mymob.sleep.name = "sleep"
mymob.sleep.screen_loc = ui_sleep
mymob.rest = new /obj/screen( null )
mymob.rest.icon = 'screen1_robot.dmi'
mymob.rest.icon_state = "rest0"
mymob.rest.name = "rest"
mymob.rest.screen_loc = ui_rest
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel.overlays = null
mymob.zone_sel.overlays += image("icon" = 'zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list(mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.other
return
+229
View File
@@ -0,0 +1,229 @@
/mob/living/silicon/hivebot/Life()
set invisibility = 0
set background = 1
if (src.monkeyizing)
return
if (src.stat != 2)
use_power()
src.blinded = null
clamp_values()
handle_regular_status_updates()
if(client)
src.shell = 0
handle_regular_hud_updates()
update_items()
if(dependent)
mainframe_check()
update_canmove()
/mob/living/silicon/hivebot
proc
clamp_values()
stunned = max(min(stunned, 10),0)
paralysis = max(min(paralysis, 1), 0)
weakened = max(min(weakened, 15), 0)
sleeping = max(min(sleeping, 1), 0)
bruteloss = max(bruteloss, 0)
toxloss = 0
oxyloss = 0
fireloss = max(fireloss, 0)
use_power()
if (src.energy)
if(src.energy <= 0)
death()
else if (src.energy <= 10)
src.module_active = null
src.module_state_1 = null
src.module_state_2 = null
src.module_state_3 = null
src.energy -=1
else
if(src.module_state_1)
src.energy -=1
if(src.module_state_2)
src.energy -=1
if(src.module_state_3)
src.energy -=1
src.energy -=1
src.blinded = 0
src.stat = 0
else
src.blinded = 1
src.stat = 1
update_canmove()
if(paralysis || stunned || weakened || buckled) canmove = 0
else canmove = 1
handle_regular_status_updates()
health = src.health_max - (fireloss + bruteloss)
if(health <= 0)
death()
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened) //Stunned etc.
if (src.stunned > 0)
src.stunned--
src.stat = 0
if (src.weakened > 0)
src.weakened--
src.lying = 0
src.stat = 0
if (src.paralysis > 0)
src.paralysis--
src.blinded = 0
src.lying = 0
src.stat = 1
else //Not stunned.
src.lying = 0
src.stat = 0
else //Dead.
src.blinded = 1
src.stat = 2
src.density = !( src.lying )
if ((src.sdisabilities & 1))
src.blinded = 1
if ((src.sdisabilities & 4))
src.ear_deaf = 1
if (src.eye_blurry > 0)
src.eye_blurry--
src.eye_blurry = max(0, src.eye_blurry)
if (src.druggy > 0)
src.druggy--
src.druggy = max(0, src.druggy)
return 1
handle_regular_hud_updates()
if (src.stat == 2 || src.mutations & XRAY)
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
else if (src.stat != 2)
src.sight &= ~SEE_MOBS
src.sight &= ~SEE_TURFS
src.sight &= ~SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
if (src.healths)
if (src.stat != 2)
switch(health)
if(health_max to INFINITY)
src.healths.icon_state = "health0"
if(src.health_max*0.80 to src.health_max)
src.healths.icon_state = "health1"
if(src.health_max*0.60 to src.health_max*0.80)
src.healths.icon_state = "health2"
if(src.health_max*0.40 to src.health_max*0.60)
src.healths.icon_state = "health3"
if(src.health_max*0.20 to src.health_max*0.40)
src.healths.icon_state = "health4"
if(0 to health_max*0.20)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
else
src.healths.icon_state = "health7"
if (src.cells)
switch(src.energy)
if(src.energy_max*0.75 to INFINITY)
src.cells.icon_state = "charge4"
if(0.5*src.energy_max to 0.75*src.energy_max)
src.cells.icon_state = "charge3"
if(0.25*src.energy_max to 0.5*src.energy_max)
src.cells.icon_state = "charge2"
if(0 to 0.25*src.energy_max)
src.cells.icon_state = "charge1"
else
src.cells.icon_state = "charge0"
switch(src.bodytemperature) //310.055 optimal body temp
if(335 to INFINITY)
src.bodytemp.icon_state = "temp2"
if(320 to 335)
src.bodytemp.icon_state = "temp1"
if(300 to 320)
src.bodytemp.icon_state = "temp0"
if(260 to 300)
src.bodytemp.icon_state = "temp-1"
else
src.bodytemp.icon_state = "temp-2"
if(src.pullin) src.pullin.icon_state = "pull[src.pulling ? 1 : 0]"
src.client.screen -= src.hud_used.blurry
src.client.screen -= src.hud_used.druggy
src.client.screen -= src.hud_used.vimpaired
if ((src.blind && src.stat != 2))
if ((src.blinded))
src.blind.layer = 18
else
src.blind.layer = 0
if (src.disabilities & 1)
src.client.screen += src.hud_used.vimpaired
if (src.eye_blurry)
src.client.screen += src.hud_used.blurry
if (src.druggy)
src.client.screen += src.hud_used.druggy
if (src.stat != 2)
if (src.machine)
if (!( src.machine.check_eye(src) ))
src.reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
update_items()
if (src.client)
src.client.screen -= src.contents
src.client.screen += src.contents
if(src.module_state_1)
src.module_state_1:screen_loc = ui_inv1
if(src.module_state_2)
src.module_state_2:screen_loc = ui_inv2
if(src.module_state_3)
src.module_state_3:screen_loc = ui_inv3
mainframe_check()
if(mainframe)
if(mainframe.stat == 2)
mainframe.return_to(src)
else
death()
+15
View File
@@ -0,0 +1,15 @@
/mob/living/silicon/hivebot/Login()
..()
update_clothing()
if (!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
src.verbs += /mob/proc/ghost
if(src.real_name == "Hiveborg")
src.real_name += " "
src.real_name += "-[rand(1, 999)]"
src.name = src.real_name
return
+178
View File
@@ -0,0 +1,178 @@
/mob/living/silicon/hive_mainframe/New()
Namepick()
/mob/living/silicon/hive_mainframe/Life()
if (src.stat == 2)
return
else
src.updatehealth()
if (src.health <= 0)
death()
return
if(src.force_mind)
if(!src.mind)
if(src.client)
src.mind = new
src.mind.key = src.key
src.mind.current = src
src.force_mind = 0
/mob/living/silicon/hive_mainframe/Stat()
..()
statpanel("Status")
if (src.client.statpanel == "Status")
if(emergency_shuttle.online && emergency_shuttle.location < 2)
var/timeleft = emergency_shuttle.timeleft()
if (timeleft)
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
/*
if(ticker.mode.name == "AI malfunction")
stat(null, "Points left until the AI takes over: [AI_points]/[AI_points_win]")
*/
/mob/living/silicon/hive_mainframe/updatehealth()
if (src.nodamage == 0)
src.health = 100 - src.fireloss - src.bruteloss
else
src.health = 100
src.stat = 0
/mob/living/silicon/hive_mainframe/death(gibbed)
src.stat = 2
src.canmove = 0
if(src.blind)
src.blind.layer = 0
src.sight |= SEE_TURFS
src.sight |= SEE_MOBS
src.sight |= SEE_OBJS
src.see_in_dark = 8
src.see_invisible = 2
src.lying = 1
src.icon_state = "hive_main-crash"
var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
mind.store_memory("Time of death: [tod]", 0)
if (src.key)
spawn(50)
if(src.key && src.stat == 2)
src.verbs += /mob/proc/ghost
return ..(gibbed)
/mob/living/silicon/hive_mainframe/say_understands(var/other)
if (istype(other, /mob/living/carbon/human))
return 1
if (istype(other, /mob/living/silicon/robot))
return 1
if (istype(other, /mob/living/silicon/hivebot))
return 1
if (istype(other, /mob/living/silicon/ai))
return 1
return ..()
/mob/living/silicon/hive_mainframe/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
return "queries, \"[text]\"";
else if (ending == "!")
return "declares, \"[copytext(text, 1, length(text))]\"";
return "states, \"[text]\"";
/mob/living/silicon/hive_mainframe/proc/return_to(var/mob/user)
if(user.mind)
user.mind.transfer_to(src)
spawn(20)
user:shell = 1
user:real_name = "Robot [pick(rand(1, 999))]"
user:name = user:real_name
return
/mob/living/silicon/hive_mainframe/verb/cmd_deploy_to()
set category = "Mainframe Commands"
set name = "Deploy to shell."
deploy_to()
/mob/living/silicon/hive_mainframe/verb/deploy_to()
if(usr.stat == 2)
usr << "You can't deploy because you are dead!"
return
var/list/bodies = new/list()
for(var/mob/living/silicon/hivebot/H in world)
if(H.z == src.z)
if(H.shell)
if(!H.stat)
bodies += H
var/target_shell = input(usr, "Which body to control?") as null|anything in bodies
if (!target_shell)
return
else if(src.mind)
spawn(30)
target_shell:mainframe = src
target_shell:dependent = 1
target_shell:real_name = src.name
target_shell:name = target_shell:real_name
src.mind.transfer_to(target_shell)
return
/client/proc/MainframeMove(n,direct,var/mob/living/silicon/hive_mainframe/user)
return
/obj/hud/proc/hive_mainframe_hud()
return
/mob/living/silicon/hive_mainframe/Login()
..()
update_clothing()
for(var/S in src.client.screen)
del(S)
src.flash = new /obj/screen( null )
src.flash.icon_state = "blank"
src.flash.name = "flash"
src.flash.screen_loc = "1,1 to 15,15"
src.flash.layer = 17
src.blind = new /obj/screen( null )
src.blind.icon_state = "black"
src.blind.name = " "
src.blind.screen_loc = "1,1 to 15,15"
src.blind.layer = 0
src.client.screen += list( src.blind, src.flash )
if(!isturf(src.loc))
src.client.eye = src.loc
src.client.perspective = EYE_PERSPECTIVE
if (src.stat == 2)
src.verbs += /mob/proc/ghost
return
/mob/living/silicon/hive_mainframe/proc/Namepick()
var/randomname = pick(ai_names)
var/newname = input(src,"You are the a Mainframe Unit. Would you like to change your name to something else?", "Name change",randomname)
if (length(newname) == 0)
newname = randomname
if (newname)
if (length(newname) >= 26)
newname = copytext(newname, 1, 26)
newname = dd_replacetext(newname, ">", "'")
src.real_name = newname
src.name = newname
+18
View File
@@ -0,0 +1,18 @@
/mob/living/silicon/hivebot/say_understands(var/other)
if (istype(other, /mob/living/silicon/ai))
return 1
if (istype(other, /mob/living/carbon/human))
return 1
if (istype(other, /mob/living/silicon/robot))
return 1
return ..()
/mob/living/silicon/hivebot/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
return "queries, \"[text]\"";
else if (ending == "!")
return "declares, \"[copytext(text, 1, length(text))]\"";
return "states, \"[text]\"";