Add borg headlamp, add movement states for surgeon/miner bot, add jetpack overlay to all miner borgs

This commit is contained in:
Markolie
2015-07-30 19:33:49 +02:00
parent 267a95c327
commit c2cbaa7627
13 changed files with 87 additions and 49 deletions
@@ -51,6 +51,7 @@
update_canmove()
if(camera)
camera.status = 0
update_headlamp(1) //So borg lights are disabled when killed.
if(in_contents_of(/obj/machinery/recharge_station))//exit the recharge station
var/obj/machinery/recharge_station/RC = loc
@@ -60,8 +61,7 @@
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
updateicon()
update_fire()
update_icons()
tod = worldtime2text() //weasellos time of death patch
if(mind) mind.store_memory("Time of death: [tod]", 0)
@@ -66,7 +66,7 @@
//Some tidying-up.
flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'Nanotrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'"
updateicon()
update_icons()
/mob/living/silicon/robot/drone/init()
laws = new /datum/ai_laws/drone()
@@ -80,7 +80,7 @@
real_name = "maintenance drone ([rand(100,999)])"
name = real_name
/mob/living/silicon/robot/drone/updateicon()
/mob/living/silicon/robot/drone/update_icons()
overlays.Cut()
if(stat == 0)
@@ -15,11 +15,7 @@
if(istype(O,/obj/item/borg/sight))
var/obj/item/borg/sight/S = O
sight_mode &= ~S.sight_mode
else if(istype(O, /obj/item/device/flashlight))
var/obj/item/device/flashlight/F = O
if(F.on)
F.on = 0
F.update_brightness(src)
if(client)
client.screen -= O
contents -= O
@@ -42,7 +42,8 @@
if (is_component_functioning("power cell") && cell)
if(src.cell.charge <= 0)
uneq_all()
src.stat = 1
update_headlamp(1)
src.stat = UNCONSCIOUS
has_power = 0
for(var/V in components)
var/datum/robot_component/C = components[V]
@@ -63,6 +64,9 @@
for(var/V in components)
var/datum/robot_component/C = components[V]
C.consume_power()
var/amt = Clamp((lamp_intensity - 2) * 2,1,cell.charge) //Always try to use at least one charge per tick, but allow it to completely drain the cell.
cell.use(amt) //Usage table: 1/tick if off/lowest setting, 4 = 4/tick, 6 = 8/tick, 8 = 12/tick, 10 = 16/tick
if(!is_component_functioning("actuator"))
Paralyse(3)
@@ -71,7 +75,8 @@
has_power = 1
else
uneq_all()
src.stat = 1
src.stat = UNCONSCIOUS
update_headlamp(1)
Paralyse(3)
/mob/living/silicon/robot/proc/handle_regular_status_updates()
@@ -324,7 +329,7 @@
src.module_state_2:screen_loc = ui_inv2
if(src.module_state_3)
src.module_state_3:screen_loc = ui_inv3
updateicon()
update_icons()
/mob/living/silicon/robot/proc/process_locks()
if(weapon_lock)
@@ -358,8 +363,6 @@
overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
if(on_fire)
overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing")
update_icons()
return
/mob/living/silicon/robot/fire_act()
if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them
+52 -21
View File
@@ -22,6 +22,7 @@ var/list/robot_verbs_default = list(
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
var/obj/screen/lamp_button = null
var/shown_robot_modules = 0 //Used to determine whether they have the module menu shown or not
var/obj/screen/robot_modules_background
@@ -74,6 +75,12 @@ var/list/robot_verbs_default = list(
var/braintype = "Cyborg"
var/base_icon = ""
var/crisis = 0
var/lamp_max = 10 //Maximum brightness of a borg lamp. Set as a var for easy adjusting.
var/lamp_intensity = 0 //Luminosity of the headlamp. 0 is off. Higher settings than the minimum require power.
var/lamp_recharging = 0 //Flag for if the lamp is on cooldown after being forcibly disabled.
var/jetpackoverlay = 0
var/obj/item/borg/sight/hud/sec/sechud = null
var/obj/item/borg/sight/hud/med/healthhud = null
@@ -92,7 +99,8 @@ var/list/robot_verbs_default = list(
robot_modules_background.layer = 19 //Objects that appear on screen are on layer 20, UI should be just below it.
ident = rand(1, 999)
updatename("Default")
updateicon()
update_icons()
update_headlamp()
radio = new /obj/item/device/radio/borg(src)
common_radio = radio
@@ -364,7 +372,7 @@ var/list/robot_verbs_default = list(
custom_name = newname
updatename()
updateicon()
update_icons()
/mob/living/silicon/robot/verb/cmd_robot_alerts()
set category = "Robot Commands"
@@ -683,7 +691,7 @@ var/list/robot_verbs_default = list(
if(cell)
user << "You close the cover."
opened = 0
updateicon()
update_icons()
else if(wiresexposed && wires.IsAllCut())
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
if(!mmi)
@@ -735,7 +743,7 @@ var/list/robot_verbs_default = list(
else
user << "You open the cover."
opened = 1
updateicon()
update_icons()
else if (istype(W, /obj/item/weapon/stock_parts/cell) && opened) // trying to put a cell inside
var/datum/robot_component/C = components["power cell"]
@@ -765,14 +773,14 @@ var/list/robot_verbs_default = list(
else if(istype(W, /obj/item/weapon/screwdriver) && opened && !cell) // haxing
wiresexposed = !wiresexposed
user << "The wires have been [wiresexposed ? "exposed" : "unexposed"]"
updateicon()
update_icons()
else if(istype(W, /obj/item/weapon/screwdriver) && opened && cell) // radio
if(radio)
radio.attackby(W,user)//Push it to the radio to let it handle everything
else
user << "Unable to locate a radio."
updateicon()
update_icons()
else if(istype(W, /obj/item/device/encryptionkey/) && opened)
if(radio)//sanityyyyyy
@@ -789,7 +797,7 @@ var/list/robot_verbs_default = list(
if(allowed(usr))
locked = !locked
user << "You [ locked ? "lock" : "unlock"] [src]'s interface."
updateicon()
update_icons()
else
user << "\red Access denied."
@@ -871,7 +879,7 @@ var/list/robot_verbs_default = list(
if(src.module && istype(src.module, /obj/item/weapon/robot_module/medical))
for(var/obj/item/weapon/borg_defib/F in src.module.modules)
F.safety = 0
updateicon()
update_icons()
return
/mob/living/silicon/robot/verb/unlock_own_cover()
@@ -882,7 +890,7 @@ var/list/robot_verbs_default = list(
switch(alert("You can not lock your cover again, are you sure?\n (You can still ask for a human to lock it)", "Unlock Own Cover", "Yes", "No"))
if("Yes")
locked = 0
updateicon()
update_icons()
usr << "You unlock your cover."
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
@@ -991,7 +999,7 @@ var/list/robot_verbs_default = list(
user.put_in_active_hand(cell)
user << "You remove \the [cell]."
cell = null
updateicon()
update_icons()
if(!opened && (!istype(user, /mob/living/silicon)))
if (user.a_intent == "help")
@@ -1023,12 +1031,10 @@ var/list/robot_verbs_default = list(
return 1
return 0
/mob/living/silicon/robot/proc/updateicon()
/mob/living/silicon/robot/update_icons()
overlays.Cut()
if(stat == 0)
overlays += "eyes"
overlays.Cut()
if(stat != DEAD && !(paralysis || stunned || weakened)) //Not dead, not stunned.
overlays += "eyes-[icon_state]"
else
overlays -= "eyes"
@@ -1059,16 +1065,16 @@ var/list/robot_verbs_default = list(
icon_state = "[base_icon]-roll"
else
icon_state = base_icon
return
/mob/living/silicon/robot/proc/updatefire()
return
if(jetpackoverlay)
overlays += "minerjetpack-[icon_state]"
update_fire()
//Call when target overlay should be added/removed
/mob/living/silicon/robot/update_targeted()
if(!targeted_by && target_locked)
qdel(target_locked)
updateicon()
update_icons()
if (targeted_by && target_locked)
overlays += target_locked
@@ -1189,6 +1195,32 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/proc/radio_menu()
radio.interact(src)//Just use the radio's Topic() instead of bullshit special-snowflake code
/mob/living/silicon/robot/proc/control_headlamp()
if(stat || lamp_recharging)
src << "<span class='danger'>This function is currently offline.</span>"
return
//Some sort of magical "modulo" thing which somehow increments lamp power by 2, until it hits the max and resets to 0.
lamp_intensity = (lamp_intensity+2) % (lamp_max+2)
src << "[lamp_intensity ? "Headlamp power set to Level [lamp_intensity/2]" : "Headlamp disabled."]"
update_headlamp()
/mob/living/silicon/robot/proc/update_headlamp(var/turn_off = 0, var/cooldown = 100)
set_light(0)
if(lamp_intensity && (turn_off || stat))
src << "<span class='danger'>Your headlamp has been deactivated.</span>"
lamp_intensity = 0
lamp_recharging = 1
spawn(cooldown) //10 seconds by default, if the source of the deactivation does not keep stat that long.
lamp_recharging = 0
else
set_light(light_range + lamp_intensity)
if(lamp_button)
lamp_button.icon_state = "lamp[lamp_intensity]"
update_icons()
/mob/living/silicon/robot/Move(a, b, flag)
@@ -1309,8 +1341,7 @@ var/list/robot_verbs_default = list(
lockcharge = null
return
overlays -= "eyes"
updateicon()
update_icons()
if (triesleft >= 1)
var/choice = input("Look at your icon - is this what you want?") in list("Yes","No")
@@ -83,7 +83,6 @@
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/weapon/melee/baton/loaded(src)
src.modules += new /obj/item/weapon/extinguisher(src)
@@ -103,7 +102,6 @@
)
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/device/healthanalyzer/advanced(src)
src.modules += new /obj/item/device/reagent_scanner/adv(src)
@@ -153,7 +151,6 @@
)
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/rcd/borg(src)
@@ -203,7 +200,6 @@
New()
src.modules += new /obj/item/device/flashlight/seclite(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/weapon/restraints/handcuffs/cable/zipties/cyborg(src)
src.modules += new /obj/item/weapon/melee/baton/loaded/robot(src)
@@ -219,7 +215,6 @@
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/weapon/soap/nanotrasen(src)
src.modules += new /obj/item/weapon/storage/bag/trash/cyborg(src)
@@ -239,7 +234,6 @@
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
src.modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src)
@@ -309,7 +303,6 @@
New()
src.modules += new /obj/item/device/flashlight/lantern(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/borg/sight/meson(src)
src.modules += new /obj/item/weapon/wrench(src)
@@ -327,7 +320,6 @@
/obj/item/weapon/robot_module/deathsquad/New()
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/borg/sight/thermal(src)
src.modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
src.modules += new /obj/item/weapon/gun/energy/pulse_rifle/cyborg(src)
@@ -341,7 +333,6 @@
/obj/item/weapon/robot_module/syndicate/New()
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/weapon/melee/energy/sword/cyborg(src)
src.modules += new /obj/item/weapon/gun/energy/printer(src)
src.modules += new /obj/item/weapon/gun/projectile/revolver/grenadelauncher/multi/cyborg(src)
@@ -356,7 +347,6 @@
name = "combat robot module"
New()
src.modules += new /obj/item/device/flashlight(src)
src.modules += new /obj/item/device/flash/cyborg(src)
src.modules += new /obj/item/borg/sight/thermal(src)
src.modules += new /obj/item/weapon/gun/energy/laser/cyborg(src)